File transfer System Design documentation

Source: Internet
Author: User
Tags format definition file transfer protocol

file transfer System ScenariosOne: Interface framework

A single document multi-view architecture, the current client interface framework such as RMS. The following views are available:

    1. In upload

The view provides elements: Start, pause, delete

    1. In the download
    2. The view provides elements: Start, pause, delete
    3. has been uploaded

The view provides elements: empty

    1. has been downloaded

The view provides elements: empty

Two: File Transfer Protocol

In order to increase the transmission reliability, support for the continuation of the breakpoint, and other functions, the client and the server in a package-by-packet confirmation, the client records the current upload or download files in the read and write location, easy to send or request again.

The data format definition for interaction between client and server:

message hpsvrpathbean{

Optional     bytes ORGID = 1;

Optional     bytes Smclass = 2;

Optional     bytes Bgclass = 3;

Optional     bytes Bizid = 4;

}

message hpsvrlistbean{

Optional Int32    FILESIZE = 1; File size

Optional bytes    Crdid = 2; Business Flow

Optional bytes    FILENAME = 3; File name

Optional bytes    CREATEUSER = 4; File on the descendant

Optional bytes    CreateDate = 5; File Upload Time

}

message hpfilebean{

Optional           bytes        FILEID = 1; The file ID, which uniquely identifies a file, is generated by the client.

Optional            Hpsvrpathbean Svrpath = 2; Destination Folder Directory

Optional           bytes        LOCALPATH = 3; Local Files Directory

Optional          UInt64        FILESIZE = 4; File size

Optional          UInt64       Rdptr = 5 [default = 0]; Read start pointer position of the file

Optional          UInt64       Wtptr = 6 [default = 0]; File Write start pointer position

Optional          UInt64        Donesize = 7; Completed size

Optional          UInt32        doingsize = 8[Default = 1024]; Size of this operation

Optional           bytes        BEGINTIME = 9; Start time

Optional           bytes       ENDTIME = 10; End time

Optional          UInt32       state = 11[Default = 0]; Current status 0 operation, 1 complete,-1 pause

Optional           bytes       USERID = 12; Manipulating user accounts

Optional           bytes       ClientIP = 13; Client IP

repeated          Int32       FILEDATA = 14; File contents

Optional          UInt32       Needrefresh = 15[Default = 0]; Whether you need to refresh the uploaded list after uploading completed 1 need, 0 do not need

Optional          UInt32       Needtip = 16[Default = 1]; Set whether you need to play bubble tip 1 required, 0 not required

}

Business system attachment Download message definition

message hpdownfilemsg {

Request Body Definition

message Request {

repeated Hpfilebean downfile = 1;

}

Response Body Definition

message Response {

Optional     bytes        FILEID = 1; The file ID, which uniquely identifies a file, is generated by the client.

Optional    UInt64 FILESIZE = 2;

Optional    UInt32        Procstate = 3[Default = 0]; Processing status 0 Download, 1 completed

Optional    UInt64        Wtptr = 4; Where the client begins to write pointers

Optional    bytes        FILEDATA = 5; File contents

}

Optional Request Request = 1;

Optional Response Response = 2;

}

Business system attachment upload message definition

message hpupfilemsg {

Request Body Definition

message Request {

repeated        Hpfilebean upfile = 1; File information

}

Response Body Definition

message Response {

Optional     bytes        FILEID = 1; The file ID, which uniquely identifies a file, is generated by the client.

Optional    UInt64        Rdptr = 2; The read-pointer offset of the client-side upload file returned by the server

Optional    UInt32        Procstate = 3; Processing status 1 successful, 0 in upload

Optional    UInt32        Needrefresh = 4; Whether the client needs to refresh the server file list after it is received

}

Optional Request Request = 1;

Optional Response Response = 2;

}

Business System Attachment List view message definitions

message hpfilelistmsg {

Request Body Definition

message Request {

Optional Hpsvrpathbean Svrpath = 1; Server path Information

Optional    UInt32  Funcid = 2; Feature ID

Optional    UInt32  isapply = 3; Whether it is admissible

Optional    UInt32  Isother = 4; is the other link

}

Response Body Definition

message Response {

repeated    Hpsvrlistbean FILELIST = 1; File size

}

Optional Request Request = 1;

Optional Response Response = 2;

}

Business System Attachment List view message definitions

message hpfiledelmsg {

Request Body Definition

message Request {

Optional     Hpsvrpathbean Svrpath = 1; Destination Folder Directory

repeated     bytes FILENAMES = 2;

Optional    UInt32     Funcid = 3; Business Flow

Optional    UInt32     Iscorp = 4; //

}

Response Body Definition

message Response {

Optional Int32    RESULT = 1; 1: Success, 0: Failure

}

Optional Request Request = 1;

Optional Response Response = 2;

}

Attachment synchronization

message syncattachmsg{

message request{

Optional      bytes ORGID = 1; Manage Company ID

Optional      bytes Bigid = 2; Attachment Large Class ID

Optional      bytes Smlid = 3; Attachment Small Class ID

Optional      bytes CUSTID = 4; Customer ID

Optional      bytes Crdid = 5; Processing serial Number

}

message response{

Optional     UInt32 CODE = 1; Response Message Bean

}

Optional Request Request = 1;

Optional Response Response = 2;

}

Three: Local file data format definition

Uploaded, the downloaded file list needs to be saved as a local file, in XML format, as defined below:

<?xml version= "1.0" encoding= "UTF-8"?>

<FileList>

<File>

<FileID>20151225151255782</FileID>

<localpath>d:\project\?? \1.jpg</localpath>

<SvrPath>30/35010001/3501/715/</SvrPath>

<WtPtr>31220</WtPtr>

<RdPtr>31220</RdPtr>

<FileSize>31220</FileSize>

<DoneSize>0</DoneSize>

<DoingSize>1024</DoingSize>

<begintime>2015-12-25 15:12:55</begintime>

<endtime>2015-12-25 15:12:55</endtime>

<State>1</State>

</File>

</FileList>

</HPFILE>

Four: System design Diagram 4.1 system logical architecture Diagram

4.2 Transport Client Class diagram

4.3 Uploading a business flowchart

4.4 Download Business Flowchart

File transfer System Design documentation

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.