[go: up one dir, main page]

CN101409727B - Document transmission method and apparatus - Google Patents

Document transmission method and apparatus Download PDF

Info

Publication number
CN101409727B
CN101409727B CN 200810178410 CN200810178410A CN101409727B CN 101409727 B CN101409727 B CN 101409727B CN 200810178410 CN200810178410 CN 200810178410 CN 200810178410 A CN200810178410 A CN 200810178410A CN 101409727 B CN101409727 B CN 101409727B
Authority
CN
China
Prior art keywords
file
peer device
operation request
information
data
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related
Application number
CN 200810178410
Other languages
Chinese (zh)
Other versions
CN101409727A (en
Inventor
刘群欣
蒋晓艳
华斌
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Zhuzhou CRRC Times Electric Co Ltd
Original Assignee
Zhuzhou CSR Times Electric Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Zhuzhou CSR Times Electric Co Ltd filed Critical Zhuzhou CSR Times Electric Co Ltd
Priority to CN 200810178410 priority Critical patent/CN101409727B/en
Publication of CN101409727A publication Critical patent/CN101409727A/en
Application granted granted Critical
Publication of CN101409727B publication Critical patent/CN101409727B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

本发明公开了一种文件传输方法,用于列车通信网络,包括:按照预定格式发送操作请求信息给对端设备,所述操作请求信息包括操作代码、传输模式和路径信息;在接收到所述对端设备返回的确认信息后,根据操作请求信息进行数据报文操作。本发明还提供一种用于列车通信网络的文件传输装置。根据本发明,可实现文件上传,文件下载,查询文件或目录,删除文件,查看磁盘使用空间五种功能,在列车通信网络上,通过一个智能设备就能够将系统文件,配置文件,应用文件传输到其他各个智能设备上,有利于列车设备上的文件系统的维护。

Figure 200810178410

The invention discloses a file transmission method for a train communication network, comprising: sending operation request information to an opposite device according to a predetermined format, the operation request information including operation code, transmission mode and path information; After the confirmation information returned by the peer device, the data packet operation is performed according to the operation request information. The invention also provides a file transmission device used in the train communication network. According to the present invention, the five functions of file upload, file download, file or directory query, file deletion, and disk space usage check can be realized. On the train communication network, system files, configuration files, and application files can be transmitted through a smart device. To other smart devices, it is beneficial to the maintenance of the file system on the train device.

Figure 200810178410

Description

一种文件传输方法及装置A file transfer method and device

技术领域 technical field

本发明涉及网络及通信技术领域,具体涉及一种文件传输方法及装置。The present invention relates to the field of network and communication technologies, in particular to a file transmission method and device.

背景技术 Background technique

列车通信网络(TCN,Train Communication Network)是用于列车上各运行管理设备之间数据文件交换,通常采用分布式模块化结构。由于是专用网络,其传输速度、传输能力、实时性都需符合列车运行要求,实现了从集中控制到分布式网络控制的技术跨越。基于TCN的文件传输,可以借鉴的方法有广泛使用的基于TCP/IP的TFTP和FTP(File TransferProtocol)。Train Communication Network (TCN, Train Communication Network) is used for data file exchange between various operation management devices on the train, and usually adopts a distributed modular structure. Because it is a dedicated network, its transmission speed, transmission capacity, and real-time performance must meet the requirements of train operation, realizing a technological leap from centralized control to distributed network control. For TCN-based file transfer, methods that can be used for reference include the widely used TCP/IP-based TFTP and FTP (File Transfer Protocol).

现有技术中的简单文件传输协议(TFTP,Trivial File Transfer Protocol)是基于用户数据报协议(UDP,User Datagram Protocol)之上的应用。在开始工作时,TFTP的客户与服务器交换信息,客户发送一个读请求或写请求给服务器。对于读请求,如果这个文件能被这个客户读取,TFTP服务器就返回一个块编号为1的数据分组。TFTP客户又发送一个包含块编号为1的确认(ACK,Acknowledge)。随后TFTP服务器继续发送块编号为2的数据分组,TFTP返回块编号为2的ACK。重复这个过程直到这个文件传送完。在写请求的情况下,如果这个文件能被该客户写,TFTP服务器则返回块编号为0的ACK。该客户就将文件的头512字节以块编号为1发出。服务器则返回块编号为1的ACK。TFTP的优点在于实现的简单。The Trivial File Transfer Protocol (TFTP, Trivial File Transfer Protocol) in the prior art is an application based on the User Datagram Protocol (UDP, User Datagram Protocol). At the beginning of the work, the client of TFTP exchanges information with the server, and the client sends a read request or write request to the server. For a read request, if the file can be read by the client, the TFTP server returns a data packet with a block number of 1. The TFTP client sends an acknowledgment (ACK, Acknowledge) containing block number 1. Then the TFTP server continues to send the data packet whose block number is 2, and TFTP returns an ACK whose block number is 2. Repeat this process until the file is transferred. In the case of a write request, the TFTP server returns an ACK with block number 0 if the file can be written by the client. The client sends the first 512 bytes of the file with block number 1. The server returns an ACK with block number 1. The advantage of TFTP lies in its simplicity of implementation.

针对于TCN的列车网络管理,目前还未提出文件传输的具体实现方法,但文件传输又是非常必要的,各种系统文件,配置文件需要在列车上的设备之间进行传输。如果将TFTP或者FTP协议完全照搬过来,对于列车网络是不可行的。这是由于列车通信网络采用的是多功能车辆总线(MVB,Multifunction Vehicle Bus)和绞线式列车总线(WTB,Wire TrainBus)总线,并且采用实时协议(RTP,Real Time Protocol),而TFTP协议、FTP协议分别是建立在TCP/IP协议族上的UDP和TCP的应用,因此,TFTP协议、FTP协议不适用于列车网。For the train network management of TCN, no specific implementation method of file transfer has been proposed yet, but file transfer is very necessary. Various system files and configuration files need to be transferred between devices on the train. If the TFTP or FTP protocol is copied completely, it is not feasible for the train network. This is because the train communication network uses a multifunctional vehicle bus (MVB, Multifunction Vehicle Bus) and a twisted train bus (WTB, Wire TrainBus) bus, and uses a real-time protocol (RTP, Real Time Protocol), while the TFTP protocol, The FTP protocol is the application of UDP and TCP based on the TCP/IP protocol family respectively. Therefore, the TFTP protocol and the FTP protocol are not suitable for the train network.

另外,TFTP虽然实现简单,但功能过于简单,只能进行文件的上传和下载,不能满足列车网络管理的需求。例如在列车网络上,需要查看远程设备上的文件列表,以便选择要下载的文件。而FTP有丰富的功能,但实现过于复杂。In addition, although TFTP is simple to implement, its functions are too simple, and it can only upload and download files, which cannot meet the needs of train network management. For example on a train network, it is necessary to view a list of files on a remote device in order to select a file to download. And FTP has rich functions, but the implementation is too complicated.

发明内容 Contents of the invention

有鉴于此,本发明提供一种文件传输方法及装置,可实现在列车通信网络中两个设备之间的文件传输,满足列车网络管理要求。In view of this, the present invention provides a file transmission method and device, which can realize file transmission between two devices in a train communication network and meet the requirements of train network management.

本发明实施例提供的一种文件传输方法,用于列车通信网络,包括:A file transfer method provided by an embodiment of the present invention is used in a train communication network, including:

按照预定格式发送操作请求信息给对端设备,所述操作请求信息包括操作代码、传输模式和路径信息;Sending operation request information to the peer device according to a predetermined format, the operation request information including operation code, transmission mode and path information;

在接收到所述对端设备返回的确认信息后,根据操作请求信息进行数据报文操作。After receiving the confirmation information returned by the peer device, the data packet operation is performed according to the operation request information.

本发明实施例还提供一种文件传输装置,用于列车通信网络,包括:The embodiment of the present invention also provides a file transmission device for a train communication network, including:

操作请求发送单元,按照预定格式发送操作请求信息给对端设备,所述操作请求信息包括操作代码、传输模式和路径信息;The operation request sending unit sends operation request information to the peer device according to a predetermined format, and the operation request information includes operation code, transmission mode and path information;

响应消息接收单元,接收到所述对端设备返回的响应消息;The response message receiving unit receives the response message returned by the peer device;

数据操作单元,在接收到所述对端设备返回的确认信息后,根据操作请求信息进行数据报文操作。The data operation unit, after receiving the confirmation information returned by the peer device, performs data message operations according to the operation request information.

综上所述,本发明实施例提供的技术方案中,提供的一种基于列车通信网络的文件传输方法及装置,可提供车辆内或车辆间的设备之间的文件传输,本发明是基于RTP协议上的应用,在用于列车通信网络的RTP(Real Time Protocol,实时协议)基础上,一个智能设备向另一设备发送功能请求,设备响应请求后,开始文件传输。通过定义和实现文件上传,文件下载,查询文件或目录,删除文件,查看磁盘使用空间五种功能,实现了在列车通信网络中两个设备之间的文件传输。To sum up, among the technical solutions provided by the embodiments of the present invention, a file transfer method and device based on a train communication network is provided, which can provide file transfer between devices in a vehicle or between vehicles. The present invention is based on RTP The application on the protocol is based on the RTP (Real Time Protocol) used in the train communication network. One smart device sends a function request to another device. After the device responds to the request, the file transfer starts. By defining and implementing five functions of file upload, file download, query file or directory, delete file, and check disk usage space, the file transfer between two devices in the train communication network is realized.

本发明的方法充分利用了简单文件传输协议(TFTP,Trivial FileTransfer Protocol)的思想来实现文件上传/下载的功能,又提供了丰富的文件传输命令,简单易行,读写效率高。实现了在列车通信网络上,通过一个智能设备就能够将系统文件,配置文件,应用文件传输到其他各个智能设备上,有利于列车设备上的文件系统的维护。The method of the present invention makes full use of the idea of Trivial File Transfer Protocol (TFTP) to realize the function of file upload/download, and provides abundant file transfer commands, which is simple and easy to operate, and has high reading and writing efficiency. Realized that on the train communication network, system files, configuration files, and application files can be transmitted to other smart devices through one smart device, which is beneficial to the maintenance of the file system on the train device.

附图说明 Description of drawings

图1为本发明实施例中提供的上传数据文件的流程图;Fig. 1 is the flow chart of uploading data file provided in the embodiment of the present invention;

图2为本发明实施例中提供的下载数据文件的流程图;Fig. 2 is the flow chart of downloading data file provided in the embodiment of the present invention;

图3为本发明实施例代理者上载文件处理的有限状态机示意图;FIG. 3 is a schematic diagram of a finite state machine for processing an agent uploading a file according to an embodiment of the present invention;

图4为本发明实施例经营者上载文件处理的有限状态机示意图;FIG. 4 is a schematic diagram of a finite state machine for file upload processing by an operator according to an embodiment of the present invention;

图5为本发明实施例提供的一种文件传输装置架构示意图。FIG. 5 is a schematic structural diagram of a file transmission device provided by an embodiment of the present invention.

具体实施方式 Detailed ways

鉴于列车通信网络的特点及环境,本发明针对列车通信网络提出了一种基于列车通信网络的文件传输方法,该方法既充分利用了TFTP的思想,又提供了丰富的文件传输功能。In view of the characteristics and environment of the train communication network, the present invention proposes a file transfer method based on the train communication network for the train communication network, which not only makes full use of the idea of TFTP, but also provides rich file transfer functions.

本文件传输方法提供的数据传输操作包括数据上传,数据下载,列表显示文件或目录,文件删除,查看磁盘可用空间大小。其实现如下:The data transfer operations provided by this file transfer method include data upload, data download, list display of files or directories, file deletion, and viewing of available disk space. It is implemented as follows:

为了集成到列车网络管理TNM中,在此对文件传输服务功能号定义如下:In order to be integrated into the train network management TNM, the function number of the file transfer service is defined as follows:

文件上传功能号为100;The file upload function number is 100;

文件下载功能号为101;The file download function number is 101;

列表显示文件或目录功能号为102;The list shows that the function number of the file or directory is 102;

删除文件功能号为103;Delete file function number is 103;

查看磁盘可用空间大小功能号为105。The function number for viewing the available disk space is 105.

首先,对报文格式进行定义,本发明实施例中文件传输协议使用5类报文:First, the message format is defined. In the embodiment of the present invention, the file transfer protocol uses 5 types of messages:

Read request(RRQ):读请求,用于下载数据文件。Read request (RRQ): Read request for downloading data files.

Write request(WRQ):写请求,用于上传数据文件。Write request (WRQ): write request for uploading data files.

Data(DATA):数据报文,用于传送文件内容。Data (DATA): data message, used to transmit file content.

Acknowledgment(ACK):确认报文,用于指示传输状态。Acknowledgment (ACK): Acknowledgment message, used to indicate the transmission status.

Error(ERROR):出错返回报文,用于指示传输错误。Error(ERROR): Error return message, used to indicate transmission error.

报文的格式与说明如下:The format and description of the message are as follows:

(1)RRQ/WRQ报文格式(1) RRQ/WRQ message format

Figure G200810178410XD0004160925QIETU
Figure G200810178410XD0004160925QIETU

RRQ和WRQ报文(操作代码opcode分别为1和2)的格式如上所示。文件名是ASCII码字符,以0结束。Mode表示文件的传输模式,有字符模式(0)或者二进制模式(3)。The formats of RRQ and WRQ messages (opcodes are 1 and 2 respectively) are as above. Filenames are ASCII characters, ending with 0. Mode indicates the transfer mode of the file, there are character mode (0) or binary mode (3).

DATA报文格式DATA message format

Figure G200810178410XD0004160943QIETU
Figure G200810178410XD0004160943QIETU

数据在数据报文中传输,其格式如上图所示。数据包的操作代码opcode为3,它还包括有一个数据块号和数据。数据块号从1开始编码,每个数据块加1,这样接收方可以确定这个包是新数据还是已经接收过的数据。数据域从0字节到512字节。如果数据域是512字节则它不是最后一个包,如果小于512字节则表示这个报文是最后一个报文。Data is transmitted in datagrams, the format of which is shown in the figure above. The opcode of the data packet is 3, and it also includes a data block number and data. The data block number starts from 1 and increases by 1 for each data block, so that the receiver can determine whether the packet is new data or already received data. The data field is from 0 bytes to 512 bytes. If the data field is 512 bytes, it is not the last packet, and if it is less than 512 bytes, it means that this packet is the last packet.

ACK报文格式ACK message format

Figure G200810178410XD0004161003QIETU
Figure G200810178410XD0004161003QIETU

ACK报文的操作代码opcode为4。其中的包号为要确认的数据包的包号。The opcode of the ACK packet is 4. The packet number is the packet number of the data packet to be confirmed.

ERROR报文格式ERROR message format

Figure G200810178410XD0004161015QIETU
Figure G200810178410XD0004161015QIETU

ERROR报文的操作代码opcode是5,它的格式如上所示,此包可以被其它任何类型的包确认。错误码指定错误的类型。错误码的取值为:The operation code opcode of the ERROR message is 5, and its format is shown above, and this packet can be confirmed by any other type of packet. The error code specifies the type of error. The value of the error code is:

0 未定义0 undefined

1 文件打开错误1 file open error

2 定时器设置错误2 Timer setting error

3 文件没有打开3 file not opened

4 不期望的报文4 Unexpected message

5 发送的块编号错误5 Wrong block number sent

磁盘满或超过分配的配额文件disk full or exceeds allocated quota file

已经存在already exists

没有类似的用户no similar users

8 非法的文件传输操作8 Illegal file transfer operations

本发明实施例提供的一种数据传输方法,用于列车通信网络,包括:A data transmission method provided by an embodiment of the present invention is used in a train communication network, including:

按照预定格式发送操作请求信息给对端设备,所述操作请求信息包括操作代码、传输模式和路径信息;Sending operation request information to the peer device according to a predetermined format, the operation request information including operation code, transmission mode and path information;

在接收到所述对端设备返回的确认信息后,根据操作请求信息进行数据报文操作。例如进行数据报文上传或下载。After receiving the confirmation information returned by the peer device, the data packet operation is performed according to the operation request information. For example, data packets are uploaded or downloaded.

实施例一Embodiment one

本实施例中,基于上传文件过程,说明报文的传输过程,参照图1,具体如下:In this embodiment, based on the process of uploading files, the transmission process of the message is described, with reference to Figure 1, as follows:

步骤S101,经营者向代理者发送一个写请求WRQ报文。In step S101, the operator sends a write request WRQ message to the agent.

经营者起到类似于文件传输客户端的功能,代理者起到类似于文件传输服务器的功能。The operator plays the function similar to the file transfer client, and the agent plays the function similar to the file transfer server.

步骤S102,代理者判断文件名与路径是否正确,系统能否接收。若正确,回答ACK报文。若错误,回答ERROR报文。Step S102, the agent judges whether the file name and path are correct, and whether the system can accept it. If correct, answer the ACK message. If it is wrong, reply with an ERROR message.

步骤S103,经营者接收到ACK报文后,开始向代理者发送DATA报文。Step S103, after receiving the ACK message, the operator starts to send the DATA message to the agent.

步骤S104,代理者接收DATA报文,写入数据文件,并回答ACK报文,如果出错,回答ERROR报文。Step S104, the agent receives the DATA message, writes it into the data file, and replies with an ACK message, and if an error occurs, replies with an ERROR message.

经营者重复步骤S103,代理者重复步骤S104。一直到数据发送完毕。如果在前面的过程中经营者收到ERROR报文,传输过程结束。The operator repeats step S103, and the agent repeats step S104. until the data is sent. If the operator receives an ERROR message during the previous process, the transmission process ends.

经营者和代理者端的状态机State machine on operator and agent side

代理者的上传文件处理模块的工作状态可以分为三个:Idle,Start,Run状态。Idle状态表示上传文件处理还没有开始。Start状态表示进入到文件上传的状态,但是还没有开始数据的传输。Run状态表示在进行上传文件,代理者正在接收数据。The working status of the agent's upload file processing module can be divided into three: Idle, Start, Run status. The Idle state indicates that upload file processing has not started yet. The Start state means entering the state of file upload, but the data transmission has not yet started. The Run state indicates that the file is being uploaded and the agent is receiving data.

经营者的上传文件处理模块的工作状态可以分为三个:Idle,Start,Run状态。Idle状态表示上传文件处理还没有开始。Start状态表示进入到文件上传的状态,但是还没有开始数据的传输。Run状态表示在进行上传文件,代理者正在接收数据。The working state of the operator's uploaded file processing module can be divided into three: Idle, Start, and Run states. The Idle state indicates that upload file processing has not started yet. The Start state means entering the state of file upload, but the data transmission has not yet started. The Run state indicates that the file is being uploaded and the agent is receiving data.

本实施例中。超时值的设置为:2秒。In this example. The timeout value is set to: 2 seconds.

实施例二Embodiment two

本实施例中,文件传输协议使用如前所述的5类报文:读请求Readrequest(RRQ),写请求Write request(WRQ),数据报文Data(DATA),确认报文Acknowledgment(ACK)以及出错返回报文Error(ERROR)。In this embodiment, the file transfer protocol uses 5 types of messages as mentioned above: read request Readrequest (RRQ), write request Write request (WRQ), data message Data (DATA), confirmation message Acknowledgment (ACK) and Error returns message Error(ERROR).

下面基于下载文件流程,说明报文的传输过程,具体如下:The following is based on the process of downloading files to illustrate the transmission process of the message, as follows:

步骤S201.经营者向代理者发送一个读请求RRQ报文;Step S201. The operator sends a read request RRQ message to the agent;

步骤S202.代理者判断文件名与路径是否正确,文件是否能打开。若正确,开始传输DATA报文。若错误,回答ERROR报文;Step S202. The agent judges whether the file name and path are correct, and whether the file can be opened. If correct, start transmitting the DATA message. If wrong, answer ERROR message;

步骤S203.经营者接收到DATA报文后,判断如果不是最后一个报文,向代理者发送ACK报文请求下一块数据;Step S203. After receiving the DATA message, the operator determines if it is not the last message, and sends an ACK message to the agent to request the next piece of data;

步骤S204.代理者接收ACK报文,如果文件还没传输完,继续回答DATA报文,如果出错,回答ERROR报文;Step S204. The agent receives the ACK message, if the file has not been transmitted, continue to answer the DATA message, if an error occurs, answer the ERROR message;

经营者重复步骤S203,代理者重复步骤S204;一直到数据发送完毕。如果在前面的过程中经营者收到ERROR报文,传输过程结束。The operator repeats step S203, and the agent repeats step S204; until the data is sent. If the operator receives an ERROR message during the previous process, the transmission process ends.

参照图3和图4,所示分别为经营者和代理者端的状态机。Referring to Fig. 3 and Fig. 4, the state machines of the operators and agents are shown respectively.

在文件下载处理中,代理者起到类似于文件传输服务器端的功能。In the file download process, the agent performs a function similar to that of the file transfer server.

代理者的上传文件处理模块的工作状态可以分为2个:Idle,Run状态。Idle状态表示下载文件处理还没有开始。Run状态表示在进行下载文件,代理者正在发送数据。The working state of the agent's upload file processing module can be divided into two: Idle and Run states. The Idle state indicates that the download file processing has not started yet. The Run state indicates that the file is being downloaded and the agent is sending data.

在文件下载处理中,经营者起到类似于文件传输客户端的功能。In file download processing, the operator functions similarly to a file transfer client.

经营者的下载文件处理模块的工作状态可以分为三个:Idle,Start,Run状态。Idle状态表示下载文件处理还没有开始。Start状态表示进入到文件下载的状态,但是还没有开始数据的传输。Run状态表示在进行下载文件,代理者正在接收数据。The working state of the operator's download file processing module can be divided into three states: Idle, Start, and Run states. The Idle state indicates that the download file processing has not started yet. The Start state means entering the state of file download, but the data transmission has not yet started. The Run state indicates that the file is being downloaded and the agent is receiving data.

实施例三Embodiment Three

本发明实施例提供的数据传输方法,与前述实施例相比,还包括:Compared with the foregoing embodiments, the data transmission method provided by the embodiment of the present invention further includes:

查询文件或目录,删除文件,查看磁盘可用空间大小这几个功能是调用智能设备上的操作系统的库函数实现的,不同的操作系统,其具体实现方法不一样。The functions of querying files or directories, deleting files, and viewing the available disk space are implemented by calling the library functions of the operating system on the smart device. Different operating systems have different specific implementation methods.

(a)查询文件或目录操作(a) query file or directory operation

查看列车网络上的智能设备的指定目录的文件列表,文件的属性(是正规文件还是目录)以及文件大小。或者查看该设备上的设备列表。设备列表包括物理串口,Flash存储设备,远程主机目录,及其他设备与驱动。View the file list of the specified directory of the smart device on the train network, the attribute of the file (regular file or directory) and file size. Or view the list of devices on that device. The device list includes physical serial ports, Flash storage devices, remote host directories, and other devices and drivers.

呼叫消息结构定义如下:The call message structure is defined as follows:

    Call_Get_Dir::RECORDCall_Get_Dir::RECORD

    {{

      dir_name_len UNSIGNED16;--用于存放”/”(指读设备列表)或者目录名的长度dir_name_len UNSIGNED16;--used to store "/" (referring to the device list) or the length of the directory name

      dir_name[256]UNSIGNED8;--用于发送”/”(指读设备列表)或目录名dir_name[256]UNSIGNED8;--used to send "/" (refers to read device list) or directory name

    }}

    应答消息的结构如下:The structure of the response message is as follows:

    Reply_Get_Dir::RECORDReply_Get_Dir::RECORD

    {{

      flag UNSIGNED8;--用于标识回复的是设备列表还是文件列表flag UNSIGNED8;--Used to identify whether the reply is a device list or a file list

        nr_files_or_drvs UNSIGNED16;--用于存放设备数或者文件数    nr_files_or_drvs UNSIGNED16;--used to store the number of devices or the number of files

          body unionbody union

            {{

              file_list ARRAY[NM_MAX_FILE_NUM]of    file_list ARRAY[NM_MAX_FILE_NUM]of

                {{

                    file_state UNSIGNED8;--用于存放文件的类型         file_state UNSIGNED8;--The type used to store the file

                 file_size UNSIGNED32;--用于存放文件的大小        file_size UNSIGNED32; -- used to store the size of the file

                 file_name[32] UNSIGNED8;--用于存放文件名        file_name[32] UNSIGNED8; -- used to store the file name

                 }            }

            dev_list ARRAY[NM_MAX_FILE_NUM]ofdev_list ARRAY[NM_MAX_FILE_NUM]of

                 {{

                  dev_num UNSIGNED16;--用于存放设备号;        dev_num UNSIGNED16;--used to store the device number;

                  dev_name[32] UNSIGNED8;--用于存放设备名        dev_name[32] UNSIGNED8;--used to store the device name

                  }            }

          }}

}}

其中flag:Among them flag:

0表示File_Or_Dev_Object数组中存放的是设备名及设备的驱动号。0 means that the file_Or_Dev_Object array stores the device name and the driver letter of the device.

1表示File_Or_Dev_Object数组中存放的是文件名及其文件的类型值。1 means that the file name and its type value are stored in the File_Or_Dev_Object array.

2表示要打开的目录名不正确。2 indicates that the name of the directory to be opened is incorrect.

flag为1时,When flag is 1,

file_state为:file_state is:

0 表示该文件名为一目录0 means the file name is a directory

1 表示该文件名为一常规文件1 indicates that the file name is a regular file

2 表示该文件的类型为其他2 indicates that the type of the file is other

3 表示获取该文件的类型失败3 indicates that the type of the file failed to be obtained

(b)删除文件操作(b) delete file operation

删除的文件可以是系统文件,配置文件,应用文件。对于文件系统的安全,由PC端的软件来实现。在发送删除命令的时候,需指定被删除文件的绝对路径。Deleted files can be system files, configuration files, and application files. The security of the file system is implemented by the software on the PC side. When sending the delete command, you need to specify the absolute path of the file to be deleted.

呼叫消息结构如下:The call message structure is as follows:

Call_Remove_File::RecordCall_Remove_File::Record

{{

file_name_len UNSIGNED16;--用于存放文件名的长度file_name_len UNSIGNED16; -- used to store the length of the file name

    file_name[256]UNSIGNED8;--用于存放文件名file_name[256]UNSIGNED8;--used to store the file name

    }}

    应答消息如下:The response message is as follows:

    Reply_Remove_File::RecordReply_Remove_File::Record

    {{

    };};

    (c)查看存储空间操作(c) View storage space operations

    查看指定磁盘可使用空间大小。需要注意的是磁盘的可使用空间并一定等于空闲空间。View the available space of the specified disk. It should be noted that the available space of the disk is not necessarily equal to the free space.

    请求消息的结构如下:The structure of the request message is as follows:

    Call_Get_Disk_Free_Space::RecordCall_Get_Disk_Free_Space::Record

    {{

    disk_name[32]UNSIGNED8;--用于存放磁盘名Disk_name[32]UNSIGNED8;--used to store the disk name

    };};

      应答消息的结构如下:The structure of the response message is as follows:

Reply_Get_Disk_Free_Space::RecordReply_Get_Disk_Free_Space::Record

{{

 free_space UNSIGNED32;--用于存放磁盘空间大小,若获取磁盘空间大小失败,则返回-1。free_space UNSIGNED32;-- used to store the disk space size, if the disk space size fails to be obtained, -1 will be returned.

};};

实施例四Embodiment four

本实施例提供的一种数据传输装置400,用于列车通信网络,如图5所示,数据传输装置400包括:A data transmission device 400 provided in this embodiment is used in a train communication network. As shown in FIG. 5, the data transmission device 400 includes:

操作请求发送单元401,按照预定格式发送操作请求信息给对端设备,所述操作请求信息包括操作代码、传输模式和路径信息;The operation request sending unit 401 sends operation request information to the peer device according to a predetermined format, the operation request information including operation code, transmission mode and path information;

响应消息接收单元402,接收到所述对端设备返回的响应消息;The response message receiving unit 402 receives the response message returned by the peer device;

数据操作单元403,在接收到所述对端设备返回的确认信息后,根据操作请求信息进行数据报文操作。The data operation unit 403, after receiving the confirmation information returned by the peer device, performs data packet operations according to the operation request information.

所述操作请求包括读请求和写请求;所述数据操作单元403包括:The operation request includes a read request and a write request; the data operation unit 403 includes:

数据接收单元403a,当所述操作请求为读请求,在所述响应消息接收单元接收到所述对端设备返回的确认信息后,用于从所述对端设备下载数据;The data receiving unit 403a is configured to download data from the peer device after the response message receiving unit receives the confirmation information returned by the peer device when the operation request is a read request;

数据发送单元403b,当所述操作请求为写请求,在所述响应消息接收单元接收到所述对端设备返回的确认信息后,向所述对端设备上传数据。The data sending unit 403b, when the operation request is a write request, uploads data to the peer device after the response message receiving unit receives the confirmation information returned by the peer device.

所述的装置400,还包括:The device 400 also includes:

查询单元404,用于查询所述对端设备中的目录及文件,包括文件列表,文件的属性以及文件大小;以及查看所述对端设备上的配置信息。The query unit 404 is configured to query directories and files in the peer device, including a file list, file attributes and file sizes; and view configuration information on the peer device.

所述的装置,还包括:The device also includes:

删除单元405,用于删除所述对端设备中的文件;和/或A deletion unit 405, configured to delete the file in the peer device; and/or

存储空间查看单元406,用于查看所述对端设备中的可用空间存储。A storage space checking unit 406, configured to check the available storage space in the peer device.

综上所述,本发明实施例提供的技术方案中,提供的一种基于列车通信网络的数据传输方法及装置,可提供车辆内或车辆间的应用之间的通信,本发明是基于RTP协议上的应用,在用于列车通信网络的RTP(RealTime Protocol,实时协议)基础上,一个智能设备向另一设备发送功能请求,设备响应请求后,开始文件传输。通过定义和实现文件上传,文件下载,查询文件或目录,删除文件,查看磁盘使用空间五种功能,实现了在列车网络,两个设备之间的文件传输。To sum up, in the technical solution provided by the embodiment of the present invention, a data transmission method and device based on a train communication network is provided, which can provide communication between applications in a vehicle or between vehicles. The present invention is based on the RTP protocol In the application on the Internet, based on the RTP (Real Time Protocol) used in the train communication network, one smart device sends a function request to another device, and after the device responds to the request, the file transfer starts. By defining and implementing five functions of file upload, file download, query file or directory, delete file, and view disk space usage, the file transfer between two devices in the train network is realized.

本发明的方法充分利用了TFTP(Trivial File Transfer Protocol,简单文件传输协议)的思想来实现文件上传/下载的功能,又提供了丰富的文件传输命令,简单易行,读写效率高。实现了在列车通信网络上,通过一个智能设备就能够将系统文件,配置文件,应用文件传输到其他各个智能设备上,有利于列车设备上的文件系统的维护。The method of the present invention makes full use of the idea of TFTP (Trivial File Transfer Protocol, simple file transfer protocol) to realize the function of file upload/download, and provides rich file transfer commands, which is simple and easy to implement, and has high reading and writing efficiency. Realized that on the train communication network, system files, configuration files, and application files can be transmitted to other smart devices through one smart device, which is beneficial to the maintenance of the file system on the train device.

显然,本领域的技术人员应该明白,上述的本发明的各单元或各步骤可以用通用的计算装置来实现,它们可以集中在单个的计算装置上,或者分布在多个计算装置所组成的网络上,可选地,它们可以用计算装置可执行的程序代码来实现,从而,可以将它们存储在存储装置中由计算装置来执行,或者将它们分别制作成各个集成电路模块,或者将它们中的多个单元或步骤制作成单个集成电路模块来实现。这样,本发明不限制于任何特定的硬件和软件结合。Obviously, those skilled in the art should understand that each unit or each step of the above-mentioned present invention can be realized by a general-purpose computing device, and they can be concentrated on a single computing device, or distributed in a network formed by multiple computing devices Optionally, they can be implemented with program codes executable by computing devices, thus, they can be stored in storage devices and executed by computing devices, or they can be made into individual integrated circuit modules, or they can be integrated into Multiple units or steps are fabricated into a single integrated circuit module to achieve. As such, the present invention is not limited to any specific combination of hardware and software.

以上所述仅为本发明的较佳实施例而已,并非用于限定本发明的保护范围。凡在本发明的精神和原则之内所作的任何修改、等同替换、改进等,均包含在本发明的保护范围内。The above descriptions are only preferred embodiments of the present invention, and are not intended to limit the protection scope of the present invention. Any modification, equivalent replacement, improvement, etc. made within the spirit and principles of the present invention are included in the protection scope of the present invention.

Claims (9)

1.一种文件传输方法,用于列车通信网络,其特征在于,包括:1. A file transfer method, used for train communication network, is characterized in that, comprising: 按照预定格式发送操作请求信息给对端设备,所述操作请求信息包括操作代码、传输模式和路径信息,所述传输模式为字符模式或者二进制模式;Send operation request information to the peer device according to a predetermined format, the operation request information includes operation code, transmission mode and path information, and the transmission mode is character mode or binary mode; 在接收到所述对端设备返回的确认信息后,根据操作请求信息进行数据报文操作;所述确认信息是由所述对端设备按照如下方式发送的:所述对端设备在接收到所述操作请求信息之后,判断所述路径信息是否正确,若正确,则按照所述操作请求信息进行操作,并反馈所述确认信息。After receiving the confirmation information returned by the peer device, the data packet operation is performed according to the operation request information; the confirmation information is sent by the peer device in the following manner: the peer device receives the After receiving the operation request information, it is judged whether the path information is correct, and if it is correct, the operation is performed according to the operation request information, and the confirmation information is fed back. 2.如权利要求1所述的方法,其特征在于,还包括:2. The method of claim 1, further comprising: 根据列车通信网络链路层的最大传输单元确定报文数据容量。The message data capacity is determined according to the maximum transmission unit of the link layer of the train communication network. 3.如权利要求1所述的方法,其特征在于,所述操作请求包括:3. The method according to claim 1, wherein the operation request comprises: 读请求,用于从所述对端设备下载所述报文数据;A read request, for downloading the message data from the peer device; 写请求,用于向所述对端设备上传所述报文数据。A write request, configured to upload the message data to the peer device. 4.如权利要求1所述的方法,其特征在于,所述操作请求还包括:4. The method according to claim 1, wherein the operation request further comprises: 查询请求,用于查询所述对端设备中的目录及文件,包括文件列表,文件的属性以及文件大小。The query request is used to query directories and files in the peer device, including a file list, file attributes and file sizes. 5.如权利要求1所述的方法,其特征在于,所述操作请求还包括:5. The method according to claim 1, wherein the operation request further comprises: 删除操作请求,用于删除所述对端设备中的文件;和/或A delete operation request for deleting the file in the peer device; and/or 存储空间查看请求,用于查看所述对端设备中的可用存储空间信息。The storage space check request is used to check the available storage space information in the peer device. 6.一种文件传输装置,用于列车通信网络,其特征在于,包括:6. A file transmission device for a train communication network, characterized in that it comprises: 操作请求发送单元,按照预定格式发送操作请求信息给对端设备,所述操作请求信息包括操作代码、传输模式和路径信息,所述传输模式为字符模式或者二进制模式;The operation request sending unit sends operation request information to the peer device according to a predetermined format, the operation request information includes operation code, transmission mode and path information, and the transmission mode is character mode or binary mode; 响应消息接收单元,接收到所述对端设备返回的响应消息;The response message receiving unit receives the response message returned by the peer device; 数据操作单元,在接收到所述对端设备返回的确认信息后,根据操作请求信息进行数据报文操作;所述确认信息是由所述对端设备按照如下方式发送的:所述对端设备在接收到所述操作请求信息之后,判断所述路径信息是否正确,若正确,则按照所述操作请求信息进行操作,并反馈所述确认信息。The data operation unit, after receiving the confirmation information returned by the peer device, performs data packet operations according to the operation request information; the confirmation information is sent by the peer device in the following manner: the peer device After receiving the operation request information, it is judged whether the path information is correct, and if it is correct, the operation is performed according to the operation request information, and the confirmation information is fed back. 7.如权利要求6所述的装置,其特征在于,所述操作请求包括读请求和写请求;所述数据操作单元包括:7. The device according to claim 6, wherein the operation request comprises a read request and a write request; the data operation unit comprises: 数据接收单元,当所述操作请求为读请求,在所述响应消息接收单元接收到所述对端设备返回的确认信息后,用于从所述对端设备下载数据;The data receiving unit is configured to download data from the peer device after the response message receiving unit receives the confirmation information returned by the peer device when the operation request is a read request; 数据发送单元,当所述操作请求为写请求,在所述响应消息接收单元接收到所述对端设备返回的确认信息后,向所述对端设备上传数据。The data sending unit, when the operation request is a write request, uploads data to the peer device after the response message receiving unit receives the confirmation information returned by the peer device. 8.如权利要求6所述的装置,其特征在于,还包括:8. The apparatus of claim 6, further comprising: 查询单元,用于查询所述对端设备中的目录及文件,包括文件列表,文件的属性以及文件大小;以及查看所述对端设备上的配置信息。The query unit is used to query the directories and files in the peer device, including the file list, file attributes and file sizes; and check the configuration information on the peer device. 9.如权利要求6所述的装置,其特征在于,还包括:9. The apparatus of claim 6, further comprising: 删除单元,用于删除所述对端设备中的文件;和/或a deletion unit, configured to delete files in the peer device; and/or 存储空间查看单元,用于查看所述对端设备中的可用空间存储。A storage space checking unit, configured to check the available storage space in the peer device.
CN 200810178410 2008-11-24 2008-11-24 Document transmission method and apparatus Expired - Fee Related CN101409727B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN 200810178410 CN101409727B (en) 2008-11-24 2008-11-24 Document transmission method and apparatus

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN 200810178410 CN101409727B (en) 2008-11-24 2008-11-24 Document transmission method and apparatus

Publications (2)

Publication Number Publication Date
CN101409727A CN101409727A (en) 2009-04-15
CN101409727B true CN101409727B (en) 2012-12-12

Family

ID=40572508

Family Applications (1)

Application Number Title Priority Date Filing Date
CN 200810178410 Expired - Fee Related CN101409727B (en) 2008-11-24 2008-11-24 Document transmission method and apparatus

Country Status (1)

Country Link
CN (1) CN101409727B (en)

Families Citing this family (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102468907B (en) * 2010-11-05 2015-07-08 北京北方微电子基地设备工艺研究中心有限责任公司 Transmission method of process data, apparatus thereof and system thereof
CN102201903A (en) * 2011-06-07 2011-09-28 合肥华云通信技术有限公司 Simple and reliable remote file transmission method
CN106254430B (en) * 2016-07-25 2019-09-17 新华三技术有限公司 A kind of document handling method and device and a kind of interface board
CN107995247B (en) * 2016-10-27 2020-07-14 腾讯科技(深圳)有限公司 File transmission method, server and system
CN106708436B (en) * 2016-12-16 2023-03-07 福州大学 A microcontroller-based wireless storage system and its control method
CN107425943A (en) * 2017-08-31 2017-12-01 广州视源电子科技股份有限公司 Message data transmission method and device, electronic equipment and computer storage medium
CN109257442B (en) * 2018-11-09 2021-10-22 南方电网科学研究院有限责任公司 File transfer method, system, terminal and storage medium based on TFTP
CN117221310A (en) * 2023-09-05 2023-12-12 佳源科技股份有限公司 File transmission method and device based on multifunctional electric energy meter communication protocol

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1181865A (en) * 1996-03-08 1998-05-13 Ntt移动通信网株式会社 Packet data transfering method for mobile radio data communication system
CN1889494A (en) * 2006-06-26 2007-01-03 株洲南车时代电气股份有限公司 Multi-bus automobile communication control module based on TCN
CN101127739A (en) * 2007-04-18 2008-02-20 谢步明 TCN gateway communication device

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1181865A (en) * 1996-03-08 1998-05-13 Ntt移动通信网株式会社 Packet data transfering method for mobile radio data communication system
CN1889494A (en) * 2006-06-26 2007-01-03 株洲南车时代电气股份有限公司 Multi-bus automobile communication control module based on TCN
CN101127739A (en) * 2007-04-18 2008-02-20 谢步明 TCN gateway communication device

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
宋国忠.MVB实时协议和网络管理的研究与实现.《中国优秀博硕士学位论文全文数据库(硕士)》.2006,第2章第2.3.3节,第3.2节第1行,第4章第4.1.1节,第5.1.3节第1行至第3行,图4.1. *
彭军.TCN数据传输实时性与可靠性.《中国优秀博硕士学位论文全文数据库(硕士)》.2006,第2章第2.2.4节及图2-5. *

Also Published As

Publication number Publication date
CN101409727A (en) 2009-04-15

Similar Documents

Publication Publication Date Title
CN101409727B (en) Document transmission method and apparatus
US5946467A (en) Application-level, persistent packeting apparatus and method
CN101682635B (en) Multiplexed data stream protocol
CN101682634B (en) A file protocol for transaction-based communication
CN107360177B (en) A kind of message transmitting method and device based on UDP
CN101626397A (en) System for downloading files based on Bittorrent protocol
WO2012047518A2 (en) High speed parallel data exchange with receiver side data handling
CN101674263A (en) Transmission method, transmission system, transmission device and receiving device of large data object
EP4175231A1 (en) Message processing method, network device and related device
CN114500528A (en) Data transmission method and device based on cloud platform
CN113553184A (en) A method, apparatus, electronic device and readable storage medium for realizing load balancing
CN111475445A (en) Method and system for converting USB or UART data and Ethernet data
CN109688208B (en) Data loading method based on FC-AE-ASM message
CN111800488B (en) Data transmission method and system based on UDP (user Datagram protocol) and IPV6 (Internet protocol video protocol)
CN112954068B (en) RDMA (remote direct memory Access) -based data transmission method and device
CN113010474B (en) File management method, instant messaging method and storage server
CN113238856A (en) RDMA (remote direct memory Access) -based memory management method and device
CN101179597B (en) File transfer method, system and a master control board
CN107659644A (en) A kind of method, apparatus for accessing storage system, readable storage medium storing program for executing
CN107623562B (en) Data transmission method and device and electronic equipment
CN114579166A (en) Component module upgrade method, component module and financial robot
CN111556128A (en) Data transmission method and system
KR100566226B1 (en) How to download system code of network equipment using SNP
CN114185889B (en) Method for efficiently reading short message of iOS equipment
CN111447205B (en) Data processing method, system and related equipment

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
CP03 Change of name, title or address
CP03 Change of name, title or address

Address after: The age of 412001 in Hunan Province, Zhuzhou Shifeng District Road No. 169

Patentee after: ZHUZHOU CRRC TIMES ELECTRIC Co.,Ltd.

Address before: The age of 412001 in Hunan Province, Zhuzhou Shifeng District Road

Patentee before: ZHUZHOU CSR TIMES ELECTRIC Co.,Ltd.

CF01 Termination of patent right due to non-payment of annual fee
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20121212