WO2020147403A1 - Cloud storage based file processing method, system and computer device - Google Patents

Cloud storage based file processing method, system and computer device Download PDF

Info

Publication number
WO2020147403A1
WO2020147403A1 PCT/CN2019/117772 CN2019117772W WO2020147403A1 WO 2020147403 A1 WO2020147403 A1 WO 2020147403A1 CN 2019117772 W CN2019117772 W CN 2019117772W WO 2020147403 A1 WO2020147403 A1 WO 2020147403A1
Authority
WO
WIPO (PCT)
Prior art keywords
file
slice
data
serial number
web server
Prior art date
Application number
PCT/CN2019/117772
Other languages
French (fr)
Chinese (zh)
Inventor
刘嘉
田甜
Original Assignee
平安科技(深圳)有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 平安科技(深圳)有限公司 filed Critical 平安科技(深圳)有限公司
Publication of WO2020147403A1 publication Critical patent/WO2020147403A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/13File access structures, e.g. distributed indices
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/10File systems; File servers
    • G06F16/18File system types
    • G06F16/182Distributed file systems

Definitions

  • the embodiments of the present application relate to the field of computer data processing, and in particular, to a file processing method, system, computer device, and non-volatile computer-readable storage medium based on cloud storage.
  • Cloud storage refers to the collection of a large number of different types of storage devices in the network through application software through functions such as cluster applications, grid technology or distributed file systems to achieve collaborative work and provide data storage and business access functions together. That is, when the core of cloud computing system operation and processing is the storage and management of large amounts of data, the cloud computing system needs to be equipped with a large number of storage devices. At this time, the cloud computing system is transformed into a cloud storage system, so the cloud storage system is a A cloud computing system with data storage and management as the core.
  • This storage system is composed of multiple storage devices, which work together through cluster functions, distributed file systems or similar grid computing functions, and provide users with certain types of storage services and access through certain application software or application interfaces. service. .
  • the existing cloud storage solutions are generally based on uploading the entire file or uploading based on slice data, and both have certain technical defects: (1) Based on the entire file upload, it is easy to cause waste of resources, for example, when a user uploads a After a larger file, if only a small part of the file is modified, the entire file still needs to be retransmitted; (2) Uploading based on slice data may easily cause upload failures due to misoperation, for example, if manual or system Misoperation confuses the correspondence between different files to be uploaded and slice files, and there may be a problem that the new file to be uploaded is inconsistent with the slice file.
  • the purpose of the embodiments of the present application is to provide a file processing method, system, computer device, and non-volatile computer-readable storage medium based on cloud storage to solve the technical problems of resource waste and upload failure in the prior art.
  • an embodiment of the present application provides a file processing method based on cloud storage, which includes the following steps:
  • Encapsulating a slice file data package including a file ID, a slice ID of each slice file, a slice serial number of each slice file, and slice data of each slice file;
  • the embodiments of the present application also provide a file processing system based on cloud storage, including:
  • the sending module is used to send a file upload request to the WEB server, where the file upload request is used to request to upload a new file to the server cluster;
  • a receiving module configured to receive a file ID returned by the server cluster via the WEB server, where the file ID is generated by the server cluster for the new file;
  • the slicing module is used to slice the new file and assign a slice serial number to each slice file;
  • the calculation module is configured to calculate the slice ID of each slice file according to the file data, file ID, and slice sequence number of each slice file, where the slice ID is used to identify the unique correspondence between the slice file and the new file to be uploaded;
  • the encapsulation module is used to encapsulate the slice file data package, the slice file data package including the file ID, the slice ID of each slice file, the slice serial number of each slice file, and the slice data of each slice file;
  • the file upload module is configured to upload the slice file data package to the WEB server, so that the slice data of each slice file in the slice file data package is sent to the corresponding server cluster in the server cluster through the WEB server
  • the server cluster is used to store the corresponding relationship between the file ID, the slice ID of each slice file, and the slice serial number of each slice file.
  • an embodiment of the present application also provides a computer device, the computer device including a memory, a processor, and computer-readable instructions stored on the memory and running on the processor, the When the computer-readable instructions are executed by the processor, the following steps are implemented:
  • Encapsulating a slice file data package including a file ID, a slice ID of each slice file, a slice serial number of each slice file, and slice data of each slice file;
  • embodiments of the present application also provide a non-volatile computer-readable storage medium, in which computer-readable instructions are stored, and the computer-readable instructions may Is executed by at least one processor, so that the at least one processor executes the following steps:
  • Encapsulating a slice file data package including a file ID, a slice ID of each slice file, a slice serial number of each slice file, and slice data of each slice file;
  • the embodiments of the present application also provide a file processing system based on cloud storage, including:
  • the WEB server is configured to receive a file upload request sent by a computer device, where the file upload request is used to request to upload a new file to the server cluster, and return to the computer device the file ID generated by the server cluster for the new file;
  • the computer device is used for slicing the new file and assigning a slice number to each slice file; for calculating the slice ID of each slice file according to the file data, file ID, and slice number of each slice file,
  • the slice ID is used to identify the unique corresponding relationship between the slice file and the new file to be uploaded; and used to upload the slice file data package to the WEB server, and the slice file data package contains the file ID and each slice
  • the WEB server is also used to send slice data of each slice file in the slice file data package to the server cluster;
  • the server cluster is configured to store the slice data of each slice file on the corresponding service terminal, wherein the server cluster saves the file ID, the slice ID of each slice file, and the slice serial number of each slice file The corresponding relationship.
  • the slice ID of each slice file is calculated based on "file data, file
  • each slice ID can guarantee the unique corresponding relationship between the slice ID, the slice file, and the new file to be uploaded, even if the different files to be uploaded are connected to different files due to human or system error. If the corresponding relationship between the slice files is confused, the new file to be uploaded will not be inconsistent with the slice file.
  • the embodiment of the present application adopts the improved slice data upload technology, it avoids resource waste caused by repeated upload of the entire file, and also avoids the problem of inconsistency between the file to be uploaded and the slice file, and effectively guarantees the correctness of uploaded data.
  • FIG. 1 is a diagram of the operating environment of Embodiment 1 of the file processing method based on cloud storage in this application.
  • Embodiment 2 is a schematic flowchart of Embodiment 1 of a file processing method based on cloud storage in this application.
  • Embodiment 3 is a schematic flowchart of the file receiving step in Embodiment 1 of the file processing method based on cloud storage of this application.
  • Embodiment 4 is a schematic flowchart of Embodiment 3 of a file processing method based on cloud storage in this application.
  • FIG. 5 is a schematic flowchart of the file receiving step in Embodiment 3 of the file processing method based on cloud storage of this application.
  • FIG. 6 is a schematic diagram of program modules of Embodiment 4 of a file processing system based on cloud storage in this application.
  • FIG. 7 is a schematic diagram of the hardware structure of the fifth embodiment of the computer equipment of this application.
  • FIG. 1 shows a diagram of the operating environment of an embodiment of this application.
  • the file processing system 1000 includes multiple execution entities, and the multiple execution entities include:
  • the computer equipment 2 can be any type of equipment with Internet access function.
  • PDA Personal Digital Assistant
  • smart phones smart phones, notebook computers, netbooks, personal computers and other similar devices;
  • WEB server 4 used to communicate with computer equipment 2;
  • Server cluster 6 further includes at least one service cluster integration end (Service Manager), each cluster service integration end can be connected to several service distribution ends (Service Master), and each service distribution end can be connected to several service terminals ( Service Worker), the service terminal is used to store 2 data files uploaded by computer equipment.
  • Service Manager service cluster integration end
  • Service Master service distribution ends
  • Service Worker service terminals
  • the following will exemplify the file processing method in the first embodiment based on the file processing system 1000 (including multiple execution entities such as the computer device 2, the WEB server 4, and the server cluster 6).
  • FIG. 2 shows a flow chart of the steps of the file processing method in the first embodiment of the present application. It can be understood that the flowchart in this method embodiment is not used to limit the order of execution of the steps. details as follows.
  • step S100 the computer device 2 sends a file upload request to the WEB server 4.
  • the file upload request is used to request to upload a new file to the server cluster 6.
  • step S102 the WEB server 4 forwards the file upload request to the server cluster 6.
  • Step S104 the file ID generated by the server cluster 6 for the new file.
  • Step S106 the server cluster 6 sends the document ID to the WEB server 4.
  • step S108 the WEB server 4 forwards the file ID to the computer device 2.
  • step S110 the computer device 2 slices the new file, and assigns a slice serial number to each slice file.
  • the slice serial number of each slice file can be numbers 1, 2, 3, etc., or letters can be A, B, C, etc., or other numbers, other letters, or other types of characters or text, etc., Used to indicate the order relationship between each slice file.
  • step S112 the computer device 2 calculates the slice ID of each slice file according to the file data, file ID, and slice serial number of each slice file.
  • the slice ID is used to identify the unique correspondence between the slice file and the new file to be uploaded.
  • the step S112 includes:
  • Step S112A1 the computer device 2 concatenates the file data, the file ID and the slice serial number corresponding to each slice file into a string;
  • step S112A2 the computer device 2 calculates the slice ID of each slice file through a hash algorithm according to the character string corresponding to each slice.
  • the order of the three in the string can be adjusted as needed. For example, it can be adjusted to the file data of each slice file, the slice serial number and file ID of each slice file, or it can be adjusted to the file ID, each The slice number of each slice file, the file data of each slice file, and other sequences.
  • the hash algorithm can be MD5 (Message Digest Algorithm), SHA (Secure Hash Algorithm), MAC (Message Authentication Code), CRC (Cyclic Redundancy Check), etc.
  • the specific calculation process can be: file data for each slice file
  • the step S112 includes:
  • step S112B1 the computer device 2 calculates the slice initial value of each slice file through a hash algorithm according to the file data of each slice file;
  • step S112B2 the computer device 2 calculates the slice ID of each slice file through a hash algorithm according to the initial slice value, file ID and slice serial number corresponding to each slice.
  • step S114 the computer device 2 uploads the slice file data package to the WEB server 4.
  • the slice file data packet includes a file ID, a slice ID of each slice file, a slice serial number of each slice file, and slice data of each slice file.
  • step S116 the WEB server 4 sends the slice data of each slice file in the slice file data package to the server cluster 6.
  • Step S118 the server cluster 6 stores the slice data of each slice file on the corresponding service terminal.
  • the server cluster 6 is used to store the corresponding relationship between the file ID, the slice ID of each slice file, and the slice serial number of each slice file.
  • step S120 the server cluster 6 returns the notification message of the storage completion to the WEB server 4.
  • step S122 the notification message of the WEB server 4 is forwarded to the computer device 2.
  • the file processing method may further include a file downloading step S124. details as follows.
  • Step S124A the computer device sends a file download request to the WEB server 4, and the file download request includes the file ID of the file that the computer device 2 requests to download;
  • Step S124B the WEB server 4 sends the file download request to the server cluster 6;
  • Step S124C the server cluster 6 sends to the WEB server 4 the address of the service terminal that stores each slice file of the file corresponding to the file ID;
  • step S124D the WEB server 4 obtains each slice file from the corresponding service terminal according to the address of the service terminal, where each slice file includes a file ID, a slice ID of each slice file, and a slice serial number of each slice file. , The slice data of each slice file;
  • Step S124E the WEB server 4 transmits each slice file to the computer device respectively;
  • step S124F the computer device composes the received slice file into the file requested to be downloaded according to the slice serial number in each slice file.
  • each slice ID of each slice file in this embodiment is based on the combination of "file data, file ID, and slice serial number of each slice file", and each slice ID can guarantee the slice The unique correspondence between ID, the slice file, and the new file to be uploaded. Even if the correspondence between the different files to be uploaded and the slice file is confused due to human or system error, the new file to be uploaded and the slice file will not appear.
  • the WEB server 4 in this embodiment will first transmit each slice file to the computer device 2, and the computer device will then according to the slice serial number in each slice file , Composing the received slice file into the file requested to download, so that "sending the file in slices" can optimize the utilization of network bandwidth, and the transmission performance is more optimized.
  • this embodiment is used to exemplarily describe the file processing system 1000.
  • the file processing system 1000 includes a computer device 2, a WEB server 4, and a server cluster 6.
  • the WEB server 4 is used to receive a file upload request sent by the computer device 2, and the file upload request is used to request to upload a new file to the server cluster 6 and return to the computer device 4 the file ID generated by the server cluster 6 for the new file .
  • the computer device 2 is used to slice the new file and assign a slice number to each slice file; it is used to calculate the slice ID of each slice file according to the file data, file ID, and slice number of each slice file.
  • the slice ID is used to identify the unique correspondence between the slice file and the new file to be uploaded; and used to upload the slice file data package to the WEB server.
  • the slice file data package contains the file ID and the slice of each slice file. ID, slice serial number of each slice file, slice data of each slice file.
  • calculating the slice ID of each slice file according to the file data, file ID, and slice sequence number of each slice file further includes: the computer device 2 converts the file data, file ID, and file ID corresponding to each slice file.
  • the slice serial numbers are concatenated into character strings; the computer device 2 calculates the slice ID of each slice file through a hash algorithm according to the character string corresponding to each slice.
  • calculating the slice ID of each slice file according to the file data, file ID, and slice serial number of each slice file further includes: the computer device 2 uses the file data of each slice file to disperse The column algorithm calculates the slice initial value of each slice file; the computer device 2 calculates the slice ID of each slice file through the hash algorithm according to the slice initial value, file ID and slice serial number corresponding to each slice.
  • the WEB server 4 is also used to send the slice data of each slice file in the slice file data package to the server cluster 6.
  • the server cluster 6 is used to store the slice data of each slice file on the corresponding service terminal, where the server cluster saves the file ID, the slice ID of each slice file, and the slice serial number of each slice file. Correspondence.
  • the computer device 2 is also used to send a file download request to the WEB server 4, and the file download request includes the file ID of the file that the computer device 2 requests to download;
  • the WEB server 4 is also used to send the file download request to the server cluster 6;
  • the server cluster 6 is also used to send the address of the service terminal storing each slice file of the file corresponding to the file ID to the WEB server 4;
  • the WEB server 4 is also used to obtain each slice file from the corresponding service terminal according to the address of the service terminal, where each slice file includes a file ID, a slice ID of each slice file, and a slice of each slice file. Serial number, slice data of each slice file;
  • the WEB server 4 is also used to separately transmit each slice file to the computer equipment;
  • the computer device 2 is also used to compose the received slice file into the file requested to be downloaded according to the slice serial number in each slice file.
  • FIG. 4 shows a flowchart of the steps of the file processing method in the third embodiment of the present application. It can be understood that the flowchart in this method embodiment is not used to limit the order of execution of the steps. details as follows.
  • Step S200 Send a file upload request to the WEB server, where the file upload request is used to request to upload a new file to the server cluster.
  • Step S202 Receive a file ID returned by the server cluster via the WEB server, where the file ID is generated by the server cluster for the new file.
  • Step S204 slice the new file, and assign a slice serial number to each slice file.
  • Step S206 Calculate the slice ID of each slice file according to the file data, file ID, and slice serial number of each slice file, where the slice ID is used to identify the unique correspondence between the slice file and the new file to be uploaded.
  • the step S206 includes:
  • Step S206A1 concatenate the file data, file ID and slice serial number corresponding to each slice file into a string
  • Step S206A2 According to the character string corresponding to each slice, the slice ID of each slice file is calculated through a hash algorithm.
  • the order of the three in the string can be adjusted as needed. For example, it can be adjusted to the file data of each slice file, the slice serial number and file ID of each slice file, or it can be adjusted to the file ID, each The slice number of each slice file, the file data of each slice file, and other sequences.
  • the hash algorithm can be MD5 (Message Digest Algorithm), SHA (Secure Hash Algorithm), MAC (Message Authentication Code), CRC (Cyclic Redundancy Check), etc.
  • the step S206 includes:
  • Step S206B1 according to the file data of each slice file, calculate the slice initial value of each slice file through a hash algorithm
  • step S206B2 the slice ID of each slice file is calculated through a hash algorithm according to the initial value of the slice corresponding to each slice, the file ID, and the slice serial number.
  • Step S208 Encapsulate the slice file data package, the slice file data package including the file ID, the slice ID of each slice file, the slice serial number of each slice file, and the slice data of each slice file.
  • Step S210 Upload the slice file data package to the WEB server, so that the slice data of each slice file in the slice file data package is sent to the corresponding service terminal in the server cluster for storage through the WEB server, where: The server cluster is used to store the corresponding relationship between the file ID, the slice ID of each slice file, and the slice serial number of each slice file.
  • the file processing method may further include a file downloading step S212. details as follows.
  • Step S212A sending a file download request to the WEB server, where the file download request includes the file ID of the computer device requesting to download the file;
  • Step S212B Receive each slice file obtained by the WEB server from the service terminal corresponding to the server cluster based on the file download request, where each slice file includes a file ID, a slice ID of each slice file, and a slice ID of each slice file. Slice serial number, slice data of each slice file;
  • Step S212C according to the slice serial number in each slice file, compose the received slice file into the file requested to be downloaded.
  • FIG. 6 shows a schematic diagram of the program modules of the fourth embodiment of the cloud storage-based file processing system of the present application.
  • file processing system 1000 shown in FIG. 1 is an external architecture system composed of multiple execution entities.
  • the file processing system 20 described in this embodiment is a software collection composed of one or more program modules.
  • the cloud storage-based file processing system 20 may include or be divided into one or more program modules, and the one or more program modules are stored in a storage medium and executed by one or more processors.
  • the program module referred to in the embodiments of the present application refers to a series of computer-readable instruction segments that can complete specific functions. The following description will specifically introduce the functions of each program module in this embodiment:
  • the sending module 200 is configured to send a file upload request to the WEB server, and the file upload request is used to request to upload a new file to the server cluster.
  • the receiving module 202 is configured to receive a file ID returned by the server cluster via the WEB server, where the file ID is generated by the server cluster for the new file.
  • the slicing module 204 is used to slice the new file and assign a slice serial number to each slice file.
  • the calculation module 206 is configured to calculate the slice ID of each slice file according to the file data, file ID, and slice serial number of each slice file, and the slice ID is used to identify the unique correspondence between the slice file and the new file to be uploaded.
  • the calculation module 206 is further configured to concatenate the file data, file ID, and slice serial number corresponding to each slice file into a string, and use a hash algorithm according to the string corresponding to each slice Calculate the slice ID of each slice file.
  • the calculation module 206 is further configured to calculate the initial slice value of each slice file through a hash algorithm according to the file data of each slice file; and according to the slice initial value and file corresponding to each slice ID and slice serial number, the slice ID of each slice file is calculated through a hash algorithm.
  • the encapsulation module 208 is configured to encapsulate a slice file data packet, which contains a file ID, a slice ID of each slice file, a slice serial number of each slice file, and slice data of each slice file.
  • the file upload module 210 is configured to upload the slice file data package to a WEB server, so as to send the slice data of each slice file in the slice file data package to the corresponding server cluster through the WEB server.
  • the server cluster is used to store the corresponding relationship between the file ID, the slice ID of each slice file, and the slice serial number of each slice file.
  • it further includes a file receiving module 212, configured to: send a file download request to the WEB server, where the file download request includes the file ID of the computer device requesting to download the file; and receive the WEB
  • the server obtains each slice file from the service terminal corresponding to the server cluster based on the file download request, where each slice file includes a file ID, a slice ID of each slice file, a slice serial number of each slice file, The slice data of each slice file; according to the slice serial number in each slice file, the received slice file is composed of the file requested to be downloaded.
  • the computer device 2 is a device that can automatically perform numerical calculation and/or information processing according to pre-set or stored instructions.
  • the computer device 2 may be a Personal Digital Assistant (PDA), a smart phone, a notebook computer, a netbook, a personal computer, and other similar devices.
  • PDA Personal Digital Assistant
  • the computer device 2 at least includes, but is not limited to, a memory 21, a processor 22, a network interface 23, and a file processing system 20 based on cloud storage that can communicate with each other through a system bus. among them:
  • the memory 21 includes at least one type of non-volatile computer-readable storage medium.
  • the readable storage medium includes flash memory, hard disk, multimedia card, card-type memory (for example, SD or DX memory, etc.), Random access memory (RAM), static random access memory (SRAM), read only memory (ROM), electrically erasable programmable read only memory (EEPROM), programmable read only memory (PROM), magnetic memory, magnetic disk, optical disk Wait.
  • the memory 21 may be an internal storage unit of the computer device 2, for example, the hard disk or memory of the computer device 2.
  • the memory 21 may also be an external storage device of the computer device 2, for example, a plug-in hard disk, a smart media card (SMC), and a secure digital (Secure Digital, SD) card, flash card (Flash Card), etc.
  • the memory 21 may also include both the internal storage unit of the computer device 2 and its external storage device.
  • the memory 21 is generally used to store the operating system and various application software installed in the computer device 2, for example, the program code of the file processing system 20 based on cloud storage in the fourth embodiment.
  • the memory 21 can also be used to temporarily store various types of data that have been output or will be output.
  • the processor 22 may be a central processing unit (Central Processing Unit, CPU), a controller, a microcontroller, a microprocessor, or other data processing chips in some embodiments.
  • the processor 22 is generally used to control the overall operation of the computer device 2.
  • the processor 22 is used to run the program code or process data stored in the memory 21, for example, to run the file processing system 20 based on cloud storage, so as to implement the file processing method based on cloud storage in the third embodiment.
  • the network interface 23 may include a wireless network interface or a wired network interface, and the network interface 23 is generally used to establish a communication connection between the computer device 2 and other electronic devices.
  • the network interface 23 is used to connect the computer device 2 with an external terminal through a network, and establish a data transmission channel and a communication connection between the computer device 2 and the external terminal.
  • the network may be an intranet, the Internet, a global system of mobile communication (GSM), a wideband code division multiple access (WCDMA), a 4G network, and a 5G Network, Bluetooth (Bluetooth), Wi-Fi and other wireless or wired networks.
  • FIG. 7 only shows the computer device 2 with components 20-23, but it should be understood that it is not required to implement all the components shown, and more or fewer components may be implemented instead.
  • the cloud storage-based file processing system 20 stored in the memory 21 may also be divided into one or more program modules, and the one or more program modules are stored in the memory 21, and It is executed by one or more processors (the processor 22 in this embodiment) to complete the application.
  • FIG. 6 shows a schematic diagram of program modules in the fourth embodiment of the cloud storage-based file processing system 20.
  • the cloud storage-based file processing system 20 can be divided into a sending module 200 and a receiving module.
  • the program module referred to in this application refers to a series of computer-readable instruction segments that can complete specific functions, and is more suitable than a program to describe the execution process of the cloud storage-based file processing system 20 in the computer device 2. .
  • the specific functions of the program modules 200-212 have been described in detail in the fourth embodiment, and will not be repeated here.
  • This embodiment also provides a non-volatile computer-readable storage medium, such as flash memory, hard disk, multimedia card, card-type memory (for example, SD or DX memory, etc.), random access memory (RAM), static random access memory ( SRAM), Read Only Memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), Programmable Read Only Memory (PROM), Magnetic Memory, Disk, Optical Disk, Server, App Store, etc., which are stored on There are computer-readable instructions, and the corresponding functions are realized when the program is executed by the processor.
  • the non-volatile computer-readable storage medium of this embodiment is used to store the cloud storage-based file processing system 20, and the processor executes the following steps:
  • Encapsulating a slice file data package including a file ID, a slice ID of each slice file, a slice serial number of each slice file, and slice data of each slice file;

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Transfer Between Computers (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

Provided by the embodiments of the present application is a cloud storage based file processing method, comprising: sending a file upload request to a WEB server; receiving a file ID returned by a server cluster by means of the WEB server; slicing the new file, and assigning a slice number to each slice file; computing a slice ID of each slice file according to the file data, file ID and slice number of each slice file, the slice ID being used to identify a unique correspondence between the slice file and the new file to be uploaded; and uploading a slice file data package to the WEB server so as to send the slice data of each slice file in the slice file data package by means of the WEB server to a corresponding service terminal in the server cluster for storage. Employing the embodiments of the present application avoids the waste of resources and inconsistency between files to be uploaded and slice files by means of an improved slice data upload technique, thus effectively ensuring the correctness of uploaded data.

Description

基于云存储的文件处理方法、系统及计算机设备File processing method, system and computer equipment based on cloud storage
本申请申明2019年01月16日递交的申请号为201910040715.2、名称为“基于云存储的文件处理方法、系统及计算机设备”的中国专利申请的优先权,该中国专利申请的整体内容以参考的方式结合在本申请中。This application affirms the priority of the Chinese patent application filed on January 16, 2019 with the application number 201910040715. 2, titled "Cloud storage-based file processing method, system and computer equipment". The entire content of the Chinese patent application is for reference The method is incorporated in this application.
技术领域Technical field
本申请实施例涉及计算机数据处理领域,尤其涉及一种基于云存储的文件处理方法、系统、计算机设备及非易失性计算机可读存储介质。The embodiments of the present application relate to the field of computer data processing, and in particular, to a file processing method, system, computer device, and non-volatile computer-readable storage medium based on cloud storage.
背景技术Background technique
云存储是指通过集群应用、网格技术或分布式文件系统等功能,将网络中大量不同类型的存储设备通过应用软件集合在一起,实现协同工作,共同对外提供数据存储和业务访问功能。即当云计算系统运算和处理的核心是大量数据的存储和管理时,云计算系统就需要配置大量的存储设备,此时的云计算系统就转变为一个云存储系统,所以云存储系统就是一个以数据存储和管理为核心的云计算系统。这个存储系统由多个存储设备组成,通过集群功能、分布式文件系统或类似网格计算等功能联合起来协同工作,并通过一定的应用软件或应用接口,为用户提供一定类型的存储服务和访问服务。。Cloud storage refers to the collection of a large number of different types of storage devices in the network through application software through functions such as cluster applications, grid technology or distributed file systems to achieve collaborative work and provide data storage and business access functions together. That is, when the core of cloud computing system operation and processing is the storage and management of large amounts of data, the cloud computing system needs to be equipped with a large number of storage devices. At this time, the cloud computing system is transformed into a cloud storage system, so the cloud storage system is a A cloud computing system with data storage and management as the core. This storage system is composed of multiple storage devices, which work together through cluster functions, distributed file systems or similar grid computing functions, and provide users with certain types of storage services and access through certain application software or application interfaces. service. .
发明人发现,现有的云存储方案一般是基于整个文件上传或基于切片数据上传,均存在一定的技术缺陷:(1)基于整个文件上传,容易造成资源的浪费,例如,当用户上传了一个较大的文件后,如果只修改了该文件的一小部分,此时仍需要重传整个文件;(2)基于切片数据上传,容易造成因误操作造成上传故障,例如,如果人为或系统的误操作把不同的待上传文件与切片文件对应关系弄混了,就有可能会出现待上传新文件与切片文件不一致的问题。The inventor found that the existing cloud storage solutions are generally based on uploading the entire file or uploading based on slice data, and both have certain technical defects: (1) Based on the entire file upload, it is easy to cause waste of resources, for example, when a user uploads a After a larger file, if only a small part of the file is modified, the entire file still needs to be retransmitted; (2) Uploading based on slice data may easily cause upload failures due to misoperation, for example, if manual or system Misoperation confuses the correspondence between different files to be uploaded and slice files, and there may be a problem that the new file to be uploaded is inconsistent with the slice file.
发明内容Summary of the invention
有鉴于此,本申请实施例的目的是提供一种基于云存储的文件处理方法、系统、计算机设备及非易失性计算机可读存储介质,解决现有技术资源浪费和上传故障的技术问题。In view of this, the purpose of the embodiments of the present application is to provide a file processing method, system, computer device, and non-volatile computer-readable storage medium based on cloud storage to solve the technical problems of resource waste and upload failure in the prior art.
为实现上述目的,本申请实施例提供了一种基于云存储的文件处理方法,包括以下步骤:In order to achieve the foregoing objective, an embodiment of the present application provides a file processing method based on cloud storage, which includes the following steps:
向WEB服务器发送文件上传请求,所述文件上传请求用于请求向服务器集群上传新文 件;Sending a file upload request to the WEB server, where the file upload request is used to request to upload a new file to the server cluster;
接收所述服务器集群经由所述WEB服务器返回的的文件ID,所述文件ID为所述服务器集群为所述新文件生成的;Receiving a file ID returned by the server cluster via the WEB server, where the file ID is generated by the server cluster for the new file;
对所述新文件进行切片,并为每个切片文件分配切片序号;Slice the new file, and assign a slice serial number to each slice file;
根据每个切片文件的文件数据、文件ID、切片序号计算每个切片文件的切片ID,所述切片ID用于标识所述切片文件与待上传新文件的唯一对应关系;Calculate the slice ID of each slice file according to the file data, file ID, and slice serial number of each slice file, where the slice ID is used to identify the unique correspondence between the slice file and the new file to be uploaded;
封装切片文件数据包,所述切片文件数据包中包含文件ID、每个切片文件的切片ID、每个切片文件的切片序号、每个切片文件的切片数据;及Encapsulating a slice file data package, the slice file data package including a file ID, a slice ID of each slice file, a slice serial number of each slice file, and slice data of each slice file; and
将所述切片文件数据包上传给所述WEB服务器,以通过所述WEB服务器将所述切片文件数据包中的每个切片文件的切片数据发送到所述服务器集群中的对应服务终端上进行存储,其中,所述服务器集群用于保存所述文件ID、每个切片文件的切片ID及每个切片文件的切片序号的对应关系。Upload the slice file data package to the WEB server to send slice data of each slice file in the slice file data package to the corresponding service terminal in the server cluster for storage through the WEB server , Wherein the server cluster is used to store the corresponding relationship between the file ID, the slice ID of each slice file, and the slice serial number of each slice file.
为实现上述目的,本申请实施例还提供了基于云存储的文件处理系统,包括:In order to achieve the foregoing objectives, the embodiments of the present application also provide a file processing system based on cloud storage, including:
发送模块,用于向WEB服务器发送文件上传请求,所述文件上传请求用于请求向服务器集群上传新文件;The sending module is used to send a file upload request to the WEB server, where the file upload request is used to request to upload a new file to the server cluster;
接收模块,用于接收所述服务器集群经由所述WEB服务器返回的的文件ID,所述文件ID为所述服务器集群为所述新文件生成的;A receiving module, configured to receive a file ID returned by the server cluster via the WEB server, where the file ID is generated by the server cluster for the new file;
切片模块,用于对所述新文件进行切片,并为每个切片文件分配切片序号;The slicing module is used to slice the new file and assign a slice serial number to each slice file;
计算模块,用于根据每个切片文件的文件数据、文件ID、切片序号计算每个切片文件的切片ID,所述切片ID用于标识所述切片文件与待上传新文件的唯一对应关系;The calculation module is configured to calculate the slice ID of each slice file according to the file data, file ID, and slice sequence number of each slice file, where the slice ID is used to identify the unique correspondence between the slice file and the new file to be uploaded;
封装模块,用于封装切片文件数据包,所述切片文件数据包中包含文件ID、每个切片文件的切片ID、每个切片文件的切片序号、每个切片文件的切片数据;及The encapsulation module is used to encapsulate the slice file data package, the slice file data package including the file ID, the slice ID of each slice file, the slice serial number of each slice file, and the slice data of each slice file; and
文件上传模块,用于将所述切片文件数据包上传所述WEB服务器,以通过所述WEB服务器将所述切片文件数据包中的每个切片文件的切片数据发送到所述服务器集群中的对应服务终端上进行存储,其中,所述服务器集群用于保存所述文件ID、每个切片文件的切片ID及每个切片文件的切片序号的对应关系。The file upload module is configured to upload the slice file data package to the WEB server, so that the slice data of each slice file in the slice file data package is sent to the corresponding server cluster in the server cluster through the WEB server The server cluster is used to store the corresponding relationship between the file ID, the slice ID of each slice file, and the slice serial number of each slice file.
为实现上述目的,本申请实施例还提供了一种计算机设备,所述计算机设备包括存储器、处理器及存储在所述存储器上并可在所述处理器上运行的计算机可读指令,所述计算机可读指令被处理器执行时实现以下步骤:In order to achieve the foregoing objective, an embodiment of the present application also provides a computer device, the computer device including a memory, a processor, and computer-readable instructions stored on the memory and running on the processor, the When the computer-readable instructions are executed by the processor, the following steps are implemented:
向WEB服务器发送文件上传请求,所述文件上传请求用于请求向服务器集群上传新文件;Sending a file upload request to the WEB server, where the file upload request is used to request to upload a new file to the server cluster;
接收所述服务器集群经由所述WEB服务器返回的的文件ID,所述文件ID为所述服务 器集群为所述新文件生成的;Receiving a file ID returned by the server cluster via the WEB server, where the file ID is generated by the server cluster for the new file;
对所述新文件进行切片,并为每个切片文件分配切片序号;Slice the new file, and assign a slice serial number to each slice file;
根据每个切片文件的文件数据、文件ID、切片序号计算每个切片文件的切片ID,所述切片ID用于标识所述切片文件与待上传新文件的唯一对应关系;Calculate the slice ID of each slice file according to the file data, file ID, and slice serial number of each slice file, where the slice ID is used to identify the unique correspondence between the slice file and the new file to be uploaded;
封装切片文件数据包,所述切片文件数据包中包含文件ID、每个切片文件的切片ID、每个切片文件的切片序号、每个切片文件的切片数据;及Encapsulating a slice file data package, the slice file data package including a file ID, a slice ID of each slice file, a slice serial number of each slice file, and slice data of each slice file; and
将所述切片文件数据包上传给所述WEB服务器,以通过所述WEB服务器将所述切片文件数据包中的每个切片文件的切片数据发送到所述服务器集群中的对应服务终端上进行存储,其中,所述服务器集群用于保存所述文件ID、每个切片文件的切片ID及每个切片文件的切片序号的对应关系。Upload the slice file data package to the WEB server to send slice data of each slice file in the slice file data package to the corresponding service terminal in the server cluster for storage through the WEB server , Wherein the server cluster is used to store the corresponding relationship between the file ID, the slice ID of each slice file, and the slice serial number of each slice file.
为实现上述目的,本申请实施例还提供了一种非易失性计算机可读存储介质,所述非易失性计算机可读存储介质内存储有计算机可读指令,所述计算机可读指令可被至少一个处理器所执行,以使所述至少一个处理器执行如下步骤:In order to achieve the foregoing objective, embodiments of the present application also provide a non-volatile computer-readable storage medium, in which computer-readable instructions are stored, and the computer-readable instructions may Is executed by at least one processor, so that the at least one processor executes the following steps:
向WEB服务器发送文件上传请求,所述文件上传请求用于请求向服务器集群上传新文件;Sending a file upload request to the WEB server, where the file upload request is used to request to upload a new file to the server cluster;
接收所述服务器集群经由所述WEB服务器返回的的文件ID,所述文件ID为所述服务器集群为所述新文件生成的;Receiving a file ID returned by the server cluster via the WEB server, where the file ID is generated by the server cluster for the new file;
对所述新文件进行切片,并为每个切片文件分配切片序号;Slice the new file, and assign a slice serial number to each slice file;
根据每个切片文件的文件数据、文件ID、切片序号计算每个切片文件的切片ID,所述切片ID用于标识所述切片文件与待上传新文件的唯一对应关系;Calculate the slice ID of each slice file according to the file data, file ID, and slice serial number of each slice file, where the slice ID is used to identify the unique correspondence between the slice file and the new file to be uploaded;
封装切片文件数据包,所述切片文件数据包中包含文件ID、每个切片文件的切片ID、每个切片文件的切片序号、每个切片文件的切片数据;及Encapsulating a slice file data package, the slice file data package including a file ID, a slice ID of each slice file, a slice serial number of each slice file, and slice data of each slice file; and
将所述切片文件数据包上传给所述WEB服务器,以通过所述WEB服务器将所述切片文件数据包中的每个切片文件的切片数据发送到所述服务器集群中的对应服务终端上进行存储,其中,所述服务器集群用于保存所述文件ID、每个切片文件的切片ID及每个切片文件的切片序号的对应关系。Upload the slice file data package to the WEB server to send slice data of each slice file in the slice file data package to the corresponding service terminal in the server cluster for storage through the WEB server , Wherein the server cluster is used to store the corresponding relationship between the file ID, the slice ID of each slice file, and the slice serial number of each slice file.
为实现上述目的,本申请实施例还提供了基于云存储的文件处理系统,包括:In order to achieve the foregoing objectives, the embodiments of the present application also provide a file processing system based on cloud storage, including:
WEB服务器,用于接收计算机设备发送的文件上传请求,所述文件上传请求用于请求向服务器集群上传新文件,并向所述计算机设备返回所述服务器集群为所述新文件生成的文件ID;The WEB server is configured to receive a file upload request sent by a computer device, where the file upload request is used to request to upload a new file to the server cluster, and return to the computer device the file ID generated by the server cluster for the new file;
所述计算机设备,用于对所述新文件进行切片,并为每个切片文件分配切片序号;用于根据每个切片文件的文件数据、文件ID、切片序号计算每个切片文件的切片ID,所述切 片ID用于标识所述切片文件与待上传新文件的唯一对应关系;以及用于将切片文件数据包上传给所述WEB服务器,所述切片文件数据包中包含文件ID、每个切片文件的切片ID、每个切片文件的切片序号、每个切片文件的切片数据;The computer device is used for slicing the new file and assigning a slice number to each slice file; for calculating the slice ID of each slice file according to the file data, file ID, and slice number of each slice file, The slice ID is used to identify the unique corresponding relationship between the slice file and the new file to be uploaded; and used to upload the slice file data package to the WEB server, and the slice file data package contains the file ID and each slice The slice ID of the file, the slice serial number of each slice file, and the slice data of each slice file;
WEB服务器,还用于将所述切片文件数据包中的每个切片文件的切片数据发送到所述服务器集群;The WEB server is also used to send slice data of each slice file in the slice file data package to the server cluster;
所述服务器集群,用于将每个切片文件的切片数据存储到对应的服务终端上,其中,所述服务器集群保存所述文件ID、每个切片文件的切片ID及每个切片文件的切片序号的对应关系。The server cluster is configured to store the slice data of each slice file on the corresponding service terminal, wherein the server cluster saves the file ID, the slice ID of each slice file, and the slice serial number of each slice file The corresponding relationship.
本申请实施例提供的基于云存储的文件处理方法、系统、计算机设备及非易失性计算机可读存储介质,每个切片文件的切片ID的计算依据为“每个切片文件的文件数据、文件ID、切片序号”三者相结合,每个切片ID都能保证该切片ID、该切片文件、待上传新文件之前的唯一对应关系,即使因为人为或系统的误操作把不同的待上传文件与切片文件对应关系弄混了,也不会出现待上传新文件与切片文件不一致的问题。In the cloud storage-based file processing method, system, computer device, and non-volatile computer-readable storage medium provided by the embodiments of the application, the slice ID of each slice file is calculated based on "file data, file The combination of ID and slice serial number, each slice ID can guarantee the unique corresponding relationship between the slice ID, the slice file, and the new file to be uploaded, even if the different files to be uploaded are connected to different files due to human or system error. If the corresponding relationship between the slice files is confused, the new file to be uploaded will not be inconsistent with the slice file.
可知,由于本申请实施例通过改进后的切片数据上传技术,避免整个文件重复上传而导致资源浪费,还避免了待上传文件和切片文件不一致的问题,有效保障了上传数据的正确性。It can be seen that, because the embodiment of the present application adopts the improved slice data upload technology, it avoids resource waste caused by repeated upload of the entire file, and also avoids the problem of inconsistency between the file to be uploaded and the slice file, and effectively guarantees the correctness of uploaded data.
附图说明BRIEF DESCRIPTION
图1为本申请基于云存储的文件处理方法实施例一的运行环境图。FIG. 1 is a diagram of the operating environment of Embodiment 1 of the file processing method based on cloud storage in this application.
图2为本申请基于云存储的文件处理方法实施例一的流程示意图。2 is a schematic flowchart of Embodiment 1 of a file processing method based on cloud storage in this application.
图3为本申请基于云存储的文件处理方法实施例一中的文件接收步骤的流程示意图。3 is a schematic flowchart of the file receiving step in Embodiment 1 of the file processing method based on cloud storage of this application.
图4为本申请基于云存储的文件处理方法实施例三的流程示意图。4 is a schematic flowchart of Embodiment 3 of a file processing method based on cloud storage in this application.
图5为本申请基于云存储的文件处理方法实施例三中的文件接收步骤的流程示意图。FIG. 5 is a schematic flowchart of the file receiving step in Embodiment 3 of the file processing method based on cloud storage of this application.
图6为本申请基于云存储的文件处理系统实施例四的程序模块示意图。FIG. 6 is a schematic diagram of program modules of Embodiment 4 of a file processing system based on cloud storage in this application.
图7为本申请计算机设备实施例五的硬件结构示意图。FIG. 7 is a schematic diagram of the hardware structure of the fifth embodiment of the computer equipment of this application.
具体实施方式detailed description
为了使本申请的目的、技术方案及优点更加清楚明白,以下结合附图及实施例,对本申请进行进一步详细说明。应当理解,此处所描述的具体实施例仅用以解释本申请,并不用于限定本申请。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。In order to make the purpose, technical solutions and advantages of the present application more clear, the following describes the present application in further detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application, and are not used to limit the present application. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative work fall within the protection scope of the present application.
需要说明的是,在本申请中涉及“第一”、“第二”等的描述仅用于描述目的,而不能理解为指示或暗示其相对重要性或者隐含指明所指示的技术特征的数量。由此,限定有“第一”、“第二”的特征可以明示或者隐含地包括至少一个该特征。另外,各个实施例之间的技术方案可以相互结合,但是必须是以本领域普通技术人员能够实现为基础,当技术方案的结合出现相互矛盾或无法实现时应当认为这种技术方案的结合不存在,也不在本申请要求的保护范围之内。It should be noted that the descriptions related to "first", "second", etc. in this application are only for descriptive purposes, and cannot be understood as indicating or implying their relative importance or implicitly indicating the number of technical features indicated. . Thus, the features defined as "first" and "second" may include at least one of the features either explicitly or implicitly. In addition, the technical solutions between the various embodiments can be combined with each other, but they must be based on the ability of those skilled in the art to achieve. When the combination of technical solutions conflicts with each other or cannot be realized, it should be considered that the combination of such technical solutions does not exist , Nor within the scope of protection required by this application.
图1所示,为本申请实施例之运行环境图。文件处理系统1000中包括多个执行主体,所述多个执行主体包括:Figure 1 shows a diagram of the operating environment of an embodiment of this application. The file processing system 1000 includes multiple execution entities, and the multiple execution entities include:
计算机设备2,可为用于具备上网功能的任意类型的设备。例如,个人数字助理(Personal Digital Assistant,PDA)、智能手机、笔记型电脑、上网本、个人计算机及其他类似设备;The computer equipment 2 can be any type of equipment with Internet access function. For example, Personal Digital Assistant (PDA), smart phones, notebook computers, netbooks, personal computers and other similar devices;
WEB服务器4,用于与计算机设备2通信; WEB server 4, used to communicate with computer equipment 2;
服务器集群6,服务器集群6进一步包括至少一个服务集群整合端(Service Manager)、每个集群服务整合端下可以连接若干服务分配端(Service Master)、每个服务分配端下可以连接若干服务终端(Service Worker),所述服务终端用于存储2计算机设备上传的数据文件。 Server cluster 6, server cluster 6 further includes at least one service cluster integration end (Service Manager), each cluster service integration end can be connected to several service distribution ends (Service Master), and each service distribution end can be connected to several service terminals ( Service Worker), the service terminal is used to store 2 data files uploaded by computer equipment.
以下将基于文件处理系统1000(包括计算机设备2、WEB服务器4、服务器集群6等多个执行主体),对实施例一中的文件处理方法进行示例性描述。The following will exemplify the file processing method in the first embodiment based on the file processing system 1000 (including multiple execution entities such as the computer device 2, the WEB server 4, and the server cluster 6).
实施例一Example one
参阅图2,示出了本申请实施例一之文件处理方法的步骤流程图。可以理解,本方法实施例中的流程图不用于对执行步骤的顺序进行限定。具体如下。Referring to FIG. 2, it shows a flow chart of the steps of the file processing method in the first embodiment of the present application. It can be understood that the flowchart in this method embodiment is not used to limit the order of execution of the steps. details as follows.
步骤S100,计算机设备2发送文件上传请求至WEB服务器4中。In step S100, the computer device 2 sends a file upload request to the WEB server 4.
所述文件上传请求用于请求向服务器集群6上传新文件。The file upload request is used to request to upload a new file to the server cluster 6.
步骤S102,WEB服务器4将所述文件上传请求转发至服务器集群6。In step S102, the WEB server 4 forwards the file upload request to the server cluster 6.
步骤S104,服务器集群6为所述新文件生成的文件ID。Step S104, the file ID generated by the server cluster 6 for the new file.
步骤S106,服务器集群6件所述文件ID发送至WEB服务器4。Step S106, the server cluster 6 sends the document ID to the WEB server 4.
步骤S108,WEB服务器4将所述文件ID转发至计算机设备2。In step S108, the WEB server 4 forwards the file ID to the computer device 2.
步骤S110,计算机设备2对所述新文件进行切片,并为每个切片文件分配切片序号。In step S110, the computer device 2 slices the new file, and assigns a slice serial number to each slice file.
示例性的,每个切片文件的切片序号可以为数字1、2、3等,也可以是字母是A、B、C等,也可以是其他数字、其他字母或其他类型的字符或文字等,用于表明每个切片文件彼此之间的顺序关系。Exemplarily, the slice serial number of each slice file can be numbers 1, 2, 3, etc., or letters can be A, B, C, etc., or other numbers, other letters, or other types of characters or text, etc., Used to indicate the order relationship between each slice file.
步骤S112,计算机设备2根据每个切片文件的文件数据、文件ID、切片序号计算每个切片文件的切片ID,所述切片ID用于标识所述切片文件与待上传新文件的唯一对应关系。In step S112, the computer device 2 calculates the slice ID of each slice file according to the file data, file ID, and slice serial number of each slice file. The slice ID is used to identify the unique correspondence between the slice file and the new file to be uploaded.
在示例性的实施例中,所述步骤S112包括:In an exemplary embodiment, the step S112 includes:
步骤S112A1,计算机设备2将每个切片文件对应的文件数据、文件ID以及切片序号串接成字符串;Step S112A1, the computer device 2 concatenates the file data, the file ID and the slice serial number corresponding to each slice file into a string;
步骤S112A2,计算机设备2根据每个切片对应的字符串,通过散列算法计算每个切片文件的切片ID。In step S112A2, the computer device 2 calculates the slice ID of each slice file through a hash algorithm according to the character string corresponding to each slice.
需要说明的是,字符串中三者的顺序可以根据需要进行调整,比如:可以调整为每个切片文件的文件数据、每个切片文件的切片序号、文件ID,也可以调整为文件ID、每个切片文件的切片序号、每个切片文件的文件数据等其他顺序。It should be noted that the order of the three in the string can be adjusted as needed. For example, it can be adjusted to the file data of each slice file, the slice serial number and file ID of each slice file, or it can be adjusted to the file ID, each The slice number of each slice file, the file data of each slice file, and other sequences.
所述散列算法可以是MD5(Message Digest Algorithm)、SHA(Secure Hash Algorithm)、MAC(Message Authentication Code)、CRC(Cyclic Redundancy Check)等,具体计算过程可以是:对每个切片文件的文件数据、文件ID、每个切片文件的切片序号三者串接成的字符串执行散列(Hash)函数的摘要运算,以得到摘要运算结果,将此摘要运算结果作为每个切片文件的切片ID。亦即,每个切片文件的切片ID=Hash函数(每个切片文件的文件数据、文件ID、每个切片文件的切片序号),因为Hash函数是现有技术,所以就不作详细描述。The hash algorithm can be MD5 (Message Digest Algorithm), SHA (Secure Hash Algorithm), MAC (Message Authentication Code), CRC (Cyclic Redundancy Check), etc. The specific calculation process can be: file data for each slice file The string composed of the file ID and the slice serial number of each slice file performs digest operation of the hash function to obtain the digest operation result, and the digest operation result is used as the slice ID of each slice file. That is, the slice ID of each slice file=Hash function (file data of each slice file, file ID, slice serial number of each slice file), because the Hash function is a prior art, it will not be described in detail.
在示例性的实施例中,所述步骤S112包括:In an exemplary embodiment, the step S112 includes:
步骤S112B1,计算机设备2根据每个切片文件的文件数据,通过散列算法计算每个切片文件的切片初始值;In step S112B1, the computer device 2 calculates the slice initial value of each slice file through a hash algorithm according to the file data of each slice file;
步骤S112B2,计算机设备2根据每个切片对应的切片初始值、文件ID以及切片序号,通过散列算法计算每个切片文件的切片ID。In step S112B2, the computer device 2 calculates the slice ID of each slice file through a hash algorithm according to the initial slice value, file ID and slice serial number corresponding to each slice.
举例而言,每个切片文件的切片初始值=MD5函数(每个切片文件的文件数据),每个切片文件的切片ID=SHA函数(每个切片文件的切片初始值、文件ID、每个切片文件的切片序号),因为MD5函数与Hash函数是现有技术,所以就不作详细描述。For example, the slice initial value of each slice file=MD5 function (file data of each slice file), the slice ID of each slice file=SHA function (the slice initial value of each slice file, file ID, each The slice sequence number of the slice file), because the MD5 function and the Hash function are existing technologies, they will not be described in detail.
步骤S114,计算机设备2将切片文件数据包上传给WEB服务器4。In step S114, the computer device 2 uploads the slice file data package to the WEB server 4.
所述切片文件数据包中包含文件ID、每个切片文件的切片ID、每个切片文件的切片序号、每个切片文件的切片数据。The slice file data packet includes a file ID, a slice ID of each slice file, a slice serial number of each slice file, and slice data of each slice file.
步骤S116,WEB服务器4将所述切片文件数据包中的每个切片文件的切片数据发送到服务器集群6。In step S116, the WEB server 4 sends the slice data of each slice file in the slice file data package to the server cluster 6.
步骤S118,服务器集群6将每个切片文件的切片数据存储到对应的服务终端上。其中, 服务器集群6用于保存所述文件ID、每个切片文件的切片ID及每个切片文件的切片序号的对应关系。Step S118, the server cluster 6 stores the slice data of each slice file on the corresponding service terminal. The server cluster 6 is used to store the corresponding relationship between the file ID, the slice ID of each slice file, and the slice serial number of each slice file.
步骤S120,服务器集群6将存储完成的通知消息返回给WEB服务器4。In step S120, the server cluster 6 returns the notification message of the storage completion to the WEB server 4.
步骤S122,WEB服务器4件所述通知消息转发至计算机设备2。In step S122, the notification message of the WEB server 4 is forwarded to the computer device 2.
在示例性的实施例中,如图3所示,所述文件处理方法还可以包括文件下载步骤S124。具体如下。In an exemplary embodiment, as shown in FIG. 3, the file processing method may further include a file downloading step S124. details as follows.
步骤S124A,计算机设备向WEB服务器4发送文件下载请求,所述文件下载请求中包含计算机设备2请求下载文件的文件ID;Step S124A, the computer device sends a file download request to the WEB server 4, and the file download request includes the file ID of the file that the computer device 2 requests to download;
步骤S124B,WEB服务器4将所述文件下载请求发送给服务器集群6;Step S124B, the WEB server 4 sends the file download request to the server cluster 6;
步骤S124C,服务器集群6向WEB服务器4发送存储与所述文件ID对应的文件的每个切片文件的服务终端的地址;Step S124C, the server cluster 6 sends to the WEB server 4 the address of the service terminal that stores each slice file of the file corresponding to the file ID;
步骤S124D,WEB服务器4根据所述服务终端的地址从对应的服务终端上获取每个切片文件,其中,每个切片文件包括文件ID、每个切片文件的切片ID、每个切片文件的切片序号、每个切片文件的切片数据;In step S124D, the WEB server 4 obtains each slice file from the corresponding service terminal according to the address of the service terminal, where each slice file includes a file ID, a slice ID of each slice file, and a slice serial number of each slice file. , The slice data of each slice file;
步骤S124E,WEB服务器4将每个切片文件分别传送给计算机设备;Step S124E, the WEB server 4 transmits each slice file to the computer device respectively;
步骤S124F,计算机设备根据每个切片文件中的切片序号,将接收到的切片文件组成所述请求下载的文件。In step S124F, the computer device composes the received slice file into the file requested to be downloaded according to the slice serial number in each slice file.
可以理解:(1)本实施例中每个切片文件的切片ID的计算依据为“每个切片文件的文件数据、文件ID、切片序号”三者相结合,每个切片ID都能保证该切片ID、该切片文件、待上传新文件之前的唯一对应关系,即使因为人为或系统的误操作把不同的待上传文件与切片文件对应关系弄混了,也不会出现待上传新文件与切片文件不一致的问题;(2)当计算机设备2需要下载文件时,本实施例中的WEB服务器4会先将每个切片文件分别传送给计算机设备2,计算机设备再根据每个切片文件中的切片序号,将接收到的切片文件组成所述请求下载的文件,这样“将文件分片发送”可以优化网络带宽的利用,且传送性能更加优化。It can be understood that: (1) The calculation of the slice ID of each slice file in this embodiment is based on the combination of "file data, file ID, and slice serial number of each slice file", and each slice ID can guarantee the slice The unique correspondence between ID, the slice file, and the new file to be uploaded. Even if the correspondence between the different files to be uploaded and the slice file is confused due to human or system error, the new file to be uploaded and the slice file will not appear. The problem of inconsistency; (2) When the computer device 2 needs to download a file, the WEB server 4 in this embodiment will first transmit each slice file to the computer device 2, and the computer device will then according to the slice serial number in each slice file , Composing the received slice file into the file requested to download, so that "sending the file in slices" can optimize the utilization of network bandwidth, and the transmission performance is more optimized.
实施例二Example 2
继续参阅图1,本实施例用于对文件处理系统1000进行示例性描述。Continuing to refer to FIG. 1, this embodiment is used to exemplarily describe the file processing system 1000.
文件处理系统1000包括计算机设备2、WEB服务器4、服务器集群6。The file processing system 1000 includes a computer device 2, a WEB server 4, and a server cluster 6.
WEB服务器4,用于接收计算机设备2发送的文件上传请求,所述文件上传请求用于请求向服务器集群6上传新文件,并向计算机设备4返回服务器集群6为所述新文件生成的文件ID。The WEB server 4 is used to receive a file upload request sent by the computer device 2, and the file upload request is used to request to upload a new file to the server cluster 6 and return to the computer device 4 the file ID generated by the server cluster 6 for the new file .
计算机设备2,用于对所述新文件进行切片,并为每个切片文件分配切片序号;用于根据每个切片文件的文件数据、文件ID、切片序号计算每个切片文件的切片ID,所述切片ID用于标识所述切片文件与待上传新文件的唯一对应关系;以及用于将切片文件数据包上传给WEB服务器,所述切片文件数据包中包含文件ID、每个切片文件的切片ID、每个切片文件的切片序号、每个切片文件的切片数据。The computer device 2 is used to slice the new file and assign a slice number to each slice file; it is used to calculate the slice ID of each slice file according to the file data, file ID, and slice number of each slice file. The slice ID is used to identify the unique correspondence between the slice file and the new file to be uploaded; and used to upload the slice file data package to the WEB server. The slice file data package contains the file ID and the slice of each slice file. ID, slice serial number of each slice file, slice data of each slice file.
在示例性的实施例中,根据每个切片文件的文件数据、文件ID、切片序号计算每个切片文件的切片ID,进一步包括:计算机设备2将每个切片文件对应的文件数据、文件ID以及切片序号串接成字符串;计算机设备2根据每个切片对应的字符串,通过散列算法计算每个切片文件的切片ID。In an exemplary embodiment, calculating the slice ID of each slice file according to the file data, file ID, and slice sequence number of each slice file, further includes: the computer device 2 converts the file data, file ID, and file ID corresponding to each slice file. The slice serial numbers are concatenated into character strings; the computer device 2 calculates the slice ID of each slice file through a hash algorithm according to the character string corresponding to each slice.
在另一示例性的实施例中,根据每个切片文件的文件数据、文件ID、切片序号计算每个切片文件的切片ID,进一步包括:计算机设备2根据每个切片文件的文件数据,通过散列算法计算每个切片文件的切片初始值;计算机设备2根据每个切片对应的切片初始值、文件ID以及切片序号,通过散列算法计算每个切片文件的切片ID。In another exemplary embodiment, calculating the slice ID of each slice file according to the file data, file ID, and slice serial number of each slice file further includes: the computer device 2 uses the file data of each slice file to disperse The column algorithm calculates the slice initial value of each slice file; the computer device 2 calculates the slice ID of each slice file through the hash algorithm according to the slice initial value, file ID and slice serial number corresponding to each slice.
WEB服务器4,还用于将所述切片文件数据包中的每个切片文件的切片数据发送到服务器集群6。The WEB server 4 is also used to send the slice data of each slice file in the slice file data package to the server cluster 6.
服务器集群6,用于将每个切片文件的切片数据存储到对应的服务终端上,其中,所述服务器集群保存所述文件ID、每个切片文件的切片ID及每个切片文件的切片序号的对应关系。The server cluster 6 is used to store the slice data of each slice file on the corresponding service terminal, where the server cluster saves the file ID, the slice ID of each slice file, and the slice serial number of each slice file. Correspondence.
在示例性的实施例中:In an exemplary embodiment:
计算机设备2,还用于向WEB服务器4发送文件下载请求,所述文件下载请求中包含计算机设备2请求下载文件的文件ID;The computer device 2 is also used to send a file download request to the WEB server 4, and the file download request includes the file ID of the file that the computer device 2 requests to download;
WEB服务器4,还用于将所述文件下载请求发送给服务器集群6;The WEB server 4 is also used to send the file download request to the server cluster 6;
服务器集群6,还用于向WEB服务器4发送存储与所述文件ID对应的文件的每个切片文件的服务终端的地址;The server cluster 6 is also used to send the address of the service terminal storing each slice file of the file corresponding to the file ID to the WEB server 4;
WEB服务器4,还用于根据所述服务终端的地址从对应的服务终端上获取每个切片文件,其中,每个切片文件包括文件ID、每个切片文件的切片ID、每个切片文件的切片序号、每个切片文件的切片数据;The WEB server 4 is also used to obtain each slice file from the corresponding service terminal according to the address of the service terminal, where each slice file includes a file ID, a slice ID of each slice file, and a slice of each slice file. Serial number, slice data of each slice file;
WEB服务器4,还用于将每个切片文件分别传送给计算机设备;The WEB server 4 is also used to separately transmit each slice file to the computer equipment;
计算机设备2,还用于根据每个切片文件中的切片序号,将接收到的切片文件组成所述请求下载的文件。The computer device 2 is also used to compose the received slice file into the file requested to be downloaded according to the slice serial number in each slice file.
以下将以计算机设备2为执行主体,对实施例三中的文件处理方法进行示例性描述。The following will exemplify the file processing method in the third embodiment with the computer device 2 as the execution subject.
实施例三Example three
参阅图4,示出了本申请实施例三之文件处理方法的步骤流程图。可以理解,本方法实施例中的流程图不用于对执行步骤的顺序进行限定。具体如下。Referring to FIG. 4, it shows a flowchart of the steps of the file processing method in the third embodiment of the present application. It can be understood that the flowchart in this method embodiment is not used to limit the order of execution of the steps. details as follows.
步骤S200,向WEB服务器发送文件上传请求,所述文件上传请求用于请求向服务器集群上传新文件。Step S200: Send a file upload request to the WEB server, where the file upload request is used to request to upload a new file to the server cluster.
步骤S202,接收服务器集群经由WEB服务器返回的的文件ID,所述文件ID为服务器集群为所述新文件生成的。Step S202: Receive a file ID returned by the server cluster via the WEB server, where the file ID is generated by the server cluster for the new file.
步骤S204,对所述新文件进行切片,并为每个切片文件分配切片序号。Step S204, slice the new file, and assign a slice serial number to each slice file.
步骤S206,根据每个切片文件的文件数据、文件ID、切片序号计算每个切片文件的切片ID,所述切片ID用于标识所述切片文件与待上传新文件的唯一对应关系。Step S206: Calculate the slice ID of each slice file according to the file data, file ID, and slice serial number of each slice file, where the slice ID is used to identify the unique correspondence between the slice file and the new file to be uploaded.
在示例性的实施例中,所述步骤S206包括:In an exemplary embodiment, the step S206 includes:
步骤S206A1,将每个切片文件对应的文件数据、文件ID以及切片序号串接成字符串;Step S206A1, concatenate the file data, file ID and slice serial number corresponding to each slice file into a string;
步骤S206A2,根据每个切片对应的字符串,通过散列算法计算每个切片文件的切片ID。Step S206A2: According to the character string corresponding to each slice, the slice ID of each slice file is calculated through a hash algorithm.
需要说明的是,字符串中三者的顺序可以根据需要进行调整,比如:可以调整为每个切片文件的文件数据、每个切片文件的切片序号、文件ID,也可以调整为文件ID、每个切片文件的切片序号、每个切片文件的文件数据等其他顺序。It should be noted that the order of the three in the string can be adjusted as needed. For example, it can be adjusted to the file data of each slice file, the slice serial number and file ID of each slice file, or it can be adjusted to the file ID, each The slice number of each slice file, the file data of each slice file, and other sequences.
所述散列算法可以是MD5(Message Digest Algorithm)、SHA(Secure Hash Algorithm)、MAC(Message Authentication Code)、CRC(Cyclic Redundancy Check)等,具体计算过程可以是:对每个切片文件的文件数据、文件ID、每个切片文件的切片序号三者串接成的字符串执行散列(Hash)函数的摘要运算,以得到摘要运算结果,将此摘要运算结果作为每个切片文件的切片ID。亦即,每个切片文件的切片ID=Hash函数(每个切片文件的文件数据、文件ID、每个切片文件的切片序号),因为Hash函数是现有技术,所以就不作详细描述。The hash algorithm can be MD5 (Message Digest Algorithm), SHA (Secure Hash Algorithm), MAC (Message Authentication Code), CRC (Cyclic Redundancy Check), etc. The specific calculation process can be: file data for each slice file The string consisting of the file ID, and the slice serial number of each slice file executes the digest operation of the Hash function to obtain the digest operation result, which is used as the slice ID of each slice file. That is, the slice ID of each slice file=Hash function (file data of each slice file, file ID, slice serial number of each slice file), because the Hash function is a prior art, it will not be described in detail.
在示例性的实施例中,所述步骤S206包括:In an exemplary embodiment, the step S206 includes:
步骤S206B1,根据每个切片文件的文件数据,通过散列算法计算每个切片文件的切片初始值;Step S206B1, according to the file data of each slice file, calculate the slice initial value of each slice file through a hash algorithm;
步骤S206B2,根据每个切片对应的切片初始值、文件ID以及切片序号,通过散列算法计算每个切片文件的切片ID。In step S206B2, the slice ID of each slice file is calculated through a hash algorithm according to the initial value of the slice corresponding to each slice, the file ID, and the slice serial number.
举例而言,每个切片文件的切片初始值=MD5函数(每个切片文件的文件数据),每个切片文件的切片ID=SHA函数(每个切片文件的切片初始值、文件ID、每个切片文件的切片序号),因为MD5函数与Hash函数是现有技术,所以就不作详细描述。For example, the slice initial value of each slice file=MD5 function (file data of each slice file), the slice ID of each slice file=SHA function (the slice initial value of each slice file, file ID, each The slice sequence number of the slice file), because the MD5 function and the Hash function are existing technologies, they will not be described in detail.
步骤S208,封装切片文件数据包,所述切片文件数据包中包含文件ID、每个切片文件的切片ID、每个切片文件的切片序号、每个切片文件的切片数据。Step S208: Encapsulate the slice file data package, the slice file data package including the file ID, the slice ID of each slice file, the slice serial number of each slice file, and the slice data of each slice file.
步骤S210,将所述切片文件数据包上传给WEB服务器,以通过WEB服务器将所述切片文件数据包中的每个切片文件的切片数据发送到服务器集群中的对应服务终端上进行存储,其中,服务器集群用于保存所述文件ID、每个切片文件的切片ID及每个切片文件的切片序号的对应关系。Step S210: Upload the slice file data package to the WEB server, so that the slice data of each slice file in the slice file data package is sent to the corresponding service terminal in the server cluster for storage through the WEB server, where: The server cluster is used to store the corresponding relationship between the file ID, the slice ID of each slice file, and the slice serial number of each slice file.
在示例性的实施例中,如图5所示,所述文件处理方法还可以包括文件下载步骤S212。具体如下。In an exemplary embodiment, as shown in FIG. 5, the file processing method may further include a file downloading step S212. details as follows.
步骤S212A,向WEB服务器发送文件下载请求,所述文件下载请求中包含计算机设备请求下载文件的文件ID;Step S212A, sending a file download request to the WEB server, where the file download request includes the file ID of the computer device requesting to download the file;
步骤S212B,接收WEB服务器基于所述文件下载请求从服务器集群对应的服务终端上获取的每个切片文件,其中,每个切片文件包括文件ID、每个切片文件的切片ID、每个切片文件的切片序号、每个切片文件的切片数据;Step S212B: Receive each slice file obtained by the WEB server from the service terminal corresponding to the server cluster based on the file download request, where each slice file includes a file ID, a slice ID of each slice file, and a slice ID of each slice file. Slice serial number, slice data of each slice file;
步骤S212C,根据每个切片文件中的切片序号,将接收到的切片文件组成所述请求下载的文件。Step S212C, according to the slice serial number in each slice file, compose the received slice file into the file requested to be downloaded.
实施例四Example 4
请继续参阅图6,示出了本申请基于云存储的文件处理系统实施例四的程序模块示意图。Please continue to refer to FIG. 6, which shows a schematic diagram of the program modules of the fourth embodiment of the cloud storage-based file processing system of the present application.
需要说明的是,图1所示的文件处理系统1000为多个执行主体构成的外部架构系统。本实施例中所述的文件处理系统20为由一个或多个程序模块组成的软件集合。It should be noted that the file processing system 1000 shown in FIG. 1 is an external architecture system composed of multiple execution entities. The file processing system 20 described in this embodiment is a software collection composed of one or more program modules.
在本实施例中,基于云存储的文件处理系统20可以包括或被分割成一个或多个程序模块,一个或者多个程序模块被存储于存储介质中,并由一个或多个处理器所执行,以完成本申请,并可实现上述基于云存储的文件处理方法。本申请实施例所称的程序模块是指能够完成特定功能的一系列计算机可读指令段。以下描述将具体介绍本实施例各程序模块的功能:In this embodiment, the cloud storage-based file processing system 20 may include or be divided into one or more program modules, and the one or more program modules are stored in a storage medium and executed by one or more processors. , In order to complete this application and realize the above-mentioned file processing method based on cloud storage. The program module referred to in the embodiments of the present application refers to a series of computer-readable instruction segments that can complete specific functions. The following description will specifically introduce the functions of each program module in this embodiment:
发送模块200,用于向WEB服务器发送文件上传请求,所述文件上传请求用于请求向服务器集群上传新文件。The sending module 200 is configured to send a file upload request to the WEB server, and the file upload request is used to request to upload a new file to the server cluster.
接收模块202,用于接收所述服务器集群经由所述WEB服务器返回的的文件ID,所述文件ID为所述服务器集群为所述新文件生成的。The receiving module 202 is configured to receive a file ID returned by the server cluster via the WEB server, where the file ID is generated by the server cluster for the new file.
切片模块204,用于对所述新文件进行切片,并为每个切片文件分配切片序号。The slicing module 204 is used to slice the new file and assign a slice serial number to each slice file.
计算模块206,用于根据每个切片文件的文件数据、文件ID、切片序号计算每个切片 文件的切片ID,所述切片ID用于标识所述切片文件与待上传新文件的唯一对应关系。The calculation module 206 is configured to calculate the slice ID of each slice file according to the file data, file ID, and slice serial number of each slice file, and the slice ID is used to identify the unique correspondence between the slice file and the new file to be uploaded.
在示例性的实施例中,计算模块206,还用于将每个切片文件对应的文件数据、文件ID以及切片序号串接成字符串,及根据每个切片对应的字符串,通过散列算法计算每个切片文件的切片ID。In an exemplary embodiment, the calculation module 206 is further configured to concatenate the file data, file ID, and slice serial number corresponding to each slice file into a string, and use a hash algorithm according to the string corresponding to each slice Calculate the slice ID of each slice file.
在示例性的实施例中,计算模块206,还用于根据每个切片文件的文件数据,通过散列算法计算每个切片文件的切片初始值;及根据每个切片对应的切片初始值、文件ID以及切片序号,通过散列算法计算每个切片文件的切片ID。In an exemplary embodiment, the calculation module 206 is further configured to calculate the initial slice value of each slice file through a hash algorithm according to the file data of each slice file; and according to the slice initial value and file corresponding to each slice ID and slice serial number, the slice ID of each slice file is calculated through a hash algorithm.
封装模块208,用于封装切片文件数据包,所述切片文件数据包中包含文件ID、每个切片文件的切片ID、每个切片文件的切片序号、每个切片文件的切片数据。The encapsulation module 208 is configured to encapsulate a slice file data packet, which contains a file ID, a slice ID of each slice file, a slice serial number of each slice file, and slice data of each slice file.
文件上传模块210,用于将所述切片文件数据包上传给WEB服务器,以通过所述WEB服务器将所述切片文件数据包中的每个切片文件的切片数据发送到所述服务器集群中的对应服务终端上进行存储,其中,所述服务器集群用于保存所述文件ID、每个切片文件的切片ID及每个切片文件的切片序号的对应关系。The file upload module 210 is configured to upload the slice file data package to a WEB server, so as to send the slice data of each slice file in the slice file data package to the corresponding server cluster through the WEB server. The server cluster is used to store the corresponding relationship between the file ID, the slice ID of each slice file, and the slice serial number of each slice file.
在示例性的实施例中,还包括文件接收模块212,用于:向所述WEB服务器发送文件下载请求,所述文件下载请求中包含所述计算机设备请求下载文件的文件ID;接收所述WEB服务器基于所述文件下载请求从所述服务器集群对应的服务终端上获取的每个切片文件,其中,每个切片文件包括文件ID、每个切片文件的切片ID、每个切片文件的切片序号、每个切片文件的切片数据;根据每个切片文件中的切片序号,将接收到的切片文件组成所述请求下载的文件。In an exemplary embodiment, it further includes a file receiving module 212, configured to: send a file download request to the WEB server, where the file download request includes the file ID of the computer device requesting to download the file; and receive the WEB The server obtains each slice file from the service terminal corresponding to the server cluster based on the file download request, where each slice file includes a file ID, a slice ID of each slice file, a slice serial number of each slice file, The slice data of each slice file; according to the slice serial number in each slice file, the received slice file is composed of the file requested to be downloaded.
实施例五Example 5
参阅图7,是本申请实施例五之计算机设备的硬件架构示意图。本实施例中,所述计算机设备2是一种能够按照事先设定或者存储的指令,自动进行数值计算和/或信息处理的设备。该计算机设备2可以是个人数字助理(Personal Digital Assistant,PDA)、智能手机、笔记型电脑、上网本、个人计算机及其他类似设备等。如图所示,所述计算机设备2至少包括,但不限于,可通过系统总线相互通信连接存储器21、处理器22、网络接口23、以及基于云存储的文件处理系统20。其中:Refer to FIG. 7, which is a schematic diagram of the hardware architecture of the computer device according to the fifth embodiment of the present application. In this embodiment, the computer device 2 is a device that can automatically perform numerical calculation and/or information processing according to pre-set or stored instructions. The computer device 2 may be a Personal Digital Assistant (PDA), a smart phone, a notebook computer, a netbook, a personal computer, and other similar devices. As shown in the figure, the computer device 2 at least includes, but is not limited to, a memory 21, a processor 22, a network interface 23, and a file processing system 20 based on cloud storage that can communicate with each other through a system bus. among them:
本实施例中,存储器21至少包括一种类型的非易失性计算机可读存储介质,所述可读存储介质包括闪存、硬盘、多媒体卡、卡型存储器(例如,SD或DX存储器等)、随机访问存储器(RAM)、静态随机访问存储器(SRAM)、只读存储器(ROM)、电可擦除可编程只读存储器(EEPROM)、可编程只读存储器(PROM)、磁性存储器、磁盘、光盘等。在一些实施例中,存储器21可以是计算机设备2的内部存储单元,例如该计算机设备2的硬盘或内存。 在另一些实施例中,存储器21也可以是计算机设备2的外部存储设备,例如该计算机设备20上配备的插接式硬盘,智能存储卡(Smart Media Card,SMC),安全数字(Secure Digital,SD)卡,闪存卡(Flash Card)等。当然,存储器21还可以既包括计算机设备2的内部存储单元也包括其外部存储设备。本实施例中,存储器21通常用于存储安装于计算机设备2的操作系统和各类应用软件,例如实施例四的基于云存储的文件处理系统20的程序代码等。此外,存储器21还可以用于暂时地存储已经输出或者将要输出的各类数据。In this embodiment, the memory 21 includes at least one type of non-volatile computer-readable storage medium. The readable storage medium includes flash memory, hard disk, multimedia card, card-type memory (for example, SD or DX memory, etc.), Random access memory (RAM), static random access memory (SRAM), read only memory (ROM), electrically erasable programmable read only memory (EEPROM), programmable read only memory (PROM), magnetic memory, magnetic disk, optical disk Wait. In some embodiments, the memory 21 may be an internal storage unit of the computer device 2, for example, the hard disk or memory of the computer device 2. In other embodiments, the memory 21 may also be an external storage device of the computer device 2, for example, a plug-in hard disk, a smart media card (SMC), and a secure digital (Secure Digital, SD) card, flash card (Flash Card), etc. Of course, the memory 21 may also include both the internal storage unit of the computer device 2 and its external storage device. In this embodiment, the memory 21 is generally used to store the operating system and various application software installed in the computer device 2, for example, the program code of the file processing system 20 based on cloud storage in the fourth embodiment. In addition, the memory 21 can also be used to temporarily store various types of data that have been output or will be output.
处理器22在一些实施例中可以是中央处理器(Central Processing Unit,CPU)、控制器、微控制器、微处理器、或其他数据处理芯片。该处理器22通常用于控制计算机设备2的总体操作。本实施例中,处理器22用于运行存储器21中存储的程序代码或者处理数据,例如运行基于云存储的文件处理系统20,以实现实施例三的基于云存储的文件处理方法。The processor 22 may be a central processing unit (Central Processing Unit, CPU), a controller, a microcontroller, a microprocessor, or other data processing chips in some embodiments. The processor 22 is generally used to control the overall operation of the computer device 2. In this embodiment, the processor 22 is used to run the program code or process data stored in the memory 21, for example, to run the file processing system 20 based on cloud storage, so as to implement the file processing method based on cloud storage in the third embodiment.
所述网络接口23可包括无线网络接口或有线网络接口,该网络接口23通常用于在所述计算机设备2与其他电子装置之间建立通信连接。例如,所述网络接口23用于通过网络将所述计算机设备2与外部终端相连,在所述计算机设备2与外部终端之间的建立数据传输通道和通信连接等。所述网络可以是企业内部网(Intranet)、互联网(Internet)、全球移动通讯系统(Global System of Mobile communication,GSM)、宽带码分多址(Wideband Code Division Multiple Access,WCDMA)、4G网络、5G网络、蓝牙(Bluetooth)、Wi-Fi等无线或有线网络。The network interface 23 may include a wireless network interface or a wired network interface, and the network interface 23 is generally used to establish a communication connection between the computer device 2 and other electronic devices. For example, the network interface 23 is used to connect the computer device 2 with an external terminal through a network, and establish a data transmission channel and a communication connection between the computer device 2 and the external terminal. The network may be an intranet, the Internet, a global system of mobile communication (GSM), a wideband code division multiple access (WCDMA), a 4G network, and a 5G Network, Bluetooth (Bluetooth), Wi-Fi and other wireless or wired networks.
需要指出的是,图7仅示出了具有部件20-23的计算机设备2,但是应理解的是,并不要求实施所有示出的部件,可以替代的实施更多或者更少的部件。It should be pointed out that FIG. 7 only shows the computer device 2 with components 20-23, but it should be understood that it is not required to implement all the components shown, and more or fewer components may be implemented instead.
在本实施例中,存储于存储器21中的所述基于云存储的文件处理系统20还可以被分割为一个或者多个程序模块,所述一个或者多个程序模块被存储于存储器21中,并由一个或多个处理器(本实施例为处理器22)所执行,以完成本申请。In this embodiment, the cloud storage-based file processing system 20 stored in the memory 21 may also be divided into one or more program modules, and the one or more program modules are stored in the memory 21, and It is executed by one or more processors (the processor 22 in this embodiment) to complete the application.
例如,图6示出了所述实现基于云存储的文件处理系统20实施例四的程序模块示意图,该实施例中,所述基于云存储的文件处理系统20可以被划分为发送模块200、接收模块202、切片模块204、计算模块206、封装模块208、文件上传模块210和文件接收模块212。其中,本申请所称的程序模块是指能够完成特定功能的一系列计算机可读指令段,比程序更适合于描述所述基于云存储的文件处理系统20在所述计算机设备2中的执行过程。所述程序模块200-212的具体功能在实施例四中已有详细描述,在此不再赘述。For example, FIG. 6 shows a schematic diagram of program modules in the fourth embodiment of the cloud storage-based file processing system 20. In this embodiment, the cloud storage-based file processing system 20 can be divided into a sending module 200 and a receiving module. Module 202, slicing module 204, calculation module 206, packaging module 208, file uploading module 210, and file receiving module 212. Among them, the program module referred to in this application refers to a series of computer-readable instruction segments that can complete specific functions, and is more suitable than a program to describe the execution process of the cloud storage-based file processing system 20 in the computer device 2. . The specific functions of the program modules 200-212 have been described in detail in the fourth embodiment, and will not be repeated here.
实施例六Example Six
本实施例还提供一种非易失性计算机可读存储介质,如闪存、硬盘、多媒体卡、卡型存储器(例如,SD或DX存储器等)、随机访问存储器(RAM)、静态随机访问存储器(SRAM)、 只读存储器(ROM)、电可擦除可编程只读存储器(EEPROM)、可编程只读存储器(PROM)、磁性存储器、磁盘、光盘、服务器、App应用商城等等,其上存储有计算机可读指令,程序被处理器执行时实现相应功能。本实施例的非易失性计算机可读存储介质用于存储基于云存储的文件处理系统20,被处理器执行以下步骤:This embodiment also provides a non-volatile computer-readable storage medium, such as flash memory, hard disk, multimedia card, card-type memory (for example, SD or DX memory, etc.), random access memory (RAM), static random access memory ( SRAM), Read Only Memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), Programmable Read Only Memory (PROM), Magnetic Memory, Disk, Optical Disk, Server, App Store, etc., which are stored on There are computer-readable instructions, and the corresponding functions are realized when the program is executed by the processor. The non-volatile computer-readable storage medium of this embodiment is used to store the cloud storage-based file processing system 20, and the processor executes the following steps:
向WEB服务器发送文件上传请求,所述文件上传请求用于请求向服务器集群上传新文件;Sending a file upload request to the WEB server, where the file upload request is used to request to upload a new file to the server cluster;
接收所述服务器集群经由所述WEB服务器返回的的文件ID,所述文件ID为所述服务器集群为所述新文件生成的;Receiving a file ID returned by the server cluster via the WEB server, where the file ID is generated by the server cluster for the new file;
对所述新文件进行切片,并为每个切片文件分配切片序号;Slice the new file, and assign a slice serial number to each slice file;
根据每个切片文件的文件数据、文件ID、切片序号计算每个切片文件的切片ID,所述切片ID用于标识所述切片文件与待上传新文件的唯一对应关系;Calculate the slice ID of each slice file according to the file data, file ID, and slice serial number of each slice file, where the slice ID is used to identify the unique correspondence between the slice file and the new file to be uploaded;
封装切片文件数据包,所述切片文件数据包中包含文件ID、每个切片文件的切片ID、每个切片文件的切片序号、每个切片文件的切片数据;及Encapsulating a slice file data package, the slice file data package including a file ID, a slice ID of each slice file, a slice serial number of each slice file, and slice data of each slice file; and
将所述切片文件数据包上传给所述WEB服务器,以通过所述WEB服务器将所述切片文件数据包中的每个切片文件的切片数据发送到所述服务器集群中的对应服务终端上进行存储,其中,所述服务器集群用于保存所述文件ID、每个切片文件的切片ID及每个切片文件的切片序号的对应关系。Upload the slice file data package to the WEB server to send slice data of each slice file in the slice file data package to the corresponding service terminal in the server cluster for storage through the WEB server , Wherein the server cluster is used to store the corresponding relationship between the file ID, the slice ID of each slice file, and the slice serial number of each slice file.
上述本申请实施例序号仅仅为了描述,不代表实施例的优劣。The sequence numbers of the above embodiments of the present application are for description only, and do not represent the advantages and disadvantages of the embodiments.
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到上述实施例方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。Through the description of the above embodiments, those skilled in the art can clearly understand that the methods in the above embodiments can be implemented by means of software plus a necessary general hardware platform, and of course, can also be implemented by hardware, but in many cases the former is better Implementation.
以上仅为本申请的优选实施例,并非因此限制本申请的专利范围,凡是利用本申请说明书及附图内容所作的等效结构或等效流程变换,或直接或间接运用在其他相关的技术领域,均同理包括在本申请的专利保护范围内。The above are only the preferred embodiments of the present application and do not limit the scope of the patent of the present application. Any equivalent structure or equivalent process transformation made by the description and drawings of this application, or directly or indirectly used in other related technical fields The same reason is included in the patent protection scope of this application.

