Method, device, processor and computer-readable storage medium for realizing file sharing based on local area network decentralization
By broadcasting the requested file list on the LAN and updating the shared folder contents, file sharing is realized without manually configuring the IP address, solving the problem of cumbersome file sharing operations in the existing technology and improving the user experience.
Patent Information
- Application Number
- CN202111242203.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-10-25
- Publication Date
- 2024-10-11
- Estimated Expiration
- 2041-10-25
AI Technical Summary
The prior art requires tedious configuration and operation when sharing files in home or office network systems, especially the need to manually enter the server IP address, resulting in poor user experience.
By broadcasting the requested file list when the computer is online, if other computers respond, they send and receive the shared file list, update the folder contents, so that each computer displays the shared files of all nodes in the LAN, and users do not need to know the host name of the computer where the file is located. or IP address.
The file sharing process is simplified, the cumbersomeness of user configuration is reduced, the user experience is improved, and the uncentralized file sharing is realized within the global area network.
Smart Images

Figure CN113946550B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer network technology, and in particular to the field of computer network communication technology, and specifically refers to a method, device, processor and computer-readable storage medium thereof for realizing file sharing based on local area network decentralization. Background Art
[0002] Usually, when a user needs to copy files from another computer in a home or office network system, or copy files from a mobile phone to other terminals such as a PC or tablet, the main methods are currently samba, tftp, or small software for file transfer. Most of these methods are performed in client and server mode. For security reasons, the server configuration is more troublesome, and the server IP address needs to be manually entered each time it is accessed. Although AirDrop can be used between Apple devices, users are required to operate the file on the shared device before they can find the file on another device. Based on this, in view of the defects in the prior art, there is an urgent need for a method that can effectively avoid cumbersome operations and quickly realize resource sharing. Summary of the invention
[0003] The purpose of the present invention is to overcome the above-mentioned shortcomings of the prior art and provide a simple and easy-to-operate method, device, processor and computer-readable storage medium for realizing file sharing based on local area network decentralization.
[0004] In order to achieve the above-mentioned purpose, the method, device, processor and computer-readable storage medium for realizing file sharing based on local area network decentralization of the present invention are as follows:
[0005] The method for realizing file sharing based on local area network decentralization has the following main features:
[0006] (1) When the computer goes online, it first determines whether the requested file broadcast can get a response;
[0007] (2) Execute the sharing operation of the corresponding file list content according to the judgment result.
[0008] Preferably, the step (2) specifically comprises the following steps:
[0009] (2.1) If the file broadcast request does not receive a response, that is, there are no other computers in the current LAN, then only the shared files on the local computer will be displayed in the shared folder of the current computer; otherwise, proceed to step (2.2);
[0010] (2.2) If there are other computers in the current local area network that receive the file request message, the local shared file list of the current computer will be sent to the computer that sent the file list request to complete the subsequent file read and write operations.
[0011] Preferably, the step (2.2) specifically includes the following steps:
[0012] (2.2.1) When the computer sending the file request message receives the shared file list sent by other computers, it sends its own shared file list to other computers and updates the file list content in its own shared folder at the same time;
[0013] (2.2.2) After receiving the shared file list sent by other computers, each computer calculates the hostname or IP address of the computer corresponding to the current shared file list;
[0014] (2.2.3) the current computer sends a file read / write request to the accessed computer where the file request message is sent;
[0015] (2.2.4) After receiving the corresponding file read and write request, the accessed computer sends its own file list content to the current computer requesting file access message;
[0016] (2.2.5) After the current computer receives the file list content sent by the accessed computer, it can start the file reading and writing operation.
[0017] Preferably, the step (2.2.3) further includes:
[0018] When a user operates a file in a shared folder of the current computer, the current computer first retrieves the hostname or IP address of the computer corresponding to the file to be shared according to the shared file list in the shared folder.
[0019] Preferably, each computer provides shared files that need to be shared with other computers, and can access shared files of other computers.
[0020] Preferably, the shared folder of each computer can display the shared files provided by the computers of all nodes in the local area network.
[0021] Preferably, if the shared file lists of different computers in the LAN contain shared files with the same file name, the hash value of the shared file of each computer is calculated respectively. If the hash values are the same, only one file name is displayed in the shared folder; if the hash values are different, the file name with the hostname suffix added is displayed in the shared folder.
[0022] The main feature of the device for realizing decentralized file sharing based on a local area network is that the device comprises:
[0023] a processor configured to execute computer executable instructions;
[0024] The memory stores one or more computer executable instructions. When the computer executable instructions are executed by the processor, the various steps of the above-mentioned method for realizing file sharing based on local area network decentralization are implemented.
[0025] The main feature of the processor for implementing file sharing based on LAN decentralization is that the processor is configured to execute computer executable instructions. When the computer executable instructions are executed by the processor, the various steps of the above-mentioned method for implementing file sharing based on LAN decentralization are implemented.
[0026] The main feature of the computer-readable storage medium is that a computer program is stored thereon, and the computer program can be executed by a processor to implement the various steps of the method for realizing file sharing based on local area network decentralization.
[0027] The method, device, processor and computer-readable storage medium for realizing file sharing based on decentralized local area network of the present invention are adopted. When each computer goes online, it will broadcast the instruction of requesting file list to the local area network, and send its own shared file list to other computers in the whole network at the same time. After receiving the file list request, other computers will send their own shared file list to the requester. After the newly online computer receives the shared file list returned by other computers, it updates its own shared folder. After receiving the shared file list of the newly online file, other computers also update their own shared folders, so that the contents in the shared folders of all computers in the whole network are consistent. Users only need to operate on the computer in the same way as opening an ordinary folder to see the shared files on all computers in the whole network, without knowing which computer the file is on, nor the host name or IP address of the computer. It can effectively reduce the cumbersome configuration brought by users when using it, and greatly improve the user experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0028] Figure 1It is a schematic diagram of the framework of the method for realizing file sharing based on decentralized local area network of the present invention. DETAILED DESCRIPTION
[0029] In order to more clearly describe the technical content of the present invention, further description is given below in conjunction with specific embodiments.
[0030] Before describing in detail embodiments according to the present invention, it should be noted that, hereinafter, the terms "comprises", "includes" or any other variations are intended to cover non-exclusive inclusion, whereby a process, method, article or apparatus comprising a series of elements includes not only these elements, but also other elements not explicitly listed or inherent to such process, method, article or apparatus.
[0031] The method for realizing file sharing based on local area network decentralization includes the following steps:
[0032] (1) When the computer goes online, it first determines whether the requested file broadcast can get a response;
[0033] (2) Execute the sharing operation of the corresponding file list content according to the judgment result.
[0034] As a preferred embodiment of the present invention, the step (2) specifically comprises the following steps:
[0035] (2.1) If the file broadcast request does not receive a response, that is, there are no other computers in the current LAN, then only the shared files on the local computer will be displayed in the shared folder of the current computer; otherwise, proceed to step (2.2);
[0036] (2.2) If there are other computers in the current local area network that receive the file request message, the local shared file list of the current computer will be sent to the computer that sent the file list request to complete the subsequent file read and write operations.
[0037] As a preferred embodiment of the present invention, the step (2.2) specifically includes the following steps:
[0038] (2.2.1) When the computer sending the file request message receives the shared file list sent by other computers, it sends its own shared file list to other computers and updates the file list content in its own shared folder at the same time;
[0039] (2.2.2) After receiving the shared file list sent by other computers, each computer calculates the hostname or IP address of the computer corresponding to the current shared file list;
[0040] (2.2.3) the current computer sends a file read / write request to the accessed computer where the file request message is sent;
[0041] (2.2.4) After receiving the corresponding file read and write request, the accessed computer sends its own file list content to the current computer requesting file access message;
[0042] (2.2.5) After the current computer receives the file list content sent by the accessed computer, it can start the file reading and writing operation.
[0043] As a preferred embodiment of the present invention, the step (2.2.3) further includes:
[0044] When a user operates a file in a shared folder of the current computer, the current computer first retrieves the hostname or IP address of the computer corresponding to the file to be shared according to the shared file list in the shared folder.
[0045] As a preferred embodiment of the present invention, each computer provides shared files that need to be shared with other computers, and can access shared files of other computers.
[0046] As a preferred embodiment of the present invention, the shared folder of each computer can display the shared files provided by the computers of all nodes in the local area network.
[0047] As a preferred embodiment of the present invention, if the shared file lists of different computers in a local area network contain shared files with the same file name, the hash value of the shared file of each computer is calculated respectively. If the hash values are the same, only one file name is displayed in the shared folder; if the hash values are different, the file name with the hostname suffix added is displayed in the shared folder.
[0048] The device for realizing decentralized file sharing based on a local area network, wherein the device comprises:
[0049] a processor configured to execute computer executable instructions;
[0050] The memory stores one or more computer executable instructions. When the computer executable instructions are executed by the processor, the various steps of the above-mentioned method for realizing file sharing based on local area network decentralization are implemented.
[0051] The processor for implementing file sharing based on a decentralized local area network, wherein the processor is configured to execute computer executable instructions, and when the computer executable instructions are executed by the processor, the various steps of the method for implementing file sharing based on a decentralized local area network are implemented.
[0052] The computer-readable storage medium stores a computer program thereon, and the computer program can be executed by a processor to implement the various steps of the method for realizing file sharing based on local area network decentralization.
[0053] In actual application, each computer is not only a server, but also a client. This technical solution allows users to view and use LAN shared files by directly opening the shared folder on each computer by starting the computer without the need for users to configure other computer IPs, device names, and samba accounts and passwords. In addition, the security issues involved can also be solved through RSA certificates.
[0054] In a specific embodiment of the present invention, calculating the hash value of the shared file of each computer also includes calculating the sha1 and md5 values.
[0055] Any process or method description in a flowchart or otherwise described herein may be understood to represent a module, segment or portion of code that includes one or more executable instructions for implementing the steps of a specific logical function or process, and the scope of the preferred embodiments of the present invention includes alternative implementations in which functions may not be performed in the order shown or discussed, including performing functions in a substantially simultaneous manner or in the reverse order depending on the functions involved, which should be understood by those skilled in the art to which the embodiments of the present invention belong.
[0056] It should be understood that each part of the present invention can be implemented by hardware, software, firmware or a combination thereof. In the above embodiments, multiple steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution device.
[0057] A person of ordinary skill in the art may understand that all or part of the steps of the method for implementing the above-mentioned embodiment may be completed by instructing the relevant hardware through a program, and the program may be stored in a computer-readable storage medium, which, when executed, includes one of the steps of the method embodiment or a combination thereof.
[0058] The storage medium mentioned above can be a read-only memory, a magnetic disk or an optical disk, etc.
[0059] In the description of this specification, the description with reference to the terms "an embodiment", "some embodiments", "example", "specific example", or "embodiment" means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner.
[0060] Although the embodiments of the present invention have been shown and described above, it is to be understood that the above embodiments are exemplary and are not to be construed as limitations of the present invention. A person skilled in the art may change, modify, replace and vary the above embodiments within the scope of the present invention.
[0061] The method, device, processor and computer-readable storage medium for realizing file sharing based on decentralized local area network of the present invention are adopted. When each computer goes online, it will broadcast the instruction of requesting file list to the local area network, and send its own shared file list to other computers in the whole network at the same time. After receiving the file list request, other computers will send their own shared file list to the requester. After the newly online computer receives the shared file list returned by other computers, it updates its own shared folder. After receiving the shared file list of the newly online file, other computers also update their own shared folders, so that the contents in the shared folders of all computers in the whole network are consistent. Users only need to operate on the computer in the same way as opening an ordinary folder to see the shared files on all computers in the whole network, without knowing which computer the file is on, nor the host name or IP address of the computer. It can effectively reduce the cumbersome configuration brought by users when using it, and greatly improve the user experience.
[0062] In this specification, the present invention has been described with reference to specific embodiments thereof. However, it is apparent that various modifications and variations may be made without departing from the spirit and scope of the present invention. Therefore, the specification and drawings should be regarded as illustrative rather than restrictive.
Claims
1. A method for realizing file sharing based on local area network decentralization. It is characterized in that The method comprises the following steps: (1) When the computer goes online, it first determines whether the requested file broadcast can get a response; (2) performing a sharing operation of the corresponding file list content according to the judgment result; The step (2) specifically comprises the following steps: (2.1) If the file broadcast request does not receive a response, that is, there are no other computers in the current LAN, then only the shared files on the local computer will be displayed in the shared folder of the current computer; otherwise, proceed to step (2.2); (2.2) If there are other computers in the current LAN that receive the file request message, the local shared file list of the current computer is sent to the computer that sent the file list request to complete the subsequent file read and write operations; The step (2.2) specifically comprises the following steps: (2.2.1) When the computer sending the file request message receives the shared file list sent by other computers, it sends its own shared file list to other computers and updates the file list content in its own shared folder at the same time; (2.2.2) After receiving the shared file list sent by other computers, each computer calculates the hostname or IP address of the computer corresponding to the current shared file list; (2.2.3) the current computer sends a file read / write request to the accessed computer where the file request message is sent; (2.2.4) After receiving the corresponding file read and write request, the accessed computer sends its own file list content to the current computer requesting file access message; (2.2.5) After the current computer receives the file list content sent by the accessed computer, it can start the file reading and writing operation.
2. The method for realizing file sharing based on decentralization of a local area network according to claim 1, It is characterized in that The step (2.2.3) further comprises: When a user operates a file in a shared folder of the current computer, the current computer first retrieves the hostname or IP address of the computer corresponding to the file to be shared according to the shared file list in the shared folder.
3. The method for realizing file sharing based on decentralization of a local area network according to claim 1, It is characterized in that Each computer provides shared files that need to be shared with other computers, and can access the shared files of other computers.
4. The method for realizing file sharing based on decentralization of a local area network according to claim 1, It is characterized in that The shared folders of each computer can display the shared files provided by computers of all nodes in the local area network.
5. The method for realizing file sharing based on decentralization of a local area network according to claim 1, It is characterized in that If the shared file lists of different computers in the LAN contain shared files with the same file name, the hash value of the shared file of each computer is calculated respectively. If the hash values are the same, only one file name is displayed in the shared folder; if the hash values are different, the file name with the hostname suffix added is displayed in the shared folder.
6. A device for realizing decentralized file sharing based on a local area network, It is characterized in that The device comprises: a processor configured to execute computer executable instructions; A memory storing one or more computer executable instructions, wherein when the computer executable instructions are executed by the processor, the steps of the method for realizing file sharing based on local area network decentralization described in any one of claims 1 to 5 are implemented.
7. A processor for file sharing based on decentralized local area network. It is characterized in that The processor is configured to execute computer-executable instructions. When the computer-executable instructions are executed by the processor, the steps of the method for realizing file sharing based on local area network decentralization described in any one of claims 1 to 5 are implemented.
8. A computer-readable storage medium, It is characterized in that A computer program is stored thereon, and the computer program can be executed by a processor to implement the various steps of the method for realizing file sharing based on local area network decentralization as described in any one of claims 1 to 5.
