Distributed data storage method and controller

By obtaining logs to determine data intimacy and optimize data layout, it solves the problem of high migration costs in distributed storage and improves efficiency and balance.

WO2024217453A1PCT designated stage expired Publication Date: 2024-10-24HUAWEI TECH CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
PCT/CN2024/088300
Authority / Receiving Office
WO · WO
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-04-20
Filing Date
2024-04-17
Publication Date
2024-10-24

AI Technical Summary

Technical Problem

In distributed storage scenarios, unreasonable data storage leads to increased migration costs during transaction execution and affects efficiency.

Method used

Determine the intimacy between data by obtaining logs, optimize data layout, reduce the number of data migrations, reduce migration costs, and improve operating performance.

Benefits of technology

It effectively reduces data migration costs, improves transaction execution efficiency, and ensures the rationality of data distribution and load balancing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN2024088300_24102024_PF_FP_ABST
    Figure CN2024088300_24102024_PF_FP_ABST
Patent Text Reader

Abstract

Embodiments of the present application provide a distributed data storage method and a controller. The method comprises: acquiring a log, wherein the log indicates N pieces of data involved in M historical tasks executed by a server cluster, M is a positive integer, and the N pieces of data are stored in the server cluster in a distributed manner; determining the closeness among the N pieces of data according to the log, wherein the closeness corresponding to any two pieces of data among the N pieces of data is used for indicating the possibility that the two pieces of data are involved in a same task, and N is an integer greater than 1; and updating storage positions of the N pieces of data according to the closeness among the N pieces of data. The solution of the embodiments of the present application implements reasonable storage of data, thereby improving the operation performance.
Need to check novelty before this filing date? Find Prior Art

Description

Data distributed storage method and controller

[0001] This application claims priority to the Chinese patent application filed with the State Intellectual Property Office of China on April 20, 2023, with application number 202310460198.0, and the priority of the Chinese patent application entitled “Method and Controller for Distributed Data Storage”. Technical Field

[0002] Embodiments of the present application relate to the field of data processing technology, and more specifically, to a method and controller for distributed data storage. Background Art

[0003] In distributed storage scenarios, data is stored across different devices. When executing a distributed transaction, the data involved may be stored on different devices, and it is usually necessary to aggregate the data involved in the transaction onto a single device. Improper data storage methods can increase migration costs during transaction execution, impacting transaction efficiency. For example, distributed databases typically have data volumes exceeding millions, and query transactions typically exceed tens of thousands, with the overall data volume reaching hundreds of millions. In this case, an inappropriate data storage method can significantly increase migration costs and severely impact transaction efficiency.

[0004] How to achieve reasonable storage of data has become an urgent problem to be solved.

[0005] Summary of the Invention

[0006] The embodiments of the present application provide a method and controller for distributed data storage, which are conducive to achieving reasonable storage of data, thereby improving operating performance.

[0007] In a first aspect, a method for distributed data storage is provided, comprising: obtaining a log indicating N data involved in M ​​historical tasks executed by a server cluster, where M is a positive integer, and the N data are distributedly stored in the server cluster; determining the intimacy between the N data based on the log, where the intimacy corresponding to any two of the N data is used to indicate the possibility that the two data are involved in the same task, where N is an integer greater than 1; and updating the storage location of the N data based on the intimacy between the N data.

[0008] In the embodiments of the present application, the intimacy between data is determined based on logs, and then the data layout, i.e., the storage location corresponding to the data, is determined based on the intimacy. This helps reduce the communication costs caused by data migration during task execution, lowering migration costs and thus improving operational performance. For example, multiple data items that are likely to be involved in the same task can be stored in the same storage location, i.e., on the same server, whenever possible. This can reduce the number of data migrations during task execution, reduce migration costs, and thus improve the processing efficiency of the task.

[0009] In combination with the first aspect, in certain implementations of the first aspect, determining the intimacy between N data based on the log includes: determining the intimacy between the N data based on the number of times the N data are involved in the same historical task among M historical tasks.

[0010] In an embodiment of the present application, the intimacy between two data is determined based on the number of times the two data involve the same historical task in the log. This solution is simple and efficient, which is conducive to quickly determining the intimacy relationship, thereby improving processing efficiency. Moreover, the intimacy relationship can be updated as the log changes, so that the intimacy relationship can more accurately reflect the current environment, which is conducive to the subsequent realization of more reasonable data distribution.

[0011] In combination with the first aspect, in certain implementations of the first aspect, the intimacy corresponding to any two data among the N data is positively correlated with the number of times the two data are involved in the same historical task among the M historical tasks.

[0012] That is, the more times any two data are involved in the same historical task, the higher the intimacy corresponding to the two data.

[0013] In combination with the first aspect, in certain implementations of the first aspect, the storage location of N data is updated according to the intimacy between the N data, including: updating the storage location of the N data according to a first storage scheme, the first storage scheme indicates the target storage location of the N data in P servers in the server cluster, P is an integer greater than 1, the statistical value of the intimacy between the P servers in the first storage scheme is less than or equal to a first threshold, and the intimacy between two of the P servers in the first storage scheme is based on the intimacy between the data corresponding to one of the two servers and the data corresponding to the other server.

[0014] For example, if each of the two servers corresponds to a piece of data, the intimacy between the two servers may be the intimacy between the data corresponding to one of the two servers and the data corresponding to the other server.

[0015] For example, if at least one of the two servers corresponds to multiple data, the intimacy between the two servers may be the sum of the intimacy between the data corresponding to one of the two servers and the data corresponding to the other server.

[0016] For example, when P>2, the statistical value of the intimacy between the P servers may be the average or sum of the intimacy between the P servers. When P=2, the statistical value of the intimacy between the P servers may be the intimacy between the two servers themselves.

[0017] In an embodiment of the present application, the statistical value of the intimacy between P servers in the first storage scheme is less than or equal to the first threshold value. This is conducive to storing data with higher intimacy in the same server, reducing the data migration cost during task execution, and thus improving the execution efficiency of the task.

[0018] In combination with the first aspect, in certain implementations of the first aspect, the first storage scheme is an element in a set consisting of multiple storage schemes, each of the multiple storage schemes indicates a different storage location of N data in P servers, and the first threshold is the minimum value of the statistical value of the intimacy between P servers in other storage schemes among the multiple storage schemes except the first storage scheme.

[0019] Each of the plurality of storage schemes indicates a corresponding relationship between the N data and the P servers, that is, indicates a storage location of the N data in the P servers. Different storage schemes indicate different corresponding relationships.

[0020] In combination with the first aspect, in certain implementations of the first aspect, the storage location of N data is updated according to the intimacy between the N data, including: sending scheduling information to a first server in a server cluster and a second server in a server cluster according to the intimacy between the N data, the scheduling information indicating that the first data stored in the first server among the N data is moved to the second server.

[0021] In combination with the first aspect, in certain implementations of the first aspect, the storage locations of N data are updated according to the intimacy between the N data, including: determining the target storage location of each data with the goal of making the number of data stored on P servers the same and the statistical value of the intimacy between the P servers minimized.

[0022] In an embodiment of the present application, the target storage location of each data is determined with the goal of making the amount of data stored on P servers the same, which is conducive to ensuring load balancing on each server and achieving balanced storage. Determining the target storage location of the N data with the goal of minimizing the intimacy between the P servers is conducive to ensuring that data with higher intimacy is stored on the same server, reducing the cost of data migration during task execution, thereby improving the efficiency of task execution. In other words, the solution of the embodiment of the present application is conducive to reducing the cost of data migration during task execution while ensuring balanced storage, thereby improving the efficiency of task execution.

[0023] In combination with the first aspect, in certain implementations of the first aspect, determining the intimacy between N data based on the log includes: constructing a first intimacy relationship graph based on the log, each of the N nodes in the first intimacy relationship graph corresponds to one data among the N data, and the weight of the edge between two nodes in the first intimacy relationship graph is used to indicate the intimacy between the two data corresponding to the two nodes.

[0024] For example, the weight of an edge between two nodes in the first intimacy relationship graph may be based on the number of times two data corresponding to the two nodes are simultaneously involved in the log.

[0025] For example, the weight of the edge between two nodes in the first intimacy relationship graph is positively correlated with the number of times the two data corresponding to the two nodes are simultaneously involved in the log.

[0026] In an embodiment of the present application, a first intimacy relationship graph can be constructed based on the log, and the intimacy relationship between different data can be represented in the form of a weighted graph. The graph construction scheme is simple and effective, which is conducive to improving processing efficiency.

[0027] In combination with the first aspect, in certain implementations of the first aspect, a first intimacy relationship graph is constructed based on the log, including: constructing a second intimacy relationship graph based on the log, each of the N nodes in the second intimacy relationship graph corresponds to one of the N data, and in the process of constructing the second intimacy relationship graph, an edge is connected between the nodes corresponding to the data involved in the mth historical task in the M historical tasks, m=1,2,…M; determining the first intimacy relationship graph based on the second intimacy relationship graph, each of the N nodes in the second intimacy relationship graph corresponds to a node in the first intimacy relationship graph, and the weight of the edge between two nodes in the first intimacy relationship graph is based on the number of edges between the corresponding two nodes in the second intimacy relationship graph.

[0028] Exemplarily, the weight of an edge between two nodes among the multiple nodes in the first intimacy relationship graph may be positively correlated with the number of edges between the corresponding two nodes in the second intimacy relationship graph.

[0029] According to the solution of the embodiment of the present application, by constructing an edge between two nodes to indicate that the data corresponding to the two nodes involves the same historical task in the log, the intimacy between N data is obtained. This method can achieve rapid modeling, that is, it increases the speed of determining intimacy. At the same time, during the construction of the second intimacy relationship graph, the number of edges between nodes changes as the data involved in different historical tasks in the log changes, which is conducive to ensuring the authenticity of the intimacy between the data.

[0030] In combination with the first aspect, in certain implementations of the first aspect, the P subgraphs of the first intimacy relationship graph correspond to P servers respectively, and the P subgraphs are obtained by dividing the first intimacy relationship graph with the goal of making the number of nodes in the P subgraphs the same and the statistical value of the weights of the edges between the P subgraphs minimized. In the P servers, the target storage location of each data is the server corresponding to the subgraph to which the node corresponding to each data in the P subgraph belongs.

[0031] In an embodiment of the present application, data distribution can be determined by graph segmentation, that is, the data distribution problem is planned as a graph segmentation problem, so that the data distribution can be determined by the graph segmentation solution method, which is conducive to improving the solution efficiency. Specifically, the graph is segmented with the goal of making the number of nodes in the subgraph the same and the weight of the edges between different subgraphs the minimum, and P subgraphs correspond to P servers respectively. Graph segmentation with the goal of making the number of nodes in the subgraph the same is conducive to ensuring load balancing on each server and achieving balanced storage. Graph segmentation with the goal of minimizing the weight of the edges between different subgraphs is conducive to ensuring that data with higher intimacy is stored in the same server, reducing the data migration cost during task execution, thereby improving the execution efficiency of the task.

[0032] In combination with the first aspect, in certain implementations of the first aspect, the P subgraphs of the second intimacy relationship graph correspond to P servers respectively, and the P subgraphs are obtained by dividing the second intimacy relationship graph with the goal of making the number of nodes in the P subgraphs the same and the statistical value of the number of edges between the P subgraphs minimized. In the P servers, the target storage location of each data is the server corresponding to the subgraph to which the node corresponding to each data in the P subgraph belongs.