Claims (20)

  1. 一种基于云存储的文件处理方法,应用于计算机设备中,所述方法包括:A file processing method based on cloud storage, applied to a computer device, the method including:
    向WEB服务器发送文件上传请求,所述文件上传请求用于请求向服务器集群上传新文件;Sending a file upload request to the WEB server, where the file upload request is used to request to upload a new file to the server cluster;
    接收所述服务器集群经由所述WEB服务器返回的的文件ID,所述文件ID为所述服务器集群为所述新文件生成的;Receiving a file ID returned by the server cluster via the WEB server, where the file ID is generated by the server cluster for the new file;
    对所述新文件进行切片,并为每个切片文件分配切片序号;Slice the new file, and assign a slice serial number to each slice file;
    根据每个切片文件的文件数据、文件ID、切片序号计算每个切片文件的切片ID,所述切片ID用于标识所述切片文件与待上传新文件的唯一对应关系;Calculate the slice ID of each slice file according to the file data, file ID, and slice serial number of each slice file, where the slice ID is used to identify the unique correspondence between the slice file and the new file to be uploaded;
    封装切片文件数据包,所述切片文件数据包中包含文件ID、每个切片文件的切片ID、每个切片文件的切片序号、每个切片文件的切片数据;及Encapsulating a slice file data package, the slice file data package including a file ID, a slice ID of each slice file, a slice serial number of each slice file, and slice data of each slice file; and
    将所述切片文件数据包上传给所述WEB服务器,以通过所述WEB服务器将所述切片文件数据包中的每个切片文件的切片数据发送到所述服务器集群中的对应服务终端上进行存储,其中,所述服务器集群用于保存所述文件ID、每个切片文件的切片ID及每个切片文件的切片序号的对应关系。Upload the slice file data package to the WEB server to send slice data of each slice file in the slice file data package to the corresponding service terminal in the server cluster for storage through the WEB server , Wherein the server cluster is used to store the corresponding relationship between the file ID, the slice ID of each slice file, and the slice serial number of each slice file.
  2. 根据权利要求1所述的基于云存储的文件处理方法,根据每个切片文件的文件数据、文件ID、切片序号计算每个切片文件的切片ID的步骤,包括:According to the cloud storage-based file processing method of claim 1, the step of calculating the slice ID of each slice file according to the file data, file ID, and slice serial number of each slice file includes:
    将每个切片文件对应的文件数据、文件ID以及切片序号串接成字符串,及Concatenate the file data, file ID and slice serial number corresponding to each slice file into a string, and
    根据每个切片对应的字符串,通过散列算法计算每个切片文件的切片ID。According to the character string corresponding to each slice, the slice ID of each slice file is calculated through a hash algorithm.
  3. 根据权利要求1所述的基于云存储的文件处理方法,根据每个切片文件的文件数据、文件ID、切片序号计算每个切片文件的切片ID的步骤,包括:According to the cloud storage-based file processing method of claim 1, the step of calculating the slice ID of each slice file according to the file data, file ID, and slice serial number of each slice file includes:
    根据每个切片文件的文件数据,通过散列算法计算每个切片文件的切片初始值;及According to the file data of each slice file, calculate the slice initial value of each slice file through a hashing algorithm; and
    根据每个切片对应的切片初始值、文件ID以及切片序号,通过散列算法计算每个切片文件的切片ID。According to the initial value of each slice, the file ID, and the slice serial number, the slice ID of each slice file is calculated through a hash algorithm.
  4. 根据权利要求1所述的基于云存储的文件处理方法,当计算机设备需要下载文件时,所述方法包括以下步骤:According to the file processing method based on cloud storage of claim 1, when a computer device needs to download a file, the method includes the following steps:
    向所述WEB服务器发送文件下载请求,所述文件下载请求中包含所述计算机设备请求下载文件的文件ID;Sending a file download request to the WEB server, where the file download request includes the file ID of the file requested by the computer device to download;
    接收所述WEB服务器基于所述文件下载请求从所述服务器集群对应的服务终端上获取的每个切片文件,其中,每个切片文件包括文件ID、每个切片文件的切片ID、每个切片文件的切片序号、每个切片文件的切片数据;Receive each slice file obtained by the WEB server from the service terminal corresponding to the server cluster based on the file download request, where each slice file includes a file ID, a slice ID of each slice file, and each slice file The slice number and slice data of each slice file;
    根据每个切片文件中的切片序号,将接收到的切片文件组成所述请求下载的文件。According to the slice serial number in each slice file, the received slice file is composed of the file requested to be downloaded.
  5. 一种基于云存储的文件处理系统,应用于计算机设备中,所述系统包括:A file processing system based on cloud storage, applied to computer equipment, the system including:
    发送模块,用于向WEB服务器发送文件上传请求,所述文件上传请求用于请求向服务器集群上传新文件;The sending module is used to send a file upload request to the WEB server, where the file upload request is used to request to upload a new file to the server cluster;
    接收模块,用于接收所述服务器集群经由所述WEB服务器返回的的文件ID,所述文件ID为所述服务器集群为所述新文件生成的;A receiving module, configured to receive a file ID returned by the server cluster via the WEB server, where the file ID is generated by the server cluster for the new file;
    切片模块,用于对所述新文件进行切片,并为每个切片文件分配切片序号;The slicing module is used to slice the new file and assign a slice serial number to each slice file;
    计算模块,用于根据每个切片文件的文件数据、文件ID、切片序号计算每个切片文件的切片ID,所述切片ID用于标识所述切片文件与待上传新文件的唯一对应关系;The calculation module is configured to calculate the slice ID of each slice file according to the file data, file ID, and slice sequence number of each slice file, where the slice ID is used to identify the unique correspondence between the slice file and the new file to be uploaded;
    封装模块,用于封装切片文件数据包,所述切片文件数据包中包含文件ID、每个切片文件的切片ID、每个切片文件的切片序号、每个切片文件的切片数据;及The encapsulation module is used to encapsulate the slice file data package, the slice file data package including the file ID, the slice ID of each slice file, the slice serial number of each slice file, and the slice data of each slice file; and
    文件上传模块,用于将所述切片文件数据包上传给所述WEB服务器,以通过所述WEB服务器将所述切片文件数据包中的每个切片文件的切片数据发送到所述服务器集群中的对应服务终端上进行存储,其中,所述服务器集群用于保存所述文件ID、每个切片文件的切片ID及每个切片文件的切片序号的对应关系。The file upload module is configured to upload the slice file data package to the WEB server, so as to send slice data of each slice file in the slice file data package to the server cluster through the WEB server It is stored on the corresponding service terminal, where the server cluster is used to store the corresponding relationship between the file ID, the slice ID of each slice file, and the slice serial number of each slice file.
  6. 根据权利要求5所述的文件处理系统,所述计算模块还用于:According to the file processing system according to claim 5, the calculation module is further configured to:
    将每个切片文件对应的文件数据、文件ID以及切片序号串接成字符串,及Concatenate the file data, file ID and slice serial number corresponding to each slice file into a string, and
    根据每个切片对应的字符串,通过散列算法计算每个切片文件的切片ID。According to the character string corresponding to each slice, the slice ID of each slice file is calculated through a hash algorithm.
  7. 根据权利要求5所述的文件处理系统,所述计算模块还用于:According to the file processing system according to claim 5, the calculation module is further configured to:
    根据每个切片文件的文件数据,通过散列算法计算每个切片文件的切片初始值;及According to the file data of each slice file, calculate the slice initial value of each slice file through a hashing algorithm; and
    根据每个切片对应的切片初始值、文件ID以及切片序号,通过散列算法计算每个切片文件的切片ID。According to the initial value of each slice, the file ID, and the slice serial number, the slice ID of each slice file is calculated through a hash algorithm.
  8. 根据权利要求5所述的文件处理系统,还包括下载模块,用于:The file processing system according to claim 5, further comprising a download module for:
    向所述WEB服务器发送文件下载请求,所述文件下载请求中包含所述计算机设备请求下载文件的文件ID;Sending a file download request to the WEB server, where the file download request includes the file ID of the file requested by the computer device to download;
    接收所述WEB服务器基于所述文件下载请求从所述服务器集群对应的服务终端上获取的每个切片文件,其中,每个切片文件包括文件ID、每个切片文件的切片ID、每个切片文件的切片序号、每个切片文件的切片数据;Receive each slice file obtained by the WEB server from the service terminal corresponding to the server cluster based on the file download request, where each slice file includes a file ID, a slice ID of each slice file, and each slice file The slice number and slice data of each slice file;
    根据每个切片文件中的切片序号,将接收到的切片文件组成所述请求下载的文件。According to the slice serial number in each slice file, the received slice file is composed of the file requested to be downloaded.
  9. 一种计算机设备,所述计算机设备包括存储器、处理器及存储在所述存储器上并可在所述处理器上运行的计算机可读指令,所述计算机可读指令被处理器执行时实现以下步骤:A computer device that includes a memory, a processor, and computer-readable instructions stored on the memory and capable of running on the processor. The computer-readable instructions implement the following steps when executed by the processor :
    向WEB服务器发送文件上传请求,所述文件上传请求用于请求向服务器集群上传新文件;Sending a file upload request to the WEB server, where the file upload request is used to request to upload a new file to the server cluster;
    接收所述服务器集群经由所述WEB服务器返回的的文件ID,所述文件ID为所述服务器集群为所述新文件生成的;Receiving a file ID returned by the server cluster via the WEB server, where the file ID is generated by the server cluster for the new file;
    对所述新文件进行切片,并为每个切片文件分配切片序号;Slice the new file, and assign a slice serial number to each slice file;
    根据每个切片文件的文件数据、文件ID、切片序号计算每个切片文件的切片ID,所述切片ID用于标识所述切片文件与待上传新文件的唯一对应关系;Calculate the slice ID of each slice file according to the file data, file ID, and slice serial number of each slice file, where the slice ID is used to identify the unique correspondence between the slice file and the new file to be uploaded;
    封装切片文件数据包,所述切片文件数据包中包含文件ID、每个切片文件的切片ID、每个切片文件的切片序号、每个切片文件的切片数据;及Encapsulating a slice file data package, the slice file data package including a file ID, a slice ID of each slice file, a slice serial number of each slice file, and slice data of each slice file; and
    将所述切片文件数据包上传给所述WEB服务器,以通过所述WEB服务器将所述切片文件数据包中的每个切片文件的切片数据发送到所述服务器集群中的对应服务终端上进行存储,其中,所述服务器集群用于保存所述文件ID、每个切片文件的切片ID及每个切片文件的切片序号的对应关系。Upload the slice file data package to the WEB server to send slice data of each slice file in the slice file data package to the corresponding service terminal in the server cluster for storage through the WEB server , Wherein the server cluster is used to store the corresponding relationship between the file ID, the slice ID of each slice file, and the slice serial number of each slice file.
  10. 根据权利要求9所述的计算机设备,根据每个切片文件的文件数据、文件ID、切片序号计算每个切片文件的切片ID的步骤,包括:The computer device according to claim 9, wherein the step of calculating the slice ID of each slice file according to the file data, file ID, and slice serial number of each slice file comprises:
    将每个切片文件对应的文件数据、文件ID以及切片序号串接成字符串,及Concatenate the file data, file ID and slice serial number corresponding to each slice file into a string, and
    根据每个切片对应的字符串,通过散列算法计算每个切片文件的切片ID。According to the character string corresponding to each slice, the slice ID of each slice file is calculated through a hash algorithm.
  11. 根据权利要求9所述的计算机设备,根据每个切片文件的文件数据、文件ID、切片序号计算每个切片文件的切片ID的步骤,包括:The computer device according to claim 9, wherein the step of calculating the slice ID of each slice file according to the file data, file ID, and slice serial number of each slice file comprises:
    根据每个切片文件的文件数据,通过散列算法计算每个切片文件的切片初始值;及According to the file data of each slice file, calculate the slice initial value of each slice file through a hashing algorithm; and
    根据每个切片对应的切片初始值、文件ID以及切片序号,通过散列算法计算每个切片文件的切片ID。According to the initial value of each slice, the file ID, and the slice serial number, the slice ID of each slice file is calculated through a hash algorithm.
  12. 根据权利要求9所述的计算机设备,当计算机设备需要下载文件时,所述方法包括以下步骤:According to the computer device of claim 9, when the computer device needs to download a file, the method includes the following steps:
    向所述WEB服务器发送文件下载请求,所述文件下载请求中包含所述计算机设备请求下载文件的文件ID;Sending a file download request to the WEB server, where the file download request includes the file ID of the file requested by the computer device to download;
    接收所述WEB服务器基于所述文件下载请求从所述服务器集群对应的服务终端上获取的每个切片文件,其中,每个切片文件包括文件ID、每个切片文件的切片ID、每个切片文件的切片序号、每个切片文件的切片数据;Receive each slice file obtained by the WEB server from the service terminal corresponding to the server cluster based on the file download request, where each slice file includes a file ID, a slice ID of each slice file, and each slice file The slice number and slice data of each slice file;
    根据每个切片文件中的切片序号,将接收到的切片文件组成所述请求下载的文件。According to the slice serial number in each slice file, the received slice file is composed of the file requested to be downloaded.
  13. 一种非易失性计算机可读存储介质,所述非易失性计算机可读存储介质内存储有计算机可读指令,所述计算机可读指令可被至少一个处理器所执行,以使所述至少一个处 理器执行如下步骤:A non-volatile computer-readable storage medium in which computer-readable instructions are stored, and the computer-readable instructions can be executed by at least one processor to cause the At least one processor performs the following steps:
    向WEB服务器发送文件上传请求,所述文件上传请求用于请求向服务器集群上传新文件;Sending a file upload request to the WEB server, where the file upload request is used to request to upload a new file to the server cluster;
    接收所述服务器集群经由所述WEB服务器返回的的文件ID,所述文件ID为所述服务器集群为所述新文件生成的;Receiving a file ID returned by the server cluster via the WEB server, where the file ID is generated by the server cluster for the new file;
    对所述新文件进行切片,并为每个切片文件分配切片序号;Slice the new file, and assign a slice serial number to each slice file;
    根据每个切片文件的文件数据、文件ID、切片序号计算每个切片文件的切片ID,所述切片ID用于标识所述切片文件与待上传新文件的唯一对应关系;Calculate the slice ID of each slice file according to the file data, file ID, and slice serial number of each slice file, where the slice ID is used to identify the unique correspondence between the slice file and the new file to be uploaded;
    封装切片文件数据包,所述切片文件数据包中包含文件ID、每个切片文件的切片ID、每个切片文件的切片序号、每个切片文件的切片数据;及Encapsulating a slice file data package, the slice file data package including a file ID, a slice ID of each slice file, a slice serial number of each slice file, and slice data of each slice file; and
    将所述切片文件数据包上传给所述WEB服务器,以通过所述WEB服务器将所述切片文件数据包中的每个切片文件的切片数据发送到所述服务器集群中的对应服务终端上进行存储,其中,所述服务器集群用于保存所述文件ID、每个切片文件的切片ID及每个切片文件的切片序号的对应关系。Upload the slice file data package to the WEB server to send slice data of each slice file in the slice file data package to the corresponding service terminal in the server cluster for storage through the WEB server , Wherein the server cluster is used to store the corresponding relationship between the file ID, the slice ID of each slice file, and the slice serial number of each slice file.
  14. 根据权利要求13所述的非易失性计算机可读存储介质,根据每个切片文件的文件数据、文件ID、切片序号计算每个切片文件的切片ID的步骤,包括:According to the non-volatile computer-readable storage medium of claim 13, the step of calculating the slice ID of each slice file according to the file data, file ID, and slice serial number of each slice file comprises:
    将每个切片文件对应的文件数据、文件ID以及切片序号串接成字符串,及Concatenate the file data, file ID and slice serial number corresponding to each slice file into a string, and
    根据每个切片对应的字符串,通过散列算法计算每个切片文件的切片ID。According to the character string corresponding to each slice, the slice ID of each slice file is calculated through a hash algorithm.
  15. 根据权利要求13所述的非易失性计算机可读存储介质,根据每个切片文件的文件数据、文件ID、切片序号计算每个切片文件的切片ID的步骤,包括:According to the non-volatile computer-readable storage medium of claim 13, the step of calculating the slice ID of each slice file according to the file data, file ID, and slice serial number of each slice file comprises:
    根据每个切片文件的文件数据,通过散列算法计算每个切片文件的切片初始值;及According to the file data of each slice file, calculate the slice initial value of each slice file through a hashing algorithm; and
    根据每个切片对应的切片初始值、文件ID以及切片序号,通过散列算法计算每个切片文件的切片ID。According to the initial value of each slice, the file ID, and the slice serial number, the slice ID of each slice file is calculated through a hash algorithm.
  16. 根据权利要求13所述的非易失性计算机可读存储介质,当计算机设备需要下载文件时,所述至少一个处理器执行如下步骤:According to the non-volatile computer readable storage medium of claim 13, when the computer device needs to download a file, the at least one processor executes the following steps:
    向所述WEB服务器发送文件下载请求,所述文件下载请求中包含所述计算机设备请求下载文件的文件ID;Sending a file download request to the WEB server, where the file download request includes the file ID of the file requested by the computer device to download;
    接收所述WEB服务器基于所述文件下载请求从所述服务器集群对应的服务终端上获取的每个切片文件,其中,每个切片文件包括文件ID、每个切片文件的切片ID、每个切片文件的切片序号、每个切片文件的切片数据;Receive each slice file obtained by the WEB server from the service terminal corresponding to the server cluster based on the file download request, where each slice file includes a file ID, a slice ID of each slice file, and each slice file The slice number and slice data of each slice file;
    根据每个切片文件中的切片序号,将接收到的切片文件组成所述请求下载的文件。According to the slice serial number in each slice file, the received slice file is composed of the file requested to be downloaded.
  17. 一种基于云存储的文件处理系统,所述系统包括:A file processing system based on cloud storage, the system comprising:
    WEB服务器,用于接收计算机设备发送的文件上传请求,所述文件上传请求用于请求向服务器集群上传新文件,并向所述计算机设备返回所述服务器集群为所述新文件生成的文件ID;The WEB server is configured to receive a file upload request sent by a computer device, where the file upload request is used to request to upload a new file to the server cluster, and return to the computer device the file ID generated by the server cluster for the new file;
    所述计算机设备,用于对所述新文件进行切片,并为每个切片文件分配切片序号;用于根据每个切片文件的文件数据、文件ID、切片序号计算每个切片文件的切片ID,所述切片ID用于标识所述切片文件与待上传新文件的唯一对应关系;以及用于将切片文件数据包上传给所述WEB服务器,所述切片文件数据包中包含文件ID、每个切片文件的切片ID、每个切片文件的切片序号、每个切片文件的切片数据;The computer device is used for slicing the new file and assigning a slice number to each slice file; for calculating the slice ID of each slice file according to the file data, file ID, and slice number of each slice file, The slice ID is used to identify the unique corresponding relationship between the slice file and the new file to be uploaded; and used to upload the slice file data package to the WEB server, and the slice file data package contains the file ID and each slice The slice ID of the file, the slice serial number of each slice file, and the slice data of each slice file;
    WEB服务器,还用于将所述切片文件数据包中的每个切片文件的切片数据发送到所述服务器集群;The WEB server is also used to send slice data of each slice file in the slice file data package to the server cluster;
    所述服务器集群,用于将每个切片文件的切片数据存储到对应的服务终端上,其中,所述服务器集群保存所述文件ID、每个切片文件的切片ID及每个切片文件的切片序号的对应关系。The server cluster is configured to store the slice data of each slice file on the corresponding service terminal, wherein the server cluster saves the file ID, the slice ID of each slice file, and the slice serial number of each slice file The corresponding relationship.
  18. 根据权利要求17所述的基于云存储的文件处理系统,所述计算机设备还用于:According to the file processing system based on cloud storage according to claim 17, the computer device is further used for:
    将每个切片文件对应的文件数据、文件ID以及切片序号串接成字符串;及根据每个切片对应的字符串,通过散列算法计算每个切片文件的切片ID。The file data, the file ID, and the slice serial number corresponding to each slice file are concatenated into a string; and the slice ID of each slice file is calculated by a hash algorithm according to the string corresponding to each slice.
  19. 根据权利要求17所述的基于云存储的文件处理系统,所述计算机设备还用于:According to the file processing system based on cloud storage according to claim 17, the computer device is further used for:
    根据每个切片文件的文件数据,通过散列算法计算每个切片文件的切片初始值;及根据每个切片对应的切片初始值、文件ID以及切片序号,通过散列算法计算每个切片文件的切片ID。According to the file data of each slice file, the initial value of each slice file is calculated by a hash algorithm; and according to the initial value of each slice, the file ID and the slice serial number, the hash algorithm is used to calculate the initial value of each slice file. Slice ID.
  20. 根据权利要求17所述的基于云存储的文件处理系统:The file processing system based on cloud storage according to claim 17:
    所述计算机设备,还用于向所述WEB服务器发送文件下载请求,所述文件下载请求中包含计算机设备请求下载文件的文件ID;The computer device is further configured to send a file download request to the WEB server, and the file download request includes the file ID of the file that the computer device requests to download;
    所述WEB服务器,还用于将所述文件下载请求发送给所述服务器集群;The WEB server is also used to send the file download request to the server cluster;
    所述服务器集群,还用于向所述WEB服务器发送存储与所述文件ID对应的文件的每个切片文件的服务终端的地址;The server cluster is further configured to send the address of the service terminal storing each slice file of the file corresponding to the file ID to the WEB server;
    所述WEB服务器,还用于根据所述服务终端的地址从对应的服务终端上获取每个切片文件,其中,每个切片文件包括文件ID、每个切片文件的切片ID、每个切片文件的切片序号、每个切片文件的切片数据;The WEB server is further configured to obtain each slice file from the corresponding service terminal according to the address of the service terminal, where each slice file includes a file ID, a slice ID of each slice file, and a slice file of each slice file. Slice serial number, slice data of each slice file;
    所述WEB服务器,还用于将每个切片文件分别传送给计算机设备;The WEB server is also used to transmit each slice file to the computer device;
    所述计算机设备,还用于根据每个切片文件中的切片序号,将接收到的切片文件组成所述请求下载的文件。The computer device is further configured to compose the received slice file into the file requested to be downloaded according to the slice serial number in each slice file.
