WO2016082469A1 - 一种传送文件的方法及装置和下载文件的方法及装置 - Google Patents

一种传送文件的方法及装置和下载文件的方法及装置 Download PDF

Info

Publication number
WO2016082469A1
WO2016082469A1 PCT/CN2015/078496 CN2015078496W WO2016082469A1 WO 2016082469 A1 WO2016082469 A1 WO 2016082469A1 CN 2015078496 W CN2015078496 W CN 2015078496W WO 2016082469 A1 WO2016082469 A1 WO 2016082469A1
Authority
WO
WIPO (PCT)
Prior art keywords
file
multicast
recipient
information
receiving
Prior art date
Application number
PCT/CN2015/078496
Other languages
English (en)
French (fr)
Inventor
乔文军
徐融
Original Assignee
中兴通讯股份有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 中兴通讯股份有限公司 filed Critical 中兴通讯股份有限公司
Publication of WO2016082469A1 publication Critical patent/WO2016082469A1/zh

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/02Details
    • H04L12/16Arrangements for providing special services to substations
    • H04L12/18Arrangements for providing special services to substations for broadcast or conference, e.g. multicast

Definitions

  • the present invention relates to the field of communications technologies, and in particular, to a method and an apparatus for transmitting a file, and a method and apparatus for downloading a file.
  • large-scale network equipment generally adopts a distributed cluster system.
  • a set of devices consists of multiple chassis.
  • Each chassis can be configured with dozens of boards.
  • Each board has one or more central processing units (Central Processing Unit). , referred to as CPU), so the entire device may have hundreds or even hundreds of CPUs.
  • the CPUs obtain the version mode from the main control CPU.
  • FTP File Transfer Protocol
  • the client/server (C/S) structure is used.
  • the CPU starts a server and provides a distribution service for the version file. All the online clients start a client from the CPU and send a version request through the client. After receiving the version file request from the server, the main CPU of the server queries the corresponding version in the database. After obtaining the detailed version information, the file is answered to the receiver of the client, and then the client downloads the version through FTP.
  • the present invention provides a method and apparatus for transmitting a file and a method and apparatus for downloading the file, which can improve file transfer efficiency and simplify the file transfer process.
  • a method for transmitting a file for transmitting a file to a receiver including the following steps:
  • the first file is multicast transmitted to all recipients.
  • the method further includes:
  • the second file After multicast transmitting the first file to all receivers, the second file is multicast transmitted to all receivers.
  • the method further includes:
  • the method further includes:
  • the step of updating the entry of the multicast list according to the second file information includes:
  • the file that is multicast by the sender in the subsequent multicast process includes all or part of the second file according to the multicast list, the entry corresponding to the second file and not yet multicast in the multicast list is not included.
  • the second file entry corresponding to the second file information is sequentially added in the multicast list.
  • the embodiment of the present invention further provides a method for downloading a file, where the receiving party downloads the file from the sender, including the following steps:
  • the file is retained when the file requested by the recipient is determined when the received file is determined.
  • the method before receiving the file sent by the sender in response to the file request of the receiver or any other recipient, the method further includes:
  • the list determines whether the file it receives is the file requested by the recipient.
  • an embodiment of the present invention further provides an apparatus for transmitting a file, where the sending direction transmits a file to a receiver, including:
  • a first file request receiving module configured to receive a file request sent by a first receiver of the receiving party
  • a first file query module configured to determine, according to the file request, a first file required by the first recipient;
  • the first file multicast module is configured to multicast the first file to all receivers.
  • the device further includes:
  • a second file request receiving module configured to receive a file request sent by a second receiver of the receiving party
  • a second file querying module configured to determine, according to the file request sent by the second receiving party, a second file required by the second receiving party;
  • the second file multicast module is configured to multicast and transmit the second file to all receivers after multicasting the first file to all receivers.
  • the device further includes:
  • a first file information sending module configured to send information of the first file to a first recipient
  • a first file entry creation module configured to establish a first file entry of the multicast list according to the information of the first file, so that the first file can be multicastly transmitted to all receivers according to the first file The first file is transmitted in the order of the entry;
  • the first file download request receiving module is configured to receive a first file download request sent by the first recipient in response to the information of the first file.
  • the device further includes:
  • a second file information sending module configured to send information of the second file to the second recipient
  • the multicast list update module is configured to update the entry of the multicast list according to the second file information, so that the second file can be multicast to all the recipients according to the updated multicast list.
  • the multicast list update module includes:
  • the first update unit is configured to: when the file that is multicast by the sender in the subsequent multicast process includes all or part of the second file according to the multicast list, corresponds to the second file, and the multicast list is not yet grouped. The information of the file not included in the broadcasted entry is added to the multicast list in the order of the multicast list.
  • the second update unit is configured to: when the file that is multicast by the sender in the subsequent multicast process does not include the second file according to the first multicast list, add the second file information correspondingly to the second in the multicast list File entry.
  • the embodiment of the present invention further provides an apparatus for downloading a file, where the receiving party downloads a file from a sender, including:
  • File receiving module configured to receive a file transmitted by the sender in response to a file request of the receiver or any other recipient;
  • a first file receiving processing module configured to discard the file when it is determined that the received file is not a file requested by the recipient;
  • the second file receiving processing module is configured to reserve the file when the file requested by the recipient is determined when the received file is determined.
  • the device further includes:
  • File information receiving module configured to receive file information requested by the sender sent by the sender;
  • Download request sending module set to send a file download request to the sender
  • a task list management module configured to establish a task list of the received file according to the file information, so that the receiving server can determine the file according to the task list after responding to the file transmitted by the receiver or any other recipient Whether the file it receives is the file requested by the recipient.
  • the file sending method and apparatus, and the file receiving method and apparatus provided by the embodiments of the present invention can send files to the receiving party in a multicast manner, thereby avoiding complicated processes and handshakes caused by FTP transmission. There are too many times and the file is reciprocating.
  • the method and apparatus provided by the embodiments of the present invention are more advantageous: when more than two receivers need to receive the same file At the same time, the files sent by all the receivers in the transmission direction will be simultaneously received by the two receivers that need the same file, so as to avoid the situation that the sender sends a large amount of bandwidth to the receiver separately.
  • FIG. 1 is a flowchart of a method for transmitting a file according to an embodiment of the present invention
  • FIG. 2 is a flowchart of a method for downloading a file according to an embodiment of the present invention
  • FIG. 3 is a schematic flowchart of a file transfer and download method according to an embodiment of the present invention.
  • FIG. 4 is a schematic structural diagram of an apparatus for transmitting a file according to an embodiment of the present invention.
  • FIG. 5 is a schematic structural diagram of an apparatus for downloading a file according to an embodiment of the present invention.
  • the embodiment of the present invention first provides a method for transmitting a file, where the method is used for sending a transmission path to a receiver, including the steps shown in FIG. 1:
  • Step 101 Receive a file request sent by a first receiver of the receiver.
  • Step 102 Determine, according to the file request, a first file required by the first recipient;
  • Step 103 Multicast and transmit the first file to all receivers.
  • the sender sends the file to the receiver in a multicast manner, without complicated handshake and frequent file transmission; when there are multiple receivers, The sender can simultaneously send the file to multiple recipients, avoiding link congestion caused by simultaneously transmitting multiple identical files with each recipient transmitting the file separately.
  • the main CPU acts as a sender to send files to the plurality of slave CPUs that start the client through the server.
  • each slave CPU is powered on, manages the client, and can register one between the client and the server during initialization.
  • a public multicast group to receive multicast messages from the CPU as a receiver.
  • the host CPU may request the file through the file after receiving the file request sent from the CPU.
  • the file is determined to be sent to the slave CPU, and the file sent to the slave CPU may be determined by the physical information of the slave CPU, such as the version, attributes, and the like carried by the file request.
  • the method further includes:
  • the second file After multicast transmitting the first file to all receivers, the second file is multicast transmitted to all receivers.
  • the first file includes file A, file B, and file C
  • the second file includes file D, file E, and file F
  • the sender multicasts file A, file B, and file C. , continue to multicast file D, file E, file F.
  • the method further includes:
  • the first receiver After receiving the information of the first file sent by the sender, the first receiver sends a first file download request to the sender, and after receiving the first file download request, the sender multicasts and sends the first file to all receivers. All recipients, including the first receiver, receive the first file sent by the sender multicast.
  • the slave CPU is the receiver, and the master and slave CPUs respectively start the server and the client to transfer files, after each slave CPU is powered on, the file is requested from the server, and the server's main CPU is based on the server.
  • the physical information reported from the CPU in the board retrieves the file requested from the CPU, adds the retrieved file information to the multicast list sent by the multicast, and returns a response message to the client.
  • the client sends a file download request to the main CPU of the server.
  • the server multicasts the files in the multicast list in sequence. In the process of multicasting, after receiving the file request of other CPUs of the client, the server adds the retrieved matching version file to the multicast group file list.
  • the method further includes:
  • the sender may directly add the entry corresponding to the second file entry of the second file information to the first file entry, so that the sender completes the first file in multicast. After that, the second file can be multicasted.
  • the entries of the multicast list are updated according to the second file information.
  • the steps include:
  • the file that is multicast by the sender in the subsequent multicast process includes all or part of the second file according to the multicast list, the entry corresponding to the second file and not yet multicast in the multicast list is not included.
  • the second file entry corresponding to the second file information is sequentially added in the multicast list.
  • the first file includes file A, file B, and file C
  • the second file includes file B, file C, and file D.
  • the sender When receiving the file request sent by the second recipient, determining the second file. After the file, if the file A in the first file has been multicast, the remaining files in the multicast list include file B and file C, and the second file includes file B, file C, and file D, then in the multicast list. Add the multicast entry of file D. According to the updated multicast list, the sender will multicast file B, file C, and file D in turn.
  • an embodiment of the present invention provides a method for downloading a file, for a receiver to download a file from a sender, including the steps shown in FIG. 2:
  • the file is retained when the file requested by the recipient is determined when the received file is determined.
  • the receiver can determine whether the file received by the receiver is the file requested by the recipient by judging the matching of the received file with the recipient.
  • the method before receiving the file transmitted by the sender in response to the file request of the recipient or any other recipient, the method further includes:
  • the list determines whether the file it receives is the file requested by the recipient.
  • the receiver when receiving the file sent by the sender, may determine, according to the file task list managed by itself, whether the file it receives is the file it needs, and if not, The file is discarded; after receiving the file, all receivers query whether the recipient has accepted the file, and if so, discard the file.
  • Figure 3 is an embodiment of a particular practical situation of the present invention.
  • the file requested by the first recipient is file A, file B, file C
  • the file requested by the second receiver is also file A, file B, file C;
  • Step 301 Start a first receiving direction of the client, and start a server to send a file request.
  • Step 302 The sender, according to the file request in the above step, queries to determine that the first file required by the first receiver is file A, file B, and file C, and adds file A, file B, and file C to the multicast list; Sending the information to the first recipient;
  • Step 303 After receiving the information of the first file sent by the sender, the first receiver establishes a first file task list, and sends a first file download request to the sender.
  • Step 304 According to the order of the entries of the multicast list, all the receivers in the sending direction including the first receiver multicast the file A;
  • Step 305 Initiate a second receiving direction of the client to send a file request to the sender.
  • Step 306 The sender determines, according to the file request in the foregoing step, that the second file required by the second receiver is the file A, the file B, and the file C, because the entries in the current multicast list that are not yet multicast include the file B. File C, so the sender adds the file A to the multicast list; and sends the information to the second recipient;
  • Step 307 After receiving the information of the second file sent by the sender, the second receiver establishes a second file task list, and sends a second file download request to the sender; the first file task list and the second file.
  • the task list can be managed by the second receiver and the second receiver, respectively;
  • Step 308 The sending direction includes all the receiving parties, including the first receiving party and the second receiving party, multicasting and transmitting the file B in sequence;
  • Step 309 The sending direction includes all the receiving parties including the first receiving party and the second receiving party, and multicasts the file C in turn;
  • Step 310 All the receiving parties including the first receiving party and the second receiving party send the file A in turn, and the other receiving party can manage the file A, the file B, and the file C according to the management.
  • the task list determines whether the file it receives is the file it needs, and if not, discards the file; after receiving the file, all receivers query whether the recipient has received the file, and if so, Then discard the file.
  • an embodiment of the present invention provides an apparatus for transmitting a file.
  • the structure is as shown in FIG. 4, and is used for sending a transmission file to a receiving end, including:
  • a first file request receiving module configured to receive a file request sent by a first receiver of the receiving party
  • a first file query module configured to determine, according to the file request, a first file required by the first recipient;
  • the first file multicast module is configured to multicast the first file to all receivers.
  • the apparatus further includes:
  • a second file request receiving module configured to receive a file request sent by a second receiver of the receiving party
  • a second file querying module configured to determine, according to the file request sent by the second receiving party, a second file required by the second receiving party;
  • the second file multicast module is configured to multicast and transmit the second file to all receivers after multicasting the first file to all receivers.
  • there is only one file requesting module, a file querying module, and a multicasting module that is, the first file requesting module and the second file requesting module are the same module, and the first A file query module and a second file query module are the same module, the first file multicast module, and the second file
  • the multicast module is the same module.
  • the file requesting module, the file querying module, and the file multicasting module can receive and process requests of multiple client senders, such as the first sender, the second sender, and the third sender, and multicast.
  • the apparatus further includes:
  • a first file information sending module configured to send information of the first file to a first recipient
  • a first file entry creation module configured to establish a first file entry of the multicast list according to the information of the first file, so that the first file can be multicastly transmitted to all receivers according to the first file The first file is transmitted in the order of the entry;
  • the first file download request receiving module is configured to receive a first file download request sent by the first recipient in response to the information of the first file.
  • the apparatus further includes:
  • a second file information sending module configured to send information of the second file to the second recipient
  • the multicast list update module is configured to update the entry of the multicast list according to the second file information, so that the second file can be multicast to all the recipients according to the updated multicast list.
  • the information sending module, the file entry processing module, and the downloading module are each only one, which can be sent to multiple clients, establish entries of multiple clients, and receive download requests of multiple clients. . That is to say, the first information sending module and the second information sending module are the same module.
  • the multicast list update module includes:
  • the first update unit is configured to: when the file that is multicast by the sender in the subsequent multicast process includes all or part of the second file according to the multicast list, corresponds to the second file, and the multicast list is not yet grouped. The information of the file not included in the broadcasted entry is added to the multicast list in the order of the multicast list.
  • the second update unit is configured to: when the file that is multicast by the sender in the subsequent multicast process does not include the second file according to the first multicast list, add the second file information correspondingly to the second in the multicast list File entry.
  • the first update unit and the second update unit are the same unit, and all multicast file information can be processed.
  • the embodiment of the present invention further provides an apparatus for downloading a file, and the structure is as shown in FIG. 5, and is used by the receiving party to download the file from the sender, including:
  • File receiving module configured to receive a file transmitted by the sender in response to a file request of the receiver or any other recipient;
  • a first file receiving processing module configured to discard the file when it is determined that the received file is not a file requested by the recipient;
  • the second file receiving processing module is configured to reserve the file when the file requested by the recipient is determined when the received file is determined.
  • the client sets a file receiving module and a file processing module, and processes all files that are multicast by the server, or downloads or discards them.
  • the apparatus further includes:
  • File information receiving module configured to receive file information requested by the sender sent by the sender;
  • Download request sending module set to send a file download request to the sender
  • a task list management module configured to establish a task list of the received file according to the file information, so that the receiving server can determine the file according to the task list after responding to the file transmitted by the receiver or any other recipient Whether the file it receives is the file requested by the recipient.
  • the file sending method and apparatus, and the file receiving method and apparatus provided by the embodiments of the present invention can send files to the receiving party in a multicast manner, thereby avoiding complicated processes and handshakes caused by FTP transmission. There are too many times and the file is reciprocating.
  • the method and apparatus provided by the embodiments of the present invention are more advantageous: when more than two receivers need to receive the same file, the sender sends the multicast file to all receivers. It is received by the two receivers that need the same file at the same time, so as to avoid the situation that the sender sends a large amount of bandwidth to the receiver separately.
  • the present invention transmits a file to a receiving party in a multicast manner, thereby avoiding the problems of complicated process, excessive handshake, and file reciprocating transmission through FTP transmission.
  • the files sent by all the receivers in the transmission direction will be received by the receivers that need the same file at the same time, avoiding the situation that the senders transmit the files to a large amount of bandwidth.