[0033] In combination with the first aspect, in certain implementations of the first aspect, partitioning the first intimacy relationship graph with the goal of making the number of nodes in the P subgraphs the same and the statistical value of the weights of the edges between the P subgraphs minimized is implemented based on a quantum heuristic algorithm.

[0034] In conjunction with the first aspect, in certain implementations of the first aspect, P=2, and the objective function of the quantum heuristic algorithm satisfies the following formula:

[0035] Among them, s i is the i-th spin variable among N spin variables, s j is the jth spin variable among N spin variables. N spin variables correspond to N data respectively. The value of the spin variable is 1 or -1. The data corresponding to the spin variables with the same value belong to the same subgraph. i,j Represents the relationship between the i-th data and the j-th data, J i,j Determined based on the intimacy between the i-th data and the j-th data.

[0036] In combination with the first aspect, in certain implementations of the first aspect, the first intimacy relationship graph is represented by a matrix, the matrix including N rows and N columns, each of the N rows corresponding to a node in the first intimacy relationship graph, each of the N columns corresponding to a node in the first intimacy relationship graph, and each element in the matrix is ​​used to represent the weight of the edge between the node corresponding to the row where each element is located and the node corresponding to the column where each element is located.

[0037] In an embodiment of the present application, the first intimacy relationship graph can be represented by a matrix, and the elements in the matrix are the weights of the edges in the first intimacy relationship graph. In this way, when performing graph segmentation, calculations can be performed based on the matrix, which is conducive to improving the solution speed.

[0038] In a second aspect, a controller is provided, comprising: a processor, configured to: determine the intimacy between N data based on a log, wherein the intimacy corresponding to any two of the N data is used to indicate the possibility that the two data involve the same task, N is an integer greater than 1, the log indicates the N data involved in M ​​historical tasks executed by a server cluster, M is a positive integer, and the N data are distributedly stored in the server cluster; an interface circuit, configured to update the storage location of the N data based on the intimacy between the N data.

[0039] In combination with the second aspect, in certain implementations of the second aspect, the processor is specifically configured to: determine the intimacy between the N data according to the number of times the N data are involved in the same historical task among the M historical tasks.

[0040] In combination with the second aspect, in certain implementations of the second aspect, the intimacy corresponding to any two data among the N data is positively correlated with the number of times the two data are involved in the same historical task among the M historical tasks.

[0041] In combination with the second aspect, in certain implementations of the second aspect, the interface circuit is specifically used to: update the storage location of N data according to a first storage scheme, the first storage scheme indicates the target storage location of N data in P servers in the server cluster, P is an integer greater than 1, the statistical value of the intimacy between the P servers in the first storage scheme is less than or equal to a first threshold, and the intimacy between two of the P servers in the first storage scheme is based on the intimacy between the data corresponding to one of the two servers and the data corresponding to the other server.

[0042] In combination with the second aspect, in certain implementations of the second aspect, the first storage scheme is an element in a set consisting of multiple storage schemes, each of the multiple storage schemes indicates a different storage location of N data in P servers, and the first threshold is the minimum value of the statistical value of the intimacy between P servers in other storage schemes among the multiple storage schemes except the first storage scheme.

[0043] In combination with the second aspect, in certain implementations of the second aspect, the interface circuit is specifically used to: send scheduling information to the first server in the server cluster and the second server in the server cluster based on the intimacy between the N data, and the scheduling information indicates that the first data stored in the first server among the N data is moved to the second server.

[0044] In combination with the second aspect, in certain implementations of the second aspect, the processor is specifically used to: construct a first intimacy relationship graph based on the log, each of the N nodes in the first intimacy relationship graph corresponds to one of the N data, and the weight of the edge between two nodes in the first intimacy relationship graph is used to indicate the intimacy between the two data corresponding to the two nodes.

[0045] In combination with the second aspect, in certain implementations of the second aspect, the processor is specifically used to: construct a second intimacy relationship graph based on the log, each of the N nodes in the second intimacy relationship graph corresponds to one of the N data, and in the process of constructing the second intimacy relationship graph, an edge is connected between the nodes corresponding to the data involved in the mth historical task in the M historical tasks, m=1,2,…M; determine the first intimacy relationship graph based on the second intimacy relationship graph, each of the N nodes in the second intimacy relationship graph corresponds to a node in the first intimacy relationship graph, and the weight of the edge between two nodes in the first intimacy relationship graph is based on the number of edges between the corresponding two nodes in the second intimacy relationship graph.

[0046] In combination with the second aspect, in certain implementations of the second aspect, the P subgraphs of the first intimacy relationship graph correspond to P servers respectively, and the P subgraphs are obtained by dividing the first intimacy relationship graph with the goal of making the number of nodes in the P subgraphs the same and the statistical value of the weights of the edges between the P subgraphs minimized. In the P servers, the target storage location of each data is the server corresponding to the subgraph to which the node corresponding to each data in the P subgraph belongs.

[0047] In combination with the second aspect, in certain implementations of the second aspect, partitioning the first intimacy relationship graph with the goal of making the number of nodes in the P subgraphs the same and the statistical value of the weights of the edges between the P subgraphs minimized is implemented based on a quantum heuristic algorithm.

[0048] In conjunction with the second aspect, in certain implementations of the second aspect, P=2, and the objective function of the quantum heuristic algorithm satisfies the following formula:

[0049] Among them, s i is the i-th spin variable among N spin variables, s j is the jth spin variable among N spin variables. N spin variables correspond to N data respectively. The value of the spin variable is 1 or -1. The data corresponding to the spin variables with the same value belong to the same subgraph. i,j Represents the relationship between the i-th data and the j-th data, J i,j Determined based on the intimacy between the i-th data and the j-th data.

[0050] In combination with the second aspect, in certain implementations of the second aspect, the first intimacy relationship graph is represented by a matrix, which includes N rows and N columns, each of the N rows corresponds to a node in the first intimacy relationship graph, and each of the N columns corresponds to a node in the first intimacy relationship graph. Each element in the matrix is ​​used to represent the weight of the edge between the node corresponding to the row where each element is located and the node corresponding to the column where each element is located.

[0051] It should be understood that the expansion, limitation, explanation and description of the relevant content in the above-mentioned first aspect also apply to the same content in the second aspect.

[0052] In a third aspect, a controller is provided, comprising a processor and a memory, and optionally, an input / output interface. The processor is configured to control the input / output interface to send and receive information, the memory is configured to store a computer program, and the processor is configured to retrieve and execute the computer program from the memory, so that the controller performs the method described in the first aspect or any possible implementation of the first aspect.

[0053] Optionally, the processor may be a general-purpose processor, which may be implemented in hardware or software. When implemented in hardware, the processor may be a logic circuit, an integrated circuit, or the like; when implemented in software, the processor may be a general-purpose processor implemented by reading software code stored in a memory, which may be integrated into the processor or located independently of the processor.

[0054] In a fourth aspect, a computing device cluster is provided, comprising a plurality of servers and the controller in the second aspect and any one of the implementations of the second aspect.

[0055] Optionally, the controller may be a server among the multiple servers, or the controller may be a server other than the multiple servers.

[0056] In a fifth aspect, a computer-readable medium is provided, comprising computer program instructions. When the computer program instructions are executed by a computing device cluster, the computing device cluster executes the method in the first aspect and any one of the implementations of the first aspect.

[0057] In a sixth aspect, a computer program product comprising instructions is provided. When the instructions are executed by a computing device cluster, the computing device cluster executes the method in the above-mentioned first aspect and any one of the implementations of the first aspect.

[0058] By way of example, these computer-readable storages include, but are not limited to, one or more of the following: read-only memory (ROM), programmable ROM (PROM), erasable PROM (EPROM), Flash memory, electrically EPROM (EEPROM), and a hard drive.

[0059] Optionally, as an implementation manner, the above-mentioned storage medium may specifically be a non-volatile storage medium. BRIEF DESCRIPTION OF THE DRAWINGS

[0060] FIG1 is a schematic flow chart of a query task execution process.

[0061] FIG2 is a schematic diagram of a data processing flow according to an embodiment of the present application.

[0062] FIG3 is a schematic flowchart of a method for distributed data storage according to an embodiment of the present application.

[0063] FIG4 is a schematic diagram of a minimum balance cut problem according to an embodiment of the present application.

[0064] FIG5 is a schematic flowchart of another method for distributed data storage according to an embodiment of the present application.

[0065] FIG6 is a schematic diagram of a second intimacy relationship diagram according to an embodiment of the present application.

[0066] FIG7 is a schematic diagram of a first intimacy relationship diagram according to an embodiment of the present application.

[0067] FIG8 is a schematic diagram of a division method of the first intimacy relationship diagram of an embodiment of the present application.

[0068] FIG9 is a schematic diagram of another division method of the first intimacy relationship diagram of an embodiment of the present application.

[0069] FIG10 is a schematic block diagram of a device for distributed data storage according to an embodiment of the present application.

[0070] FIG11 is a schematic block diagram of a controller according to an embodiment of the present application. DETAILED DESCRIPTION

[0071] The technical solutions in the embodiments of the present application will be described below with reference to the accompanying drawings.

[0072] This application will present various aspects, embodiments, or features around systems including multiple devices, components, modules, etc. It should be understood and appreciated that each system may include additional devices, components, modules, etc., and / or may not include all of the devices, components, modules, etc. discussed in conjunction with the figures. Furthermore, combinations of these aspects may also be used.

[0073] In the embodiments of the present application, “corresponding” and “relevant” may sometimes be used interchangeably. It should be noted that when the distinction between them is not emphasized, the meanings they intend to express are consistent.

[0074] The business scenarios described in the embodiments of the present application are intended to more clearly illustrate the technical solutions of the embodiments of the present application, and do not constitute a limitation on the technical solutions provided in the embodiments of the present application. A person skilled in the art will appreciate that, with the evolution of network architecture and the emergence of new business scenarios, the technical solutions provided in the embodiments of the present application are equally applicable to similar technical problems.

[0075] References to "one embodiment" or "some embodiments" in this specification mean that a particular feature, structure, or characteristic described in conjunction with that embodiment is included in one or more embodiments of the present application. Thus, phrases such as "in one embodiment," "in some embodiments," "in other embodiments," and "in yet other embodiments" appearing in various places in this specification do not necessarily refer to the same embodiment, but rather mean "one or more but not all embodiments," unless otherwise specifically emphasized. The terms "including," "comprising," "having," and variations thereof mean "including but not limited to," unless otherwise specifically emphasized.

[0076] In this application, "at least one" means one or more, and "more" means two or more. "And / or" describes the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can mean: including the existence of A alone, the existence of A and B at the same time, and the existence of B alone, where A and B can be singular or plural. The character " / " generally indicates that the previous and next associated objects are in an "or" relationship. "At least one of the following items" or similar expressions refers to any combination of these items, including any combination of single or plural items. For example, at least one of a, b, or c can mean: a, b, c, ab, ac, bc, or abc, where a, b, c can be single or multiple.

[0077] The solution of the embodiment of the present application can be applied to the scenario of distributed storage, that is, the solution of the embodiment of the present application can be used to store data on different devices, for example, storing data on different servers or hard disks.

[0078] For example, the solution of the embodiment of the present application can be applied to a distributed database server or a cloud-native database.

