WO2015085901A1 - 一种文件传输方法、设备以及相关系统 - Google Patents

一种文件传输方法、设备以及相关系统 Download PDF

Info

Publication number
WO2015085901A1
WO2015085901A1 PCT/CN2014/093361 CN2014093361W WO2015085901A1 WO 2015085901 A1 WO2015085901 A1 WO 2015085901A1 CN 2014093361 W CN2014093361 W CN 2014093361W WO 2015085901 A1 WO2015085901 A1 WO 2015085901A1
Authority
WO
WIPO (PCT)
Prior art keywords
file
event
parameter
file name
events
Prior art date
Application number
PCT/CN2014/093361
Other languages
English (en)
French (fr)
Inventor
赵化强
Original Assignee
北京奇虎科技有限公司
奇智软件(北京)有限公司
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 北京奇虎科技有限公司, 奇智软件(北京)有限公司 filed Critical 北京奇虎科技有限公司
Publication of WO2015085901A1 publication Critical patent/WO2015085901A1/zh

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]

Definitions

  • the present invention relates to the field of computers and the Internet, and more particularly to data synchronization techniques in networks.
  • a typical network storage system can include a first computing device 110, a second computing device 120, and a storage server 130.
  • the first computing device 110 and the second computing device 120 communicate with the storage server 130 via a network, respectively.
  • the computing devices 110 and 120 respectively monitor the file changes under the corresponding directory locally.
  • the first computing device 110 detects that a file in a certain directory changes, it interacts with the storage server 130, uploads the changed file and its data to the storage server 130, and when the second When the computing device 120 interacts with the storage server 130, the file newly stored in the storage server 130 and changed in the first computing device 110 and its data can be automatically downloaded to the local corresponding directory of the second computing device 120, thereby Synchronization of related files in various computing terminals is achieved.
  • the file information of interest is the content after the modification, not the modification process, so this will result in useless frequent interaction between the computing terminal and the storage server, reducing the entire network storage system. performance. There is therefore a need for a file transfer scheme that reduces invalid data transfers to increase the efficiency of the overall network storage system.
  • the present invention provides a new solution in an effort to solve or at least alleviate the above problems. question.
  • a file transfer device that resides on a computing device and is adapted to transfer a file on a computing device to a server, the file transfer device comprising: a file monitor adapted to Monitoring various file changes in the computing device and generating corresponding file change events; an event handler adapted to process file change events generated by the file monitor in accordance with predetermined rules; and a communication unit adapted to process the events One or more file change events and associated file data processed by the device are transmitted to the server together.
  • the file change event may be divided into a create event, a delete event, a modify event, and a rename event, wherein the parameters for creating the event, deleting the event, and modifying the event are file names involved, and the rename event has a name before the rename
  • the file name is used as the first parameter and the renamed file name is used as the second parameter.
  • the file transfer device further includes a synchronization trigger adapted to, when triggered, instruct the event processor to process a file change event generated by the file monitor since the last time it was triggered, and instruct the communication unit to transmit data.
  • a synchronization trigger adapted to, when triggered, instruct the event processor to process a file change event generated by the file monitor since the last time it was triggered, and instruct the communication unit to transmit data.
  • a file transfer method is provided, the method being adapted to transfer a file on a computing device to a server, the file transfer method comprising the steps of: monitoring various file changes in the computing device, and generating Corresponding file change events; processing the generated file change events according to predetermined rules; and transmitting the processed one or more file change events and associated file data to the server.
  • the file change event may be divided into a create event, a delete event, a modify event, and a rename event, wherein the parameters for creating the event, deleting the event, and modifying the event are file names involved, and the rename event has a name before the rename
  • the file name is used as the first parameter and the renamed file name is used as the second parameter.
  • the file transfer method according to the present invention further includes a triggering step of performing the step of processing the file change event periodically or at the request of the user to trigger the file change event generated since the last time the event was triggered. deal with.
  • a network storage system comprising: a server; and a plurality of computing devices, each computing device comprising a file transfer device in accordance with the present invention for transmitting files on a computing device to a server in.
  • a computer program comprising computer readable code that causes the file transfer method method to be executed when the electronic device runs the computer readable code.
  • a computer readable medium storing a computer program as described above is provided.
  • the file change in the computing device is analyzed according to a predetermined rule, and some unnecessary intermediate file transmission is removed, thereby improving the efficiency of file transmission.
  • Figure 1 shows a schematic diagram of a network storage system in accordance with the present invention
  • FIG. 2 shows a schematic diagram of a file transfer device in accordance with one embodiment of the present invention
  • FIG. 3 is a schematic diagram showing a file transfer method according to an embodiment of the present invention.
  • FIG. 4 shows a block diagram of an electronic device for performing the method of the present invention
  • Figure 5 shows a schematic diagram of a memory unit for holding or carrying program code implementing the method according to the invention.
  • the present invention can be implemented in the network storage system shown in FIG. 1.
  • the network storage system can include a first computing device 110, a second computing device 120, and a storage server 130.
  • the first computing device 110 and the second computing device 120 communicate with the storage server 130 via a network, respectively.
  • the first and second computing devices include a file transfer device in accordance with the present invention for transferring files in the computing device to the storage server 130 for centralized storage.
  • FIG. 2 shows a schematic diagram of a file transfer device in accordance with one embodiment of the present invention.
  • the file transfer device 200 is included in any of the first computing device 110 and the second computing device 120 shown in FIG. 1 for transferring files in the computing devices to the server 130 and storing them in among them.
  • Service The server 130 can then transfer these files to other computing devices that do not yet have these files, thereby enabling synchronization of the files.
  • the first and second computing devices 110 and 120 can be any device in the art that can process electronic data, including but not limited to desktop computers, notebook computers, personal digital assistants, smart mobile terminals, tablets, and the like.
  • a modern operating system is typically run in computing devices 110 and 120, utilizing an operating system to manage hardware resources in the computing device.
  • Computing devices 110 and 120 can run various applications on an operating system.
  • File transfer device 200 in the present invention can operate on computing devices 110 and 120 as an application.
  • the implementation of the file transfer device 200 is also different. The present invention is not limited to the various implementations that the file transfer device 200 employs to adapt to different operating systems, but only It is limited to the implementation logic that file transfer device 200 must have to implement the functionality of the present invention.
  • the file transfer device 200 includes a file monitor 210, an event processor 220, and a communication unit 230.
  • File monitor 210 monitors various file changes in computing device 110, such as creating files, deleting files, moving files, and modifying file content.
  • the operating system typically provides a file operation interface.
  • file monitor 210 can accurately learn file changes in computing device 110 by adding a hook (HOOK) on these file operations interfaces.
  • computing device 110 since computing device 110 does not wish to synchronize all of the files on the computing device to other computing devices, computing device 110 typically specifies one or more file directories to be file synchronized, at which point the file monitor 210 only monitors these file directories.
  • each file change event includes an event generation time, an action type, and a parameter.
  • Action types include create, delete, modify, and rename. Accordingly, file change events can be classified into create events, delete events, modify events, and rename events.
  • the parameters of the file change event are the file names involved; for rename events, the parameters of the file change event include the file name before the rename as the first parameter and the renamed file. The name is used as the second parameter.
  • a create event is generated with the argument a.doc.
  • a delete event is generated with the parameter b.bak.
  • a rename event is generated with the first parameter a.doc and the second parameter tmp.
  • Event processor 220 is coupled to file monitor 210 to process a series of file change events generated by file monitor 210.
  • One of the most straightforward ways to simultaneously copy files on a computing device to server 130 is to replay these file change events in the same order on server 130, i.e., re-execute the file change process on server 130, thus You can be sure to copy the files to the server completely. Since file monitor 210 generates a file change event for each file change operation, if these events are replayed directly on the server, a large amount of file transfer between the computing device and the server results. Thus, processing the file change events generated by the file monitor 210 by the event processor 220 in accordance with predetermined rules prior to replaying these events on the server 130 helps to reduce unnecessary between the computing device and the server 130. data transmission.
  • the first predetermined rule according to the invention is that if there are multiple modification events with the same parameters, they are merged into one modification event with the same parameters. For example, when a file is modified multiple times on a computing device (for example, editing a graphic file multiple times), multiple modification events are generated, but the final result is to store the last file, so multiple modification events can be merged into A modification event.
  • the parameter is a creation event of the temporary file name
  • the first parameter is the target file name
  • the second parameter is the rename event of the backup file name
  • the first parameter If the temporary file name and the second parameter are the rename event of the target file name and the deletion event whose parameter is the backup file name, these events are merged into a modification event whose parameter is the target file name.
  • the second predetermined rule applies to situations where it is necessary to save files when running various applications that edit files on the computing device.
  • these applications typically use the following processing to save the target files: First, the content to be saved is written to a temporary file, then the target file is renamed to the backup file, and then the temporary file is renamed to the target file. If the execution of these steps is successful, the backup file is deleted. Since the network storage system uploads the target file only after the target file is reliably saved, it is not necessary to play back all four events on the server, but simply replay an event of updating the target file.
  • a word file for example, a.doc
  • the word file needs to be saved in the editing process, and the word processing software performs the following file operations.
  • the word processing software performs the following file operations.
  • save the edited Chinese text as a .tmp file then rename the a.doc file to be saved to a.bak file, and then rename the .tmp file to a.doc file.
  • delete a. .bak file But for the user, it is the operation of storing a.doc once, and when uploading related files to the server, it only needs to transfer the updated a.doc to the server without transferring various tmp and bak files. .
  • the third predetermined rule according to the present invention is that if there are two consecutive sequential events: the parameter is a creation event of the temporary file name and the first parameter is a temporary file name and the second parameter is a rename event of the target file name,
  • the third predetermined rule applies to an example where the user first creates a name a.doc, but finds that the name is entered incorrectly, then the file name is changed to b.doc. At this point, for file synchronization, the end result is that a file named b.doc is created, so these two events can be merged.
  • the fourth predetermined rule of the present invention if there are two following sequential events: the first parameter is the target file name and the second parameter is the rename event of the temporary file name, and the first parameter is the temporary file name and the first parameter If the second parameter is the rename event of the target file name, the two events can be deleted.
  • the fourth predetermined rule takes into account the fact that the user erroneously modifies the name of a file, but finds a modification error and modifies the file name as it is. The end result is that the file system has not changed, so you can delete both events.
  • the first parameter is the target file name and the second parameter is the rename event of the temporary file name
  • the one or more parameters are the modification event of the target file name. If the parameter is a delete event of the temporary file name, these events can be combined into one modification event whose parameter is the target file name.
  • the fifth predetermined rule applies to the case where when a file needs to be continuously modified, due to an error in the modification of the file, a temporary file of the file is copied first, and then the file is continuously modified. When the file modification is successful, delete the temporary file that was originally copied. For a synchronous system, the end result is that the file has been modified, so event consolidation is required.
  • the event handler 220 will process and cycle through the predetermined rules until the events cannot be processed by any predetermined rules. For example, when the event processor 220 first processes the event according to each predetermined rule in turn, after the first round of processing is performed, the event is processed again according to each predetermined rule in turn until the event cannot be optimized according to the predetermined rule. After the event generated by the event monitor 220 for the file monitor 210 is processed, the communication unit 230 coupled to the event processor 220 transmits the processed file change event and associated file data to the server 130 for The event is replayed on server 130 to synchronize the file to server 130.
  • the file transfer process is performed with the file change event generated by the file monitor 210 as the basic processing unit. Since the operations involving files on the computing device are the most frequent operations in modern operating systems, the file monitor 210 generates a large number of file changes. Pieces. In order to ensure synchronization of file contents between the computing device and the server, file transfer needs to be performed at an appropriate timing. Therefore, according to one embodiment of the present invention, the file transfer device 200 includes a sync trigger 240. When triggered, the synchronization trigger 240 instructs the event processor 220 to process the file change event generated by the file monitor 210 since it was last triggered, and simultaneously instructs the communication unit 230 to follow the file change event processed by the event processor 220. The relevant data is sent to the server 130 for playback to synchronously store the corresponding file.
  • the file change event generated by the file monitor 210 is processed, it is cleared from the file monitor 210, and then the file monitor 210 continues to monitor the related file directory and generate a new file change event.
  • the sync trigger 240 is triggered again, the event handler 220 is instructed to process the file change event and clear the processed file change event.
  • the sync trigger 240 can be triggered periodically, such as every 5 seconds or every 30 seconds.
  • the synchronization trigger 240 can also be triggered by the user, that is, triggered according to the user's operation.
  • the file transmission device 200 analyzes file changes in the computing device according to a predetermined rule before transmitting the file of the computing device to the server, thereby removing some unnecessary intermediate file transmission, thereby improving the efficiency of file transfer.
  • FIG. 3 shows a schematic diagram of a file transfer method 300 in accordance with one embodiment of the present invention.
  • the file transfer method 300 illustrated in FIG. 3 is adapted to be executed in the computing device 110 or 120 of FIG. 1 to synchronize files in the computing device into the server 130.
  • the file transfer method 300 can be performed by the file transfer device 200 shown in FIG. 2.
  • the method 300 begins in step S310, in which various file changes in the computing device 110, such as creating files, deleting files, moving files, and modifying file content, are monitored.
  • various file changes in the computing device 110 such as creating files, deleting files, moving files, and modifying file content
  • operating systems in computing devices typically provide a file manipulation interface.
  • file changes in computing device 110 can be accurately learned by adding a hook (HOOK) on these file operations interfaces.
  • the computing device 110 since the computing device 110 does not wish to synchronize all files on the computing device to other computing devices, the computing device 110 typically specifies one or more file directories to be file synchronized, at step S310. Only these file directories are monitored.
  • each file change event includes an event generation time, an action type, and a parameter.
  • Action type This includes creating, deleting, modifying, and renaming, and accordingly, file change events can be categorized as creating events, deleting events, modifying events, and renaming events.
  • the parameters of the file change event are the file names involved; for rename events, the parameters of the file change event include the file name before the rename as the first parameter and the renamed file. The name is used as the second parameter.
  • a create event is generated with the argument a.doc.
  • a delete event is generated with the parameter b.bak.
  • a rename event is generated with the first parameter a.doc and the second parameter tmp.
  • step S310 Since a file change event is generated for each file change operation in step S310, if these events are played back directly on the server, a large amount of file transfer between the computing device and the server is caused. Therefore, before the events are played back on the server 130, processing the file change event generated by the file monitor 210 according to the predetermined rule in step S320 helps to reduce unnecessary between the computing device and the server 130. data transmission.
  • the first predetermined rule according to the invention is that if there are multiple modification events with the same parameters, they are merged into one modification event with the same parameters. For example, when a file is modified multiple times on a computing device (for example, editing a graphic file multiple times), multiple modification events are generated, but the final result is to store the last file, so multiple modification events can be merged into A modification event.
  • the parameter is a creation event of the temporary file name
  • the first parameter is the target file name
  • the second parameter is the rename event of the backup file name
  • the first parameter If the temporary file name and the second parameter are the rename event of the target file name and the deletion event whose parameter is the backup file name, these events are merged into a modification event whose parameter is the target file name.
  • the second predetermined rule applies to situations where it is necessary to save files when running various applications that edit files on the computing device.
  • these applications typically use the following processing to save the target files: First, the content to be saved is written to a temporary file, then the target file is renamed to the backup file, and then the temporary file is renamed to the target file. If the execution of these steps is successful, the backup file is deleted. Since the network storage system only uploads the target file after the target file is reliably saved, there is no need to replay all four things on the server. Instead, simply replay an event that updates the target file.
  • a word file for example, a.doc
  • the word file needs to be saved in the editing process, and the word processing software performs the following file operations.
  • the word processing software performs the following file operations.
  • save the edited Chinese text as a .tmp file then rename the a.doc file to be saved to a.bak file, and then rename the .tmp file to a.doc file.
  • delete a. .bak file But for the user, it is the operation of storing a.doc once, and when uploading related files to the server, it only needs to transfer the updated a.doc to the server without transferring various tmp and bak files. .
  • the parameter is a creation event of the temporary file name and the first parameter is a temporary file name and the second parameter is a rename event of the target file name, then You can combine these two events into one creation event with the parameter name of the target file.
  • the third predetermined rule applies to an example where the user first creates a name a.doc, but finds that the name is entered incorrectly, then the file name is changed to b.doc. At this point, for file synchronization, the end result is that a file named b.doc is created, so these two events can be merged.
  • the fourth predetermined rule of the present invention if there are two following sequential events: the first parameter is the target file name and the second parameter is the rename event of the temporary file name, and the first parameter is the temporary file name and the first parameter If the second parameter is the rename event of the target file name, the two events can be deleted.
  • the fourth predetermined rule takes into account the fact that the user erroneously modifies the name of a file, but finds a modification error and modifies the file name as it is. The end result is that the file system has not changed, so you can delete both events.
  • the first parameter is the target file name and the second parameter is the rename event of the temporary file name
  • the one or more parameters are the modification event of the target file name. If the parameter is a delete event of the temporary file name, these events can be combined into one modification event whose parameter is the target file name.
  • the fifth predetermined rule applies to the case where when a file needs to be continuously modified, due to an error in the modification of the file, a temporary file of the file is copied first, and then the file is continuously modified. When the file modification is successful, delete the temporary file that was originally copied. For a synchronous system, the end result is that the file has been modified, so event consolidation is required.
  • step S320 the predetermined rules are sequentially and cyclically processed until the events cannot be processed by any predetermined rules.
  • the event is first processed according to each predetermined rule in turn, after the first round of processing, and then The event is processed in turn according to each predetermined rule until the event cannot be optimized according to a predetermined rule.
  • the processed file change event and associated file data are transmitted to the server 130 together in step S330 to replay the event on the server 130, thereby Sync to server 130.
  • the method 300 further includes a triggering step. This step, when executed, instructs the computing device to perform steps S320 and S330 described above to process the file change event generated in step S310 since the last time it was triggered.
  • the triggering step is used to trigger execution of steps S320 and S330 to process the file change event and clear the processed file change event, while step S310 continues to generate a new, pending file change event.
  • the triggering step can be triggered periodically, for example every 5 seconds or every 30 seconds.
  • the triggering step can also be triggered by the user, that is, triggered according to the user's operation.
  • the file transfer method 300 analyzes file changes in the computing device according to a predetermined rule before transmitting the file of the computing device to the server, thereby removing some unnecessary intermediate file transfer, thereby improving the efficiency of file transfer.
  • 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 positioned differently than the devices in this example. In one or more devices.
  • the modules in the foregoing examples can be combined into one
  • the modules can be further divided into a plurality of submodules.
  • modules in the devices of the embodiments can be adaptively changed and placed 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 further they may be divided into a plurality of sub-modules or sub-units or sub-components.
  • any combination of the features disclosed in the specification, including the accompanying claims, the abstract and the drawings, and any methods so disclosed, or All processes or units of the device are combined.
  • Each feature disclosed in this specification (including the accompanying claims, the abstract and the drawings) may be replaced by alternative features that provide the same, equivalent or similar purpose.
  • the various component embodiments of the present invention may be implemented in hardware, or in a software module running on one or more processors, or in a combination thereof.
  • a microprocessor or digital signal processor may be used in practice to implement some or all of the functionality of some or all of the components of a file transfer device in accordance with embodiments of the present invention.
  • the invention can also be implemented as a device or device program (such as a computer program and a computer program product) for performing some or all of the methods described herein.
  • Such a program implementing the invention may be stored on a computer readable medium or may be in the form of one or more signals. Such signals may be downloaded from an Internet website, provided on a carrier signal, or provided in any other form.
  • FIG. 4 illustrates an electronic device in which the file transfer method of the present invention can be implemented.
  • the electronic device conventionally includes a processor 410 and a computer program product or computer readable medium in the form of a memory 420.
  • the memory 420 may be an electronic memory such as a flash memory, an EEPROM (Electrically Erasable Programmable Read Only Memory), an EPROM, a hard disk, or a ROM.
  • Memory 420 has a memory space 430 for program code 431 for performing any of the method steps described above.
  • storage space 430 for program code may include various program code 431 for implementing various steps in the above methods, respectively.
  • These program code can be read from or written to one or more computer program products or Among several computer program products.
  • These computer program products include program code carriers such as hard disks, compact disks (CDs), memory cards or floppy disks. Such computer program products are typically portable or fixed storage units as described with reference to FIG.
  • the storage unit may have a storage section or a storage space or the like arranged similarly to the storage 420 in the electronic device of FIG.
  • the program code can be compressed, for example, in an appropriate form.
  • the storage unit comprises a program 431' for performing the steps of the method according to the invention, ie a code readable by a processor, such as 410, which, when executed by the electronic device, causes the electronic device to perform the above Each step in the described method.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