Abstract

本发明提供一种传送文件的方法及装置和下载文件的方法及装置。所述传送文件的方法,用于发送方向接收方传输文件,包括:接收接收方中的第一接收方发送的文件请求;根据所述文件请求,确定第一接收方所需要的第一文件;向所有接收方组播传输所述第一文件。所述下载文件的方法用于接收方从发送方下载文件,包括:接收发送方响应于本接收方或其它任意接收方的文件请求所组播传送的文件;当确定所述接收到的文件不是本接收方所请求的文件时,将文件丢弃;当确定所述接收到的文件是本接收方所请求的文件时,将文件保留。所述装置与所述方法对应。本发明提供的方法和装置能够提高文件传送效率,简化文件传送过程。

Description

一种传送文件的方法及装置和下载文件的方法及装置 技术领域
本发明涉及通信技术领域,尤其涉及一种传送文件的方法及装置和下载文件的方法及装置。
背景技术
目前,大型网络设备一般都采用分布式集群系统。在这种分布式集群硬件架构中,一套设备由多个机框组成,每个机框最多可能会设置有几十块单板,每个单板一个或多个中央处理单元(Central Processing Unit,简称为CPU),因此整套设备可能拥有上百、乃至几百个CPU。这些CPU从主控CPU获取版本方式目前主要使用文件传输协议(File Transfer Protocol,简称为FTP)下载方式,采用的是客户端/服务端(Client/Server,简称为C/S)结构,主控CPU启动一个服务端,提供版本文件的分发服务,所有的在线从CPU启动一个客户端,通过客户端发送版本请求,服务端的主CPU作为发送方收到版本文件请求后,在数据库中查询相应版本文件,获取详细的版本信息后,应答给客户端的接收方,然后客户端通过FTP进行版本的下载。
通过FTP方式下载版本文件存在的问题有:从FTP服务端检索一个文件,包括繁复的交换握手步骤,传输一个文件,FTP需要往复10次。
发明内容
有鉴于此,本发明提供一种传送文件的方法及装置和下载文件的方法及装置,能够提高文件传送效率,简化文件传送过程。
一种传送文件的方法,用于发送方向接收方传输文件,包括如下步骤:
接收接收方中的第一接收方发送的文件请求;
根据所述文件请求,确定第一接收方所需要的第一文件;
向所有接收方组播传输所述第一文件。
可选的,接收接收方中的第一接收方发送的文件请求之后,还包括:
接收接收方中的第二接收方发送的文件请求;
根据所述第二接收方发送的文件请求,确定所述第二接收方所需要的第二文件;
向所有接收方组播传输所述第一文件之后,向所有接收方组播传输所述第二文件。
可选的,根据所述文件请求、确定第一接收方所需要的第一文件之后,还包括:
将所述第一文件的信息发送到第一接收方;并根据所述第一文件的信息建立组播列表的第一文件表项,从而向所有接收方组播传输所述第一文件时能够根据所述第一文件表项的顺序传输所述第一文件;
接收第一接收方响应于所述第一文件的信息所发送的第一文件下载请求;
进入所述向所有接收方组播传输所述第一文件的步骤。
可选的,根据所述第二接收方发送的文件请求、确定所述第二接收方所需要的第二文件之后,还包括:
将第二文件的信息发送到所述第二接收方,并根据第二文件信息更新组播列表的表项,从而能够根据更新后的组播列表向所有接收方组播第二文件。
可选的,根据第二文件信息更新组播列表的表项的步骤包括:
当依据组播列表,发送方在后续组播过程中组播的文件包括全部或部分第二文件时,对应于第二文件中包括的、并且组播列表中尚未组播的表项所未包括的文件的信息,在组播列表中按照顺序增加组播表项;
当依据第一组播列表,发送方在后续组播过程组播的文件不包括第二文件时,在组播列表中按照顺序增加第二文件信息所对应的第二文件表项。
同时,本发明实施例还提供一种下载文件的方法,用于接收方从发送方下载文件,包括如下步骤:
接收发送方响应于本接收方或其它任意接收方的文件请求所组播传送的文件;
当确定所述接收到的文件不是本接收方所请求的文件时,将文件丢弃;
当确定所述接收到的文件时本接收方所请求的文件时,将文件保留。
可选的,接收发送方响应于本接收方或其它任意接收方的文件请求所传送的文件之前,还包括:
接收发送方发送的本接收方所请求的文件信息;
向发送方发送文件下载请求;并根据所述文件信息,建立接收文件的任务列表,从而在接收服务端响应于本接收方或其它任意接收方的文件请求所传送的文件之后能够根据所述任务列表判断其所接收到的文件是否为本接收方所请求的文件。
优选地,本发明实施例还提供一种传送文件的装置,用于发送方向接收方传输文件,包括:
第一文件请求接收模块:设置为接收接收方中的第一接收方发送的文件请求;
第一文件查询模块:设置为根据所述文件请求,确定第一接收方所需要的第一文件;
第一文件组播模块:设置为向所有接收方组播传输所述第一文件。
可选的,所述装置还包括:
第二文件请求接收模块:设置为接收接收方中的第二接收方发送的文件请求;
第二文件查询模块:设置为根据所述第二接收方发送的文件请求,确定所述第二接收方所需要的第二文件;
第二文件组播模块:设置为向所有接收方组播传输所述第一文件之后,向所有接收方组播传输所述第二文件。
可选的,所述装置还包括:
第一文件信息发送模块:设置为将所述第一文件的信息发送到第一接收方;
第一文件表项建立模块:设置为根据所述第一文件的信息建立组播列表的第一文件表项,从而向所有接收方组播传输所述第一文件时能够根据所述第一文件表项的顺序传输所述第一文件;
第一文件下载请求接收模块:设置为接收第一接收方响应于所述第一文件的信息所发送的第一文件下载请求。
可选的,所述装置还包括:
第二文件信息发送模块:设置为将第二文件的信息发送到所述第二接收方;
组播列表更新模块:设置为根据第二文件信息更新组播列表的表项,从而能够根据更新后的组播列表向所有接收方组播第二文件。
可选的,所述组播列表更新模块包括:
第一更新单元:设置为当依据组播列表,发送方在后续组播过程中组播的文件包括全部或部分第二文件时,对应于第二文件中包括的、并且组播列表中尚未组播的表项所未包括的文件的信息,在组播列表中按照顺序增加组播表项;
第二更新单元:设置为当依据第一组播列表,发送方在后续组播过程组播的文件不包括第二文件时,在组播列表中按照顺序增加第二文件信息所对应的第二文件表项。
优选地,本发明实施例还提供一种下载文件的装置,用于接收方从发送方下载文件,包括:
文件接收模块:设置为接收发送方响应于本接收方或其它任意接收方的文件请求所组播传送的文件;
第一文件接收处理模块:设置为当确定所述接收到的文件不是本接收方所请求的文件时,将文件丢弃;
第二文件接收处理模块:设置为当确定所述接收到的文件时本接收方所请求的文件时,将文件保留。
可选的,所述装置还包括:
文件信息接收模块:设置为接收发送方发送的本接收方所请求的文件信息;
下载请求发送模块:设置为向发送方发送文件下载请求;
任务列表管理模块:设置为根据所述文件信息,建立接收文件的任务列表,从而在接收服务端响应于本接收方或其它任意接收方的文件请求所传送的文件之后能够根据所述任务列表判断其所接收到的文件是否为本接收方所请求的文件。
从上面所述可以看出,本发明实施例所提供的文件发送方法及装置和文件接收方法及装置,可以通过组播的方式向接收方发送文件,避免通过FTP传输所出现的过程复杂、握手次数过多、文件往复传送的问题。在接收方存在多个的情况下,本发明实施例提供的方法和装置更能够体现优势:当有两个以上的接收方需要接收相同的文件 时,发送方向所有接收方组播发送的文件将被这两个以上需要相同文件的接收方同时接收,避免发送方向接收方单独传送文件占用大量带宽的情况。
附图说明
图1为本发明实施例的传送文件的方法流程图;
图2为本发明实施例的下载文件的方法流程图;
图3为本发明一种实施例的文件传送和下载方法流程示意图;
图4为本发明实施例提供的传送文件的装置结构示意图;
图5为本发明实施例提供的下载文件的装置结构示意图。
具体实施方式
为了给出有效的实现方案,本发明提供了下述实施例,以下结合说明书附图对本发明实施例进行说明。
本发明实施例首先提供一种传送文件的方法,其中,用于发送方向接收方传输文件,包括如图1所示的步骤:
步骤101:接收接收方中的第一接收方发送的文件请求;
步骤102:根据所述文件请求,确定第一接收方所需要的第一文件;
步骤103:向所有接收方组播传输所述第一文件。
从上面所述可以看出,本发明实施例提供的传送文件的方法,发送方以组播方式向接收方发送文件,无需经过繁复的握手以及频繁的文件传送;当接收方存在多个时,发送方能够将文件同时发送给多个接收方,避免向每个接收方单独传送文件的情况下同时传送多个同样的文件而引起的链路拥堵。
主CPU作为发送方通过服务端向启动客户端的多个从CPU发送文件,在这种集群环境下,每个从CPU上电,管理客户端,初始化时可在客户端和服务端之间注册一个公共的组播组,以便作为接收方的从CPU接收组播消息。
在本发明的优选实施例中,在主CPU通过服务端向客户端的从CPU组播发送文件的情况下,主CPU在接收到从CPU所发送的文件请求之后,可以通过文件请求内 容确定向该从CPU发送的文件,也可以通过文件请求所携带的从CPU的物理信息,如版本、属性等,确定向该从CPU发送的文件。
在本发明的一些实施例中,所述方法还包括:
接收接收方中的第二接收方发送的文件请求;
根据所述第二接收方发送的文件请求,确定所述第二接收方所需要的第二文件;
向所有接收方组播传输所述第一文件之后,向所有接收方组播传输所述第二文件。
在本发明优选实施例中,假设第一文件包括文件A、文件B、文件C,第二文件包括文件D、文件E、文件F,那么发送方组播完文件A、文件B、文件C之后,继续组播文件D、文件E、文件F。
在本发明一些实施例中,根据所述文件请求、确定第一接收方所需要的第一文件之后,还包括:
将所述第一文件的信息发送到第一接收方;并根据所述第一文件的信息建立组播列表的第一文件表项,从而向所有接收方组播传输所述第一文件时能够根据所述第一文件表项的顺序传输所述第一文件;
接收第一接收方响应于所述第一文件的信息所发送的第一文件下载请求;
进入所述向所有接收方组播传输所述第一文件的步骤。
当第一接收方收到发送方所发送的第一文件的信息之后,向发送方发送第一文件下载请求,发送方收到第一文件下载请求之后,向所有接收方组播发送第一文件,包括第一接收方在内的所有接收方接收发送方组播发送的第一文件。
在主CPU作为发送方、从CPU作为接收方、主从CPU分别启动服务端和客户端传输文件的集群环境下,每个从CPU上电后,会向服务端请求文件,服务端的主CPU根据单板中的从CPU上报的物理信息,检索从CPU所请求的文件,将检索出的文件信息添加到组播发送的组播列表中,同时给客户端回应答消息。客户端相应的从CPU收到应答消息后,会向服务端的主CPU发送文件的下载请求,服务端将组播列表中的文件顺序依次组播出去。在组播的过程中,服务端又收到启动客户端的其他CPU的文件请求后,会将检索出的匹配版本文件加入组播组文件列表中。
在本发明一些实施例中,根据所述第二接收方发送的文件请求、确定所述第二接收方所需要的第二文件之后,还包括:
将第二文件的信息发送到所述第二接收方,并根据第二文件信息更新组播列表的表项,从而能够根据更新后的组播列表向所有接收方组播第二文件。
在本发明的一种优选实施例中,所述发送方可以直接将第二文件信息对应第二文件表项的表项添加于第一文件表项之后,从而发送方在组播完成第一文件之后,就可以接着组播第二文件。
在本发明的另一些实施例中,考虑到第二文件中可能存在于第一文件重复的文件,因此,在本发明的另一些实施例中,根据第二文件信息更新组播列表的表项的步骤包括:
当依据组播列表,发送方在后续组播过程中组播的文件包括全部或部分第二文件时,对应于第二文件中包括的、并且组播列表中尚未组播的表项所未包括的文件的信息,在组播列表中按照顺序增加组播表项;
当依据第一组播列表,发送方在后续组播过程组播的文件不包括第二文件时,在组播列表中按照顺序增加第二文件信息所对应的第二文件表项。
在本发明优选实施例中,假设第一文件包括文件A、文件B、文件C,第二文件包括文件B、文件C、文件D,当接收到第二接收方发送的文件请求、确定第二文件之后,若第一文件中的文件A已经组播完毕,组播列表中剩余的文件包括文件B、文件C,第二文件中包括文件B、文件C、文件D,那么在组播列表中增加文件D的组播表项,依据更新后的组播列表,发送方将依次组播文件B、文件C、文件D。
优选地,本发明实施例提供一种下载文件的方法,用于接收方从发送方下载文件,包括图2所示的步骤:
接收发送方响应于本接收方或其它任意接收方的文件请求所组播传送的文件;
当确定所述接收到的文件不是本接收方所请求的文件时,将文件丢弃;
当确定所述接收到的文件时本接收方所请求的文件时,将文件保留。
在本发明优选实施例中,接收方可以通过判断接收到的文件与本接收方的匹配性判断其所接收到的文件是否为本接收方所请求的文件。
在本发明的一些实施例中,接收发送方响应于本接收方或其它任意接收方的文件请求所传送的文件之前,还包括:
接收发送方发送的本接收方所请求的文件信息;
向发送方发送文件下载请求;并根据所述文件信息,建立接收文件的任务列表,从而在接收服务端响应于本接收方或其它任意接收方的文件请求所传送的文件之后能够根据所述任务列表判断其所接收到的文件是否为本接收方所请求的文件。
在本发明优选实施例中,接收方在接收到发送方所发送的文件时,可根据自己所管理的文件任务列表判断其所接收到的文件是否为其所需要的文件,若不是,则将文件丢弃;所有接收方在接收到文件之后,均查询本接收方是否已接受过该文件,若是,则将文件丢弃。
图3为本发明一种特定实际情况下的实施例。在该特定情况下,第一接收方所请求的文件为文件A、文件B、文件C,第二接收方请求的文件也为文件A、文件B、文件C;在发送方组播完毕文件A后,接收到第二接收方的文件请求,在该实施例中,执行的步骤如下:
步骤301:启动客户端的第一接收方向启动服务端发送文件请求;
步骤302:发送方依据上述步骤中的文件请求,查询确定第一接收方所需要的第一文件为文件A、文件B、文件C,将文件A、文件B、文件C加入组播列表;并将该信息发送到第一接收方;
步骤303:第一接收方接收到发送方所发送的第一文件的信息之后,建立第一文件任务列表,并向发送方发送第一文件下载请求;
步骤304:按照组播列表的表项顺序,发送方向包括第一接收方在内的所有接收方组播发送文件A;
步骤305:启动客户端的第二接收方向发送方发送文件请求;
步骤306:发送方依据上述步骤中的文件请求,查询确定第二接收方所需要的第二文件为文件A、文件B、文件C,由于当前组播列表中尚未组播的表项包括文件B、文件C,因此发送方将文件A加入组播列表;并将该信息发送到第二接收方;
步骤307:第二接收方接收到发送方所发送的第二文件的信息之后,建立第二文件任务列表,并向发送方发送第二文件下载请求;所述第一文件任务列表、第二文件任务列表可分别由第二接收方和第二接收方进行管理;
步骤308:发送方向包括第一接收方、第二接收方在内的所有接收方依次组播发送文件B;
步骤309:发送方向包括第一接收方、第二接收方在内的所有接收方依次组播发送文件C;
步骤310:发送方向包括第一接收方、第二接收方在内的所有接收方依次组播发送文件A;其它接收方在接收到上述文件A、文件B、文件C时,可根据自己所管理的任务列表判断其所接收到的文件是否为其所需要的文件,若不是,则将文件丢弃;所有接收方在接收到文件之后,均查询本接收方是否已接接收过该文件,若是,则将文件丢弃。
优选地,本发明实施例提供一种传送文件的装置,结构如图4所示,用于发送方向接收方传输文件,包括:
第一文件请求接收模块:设置为接收接收方中的第一接收方发送的文件请求;
第一文件查询模块:设置为根据所述文件请求,确定第一接收方所需要的第一文件;
第一文件组播模块:设置为向所有接收方组播传输所述第一文件。在本发明的一些实施例中,所述装置还包括:
第二文件请求接收模块:设置为接收接收方中的第二接收方发送的文件请求;
第二文件查询模块:设置为根据所述第二接收方发送的文件请求,确定所述第二接收方所需要的第二文件;
第二文件组播模块:设置为向所有接收方组播传输所述第一文件之后,向所有接收方组播传输所述第二文件。
在本发明的一种优选实施例中,文件请求模块、文件查询模块和组播模块分别只有一个,也就是说,所述第一文件请求模块和第二文件请求模块为同一模块、所述第一文件查询模块和第二文件查询模块为同一模块、所述第一文件组播模块和第二文件 组播模块为同一模块。所述文件请求模块、文件查询模块和文件组播模块可以接收、处理第一发送方、第二发送方、第三发送方等多个客户端发送方的请求,以及组播。
在本发明的一些实施例中,所述装置还包括:
第一文件信息发送模块:设置为将所述第一文件的信息发送到第一接收方;
第一文件表项建立模块:设置为根据所述第一文件的信息建立组播列表的第一文件表项,从而向所有接收方组播传输所述第一文件时能够根据所述第一文件表项的顺序传输所述第一文件;
第一文件下载请求接收模块:设置为接收第一接收方响应于所述第一文件的信息所发送的第一文件下载请求。
在本发明的一些实施例中,所述装置还包括:
第二文件信息发送模块:设置为将第二文件的信息发送到所述第二接收方;
组播列表更新模块:设置为根据第二文件信息更新组播列表的表项,从而能够根据更新后的组播列表向所有接收方组播第二文件。
在本发明一种优选实施例中,信息发送模块、文件表项处理模块、下载模块也是分别只有一个,能够发送给多个客户端,建立多个客户端的表项,接收多个客户端的下载请求。也就是说,第一信息发送模块和第二信息发送模块为同一模块。
在本发明的一些实施例中,所述组播列表更新模块包括:
第一更新单元:设置为当依据组播列表,发送方在后续组播过程中组播的文件包括全部或部分第二文件时,对应于第二文件中包括的、并且组播列表中尚未组播的表项所未包括的文件的信息,在组播列表中按照顺序增加组播表项;
第二更新单元:设置为当依据第一组播列表,发送方在后续组播过程组播的文件不包括第二文件时,在组播列表中按照顺序增加第二文件信息所对应的第二文件表项。
在本发明一种优选实施例中,服务端的更新单元也只有一个,也就是说,上述第一更新单元和第二更新单元为同一单元,可以处理所有组播文件信息。
优选地,本发明实施例还提供一种下载文件的装置,结构如图5所示,用于接收方从发送方下载文件,包括:
文件接收模块:设置为接收发送方响应于本接收方或其它任意接收方的文件请求所组播传送的文件;
第一文件接收处理模块:设置为当确定所述接收到的文件不是本接收方所请求的文件时,将文件丢弃;
第二文件接收处理模块:设置为当确定所述接收到的文件时本接收方所请求的文件时,将文件保留。
在本发明的一种优选实施例中客户端设置文件接收模块和文件处理模块,处理所有服务端组播过来的文件,或下载,或抛弃。
在本发明的一些实施例中,所述装置还包括:
文件信息接收模块:设置为接收发送方发送的本接收方所请求的文件信息;
下载请求发送模块:设置为向发送方发送文件下载请求;
任务列表管理模块:设置为根据所述文件信息,建立接收文件的任务列表,从而在接收服务端响应于本接收方或其它任意接收方的文件请求所传送的文件之后能够根据所述任务列表判断其所接收到的文件是否为本接收方所请求的文件。
从上面所述可以看出,本发明实施例所提供的文件发送方法及装置和文件接收方法及装置,可以通过组播的方式向接收方发送文件,避免通过FTP传输所出现的过程复杂、握手次数过多、文件往复传送的问题。在接收方存在多个的情况下,本发明实施例提供的方法和装置更能够体现优势:当有两个以上的接收方需要接收相同的文件时,发送方向所有接收方组播发送的文件将被这两个以上需要相同文件的接收方同时接收,避免发送方向接收方单独传送文件占用大量带宽的情况。
工业实用性:通过上述描述可知,本发明通过组播的方式向接收方发送文件,避免通过FTP传输所出现的过程复杂、握手次数过多、文件往复传送的问题。在接收方存在多个的情况下,发送方向所有接收方组播发送的文件将被这两个以上需要相同文件的接收方同时接收,避免发送方向接收方单独传送文件占用大量带宽的情况。
应当理解,本说明书所描述的多个实施例仅用于说明和解释本发明,并不用于限定本发明。并且在不冲突的情况下,本申请中的实施例及实施例中的特征可以相互组合。
显然,本领域的技术人员可以对本发明进行各种改动和变型而不脱离本发明的精神和范围。这样,倘若本发明的这些修改和变型属于本发明权利要求及其等同技术的范围之内,则本发明也意图包括这些改动和变型在内。