[0079] Cloud-native databases leverage the elasticity and distributed nature of cloud platforms to pool cloud computing resources and scale the platform. Cloud-native databases enable distributed storage, with the data accessed by tasks, or the indexes of those data, stored on different servers. This type of database is also called a distributed database.

[0080] In order to better illustrate the solutions of the embodiments of the present application, the terms that may be involved in the present application are first explained below.

[0081] (1) Ising model

[0082] The Ising model is used to find the spin configuration that minimizes the Ising energy.

[0083] For example, the Ising model can satisfy the following formula:

[0084] Among them, s represents the spin variable, s i represents the i-th spin variable, s j represents the jth spin variable, and the value of s is 1 or -1. N represents the number of spin variables. N is an integer greater than 1. i,j It represents the coupling strength (or coupling coefficient) between the i-th spin variable and the j-th spin variable. i represents the properties of the i-th spin variable itself. Specifically, h i represents the local magnetic field on the i-th spin variable. i Can be 0.

[0085] The Ising model can also be expressed in other forms, which are not limited in the embodiments of the present application.

[0086] The solution of the Ising model can be expressed as a vector with spin as its element (s1,s2,...,s N The purpose of the Ising model is to find a set of combinations of s so that the Ising energy E Ising smaller, the optimal solution is to make E Ising The vector (s1,s2,...,s N ) value.

[0087] The Ising model is often used as a model for solving combinatorial optimization problems.

[0088] The problem of calculating an approximate solution that reduces the energy of the Ising model is called the Ising problem. An approximate solution is a solution that brings the value of the objective function closer to the optimal value.

[0089] (2) Quantum-inspired algorithms

[0090] Quantum-inspired algorithms can be used to solve combinatorial optimization problems, such as the Ising problem.

[0091] Quantum-inspired algorithms are based on quantum annealing algorithms, but they use a classical approximation of the quantum portion of the algorithm to run on a classical computer. Quantum-inspired algorithms can be considered a classical version of quantum annealing.

[0092] For example, the quantum heuristic algorithm may include: simulated coherent Ising machine (SimSIM), simulated bifurcation machine (SBM), or local quantum annealing (LQA).

[0093] (3) Simulated bifurcation (SB) algorithm

[0094] SBM can also be called SB algorithm.

[0095] In the simulated fork algorithm, for the variable x i and y i Calculate and solve. i=1,2,…N. N is a positive integer. N variables x i and N variables y i Each variable corresponds to a spin variable s of the Ising model i .x i Can be s i The corresponding particle position. i Can be s i The momentum of the corresponding particle.

[0096] The simulated bifurcation algorithm solves the Ising problem through iterative updates.

[0097] For example, the iterative process may satisfy the following formula: xi (t k+1 )=x i (t k )+a0y i (t k+1 )Δt;

[0098] Where a0 and c0 are constants and are positive numbers. Δt represents the time step and is a positive number. k Indicates discrete time, t0=0, t k+1 =t k +Δt. k is the number of iterations, k is a non-negative integer. a(tk) represents t k The control parameters of the moment,

[0099] For example, initialize x i and y i is a random number near 0, and then x is calculated based on the above formula i and y i Perform iterative updates. i Afterwards, confirm x i The absolute value of |x i |Is it greater than 1. If |x i |>1, then the current x i The value of sgn(x i ), the current y i Set to 0. That is, if |x i |>1, then x i=sgn(x i ),y i =0.

[0100] Through the above iterative process, we can get N variables x i The value of x i Perform symbolic operations to obtain the corresponding s i , that is, s i =sgn(x i ), thus obtaining the solution to the Ising problem.

[0101] It should be understood that the above is only an example form of the simulated fork algorithm, and the simulated fork algorithm can also implement iteration through other formulas.

[0102] Data distribution refers to improving execution efficiency by rationally distributing data in distributed storage scenarios. When executing a distributed task, the data involved may be stored on different devices. It is usually necessary to aggregate the data involved on a single device. Migrating data from one device to another incurs migration costs.

[0103] FIG1 shows a schematic flow chart of a query task execution process.

[0104] For example, FIG1 shows four servers, namely, server 111, server 112, server 113, and server 114. Data is stored in the four servers shown in FIG1.

[0105] After the execution unit 120 receives the user's request, the routing decision module 121 can determine the migration method of the data involved in the query task corresponding to the request based on the user request. The migration decision is used to indicate the migration method of the data. As shown in Figure 1, the data involved in the query task includes data #1, data #2, data #3 and data #4. Data #1 is stored in server 111, data #2 and data #3 are stored in server 112, and data #4 is stored in server 113. Based on the migration decision, data #1 in server 110 is migrated to server 112, and data #4 in server 113 is migrated to server 112. Data #2 and data #3 do not need to be migrated. After the query is completed, the query results are fed back to the user.

[0106] In this query, both data #1 and data #4 need to be migrated to server 112, resulting in two migration costs. If data #1, data #2, data #3, and data #4 were stored on the same server, this query would not involve data migration, thus improving task execution efficiency.

[0107] As can be seen from Figure 1, improper data storage methods will increase the amount of data that needs to be migrated or the number of migrations during task execution, resulting in an increase in migration costs, thereby affecting the execution efficiency of the task.

[0108] In view of this, an embodiment of the present application provides a method for distributed data storage, which determines the intimacy between data based on logs, and then optimizes the data layout according to the intimacy between data, which is conducive to allocating a more reasonable storage location for the data, thereby reducing the data migration cost and improving the operating performance.

[0109] Figure 2 shows a schematic flow chart of a data processing process according to an embodiment of the present application. The method for distributed data storage according to an embodiment of the present application can be applied to the data processing process to determine the location of data storage.

[0110] For example, after executing a task, the routing decision module 121 may save the execution status of the task to a task log. For example, as shown in FIG2 , after executing a query task, the routing decision module 121 may save the query record to the task log.

[0111] As shown in FIG. 2 , the solving unit 130 includes an acquisition module 131 , an intimacy determination module 132 and a segmentation module 133 .

[0112] The acquisition module 131 is used to obtain logs. The logs are used to indicate N data involved in M ​​historical tasks executed by the server cluster. M is a positive integer. N is an integer greater than 1.

[0113] 2 , the acquisition module 131 may obtain historical records based on the task log. The historical tasks may be historical query tasks.

[0114] For example, the acquisition module 131 may load a data pipeline to obtain the historical records. The data pipeline may be used to copy relevant data of the historical records from the task log and process the relevant data to obtain the historical records.

[0115] It should be understood that this is only an example, and the acquisition module 131 can also obtain historical records in other ways, which is not limited in this embodiment of the present application.

[0116] The intimacy determination module 132 is configured to determine the intimacy between N data based on the logs.

[0117] Optionally, the intimacy determination module 132 can construct a graph structure corresponding to the log based on the log. Exemplarily, the graph structure can be the first intimacy relationship graph mentioned later. Each of the N nodes of the first intimacy relationship corresponds to one of the N data. The weight of the edge in the first intimacy relationship graph is used to indicate the intimacy between the N data. In this case, the intimacy determination module 132 can also be referred to as the construction module 132.

[0118] If a previously constructed graph structure is stored in the system, the construction module 132 may update the graph structure based on the log.

[0119] Segmentation module 133 is configured to determine target storage locations for the N data items on P servers in the server cluster based on the intimacy between the N data items. P is a positive integer. The storage locations of the N data items on the P servers may also be referred to as the servers corresponding to the N data items. The server corresponding to each data item is the storage location of that data item.

[0120] Exemplarily, the segmentation module 133 can be used to implement graph segmentation processing. Specifically, the segmentation module 133 can be used to divide the first intimacy relationship graph into P subgraphs. Each subgraph corresponds to a server. The target storage location of each data is the server corresponding to the subgraph to which the corresponding node of each data in the first intimacy relationship graph belongs.

[0121] Furthermore, the partitioning module 133 can provide the data distribution plan as feedback to the scheduler 122. The data distribution plan indicates the target storage location for each piece of data. The scheduler 122 can determine a layout decision based on the data distribution plan to adjust the data storage location, i.e., to move the data to the target storage location determined by the partitioning module 133, thereby optimizing the data layout.

[0122] The scheduler 122 may send scheduling information to the server, where the scheduling information indicates a data migration strategy.

[0123] For example, if the target storage location of the data determined by the segmentation module 133 is different from the server where the data is currently stored, the scheduler 122 may send scheduling information to the two servers to instruct the data to move.

[0124] Exemplarily, the scheduler 122 may also send scheduling information to all servers currently storing the N data and P servers to instruct them to move the N data to idle servers, and then move the N data from the idle servers to the target storage locations of each data respectively.

[0125] It should be understood that the above scheduling process is only an example, and the embodiments of the present application do not limit the specific scheduling process.

[0126] For example, the solving unit 130 may re-execute the above process of determining data distribution at regular intervals, thereby updating the location where the data is stored.

[0127] For a detailed description of the solving unit 130 , reference may be made to the method 300 .

[0128] It should be understood that the positions and quantities of the various modules, units, servers, etc. in Figure 2 are only examples and do not limit the solutions of the embodiments of the present application. For example, in the system shown in Figure 2, the solution unit 130, the execution unit 140 and the server are shown separately for convenience of description only, and do not limit the solution unit 130, the execution unit 140 and the server to be set on independent devices. For example, the solution unit 130 can be deployed in any one or more of the servers shown in Figure 2, or the solution unit 130 can also be deployed on other devices other than the servers shown in Figure 2. For another example, the solution unit 130 and the execution unit 120 can be integrated into the same device, or they can be deployed on different devices respectively.

[0129] FIG3 shows a schematic flow chart of a method for distributed data storage according to an embodiment of the present application. Method 300 can be applied to the process shown in FIG2 . The method shown in FIG3 can be executed by a controller. The controller can communicate with multiple servers in a server cluster. The multiple servers are used to store data in a distributed manner. The controller can be any one or more of the multiple servers, or the controller can be a module deployed in any one or more of the multiple servers. Alternatively, the controller can be a server other than the multiple servers. Alternatively, the controller can be a module deployed in a server other than the multiple servers.

[0130] For example, method 300 may be executed by the solution unit 130 in FIG2 . The controller may include the solution unit 130. Furthermore, the controller may also include an execution unit 120. It should be understood that FIG2 is merely an example, and in other possible implementations, the execution unit 120 may also be deployed outside the controller.

[0131] As shown in FIG3 , method 300 includes the following steps.

[0132] 310. Obtain a log. The log indicates N data items involved in M ​​historical tasks executed by the server cluster. M is a positive integer. N is an integer greater than 1.

[0133] 320. Determine the intimacy between the N data according to the log. The intimacy corresponding to any two data among the N data is used to indicate the possibility that the two data are related to the same task.

[0134] 330 , updating the storage locations of the N data according to the intimacy between the N data.

[0135] In step 330, the target storage location of each data in P servers is determined based on the intimacy between the N data, where P is an integer greater than 1.

[0136] For example, if the controller does not include the execution unit 120, step 310 may be performed by the acquisition module 131 in Figure 2. That is, the acquisition module 131 may receive the log from the execution unit 120. If the controller includes the execution unit 120, step 310 may be understood as reading the log.

[0137] Exemplarily, the M historical tasks may include multiple historical tasks, that is, M>1. The multiple historical tasks may include tasks with the same task content, or tasks with different task contents.

[0138] For example, the task may be a query task, where one task is a query.

[0139] Alternatively, the task can also be other tasks that need to access data.

[0140] For the sake of ease of description, the embodiments of the present application are described using only query tasks as an example, without limiting the scope of the embodiments of the present application.

[0141] The log is used to indicate the data involved in each of the M historical tasks.

[0142] The data involved in the task may include the data accessed by the task or an identifier of the data accessed by the task, for example, an index of the data.

[0143] Exemplarily, the log may include the data itself involved in the M historical tasks.

[0144] For example, the data involved in the M historical tasks may be the index of the data accessed by the M historical tasks, and the log may include the index of the data accessed by the M historical tasks. In this case, the N data may be N indexes, and the data distribution is the distribution of the N indexes.

[0145] Exemplarily, the log may include identifications of data involved in the M historical tasks.

[0146] For example, the data involved in the M historical tasks may be the data accessed by the M historical tasks, and the log may include the index of the data accessed by the M historical tasks. In this case, the N data may be the data accessed by the N tasks, and the data distribution is the distribution of the data accessed by the N tasks.

[0147] For example, the history of log indications can be expressed as follows:

[0148] 0 5

[0149] 1 2 3

[0150] 2 3 4

[0151] 0 1 5

[0152] In the above historical records, each row represents a historical query, and each number represents the index of a piece of data. The above historical records show four historical tasks, that is, M = 4. The numbers 0-5 represent the indexes of six pieces of data, respectively. The indexes in the same row are the indexes of the data accessed by the same historical query. The above historical records include four historical queries. In the first historical query, the query accessed the data with index 0 and the data with index 5. In the second historical query, the query accessed the data with index 1, the data with index 2, and the data with index 3, and so on.

[0153] It should be understood that the above is only an example, and the historical records may also be represented in other forms as long as they can indicate the data involved in each historical task.

[0154] Exemplarily, step 320 may be performed by the intimacy determination module 132 in FIG. 2 .

[0155] The possibility that two data items are related to the same task may also be understood as the correlation between the two data items and the same task.

[0156] For ease of description, in the embodiments of this application, multiple data items involving the same task can also be referred to as being simultaneously involved. In other words, being simultaneously involved means that multiple data items are involved in the same task, and is not limited to being involved in the same task at the same time. Multiple data items being simultaneously involved in a log means that the multiple data items are involved in the same task among the M historical tasks.

[0157] Step 320 may also be referred to as performing intimacy modeling based on the logs.

[0158] For example, the intimacy between two data items can also be referred to as the intimacy between the two data items. The intimacy between two data items can be positively correlated with the likelihood that the two data items are related to the same task. That is, the higher the likelihood that the two data items are related to the same task, the higher the intimacy between the two data items.

[0159] For ease of description, the embodiments of the present application are mainly illustrated by taking the positive correlation between the intimacy between two data and the possibility that the two data involve the same task as an example, and do not constitute a limitation on the scheme of the embodiments of the present application.

[0160] Exemplarily, the target storage location of each data may be determined by the segmentation module 133 in FIG. 2 .

[0161] For example, in step 330 , based on the intimacy between the N data, data with a high possibility of being related to the same task may be stored on the same server as much as possible.

[0162] In this way, the number of data migrations during the execution of the task can be reduced, thereby reducing the migration cost and improving the execution efficiency of the task.

[0163] According to the solution of the embodiments of the present application, the intimacy between data is determined based on logs, and then the data layout method, that is, the target storage location of the data, is determined based on the intimacy. This helps reduce the communication costs caused by data migration during task execution, reduces migration costs, and thus improves operational performance. For example, multiple data items that are likely to be involved in the same task can be stored on the same server as much as possible. This can reduce the number of data migrations during the execution of the task, reduce migration costs, and thus improve the processing efficiency of the task.

[0164] Optionally, step 320 may include: determining the intimacy between the N data according to the number of times the N data are involved in the same historical task among the M historical tasks.

[0165] Optionally, the data involved in the M historical tasks include data #11 and data #12, the subsets of the set consisting of the M historical tasks include a first subset and a second subset, the elements of the first subset include all historical tasks involving data #11 among the M historical tasks, the elements of the second subset include all historical tasks involving data #12 among the M historical tasks, and the intimacy between data #11 and data #12 is based on the number of elements in the intersection of the first subset and the second subset.

[0166] The elements in the intersection of the first subset and the second subset include all historical tasks involving data #11 and data #12 in the M historical tasks. The data involved in each element in the intersection of the first subset and the second subset includes both data #11 and data #12.

[0167] The number of elements in the intersection of the first subset and the second subset is the number of times data #11 and data #12 are simultaneously involved in the log.

[0168] In other words, the closeness between data #11 and data #12 is based on the number of times data #11 and data #12 are simultaneously referred to in the log.

[0169] Data #11 and Data #12 are any two data points from the M historical tasks. The "first" and "second" in Data #11 and Data #12 are used solely to distinguish the two data points and do not have any other limiting function. The intimacy between any two data points from the M historical tasks can be determined using the same method for determining the intimacy between Data #11 and Data #12.

[0170] For example, the intimacy between two data items among the data items involved in the M historical tasks is based on the number of times the two data items are simultaneously involved in the log.

[0171] The following is an illustrative explanation using the example of the historical records in the previous text.

[0172] For example, data #11 may be data with index 0, and data #12 may be data with index 1. The data with index 0 is accessed by the first historical query and the fourth historical query, and the elements of the first subset include the first historical query and the fourth historical query. The data with index 1 is accessed by the second historical query and the fourth historical query, and the elements of the second subset include the second historical query and the fourth historical query. The elements in the intersection of the first subset and the second subset are the elements in the fourth historical query. The number of elements in the intersection of the first subset and the second subset is 1. In this historical record, the number of times the data with index 0 and the data with index 1 are simultaneously involved is 1.

[0173] For another example, data #11 may be data with index 0, and the second data may be data with index 5. The data with index 0 is accessed by the first historical query and the fourth historical query, and the elements of the first subset include the first historical query and the fourth historical query. The data with index 5 is accessed by the first historical query and the fourth historical query, and the elements of the second subset include the first historical query and the fourth historical query. The elements in the intersection of the first subset and the second subset include the first historical query and the fourth historical query. The number of elements in the intersection of the first subset and the second subset is 2. In this historical record, the number of times the data with index 0 and the data with index 5 are simultaneously referenced is 2.

[0174] As a possible example, the intimacy between two pieces of data may be positively correlated with the number of times the two pieces of data are simultaneously mentioned in a log, that is, the more times the two pieces of data are simultaneously mentioned in a log, the higher the intimacy between the two pieces of data.

[0175] For example, the closeness between two data is the number of times the two data are simultaneously involved in the log.

[0176] Taking the example of the historical records in the previous article as an example, the intimacy between the data with index 0 and the data with index 5 is 2, and the intimacy between the data with index 0 and the data with index 1 is 1.

[0177] Alternatively, the intimacy between two data items may also be obtained by processing the number of times the two data items are simultaneously involved in the log.

[0178] For example, when the number of elements in the intersection of the first subset and the second subset is less than or equal to threshold #1, the closeness between data #11 and data #12 is 0.

[0179] In other words, if the number of times two data are simultaneously involved in the log is less than or equal to threshold #1, the intimacy between the two data can be set to 0.

[0180] Exemplarily, threshold #1 may be determined based on the number of times two data are simultaneously involved in the data involved in the M historical tasks.

[0181] For example, Threshold #1 can be the minimum number of times any two data items are simultaneously mentioned in the M historical tasks. In other words, if the number of times two data items are simultaneously mentioned in the log is less than or equal to the number of times other data items in the M historical tasks are simultaneously mentioned in the log, then the number of times the two data items are simultaneously mentioned in the log can be used as Threshold #1. That is, the intimacy between the two data items with the fewest number of simultaneous mentions in the log is set to 0.

[0182] Exemplarily, threshold #1 may be a preset fixed value.

[0183] Threshold #1 may also be determined by other methods, which is not limited in this embodiment of the present application.

[0184] The number of times two data in the log involve the same historical task can be used to reflect the intimacy between the two data, that is, to reflect the possibility that the two data will be read by the same task in the future. If two data are read simultaneously in the log multiple times, then the possibility that the two data will be read by the same task in the future is greater. In an embodiment of the present application, the intimacy between the two data is determined based on the number of times the two data in the log involve the same historical task. This solution is simple and efficient, which is conducive to quickly determining the intimacy relationship, thereby improving processing efficiency, and the intimacy relationship can be updated as the log changes, so that the intimacy relationship can more accurately reflect the current environment, which is conducive to the subsequent realization of more reasonable data distribution.

[0185] The intimacy between two data may also be determined by other means. For example, the intimacy between two data may be determined by machine learning.

[0186] Optionally, step 320 may include: constructing a first intimacy relationship graph based on the log, each of the N nodes in the first intimacy relationship graph corresponds to one of the N data, and the weight of the edge between two nodes in the first intimacy relationship graph is used to indicate the intimacy between the two data corresponding to the two nodes.

[0187] The first intimacy relationship graph is a weighted graph, in which edges have corresponding weights.

[0188] In the first intimacy relationship graph, the weight of an edge between two nodes may be based on the number of times two data corresponding to the two nodes are simultaneously involved in the log.

[0189] For example, in the first intimacy relationship graph, the weight of an edge between two nodes may be the number of times two data corresponding to the two nodes are simultaneously involved in the log.

[0190] Alternatively, in the first intimacy relationship graph, the weight of the edge between two nodes may be obtained by processing the number of times two data corresponding to the two nodes are simultaneously involved in the log.

[0191] For example, a graph structure is constructed based on logs, and the number of times two data are simultaneously involved in the logs is set as the weight of the edge between two nodes corresponding to the two data in the graph structure. The edges of the graph structure are processed to obtain a first intimacy relationship graph.

[0192] Exemplarily, edges with weights less than or equal to threshold #2 are deleted from the graph structure to obtain a first intimacy relationship graph.

[0193] Threshold #2 can be set as needed.

[0194] For example, threshold #2 may be the minimum value among the weights of all edges in the graph structure. In other words, the edge with the smallest weight is deleted from the graph structure to obtain the first intimacy relationship graph.

[0195] It should be understood that the above is only an example, and the weight of the edge between two nodes can also be determined by other methods, which is not limited in the embodiments of the present application.

[0196] Exemplarily, in the first intimacy graph, the weight of the edge between two nodes may be the intimacy between two data corresponding to the two nodes.

[0197] In an embodiment of the present application, a first intimacy relationship graph can be constructed based on the log, and the intimacy relationship between different data can be represented in the form of a weighted graph. The graph construction scheme is simple and effective, which is conducive to improving processing efficiency.

[0198] Optionally, constructing the first intimacy relationship graph based on the logs can be achieved through the following steps:

[0199] S1. Construct a second intimacy relationship graph based on the log. Each of the N nodes in the second intimacy relationship graph corresponds to one of the N data. In the process of constructing the second intimacy relationship graph, an edge is connected between the nodes corresponding to the data involved in the mth historical task in the M historical tasks, where m = 1, 2, ...M.

[0200] In other words, for each historical task, a fully connected graph is constructed based on the data involved in the historical task. Each node in the fully connected graph corresponds to a piece of data involved in the historical task. Each piece of data involved in the historical task corresponds to a fully connected subgraph in the second intimacy graph. The number of edges between two nodes in the second intimacy graph is the number of times the two pieces of data corresponding to the two nodes are simultaneously involved in the log.

[0201] For example, if a historical task involves data #1, data #2, and data #3, an edge is constructed between the nodes corresponding to data #1, data #2, and data #3. This process continues until all the data involved in the historical tasks are represented in the graph, resulting in a second intimacy graph.

[0202] For two pieces of data, each time they are mentioned simultaneously in the log, an edge is constructed between the nodes corresponding to the two pieces of data. In this way, the number of edges between each node in the second intimacy graph can be used to determine the number of times the data corresponding to each node is mentioned simultaneously in the log.

[0203] S2, determine the first intimacy relationship graph based on the second intimacy relationship graph, each of the N nodes in the second intimacy relationship graph corresponds to a node in the first intimacy relationship graph, and the weight of the edge between two nodes in the first intimacy relationship graph is based on the number of edges between the corresponding two nodes in the second intimacy relationship graph.

[0204] Exemplarily, the weight of an edge between two nodes among the multiple nodes in the first intimacy relationship graph may be positively correlated with the number of edges between the corresponding two nodes in the second intimacy relationship graph.

[0205] For example, the weight of an edge between two nodes among the multiple nodes in the first intimacy relationship graph may be the number of edges between the corresponding two nodes in the second intimacy relationship graph.

[0206] In the second intimacy graph, if the number of edges between two nodes is greater than 1, the edges between the two nodes are merged into a single edge with a weight equal to the number of edges between the two nodes before the merger. For example, if the number of edges between two nodes in the second intimacy graph is 2, the two nodes are merged into a single edge with a weight of 2. After performing the above operation on all edges in the second intimacy graph, a graph structure is obtained.

[0207] This graph structure can be used as the first intimacy relationship graph. In this case, the weight of an edge between two nodes in the plurality of nodes in the first intimacy relationship graph is the number of edges between the corresponding two nodes in the second intimacy relationship graph.

[0208] Alternatively, the edges in the graph structure may be processed to obtain a first intimacy relationship graph. Detailed descriptions may be found in the previous text, and will not be repeated here to avoid repetition.

[0209] According to the solution of the embodiment of the present application, by constructing an edge between two nodes to indicate that the data corresponding to the two nodes involves the same historical task in the log, the intimacy between N data is obtained. This method can achieve rapid modeling, that is, it increases the speed of determining intimacy. At the same time, during the construction of the second intimacy relationship graph, the number of edges between nodes changes as the data involved in different historical tasks in the log changes, which is conducive to ensuring the authenticity of the intimacy between the data.

[0210] The closeness relationship between data can be expressed through a variety of graph language representations.

[0211] Optionally, the first intimacy relationship graph can be represented by a matrix. The matrix includes N rows and N columns, where each row corresponds to a node in the first intimacy relationship graph, and each column corresponds to a node in the first intimacy relationship graph. Each element in the matrix is ​​used to represent the weight of the edge between the node corresponding to the row where the element is located and the node corresponding to the column where the element is located.

[0212] In other words, a sparse matrix is ​​used to represent the intimacy relationship between data.

[0213] For example, the number of the nodes in the first intimacy relationship graph is the same as the number of the row of the matrix corresponding to the node. The number of the nodes in the first intimacy relationship graph is the same as the number of the matrix corresponding to the node. The element at the ath row and the bth column of the matrix is ​​the weight of the edge between the ath node and the bth node. Correspondingly, the element at the bth row and the ath column of the matrix is ​​also the weight of the edge between the ath node and the bth node. a is an integer less than N. b is an integer less than N.

[0214] It should be noted that the first intimacy relationship graph may also be represented by other graph language representations, for example, by a dictionary or a list, etc. This embodiment of the present application does not limit this.

[0215] Optionally, step 330 may include: storing the N data according to a first storage scheme. The first storage scheme indicates target storage locations of the N data in the P servers. A statistical value of the intimacy between the P servers in the first storage scheme is less than or equal to a first threshold. The intimacy between two of the P servers in the first storage scheme is based on the intimacy between data corresponding to one of the two servers and data corresponding to the other server.

[0216] The first storage solution indicating the target storage locations of the N data on the P servers can also be understood as indicating the target correspondence between the N data and the P servers. The data corresponding to a server in the storage solution can be understood as the data stored on the server from the N data indicated by the storage solution, and does not limit the actual storage location of the data.

[0217] The first storage solution can be used as the data distribution plan in FIG2 .

[0218] Optionally, the first storage scheme is an element in a set consisting of multiple storage schemes, each of the multiple storage schemes indicating a different storage location of the N data in the P servers. In other words, each storage scheme indicates a different correspondence between the N data and the P servers.

[0219] Step 330 may include: determining a first storage scheme from the multiple storage schemes according to the intimacy between the N data.

[0220] Each of the plurality of storage schemes indicates a corresponding relationship, that is, indicates a storage location of the N data in the P servers. Different storage schemes indicate different corresponding relationships. The corresponding relationship is a corresponding relationship between the N data and the P servers.

[0221] The multiple storage solutions can also be understood as multiple combinations of N data and P nodes.

[0222] For example, P servers include server #1 and server #2. N data include data 1#, data 2#, and data 3#. The multiple storage schemes include storage scheme #1 and storage scheme #2. Storage scheme #1 and storage scheme #2 respectively indicate two corresponding relationships. Specifically, in storage scheme #1, data #1 and data #2 correspond to server #1, and data #3 corresponds to server #2. In storage scheme #2, data #1 corresponds to server #1, and data #2 and data #3 correspond to server #2.

[0223] The following description takes one of the multiple storage solutions as an example.

[0224] For a storage solution, the statistical value of the intimacy between P servers can be understood as the statistical value of the intimacy between every two servers in the P servers.

[0225] For example, if each of the two servers corresponds to a piece of data, the intimacy between the two servers may be the intimacy between the data corresponding to one of the two servers and the data corresponding to the other server.

[0226] For example, if at least one of the two servers corresponds to multiple data, the intimacy between the two servers may be the sum of the intimacy between the data corresponding to one of the two servers and the data corresponding to the other server.

[0227] For example, when P>2, the statistical value of the intimacy between the P servers may be the average or sum of the intimacy between the P servers. When P=2, the statistical value of the intimacy between the P servers may be the intimacy between the two servers themselves.

[0228] For example, P servers include server #1 and server #2. N data include data 1#, data 2#, and data 3#. Data #1 and data #2 correspond to server #1, and data #3 corresponds to server #2. The intimacy between the two servers can be the sum of the intimacy between the data corresponding to server #1 and the data corresponding to server #2, that is, the sum of the intimacy between data #1 and data #3 and the intimacy between data #2 and data #3.

[0229] For another example, P servers include server #1, server #2, and server #3. N data include data #1, data #2, data #3, and data #4. Data #1 and data #2 correspond to server #1, data #3 corresponds to server #2, and data #4 corresponds to server #3. The sum of the intimacy between the three servers is the sum of the intimacy between server #1 and server #2, the intimacy between server #1 and server #3, and the intimacy between server #2 and server #3. The intimacy between server #1 and server #2 is the sum of the intimacy between data #1 and data #3 and the intimacy between data #2 and data #3. The intimacy between server #1 and server #3 is the sum of the intimacy between data #1 and data #4 and the intimacy between data #2 and data #4. The intimacy between server #2 and server #3 is the sum of the intimacy between data #3 and data #4.

[0230] Exemplarily, the first threshold may be a manually set value.

[0231] Optionally, the first threshold may be a minimum value of a statistical value of intimacy between P servers in other storage schemes except the first storage scheme among the multiple storage schemes.

[0232] In other words, step 330 may be to determine a first storage scheme from the multiple storage schemes, wherein the statistical value of the intimacy between P servers in the first storage scheme is less than or equal to the statistical value of the intimacy between P servers in the remaining storage schemes.

[0233] Optionally, step 330 may include: determining a target storage location for each data item with the goal of making the amount of data stored on the P servers the same and minimizing the statistical value of the intimacy between the P servers.

[0234] That is, the first storage solution is determined with the goal of making the amount of data stored on the P servers the same and minimizing the statistical value of the intimacy between the P servers.

[0235] In other words, the data distribution in the P servers is determined based on the intimacy between the N data, so that the data distribution result is as close as possible to the goal of having the same amount of data corresponding to the P servers and the minimum statistical value of the intimacy points between the P servers.

[0236] The solution to this goal can be considered as a combinatorial optimization problem. A combinatorial optimization problem is to find the optimal value (maximum or minimum value) of the objective function under given constraints.

[0237] Step 330 can also be understood as follows. There is an optimal solution among all storage solutions, namely the optimal storage solution. The amount of data corresponding to the P servers in the optimal storage solution is the same, and the statistical value of the intimacy between the P servers in the optimal storage solution is the minimum value of the statistical value of the intimacy between the P servers in all storage solutions. Step 330 is to find the optimal solution, or in other words, to obtain a storage solution that is as close as possible to the optimal solution, namely the first storage solution.

[0238] In an embodiment of the present application, the target storage location of the N data is determined with the goal of making the amount of data stored on the P servers the same, which is conducive to ensuring load balancing on each server and achieving balanced storage. The target storage location of the N data is determined with the goal of minimizing the intimacy between the P servers, which is conducive to ensuring that data with higher intimacy is stored on the same server, reducing the cost of data migration during task execution, thereby improving the efficiency of task execution. In other words, the solution of the embodiment of the present application is conducive to reducing the cost of data migration during task execution while ensuring balanced storage, thereby improving the efficiency of task execution.

[0239] The combinatorial optimization problem described above can be transformed into the minimum balanced cuts problem for graph partitioning. The minimum balanced cuts problem involves partitioning an undirected graph into P subgraphs, satisfying the following requirements: the number of nodes within each subgraph is balanced, and the number of edges between the P subgraphs is minimized. In other words, the minimum balanced cuts problem imposes two constraints: balance and cut ratio.

[0240] Figure 4 shows a schematic diagram of a minimum balanced cut problem. As shown in Figure 4 , with P = 2, an undirected graph is partitioned into two subgraphs, V' and V", such that the number of nodes in the two subgraphs is balanced and the number of edges between the two subgraphs is minimized. The number of edges between the two subgraphs in Figure 4 is 3.

[0241] Optionally, the P servers correspond to P subgraphs of the first intimacy relationship graph, respectively, and step 330 may include: dividing the first intimacy relationship graph into P subgraphs with the goal of ensuring that the number of nodes in the P subgraphs is the same and the statistical value of the weights of the edges between the P subgraphs is minimized. The target storage location of each data is the server corresponding to the subgraph to which the node corresponding to each data in the P subgraphs belongs.

[0242] The first intimacy relationship graph can be divided into P subgraphs in various ways. For each division method, the statistical value of the weight of the edge between the P subgraphs can be understood as the statistical value of the weight of the edge between every two subgraphs in the P subgraphs.

[0243] Exemplarily, if two subgraphs among the P subgraphs of the first intimacy relationship graph each include only one node, the weight of the edge between the two subgraphs is based on the weight of the edge between the node in one subgraph and the node in the other subgraph of the two subgraphs.

[0244] Exemplarily, if at least one of two subgraphs among the P subgraphs of the first intimacy relationship graph includes multiple nodes, the weight of the edge between the two subgraphs is based on the sum of the weights of the edges between the nodes in one subgraph and the nodes in the other subgraph of the two subgraphs, that is, the sum of the weights of the edges connecting the two subgraphs.

[0245] For example, when P>2, the statistical value of the weights of the edges between the P subgraphs may be the average or sum of the weights of the edges between the P subgraphs. When P=2, the statistical value of the weights of the edges between the P subgraphs may be the weights of the edges between the two subgraphs.

[0246] Among all the partitioning methods of the first intimacy relationship graph, there is an optimal solution, namely the optimal partitioning method. In this optimal partitioning method, the number of nodes in the P subgraphs is the same, and the statistical value of the weights of the edges between the P subgraphs in this optimal partitioning method is the minimum value of the statistical value of the weights of the edges between the P subgraphs in all partitioning methods. Step 330 is to find this optimal solution, or in other words, to obtain a partitioning method that is as close to the optimal solution as possible.

[0247] Optionally, the P servers correspond to P subgraphs of the second intimacy relationship graph respectively, and step 330 may include: dividing the second intimacy relationship graph into P subgraphs with the goal of making the number of nodes in the P subgraphs the same and the statistical value of the number of edges between the P subgraphs minimized, and the target storage location of each data is the server corresponding to the subgraph to which the node corresponding to each data in the P subgraphs belongs.

[0248] The second intimacy relationship graph can be divided into P subgraphs in various ways. For each division method, the statistical value of the number of edges between the P subgraphs can be understood as the statistical value of the number of edges between every two subgraphs in the P subgraphs.

[0249] Exemplarily, if two subgraphs in the P subgraphs of the second intimacy relationship graph each include only one node, the number of edges between the two subgraphs is based on the number of edges between the two nodes.

[0250] Exemplarily, if at least one of two subgraphs among the P subgraphs of the second intimacy relationship graph includes multiple nodes, the number of edges between the two subgraphs is based on the sum of the number of edges between the nodes in one subgraph and the nodes in the other subgraph of the two subgraphs, that is, the sum of the number of edges connecting the two subgraphs.

[0251] For example, when P>2, the statistical value of the number of edges between the P subgraphs may be the average value or sum of the number of edges between the P subgraphs. When P=2, the statistical value of the number of edges between the P subgraphs may be the number of edges between the two subgraphs.

[0252] Among all the partitioning methods of the second intimacy relationship graph, there is an optimal solution, namely the optimal partitioning method. In this optimal partitioning method, the number of nodes in the P subgraphs is the same, and the statistical value of the number of edges between the P subgraphs in this optimal partitioning method is the minimum value of the statistical value of the number of edges between the P subgraphs in all partitioning methods. Step 330 is to find this optimal solution, or in other words, to obtain a partitioning method that is as close to the optimal solution as possible.

[0253] In this way, the above optimization combination problem can be converted into a balanced minimum cut problem in graph partitioning. The above partitioning method makes the problem more accurate.

[0254] As mentioned above, in the first intimacy relationship graph, the weight of the edge can be used for the intimacy between the nodes. Accordingly, the weight of the edge between the P subgraphs of the first intimacy relationship graph can be used to indicate the intimacy between P servers. The weight of the edge between two subgraphs in the P subgraphs of the first intimacy relationship graph can be used to indicate the intimacy between two of the P servers. In the second intimacy relationship graph, the number of edges can be used for the intimacy between the nodes. Accordingly, the number of edges between the P subgraphs of the second intimacy relationship graph can be used to indicate the intimacy between P servers. The number of edges between two subgraphs in the P subgraphs of the second intimacy relationship graph can be used to indicate the intimacy between two of the P servers. For the sake of convenience of description, the embodiment of the present application is mainly described by taking the first intimacy relationship graph as an example, and does not limit the scheme of the embodiment of the present application.

[0255] In an embodiment of the present application, data distribution can be determined by graph segmentation, that is, the data distribution problem is planned as a graph segmentation problem, so that the data distribution can be determined by the graph segmentation solution method, which is conducive to improving the solution efficiency. Specifically, the graph is segmented with the goal of making the number of nodes in the subgraph the same and the weight of the edges between different subgraphs the minimum, and P subgraphs correspond to P servers respectively. Graph segmentation with the goal of making the number of nodes in the subgraph the same is conducive to ensuring load balancing on each server and achieving balanced storage. Graph segmentation with the goal of minimizing the weight of the edges between different subgraphs is conducive to ensuring that data with higher intimacy is stored in the same server, reducing the data migration cost during task execution, thereby improving the execution efficiency of the task.

[0256] The balanced minimum cut problem can be regarded as the Ising problem, or in other words, the graph structure can be encoded into the Ising model and then solved using the solution method of the Ising problem.

[0257] Each node in the graph corresponds to a spin in the Ising model. Spin up and spin down are represented by 1 and -1, respectively. Nodes with the same spin can be assigned to the same component, that is, the same subgraph.

[0258] Exemplarily, each node in the first intimacy relationship graph corresponds to a spin in the Ising model, and corresponding nodes with the same spin belong to the same subgraph among the P subgraphs of the first intimacy relationship graph.

[0259] For the convenience of description, the embodiments of the present application are mainly described by taking P=2 as an example.

[0260] For example, the cut value C(s) between two components, that is, the sum of the weights of the edges connecting nodes in different subgraphs, can satisfy the following formula:

[0261] s represents the spin variable. s i is the i-th spin variable among N spin variables, s j is the jth spin variable among the N spin variables. The N spin variables correspond to the N data, or in other words, the N spin variables correspond to the N nodes in the first intimacy relationship graph. The value of the spin variable is 1 or -1. The data corresponding to the spin variables with the same value belong to the same subgraph. i,j represents the weight of the edge between the i-th node and the j-th node in N nodes. Or, w i,j Indicates the closeness between the i-th data and the j-th data in N data. The i-th node corresponds to the i-th data. The j-th node corresponds to the j-th data.

[0262] As previously mentioned, the first intimacy graph is divided into P subgraphs with the goal of ensuring that the number of nodes in the P subgraphs of the first intimacy graph is the same and the statistical value of the weight of the edges between the P subgraphs is minimized. That is, the graph is partitioned under the two constraints of balance and cutting ratio. For example, the objective function can satisfy the following formula:

[0263] α and β are the coefficients corresponding to the above two restrictions. The first term in the above formula is a constant term, so the above objective function can be expressed as the following formula:

[0264] Among them, J i,j Represents the relationship between the i-th node and the j-th node in the first intimacy relationship graph. i,jDetermined based on the weight of the edge between the i-th node and the j-th node. In other words, J i,j Represents the relationship between the i-th data and the j-th data. i,j Determined based on the intimacy between the i-th data and the j-th data. For example, J i,j The following formula can be satisfied:

[0265] From the above formula, it can be seen that the graph partitioning problem can be transformed into the Ising problem.

[0266] It should be understood that the above formula is only an example and does not limit the solution of the embodiment of the present application. The expression form of the objective function can be set as needed.

[0267] As mentioned above, the first intimacy graph can be represented as a matrix, where the elements in the matrix are the weights of the edges in the first intimacy graph. In this way, when performing graph segmentation, calculations can be performed based on the matrix, which helps to improve the solution speed.

[0268] Optionally, step 330 may be implemented by a quantum heuristic algorithm, such as SimCIM, SBM, or LQA.

[0269] The following is an illustrative description using SBM as an example.

[0270] SBM solves the Ising problem by continuously iteratively updating the current results.

[0271] For example, the iterative process may satisfy the following formula: x i (t k+1 )=x i (t k )+a0y i (t k+1 )Δt;

[0272] Among them, the variable x i and variable y i With s i Correspondingly, i=1,2,…N. a0 and c0 are constants, a0 and c0 are positive numbers. Δt represents the time step, Δt is a positive number. t k Indicates discrete time, t0=0, t k+1 =t k +Δt. k is the number of iterations, k is a non-negative integer. a(t k ) represents t k Control parameters at the moment.

[0273] For example, initialize x i and y iis a random number near 0, based on the above formula for x i and y i Perform iterative updates. i Afterwards, confirm x i The absolute value of |x i |Is it greater than 1. If |x i |>1, then the current x i The value of sgn(x i ), the current y i Set to 0. That is, if |x i |>1, then x i =sgn(x i ),y i =0.

[0274] Through the above iterative process, we can get N variables x i The value of x i Perform symbolic operations to obtain the corresponding s i , that is, s i =sgn(x i ). s with a value of 1 belongs to one subgraph, and s with a value of -1 belongs to another subgraph.

[0275] According to the solution of the embodiment of the present application, a quantum heuristic algorithm can be used to implement graph segmentation, and the solution can be achieved through iterative updating, which is conducive to improving the solution speed.

[0276] It should be understood that the above is only an example, and graph segmentation can also be achieved through other methods, which are not limited in the embodiments of the present application.

[0277] In step 330 , the controller may send scheduling information to the servers in the server cluster to instruct the servers to update the storage location of the data.

[0278] Exemplarily, the scheduling information may be sent by the scheduler 122 in Figure 2. For example, the segmentation module in Figure 2 determines the target storage locations of the N data and notifies the scheduler 122. The scheduler 122 may send the scheduling information based on the target storage locations of the N data.

[0279] For example, the target storage location of the N data may be indicated by the first storage scheme, that is, the scheduling information is determined according to the first storage scheme.

[0280] Exemplarily, the controller may send scheduling information for data in the N data whose target storage location is different from the current storage location, to instruct the data to be moved from the current storage location to the target storage location.

[0281] Optionally, step 330 may include: sending scheduling information to a first server in the server cluster and a second server in the server cluster according to the intimacy between the N data, wherein the scheduling information indicates that the first data stored in the first server among the N data is moved to the second server.

[0282] For example, the target storage location of N data may be indicated by a first storage scheme. The first data is stored on a first server, and the first storage scheme indicates that the target storage location of the first data is a second server. The controller may send scheduling information to the first server and the second server to instruct them to move the first data from the first server to the second server.

[0283] Exemplarily, the controller may send scheduling information for the N data to instruct the N data to be moved from the current storage location to the target storage location.

[0284] For example, the controller may send scheduling information to the current storage location and target storage location of the N data (i.e., the P servers), and move the N data from the current storage location to an idle server, and then move the data from the idle server to the target storage location of the N data. For example, the idle server does not belong to the current storage location of the N data nor to the P servers.

[0285] It should be understood that the above is only an example, and the embodiments of the present application do not limit the specific implementation method of the scheduling process.

[0286] In the embodiment of the present application, steps 310 to 330 can be repeated. In other words, logs can be retrieved at regular intervals to calculate the intimacy between data, and then the data distribution can be re-determined. The data storage location can then be refreshed based on the new data distribution plan.

[0287] Steps 310 to 330 may be triggered and executed in various ways.

[0288] Exemplarily, steps 310 to 330 are executed periodically. The execution period can be set as needed.

[0289] Exemplarily, method 300 further includes: obtaining a first task request from the user, executing the first task in response to the first task request, and executing steps 310 to 330 when the migration cost during the execution of the first task is greater than or equal to threshold #3.

[0290] In other words, when the migration cost of a task is too high, steps 310 to 330 may be executed.

[0291] Exemplarily, when the migration cost of a task during execution of a task in the first time period is greater than or equal to threshold #4 and greater than or equal to threshold #5, steps 310 to 330 are performed.

[0292] In other words, if the number of tasks with a large migration cost is large within a period of time, steps 310 to 330 may be executed.

[0293] It should be understood that the above is only an example, and steps 310 to 330 may also be triggered in other ways, which is not limited in the embodiments of the present application.

[0294] FIG5 is a schematic flow chart illustrating another method for distributed data storage provided in an embodiment of the present application. The method 500 shown in FIG5 can be considered as a specific implementation of the method 300. For related descriptions, reference can be made to the method 300. To avoid repetition, some descriptions of the method 500 are omitted as appropriate.

[0295] As shown in FIG5 , method 500 includes the following steps.

[0296] 510. Obtain a log. The log indicates N data items involved in M ​​historical tasks. M is a positive integer. N is a positive integer.

[0297] 520. Construct a first intimacy relationship graph based on the log.

[0298] Exemplarily, step 520 may be implemented through steps 521 and 522 (not shown in FIG. 5 ).

[0299] 521. Construct a second intimacy relationship graph based on the log. Each of the N nodes in the second intimacy relationship graph corresponds to one data in the N data. In the process of constructing the second intimacy relationship graph, an edge is connected between the nodes corresponding to the data involved in the mth historical task in the M historical tasks, where m = 1, 2, ...M.

[0300] 522. Determine the first intimacy relationship graph based on the second intimacy relationship graph. Each of the N nodes in the second intimacy relationship graph corresponds to a node in the first intimacy relationship graph, and the weight of an edge between two nodes in the first intimacy relationship graph is based on the number of edges between the corresponding two nodes in the second intimacy relationship graph.

[0301] The following is an illustrative description of step 521 and step 522 using the log in the previous text as an example.

[0302] For example, the history indicated by the log includes:

[0303] 0 5

[0304] 1 2 3

[0305] 2 3 4

[0306] 0 1 5

[0307] The N data can be N data accessed by tasks, and the historical records are used to indicate the data accessed by M historical tasks. The historical records in the above example can be regarded as 4 groups of indexes, namely the indexes of the data accessed by 4 historical tasks, which are respectively used to indicate the data accessed by 4 historical tasks. Figure 6 shows a schematic diagram of the second intimacy relationship graph constructed based on the log. In the second intimacy relationship graph, the number of the node is the same as the index of the data corresponding to the node. The second intimacy relationship graph shown in Figure 6 can be obtained by the following method:

[0308] The data accessed by the first historical query includes the data with index 0 and the data with index 5. In the second closeness relationship graph, an edge is constructed between the node corresponding to the data with index 0 and the node corresponding to the data with index 5;

[0309] The data accessed by the second historical query includes the data with index 1, the data with index 2, and the data with index 3. An edge is constructed between every two nodes in the three nodes corresponding to these three data.

[0310] This process is deduced in this way until the data processing of all historical query accesses is completed, and the second intimacy relationship graph shown in FIG6 is obtained.

[0311] Figure 7 shows a schematic diagram of a first intimacy relationship graph constructed based on the above logs. The first intimacy relationship graph shown in Figure 7 can be obtained in the following manner:

[0312] In the second intimacy relationship graph, if the number of edges between two nodes is greater than 1, the edges between the two nodes are merged into 1, and the weight of the edge between the two nodes is set to the number of edges between the two nodes before the merger, thereby obtaining the first intimacy relationship graph shown in Figure 7.

[0313] For example, in the second intimacy relationship graph in FIG6 , the number of edges between the node corresponding to the data with index 1 and the node corresponding to the data with index 0 is 2, and the two edges are merged into one edge with a weight of 2.

[0314] Furthermore, the first intimacy relationship graph is represented as a matrix. The matrix includes N rows and N columns, where each of the N rows corresponds to a node in the first intimacy relationship graph, and each of the N columns corresponds to a node in the first intimacy relationship graph. Each element in the matrix is ​​used to represent the weight of the edge between the node corresponding to the row where the element is located and the node corresponding to the column where the element is located.

[0315] For example, the first intimacy relationship diagram shown in FIG7 can be represented as the following matrix.

[0316] The rows and columns of the matrix can be numbered from 0 to 5, the same as the node numbers. For example, in the first closeness relationship graph, the weight of the edge between node 0 and node 5 is 2. Then, the element at row 0, column 5 in the matrix is ​​2, and the element at row 5, column 0 is also 2.

[0317] 530 , segment the first intimacy relationship graph.

[0318] The first intimacy relationship graph is divided into P subgraphs with the goal of ensuring that the number of nodes in the P subgraphs of the first intimacy relationship graph is the same and the sum of the weights of the edges between the P subgraphs is minimized. The P subgraphs correspond to P nodes respectively. The target storage location of each data is the server corresponding to the subgraph to which the node corresponding to each data in the P subgraph belongs.

[0319] FIG8 is a schematic diagram showing a method for dividing a subgraph of the first intimacy relationship graph shown in FIG7 .

[0320] As shown in Figure 8 , P = 2. The edge between the two subgraphs includes two edges: the edge between the node numbered 1 and the node numbered 2, and the edge between the node numbered 1 and the node numbered 3. The weight of the edge between the two subgraphs is the sum of the weights of the two edges.

[0321] FIG. 9 is a schematic diagram showing a method of dividing another seed graph of the first intimacy relationship graph shown in FIG. 7 .

[0322] As shown in FIG9 , P=2.

[0323] The edges between the two subgraphs include five edges, namely, the edge between the node numbered 1 and the node numbered 3, the edge between the node numbered 1 and the node numbered 0, the edge between the node numbered 0 and the node numbered 5, the edge between the node numbered 4 and the node numbered 2, and the edge between the node numbered 2 and the node numbered 3. The statistical value of the weights of the edges between the two subgraphs is the sum of the weights of the five edges.

[0324] It should be understood that the above two division methods are only examples and do not constitute a limitation to the solutions of the embodiments of the present application.

[0325] The specific method of graph segmentation can refer to the description in method 300, and will not be described again here to avoid repetition.

[0326] It should be understood that the method 500 shown in FIG5 is merely an example and does not limit the solution of the embodiment of the present application.

[0327] The following describes an embodiment of the device of the present application in conjunction with Figures 10 and 11. It should be understood that the description of the method embodiment corresponds to the description of the device embodiment, and for specific descriptions, reference can be made to the relevant descriptions above. To avoid unnecessary repetition, repeated descriptions will be appropriately omitted when introducing the device embodiment.

[0328] Figure 10 is a schematic block diagram of an apparatus for distributed data storage according to an embodiment of the present application. The apparatus 1000 shown in Figure 10 can be used to execute the method for distributed data storage according to an embodiment of the present application, for example, method 300 or method 500.

[0329] As shown in FIG. 10 , the apparatus 1000 includes an acquisition unit 1010 and a processing unit 1020 .

[0330] In a possible implementation, the acquiring unit 1010 is configured to execute step 310 or step 510 ; the processing unit 1020 is configured to execute steps 320 to 330 or steps 520 to 530 .

[0331] The term "unit" herein may be implemented in software and / or hardware form and is not specifically limited thereto.

[0332] For example, a "unit" may be a software program, a hardware circuit, or a combination of the two that implements the aforementioned functions. For example, the implementation of a processing unit will be described below using the processing unit as an example. Similarly, the implementation of the acquisition unit and the output unit can refer to the implementation of the processing unit.

[0333] As an example of a software functional unit, a processing unit may include code running on a computing instance. The computing instance may include at least one of a physical host (computing device), a virtual machine, and a container. Furthermore, the computing instance may be one or more. For example, the processing unit may include code running on multiple hosts / virtual machines / containers. It should be noted that the multiple hosts / virtual machines / containers used to run the code may be distributed in the same region or in different regions. Furthermore, the multiple hosts / virtual machines / containers used to run the code may be distributed in the same availability zone (AZ) or in different AZs, each AZ including one data center or multiple geographically close data centers. Typically, a region may include multiple AZs.

[0334] Similarly, multiple hosts / virtual machines / containers running the code can be distributed within the same virtual private cloud (VPC) or across multiple VPCs. Typically, a VPC is set up within a region. Cross-region communication between two VPCs within the same region, or between VPCs in different regions, requires a communication gateway within each VPC to interconnect the VPCs.

[0335] As an example of a hardware functional unit, a processing unit may include at least one computing device, such as a server. Alternatively, the processing unit may be implemented using an application-specific integrated circuit (ASIC) or a programmable logic device (PLD). The PLD may be implemented using a complex programmable logical device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL), or any combination thereof.