本发明公开了一种文件传输设备,该文件传输设备驻留在计算设备上,适于将计算设备上的文件传输到服务器,该文件传输设备包括:文件监视器,适于监视在计算设备中的各种文件变化,并生成相应的文件变化事件;事件处理器,适于根据预定规则对文件监视器生成的文件变化事件进行处理;以及通信单元,适于将经事件处理器处理后的一个或者多个文件变化事件以及相关联的文件数据一起传输到服务器。本发明还公开了对应的文件传输方法和网络存储系统。

Description

一种文件传输方法、设备以及相关系统 技术领域
本发明涉及计算机和互联网领域,尤其涉及在网络中的数据同步技术。
背景技术
随着互联网络和计算机的普及,人们在生活和工作中一般都会拥有多个计算设备,例如,在工作单位至少会使用一台计算机,而在家中还会使用另一台计算机,而在外出或者娱乐时会使用各种移动计算设备如平板或者智能手机等。为了统一管理这些计算设备中的文件,出现了网络存储系统。如图1所示,一个典型的网络存储系统可以包括第一计算设备110、第二计算设备120,及存储服务器130。第一计算设备110和第二计算设备120分别经由网络与存储服务器130进行通信。计算设备110和120分别在本地监控相应目录下的文件变化情况。举例来说,当第一计算设备110检测到其某个目录中的文件发生变化时,就会与存储服务器130进行交互,将发生变化的文件及其数据上传至存储服务器130,而当第二计算设备120与存储服务器130进行交互时,可以将存储服务器130中新存储的、在第一计算设备110中发生变化的文件及其数据自动下载至第二计算设备120的本地相应目录中,从而实现了在各个计算终端中相关文件的同步。
但是,在本地计算设备中,各种应用程序在执行过程中会产生大量的中间文件变化过程,例如,当计算设备运行微软公司的Word字处理软件时,在对word文件进行编辑的过程中会产生许多的临时中间文件,同时在保存word文件时也会引发多次文件修改事件。这是应用程序为了保证word文件的安全而采取的方式,但是对于网络存储系统来说,这会导致数据同步低效的问题。这是因为,根据现有的网络同步存储机制,在计算终端上每次对文件的修改都会将所修改的内容传输到存储服务器,计算终端会记录完整的文件变化过程并在存储服务器上进行重放,而对于同步存储系统而言,所关注的文件信息是修改完成后的内容,而不是修改过程,因此这会导致计算终端与存储服务器之间无用的频繁交互,降低了整个网络存储系统的性能。因此需要一种能够减少无效数据传输的文件传输方案以提高整个网络存储系统的效率。
发明内容
为此,本发明提供一种新的方案以力图解决或者至少缓解上面存在的问 题。
根据本发明的一个方面,提供了一种文件传输设备,该文件传输设备驻留在计算设备上,适于将计算设备上的文件传输到服务器,该文件传输设备包括:文件监视器,适于监视在计算设备中的各种文件变化,并生成相应的文件变化事件;事件处理器,适于根据预定规则对文件监视器生成的文件变化事件进行处理;以及通信单元,适于将经事件处理器处理后的一个或者多个文件变化事件以及相关联的文件数据一起传输到服务器。
可选地,文件变化事件可以分为创建事件、删除事件、修改事件和重命名事件,其中所述创建事件、删除事件和修改事件的参数为涉及的文件名,以及重命名事件具有重命名前的文件名作为第一参数和重命名后的文件名作为第二参数。
可选地,根据本发明的文件传输设备还包括同步触发器,适于在被触发时,指示事件处理器对上次被触发以来文件监视器生成的文件变化事件进行处理,并指示通信单元传输数据。
根据本发明的另一个方面,提供了一种文件传输方法,该方法适于将计算设备上的文件传输到服务器,该文件传输方法包括步骤:监视在计算设备中的各种文件变化,并生成相应的文件变化事件;根据预定规则对所生成的文件变化事件进行处理;以及将经处理后的一个或者多个文件变化事件以及相关联的文件数据一起传输到服务器。
可选地,文件变化事件可以分为创建事件、删除事件、修改事件和重命名事件,其中所述创建事件、删除事件和修改事件的参数为涉及的文件名,以及重命名事件具有重命名前的文件名作为第一参数和重命名后的文件名作为第二参数。
可选地,根据本发明的文件传输方法还包括触发步骤,适于定期或者应用户的请求触发来执行所述处理文件变化事件的步骤,以对上次被触发以来所生成的文件变化事件进行处理。
根据本发明的还有一个方面,提供了一种网络存储系统,包括:服务器;以及多个计算设备,每个计算设备包括根据本发明的文件传输设备,以便将计算设备上的文件传输到服务器中。
根据本发明的另一个方面,提供了一种计算机程序,其包括计算机可读代码,当电子设备运行所述计算机可读代码时,导致所述的文件传输方法方法被执行。
根据本发明的再一个方面,提供了一种计算机可读介质,其中存储了如上所述的计算机程序。
根据本发明的文件传输方案,在将计算设备的文件传输到服务器之前,根据预定规则对计算设备中的文件变化情况进行分析,去除一些不必要的中间文件传输,从而提高了文件传输的效率。
附图说明
为了实现上述以及相关目的,本文结合下面的描述和附图来描述某些说明性方面,这些方面指示了可以实践本文所公开的原理的各种方式,并且所有方面及其等效方面旨在落入所要求保护的主题的范围内。通过结合附图阅读下面的详细描述,本公开的上述以及其它目的、特征和优势将变得更加明显。遍及本公开,相同的附图标记通常指代相同的部件或元素。
图1示出了根据本发明的网络存储系统的示意图;
图2示出了根据本发明一个实施例的文件传输设备的示意图;
图3示出了根据本发明一个实施例的文件传输方法的示意图;
图4示出了用于执行本发明的方法的电子设备的框图;以及
图5示出了用于保持或者携带实现根据本发明的方法的程序代码的存储单元示意图。
具体实施方式
下面将参照附图更详细地描述本公开的示例性实施例。虽然附图中显示了本公开的示例性实施例,然而应当理解,可以以各种形式实现本公开而不应被这里阐述的实施例所限制。相反,提供这些实施例是为了能够更透彻地理解本公开,并且能够将本公开的范围完整的传达给本领域的技术人员。
下面将参照附图更详细地描述本公开的示例性实施例。虽然附图中显示了本公开的示例性实施例,然而应当理解,可以以各种形式实现本公开而不应被这里阐述的实施例所限制。相反,提供这些实施例是为了能够更透彻地理解本公开,并且能够将本公开的范围完整的传达给本领域的技术人员。
本发明可以在图1所示的网络存储系统中实施,如图1所示,网络存储系统可以包括第一计算设备110、第二计算设备120,及存储服务器130。第一计算设备110和第二计算设备120分别经由网络与存储服务器130进行通信。第一和第二计算设备中包括根据本发明的文件传输设备,用于将计算设备中的文件传输到存储服务器130中进行集中存储。
图2示出了根据本发明一个实施例的文件传输设备的示意图。如图2所示,文件传输设备200包含在图1所示的第一计算设备110和第二计算设备120的任一个中,用于将这些计算设备中的文件传输到服务器130上并存储在其中。服 务器130随后可以将这些文件传输到其它还没有这些文件的计算设备中,从而实现文件的同步。
在本发明中,第一和第二计算设备110和120可以是本领域任何可以处理电子数据的设备,包括但不限于桌面型计算机、笔记本式计算机、个人数字助理、智能移动终端、平板电脑等。计算设备110和120中通常运行现代的操作系统,利用操作系统来管理计算设备中的硬件资源。计算设备110和120可以在操作系统上运行各种应用。本发明中的文件传输设备200可以作为一种应用而在计算设备110和120上运行。当然取决于在计算设备上运行的操作系统的不同,文件传输设备200的实现方式也有所不同,本发明不受限于文件传输设备200为了适应不同操作系统才采用的各种实现,而仅仅受限于文件传输设备200实现本发明的功能而必须具有的实现逻辑。
如图2所示,文件传输设备200包括文件监视器210、事件处理器220和通信单元230。文件监视器210对计算设备110中的各种文件变化,例如创建文件、删除文件、移动文件和修改文件内容等进行监视。如上所述,当文件传输设备200作为应用在操作系统上运行时,操作系统通常提供了文件操作接口。根据一种实现方式,文件监视器210可以通过在这些文件操作接口上添加钩子(HOOK),就可以准确地获悉在计算设备110中的文件变化。可选地,由于计算设备110并不希望将计算设备上的所有文件都同步到其它计算设备中,因此计算设备110通常会指定一个或者多个要进行文件同步的文件目录,此时文件监视器210仅监视这些文件目录。
文件监视器210在监视到文件的变化时,可以生成相应的文件变化事件,并且按照时间顺序来存储这些文件变化事件。如上所述,文件监视器210可以通过在操作系统的文件操作接口上添加钩子来监视文件的变化,因此文件监视器210可以在文件发生变化时,生成反映该文件变化内容的详细信息的文件变化事件。根据一种实现方式,每个文件变化事件包括事件生成时间、动作类型和参数。动作类型包括创建、删除、修改和重命名,相应地,可以将文件变化事件分类为创建事件、删除事件、修改事件和重命名事件。对于创建事件、删除事件和修改事件,文件变化事件的参数为所涉及的文件名;而对于重命名事件,文件变化事件的参数包括重命名前的文件名作为第一参数和重命名后的文件名作为第二参数。
例如,当创建一个文件名为a.doc的文件时,会生成一个创建事件,其参数为a.doc。当删除一个文件名为b.bak的文件时,会生成一个删除事件,其参数为b.bak。当把一个文件从文件名a.doc修改为tmp时,会生成一个重命名事件,其第一参数为a.doc且第二参数为tmp。
事件处理器220耦接到文件监视器210,对文件监视器210生成的一系列文件变化事件进行处理。将计算设备上的文件同步复制到服务器130上的一种最直接方式是,将这些文件变化事件在服务器130上以相同的次序进行重放,即在服务器130上重新执行文件变化过程,这样就可以确保完整地将文件复制到服务器上。由于文件监视器210针对每个文件变化操作都生成一个文件变化事件,如果直接在服务器上重放这些事件,会导致大量在计算设备和服务器之间的文件传输。因此,在将这些事件在服务器130上进行重放之前,由事件处理器220根据预定规则对文件监视器210生成的文件变化事件进行处理有助于减少在计算设备和服务器130之间不必要的数据传输。
可以设置多种预定规则,这些规则通常可以会考虑多个文件操作的最终结果。
根据本发明的第一个预定规则是,如果存在多个具有相同参数的修改事件,则合并为一个参数相同的修改事件。例如当在计算设备上对一个文件进行了多次修改时(例如多次编辑图形文件),会产生多次修改事件,但是其最终结果是存储最后的文件,因此可以将多次修改事件合并为一个修改事件。
根据本发明的第二个预定规则是,如果存在下列先后顺序的事件:参数为临时文件名的创建事件、第一参数为目标文件名且第二参数为备份文件名的改名事件、第一参数为临时文件名且第二参数为目标文件名的改名事件以及参数为备份文件名的删除事件,则将这些事件合并为参数为目标文件名的修改事件。
第二个预定规则适用于这样的情况,其中在计算设备上运行各种编辑文件的应用时,需要保存文件,为了确保文件保存过程可靠地执行,通常这些应用会采用下面处理来保存目标文件:首先将要保存的内容写入到一个临时文件中,接着将目标文件改名为备份文件,随后将临时文件改名为目标文件,如果这些步骤的执行都成功了,则删除备份文件。由于网络存储系统仅仅是在目标文件可靠保存后才上传目标文件,因此没有必要在服务器上重放全部四个事件,而是简单地重放一个更新目标文件的事件即可。
以微软的word字处理软件为例,当用户利用该字处理软件对word文件(例如a.doc)进行编辑时,需要在编辑过程中保存word文件,此时字处理软件会进行以下文件操作,首先把当然编辑中文本存储为一个.tmp文件,随后将要保存的文件即a.doc文件改名为a.bak文件,随后将.tmp文件改名为a.doc文件,在一切操作无误后,删除a.bak文件。但是对于用户来说,就是一次存储a.doc的操作,而当需要将相关文件上传到服务器上时,也仅仅需要将更新后的a.doc传输到服务器,而不用传输各种tmp和bak文件。
根据本发明的第三个预定规则是,如果存在下面两个先后顺序的事件:参数为临时文件名的创建事件以及第一参数为临时文件名而第二参数为目标文件名的改名事件,
则可以将这两个事件合并为一个参数为目标文件名的创建事件。
第三个预定规则适用于这样的例子,例如用户首先创建了一个名称为a.doc,然而发现名称输入错误,则将该文件名称修改为b.doc。此时对于文件同步来说,最终结果是创建了一个名称为b.doc的文件,因此可以将这两个事件进行合并。
根据本发明的第四个预定规则是,如果存在下面两个先后顺序的事件:第一参数为目标文件名且第二参数为临时文件名的改名事件,以及第一参数为临时文件名且第二参数为目标文件名的改名事件,则可以删除这两个事件。
第四个预定规则考虑到这样的情况,用户错误地修改了一个文件的名称,但是发现修改错误,又把文件名称修改成原样。此时最终结果是文件系统没有发生任何改变,因此可以删除这两个事件。
根据本发明的第五个预定规则是,如果存在以下先后顺序的事件:第一参数为目标文件名且第二参数为临时文件名的改名事件、一个或者多个参数为目标文件名的修改事件、参数为临时文件名的删除事件,则可以将这些事件合并为一个参数为目标文件名的修改事件。
第五个预定规则适用于这样的情况,当需要对一个文件进行持续修改时,由于担心该文件修改过程中发生错误,先复制一份该文件的临时文件,然后对该文件持续进行修改,当文件修改成功时,删除原先复制的临时文件。对于同步系统来说,最终的结果就是对该文件进行了修改,因此需要进行事件合并处理。
当存在多个预定规则时,事件处理器220会顺序并循环利用预定规则进行处理,直到事件不能由任何预定规则进行处理为止。例如,当事件处理器220会首先依次根据各个预定规则来对事件进行处理,在进行了第一轮处理之后,再次依次根据各个预定规则对事件进行处理,直到事件不能根据预定规则进行优化为止。在由事件处理器220对文件监视器210生成的事件进行处理之后,耦接到事件处理器220的通信单元230将经过处理后的文件变化事件以及相关联的文件数据一起传输到服务器130,以便在服务器130上对事件进行重放,从而将文件同步到服务器130上。
如上所述,在文件传输设备200中,会以文件监视器210生成的文件变化事件为基本处理单位来进行文件传输处理。由于在计算设备上涉及文件的操作是现代操作系统中最频繁的操作,因此文件监视器210会生成大量的文件变化事 件。为了保证计算设备和服务器之间的文件内容同步,需要以恰当的时机来进行文件传输,因此,根据本发明的一个实施方式,文件传输设备200包括同步触发器240。同步触发器240在被触发时,指示事件处理器220对从上次被触发以来文件监视器210生成的文件变化事件进行处理,并同时指示通信单元230根据事件处理器220处理后的文件变化事件来将相关数据发送到服务器130上进行重放以便同步存储相应文件。
文件监视器210生成的文件变化事件经过处理之后,就会从文件监视器210中清除,随后文件监视器210继续监视相关文件目录,并生成新的文件变化事件。当同步触发器240再次被触发时,又会指示事件处理器220处理文件变化事件并清除已处理的文件变化事件。通过上述循环处理,实现了文件在计算设备和服务器之间的持续同步。
根据一个实施方式,同步触发器240可以被定时触发,例如每隔5秒钟或者每隔30秒钟被定时触发。另外,同步触发器240也可以由用户来触发,即根据用户的操作来触发。
根据本发明的文件传输设备200在将计算设备的文件传输到服务器之前,根据预定规则对计算设备中的文件变化情况进行分析,去除一些不必要的中间文件传输,从而提高了文件传输的效率。
图3示出了根据本发明一个实施例的文件传输方法300的示意图。图3所示的文件传输方法300适于在图1中的计算设备110或者120中执行,以便将计算设备中的文件同步到服务器130中。根据一个实施例,该文件传输方法300可以由图2所示的文件传输设备200来执行。
方法300始于步骤S310,在步骤S310中,对计算设备110中的各种文件变化,例如创建文件、删除文件、移动文件和修改文件内容等进行监视。如上所述,计算设备中的操作系统通常提供了文件操作接口。根据一种实现方式,在步骤S310中,可以通过在这些文件操作接口上添加钩子(HOOK),就可以准确地获悉在计算设备110中的文件变化。可选地,由于计算设备110并不希望将计算设备上的所有文件都同步到其它计算设备中,因此计算设备110通常会指定一个或者多个要进行文件同步的文件目录,此时在步骤S310中仅监视这些文件目录。
当在步骤S310中监视到文件的变化时,可以生成相应的文件变化事件,并且按照时间顺序来存储这些文件变化事件。如上所述,可以通过在操作系统的文件操作接口上添加钩子来监视文件的变化,因此在步骤S310中,可以在文件发生变化时,生成反映该文件变化内容的详细信息的文件变化事件。根据一种实现方式,每个文件变化事件包括事件生成时间、动作类型和参数。动作类型 包括创建、删除、修改和重命名,相应地,可以将文件变化事件分类为创建事件、删除事件、修改事件和重命名事件。对于创建事件、删除事件和修改事件,文件变化事件的参数为所涉及的文件名;而对于重命名事件,文件变化事件的参数包括重命名前的文件名作为第一参数和重命名后的文件名作为第二参数。
例如,当创建一个文件名为a.doc的文件时,会生成一个创建事件,其参数为a.doc。当删除一个文件名为b.bak的文件时,会生成一个删除事件,其参数为b.bak。当把一个文件从文件名a.doc修改为tmp时,会生成一个重命名事件,其第一参数为a.doc且第二参数为tmp。在步骤S310中生成一系列文件变化事件之后,在步骤S320中,对这些文件变化事件进行处理。将计算设备上的文件同步复制到服务器130上的一种最直接方式是,将这些文件变化事件在服务器130上以相同的次序进行重放,即在服务器130上重新执行文件变化过程,这样就可以确保完整地将文件复制到服务器上。由于在步骤S310中,针对每个文件变化操作都生成一个文件变化事件,如果直接在服务器上重放这些事件,会导致大量在计算设备和服务器之间的文件传输。因此,在将这些事件在服务器130上进行重放之前,在步骤S320中,根据预定规则对文件监视器210生成的文件变化事件进行处理有助于减少在计算设备和服务器130之间不必要的数据传输。
可以设置多种预定规则,这些规则通常可以会考虑多个文件操作的最终结果。
根据本发明的第一个预定规则是,如果存在多个具有相同参数的修改事件,则合并为一个参数相同的修改事件。例如当在计算设备上对一个文件进行了多次修改时(例如多次编辑图形文件),会产生多次修改事件,但是其最终结果是存储最后的文件,因此可以将多次修改事件合并为一个修改事件。
根据本发明的第二个预定规则是,如果存在下列先后顺序的事件:参数为临时文件名的创建事件、第一参数为目标文件名且第二参数为备份文件名的改名事件、第一参数为临时文件名且第二参数为目标文件名的改名事件以及参数为备份文件名的删除事件,则将这些事件合并为参数为目标文件名的修改事件。
第二个预定规则适用于这样的情况,其中在计算设备上运行各种编辑文件的应用时,需要保存文件,为了确保文件保存过程可靠地执行,通常这些应用会采用下面处理来保存目标文件:首先将要保存的内容写入到一个临时文件中,接着将目标文件改名为备份文件,随后将临时文件改名为目标文件,如果这些步骤的执行都成功了,则删除备份文件。由于网络存储系统仅仅是在目标文件可靠保存后才上传目标文件,因此没有必要在服务器上重放全部四个事 件,而是简单地重放一个更新目标文件的事件即可。
以微软的word字处理软件为例,当用户利用该字处理软件对word文件(例如a.doc)进行编辑时,需要在编辑过程中保存word文件,此时字处理软件会进行以下文件操作,首先把当然编辑中文本存储为一个.tmp文件,随后将要保存的文件即a.doc文件改名为a.bak文件,随后将.tmp文件改名为a.doc文件,在一切操作无误后,删除a.bak文件。但是对于用户来说,就是一次存储a.doc的操作,而当需要将相关文件上传到服务器上时,也仅仅需要将更新后的a.doc传输到服务器,而不用传输各种tmp和bak文件。
根据本发明的第三个预定规则是,如果存在下面两个先后顺序的事件:参数为临时文件名的创建事件以及第一参数为临时文件名而第二参数为目标文件名的改名事件,则可以将这两个事件合并为一个参数为目标文件名的创建事件。
第三个预定规则适用于这样的例子,例如用户首先创建了一个名称为a.doc,然而发现名称输入错误,则将该文件名称修改为b.doc。此时对于文件同步来说,最终结果是创建了一个名称为b.doc的文件,因此可以将这两个事件进行合并。
根据本发明的第四个预定规则是,如果存在下面两个先后顺序的事件:第一参数为目标文件名且第二参数为临时文件名的改名事件,以及第一参数为临时文件名且第二参数为目标文件名的改名事件,则可以删除这两个事件。
第四个预定规则考虑到这样的情况,用户错误地修改了一个文件的名称,但是发现修改错误,又把文件名称修改成原样。此时最终结果是文件系统没有发生任何改变,因此可以删除这两个事件。
根据本发明的第五个预定规则是,如果存在以下先后顺序的事件:第一参数为目标文件名且第二参数为临时文件名的改名事件、一个或者多个参数为目标文件名的修改事件、参数为临时文件名的删除事件,则可以将这些事件合并为一个参数为目标文件名的修改事件。
第五个预定规则适用于这样的情况,当需要对一个文件进行持续修改时,由于担心该文件修改过程中发生错误,先复制一份该文件的临时文件,然后对该文件持续进行修改,当文件修改成功时,删除原先复制的临时文件。对于同步系统来说,最终的结果就是对该文件进行了修改,因此需要进行事件合并处理。
当存在多个预定规则时,在步骤S320中,会顺序并循环利用预定规则进行处理,直到事件不能由任何预定规则进行处理为止。例如,在步骤S320中,会首先依次根据各个预定规则来对事件进行处理,在进行了第一轮处理之后,再 次依次根据各个预定规则对事件进行处理,直到事件不能根据预定规则进行优化为止。在步骤S320对所生成的事件进行处理之后,在步骤S330中将经过处理后的文件变化事件以及相关联的文件数据一起传输到服务器130,以便在服务器130上对事件进行重放,从而将文件同步到服务器130上。
由于在计算设备上涉及文件的操作是现代操作系统中最频繁的操作,因此在步骤S310中会生成大量的文件变化事件。为了保证计算设备和服务器之间的文件内容同步,需要以恰当的时机来进行文件传输,因此,根据本发明的一个实施方式,方法300还包括触发步骤。该步骤在执行时会指示计算设备来执行上述步骤S320和S330,以便对从上次被触发以来步骤S310中生成的文件变化事件进行处理。
利用触发步骤来触发执行步骤S320和S330以处理文件变化事件并清除已处理的文件变化事件,而步骤S310继续生成新的、待处理的文件变化事件。通过这样的循环处理,实现了文件在计算设备和服务器之间的持续同步。
根据一个实施方式,触发步骤可以被定时触发,例如每隔5秒钟或者每隔30秒钟被定时触发。另外,触发步骤也可以由用户来触发,即根据用户的操作来触发。
根据本发明的文件传输方法300在将计算设备的文件传输到服务器之前,根据预定规则对计算设备中的文件变化情况进行分析,去除一些不必要的中间文件传输,从而提高了文件传输的效率。
在此处所提供的说明书中,说明了大量具体细节。然而,能够理解,本发明的实施例可以在没有这些具体细节的一部分或者全部的情况下被实践。在一些实例中,并未详细示出公知的方法、结构和技术,以便不模糊对本说明书的理解。
类似地,应当理解,为了精简本公开并帮助理解各个发明方面中的一个或多个,在上面对本发明的示例性实施例的描述中,本发明的各个特征有时被一起分组到单个实施例、图、或者对其的描述中。然而,并不应将该公开的方法解释成反映如下意图:即所要求保护的本发明要求比在每个权利要求中所明确记载的特征更多特征。更确切地说,如下面的权利要求书所反映的那样,发明方面在于少于前面公开的单个实施例的所有特征。因此,遵循具体实施方式的权利要求书由此明确地并入该具体实施方式,其中每个权利要求本身都作为本发明的单独实施例。
本领域那些技术人员应当理解在本文所公开的示例中的设备的模块或单元或组件可以布置在如该实施例中所描述的设备中,或者可替换地可以定位在与该示例中的设备不同的一个或多个设备中。前述示例中的模块可以组合为一 个模块或者此外可以分成多个子模块。
本领域那些技术人员可以理解,可以对实施例中的设备中的模块进行自适应性地改变并且把它们设置在与该实施例不同的一个或多个设备中。可以把实施例中的模块或单元或组件组合成一个模块或单元或组件,以及此外可以把它们分成多个子模块或子单元或子组件。除了这样的特征和/或过程或者单元中的至少一些是相互排斥之外,可以采用任何组合对本说明书(包括伴随的权利要求、摘要和附图)中公开的所有特征以及如此公开的任何方法或者设备的所有过程或单元进行组合。除非另外明确陈述,本说明书(包括伴随的权利要求、摘要和附图)中公开的每个特征可以由提供相同、等同或相似目的的替代特征来代替。
此外,本领域的技术人员能够理解,尽管在此所述的一些实施例包括其它实施例中所包括的某些特征而不是其它特征,但是不同实施例的特征的组合意味着处于本发明的范围之内并且形成不同的实施例。例如,在下面的权利要求书中,所要求保护的实施例的任意之一都可以以任意的组合方式来使用。
此外,所述实施例中的一些在此被描述成可以由计算机系统的处理器或者由执行所述功能的其它装置实施的方法或方法元素的组合。因此,具有用于实施所述方法或方法元素的必要指令的处理器形成用于实施该方法或方法元素的装置。此外,装置实施例的在此所述的元素是如下装置的例子:该装置用于实施由为了实施该发明的目的的元素所执行的功能。
本发明的各个部件实施例可以以硬件实现,或者以在一个或者多个处理器上运行的软件模块实现,或者以它们的组合实现。本领域的技术人员应当理解,可以在实践中使用微处理器或者数字信号处理器(DSP)来实现根据本发明实施例的文件传输设备中的一些或者全部部件的一些或者全部功能。本发明还可以实现为用于执行这里所描述的方法的一部分或者全部的设备或者装置程序(如计算机程序和计算机程序产品)。这样的实现本发明的程序可以存储在计算机可读介质上,或者可以具有一个或者多个信号的形式。这样的信号可以从因特网网站上下载得到,或者在载体信号上提供,或者以任何其他形式提供。
例如,图4示出了可以实现本发明的文件传输方法的电子设备。该电子设备传统上包括处理器410和以存储器420形式的计算机程序产品或者计算机可读介质。存储器420可以是诸如闪存、EEPROM(电可擦除可编程只读存储器)、EPROM、硬盘或者ROM之类的电子存储器。存储器420具有用于执行上述方法中的任何方法步骤的程序代码431的存储空间430。例如,用于程序代码的存储空间430可以包括分别用于实现上面的方法中的各种步骤的各个程序代码431。这些程序代码可以从一个或者多个计算机程序产品中读出或者写入到这一个或 者多个计算机程序产品中。这些计算机程序产品包括诸如硬盘,紧致盘(CD)、存储卡或者软盘之类的程序代码载体。这样的计算机程序产品通常为如参考图5所述的便携式或者固定存储单元。该存储单元可以具有与图4的电子设备中的存储器420类似布置的存储段或者存储空间等。程序代码可以例如以适当形式进行压缩。通常,存储单元包括用于执行根据本发明的方法步骤的程序431’,即可以由例如诸如410之类的处理器读取的代码,这些代码当由电子设备运行时,导致该电子设备执行上面所描述的方法中的各个步骤。
本文中所称的“一个实施例”、“实施例”或者“一个或者多个实施例”意味着,结合实施例描述的特定特征、结构或者特性包括在本发明的至少一个实施例中。此外,请注意,这里“在一个实施例中”的词语例子不一定全指同一个实施例。
如在此所使用的那样,除非另行规定,使用序数词“第一”、“第二”、“第三”等等来描述普通对象仅仅表示涉及类似对象的不同实例,并且并不意图暗示这样被描述的对象必须具有时间上、空间上、排序方面或者以任意其它方式的给定顺序。
应该注意的是,上述实施例对本发明进行的详细说明并不是对本发明进行限制,并且本领域技术人员在不脱离所附权利要求的范围的情况下可设计出替换实施例。在权利要求中,不应将位于括号之间的任何参考符号构造成对权利要求的限制。单词“包含”或“包括”不排除存在未列在权利要求中的元件或步骤。位于元件之前的单词“一”或“一个”不排除存在多个这样的元件。本发明可以借助于包括有若干不同元件的硬件以及借助于适当编程的计算机来实现。在列举了若干装置的单元权利要求中,这些装置中的若干个可以是通过同一个硬件项来具体体现。单词第一、第二、以及第三等的使用不表示任何顺序。可将这些单词解释为名称。
尽管根据有限数量的实施例描述了本发明,但是受益于上面的描述,本技术领域内的技术人员明白,在由此描述的本发明的范围内,可以设想其它实施例。此外,应当注意,本说明书中使用的语言主要是为了可读性和教导的目的而选择的,而不是为了解释或者限定本发明的主题而选择的。因此,在不偏离所附权利要求书的范围和精神的情况下,对于本技术领域的普通技术人员来说许多修改和变更都是显而易见的。对于本发明的范围,对本发明所做的公开是说明性的,而非限制性的,本发明的范围由所附权利要求书限定。