Claims (14)

  1. 一种传送文件的方法,用于发送方向接收方传输文件,包括如下步骤:
    接收接收方中的第一接收方发送的文件请求;
    根据所述文件请求,确定第一接收方所需要的第一文件;
    向所有接收方组播传输所述第一文件。
  2. 根据权利要求1所述的方法,其中,接收接收方中的第一接收方发送的文件请求之后,还包括:
    接收接收方中的第二接收方发送的文件请求;
    根据所述第二接收方发送的文件请求,确定所述第二接收方所需要的第二文件;
    向所有接收方组播传输所述第一文件之后,向所有接收方组播传输所述第二文件。
  3. 根据权利要求2所述的方法,其中,根据所述文件请求、确定第一接收方所需要的第一文件之后,还包括:
    将所述第一文件的信息发送到第一接收方;并根据所述第一文件的信息建立组播列表的第一文件表项,从而向所有接收方组播传输所述第一文件时能够根据所述第一文件表项的顺序传输所述第一文件;
    接收第一接收方响应于所述第一文件的信息所发送的第一文件下载请求;
    进入所述向所有接收方组播传输所述第一文件的步骤。
  4. 根据权利要求3所述的方法,其中,根据所述第二接收方发送的文件请求、确定所述第二接收方所需要的第二文件之后,还包括:
    将第二文件的信息发送到所述第二接收方,并根据第二文件信息更新组播列表的表项,从而能够根据更新后的组播列表向所有接收方组播第二文件。
  5. 根据权利要求4所述的方法,其中,根据第二文件信息更新组播列表的表项的步骤包括:
    当依据组播列表,发送方在后续组播过程中组播的文件包括全部或部分第二文件时,对应于第二文件中包括的、并且组播列表中尚未组播的表项所未包括的文件的信息,在组播列表中按照顺序增加组播表项;
    当依据第一组播列表,发送方在后续组播过程组播的文件不包括第二文件时,在组播列表中按照顺序增加第二文件信息所对应的第二文件表项。
  6. 一种下载文件的方法,用于接收方从发送方下载文件,包括如下步骤:
    接收发送方响应于本接收方或其它任意接收方的文件请求所组播传送的文件;
    当确定所述接收到的文件不是本接收方所请求的文件时,将文件丢弃;
    当确定所述接收到的文件是本接收方所请求的文件时,将文件保留。
  7. 根据权利要求6所述的方法,其中,接收发送方响应于本接收方或其它任意接收方的文件请求所传送的文件之前,还包括:
    接收发送方发送的本接收方所请求的文件信息;
    向发送方发送文件下载请求;并根据所述文件信息,建立接收文件的任务列表,从而在接收服务端响应于本接收方或其它任意接收方的文件请求所传送的文件之后能够根据所述任务列表判断其所接收到的文件是否为本接收方所请求的文件。
  8. 一种传送文件的装置,用于发送方向接收方传输文件,包括:
    第一文件请求接收模块:设置为接收接收方中的第一接收方发送的文件请求;
    第一文件查询模块:设置为根据所述文件请求,查询确定第一接收方所需要的第一文件;
    第一文件组播模块:设置为向所有接收方组播传输所述第一文件。
  9. 根据权利要求8所述的装置,其中,所述装置还包括:
    第二文件请求接收模块:设置为接收接收方中的第二接收方发送的文件请求;
    第二文件查询模块:设置为根据所述第二接收方发送的文件请求,确定所述第二接收方所需要的第二文件;
    第二文件组播模块:设置为向所有接收方组播传输所述第一文件之后,向所有接收方组播传输所述第二文件。
  10. 根据权利要求9所述的装置,其中,所述装置还包括:
    第一文件信息发送模块:设置为将所述第一文件的信息发送到第一接收方;
    第一文件表项建立模块:设置为根据所述第一文件的信息建立组播列表的第一文件表项,从而向所有接收方组播传输所述第一文件时能够根据所述第一文件表项的顺序传输所述第一文件;
    第一文件下载请求接收模块:设置为接收第一接收方响应于所述第一文件的信息所发送的第一文件下载请求。
  11. 根据权利要求10所述的装置,其中,所述装置还包括:
    第二文件信息发送模块:设置为将第二文件的信息发送到所述第二接收方;
    组播列表更新模块:设置为根据第二文件信息更新组播列表的表项,从而能够根据更新后的组播列表向所有接收方组播第二文件。
  12. 根据权利要求11所述的装置,其中,所述组播列表更新模块包括:
    第一更新单元:设置为当依据组播列表,发送方在后续组播过程中组播的文件包括全部或部分第二文件时,对应于第二文件中包括的、并且组播列表中尚未组播的表项所未包括的文件的信息,在组播列表中按照顺序增加组播表项;
    第二更新单元:设置为当依据第一组播列表,发送方在后续组播过程组播的文件不包括第二文件时,在组播列表中按照顺序增加第二文件信息所对应的第二文件表项。
  13. 一种下载文件的装置,用于接收方从发送方下载文件,包括:
    文件接收模块:设置为接收发送方响应于本接收方或其它任意接收方的文件请求所组播传送的文件;
    第一文件接收处理模块:设置为当确定所述接收到的文件不是本接收方所请求的文件时,将文件丢弃;
    第二文件接收处理模块:设置为当确定所述接收到的文件时本接收方所请求的文件时,将文件保留。
  14. 根据权利要求13所述的装置,其中,所述装置还包括:
    文件信息接收模块:设置为接收发送方发送的本接收方所请求的文件信息;
    下载请求发送模块:设置为向发送方发送文件下载请求;
    任务列表管理模块:设置为根据所述文件信息,建立接收文件的任务列表,从而在接收服务端响应于本接收方或其它任意接收方的文件请求所传送的文件之后能够根据所述任务列表判断其所接收到的文件是否为本接收方所请求的文件。