[0336] The multiple computing devices included in a processing unit can be distributed in the same region or in different regions. They can also be distributed in the same AZ or in different AZs. Similarly, they can be distributed in the same VPC or across multiple VPCs. These multiple computing devices can be any combination of servers, ASICs, PLDs, CPLDs, FPGAs, GALs, and other computing devices.

[0337] Therefore, the modules of each example described in the embodiments of this application can be implemented with electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0338] It should be noted that, in other embodiments, the processing unit can be used to execute any step in the method of distributed data storage, and the acquisition unit can be used to execute any step in the method of distributed data storage. The steps that the acquisition unit and the processing unit are responsible for implementing can be specified as needed. The full functions of the device 1000 are realized by respectively implementing different steps in the method of distributed data storage by the acquisition unit and the processing unit.

[0339] The present application also provides a controller 1100. As shown in Figure 11, the controller 1100 includes: a processor 1004 and a communication interface 1008. Furthermore, the controller 1100 may also include a bus 1002 and a memory 1006. It should be understood that the bus 1002 and the memory 1006 are optional. The processor 1004, the memory 1006 and the communication interface 1008 communicate with each other via the bus 1002. Exemplarily, the controller 1100 can be a computing device or an apparatus in a computing device for implementing the method of an embodiment of the present application. The controller 1100 can be a server or a terminal device. It should be understood that the present application does not limit the number of processors and memories in the controller 1000.

