CN115150392B - Remote file copying method, system, computing equipment and storage medium - Google Patents

Remote file copying method, system, computing equipment and storage medium Download PDF

Info

Publication number
CN115150392B
CN115150392B CN202211050854.1A CN202211050854A CN115150392B CN 115150392 B CN115150392 B CN 115150392B CN 202211050854 A CN202211050854 A CN 202211050854A CN 115150392 B CN115150392 B CN 115150392B
Authority
CN
China
Prior art keywords
file
server
client
remote
resource
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202211050854.1A
Other languages
Chinese (zh)
Other versions
CN115150392A (en
Inventor
刘成昊
吕果
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Uniontech Software Technology Co Ltd
Original Assignee
Uniontech Software Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Uniontech Software Technology Co Ltd filed Critical Uniontech Software Technology Co Ltd
Priority to CN202211050854.1A priority Critical patent/CN115150392B/en
Publication of CN115150392A publication Critical patent/CN115150392A/en
Application granted granted Critical
Publication of CN115150392B publication Critical patent/CN115150392B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/06Protocols specially adapted for file transfer, e.g. file transfer protocol [FTP]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/18File system types
    • G06F16/182Distributed file systems
    • G06F16/184Distributed file systems implemented as replicated file system
    • G06F16/1844Management specifically adapted to replicated file systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/543User-generated data transfer, e.g. clipboards, dynamic data exchange [DDE], object linking and embedding [OLE]
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/54Interprogram communication
    • G06F9/547Remote procedure calls [RPC]; Web services
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/02Protocols based on web technology, e.g. hypertext transfer protocol [HTTP]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/1095Replication or mirroring of data, e.g. scheduling or transport for data synchronisation between network nodes
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/14Session management
    • H04L67/146Markers for unambiguous identification of a particular session, e.g. session cookie or URL-encoding
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2209/00Indexing scheme relating to G06F9/00
    • G06F2209/54Indexing scheme relating to G06F9/54
    • G06F2209/544Remote

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention discloses a remote file copying method, a system, a computing device and a storage medium, relating to the technical field of computers and operating systems, wherein the method is executed at a server, the server is in communication connection with a client, and the method comprises the following steps: receiving a resource access request sent by a client; accessing resources based on the resource access request, generating a resource page, and returning the resource page to the client, wherein the resource page comprises one or more original file paths; and responding to a file copying operation sent by the client based on the original file path of the resource page, converting the original file path into a relative file path and returning the relative file path to the client so that the client converts the relative file path into a target file path and acquires a corresponding target file from the server based on the target file path. According to the technical scheme of the invention, the remote file copying and cutting can be realized between two devices of different operating systems.

Description

Remote file copying method, system, computing equipment and storage medium
Technical Field
The present invention relates to the technical field of computers and operating systems, and in particular, to a remote file replication method, a remote file replication system, a computing device, and a storage medium.
Background
Remote desktop software is the mainstream means for accessing resources across devices, and file copy and cut are the most basic interactive operations in a desktop environment. However, currently, the mainstream remote desktop software has some problems in data interaction between devices, which are specifically shown as follows: the mainstream remote desktop software only supports the copy and paste operation of plain text or images and does not support other file types; part of remote desktop software supporting file copying can only provide file sending operation and cannot enable a user to feel interactive operation of copying and cutting; in the process of copying files, some remote desktop software blocks the whole remote system in the copying process, or has no queuing mechanism, cannot additionally copy a plurality of files, and cannot realize cross-system copying and cutting.
In the prior art, in a device with both sides based on a Windows operating system, mstsc can be used to realize remote file copy. Specifically, by opening a remote desktop connection function in the computing device, then tick the clipboard at the local resource, and setting "remote desktop" to allow through in the firewall. Furthermore, by running the mstsc program in the operating system, inputting the corresponding information of the target device, the remote connection can be established with the target device, and after the connection is successful, the copy and cut functions of the operating systems of the two sides can be used, and the functions are mainly realized by depending on the rdpclip. The remote file copying scheme can only be applied to equipment of which both sides are based on a Windows operating system, and can not realize the cross-system remote file copying and cutting.
For this reason, a remote file copying method is required to solve the problems in the above-described scheme.
Disclosure of Invention
To this end, the present invention provides a remote file copying method to solve or at least alleviate the above existing problems.
According to one aspect of the present invention, there is provided a remote file replication method, executed at a server, the server being in communication connection with a client, the method including: receiving a resource access request sent by a client; accessing resources based on the resource access request, generating a resource page, and returning the resource page to the client, wherein the resource page comprises one or more original file paths; and responding to a file copying operation sent by the client based on the original file path of the resource page, converting the original file path into a relative file path and returning the relative file path to the client, so that the client converts the relative file path into a target file path and acquires a corresponding target file from the server based on the target file path.
Optionally, in the remote file replication method according to the present invention, the resource access request is a directory access request; accessing a resource based on the resource access request and generating a resource page, including: and accessing a target directory based on the resource access request, acquiring original file paths of all files in the target directory and generating a resource page.
Optionally, in the remote file copying method according to the present invention, the server runs a first operating system, where the first operating system includes a remote file server and a remote file system, and the remote file server includes a virtual file system; the client runs a second operating system which comprises a user space file system; converting the original file path into a relative file path and returning the relative file path to the client, so that the client converts the relative file path into a target file path, and the method comprises the following steps: converting the original file path to a relative file path in the remote file server; and informing the client to mount the virtual file system in the remote file server through the user space file system so that the client converts the relative file path into a target file path corresponding to the user space file system.
Optionally, in the remote file copying method according to the present invention, further comprising: and the remote file server receives a target file acquisition request sent by the client based on the target file path, acquires a target file from the remote file system, and returns the target file to the client.
Optionally, in the remote file copying method according to the present invention, further comprising: monitoring a system shear plate of the client; and when detecting that the original file path is newly added to the system clipboard, responding to the file copying operation sent by the client, and starting the remote file server.
Optionally, in the remote file copying method according to the present invention, a first daemon process runs in a first operating system of the server, a second daemon process runs in a second operating system of the client, and the first daemon process is adapted to establish a communication connection with the second daemon process; the first daemon process is further adapted to listen to a system clipboard of the client.
Optionally, in the remote file copying method according to the present invention, the resource access request is a file access request; the method further comprises the following steps: and acquiring a target file based on the resource access request, and returning the target file to the client.
According to one aspect of the present invention, there is provided a remote file replication method, executed at a client, the client being communicatively connected to a server, the method including: sending a resource access request to a server, so that the server accesses resources based on the resource access request and generates a resource page; receiving a resource page returned by a server, wherein the resource page comprises one or more original file paths; sending a file copying operation to a server based on an original file path of the resource page, and receiving a relative file path obtained by converting the original file path and returned by the server; and converting the relative file path into a target file path, and acquiring a corresponding target file from a server based on the target file path.
According to an aspect of the present invention, there is provided a remote file replication system including: a client running a second operating system and adapted to perform the method as described above; the server side is in communication connection with the client side, runs the first operating system and is suitable for executing the method.
According to an aspect of the invention, there is provided a computing device comprising: at least one processor; a memory storing program instructions, wherein the program instructions are configured to be executed by the at least one processor, the program instructions comprising instructions for performing the remote file copy method as described above.
According to an aspect of the present invention, there is provided a readable storage medium storing program instructions that, when read and executed by a computing device, cause the computing device to perform a remote file copy method as described above.
According to the technical scheme of the invention, the remote file copying method is provided, and remote file copying and cutting can be realized between a server side and a client side which are connected in remote communication. The server and the client run different operating systems, when the server receives a resource access request sent by the client, the server accesses resources based on the resource access request, generates a resource page and returns the resource page to the client. Subsequently, a client user can perform file copy operations (including copy and cut operations) based on an original file path of a resource page, the server responds to the file copy operations of the client, converts the original file path into a relative file path and returns the relative file path to the client, and notifies the client to mount a remote file server of the server, and finally, the client can convert the relative file path into a target file path and acquire a corresponding target file from a remote file system of the server based on the target file path. Thus, according to the technical scheme of the invention, the remote file copying and cutting can be realized between two devices of different operating systems. Moreover, the invention supports large file copy, and the operation of the operating system is not blocked by adding the copied file.
The foregoing description is only an overview of the technical solutions of the present invention, and the embodiments of the present invention are described below in order to make the technical means of the present invention more clearly understood and to make the above and other objects, features, and advantages of the present invention more clearly understandable.
Drawings
To the accomplishment of the foregoing and related ends, certain illustrative aspects are described herein in connection with the following description and the annexed drawings, which are indicative of various ways in which the principles disclosed herein may be practiced, and all aspects and equivalents thereof are intended to be within the scope of the claimed subject matter. The above and other objects, features and advantages of the present disclosure will become more apparent from the following detailed description read in conjunction with the accompanying drawings. Throughout this disclosure, like reference numerals generally refer to like parts or elements.
FIG. 1 illustrates a schematic diagram of a remote file replication system 100, in accordance with one embodiment of the present invention;
FIG. 2 shows a schematic diagram of a computing device 200, according to one embodiment of the invention;
FIG. 3 illustrates a flow diagram of a remote file replication method 300 according to one embodiment of the invention;
FIG. 4 illustrates a logical view of a server-side provided HTTP service according to one embodiment of the present invention;
FIG. 5 illustrates a timing diagram for remotely copying a file according to one embodiment of the invention;
FIG. 6 illustrates a logical view of mounting a remote file server based on a user space file system according to one embodiment of the present invention;
FIG. 7 shows a flow diagram of a remote file copy method 700 according to one embodiment of the invention.
Detailed Description
Exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be embodied in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.
FIG. 1 shows a schematic diagram of a remote file replication system 100, in accordance with one embodiment of the present invention.
As shown in FIG. 1, a remote file replication system 100 includes a server 110 and a client 120. The server 110 and the client 120 may establish a remote communication connection, and the server 110 and the client 120 run different operating systems. The server 110 runs a first operating system, and the client 120 runs a second operating system. Here, the present invention is not particularly limited to the types of the first operating system and the second operating system.
In one embodiment of the present invention, the first operating system may be implemented as a Windows operating system, for example, and the second operating system may be implemented as a Linux operating system, for example.
In an embodiment of the present invention, the first operating system of the server 110 includes a remote file server 113 and a remote file system 111. Here, the remote file system 111 is the underlying file system of the server 110. The remote file server 113 includes a virtual file system therein so that the remote file system 111 is managed by the virtual file system.
The second operating system of the client 120 includes a local file system 121 and a user space file system 123. The user space file system 123 may be embodied as a FUSE file system. Here, the local file system 121 is the underlying file system of the client 120. Additionally, an application 127 may be running on a second operating system of the client 120.
In one embodiment of the present invention, a first daemon 115 runs in a first operating system of the server 110, and a second daemon 125 runs in a second operating system of the client 120. The first daemon process 115 of the server 110 establishes a bidirectional communication connection with the second daemon process 125 of the client 120 to realize a remote communication connection between the server 110 and the client 120, so that the server 110 and the client 120 perform remote communication.
It should be noted that the server 110 is a remote terminal of the client 120, and the client 120 may copy a file in its remote file system 111 from the server 110, that is, copy a remote file.
Specifically, the client 120 may first request to access the resource of the server 110, and specifically may request to access the directory or file of the server 110. When receiving a resource access request sent by the client 120, the server 110 accesses a resource based on the resource access request, generates a resource page, and returns the resource page to the client 120, where the resource page includes one or more original file paths. Client 120 may present a resource page.
In one embodiment, when the resource access request is a directory access request, the server 110 accesses the target directory based on the resource access request (directory access request), and renders the original file paths of all files in the target directory (i.e., the local file path of the server 110) to generate a resource page, and then returns the resource page to the client 120.
The client 120 user may operate on one or more original file paths at the resource page to initiate a copy operation of the file of the server 110 based on the original file paths.
The server 110 may receive the file copy operation sent by the client 120 based on the original file path of the resource page, and in response to the file copy operation sent by the client 120 based on the original file path of the resource page, convert the original file path (i.e., the local file path of the server 110) into a relative file path and return the relative file path to the client 120. After the client 120 receives the relative file path, the client 120 may convert the relative file path into a target file path, and write the target file path into a system clipboard of the client 120, and then the client 120 may obtain a corresponding target file from the server 110 based on the target file path, thereby implementing the copy of the target file from the first operating system of the server 110.
According to an embodiment of the present invention, the server 110 may execute the remote file copying method 300 of the present invention, and the client 120 may execute the remote file copying method 700 of the present invention, so as to enable the client 120 to copy the remote file from the server 110. The remote file copy method 300 and the remote file copy method 700 of the present invention will be described in detail below.
In one embodiment of the present invention, the server 110 and the client 120 may be implemented as a computing device, respectively, so that the remote file copying method 300 or the remote file copying method 700 of the present invention may be executed in the computing device.
FIG. 2 shows a schematic diagram of a computing device 200, according to one embodiment of the invention. As shown in FIG. 2, in a basic configuration, computing device 200 includes at least one processing unit 202 and system memory 204. According to one aspect, the processing unit 202 may be implemented as a processor depending on the configuration and type of computing device. The system memory 204 includes, but is not limited to, volatile storage (e.g., random access memory), non-volatile storage (e.g., read-only memory), flash memory, or any combination of such memories. According to one aspect, an operating system 205 is included in system memory 204, with operating system 205 being configured to perform either remote file copy method 300 or remote file copy method 700 of the present invention.
According to one aspect, the operating system 205 is, for example, adapted to control the operation of the computing device 200. Further, the examples are practiced in conjunction with a graphics library, other operating systems, or any other application program, and are not limited to any particular application or system. This basic configuration is illustrated in fig. 2 by those components within the dashed line. According to one aspect, computing device 200 has additional features or functionality. For example, according to one aspect, computing device 200 includes additional data storage devices (removable and/or non-removable) such as, for example, magnetic disks, optical disks, or tape. Such additional storage is illustrated in FIG. 2 by a removable storage device 209 and a non-removable storage device 210.
As stated hereinabove, according to one aspect, a program module 203 is stored in system memory 204. According to one aspect, the program module 203 may include one or more applications, the invention is not limited to the type of application, for example, the applications may include: email and contacts applications, word processing applications, spreadsheet applications, database applications, slide show applications, drawing or computer-aided applications, web browser applications, and the like.
According to one aspect, examples may be practiced in a circuit comprising discrete electronic elements, a packaged or integrated electronic chip containing logic gates, a circuit utilizing a microprocessor, or on a single chip containing electronic elements or microprocessors. For example, an example may be practiced via a system on a chip (SOC) in which each or many of the components shown in fig. 2 may be integrated on a single integrated circuit. According to one aspect, such SOC devices may include one or more processing units, graphics units, communication units, system virtualization units, and various application functions, all integrated (or "burned") onto a chip substrate as a single integrated circuit. When operating via an SOC, the functions described herein may be operated via application-specific logic integrated with other components of the computing device 200 on a single integrated circuit (chip). Embodiments of the invention may also be practiced using other technologies capable of performing logical operations (e.g., AND, OR, AND NOT), including but NOT limited to mechanical, optical, fluidic, AND quantum technologies. In addition, embodiments of the invention may be practiced within a general purpose computer or in any other circuits or systems.
According to one aspect, computing device 200 may also have one or more input devices 212, such as a keyboard, mouse, pen, voice input device, touch input device, or the like. Output device(s) 214 such as a display, speakers, printer, etc. may also be included. The foregoing devices are examples and other devices may also be used. Computing device 200 may include one or more communication connections 216 that allow communication with other computing devices 218. Examples of suitable communication connections 216 include, but are not limited to: RF transmitter, receiver and/or transceiver circuitry; universal Serial Bus (USB), parallel, and/or serial ports.
The term computer readable media as used herein includes computer storage media. Computer storage media may include volatile and nonvolatile, removable and non-removable media implemented in any method or technology for storage of information, such as computer readable instructions, data structures, or program modules. System memory 204, removable storage 209, and non-removable storage 210 are all examples of computer storage media (i.e., memory storage). Computer storage media may include Random Access Memory (RAM), read-only memory (ROM), electrically erasable read-only memory (EEPROM), flash memory or other memory technology, CD-ROM, digital Versatile Disks (DVD) or other optical storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other article of manufacture that may be used to store information and that may be accessed by computing device 200. In accordance with one aspect, any such computer storage media may be part of computing device 200. Computer storage media does not include a carrier wave or other propagated data signal.
According to one aspect, communication media is embodied by computer readable instructions, data structures, program modules, or other data in a modulated data signal (e.g., a carrier wave or other transport mechanism) and includes any information delivery media. According to one aspect, the term "modulated data signal" describes a signal that has one or more feature sets or that has been altered in such a manner as to encode information in the signal. By way of example, and not limitation, communication media includes wired media such as a wired network or direct-wired connection, and wireless media such as acoustic, radio Frequency (RF), infrared, and other wireless media.
In an embodiment according to the present invention, the operating system of the computing device 200 includes a plurality of program instructions for executing the remote file copy method 300 or the remote file copy method 700 of the present invention, which may instruct the processor to execute the remote file copy method 300 or the remote file copy method 700 of the present invention, and the computing device implements remote file copy between two devices of different operating systems by executing the remote file copy method 300 or the remote file copy method 700 of the present invention.
FIG. 3 illustrates a flow diagram of a remote file copy method 300 according to one embodiment of the invention. The method 300 is suitable for execution in an operating system of a server 110, such as the computing device 200 described above.
In an embodiment according to the present invention, the server 110 and the client 120 may establish a remote communication connection, and the server 110 and the client 120 run different operating systems. The server 110 runs a first operating system, and the client 120 runs a second operating system. Here, the present invention is not particularly limited to the types of the first operating system and the second operating system.
In one embodiment of the present invention, the first operating system may be implemented as a Windows operating system, for example, and the second operating system may be implemented as a Linux operating system, for example.
In an embodiment of the present invention, the first operating system of the server 110 includes a remote file server 113 and a remote file system 111. Here, the remote file system 111 is the underlying file system of the server 110. The remote file server 113 includes a virtual file system therein so that the remote file system 111 is managed by the virtual file system. The second operating system of the client 120 includes a user space file system 123. The user space file system 123 may be embodied as a FUSE file system.
It should be noted that, in the embodiment of the present invention, the first operating system of the server 110 is used as a file source system, and the second operating system of the client 120 is used as a file obtaining system, so as to describe an implementation method for the client 120 to copy a remote file from the server 110 (which is a remote terminal of the client 120).
As shown in FIG. 3, the method 300 includes steps 310 to 330.
First, in step 310, the server 110 receives a resource access request sent by the client 120. Here, the resource may include a directory or a file of the remote file system 111 of the server 110.
Subsequently, in step 320, the server 110 accesses the resource based on the resource access request and generates a resource page, and returns the resource page to the client 120, wherein the resource page includes one or more original file paths. Client 120 may present a resource page.
In an embodiment of the present invention, the resource access request sent by the client 120 includes a directory access request or a file access request.
In one embodiment, when the resource access request is a directory access request, the server 110 accesses the target directory based on the resource access request (directory access request), and renders the original file paths of all files in the target directory (i.e., the local file path of the server 110) to generate a resource page, and then returns the resource page to the client 120. In this way, the resource page may be exposed at the client 120, and a user of the client 120 may operate on one or more original file paths at the resource page to initiate a copy operation of a file of the server 110 based on the original file paths. Here, the target directory may be a root directory of the server 110, or may be a sub-directory under the root directory.
In one embodiment, when the resource access request is a file access request, the server 110 responds to the resource access request (file access request), directly obtains the target file from the remote file system 111 based on the resource access request, and returns the target file to the client 120.
It should be noted that the server 110 of the present invention can provide HTTP service. Fig. 4 shows a logical diagram of an HTTP service provided by the server 110 according to an embodiment of the present invention.
In one embodiment, as shown in FIG. 4, client 120 may request access to resources, including directories or files, from server 110 based on a URI. That is, the resource access request sent by client 120 to server 110 based on the URI may be a directory access request or a file access request. Specifically, when the URI points to the directory, the resource access request is a directory access request; when the URI points to a file, the resource access request is a file access request.
In one embodiment, in step 310, if the resource access request sent by the client 120 is a directory access request, the resource access request includes a URI of a target directory requested to be accessed, and the server 110 may obtain the URI of the target directory from the resource access request and access the target directory based on the URI. I.e., routed based on the URI to access the target directory corresponding to the URI. Further, by obtaining the original file paths of all files in the target directory, rendering the original file paths of all files can generate a resource page, and return the resource page to the client 120. Here, the resource page includes original file paths of all files under the target directory.
Additionally, in step 310, if the resource access request sent by the client 120 is a file access request, the resource access request includes the URI of the target file requested to be accessed. When the server 110 receives a file access request of the client 120, the server 110 responds to the file access request, directly obtains the target file from the remote file system 111 based on the file access request, and returns the target file to the client 120. Here, the server 110 may obtain the URI of the target file from the resource access request (file access request), obtain the target file from the remote file system 111 based on the URI of the target file, and return the target file to the client 120. It can be understood that, in this embodiment, the client 120 may directly obtain the target file of the server 110 without performing a subsequent copy operation.
According to an embodiment of the present invention, after the server 110 returns the resource page to the client 120, the client 120 user may operate on one or more original file paths in the resource page, so as to initiate a copy operation of the file of the server 110 based on the original file paths.
In step 330, the server 110 may receive the file copy operation sent by the client 120 based on the original file path of the resource page, and in response to the file copy operation sent by the client 120 based on the original file path of the resource page, convert the original file path (i.e., the local file path of the server 110) into a relative file path and return the relative file path to the client 120. After the client 120 receives the relative file path, the client 120 may convert the relative file path into a target file path, and write the target file path into a system clipboard of the client 120, and then the client 120 may obtain a corresponding target file from the server 110 based on the target file path, thereby enabling the client to copy the target file from the first operating system of the server 110.
It should be noted that the file copy operation in step 330 may include a copy operation/cut operation.
Specifically, for the copy operation, after the server 110 returns the target file to the client 120, the file copy operation process is completed. For the cutting operation, after the server 110 returns the target file to the client 120, the target file of the server 110 is also deleted, so that the cutting operation on the target file of the server 110 can be realized.
FIG. 5 illustrates a timing diagram for remotely copying a file according to one embodiment of the invention.
In one embodiment of the invention, as shown in FIG. 5, before a client 120 user initiates a file copy operation, or in other words, before the server 110 responds to a file copy operation sent by the client 120 based on the original file path of the resource page, the server 110 may listen to the client 120's system clipboard. When the server 110 detects that an original file path is added to the system clipboard of the client 120, it may be determined that the client 120 performs a file copy operation, and the remote file server 113 is started in response to the file copy operation sent by the client 120, so that the file to be copied is brought into a management range through the remote file server 113. The original file path may then be converted to a relative file path and returned to client 120 so that client 120 converts the relative file path to a target file path.
In one embodiment of the present invention, a first daemon 115 runs in a first operating system of the server 110, and a second daemon 125 runs in a second operating system of the client 120. Before listening to the system clipboard of the client 120, the server 110 first establishes a two-way communication connection with the second daemon process 125 through the first daemon process 115, so that the server 110 and the client 120 perform remote communication. Subsequently, the system clipboard of client 120 may be listened to by first daemon 115. In one implementation, the first daemon 115 and the second daemon 125 can establish an RPC communication connection through thrift. It should be noted that thrift is an interface description language and binary communication protocol, can be used to define and create cross-language services, and can be used as a Remote Procedure Call (RPC) framework.
It should be noted that the server 110 and the client 120 may listen to and synchronize the system clipboard data of each other through the daemon process. Specifically, the server 110 may listen to the system clipboard of the client 120 through the first daemon 115. Accordingly, the client 120 may also listen to the system clipboard of the server 110 through the second daemon 125.
In one implementation, the first daemon 115 and the second daemon 125 can utilize the Clipboard library of the QT to monitor or write system Clipboard data of different operating systems.
In one embodiment, when the first daemon 115 of the server 110 detects that the original file path is added to the system clipboard of the client 120, the remote file server 113 is started in response to a file copying operation sent by the client 120, and the file to be copied is brought into a management range through the remote file server 113. Subsequently, the first daemon 115 of the server 110 may convert the original file path into a relative file path and return to the client 120 by performing the following steps, so that the client 120 converts the relative file path into a target file path:
first, the original file path is converted to a relative file path in the remote file server 113. Here, the remote file server 113 may access the remote file system 111 based on the relative file path.
Subsequently, (the second daemon 125 of) the client 120 may be notified to mount the virtual file system in the remote file server 113.
FIG. 6 illustrates a logical view of mounting remote file server 113 based on user space file system 123 according to one embodiment of the present invention. As shown in fig. 6, the client 120 may mount the virtual file system of the remote file server 113 through the user space file system 123, and mount the virtual file system of the remote file server 113 to the local file system 121 of the client 120, specifically, may mount the virtual file system to the temporary directory of the local file system 121. Client 120 may then convert the relative file path to a target file path corresponding to user space file system 123. Also, client 120 may write the target file path into the system clipboard of client 120. In this way, the client 120 may obtain the corresponding target file from the server 110 based on the target file path.
In one embodiment, the server 110 may implement the remote file server 113 using the HTTP protocol, in other words, the remote file server 113 may be implemented as an HTTP file server (HTTP dirfs). HTTPDirFS supports mount in a read-only manner.
After client 120 mounts remote file server 113 (including the virtual file system) via user space file system 123, mounted remote file server 113 may serve as the back-end of user space file system 123 for client 120. In this way, client 120 may mount a file to be copied in remote file system 111 based on user space file system 123 in order to copy or cut the file in the remote file system.
Further, an application 127 of a client 120 may access a remote file server 113 (mounted on the client's local file system 121) via a user space file system 123 and access a remote file system 111 via the remote file server 113.
In one embodiment, after converting the relative file path to a target file path corresponding to user space file system 123, client 120 may send a target file retrieval request to remote file server 113 of server 110 based on the target file path, i.e., request retrieval of the target file from remote file server 113 based on the target file path. In particular, application 127 of client 120 may send a target file fetch request to remote file server 113 based on a target file path via user space file system 123. Remote file server 113, upon receiving a target file acquisition request sent by application 127 of client 120 (via user space file system 123) based on the target file path, acquires the target file from remote file system 111 and returns the target file to client 120.
FIG. 7 illustrates a flow diagram of a method 700 of remote file replication in accordance with one embodiment of the present invention. Method 700 is performed in an operating system of client 120 (e.g., computing device 200 described above).
In an embodiment according to the present invention, the client 120 may establish a remote communication connection with the server 110, and the client 120 and the server 110 run different operating systems. The server 110 runs a first operating system, and the client 120 runs a second operating system. Here, the present invention is not particularly limited to the types of the first operating system and the second operating system.
It should be noted that, in the method 700 of the present invention, the first operating system of the server 110 is used as a file source system, and the second operating system of the client 120 is used as a file obtaining system, so as to describe an implementation method for the client 120 to copy a remote file from the server 110 (which is a remote terminal of the client 120).
As shown in FIG. 7, the method 700 includes steps 710 to 740.
First, in step 710, the client 120 sends a resource access request to the server 110. The server 110 may access the resource based on the resource access request and generate a resource page, and return the resource page to the client 120.
Subsequently, in step 720, the client 120 receives the resource page returned by the server 110. Here, the resource page includes one or more original file paths.
Then, in step 730, the client 120 sends a file copy operation to the server 110 based on the original file path of the resource page, and receives a relative file path obtained by converting the original file path and returned by the server 110. Here, the server 110 may convert the original file path (i.e., the local file path of the server 110) into a relative file path and return to the client 120 in response to a file copy operation sent by the client 120 based on the original file path of the resource page.
Finally, in step 740, the client 120 converts the relative file path into a target file path, and obtains a corresponding target file from the server 110 based on the target file path.
It should be noted that, for the specific execution logic of steps 710 to 740 in the method 700, reference is made to the related description in the method 300, and details are not described here again.
According to the remote file copying method 300, remote file copying and cutting can be realized between a server and a client which are connected in remote communication. The server and the client run different operating systems, when the server receives a resource access request sent by the client, the server accesses resources based on the resource access request, generates a resource page and returns the resource page to the client. Subsequently, a client user can perform file copy operations (including copy and cut operations) based on an original file path of a resource page, the server responds to the file copy operations of the client, converts the original file path into a relative file path and returns the relative file path to the client, and notifies the client to mount a remote file server of the server, and finally, the client can convert the relative file path into a target file path and acquire a corresponding target file from a remote file system of the server based on the target file path. Therefore, according to the technical scheme of the invention, the remote file copying and cutting can be realized between two devices of different operating systems. Moreover, the invention supports large file copy, and the operation of the operating system is not blocked by adding the copied file.
The various techniques described herein may be implemented in connection with hardware or software or, alternatively, with a combination of both. Thus, the methods and apparatus of the present invention, or certain aspects or portions thereof, may take the form of program code (i.e., instructions) embodied in tangible media, such as removable hard drives, U.S. disks, floppy disks, CD-ROMs, or any other machine-readable storage medium, wherein, when the program is loaded into and executed by a machine, such as a computer, the machine becomes an apparatus for practicing the invention.
In the case of program code execution on programmable computers, the mobile terminal generally includes a processor, a storage medium readable by the processor (including volatile and non-volatile memory and/or storage elements), at least one input device, and at least one output device. Wherein the memory is configured to store program code; the processor is configured to perform the remote file copy method of the present invention according to instructions in the program code stored in the memory.
By way of example, and not limitation, readable media may comprise readable storage media and communication media. Readable storage media store information such as computer readable instructions, data structures, program modules or other data. Communication media typically embodies computer readable instructions, data structures, program modules or other data in a modulated data signal such as a carrier wave or other transport mechanism and includes any information delivery media. Combinations of any of the above are also included within the scope of readable media.
In the description provided herein, algorithms and displays are not inherently related to any particular computer, virtual system, or other apparatus. Various general purpose systems may also be used with examples of this invention. The required structure for constructing such a system will be apparent from the description above. Moreover, the present invention is not directed to any particular programming language. It is appreciated that a variety of programming languages may be used to implement the teachings of the present invention as described herein, and any descriptions of specific languages are provided above to disclose the best mode of the invention.
In the description provided herein, numerous specific details are set forth. However, it is understood that embodiments of the invention may be practiced without these specific details. In some instances, well-known methods, structures and techniques have not been shown in detail in order not to obscure an understanding of this description.
Similarly, it should be appreciated that in the foregoing description of exemplary embodiments of the invention, various features of the invention are sometimes grouped together in a single embodiment, figure, or description thereof for the purpose of streamlining the disclosure and aiding in the understanding of one or more of the various inventive aspects. However, the disclosed method should not be construed to reflect the intent: that the invention as claimed requires more features than are expressly recited in each claim. Thus, the claims following the detailed description are hereby expressly incorporated into this detailed description, with each claim standing on its own as a separate embodiment of this invention.
Those skilled in the art will appreciate that the modules or units or components of the devices in the examples disclosed herein may be arranged in a device as described in this embodiment, or alternatively may be located in one or more devices different from the device in this example. The modules in the foregoing examples may be combined into one module or may additionally be divided into multiple sub-modules.
Those skilled in the art will appreciate that the modules in the device in an embodiment may be adaptively changed and disposed in one or more devices different from the embodiment. The modules or units or components of the embodiments may be combined into one module or unit or component, and furthermore they may be divided into a plurality of sub-modules or sub-units or sub-components. All of the features disclosed in this specification (including any accompanying claims, abstract and drawings), and all of the processes or elements of any method or apparatus so disclosed, may be combined in any combination, except combinations where at least some of such features and/or processes or elements are mutually exclusive. Each feature disclosed in this specification (including any accompanying claims, abstract and drawings) may be replaced by alternative features serving the same, equivalent or similar purpose, unless expressly stated otherwise.
Furthermore, those skilled in the art will appreciate that while some embodiments described herein include some features included in other embodiments, rather than other features, combinations of features of different embodiments are meant to be within the scope of the invention and form different embodiments.
Additionally, some of the embodiments are described herein as a method or combination of method elements that can be implemented by a processor of a computer system or by other means of performing the described functions. A processor having the necessary instructions for carrying out the method or method elements thus forms a means for carrying out the method or method elements. Further, the elements of the apparatus embodiments described herein are examples of the following apparatus: the apparatus is used to implement the functions performed by the elements for the purpose of carrying out the invention.
As used herein, unless otherwise specified the use of the ordinal adjectives "first", "second", "third", etc., to describe a common object, merely indicate that different instances of like objects are being referred to, and are not intended to imply that the objects so described must be in a given sequence, either temporally, spatially, in ranking, or in any other manner.
While the invention has been described with respect to a limited number of embodiments, those skilled in the art, having benefit of this description, will appreciate that other embodiments can be devised which do not depart from the scope of the invention as disclosed herein. Furthermore, it should be noted that the language used in the specification has been principally selected for readability and instructional purposes, and may not have been selected to delineate or circumscribe the inventive subject matter. Accordingly, many modifications and variations will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the appended claims. The present invention has been disclosed in an illustrative rather than a restrictive sense with respect to the scope of the invention, as defined in the appended claims.

Claims (9)

1. A remote file copying method is executed on a server, the server is in communication connection with a client, a first operating system runs on the server, the first operating system comprises a remote file server and a remote file system, the remote file server comprises a virtual file system, the client runs on a second operating system, the second operating system comprises a user space file system, and the method comprises the following steps:
receiving a resource access request sent by a client;
accessing resources based on the resource access request, generating a resource page, and returning the resource page to the client, wherein the resource page comprises one or more original file paths;
and responding to a file copying operation sent by the client based on the original file path of the resource page, converting the original file path into a relative file path in the remote file server and returning the relative file path to the client, informing the client to mount a virtual file system in the remote file server through a user space file system so that the client converts the relative file path into a target file path corresponding to the user space file system, and acquiring a corresponding target file from the server based on the target file path.
2. The method of claim 1, wherein the resource access request is a directory access request; accessing a resource based on the resource access request and generating a resource page, including:
and accessing a target directory based on the resource access request, acquiring original file paths of all files in the target directory and generating a resource page.
3. The method of claim 1, further comprising:
and the remote file server receives a target file acquisition request sent by the client based on the target file path, acquires a target file from the remote file system, and returns the target file to the client.
4. The method of any one of claims 1-3, further comprising:
monitoring a system clipboard of the client;
and when detecting that the original file path is newly added to the system clipboard, responding to the file copying operation sent by the client, and starting the remote file server.
5. The method of any one of claims 1-3,
a first daemon process runs in a first operating system of the server, a second daemon process runs in a second operating system of the client, and the first daemon process is suitable for establishing communication connection with the second daemon process;
the first daemon process is further adapted to listen to a system clipboard of the client.
6. A remote file copying method is executed at a client, the client is in communication connection with a server, a first operating system runs at the server, the first operating system comprises a remote file server and a remote file system, the remote file server comprises a virtual file system, a second operating system runs at the client, and the second operating system comprises a user space file system, and the method comprises the following steps:
sending a resource access request to a server, so that the server accesses resources based on the resource access request and generates a resource page;
receiving a resource page returned by a server, wherein the resource page comprises one or more original file paths;
sending a file copying operation to a server based on an original file path of the resource page, receiving a relative file path in the remote file server obtained by converting the original file path returned by the server, and mounting a virtual file system in the remote file server through a user space file system;
and converting the relative file path into a target file path corresponding to the user space file system, and acquiring a corresponding target file from a server based on the target file path.
7. A remote file replication system comprising:
a client running a second operating system including a user space file system, the client being adapted to perform the method of claim 6;
the server side is in communication connection with the client side, the server side runs a first operating system, the first operating system comprises a remote file server and a remote file system, the remote file server comprises a virtual file system, and the server side is suitable for executing the method according to any one of claims 1-5.
8. A computing device, comprising:
at least one processor; and
a memory storing program instructions, wherein the program instructions are configured to be executed by the at least one processor, the program instructions comprising instructions for performing the method of any of claims 1-6.
9. A readable storage medium storing program instructions that, when read and executed by a computing device, cause the computing device to perform the method of any of claims 1-6.
CN202211050854.1A 2022-08-30 2022-08-30 Remote file copying method, system, computing equipment and storage medium Active CN115150392B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211050854.1A CN115150392B (en) 2022-08-30 2022-08-30 Remote file copying method, system, computing equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211050854.1A CN115150392B (en) 2022-08-30 2022-08-30 Remote file copying method, system, computing equipment and storage medium

Publications (2)

Publication Number Publication Date
CN115150392A CN115150392A (en) 2022-10-04
CN115150392B true CN115150392B (en) 2022-12-02

Family

ID=83416394

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211050854.1A Active CN115150392B (en) 2022-08-30 2022-08-30 Remote file copying method, system, computing equipment and storage medium

Country Status (1)

Country Link
CN (1) CN115150392B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116887032A (en) * 2023-07-05 2023-10-13 荣耀终端有限公司 Cross-terminal image data acquisition system, method, client and server

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103618765A (en) * 2013-11-11 2014-03-05 华为技术有限公司 Remote copying method and device, backup terminal device and system
CN103761154A (en) * 2014-01-27 2014-04-30 宇龙计算机通信科技(深圳)有限公司 Cross-platform shear plate synchronizing method and system
CN107967184A (en) * 2017-11-30 2018-04-27 北京奇艺世纪科技有限公司 Method of attaching, device and electronic equipment are replicated in remote assistance
CN112445579A (en) * 2020-12-11 2021-03-05 西安万像电子科技有限公司 Zero-terminal data processing system and file copying method and device thereof

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8578203B2 (en) * 2010-08-31 2013-11-05 Autonomy, Inc. Providing a backup service from a remote backup data center to a computer through a network
WO2019127191A1 (en) * 2017-12-28 2019-07-04 深圳前海达闼云端智能科技有限公司 File system sharing method and apparatus for multi-operating system, and electronic device

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103618765A (en) * 2013-11-11 2014-03-05 华为技术有限公司 Remote copying method and device, backup terminal device and system
CN103761154A (en) * 2014-01-27 2014-04-30 宇龙计算机通信科技(深圳)有限公司 Cross-platform shear plate synchronizing method and system
CN107967184A (en) * 2017-11-30 2018-04-27 北京奇艺世纪科技有限公司 Method of attaching, device and electronic equipment are replicated in remote assistance
CN112445579A (en) * 2020-12-11 2021-03-05 西安万像电子科技有限公司 Zero-terminal data processing system and file copying method and device thereof

Also Published As

Publication number Publication date
CN115150392A (en) 2022-10-04

Similar Documents

Publication Publication Date Title
EP2021937B1 (en) Techniques to perform gradual upgrades
US9432484B1 (en) CIM-based data storage management system having a restful front-end
CN109906597B (en) Storing and retrieving restricted and unrestricted data sets to and from a cloud network
JP2016529599A (en) Content clipboard synchronization
CN103930881A (en) Hosted storage locking
CN113568566A (en) Method, host device and storage server for seamless migration of simple storage service by using index object
CN111010364A (en) System for offline object-based storage and simulation of REST responses
CN115150392B (en) Remote file copying method, system, computing equipment and storage medium
WO2019162830A1 (en) Chronologically ordered out-of-place update key-value storage system
US20220012050A1 (en) Mini program batch processing method and apparatus, electronic device, and readable storage medium
US9703848B2 (en) Caching linked queries for optimized compliance management
CN114371914A (en) Container IP address configuration method and device, storage medium and electronic equipment
US20080270480A1 (en) Method and system of deleting files from a remote server
US8280950B2 (en) Automatic client-server code generator
CN115586872A (en) Container mirror image management method, device, equipment and storage medium
CN113779122B (en) Method and device for exporting data
US11625497B2 (en) File management system and non-transitory computer readable medium
CN114860272A (en) Operating system installation method, computing device and storage medium
CN115485677A (en) Secure data replication in a distributed data storage environment
CN112152988A (en) Method, system, and computer device and medium for asynchronous NBMP request processing
CN113761075A (en) Method, device, equipment and computer readable medium for switching databases
CN114389980B (en) Test environment monitoring management method and device and computer equipment
US20090006942A1 (en) Embedded markup resources
CN115202830B (en) Root file system preparation method, system, computing device and readable storage medium
CN115514611B (en) Message processing method, device, equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant