WO2011130974A1 - 文件下载方法及系统 - Google Patents

文件下载方法及系统 Download PDF

Info

Publication number
WO2011130974A1
WO2011130974A1 PCT/CN2010/075821 CN2010075821W WO2011130974A1 WO 2011130974 A1 WO2011130974 A1 WO 2011130974A1 CN 2010075821 W CN2010075821 W CN 2010075821W WO 2011130974 A1 WO2011130974 A1 WO 2011130974A1
Authority
WO
WIPO (PCT)
Prior art keywords
terminal
module
file data
file
data
Prior art date
Application number
PCT/CN2010/075821
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 WO2011130974A1 publication Critical patent/WO2011130974A1/zh

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/957Browsing optimisation, e.g. caching or content distillation
    • G06F16/9574Browsing optimisation, e.g. caching or content distillation of access to content, e.g. by caching

Definitions

  • the present invention relates to the field of embedded technologies, and in particular to a file downloading method and system.
  • BACKGROUND With the rapid development of the mobile communication industry, in order to meet different customer needs, the built-in functions of the terminal are more and more diverse, for example, broadcasting television, viewing electronic maps, playing game games, and the like.
  • These expanded business functions and basic business functions are integrated into the mobile terminal software version and downloaded into the terminal product through the production or after-sales upgrade of the terminal product. Due to the increase of business functions, the capacity of the terminal software version has increased, and the time to download the software version has become longer and longer, which not only brings great pressure to the terminal equipment manufacturer's production and after-sales departments, but also affects the terminal equipment's time to market. And after-sales monthly cost.
  • the traditional terminal file download method is to physically connect the downloaded software to the non-volatile storage medium of the terminal through a USB (Universal Serial Bus) port to physically connect with other terminals (such as a computer).
  • a USB Universal Serial Bus
  • the serial download mode is characterized in that: the computer composes the terminal software to be downloaded into data frames (one data packet), and sends the data frame to the on-chip RAM (random access memory) of the terminal device through the USB port. Or temporarily stored in the off-chip RAM. After the data frame is sent, the data frame temporarily stored in the RAM is written into the Flash of the terminal device to complete the software version download.
  • the computer successfully transmits one frame of data, it will enter a state of waiting for feedback from the terminal device. After the terminal device successfully feeds back, the computer then initiates the next frame of data transmission.
  • the drawback of this conventional method is that the terminal device must wait until the data frame is sent before writing the version data to the terminal device Flash.
  • the traditional serial download method has the following drawbacks: The terminal device must wait until the data frame is sent and then write to the terminal device Flash. If the data frame capacity is relatively small, the number of times the terminal device feeds back the response to the computer increases, increasing the interaction time. In addition, if the data frame capacity is relatively large, the time for transmitting the data frame is too long, which increases the time for the terminal to wait for data.
  • a primary object of the present invention is to provide a file downloading method and system, which solves the problem that the existing downloading technology uses the received data and the dumped data serial execution mode, resulting in a slow file downloading speed.
  • a file downloading method including: receiving, the first terminal receiving file data sent by the second terminal, temporarily storing the data in a predetermined storage area of the memory of the first terminal; Determining, by the first terminal, whether the size of the data that is not dumped in the predetermined storage area reaches or exceeds a threshold, and if so, performing a dumping step, and performing the receiving step synchronously; otherwise, performing only the receiving step; the transferring step, storing the predetermined The data of the threshold size in the area is transferred to the non-volatile storage medium of the first terminal.
  • a file downloading system including: a first terminal and a second terminal, where the first terminal includes: a receiving module, configured to receive file data sent by the second terminal, temporarily a predetermined storage area of the memory stored in the first terminal; a monitoring module, configured to monitor whether the size of the un-deposited data in the predetermined storage area reaches or exceeds a threshold, and if so, triggers the dumping module; The data of the threshold size of the predetermined storage area is transferred to the non-volatile storage medium of the first terminal; the control module is configured to control the receiving module to synchronously receive the file data when the dumping module dumps the data; the second terminal includes: sending The module is configured to send file data to the first terminal.
  • the setting file data dump threshold is used, the timing of file data dumping is controlled, and the file data is synchronously received when the data is dumped, which solves the problem that the download speed is slow due to the serial download file in the prior art. , which improves the file download speed.
  • FIG. 2 is a flowchart of a file download method in accordance with a first embodiment of the present invention
  • FIG. 3 is a parallel diagram of data transfer and write flash in accordance with Embodiment 3 of the present invention
  • Figure 4 is a block diagram showing the structure of a file downloading system according to a fourth embodiment of the present invention
  • Figure 5 is a block diagram showing the structure of a terminal 10 according to a fourth embodiment of the present invention
  • Figure 6 is a block diagram showing the structure of a terminal 20 according to a fourth embodiment of the present invention.
  • FIG. 1 is a schematic diagram of a download system according to an embodiment of the present invention.
  • the terminal 10 is connected to a terminal 20 (for example, a PC or other embedded device) through a communication interface (for example, a USB port) between devices, and Downloading the file from the terminal 20, the terminal 10 temporarily stores the received file data in a predetermined storage area 101 of the memory during the downloading process, and the storage area is applied by the CPU of the device 10 when the download connection is established, and is used for temporary downloading.
  • a terminal 20 for example, a PC or other embedded device
  • a communication interface for example, a USB port
  • a file downloading method is provided, which is applied to an embedded terminal device to download a file from another device.
  • the method includes: Step S202: The terminal 10 receives the file data sent by the terminal 20 and temporarily stores it in the memory of the terminal 10. Step S204, the terminal 10 determines whether the size of the data that has not been dumped in the predetermined storage area 101 reaches or exceeds the threshold.
  • step S206 dumping the data of the threshold size in the predetermined storage area 101 to the non-volatile storage medium 102 of the terminal 10; Step S208, the terminal 10 continues to receive the file data sent by the terminal 20.
  • the related technology of the existing terminal download file uses the serial download mode, that is, the data reception and the data transfer cannot be performed synchronously. When the data is transferred (that is, written to the nonvolatile storage medium), the data reception is stopped, and the data is stopped.
  • the speed of the transfer is much lower than the speed of data reception, and the above-mentioned side provided by this embodiment
  • the method uses data reception and data transfer synchronization processing to receive file data during data dumping, which reduces the waiting time for receiving data, thereby improving the download speed of the terminal.
  • the terminal 10 and the terminal 20 before performing the above steps S202 to S206, the terminal 10 and the terminal 20 establish a data transmission connection, which may be an existing wired connection or a wireless connection based on various protocols, for example, the terminal 10 and the terminal 20 pass The USB port is connected, or the terminal 10 establishes a Bluetooth connection with the terminal 20.
  • the terminal 10 of the foregoing step S202 may not feed back the success status, but may not be limited to carrying the data in the file data.
  • the information ensures that the file data is not lost during transmission.
  • the threshold in the above step S204 may be controlled according to the size of the storage area 101, the receiving speed of the file data, and the speed of the file data being transferred to the non-volatile storage medium, by setting the threshold condition of the data dump. The timing and frequency of data dumping not only optimizes the synchronization of data reception and data dumping, but also minimizes the number of dumps on the premise of continuously receiving file data, thereby improving file download speed.
  • the foregoing terminal 10 may be, but not limited to, an embedded terminal (for example, a communication terminal, a PDA, an audio/video player, etc.), and the terminal 20 may be, but not limited to, a computer terminal or other embedded terminal, and the foregoing non-
  • the volatile storage medium 102 can be, but is not limited to, a flash memory or the like.
  • the terminal 10 interacts with the terminal 20 to know the size of the file to be downloaded. In order for the terminal 10 to judge whether the file download is successful or not.
  • the terminal 10 determines that the size of the data that has been dumped reaches the file size to be downloaded, the terminal 20 is notified that the file download is successful, thereby ensuring that the data downloaded by the terminal 10 is complete, and the terminal 20 is informed of the download of the terminal 10.
  • the status is known to be successful for the terminal 10 to download.
  • Embodiment 2 This embodiment provides a better file downloading method. The preferred method is based on the method provided in the first embodiment, and further includes: before the terminal 20 receives the file data, that is, at the terminal 10 and the terminal 20 In the process of establishing a connection for transmitting data, the terminal 10 interacts with the terminal 20, and can notify the terminal 20 of the size of the storage space of the predetermined storage area 101.
  • the size of the storage space of the storage area 101 determines whether or not to continue to transmit file data.
  • the size of the storage space of the storage area 101 determines whether or not to continue to transmit file data.
  • the terminal 10 of the present embodiment notifies the terminal 20 of the size of the storage space of the predetermined storage area 101, so that the terminal 20 can control the file data transmission/suspend transmission/resumption transmission according to the size of the storage space of the predetermined storage area 101, thereby ensuring the reservation.
  • the storage area 101 does not overflow.
  • the terminal 20 can monitor in real time whether the size of the sent file data reaches the storage space of the predetermined storage area 101, and if so, it indicates that the file data received by the terminal 10 side is full.
  • the storage area 101 at this time, the terminal 20 stops transmitting file data, otherwise, continues to send file data.
  • the terminal 20 waits for the indication information sent by the terminal 10 to resume the transmission. After receiving the indication information, it indicates that the terminal 10 has transferred all the previously received file data to the non-transfer. In the volatile storage medium, the file data can continue to be received, and the terminal 20 resumes the transmission of the file data.
  • the instruction of the terminal 10 restores the transmission of the file data, thereby avoiding that the predetermined storage area data of the terminal 10 does not overflow, and ensuring that the terminal 20 can continue to transmit the remaining file data, and the file data transmission is complete.
  • the terminal 10 transmits the above indication information to the terminal 20 in the following cases: a predetermined storage area
  • the data of 101 is dumped, and the size of the data that has been dumped does not reach the file size to be downloaded. If the terminal 10 determines that the size of the data that has been dumped reaches the file size to be downloaded, the file data is all downloaded, and the indication information that the download is successful should be sent to the terminal 20. In the embodiment, the terminal 10 determines the appropriate timing, and instructs the terminal 20 to continue to send the file data, so as to ensure that all the temporarily stored data in the predetermined storage area 101 are dumped, so that the received file data can overwrite the original data. File data. Embodiment 3 In conjunction with FIG.
  • the terminal 20 is specifically a computer, and the terminal 10 (hereinafter referred to as a terminal device) is connected to the computer through the USB port, and downloads files from the computer.
  • the downloaded file data is temporarily stored in the RAM of the terminal device, and the file data in the RAM is written into the flash memory of the terminal device.
  • FIG. 3 is a flowchart of parallel execution of data transmission and write flash according to the third embodiment of the present invention.
  • the method includes the following steps: Step S301: The terminal device is connected to the USB port of the computer to establish a physical connection with the computer; Step S302, the computer detects the access of the terminal device on the USB port in real time, controls the terminal device to enter the download mode, and reads the Flash driver.
  • Step S303 the terminal device turns on the USB read interrupt, waits for the arrival of the data
  • Step S304 the computer parses the terminal software to be downloaded, and obtains the file to be downloaded Size, and send the file size to the terminal through the USB port
  • Step S305 the computer continuously sends the file data to the terminal device RAM through the USB port, and records the number of bytes sent.
  • the terminal device determines whether the received data in the RAM reaches a threshold.
  • the received data threshold is 512 bytes, which is the smallest unit for writing data to the Flash.
  • step S306 is performed; in step S306, the computer side continues to send data to the terminal RAM, and the terminal side starts to write the temporarily stored data in the RAM to the flash.
  • the process of transmitting the USB data of the computer side to the RAM is synchronous with the process of writing the data of the terminal side to the Flash. Since the USB data transmission speed is much faster than the Flash write speed, it is guaranteed that the RAM is already stored when writing the Flash. To be written
  • Step S307 the computer side, if it is determined that the number of bytes of the transferred file is less than or equal to the size of the RAM storable space, and the file has been completely transferred, then step S309 is performed; otherwise, step S308 is performed, and the terminal side determines if all the data in the RAM is determined.
  • the feedback information indicates that all data sent by the computer to the terminal RAM has been written to the Flash.
  • the computer After receiving the feedback information, the computer performs step S305; the terminal side determines that the number of written flash bytes is the size of the RAM storable space, turns on the USB write interrupt, and sends feedback information to the computer. Feedback sending Then, step S305 is performed; step S309, on the computer side, all file data is completely transmitted, and the USB data transmission is ended; on the terminal side, all the file data has been written into the Flash, and the terminal device is restarted to determine that the download is successful.
  • FIG. 4 is a structural block diagram of a file downloading system according to Embodiment 4 of the present invention. As shown in FIG.
  • the system includes: a terminal 10 and a terminal 20, and the terminal 10 communicates with a terminal (such as a USB interface) and a terminal. 20 is connected, and the file is downloaded from the terminal 20.
  • the terminal 10 includes: a receiving module 103, a monitoring module 104, a dumping module 105, and a control module 106, wherein the receiving module 103 is configured to receive file data sent by the terminal 20 and temporarily store it in a predetermined storage area of the memory of the terminal 10;
  • the module 104 is configured to monitor whether the size of the data that is not dumped in the predetermined storage area reaches or exceeds a threshold, and if so, triggers the dumping module 105; the dumping module 105 is configured to use the data of the threshold size of the predetermined storage area.
  • the non-volatile storage medium is transferred to the terminal 10; the control module 106 is configured to control the receiving module 103 to synchronously receive the file data when the dumping module dumps the data.
  • the terminal 20 includes: a sending module 201, configured to send file data to the terminal 10.
  • the existing terminal downloads the file system, and the terminal 10 uses the serial download mode, that is, the data receiving and the data transfer cannot be performed synchronously, thereby causing the file downloading speed to be low.
  • the above system provided by the embodiment uses data receiving and data transfer.
  • the synchronization process is saved, which improves the download speed of the terminal.
  • the terminal 10 may further include: a first accumulating module 107, a first judging module 108, and a notification module 109, wherein the first accumulating module 107 is coupled to the dumping module 105 for accumulating The size of the data that has been dumped by the dumping module 107; the first determining module 108 is coupled to the first accumulating module 107 and the notification module 109, and is configured to determine in real time whether the size of the data that has been dumped by the first accumulating module 107 is The file size to be downloaded is reached. If yes, the notification module 109 is triggered. The notification module 109 is configured to notify the terminal 20 that the file download is successful.
  • the terminal 20 can know the download status of the terminal 10 in time, thereby causing the terminal 20 to determine subsequent operations (for example, disconnecting the terminals or transmitting the next file).
  • the terminal 10 may further include: an indication information sending module 110:
  • the terminal 20 may further include: a second accumulating module 202, a second judging module 203, and an indication information
  • the receiving module 204 wherein the indication information sending module 110 is configured to: when the data in the predetermined storage area is dumped, and the size of the data that has been dumped does not reach the file size to be downloaded, sending the indication to the second terminal to recover
  • the second accumulating module 202 is coupled to the sending module 201, and configured to accumulate the size of the file data that the sending module 201 has sent; the second judging module 203, the second accumulating module 202, and the sending module 201.
  • the method is configured to determine, in real time, whether the size of the file data that has been sent by the second accumulation module 202 reaches the storage space of the predetermined storage area, and if so, the trigger sending module 201 stops sending the file data; the indication information receiving module 204, coupled to the sending module 201, configured to receive the indication information from the terminal 10 indicating that the transmission is resumed, and trigger the sending module 201 to resume sending the file data.
  • the terminal 10 determines an appropriate timing to instruct the terminal 20 to continue transmitting file data, and the terminal 20 determines the transmission of the appropriate actual restored file data, thereby ensuring the reservation of the terminal 10 that has been filled with data.
  • the technical solution provided by the embodiment of the present invention controls the timing and frequency of data transfer by optimizing the receiving and transferring of file data concurrently, and setting the threshold condition of data dumping, which is not only optimized. Synchronous processing of data reception and data transfer, and under the premise of continuously receiving file data, the number of times of transfer is minimized, thereby improving the file download speed, improving the download speed of the terminal software, and extracting a suitable transmission suspension mechanism. , to avoid data overflow in the memory of the receiving terminal.
  • modules or steps of the present invention can be implemented by a general-purpose computing device, which can be concentrated on a single computing device or distributed over a network composed of multiple computing devices. Alternatively, they may be implemented by program code executable by the computing device, such that they may be stored in the storage device by the computing device and, in some cases, may be different from the order herein.
  • the steps shown or described are performed, or they are separately fabricated into individual integrated circuit modules, or a plurality of modules or steps are fabricated as a single integrated circuit module.
  • the invention is not limited to any specific combination of hardware and software.
  • the above is only the preferred embodiment of the present invention, and is not intended to limit the present invention, and various modifications and changes can be made to the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the scope of the present invention are intended to be included within the scope of the present invention.