[0340] Bus 1002 may be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, among others. Buses may be classified as address buses, data buses, control buses, and the like. For ease of illustration, FIG11 shows only one line, but this does not imply a single bus or type of bus. Bus 1004 may include a path for transmitting information between various components of controller 1000 (e.g., memory 1006, processor 1004, and communication interface 1008).

[0341] The processor 1004 may include any one or more processors such as a central processing unit (CPU), a graphics processing unit (GPU), a microprocessor (MP), or a digital signal processor (DSP).

[0342] The memory 1006 may include volatile memory, such as random access memory (RAM). The memory 1006 may also include non-volatile memory, such as read-only memory (ROM), flash memory, hard disk drive (HDD), or solid state drive (SSD).

[0343] The memory 1006 stores executable program code, and the processor 1004 executes the executable program code to implement the functions of the aforementioned acquisition unit and processing unit, thereby implementing the method for distributed data storage. In other words, the memory 1006 stores instructions for executing the method for distributed data storage.

[0344] The communication interface 1003 uses a transceiver module such as, but not limited to, a network interface card or a transceiver to implement communication between the controller 1100 and other devices or communication networks (eg, multiple servers). The communication interface may also be referred to as an interface circuit.

[0345] The present application also provides a computing device cluster. The computing device cluster includes a controller 1100 and multiple computing devices. The computing device can be a server, such as a central server, an edge server, or a local server in a local data center. In some embodiments, the computing device can also be a terminal device such as a desktop computer, a laptop computer, or a smartphone. The multiple computing devices can be the multiple servers mentioned above.