PCT/CN2019/117772 2019-01-16 2019-11-13 Cloud storage based file processing method, system and computer device WO2020147403A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201910040715.2A CN109951514B (en) 2019-01-16 2019-01-16 File processing method and system based on cloud storage and computer equipment
CN201910040715.2 2019-01-16

Publications (1)

Publication Number Publication Date
WO2020147403A1 true WO2020147403A1 (en) 2020-07-23

Family

ID=67007281

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/117772 WO2020147403A1 (en) 2019-01-16 2019-11-13 Cloud storage based file processing method, system and computer device

Country Status (2)

Country Link
CN (1) CN109951514B (en)
WO (1) WO2020147403A1 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112637341A (en) * 2020-12-22 2021-04-09 平安银行股份有限公司 File uploading method and device, electronic equipment and storage medium
CN115412543A (en) * 2022-04-24 2022-11-29 联通沃悦读科技文化有限公司 MapReduce-based oversized file batch uploading method

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109951514B (en) * 2019-01-16 2022-03-25 平安科技(深圳)有限公司 File processing method and system based on cloud storage and computer equipment
CN111629075B (en) * 2020-08-03 2020-12-18 腾讯科技(深圳)有限公司 Data downloading method and related device
CN112383614A (en) * 2020-11-11 2021-02-19 常州微亿智造科技有限公司 File transmission method and device
CN113507516A (en) * 2021-07-06 2021-10-15 深圳海付移通科技有限公司 File service method, access server, computer device and storage medium
CN115643453B (en) * 2022-12-23 2023-03-21 北京安锐卓越信息技术股份有限公司 Video uploading method, system, user terminal, server and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102833294A (en) * 2011-06-17 2012-12-19 阿里巴巴集团控股有限公司 File processing method and system based on cloud storage, and server cluster system
CN103197987A (en) * 2012-01-04 2013-07-10 中兴通讯股份有限公司 Data backup method, data recovery method and cloud storage system
US20140337661A1 (en) * 2010-06-22 2014-11-13 Cleversafe, Inc. Cooperative storage system utilizing dispersed storage
CN108111585A (en) * 2017-12-15 2018-06-01 成都链网络科技有限公司 Distributed storage method based on block chain
CN109951514A (en) * 2019-01-16 2019-06-28 平安科技(深圳)有限公司 Document handling method, system and computer equipment based on cloud storage

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070038681A1 (en) * 2005-08-10 2007-02-15 Spare Backup, Inc. System and method of remote storage of data through connection from a server to a client
CN101141627A (en) * 2007-10-23 2008-03-12 深圳市迅雷网络技术有限公司 Storage system and method of stream media file
US20180322901A1 (en) * 2017-05-03 2018-11-08 Hey Platforms DMCC Copyright checking for uploaded media
CN107528926A (en) * 2017-10-11 2017-12-29 郑州云海信息技术有限公司 A kind of file uploading method and system

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140337661A1 (en) * 2010-06-22 2014-11-13 Cleversafe, Inc. Cooperative storage system utilizing dispersed storage
CN102833294A (en) * 2011-06-17 2012-12-19 阿里巴巴集团控股有限公司 File processing method and system based on cloud storage, and server cluster system
CN103197987A (en) * 2012-01-04 2013-07-10 中兴通讯股份有限公司 Data backup method, data recovery method and cloud storage system
CN108111585A (en) * 2017-12-15 2018-06-01 成都链网络科技有限公司 Distributed storage method based on block chain
CN109951514A (en) * 2019-01-16 2019-06-28 平安科技(深圳)有限公司 Document handling method, system and computer equipment based on cloud storage

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112637341A (en) * 2020-12-22 2021-04-09 平安银行股份有限公司 File uploading method and device, electronic equipment and storage medium
CN112637341B (en) * 2020-12-22 2022-12-13 平安银行股份有限公司 File uploading method and device, electronic equipment and storage medium
CN115412543A (en) * 2022-04-24 2022-11-29 联通沃悦读科技文化有限公司 MapReduce-based oversized file batch uploading method

