Local area network file sharing operation method and device, storage medium and terminal
By establishing point -to -point connections in the local area network, the file block of shared files is obtained through the terminal, incremental transmission is achieved, the problem of low transmission efficiency of the existing technology of the existing technology, and improving the speed and efficiency of transmission.
Patent Information
- Application Number
- CN202310922868.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-07-25
- Publication Date
- 2025-01-28
AI Technical Summary
The existing LAN file sharing method is inefficient during transmission, especially when multiple transmissions, and cannot achieve incremental transmission, resulting in repeated transmission of full file content.
By establishing point -to -point connections between the first terminal and the second terminal, at least one file block of the shared file is obtained through the end of the end, and it is stored in the first distributed management system to achieve incremental transmission.
The file transmission efficiency of the file sharing files has been improved, the content of the full file of repeated transmission is reduced, and the transmission speed is improved.
Smart Images

Figure CN119383181A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of file sharing, and in particular to a local area network file sharing operation, device, storage medium and terminal. Background Art
[0002] In daily office scenarios, there may be a situation where a terminal shares local files with other terminals. One method of implementing cross-terminal file sharing may be to share files between terminals via a local area network, and all terminals in the local area network can transfer files to each other.
[0003] In the LAN file sharing method, the network file sharing service Samba is mostly used for file sharing between Linux and Windows systems. Samba can be used for file sharing between Windows and Linux systems, and can also be used for resource sharing between Linux systems. In addition, the Network File System (NFS) can also complete data sharing between Linux and Linux. Summary of the invention
[0004] The embodiment of the present application provides a local area network file sharing operation, device, computer storage medium and terminal, which obtains the file content of the shared file by cross-terminal acquisition of at least one file block of the shared file of other terminals, thereby realizing incremental transmission, that is, for a shared file that has been transmitted multiple times, only the incremental file content corresponding to the shared file can be transmitted in the subsequent transmission process, thereby improving the file transmission efficiency of the local area network shared file. The technical solution is as follows:
[0005] In a first aspect, an embodiment of the present application provides a local area network file sharing operation, which is applied to a first terminal, and the method includes:
[0006] Establishing a point-to-point connection between the first terminal and the second terminal through a first distributed management system via a cloud server based on a terminal storage drive address;
[0007] In response to a file acquisition operation for a first shared file of the second terminal, acquiring a file acquisition instruction for the file acquisition operation;
[0008] In response to the file acquisition instruction, acquiring at least one first file block corresponding to the first shared file from the second distributed management system of the second terminal through the first distributed management system using the point-to-point connection;
[0009] The first shared file is stored in the first distributed management system based on the at least one first file block.
[0010] In a second aspect, an embodiment of the present application provides a local area network file sharing operation device, which is applied to a first terminal, and the device includes:
[0011] A connection establishment module, used to establish a point-to-point connection between the first terminal and the second terminal through a cloud server based on a terminal storage drive address through a first distributed management system;
[0012] an instruction determination module, configured to, in response to a file acquisition operation for a first shared file of the second terminal, acquire a file acquisition instruction for the file acquisition operation;
[0013] a data acquisition module, configured to, in response to the file acquisition instruction, acquire at least one first file block corresponding to the first shared file from the second distributed management system of the second terminal through the first distributed management system using the point-to-point connection;
[0014] A data storage module is used to store the first shared file in the first distributed management system based on the at least one first file block.
[0015] In a third aspect, an embodiment of the present application provides a computer storage medium, wherein the computer storage medium has a plurality of instructions, and the instructions are suitable for being loaded by a processor and executing the above-mentioned method steps.
[0016] In a fourth aspect, an embodiment of the present application provides a terminal, which may include: a memory and a processor; wherein the memory stores a computer program, and the computer program is suitable for being loaded by the memory and executing the above-mentioned method steps.
[0017] The beneficial effects brought by the technical solution provided by the embodiment of the present application include at least:
[0018] In an embodiment of the present application, the first terminal establishes a point-to-point connection between the first terminal and the second terminal through the first distributed management system based on the terminal storage drive address through the cloud server, responds to the file acquisition operation for the first shared file of the second terminal, obtains the file acquisition instruction for the file acquisition operation, responds to the file acquisition instruction, uses the point-to-point connection to obtain at least one first file block corresponding to the first shared file from the second distributed management system of the second terminal through the first distributed management system, and stores the first shared file to the first distributed management system based on the at least one first file block. In an embodiment of the present application, on the basis of establishing a point-to-point connection between the first terminal and the second terminal, after determining the file acquisition instruction for the first shared file of the second terminal, the first terminal obtains the file block of the first shared file from the second terminal through the established point-to-point connection, and then stores the first shared file on the first terminal through the file block. In the embodiment of the present application, the file content of the shared file is obtained by obtaining at least one file block of the shared file across terminals, thereby realizing incremental transmission, that is, for a shared file that is transmitted multiple times, only the incremental file content corresponding to the shared file can be transmitted in the subsequent transmission process, thereby improving the file transmission efficiency of the shared file in the local area network. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without paying any creative work.
[0020] Figure 1 This is a schematic diagram of the architecture of a local area network file sharing operation provided by an embodiment of the present application;
[0021] Figure 2 It is a schematic diagram of a method for local area network file sharing operation provided by an embodiment of the present application;
[0022] Figure 3 It is a flowchart of another LAN file sharing operation provided by an embodiment of the present application;
[0023] Figure 4 This is a flowchart of another LAN file sharing operation provided by an embodiment of the present application;
[0024] Figure 5 It is a structural diagram of a local area network file sharing operation device provided in an embodiment of the present application;
[0025] Figure 6It is a structural diagram of a terminal provided in an embodiment of the present application. DETAILED DESCRIPTION
[0026] In order to make the purpose, features, and advantages of the embodiments of the present application more obvious and understandable, 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. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of this application.
[0027] In the description of the present application, it should be understood that the terms "first", "second", etc. are only used for descriptive purposes and cannot be understood as indicating or implying relative importance. In the description of the present application, it should be noted that, unless otherwise clearly specified and limited, "including" and "having" and any of their variations are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not limited to the listed steps or units, but optionally also includes steps or units that are not listed, or optionally also includes other steps or units inherent to these processes, methods, products or devices. For those of ordinary skill in the art, the specific meanings of the above terms in the present application can be understood in specific circumstances. In addition, in the description of the present application, unless otherwise specified, "multiple" refers to two or more. "And / or" describes the association relationship of associated objects, indicating that there can be three relationships, for example, A and / or B, which can represent: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the associated objects before and after are an "or" relationship.
[0028] In the related art, the method of sharing files in a local area network based on Samba and NFS is initiated by the user at the receiving end to establish a shared connection. If the sharing end and the receiving end are not in the same NAT gateway, the receiving end cannot directly access the sharing end, and the receiving end cannot establish a shared connection with the sharing end. In other words, the above-mentioned method of sharing files in a local area network requires that the receiving end and the sharing end are in the same NAT gateway. Since the above-mentioned method of sharing files in a local area network does not support the transmission mode based on the many-to-many p2p connection technology, the transmission speed of the shared file depends on the bandwidth resources of the sharing end and the receiving end at the same time, so the transmission rate is not that high. The above-mentioned method of sharing files in a local area network needs to transmit the full file content of the shared file every time the shared file is transmitted. For example, in the process of transmitting a shared file, when the network is interrupted and the first transmission fails, the second transmission can be performed after the terminal reconnects to the network, and the full file content of the shared file can only be transmitted from the beginning during the second transmission, and it is impossible to continue the transmission according to the part of the file content that has not been transmitted during the first transmission. Therefore, the file transmission efficiency of the shared file in the local area network is low.
[0029] The present application is described in detail below with reference to specific embodiments.
[0030] See also Figure 1 , which is a system architecture diagram of a local area network file sharing operating system provided in an embodiment of the present application.
[0031] like Figure 1 As shown, Figure 1 The system may include a first terminal, a cloud server, and a second terminal. The first terminal may transmit data to the second terminal through the cloud server, or the first terminal may transmit data directly to the second terminal without going through the cloud server. The second terminal may transmit data to the first terminal through the cloud server, or the second terminal may transmit data directly to the first terminal without going through the cloud server.
[0032] The first terminal may include but is not limited to a mobile phone, a tablet, and a laptop computer. The second terminal may include but is not limited to a mobile phone, a tablet, and a laptop computer.
[0033] Optionally, data transmission between the first terminal and the second terminal may be achieved through a peer-to-peer (P2P) connection technology.
[0034] In an embodiment of the present application, the first terminal establishes a point-to-point connection between the first terminal and the second terminal through the first distributed management system based on the terminal storage drive address through the cloud server, responds to the file acquisition operation for the first shared file of the second terminal, determines the file acquisition instruction for the file acquisition operation, responds to the file acquisition instruction, uses the point-to-point connection to obtain at least one first file block corresponding to the first shared file from the second distributed management system of the second terminal through the first distributed management system, and stores the first shared file to the first distributed management system based on the at least one first file block. In an embodiment of the present application, on the basis of establishing a point-to-point connection between the first terminal and the second terminal, after determining the file acquisition instruction for the first shared file of the second terminal, the first terminal obtains the file block of the first shared file from the second terminal through the established point-to-point connection, and then stores the first shared file on the first terminal through the file block. In the embodiment of the present application, at least one file block of the shared file is obtained across terminals to obtain the file content of the shared file, thereby realizing incremental transmission, that is, for a shared file that is transmitted multiple times, only the incremental file content corresponding to the shared file can be transmitted in the subsequent transmission process, thereby improving the file transmission efficiency of the shared file in the local area network.
[0035] See also Figure 2 , is a flow chart of a local area network file sharing operation method provided by an embodiment of the present application. Figure 2 As shown, the method of the embodiment of the present application may include the following steps:
[0036] S201, establishing a point-to-point connection between a first terminal and a second terminal via a cloud server based on a terminal storage drive address through a first distributed management system.
[0037] It is easy to understand that the first distributed management system can be a management system deployed in the first terminal for implementing the local area network sharing file function. Specifically, the components in the first distributed management system can include but are not limited to the first file manager, the first storage service, the first storage driver, the first storage space and the first file system.
[0038] Among them, the first file manager can be used to help users manage directories and files in the operating system in a graphical manner. The first storage service can be used to maintain file metadata and implement directory tree management of files. File metadata may include information such as file name, file identifier, file type and file size. The first storage space may refer to a file storage space set based on the InterPlanetary File System (IPFS for short). The first file system can be used to store terminal file metadata and file directory structure data.
[0039] The terminal storage driver address may refer to a connection address used to establish a connection with a storage driver of another terminal. In an embodiment of the present application, the terminal storage driver address may include a first driver connection address of a first storage driver and a second driver connection address of a second storage driver.
[0040] Point-to-point connection refers to p2p network connection technology. The p2p network can be intuitively understood as a "point-to-point" or "end-to-end" network form. It is different from the centralized network model and is an interconnected network connection model. For each peer terminal in the point-to-point connection network, they can share their resources and can also be directly accessed by other peer terminals without going through an intermediate terminal. In a point-to-point connection network, each terminal can be both a resource provider and a resource acquirer. For example, see Figure 1 As shown in the system architecture diagram, if the first terminal and the second terminal establish a point-to-point connection, the first terminal can communicate directly with the second terminal without going through an intermediate server, the first terminal can directly obtain resources from the second terminal, and the second terminal can also directly obtain resources from the first terminal.
[0041] In an embodiment of the present application, the first terminal may generate a point-to-point connection instruction according to the first drive connection address of the first storage drive in the first distributed management system, and the point-to-point connection instruction may include the first drive connection address. Then, the point-to-point connection instruction may be sent to the cloud server through the first storage service in the first distributed management system, and the cloud server may forward the point-to-point connection instruction to the second terminal, and the point-to-point connection instruction may instruct the second terminal to establish a point-to-point connection with the first storage drive according to the first drive connection address.
[0042] S202: In response to a file acquisition operation for a first shared file of a second terminal, acquire a file acquisition instruction for the file acquisition operation.
[0043] The file acquisition operation may be an operation performed on the first terminal to acquire the first shared file of the second terminal. The first shared file may be a file configured with a sharing attribute in the second terminal.
[0044] In an embodiment of the present application, a user may perform a file acquisition operation on a first terminal to acquire a first shared file on a second terminal, and the first terminal may generate a file acquisition instruction for the file acquisition operation in response to the file acquisition operation. The file acquisition instruction may include a file identifier of the first shared file.
[0045] S203: In response to the file acquisition instruction, acquire at least one first file block corresponding to the first shared file from the second distributed management system of the second terminal through the first distributed management system using a point-to-point connection.
[0046] It is easy to understand that the second distributed management system can be a management system deployed in the second terminal for realizing the LAN file sharing function. Specifically, the components in the second distributed management system can include but are not limited to a second file manager, a second storage service, a second storage driver, a second storage space, and a second file system.
[0047] Among them, the second file manager can be used to help users manage directories and files in the operating system in a graphical manner. The second storage service can be used to maintain file metadata and implement directory tree management of files. File metadata may include information such as file name, file identifier, file type, and file size. The second storage space may refer to a file storage space set based on the InterPlanetary File System (IPFS for short). The second file system can be used to store terminal file metadata and directory structure data of files.
[0048] The first file block may refer to a data storage structure used to store a portion of file content in a file.
[0049] In an embodiment of the present application, after determining the file acquisition instruction, the file acquisition instruction can be sent to the first storage service through the first file manager in the first distributed management system, and the first storage service can send the file acquisition instruction to the first storage driver, and the first storage driver obtains at least one file block corresponding to the first shared file from the second distributed management system of the second terminal through the point-to-point connection established with the second terminal as described above. The at least one file block corresponding to the first shared file is stored in the second storage space in the second distributed management system, and the first storage driver can control the second storage driver to read at least one file block of the first shared file from the second storage space through the point-to-point connection.
[0050] S204: Store the first shared file in the first distributed management system based on at least one first file block.
[0051] In the embodiment of the present application, according to the description of S203, the first storage driver obtains at least one first file block from the second terminal, the first storage driver may merge the at least one first file block into a first shared file, and the first storage driver stores the first shared file in the first file system. In addition, the first storage driver may also store the at least one file block in the first storage space, so that when the first shared file is deleted from the first file system, the at least one first file block of the first shared file may also be obtained from the first storage space, so as to merge the at least one first file block to obtain the first shared file.
[0052] In an embodiment of the present application, the first terminal establishes a point-to-point connection between the first terminal and the second terminal through the first distributed management system based on the terminal storage drive address through the cloud server, responds to the file acquisition operation for the first shared file of the second terminal, determines the file acquisition instruction for the file acquisition operation, responds to the file acquisition instruction, uses the point-to-point connection to obtain at least one first file block corresponding to the first shared file from the second distributed management system of the second terminal through the first distributed management system, and stores the first shared file to the first distributed management system based on the at least one first file block. In an embodiment of the present application, on the basis of establishing a point-to-point connection between the first terminal and the second terminal, after determining the file acquisition instruction for the first shared file of the second terminal, the first terminal obtains the file block of the first shared file from the second terminal through the established point-to-point connection, and then stores the first shared file on the first terminal through the file block. In the embodiment of the present application, at least one file block of the shared file of other terminals is obtained across terminals to obtain the file content of the shared file, thereby realizing incremental transmission, that is, for a shared file that is transmitted multiple times, only the incremental file content corresponding to the shared file can be transmitted in the subsequent transmission process, thereby improving the file transmission efficiency of the shared file in the local area network.
[0053] See also Figure 3 , is a flow chart of a local area network file sharing operation method provided by an embodiment of the present application. Figure 3 As shown, the method of the embodiment of the present application may include the following steps:
[0054] S301 : Generate a point-to-point connection instruction based on a first drive connection address for a first storage drive.
[0055] The first driver connection address may refer to a connection address used for the first storage driver to establish a connection with storage drivers of other terminals.
[0056] In an embodiment of the present application, when the first terminal detects an operation input by a user to trigger a LAN file sharing function, the first terminal can obtain a first drive connection address of a first storage drive of the first terminal, and then generate a point-to-point connection instruction according to the first drive connection address.
[0057] S302, sending the point-to-point connection instruction to the second storage service of the second terminal via the cloud server through the first storage service.
[0058] The point-to-point connection instruction may be used to instruct the second terminal to establish a first point-to-point connection with the first storage driver through the first driver connection address based on the second storage driver.
[0059] In an embodiment of the present application, the first storage service of the first terminal may send a point-to-point connection instruction to the cloud server, and the cloud server may send the point-to-point connection instruction to the second storage service of the second terminal. The second storage service may send the point-to-point connection instruction to the second storage driver of the second terminal, and the second storage driver may establish a first point-to-point connection with the first storage driver through the first driver connection address in the point-to-point connection instruction.
[0060] If the second terminal and the first terminal are connected to the same NAT network, the first point-to-point connection between the second storage driver of the second terminal and the first storage driver can be established successfully.
[0061] S303: When the first point-to-point connection fails to be established, a second drive connection address sent by the second terminal through the second storage service via the cloud server is received through the first storage service.
[0062] The second drive connection address may be a drive connection address corresponding to the second storage drive obtained by the second terminal through the second storage service.
[0063] In an embodiment of the present application, if the first terminal and the second terminal are connected to different NAT networks, the operation mode of the second storage service in which the first storage service sends the point-to-point connection instruction to the second terminal via the cloud server cannot establish the first point-to-point connection between the second storage driver and the first storage driver, that is, the first point-to-point connection fails to be established.
[0064] When the first point-to-point connection fails to be established, the first terminal can receive the second drive connection address sent by the cloud server through the first storage service. The second drive connection address can be sent to the cloud server by the second storage service of the second terminal, and the second storage service can obtain the second drive connection address from the second storage drive of the second terminal.
[0065] S304: Establishing a second point-to-point connection with a second storage driver by using the first storage driver connection address.
[0066] In an embodiment of the present application, the first storage service of the first terminal can send the second drive connection address to the first storage driver of the first terminal, and the first storage driver can use the second drive connection to establish a second point-to-point connection with the second storage driver.
[0067] S305, in response to a target list operation on a file directory list of the second terminal, generating a target list instruction corresponding to the target list operation through the first file manager, and controlling the first storage service to send the target list instruction to the second storage service of the second terminal via the cloud server.
[0068] It is easy to understand that the file directory list may refer to a directory list to which files configured with sharing attributes in the second terminal belong.
[0069] The target list operation may be an operation performed by the first terminal to obtain a file directory list of the second terminal.
[0070] The target list instruction may be used to instruct the second storage service of the second terminal to read the file directory list of the second terminal.
[0071] In an embodiment of the present application, a user may perform a target list operation of obtaining a file directory list of a second terminal in a first file manager of a first terminal. In response to the target list operation, the first file manager may generate a directory list instruction for the directory list operation. The first file manager may send the directory list instruction to a first storage service of the first terminal. The first storage service may send the directory list instruction to a cloud server. The cloud server may send the directory list instruction to a second storage service of the second terminal. The second storage service may read the file directory list of the second terminal from a local database of the second terminal.
[0072] S306: Receive, through the first storage service, a file directory list sent by the second storage service of the second terminal via the cloud server.
[0073] In an embodiment of the present application, as described in S306, the second storage service of the second terminal can read the file directory list of the second terminal. The second storage service can send the file directory list to the cloud server. The cloud server can send the file directory list to the first storage service of the first terminal, and the first storage service can receive the file directory list.
[0074] S307: Control the first storage service to store the file directory list in the first file manager, and display the file directory list.
[0075] In an embodiment of the present application, the first storage service may send the file directory list to the first file manager, and the first file manager may store the file directory list and display the file directory list in the first file manager.
[0076] S308, in response to the file acquisition operation for the first shared file in the file directory list of the second terminal, determine the source file identifier and the file operation path of the first shared file through the first file manager, and generate a file acquisition instruction including the source file identifier and the file operation path.
[0077] It is easy to understand that the file acquisition operation may be an operation performed in the file directory list of the second terminal.
[0078] The source file identifier may refer to an identifier used to uniquely identify a shared file. The source file identifier may be composed of at least one of letters and numbers.
[0079] The file operation path may refer to the file path for accessing the first shared file in the file directory list. For example, the file path may be demo\share\shedule, where shedule may represent the name of the folder where the first shared file is located, share may represent the parent folder of the folder shedule, and demo may represent the parent folder of the folder share. The first shared file stored in the shedule folder may be accessed by accessing the share folder in the demo folder and then accessing the shedule folder in the share folder.
[0080] In the embodiment of the present application, since the file directory list is displayed in the first file manager and the file acquisition operation is performed in the file directory list, the source file identifier and the file operation path of the first shared file can be determined by the first file manager. Further, the first file manager can generate a file acquisition instruction containing the source file identifier and the file operation path.
[0081] S309: In response to the file acquisition instruction, send the file acquisition instruction to the first storage service through the first file manager, control the first storage service to update the database based on the file acquisition instruction and send the file acquisition instruction to the first storage driver.
[0082] In an embodiment of the present application, the first file manager may send a file acquisition instruction to the first storage service. The first terminal may control the first storage service to send the file acquisition instruction to the first storage driver. At the same time, the first terminal may also control the first storage service to update the database according to the file acquisition instruction. Specifically, the first storage service may establish directory structure data corresponding to the file operation path in the database according to the file operation path included in the file acquisition instruction.
[0083] S310, controlling the first storage driver to obtain a source file identifier in response to a file acquisition instruction, and obtaining at least one first file block corresponding to the source file identifier from a second storage space through a second point-to-point connection and a second storage driver based on a second terminal.
[0084] In an embodiment of the present application, the first terminal can control the first storage driver to read the source file identifier and the file operation path contained in the file acquisition instruction. Since the first storage driver of the first terminal establishes a second point-to-point connection with the second storage driver of the second terminal, the first storage driver can send a file download instruction for the source file identifier to the second storage driver through the point-to-point connection, and after the second storage driver receives the file download instruction, the second storage driver reads at least one first file block corresponding to the source file identifier from the second storage space of the second terminal.
[0085] The second storage driver reads at least one first file block corresponding to the source file identifier from the second storage space of the second terminal. In this operation, the second storage space can store multiple source file identifiers and at least one file block identifier corresponding to each source file identifier. The second storage driver can query at least one target file block identifier corresponding to the source file identifier from the second storage space, and the second storage driver can download the first file block corresponding to the at least one target file block identifier from the second storage space.
[0086] S311: Merge data of at least one first file block through a first storage driver to obtain file data of a first shared file.
[0087] In the embodiment of the present application, the first storage driver may merge the data stored in all the first file blocks into a temporary file, and the data stored in the temporary file is the file data of the first shared file.
[0088] S312: Write the file data into the first file storage system through the first storage driver, and store at least one file block in the first storage space through the first storage driver.
[0089] In an embodiment of the present application, the first terminal can write file data into the first file storage system through the first storage driver, so that the user can operate the first shared file in the first file storage system. The first terminal can store at least one file block in the first storage space through the first storage driver, so that when the first shared file is deleted in the first file system, at least one first file block of the first shared file can be obtained from the first storage space, so as to merge the first shared file according to the at least one first file block.
[0090] It should be noted that the definitions of the first storage driver, the first storage service, the second storage service, the second storage driver, the first file manager, the second storage space, and the first storage space in the embodiments of the present application can be specifically referred to in Figure 2 The description in the illustrated embodiment will not be repeated here.
[0091] In an embodiment of the present application, the first terminal can obtain a file directory list of the second terminal through a cloud server, and the file directory list can be displayed in a first file manager of the first terminal, and the displayed file directory list can be conveniently used to access the shared files of the second terminal. On the basis of establishing a point-to-point connection between the first terminal and the second terminal, the first terminal can obtain at least one file block corresponding to the shared file of the second terminal through the point-to-point connection, so incremental transmission can be supported; in the event of a transmission interruption and the need to restart the transmission, there is no need to repeatedly download the file blocks that have been transmitted, so breakpoint resumption can be supported. In addition, in the process of establishing a point-to-point connection between the first terminal and the second terminal, it can support either the first terminal or the second terminal to actively initiate an instruction to establish a connection, so NAT penetration is supported, that is, two terminals in different NAT networks can establish a direct connection.
[0092] See also Figure 4 , is a flow chart of a local area network file sharing operation provided by an embodiment of the present application. Figure 4 As shown, the method of the embodiment of the present application may include the following steps:
[0093] S401, establishing a point-to-point connection with a second terminal through a first distributed management system via a cloud server based on a terminal storage drive address.
[0094] S402: In response to a file acquisition operation for a first shared file of a second terminal, acquire a file acquisition instruction for the file acquisition operation.
[0095] S403, in response to the file acquisition instruction, acquiring at least one first file block corresponding to the first shared file from the second distributed management system of the second terminal through the first distributed management system using a point-to-point connection
[0096] S404: Store the first shared file in the first distributed management system based on at least one first file block.
[0097] Specifically, S401-S404 can be found in Figure 2 The description of S201-S204 will not be repeated here.
[0098] S405: In response to a file sending operation on a second shared file of the first terminal, obtaining a file sending instruction for the file sending operation.
[0099] It is easy to understand that the file sending operation may be an operation performed on the first terminal to send the second shared file of the first terminal to the second terminal. The second shared file may be a file configured with a sharing attribute in the first terminal.
[0100] Specifically, the file sending operation may be a file sending operation executed in a first file manager of the first terminal. The first file manager may generate a file sending instruction for the file sending operation.
[0101] Optionally, the file sending operation can be an operation performed in the target list of the first file management. The first file manager can determine the source file identifier and the file operation path of the second shared file, and the first file manager can generate a file sending instruction containing the source file identifier and the file operation path. The source file identifier refers to an identifier used to identify a shared file with uniqueness. The source file identifier can be composed of at least one of letters and numbers. The file operation path refers to the file path for accessing the second shared file in the file directory list. For example, the file path can be demo\share\word, where word can represent the name of the folder where the second shared file is located, share can represent the parent folder of the folder word, and demo can represent the parent folder of the folder share. The second shared file stored in the word folder can be accessed by accessing the share folder in the demo folder and then accessing the word folder in the share folder.
[0102] S406, sending the file sending instruction to the second distributed management system via the first distributed management system via the cloud server.
[0103] It is easy to understand that the file sending instruction can be used by the second distributed management system of the second terminal to obtain at least one second file block corresponding to the second shared file from the first distributed management system, and the at least one second file block is used by the second terminal to store the second shared file to the second distributed management system.
[0104] Specifically, the first terminal may control the first file management to send a file sending instruction to the first storage service of the first terminal. The first terminal may control the first storage service to send the file sending instruction to the cloud server. The cloud server may forward the file sending instruction to the second storage service of the second terminal. The second storage service of the second terminal may send the file sending instruction to the second storage driver of the second terminal. The second storage driver may read the source file identifier contained in the file sending instruction. The second storage driver may send a file download instruction for the source file identifier to the first storage driver of the first terminal. The first storage driver may read at least one second file block corresponding to the source file identifier from the first storage space of the first terminal according to the file download instruction. The first storage driver may send at least one second file block to the second storage driver. The second storage driver may merge data of at least one second file block to obtain file data of the second shared file, and store the file data of the second shared file in the second file system of the second terminal, so that the user can operate the second shared file in the second file system. At the same time, the second storage driver may send at least one second file block to the second storage space of the second terminal, so that when the second shared file is deleted in the second file system, at least one second file block of the second shared file can also be obtained from the second storage space, so as to merge the second shared file according to at least one second file block.
[0105] It should be noted that the definitions of the first storage driver, the first storage service, the second storage service, the second storage driver, the first file manager, the second storage space, and the first storage space in the embodiments of the present application can be specifically referred to in Figure 2 The description in the illustrated embodiment will not be repeated here.
[0106] In an embodiment of the present application, on the basis of establishing a point-to-point connection between the first terminal and the second terminal, after determining the file sending instruction for the second shared file of the first terminal, the first terminal can send the file sending instruction to the second terminal, and the second terminal can obtain the file block of the second shared file from the first terminal through the established point-to-point connection, and then store the second shared file on the second terminal through the file block. The embodiment of the present application sends at least one file block of a shared file across terminals so that other terminals can obtain the file content of the shared file of this terminal, thereby realizing incremental transmission, that is, for a shared file that is transmitted multiple times, only the incremental file content corresponding to the shared file can be transmitted in the subsequent transmission process, thereby improving the file transmission efficiency of the shared file in the local area network.
[0107] See also Figure 5, is a schematic diagram of the structure of a local area network file sharing operation device provided in an embodiment of the present application. The local area network file sharing operation device 500 can be implemented as all or part of a terminal through software, hardware, or a combination of both. The device 500 includes:
[0108] A connection establishment module 510 is used to establish a point-to-point connection between the first terminal and the second terminal through a cloud server based on a terminal storage drive address through a first distributed management system;
[0109] An instruction determining module 520 is configured to obtain a file acquisition instruction for a file acquisition operation on a first shared file of the second terminal in response to the file acquisition operation on the second terminal;
[0110] A data acquisition module 530, configured to, in response to the file acquisition instruction, acquire at least one first file block corresponding to the first shared file from the second distributed management system of the second terminal through the first distributed management system using the point-to-point connection;
[0111] The data storage module 540 is configured to store the first shared file in the first distributed management system based on the at least one first file block.
[0112] Optionally, the connection establishment module 510 includes:
[0113] A first connection unit, configured to generate a point-to-point connection instruction based on a first drive connection address for a first storage drive;
[0114] The second connection unit is used to send the point-to-point connection instruction to the second storage service of the second terminal via the cloud server through the first storage service, and the point-to-point connection instruction is used to instruct the second terminal to establish a first point-to-point connection with the first storage driver through the first driver connection address based on the second storage driver.
[0115] Optionally, the connection establishment module 510 further includes:
[0116] a third connection unit, configured to receive, through the first storage service, a second drive connection address sent by the second terminal through the second storage service via the cloud server when the first point-to-point connection fails to be established, wherein the second drive connection address is a drive connection address corresponding to the second storage drive obtained by the second terminal through the second storage service;
[0117] A fourth connection unit is configured to establish a second point-to-point connection with the second storage driver through the first storage driver using the second driver connection address.
[0118] Optionally, the instruction determination module 520 includes:
[0119] A first determining unit is configured to obtain a file directory list in the second distributed management system of the second terminal through the first distributed management system via the cloud server, and display the file directory list;
[0120] The second determining unit is configured to respond to a file acquisition operation for the first shared file in the file directory list of the second terminal.
[0121] Optionally, the first determining unit includes:
[0122] A first subunit is configured to, in response to a target list operation on a file directory list of the second terminal, determine a target list instruction corresponding to the target list operation;
[0123] A second subunit is configured to obtain the file directory list from the second distributed management system of the second terminal through the first distributed management system via the cloud server based on the target list instruction;
[0124] The third subunit is used to receive the file directory list sent by the second distributed management system of the second terminal through the first distributed management system.
[0125] Optionally, the first subunit and the second subunit are specifically used for:
[0126] Generate a target list instruction corresponding to the target list operation by the first file manager, control the first storage service to send the target list instruction to the second storage service of the second terminal via the cloud server, and the target list instruction is used to instruct the second storage service to read the file directory list;
[0127] The third subunit is specifically used for:
[0128] Receiving, through the first storage service, the file directory list sent by the second storage service of the second terminal via the cloud server;
[0129] Control the first storage service to store the file directory list in the first file manager.
[0130] Optionally, the data acquisition module 530 includes:
[0131] A first acquisition unit, configured to send a file acquisition instruction to a first storage service through a first file manager, control the first storage service to update a database based on the file acquisition instruction, and send the file acquisition instruction to a first storage driver;
[0132] The second acquisition unit is used to control the first storage driver to respond to the file acquisition instruction and acquire at least one first file block corresponding to the first shared file from the second storage space through the point-to-point connection based on the second terminal's second storage driver.
[0133] Optionally, the instruction determination module 520 is specifically configured to:
[0134] Determine, by a first file manager, a source file identifier and a file operation path of the first shared file, and generate a file acquisition instruction including the source file identifier and the file operation path;
[0135] Controlling the first storage driver to obtain the source file identifier in response to the file acquisition instruction;
[0136] A second storage driver based on the second terminal obtains at least one first file block corresponding to the source file identifier from a second storage space through the point-to-point connection.
[0137] Optionally, the data storage module 540 is specifically used for:
[0138] Merging data of the at least one first file block by the first storage driver to obtain file data of the first shared file;
[0139] The file data is written into a first file storage system through the first storage driver, and the at least one file block is stored in a first storage space through the first storage driver.
[0140] Optionally, the device further comprises:
[0141] A first sending module, configured to, in response to a file sending operation on a second shared file of the first terminal, obtain a file sending instruction for the file sending operation;
[0142] A second sending module is used to send the file sending instruction to the second distributed management system via the cloud server through the first distributed management system, and the file sending instruction is used by the second distributed management system to obtain at least one second file block corresponding to the second shared file from the first distributed management system, and the at least one second file block is used by the second terminal to store the second shared file in the second distributed management system.
[0143] Optionally, the first distributed management system includes a first file manager, a first storage service, a first storage driver, a first storage space and a first file storage system; the second distributed management system includes a second file manager, a second storage service, a second storage driver, a second storage space and a second file storage system.
[0144] Please refer to Figure 6 , Figure 6 A schematic diagram of the structure of a terminal provided in an embodiment of the present application. Figure 6 As shown, the terminal 600 may include: at least one processor 601 , at least one network interface 604 , a user interface 603 , a memory 605 , a display screen component 606 , and at least one communication bus 602 .
[0145] The communication bus 602 is used to realize the connection and communication between these components.
[0146] The user interface 603 may include a display screen (Display) and a camera (Camera), and the optional user interface 603 may also include a standard wired interface and a wireless interface.
[0147] The network interface 604 may optionally include a standard wired interface or a wireless interface (such as a WI-FI interface).
[0148] Among them, the processor 601 may include one or more processing cores. The processor 601 uses various interfaces and lines to connect various parts in the entire terminal 600, and executes various functions and processes data of the terminal 600 by running or executing instructions, programs, code sets or instruction sets stored in the memory 605, and calling data stored in the memory 605. Optionally, the processor 601 can be implemented in at least one hardware form of digital signal processing (Digital Signal Processing, DSP), field programmable gate array (Field-Programmable Gate Array, FPGA), and programmable logic array (Programmable Logic Array, PLA). The processor 601 can integrate one or a combination of a central processing unit (Central Processing Unit, CPU), a graphics processing unit (Graphics Processing Unit, GPU) and a modem. Among them, the CPU mainly processes the operating system, user interface and application programs; the GPU is responsible for rendering and drawing the content to be displayed on the display screen; the modem is used to process wireless communications. It can be understood that the above-mentioned modem may not be integrated into the processor 601, and it can be implemented separately through a chip.
[0149] Among them, the memory 605 may include a random access memory (Random Access Memory, RAM) and may also include a read-only memory (Read-Only Memory). Optionally, the memory 605 includes a non-transitory computer-readable storage medium. The memory 605 can be used to store instructions, programs, codes, code sets or instruction sets. The memory 605 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for at least one function (such as a touch function, a sound playback function, an image playback function, etc.), instructions for implementing the above-mentioned method embodiments, etc.; the data storage area may store data involved in the above-mentioned method embodiments, etc. The memory 605 may optionally be at least one storage device located away from the aforementioned processor 601. As Figure 6 As shown, the memory 605 as a computer storage medium may include an operating system, a network communication module, a user interface module, and a program of a LAN file sharing operation method.
[0150] exist Figure 6 In the terminal 600 shown, the user interface 603 is mainly used to provide an input interface for the user and obtain the data input by the user; and the processor 601 can be used to call the program of the local area network file sharing operation method stored in the memory 605, and specifically perform the following operations:
[0151] Establishing a point-to-point connection between the first terminal and the second terminal through a first distributed management system via a cloud server based on a terminal storage drive address;
[0152] In response to a file acquisition operation for a first shared file of the second terminal, acquiring a file acquisition instruction for the file acquisition operation;
[0153] In response to the file acquisition instruction, acquiring at least one first file block corresponding to the first shared file from the second distributed management system of the second terminal through the first distributed management system using the point-to-point connection;
[0154] The first shared file is stored in the first distributed management system based on the at least one first file block.
[0155] In one embodiment, when the processor 601 executes the step of establishing a point-to-point connection between the first terminal and the second terminal through the cloud server based on the terminal storage drive address through the first distributed management system, the processor 601 specifically performs the following operations:
[0156] generating a point-to-point connection instruction based on a first drive connection address for the first storage drive;
[0157] The point-to-point connection instruction is sent by the first storage service to the second storage service of the second terminal via the cloud server, and the point-to-point connection instruction is used to instruct the second terminal to establish a first point-to-point connection with the first storage driver through the first driver connection address based on the second storage driver.
[0158] In one embodiment, the processor 601 further performs the following operations:
[0159] When the first point-to-point connection fails to be established, receiving, through the first storage service, a second drive connection address sent by the second terminal through the second storage service via the cloud server, where the second drive connection address is a drive connection address corresponding to the second storage drive obtained by the second terminal through the second storage service;
[0160] A second point-to-point connection with the second storage driver is established through the first storage driver using the second driver connection address.
[0161] In one embodiment, when executing the file acquisition operation in response to the first shared file for the second terminal, the processor 601 specifically performs the following operations:
[0162] Obtaining, through the first distributed management system via the cloud server, a list of file directories in the second distributed management system of the second terminal, and displaying the list of file directories;
[0163] In response to a file acquisition operation for a first shared file in the file directory list of the second terminal.
[0164] In one embodiment, when the processor 601 executes the step of obtaining the file directory list in the second distributed management system of the second terminal via the cloud server through the first distributed management system, the processor 601 specifically performs the following operations:
[0165] In response to a target list operation on a file directory list of the second terminal, determining a target list instruction corresponding to the target list operation;
[0166] Based on the target list instruction, the first distributed management system obtains the file directory list from the second distributed management system of the second terminal via the cloud server;
[0167] The file directory list sent by the second distributed management system of the second terminal is received through the first distributed management system.
[0168] In one embodiment, when the processor 601 executes the target list instruction corresponding to the target list operation, and obtains the file directory list from the second distributed management system of the second terminal through the first distributed management system via the cloud server based on the target list instruction, the processor 601 specifically performs the following operations:
[0169] Generate a target list instruction corresponding to the target list operation by the first file manager, control the first storage service to send the target list instruction to the second storage service of the second terminal via the cloud server, and the target list instruction is used to instruct the second storage service to read the file directory list;
[0170] When the processor 601 executes the step of receiving, through the first distributed management system, the file directory list sent by the second distributed management system of the second terminal, the following specific operations are performed:
[0171] Receiving, through the first storage service, the file directory list sent by the second storage service of the second terminal via the cloud server;
[0172] Control the first storage service to store the file directory list in the first file manager.
[0173] In one embodiment, when the processor 601 executes the step of acquiring at least one first file block corresponding to the first shared file from the second distributed management system of the second terminal through the first distributed management system using the point-to-point connection, the processor 601 specifically performs the following operations:
[0174] Sending a file acquisition instruction to the first storage service through the first file manager, controlling the first storage service to update a database based on the file acquisition instruction and sending the file acquisition instruction to the first storage driver;
[0175] The first storage driver is controlled to respond to the file acquisition instruction, and a second storage driver based on the second terminal obtains at least one first file block corresponding to the first shared file from the second storage space through the point-to-point connection.
[0176] In one embodiment, when the processor 601 executes the file acquisition instruction for determining the file acquisition operation, the processor 601 specifically performs the following operations:
[0177] Determine, by a first file manager, a source file identifier and a file operation path of the first shared file, and generate a file acquisition instruction including the source file identifier and the file operation path;
[0178] When the processor 601 executes the control of the first storage driver in response to the file acquisition instruction, obtaining at least one first file block corresponding to the first shared file from the second storage space through the point-to-point connection based on the second terminal of the second storage driver, the following specific operations are performed:
[0179] Controlling the first storage driver to obtain the source file identifier in response to the file acquisition instruction;
[0180] A second storage driver based on the second terminal obtains at least one first file block corresponding to the source file identifier from a second storage space through the point-to-point connection.
[0181] In one embodiment, when the processor 601 executes the step of storing the first shared file in the first distributed management system based on the at least one first file block, the processor 601 specifically performs the following operations:
[0182] Merging data of the at least one first file block by the first storage driver to obtain file data of the first shared file;
[0183] The file data is written into a first file storage system through the first storage driver, and the at least one file block is stored in a first storage space through the first storage driver.
[0184] In one embodiment, the processor 601 further performs the following operations:
[0185] In response to a file sending operation for a second shared file of the first terminal, obtaining a file sending instruction for the file sending operation;
[0186] The file sending instruction is sent to the second distributed management system via the cloud server through the first distributed management system. The file sending instruction is used by the second distributed management system to obtain at least one second file block corresponding to the second shared file from the first distributed management system. The at least one second file block is used by the second terminal to store the second shared file in the second distributed management system.
[0187] In one embodiment, the first distributed management system includes a first file manager, a first storage service, a first storage driver, a first storage space and a first file storage system; the second distributed management system includes a second file manager, a second storage service, a second storage driver, a second storage space and a second file storage system.
[0188] In addition, those skilled in the art will appreciate that the structure of the terminal 600 shown in the above figures does not limit the terminal 600, and the user terminal may include more or fewer components than shown, or combine certain components, or arrange the components differently. For example, the terminal 600 also includes components such as a radio frequency circuit, an audio circuit, a WiFi component, a power supply, and a Bluetooth component, which will not be described in detail here.
[0189] An embodiment of the present application also provides a computer-readable storage medium, which stores at least one instruction, and the at least one instruction is used to be executed by a processor to implement the local area network file sharing operation method as described in the above embodiments.
[0190] An embodiment of the present application further provides a computer program product, which stores at least one instruction, and the at least one instruction is loaded and executed by the processor to implement the local area network file sharing operation method described in the above embodiments.
[0191] Those skilled in the art should be aware that in one or more of the above examples, the functions described in the embodiments of the present application can be implemented with hardware, software, firmware, or any combination thereof. When implemented using software, these functions can be stored in a computer-readable medium or transmitted as one or more instructions or codes on a computer-readable medium. Computer-readable media include computer storage media and communication media, wherein the communication media include any media that facilitates the transmission of a computer program from one place to another. The storage medium can be any available medium that a general or special-purpose computer can access.
[0192] The above description is only an optional embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application shall be included in the protection scope of the present application.
Claims
1. A local area network file sharing operation method, applied to a first terminal, characterized in that: The method comprises: Establishing a point-to-point connection between the first terminal and the second terminal through a first distributed management system via a cloud server based on a terminal storage drive address; In response to a file acquisition operation for a first shared file of the second terminal, acquiring a file acquisition instruction for the file acquisition operation; In response to the file acquisition instruction, acquiring at least one first file block corresponding to the first shared file from the second distributed management system of the second terminal through the first distributed management system using the point-to-point connection; The first shared file is stored in the first distributed management system based on the at least one first file block.
2. The method according to claim 1, characterized in that The step of establishing a point-to-point connection between the first terminal and the second terminal through a cloud server based on a terminal storage drive address through the first distributed management system includes: generating a point-to-point connection instruction based on a first drive connection address for the first storage drive; The point-to-point connection instruction is sent by the first storage service to the second storage service of the second terminal via the cloud server, and the point-to-point connection instruction is used to instruct the second terminal to establish a first point-to-point connection with the first storage driver through the first driver connection address based on the second storage driver.
3. The method according to claim 2, characterized in that The method further comprises: When the first point-to-point connection fails to be established, receiving, through the first storage service, a second drive connection address sent by the second terminal through the second storage service via the cloud server, where the second drive connection address is a drive connection address corresponding to the second storage drive obtained by the second terminal through the second storage service; A second point-to-point connection with the second storage driver is established through the first storage driver using the second driver connection address.
4. The method according to claim 1, characterized in that: The file acquisition operation in response to the first shared file of the second terminal includes: Obtaining, through the first distributed management system via the cloud server, a list of file directories in the second distributed management system of the second terminal, and displaying the list of file directories; In response to a file acquisition operation for a first shared file in the file directory list of the second terminal.
5. The method according to claim 4, characterized in that The obtaining, through the first distributed management system via the cloud server, a file directory list in the second distributed management system of the second terminal includes: In response to a target list operation on a file directory list of the second terminal, determining a target list instruction corresponding to the target list operation; Based on the target list instruction, the first distributed management system obtains the file directory list from the second distributed management system of the second terminal via the cloud server; The file directory list sent by the second distributed management system of the second terminal is received through the first distributed management system.
6. The method according to claim 5, characterized in that The determining a target list instruction corresponding to the target list operation, and obtaining the file directory list from a second distributed management system of the second terminal through the first distributed management system via the cloud server based on the target list instruction, comprises: Generate a target list instruction corresponding to the target list operation by the first file manager, control the first storage service to send the target list instruction to the second storage service of the second terminal via the cloud server, and the target list instruction is used to instruct the second storage service to read the file directory list; The step of receiving, through the first distributed management system, the file directory list sent by the second distributed management system of the second terminal comprises: Receiving, through the first storage service, the file directory list sent by the second storage service of the second terminal via the cloud server; Control the first storage service to store the file directory list in the first file manager.
7. The method according to claim 1, characterized in that The step of acquiring at least one first file block corresponding to the first shared file from the second distributed management system of the second terminal through the first distributed management system by using the point-to-point connection includes: Sending a file acquisition instruction to the first storage service through the first file manager, controlling the first storage service to update a database based on the file acquisition instruction and sending the file acquisition instruction to the first storage driver; The first storage driver is controlled to respond to the file acquisition instruction, and a second storage driver based on the second terminal obtains at least one first file block corresponding to the first shared file from the second storage space through the point-to-point connection.
8. The method according to claim 7, characterized in that The obtaining of a file obtaining instruction for the file obtaining operation includes: Determine, by a first file manager, a source file identifier and a file operation path of the first shared file, and generate a file acquisition instruction including the source file identifier and the file operation path; The controlling the first storage driver to respond to the file acquisition instruction to acquire at least one first file block corresponding to the first shared file from the second storage space through a point-to-point connection based on a second storage driver of a second terminal includes: Controlling the first storage driver to obtain the source file identifier in response to the file acquisition instruction; A second storage driver based on the second terminal obtains at least one first file block corresponding to the source file identifier from a second storage space through the point-to-point connection.
9. The method according to claim 7, characterized in that: The storing the first shared file to the first distributed management system based on the at least one first file block includes: Merging data of the at least one first file block by the first storage driver to obtain file data of the first shared file; The file data is written into a first file storage system through the first storage driver, and the at least one file block is stored in a first storage space through the first storage driver.
10. The method according to claim 1, characterized in that The method further comprises: In response to a file sending operation for a second shared file of the first terminal, obtaining a file sending instruction for the file sending operation; The file sending instruction is sent to the second distributed management system via the cloud server through the first distributed management system. The file sending instruction is used by the second distributed management system to obtain at least one second file block corresponding to the second shared file from the first distributed management system. The at least one second file block is used by the second terminal to store the second shared file in the second distributed management system.
11. The method according to any one of claims 1 to 10, characterized in that: The first distributed management system includes a first file manager, a first storage service, a first storage driver, a first storage space and a first file storage system; The second distributed management system includes a second file manager, a second storage service, a second storage driver, a second storage space and a second file storage system.
12. A local area network file sharing operation device, applied to a first terminal, characterized in that: The device comprises: A connection establishment module, used to establish a point-to-point connection between the first terminal and the second terminal through a cloud server based on a terminal storage drive address through a first distributed management system; an instruction determination module, configured to, in response to a file acquisition operation for a first shared file of the second terminal, acquire a file acquisition instruction for the file acquisition operation; a data acquisition module, configured to, in response to the file acquisition instruction, acquire at least one first file block corresponding to the first shared file from the second distributed management system of the second terminal through the first distributed management system using the point-to-point connection; A data storage module is used to store the first shared file in the first distributed management system based on the at least one first file block.
13. A computer storage medium, characterized in that: The computer storage medium stores a plurality of instructions, and the instructions are suitable for being loaded by a processor and executing the method steps according to any one of claims 1 to 11.
14. A terminal, characterized in that: include: A processor and a memory; wherein the memory stores a computer program, and the computer program is suitable for being loaded by the processor and executing the method steps as claimed in any one of claims 1 to 11.