Claims (20)

  1. 一种文件传输设备,该文件传输设备驻留在计算设备上,适于将计算设备上的文件传输到服务器,该文件传输设备包括:
    文件监视器,适于监视在计算设备中的各种文件变化,并生成相应的文件变化事件;
    事件处理器,适于根据预定规则对所述文件监视器生成的文件变化事件进行处理;以及
    通信单元,适于将经所述事件处理器处理后的一个或者多个文件变化事件以及相关联的文件数据一起传输到服务器。
  2. 如权利要求1所述的文件传输设备,还包括同步触发器,适于在被触发时,指示事件处理器对上次被触发以来文件监视器生成的文件变化事件进行处理,并指示通信单元传输数据。
  3. 如权利要求1或者2所述的文件传输设备,其中文件变化事件可以分为创建事件、删除事件、修改事件和重命名事件,其中所述创建事件、删除事件和修改事件的参数为涉及的文件名,以及重命名事件具有重命名前的文件名作为第一参数和重命名后的文件名作为第二参数。
  4. 如权利要求3所述的文件传输设备,其中所述预定规则包括:如果存在下列先后顺序的事件:参数为临时文件名的创建事件、第一参数为目标文件名且第二参数为备份文件名的改名事件、第一参数为临时文件名且第二参数为目标文件名的改名事件以及参数为备份文件名的删除事件,则将这些事件合并为参数为目标文件名的修改事件。
  5. 如权利要求3所述的文件传输设备,其中所述预定规则包括:如果存在下面两个先后顺序的事件:参数为临时文件名的创建事件以及第一参数为临时文件名而第二参数为目标文件名的改名事件,则可以将这两个事件合并为一个参数为目标文件名的创建事件。
  6. 如权利要求3所述的文件传输设备,其中所述预定规则包括:如果存在下面两个先后顺序的事件:第一参数为目标文件名且第二参数为临时文件名的改名事件,以及第一参数为临时文件名且第二参数为目标文件名的改名事件,则可以删除这两个事件。
  7. 如权利要求3所述的文件传输设备,其中所述预定规则包括:如果存在以下先后顺序的事件:第一参数为目标文件名且第二参数为临时文件名的改名事件、一个或者多个参数为目标文件名的修改事件、参数为临时文件名的删除事件,则可以将这些事件合并为一个参数为目标文件名的修改事件。
  8. 如权利要求1-7中任一个所述的文件传输设备,其中所述同步触发器被 定期触发或者应用户的请求而触发。
  9. 如权利要求1-8中任一个所述的文件传输设备,其中所述文件监视器适于对计算设备上的预定文件目录进行监视。
  10. 一种文件传输方法,该方法适于将计算设备上的文件传输到服务器,该文件传输方法包括步骤:
    监视在计算设备中的各种文件变化,并生成相应的文件变化事件;
    根据预定规则对所生成的文件变化事件进行处理;以及
    将经处理后的一个或者多个文件变化事件以及相关联的文件数据一起传输到服务器。
  11. 如权利要求10所述的文件传输方法,还包括触发步骤,适于定期或者应用户的请求触发来执行所述处理文件变化事件的步骤,以对上次被触发以来所生成的文件变化事件进行处理。
  12. 如权利要求10或者11所述的文件传输方法,其中文件变化事件可以分为创建事件、删除事件、修改事件和重命名事件,其中所述创建事件、删除事件和修改事件的参数为涉及的文件名,以及重命名事件具有重命名前的文件名作为第一参数和重命名后的文件名作为第二参数。
  13. 如权利要求12所述的文件传输方法,其中所述预定规则包括:如果存在下列先后顺序的事件:参数为临时文件名的创建事件、第一参数为目标文件名且第二参数为备份文件名的改名事件、第一参数为临时文件名且第二参数为目标文件名的改名事件以及参数为备份文件名的删除事件,则将这些事件合并为参数为目标文件名的修改事件。
  14. 如权利要求12所述的文件传输方法,其中所述预定规则包括:如果存在下面两个先后顺序的事件:参数为临时文件名的创建事件以及第一参数为临时文件名而第二参数为目标文件名的改名事件,则可以将这两个事件合并为一个参数为目标文件名的创建事件。
  15. 如权利要求12所述的文件传输方法,其中所述预定规则包括:如果存在下面两个先后顺序的事件:第一参数为目标文件名且第二参数为临时文件名的改名事件,以及第一参数为临时文件名且第二参数为目标文件名的改名事件,则可以删除这两个事件。
  16. 如权利要求12所述的文件传输方法,其中所述预定规则包括:如果存在以下先后顺序的事件:第一参数为目标文件名且第二参数为临时文件名的改名事件、一个或者多个参数为目标文件名的修改事件、参数为临时文件名的删除事件,则可以将这些事件合并为一个参数为目标文件名的修改事件。
  17. 如权利要求10-16中任一个所述的文件传输方法,其中所述监视在计 算设备中的各种文件变化的步骤包括监视所述计算设备上的预定文件目录中的各种文件变化。
  18. 一种网络存储系统,包括:
    服务器;以及
    多个计算设备,每个计算设备包括如权利要求1-9中任一个所述的文件传输设备,以便将计算设备上的文件传输到所述服务器中。
  19. 一种计算机程序,包括计算机可读代码,当电子设备运行所述计算机可读代码运行时,导致权利要求10-17中的任一项权利要求所述的文件传输方法被执行。
  20. 一种计算机可读介质,其中存储了如权利要求19所述的计算机程序。
