A data processing method, device, equipment and storage medium
By dividing the data to be processed into data blocks and check blocks in the distributed storage system, and selecting target nodes for storage according to the node-level fault tolerance strategy, the problem of low reliability of data processing is solved and efficient recovery and recovery of data blocks are achieved. System fault tolerance.
Patent Information
- Application Number
- CN202211060845.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-08-31
- Publication Date
- 2024-10-25
- Estimated Expiration
- 2042-08-31
AI Technical Summary
In a distributed storage system, due to differences in storage node processing efficiency and computing resource occupancy, data blocks are unevenly distributed, causing data to be unrecoverable when some nodes fail, reducing the reliability of data processing.
When receiving the data to be processed, it is divided into multiple data blocks and at least one check block, and the target node is selected from the storage node for storage according to the node-level fault tolerance strategy to ensure the load balancing and fault tolerance of each target node and avoid Data corruption caused by single point of failure.
It improves the reliability of data processing, ensures that data blocks are restored through other nodes when a node fails, avoids data damage, and enhances the fault tolerance of the system.
Smart Images

Figure CN115514775B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a data processing method, device, equipment and storage medium. Background Art
[0002] With the continuous development of science and technology, more and more devices can use distributed storage systems to provide data storage services to avoid the problems of limited storage space in stand-alone storage space, single point failures that may lead to complete data loss, and difficulty in scalable expansion.
[0003] In the related art, when a device adopts a distributed storage system to store data to be processed, the data to be processed can be divided into multiple data blocks, and a storage node can be allocated to each data block in sequence from each storage node included in the distributed storage system to achieve the purpose of storing each data block.
[0004] However, due to the different processing efficiency and computing resource usage of each storage node, when allocating data blocks to each storage node, some storage nodes may be allocated more data blocks, while other storage nodes may be allocated fewer data blocks. In this case, when a storage node that is allocated more data blocks fails, the entire data to be processed will be damaged and cannot be recovered, making the reliability of the data processing process low.
[0005] It can be seen that in the related art, the reliability of the data processing process is low. Summary of the invention
[0006] The embodiments of the present application provide a data processing method, apparatus, computer device and storage medium for solving the problem of low reliability in the data processing process.
[0007] In a first aspect, a data processing method is provided, which is applied to a distributed storage system, comprising:
[0008] When receiving the data to be processed, the data to be processed is divided into a plurality of data blocks to be processed and at least one check block to be processed, wherein the check block to be processed is used to restore the abnormal data block to be processed when there is an abnormal data block to be processed among the plurality of data blocks to be processed;
[0009] When it is determined that the total number of storage nodes of each storage node included in the distributed storage system is not less than the node number threshold associated with the preset node-level fault-tolerant strategy, based on the node-level fault-tolerant strategy, corresponding first target nodes are selected from each storage node for the multiple data blocks to be processed and the at least one check block to be processed, respectively, wherein the number of times each first target node is selected does not exceed the selection number threshold associated with the node-level fault-tolerant strategy;
[0010] The multiple data blocks to be processed and the at least one check block to be processed are stored in corresponding first target nodes respectively.
[0011] Optionally, after the receiving the data to be processed, dividing the data to be processed into a plurality of data blocks to be processed and at least one check block to be processed, the method further includes:
[0012] When it is determined that the total number of storage nodes is less than the node number threshold, based on a load balancing strategy, selecting corresponding second target nodes for the multiple data blocks to be processed and the at least one check block to be processed from the storage nodes respectively;
[0013] The multiple data blocks to be processed and the at least one check block to be processed are stored in corresponding second target nodes respectively.
[0014] Optionally, after storing the plurality of to-be-processed data blocks and the at least one to-be-processed check block in the corresponding second target node respectively, the method further includes:
[0015] When receiving a storage node expansion instruction, updating the total number of storage nodes, wherein the storage node expansion instruction is used to add a new storage node in the distributed storage system;
[0016] When it is determined that the total number of updated storage nodes is not less than the node number threshold, based on the node-level fault-tolerant strategy, respectively reallocating corresponding third target nodes for a plurality of stored data blocks and at least one stored check block corresponding to each stored data stored in the distributed storage system;
[0017] The plurality of stored data blocks and at least one stored check block corresponding to each of the stored data are respectively migrated to the corresponding third target node.
[0018] Optionally, the reallocating corresponding third target nodes for the plurality of stored data blocks and at least one stored check block corresponding to each stored data stored in the distributed storage system based on the node-level fault tolerance strategy includes:
[0019] For each of the stored data, the following operations are performed respectively:
[0020] Determine original storage nodes of each of a plurality of stored data blocks and at least one stored check block corresponding to the stored data in the distributed storage system;
[0021] Count the number of times the same original storage node appears repeatedly in each original storage node;
[0022] For the stored data blocks or stored check blocks corresponding to the original storage nodes whose repetition times exceed the selected quantity threshold, the corresponding third target nodes are reallocated in the storage nodes other than the original storage nodes.
[0023] Optionally, when it is determined that the total number of updated storage nodes is not less than the node number threshold, based on the node-level fault-tolerant strategy, before reallocating corresponding third target nodes for each of the plurality of stored data blocks and at least one stored check block corresponding to each of the stored data stored in the distributed storage system, the method further includes:
[0024] Determining whether the distributed storage system meets the migration condition;
[0025] When the distributed storage system meets the migration condition, it is determined whether the updated total number of storage nodes is less than the node number threshold.
[0026] Optionally, determining whether the distributed storage system meets a migration condition includes:
[0027] When the distributed storage system has an associated migration identifier, determining whether the migration identifier indicates that migration is possible; or,
[0028] When the distributed storage system has an associated migration time interval, determining whether the current time is within the migration time interval; or,
[0029] When each storage node included in the distributed storage system has an associated running status, determining whether there is a storage node whose running status represents online operation among the storage nodes; or,
[0030] Determine whether there is an abnormal stored data block or an abnormal stored check block among the plurality of stored data blocks and at least one stored check block corresponding to each of the stored data stored in the distributed storage system.
[0031] In a second aspect, a data processing device is provided, which is applied to a distributed storage system, comprising:
[0032] The acquisition module is used for dividing the data to be processed into a plurality of data blocks to be processed and at least one check block to be processed when receiving the data to be processed, wherein the check block to be processed is used for recovering the abnormal data block to be processed when there is an abnormal data block to be processed among the plurality of data blocks to be processed;
[0033] Processing module: when determining that the total number of storage nodes of each storage node included in the distributed storage system is not less than the node number threshold associated with the preset node-level fault-tolerant strategy, based on the node-level fault-tolerant strategy, select corresponding first target nodes from each storage node for the multiple data blocks to be processed and the at least one check block to be processed, respectively, wherein the number of times each first target node is selected does not exceed the selection number threshold associated with the node-level fault-tolerant strategy;
[0034] The processing module is further used to: store the multiple data blocks to be processed and the at least one check block to be processed into corresponding first target nodes respectively.
[0035] Optionally, the processing module is further used for:
[0036] After dividing the data to be processed into a plurality of data blocks to be processed and at least one check block to be processed when receiving the data to be processed, when determining that the total number of storage nodes is less than the node number threshold, selecting corresponding second target nodes for the plurality of data blocks to be processed and the at least one check block to be processed from the respective storage nodes based on a load balancing strategy;
[0037] The multiple data blocks to be processed and the at least one check block to be processed are stored in corresponding second target nodes respectively.
[0038] Optionally, the processing module is further used for:
[0039] After storing the plurality of to-be-processed data blocks and the at least one to-be-processed check block in the corresponding second target nodes respectively, upon receiving a storage node expansion instruction, updating the total number of storage nodes, wherein the storage node expansion instruction is used to add a new storage node in the distributed storage system;
[0040] When it is determined that the total number of updated storage nodes is not less than the node number threshold, based on the node-level fault-tolerant strategy, respectively reallocating corresponding third target nodes for a plurality of stored data blocks and at least one stored check block corresponding to each stored data stored in the distributed storage system;
[0041] The plurality of stored data blocks and at least one stored check block corresponding to each of the stored data are respectively migrated to the corresponding third target node.
[0042] Optionally, the processing module is specifically used for:
[0043] For each of the stored data, the following operations are performed respectively:
[0044] Determine original storage nodes of each of a plurality of stored data blocks and at least one stored check block corresponding to the stored data in the distributed storage system;
[0045] Count the number of times the same original storage node appears repeatedly in each original storage node;
[0046] For the stored data blocks or stored check blocks corresponding to the original storage nodes whose repetition times exceed the selected quantity threshold, the corresponding third target nodes are reallocated in the storage nodes other than the original storage nodes.
[0047] Optionally, the processing module is further used for:
[0048] When it is determined that the total number of updated storage nodes is not less than the node number threshold, based on the node-level fault-tolerant strategy, for each of the stored data blocks and at least one stored check block corresponding to each of the stored data stored in the distributed storage system, before reallocating the corresponding third target node, determining whether the distributed storage system meets the migration condition;
[0049] When the distributed storage system meets the migration condition, it is determined whether the updated total number of storage nodes is less than the node number threshold.
[0050] Optionally, the processing module is specifically used for:
[0051] When the distributed storage system has an associated migration identifier, determining whether the migration identifier indicates that migration is possible; or,
[0052] When the distributed storage system has an associated migration time interval, determining whether the current time is within the migration time interval; or,
[0053] When each storage node included in the distributed storage system has an associated running status, determining whether there is a storage node whose running status represents online operation among the storage nodes; or,
[0054] Determine whether there is an abnormal stored data block or an abnormal stored check block among the plurality of stored data blocks and at least one stored check block corresponding to each of the stored data stored in the distributed storage system.
[0055] According to a third aspect, a computer program product is provided, comprising a computer program, which implements the method according to the first aspect when executed by a processor.
[0056] According to a fourth aspect, a computer device is provided, comprising:
[0057] A memory for storing program instructions;
[0058] The processor is used to call the program instructions stored in the memory and execute the method as described in the first aspect according to the obtained program instructions.
[0059] According to a fifth aspect, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer-executable instructions, and the computer-executable instructions are used to enable a computer to execute the method described in the first aspect.
[0060] In an embodiment of the present application, when the total number of storage nodes of each storage node included in the distributed storage system is not less than the node number threshold associated with the node-level fault-tolerant policy, it means that the distributed storage system has the conditions to use the node-level fault-tolerant policy to store the data to be processed. Then, based on the node-level fault-tolerant policy, the data to be processed is stored, so that the device can choose whether to use the node-level fault-tolerant policy for data processing in a targeted manner, thereby improving the reliability of data processing.
[0061] Furthermore, the data to be processed is divided into multiple data blocks to be processed and at least one check block to be processed, and corresponding first target nodes are selected from each storage node for the multiple data blocks to be processed and at least one check block to be processed, and the number of times each first target node is selected does not exceed the selection quantity threshold associated with the node-level fault-tolerant strategy, so that each first target node does not store a large number of data blocks to be processed or check blocks to be processed, which may cause the data to be processed to be damaged or lost when the first target node is abnormal, thereby improving the reliability of data processing. BRIEF DESCRIPTION OF THE DRAWINGS
[0062] Figure 1 An application scenario of the data processing method provided in the embodiment of the present application;
[0063] Figure 2 A flowchart of a data processing method provided in an embodiment of the present application;
[0064] Figure 3 A schematic diagram of a data processing method provided in an embodiment of the present application Figure 1 ;
[0065] Figure 4 A schematic diagram of a data processing method provided in an embodiment of the present application Figure 2 ;
[0066] Figure 5 A schematic diagram of a data processing method provided in an embodiment of the present application Figure 3 ;
[0067] Figure 6 A schematic diagram of a data processing method provided in an embodiment of the present application Figure 4 ;
[0068] Figure 7 A schematic diagram of a data processing method provided in an embodiment of the present application Figure 5 ;
[0069] Figure 8 A structural diagram of a data processing device provided in an embodiment of the present application Figure 1 ;
[0070] Fig. 9 A structural diagram of a data processing device provided in an embodiment of the present application Figure 2 . DETAILED DESCRIPTION
[0071] In order to make the purpose, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application.
[0072] It should be noted that in the embodiments of the present application, it involves obtaining relevant data such as data to be processed. When the above embodiments of the present application are applied to specific products or technologies, each time data is acquired, user permission or consent is required, and the collection, use and processing of relevant data need to comply with relevant laws, regulations and standards of relevant countries and regions.
[0073] The following is a brief introduction to the application fields of the data processing method provided in the embodiments of the present application.
[0074] With the continuous development of science and technology, more and more devices can use distributed storage systems to provide data storage services to avoid the problems of limited storage space in stand-alone storage space, single point failures that may lead to complete data loss, and difficulty in scalable expansion.
[0075] For example, in the field of video security, the data value density of videos or images is relatively low. If a copy strategy is used for storage, it may cause problems such as low disk utilization. Therefore, in the related art, when a device uses a distributed storage system to store data to be processed, the data to be processed can be divided into multiple data blocks, and a storage node is allocated to each data block in sequence from each storage node included in the distributed storage system to achieve the purpose of storing each data block.
[0076] However, due to the different processing efficiency and computing resource usage of each storage node, when allocating data blocks to each storage node, some storage nodes may be allocated more data blocks, while other storage nodes may be allocated fewer data blocks. In this case, when a storage node that is allocated more data blocks fails, the entire data to be processed will be damaged and cannot be recovered, making the reliability of the data processing process low.
[0077] It can be seen that in the related art, the reliability of the data processing process is low.
[0078] In order to solve the problem of low reliability of the data processing process, the present application proposes a data processing method. When receiving the data to be processed, the method divides the data to be processed into multiple data blocks to be processed and at least one check block to be processed, wherein the check block to be processed is used to restore the abnormal data blocks to be processed when there are abnormal data blocks to be processed in the multiple data blocks to be processed. When it is determined that the total number of storage nodes of each storage node included in the distributed storage system is not less than the node number threshold associated with the preset node-level fault tolerance strategy, based on the node-level fault tolerance strategy, from each storage node, the corresponding first target nodes are selected for the multiple data blocks to be processed and the at least one check block to be processed, wherein the number of times each first target node is selected does not exceed the selection number threshold associated with the node-level fault tolerance strategy. Multiple data blocks to be processed and at least one check block to be processed are stored in the corresponding first target nodes respectively.
[0079] In an embodiment of the present application, when the total number of storage nodes of each storage node included in the distributed storage system is not less than the node number threshold associated with the node-level fault-tolerant policy, it means that the distributed storage system has the conditions to use the node-level fault-tolerant policy to store the data to be processed. Then, based on the node-level fault-tolerant policy, the data to be processed is stored, so that the device can choose whether to use the node-level fault-tolerant policy for data processing in a targeted manner, thereby improving the reliability of data processing.
[0080] Furthermore, the data to be processed is divided into multiple data blocks to be processed and at least one check block to be processed, and corresponding first target nodes are selected from each storage node for the multiple data blocks to be processed and at least one check block to be processed, and the number of times each first target node is selected does not exceed the selection quantity threshold associated with the node-level fault-tolerant strategy, so that each first target node does not store a large number of data blocks to be processed or check blocks to be processed, which may cause the data to be processed to be damaged or lost when the first target node is abnormal, thereby improving the reliability of data processing.
[0081] The following describes the application scenarios of the data processing method provided by this application.
[0082] Please refer to Figure 1, is a schematic diagram of an application scenario of the data processing method provided in the present application. The application scenario includes a client 101 and a server 102. The client 101 and the server 102 can communicate with each other. The communication method can be to communicate using wired communication technology, for example, by connecting a network cable or a serial port cable; or to communicate using wireless communication technology, for example, by communicating using technologies such as Bluetooth or wireless fidelity (WIFI), without specific limitation.
[0083] The client 101 generally refers to a device that can send data to be processed to the server 102, such as a terminal device, a third-party application that can be accessed by the terminal device, or a web page that can be accessed by the terminal device. Terminal devices include but are not limited to mobile phones, computers, intelligent transportation equipment, smart appliances, etc. The server 102 generally refers to a device that can process data, such as a terminal device or a server. Servers include but are not limited to cloud servers, local servers, or associated third-party servers. Both the client 101 and the server 102 can use cloud computing to reduce the occupation of local computing resources; cloud storage can also be used to reduce the occupation of local storage resources.
[0084] As an embodiment, the client 101 and the server 102 can be the same device. For example, the embodiment of the present application can be implemented only through the client 101, or only through the server 102, etc., without specific limitation. In the embodiment of the present application, the client 101 and the server 102 are different devices as an example for introduction.
[0085] The following is based on Figure 1 , taking the service end 102 as an example, the data processing method provided in the embodiment of the present application is specifically introduced. The server has a distributed storage system, and the distributed storage system may include at least one management node and multiple storage nodes. The management node is used to process data and schedule storage nodes, etc., and the storage nodes are used to store data, etc. When at least one management node is multiple management nodes, there is a main management node and at least one backup management node among the multiple management nodes. The main management node is used to process data and schedule storage nodes, etc., and at least one backup management node is used to serve as the main management node when the main management node is abnormal, to process data and schedule storage nodes, etc., without specific limitations. In the embodiment of the present application, the distributed storage system including one management node is introduced as an example.
[0086] Please refer to Figure 2 , which is a flow chart of a data processing method provided in an embodiment of the present application.
[0087] S201, when receiving data to be processed, dividing the data to be processed into a plurality of data blocks to be processed and at least one check block to be processed.
[0088] When receiving the data to be processed, the server may divide the data to be processed into multiple data blocks to be processed and at least one check block to be processed. The check block to be processed is used to recover the abnormal data blocks to be processed when there are abnormal data blocks to be processed among the multiple data blocks to be processed. When the number of damaged data blocks to be processed is less than the number of check blocks to be processed, the damaged data blocks to be processed can be recovered by performing erasure code calculation on the check blocks to be processed, so that the data to be processed is not actually damaged.
[0089] S202, when it is determined that the total number of storage nodes included in the distributed storage system is not less than the node number threshold associated with the preset node-level fault-tolerance strategy, based on the node-level fault-tolerance strategy, select corresponding first target nodes from each storage node for multiple data blocks to be processed and at least one check block to be processed.
[0090] After obtaining multiple to-be-processed data blocks and at least one to-be-processed check block corresponding to the to-be-processed data, the server can obtain the total number of storage nodes of each storage node included in the distributed storage system, and determine which strategy to adopt to store the to-be-processed data blocks according to the total number of storage nodes.
[0091] When it is determined that the total number of storage nodes included in the distributed storage system is not less than the node number threshold associated with the preset node-level fault-tolerant strategy, it means that each storage node is sufficient to provide storage for the data to be processed, so that when the number of storage nodes is less than or equal to the number of pending check blocks is abnormal, the data to be processed can be recovered through the pending data blocks or pending check blocks stored in other storage nodes, and the data to be processed will not be actually damaged.
[0092] As an embodiment, when the data to be processed is divided into a plurality of data blocks to be processed and at least one check block to be processed, the data can be divided according to the number of data blocks and the number of check blocks associated with the node-level fault-tolerant strategy. For example, when the number of data blocks associated with the node-level fault-tolerant strategy is N and the number of check blocks associated with the node-level fault-tolerant strategy is M, the data to be processed can be divided into N data blocks to be processed and M check blocks to be processed.
[0093] In addition to associating the number of data blocks and the number of check blocks, the node-level fault-tolerance strategy can also be associated with the number of node fault tolerances. The number of node fault tolerances represents the upper limit of the number of abnormal storage nodes allowed when storing data according to the node-level fault-tolerance strategy. When storage nodes that are less than or equal to the number of node fault tolerances are abnormal, the data blocks or check blocks stored in the abnormal storage nodes can be recovered. When storage nodes that are greater than the number of node fault tolerances are abnormal, the data blocks or check blocks stored in the abnormal storage nodes cannot be recovered.
[0094] The node number threshold associated with the node-level fault tolerance strategy can be determined based on the number of data blocks, the number of check blocks, and the number of node fault tolerances associated with the node-level fault tolerance strategy. Please refer to formula (1).
[0095]
[0096] Among them, A represents the node number threshold, N represents the number of data blocks, M represents the number of check blocks, and b represents the number of node fault tolerance. Represents rounding up.
[0097] If the number of times each first target node is selected does not exceed the selection number threshold associated with the node-level fault tolerance strategy, then there will be no first target node that stores a large number of pending data blocks or a large number of pending check blocks. This allows the distributed storage system to recover the pending data blocks or pending check blocks stored in the abnormal first target node based on the pending data blocks or pending check blocks stored in other first target nodes if b first target nodes are abnormal. The selection number threshold can be determined based on the number of check blocks and the number of node fault tolerances, please refer to formula (2).
[0098]
[0099] Among them, B represents the selection quantity threshold, M represents the number of check blocks, and b represents the number of node fault tolerance. Represents rounding up.
[0100] For example, see Figure 3 , including three storage nodes, namely the first storage node, the second storage node and the third storage node. The number of data blocks associated with the node-level fault tolerance strategy is 4, the number of check blocks is 2, and the number of node fault tolerance is 1. Based on formula (1), the node number threshold can be determined to be 3, and based on formula (2), the selection number threshold can be determined to be 2.
[0101] After the data to be processed is obtained, the data to be processed may be divided into 4 data blocks to be processed and 2 check blocks to be processed according to the number of data blocks and the number of check blocks associated with the node-level fault tolerance strategy.
[0102] The server can determine that the total number of storage nodes is 3, which is not less than the node number threshold of 3. Then, based on the node-level fault tolerance strategy, the server can allocate corresponding first target nodes for the 4 data blocks to be processed and the 2 check blocks to be processed.
[0103] One allocation method may be to store two data blocks to be processed in the first storage node, to store one data block to be processed and one check block to be processed in the second storage node, and to store two data blocks to be processed in the third storage node.
[0104] S203: Store the plurality of to-be-processed data blocks and the at least one to-be-processed check block into corresponding first target nodes respectively.
[0105] Based on the node-level fault-tolerance strategy, after selecting corresponding first target nodes for multiple data blocks to be processed and at least one check block to be processed from each storage node, the server can store the multiple data blocks to be processed and at least one check block to be processed into the corresponding first target nodes respectively to complete the storage processing of the data to be processed.
[0106] As an embodiment, when it is determined that the total number of storage nodes is less than the node number threshold, it means that the number of storage nodes currently included in the distributed storage system is insufficient to provide storage for the data to be processed, so that when the storage nodes that are less than or equal to the node fault tolerance number are abnormal, the data to be processed can be recovered through the data blocks to be processed or the check blocks to be processed stored in other storage nodes, and the data to be processed will not be actually damaged.
[0107] Therefore, based on the load balancing strategy, the server can select corresponding second target nodes from each storage node for multiple data blocks to be processed and at least one check block to be processed. The server can obtain the node performance of each storage node in the current distributed storage system, and arrange each storage node in order from high to low according to the node performance. Thus, the server can sequentially assign corresponding second target nodes to each data block to be processed or check block to be processed. The higher the node performance, the less computing resources, load or bandwidth usage of the storage node. The server can determine the node performance of the storage node based on multiple angles such as the current computing resource usage, load and bandwidth usage of each storage node, without specific restrictions.
[0108] After selecting corresponding second target nodes for the multiple data blocks to be processed and the at least one check block to be processed respectively from each storage node, the server may store the multiple data blocks to be processed and the at least one check block to be processed in the corresponding second target nodes respectively.
[0109] As an embodiment, since the scale of storage nodes of a distributed storage system may be continuously expanded from small to large, when the scale of storage nodes is small, that is, the total number of storage nodes is small, the server may not be able to store the obtained data to be processed based on the node-level fault tolerance strategy. Then, each time the server receives a storage node expansion instruction, it can check the scale of storage nodes of the distributed storage system to determine whether the total number of storage nodes reaches the node number threshold associated with the node-level fault tolerance strategy.
[0110] The server can update the total number of storage nodes when receiving a storage node expansion instruction, and the storage node expansion instruction is used to add a new storage node in the distributed storage system. When it is determined that the updated total number of storage nodes is not less than the node number threshold, it means that the number of storage nodes is sufficient, then the server can adjust the storage location of multiple stored data blocks and at least one stored check block corresponding to each stored data, so that when the storage node that is less than or equal to the node fault tolerance number is abnormal, each stored data can be restored through the stored data blocks or stored check blocks stored in other storage nodes, without causing actual damage to the stored data.
[0111] The server may reallocate corresponding third target nodes for the multiple stored data blocks and at least one stored check block corresponding to each stored data stored in the distributed storage system based on the node-level fault tolerance strategy. After allocating the corresponding third target nodes, the server may migrate the multiple stored data blocks and at least one stored check block corresponding to each stored data to the corresponding third target nodes.
[0112] As an embodiment, when reallocating corresponding third target nodes for multiple stored data blocks and at least one stored check block corresponding to each stored data, only the stored data that is not stored based on the node and fault tolerance strategy can be migrated. The migration process of one stored data is introduced as an example below. The migration process of other stored data is similar to that of the one stored data, and will not be repeated here.
[0113] The server determines the original storage nodes of the plurality of stored data blocks and at least one stored check block corresponding to the stored data in the distributed storage system. The server can obtain the number of repeated occurrences of the same original storage node in each original storage node by counting, so as to determine how many stored data blocks or stored check blocks are stored in each original storage node for the stored data.
[0114] The server can reallocate the corresponding third target node for the stored data blocks or stored check blocks corresponding to the original storage nodes whose repetition times exceed the selected number threshold, among the storage nodes other than the original storage nodes. Thus, after the stored data blocks or stored check blocks corresponding to the original storage nodes whose repetition times exceed the selected number threshold are migrated to the corresponding third target node, the stored data becomes a storage method based on the node-level fault tolerance strategy.
[0115] For example, see Figure 4, 5 stored data blocks and 2 stored check blocks corresponding to one stored data are stored in the first original storage node, the second original storage node, and the third original storage node respectively. The first original storage node stores two stored data blocks, the second original storage node stores one stored data block and one stored check block, and the third original storage node stores two stored data blocks and one stored check block. In the distributed storage system, in addition to the first original storage node, the second original storage node, and the third original storage node, it also includes the first storage node and the second storage node.
[0116] If the selection quantity threshold is 2, and the total number of stored data blocks and stored check blocks stored in the third original storage node is 3, which has exceeded the selection quantity threshold, then the server can select a stored data block or a stored check block from the two stored data blocks and one stored check block, assign a storage node as the third target node for it in the first storage node and the second storage node, and migrate it to the third target node. For example, select a stored data block, use the first storage node as the third target storage node for the one stored data block, and migrate the one stored data block to the third target node.
[0117] As an embodiment, the server may be pre-set with migration conditions. When the server receives the storage node expansion instruction, after updating the total number of storage nodes, before determining whether the updated total number of storage nodes is less than the node number threshold, it may also first determine whether the distributed storage system meets the migration conditions. When the distributed storage system meets the migration conditions, it is determined whether the updated total number of storage nodes is less than the node number threshold, otherwise the stored data blocks or stored check blocks stored in the distributed storage system are not migrated.
[0118] As an embodiment, there may be multiple pre-set migration conditions, four of which are described below as examples. The migration conditions may also be migration conditions other than the following four conditions, which are not specifically limited.
[0119] Migration Condition 1:
[0120] When the distributed storage system has an associated migration identifier, it is determined whether the migration identifier indicates that the storage system is migratable.
[0121] The distributed storage system may have an associated migration identifier, and the migration identifier may indicate whether it is migratable or not. When the migration identifier indicates that it is migratable, the server may migrate the stored data blocks or stored check blocks stored in the distributed storage system from the original storage node to the third target node. When the migration identifier indicates that it is not migratable, the server cannot migrate the stored data blocks or stored check blocks stored in the distributed storage system. Then, when the migration identifier indicates that it is migratable, the server may determine that the distributed storage system meets the migration conditions.
[0122] Migration Condition 2:
[0123] When the distributed storage system has an associated migration time interval, it is determined whether the current time is within the migration time interval.
[0124] The distributed storage system may have an associated migration time interval, and the migration time interval indicates that when the current moment is within the migration time interval, the server can migrate the stored data blocks or stored check blocks stored in the distributed storage system from the original storage node to the third target node. When the current moment is not within the migration time interval, the server cannot migrate the stored data blocks or stored check blocks stored in the distributed storage system. Then, when the current moment is within the migration time interval, the server can determine that the distributed storage system meets the migration conditions.
[0125] Migration Condition 3:
[0126] When each storage node included in the distributed storage system has an associated operating status, it is determined whether there is a storage node whose operating status represents online operation among the storage nodes.
[0127] Each storage node included in the distributed storage system may have an associated operating status, including online operation and offline standby. When counting the total number of storage nodes, the server may only count the storage nodes whose operating status is online operation. If there is no storage node whose operating status represents online operation among the storage nodes, the server may determine that the distributed storage system does not meet the migration conditions; if there is a storage node whose operating status represents online operation among the storage nodes, the server may determine that the distributed storage system meets the migration conditions.
[0128] Alternatively, before the stored data blocks or stored check blocks stored in the distributed storage system are migrated, it can be determined for each stored data that the operating status of the storage nodes other than its original storage node does not indicate online operation, then the server can determine that the distributed storage system does not meet the migration conditions; when it is determined for each stored data that the number of storage nodes whose operating status indicates online operation among the storage nodes other than its original storage node matches the number of stored data blocks or stored check blocks to which the storage nodes need to be reallocated for the stored data, the server can determine that the distributed storage system meets the migration conditions.
[0129] Migration Condition 4:
[0130] It is determined whether there is an abnormal stored data block or an abnormal stored check block among a plurality of stored data blocks and at least one stored check block corresponding to each stored data stored in the distributed storage system.
[0131] When there is an abnormal stored data block or an abnormal stored check block among the multiple stored data blocks and at least one stored check block corresponding to a stored data, it is necessary to first restore the abnormal stored data block or the abnormal stored check block, and only after the restoration can migration be performed, otherwise the abnormal stored data block or the abnormal stored check block cannot be migrated. Therefore, when there is no abnormal stored data block or abnormal stored check block among the multiple stored data blocks and at least one stored check block corresponding to the stored data, the server can determine that the distributed storage system meets the migration conditions.
[0132] The following is an example introduction to the data processing method provided in the embodiments of the present application.
[0133] Please refer to Figure 5 , which is a schematic diagram of the interaction principle between the client and the server where the distributed storage system is located.
[0134] The server includes a primary management node and a backup management node. The primary management node is used to respond to metadata-related requests of the entire distributed storage system, maintain the metadata image of the entire distributed storage system internally, and is responsible for storage node management and load balancing, as well as other distributed storage system-related management tasks. The backup management node is used to replace the primary management node for management when the primary management node is abnormal.
[0135] The server also includes multiple data nodes, which are used to provide real business data, that is, the ability to write non-metadata, and to provide an interface SDK to write data to persistent storage media and periodically report data block status to the management node.
[0136] The server also includes multiple storage nodes, and the storage nodes are used to store data.
[0137] The client and each storage node can interact through data streams, and the client and management node, the primary management node and the backup management node, the management node and the data node, and the data node and the storage node can interact through signaling streams.
[0138] When a user writes data to a distributed storage system through a client, the data can be in the form of a file. The server can first divide the file into multiple file objects according to a fixed size. Figure 6 Each file object may include a file object identifier, a status bit, an offset in the file, a data block array composed of the data blocks contained therein, and a position array of each data block. The data block array may include information such as the length of the array and the length of each data block. The position array of each data block may include the length of the array and the position of each data block.
[0139] A file or file object may have an associated file status, which is used to indicate whether there are any abnormalities in the stored data blocks and verified data blocks corresponding to the file or file object. If there are no abnormalities in the stored data blocks and verified data blocks, the file status is complete; if there are abnormalities in the stored data blocks and verified data blocks, the file status is incomplete. Based on the file status, the server can determine whether data recovery is required.
[0140] When splitting a file object, you can split it based on the preset node-level fault tolerance strategy. For example, when the number of data blocks associated with the node-level fault tolerance strategy is 4 and the number of check blocks is 1, the file can be split into 4 256M file objects.
[0141] The file may be regarded as a data to be processed, or each segmented file object may be regarded as a data to be processed, etc., without any specific limitation. In the embodiment of the present application, each segmented file object is taken as a data to be processed as an example for introduction.
[0142] After obtaining the data to be processed, the server can divide the data to be processed into multiple data blocks to be processed and at least one check block to be processed based on a preset node-level fault-tolerant strategy. For example, when the number of data blocks associated with the node-level fault-tolerant strategy is N and the number of check blocks is M, the data to be processed can be divided into N data blocks to be processed and M check blocks to be processed. The sizes of the data blocks to be processed and the check blocks to be processed can be set to different values according to different business scenarios, which can maximize the utilization rate of the system's distributed storage system.
[0143] The metadata of the data to be processed can be stored in the management node. The data node can periodically report the information of each data block to be processed to the management node. The management node corrects the correctness of the internal cache metadata based on the received information of the data block to be processed, and maintains the metadata of the file object accurately and timely.
[0144] Traditional erasure codes only support N+M fault tolerance, where N represents the stored data blocks and M represents the stored check blocks. When the total number of stored data blocks damaged is less than or equal to M, the damaged stored data blocks can still be restored by erasure code calculation on the stored check blocks, and the data will not be actually damaged, thus improving the data's fault tolerance and reliability.
[0145] In a distributed storage system, the N+M fault tolerance capability is disk-level fault tolerance, which means that a total of N+M disks are selected to respond to the current IO write request. If a storage node is damaged, it will be impossible to calculate the erasure code for the stored checksum and recover the stored data blocks in the damaged storage node.
[0146] In the embodiment of the present application, by setting the node fault tolerance number, the node number threshold associated with the node-level fault tolerance strategy and the selection number threshold associated with the node-level fault tolerance strategy are obtained. The node-level fault tolerance capability can be used to further improve the reliability and security of data and solve the problem that data will not be lost after a hardware failure at the storage node server level.
[0147] For example, when the number of data blocks associated with the node-level fault-tolerance strategy is N and the number of check blocks is M, the node fault tolerance number is set to b, and the value of b is less than or equal to M. In this way, while allowing M data blocks to be damaged, the system is also allowed to damage b storage nodes, and the integrity of the stored data can still be guaranteed, greatly improving the data fault tolerance capability from the disk level to the node level.
[0148] When the total number of storage nodes in the distributed storage system is less than the node number threshold, the user IO write space application is automatically downgraded to traditional disk-level fault tolerance, and the traditional erasure code process is used. When the total number of storage nodes in the distributed storage system is not less than the node number threshold, the user IO write space application adopts the node-level fault tolerance strategy, and the stored data blocks can also be migrated to improve the data fault tolerance capability.
[0149] In the embodiment of the present application, the value of b can be set flexibly. For example, when the total number of storage nodes is large enough (such as more than 100), it can support designing b to be equal to or slightly less than M; when the total number of storage nodes is small, the user can customize the value of b according to actual usage to avoid occupying more storage space and maximize data reliability.
[0150] In the embodiment of the present application, the stored data may also be associated with a file type, which indicates the type of data, such as video data, text data, or image data, etc. Therefore, the value of b may be specified according to different file types. For example, for two types of files, pictures and videos, pictures are generally smaller in size, and the probability of reading pictures is higher than that of videos. Therefore, pictures are relatively more valuable, and a higher fault tolerance level and capability may be set for pictures, and the corresponding b value may be set larger, while the b value of videos may be set to a smaller value.
[0151] Please refer to Figure 7 , S701, when starting the migration, you can first determine whether the configuration switch of the distributed storage system is turned on. If the configuration switch is turned on, it means that the distributed storage system can currently migrate data blocks. If the configuration switch is turned off, it means that the distributed storage system cannot currently migrate data blocks.
[0152] S702, when the configuration switch is turned on and the total number of storage nodes is not less than the node number threshold, the management node will determine whether the distributed storage system meets the migration conditions. The migration condition is to set the migration time period, such as performing the migration task between 1:00 and 4:00 a.m. every day, and limit the total bandwidth upper limit of the storage node occupied by the migration task to avoid a large number of migration tasks affecting real-time IO write requests.
[0153] For example, in the video security industry, early morning is generally the off-peak period for traffic on each checkpoint and street. Performing migration tasks at this time can minimize the impact on real-time business. The migration period can be configured, and the migration task can be performed during the off-peak period based on the actual deployment scenario.
[0154] For example, when a migration task is executed, the source data block information will be read through the network and written to the target node, controlling the upper limit of the migration task bandwidth, which can minimize the impact on real-time business. In addition to the migration time limit, other dimensions of migration conditions are also supported, such as setting the current node storage node online rate to allow migration; or setting the current storage node access business pressure to less than 80% of the maximum performance before executing the migration action, etc.
[0155] S703, when the migration conditions are met, control the execution of the entire migration process. First, the migration management thread periodically scans the stored data with a file status of full (complete), obtains each stored data that needs to be migrated, and then performs the migration task on the stored data blocks and stored check blocks corresponding to each stored data.
[0156] If the file status of the stored data is complete, it means that the stored data can be migrated based on the node-level fault tolerance policy. If the file status of the stored data is incomplete, it means that the stored data cannot be migrated based on the node-level fault tolerance policy.
[0157] S704: Encapsulate a migration task for each stored data that needs to be migrated.
[0158] When the stored data cannot be migrated based on the node-level fault tolerance strategy, a second target node with the best load is selected from all storage nodes, and multiple stored data blocks and at least one stored check block corresponding to the stored data are migrated to the corresponding second target node.
[0159] When the stored data can be migrated based on the node-level fault-tolerance policy, a corresponding third target node is selected from all storage nodes based on the node-level fault-tolerance policy, and multiple stored data blocks and at least one stored check block corresponding to the stored data are migrated to the corresponding third target node.
[0160] S705, when the storage node receives the block migration task issued by the management node, it reads the stored data block from the data block list of the source storage node and migrates it to the corresponding target node through network reading. After the block migration action is completed, the storage node reports the block migration result. The management node updates the metadata cache and modifies the index information of the corresponding data block based on the reported migration result and the attribute information of the data block, so as to achieve the purpose of maintaining real-time and accurate metadata mirroring.
[0161] In the embodiment of the present application, in the data writing stage, according to the current system data node scale, the traditional erasure code or the node-level fault tolerance strategy is adaptively selected to respond to the IO write request, wherein the node-level fault tolerance strategy can solve the risk of data loss that may be caused by the traditional erasure code when the storage device server-level hardware failure occurs in the disk-level fault tolerance. When the management node responds to the user space application request, it is preferred to combine the node-level fault tolerance strategy. When the node-level fault tolerance cannot select a suitable target node to respond to the user write request, the fault tolerance is downgraded to the disk-level fault tolerance. Based on the traditional erasure code writing, the problem of distributed system availability is first solved, and then when the total number of storage nodes increases, it is self-adjusted according to the node-level fault tolerance strategy to achieve the purpose of secondary improvement of system data reliability. The node-level fault tolerance strategy allows the number b of damaged storage nodes to be configurable. After actual project testing, combined with the node-level fault tolerance strategy, the actual project can basically meet the node-level fault tolerance requirements when the user data is written into the application space. In the large-scale deployment scenario of the distributed system, under the premise that server hardware failure is inevitable, the distributed storage system can basically cope with and tolerate these server-level failures freely, greatly reducing the risk of user data damage and loss, and achieving the purpose of improving system reliability.
[0162] In the embodiment of the present application, in the distributed storage system, when the migration configuration switch is turned on and the total number of storage nodes meets the requirements, under the premise of meeting the preset block migration conditions of the system (time point, system load requirements, etc.), the management node will control the periodic scanning of the file information that has been written and the file status is complete, and perform the migration operation of the data block with the file or file object as the granularity. When the storage node where the data block is currently distributed does not meet the node-level fault tolerance strategy, a migration task for this object will be encapsulated, and the management node will control the migration task to be sent to the target node selected based on the current load and the node-level fault tolerance strategy, and send the block migration request to the target node. The target node parses the received block migration task, reads and copies the data block from the source storage node to the target node, completes the current migration task, and reports the migration result of the management node. The management node updates the file status according to the result, and finally maintains the correctness of the management node metadata mirror and the correctness integrity of the file view. Combined with the actual project test, through the design of the migration conditions, it is finally made that when the written files in the existing system do not meet the node-level fault tolerance strategy, the block migration will improve the fault tolerance level of the entire file. When monitoring block migration operations in actual projects, block migration can effectively improve the reliability of files. The migration of data blocks has achieved the purpose of achieving secondary balancing of storage data under the premise of meeting certain fault tolerance capabilities of the entire storage system. The adaptive execution of block migration and secondary balancing is also a major feature of the self-management and self-completeness of the storage system involved in this patent.
[0163] Based on the same inventive concept, the present application embodiment provides a data processing device that can implement the functions corresponding to the aforementioned data processing method. Figure 8 , the device includes an acquisition module 801 and a processing module 802, wherein:
[0164] The acquisition module 801 is used for dividing the data to be processed into a plurality of data blocks to be processed and at least one check block to be processed when receiving the data to be processed, wherein the check block to be processed is used for recovering the abnormal data block to be processed when there is an abnormal data block to be processed among the plurality of data blocks to be processed;
[0165] Processing module 802: when determining that the total number of storage nodes of each storage node included in the distributed storage system is not less than the node number threshold associated with the preset node-level fault-tolerant strategy, based on the node-level fault-tolerant strategy, select corresponding first target nodes from each storage node for a plurality of data blocks to be processed and at least one check block to be processed, wherein the number of times each first target node is selected does not exceed the selection number threshold associated with the node-level fault-tolerant strategy;
[0166] The processing module 802 is further configured to store the plurality of to-be-processed data blocks and the at least one to-be-processed check block into corresponding first target nodes respectively.
[0167] In a possible embodiment, the processing module 802 is further configured to:
[0168] When receiving the data to be processed, after dividing the data to be processed into a plurality of data blocks to be processed and at least one check block to be processed, when it is determined that the total number of storage nodes is less than the node number threshold, based on the load balancing strategy, from each storage node, respectively, select a corresponding second target node for the plurality of data blocks to be processed and the at least one check block to be processed;
[0169] A plurality of to-be-processed data blocks and at least one to-be-processed check block are stored in corresponding second target nodes respectively.
[0170] In a possible embodiment, the processing module 802 is further configured to:
[0171] After storing the plurality of to-be-processed data blocks and the at least one to-be-processed check block in the corresponding second target nodes respectively, upon receiving a storage node expansion instruction, updating the total number of storage nodes, wherein the storage node expansion instruction is used to add a storage node in the distributed storage system;
[0172] When it is determined that the total number of updated storage nodes is not less than the node number threshold, based on the node-level fault tolerance strategy, respectively reallocate corresponding third target nodes for multiple stored data blocks and at least one stored check block corresponding to each stored data stored in the distributed storage system;
[0173] A plurality of stored data blocks and at least one stored check block corresponding to each of the stored data are respectively migrated to the corresponding third target node.
[0174] In a possible embodiment, the processing module 802 is specifically configured to:
[0175] For each stored data, perform the following operations:
[0176] Determine the original storage nodes of each of the plurality of stored data blocks and the at least one stored check block corresponding to the stored data in the distributed storage system;
[0177] Count the number of times the same original storage node appears repeatedly in each original storage node;
[0178] For the stored data blocks or stored check blocks corresponding to the original storage nodes whose repetition times exceed the selected quantity threshold, the corresponding third target nodes are reallocated in the storage nodes other than the original storage nodes.
[0179] In a possible embodiment, the processing module 802 is further configured to:
[0180] When it is determined that the total number of updated storage nodes is not less than the node number threshold, based on the node-level fault tolerance strategy, before reallocating the corresponding third target node for each of the plurality of stored data blocks and at least one stored check block corresponding to each of the stored data stored in the distributed storage system, determine whether the distributed storage system meets the migration condition;
[0181] When the distributed storage system meets the migration condition, it is determined whether the total number of updated storage nodes is less than the node number threshold.
[0182] In a possible embodiment, the processing module 802 is specifically configured to:
[0183] When the distributed storage system has an associated migration identifier, determining whether the migration identifier indicates that migration is possible; or,
[0184] When the distributed storage system has an associated migration time interval, determining whether the current time is within the migration time interval; or,
[0185] When each storage node included in the distributed storage system has an associated running status, determining whether there is a storage node whose running status represents online operation among the storage nodes; or,
[0186] It is determined whether there is an abnormal stored data block or an abnormal stored check block among a plurality of stored data blocks and at least one stored check block corresponding to each stored data stored in the distributed storage system.
[0187] Please refer to Fig. 9 The above data processing device can be run on a computer device 900, and the current version and historical version of the data storage program and the application software corresponding to the data storage program can be installed on the computer device 900, and the computer device 900 includes a processor 980 and a memory 920. In some embodiments, the computer device 900 may include a display unit 940, and the display unit 940 includes a display panel 941 for displaying an interactive operation interface by a user.
[0188] In a possible embodiment, the display panel 941 may be configured in the form of a liquid crystal display (LCD) or an organic light-emitting diode (OLED).
[0189] The processor 980 is used to read the computer program and then execute the method defined by the computer program. For example, the processor 980 reads the data storage program or file, so as to run the data storage program on the computer device 900 and display the corresponding interface on the display unit 940. The processor 980 may include one or more general-purpose processors and may also include one or more DSPs (Digital Signal Processors) to perform related operations to implement the technical solutions provided in the embodiments of the present application.
[0190] The memory 920 generally includes internal memory and external memory, and the internal memory can be a random access memory (RAM), a read-only memory (ROM), and a cache (CACHE), etc. The external memory can be a hard disk, an optical disk, a USB disk, a floppy disk, or a tape drive, etc. The memory 920 is used to store computer programs and other data, and the computer program includes applications corresponding to each client, etc. Other data may include data generated after the operating system or application is run, and the data includes system data (such as configuration parameters of the operating system) and user data. In the embodiment of the present application, program instructions are stored in the memory 920, and the processor 980 executes the program instructions in the memory 920 to implement any of the methods discussed in the previous figure.
[0191] The display unit 940 is used to receive input digital information, character information or contact touch operation / contactless gesture, and generate signal input related to user settings and function control of the computer device 900. Specifically, in the embodiment of the present application, the display unit 940 may include a display panel 941. The display panel 941 is, for example, a touch screen, which can collect user touch operations on or near it (such as operations performed by the user using fingers, stylus, or any other suitable object or accessory on or on the display panel 941), and drive corresponding connection devices according to a pre-set program.
[0192] In a possible embodiment, the display panel 941 may include two parts: a touch detection device and a touch controller. The touch detection device detects the touch position of the player, detects the signal brought by the touch operation, and transmits the signal to the touch controller; the touch controller receives the touch information from the touch detection device, converts it into the touch point coordinates, and then sends it to the processor 980, and can receive and execute the command sent by the processor 980.
[0193] The display panel 941 may be implemented in various types such as resistive, capacitive, infrared, and surface acoustic wave. In addition to the display unit 940, in some embodiments, the computer device 900 may further include an input unit 930, which may include an image input device 931 and other input devices 932, wherein the other input devices may include, but are not limited to, one or more of a physical keyboard, a function key (such as a volume control key, a switch key, etc.), a trackball, a mouse, a joystick, and the like.
[0194] In addition to the above, the computer device 900 may also include a power supply 990 for supplying power to other modules, an audio circuit 960, a near field communication module 970, and an RF circuit 910. The computer device 900 may also include one or more sensors 950, such as an acceleration sensor, a light sensor, a pressure sensor, etc. The audio circuit 960 specifically includes a speaker 961 and a microphone 962, etc. For example, the computer device 900 can collect the user's voice through the microphone 962 to perform corresponding operations, etc.
[0195] As an embodiment, the number of processors 980 may be one or more, and the processor 980 and the memory 920 may be coupled or relatively independently configured.
[0196] As an example, Fig. 9 The processor 980 in the embodiment can be used to implement the following Figure 8 The functions of the acquisition module 801 and the processing module 802 in .
[0197] As an example, Fig. 9 The processor 980 in can be used to implement the corresponding functions of the server or terminal device discussed above.
[0198] A person skilled in the art can understand that: all or part of the steps of implementing the above method embodiment can be completed by hardware related to program instructions, and the aforementioned program can be stored in a computer-readable storage medium. When the program is executed, it executes the steps of the above method embodiment; and the aforementioned storage medium includes: mobile storage devices, read-only memories (ROM, Read-Only Memory), random access memories (RAM, Random Access Memory), disks or optical disks, etc. Various media that can store program codes.
[0199] Alternatively, if the above-mentioned integrated unit of the present invention is implemented in the form of a software function module and sold or used as an independent product, it can also be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the embodiment of the present invention can be essentially or partly reflected in the form of a software product, for example, through a computer program product, which is stored in a storage medium and includes a number of instructions for a computer device to execute all or part of the methods described in each embodiment of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as mobile storage devices, ROM, RAM, magnetic disks or optical disks.
[0200] Obviously, those skilled in the art can make various changes and modifications to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.
Claims
1. A data processing method, characterized in that: Applied to distributed storage systems, including: When receiving the data to be processed, the data to be processed is divided into a plurality of data blocks to be processed and at least one check block to be processed, wherein the check block to be processed is used to restore the abnormal data block to be processed when there is an abnormal data block to be processed among the plurality of data blocks to be processed; When it is determined that the total number of storage nodes of each storage node included in the distributed storage system is not less than the node number threshold associated with the preset node-level fault-tolerant strategy, based on the node-level fault-tolerant strategy, corresponding first target nodes are selected from each storage node for the multiple data blocks to be processed and the at least one check block to be processed, respectively, wherein the number of times each first target node is selected does not exceed the selection number threshold associated with the node-level fault-tolerant strategy; storing the plurality of to-be-processed data blocks and the at least one to-be-processed check block into corresponding first target nodes respectively; The method further comprises: When receiving a storage node expansion instruction, updating the total number of storage nodes, wherein the storage node expansion instruction is used to add a new storage node in the distributed storage system; When it is determined that the total number of updated storage nodes is not less than the node number threshold, based on the node-level fault-tolerant strategy, a corresponding third target node is reallocated for each of the plurality of stored data blocks and at least one stored check block corresponding to each of the stored data stored in the distributed storage system; wherein, for each of the stored data, the following operations are performed respectively: Determine original storage nodes of each of a plurality of stored data blocks and at least one stored check block corresponding to the stored data in the distributed storage system; Count the number of times the same original storage node appears repeatedly in each original storage node; For the stored data blocks or stored check blocks corresponding to the original storage nodes whose repetition times exceed the selected quantity threshold, reallocate corresponding third target nodes in the storage nodes other than the respective original storage nodes; The plurality of stored data blocks and at least one stored check block corresponding to each of the stored data are respectively migrated to the corresponding third target node.
2. The method according to claim 1, characterized in that After the to-be-processed data is divided into a plurality of to-be-processed data blocks and at least one to-be-processed check block when the to-be-processed data is received, the method further comprises: When it is determined that the total number of storage nodes is less than the node number threshold, based on a load balancing strategy, selecting corresponding second target nodes for the multiple data blocks to be processed and the at least one check block to be processed from the storage nodes respectively; The multiple data blocks to be processed and the at least one check block to be processed are stored in corresponding second target nodes respectively.
3. The method according to claim 1, characterized in that: When it is determined that the total number of updated storage nodes is not less than the node number threshold, based on the node-level fault-tolerant strategy, before reallocating corresponding third target nodes for the plurality of stored data blocks and at least one stored check block corresponding to each stored data stored in the distributed storage system, the method further includes: Determining whether the distributed storage system meets the migration condition; When the distributed storage system meets the migration condition, it is determined whether the updated total number of storage nodes is less than the node number threshold.
4. The method according to claim 3, characterized in that The determining whether the distributed storage system meets the migration condition includes: When the distributed storage system has an associated migration identifier, determining whether the migration identifier indicates that migration is possible; or, When the distributed storage system has an associated migration time interval, determining whether the current time is within the migration time interval; or, When each storage node included in the distributed storage system has an associated running status, determining whether there is a storage node whose running status represents online operation among the storage nodes; or, Determine whether there is an abnormal stored data block or an abnormal stored check block among the plurality of stored data blocks and at least one stored check block corresponding to each stored data stored in the distributed storage system.
5. A data processing device, characterized in that: Applied to distributed storage systems, including: The acquisition module is used for dividing the data to be processed into a plurality of data blocks to be processed and at least one check block to be processed when receiving the data to be processed, wherein the check block to be processed is used for recovering the abnormal data block to be processed when there is an abnormal data block to be processed among the plurality of data blocks to be processed; Processing module: when determining that the total number of storage nodes of each storage node included in the distributed storage system is not less than the node number threshold associated with the preset node-level fault-tolerant strategy, based on the node-level fault-tolerant strategy, select corresponding first target nodes from each storage node for the multiple data blocks to be processed and the at least one check block to be processed, respectively, wherein the number of times each first target node is selected does not exceed the selection number threshold associated with the node-level fault-tolerant strategy; The processing module is further used to: store the plurality of to-be-processed data blocks and the at least one to-be-processed check block into corresponding first target nodes respectively; The processing module is also used for: When receiving a storage node expansion instruction, updating the total number of storage nodes, wherein the storage node expansion instruction is used to add a new storage node in the distributed storage system; When it is determined that the total number of updated storage nodes is not less than the node number threshold, based on the node-level fault-tolerant strategy, a corresponding third target node is reallocated for each of the plurality of stored data blocks and at least one stored check block corresponding to each of the stored data stored in the distributed storage system; wherein, for each of the stored data, the following operations are performed respectively: Determine original storage nodes of each of a plurality of stored data blocks and at least one stored check block corresponding to the stored data in the distributed storage system; Count the number of times the same original storage node appears repeatedly in each original storage node; For the stored data blocks or stored check blocks corresponding to the original storage nodes whose repetition times exceed the selected quantity threshold, reallocate corresponding third target nodes in the storage nodes other than the respective original storage nodes; The plurality of stored data blocks and at least one stored check block corresponding to each of the stored data are respectively migrated to the corresponding third target node.
6. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the method according to any one of claims 1 to 4 is implemented.
7. A computer device, characterized in that: include: A memory for storing program instructions; The processor is used to call the program instructions stored in the memory, and execute the method according to any one of claims 1 to 4 according to the obtained program instructions.
8. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, and the computer-executable instructions are used to enable a computer to execute the method according to any one of claims 1 to 4.