PCT/CN2015/078496 2014-11-24 2015-05-07 一种传送文件的方法及装置和下载文件的方法及装置 WO2016082469A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201410680805.5A CN105635233A (zh) 2014-11-24 2014-11-24 一种传送文件的方法及装置和下载文件的方法及装置
CN201410680805.5 2014-11-24

Publications (1)

Publication Number Publication Date
WO2016082469A1 true WO2016082469A1 (zh) 2016-06-02

Family

ID=56049709

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2015/078496 WO2016082469A1 (zh) 2014-11-24 2015-05-07 一种传送文件的方法及装置和下载文件的方法及装置

Country Status (2)

Country Link
CN (1) CN105635233A (zh)
WO (1) WO2016082469A1 (zh)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108199856A (zh) * 2017-12-01 2018-06-22 东软集团股份有限公司 数据发送方法、装置、计算机节点及存储介质

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1870599A (zh) * 2006-06-22 2006-11-29 杭州华为三康技术有限公司 一种分布式系统中处理程序加载请求的方法、装置及应用
CN101137972A (zh) * 2005-03-07 2008-03-05 英特尔公司 自适应组播文件传输协议
CN101383720A (zh) * 2007-09-05 2009-03-11 大唐移动通信设备有限公司 受控网元的软件更新方法及受控网元、操作维护中心
CN101951369A (zh) * 2010-09-14 2011-01-19 太仓市同维电子有限公司 基于自动发现的终端批量升级方法及其系统
EP2458780A1 (en) * 2010-11-26 2012-05-30 British Telecommunications Public Limited Company Cyclic data delivery using a multicast scheme

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101137972A (zh) * 2005-03-07 2008-03-05 英特尔公司 自适应组播文件传输协议
CN1870599A (zh) * 2006-06-22 2006-11-29 杭州华为三康技术有限公司 一种分布式系统中处理程序加载请求的方法、装置及应用
CN101383720A (zh) * 2007-09-05 2009-03-11 大唐移动通信设备有限公司 受控网元的软件更新方法及受控网元、操作维护中心
CN101951369A (zh) * 2010-09-14 2011-01-19 太仓市同维电子有限公司 基于自动发现的终端批量升级方法及其系统
EP2458780A1 (en) * 2010-11-26 2012-05-30 British Telecommunications Public Limited Company Cyclic data delivery using a multicast scheme