PCT/CN2014/093361 2013-12-10 2014-12-09 一种文件传输方法、设备以及相关系统 WO2015085901A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201310669935.4A CN103747029A (zh) 2013-12-10 2013-12-10 一种文件传输方法、设备和系统
CN201310669935.4 2013-12-10

Publications (1)

Publication Number Publication Date
WO2015085901A1 true WO2015085901A1 (zh) 2015-06-18

Family

ID=50504016

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2014/093361 WO2015085901A1 (zh) 2013-12-10 2014-12-09 一种文件传输方法、设备以及相关系统

Country Status (2)

Country Link
CN (1) CN103747029A (zh)
WO (1) WO2015085901A1 (zh)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103747029A (zh) * 2013-12-10 2014-04-23 北京奇虎科技有限公司 一种文件传输方法、设备和系统
US10334017B2 (en) * 2015-12-18 2019-06-25 Accenture Global Solutions Limited Tracking a status of a file transfer using feedback files corresponding to file transfer events
CN106155750B (zh) * 2016-07-29 2018-09-07 腾讯科技(深圳)有限公司 一种资源文件的加载方法和装置
CN106371880B (zh) * 2016-09-06 2019-10-11 珠海金山网络游戏科技有限公司 一种资源热加载快速迭代游戏制作的系统和方法
CN110417860A (zh) * 2019-06-21 2019-11-05 深圳壹账通智能科技有限公司 文件传输管理方法、装置、设备及存储介质

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101281543A (zh) * 2008-05-13 2008-10-08 华为技术有限公司 文件同步方法及装置
CN101763421A (zh) * 2009-12-24 2010-06-30 山东中创软件商用中间件股份有限公司 一种文件同步方法和装置
CN102946411A (zh) * 2012-10-15 2013-02-27 北京奇虎科技有限公司 网络同步系统
CN102946410A (zh) * 2012-10-15 2013-02-27 北京奇虎科技有限公司 网络同步方法和装置
CN103747029A (zh) * 2013-12-10 2014-04-23 北京奇虎科技有限公司 一种文件传输方法、设备和系统

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7814068B2 (en) * 2001-11-16 2010-10-12 Gemalto Sa Identifying changed records in a file stored on an electronic token

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101281543A (zh) * 2008-05-13 2008-10-08 华为技术有限公司 文件同步方法及装置
CN101763421A (zh) * 2009-12-24 2010-06-30 山东中创软件商用中间件股份有限公司 一种文件同步方法和装置
CN102946411A (zh) * 2012-10-15 2013-02-27 北京奇虎科技有限公司 网络同步系统
CN102946410A (zh) * 2012-10-15 2013-02-27 北京奇虎科技有限公司 网络同步方法和装置
CN103747029A (zh) * 2013-12-10 2014-04-23 北京奇虎科技有限公司 一种文件传输方法、设备和系统

