CN108234539B - File uploading, downloading and transmitting method and device - Google Patents
File uploading, downloading and transmitting method and device Download PDFInfo
- Publication number
- CN108234539B CN108234539B CN201611151740.0A CN201611151740A CN108234539B CN 108234539 B CN108234539 B CN 108234539B CN 201611151740 A CN201611151740 A CN 201611151740A CN 108234539 B CN108234539 B CN 108234539B
- Authority
- CN
- China
- Prior art keywords
- file
- block
- module
- management server
- request
- 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
Links
- 238000000034 method Methods 0.000 title claims abstract description 190
- 230000008569 process Effects 0.000 claims abstract description 43
- 238000012546 transfer Methods 0.000 claims description 45
- 238000012544 monitoring process Methods 0.000 claims description 37
- 238000004422 calculation algorithm Methods 0.000 claims description 29
- 230000005540 biological transmission Effects 0.000 claims description 24
- 238000012790 confirmation Methods 0.000 claims description 24
- 230000011218 segmentation Effects 0.000 claims description 10
- 230000006870 function Effects 0.000 description 80
- 230000003993 interaction Effects 0.000 description 11
- 238000012795 verification Methods 0.000 description 9
- 238000013461 design Methods 0.000 description 7
- 238000010586 diagram Methods 0.000 description 6
- 230000018109 developmental process Effects 0.000 description 4
- 238000009877 rendering Methods 0.000 description 4
- 230000004044 response Effects 0.000 description 4
- 230000006399 behavior Effects 0.000 description 2
- 238000006243 chemical reaction Methods 0.000 description 2
- 238000005316 response function Methods 0.000 description 2
- 230000001960 triggered effect Effects 0.000 description 2
- 238000012937 correction Methods 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 238000011156 evaluation Methods 0.000 description 1
- 238000004880 explosion Methods 0.000 description 1
- 230000006872 improvement Effects 0.000 description 1
- 238000009434 installation Methods 0.000 description 1
- 239000000463 material Substances 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 238000010187 selection method Methods 0.000 description 1
- 239000002699 waste material Substances 0.000 description 1
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/06—Protocols specially adapted for file transfer, e.g. file transfer protocol [FTP]
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/10—Protocols in which an application is distributed across nodes in the network
- H04L67/104—Peer-to-peer [P2P] networks
- H04L67/1074—Peer-to-peer [P2P] networks for supporting data block transmission mechanisms
- H04L67/1078—Resource delivery mechanisms
- H04L67/108—Resource delivery mechanisms characterised by resources being split in blocks or fragments
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/10—Protocols in which an application is distributed across nodes in the network
- H04L67/1097—Protocols in which an application is distributed across nodes in the network for distributed storage of data in networks, e.g. transport arrangements for network file system [NFS], storage area networks [SAN] or network attached storage [NAS]
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Information Transfer Between Computers (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
本发明实施例公开了一种文件上传、下载方法及装置,文件上传方法包括:接收针对目标文件的上传请求;将目标文件按照预设分割规则分割成文件块;在分割好的文件块中确定待上传文件块;向云存储系统的管理服务器发送上传待上传文件块的第一请求,其中,第一请求中包括待上传文件块的数量;接收管理服务器反馈的第一存储位置;根据第一存储位置,上传待上传文件块;在分割好的文件块未全部上传的情况下,从未上传的文件块中选择文件块,将待上传文件块更新为所选择的文件块,并返回执行向云存储系统的管理服务器发送上传待上传文件块的第一请求的步骤,直至分割好的文件块全部上传完成。应用本发明实施例,减少了文件上传过程中的出错机率。
The embodiment of the present invention discloses a file uploading and downloading method and device. The file uploading method includes: receiving an upload request for a target file; dividing the target file into file blocks according to preset dividing rules; File blocks to be uploaded; send a first request for uploading file blocks to be uploaded to the management server of the cloud storage system, wherein the first request includes the number of file blocks to be uploaded; receive a first storage location fed back by the management server; Storage location, upload the file block to be uploaded; if the divided file blocks are not all uploaded, select the file block from the unuploaded file blocks, update the file block to be uploaded to the selected file block, and return to the execution direction. The management server of the cloud storage system sends the first request for uploading the file block to be uploaded until all the divided file blocks are uploaded. By applying the embodiments of the present invention, the probability of errors in the file uploading process is reduced.
Description
技术领域technical field
本发明涉及数据传输领域,特别涉及一种文件上传、下载、传输方法及装置。The invention relates to the field of data transmission, in particular to a method and device for uploading, downloading and transmitting files.
背景技术Background technique
在当前信息爆炸的时代,无时无刻不在都在产生数据信息,同时也在无时无刻不在进行着数据信息的传递、利用等,为了更好地传递或利用这些数据信息,可以将这些数据信息保存下来。数据信息保存的方式有很多种,最常用的方式就是把数据信息保存在文件中,将文件进行保存。这里所说的文件可以为视频文件、音频文件、图片文件、文档文件、网页文件等等。In the current era of information explosion, data information is generated all the time, and at the same time, data information is transmitted and utilized all the time. In order to better transmit or utilize these data information, these data information can be saved. There are many ways to save data information, the most common way is to save the data information in a file and save the file. The files mentioned here can be video files, audio files, picture files, document files, web page files, and so on.
通常情况下,可以将文件保存至存储介质中,但随着需要存储的文件越来越多,而存储介质的存储容量有限,现有的存储的方法已经不能满足实际的需求,通过将文件上传至云存储系统进行保存来解决这一问题。云存储系统是基于云存储技术的一种新兴的网络存储系统,其存储容量可以海量扩容。Normally, files can be saved to a storage medium, but as more and more files need to be stored, and the storage capacity of the storage medium is limited, the existing storage methods can no longer meet the actual needs. Save to the cloud storage system to solve this problem. Cloud storage system is an emerging network storage system based on cloud storage technology, and its storage capacity can be massively expanded.
将文件上传至云存储系统的方法是向云存储系统的管理服务器发送上传文件的请求,在接收到管理服务器反馈的该文件的存储位置后,将文件上传至该存储位置,该存储位置是文件在云存储系统中的存储服务器中的存储位置。由于在上传的过程中,是整个文件上传,上传的时间比较长,出错的机率很大,可能会导致文件的损坏或上传失败等情况的发生。The method of uploading a file to the cloud storage system is to send a request for uploading the file to the management server of the cloud storage system, and after receiving the storage location of the file fed back by the management server, upload the file to the storage location, and the storage location is the file. The storage location in the storage server in the cloud storage system. Since the whole file is uploaded during the uploading process, the uploading time is relatively long, and there is a high probability of errors, which may lead to file damage or upload failure.
发明内容SUMMARY OF THE INVENTION
本发明实施例的目的在于提供一种文件上传、下载、传输方法及装置,以减少文件上传过程中的出错机率。The purpose of the embodiments of the present invention is to provide a file uploading, downloading, and transmitting method and device, so as to reduce the probability of errors in the file uploading process.
第一方面,为达到上述目的,本发明实施例公开了一种文件上传方法。方法包括:In a first aspect, in order to achieve the above object, an embodiment of the present invention discloses a file uploading method. Methods include:
接收针对目标文件的上传请求;Receive upload requests for target files;
将所述目标文件按照预设分割规则分割成文件块;The target file is divided into file blocks according to a preset division rule;
在分割好的文件块中确定待上传文件块;Determine the file block to be uploaded in the divided file block;
向云存储系统的管理服务器发送上传所述待上传文件块的第一请求,其中,所述第一请求中包括所述待上传文件块的数量;sending a first request for uploading the file blocks to be uploaded to the management server of the cloud storage system, wherein the first request includes the number of the file blocks to be uploaded;
接收所述管理服务器反馈的第一存储位置,其中,所述第一存储位置为所述待上传文件块在云存储系统的存储服务器中的存储位置;receiving the first storage location fed back by the management server, wherein the first storage location is the storage location of the to-be-uploaded file block in the storage server of the cloud storage system;
根据所述第一存储位置,上传所述待上传文件块;uploading the to-be-uploaded file block according to the first storage location;
在分割好的文件块未全部上传的情况下,从未上传的文件块中选择文件块,将所述待上传文件块更新为所选择的文件块,并返回执行所述向云存储系统的管理服务器发送上传所述待上传文件块的第一请求的步骤,直至分割好的文件块全部上传完成。If the divided file blocks are not all uploaded, select the file block from the unuploaded file blocks, update the to-be-uploaded file block to the selected file block, and return to execute the management to the cloud storage system The step of the server sending the first request to upload the file block to be uploaded until all the divided file blocks are uploaded.
第二方面,为达到上述目的,本发明实施例公开了一种文件下载方法。方法包括:In the second aspect, in order to achieve the above purpose, an embodiment of the present invention discloses a file downloading method. Methods include:
向云存储系统的管理服务器发送针对第一文件的下载请求,其中,所述第一文件包括至少一个文件块;sending a download request for a first file to the management server of the cloud storage system, wherein the first file includes at least one file block;
接收所述管理服务器反馈的第三信息,其中,所述第三信息中包括所述第一文件的文件块数量;receiving third information fed back by the management server, wherein the third information includes the number of file blocks of the first file;
基于所述文件块数量,确定待下载文件块;Based on the number of file blocks, determine the file blocks to be downloaded;
向所述管理服务器发送下载所述待下载文件块的第三请求,其中所述第三请求包含所述待下载文件块的数量;sending a third request for downloading the to-be-downloaded file block to the management server, wherein the third request includes the number of the to-be-downloaded file block;
接收所述管理服务器反馈的所述待下载文件块的第二存储位置;receiving the second storage location of the to-be-downloaded file block fed back by the management server;
从所述第二存储位置下载所述待下载文件块,在所述第一文件未下载完毕的情况下,返回执行所述基于所述第一文件的块数,确定待下载文件的步骤,直至所述第一文件下载完成。The block of the file to be downloaded is downloaded from the second storage location, and if the download of the first file is not completed, the process of determining the file to be downloaded based on the number of blocks of the first file is returned to until The download of the first file is completed.
第三方面,为达到上述目的,本发明实施例公开了一种文件上传装置。装置包括:In a third aspect, in order to achieve the above purpose, an embodiment of the present invention discloses a file uploading device. The device includes:
第一接收模块,用于接收针对目标文件的上传请求;a first receiving module, configured to receive an upload request for the target file;
分割模块,用于将所述目标文件按照预设分割规则分割成文件块;a segmentation module, for dividing the target file into file blocks according to preset segmentation rules;
第一确定模块,用于在分割好的文件块中确定待上传文件块;The first determination module is used to determine the file blocks to be uploaded in the divided file blocks;
第一发送模块,用于向云存储系统的管理服务器发送上传所述待上传文件块的第一请求,其中,所述第一请求中包括所述待上传文件块的数量;a first sending module, configured to send a first request for uploading the file blocks to be uploaded to the management server of the cloud storage system, wherein the first request includes the number of the file blocks to be uploaded;
第二接收模块,用于接收所述管理服务器反馈的第一存储位置,其中,所述第一存储位置为所述待上传文件块在云存储系统的存储服务器中的存储位置;a second receiving module, configured to receive a first storage location fed back by the management server, wherein the first storage location is a storage location of the to-be-uploaded file block in the storage server of the cloud storage system;
第一上传模块,用于将所述待上传文件块上传至所述第一存储位置;a first uploading module, configured to upload the to-be-uploaded file block to the first storage location;
更新模块,用于在分割好的文件块未全部上传的情况下,从未上传的文件块中选择文件块,将所述待上传文件块更新为所选择的文件块,并返回执行所述第一发送模块,直至分割好的文件块全部上传完成。The update module is used to select a file block from the unuploaded file blocks when the divided file blocks are not all uploaded, update the to-be-uploaded file block to the selected file block, and return to execute the first file block. Once the module is sent, until all the divided file blocks are uploaded.
第四方面,为达到上述目的,本发明实施例公开了一种文件下载装置。装置包括:In a fourth aspect, in order to achieve the above objective, an embodiment of the present invention discloses a file downloading apparatus. The device includes:
第四发送模块,用于向云存储系统的管理服务器发送针对第一文件的下载请求,其中,所述第一文件包括至少一个文件块;a fourth sending module, configured to send a download request for a first file to a management server of the cloud storage system, wherein the first file includes at least one file block;
第五接收模块,用于接收所述管理服务器反馈的第三信息,其中,所述第三信息中包括所述第一文件的文件块数量;a fifth receiving module, configured to receive third information fed back by the management server, wherein the third information includes the number of file blocks of the first file;
第二确定模块,用于基于所述文件块数量,确定待下载文件块;a second determining module, configured to determine the file blocks to be downloaded based on the number of file blocks;
第五发送模块,用于向所述管理服务器发送下载所述待下载文件块的第三请求,其中所述第三请求包含所述待下载文件块的数量;a fifth sending module, configured to send a third request for downloading the to-be-downloaded file block to the management server, wherein the third request includes the number of the to-be-downloaded file block;
第六接收模块,用于接收所述管理服务器反馈的所述待下载文件块的第二存储位置;a sixth receiving module, configured to receive the second storage location of the to-be-downloaded file block fed back by the management server;
下载模块,用于从所述第二存储位置下载所述待下载文件块,在所述第一文件未下载完毕的情况下,返回执行所述第二确定模块,直至所述第一文件下载完成。a download module, configured to download the to-be-downloaded file block from the second storage location, and in the case that the first file has not been downloaded, return to execute the second determination module until the first file is downloaded .
第五方面,为达到上述目的,本本发明实施例公开了一种文件传输方法,所述方法包括:In a fifth aspect, in order to achieve the above object, an embodiment of the present invention discloses a file transmission method, and the method includes:
监测是否接收到用于第三文件操作面板的第三展示指令;monitoring whether a third display instruction for the third file operation panel is received;
若为是,展示所述第三文件操作面板;If yes, display the third file operation panel;
接收通过所述第三文件操作面板发送的文件传输指令;receiving a file transfer instruction sent through the third file operation panel;
判断是否成功登录云存储系统的管理服务器;Determine whether the management server of the cloud storage system is successfully logged in;
若成功,在距离所述第三文件操作面板的第三预设位置展示第三文件管理面板;If successful, displaying a third file management panel at a third preset position away from the third file operation panel;
若失败,展示第三登录面板,并通过所述第三登录面板登录所述管理服务器,在成功登录所述管理服务器后,在距离所述第二文件操作面板的第三预设位置展示第二文件管理面板;If it fails, display a third login panel, and log in to the management server through the third login panel. After successfully logging in to the management server, display a second login panel at a third preset position away from the second file operation panel. file management panel;
获得根据所述第一文件管理面板的展示信息确定的目标路径,根据所述目标路径和所述文件传输指令进行文件传输。A target path determined according to the display information of the first file management panel is obtained, and file transfer is performed according to the target path and the file transfer instruction.
第六方面,为达到上述目的,本发明实施例公开了一种文件传输装置,所述装置包括:In a sixth aspect, in order to achieve the above object, an embodiment of the present invention discloses a file transmission device, and the device includes:
第二监测模块,用于监测是否接收到用于第三文件操作面板的第三展示指令;The second monitoring module is used to monitor whether the third display instruction for the third file operation panel is received;
第五展示模块,用于在所述第二监测模块的监测结果为是的情况下,展示所述第三文件操作面板;a fifth display module, configured to display the third file operation panel when the monitoring result of the second monitoring module is yes;
第十接收模块,用于接收通过所述第三文件操作面板发送的文件传输指令;a tenth receiving module, configured to receive a file transfer instruction sent through the third file operation panel;
第二判断模块,用于判断是否成功登录云存储系统的管理服务器;The second judgment module is used to judge whether the management server of the cloud storage system is successfully logged in;
第六展示模块,用于第二判断模块的判断结果为成功的情况下,在距离所述第三文件操作面板的预设位置展示第三文件管理面板;The sixth display module is used to display the third file management panel at a preset position away from the third file operation panel when the judgment result of the second judgment module is successful;
第七展示模块,用于第二判断模块的判断结果为失败的情况下,展示第三登录面板,并通过所述第三登录面板登录所述管理服务器,在成功登录所述管理服务器后,在距离所述第二文件操作面板的预设位置展示第二文件管理面板;The seventh display module is used to display a third login panel when the judgment result of the second judgment module is a failure, and log in to the management server through the third login panel, and after successfully logging in to the management server, in the Displaying a second file management panel at a preset position away from the second file operation panel;
传输模块,用于获得根据所述第一文件管理面板的展示信息确定的目标路径,根据所述目标路径和所述文件传输指令进行文件传输。A transmission module, configured to obtain a target path determined according to the display information of the first file management panel, and perform file transmission according to the target path and the file transmission instruction.
由上述技术方案可见,本发明实施例提供,一种文件上传、下载方法及装置,文件上传方法包括:获取针对目标文件的上传请求;将所述目标文件按照预设分割规则分割成文件块;在分割好的文件块中确定待上传文件块;向云存储系统的管理服务器发送上传所述待上传文件块的第一请求,其中,所述第一请求中包括所述待上传文件块的数量;接收所述管理服务器反馈的第一存储位置,其中,所述第一存储位置为所述待上传文件在云存储系统的存储服务器中的存储位置;将所述待上传文件块上传至所述第一存储位置;在分割好的文件块中除已经上传的文件块的其他文件块中,确定待上传文件块,并返回执行向云存储系统的管理服务器发送上传所述待上传文件块的第一请求的步骤;直至所有文件块上传完成。应用本发明实施例,通过对文件分块上传,每一个文件块上传的时间比较短,相较于现有技术,减少了文件上传过程中的出错机率。It can be seen from the above technical solutions that the embodiments of the present invention provide a method and device for uploading and downloading files. The file uploading method includes: obtaining an upload request for a target file; dividing the target file into file blocks according to preset segmentation rules; Determine the file blocks to be uploaded from the divided file blocks; send a first request for uploading the file blocks to be uploaded to the management server of the cloud storage system, where the first request includes the number of the file blocks to be uploaded ; Receive the first storage position fed back by the management server, wherein the first storage position is the storage position of the file to be uploaded in the storage server of the cloud storage system; upload the block of the file to be uploaded to the The first storage location; in the divided file blocks except for the file blocks that have been uploaded, determine the file blocks to be uploaded, and return to the management server of the cloud storage system to send and upload the file blocks to be uploaded. A requested step; until all file chunks are uploaded. By applying the embodiments of the present invention, by uploading files in blocks, the uploading time of each file block is relatively short, and compared with the prior art, the probability of errors in the file uploading process is reduced.
附图说明Description of drawings
为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to explain the embodiments of the present invention or the technical solutions in the prior art more clearly, the following briefly introduces the accompanying drawings that need to be used in the description of the embodiments or the prior art. Obviously, the accompanying drawings in the following description are only These are some embodiments of the present invention. For those of ordinary skill in the art, other drawings can also be obtained according to these drawings without creative effort.
图1为本发明实施例提供的文件上传方法的第一种流程示意图;1 is a first schematic flowchart of a file uploading method provided by an embodiment of the present invention;
图2为本发明实施例提供的文件上传方法的第二种流程示意图;2 is a second schematic flowchart of a file uploading method provided by an embodiment of the present invention;
图3为在PS中展示有第一文件管理面板的效果图;Fig. 3 is the renderings showing the first file management panel in PS;
图4为在PS中展示有第一登录面板的效果图;Fig. 4 is the renderings showing the first login panel in PS;
图5为本发明实施例提供的文件上传方法的第三种流程示意图;5 is a third schematic flowchart of a file uploading method provided by an embodiment of the present invention;
图6为本发明实施例提供的文件上传方法的第四种流程示意图;6 is a fourth schematic flowchart of a file uploading method provided by an embodiment of the present invention;
图7为本发明实施例提供的文件上传方法的第五种流程示意图;7 is a fifth schematic flowchart of a file uploading method provided by an embodiment of the present invention;
图8为本发明实施例提供的文件上传方法的第六种流程示意图;8 is a sixth schematic flowchart of a file uploading method provided by an embodiment of the present invention;
图9为本发明实施例提供的文件上传方法的第七种流程示意图;9 is a seventh schematic flowchart of a file uploading method provided by an embodiment of the present invention;
图10为本发明实施例提供的文件下载方法的第一种流程示意图;10 is a first schematic flowchart of a file downloading method provided by an embodiment of the present invention;
图11为本发明实施例提供的文件下载方法的第二种流程示意图;11 is a second schematic flowchart of a file downloading method provided by an embodiment of the present invention;
图12为本发明实施例提供的文件下载方法的第三种流程示意图;12 is a third schematic flowchart of a file downloading method provided by an embodiment of the present invention;
图13为本发明实施例提供的文件下载方法的第四种流程示意图;13 is a fourth schematic flowchart of a file downloading method provided by an embodiment of the present invention;
图14为本发明实施例提供的文件下载方法的第五种流程示意图;14 is a fifth schematic flowchart of a file downloading method provided by an embodiment of the present invention;
图15为本发明实施例提供的文件上传装置的结构示意图;15 is a schematic structural diagram of a file uploading apparatus provided by an embodiment of the present invention;
图16为本发明实施例提供的文件下载装置的结构示意图;16 is a schematic structural diagram of a file downloading apparatus provided by an embodiment of the present invention;
图17为本发明实施例提供的文件传输方法的种流程示意图;17 is a schematic flowchart of a file transmission method provided by an embodiment of the present invention;
图18为在PS中展示有第三文件管理面板的效果图;Fig. 18 is the renderings showing the third file management panel in PS;
图19为在PS中展示有第三登录面板的效果图;Figure 19 is a rendering showing the third login panel in PS;
图20为本发明实施例提供的文件传输装置的结构示意图。FIG. 20 is a schematic structural diagram of a file transmission apparatus according to an embodiment of the present invention.
具体实施方式Detailed ways
下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, but not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.
为了解决现有技术问题,本发明实施例提供了一种文件上传、下载、传输方法及装置。下面首先对本发明实施例所提供的一种文件上传方法进行介绍。In order to solve the problems of the prior art, the embodiments of the present invention provide a method and apparatus for uploading, downloading, and transmitting files. The following first introduces a file uploading method provided by an embodiment of the present invention.
图1为本发明实施例提供的文件上传方法的第一种流程示意图;方法包括:1 is a first schematic flowchart of a file uploading method provided by an embodiment of the present invention; the method includes:
S101:接收针对目标文件的上传请求。S101: Receive an upload request for a target file.
在本发明实施例中,可以是具有上传功能的客户端接收针对目标文件的上传请求,这里所说的具有上传功能的客户端可以为专有上传功能的客户端,也可以为带有上传功能的客户端。专有上传功能的客户端可以为只具有与上传下载等相关功能的客户端,即专门为上传下载而定制的客户端,而带有上传功能的客户端除了具有上传功能,还具有其他功能,示例性的,可以为对文件的编辑功能等等。In this embodiment of the present invention, a client with an upload function may receive an upload request for a target file, and the client with an upload function here may be a client with a dedicated upload function, or may be a client with an upload function client. The client with the exclusive upload function can be a client that only has functions related to uploading and downloading, that is, a client specially customized for uploading and downloading, while the client with the uploading function has other functions besides the uploading function. For example, it can be the editing function of the file and so on.
带有上传功能的客户端,示例性的,可以为带有上传功能的PS(AdobePhotoshop),PS是图像处理软件,主要是用来处理以像素所构成的数字图像,即可以理解为本发明实施例所提供的方法应用于PS中,具体的,应用于PS中带有上传功能的插件中。当然,PS包括了不同的版本,示例性的,可以为PS的CC(Creative Cloud,创意云)版本,PS的CS6、CS5版本等等,进一步的,该PS安装在Mac系统中,Mac是苹果公司自1984年起以“Macintosh(麦金塔电脑)”开始的个人消费型计算机。当然带有上传功能的客户端还可以为办公软件、视频编辑软件、音频编辑软件、阅读软件等等。在实际应用中,带有上传功能的客户端可以通过具有上传功能的插件实现文件的上传。插件(Plug)是一种遵循一定规范的应用接口编写出来的程序,执行运行在该程序规定的系统平台下,而不能脱离指定的平台单独运行。具体实现可以为:将具有上传功能的插件存放在客户端中的安装目录下的存放插件的文件夹,该文件夹可以称之为Plug-ins。需要说明的是,该插件除了具有上传功能,还可以具有下载功能。当然,这里所说的上传功能的客户端可以安装在Mac系统中,也可以安装在Windows系统中,Windows系统是美国微软公司开发的一种操作系统。A client with an upload function, exemplarily, can be PS (Adobe Photoshop) with an upload function. PS is an image processing software, which is mainly used to process digital images formed by pixels, which can be understood as the implementation of the present invention. The method provided in the example is applied to PS, specifically, to a plug-in with upload function in PS. Of course, PS includes different versions, for example, it can be CC (Creative Cloud) version of PS, CS6, CS5 version of PS, etc. Further, the PS is installed in the Mac system, and the Mac is an Apple The company's personal consumption computer since 1984 as "Macintosh". Of course, the client with upload function can also be office software, video editing software, audio editing software, reading software and so on. In practical applications, a client with an upload function can upload files through a plug-in with an upload function. A plug-in (Plug) is a program written in accordance with a certain standard application interface, which runs on the system platform specified by the program, and cannot be run independently of the specified platform. The specific implementation may be: storing the plug-in with the upload function in the folder where the plug-in is stored in the installation directory of the client, and the folder may be called Plug-ins. It should be noted that in addition to the upload function, the plugin can also have a download function. Of course, the client of the uploading function mentioned here can be installed in a Mac system or in a Windows system, and the Windows system is an operating system developed by Microsoft Corporation of the United States.
在实际应用中,接收到针对目标文件的上传请求后,客户端启动一个文件输入流,该文件输入流一点一点地从文件中读取数据,将读取中的数据存储在内存中,该内存为上传文件临时缓存所设置的存储空间,上述过程可以理解为,将目标文件的临时数据块缓存在内存中,当然,如果目标文件比较小,可以将目标文件缓存在内存中。进一步的,如果该客户端的上传功能是以插件实现的,则本发明实施例所提供的文件上传方法是通过插件实现的。In practical applications, after receiving the upload request for the target file, the client starts a file input stream, which reads data from the file bit by bit, and stores the data being read in the memory. The memory is the storage space set for the temporary cache of the uploaded file. The above process can be understood as caching the temporary data block of the target file in the memory. Of course, if the target file is relatively small, the target file can be cached in the memory. Further, if the uploading function of the client is implemented by a plug-in, the file uploading method provided by the embodiment of the present invention is implemented by a plug-in.
在实际应用中,插件的安装方法是现有技术,在这里不进行赘述。插件在客户端启动时自动加载,也可以在触发时才进行加载。当插件加载完成后,可以监听上传请求并将接收该上传请求,实现目标文件的上传。In practical applications, the method for installing a plug-in is the prior art, and details are not described here. Plugins are automatically loaded when the client starts, or they can be loaded when triggered. After the plugin is loaded, it can monitor the upload request and receive the upload request to upload the target file.
在本发明实施例中,插件与安装有该插件的客户端需要联动才能实现文件的上传。具体的,插件与该客户端之间的联动方式为:In the embodiment of the present invention, the plug-in and the client on which the plug-in is installed need to be linked to realize file uploading. Specifically, the linkage between the plug-in and the client is as follows:
插件会监测到客户端的打开、保存、新建等事件,这些事件的监测利用了客户端的SDK(Software Development Kit,软件开发工具包)来实现的,具体的实现过程为:下载客户端的SDK,基于客户端的SDK,按照所需要的功能进行开发,可以实现对事件的监测。当该插件监测到事件后,创建事件的描述,然后,转换事件的各个参数,根据事件的不同,转换后的参数不同,即别名不同,转换参数可以使得插件兼容各种操作;进而,对事件进行执行,根据事件转换后的参数,枚举响应事件,这里所说的枚举响应事件是转换后的参数与事件存在对应关系,将转换后的参数与事件进行逐个匹配,示例性的,假设转换后的参数为1234,1234对应的事件为保存,则1234与保存之间存在对应关系。然后,对事件进行执行,返回错误码,标识执行结果,示例性的,错误码为0,代表事件执行成功,错误码为非0,代表事件执行失败。最后,释放执行该事件所用到的参数内存占用,返回执行结果,即错误码。The plug-in will monitor the events such as opening, saving, and new creation of the client. The monitoring of these events is realized by using the SDK (Software Development Kit, software development kit) of the client. The specific implementation process is: download the SDK of the client, based on the client The SDK of the terminal is developed according to the required functions, which can realize the monitoring of events. When the plug-in detects the event, it creates a description of the event, and then converts each parameter of the event. According to the different events, the converted parameters are different, that is, the aliases are different, and the conversion parameters can make the plug-in compatible with various operations; Execute, according to the converted parameters of the event, enumerate the response events. The enumeration response events mentioned here means that the converted parameters and events have a corresponding relationship, and the converted parameters and events are matched one by one. For example, suppose The converted parameter is 1234, and the event corresponding to 1234 is save, so there is a corresponding relationship between 1234 and save. Then, execute the event, return an error code, and identify the execution result. Exemplarily, if the error code is 0, it means that the event execution is successful, and if the error code is non-zero, it means that the event execution fails. Finally, release the memory occupied by the parameters used to execute the event, and return the execution result, that is, the error code.
下面以在PS中上传目标文件为例说明插件与客户端之间的联动:The following takes uploading the target file in PS as an example to illustrate the linkage between the plug-in and the client:
当需要上传正在编辑的目标文件时,需要获取当前正在编辑目标文件的本地位置,此时,插件获取针对目标文件的上传请求时,会创建事件的描述,具体的,可以通过sPSActionDescriptor->Make,创建对获取目标文件的本地位置的事件描述,sPSActionDescriptor->Make是一种全局的事件响应函数;然后,转化事件的参数,事件的不同需要转换的参数不同,将事件的参数转换为插件能够理解并能够识别的字符串,插件可以根据识别的字符串对事件进行处理,具体的,可以通过sPSActionReference->PutEnumerated,将事件的参数转换为一个枚举类型的参数;再通过sPSActionControl->Get,对该上传事件执行,获取目标文件的参考位置,然后通过sPSActionDescriptor->GetAlias,获取文件的别名,将目标文件的参考位置转换为别名,再通过AliasToFullPath,将别名转换为真实文件的可读地址,并返回错误码,最后通过sPSActionReference->Free,释放执行该事件所用到的参数内存占用,并返回真实地址。When the target file being edited needs to be uploaded, it is necessary to obtain the local location of the target file currently being edited. At this time, when the plugin obtains the upload request for the target file, it will create a description of the event. Specifically, you can use sPSActionDescriptor->Make, Create an event description for obtaining the local location of the target file, sPSActionDescriptor->Make is a global event response function; then, convert the parameters of the event, the parameters that need to be converted are different for different events, and the parameters of the event are converted into plugins that can be understood And can recognize the string, the plug-in can process the event according to the recognized string, specifically, you can convert the event parameter into an enumeration type parameter through sPSActionReference->PutEnumerated; then through sPSActionControl->Get, to The upload event is executed to obtain the reference position of the target file, and then obtain the alias of the file through sPSActionDescriptor->GetAlias, convert the reference position of the target file to an alias, and then use AliasToFullPath to convert the alias to the readable address of the real file, and Return the error code, and finally release the parameter memory used to execute the event through sPSActionReference->Free, and return the real address.
在本发明实施例中,插件可以包括以JavaScript语言编写的页面及以Objective-C语言编写的上传逻辑,两者分离,有利于解耦。JavaScript(JS)是一种直译式脚本语言,是一种动态类型、弱类型、基于原型的语言,内置支持类型。Objective-C,通常写作ObjC或OC和较少用的Objective C或Obj-C,是扩充C的面向对象编程语言。以JavaScript语言编写的页面可以是UI,即User Interface(用户界面)的简称,泛指用户的操作界面,UI设计主要指界面的样式,美观程度。在而使用上,对软件的人机交互、操作逻辑、界面美观的整体设计则是同样重要的另一个门道,在本发明实施例中,UI是web(网页)界面。在实际应用中,插件功能的实现,可以JS语言和OC语言的相互配合才能实现,需要打通两种语言的交互,即实现两种语言的相互调用,下面对两种语言的调用方法进行说明。In this embodiment of the present invention, the plug-in may include a page written in the JavaScript language and upload logic written in the Objective-C language, and the two are separated, which facilitates decoupling. JavaScript (JS) is a literal scripting language, a dynamically typed, weakly typed, prototype-based language with built-in support for types. Objective-C, commonly written as ObjC or OC and less commonly Objective C or Obj-C, is an object-oriented programming language that extends C. A page written in JavaScript language can be UI, which is short for User Interface, which generally refers to the user's operation interface. UI design mainly refers to the style and aesthetics of the interface. In terms of use, the overall design of the software's human-computer interaction, operation logic, and beautiful interface is another doorway that is equally important. In the embodiment of the present invention, the UI is a web (web page) interface. In practical applications, the realization of plug-in functions can only be realized by the mutual cooperation of JS language and OC language. It is necessary to get through the interaction of the two languages, that is, to realize the mutual call of the two languages. The calling methods of the two languages are described below. .
一、JS调用OC1. JS calls OC
利用web界面的重定向原理,即重新在JS语言中指定document.location的值,document.location的含义是将页面内容定位到指定位置,document.location的值是可以理解为是一个URL(Uniform Resource Locator,统一资源定位符),URL是对可以从互联网上得到的资源的位置和访问方法的一种简洁的表示,是互联网上标准资源的地址。互联网上的每个文件都有一个唯一的URL,它包含的信息指出文件的位置以及浏览器应该怎么处理它。只要该URL字符串中按自定义规则指定所需的调用OC中的方法,然后通过OC中的shouldStartLoadWithRequest函数去捕获处理JS的请求,从而实现JS调用OC。需要说明的是,shouldStartLoadWithRequest函数是OC语言的一个函数,主要是用来捕获JS语言的请求。Using the redirection principle of the web interface, that is to re-specify the value of document.location in the JS language, the meaning of document.location is to locate the page content to the specified location, and the value of document.location can be understood as a URL (Uniform Resource Locator, Uniform Resource Locator), URL is a concise representation of the location and access method of resources available from the Internet, and is the address of standard resources on the Internet. Every file on the Internet has a unique URL, which contains information indicating the file's location and what the browser should do with it. As long as the URL string specifies the required method in the OC to be called according to the custom rules, and then uses the shouldStartLoadWithRequest function in the OC to capture and process the JS request, so that the JS can call the OC. It should be noted that the shouldStartLoadWithRequest function is a function of the OC language, which is mainly used to capture the request of the JS language.
二、OC调用JS2. OC calls JS
在JS语言中有一个windowScriptObject(窗口脚本对象)属性,可以直接获得脚本对象,OC便可以调用callWebScriptMethod:withArguments将消息转发给JS中对象的方法和参数,可以实现OC调用JS,例如[self.windowScriptObject callWebScriptMethod:@"login:password:"withArguments:@[@”zhangsan”,@”123456”]]。callWebScriptMethod:withArguments是OC语言中的函数,主要将OC中的消息传递给JS。In the JS language, there is a windowScriptObject (window script object) property, which can directly obtain the script object, and the OC can call callWebScriptMethod:withArguments to forward the message to the method and parameters of the object in the JS, so that the OC can call JS, such as [self.windowScriptObject callWebScriptMethod:@"login:password:"withArguments:@[@"zhangsan",@"123456"]]. callWebScriptMethod:withArguments is a function in OC language, which mainly passes messages in OC to JS.
具体的,JS语言与OC语言之间的交互是现有技术,本领域技术人员可以通过公开的资料,实现JS语言与OC语言之间的交互。在本发明实施例中,如果是以插件实现对目标文件的上传,则需要建立插件与云存储系统中的管理服务器的联系,具体的,通过插件远程登录管理服务器从而可以建立联系。在远程登录管理服务器时,需要JS语言与OC语言的交互,才能实现。登录过程中的JS语言与OC语言的交互是采用上述方法实现的,在这里不进行赘述。当检测到用户输入的用户的标识信息和密码时,根据用户的标识信息和密码进行验证,验证成功,则登录成功。在具体应用中,用户的标识信息可以为用户名、邮箱、手机号等等,当然,当需要输入的信息包括企业标识信息时,还需要输入企业的标识信息。在本发明实施例中,可以自动登录,也可以检测到登录信息后登录。Specifically, the interaction between the JS language and the OC language is the prior art, and those skilled in the art can realize the interaction between the JS language and the OC language through the disclosed materials. In this embodiment of the present invention, if a plug-in is used to upload the target file, the connection between the plug-in and the management server in the cloud storage system needs to be established. Specifically, the connection can be established by logging in to the management server remotely through the plug-in. When logging into the management server remotely, the interaction between the JS language and the OC language is required to achieve this. The interaction between the JS language and the OC language during the login process is realized by the above method, which will not be repeated here. When the user's identification information and password input by the user are detected, verification is performed according to the user's identification information and password. If the verification is successful, the login is successful. In a specific application, the user's identification information may be user name, email address, mobile phone number, etc. Of course, when the information to be input includes enterprise identification information, the enterprise identification information also needs to be input. In this embodiment of the present invention, the login may be performed automatically, or the login may be performed after the login information is detected.
S102:将目标文件按照预设分割规则分割成文件块。S102: Divide the target file into file blocks according to a preset dividing rule.
预设分割规则可以为根据预设大小分割,示例性的,目标文件为15M,预设大小为4M,则将目标文件块分割成3个4M的文件块和1个3M的文件块;当然,预设分割规则还可以为根据目标文件的大小及预设块数分割,示例性的,目标文件为15M,预设块数是4块,则可以将目标文件分割成1个6M的文件块和3个3M的文件块;预设分割规则还可以为根据预设块数平均分割,示例性的,目标文件为15M,预设块数是5块,则可以将目标文件块分割成5个3M的文件块。本发明实施例只是以上述为例进行说明,实际应用中,预设分割规则并不仅限于上述几种。The preset dividing rule may be divided according to a preset size. Exemplarily, if the target file is 15M and the preset size is 4M, the target file block is divided into three 4M file blocks and one 3M file block; of course, The preset division rule can also be divided according to the size of the target file and the preset number of blocks. Exemplarily, if the target file is 15M and the preset number of blocks is 4, the target file can be divided into one 6M file block and 3 file blocks of 3M; the preset division rule can also be divided equally according to the preset number of blocks, for example, if the target file is 15M, and the preset number of blocks is 5, the target file block can be divided into 5 3M blocks file block. The embodiments of the present invention are only described by taking the above as an example. In practical applications, the preset segmentation rules are not limited to the above-mentioned ones.
在实际应用中,带有上传功能的客户端将缓存在内存中的目标文件按照预设分割规则进行分割,进一步地,是客户端带有上传功能的插件将将缓存在内存中的目标文件按照预设分割规则进行分割。In practical applications, the client with the upload function divides the target files cached in the memory according to the preset segmentation rules. Preset segmentation rules for segmentation.
S103:在分割好的文件块中确定待上传文件块。S103: Determine the file block to be uploaded in the divided file blocks.
当分割好的文件块只有一块时,将该文件块确定为待上传文件块,当分割好的文件块不止一块的时候,可以将固定数量的文件块确定为待上传文件块,示例性的,假设固定数量为16块,分割好的文件块有4块,则将这4块确定为待上传文件块,如果分割好的文件有20块,则将其中的16块确定为待上传文件块,具体的,可以在20个文件块中随机选择16块;在实际应用中,分割好的文件块中每一块都有自身的块号,块号是按照分割的先后顺序确定的,块号可以是数字,也可以为是字母,确定待上传文件块可以根据分割好的文件块的块号的排序确定的。示例性的,假设有5块,分别为文件块1-5,固定数量是两块,则可以将文件块1和文件块2确定为待上传文件块。当然并不不仅限于上述确定待上传文件块的方法,在这里不进行一一列举。When there is only one divided file block, the file block is determined as the file block to be uploaded. When there is more than one divided file block, a fixed number of file blocks can be determined as the file block to be uploaded. Exemplarily, Assuming that the fixed number is 16 blocks, and there are 4 divided file blocks, the 4 blocks are determined as the file blocks to be uploaded. If the divided file has 20 blocks, 16 of them are determined as the file blocks to be uploaded. Specifically, 16 blocks can be randomly selected from 20 file blocks; in practical applications, each block in the divided file blocks has its own block number, and the block number is determined according to the order of division, and the block number can be The number can also be a letter, and the block of the file to be uploaded can be determined according to the order of block numbers of the divided file blocks. Exemplarily, assuming that there are 5 blocks, which are file blocks 1-5 respectively, and the fixed number is two blocks, then file block 1 and file block 2 may be determined as the file blocks to be uploaded. Of course, it is not limited to the above-mentioned method for determining the file block to be uploaded, which will not be listed one by one here.
当分割好的文件块不止一块的时候,还可以将其中一个的文件块确定为待上传文件块,也可以将多个文件块确定为待上传文件块。需要说明的是,每一次确定待上传文件块的数量可以相同,也可以不同。具体的,每次确定的待上传文件块的数量可以根据实际情况而定。When there are more than one divided file blocks, one of the file blocks may be determined as the to-be-uploaded file block, or multiple file blocks may be determined as the to-be-uploaded file blocks. It should be noted that the number of file blocks to be uploaded may be the same or different each time. Specifically, the number of file blocks to be uploaded each time determined may be determined according to the actual situation.
S104:向云存储系统的管理服务器发送上传所述待上传文件块的第一请求,其中,所述第一请求中包括所述待上传文件块的数量。S104: Send a first request for uploading the file blocks to be uploaded to the management server of the cloud storage system, where the first request includes the number of the file blocks to be uploaded.
当需要上传该待上传文件块时,向管理服务器发送第一请求,该第一请求中包含待上传文件块的数量,这里所说的待上传文件块的数量是S103中确定的待上传文件块的数量。在实际应用中,每一分割好的文件块对应着一个块号,则确定的待上传文件块也有其对应的块号,则第一请求中还包括每一待上传文件块的块号,示例性的,待上传文件块分别为文件块1、文件块2和文件块3,则第一请求中包含待上传文件块为3块,分别为文件块1、文件块2和文件块3的信息。When the to-be-uploaded file block needs to be uploaded, a first request is sent to the management server, where the first request includes the number of to-be-uploaded file blocks, and the number of to-be-uploaded file blocks referred to here is the to-be-uploaded file block determined in S103 quantity. In practical applications, each segmented file block corresponds to a block number, and the determined file block to be uploaded also has its corresponding block number, and the first request also includes the block number of each file block to be uploaded. Example The file blocks to be uploaded are respectively file block 1, file block 2 and file block 3, then the first request contains the information of file block 1, file block 2 and file block 3, which are 3 file blocks to be uploaded. .
需要说明的是,所有与管理服务器之间的请求可以为https(Hyper TextTransfer Protocol over Secure Socket Layer)请求,https是以安全为目标的http(HyperText Transfer Protocol,超文本传输协议)通道,简单讲是http的安全版。http是互联网上应用最为广泛的一种网络协议。当然,所有与管理服务器之间的请求也可以为http请求。It should be noted that all requests with the management server can be https (Hyper TextTransfer Protocol over Secure Socket Layer) requests, and https is a secure http (HyperText Transfer Protocol, hypertext transfer protocol) channel, which is simply The secure version of http. HTTP is the most widely used network protocol on the Internet. Of course, all requests to and from the management server can also be http requests.
S105:接收所述管理服务器反馈的第一存储位置,其中,所述第一存储位置为所述待上传文件块在云存储系统的存储服务器中的存储位置。S105: Receive a first storage location fed back by the management server, where the first storage location is a storage location of the to-be-uploaded file block in the storage server of the cloud storage system.
管理服务器在接收到第一请求后,根据第一请求中待上传文件块的数量确定第一存储位置。在实际应用中,管理服务器反馈的第一存储位置可以是与待上传文件块的数量相同的,第一存储位置中的每一存储位置与待上传文件块中的每一文件块存在对应关系,示例性的,可以如表1所示。After receiving the first request, the management server determines the first storage location according to the number of file blocks to be uploaded in the first request. In practical applications, the first storage location fed back by the management server may be the same as the number of file blocks to be uploaded, and each storage location in the first storage location has a corresponding relationship with each file block in the file blocks to be uploaded, Exemplarily, as shown in Table 1.
表1Table 1
管理服务器反馈的第一存储位置,可以是待上传文件块在存储服务器的一段存储位置,示例性的,第一存储位置可以为存储位置A-存储位置D;当然,第一存储位置可以为待上传文件块在存储服务器中起始存储位置,存储服务器将待上传文件块从该起始存储位置开始依次存储。The first storage location fed back by the management server may be a segment of the storage location of the file block to be uploaded on the storage server. Exemplarily, the first storage location may be storage location A-storage location D; of course, the first storage location may be the storage location to be uploaded. The upload file block starts at a storage location in the storage server, and the storage server stores the file blocks to be uploaded in sequence from the starting storage location.
需要说明的是,如果管理服务器根据第一请求,确定第一请求中所包含的待上传文件块已经都上传,则反馈已经上传的信息,如果第一请求中所包含的待上传文件块已还有部分未上传,则反馈的信息中包含了已上传的文件块的块号以及第一存储位置,该第一存储位置是基于未上传的文件块的数量确定的,这样可以避免重复上传而导致的资源和效率的浪费。It should be noted that if the management server determines, according to the first request, that all the file blocks to be uploaded included in the first request have been uploaded, it will feed back the information that has been uploaded. If the file blocks to be uploaded included in the first request have been returned If some parts are not uploaded, the feedback information includes the block number of the uploaded file block and the first storage location. The first storage location is determined based on the number of unuploaded file blocks, which can avoid repeated uploads. waste of resources and efficiency.
S106:根据所述第一存储位置,上传所述待上传文件块。S106: Upload the to-be-uploaded file block according to the first storage location.
在实际应用中,如果第一存储位置中的每一存储位置与待上传文件块中的每一文件块存在对应关系,则根据该对应关系,将该文件块上传至对应的存储位置;如果第一存储位置是一段存储位置,则可以根据该段存储位置的起始存储位置及结束存储位置,依次上传文件块;如果第一存储位置只包含了起始存储位置,以该起始存储位置为存储起点,上传待上传文件块,当待上传文件块上传完成,则可以确定待上传文件块的结束存储位置。In practical applications, if there is a corresponding relationship between each storage location in the first storage location and each file block in the file block to be uploaded, the file block is uploaded to the corresponding storage location according to the corresponding relationship; A storage location is a segment of storage location, and file blocks can be uploaded in sequence according to the starting storage location and ending storage location of the segment of storage location; if the first storage location only includes the starting storage location, the starting storage location is Storage starting point, upload the file block to be uploaded, when the upload of the file block to be uploaded is completed, the end storage location of the file block to be uploaded can be determined.
S107:在分割好的文件块未全部上传的情况下,从未上传的文件块中选择文件块,将所述待上传文件块更新为所选择的文件块,并返回执行S104,直至分割好的文件块全部上传完成。S107: In the case where the divided file blocks are not all uploaded, select a file block from the unuploaded file blocks, update the to-be-uploaded file block to the selected file block, and return to executing S104 until the divided file blocks are All file chunks are uploaded.
在S013中,确定的待上传文件块,可以是分割好的文件块中的一个或多个文件块,当待上传文件块上传后,还需要在未上传的文件块中选择文件块作为待上传文件块,继续上传文件块,直至所有分割好的文件块上传完成,此时目标文件上传完成。In S013, the determined file block to be uploaded may be one or more file blocks in the divided file blocks, and after the file block to be uploaded is uploaded, it is also necessary to select the file block from the unuploaded file blocks as the to-be-uploaded file block File blocks, continue to upload file blocks until all divided file blocks are uploaded, and the upload of the target file is completed.
在本发明实施例中,具有上传功能的客户端能够将自身正在编辑的文件上传至存储服务器,不需要将自身正在编辑的文件先保存,再上传在存储服务器,不用占用本地空间,彻底解放本地存储空间不足的后顾之忧,解决了将文件存储至存储服务器必须先保存的问题,也防止文件损坏或丢失。同时,可以直接将目标文件上传至存储服务器,省去了安装专有上传功能客户端的步骤,也省去了打开上传功能客户端的步骤,简化了带有上传功能的客户端的办公。在现有技术中,采用网页网盘进行存储文件,但由于网页的性能不佳,相较于现有技术,本发明实施例用户体验更好。相较于现有的利用存储介质存储文件,由于存储介质随时可能损坏,不利于数据安全。本发明实施例,将文件上传至存储服务器,能够实现数据的安全。In the embodiment of the present invention, the client with the upload function can upload the file that it is editing to the storage server, without the need to save the file it is editing first, and then upload it to the storage server, without occupying local space, completely liberating the local The worry of insufficient storage space solves the problem that files must be saved first when they are stored on the storage server, and also prevents files from being damaged or lost. At the same time, the target file can be directly uploaded to the storage server, which saves the steps of installing the client with the exclusive upload function, and the steps of opening the client with the upload function, which simplifies the office work of the client with the upload function. In the prior art, a web disk is used to store files, but due to the poor performance of the web page, compared with the prior art, the embodiment of the present invention has a better user experience. Compared with the existing storage medium for storing files, the storage medium may be damaged at any time, which is not conducive to data security. In the embodiment of the present invention, the file is uploaded to the storage server, which can realize data security.
在本发明实施例中,可以快速地将文件上传至云端进行存储,将较于将文件存储在本地,将文件存储至云端,极大减少了文件丢失或损坏的可能性。而且,在实际应用中,将文件上传至云端,云端提供了一个公共空间,使得可以通过该公共空间将文件分享给他人,当然,也可以以文件外链的形式将分享给他人。In the embodiment of the present invention, the file can be quickly uploaded to the cloud for storage, which greatly reduces the possibility of file loss or damage compared to storing the file locally and storing the file in the cloud. Moreover, in practical applications, when uploading files to the cloud, the cloud provides a public space, so that files can be shared with others through the public space, and of course, they can also be shared with others in the form of file external links.
应用本发明实施例,通过对文件分块上传,每一个文件块上传的时间比较短,相较于现有技术,减少了文件上传过程中的出错机率。By applying the embodiments of the present invention, by uploading files in blocks, the uploading time of each file block is relatively short, and compared with the prior art, the probability of errors in the file uploading process is reduced.
在本发明的另一个具体实施例中,参见图2,提供了文件上传的方法的第二种流程示意图,与图1所示实施例相比,本实施例中,根接收针对目标文件的上传请求(S101),包括:In another specific embodiment of the present invention, referring to FIG. 2 , a second schematic flowchart of a method for uploading a file is provided. Compared with the embodiment shown in FIG. 1 , in this embodiment, the root receives the upload of the target file. request (S101), including:
S1011:监测是否接收到用于展示第一文件操作面板的第一展示指令。S1011: Monitor whether a first display instruction for displaying the first file operation panel is received.
在实际应用中,第一展示指令是用于展示第一文件操作面板的展示指令,进一步的,可以说是展示客户端中文件操作面板的展示指令,具体的,客户端中的插件当监测到文件的保存文件事件、打开文件事件等等,均可以默认为接收到第一展示指令。需要说明的是,在本发明实施例中所说的客户端均为带有上传功能的客户端,进一步的,是带有上传功能的插件的客户端。In practical applications, the first display instruction is a display instruction for displaying the first file operation panel. Further, it can be said to be a display instruction for displaying the file operation panel in the client. Specifically, when the plug-in in the client detects the A file saving event, a file opening event, etc., can all default to receiving the first display instruction. It should be noted that the clients mentioned in the embodiments of the present invention are all clients with an upload function, and further, are clients with a plug-in with an upload function.
S1012:展示所述第一文件操作面板。S1012: Display the first file operation panel.
在接收到第一展示指令后,在客户端展示第一文件操作面板,在实际应用中,该第一文件操作面板可以是由JavaScript语言编写的页面,是UI设计。具体的,第一文件操作面板是插件其中一个界面,具体的展示方法是JS与OC交互实现的,在这里不进行赘述。需要说明的是,在本发明实施例中所说的插件均为带有上传功能的插件。After receiving the first display instruction, the first file operation panel is displayed on the client side. In practical applications, the first file operation panel may be a page written in JavaScript language, which is a UI design. Specifically, the first file operation panel is one of the interfaces of the plug-in, and the specific display method is realized by the interaction between JS and OC, which will not be repeated here. It should be noted that the plug-ins mentioned in the embodiments of the present invention are all plug-ins with an upload function.
S1013:接收通过所述第一文件操作面板发送的针对目标文件的上传请求。S1013: Receive an upload request for a target file sent through the first file operation panel.
在实际应用中,客户端与第一文件操作面板之间建立了连接,客户端可以接收通过第一文件操作面板发送上传请求;示例性的,第一文件操作面板上的“保存到云盘”按钮被触发,客户端就接收到针对目标文件的上传请求,需要说明的是,这里所说的云盘是云存储系统。In practical applications, a connection is established between the client and the first file operation panel, and the client can receive an upload request sent through the first file operation panel; exemplarily, on the first file operation panel, "Save to cloud disk" When the button is triggered, the client receives an upload request for the target file. It should be noted that the cloud disk mentioned here is a cloud storage system.
进一步的,在本发明的一个具体实施例中,在接收过所述第一文件操作面板发送的针对目标文件的上传请求之后,还包括:Further, in a specific embodiment of the present invention, after receiving the upload request for the target file sent by the first file operation panel, the method further includes:
判断是否成功登录云存储系统的管理服务器;Determine whether the management server of the cloud storage system is successfully logged in;
若成功,在距离所述第一文件操作面板的第一预设位置展示第一文件管理面板;If successful, displaying the first file management panel at a first preset position away from the first file operation panel;
若失败,展示第一登录面板,并通过所述第一登录面板登录所述管理服务器,在成功登录所述管理服务器后,在距离所述第一文件操作面板的第一预设位置展示第一文件管理面板;If it fails, display the first login panel, and log in to the management server through the first login panel. After successfully logging in to the management server, display the first login panel at a first preset position away from the first file operation panel. file management panel;
获得根据所述第一文件管理面板的展示信息确定的目标存储路径;obtaining the target storage path determined according to the display information of the first file management panel;
所述第一请求中还包括:所述目标存储路径;The first request further includes: the target storage path;
所述接收所述管理服务器反馈的第一存储位置,包括:The first storage location for receiving feedback from the management server includes:
接收所述管理服务器根据所述目标存储路径确定的第一存储位置。A first storage location determined by the management server according to the target storage path is received.
在上传文件的时候,客户端需要与云存储系统建立连接,进一步,需要与云存储系统中的管理服务器和存储服务器建立连接才能完成文件的上传,因此需要判断是否成功登录管理服务器。When uploading a file, the client needs to establish a connection with the cloud storage system. Further, it needs to establish a connection with the management server and the storage server in the cloud storage system to complete the file upload. Therefore, it is necessary to determine whether the management server is successfully logged in.
在成功登录管理服务器后,则在距离第一文件操作面板的第一预设位置展示第一文件管理面板。示例性的,在PS中的第一文件管理面板可以如图3所示,在图3中,第一文件管理面板位于第一文件操作面板的上侧。这里所说的第一预设位置还可以是第一文件操作面板的左侧、右侧、下侧等位置,本发明实施例对此不做限定。After successfully logging in to the management server, the first file management panel is displayed at a first preset position away from the first file operation panel. Exemplarily, the first file management panel in the PS may be as shown in FIG. 3 . In FIG. 3 , the first file management panel is located on the upper side of the first file operation panel. The first preset position mentioned here may also be a position on the left side, the right side, the lower side, etc. of the first file operation panel, which is not limited in this embodiment of the present invention.
在实际应用中,如果没有成功登录管理服务器,则展示第一登录面板,示例性的,第一登录面板可以图4所示,可以通过第一登录面板上的登录信息输入框输入登录信息,输入完毕后,点击“登录”按钮即认为向管理服务器发送了登录请求。在实际应用中,管理服务器确认该登录信息有效的情况下,向客户端反馈登录信息有效的确认结果,具体的,向管理服务器发送登录请求是JS调用OC,当管理服务反馈确认结果时,是OC调用JS,展示第一文件操作面板。In practical applications, if the management server is not successfully logged in, the first login panel is displayed. Exemplarily, the first login panel can be as shown in FIG. 4 . The login information can be input through the login information input box on the first login panel, and the input After completion, click the "Login" button, it is considered that a login request has been sent to the management server. In practical applications, when the management server confirms that the login information is valid, it feeds back the confirmation result that the login information is valid to the client. Specifically, sending a login request to the management server is JS calling OC. When the management service returns the confirmation result, it is OC calls JS to display the first file operation panel.
在展示第一文件管理面板之后,可以通过第一文件管理面板选择目标文件的目标存储路径,客户端可以通过第一文件管理面板的展示信息获得目标存储路径,具体的,可以通过JS与OC调用获取目标存储路径。在实际应用中,向管理服务器发送的第一请求中包含目标存储路径,管理服务器可以根据目标存储路径确定第一存储位置。After displaying the first file management panel, the target storage path of the target file can be selected through the first file management panel, and the client can obtain the target storage path through the display information of the first file management panel. Specifically, it can be called through JS and OC Get the target storage path. In practical applications, the first request sent to the management server includes the target storage path, and the management server may determine the first storage location according to the target storage path.
需要说明的是,在接收到通过第一登录面板或者第一文件管理面板发送的取消请求,则关闭对应的面板,示例性的,如果接收通过第一登录面板发送的取消请求,则会关闭该第一登录面板。It should be noted that when a cancellation request sent through the first login panel or the first file management panel is received, the corresponding panel is closed. Exemplarily, if a cancellation request sent through the first login panel is received, the corresponding panel is closed. First login panel.
在本发明的一个优选实施例中,在根据所述第一存储位置,上传所述待上传文件块之后,还包括:In a preferred embodiment of the present invention, after uploading the to-be-uploaded file block according to the first storage location, the method further includes:
通过所述第一文件管理面板展示所述目标文件的上传进度。The upload progress of the target file is displayed through the first file management panel.
在实际应用中,当上传待文件块之后,可以通过第一文件管理面板显示目标文件的上传进度,上传进度可以以百分比的形式显示,也可以以已上传的文件大小显示,具体的,显示方式是现有技术,在这里不进行赘述,参考迅雷等下载文件时进度显示的方式。In practical applications, after uploading the pending file block, the upload progress of the target file can be displayed through the first file management panel, and the upload progress can be displayed in the form of a percentage or the size of the uploaded file. Specifically, the display method This is the prior art, and it will not be repeated here. Reference is made to the way of progress display when downloading files, such as Thunder.
在本发明的一个优选实施例中,方法可以还包括:In a preferred embodiment of the present invention, the method may further include:
通过所述第一文件管理面板向所述管理服务器发送第一对象新建请求;Send a first object creation request to the management server through the first file management panel;
接收所述管理服务器反馈的针对所述第一对象新建请求的结果信息;receiving the result information of the new request for the first object fed back by the management server;
根据所述结果信息在所述的第一文件管理面板中显示新建的第一对象。The newly created first object is displayed in the first file management panel according to the result information.
在实际应用中,这里所说的第一对象新建请求可以为文件夹新建请求,示例性的,可以通过图3中的“新建文件夹”按钮发送第一对象新建请求,第一对象新建请求中还可以携带被新建的第一对象存储位置、名称等信息。第一文件管理面板显示的新建的第一对象,可以为在第一对象的存储位置,显示带有第一对象名称的文件夹。In practical applications, the first object creation request mentioned here may be a folder creation request. Exemplarily, the first object creation request may be sent through the "New Folder" button in FIG. 3 . In the first object creation request It may also carry information such as the storage location and name of the newly created first object. The newly created first object displayed on the first file management panel may be a folder with the name of the first object displayed at the storage location of the first object.
在本发明的一个优选实施例中,方法可以还包括:In a preferred embodiment of the present invention, the method may further include:
接收通过所述第一文件管理面板发送的第一退出登录请求;receiving a first logout request sent through the first file management panel;
根据所述第一退出登录请求,断开与所述管理服务器之间的连接。According to the first logout request, the connection with the management server is disconnected.
示例性的,可以通过图3中的“退出”按钮发送第一退出登录请求,当断开管理服务器之间的连接,则展示如图4所示的第一文件管理面板。Exemplarily, the first logout request may be sent through the “Logout” button in FIG. 3 , and when the connection between the management servers is disconnected, the first file management panel shown in FIG. 4 is displayed.
应用本发明实施例,通过对文件分块上传,每一个文件块上传的时间比较短,相较于现有技术,减少了文件上传过程中的出错机率。同时,在本发明实施例中,提供针对云存储系统的第一操作面板以供用户操作,这样无需使用单独设置的云存储系统的客户端,简化了用户上传文件的步骤,为用户操作云存储系统中的文件提供了极大的便利性,节省了用户的时间,提升了用户体验。By applying the embodiments of the present invention, by uploading files in blocks, the uploading time of each file block is relatively short, and compared with the prior art, the probability of errors in the file uploading process is reduced. At the same time, in the embodiment of the present invention, a first operation panel for the cloud storage system is provided for the user to operate, which eliminates the need to use a client of the cloud storage system that is set separately, simplifies the steps of uploading files by the user, and enables the user to operate the cloud storage system. The files in the system provide great convenience, save the user's time and improve the user experience.
图5为本发明实施例所提供的文件上传方法的第三种流程示意图。基于图1所提供的实施例,本发明实施例所提供的一种文件上传方法,在S101与S102之间,还包括S108和S109,其中,FIG. 5 is a third schematic flowchart of a file uploading method provided by an embodiment of the present invention. Based on the embodiment provided in FIG. 1, a file uploading method provided by the embodiment of the present invention further includes S108 and S109 between S101 and S102, wherein,
S108:向所述管理服务器发送获取目标文件的标识信息的获取请求。S108: Send an acquisition request for acquiring the identification information of the target file to the management server.
存储服务器同一时间可能会存储多个文件,因为文件是以文件块的形式进行存储,为了使得上传到存储服务器中的文件块能够正确地存储,不会与其他文件的文件块存储发生错乱,需要获取目标文件的标识信息,在每次与管理服务器或存储服务器通信时,携带目标文件的标识信息,这样避免了因多个文件同时上传造成错乱的情况的发生。The storage server may store multiple files at the same time, because the files are stored in the form of file blocks. In order to make the file blocks uploaded to the storage server can be stored correctly and will not be confused with the file block storage of other files, it is necessary to The identification information of the target file is obtained, and the identification information of the target file is carried every time it communicates with the management server or the storage server, so as to avoid the occurrence of confusion caused by the simultaneous upload of multiple files.
在实际应用中,该获取请求中包含了目标文件的大小、名称及在客户端中该目标文件所在父目录的标识信息。管理服务器根据获取请求确定目标文件在云存储系统中的标识信息。In practical applications, the obtaining request includes the size and name of the target file and the identification information of the parent directory where the target file is located in the client. The management server determines the identification information of the target file in the cloud storage system according to the acquisition request.
S109:接收所述管理服务器反馈的第二信息,其中所述第二信息中包括所述目标文件的标识信息。S109: Receive second information fed back by the management server, where the second information includes identification information of the target file.
具体的,第一请求还包括:所述目标文件的标识信息。Specifically, the first request further includes: identification information of the target file.
所述第一存储位置是所述管理服务器根据所述目标文件的标识信息确定的。The first storage location is determined by the management server according to the identification information of the target file.
在向管理服务器发送第一请求中携带目标文件的标识信息,管理服务器可以根据目标文件的标识信息确定第一存储位置。管理服务器可以根据目标文件的标识信息,确定是否已经目标文件的文件块上传,如果有,根据已经上传文件块的存储位置确定第一存储位置,如果没有,根据目标文件的标识信息,选择在存储服务器中选择存储位置。The identification information of the target file is carried in the first request sent to the management server, and the management server may determine the first storage location according to the identification information of the target file. The management server can determine whether the file block of the target file has been uploaded according to the identification information of the target file, if so, determine the first storage position according to the storage position of the uploaded file block, if not, according to the identification information of the target file, select the storage Select the storage location in the server.
具体的,所述第二信息包括所述目标文件的当前版本信息。Specifically, the second information includes current version information of the target file.
管理服务器根据目标文件的名称确定目标文件的当前版本信息,如果管理服务器中记载有该目标文件的名称对应的上传记录,则该目标文件存在历史版本已经上传,则该目标文件的当前版本信息是第几版本,示例性的,在管理服务器中该目标文件的名称对应的上传记录有2个,则目标文件的当前版本信息为地第3版。目标文件的版本信息有利于数据备份,如果将本地或者存储服务器中存储的文件删除或丢失,根据目标文件的当前版本信息,可以知道之前是否有文件已经存储在存储服务器,如果有,则可以在存储服务器中获取目标文件,在实际应用中,通过查看历史版本信息或回收站,获取目标文件,确保文件不会丢失。同时,通过当前版本信息,可以确定目标文件是否存在实例版本,如果存在,可以根据查看历史版本,查看目标文件的修改内容,同时可以查看上传的文件历史版本是否上传错误,即能够通过当前版本信息进行纠错。The management server determines the current version information of the target file according to the name of the target file. If the management server records the upload record corresponding to the name of the target file, then the target file has a historical version that has been uploaded, and the current version information of the target file is Which version, for example, there are two upload records corresponding to the name of the target file in the management server, and the current version information of the target file is the third version. The version information of the target file is conducive to data backup. If the file stored locally or in the storage server is deleted or lost, according to the current version information of the target file, you can know whether there is a file that has been stored in the storage server before. The target file is obtained from the storage server. In practical applications, the target file can be obtained by viewing the historical version information or the recycle bin to ensure that the file will not be lost. At the same time, through the current version information, you can determine whether there is an instance version of the target file. If so, you can view the modified content of the target file according to the historical version, and at the same time, you can check whether the uploaded historical version of the file is uploaded incorrectly, that is, you can pass the current version information. Error correction.
应用本发明实施例,通过对文件分块上传,每一个文件块上传的时间比较短,相较于现有技术,减少了文件上传过程中的出错机率。同时,基于目标文件的标识信息,保证在上传的过程中不会出现文件块上传错乱的情况。By applying the embodiments of the present invention, by uploading files in blocks, the uploading time of each file block is relatively short, and compared with the prior art, the probability of errors in the file uploading process is reduced. At the same time, based on the identification information of the target file, it is ensured that there will be no disorderly upload of file blocks during the uploading process.
在本发明的另一个具体实施例中,参见图6,提供了文件上传的方法的第四种流程示意图,与图5所示实施例相比,本实施例中,根据所述第一存储位置,上传所述待上传文件块(S106),包括:In another specific embodiment of the present invention, referring to FIG. 6 , a fourth schematic flowchart of a method for uploading a file is provided. Compared with the embodiment shown in FIG. 5 , in this embodiment, according to the first storage location , uploading the to-be-uploaded file block (S106), including:
S1061:将所述待上传文件块中的一个文件块确定为目标文件块。S1061: Determine one of the file blocks to be uploaded as a target file block.
当待上传文件块只有一块的时候,将该待上传文件块确定为目标文件块;当待上传文件块不止一块的时候,可以随机选择一个文件块,将选择的文件块确定为目标文件块,也可以将待上传文件块中的文件块进行排序,具体的,可以根据待上传文件块中的文件块的块号进行排序,将排序最靠前的文件块确定为目标文件块,也可以将排序最靠后的文件块确定为目标文件块。本发明实施例只是以上述为例进行说明,实际应用中,确定目标文件块的方式并不仅限于上述几种。When there is only one file block to be uploaded, the file block to be uploaded is determined as the target file block; when there are more than one file block to be uploaded, a file block can be randomly selected, and the selected file block is determined as the target file block. The file blocks in the file blocks to be uploaded can also be sorted. Specifically, the file blocks can be sorted according to the block numbers of the file blocks in the file blocks to be uploaded, and the file block with the highest ranking is determined as the target file block, or the The last sorted file block is determined as the target file block. The embodiments of the present invention are only described by taking the above as an example, and in practical applications, the manners of determining the target file block are not limited to the above-mentioned ones.
S1062:向所述存储服务器发送第二请求。S1062: Send a second request to the storage server.
需要说明的是,所有向存储服务器发送的请求为http请求或https请求。It should be noted that all requests sent to the storage server are http requests or https requests.
S1063:根据所述第一存储位置,上传所述目标文件块。S1063: Upload the target file block according to the first storage location.
当第一存储位置中存储位置与目标文件块之间存在对应关系时,可以将目标文件上传至对应的存储位置,当然,也可以在第一存储位置中随机选择一个存储位置,将目标文件块上传至选择的存储位置,在第一存储位置只有起始存储位置时,根据起始存储位置确定目标文件块的存储位置,上传该目标文件块。When there is a correspondence between the storage location in the first storage location and the target file block, the target file can be uploaded to the corresponding storage location. Upload to the selected storage location, when the first storage location has only the initial storage location, determine the storage location of the target file block according to the initial storage location, and upload the target file block.
S1064:在所述待上传文件块未全部上传的情况下,从未上传的文件块中选择文件块,并将所述目标文件块更新为所选择的文件块,返回执行S1062,直至所述待上传文件块全部上传完成。S1064: In the case that the file blocks to be uploaded are not all uploaded, select a file block from the unuploaded file blocks, update the target file block to the selected file block, and return to executing S1062 until the to-be-uploaded file block is Upload file chunks are all uploaded.
在待上传文件块为多个时,由于上传是一个一个地串行上传,当一个文件块上传完成时,需要上传下一个文件块,可以未上传的文件块中选择一个文件块确定为目标文件块,具体选择的方法可以参见上述确定目标文件块的方法,在这里不进行赘述。When there are multiple file blocks to be uploaded, since the upload is serially uploaded one by one, when the upload of one file block is completed, the next file block needs to be uploaded, and one file block can be selected from the unuploaded file blocks and determined as the target file For the specific selection method, refer to the above-mentioned method for determining the target file block, which will not be repeated here.
应用本发明实施例,通过对文件分块上传,每一个文件块上传的时间比较短,文件块是一块一块地上传,相较于现有技术,减少了文件上传过程中的出错机率。By applying the embodiments of the present invention, by uploading files in blocks, the upload time of each file block is relatively short, and the file blocks are uploaded one by one, which reduces the probability of errors during file uploading compared with the prior art.
在本发明的另一个具体实施例中,参见图7,提供了文件上传的方法的第五种流程示意图,与图6所示实施例相比,本实施例中,根据所述第一存储位置,上传所述目标文件块(S1063)之后,还包括:In another specific embodiment of the present invention, referring to FIG. 7 , a fifth schematic flowchart of a method for uploading a file is provided. Compared with the embodiment shown in FIG. 6 , in this embodiment, according to the first storage location , after uploading the target file block (S1063), it also includes:
S1065:在接收到所述存储服务器反馈的上传完成的信息情况下,向所述管理服务器发送查询请求,其中,所述查询请求用于查询所述目标文件块是否上传成功。S1065: Send a query request to the management server in the case of receiving the upload completion information fed back by the storage server, where the query request is used to query whether the target file block is uploaded successfully.
具体的,所述第二请求包括:所述待上传文件块中各文件块的第一哈希值,其中,所述第一哈希值为:计算所述待上传文件块中每一文件块存储的数据的哈希值得到的。Specifically, the second request includes: a first hash value of each file block in the file blocks to be uploaded, wherein the first hash value is: calculating each file block in the file blocks to be uploaded The hash value of the stored data is obtained.
需要说明的是,第一请求中包含的第一哈希值的数量与待上传文件块中的文件块的数量相同,具体的,第一哈希值为计算待上传文件块中的每一文件中存储的哈希值得到的。在实际应用中,第一哈希值可以为md5(Message Digest Algorithm 5,消息摘要算法第五版)值,也可以是sha1(Secure Hash Algorithm 1,安全哈希算法)值。当然,第一哈希值还可以为RIPEMD(RACE Integrity Primitives Evaluation Message Digest,RACE原始完整性校验消息摘要)值,当然,第一哈希值并不仅限于上述几种。It should be noted that the number of first hash values included in the first request is the same as the number of file blocks in the file block to be uploaded. Specifically, the first hash value is calculated for each file in the file block to be uploaded. obtained from the hash value stored in . In practical applications, the first hash value may be an md5 (Message Digest Algorithm 5, fifth edition of the message digest algorithm) value, or may be a sha1 (Secure Hash Algorithm 1, secure hash algorithm) value. Certainly, the first hash value may also be a RIPEMD (RACE Integrity Primitives Evaluation Message Digest, RACE original integrity verification message digest) value, of course, the first hash value is not limited to the above-mentioned types.
S1066:接收所述管理服务器反馈的查询结果。S1066: Receive the query result fed back by the management server.
存储服务器在确定目标文件块反馈的上传完成的信息后,会向管理服务器发送查询请求,管理服务器将接收到该查询请求时,记录该目标文件块已经上传,并向存储服务器发送给验证请求,该验证请求包含目标文件的标识信息及块号,存储服务器根据确定请求确定目标文件块,根据目标文件块的第一哈希值,验证目标文件块的完整状态,并向管理服务器反馈验证结果,管理服务器基于验证结果向客户端查询结果。需要说明的是,根据目标文件块的第一哈希值,验证目标文件块的完整状态是现有技术,在这里不进行赘述。After the storage server determines the upload completion information fed back by the target file block, it will send a query request to the management server. When the management server receives the query request, it will record that the target file block has been uploaded, and send a verification request to the storage server. The verification request includes the identification information and block number of the target file, the storage server determines the target file block according to the determination request, verifies the complete state of the target file block according to the first hash value of the target file block, and feeds back the verification result to the management server, The management server queries the client for the result based on the verification result. It should be noted that it is the prior art to verify the complete state of the target file block according to the first hash value of the target file block, and details are not described here.
S1067:在所述查询结果表明上传失败时,判断所述目标文件块的上传次数是否超过第一预设次数;其中,所述查询结果是所述存储服务器根据所述第一哈希值,检查所述待上传文件块的完整状态后确定的。S1067: When the query result indicates that uploading fails, determine whether the number of uploads of the target file block exceeds a first preset number of times; wherein, the query result is that the storage server checks according to the first hash value It is determined after the complete state of the file block to be uploaded.
存储服务器根据目标文件块的第一哈希值验证目标文件块的完整性,如果验证结果为完整,则查询结果为上传成功,则执行S1064,如果验证结果为不完整,则查询结果为上传失败,则判断目标文件块的上传次数是否超过第一预设次数,第一预设次数可以根据实际情况设置,示例性的,第一预设次数可以为3次。在本发明实施例中设置了第一预设次数,不会因为一个文件块的一个上传失败,导致目标文件的上传失败,减少了上传失败机率。在本发明实施例中,在确定上一个文件块上传成功后,才会上传下一个文件块,当出现网络故障的时候,可以从已经上传的部分开始继续上传未完成的部分,而没有必要从头开始上传下载,这样可以实现断点续传,从而可以节省时间,提高速度。The storage server verifies the integrity of the target file block according to the first hash value of the target file block. If the verification result is complete, the query result is that the upload is successful, and S1064 is executed. If the verification result is incomplete, the query result is that the upload failed. , then it is determined whether the number of uploads of the target file block exceeds the first preset number of times. The first preset number of times may be set according to the actual situation. Exemplarily, the first preset number of times may be 3 times. In the embodiment of the present invention, the first preset number of times is set, so that the upload of the target file will not fail due to the failure of one upload of one file block, which reduces the probability of upload failure. In this embodiment of the present invention, after it is determined that the previous file block is successfully uploaded, the next file block will be uploaded. When a network failure occurs, the unfinished part can be uploaded from the part that has been uploaded, and it is not necessary to start from the beginning. Start uploading and downloading, so that you can resume the upload from a breakpoint, which can save time and improve speed.
S1068:显示上传失败的提示。S1068: Display a prompt of upload failure.
当目标文件块的上传次数超过第一预设次数,则显示上传失败的提示,具体的,可以在第一文件管理面板上显示上传失败的提示,这里所说的显示失败的提示,是通过OC语言与JS语言的交互实现的,在本发明实施例中,在上传的过程中,还会显示上传的进度,上传进度可以在目标文件块上传完成增加,也可以在待上传文件块上传完成后增加,需要说明的是,当显示上传失败的信息时,不会再进行上传操作,只有再次接收到目标文件的上传请求时,才会进行文件的上传,上传失败的文件对应的文件块,存储服务器可以删除。When the number of uploads of the target file block exceeds the first preset number of times, a prompt of upload failure is displayed. Specifically, a prompt of upload failure can be displayed on the first file management panel. The display of failure prompt mentioned here is obtained through OC The interaction between the language and the JS language is realized. In the embodiment of the present invention, during the uploading process, the uploading progress is also displayed. The uploading progress can be increased after the uploading of the target file block is completed, or after the uploading of the to-be-uploaded file block is completed. Added, it should be noted that when the upload failure information is displayed, the upload operation will not be performed again. Only when the upload request of the target file is received again, the file upload will be performed. The file block corresponding to the failed upload file is stored. The server can be deleted.
应用本发明实施例,通过对文件分块上传,每一个文件块上传的时间比较短,文件块是一块一块地上传,相较于现有技术,减少了文件上传过程中的出错机率。By applying the embodiments of the present invention, by uploading files in blocks, the upload time of each file block is relatively short, and the file blocks are uploaded one by one, which reduces the probability of errors during file uploading compared with the prior art.
在本发明的另一个具体实施例中,参见图8,提供了文件上传的方法的第六种流程示意图,与图7所示实施例相比,本实施例中,根据所述第一存储位置,上传所述目标文件块(S1063)之前,还包括:In another specific embodiment of the present invention, referring to FIG. 8 , a sixth schematic flowchart of a method for uploading a file is provided. Compared with the embodiment shown in FIG. 7 , in this embodiment, according to the first storage location , before uploading the target file block (S1063), further comprising:
S1069:利用加密算法及自身记录的第一密钥,对所述目标文件块进行加密。S1069: Encrypt the target file block by using the encryption algorithm and the first key recorded by itself.
具体的,所述根据所述第一存储位置,上传所述待上传文件块,包括:Specifically, the uploading of the to-be-uploaded file block according to the first storage location includes:
根据所述第一存储位置,上传加密后的所述目标文件块。Upload the encrypted target file block according to the first storage location.
在实际应用中,加密算法可以为AES(Advanced Encryption Standard,高级加密标准)256加密算法,AES256加密算法是美国军方的一种加密算法。AES是一种对称密钥算法,使用128、192或256位密钥,并且用128位数据块分组对数据进行加密和解密。AES对不同密钥大小的命名方式为AES-x,其中x是密钥大小。在本发明实施例中,第一密钥可以是256位的密钥,则加密算法为AES256加密算法。当然,加密算法并不仅限于上述算法,还可以是其他可以实现加密的算法,在这里不进行一一列举。利用加密算法及记录的密钥对文件块加密的具体实现是现有技术,在这里不进行赘述。对文件块进行加密,保证了在上传过程中数据的安全。In practical applications, the encryption algorithm may be an AES (Advanced Encryption Standard, Advanced Encryption Standard) 256 encryption algorithm, which is an encryption algorithm of the US military. AES is a symmetric key algorithm that uses a 128, 192 or 256-bit key and encrypts and decrypts data in blocks of 128-bit data. AES names the different key sizes as AES-x, where x is the key size. In this embodiment of the present invention, the first key may be a 256-bit key, and the encryption algorithm is the AES256 encryption algorithm. Of course, the encryption algorithm is not limited to the above-mentioned algorithms, and may also be other algorithms that can implement encryption, which will not be listed here. The specific implementation of encrypting the file block by using the encryption algorithm and the recorded key is the prior art, and details are not described here. File blocks are encrypted to ensure data security during uploading.
需要说明的是,在实际应用中,第一请求中还包含待上传文件块中加密后的每一文件块的sha1值和md5值,管理服务器会存储sha1值和md5值,用于完成对目标文件的下载。It should be noted that, in practical applications, the first request also includes the sha1 value and md5 value of each encrypted file block in the file block to be uploaded, and the management server will store the sha1 value and md5 value to complete the target file download.
应用本发明实施例,通过对文件分块上传,每一个文件块上传的时间比较短,文件块是一块一块地上传,相较于现有技术,减少了文件上传过程中的出错机率。对文件进行加密,保证了上传过程中数据的安全。By applying the embodiments of the present invention, by uploading files in blocks, the upload time of each file block is relatively short, and the file blocks are uploaded one by one, which reduces the probability of errors during file uploading compared with the prior art. The file is encrypted to ensure the security of the data during the uploading process.
在本发明的另一个具体实施例中,参见图9,提供了文件上传的方法的第七种流程示意图,与图5所示实施例相比,本实施例中,在S107之后,还包括S110、S111和S112。In another specific embodiment of the present invention, referring to FIG. 9 , a seventh schematic flowchart of a method for uploading a file is provided. Compared with the embodiment shown in FIG. 5 , in this embodiment, after S107 , S110 is further included. , S111 and S112.
S110:向所述管理服务器发送文件块上传完成确认请求。S110: Send a file block upload completion confirmation request to the management server.
在分割好的文件块全部上传完成后,向管理服务器发送确定请求,管理服务器在接收到确定请求后确定是否所有文件块全部上传。After all the divided file blocks are uploaded, a confirmation request is sent to the management server, and the management server determines whether all the file blocks are uploaded after receiving the confirmation request.
S111:接收所述管理服务器反馈的确认结果。S111: Receive a confirmation result fed back by the management server.
在实际应用中,确定请求中包含目标文件的标识信息和块数,因为同一时间可能会存在多个文件在上传,需要根据标识信息确定目标文件,需要说明的是,在获取目标文件的标识信息后,向管理服务器或存储服务器发送的请求都携带目标文件的标识信息。管理服务器根据目标文件的块数及自身记录的已经上传的文件块的块号,确定有无遗漏的文件块,并反馈确定结果。In practical applications, it is determined that the request contains the identification information and the number of blocks of the target file, because there may be multiple files being uploaded at the same time, and the target file needs to be determined according to the identification information. It should be noted that when obtaining the identification information of the target file After that, the request sent to the management server or the storage server carries the identification information of the target file. The management server determines whether there are any missing file blocks according to the block number of the target file and the block number of the uploaded file block recorded by itself, and feeds back the determination result.
S112:在所述确认结果表明存在遗漏的文件块后,将所述遗漏的文件块上传至所述第一存储位置;并返回执行S110。S112: After the confirmation result indicates that there are missing file blocks, upload the missing file blocks to the first storage location; and return to executing S110.
在确认结果为没有文件块遗漏时,管理服务器将目标文件块的所有文件块拼接成目标文件并进行显示,具体的,可以参考现有的文件下载过程中,当文件没有下载完成,该文件不可读且不显示文件对应的图标,当文件下载完成文件可读,且显示文件对应的图标,这里所说的将文件块拼接成目标文件就是使目标文件可读且显示目标文件对应的图标,具体的拼接方法是现有技术,拼接也可能失败,拼接过程中存在拼接次数的上限,如果拼接次数达到上限还没拼接成功,则向客户端反馈拼接失败的信息,客户端接收到拼接失败的信息后,显示上传失败的提示。管理服务器在拼接完成后,计算拼接后的目标文件中存储的数据的sha1值,与获取请求中携带的sha1值进行比对,这里所说的sha1值是通过计算目标文件存储的数据的哈希值得到的,如果两个sha1值不同,则说明拼接后的目标文件已经损坏,通知客户端目标文件已损坏的信息,客户端接收到该信息后,显示上传失败的提示。在实际应用中,获取中还包含目标文件的md5值,md5值是通过计算目标文件中存储的数据得到的,需要说明的是,sha1值与md5均是哈希值,只是长度不同,md5值是128位,sha1值是160位。管理服务器还可以利用md5值验证文件是否损坏。When the confirmation result is that no file block is missing, the management server splices all the file blocks of the target file block into the target file and displays it. For details, please refer to the existing file download process. When the file is not downloaded, the file cannot be downloaded. Read and do not display the icon corresponding to the file. When the file is downloaded, the file is readable, and the icon corresponding to the file is displayed. The splicing of the file blocks into the target file is to make the target file readable and display the icon corresponding to the target file. Specifically, The splicing method is the prior art, and the splicing may also fail. There is an upper limit of the number of splicing in the splicing process. If the number of splicing reaches the upper limit and the splicing has not been successful, the information of the splicing failure is fed back to the client, and the client receives the information of the splicing failure. After the upload fails, a prompt is displayed. After the splicing is completed, the management server calculates the sha1 value of the data stored in the spliced target file, and compares it with the sha1 value carried in the acquisition request. The sha1 value mentioned here is calculated by calculating the hash of the data stored in the target file. If the two sha1 values are different, it means that the target file after splicing is damaged, and informs the client that the target file is damaged. After the client receives the information, it will display the upload failure prompt. In practical applications, the acquisition also includes the md5 value of the target file. The md5 value is obtained by calculating the data stored in the target file. It should be noted that the sha1 value and the md5 value are both hash values, but the length is different. The md5 value is 128 bits and the sha1 value is 160 bits. The management server can also use the md5 value to verify that the file is not corrupted.
在实际应用中,在确认结果表明存在文件块遗漏时,管理服务器反馈的确认结果中包含遗漏的文件块的块号,当只有一个文件块遗漏时,上传该文件块,上传遗漏文件块的步骤与上述上传文件块的步骤相同,在这里不进行赘述。当遗漏的文件块不只一块时,则所有遗漏的文件块为待上传文件块,具体的上传方法与上述上传待上传文件块的方法相同,在这里不进行赘述。In practical applications, when the confirmation result indicates that a file block is missing, the confirmation result fed back by the management server includes the block number of the missing file block. When only one file block is missing, upload the file block and upload the missing file block. The steps for uploading file chunks are the same as those described above, and will not be repeated here. When there is more than one missing file block, all the missing file blocks are to-be-uploaded file blocks, and the specific uploading method is the same as the above-mentioned method for uploading the to-be-uploaded file block, which will not be repeated here.
应用本发明实施例,通过对文件分块上传,每一个文件块上传的时间比较短,文件块是一块一块地上传,相较于现有技术,减少了文件上传过程中的出错机率。By applying the embodiments of the present invention, by uploading files in blocks, the upload time of each file block is relatively short, and the file blocks are uploaded one by one, which reduces the probability of errors during file uploading compared with the prior art.
图10为本发明实施例提供的文件下载方法的第一种流程示意图,方法包括:10 is a first schematic flowchart of a file downloading method provided by an embodiment of the present invention, the method includes:
S201:向云存储系统的管理服务器发送针对第一文件的下载请求,其中,所述第一文件包括至少一个文件块。S201: Send a download request for a first file to a management server of a cloud storage system, where the first file includes at least one file block.
在本发明实施例中,可以是具有下载功能的客户端向云存储系统的管理服务器发送针对第一文件的下载请求,这里所说的具有下载功能的客户端可以为专有下载功能的客户端,也可以为带有下载功能的客户端。专有下载功能的客户端可以为只具有与上传下载等相关功能的客户端,即专门为上传下载而定制的客户端,而带有下载功能的客户端除了具有下载功能,还具有其他功能,示例性的,可以为对文件的编辑功能等等。带有下载功能的客户端可以通过具有下载功能的插件实现。带有下载功能的客户端,示例性的,可以为带有下载功能的PS、办公软件等等,在实际应用中,带有下载功能的客户端可以通过具有下载功能的插件实现文件的下载。需要说明的是,该插件除了具有下载功能,还可以具有上传功能。当然,这里所说的下载功能的客户端可以安装在Mac系统中,也可以安装在Windows系统中,Windows系统是美国微软公司开发的一种操作系统。In this embodiment of the present invention, a client with a download function may send a download request for the first file to the management server of the cloud storage system, and the client with a download function mentioned here may be a client with a dedicated download function , or a client with a download function. The client with exclusive download function can be a client with only related functions such as upload and download, that is, a client specially customized for upload and download, while a client with download function has other functions besides the download function. For example, it can be the editing function of the file and so on. A client with download function can be implemented by a plug-in with download function. The client with the download function, for example, can be PS, office software, etc. with the download function. In practical applications, the client with the download function can download files through a plug-in with the download function. It should be noted that in addition to the download function, the plug-in can also have an upload function. Of course, the client of the download function mentioned here can be installed in a Mac system or in a Windows system, and the Windows system is an operating system developed by Microsoft Corporation of the United States.
在本发明实施例中,插件与安装有该插件的客户端需要联动才能实现文件的下载。具体的,插件与该客户端之间的联动为:In the embodiment of the present invention, the plug-in and the client on which the plug-in is installed need to be linked to realize the download of the file. Specifically, the linkage between the plug-in and the client is:
插件会监测到客户端的打开、保存、新建等事件,这些事件的监测利用了客户端的SDK(Software Development Kit,软件开发工具包)来实现的,具体的实现过程为:下载客户端的SDK,基于客户端的SDK,按照所需要的功能进行开发,可以实现对事件的监测。当该插件监测到事件后,创建事件的描述,然后,转换事件的各个参数,根据事件的不同,转换后的参数不同,即别名不同,转换参数可以使得插件兼容各种操作;进而,对事件进行执行,根据事件转换后的参数,枚举响应事件,这里所说的枚举响应事件是转换后的参数与事件存在对应关系,将转换后的参数与事件进行逐个匹配,示例性的,假设转换后的参数为1234,1234对应的事件为保存,则1234与保存之间存在对应关系。然后,对事件进行执行,返回错误码,标识执行结果,示例性的,错误码为0,代表事件执行成功,错误码为非0,代表事件执行失败。最后,释放执行该事件所用到的参数内存占用,返回执行结果,即错误码。The plug-in will monitor the events such as opening, saving, and new creation of the client. The monitoring of these events is realized by using the SDK (Software Development Kit, software development kit) of the client. The specific implementation process is: download the SDK of the client, based on the client The SDK of the terminal is developed according to the required functions, which can realize the monitoring of events. When the plug-in detects the event, it creates a description of the event, and then converts each parameter of the event. According to the different events, the converted parameters are different, that is, the aliases are different, and the conversion parameters can make the plug-in compatible with various operations; Execute, according to the converted parameters of the event, enumerate the response events. The enumeration response events mentioned here means that the converted parameters and events have a corresponding relationship, and the converted parameters and events are matched one by one. For example, suppose The converted parameter is 1234, and the event corresponding to 1234 is save, so there is a corresponding relationship between 1234 and save. Then, execute the event, return an error code, and identify the execution result. Exemplarily, if the error code is 0, it means that the event execution is successful, and if the error code is non-zero, it means that the event execution fails. Finally, release the memory occupied by the parameters used to execute the event, and return the execution result, that is, the error code.
下面以在PS中打开下载的第一文件为例说明插件与客户端之间的联动:The link between the plug-in and the client is described below by taking the first file downloaded in PS as an example:
当第一文件下载完后,插件会创建事件的描述,具体的,可以通过sPSActionDescriptor->Make,创建对获取目标文件的本地位置的事件描述,sPSActionDescriptor->Make是一种全局的事件响应函数;然后,转化事件的参数,具体的,可以通过sPSActionDescriptor->PutAlias,进行参数的转换,通过给定的key(键),设置一个C标准格式的行为别名,这样做可以兼容各种操作,根据不同的事件,别名不同;再通过sPSActionDescriptor->PutInteger进行转化参数,通过给定的key(键),设置一个C标准格式的行为的数字ID(identification,身份标识号);再通过sPSActionControl->Play,执行第一文件打开之一事件并返回错误码,最后通过sPSActionReference->Free,释放执行该事件所用到的参数内存占用,并返回错误码。When the first file is downloaded, the plugin will create an event description. Specifically, you can create an event description for the local location of the target file through sPSActionDescriptor->Make. sPSActionDescriptor->Make is a global event response function; Then, convert the parameters of the event. Specifically, you can convert the parameters through sPSActionDescriptor->PutAlias, and set a behavior alias in the C standard format through the given key (key), which is compatible with various operations. The events have different aliases; then pass sPSActionDescriptor->PutInteger to convert parameters, and set a digital ID (identification, identification number) of a behavior in C standard format through the given key (key); then pass sPSActionControl->Play, Execute one of the first file open events and return an error code. Finally, through sPSActionReference->Free, release the memory occupation of the parameters used to execute the event and return the error code.
S202:接收所述管理服务器反馈的第三信息,其中,所述第三信息中包括所述第一文件的文件块数量。S202: Receive third information fed back by the management server, where the third information includes the number of file blocks of the first file.
需要说明的是,下载请求中包含了第一文件的标识信息,管理服务器在接收到该下载请求后,根据下载请求中第一文件的标识信息与自身存储的第一文件的信息之间的对应关系,反馈第三信息,第三信息包含了第一文件块的文件块数量,客户端基于第一文件的文件块数量可以确定待下载文件块,也可以确定第一文件的文件块是否全部下载完成。It should be noted that the download request includes the identification information of the first file, and after receiving the download request, the management server, after receiving the download request, according to the correspondence between the identification information of the first file in the download request and the information of the first file stored by itself. relationship, feedback the third information, the third information includes the number of file blocks of the first file block, the client can determine the file block to be downloaded based on the number of file blocks of the first file, and can also determine whether all the file blocks of the first file are downloaded. Finish.
具体的,所述第三信息还包括:所述第一文件的当前版本信息。Specifically, the third information further includes: current version information of the first file.
这里所说的第一文件的当前版本信息与文件上传方法实施例中目标文件的当前版本信息的作用相同,在这里不进行详述。The current version information of the first file mentioned here has the same function as the current version information of the target file in the embodiment of the file uploading method, and will not be described in detail here.
S203:基于所述文件块数量,确定待下载文件块。S203: Based on the number of file blocks, determine the file blocks to be downloaded.
当文件块数量只有一块时,将该文件块确定为待下载文件块,当文件块书数量不止一块的时候,可以将固定数量的文件块确定为待下载文件块,示例性的,假设固定数量为16块,分割好的文件块有4块,则将这4块确定为待下载文件块,如果分割好的文件有20块,则将其中的16块确定为待下载文件块,具体的,可以在20个文件块中随机选择16块;在实际应用中,第一文件的文件块中每一块有携带有块号,块号可以是数字,也可以为是字母,确定待下载文件块可以根据文件块的块号的排序确定的。示例性的,假设有5块,分别为文件块1-5,固定数量是两块,则可以将文件块1和文件块2确定为待下载文件块。当然并不不仅限于上述确定待下载文件块的方法,在这里不进行一一列举。When the number of file blocks is only one, the file block is determined as the file block to be downloaded. When the number of file blocks is more than one, a fixed number of file blocks can be determined as the file block to be downloaded. Exemplarily, a fixed number of is 16 blocks, and there are 4 divided file blocks, then these 4 blocks are determined as the file blocks to be downloaded. If there are 20 divided files, 16 of them are determined as the file blocks to be downloaded. Specifically, 16 blocks can be randomly selected from the 20 file blocks; in practical applications, each block in the file block of the first file carries a block number, and the block number can be a number or a letter. It is determined that the file block to be downloaded can be Determined according to the ordering of the block numbers of the file blocks. Exemplarily, assuming that there are 5 blocks, which are file blocks 1-5 respectively, and the fixed number is two blocks, then file block 1 and file block 2 may be determined as the file blocks to be downloaded. Of course, it is not limited to the above-mentioned method for determining the file block to be downloaded, which will not be listed one by one here.
S204:向所述管理服务器发送下载所述待下载文件块的第三请求,其中所述第三请求包含所述待下载文件块的数量。S204: Send a third request for downloading the to-be-downloaded file block to the management server, where the third request includes the number of the to-be-downloaded file block.
在实际应用中,第三请求中不仅包含待下载文件块的数量,还包含了待下载文件块的块号,进一步的,还包含第一文件的标识信息,管理服务器在接收到第三请求,根据第三请求确定第二存储位置。In practical applications, the third request includes not only the number of file blocks to be downloaded, but also the block numbers of the file blocks to be downloaded, and further, the identification information of the first file. When the management server receives the third request, The second storage location is determined according to the third request.
在本发明的一个优选实施例中,在所述向所述管理服务器发送下载所述待下载文件块的第三请求之后,还包括:In a preferred embodiment of the present invention, after the sending the third request for downloading the to-be-downloaded file block to the management server, the method further includes:
接收所述管理服务器反馈的第二哈希值,其中,所述第二哈希值为:通过计算所述待下载文件块中每一文件块存储的数据的哈希值得到的。The second hash value fed back by the management server is received, wherein the second hash value is obtained by calculating the hash value of the data stored in each file block in the file blocks to be downloaded.
需要说明的是,管理服务器反馈的第二哈希值数量与待下载文件块中的文件块的数量相同,且第二哈希值与待下载文件块中的文件块存在一一对应关系。第二哈希值可以为md5值,也可以为sha1值,当然也可以为其他的哈希值。第一哈希值与第二哈希值可以是相同类型的哈希值,也可以是不同类型的哈希值。当第一哈希值与第二哈希值是相同类型的哈希值时,管理服务器还会反馈待下载文件块的第一哈希值。It should be noted that the number of second hash values fed back by the management server is the same as the number of file blocks in the file blocks to be downloaded, and there is a one-to-one correspondence between the second hash values and the file blocks in the file blocks to be downloaded. The second hash value may be an md5 value, a sha1 value, or of course other hash values. The first hash value and the second hash value may be hash values of the same type, or may be hash values of different types. When the first hash value and the second hash value are the same type of hash value, the management server also feeds back the first hash value of the file block to be downloaded.
S205:接收所述管理服务器反馈的所述待下载文件块的第二存储位置。S205: Receive the second storage location of the to-be-downloaded file block fed back by the management server.
第二存储位置由第一文件的标识信息、待下载文件块的数量确定的,如果一个待下载文件块对应了一个存储位置,则第二存储位置中包含了与待下载文件块的数量相同的存储位置,进一步的,待下载文件块的块号与存储位置之间存在对应关系,根据该对应关系可以确定第二存储位置。The second storage location is determined by the identification information of the first file and the number of file blocks to be downloaded. If a file block to be downloaded corresponds to a storage location, the second storage location contains the same number of file blocks as the number of file blocks to be downloaded. The storage location, further, there is a correspondence between the block number of the file block to be downloaded and the storage location, and the second storage location can be determined according to the correspondence.
S206:从所述第二存储位置下载所述待下载文件块,在所述第一文件未下载完毕的情况下,返回执行S203,直至所述第一文件下载完成。S206: Download the to-be-downloaded file block from the second storage location, and if the first file has not been downloaded, return to S203 until the first file is downloaded.
在实际应用中,当第一文件下载完成,将第一文件的所有文件块合并成一个可读的第一文件,合并的方法与上述文件上传过程管理服务器对文件块的合并方法相同,在这里不进行赘述。带有上传功能的客户端判断自身是否能够打开该第一文件,如果能,则直接打开,对第一文件进行编辑,在对第一文件编辑完成后,则可以直接将编辑后的第一文件上传至存储服务器。如果不能,调动shell(壳)命令,利用默认程序打开第一文件。shell基本上是一个命令解释器,可以调用相应的应用程序。In practical applications, when the first file is downloaded, all the file blocks of the first file are merged into a readable first file. The method of merging is the same as the method of merging file blocks by the above-mentioned file upload process management server. Here No further description will be given. The client with the upload function determines whether it can open the first file, and if so, directly opens the first file and edits the first file. After editing the first file, the edited first file can be directly edited. Upload to the storage server. If not, invoke the shell command to open the first file with the default program. The shell is basically a command interpreter that invokes the corresponding application.
在本发明实施例中,具有下载功能的客户端能够随时下载之间编辑的文件,文件存储在存储服务器,不用占用本地空间,彻底解放本地存储空间不足的后顾之忧,也防止文件损坏或丢失。同时,可以直接下载文件,省去了寻找文件的时间,也省去了安装专有上传功能客户端的步骤,进一步的也省去了打开上传功能客户端的步骤,简化了带有上传功能的客户端的办公。采用网页网盘进行存储文件,但由于网页的性能不佳,相较于现有技术,本发明实施例用户体验更好,相较于现有的利用存储介质存储文件,由于存储介质随时可能损坏,不利于数据的备份和安全,也省去了寻找存储介质的时间。在本发明实施例中,将文件上传至存储服务器,多个客户端均可以查看该文件。In the embodiment of the present invention, the client with the download function can download the files edited between them at any time, and the files are stored in the storage server without occupying the local space, which completely relieves the worries of insufficient local storage space, and also prevents the files from being damaged or lost. At the same time, the file can be downloaded directly, which saves the time of searching for the file, and saves the steps of installing the client with the exclusive upload function, and further saves the step of opening the client with the upload function, which simplifies the operation of the client with the upload function. office. The webpage network disk is used to store files, but due to the poor performance of webpages, compared with the prior art, the user experience of the embodiment of the present invention is better. Compared with the existing storage medium for storing files, the storage medium may be damaged at any time. , which is not conducive to data backup and security, and saves the time to find storage media. In this embodiment of the present invention, a file is uploaded to a storage server, and multiple clients can view the file.
应用本发明实施例,通过对文件分块下载,每一个文件块下载的时间比较短,相较于现有技术,减少了文件下载过程中的出错机率。By applying the embodiments of the present invention, by downloading files in blocks, the download time of each file block is relatively short, and compared with the prior art, the probability of errors in the file downloading process is reduced.
图11为本发明实施例所提供的文件下载方法的第二种流程示意图。基于图10所提供的实施例,本发明实施例所提供的一种文件下载方法,在所述向云存储系统的管理服务器发送针对第一文件的下载请求(S201)之前,还包括:FIG. 11 is a schematic flowchart of a second method for downloading a file according to an embodiment of the present invention. Based on the embodiment provided in FIG. 10 , the method for downloading a file provided by the embodiment of the present invention, before the sending a download request for the first file to the management server of the cloud storage system (S201), further includes:
S207:监测是否接收到用于展示第二文件操作面板的第二展示指令。S207: Monitor whether a second display instruction for displaying the second file operation panel is received.
需要说明的是,第二展示指令是用于展示第二文件操作面板的展示指令,进一步的,可以说是展示客户端中文件操作面板的展示指令,具体的,客户端中的插件当监测到文件的保存文件事件、打开文件事件等等,均可以默认为接收到第二展示指令。需要说明的是,在本发明实施例中所说的客户端均为带有下载功能的客户端,进一步的,是带有下载功能的插件的客户端。It should be noted that the second display instruction is a display instruction for displaying the second file operation panel. Further, it can be said to be a display instruction for displaying the file operation panel in the client. Specifically, when the plug-in in the client detects the The file save event, open file event, etc. of the file can all default to receiving the second display instruction. It should be noted that the clients mentioned in the embodiments of the present invention are all clients with a download function, and further, are clients with a plug-in with a download function.
S208:展示所述第二文件操作面板。S208: Display the second file operation panel.
在实际应用中,该第二文件操作面板可以是由JavaScript语言编写的页面,是UI设计。具体的,第二文件操作面板是插件其中一个界面,具体的展示方法是JS与OC交互实现的,在这里不进行赘述。示例性的,第二文件操作面板与图3中的第一文件操作面板的界面设计相似。需要说明的是,在本发明实施例中所说的插件均为带有下载功能的插件。In practical applications, the second file operation panel may be a page written in JavaScript language, which is a UI design. Specifically, the second file operation panel is one of the interfaces of the plug-in, and the specific display method is realized by the interaction between JS and OC, which will not be repeated here. Exemplarily, the interface design of the second file operation panel is similar to that of the first file operation panel in FIG. 3 . It should be noted that the plug-ins mentioned in the embodiments of the present invention are all plug-ins with a download function.
S209:判断是否成功登录云存储系统的管理服务器。S209: Determine whether the management server of the cloud storage system is successfully logged in.
在实际应用中,在下载的时候,客户端需要与云存储系统建立连接,才能完成第一文件的下载,判断是否与云存储服务器建立连接,可以为判断是否成功登录云存储系统的管理服务器。In practical applications, when downloading, the client needs to establish a connection with the cloud storage system to complete the download of the first file, and judging whether to establish a connection with the cloud storage server can be used to judge whether the management server of the cloud storage system is successfully logged in.
S210:在距离所述第二文件操作面板的第二预设位置展示第二文件管理面板。S210: Display the second file management panel at a second preset position away from the second file operation panel.
在成功登录云存储系统的管理服务器的情况下,在距离第二文件操作面板的第二预设位置展示第二文件操作面板。这里所说的第二预设位置还可以是第二文件操作面板的左侧、右侧、上侧、下侧等位置,本发明实施例对此不做限定。In the case of successfully logging in to the management server of the cloud storage system, the second file operation panel is displayed at a second preset position away from the second file operation panel. The second preset position mentioned here may also be a position such as a left side, a right side, an upper side, a lower side, etc. of the second file operation panel, which is not limited in this embodiment of the present invention.
S211:展示第二登录面板,并通过所述第二登录面板登录所述管理服务器,在成功登录所述管理服务器后,在距离所述第二文件操作面板的第二预设位置展示第二文件管理面板。S211: Display a second login panel, and log in to the management server through the second login panel, and after successfully logging in to the management server, display a second file at a second preset position away from the second file operation panel Admin panel.
在实际应用中,如果没有成功登录管理服务器,则展示第二登录面板,可以通过第二登录面板上的登录信息输入框输入登录信息,输入完毕后向管理服务器发送了登录请求。在实际应用中,管理服务器确认该登录信息有效的情况下,向客户端反馈登录信息有效的确认结果,具体的,向管理服务器发送登录请求是JS调用OC,当管理服务反馈确认结果时,是OC调用JS,展示第二文件操作面板。示例性的,第二登录面板与图4中的第一登录面板的界面设计相似。In practical applications, if the management server is not successfully logged in, the second login panel is displayed, the login information can be input through the login information input box on the second login panel, and a login request is sent to the management server after the input is completed. In practical applications, when the management server confirms that the login information is valid, it feeds back the confirmation result that the login information is valid to the client. Specifically, sending a login request to the management server is JS calling OC. When the management service returns the confirmation result, it is OC calls JS to display the second file operation panel. Exemplarily, the interface design of the second login panel is similar to that of the first login panel in FIG. 4 .
S212:获得根据所述第二文件管理面板的展示信息确定的目标下载路径。S212: Obtain the target download path determined according to the display information of the second file management panel.
在展示第二文件管理面板之后,可以通过第二文件管理面板选择第一文件的目标下载路径,客户端中的插件可以通过第二文件管理面板的展示信息获得目标存储路径。After displaying the second file management panel, the target download path of the first file can be selected through the second file management panel, and the plug-in in the client can obtain the target storage path through the display information of the second file management panel.
所述向云存储系统的管理服务器发送针对第一文件的下载请求,包括:The sending of the download request for the first file to the management server of the cloud storage system includes:
通过所述第二文件管理面板向云存储系统的管理服务器发送针对第一文件的下载请求;Send a download request for the first file to the management server of the cloud storage system through the second file management panel;
所述下载请求中还包括:所述目标下载路径;The download request further includes: the target download path;
所述接收所述管理服务器反馈的所述待下载文件块的第二存储位置,包括:The second storage location of the to-be-downloaded file block that is fed back by the management server includes:
接收所述管理服务器根据所述目标下载路径确定的第二存储位置。A second storage location determined by the management server according to the target download path is received.
在本发明实施例中,在从所述第二存储位置下载所述待下载文件块,方法还可以包括:In this embodiment of the present invention, when downloading the to-be-downloaded file block from the second storage location, the method may further include:
通过所述第二文件管理面板展示所述第一文件的下载进度。The download progress of the first file is displayed through the second file management panel.
在本发明实施例中,方法还可以包括:In this embodiment of the present invention, the method may further include:
通过所述第二文件管理面板向所述管理服务器发送第三对象新建请求;Send a third object creation request to the management server through the second file management panel;
接收所述管理服务器反馈的针对所述第三对象新建请求的结果信息;receiving the result information of the new request for the third object fed back by the management server;
根据所述结果信息在所述的第三文件管理面板中显示新建的第三对象。The newly created third object is displayed in the third file management panel according to the result information.
在本发明实施例中,方法还可以包括:In this embodiment of the present invention, the method may further include:
接收通过所述第二文件管理面板发送的第三退出登录请求;receiving a third logout request sent through the second file management panel;
根据所述第三退出登录请求,断开与所述管理服务器之间的连接。According to the third logout request, the connection with the management server is disconnected.
应用本发明实施例,通过对文件分块下载,每一个文件块下载的时间比较短,相较于现有技术,减少了文件下载过程中的出错机率。同时,在本发明实施例中,提供针对云存储系统的第二操作面板以供用户操作,这样无需使用单独设置的云存储系统的客户端,简化了用户下载文件的步骤,为用户操作云存储系统中的文件提供了极大的便利性,节省了用户的时间,提升了用户体验。By applying the embodiments of the present invention, by downloading files in blocks, the download time of each file block is relatively short, and compared with the prior art, the probability of errors in the file downloading process is reduced. At the same time, in the embodiment of the present invention, a second operation panel for the cloud storage system is provided for the user to operate, which eliminates the need to use a client of the cloud storage system that is set separately, simplifies the steps for the user to download files, and allows the user to operate the cloud storage system. The files in the system provide great convenience, save the user's time and improve the user experience.
在本发明的另一个具体实施例中,参见图12,提供了文件下载的方法的第三种流程示意图,与图10所示实施例相比,本实施例中,从所述第二存储位置下载所述待下载文件块(S206),包括:In another specific embodiment of the present invention, referring to FIG. 12 , a third schematic flowchart of a method for downloading a file is provided. Compared with the embodiment shown in FIG. 10 , in this embodiment, the file is downloaded from the second storage location Downloading the to-be-downloaded file block (S206) includes:
S2061:将所述待下载文件块中的一个文件块确定为第一文件块。S2061: Determine one file block in the to-be-downloaded file blocks as the first file block.
确定第一文件块的方式与确定目标文件块的方式相同,在这里不进行赘述。The manner of determining the first file block is the same as the manner of determining the target file block, and details are not described here.
S2062:向所述存储服务器发送的第四请求。S2062: Send a fourth request to the storage server.
在实际应用中,第四请求包了第一文件块的标识信息及第一文件块的块号,存储服务器可以根据第四请求确定第一文件块的具体位置。In practical applications, the fourth request includes the identification information of the first file block and the block number of the first file block, and the storage server can determine the specific location of the first file block according to the fourth request.
在具体应用中,当第一哈希值与第二哈希值是相同类型的哈希值时,第四请求中包含第一文件块的第二哈希值,当第一哈希值与第二哈希值是不同类型的哈希值时,第四请求中包含第一文件块的第一哈希值。In a specific application, when the first hash value and the second hash value are the same type of hash value, the fourth request includes the second hash value of the first file block, and when the first hash value is the same as the second hash value When the two hash values are different types of hash values, the fourth request includes the first hash value of the first file block.
S2063:从所述第二存储位置下载所述待下载所述第一文件块。S2063: Download the to-be-downloaded first file block from the second storage location.
具体的,从第一文件块对应的存储位置下载第一文件块,第二存储位置中包含了第一文件块对应的存储位置。Specifically, the first file block is downloaded from the storage location corresponding to the first file block, and the second storage location includes the storage location corresponding to the first file block.
S2064:在所述待下载文件块未全部上下载的情况下,从未下载的文件块中选择文件块,并将所述第一文件块更新为所选择的文件块,返回执行向S2062,直至所述待下载文件块全部下载完成。S2064: In the case that the to-be-downloaded file blocks are not all downloaded, select a file block from the undownloaded file blocks, update the first file block to the selected file block, and return to execution to S2062 until All the file blocks to be downloaded are downloaded.
从未下载的文件块中选择文件块的方式与上述确定第一文件块的方式相同,在这里不进行赘述。The manner of selecting the file block from the undownloaded file blocks is the same as the manner of determining the first file block above, which will not be repeated here.
应用本发明实施例,通过对文件分块下载,每一个文件块下载的时间比较短,相较于现有技术,减少了文件下载过程中的出错机率。By applying the embodiments of the present invention, by downloading files in blocks, the download time of each file block is relatively short, and compared with the prior art, the probability of errors in the file downloading process is reduced.
在本发明的另一个具体实施例中,参见图13,提供了文件下载的方法的第三种流程示意图,与图10所示实施例相比,本实施例中,在S2063之后,还包括S2065、S2066和S2067。In another specific embodiment of the present invention, referring to FIG. 13 , a third schematic flowchart of a method for downloading a file is provided. Compared with the embodiment shown in FIG. 10 , in this embodiment, after S2063 , S2065 is further included. , S2066 and S2067.
S2065:根据所述管理服务器反馈的第二哈希值,确定所述第一文件块是否完整,其中,所述第二哈希值是所述管理服务器在接收到所述第三请求时反馈的。S2065: Determine whether the first file block is complete according to the second hash value fed back by the management server, where the second hash value is fed back by the management server when receiving the third request .
客户端根据第二哈希值确定第一文件块对否完整的方法与存储服务器根据第一哈希值验证目标文件块是否完整的方式相同,在这里不进行赘述。需要说明的是,根据管理服务器反馈的第二哈希值,确定第一文件块对否完整,实际上,管理服务器反馈的第二哈希值与第一文件块之间存在对应关系,根据该对应关系确定第一文件块的第二哈希值,根据第一文件块的第二哈希值确定第一文件块是否完整。The method for the client to determine whether the first file block is complete according to the second hash value is the same as the method for the storage server to verify whether the target file block is complete according to the first hash value, and details are not described here. It should be noted that whether the first file block is complete is determined according to the second hash value fed back by the management server. In fact, there is a corresponding relationship between the second hash value fed back by the management server and the first file block. The corresponding relationship determines the second hash value of the first file block, and determines whether the first file block is complete according to the second hash value of the first file block.
在确定第一文件块完整的情况下,返回执行S2064。If it is determined that the first file block is complete, return to S2064.
S2066:判断所述第一文件块的下载次数是否超过第二预设次数。S2066: Determine whether the number of downloads of the first file block exceeds a second preset number of times.
需要说明的是,第二预设次数可以根据实际情况设置,示例性的,可以是三次,也可以是五次。当第一文件块的下载次数没有超过第二预设次数时,返回执行S2063。It should be noted that the second preset number of times may be set according to actual conditions, and may be exemplarily three times or five times. When the number of downloads of the first file block does not exceed the second preset number of times, return to S2063.
S2067:显示下载失败的信息。S2067: Display the information of download failure.
当第一文件块的下载次数超过第二预设次数,则显示下载失败的提示,示例性的,可以在第一文件管理面板上显示下载失败的提示,这里所说的显示失败的提示,是通过OC语言与JS语言的交互实现的,在本发明实施例中,在下载的过程中,还会显示下载的进度,下载进度可以在第一文件块下载完成时增加,也可以在待下载文件块下载完成后增加,下载进度可以以百分比的形式显示,也可以以已下载的文件大小显示,具体的,显示方式是现有技术,在这里不进行赘述,参考迅雷等下载文件时进度显示的方式。需要说明的是,当显示下载失败的信息时,不会再进行下载操作,只有再次接收到目标文件的下载请求时,才会进行文件的下载,下载失败的文件对应的文件块,存储服务器可以删除。When the number of downloads of the first file block exceeds the second preset number of times, a prompt of download failure is displayed. Exemplarily, a prompt of download failure can be displayed on the first file management panel. Here, the prompt to display failure is It is realized through the interaction between the OC language and the JS language. In the embodiment of the present invention, during the downloading process, the download progress is also displayed. After the block download is completed, the download progress can be displayed in the form of a percentage, or it can be displayed in the size of the downloaded file. Specifically, the display method is the prior art, which will not be repeated here. Refer to the progress displayed when downloading files such as Thunder. Way. It should be noted that when the download failure information is displayed, the download operation will not be performed again. The file download will only be performed when the download request of the target file is received again. The file block corresponding to the failed file can be downloaded by the storage server. delete.
应用本发明实施例,通过对文件分块下载,每一个文件块下载的时间比较短,相较于现有技术,减少了文件下载过程中的出错机率。By applying the embodiments of the present invention, by downloading files in blocks, the download time of each file block is relatively short, and compared with the prior art, the probability of errors in the file downloading process is reduced.
在本发明的另一个具体实施例中,参见图14,提供了文件下载的方法的第五种流程示意图,与图11所示实施例相比,本实施例中,在S2063之后,还包括S2068。In another specific embodiment of the present invention, referring to FIG. 14 , a fifth schematic flowchart of the method for downloading files is provided. Compared with the embodiment shown in FIG. 11 , in this embodiment, after S2063 , S2068 is further included. .
S2068:基于解密算法及自身记录的第二密钥,对所述第一文件块进行解密。S2068: Decrypt the first file block based on the decryption algorithm and the second key recorded by itself.
本领域技术人员可以理解的是,解密是加密的逆过程,在本发明实施例中解密算法与文件上传过程中的加密算法相对应,如果加密算法是AES加密算法,则解密算法是AES解密算法。需要说明的是,第一密钥与对第一文件块进行加密时所使用的密钥相同,基于解密算法及自身记录的第二密钥,对第一文件块进行解密是现有技术,在这里不进行赘述。Those skilled in the art can understand that decryption is an inverse process of encryption. In this embodiment of the present invention, the decryption algorithm corresponds to the encryption algorithm in the file uploading process. If the encryption algorithm is the AES encryption algorithm, the decryption algorithm is the AES decryption algorithm. . It should be noted that the first key is the same as the key used when encrypting the first file block. Based on the decryption algorithm and the second key recorded by itself, it is the prior art to decrypt the first file block. It is not repeated here.
应用本发明实施例,通过对文件分块上传,每一个文件块上传的时间比较短,文件块是一块一块地上传,相较于现有技术,减少了文件上传过程中的出错机率。下载的文件块是加密文件块,保证下载过程中数据的安全。By applying the embodiments of the present invention, by uploading files in blocks, the upload time of each file block is relatively short, and the file blocks are uploaded one by one, which reduces the probability of errors during file uploading compared with the prior art. The downloaded file blocks are encrypted file blocks to ensure data security during the download process.
与图1所示的方法实施例相对应,图15为本发明实施例提供的文件上传装置的结构示意图,该装置包括:第一接收模块301,分割模块302,第一确定模块303,第一发送模块304,第二接收模块305,第一上传模块306和更新模块307。Corresponding to the method embodiment shown in FIG. 1 , FIG. 15 is a schematic structural diagram of a file uploading apparatus according to an embodiment of the present invention. The apparatus includes: a
第一接收模块301,用于接收针对目标文件的上传请求。The
分割模块302,用于将所述目标文件按照预设分割规则分割成文件块。The
第一确定模块303,用于在分割好的文件块中确定待上传文件块。The first determining
第一发送模块304,用于向云存储系统的管理服务器发送上传所述待上传文件块的第一请求,其中,所述第一请求中包括所述待上传文件块的数量。The
第二接收模块305,用于接收所述管理服务器反馈的第一存储位置,其中,所述第一存储位置为所述待上传文件块在云存储系统的存储服务器中的存储位置。The
第一上传模块306,用于将所述待上传文件块上传至所述第一存储位置。The
更新模块307,用于在分割好的文件块未全部上传的情况下,从未上传的文件块中选择文件块,将所述待上传文件块更新为所选择的文件块,并返回执行所述第一发送模块304,直至分割好的文件块全部上传完成。The updating
应用本发明实施例,通过对文件分块上传,每一个文件块上传的时间比较短,相较于现有技术,减少了文件上传过程中的出错机率。By applying the embodiments of the present invention, by uploading files in blocks, the uploading time of each file block is relatively short, and compared with the prior art, the probability of errors in the file uploading process is reduced.
与图2所示的方法实施例相对应,该第一接收模块,可以包括:第一监测子模块、第一展示子模块和第一接收子模块。Corresponding to the method embodiment shown in FIG. 2 , the first receiving module may include: a first monitoring sub-module, a first displaying sub-module and a first receiving sub-module.
第一监测子模块,用于监测是否接收到用于展示第一文件操作面板的第一展示指令;a first monitoring sub-module for monitoring whether a first display instruction for displaying the first file operation panel is received;
第一展示子模块,用于在第一监测子模块的监测结果为是的情况下,展示所述第一文件操作面板;a first display submodule, configured to display the first file operation panel when the monitoring result of the first monitoring submodule is yes;
第一接收子模块,用于接收通过所述第一文件操作面板发送的针对目标文件的上传请求。The first receiving sub-module is configured to receive an upload request for a target file sent through the first file operation panel.
在本发明的一个具体实施例中,所述第一接收模块,还包括:第一判断子模块、第二展示子模块、第三展示子模块和第一获得子模块。In a specific embodiment of the present invention, the first receiving module further includes: a first judging sub-module, a second displaying sub-module, a third displaying sub-module and a first obtaining sub-module.
第一判断子模块,用于判断是否成功登录云存储系统的管理服务器;The first judgment submodule is used to judge whether the management server of the cloud storage system is successfully logged in;
第二展示子模块,用于在所述第一判断子模块的判断结果为成功的情况下,在距离所述第一文件操作面板的第一预设位置展示第一文件管理面板;a second display submodule, configured to display the first file management panel at a first preset position away from the first file operation panel when the determination result of the first determination submodule is successful;
第三展示子模块,用于在所述第一判断子模块的判断结果为失败的情况下,展示第一登录面板,并通过所述第一登录面板登录所述管理服务器,在成功登录所述管理服务器后,在距离所述第一文件操作面板的第一预设位置展示第一文件管理面板;The third display sub-module is configured to display a first login panel when the judgment result of the first judgment sub-module is failure, and log in to the management server through the first login panel. After the server is managed, the first file management panel is displayed at a first preset position away from the first file operation panel;
第一获得子模块,用于获得根据所述第一文件管理面板的展示信息确定的目标存储路径;The first obtaining submodule is used to obtain the target storage path determined according to the display information of the first file management panel;
所述第一请求中还包括:所述目标存储路径;The first request further includes: the target storage path;
所述第二接收模块,具体用于:The second receiving module is specifically used for:
接收所述管理服务器根据所述目标存储路径确定的第一存储位置。A first storage location determined by the management server according to the target storage path is received.
在本发明的一个优选的实施例中,所述装置,还包括:第一展示模块。In a preferred embodiment of the present invention, the device further includes: a first display module.
第一展示模块,用于通过所述第一文件管理面板展示所述目标文件的上传进度。The first display module is configured to display the upload progress of the target file through the first file management panel.
在本发明的一个优选的实施例中,所述装置,还包括:第六发送模块。In a preferred embodiment of the present invention, the apparatus further includes: a sixth sending module.
第六发送模块,用于向所述管理服务器发送第一对象新建请求;a sixth sending module, configured to send a first object creation request to the management server;
第八接收模块,用于接收所述管理服务器反馈的针对所述第一对象新建请求的结果信息;an eighth receiving module, configured to receive the result information of the new request for the first object fed back by the management server;
第一显示模块,用于根据所述结果信息在所述的第一文件管理面板中显示新建的第一对象。The first display module is configured to display the newly created first object in the first file management panel according to the result information.
在本发明的一个优选的实施例中,所述装置,还包括:第九接收模块。In a preferred embodiment of the present invention, the apparatus further includes: a ninth receiving module.
第九接收模块,用于接收通过所述第一文件管理面板发送的第一退出登录请求;a ninth receiving module, configured to receive the first logout request sent through the first file management panel;
第一断开模块,用于根据所述第一退出登录请求,断开与所述管理服务器之间的连接。A first disconnection module, configured to disconnect the connection with the management server according to the first logout request.
应用本发明实施例,通过对文件分块上传,每一个文件块上传的时间比较短,相较于现有技术,减少了文件上传过程中的出错机率。同时,在本发明实施例中,提供针对云存储系统的第一操作面板以供用户操作,这样无需使用单独设置的云存储系统的客户端,简化了用户上传文件的步骤,为用户操作云存储系统中的文件提供了极大的便利性,节省了用户的时间,提升了用户体验。By applying the embodiments of the present invention, by uploading files in blocks, the uploading time of each file block is relatively short, and compared with the prior art, the probability of errors in the file uploading process is reduced. At the same time, in the embodiment of the present invention, a first operation panel for the cloud storage system is provided for the user to operate, which eliminates the need to use a client of the cloud storage system that is set separately, simplifies the steps of uploading files by the user, and enables the user to operate the cloud storage system. The files in the system provide great convenience, save the user's time and improve the user experience.
与图5所示的方法实施例相对应,该装置还包括:第二发送模块和第三接收模块。Corresponding to the method embodiment shown in FIG. 5 , the apparatus further includes: a second sending module and a third receiving module.
第二发送模块,用于向所述管理服务器发送获取目标文件的标识信息的获取请求。The second sending module is configured to send an obtaining request for obtaining the identification information of the target file to the management server.
在一个具体实施例中,所述第一请求还包括:所述目标文件的标识信息;所述第一存储位置是所述管理服务器根据所述目标文件的标识信息确定的。In a specific embodiment, the first request further includes: identification information of the target file; and the first storage location is determined by the management server according to the identification information of the target file.
第三接收模块,用于接收所述管理服务器反馈的第二信息,其中所述第二信息中包括所述目标文件的标识信息。具体的,所述第二信息包括所述目标文件的当前版本信息。The third receiving module is configured to receive second information fed back by the management server, wherein the second information includes identification information of the target file. Specifically, the second information includes current version information of the target file.
应用本发明实施例,通过对文件分块上传,每一个文件块上传的时间比较短,相较于现有技术,减少了文件上传过程中的出错机率。同时,基于目标文件的标识信息,保证在上传的过程中不会出现文件块上传错乱的情况。By applying the embodiments of the present invention, by uploading files in blocks, the uploading time of each file block is relatively short, and compared with the prior art, the probability of errors in the file uploading process is reduced. At the same time, based on the identification information of the target file, it is ensured that there will be no disorderly upload of file blocks during the uploading process.
与图6所示的方法实施例相对应,该第一上传模块306,包括:第一确定子模块、第一发送子模块、上传子模块和第一更新子模块。Corresponding to the method embodiment shown in FIG. 6 , the
第一确定子模块,用于将所述待上传文件块中的一个文件块确定为目标文件块。The first determination submodule is configured to determine a file block in the to-be-uploaded file blocks as a target file block.
第一发送子模块,用于向所述存储服务器发送第二请求。The first sending submodule is configured to send a second request to the storage server.
所述第二请求包括:所述待上传文件块中各文件块的第一哈希值,其中,所述第一哈希值为:通过计算所述待上传文件块中每一文件块存储的数据的哈希值得到的。The second request includes: the first hash value of each file block in the to-be-uploaded file blocks, wherein the first hash value is: calculated by calculating the value stored in each file block in the to-be-uploaded file block; The hash value of the data is obtained.
上传子模块,用于根据所述第一存储位置,上传所述目标文件块。The uploading submodule is configured to upload the target file block according to the first storage location.
第一更新子模块,用于在所述待上传文件块未全部上传的情况下,从未上传的文件块中选择文件块,并将所述目标文件块更新为所选择的文件块,返回执行所述第一发送子模块,直至所述待上传文件块全部上传完成。The first update submodule is used to select a file block from the unuploaded file blocks under the condition that the to-be-uploaded file blocks are not all uploaded, update the target file block to the selected file block, and return to execute the first sending sub-module until all the file blocks to be uploaded are uploaded.
应用本发明实施例,通过对文件分块上传,每一个文件块上传的时间比较短,文件块是一块一块地上传,相较于现有技术,减少了文件上传过程中的出错机率。By applying the embodiments of the present invention, by uploading files in blocks, the upload time of each file block is relatively short, and the file blocks are uploaded one by one, which reduces the probability of errors during file uploading compared with the prior art.
与图7所示的方法实施例相对应,第一上传模块306还包括:第二发送子模块、第一接收子模块、第一判断子模块和第一显示子模块。Corresponding to the method embodiment shown in FIG. 7 , the
第二发送子模块,用于在接收到所述存储服务器反馈的上传完成的信息情况下,向所述管理服务器发送查询请求,其中,所述查询请求用于查询所述目标文件块是否上传成功。The second sending sub-module is configured to send a query request to the management server in the case of receiving the upload completion information fed back by the storage server, wherein the query request is used to query whether the target file block is uploaded successfully .
第一接收子模块,用于接收所述管理服务器反馈的查询结果。The first receiving sub-module is configured to receive the query result fed back by the management server.
第一判断子模块,用于在所述查询结果表明上传失败时,判断所述目标文件块的上传次数是否超过第一预设次数;其中,所述查询结果是所述存储服务器根据所述第一哈希值,检查所述待上传文件块的完整状态后确定的。The first judgment submodule is configured to judge whether the number of uploads of the target file block exceeds a first preset number of times when the query result indicates that the upload fails; wherein, the query result is that the storage server according to the first A hash value, determined after checking the complete state of the file block to be uploaded.
第一显示子模块,用于在所述判断子模块的判断结果为是的情况下,显示上传失败的提示。The first display sub-module is configured to display a prompt of upload failure when the determination result of the determination sub-module is yes.
所述上传子模块,还用于在所述第一判断子模块的判断结果为否的情况下,根据所述第一存储位置,上传所述目标文件块。The uploading sub-module is further configured to upload the target file block according to the first storage location when the judgment result of the first judging sub-module is no.
应用本发明实施例,通过对文件分块上传,每一个文件块上传的时间比较短,文件块是一块一块地上传,相较于现有技术,减少了文件上传过程中的出错机率。By applying the embodiments of the present invention, by uploading files in blocks, the upload time of each file block is relatively short, and the file blocks are uploaded one by one, which reduces the probability of errors during file uploading compared with the prior art.
与图8所示的方法实施例相对应,第一上传模块还包括:加密子模块。Corresponding to the method embodiment shown in FIG. 8 , the first uploading module further includes: an encryption sub-module.
加密子模块,用于利用加密算法及自身记录的第一密钥,对所述目标文件块进行加密。The encryption sub-module is used for encrypting the target file block by using the encryption algorithm and the first key recorded by itself.
所述上传子模块,具体用于:根据所述第一存储位置,上传加密后的所述目标文件块。The uploading submodule is specifically configured to: upload the encrypted target file block according to the first storage location.
应用本发明实施例,通过对文件分块上传,每一个文件块上传的时间比较短,文件块是一块一块地上传,相较于现有技术,减少了文件上传过程中的出错机率。对文件进行加密,保证了上传过程中数据的安全。By applying the embodiments of the present invention, by uploading files in blocks, the upload time of each file block is relatively short, and the file blocks are uploaded one by one, which reduces the probability of errors during file uploading compared with the prior art. The file is encrypted to ensure the security of the data during the uploading process.
与图9所示的方法实施例相对应,该装置还包括:第三发送模块、第四接收模块和第二上传模块。Corresponding to the method embodiment shown in FIG. 9 , the apparatus further includes: a third sending module, a fourth receiving module, and a second uploading module.
第三发送模块,用于在分割好的文件块全部上传完成之后向所述管理服务器发送文件块上传完成确认请求。The third sending module is configured to send a file block upload completion confirmation request to the management server after all the divided file blocks are uploaded.
第四接收模块,用于接收所述管理服务器反馈的确认结果。The fourth receiving module is configured to receive the confirmation result fed back by the management server.
第二上传模块,用于在所述确认结果表明存在遗漏的文件块后,将所述遗漏的文件块上传至所述第一存储位置;并返回执行所述第三发送模块310。The second uploading module is configured to upload the missing file block to the first storage location after the confirmation result indicates that there is a missing file block; and return to execute the third sending module 310 .
应用本发明实施例,通过对文件分块上传,每一个文件块上传的时间比较短,文件块是一块一块地上传,相较于现有技术,减少了文件上传过程中的出错机率。By applying the embodiments of the present invention, by uploading files in blocks, the upload time of each file block is relatively short, and the file blocks are uploaded one by one, which reduces the probability of errors during file uploading compared with the prior art.
与图10所示的方法实施例相对应,图16为本发明实施例提供的文件下载装置的结构示意图,该装置包括:第四发送模块401、第五接收模块402、第二确定模块403、第五发送模块404、第六接收模块405和下载模块406。Corresponding to the method embodiment shown in FIG. 10 , FIG. 16 is a schematic structural diagram of a file downloading apparatus provided by an embodiment of the present invention. The apparatus includes: a
第四发送模块401,用于向云存储系统的管理服务器发送针对第一文件的下载请求,其中,所述第一文件包括至少一个文件块。The
第五接收模块402,用于接收所述管理服务器反馈的第三信息,其中,所述第三信息中包括所述第一文件的文件块数量。The
第二确定模块403,用于基于所述文件块数量,确定待下载文件块。The second determining
第五发送模块404,用于向所述管理服务器发送下载所述待下载文件块的第三请求,其中所述第三请求包含所述待下载文件块的数量。The
第六接收模块405,用于接收所述管理服务器反馈的所述待下载文件块的第二存储位置。The
下载模块406,用于从所述第二存储位置下载所述待下载文件块,在所述第一文件未下载完毕的情况下,返回执行所述第二确定模块403,直至所述第一文件下载完成。The
具体的,所述第三信息包括:所述第一文件的当前版本信息。Specifically, the third information includes: current version information of the first file.
应用本发明实施例,通过对文件分块下载,每一个文件块下载的时间比较短,相较于现有技术,减少了文件下载过程中的出错机率。By applying the embodiments of the present invention, by downloading files in blocks, the download time of each file block is relatively short, and compared with the prior art, the probability of errors in the file downloading process is reduced.
与图11所示的方法实施例相对应,该装置包括:第一监测模块、第二展示模块、第一判断模块、第三展示模块、第四展示模块和第一获得模块。Corresponding to the method embodiment shown in FIG. 11 , the apparatus includes: a first monitoring module, a second display module, a first judgment module, a third display module, a fourth display module, and a first obtaining module.
第一监测模块,用于监测是否接收到用于展示第二文件操作面板的第二展示指令;a first monitoring module for monitoring whether a second display instruction for displaying the second file operation panel is received;
第二展示模块,用于在所述第一监测模块的监测结果为是的情况下,展示所述第二文件操作面板;a second display module, configured to display the second file operation panel when the monitoring result of the first monitoring module is yes;
第一判断模块,用于判断是否成功登录云存储系统的管理服务器;The first judgment module is used for judging whether the management server of the cloud storage system is successfully logged in;
第三展示模块,用于在所述第一判断模块的判断结果为成功的情况下,在距离所述第二文件操作面板的第二预设位置展示第二文件管理面板;a third display module, configured to display the second file management panel at a second preset position away from the second file operation panel when the determination result of the first determination module is successful;
第四展示模块,用于在所述第一判断模块的判断结果为失败的情况下,展示第二登录面板,并通过所述第二登录面板登录所述管理服务器,在成功登录所述管理服务器后,在距离所述第二文件操作面板的第二预设位置展示第二文件管理面板;The fourth display module is used to display a second login panel when the judgment result of the first judgment module is a failure, and log in to the management server through the second login panel, and log in to the management server successfully. after that, displaying a second file management panel at a second preset position away from the second file operation panel;
第一获得模块,用于获得根据所述第二文件管理面板的展示信息确定的目标下载路径;a first obtaining module, configured to obtain a target download path determined according to the display information of the second file management panel;
所述第六接收模块,具体用于:The sixth receiving module is specifically used for:
通过所述第二文件管理面板向云存储系统的管理服务器发送针对第一文件的下载请求;Send a download request for the first file to the management server of the cloud storage system through the second file management panel;
所述下载请求中还包括:所述目标下载路径;The download request further includes: the target download path;
所述第六接收模块,具体用于:The sixth receiving module is specifically used for:
接收所述管理服务器根据所述目标下载路径确定的第二存储位置。A second storage location determined by the management server according to the target download path is received.
应用本发明实施例,通过对文件分块下载,每一个文件块下载的时间比较短,相较于现有技术,减少了文件下载过程中的出错机率。同时,在本发明实施例中,提供针对云存储系统的第二操作面板以供用户操作,这样无需使用单独设置的云存储系统的客户端,简化了用户下载文件的步骤,为用户操作云存储系统中的文件提供了极大的便利性,节省了用户的时间,提升了用户体验。By applying the embodiments of the present invention, by downloading files in blocks, the download time of each file block is relatively short, and compared with the prior art, the probability of errors in the file downloading process is reduced. At the same time, in the embodiment of the present invention, a second operation panel for the cloud storage system is provided for the user to operate, which eliminates the need to use a client of the cloud storage system that is set separately, simplifies the steps for the user to download files, and allows the user to operate the cloud storage system. The files in the system provide great convenience, save the user's time and improve the user experience.
与图12所示的方法实施例相对应,所述装置,还包括第七接收模块。Corresponding to the method embodiment shown in FIG. 12 , the apparatus further includes a seventh receiving module.
第七接收模块,用于接收所述管理服务器反馈的第二哈希值,其中,所述第二哈希值为:通过计算所述待下载文件块中每一文件块存储的数据的哈希值得到的。A seventh receiving module, configured to receive a second hash value fed back by the management server, wherein the second hash value is: by calculating the hash of the data stored in each file block in the to-be-downloaded file blocks value obtained.
所述下载模块406,包括:第二确定子模块、第三发送子模块、下载子模块和第二更新子模块。The
第二确定子模块,用于将所述待下载文件块中的一个文件块确定为第一文件块;The second determination submodule is used for determining a file block in the to-be-downloaded file blocks as the first file block;
第三发送子模块,用于向所述存储服务器发送的第四请求。The third sending submodule is used for sending the fourth request to the storage server.
下载子模块,用于从所述第二存储位置下载所述待下载所述第一文件块。A download submodule, configured to download the to-be-downloaded first file block from the second storage location.
第二更新子模块,用于在所述待下载文件块未全部上下载的情况下,从未下载的文件块中选择文件块,并将所述第一文件块更新为所选择的文件块,返回执行所述第三发送子模块。a second update submodule, configured to select a file block from the undownloaded file blocks when the file blocks to be downloaded are not all downloaded, and update the first file block to the selected file block, Return to execute the third sending sub-module.
应用本发明实施例,通过对文件分块下载,每一个文件块下载的时间比较短,相较于现有技术,减少了文件下载过程中的出错机率。By applying the embodiments of the present invention, by downloading files in blocks, the download time of each file block is relatively short, and compared with the prior art, the probability of errors in the file downloading process is reduced.
与图13所示的方法实施例相对应,所述下载模块406,包括:第二接收子模块、第三确定子模块、第二判断子模块和第二显示子模块。Corresponding to the method embodiment shown in FIG. 13 , the
第二接收子模块,用于接收所述管理服务器反馈的第二哈希值,其中,所述第二哈希值为:计算所述待下载的文件块中存储的数据的哈希值得到的。The second receiving sub-module is configured to receive the second hash value fed back by the management server, where the second hash value is obtained by calculating the hash value of the data stored in the file block to be downloaded .
第三确定子模块,用于根据所述管理服务器反馈的第二哈希值,确定所述第一文件块是否完整,其中,所述第二哈希值是所述管理服务器在接收到所述第三请求时反馈的。The third determination submodule is configured to determine whether the first file block is complete according to the second hash value fed back by the management server, wherein the second hash value is the Feedback on the third request.
所述第二更新子模块,还用于在所述第三确定子模块的确定结果为是的情况下,在所述待下载文件块未全部上下载的情况下,从未下载的文件块中选择文件块,并将所述第一文件块更新为所选择的文件块,返回执行所述第三发送子模块。The second update sub-module is further configured to, in the case that the determination result of the third determination sub-module is yes, in the case that the to-be-downloaded file blocks are not all uploaded and downloaded, the un-downloaded file blocks Select a file block, update the first file block to the selected file block, and return to execute the third sending submodule.
第二判断子模块,用于在所述第三确定子模块的确定结果为否的情况下,判断所述第一文件块的下载次数是否超过第二预设次数。The second determination submodule is configured to determine whether the number of downloads of the first file block exceeds a second preset number of times when the determination result of the third determination submodule is no.
第二显示子模块,用于在所述判断子模块的判断结果为超过的情况下,显示下载失败的提示。The second display sub-module is configured to display a download failure prompt when the determination result of the determination sub-module is exceeded.
所述下载子模块,还用于在所述第二判断子模块的判断结果为不超过的情况下,从所述第二存储位置下载所述待下载所述第一文件块。The downloading sub-module is further configured to download the to-be-downloaded first file block from the second storage location when the judgment result of the second judging sub-module is not exceeding.
应用本发明实施例,通过对文件分块下载,每一个文件块下载的时间比较短,相较于现有技术,减少了文件下载过程中的出错机率。By applying the embodiments of the present invention, by downloading files in blocks, the download time of each file block is relatively short, and compared with the prior art, the probability of errors in the file downloading process is reduced.
与图14所示的方法实施例相对应,所述下载模块,还包括解密子模块。Corresponding to the method embodiment shown in FIG. 14 , the download module further includes a decryption submodule.
解密子模块,用于基于解密算法及自身记录的第二密钥,对所述第一文件块进行解密。The decryption submodule is configured to decrypt the first file block based on the decryption algorithm and the second key recorded by itself.
应用本发明实施例,通过对文件分块上传,每一个文件块上传的时间比较短,文件块是一块一块地上传,相较于现有技术,减少了文件上传过程中的出错机率。下载的文件块是加密文件块,保证下载过程中数据的安全。By applying the embodiments of the present invention, by uploading files in blocks, the upload time of each file block is relatively short, and the file blocks are uploaded one by one, which reduces the probability of errors during file uploading compared with the prior art. The downloaded file blocks are encrypted file blocks to ensure data security during the download process.
图17为本发明实施例提供的文件传输方法的流程示意图,方法包括:17 is a schematic flowchart of a file transmission method provided by an embodiment of the present invention, where the method includes:
S501:监测是否接收到用于第三文件操作面板的第三展示指令。S501: Monitor whether a third display instruction for a third file operation panel is received.
在本发明实施例中,可以是具有文件传输的客户端进行监测,这里所说的具有文件传输的客户端可以为专有文件传输功能的客户端,也可以为带有文件传输功能的客户端。专有文件传输功能的客户端可以为只具有与文件传输等相关功能的客户端,即专门为文件传输而定制的客户端,而带有文件传输功能的客户端除了具有文件传输功能,还具有其他功能,示例性的,可以为对文件的编辑功能等等。In this embodiment of the present invention, the monitoring may be performed by a client with file transmission. The client with file transmission mentioned here may be a client with a dedicated file transmission function, or a client with a file transmission function. . The client with the exclusive file transfer function can be the client that only has functions related to file transfer, that is, the client specially customized for file transfer, while the client with the file transfer function has the file transfer function and Other functions, by way of example, may be editing functions for files and the like.
带有文件传输功能的客户端,示例性的,可以为带有文件传输功能的PS,进一步的,该PS安装在Mac系统中,当然带有文件传输功能的客户端还可以为办公软件、视频编辑软件、音频编辑软件、阅读软件等等。在实际应用中,带有文件传输功能的客户端可以通过具有文件传输功能的插件实现文件的传输。A client with a file transfer function, exemplarily, can be a PS with a file transfer function. Further, the PS is installed in a Mac system. Of course, the client with a file transfer function can also be office software, video Editing software, audio editing software, reading software, etc. In practical applications, the client with the file transfer function can realize the file transfer through the plug-in with the file transfer function.
在实际应用中,第三展示指令是用于展示第三文件操作面板的展示指令,进一步的,可以说是展示客户端中文件操作面板的展示指令,具体的,客户端中的插件当监测到文件的保存文件事件、打开文件事件等等,均可以默认为接收到第一展示指令。需要说明的是,在本发明实施例中所说的客户端均为带有文件传输功能的客户端,进一步的,是带有文件传输功能的插件的客户端。In practical applications, the third display instruction is a display instruction for displaying the third file operation panel. Further, it can be said to be a display instruction for displaying the file operation panel in the client. Specifically, when the plug-in in the client detects the A file saving event, a file opening event, etc., can all default to receiving the first display instruction. It should be noted that the clients mentioned in the embodiments of the present invention are all clients with a file transfer function, and further, are clients with a plug-in with a file transfer function.
S502:展示所述第三文件操作面板。S502: Display the third file operation panel.
在接收到第三展示指令后,在客户端展示第三文件操作面板,在实际应用中,该第三文件操作面板可以是由JavaScript语言编写的页面,是UI设计。具体的,第三文件操作面板是插件其中一个界面,具体的展示方法是JS与OC交互实现的,在这里不进行赘述。需要说明的是,在本发明实施例中所说的插件均为带有文件传输功能的插件。After receiving the third display instruction, the third file operation panel is displayed on the client side. In practical applications, the third file operation panel may be a page written in JavaScript language, which is a UI design. Specifically, the third file operation panel is one of the interfaces of the plug-in, and the specific display method is realized by the interaction between JS and OC, which will not be repeated here. It should be noted that the plug-ins mentioned in the embodiments of the present invention are all plug-ins with a file transfer function.
S503:接收通过所述第三文件操作面板发送的针对第二文件的文件传输指令。S503: Receive a file transfer instruction for the second file sent through the third file operation panel.
在实际应用中,客户端与第三文件操作面板之间建立了连接,客户端可以接收通过第三文件操作面板文件传输指令。In practical applications, a connection is established between the client and the third file operation panel, and the client can receive a file transfer instruction through the third file operation panel.
S504:判断是否成功登录云存储系统的管理服务器。S504: Determine whether the management server of the cloud storage system is successfully logged in.
在文件传输的时候,客户端需要与云存储系统建立连接,进一步,需要与云存储系统中的管理服务器和存储服务器建立连接才能完成文件的传输,因此需要判断是否成功登录管理服务器。During file transfer, the client needs to establish a connection with the cloud storage system. Further, it needs to establish a connection with the management server and the storage server in the cloud storage system to complete the file transfer. Therefore, it is necessary to determine whether the management server is successfully logged in.
S505:在距离所述第三文件操作面板的第三预设位置展示第三文件管理面板。S505: Display a third file management panel at a third preset position away from the third file operation panel.
在成功登录管理服务器后,则在距离第三文件操作面板的第三预设位置展示第三文件管理面板。示例性的,在PS中的第三文件管理面板可以如图18所示,在图18中,第三文件管理面板位于第三文件操作面板的右侧。这里所说的第三预设位置还可以是第三文件操作面板的左侧、上侧、下侧等位置,本发明实施例对此不做限定。需要说明的是,在第三文件操作面板中的“从云盘打开”、“保存到云盘”中的云盘是本发明实施例中所说的云存储系统。After successfully logging in to the management server, the third file management panel is displayed at a third preset position away from the third file operation panel. Exemplarily, the third file management panel in the PS may be as shown in FIG. 18 . In FIG. 18 , the third file management panel is located on the right side of the third file operation panel. The third preset position mentioned here may also be a position on the left side, the upper side, the lower side, etc. of the third file operation panel, which is not limited in this embodiment of the present invention. It should be noted that the cloud disk in "open from cloud disk" and "save to cloud disk" in the third file operation panel is the cloud storage system mentioned in the embodiment of the present invention.
S506:展示第三登录面板,并通过所述第三登录面板登录所述管理服务器,在成功登录所述管理服务器后,在距离所述第二文件操作面板的第三预设位置展示第二文件管理面板。S506: Display a third login panel, and log in to the management server through the third login panel, and after successfully logging in to the management server, display a second file at a third preset position away from the second file operation panel Admin panel.
在实际应用中,如果没有成功登录管理服务器,则展示第三登录面板,示例性的,第三登录面板可以图19所示,可以通过第三登录面板上的登录信息输入框输入登录信息,输入完毕后,点击“登录”按钮即认为向管理服务器发送了登录请求。在实际应用中,管理服务器确认该登录信息有效的情况下,向客户端反馈登录信息有效的确认结果,具体的,向管理服务器发送登录请求是JS调用OC,当管理服务反馈确认结果时,是OC调用JS,展示第三文件操作面板。In practical applications, if the management server is not successfully logged in, a third login panel is displayed. Exemplarily, the third login panel can be as shown in FIG. 19 . The login information can be entered through the login information input box on the third login panel, and the After completion, click the "Login" button, it is considered that a login request has been sent to the management server. In practical applications, when the management server confirms that the login information is valid, it feeds back the confirmation result that the login information is valid to the client. Specifically, sending a login request to the management server is JS calling OC. When the management service returns the confirmation result, it is OC calls JS to display the third file operation panel.
S507:获得根据所述第一文件管理面板的展示信息确定的目标路径,根据所述目标路径和所述文件传输指令进行所述第二文件的传输。S507: Obtain a target path determined according to the display information of the first file management panel, and transmit the second file according to the target path and the file transfer instruction.
在展示第三文件管理面板之后,可以通过第三文件管理面板选择目标路径,客户端可以通过第一文件管理面板的展示信息获得目标路径,具体的,可以通过JS与OC调用获取目标存储路径。根据目标路径和文件传输指令进行传输。这里所说的文件传输可以为文件的上传或下载,具体的,文件的上传或下载方法,可以如上述内容所示,也可以是其他的上传或下载方法,在这里不进行限定。After displaying the third file management panel, the target path can be selected through the third file management panel, and the client can obtain the target path through the display information of the first file management panel. Specifically, the target storage path can be obtained through JS and OC calls. Transfer according to the destination path and file transfer instructions. The file transfer mentioned here may be file uploading or downloading. Specifically, the file uploading or downloading method may be as shown in the above content, or may be other uploading or downloading methods, which are not limited here.
需要说明的是,在接收到通过第一登录面板或者第一文件管理面板发送的取消请求,则会关闭对应的窗口,示例性的,如果接收通过第三登录面板发送的取消请求,则关闭该第三登录面板。It should be noted that when a cancellation request sent through the first login panel or the first file management panel is received, the corresponding window will be closed. Exemplarily, if a cancellation request sent through the third login panel is received, the corresponding window will be closed. The third login panel.
在本发明的一个优选的实施例中,在所述获得根据所述第一文件管理面板的展示信息确定的目标路径,根据所述目标路径和所述文件传输指令进行文件传输之后,还包括:In a preferred embodiment of the present invention, after obtaining the target path determined according to the display information of the first file management panel, and performing file transfer according to the target path and the file transfer instruction, the method further includes:
通过所述第三文件管理面板展示所述第二文件的传输进度。The transfer progress of the second file is displayed through the third file management panel.
在实际应用中,在文件进行传输之后,可以通过第三文件管理面板显示第二标文件的传输进度,传输进度可以以百分比的形式显示,也可以以已传输的文件大小显示,具体的,显示方式是现有技术,在这里不进行赘述,参考迅雷等下载文件时进度显示的方式。In practical applications, after the file is transferred, the transfer progress of the second target file can be displayed through the third file management panel. The transfer progress can be displayed in the form of a percentage or the size of the transferred file. Specifically, the display The method is the prior art, which will not be repeated here, and refer to the method of displaying progress when downloading files such as Thunder.
在本发明的一个优选的实施例中,所述方法还包括:In a preferred embodiment of the present invention, the method further includes:
通过所述第三文件管理面板向所述管理服务器发送第二对象新建请求;Send a second object creation request to the management server through the third file management panel;
接收所述管理服务器反馈的针对所述第二对象新建请求的结果信息;receiving the result information of the new request for the second object fed back by the management server;
根据所述结果信息在所述第三文件管理面板中显示新建的第二对象。The newly created second object is displayed in the third file management panel according to the result information.
在实际应用中,这里所说的第二对象新建请求可以为文件夹新建请求,示例性的,可以通过图18中的“新建文件夹”按钮发送第二对象新建请求,第二对象新建请求中还可以携带被新建的第二对象存储位置、名称等信息。第二文件管理面板显示的新建的第二对象,可以为在第二对象的存储位置,显示带有第二对象名称的文件夹。In a practical application, the second object creation request mentioned here may be a folder creation request. Exemplarily, the second object creation request may be sent through the “New Folder” button in FIG. 18 . In the second object creation request It may also carry information such as the storage location and name of the newly created second object. The newly created second object displayed on the second file management panel may be a folder with the name of the second object displayed in the storage location of the second object.
在本发明的一个优选实施例中,方法可以还包括:In a preferred embodiment of the present invention, the method may further include:
接收通过所述第三文件管理面板发送的第二退出登录请求;receiving a second logout request sent through the third file management panel;
根据所述第二退出登录请求,断开与所述管理服务器之间的连接。According to the second logout request, the connection with the management server is disconnected.
示例性的,可以通过图18中的“退出”按钮发送第二退出登录请求,当断开管理服务器之间的连接,则展示如图19所示的第三文件管理面板。Exemplarily, a second logout request may be sent through the "Logout" button in FIG. 18 , and when the connection between the management servers is disconnected, the third file management panel shown in FIG. 19 is displayed.
应用本发明实施例,提供了针对云存储系统的第三操作面板以供用户操作,这样无需使用单独设置的云存储系统的客户端,简化了用户传输文件的步骤,为用户操作云存储系统中的文件提供了极大的便利性,节省了用户的时间,提升了用户体验。By applying the embodiments of the present invention, a third operation panel for the cloud storage system is provided for the user to operate, so that it is not necessary to use a client of the cloud storage system separately set, the steps of transferring files for the user are simplified, and the operation of the cloud storage system is simplified for the user. It provides great convenience, saves the user's time, and improves the user experience.
与图17所示的方法实施例相对应,图20为本发明实施例提供的文件传输装置的结构示意图,该装置可以包括:第二监测模块601、第五展示模块602、第十接收模块603、第二判断模块604、第六展示模块605、第七展示模块606和传输模块607。Corresponding to the method embodiment shown in FIG. 17 , FIG. 20 is a schematic structural diagram of a file transmission apparatus provided by an embodiment of the present invention, and the apparatus may include: a
第二监测模块601,用于监测是否接收到用于第三文件操作面板的第三展示指令;The
第五展示模块602,用于在所述第二监测模块的监测结果为是的情况下,展示所述第三文件操作面板;a
第十接收模块603,用于接收通过所述第三文件操作面板发送的针对第二文件的文件传输指令;A
第二判断模块604,用于判断是否成功登录云存储系统的管理服务器;The
第六展示模块605,用于在所述第二判断模块604的判断结果为成功的情况下,在距离所述第三文件操作面板的第三预设位置展示第三文件管理面板;a
第七展示模块606,用于在所述第二判断模块604的判断结果为失败的情况下,展示第三登录面板,并通过所述第三登录面板登录所述管理服务器,在成功登录所述管理服务器后,在距离所述第二文件操作面板的第三预设位置展示第二文件管理面板;The
传输模块607,用于获得根据所述第一文件管理面板的展示信息确定的目标路径,根据所述目标路径和所述文件传输指令进行所述第二文件的传输。The transmission module 607 is configured to obtain a target path determined according to the display information of the first file management panel, and perform the transmission of the second file according to the target path and the file transmission instruction.
在本发明的一个优选的实施例中,所述装置,还可以包括:第八展示模块(图中未示出)。In a preferred embodiment of the present invention, the apparatus may further include: an eighth display module (not shown in the figure).
第八展示模块,用于通过所述第三文件管理面板展示所述第二文件的传输进度。The eighth display module is configured to display the transmission progress of the second file through the third file management panel.
在本发明的一个优选的实施例中,所述装置,还可以包括:第七发送模块、第十一接收模块和第二显示模块(图中未示出)。In a preferred embodiment of the present invention, the apparatus may further include: a seventh sending module, an eleventh receiving module and a second display module (not shown in the figure).
第七发送模块,用于通过所述第三文件管理面板向所述管理服务器发送第二对象新建请求;a seventh sending module, configured to send a second object creation request to the management server through the third file management panel;
第十一接收模块,用于接收所述管理服务器反馈的针对所述第二对象新建请求的结果信息;An eleventh receiving module, configured to receive the result information of the new request for the second object fed back by the management server;
第二显示模块,用于根据所述结果信息在所述第三文件管理面板中显示新建的第二对象。The second display module is configured to display the newly created second object in the third file management panel according to the result information.
在本发明的一个优选的实施例中,所述装置,还可以包括:第十二接收模块和第二断开模块(图中未示出)。In a preferred embodiment of the present invention, the device may further include: a twelfth receiving module and a second disconnecting module (not shown in the figure).
第十二接收模块,用于接收通过所述第三文件管理面板发送的第二退出登录请求;A twelfth receiving module, configured to receive a second logout request sent through the third file management panel;
第二断开模块,用于根据所述第二退出登录请求,断开与所述管理服务器之间的连接。A second disconnection module, configured to disconnect the connection with the management server according to the second logout request.
应用本发明实施例,提供了针对云存储系统的第三操作面板以供用户操作,这样无需使用单独设置的云存储系统的客户端,简化了用户传输文件的步骤,为用户操作云存储系统中的文件提供了极大的便利性,节省了用户的时间,提升了用户体验。By applying the embodiments of the present invention, a third operation panel for the cloud storage system is provided for the user to operate, so that it is not necessary to use a client of the cloud storage system separately set, the steps of transferring files for the user are simplified, and the operation of the cloud storage system is simplified for the user. It provides great convenience, saves the user's time, and improves the user experience.
需要说明的是,在本文中,诸如第一和第二等之类的关系术语仅仅用来将一个实体或者操作与另一个实体或操作区分开来,而不一定要求或者暗示这些实体或操作之间存在任何这种实际的关系或者顺序。而且,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括所述要素的过程、方法、物品或者设备中还存在另外的相同要素。It should be noted that, in this document, relational terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any relationship between these entities or operations. any such actual relationship or sequence exists. Moreover, the terms "comprising", "comprising" or any other variation thereof are intended to encompass a non-exclusive inclusion such that a process, method, article or device that includes a list of elements includes not only those elements, but also includes not explicitly listed or other elements inherent to such a process, method, article or apparatus. Without further limitation, an element qualified by the phrase "comprising a..." does not preclude the presence of additional identical elements in a process, method, article or apparatus that includes the element.
本说明书中的各个实施例均采用相关的方式描述,各个实施例之间相同相似的部分互相参见即可,每个实施例重点说明的都是与其他实施例的不同之处。尤其,对于装置实施例而言,由于其基本相似于方法实施例,所以描述的比较简单,相关之处参见方法实施例的部分说明即可。Each embodiment in this specification is described in a related manner, and the same and similar parts between the various embodiments may be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the apparatus embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and reference may be made to some descriptions of the method embodiments for related parts.
本领域普通技术人员可以理解实现上述方法实施方式中的全部或部分步骤是可以通过程序来指令相关的硬件来完成,所述的程序可以存储于计算机可读取存储介质中,这里所称得的存储介质,如:ROM/RAM、磁碟、光盘等。Those of ordinary skill in the art can understand that all or part of the steps in the implementation of the above method can be completed by instructing the relevant hardware through a program, and the program can be stored in a computer-readable storage medium. Storage medium, such as: ROM/RAM, magnetic disk, optical disk, etc.
以上所述仅为本发明的较佳实施例而已,并非用于限定本发明的保护范围。凡在本发明的精神和原则之内所作的任何修改、等同替换、改进等,均包含在本发明的保护范围内。The above descriptions are only preferred embodiments of the present invention, and are not intended to limit the protection scope of the present invention. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention are included in the protection scope of the present invention.
Claims (40)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201611151740.0A CN108234539B (en) | 2016-12-14 | 2016-12-14 | File uploading, downloading and transmitting method and device |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201611151740.0A CN108234539B (en) | 2016-12-14 | 2016-12-14 | File uploading, downloading and transmitting method and device |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| CN108234539A CN108234539A (en) | 2018-06-29 |
| CN108234539B true CN108234539B (en) | 2022-06-03 |
Family
ID=62638309
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN201611151740.0A Active CN108234539B (en) | 2016-12-14 | 2016-12-14 | File uploading, downloading and transmitting method and device |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN108234539B (en) |
Families Citing this family (23)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN109241002B (en) * | 2018-09-10 | 2022-02-01 | 创新先进技术有限公司 | File uploading method, device and equipment |
| CN109922142B (en) * | 2019-02-21 | 2022-04-19 | 创新先进技术有限公司 | File downloading method, device and system |
| CN111610970A (en) * | 2019-02-22 | 2020-09-01 | 广东真才企链信息科技有限公司 | Method for asynchronously submitting large data scale list package |
| CN110247986A (en) * | 2019-06-28 | 2019-09-17 | 北京奇艺世纪科技有限公司 | A kind of document transmission method, device and electronic equipment |
| CN110336871A (en) * | 2019-07-01 | 2019-10-15 | 江苏满运软件科技有限公司 | A kind of document handling method, device, storage medium and electronic equipment |
| CN110610103A (en) * | 2019-09-24 | 2019-12-24 | 成都卫士通信息安全技术有限公司 | Method and device for verifying confidential document |
| CN110784524A (en) * | 2019-10-14 | 2020-02-11 | 广州微算互联信息技术有限公司 | Cloud mobile phone file uploading keep-alive method, device and system |
| CN112883427A (en) * | 2019-11-29 | 2021-06-01 | 航天信息股份有限公司 | Method and device for detecting integrity of file |
| CN111159291A (en) * | 2019-12-19 | 2020-05-15 | 视联动力信息技术股份有限公司 | Progress bar display method and device, terminal equipment and storage medium |
| CN111193785B (en) * | 2019-12-20 | 2023-05-02 | 北京淇瑀信息科技有限公司 | File cutting and transmitting method and device and electronic equipment |
| CN111147332B (en) * | 2019-12-29 | 2022-04-29 | 北京浪潮数据技术有限公司 | Method, system and related device for determining uploading progress of cloud backup of storage system |
| CN112306604B (en) * | 2020-08-21 | 2022-09-23 | 海信视像科技股份有限公司 | Progress display method and display device for file transmission |
| CN112468511B (en) * | 2020-12-11 | 2023-02-03 | 建信金融科技有限责任公司 | File transmission method and device |
| CN112822260B (en) * | 2020-12-31 | 2023-06-09 | 北京天融信网络安全技术有限公司 | File transmission method and device, electronic equipment and storage medium |
| CN113271343B (en) * | 2021-04-28 | 2025-06-17 | 华录光存储研究院(大连)有限公司 | Data downloading and uploading method and electronic device |
| CN114338646B (en) * | 2021-11-29 | 2024-06-21 | 王建冬 | File interactive transmission method, device, equipment and storage medium |
| CN114338653A (en) * | 2021-12-29 | 2022-04-12 | 中国电信股份有限公司 | File breakpoint resuming method and device |
| CN114401261B (en) * | 2021-12-29 | 2024-09-03 | 中国电信股份有限公司 | File downloading method and device |
| CN114500514B (en) * | 2022-02-14 | 2023-12-12 | 京东科技信息技术有限公司 | File transmission method and device for cloud storage, electronic equipment and storage medium |
| CN114866536A (en) * | 2022-05-31 | 2022-08-05 | 北京奕斯伟计算技术有限公司 | File uploading method and WEB front end |
| CN116155883A (en) * | 2022-12-20 | 2023-05-23 | 四川大学华西医院 | A file service system and method |
| WO2024154844A1 (en) * | 2023-01-18 | 2024-07-25 | 라쿠텐 심포니 주식회사 | Simultaneous upload and download |
| CN116684271A (en) * | 2023-05-18 | 2023-09-01 | 上海中通吉网络技术有限公司 | A method for automatically uploading local data on a mobile terminal to a server |
Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN103973421A (en) * | 2013-02-06 | 2014-08-06 | 腾讯科技(深圳)有限公司 | File transmitting method and device |
| CN104468843A (en) * | 2014-12-31 | 2015-03-25 | 浪潮软件股份有限公司 | File uploading method and device |
| CN105472035A (en) * | 2016-01-04 | 2016-04-06 | 百度在线网络技术(北京)有限公司 | File transmission method and device |
| CN105491132A (en) * | 2015-12-11 | 2016-04-13 | 北京元心科技有限公司 | File server, terminal and file subpackage transmission method |
Family Cites Families (14)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US8510267B2 (en) * | 2011-03-08 | 2013-08-13 | Rackspace Us, Inc. | Synchronization of structured information repositories |
| KR20130046540A (en) * | 2011-10-28 | 2013-05-08 | 삼성에스디에스 주식회사 | Data transmitting apparatus and method |
| CN102739689B (en) * | 2012-07-16 | 2015-05-13 | 四川师范大学 | File data transmission device and method used for cloud storage system |
| CN103685332B (en) * | 2012-08-31 | 2018-04-24 | 腾讯科技(深圳)有限公司 | File uploading method, client, server and system |
| CN103731451B (en) * | 2012-10-12 | 2018-10-19 | 腾讯科技(深圳)有限公司 | A kind of method and system that file uploads |
| CN105025053A (en) * | 2014-04-24 | 2015-11-04 | 苏宁云商集团股份有限公司 | Distributed file upload method based on cloud storage technology and system |
| CN105227610A (en) * | 2014-06-30 | 2016-01-06 | 北京金山安全软件有限公司 | File uploading and storing method and device |
| CN104580395B (en) * | 2014-12-22 | 2018-02-23 | 西安电子科技大学 | A kind of cloudy collaboration Storage Middleware Applying system based on existing cloud storage platform |
| CN104539739B (en) * | 2015-01-26 | 2019-03-29 | 浙江大学 | A kind of system, method and device that file uploads |
| CN105338090A (en) * | 2015-11-12 | 2016-02-17 | 浪潮软件集团有限公司 | A method and device for resumed transmission based on WebSocket |
| CN105847139A (en) * | 2016-03-25 | 2016-08-10 | 乐视控股(北京)有限公司 | Data transmission method, apparatus and system |
| CN105872036A (en) * | 2016-03-28 | 2016-08-17 | 联想(北京)有限公司 | Data uploading, downloading method, electronic equipment and server |
| CN105893511A (en) * | 2016-03-30 | 2016-08-24 | 电子科技大学 | Method for data copy trace retention through agent cloud |
| CN105872102B (en) * | 2016-06-06 | 2018-12-18 | 武汉理工大学 | A kind of File Upload and Download method |
-
2016
- 2016-12-14 CN CN201611151740.0A patent/CN108234539B/en active Active
Patent Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN103973421A (en) * | 2013-02-06 | 2014-08-06 | 腾讯科技(深圳)有限公司 | File transmitting method and device |
| CN104468843A (en) * | 2014-12-31 | 2015-03-25 | 浪潮软件股份有限公司 | File uploading method and device |
| CN105491132A (en) * | 2015-12-11 | 2016-04-13 | 北京元心科技有限公司 | File server, terminal and file subpackage transmission method |
| CN105472035A (en) * | 2016-01-04 | 2016-04-06 | 百度在线网络技术(北京)有限公司 | File transmission method and device |
Also Published As
| Publication number | Publication date |
|---|---|
| CN108234539A (en) | 2018-06-29 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN108234539B (en) | File uploading, downloading and transmitting method and device | |
| US12149581B2 (en) | Link file sharing and synchronization | |
| CN112948340B (en) | Data synchronization method, device, electronic device and readable storage medium | |
| WO2022252632A1 (en) | Data encryption processing method and apparatus, computer device, and storage medium | |
| US9311326B2 (en) | Virtual file system for automated data replication and review | |
| KR101623742B1 (en) | Method and system for sharing file related messages | |
| US20120226823A1 (en) | Document distribution system and method | |
| CN113222558B (en) | System and method for message editing | |
| US20150326667A1 (en) | Peer-to-peer sharing of cloud-based content | |
| US10855746B2 (en) | Generating content fragments for content distribution | |
| US20120030224A1 (en) | Enabling active content in messaging using automatic data replacement | |
| US10574703B1 (en) | Content delivery employing multiple security levels | |
| US20170371625A1 (en) | Content delivery method | |
| US20170011030A1 (en) | Method for searching for multimedia file, terminal device, and server | |
| WO2021098277A1 (en) | Blockchain file access method and apparatus, computer device and storage medium | |
| CN111611606B (en) | File encryption and decryption method and device | |
| US20140044259A1 (en) | Job processing system, job processing method, and non-transitory computer-readable medium | |
| KR20150032152A (en) | Method and apparatus for performing edit operations between electronic devices | |
| US9332405B2 (en) | Short message backup method, mobile terminal, and server | |
| US20080183839A1 (en) | System For Computer To Mobile Device Place Shifting | |
| US11138287B1 (en) | System for reducing size of transmitted content | |
| TW201440475A (en) | Streaming ZIP | |
| KR20090003405A (en) | File upload system and method | |
| US20080184123A1 (en) | System And Method For Providing A Secure Connection Between A Computer And A Mobile Device | |
| CN116015767A (en) | A data processing method, device, equipment and 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 |