Landscapes

  • Engineering & Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (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)

Description

文件下载方法及系统 技术领域 本发明涉及嵌入式技术领域,具体而言, 涉及一种文件下载方法及系统。 背景技术 随着移动通讯业的迅猛发展, 为满足不同的客户需求, 终端内置的功能 越来越多样化, 例如, 可以播放广播电视、 查看电子地图、 玩竟技游戏等等。 这些拓展的业务功能和基本业务功能集成在移动终端软件版本中, 通过终端 产品的生产或售后升级下载到终端产品内。 由于业务功能的增添, 终端软件 版本容量的增大, 下载软件版本的时间也越来越长, 不仅给终端设备制造商 生产和售后部门带来了巨大的压力, 还影响了终端设备的上市周期和售后月艮 务成本。 传统的终端文件下载方法是通过 USB ( Universal Serial Bus, 通用串行 总线) 端口与其他终端 (例如计算机) 进行物理连接, 以串行的方式将下载 的软件写入终端的非易失存储介质 (例如 Flash存储器) 中, 这是大多数终 端设备生产和售后下载所釆用的方法。 这种串行下载方式的特点是: 计算机 将待下载的终端软件组成数据帧 (一个个的数据包), 通过 USB端口将数据 帧发送到终端设备的片内 RAM ( Random Access Memory, 随机存储器) 或 片外 RAM中暂存, 待数据帧发送结束后, 再将暂存在 RAM 中的数据帧写 入终端设备的 Flash 中, 完成软件版本下载。 而且, 在下载过程中, 计算机 将一帧数据发送成功后, 会进入等待终端设备反馈的状态, 终端设备成功反 馈后, 计算机再发起下一帧数据传输。 这种传统方法的缺陷是终端设备必须 等到数据帧发送完毕, 才将版本数据写入终端设备 Flash。 传统的串行下载方式有如下缺陷: 终端设备必须等到数据帧发送完毕, 再写入终端设备 Flash。如果数据帧容量比较小, 终端设备向计算机反馈应答 的次数就会增多, 增加了交互时间。 另外, 如果数据帧容量比较大, 数据帧 发送完毕的时间就会过长, 增加了终端等待数据的时间。 因此, 现有技术釆 用串行下载的方式, 存在文件下载速度慢的问题。 发明内容 本发明的主要目的在于提供文件下载方法及系统, 以解决现有的下载技 术釆用接收数据和转存数据串行执行方式, 导致文件下载速度慢的问题。 才艮据本发明的一个方面, 提供了一种文件下载方法, 包括: 接收步骤, 第一终端接收第二终端发送的文件数据, 暂存至第一终端的内存的预定存储 区; 判断步骤, 第一终端判断预定存储区内未转存的数据的大小是否达到或 超过阈值, 如果是, 则执行转存步骤, 并且同步执行接收步骤, 否则, 只执 行接收步骤; 转存步骤, 将预定存储区中阈值大小的数据转存至第一终端的 非易失存储介质。 才艮据本发明的另一方面, 提供了一种文件下载系统, 包括: 第一终端和 第二终端, 其中, 第一终端包括: 接收模块, 用于接收第二终端发送的文件 数据, 暂存至第一终端的内存的预定存储区; 监测模块, 用于监测预定存储 区内未转存的数据的大小是否达到或超过阈值, 如果是, 则触发转存模块; 转存模块, 用于将预定存储区的阈值大小的数据转存至第一终端的非易失存 储介质; 控制模块, 用于在转存模块转存数据时, 控制接收模块同步接收文 件数据; 第二终端包括: 发送模块, 用于向第一终端发送文件数据。 通过本发明, 釆用设置文件数据转存阈值, 控制文件数据转存的时机, 以及在转存数据时同步接收文件数据, 解决了现有技术中釆用串行下载文件 导致下载速度慢的问题, 进而提高了文件下载速度。 附图说明 此处所说明的附图用来提供对本发明的进一步理解, 构成本申请的一部 分, 本发明的示意性实施例及其说明用于解释本发明, 并不构成对本发明的 不当限定。 在附图中: 图 1是 居本发明实施例的下载系统示意图; 图 2是 居本发明实施例一的文件下载方法流程图; 图 3是根据本发明实施例三的数据传输与写 Flash 并行执行的流程图; 图 4是才艮据本发明实施例四的文件下载系统结构框图; 图 5是才艮据本发明实施例四的终端 10的结构框图; 图 6是才艮据本发明实施例四的终端 20的结构框图。 具体实施方式 下文中将参考附图并结合实施例来详细说明本发明。 需要说明的是, 在 不冲突的情况下, 本申请中的实施例及实施例中的特征可以相互组合。 图 1是才艮据本发明实施例的下载系统示意图, 如图 1所示, 终端 10通 过设备间的通信接口 (例如 USB端口)与终端 20 (例如 PC机或其他嵌入式 设备) 连接, 并且从终端 20上下载文件, 终端 10在下载过程中, 将接收到 的文件数据暂存在内存的预定存储区 101 , 该存储区在建立下载连接时, 由 设备 10的 CPU申请, 专用于暂存下载的文件数据。终端 10再将预定存储区 101 中暂存的文件数据写入到终端 10的非易失存储介质中 102 (例如 Flash 存储器) 中。 实施例一 在本实施例中, 提供了一种文件下载方法, 应用于嵌入式终端设备从另 一设备上下载文件。 图 2是根据本发明实施例一的文件下载方法流程图, 结 合图 1和图 2, 该方法包括: 步骤 S202, 终端 10接收终端 20发送的文件数据, 暂存至所述终端 10 的内存的预定存储区 101 ; 步骤 S204, 终端 10判断预定存储区 101 内未转存的数据的大小是否达 到或超过阈值, 如果是, 则执行步骤 S206, 并且同步执行步骤 S208, 否则, 只执行步 4聚 S202; 步骤 S206, 将预定存储区 101 中阈值大小的数据转存至终端 10的非易 失存储介质 102; 步骤 S208, 终端 10继续接收终端 20发送的文件数据。 现有的终端下载文件的相关技术, 釆用串行下载方式, 即数据接收和数 据转存不能同步执行, 当数据转存 (即写入非易失存储介质) 时, 数据接收 停止, 而数据转存的速度远远低于数据接收的速度, 本实施例提供的上述方 法, 釆用数据接收和数据转存同步处理, 在数据转存的过程中, 仍接收文件 数据, 减少了接收数据的等待时间, 进而提高终端下载的速度。 在实施过程中, 在执行上述步骤 S202至 S206之前, 终端 10和终端 20 建立数据传输连接, 此连接可以是现有的基于各种协议的有线连接或无线连 接, 例如, 终端 10与终端 20通过 USB端口连接, 或终端 10与终端 20建立 蓝牙连接。 在实施过程中, 上述步骤 S202的终端 10接收文件数据时, 为提高接收 速度, 每次成功接收一帧数据后, 可以不向终端 20 反馈接收成功状态, 可 以但不限于在文件数据中携带校验信息保证文件数据在传输过程中不丢失。 在实施过程中, 上述步骤 S204 中的阈值可以根据存储区 101 的大小, 文件数据的接收速度以及文件数据转存至非易失存储介质的速度设置, 通过 设定数据转存的阈值条件, 控制数据转存的时机和频率, 从而不仅优化了数 据接收和数据转存的同步处理, 并且在不间断接收文件数据的前提下, 尽量 减少转存的次数, 从而提高文件下载速度。 需要说明的是: 上述终端 10 可以但不限于是嵌入式终端 (例如, 通信 终端、 PDA、 音 /视频播放器等), 上述终端 20可以但不限于是计算机终端或 其他嵌入式终端、 上述非易失存储介质 102可以但不限于是 Flash存储器等。 优选地, 在终端 10接收文件数据之前, 即在终端 10和终端 20建立传 输数据的连接的过程中, 终端 10与终端 20交互,获知待下载的文件的大小。 以便终端 10据此判断文件下载是否成功。 优选地, 如果终端 10 确定已经转存的数据的大小达到所述待下载的文 件大小, 则通知终端 20文件下载成功, 从而保证终端 10下载的数据完整, 并且使终端 20获知了终端 10的下载状态, 获知终端 10下载成功。 实施例二 本实施例提供了一种更优的文件下载方法, 该更优的方法在实施例一提 供的方法的基础上, 还包括: 终端 20接收文件数据之前, 即在终端 10和终端 20建立传输数据的连 接的过程中, 终端 10与终端 20交互, 可以将预定存储区域 101的存储空间 的大小通知给终端 20。 以便终端 20在发送文件数据的过程中, 可以 居预 定存储区域 101的存储空间的大小决定是否继续发送文件数据。 结合上述图 1 , 相关技术中, 如果终端 10待下载的文件的大小超过了预 定存储区 101的大小, 则存在一种隐患, 即预定存储区 101满的时候, 如果 终端 20继续发送文件数据, 则会出现预定存储区 101数据溢出, 可能导致 之前尚未转存的数据被新接收的数据覆盖, 从而导致文件数据丢失。 而本实 施例终端 10将预定存储区域 101的存储空间的大小通知给终端 20 , 使得终 端 20可以根据预定存储区域 101的存储空间的大小控制文件数据发送 /暂停 发送 /恢复发送, 从而保证了预定存储区 101不会出现溢出的情况。 优选地, 终端 20 在发送文件数据的过程中, 可以实时监测发送过的文 件数据的大小是否达到预定存储区 101的存储空间的大小, 如果是, 表明终 端 10侧接收的文件数据已经存满预定存储区 101 , 此时终端 20停止发送文 件数据, 否则, 继续发送文件数据。 通过上述技术手段, 避免终端 10 的预 定存储区 101出现数据溢出。 优选地, 在终端 20停止发送文件数据之后, 终端 20等待终端 10发送 的指示恢复发送的指示信息, 当接收到该指示信息后, 表明终端 10 已经将 之前接收到的文件数据全部转存至非易失存储介质中, 可以继续接收文件数 据, 此时终端 20恢复文件数据的发送。 通过上述技术手段, 居终端 10的 指示恢复文件数据的发送, 既避免了终端 10 的预定存储区数据不溢出, 又 保证了终端 20可以继续发送剩余文件数据, 文件数据发送完整。 优选地, 终端 10在以下情况向终端 20发送上述指示信息: 预定存储区
101的数据均被转存, 并且已经转存的数据的大小未达到待下载的文件大小。 如果终端 10 判断已经转存的数据的大小达到了待下载的文件大小, 则 说明文件数据全部下载, 此时应该向终端 20发送下载成功的指示信息。 本实施例通过上述技术手段, 终端 10确定合适的时机, 指示终端 20继 续发送文件数据, 保证了预定存储区 101 内所有暂存的数据都被转存, 使得 之后接收的文件数据可以覆盖原来的文件数据。 实施例三 结合图 1 , 在本实施例中, 终端 20具体为一台计算机, 终端 10 (以下 称之为终端设备) 通过 USB端口与计算机连接, 并从该计算机中下载文件, 下载的文件数据暂存于终端设备的 RAM中, 并将 RAM中的文件数据写入 终端设备的 Flash存储器中,图 3是根据本发明实施例三的数据传输与写 Flash 并行执行的流程图, 包括以下步骤: 步骤 S301 , 终端设备连接到计算机 USB端口上, 与计算机建立物理连 接; 步骤 S302, 计算机实时侦测 USB端口上终端设备的接入, 控制终端设 备进入下载模式, 并将 Flash驱动读入到终端设备的 RAM中, 运行 Flash驱 动程序, 与驱动建立数据连接; 步骤 S303 , 终端设备开启 USB读中断, 等待数据的到来; 步骤 S304, 计算机解析待下载的终端软件, 获取待下载的文件大小, 并 通过 USB端口将该文件大小发送至终端; 步骤 S305 ,计算机通过 USB端口将文件数据连续发送至终端设备 RAM, 并记录已发送字节数。 于此同时, 终端设备判断 RAM 中已接收数据是否达 到阈值, 在这里, 接收数据阈值为 512字节, 为 Flash写入数据的最小单元。 如果终端设备 RAM中接收的数据达到阈值, 执行步骤 S306; 步骤 S306, 计算机侧仍然继续向终端 RAM 发送数据, 终端侧开始将 RAM中暂存的数据写入 Flash。 此时, 计算机侧 USB数据发送到 RAM的过 程与终端侧数据写入 Flash的过程同步进行, 由于 USB数据传输速度远远大 于 Flash写速度, 所以, 可保证在写 Flash时, RAM中已经存储了待写入的
步骤 S307, 计算机侧, 如果判断已传文件字节数小于等于 RAM可存储 空间大小, 且文件已全部传输完毕, 那么执行步骤 S309; 否则, 执行步骤 S308, 终端侧, 如果判断 RAM中的数据全部写入 Flash, 并且写入的数据空 间小于或等于 RAM可存储空间,那么执行步骤 S309; 否则,执行步骤 S308; 步骤 S308, 计算机侧, 判断已发送字节数为 RAM可存储空间大小, 且 文件未全部传送完毕, 计算机停止发送数据, 等待终端的反馈信息, 反馈信 息表示终端侧已经将计算机发送至终端 RAM中的全部数据写入 Flash。计算 机收到反馈信息后,执行步骤 S305;终端侧,判断已写入 Flash字节数为 RAM 可存储空间大小, 开启 USB写中断, 向计算机发送反馈信息。 反馈信息发送 后, 执行步骤 S305; 步骤 S309, 计算机侧, 所有文件数据全部传输结束, 结束 USB数据传 输; 终端侧, 所有文件数据已全部写入 Flash, 重启终端设备,确定下载成功。 实施例四 图 4是 居本发明实施例四的文件下载系统结构框图, 如图 4所示, 该 系统包括: 终端 10和终端 20 , 终端 10通过设备间的通信接口 (例如 USB 接口) 与终端 20连接, 并且从终端 20上下载文件。 终端 10包括: 接收模块 103 , 监测模块 104 , 转存模块 105以及控制模 块 106 , 其中, 接收模块 103 , 用于接收终端 20发送的文件数据, 暂存至终 端 10的内存的预定存储区; 监测模块 104 , 用于监测预定存储区内未转存的 数据的大小是否达到或超过阈值, 如果是, 则触发转存模块 105; 转存模块 105 , 用于将预定存储区的上述阈值大小的数据转存至终端 10的非易失存储 介质; 控制模块 106 , 用于在转存模块转存 105数据时, 控制接收模块 103 同步接收文件数据。 终端 20包括: 发送模块 201 , 用于向终端 10发送文件数据。 现有的终端下载文件系统, 终端 10 釆用串行下载方式, 即数据接收和 数据转存不能同步执行, 从而导致文件下载速度低, 本实施例提供的上述系 统, 釆用数据接收和数据转存同步处理, 提高了终端下载的速度。 优选地, 如图 5所示, 终端 10还可以包括: 第一累计模块 107、 第一判 断模块 108 以及通知模块 109 , 其中, 第一累计模块 107 , 与转存模块 105 耦接, 用于累计转存模块 107 已经转存的数据的大小; 第一判断模块 108 , 与第一累计模块 107及通知模块 109耦接, 用于实时判断第一累计模块 107 累计的已经转存的数据的大小是否达到待下载的文件大小, 如果是, 则触发 通知模块 109; 通知模块 109 , 用于通知终端 20文件下载成功。 通过在终端 10中设置上述模块, 使终端 20及时地获知终端 10的下载 状态, 从而使终端 20 决定后续操作 (例如, 断开终端之间的连接或发送下 一个文件)。 优选地, 如图 6所示, 终端 10还可以包括: 指示信息发送模块 110: 终 端 20还可以包括: 第二累计模块 202、 第二判断模块 203、 以及指示信息接 收模块 204 , 其中, 指示信息发送模块 110 , 用于在预定存储区的数据均被转 存, 并且已经转存的数据的大小未达到待下载的文件大小的情况下, 发送指 示第二终端恢复发送文件数据的指示信息; 第二累计模块 202 , 与发送模块 201耦接, 用于累计发送模块 201 已经发送的文件数据的大小; 第二判断模 块 203 , 与第二累计模块 202和发送模块 201耦接, 用于实时判断第二累计 模块 202累计的已经发送过的文件数据的大小是否达到预定存储区的存储空 间的大小, 如果是, 则触发发送模块 201停止发送文件数据; 指示信息接收 模块 204 , 与发送模块 201耦接, 用于接收来自终端 10的指示恢复发送的指 示信息, 并触发发送模块 201恢复发送文件数据。 通过在终端 10和终端 20中设置上述模块, 终端 10确定合适的时机指 示终端 20继续发送文件数据,终端 20确定合适的实际恢复文件数据的发送, 从而保证了终端 10 的已经存满数据的预定存储区内所有暂存的数据都被转 存, 使得之后接收的文件数据可以覆盖原来的文件数据。 避免终端 10 的预 定存储区中出现数据溢出。 从以上的描述中, 可以看出, 本发明实施例提供的技术方案, 通过文件 数据的接收和转存并发执行, 以及设置数据转存的阈值条件, 控制数据转存 的时机和频率, 不仅优化了数据接收和数据转存的同步处理, 并且在不间断 接收文件数据的前提下, 尽量减少转存的次数, 从而提高文件下载速度提高 了终端软件下载速度, 并且, 釆取合适的传输暂停机制, 避免接收终端的内 存出现数据溢出。 显然, 本领域的技术人员应该明白, 上述的本发明的各模块或各步骤可 以用通用的计算装置来实现, 它们可以集中在单个的计算装置上, 或者分布 在多个计算装置所组成的网络上, 可选地, 它们可以用计算装置可执行的程 序代码来实现, 从而, 可以将它们存储在存储装置中由计算装置来执行, 并 且在某些情况下, 可以以不同于此处的顺序执行所示出或描述的步骤, 或者 将它们分别制作成各个集成电路模块, 或者将它们中的多个模块或步骤制作 成单个集成电路模块来实现。 这样, 本发明不限制于任何特定的硬件和软件 结合。 以上所述仅为本发明的优选实施例而已, 并不用于限制本发明, 对于本 领域的技术人员来说, 本发明可以有各种更改和变化。 凡在本发明的^"神和 原则之内, 所作的任何修改、 等同替换、 改进等, 均应包含在本发明的保护 范围之内。