[0346] In a possible implementation, the controller 1100 is one of the multiple computing devices or a device in the computing device for implementing the above method.

[0347] In another possible implementation, the controller 1100 is another computing device other than the multiple computing devices or is a device in another computing device for implementing the above method.

[0348] The present application also provides a computer program product comprising instructions. The computer program product may be software or a program product comprising instructions that can be run on a computing device or stored in any available medium. When the computer program product is run on at least one computing device, the at least one computing device executes the method of the present application.

[0349] The present application also provides a computer-readable storage medium. The computer-readable storage medium can be any available medium that can be stored by a computing device or a data storage device such as a data center that contains one or more available media. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state drive). The computer-readable storage medium includes instructions that instruct the computing device to execute the method in the embodiment of the present application, or instruct the computing device to execute the method in the embodiment of the present application.

[0350] It should be understood that in the various embodiments of the present application, the size of the serial numbers of the above-mentioned processes does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.

[0351] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0352] Those skilled in the art will clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0353] In the several embodiments provided in this application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are merely schematic. For example, the division of the units is merely a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0354] The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected to achieve the purpose of this embodiment according to actual needs.

[0355] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.

[0356] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0357] The above description is merely a specific embodiment of the present application, but the scope of protection of the present application is not limited thereto. Any changes or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in this application should be included in the scope of protection of this application. Therefore, the scope of protection of this application should be based on the scope of protection of the claims.

