Point-to-point distributed storage method in local area network
By using the UDP protocol broadcast mechanism in the LAN, the problem of low efficiency of TCP protocol is solved, efficient one-to-many communication between nodes in the LAN is realized, point-to-point distributed storage is realized, networking efficiency is improved, and multi-node support is supported Cooperative transmission.
Patent Information
- Application Number
- CN202111590561.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-23
- Publication Date
- 2024-11-15
- Estimated Expiration
- 2041-12-23
AI Technical Summary
The existing TCP protocol is inefficient in point-to-point distributed storage, requiring the central server to determine the node location and can only conduct one-to-one communication, which limits the network efficiency of the network.
In the LAN, UDP protocol is used to broadcast storage requirements and download demand messages through the router, realizing one-to-many communication between nodes, allowing point-to-point distributed storage.
Through the broadcast mechanism of the UDP protocol, nodes can conduct one-to-many communication, realize point-to-point distributed storage, improve networking efficiency, save server costs, and support multi-node collaborative transmission and breakpoint continuous transmission.
Smart Images

Figure CN114338700B_ABST
Abstract
Description
Technical Field
[0001] The invention relates to a local area network point-to-point distributed storage method. Background Art
[0002] Distributed storage is a data storage technology that combines the storage space on machines through the network to form a virtual storage space. Peer-to-peer distributed storage uses peer-to-peer technology to expand the storage space from the server to all personal computers, which can maximize the use of bandwidth and storage space while also saving server costs. Currently, most peer-to-peer distributed storage networks use the TCP protocol for networking.
[0003] TCP connection has the following disadvantages: low efficiency, TCP connection requires three-way handshake, and can only communicate one-to-one. A network center server is required, and the location of another point must be determined through the central server before communication and networking can be carried out. Summary of the invention
[0004] The present invention provides a local area network point-to-point distributed storage method to solve the above-mentioned technical problems, and specifically adopts the following technical solutions:
[0005] A local area network point-to-point distributed storage method is applied to a local area network system, wherein the local area network system includes a plurality of user nodes, and the plurality of user nodes are connected to a router, and comprises the following steps:
[0006] One of the user nodes sends a storage request message to the router;
[0007] The router broadcasts the storage demand message to all other user nodes in the LAN;
[0008] The user node receiving the storage demand message sends a first location information message including its own location to the user node sending the storage demand message;
[0009] The user node that sends the storage demand message sends the source file to the corresponding multiple user nodes that send the first location information messages respectively according to the received multiple location information messages.
[0010] Furthermore, the storage demand message is a UDP protocol message and the first location information message is a UDP protocol message.
[0011] Furthermore, the specific method for the user node sending the storage demand message to send the source file to the corresponding multiple user nodes sending the first location information messages respectively according to the received multiple first location information messages is:
[0012] The user node that sends the storage demand message sends the source file to multiple user nodes that send the first location information messages through the UDP protocol.
[0013] Furthermore, the specific method for the user node sending the storage demand message to send the source file to the corresponding multiple user nodes sending the first location information messages respectively according to the received multiple first location information messages is:
[0014] The user node sending the storage demand message generates an upload queue according to the received multiple first location information messages;
[0015] The user node that sends the storage demand message transfers the source file to multiple user nodes that send the first location information messages according to the upload queue.
[0016] Furthermore, the user node that sends the storage demand message simultaneously sends the source file to a first number of user nodes that send the first location information messages.
[0017] Furthermore, the first number is greater than or equal to 1 and less than or equal to 5.
[0018] Further, one of the user nodes sends a download request message to the router;
[0019] The router broadcasts the download request message to all other user nodes in the LAN;
[0020] The user node that receives the download request message and stores the source file sends a second location information message including its own location to the user node that sends the download request message;
[0021] The user node that sends the download request message downloads the source file from the corresponding multiple user nodes that send the second location information messages respectively according to the received multiple second location information messages.
[0022] Furthermore, the download request message and the second location information message are UDP protocol messages.
[0023] Furthermore, the specific method for the user node sending the download request message to download the source file from the corresponding multiple user nodes sending the second location information messages according to the received multiple second location information messages is:
[0024] The user node that sends the download request message downloads the source file from multiple user nodes that send the second location information messages through the UDP protocol.
[0025] Furthermore, the specific method for the user node sending the download request message to download the source file from the corresponding multiple user nodes sending the second location information messages according to the received multiple second location information messages is:
[0026] The user node sending the download request message divides the source file to be downloaded into multiple files, respectively, from one file corresponding to multiple user nodes sending the second location information messages, and assembles the downloaded multiple files into a completed source file after the download is completed.
[0027] The invention is beneficial in that it provides a LAN point-to-point distributed storage method, which uses router broadcasting in the LAN to achieve networking, and adopts the UDP protocol to enable nodes to perform one-to-many communication, thereby achieving point-to-point distributed storage. BRIEF DESCRIPTION OF THE DRAWINGS
[0028] Figure 1 It is a schematic diagram of a local area network point-to-point distributed storage method of the present invention. DETAILED DESCRIPTION
[0029] The present invention is described in detail below with reference to the accompanying drawings and specific embodiments.
[0030] like Figure 1 The present application shows a LAN point-to-point distributed storage method, which is applied to a LAN system, wherein the LAN system includes a plurality of user nodes, and the plurality of user nodes are connected to a router. The LAN point-to-point distributed storage method includes the following steps: S1: One of the user nodes sends a storage demand message to the router. S2: The router broadcasts the storage demand message to all other user nodes in the LAN. S3: The user node that receives the storage demand message sends a first location information message containing its own location to the user node that sends the storage demand message. S4: The user node that sends the storage demand message sends the source file to the corresponding plurality of user nodes that send the first location information message according to the received plurality of location information messages. The above steps are described in detail below.
[0031] For step S1: one of the user nodes sends a storage request message to the router.
[0032] When one of the user nodes, such as node A, needs to store a source file, node A needs to initiate a storage demand broadcast to the local area network. Specifically, node A sends a storage demand message to the router. The storage demand message is a UDP protocol message, which only needs to send a request to the router, without a response, and does not need to know which nodes have received the broadcast.
[0033] For step S2: the router broadcasts the storage demand message to all other user nodes in the local area network.
[0034] When the router receives the storage request message, it will broadcast the storage request message to all connected machines in the LAN.
[0035] Regarding step S3: the user node that receives the storage requirement message sends a first location information message containing its own location to the user node that sends the storage requirement message.
[0036] Nodes that receive the storage request message, such as node B, node C, node D, node E, and node F, actively send a first location information message containing their own location information (MAC and IP) to node A. The first location information message is also a UDP request. Therefore, for nodes B, node C, node D, node E, and node F, this request consumes almost no computing resources, and nodes B, node C, node D, node E, and node F do not care whether node A receives the request.
[0037] Regarding step S4: the user node that sends the storage demand message sends the source file to the corresponding multiple user nodes that send the first location information messages respectively according to the received multiple location information messages.
[0038] After node A receives the first location information of multiple nodes, node A can send the source file to multiple target nodes through the UDP protocol to meet the needs of point-to-point distributed storage.
[0039] As a preferred implementation, the specific method for the user node sending the storage demand message to send the source file to the corresponding multiple user nodes sending the first location information messages respectively according to the received multiple first location information messages is:
[0040] The user node that sends the storage requirement message generates an upload queue according to the received multiple first location information messages.
[0041] The user node that sends the storage demand message transfers the source file to multiple user nodes that send the first location information messages according to the upload queue.
[0042] It is understandable that in order to avoid network congestion, if storage reception is initiated to all nodes at once, the amount of network data will become very large. Therefore, in this application, node A will sort node B, node C, node D, node E and node F, and then transmit the source file to multiple user nodes that send the first location information message in sequence.
[0043] Preferably, node A will first select a first number of nodes from node B, node C, node D, node E and node F to send source files.
[0044] As a preferred implementation, the first number is greater than or equal to 1 and less than or equal to 5.
[0045] In the present application, the first number is 2. For example, node A first uploads the source file to node C and node D, while node B, node E and node F queue up according to the upload queue and wait for uploading.
[0046] As a preferred implementation, when one of the user nodes needs to download a file, one of the user nodes sends a download request message to the router. The router broadcasts the download request message to all other user nodes in the local area network. The user node that receives the download request message and stores the source file sends a second location information message containing its own location to the user node that sends the download request message. The user node that sends the download request message downloads the source file from the corresponding multiple user nodes that send the second location information messages according to the received multiple second location information messages.
[0047] It is understandable that when node A needs to download the source file, node A sends a download request message to the router, and the router broadcasts the download request message to other nodes. The user nodes that receive the download request message and store the source file, such as node B, node C, node D, node E and node F, send the second location information message to node A. After node A receives the second location information of (many) nodes, node A can download the source file from multiple target nodes through the UDP protocol. Preferably, the download request message and the second location information message are UDP protocol messages.
[0048] As a preferred implementation, the specific method for the user node sending the download request message to download the source file from the corresponding multiple user nodes sending the second location information messages according to the received multiple second location information messages is:
[0049] The user node sending the download request message divides the source file to be downloaded into multiple files, respectively, from one file corresponding to multiple user nodes sending the second location information messages, and assembles the downloaded multiple files into a completed source file after the download is completed.
[0050] It is understandable that when downloading files, if the node suddenly goes offline (the machine is turned off or crashed), the program can record the download progress so that the node can be switched to resume the download, saving time. In addition, the file can be split into multiple copies, which can be transmitted simultaneously by multiple nodes and assembled into a complete file after the transmission is completed, improving efficiency.
[0051] The above shows and describes the basic principles, main features and advantages of the present invention. Those skilled in the art should understand that the above embodiments do not limit the present invention in any form, and any technical solution obtained by equivalent replacement or equivalent transformation falls within the protection scope of the present invention.
Claims
1. A local area network point-to-point distributed storage method, applied to a local area network system, wherein the local area network system comprises a plurality of user nodes, and the plurality of user nodes are connected to a router, wherein: The following steps are involved: One of the user nodes sends a storage demand message to the router; The router broadcasts the storage demand message to all other user nodes in the local area network; The user node receiving the storage demand message sends a first location information message including its own location to the user node sending the storage demand message; The user node sending the storage demand message sends the source file to the corresponding multiple user nodes sending the first location information messages respectively according to the received multiple location information messages; The storage demand message is a UDP protocol message and the first location information message is a UDP protocol message; The specific method by which the user node sending the storage demand message sends the source file to the corresponding multiple user nodes sending the first location information messages respectively according to the received multiple first location information messages is: The user node sending the storage demand message sends the source file to multiple user nodes sending the first location information message through the UDP protocol; The specific method by which the user node sending the storage demand message sends the source file to the corresponding multiple user nodes sending the first location information messages respectively according to the received multiple first location information messages is: The user node sending the storage requirement message generates an upload queue according to the received plurality of first location information messages; The user node sending the storage demand message transmits the source file to multiple user nodes sending the first location information message according to the upload queue; The user node sending the storage demand message simultaneously sends the source file to a first number of user nodes sending the first location information message; The first number is greater than or equal to 1 and less than or equal to 5; One of the user nodes sends a download request message to the router; The router broadcasts the download request message to all other user nodes in the local area network; The user node that receives the download request message and stores the source file sends a second location information message containing its own location to the user node that sends the download request message; The user node sending the download request message downloads the source file from the corresponding multiple user nodes sending the second location information messages respectively according to the received multiple second location information messages; The specific method for the user node sending the download request message to download the source file from the corresponding multiple user nodes sending the second location information messages according to the received multiple second location information messages is: The user node sending the download request message divides the source file to be downloaded into multiple files, respectively, from one file corresponding to multiple user nodes sending the second location information messages, and after the download is completed, assembles the downloaded multiple files into a completed source file.
2. The local area network point-to-point distributed storage method according to claim 1, characterized in that: The download request message and the second location information message are UDP protocol messages.
3. The local area network point-to-point distributed storage method according to claim 1, characterized in that: The specific method for the user node sending the download request message to download the source file from the corresponding multiple user nodes sending the second location information messages according to the received multiple second location information messages is: The user node that sends the download request message downloads the source file from multiple user nodes that send the second location information messages through the UDP protocol.
