A data storage method and device based on multiple network ports
By acquiring and selecting multiple network ports with the highest performance to establish data links, the load balancing problem in parallel storage of multiple network ports is solved, the efficiency and reliability of the storage system are improved, and load balancing and low-latency data storage are realized.
Patent Information
- Application Number
- CN202010721144.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-07-24
- Publication Date
- 2024-12-17
- Estimated Expiration
- 2040-07-24
AI Technical Summary
In the parallel storage process of multiple network ports, it is difficult to achieve load balancing, resulting in low system utilization and unable to meet the needs of large-scale storage applications.
By obtaining storage node information, selecting multiple network ports of the same type with the highest transmission rate to establish data links, and establishing them in sequence according to the number of established data links, and repeating them until the upper limit of the data link is reached. At the same time, in the network port When the status is not online, it will be established from high to low according to the transmission rate, record the number of establishments and set the offline state to achieve load balancing.
Load balancing between multiple network ports is realized, data storage efficiency is improved, network delay is reduced, and storage system reliability and performance is improved.
Smart Images

Figure CN111880932B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of data storage, and in particular to a data storage method and device based on multiple network ports. Background Art
[0002] Traditional network storage systems use centralized storage servers to store all data. Storage servers become the bottleneck of system performance and the focus of reliability and security, and cannot meet the needs of large-scale storage applications. Distributed network storage systems use an extensible system structure, use multiple storage servers to share storage loads, and use location servers to locate storage information. It not only improves system reliability, availability, and access efficiency, but is also easy to expand.
[0003] With the development of storage technology, multi-network port storage technology has gradually emerged, that is, when storing between the client and the server, multiple network ports are used for parallel storage, thereby improving data storage efficiency. However, in the process of parallel storage of multiple network ports, it is difficult to achieve load balancing between multiple network ports, resulting in low system utilization. Summary of the invention
[0004] The purpose of the present invention is to provide a data storage method and device based on multiple network ports, so as to achieve load balancing among multiple network ports during data transmission and improve data storage efficiency.
[0005] The present invention adopts the following technical solution: a method for establishing a data link based on multiple network ports, comprising the following steps:
[0006] Obtain storage node information; wherein the storage node information includes the data link upper limit value and network port address list of the storage node;
[0007] According to the network port address list, select multiple network ports of the same type with the highest transmission rate to establish a data link;
[0008] The method for establishing the data link is as follows: obtaining the number of established data links of each network port, and establishing a data link with the network port with the least number and whose status is online;
[0009] Repeat the steps of establishing a data link until the number of data links on the storage node reaches the upper limit of the data link, and the data link establishment with the storage node is completed.
[0010] Furthermore, selecting the network port with the highest transmission rate to establish the data link also includes:
[0011] When the status of multiple network ports of the same type with the highest transmission rate are all offline, other types of network ports of the storage node are traversed in descending order of transmission rate and data links are established.
[0012] Furthermore, when the data link fails to be established:
[0013] Repeatedly establish a data link to the network port and record the number of establishments;
[0014] When the number of establishment times reaches the upper limit of the number of establishment times, the state of the network port is set to a possible offline state, and the established data link on the network port is disconnected;
[0015] Set the status of the network port to offline.
[0016] Furthermore, before obtaining the storage node information, the step of obtaining a storage node list is also included;
[0017] The storage node list is established through the management node in the storage system. The establishment method is:
[0018] Obtain node information of each storage node; wherein the node information includes the data link upper limit value, the number of established data links, the node network port address list and the node connection pool;
[0019] Summarize the node information of each storage node and generate a storage node list.
[0020] Further, after the state of the network port is set to an offline state, the method further includes:
[0021] When the network port in offline state changes to online state;
[0022] Disconnect all unused data links;
[0023] Re-establish the data link with the storage node.
[0024] Another technical solution of the present invention: a data link establishment device based on multiple network ports, comprising:
[0025] An acquisition module is used to acquire storage node information; wherein the storage node information includes a data link upper limit value and a network port address list of the storage node;
[0026] A selection module is used to select multiple network ports of the same type with the highest transmission rate to establish a data link according to the network port address list;
[0027] The method for establishing the data link is as follows: obtaining the number of established data links of each network port, and establishing the data link with the network port with the least number and whose status is online;
[0028] The repetitive execution module is used to repeatedly execute the step of establishing a data link until the number of data links on the storage node reaches the upper limit of the data link, and the establishment of the data link with the storage node is completed.
[0029] Further, selecting multiple network ports of the same type with the highest transmission rate to establish a data link also includes:
[0030] The traversal module is used to traverse other types of network ports of the storage node in order of transmission rate from high to low when the status of the network ports with the highest transmission rate are all offline, and establish data links.
[0031] Furthermore, when the data link fails to be established:
[0032] A repeated establishment module is used to repeatedly establish a data link to the network port and record the number of establishments;
[0033] A state setting module, used for setting the state of the network port to a possible offline state and disconnecting the established data link on the network port when the establishment times reach the upper limit of the establishment times;
[0034] Set the status of the network port to offline.
[0035] Another technical solution of the present invention: a data link establishment device based on multiple network ports, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, any one of the above-mentioned methods for establishing a data link based on multiple network ports is implemented.
[0036] Another technical solution of the present invention: a computer-readable storage medium, the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, it implements any of the above-mentioned methods for establishing a data link based on multiple network ports.
[0037] The beneficial effects of the present invention are as follows: by acquiring the node information of the storage node, the present invention can select multiple network ports of the same type with the highest performance to establish data links, and according to the number of established data links of the network port, establish data links with the network port with the highest performance of this type in turn to perform data transmission, thereby achieving the same number of data links established between multiple network ports, achieving load balancing between multiple network ports, improving the data storage efficiency of the storage network, and reducing network latency. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] Figure 1 A flowchart of a method for establishing a data link based on multiple network ports according to an embodiment of the present invention;
[0039] Figure 2 A schematic diagram of the connection relationship between nodes of the storage system in an embodiment of the present invention;
[0040] Figure 3 A module diagram of a device for establishing a data link based on multiple network ports according to an embodiment of the present invention;
[0041] Figure 4 A schematic diagram of a data link establishment device based on multiple network ports according to an embodiment of the present invention;
[0042] Figure 5 A detailed flow chart of an embodiment of the present invention;
[0043] Figure 6 Flow chart of a processing method when the network port status is changed to offline in an embodiment of the present invention;
[0044] Figure 7 Flow chart of a processing method when the network port status is changed to online in an embodiment of the present invention;
[0045] Figure 8 This is a flow chart of a first method for obtaining a network port status change in an embodiment of the present invention;
[0046] Fig. 9 This is a flow chart of a second method for acquiring network port status changes in an embodiment of the present invention. DETAILED DESCRIPTION
[0047] The present invention is described in detail below with reference to the accompanying drawings and specific embodiments.
[0048] The embodiment of the present invention discloses a method for establishing a data link based on multiple network ports, comprising the following steps:
[0049] S110, obtaining storage node information; wherein the storage node information includes the data link upper limit value and the network port address list of the storage node; S120, selecting multiple network ports of the same type with the highest transmission rate to establish a data link according to the network port address list; wherein the method for establishing a data link is: obtaining the number of established data links for each network port, and establishing a data link with the network port with the least number and whose status is online; S130, repeating the steps of establishing a data link until the number of data links on the storage node reaches the data link upper limit value, and completing the establishment of the data link with the storage node.
[0050] By acquiring the node information of the storage node, the present invention can select multiple network ports of the same type with the highest performance to establish data links, and according to the number of established data links of the network ports, establish data links with the network ports with the highest performance of this type in turn to perform data transmission, thereby achieving the same number of data links established between multiple network ports, achieving load balancing between multiple network ports, improving the data storage efficiency of the storage network, and reducing network latency.
[0051] In the embodiment of the present invention, selecting the network port with the highest transmission rate to establish the data link further includes:
[0052] When the status of multiple network ports of the same type with the highest transmission rate are all offline, other types of network ports of the storage node are traversed in descending order of transmission rate and data links are established.
[0053] During the process of establishing a data link, although the network port for establishing a data link appears in the network port address list, it is possible that when the current data link is established, the network port is offline due to other reasons (such as equipment maintenance, etc.). Therefore, it is necessary to traverse and check the online status of each type of network port one by one among the network ports with the highest transmission rate, delete those offline network ports, and then establish a data link with the online network port, thereby achieving load balancing of the network ports. Otherwise, establishing a data link with the offline network port will waste time, thereby extending the data storage time and reducing the storage efficiency of data storage.
[0054] In a possible implementation, when establishing a data link fails:
[0055] Repeatedly establish data links to the network port and record the number of establishments; when the number of establishments reaches the upper limit, set the state of the network port to a possible offline state and disconnect the established data link on the network port; when there is data transmission on the established data link, disconnect the established data link after the data transmission is completed; however, sometimes the data link may not be available, so it is necessary to wait for the data link to disconnect automatically. When all data links on the network port have been disconnected, set the state of the network port to an offline state.
[0056] When establishing a data link, if the establishment fails, it may be caused by a variety of reasons, such as the current network port is not online, the data transmission line is faulty, the data transmission packet is lost, etc. If the network port is abandoned after the first data link connection fails, it may be a misjudgment caused by the above reasons. Then, in order to improve the reliability of the storage system, the data link with the network port is repeatedly established. When the data link establishment fails multiple times, it can be determined that the connection failure is caused by the offline state of the network port. Therefore, the state of the network port is set to a possible offline state, and each established data link is gradually disconnected. When all data links are disconnected, the state of the network port is set to an offline state. Of course, in order to improve efficiency, a threshold value can be set according to the actual operating environment, that is, the upper limit of the number of establishment times.
[0057] like Figure 5 As shown, it is a flowchart of a specific implementation method of an embodiment of the present invention. It can be seen in the figure that when the client node wants to store data to the cluster node, it first obtains the storage node list from the management node (that is, finds the node information to be connected from the node list in the figure), and then obtains the network port information of the node from the node information of the node.
[0058] Through the network port information of the node, we can obtain which network ports in the node are the highest performance network ports (i.e., the network ports with the highest transmission rate), such as network port 1, network port 3, and network port 4. The next step is to determine the number of established data links in the network port with the highest performance and the current status of the network port. For example, the current status of network port 1 is online, and the number of established data links is 1; the current status of network port 3 is online, and the number of established data links is 2; the current status of network port 4 is offline, and the number of established data links is 2.
[0059] Therefore, after screening, network port 4 which is in an offline state is deleted, and then the network port with the least number of established data links, namely network port 1, is selected, and a request to establish a data link is sent to network port 1. When network port 1 receives the request, it returns a message indicating that a data link has been successfully established with the current client. At this time, the data link between the client and network port 1 is successfully established.
[0060] When no return message is received from network port 1, it is necessary to repeatedly send a request message to establish a data link. If a return message is received when the request is sent for the third time, the data link is established. If the number of requests sent reaches the maximum limit of 5 times, network port 1 is marked as offline. Next, a request is sent to network port 3. If no return message is received from network port 3 when the number of requests sent reaches the upper limit of 5 times, network port 3 is also set to offline.
[0061] At this time, it is necessary to select the network port with the second highest performance in the network port information to establish a data link, that is, compared with the network port 1, network port 3 and network port 4, the network port with the lowest transmission rate is assumed to be network port 6 and network port 8. Then repeat the above process to establish a connection with network port 6 and network port 8. If these two network ports cannot establish a connection, they are set as offline network ports. Continue to select network ports with lower transmission rates, such as network port 2, network port 5, and network port 7, and continue to send requests to these three network ports to establish data links.
[0062] When network port 2, network port 5 and network port 7 are all online, and there are 3 data links established on network port 2, 5 data links established on network port 5, and 4 data links established on network port 7, network port 2 is selected first to establish a data link. After the data link with network port 2 is established, the number of data links established by all network ports on the node is determined. For example, if there are 4 data links on network port 2, 5 data links on network port 5, and 4 data links on network port 7, the total number of data links on the node is 13. Assuming that the upper limit of the total number of data links of the network port is 18, then, according to the above principle, 2 more data links are established on network port 2 and network port 7 respectively, and 1 more data link is established on network port 5. Finally, the number of data links on network port 2, network port 5 and network port 7 is 6, which realizes the load balancing of the three network ports and improves the storage efficiency of the storage system.
[0063] like Figure 6 As shown, based on the above example, assuming that network port 7 is disconnected from the client due to equipment maintenance, which leads to the failure of communication between the client and network port 7, the client sends a request to network port 7 to re-establish the data link connection. When the request reaches the upper limit of 5 times, the connection with network port 7 is disconnected and network port 7 is set to offline state. At this time, the 6 data links on network port 7 are all disconnected, and it is necessary to re-establish data links with network port 2 and network port 5 so that the number of data links of the storage node reaches the upper limit. Therefore, according to the above method, continue to establish data links on network port 2 and network port 5, and finally establish 9 data links on network port 2 and network port 5 respectively, so as to achieve load balancing on network port 2 and network port 5.
[0064] like Figure 7 As shown, when the network port status is restored, after the client receives the network port status reply message, it disconnects the unused connection and rechecks the data links between the network ports. Continuing with the above embodiment, assuming that the status of network port 7 is restored to online, since load balancing is not achieved between network port 2, network port 5 and network port 7, after each data link between network port 2 and network port 5 completes a data transmission, the data link is disconnected, and the data link is reestablished according to the above method, and finally load balancing is achieved between network port 2, network port 5 and network port 7, that is, 6 data links are established on network port 2, network port 5 and network port 7 for data transmission.
[0065] Specifically, there are two ways to determine whether the network port changes from offline to online. The first is the passive polling method, which establishes a connection at a fixed time. If the connection fails to be established, the reason for the failure is timeout (i.e. no response) or network port abnormality, the connection fails to be established. If the connection is established successfully, the network port status is set to online. Figure 8 As shown, the specific steps of this method are:
[0066] 1. Start the timer and send a request to establish a data link to the network port every N seconds;
[0067] 2. If you receive a successful connection response message, set the network port status to online;
[0068] 3. If no return message indicating successful connection is received, the timer triggers the next request to establish a data link to the network port after N seconds, until the network port is online.
[0069] The second is the active reporting method, which is actively reported by the cluster node. When the network port is online, the network port driver will report the event to the cluster node. The cluster node reports the network port online event to the management node, and then the management node notifies all clients of the latest information on the network port status. The client confirms the establishment of the connection. Fig. 9 As shown, the specific steps are as follows:
[0070] 1. The network card driver on the cluster node reports the network port online event;
[0071] 2. The cluster node reports the event to the management node;
[0072] 3. The management node forwards the event to all clients;
[0073] 4. After receiving the event, the client establishes a connection with the node;
[0074] 5. If the connection is established successfully, set the network port status to online;
[0075] 6. Otherwise, no action is taken.
[0076] In one embodiment, before obtaining the storage node information, the process further includes obtaining a storage node list; wherein the storage node list is established by a management node in the storage system, and the establishment method is:
[0077] Obtain node information of each storage node; wherein the node information includes a data link upper limit, the number of established data links, a node network port address list, and a node connection pool; summarize the node information of each storage node and generate a storage node list.
[0078] like Figure 2 As shown in the figure, in the distributed storage system, there are management nodes, storage nodes (i.e. cluster nodes) and client nodes. Each cluster node registers node information with the management node, and other cluster nodes synchronize all node information from the management node. Each node records the node information of all nodes in the cluster. The client node downloads the synchronized node information from the management node and establishes multiple data links to the cluster node for data transmission.
[0079] In the embodiment of the present invention, the node information includes the maximum number of node connections (i.e., the data link upper limit of the storage node, NodeConnMax), the number of data links that have been established with this storage node, and the network port address list of the storage node. The above-mentioned data link upper limit of the storage node is subject to the hardware limitations of the network port and the storage node, such as the processing power of the CPU, the performance of the network card, etc.
[0080] The network port address list (NodeNicAddressList) is an ascending linked list sorted by the number of network port address connection links, which includes the information of a single network port (i.e., NodeNicAddress). The information of a single network port usually needs to include the single network port address information (physical address, logical address), network port address type (RDMA, FTP, TCP, etc.), network port address status (online, possibly offline, offline, etc.), network port established connection number (NicConnNum), etc.
[0081] When Node1 needs to establish a connection with Node2, it will traverse the network port addresses in NodeNicAddressList once to establish a data link until the data link is successfully established. In this type of multi-network port distributed storage system, data links can be established between two nodes through multiple network ports at the same time. When the number of data links of multiple network ports is the same, load balancing is achieved, and data can be stored synchronously through multiple network ports, thereby improving the network bandwidth of the storage system.
[0082] In one embodiment, after the state of the network port is set to an offline state, the method further includes:
[0083] When the network port in the offline state changes to the online state, disconnect all unused data links and re-establish the data link with the storage node.
[0084] In the embodiment of the present invention, multiple network ports are used simultaneously to establish multiple data links, which are evenly distributed on multiple network ports. After the abnormal network port is restored, the network port status is automatically restored and the load balance between the multiple network ports is restored. In a distributed parallel system with extremely high network requirements, multiple network ports can be used simultaneously, the network processing capacity of the distributed parallel system can be linearly improved, the network is automatically restored and balanced network processing capacity is provided, and the stability and performance of the system are greatly improved.
[0085] Another embodiment of the present invention also discloses a data link establishment device based on multiple network ports, such as Figure 3 As shown, including:
[0086] An acquisition module 210 is used to acquire storage node information; wherein the storage node information includes a data link upper limit value and a network port address list of the storage node; a selection module 220 is used to select multiple network ports of the same type with the highest transmission rate to establish a data link based on the network port address list; wherein the method for establishing a data link is: obtaining the number of established data links for each network port, and establishing a data link with the network port with the least number and an online status; a repeated execution module 230 is used to repeatedly execute the steps of establishing a data link until the number of data links on the storage node reaches the data link upper limit value, thereby completing the establishment of a data link with the storage node.
[0087] In this embodiment, selecting the network port with the highest transmission rate to establish a data link further includes:
[0088] The traversal module is used to traverse other types of network ports of the storage node in order of transmission rate from high to low and establish data links when the status of multiple network ports of the same type with the highest transmission rate are all offline.
[0089] Specifically, when the data link fails to be established:
[0090] A repeated establishment module is used to repeatedly establish a data link to the network port and record the number of establishments; a state setting module is used to set the state of the network port to a possible offline state and disconnect the established data link on the network port when the number of establishments reaches the upper limit of the number of establishments;
[0091] The state change module is used to set the state of the network port to an offline state.
[0092] It should be noted that the information interaction, execution process and other contents between the above modules are based on the same concept as the embodiment of the method of the present invention. Their specific functions and technical effects can be found in the method embodiment part and will not be repeated here.
[0093] Those skilled in the art can clearly understand that, for the convenience and simplicity of description, only the division of the above-mentioned functional modules is used as an example for illustration. In practical applications, the above-mentioned functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above. The functional modules in the embodiment can be integrated into a processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the modules in the above-mentioned device can refer to the corresponding process in the aforementioned method embodiment, which will not be repeated here.
[0094] Another embodiment of the present invention also discloses a data link establishment device 3 based on multiple network ports, such as Figure 4 As shown, it includes a memory 31, a processor 32, and a computer program 33 stored in the memory and executable on the processor. When the processor 32 executes the computer program 33, a method for establishing a data link based on multiple network ports is implemented in any one of the above method embodiments.
[0095] Another embodiment of the present invention further discloses a computer-readable storage medium, which stores a computer program. When the computer program is executed by a processor, a method for establishing a data link based on multiple network ports in any one of the above method embodiments is implemented.
Claims
1. A method for establishing a data link based on multiple network ports, characterized in that: The following steps are involved: Obtain storage node information; wherein the storage node information includes the data link upper limit value and network port address list of the storage node; According to the network port address list, multiple network ports of the same type with the highest transmission rates are selected to establish a data link; The method for establishing the data link is as follows: obtaining the number of established data links of each network port, and establishing a data link with the network port with the least number of established data links and in an online state; Repeat the step of establishing a data link until the number of data links on the storage node reaches the upper limit of the data link, and the data link establishment with the storage node is completed; Selecting the network port with the highest transmission rate to establish a data link also includes: When the status of multiple network ports of the same type with the highest transmission rate are all offline, other types of network ports of the storage node are traversed in descending order of transmission rate and data links are established.
2. A method for establishing a data link based on multiple network ports as claimed in claim 1, characterized in that: When establishing a data link fails: Repeatedly establish a data link to the network port and record the number of establishments; When the number of establishment times reaches the upper limit of the number of establishment times, the state of the network port is set to a possible offline state, and the established data link on the network port is disconnected; Set the network port status to offline.
3. A method for establishing a data link based on multiple network ports according to claim 1 or 2, characterized in that: Before obtaining the storage node information, it also includes obtaining the storage node list; The storage node list is established by the management node in the storage system in the following way: Obtaining node information of each storage node; wherein the node information includes a data link upper limit, the number of established data links, a node network port address list, and a node connection pool; The node information of each storage node is aggregated to generate a storage node list.
4. A method for establishing a data link based on multiple network ports as claimed in claim 3, characterized in that: After the network port is set to offline, the following is also included: When the network port in offline state changes to online state; Disconnect all unused data links; Re-establish the data link with the storage node.
5. A data link establishment device based on multiple network ports, characterized in that: include: An acquisition module is used to acquire storage node information; wherein the storage node information includes a data link upper limit value and a network port address list of the storage node; A selection module is used to select multiple network ports of the same type with the highest transmission rate to establish a data link according to the network port address list; The method for establishing the data link is as follows: obtaining the number of established data links of each network port, and establishing the data link with the network port with the least number of established data links and being in an online state; a repeating execution module, configured to repeatedly execute the step of establishing a data link until the number of data links on the storage node reaches the upper limit of the data link, thereby completing the establishment of the data link with the storage node; Selecting the network port with the highest transmission rate to establish a data link also includes: When the status of multiple network ports of the same type with the highest transmission rate are all offline, other types of network ports of the storage node are traversed in descending order of transmission rate and data links are established.
6. The device for establishing a data link based on multiple network ports according to claim 5, characterized in that: Selecting the network port with the highest transmission rate to establish a data link also includes: The traversal module is used to traverse other types of network ports of the storage node in descending order of transmission rate and establish data links when the status of multiple network ports of the same type with the highest transmission rate are all offline.
7. The device for establishing a data link based on multiple network ports according to claim 6, wherein: When establishing a data link fails: A repeated establishment module is used to repeatedly establish a data link to the network port and record the number of establishments; A status setting module is used to set the status of the network port to a possible offline state and disconnect the established data link on the network port when the number of establishment times reaches the upper limit of the number of establishment times; The state change module is used to set the state of the network port to an offline state.
8. A data link establishment device based on multiple network ports, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the method for establishing a data link based on multiple network ports as described in any one of claims 1 to 4 is implemented.
9. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the method for establishing a data link based on multiple network ports as described in any one of claims 1 to 4 is implemented.
Citation Information
Patent Citations
Multi-mode mobile terminal and method for balancing load
CN102595502A
Method and system for selecting data link in network
WO2018214059A1