Claims

1. A method for distributed data storage, It is characterized in that include: Obtain a log, where the log indicates N data involved in M ​​historical tasks executed by the server cluster, where M is a positive integer, and the N data are distributedly stored in the server cluster; Determine the intimacy between the N data according to the log, wherein the intimacy corresponding to any two data among the N data is used to indicate the possibility that the two data are related to the same task, and N is an integer greater than 1; The storage locations of the N data are updated according to the intimacy between the N data.

2. The method according to claim 1, It is characterized in that The determining the intimacy between the N data according to the log includes: The intimacy between the N data is determined according to the number of times the N data is involved in the same historical task among the M historical tasks.

3. The method according to claim 2, It is characterized in that The intimacy corresponding to any two data among the N data is positively correlated with the number of times the two data are involved in the same historical task among the M historical tasks.

4. The method according to any one of claims 1 to 3, It is characterized in that The updating the storage locations of the N data according to the intimacy between the N data includes: The storage locations of the N data are updated according to a first storage scheme, wherein the first storage scheme indicates the target storage locations of the N data in P servers in the server cluster, where P is an integer greater than 1, the statistical value of the intimacy between the P servers in the first storage scheme is less than or equal to a first threshold, and the intimacy between two of the P servers in the first storage scheme is based on the intimacy between the data corresponding to one of the two servers and the data corresponding to the other server.