Claims

权 利 要 求 书
1. 一种文件下载方法, 其特征在于, 包括:
接收步骤, 第一终端接收第二终端发送的文件数据, 暂存至所述第 一终端的内存的预定存储区;
判断步骤, 所述第一终端判断所述预定存储区内未转存的文件数据 的大小是否达到或超过阈值, 如果是, 则执行转存步骤, 并且同步执行 所述接收步 4聚, 否则, 只执行所述接收步 4聚;
转存步骤, 将所述预定存储区中所述阈值大小的文件数据转存至所 述第一终端的非易失存储介质。
2. 根据权利要求 1所述的方法, 其特征在于, 在所述第一终端接收文件数 据之前, 还包括: 所述第一终端从所述第二终端获取待下载的文件的大 小信息。
3. 根据权利要求 2所述的方法, 其特征在于, 还包括: 所述第一终端确定 已经转存的文件数据的大小达到所述待下载的文件大小, 则通知所述第 二终端文件下载成功。
4. 根据权利要求 1至 3任一项所述的方法, 其特征在于, 在所述第一终端 接收文件数据之前, 还包括: 所述第一终端将所述预定存储区域的存储 空间的大小通知给所述第二终端。
5. 根据权利要求 4所述的方法, 其特征在于, 还包括: 所述第二终端实时 监测发送过的文件数据的大小是否达到所述预定存储区的存储空间的大 小, 如果是, 则停止发送文件数据, 否则, 继续发送文件数据。
6. 居权利要求 5所述的方法, 其特征在于, 在所述第二终端停止发送文 件数据之后, 还包括:
所述第二终端接收来自所述第一终端的指示恢复发送的指示信息; 所述第二终端才艮据所述指示信息恢复文件数据的发送。
7. 居权利要求 6所述的方法, 其特征在于, 所述第一终端在以下情况向 所述第二终端发送所述指示信息:所述预定存储区的文件数据均被转存, 并且已经转存的文件数据的大小未达到所述待下载的文件大小。
8. —种文件下载系统, 其特征在于, 包括: 第一终端, 包括:
接收模块, 用于接收第二终端发送的文件数据, 并将所述文件数据 暂存至所述第一终端的内存的预定存储区;
监测模块, 用于监测所述预定存储区内未转存的文件数据的大小是 否达到或超过阈值, 如果是, 则触发转存模块;
所述转存模块, 用于将所述预定存储区的所述阈值大小的文件数据 转存至所述第一终端的非易失存储介质;
控制模块, 用于在所述转存模块转存文件数据时, 控制所述接收模 块同步接收文件数据;
所述第二终端, 包括:
发送模块, 用于向所述第一终端发送文件数据。
9. 根据权利要求 8所述的系统, 其特征在于, 所述第一终端还包括: 第一累计模块, 与所述转存模块耦接, 用于累计所述转存模块已经 转存的文件数据的大小;
第一判断模块, 与所述第一累计模块及通知模块耦接, 用于实时判 断所述第一累计模块累计的已经转存的文件数据的大小是否达到所述待 下载的文件大小, 如果是, 则触发通知模块;
通知模块, 用于通知所述第二终端文件下载成功。
10. 根据权利要求 8或 9所述的系统, 其特征在于,
所述第二终端还包括:
第二累计模块, 与所述发送模块耦接, 用于累计所述发送模块已经 发送的文件数据的大小;
第二判断模块, 与所述第二累计模块和所述发送模块耦接, 用于实 时判断所述第二累计模块累计的已经发送过的文件数据的大小是否达到 所述预定存储区的存储空间的大小, 如果是, 则触发所述发送模块停止 发送文件数据; 指示信息接收模块, 与所述发送模块耦接, 用于接收来自所述第一 终端的指示恢复发送的指示信息, 并触发所述发送模块恢复发送文件数 据;
所述第一终端还包括:
指示信息发送模块, 用于在所述预定存储区的数据均被转存, 并且 已经转存的数据的大小未达到所述待下载的文件大小的情况下, 发送指 示所述第二终端恢复发送文件数据的指示信息。
PCT/CN2010/075821 2010-04-21 2010-08-09 文件下载方法及系统 WO2011130974A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201010153769A CN101819561A (zh) 2010-04-21 2010-04-21 文件下载方法及系统
CN201010153769.9 2010-04-21

