Multi-replica storage method, and related apparatus
By determining the backup node based on the collaborative node set in the distributed system, multi-copy storage is realized, which solves the problems of insecurity and complex management logic of centralized storage, and improves the availability and storage efficiency of data.
Patent Information
- Application Number
- PCT/CN2024/087512
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-04-18
- Filing Date
- 2024-04-12
- Publication Date
- 2024-10-24
AI Technical Summary
In distributed systems, the centralized data storage method makes data storage unsafe. When a single node fails, backup files and source files are unavailable, and each node needs to run complex multi-copy storage management logic, which increases the algorithm burden.
By determining the backup node based on the pre-established collaborative node set in the first node of the distributed system, and storing the source files in the backup node, unified multi-copy storage management of multiple nodes is achieved without running on each node. Multi-copy storage management logic uses different node backups to avoid file unavailability problems caused by damage to a single node.
It realizes multi-copy storage of source files, improves the availability of backup files, reduces the algorithm burden on nodes, avoids the situation where both backup files and source files are unavailable due to damage to a single node, simplifies file reading logic, and satisfies users file reading requirements.
Smart Images

Figure CN2024087512_24102024_PF_FP_ABST
Abstract
Description
A multi-copy storage method and related device
[0001] This application claims priority to the Chinese patent application filed with the China Patent Office on April 18, 2023, with application number 202310449317.2 and invention name “A multi-copy storage method and related device”, the entire contents of which are incorporated by reference into this application. Technical Field
[0002] The embodiments of the present application relate to the field of computer application technology, specifically, to object storage technology, and more specifically, to a multi-copy storage method and related devices. Background Art
[0003] Currently, distributed systems often use centralized cloud storage. Large amounts of user data are stored in central nodes. End users can access the stored data by accessing the central nodes.
[0004] However, the way central nodes store data will lead to serious centralization problems in data storage. The distance between user terminals and data is far. In addition, if the central node fails, it will directly lead to user data unavailability.
[0005] Summary of the Invention
[0006] Multiple embodiments of the present application provide a multi-copy storage method and related devices to achieve the purpose of multi-copy storage of data.
[0007] In a first aspect, an embodiment of the present application provides a multi-copy storage method, which is applied to a first node of a distributed system, wherein the distributed system further includes a collaborative node set, the collaborative node set includes multiple second nodes, and the first node is configured to perform multi-copy storage management on the collaborative node set. The multi-copy storage method includes:
[0008] receiving a storage message notification sent by a source node storing a source file, wherein the storage message notification is used to notify the source node that the source file is stored, and the source node is a second node in the collaborative node set;
[0009] In the collaborative node set, determining at least one second node other than the source node as a backup node;
[0010] A backup instruction is sent to the backup node, where the backup instruction is used to instruct the backup node to back up the source file.
[0011] In a second aspect, an embodiment of the present application provides a multi-copy storage device, applied to a first node of a distributed system, wherein the distributed system further includes a collaborative node set, the collaborative node set includes multiple second nodes, the first node is configured to perform multi-copy storage management on the collaborative node set, and the multi-copy storage device includes:
[0012] a message receiving module, configured to receive a storage message notification sent by a source node storing a source file, wherein the storage message notification is used to notify the source node that the source file is stored therein, the source node being a second node in the collaborative node set;
[0013] a node determination module, configured to determine, in the collaborative node set, at least one second node other than the source node as a backup node, the collaborative node set including a plurality of the second nodes;
[0014] An instruction sending module is used to send a backup instruction to the backup node, where the backup instruction is used to instruct the backup node to back up the source file.
[0015] In a third aspect, an embodiment of the present application provides an edge cloud computing system, comprising: a first node and a plurality of second nodes; wherein,
[0016] The first node is used to store multiple copies of the source file stored in the second node according to any of the multiple copy storage methods described above.
[0017] In a fourth aspect, an embodiment of the present application provides an electronic device, including: a processor and a memory;
[0018] The memory is connected to the processor, and is used to store computer programs;
[0019] The processor is configured to implement the above-mentioned multi-copy storage method by running the computer program stored in the memory.
[0020] In a fifth aspect, an embodiment of the present application provides a storage medium on which a computer program is stored. When the computer program is executed by a processor, the multi-copy storage method as described above is implemented.
[0021] In a sixth aspect, an embodiment of the present application provides a computer program product or a computer program, wherein the computer program product or the computer program includes computer instructions, and the computer instructions are stored in a computer-readable storage medium; the processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor implements the steps of the above-mentioned multi-copy storage method when executing the computer instructions.
[0022] The multiple implementations provided in this application utilize a first node, based on a pre-established set of collaborative nodes, to determine a backup node for backing up a source file, and store the source file in the backup node, thereby achieving unified multi-copy storage management for multiple second nodes. This eliminates the need to run multi-copy storage management logic in each second node, which helps reduce the algorithmic burden on the second nodes. Furthermore, since the backup node and the source node are different second nodes, cross-node backup of the source file can be achieved, avoiding the situation where both the backup file and the source file are unavailable due to damage to a single node, achieving multi-copy storage of the source file and resolving the issue of poor backup file availability. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] In the accompanying drawings, unless otherwise specified, the same reference numerals throughout the multiple drawings represent the same or similar components or elements. These drawings are not necessarily drawn to scale. It should be understood that these drawings only depict some embodiments disclosed in this application and should not be construed as limiting the scope of this application.
[0024] FIG1 is a schematic diagram of an application scenario of a multi-copy storage method provided by one embodiment of the present application;
[0025] FIG2 is a schematic diagram of a flow chart of a multi-copy storage method provided in one embodiment of the present application;
[0026] FIG3 is a schematic diagram of the structure of a collaborative node set provided by one embodiment of the present application;
[0027] FIG4 is a schematic diagram of a flow chart of a multi-copy storage method provided in another embodiment of the present application;
[0028] FIG5 is a schematic structural diagram of a multi-copy storage device provided by one embodiment of the present application;
[0029] FIG6 is a schematic structural diagram of a multi-copy storage device provided by another embodiment of the present application;
[0030] FIG7 is a schematic structural diagram of an electronic device provided in one embodiment of the present application. DETAILED DESCRIPTION
[0031] To make the purpose, technical solutions, and advantages of the embodiments of this application more clear, the technical solutions in the embodiments of this application will be clearly and completely described below in conjunction with the drawings in the embodiments of this application. Obviously, the described embodiments are part of the embodiments of this application, not all of the embodiments. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without making creative efforts are within the scope of protection of this application.
[0032] In related technologies, multi-copy storage in distributed systems is mostly limited to one node. For example, file backup is performed in different storage areas or different hosts in a data center. This multi-copy storage method can only provide backup files when a single host or storage area is damaged. When the entire data center is damaged due to natural disasters or human factors, the source files and backup files will be lost together, resulting in the problem that the files required by users are unavailable.
[0033] In order to solve this problem, the inventors have discovered after long-term research that it is possible to store multiple copies of files between different nodes to avoid the problem of file unavailability when a single node is damaged. For example, after a source node stores a source file, if it needs to store multiple copies of the source file, a communication connection can be established between the source node and the backup node. Based on the established communication connection, the source node sends the source file to the backup node and instructs the backup node to back up the source file. During this process, if the backup node is unavailable, the entire backup process cannot be completed. And because each node in the distributed system may have the need to store multiple copies of files, this requires each node to have a complete set of execution logic for multiple copy storage, which makes the node management logic complex.
[0034] In order to solve this problem, the inventors discovered through further research that the first node can determine the backup node for backing up the source file based on a pre-established set of collaborative nodes, and store the source file in the backup node, thereby realizing unified multi-copy storage management of multiple second nodes. There is no need to run the multi-copy storage management logic in each second node, which helps to reduce the algorithm burden of the second node. In addition, the backup node and the source node are different second nodes, which can realize the different-node backup of the source file, avoiding the situation where the backup file and the source file are unavailable due to damage to a single node, realizing multi-copy storage of the source file, and solving the problem of poor availability of the backup file. In addition, the corresponding file reading logic can also be designed in the first node to meet the user's demand for reading files.
[0035] Based on the above concept, an embodiment of the present application provides a multi-copy storage method, which will be exemplarily described below with reference to the accompanying drawings.
[0036] Referring to Figure 1, Figure 1 shows a feasible application scenario of a multi-copy storage method, which can be a distributed system, specifically a distributed storage system or a distributed computing system. The file storage method in the distributed system can be object storage (Object Storage), which is an object-based data storage that manages and operates data as different units. Each data unit (object) has a metadata description. Specifically, in this distributed system, the stored file (data unit) contains corresponding metadata (Metadata), which is used to describe the properties of the file (such as the size, modification time, storage location, etc. of the file). In this way, the storage method in which metadata and files correspond one to one supports multi-threaded parallel reading, which solves the problem that distributed systems based on block storage (Block Storage) can only read files sequentially. At the same time, distributed systems that store files in object storage also have the characteristics of high scalability.
[0037] In Figure 1, the distributed system 10 includes multiple nodes 11. The node 11 can be an Internet Data Center (IDC), a server, or a user-side device (such as a gateway, etc.) and its corresponding network environment. The client 12 communicates with the distributed system 10 through the network. The distributed system 10 can set up specific physical nodes (such as data centers) or program nodes (such as collaborative storage centers) to execute the multi-copy storage method provided by the embodiment of the present application. The above-mentioned collaborative storage center can be mounted on a certain node 11. Users can access the distributed system 10 through the client 12 and use the various services provided by the distributed system 10.
[0038] In a specific application scenario, the distributed system can be an edge cloud computing system, and the node 11 in the edge cloud computing system can be an edge node. The edge node can be a data center or a user-side node (such as an edge gateway or a home gateway). The edge node has the characteristic of being closer to the user side, and the user can access data at a closer distance. Specifically, the edge cloud computing system is a cloud computing platform built on edge infrastructure (i.e., edge nodes) based on the core of cloud computing technology and the capabilities of edge computing. It places network forwarding, storage, computing, intelligent data analysis and other tasks at the edge (i.e., close to the user side) to reduce response latency, alleviate cloud pressure, reduce bandwidth costs, and provide cloud services such as full-network scheduling and computing power distribution.
[0039] In the application scenario shown in Figure 1, the client 12 can be an electronic device with network access capabilities. Specifically, for example, the client 12 can be a desktop computer, tablet computer, laptop computer, smartphone, digital assistant, smart wearable device, shopping guide terminal, television, smart speaker, microphone, etc. Smart wearable devices include, but are not limited to, smart bracelets, smart watches, smart glasses, smart helmets, smart necklaces, etc. Alternatively, the client can be software that can run on the electronic device. In the distributed system 10, the node 11 can include at least one server. The server can be an electronic device with certain computing and processing capabilities. It can have a network communication module, a processor, and memory. Of course, the server can also refer to software running on the electronic device. The server can also be a distributed server, which can be a system with multiple processors, memories, network communication modules, etc. operating in coordination. Alternatively, the server can be a server cluster formed by multiple servers. Alternatively, with the advancement of science and technology, the server can also be a new technical means that can implement the corresponding functions of the embodiments of this specification. For example, it can be a new form of "server" based on quantum computing.
[0040] One embodiment of the present application provides a multi-copy storage method, which is applied to a first node of a distributed system, wherein the distributed system further includes a collaborative node set, the collaborative node set including a plurality of second nodes, and the first node is configured to perform multi-copy storage management on the collaborative node set using the multi-copy storage method. As shown in FIG2 , the multi-copy storage method includes:
[0041] S201: Receive a storage message notification sent by a source node storing a source file, where the storage message notification is used to notify that the source file is stored in the source node, and the source node is a second node in the collaborative node set.
[0042] The storage message notification may be a message sent by the source node to the first node after storing the source file, that is, the storage message notification is used to notify the first node that the source file is stored in the source node. More specifically, the message may be used to notify the first node that the operation of storing the source file has occurred in the source node. In some embodiments, in order to indicate relevant information of the stored source file and facilitate search and management, the storage message notification may carry metadata of the source file, and the metadata is used to represent attribute information of the source file (such as the storage location, size, modification time, etc. of the source file).
[0043] As mentioned above, the first node can be a management node with management functions in a distributed system. The management node can be a physical node (such as a data center) or a program node running in a physical node of the distributed system (such as a collaborative storage center running in a physical node). The second node can refer to a physical node with a storage space (Bucket). The storage space can be a container for storing objects (Object), and the object belongs to a certain storage space. The first node and the second node can be different nodes in the distributed system. The storage space can have various configuration attributes, which may include region, access rights, storage type, etc. In this embodiment, each second node can be a node located in a different geographic grid to achieve off-site backup of the source file. According to a unified rule, the ground area is continuously divided according to certain longitude and latitude or ground distance, and the spatial uncertainty is controlled within a certain range to form regular polygons. Each polygon is called a geographic grid, thereby achieving discretization of the ground space. The division method and size of the geographic grid can be determined according to actual conditions, and this application does not limit this.
[0044] In some embodiments, in order to avoid repeated backup, the source node may refer to the second node that first stores the source file in the distributed system, or the multi-copy storage method provided in the embodiment of the present application does not perform subsequent backup operations for the storage message notification reported by the second node that stores the backup file, thereby avoiding cyclic backup of the same file.
[0045] S202: Determine at least one second node other than the source node in the collaborative node set as a backup node.
[0046] The collaborative node set includes multiple second nodes, which may mean that the collaborative node set includes storage space for multiple second nodes and target node lists for multiple second nodes. That is, the collaborative node set may include a target node list and a logical storage space (logical bucket), for example, it may be a set that logically integrates the target lists of multiple second nodes and the storage space of these second nodes. In some embodiments, the collaborative node set may correspond to a user, and the collaborative node set includes a target node list configured by the user corresponding to the collaborative node set and the storage space of the second nodes in the list. A first node can perform multi-copy storage management on multiple collaborative node sets to achieve global centralized multi-copy storage management.
[0047] Referring to Figure 3, a schematic diagram of the structure of a collaborative node set is shown. In Figure 3, collaborative node set 1 includes a target node list consisting of three second nodes and storage space. These three second nodes may be second nodes A, B, and C, respectively, and the corresponding storage spaces are Bucket A, Bucket B, and Bucket C, respectively, for second node A. In some embodiments, to improve the efficiency of determining a backup node from a combination of collaborative nodes, the collaborative node set may further include associations between the second nodes. Still referring to Figure 3, for example, in collaborative node set 1, second node A is associated with second node B and second node C, second node B is associated with second node A, and second node C is associated with second node B and second node A. Accordingly, Bucket A is associated with Bucket B and Bucket C, Bucket B is associated with Bucket A, and Bucket C is associated with Bucket B and Bucket A. A single second node may be associated with one or more other second nodes, but this application does not limit this. When a single second node is associated with multiple other second nodes, taking the second node A in Figure 3 as an example, when there is a backup requirement for the source file in the second node A, the source file can be backed up in the second node B or in the second node C. In some embodiments, it can also be backed up in the second node B and the second node C at the same time. This application does not limit this.
[0048] In this way, when determining a backup node from a collaborative node set, an available second node can be first determined from the nodes associated with the source node as a backup node. When the nodes associated with the source node are all in an abnormal state (for example, in a network cutover state or an unavailable state), other second nodes can be determined as backup nodes from the target node list of the collaborative node set. This can improve the efficiency of determining the second node.
[0049] In one embodiment, different second nodes in the same area (for example, the same province or the same city) can be associated with each other, so that the backup node of the source node can be determined preferentially in the same area, shortening the communication path length between the backup node and the source node and improving the backup efficiency.
[0050] S203: Send a backup instruction to the backup node, where the backup instruction is used to instruct the backup node to back up the source file.
[0051] After determining the backup node for backing up the source file, the first node may send a backup instruction to the backup node to instruct the backup node to perform backup storage on the source file to implement multi-copy storage.
[0052] In the described multi-copy storage method, a first node determines a backup node for backing up a source file based on a pre-established set of collaborative nodes, and stores the source file on the backup node. This enables unified multi-copy storage management for multiple second nodes, eliminating the need to run multi-copy storage management logic on each second node, which helps reduce the algorithmic burden on the second nodes. Furthermore, since the backup node and the source node are different second nodes, cross-node backup of the source file can be achieved, avoiding the situation where both the backup file and the source file become unavailable due to a single node failure. This enables multi-copy storage of the source file and addresses the issue of poor backup file availability.
[0053] In some implementations, a method for implementing on-demand backup is provided. Specifically, determining at least one second node other than the source node in the collaborative node set as a backup node includes:
[0054] If the collaborative node set to which the source node belongs is in a global backup state, then determining at least one second node other than the source node in the collaborative node set as a backup node;
[0055] If the collaborative node set to which the source node belongs is in a partial backup state, then when the source file meets a preset condition, at least one second node other than the source node in the collaborative node set is determined as a backup node.
[0056] In this embodiment, the collaborative node set may include a global backup state and a partial backup state. The user may configure the state of the collaborative node set according to needs.
[0057] When the collaborative node set is in the global backup state, when the second node in the collaborative node set writes the source file, the source file will be backed up. If the user's files are relatively important, the collaborative node set can be set to the global backup state to meet the need for automatic backup of all files stored in the collaborative node set.
[0058] When the collaborative node set is in a partial backup state, the source file will be backed up only when it meets the preset conditions, meeting the user's on-demand backup needs of backing up important files but not backing up unimportant files.
[0059] In an optional embodiment, a convenient condition setting method is provided. Specifically, the preset condition includes: the file name prefix of the source file matches a preset prefix template.
[0060] For example, assuming that the preset prefix template includes: a / *, then the file name prefix of the file named a / test.mp4 matches the prefix template and requires multiple copies of backup. However, the file name prefix of the file named b / test.mp4 does not match the prefix template and does not require multiple copies of backup. By simply matching the file name prefix with the prefix template, it is possible to easily and quickly determine which source files require multiple copies of backup and which source files do not require multiple copies of backup, which is conducive to improving the execution efficiency of the method. In addition, after the user sets the prefix template, the file name prefix can be used to distinguish between files that require multiple copies of backup and files that do not require multiple copies of backup by naming the file name. It has the characteristics of simple implementation and easy operation, and does not require users to pay a lot of learning costs.
[0061] In order to conveniently identify which files are stored in the collaborative node set for the first time and which files are stored in the collaborative node set as backup files of the source files, in some embodiments, the second node includes a first storage space and a second storage space; the source node stores the source file in the first storage space;
[0062] The backup instruction is specifically used to instruct the backup node to back up the source file in the second storage space.
[0063] In this implementation, the storage space of the second node is divided into two categories: one is called the first storage space (also called the primary storage space), which is used to store source files that are initially stored in the collaborative node set; the other is called the second storage space (also called the backup storage space), which is used to back up source files. This allows the storage message to notify the corresponding file of its storage space type, thereby determining whether the file is a source file or a backup source file, which is simple and easy to implement.
[0064] In a feasible embodiment, a feasible method for determining a source file and a backup file of the source file based on a storage location is provided, which may specifically include: the storage message notification carries storage location information, and the storage location information is used to represent the storage location of the source file;
[0065] Determining at least one second node other than the source node in the collaborative node set as a backup node includes:
[0066] If the storage location information indicates that the source file is stored in the first storage space, at least one second node other than the source node in the collaborative node set is determined as a backup node.
[0067] If the storage location information indicates that the source file is stored in the second storage space, the source file is determined to be a backup source file, and multiple copies of the backup are not performed.
[0068] In this embodiment, the storage notification message carries storage location information, which can be included in the metadata of the source file. This partitioning of the second node's storage space allows for categorization of the storage areas for the source file and the backup source file. This allows for distinguishing between the backup file and the first-stored file based on the storage location information in the source file's metadata, providing a simple and easy way to avoid cyclic backups of the source file.
[0069] In order to meet the user's query requirements for stored files, in one embodiment of the present application, the storage message notification carries metadata, and the metadata is used to characterize the attributes of the files stored in the source node and the backup node;
[0070] As shown in FIG4 , the multi-copy storage method further includes:
[0071] S401: In response to a file read instruction, the source node or the backup node storing the target file is used as a read node; the file read instruction carries metadata of the target file;
[0072] S402: Return the address of the target file in the read node as a response result to the requester of the file read instruction.
[0073] As mentioned above, file attributes may include information such as file size, modification time, storage location, file type, and file name. By using metadata representing the above information, the target file to be queried by the user can be accurately determined, and then the target file can be read from the source node or backup node where the target file is stored and returned as a response result to the requester of the file read instruction, thereby satisfying the user's query requirements for the file. During the reading process, after the first node determines the target file based on the metadata carried by the file read instruction, it automatically uses the source node or backup node as the reading node and returns the address of the target file in the reading node. The user does not need to specify which node to use as the reading node, which can simplify user operations, reduce user learning costs, and improve user experience.
[0074] Factors used by the first node to determine the read node may include the geographical location of the source node and the backup node, resource levels (remaining storage resource capacity of the second node, network bandwidth), and other factors.
[0075] In this embodiment, the response result of the file read instruction is the address of the target file in the reading node. The requester can actually access the target file based on the address. The first node does not read or write the target file, which is beneficial to reducing the data processing volume of the first node and improving the execution efficiency of the method.
[0076] In some implementations, a feasible method for reading a target file is provided. Specifically, using the source node or the backup node storing the target file as a reading node includes:
[0077] Determine a source node and a backup node storing the target file according to the metadata of the target file;
[0078] When the determined source node is available, using the source node as the reading node;
[0079] When the determined source node is unavailable, the backup node is used as the reading node.
[0080] In this embodiment, the source node is preferentially used as the reading node because, in general, the source node may have storage or communication advantages. For example, in some cases, the storage period of the target file in the source node is longer than the storage period of the target file in the backup node, which can meet the user's access to the target file for a longer period of time. In other cases, when the target file is stored for the first time, the first node can select a second node as the source node to store the file based on factors such as the location, communication status, and bandwidth of the second node. In this way, when reading, using the source node as the reading node of the target file can improve the efficiency of the first node in reading the target file.
[0081] As described above, in some implementations, a time limit for the backup node to back up the source file may be specified. Specifically, the backup instruction is used to instruct the backup node to obtain the source file from the source node and store the source file within a preset time period.
[0082] In this embodiment, the backup instruction can specify a preset time period for the backup node to store the source file. This preset time period can be the same as or different from the time period for the source node to store the source file, thereby achieving differentiated management between the source file and the backed-up source file. Furthermore, the first node only issues the backup instruction, while the backup node reads the source file from the source node. This eliminates the need for the first node to perform file read and write operations, thus reducing the data processing workload of the first node.
[0083] As described above, when the collaborative node set further includes an association relationship between the second nodes, determining at least one second node other than the source node in the collaborative node set as a backup node includes:
[0084] At least one second node in the collaborative node set to which the source node belongs and which has an association relationship with the source node is used as the backup node.
[0085] In this embodiment, when determining a backup node from a collaborative node set, an available second node can be first determined from the nodes associated with the source node as a backup node. When all nodes associated with the source node are in an abnormal state (for example, in a network cutover state or an unavailable state), other second nodes can be determined as backup nodes from the target node list of the collaborative node set. This can improve the efficiency of determining the backup node. In some embodiments, different second nodes in the same area (for example, the same province or the same city) can also be associated with each other, and second nodes in adjacent geographical grids can also be associated with each other. In this way, the backup node of the source node can be determined preferentially within the same area, shortening the communication path length between the backup node and the source node, thereby improving the backup efficiency.
[0086] As described above, the first node may automatically schedule according to the resource level of the second node when backing up the source file. Specifically, in one embodiment, determining at least one second node other than the source node in the collaborative node set as a backup node includes:
[0087] At least one second node other than the source node is determined as a backup node based on status parameters of the second node in the collaborative node set, wherein the status parameters include at least one of the geographical location of the second node, the remaining amount of storage resources of the second node, and the network bandwidth capacity of the second node.
[0088] The remaining storage resources of the second node and the network bandwidth capacity of the second node can be referred to as the resource water level of the second node. The network bandwidth capacity of the second node can refer to the total network bandwidth capacity of the second node or the available network bandwidth capacity of the second node, which is not limited in this application. Automatically scheduling backup files based on the status parameters of the collaborative node set can achieve load balancing among the second nodes to a certain extent.
[0089] In some embodiments, determining, based on the state parameters of the second nodes in the collaborative node set, at least one second node other than the source node as a backup node includes:
[0090] A second node whose geographical location is close to the user's location is determined as the backup node, or a second node with the highest remaining storage resource and network bandwidth capacity is determined as the backup node.
[0091] In addition to the above method, the distance between the geographical location of the second node and the user's location can also be weighted and scored, and the remaining storage resources and network bandwidth capacity of the second node can also be weighted and scored. The second node with the highest weighted sum of the scores of various parameters is determined as the backup node. In this way, on the basis of achieving load balancing of each second node, the need to store backup files close to the user side can also be taken into account.
[0092] In addition to automatically scheduling the first node based on the resource level of the second node when storing the backup file, in some embodiments, the first node can also automatically schedule between the source node and the backup node when reading the target file. The automatic scheduling of target file reading can be based on achieving load balancing between each source node and the backup node, and can also take into account the node close to the user side as the reading node to improve the efficiency of user reading files. The automatic scheduling process during the reading process can be similar to the automatic scheduling method when storing the backup file, and this application will not go into details here.
[0093] The present application also provides a multi-copy storage device, as shown in FIG5 , which is applied to a first node of a distributed system. The distributed system further includes a collaborative node set, the collaborative node set including a plurality of second nodes, the first node being configured to perform multi-copy storage management on the collaborative node set. The multi-copy storage device includes:
[0094] A message receiving module 501 is configured to receive a storage message notification sent by a source node storing a source file, wherein the storage message notification is used to notify the source node that the source file is stored therein, and the source node is a second node in the collaborative node set;
[0095] a node determination module 502 configured to determine, in the collaborative node set, at least one second node other than the source node as a backup node, the collaborative node set including a plurality of second nodes;
[0096] The instruction sending module 503 is used to send a backup instruction to the backup node, where the backup instruction is used to instruct the backup node to back up the source file.
[0097] Referring to Figure 6 , it illustrates a feasible specific structure and a feasible process for file reading and writing in a multi-copy storage device. In Figure 6 , when a user first stores a source file on a source node, the source node uploads a storage message notification to the Meta Information Aggregation Module of the first node. This Meta Information Aggregation Module implements the function of the message receiving module 501 receiving the storage message notification sent by the source node and storing the metadata in the storage message notification in the core library. Furthermore, the Meta Information Aggregation Module can also determine whether the source file needs to be backed up (the specific judgment logic can be found in the relevant description of the exemplary method above). When the source file needs to be backed up, the backup task is added to the asynchronous queue. The asynchronous queue sends the specific backup task to the data collaboration module based on the backup tasks in the queue. The global bucket management module is used to store the storage space information of the second node in the collaborative node set. Global scheduling coordinates the backup tasks of the data collaboration module based on the relevant storage space information stored in the global bucket management module to determine the backup node. That is, global scheduling implements the function of the node determination module 502. The data collaboration module sends a backup instruction to the determined backup node, implementing the function of the instruction sending module 503.
[0098] When a user reads a target file, a file read task is added to the file read / delete list. The source and backup nodes for the target file are determined based on the file metadata stored in the core library. The global scheduling module determines the target file's read node based on the actual source and backup node conditions. The target file's address in the source or backup node (i.e., the target file address) is returned to the user, enabling the target file to be read.
[0099] The multi-copy storage device provided in this embodiment is based on the same concept as the multi-copy storage method provided in the aforementioned embodiments of this application. It can execute the multi-copy storage method provided in any of the aforementioned embodiments of this application and has the corresponding functional modules and beneficial effects for executing the multi-copy storage method. For technical details not fully described in this embodiment, please refer to the specific processing content of the multi-copy storage method provided in the aforementioned embodiments of this application and will not be repeated here.
[0100] An embodiment of the present application further provides an edge cloud computing system, comprising: a first node and a plurality of second nodes; wherein,
[0101] The first node is configured to perform multiple copy storage of the source file stored in the second node according to the multiple copy storage method described in any one of the above embodiments.
[0102] In the edge cloud computing system, the second node can be the edge node described in the exemplary scenario. In the edge cloud computing system, since the number of second nodes is usually large and the stability levels of each second node are uneven, the implementation of multi-copy storage can ensure the high availability of the edge cloud computing system while giving full play to the low latency characteristics of the edge cloud computing system.
[0103] Another embodiment of the present application further proposes a computing device. As shown in Figure 7, an exemplary embodiment of the present application further provides a computing device, including: a memory and a processor, the memory storing a computer program, and the processor executing the computer program when executing the computer program performs the steps of the multi-copy storage method according to various embodiments of the present application described in the above embodiments of the present application.
[0104] The internal structure of the computing device can be shown in Figure 7. The computing device includes a processor, a memory, a network interface, and an input device connected via a system bus. The processor of the computing device is used to provide computing and control capabilities. The memory of the central control device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and computer program in the non-volatile storage medium. The network interface of the computing device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, it follows the steps of the multi-copy storage method according to various embodiments of the present application described in the above embodiments of the present application.
[0105] The processor may include a main processor, and may also include a baseband chip, a modem, etc.
[0106] The memory stores a computer program that executes the technical solution of the present invention, and may also store an operating system and other key programs. Specifically, the computer program may include program code, which includes computer operating instructions. More specifically, the memory may include read-only memory (ROM), other types of static storage devices that can store static information and instructions, random access memory (RAM), other types of dynamic storage devices that can store information and instructions, disk storage, flash memory, etc.
[0107] The processor may be a general-purpose processor, such as a general-purpose processor (CPU), a microprocessor, or an application-specific integrated circuit (ASIC), or one or more integrated circuits for controlling the execution of the program of the present invention. It may also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic device, discrete gate or transistor logic device, or discrete hardware components.
[0108] Input devices may include devices that receive data and information input by a user, such as a keyboard, mouse, camera, scanner, light pen, voice input device, touch screen, pedometer, or gravity sensor.
[0109] Output devices may include means that allow information to be output to a user, such as display screens, printers, speakers, and the like.
[0110] The communication interface may include any device such as a transceiver to communicate with other devices or communication networks, such as Ethernet, Radio Access Network (RAN), Wireless Local Area Network (WLAN), etc.
[0111] The processor executes the computer program stored in the memory and calls other devices, which can be used to implement the various steps of any multi-copy storage method provided in the above embodiments of the present application.
[0112] The computing device may also include a display component and a voice component. The display component may be a liquid crystal display or an electronic ink display. The input device of the computing device may be a touch layer covering the display component, or a button, trackball or touchpad provided on the housing of the computing device, or an external keyboard, touchpad or mouse.
[0113] Those skilled in the art will understand that the structure shown in Figure 7 is merely a block diagram of a portion of the structure related to the solution of the present application, and does not constitute a limitation on the computing device to which the solution of the present application is applied. The specific computing device may include more or fewer components than shown in the figure, or combine certain components, or have a different component arrangement.
[0114] In addition to the above-mentioned methods and devices, the multi-copy storage method provided by the embodiments of the present application may also be a computer program product, which includes a computer program, which, when executed by a processor, enables the processor to execute the steps of the multi-copy storage method according to various embodiments of the present application described in the above-mentioned "Exemplary Method" section of the present application.
[0115] The computer program product may be written in any combination of one or more programming languages to implement the program code for performing the operations of the embodiments of the present application, including object-oriented programming languages such as Java, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user's computing device, partially on the user's computing device, as a standalone software package, partially on the user's computing device and partially on a remote computing device, or entirely on a remote computing device or server.
[0116] In addition, an embodiment of the present application also provides a computer-readable storage medium on which a computer program is stored, and the computer program is executed by a processor to execute the steps of the multi-copy storage method according to various embodiments of the present application described in the above "Example Method" section of the present application.
[0117] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with the relevant laws, regulations and standards of relevant countries and regions, and provide corresponding operation entrances for users to choose to authorize or refuse.
[0118] It should be understood that the specific examples in this article are only intended to help those skilled in the art better understand the implementation methods of the present application, rather than to limit the scope of the present application.
[0119] It can be understood that in the various implementation methods of this application, the size of the serial number of each process 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 implementation method of this application.
[0120] It can be understood that the various embodiments described in this application can be implemented individually or in combination, and the embodiments of this application are not limited to this.
[0121] Unless otherwise indicated, all technical and scientific terms used in the embodiments of the present application have the same meaning as those commonly understood by those skilled in the art in the technical field of the present application. The terms used in this application are only for the purpose of describing specific embodiments and are not intended to limit the scope of this application. The term "and / or" used in this application includes any and all combinations of one or more related listed items. The singular forms "a", "above", and "the" used in the embodiments of the present application and the appended claims are also intended to include plural forms, unless the context clearly indicates otherwise.
[0122] It is understood that the processor in the embodiments of the present application can be an integrated circuit chip with signal processing capabilities. During implementation, each step of the above-mentioned method embodiment can be completed by hardware integrated logic circuits in the processor or software instructions. The above-mentioned processor can be a general-purpose processor, a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. The various methods, steps, and logic block diagrams disclosed in the embodiments of the present application can be implemented or executed. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the method disclosed in the embodiments of the present application can be directly implemented and executed by a hardware decoding processor, or by a combination of hardware and software modules in the decoding processor. The software module can be located in a storage medium mature in the art, such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, etc. The storage medium is located in the memory, and the processor reads the information in the memory and, in conjunction with its hardware, completes the steps of the above-mentioned method.
[0123] It will be understood that the memory in the embodiments of the present application may be a volatile memory or a non-volatile memory, or may include both volatile and non-volatile memories. Among them, the non-volatile memory may be a read-only memory (ROM), a programmable read-only memory (Programmable ROM, PROM), an erasable programmable read-only memory (Erasable PROM, EPROM), an electrically erasable programmable read-only memory (EEPROM) or a flash memory. The volatile memory may be a random access memory (RAM). It should be noted that the memory of the systems and methods described herein is intended to include, but is not limited to, these and any other suitable types of memory.
[0124] 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.
[0125] Those skilled in the art will clearly understand that, for the convenience and brevity of description, the specific working processes of the above-described systems, devices and units can refer to the corresponding processes in the aforementioned method implementation methods and will not be repeated here.
[0126] 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 illustrative. 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.
[0127] 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 the units may be selected according to actual needs to achieve the purpose of this embodiment.
[0128] 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.
[0129] 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, and the computer software product is stored in a storage medium, including a number of 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.
[0130] 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 the present application should be included in the scope of protection of the present application. Therefore, the scope of protection of the present application should be based on the scope of protection of the claims.
Claims
1. A multi-copy storage method, characterized in that: A first node applied to a distributed system, the distributed system further comprising a collaborative node set, the collaborative node set comprising a plurality of second nodes, the first node being used to perform multi-copy storage management on the collaborative node set, the multi-copy storage method comprising: Receiving a storage message notification sent by a source node storing a source file, wherein the storage message notification is used to notify that the source file is stored in the source node, and the source node is a second node in the collaborative node set; In the collaborative node set, at least one second node other than the source node is determined as a backup node; A backup instruction is sent to the backup node, where the backup instruction is used to instruct the backup node to back up the source file.
2. The method according to claim 1, characterized in that The step of determining at least one second node other than the source node in the collaborative node set as a backup node comprises: If the collaborative node set to which the source node belongs is in a global backup state, then in the collaborative node set, at least one second node other than the source node is determined as a backup node; If the collaborative node set to which the source node belongs is in a partial backup state, then when the source file meets a preset condition, at least one second node other than the source node in the collaborative node set is determined as a backup node.
3. The method according to claim 2, characterized in that The preset condition includes: the file name prefix of the source file matches a preset prefix template.
4. The method according to claim 1, characterized in that: The second node includes a first storage space and a second storage space; the source node stores the source file in the first storage space; The backup instruction is specifically used to instruct the backup node to back up the source file in the second storage space.
5. The method according to claim 4, characterized in that The storage message notification carries storage location information, and the storage location information is used to represent the storage location of the source file; The step of determining at least one second node other than the source node in the collaborative node set as a backup node comprises: If the storage location information indicates that the source file is stored in the first storage space, then in the collaborative node set, at least one second node other than the source node is determined as a backup node.
6. The method according to claim 1, characterized in that The storage message notification carries metadata, where the metadata is used to characterize the attributes of the files stored in the source node and the backup node; The multi-copy storage method further includes: In response to a file reading instruction, the source node or the backup node storing the target file is used as a reading node; the file reading instruction carries metadata of the target file; The address of the target file in the reading node is returned as a response result to the requester of the file reading instruction.
7. The method according to claim 6, characterized in that The source node or the backup node storing the target file as a reading node includes: Determine a source node and a backup node storing the target file according to the metadata of the target file; When the determined source node is available, using the source node as the reading node; When the determined source node is unavailable, the backup node is used as the reading node.
8. The method according to claim 1, characterized in that The step of determining at least one second node other than the source node in the collaborative node set as a backup node comprises: At least one second node other than the source node is determined as a backup node based on status parameters of the second node in the collaborative node set, wherein the status parameters include at least one of the geographical location of the second node, the remaining amount of storage resources of the second node, and the network bandwidth capacity of the second node.
9. The method according to claim 1, characterized in that: The backup instruction is specifically used to instruct the backup node to obtain the source file from the source node and store the source file within a preset time period.
10. The method according to claim 1, characterized in that The collaborative node set also includes association relationships between the second nodes; The step of determining at least one second node other than the source node in the collaborative node set as a backup node comprises: At least one second node in the collaborative node set to which the source node belongs and which has an association relationship with the source node is used as the backup node.
11. A multi-copy storage device, characterized in that: A first node applied to a distributed system, the distributed system further comprising a collaborative node set, the collaborative node set comprising a plurality of second nodes, the first node being used to perform multi-copy storage management on the collaborative node set, the multi-copy storage device comprising: A message receiving module, used to receive a storage message notification sent by a source node storing a source file, wherein the storage message notification is used to notify that the source file is stored in the source node, and the source node is a second node in the collaborative node set; A node determination module, configured to determine at least one second node other than the source node in the collaborative node set as a backup node, wherein the collaborative node set includes a plurality of the second nodes; The instruction sending module is used to send a backup instruction to the backup node, wherein the backup instruction is used to instruct the backup node to back up the source file.
12. An edge cloud computing system, characterized in that: include: a first node and a plurality of second nodes; wherein, The first node is used to store multiple copies of the source file stored in the second node according to the multiple copy storage method according to any one of claims 1 to 10.
13. An electronic device, characterized in that: include: Processor and memory; Wherein, the memory is connected to the processor, and the memory is used to store a computer program; The processor is used to implement the multi-copy storage method according to any one of claims 1 to 10 by running the computer program stored in the memory.
14. A storage medium, characterized in that: The storage medium stores a computer program, and when the computer program is executed by the processor, the multi-copy storage method according to any one of claims 1 to 10 is implemented.
Citation Information
Patent Citations
File data accessing method, apparatus and system
CN101510219A
Data deduplication method suitable for working load protecting system
CN102184198A
Apparatus for realizing storage resource allocation on cloud
CN107197055A
Backup method, system and equipment for distributed cluster and medium
CN111611109A
Metadata backup method, device, equipment and storage medium
CN111638995A