5. The method according to claim 4, It is characterized in that The first storage scheme is an element in a set consisting of multiple storage schemes, each of the multiple storage schemes respectively indicates a different storage location of the N data in the P servers, and the first threshold is the minimum value of the statistical value of the intimacy between the P servers in the other storage schemes among the multiple storage schemes except the first storage scheme.

6. The method according to any one of claims 1 to 5, It is characterized in that The updating the storage locations of the N data according to the intimacy between the N data includes: Scheduling information is sent to a first server in the server cluster and a second server in the server cluster according to the intimacy between the N data, wherein the scheduling information indicates that first data among the N data stored in the first server is moved to the second server.

7. The method according to any one of claims 1 to 6, It is characterized in that The determining the intimacy between the N data according to the log includes: A first intimacy relationship graph is constructed based on the log, each of the N nodes in the first intimacy relationship graph corresponds to one of the N data, and the weight of the edge between two nodes in the first intimacy relationship graph is used to indicate the intimacy between the two data corresponding to the two nodes.

8. The method according to claim 7, It is characterized in that The step of constructing a first intimacy relationship graph according to the log includes: A second intimacy relationship graph is constructed according to the log, wherein each of the N nodes in the second intimacy relationship graph corresponds to one of the N data, and in the process of constructing the second intimacy relationship graph, an edge is connected between the nodes corresponding to the data involved in the mth historical task in the M historical tasks, where m=1, 2, ...M; The first intimacy relationship graph is determined based on the second intimacy relationship graph, each of the N nodes in the second intimacy relationship graph corresponds to a node in the first intimacy relationship graph, and the weight of the edge between two nodes in the first intimacy relationship graph is based on the number of edges between the corresponding two nodes in the second intimacy relationship graph.

9. The method according to claim 7 or 8, It is characterized in that The P subgraphs of the first intimacy relationship graph correspond to P servers respectively, and the P subgraphs are obtained by dividing the first intimacy relationship graph with the goal of making the number of nodes in the P subgraphs the same and the statistical value of the weights of the edges between the P subgraphs minimized. In the P servers, the target storage location of each data is the server corresponding to the subgraph to which the node corresponding to each data in the P subgraph belongs.

10. The method according to claim 9, It is characterized in that The partitioning of the first intimacy relationship graph with the goal of making the number of nodes in the P subgraphs the same and the statistical value of the weights of the edges between the P subgraphs minimum is implemented based on a quantum heuristic algorithm.

11. The method according to claim 10, It is characterized in that P=2, and the objective function solved by the quantum heuristic algorithm satisfies the following formula: Among them, s i is the i-th spin variable among N spin variables, s j is the jth spin variable among the N spin variables, the N spin variables correspond to the N data respectively, the value of the spin variable is 1 or -1, and the data corresponding to the spin variables with the same value belong to the same subgraph, J i,j represents the relationship between the i-th data and the j-th data, J i,j Determined based on the intimacy between the i-th data and the j-th data.

12. The method according to any one of claims 7 to 11, It is characterized in that The first intimacy relationship graph is represented by a matrix, which includes N rows and N columns, each of the N rows corresponds to a node in the first intimacy relationship graph, each of the N columns corresponds to a node in the first intimacy relationship graph, and each element in the matrix is ​​used to represent the weight of the edge between the node corresponding to the row where each element is located and the node corresponding to the column where each element is located.

13. A controller, It is characterized in that include: A processor, configured to determine the intimacy between N data according to a log, wherein the intimacy corresponding to any two data among the N data is used to indicate the possibility that the two data are related to the same task, N is an integer greater than 1, the log indicates the N data involved in M ​​historical tasks executed by a server cluster, M is a positive integer, and the N data are distributedly stored in the server cluster; The interface circuit is used to update the storage locations of the N data according to the intimacy between the N data.

14. The controller according to claim 13, It is characterized in that The processor is specifically used for: The intimacy between the N data is determined according to the number of times the N data is involved in the same historical task among the M historical tasks.

15. The controller according to claim 14, It is characterized in that The intimacy corresponding to any two data among the N data is positively correlated with the number of times the two data are involved in the same historical task among the M historical tasks.

16. A controller according to any one of claims 13 to 15, It is characterized in that The interface circuit is specifically used for: The storage locations of the N data are updated according to the first storage scheme, the first storage scheme indicates the target storage locations of the N data in P servers in the server cluster, P is an integer greater than 1, the statistical value of the intimacy between the P servers in the first storage scheme is less than or equal to a first threshold, and the intimacy between two servers among the P servers in the first storage scheme is based on the intimacy between the data corresponding to one of the two servers and the data corresponding to the other server.

17. The controller according to claim 16, It is characterized in that The first storage scheme is an element in a set consisting of multiple storage schemes, each of the multiple storage schemes respectively indicates a different storage location of the N data in the P servers, and the first threshold is the minimum value of the statistical value of the intimacy between the P servers in the other storage schemes among the multiple storage schemes except the first storage scheme.

18. A controller according to any one of claims 13 to 17, It is characterized in that The interface circuit is specifically used for: Scheduling information is sent to a first server in the server cluster and a second server in the server cluster according to the intimacy between the N data, wherein the scheduling information indicates that first data among the N data stored in the first server is moved to the second server.

19. A controller according to any one of claims 13 to 18, It is characterized in that The processor is specifically used for: A first intimacy relationship graph is constructed based on the log, each of the N nodes in the first intimacy relationship graph corresponds to one of the N data, and the weight of the edge between two nodes in the first intimacy relationship graph is used to indicate the intimacy between the two data corresponding to the two nodes.

20. The controller according to claim 19, It is characterized in that The processor is specifically used for: A second intimacy relationship graph is constructed according to the log, wherein each of the N nodes in the second intimacy relationship graph corresponds to one of the N data, and in the process of constructing the second intimacy relationship graph, an edge is connected between the nodes corresponding to the data involved in the mth historical task in the M historical tasks, where m=1, 2, ...M; The first intimacy relationship graph is determined based on the second intimacy relationship graph, each of the N nodes in the second intimacy relationship graph corresponds to a node in the first intimacy relationship graph, and the weight of the edge between two nodes in the first intimacy relationship graph is based on the number of edges between the corresponding two nodes in the second intimacy relationship graph.

21. A controller according to claim 19 or 20, It is characterized in that The P subgraphs of the first intimacy relationship graph correspond to P servers respectively, and the P subgraphs are obtained by dividing the first intimacy relationship graph with the goal of making the number of nodes in the P subgraphs the same and the statistical value of the weights of the edges between the P subgraphs minimized. In the P servers, the target storage location of each data is the server corresponding to the subgraph to which the node corresponding to each data in the P subgraph belongs.

22. The controller according to claim 21, It is characterized in that The partitioning of the first intimacy relationship graph with the goal of making the number of nodes in the P subgraphs the same and the statistical value of the weights of the edges between the P subgraphs minimum is implemented based on a quantum heuristic algorithm.

23. The controller according to claim 22, It is characterized in that P=2, and the objective function solved by the quantum heuristic algorithm satisfies the following formula: Among them, s i is the i-th spin variable among N spin variables, s j is the jth spin variable among the N spin variables, the N spin variables correspond to the N data respectively, the value of the spin variable is 1 or -1, and the data corresponding to the spin variables with the same value belong to the same subgraph, J i,j represents the relationship between the i-th data and the j-th data, J i,j Determined based on the intimacy between the i-th data and the j-th data.

24. A controller according to any one of claims 19 to 23, It is characterized in that The first intimacy relationship graph is represented by a matrix, which includes N rows and N columns, each of the N rows corresponds to a node in the first intimacy relationship graph, each of the N columns corresponds to a node in the first intimacy relationship graph, and each element in the matrix is ​​used to represent the weight of the edge between the node corresponding to the row where each element is located and the node corresponding to the column where each element is located.

25. A controller, It is characterized in that The controller comprises a processor and a memory, wherein the processor is configured to execute instructions stored in the memory so as to enable the controller to execute the method according to any one of claims 1 to 12.

26. A computing device cluster, It is characterized in that The device comprises a plurality of servers and a controller as claimed in any one of claims 13 to 24.

27. A computer-readable storage medium, It is characterized in that The method comprises computer program instructions, and when the computer program instructions are executed by a computing device cluster, the computing device cluster performs the method according to any one of claims 1 to 12.

28. A computer program product comprising instructions, It is characterized in that When the instructions are executed by a computing device cluster, the computing device cluster is caused to perform the method according to any one of claims 1 to 12.

Citation Information

Patent Citations

  • Data processing method and device, electronic equipment and storage medium

    CN113296981A

  • Data processing method and device

    CN114116790A

  • Data processing method and device

    CN114625695A

  • Data file processing method and device, equipment and storage medium

    CN115495015A

  • System For Optimizing Storage Replication In A Distributed Data Analysis System Using Historical Data Access Patterns

    US20200065415A1