Publications (1)

Publication Number Publication Date
WO2011130974A1 true WO2011130974A1 (zh) 2011-10-27

Family

ID=42654671

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2010/075821 WO2011130974A1 (zh) 2010-04-21 2010-08-09 文件下载方法及系统

Country Status (2)

Country Link
CN (1) CN101819561A (zh)
WO (1) WO2011130974A1 (zh)

Families Citing this family (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102291462A (zh) * 2011-08-18 2011-12-21 中兴通讯股份有限公司 一种嵌入式浏览器下载数据的方法及装置
CN102394930B (zh) * 2011-11-02 2014-11-19 宇龙计算机通信科技(深圳)有限公司 移动终端、云服务器和数据处理方法
CN102750317B (zh) * 2012-05-02 2015-01-21 华为技术有限公司 数据持久化处理方法、装置及数据库系统
CN103514002A (zh) * 2012-06-26 2014-01-15 冠捷投资有限公司 具有韧体更新功能的电子装置及韧体更新方法
CN103605800A (zh) * 2013-12-06 2014-02-26 贝壳网际(北京)安全技术有限公司 文件处理方法及系统
CN104901920B (zh) * 2014-03-03 2018-06-01 联想(北京)有限公司 一种数据传输控制方法、装置及电子设备
CN104965671A (zh) * 2015-05-06 2015-10-07 深圳市金立通信设备有限公司 一种数据处理方法
CN104965796A (zh) * 2015-05-06 2015-10-07 深圳市金立通信设备有限公司 一种终端
CN105426123B (zh) * 2015-11-06 2018-07-03 安徽容知日新科技股份有限公司 数据管理方法、采集站及设备监测系统
CN105592143B (zh) * 2015-11-23 2019-09-06 新华三技术有限公司 一种文件加载方法及装置
CN107689996B (zh) * 2017-09-05 2020-07-31 武汉斗鱼网络科技有限公司 数据传输方法、装置及终端设备
CN108270786B (zh) * 2018-01-16 2021-02-26 Oppo广东移动通信有限公司 应用程序的权限管理方法、装置、存储介质及智能终端
CN112083884A (zh) * 2020-09-08 2020-12-15 久盈世纪(北京)科技有限公司 基于堡垒机的磁盘预警方法与设备
CN112416252A (zh) * 2020-11-25 2021-02-26 国网山西省电力公司晋中供电公司 一种继电保护装置打印数据感知存储的装置及方法
CN115277589B (zh) * 2022-06-30 2023-08-29 北京比特大陆科技有限公司 控制数据的发送方法、装置、设备及存储介质

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6341304B1 (en) * 1999-09-23 2002-01-22 International Business Machines Corporation Data acquisition and distribution processing system
CN101409593A (zh) * 2008-11-27 2009-04-15 中兴通讯股份有限公司 一种移动多媒体广播节目录制终端及方法
CN101635734A (zh) * 2008-07-22 2010-01-27 上海聚力传媒技术有限公司 非易失性存储介质上的下载数据存储管理方法及装置

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TW559702B (en) * 2000-08-31 2003-11-01 Nippon Telegraph & Telephone File transfer system, apparatus, method and computer readable medium storing file transfer program
CN101351026A (zh) * 2007-07-18 2009-01-21 中国移动通信集团公司 语音通话中用户实时转存数据的方法
CN100492367C (zh) * 2007-10-22 2009-05-27 深圳市迅雷网络技术有限公司 一种用于下载系统的提示装置及方法

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6341304B1 (en) * 1999-09-23 2002-01-22 International Business Machines Corporation Data acquisition and distribution processing system
CN101635734A (zh) * 2008-07-22 2010-01-27 上海聚力传媒技术有限公司 非易失性存储介质上的下载数据存储管理方法及装置
CN101409593A (zh) * 2008-11-27 2009-04-15 中兴通讯股份有限公司 一种移动多媒体广播节目录制终端及方法

Also Published As

Publication number Publication date
CN101819561A (zh) 2010-09-01

Similar Documents

Publication Publication Date Title
WO2011130974A1 (zh) 文件下载方法及系统
US11146362B2 (en) Internet of things data transmission method, device and system
JP3970282B2 (ja) Icカード、データ転送装置、データ転送方法及びデータ転送方法のプログラム
US20210011785A1 (en) Methods and apparatus for correcting out-of-order data transactions between processors
CN102739634B (zh) 主机设备基于通知挂起到客户端设备的通信链路
US9614944B2 (en) Command queuing for multimedia storage devices
US9772778B2 (en) Method and apparatus for adaptive data chunk transfer
WO2015051647A1 (zh) 一种固件的升级方法和系统、上位机和光模块
JP2007226777A5 (zh)
CN101276316B (zh) 用于控制主机设备与usb设备之间的通信的装置、方法及系统
KR20140098246A (ko) 다중 프로세서 시스템에서의 프로세서 간 프로토콜
WO2013124918A1 (ja) イニシエータ装置、ターゲット装置、通信システム、タイムアウト検出方法、およびタイムアウト検出プログラム
CN106886438A (zh) 基于fpga的系统远程更新方法
WO2016173128A1 (zh) 一种软件版本的下载方法及装置、存储介质
US7953822B2 (en) Method of and apparatus for downloading data
US8125936B2 (en) Low power data streaming
JPH11340986A (ja) 無線通信システムで用いられる装置とプログラム記録媒体
CN103650401A (zh) 一种移动终端内部通信方法
EP1531577B1 (en) Method for transmitting and processing command and data
EP2317435A1 (en) Electronic device and method for making upgraded firmware
CN111857303B (zh) 一种fpga复位方法、装置、系统和电子设备
US20090064129A1 (en) Suspend and resume mechanisms on a flash memory
WO2012000240A1 (zh) 下载数据的方法和终端设备
WO2011147113A1 (zh) 多媒体广播芯片断电方法、装置及数据卡
JP4069125B2 (ja) 伝送方法、送信装置、および送受信システム

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

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

Country of ref document: EP

Kind code of ref document: A1