Also Published As

Publication number Publication date
CN105635233A (zh) 2016-06-01

Similar Documents

Publication Publication Date Title
US20150215400A1 (en) File Upload Method And System
JP3925188B2 (ja) アプリケーションレイヤ・マルチキャスト方法及び中継ノードシステム
US20070280236A1 (en) System and method for providing multicast service
US20090316573A1 (en) System and method for transmitting messages using a redundancy mechanism
JP2015510301A5 (zh)
KR101600060B1 (ko) 다중캐스트 네트워크에서 sctp를 위한 프로토콜 부스터
WO2015113291A1 (zh) 无线网络数据处理装置和无线网络系统
WO2011015020A1 (zh) 文件传输方法、系统及客户端
WO2016070566A1 (zh) 云终端升级方法、系统、网管服务器及代理服务器
JP6029805B2 (ja) 配信装置、配信プログラムおよび配信方法
WO2019100912A1 (zh) 数据分发方法以及分发服务器
WO2016082469A1 (zh) 一种传送文件的方法及装置和下载文件的方法及装置
CN106375100B (zh) 一种视频监控系统中组播实现方法及装置
CN106790609B (zh) 数据传输方法及装置
CN112217649B (zh) 终端设备管理方法、服务器及终端设备
US10348597B2 (en) Monitoring server, resolution server, request device, and node selection method
JP6467373B2 (ja) 通信チャネル制御装置、通信チャネル制御方法及び通信チャネル制御プログラム
CN102611675A (zh) 桌面共享管控系统及方法
JP2018516478A5 (zh)
JP2017037411A (ja) コンテンツ配信ネットワークの転送装置、サーバ装置及びプログラム
US20110167171A1 (en) System and method for network content delivery
JP2018042179A (ja) 通信装置及び通信方法
JP5549149B2 (ja) データ共有システム、データ共有方法、データ共有プログラム
JP5713499B2 (ja) 多地点配信方法及び多地点配信システム
CN110557728A (zh) 一种短信发送方法、装置及网络设备

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: 15863027

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: 15863027

Country of ref document: EP

Kind code of ref document: A1