Also Published As

Publication number Publication date
CN103747029A (zh) 2014-04-23

Similar Documents

Publication Publication Date Title
US11550757B2 (en) Systems and methods for synchronization event building and/or collapsing by a synchronization component of a cloud-based platform
JP7158482B2 (ja) クライアント同期における違反の解決のための方法、コンピュータ可読媒体、及びシステム
TWI740901B (zh) 執行資料恢復操作的方法及裝置
US9977715B2 (en) Techniques to manage collaborative documents
US9396245B2 (en) Race condition handling in a system which incrementally updates clients with events that occurred in a cloud-based collaboration platform
WO2015085901A1 (zh) 一种文件传输方法、设备以及相关系统
CN102402596B (zh) 一种主从分离数据库的读写方法和系统
JP5376696B2 (ja) ステートレスなプロトコルを介したドキュメントの同期
US20150213100A1 (en) Data synchronization method and system
KR101087364B1 (ko) 철회 기반구조
US20140195485A1 (en) File system monitoring in a system which incrementally updates clients with events that occurred in a cloud-based collaboration platform
CN109804361B (zh) 计算系统中的文件同步
CN107004010A (zh) 控制多数据库系统
CN109144785B (zh) 用于备份数据的方法和装置
KR20140079451A (ko) 다수의 소스로부터의 재생 목록의 병합
CN102272751B (zh) 在数据库环境通过背景同步的数据完整性
US20160088077A1 (en) Seamless binary object and metadata sync
CN104461826B (zh) 对象流转监控的方法、装置及系统
TW201351264A (zh) 分散式文檔儲存系統及方法
US20150261766A1 (en) Method and apparatus for determining a range of files to be migrated
KR20180061493A (ko) 데이터베이스 이중화 무중단 정합성 복구 기법
CN106682021B (zh) 数据库迁移方法及装置
JP2012510094A5 (zh)
US20170277742A1 (en) Synchronizing files on different computing devices using file anchors
US20130304772A1 (en) Managing the product of temporary groups in a community

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 14869501

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 14869501

Country of ref document: EP

Kind code of ref document: A1