Also Published As

Publication number Publication date
CN109951514B (en) 2022-03-25
CN109951514A (en) 2019-06-28

Similar Documents

Publication Publication Date Title
WO2020147403A1 (en) Cloud storage based file processing method, system and computer device
WO2021036228A1 (en) File upload method and apparatus, terminal, server, system, and storage medium
WO2018059222A1 (en) File slice uploading method and apparatus, and cloud storage system
US20210160319A1 (en) Data Sending Method and Apparatus, and Data Receiving Method and Apparatus
CN110572422B (en) Data downloading method, device, equipment and medium
CN111490963B (en) Data processing method, system, equipment and storage medium based on QUIC protocol stack
US8881177B2 (en) Communications driver management
WO2020001488A1 (en) File download method and apparatus, client and computer readable storage medium
CN112422497B (en) Message transmission method and device and computer equipment
CN111666745A (en) File downloading method, device, server and medium
CN111490947A (en) Data packet transmitting method, data packet receiving method, system, device and medium
CN106339267A (en) Object query method and server side
CN112422450B (en) Computer equipment, and flow control method and device for service request
CN111885184A (en) Method and device for processing hot spot access keywords in high concurrency scene
CN114281263A (en) Storage resource processing method, system and equipment of container cluster management system
WO2021098393A1 (en) Method and apparatus for intelligent system resource monitoring, electronic device, and storage medium
CN112087475B (en) Message pushing method and device for cloud platform component application and message server
CN108595574B (en) Database cluster connection method, device, equipment and storage medium
CN112969198A (en) Data transmission method, terminal and storage medium
CN111800223B (en) Method, device and system for generating sending message and processing receiving message
CN113220481A (en) Request processing and feedback method and device, computer equipment and readable storage medium
CN115361455B (en) Data transmission storage method and device and computer equipment
CN111245949A (en) File filing and transmission method, device and equipment
CN113037848B (en) File uploading method and system
CN112688905B (en) Data transmission method, device, client, server and storage medium

Legal Events

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

Ref document number: 19909870

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 19909870

Country of ref document: EP

Kind code of ref document: A1