[go: up one dir, main page]

CN103312792B - The method and system of file are read from external storage equipment - Google Patents

The method and system of file are read from external storage equipment Download PDF

Info

Publication number
CN103312792B
CN103312792B CN201310202179.4A CN201310202179A CN103312792B CN 103312792 B CN103312792 B CN 103312792B CN 201310202179 A CN201310202179 A CN 201310202179A CN 103312792 B CN103312792 B CN 103312792B
Authority
CN
China
Prior art keywords
file
terminal device
external storage
identification information
network
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
CN201310202179.4A
Other languages
Chinese (zh)
Other versions
CN103312792A (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.)
Shenzhen TCL New Technology Co Ltd
Original Assignee
Shenzhen TCL New Technology 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 Shenzhen TCL New Technology Co Ltd filed Critical Shenzhen TCL New Technology Co Ltd
Priority to CN201310202179.4A priority Critical patent/CN103312792B/en
Publication of CN103312792A publication Critical patent/CN103312792A/en
Application granted granted Critical
Publication of CN103312792B publication Critical patent/CN103312792B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

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

Abstract

本发明公开了一种从外接存储设备中读取文件的方法及系统。本发明通过外接存储设备从网络端下载文件的同时保存唯一标识该文件的标识信息以及下载地址,终端设备读取外接存储设备中的文件的标识信息以及下载地址,然后在读取该文件时按字节读取该文件,并实时记录当前读取位置,当终端设备读取外接存储设备所下载的该文件的过程中遇到外接存储设备不存在了或被拔掉的情况时,终端设备能够根据所述标识信息以及下载地址,在网络可用的情况下,从网络端下载并读取发生异常时所述文件当前读取位置之后的内容,继续读取完未读完的剩余文件内容,从而使文件读取过程不会中断,充分利用已读取资源、提高系统应用的稳定性和实用性。

The invention discloses a method and system for reading files from an external storage device. The present invention downloads a file from the network through an external storage device, and at the same time saves the identification information and the download address that uniquely identify the file, and the terminal device reads the identification information and the download address of the file in the external storage device, and then presses the Byte reads the file and records the current reading position in real time. When the terminal device encounters the external storage device does not exist or is unplugged during the process of reading the file downloaded by the external storage device, the terminal device can According to the identification information and the download address, if the network is available, download and read the content after the current reading position of the file when an exception occurs from the network side, and continue to read the remaining unfinished file content, thereby Make the file reading process uninterrupted, make full use of read resources, and improve the stability and practicality of system applications.

Description

从外接存储设备中读取文件的方法及系统Method and system for reading files from external storage device

技术领域technical field

本发明涉及到文件读取下载的技术领域,尤其涉及一种从外接存储设备中读取文件的方法及系统。The invention relates to the technical field of file reading and downloading, in particular to a method and system for reading files from an external storage device.

背景技术Background technique

现有的终端设备读取外接存储设备从网络端下载到的文件的过程中,由于终端设备是在读取文件之前检测文件是否存在,从而如果出现外接存储设备被拔出等终端设备与外接存储设备连接异常的情况时,终端设备则会进行报错提示处理,并且使读取过程终止。由于文件读取过程的中断,会造成已读取的资源被浪费,进而降低了系统应用的稳定性以及实用性。In the process of the existing terminal device reading the file downloaded from the network by the external storage device, since the terminal device detects whether the file exists before reading the file, if the external storage device is pulled out, etc., the terminal device and the external storage When the device connection is abnormal, the terminal device will report an error and prompt processing, and terminate the reading process. Due to the interruption of the file reading process, the read resources will be wasted, thereby reducing the stability and practicality of the system application.

发明内容Contents of the invention

本发明的主要目的为提供一种从外接存储设备中读取文件的方法及系统,旨在终端设备读取外接存储设备的文件过程中出现读取异常时可通过网络下载的方式解决读取过程中止的问题。The main purpose of the present invention is to provide a method and system for reading files from an external storage device, aiming at solving the reading process by downloading from the network when the terminal device reads files from the external storage device when abnormal reading occurs abort problem.

一种从外接存储设备中读取文件的方法,包括以下步骤:A method for reading files from an external storage device, comprising the following steps:

终端设备获取外接存储设备中文件的标识信息以及下载地址,该标识信息用于唯一标识所述文件,所述标识信息和下载地址存放在终端设备中;The terminal device acquires identification information and a download address of the file in the external storage device, the identification information is used to uniquely identify the file, and the identification information and the download address are stored in the terminal device;

终端设备读取所述外接存储设备中文件;The terminal device reads the files in the external storage device;

终端设备检测到外接存储设备与终端设备连接异常时,记录当前读取位置;When the terminal device detects that the connection between the external storage device and the terminal device is abnormal, it will record the current reading position;

终端设备根据所述标识信息和当前读取位置,从网络端读取所述文件的当前读取位置之后的所有内容。The terminal device reads all content after the current reading position of the file from the network side according to the identification information and the current reading position.

优选地,优选地,Preferably, preferably,

所述终端设备获取外接存储设备中文件的标识信息以及下载地址的步骤之前还包括:Before the terminal device obtains the identification information of the file in the external storage device and the download address, it also includes:

与外接存储设备相连的终端设备从网络端下载并保存所述文件至外接存储设备中,同时将文件对应的标识信息、下载地址保存在终端设备中。The terminal device connected to the external storage device downloads and saves the file from the network to the external storage device, and simultaneously saves the identification information and download address corresponding to the file in the terminal device.

优选地,所述标识信息至少包括所述文件的文件名以及下载地址;Preferably, the identification information includes at least the file name and download address of the file;

所述终端设备读取所述文件具体包括:所述终端设备按顺序逐字节读取所述文件。The terminal device reading the file specifically includes: the terminal device reading the file byte by byte in sequence.

优选地,所述终端设备根据所述标识信息和当前读取位置,从网络端读取所述文件的当前读取位置之后的所有内容的步骤具体包括:Preferably, the step of the terminal device reading all content after the current reading position of the file from the network side according to the identification information and the current reading position specifically includes:

终端设备根据所述标识信息在网络端查找所述文件;The terminal device searches for the file on the network side according to the identification information;

如存在所述文件,则根据所述当前读取位置,按顺序逐字节的从网络端边下载边读取所述文件当前读取位置之后的所有字节。If the file exists, according to the current reading position, all bytes after the current reading position of the file are read from the network end byte by byte in order while downloading.

优选地,所述终端设备根据所述标识信息在网络端查找所述文件的步骤具体包括:Preferably, the step of the terminal device searching for the file on the network side according to the identification information specifically includes:

终端设备判断是否与网络端连接;The terminal device judges whether it is connected to the network;

若否,则提示用户与网络端未连接;If not, it prompts that the user is not connected to the network;

若是,则根据所述标识信息在网络端查找所述文件;如不存在所述文件,则提示用户未找到文件。If so, search for the file on the network side according to the identification information; if the file does not exist, prompt the user that the file is not found.

本发明进一步的提供了一种从外接存储设备中读取文件的系统,包括终端设备、外接存储设备和网络端,所述外接存储设备与所述终端设备相连,所述终端设备与网络端相连,其中,The present invention further provides a system for reading files from an external storage device, including a terminal device, an external storage device and a network terminal, the external storage device is connected to the terminal device, and the terminal device is connected to the network terminal ,in,

所述终端设备,用于获取外接存储设备中文件的标识信息以及下载地址,该标识信息用于唯一标识所述文件,并存放所述标识信息和下载地址;读取所述文件;检测到外接存储设备与终端设备连接异常时,记录当前读取位置;根据所述标识信息和当前读取位置,从网络端读取所述文件的当前读取位置之后的所有内容;The terminal device is used to obtain the identification information and download address of the file in the external storage device, the identification information is used to uniquely identify the file, and store the identification information and download address; read the file; detect the external When the connection between the storage device and the terminal device is abnormal, record the current reading position; read all content after the current reading position of the file from the network according to the identification information and the current reading position;

所述外接存储设备,用于存储所述文件,以供所述终端设备读取;The external storage device is used to store the file for reading by the terminal device;

所述网络端,用于提供所述文件和与该文件对应的标识信息以及下载地址,以供与外接存储设备相连所述终端设备下载。The network end is configured to provide the file, identification information corresponding to the file, and a download address for downloading by the terminal device connected to the external storage device.

优选地,所述终端设备还用于:在与外接存储设备相连时,从网络端下载并保存所述文件至外接存储设备中,同时将文件对应的标识信息、下载地址链接保存在终端设备中。Preferably, the terminal device is further configured to: when connected to an external storage device, download and save the file from the network to the external storage device, and simultaneously save the identification information and download address link corresponding to the file in the terminal device .

优选地,所述标识信息包括所述文件的文件名以及下载地址;Preferably, the identification information includes the file name and download address of the file;

所述终端设备还用于,按顺序逐字节读取所述文件。The terminal device is further configured to read the file byte by byte in sequence.

优选地,所述终端设备还用于:Preferably, the terminal device is also used for:

根据所述标识信息在网络端查找所述文件;如存在所述文件,则根据所述当前读取位置,按顺序逐字节的从网络端边下载边读取所述文件当前读取位置之后的所有字节。Search for the file at the network end according to the identification information; if the file exists, read the file from the network end byte by byte in order after the current read position according to the current read position all bytes of the .

优选地,所述终端设备还用于:Preferably, the terminal device is also used for:

判断所述终端设备是否与网络端连接;若否,则提示用户与网络端未连接;若是,则根据所述标识信息在网络端查找所述文件;当未找到所述文件时,则提示用户未找到文件Judging whether the terminal device is connected to the network; if not, prompting the user that it is not connected to the network; if so, searching for the file on the network according to the identification information; when not finding the file, prompting the user file not found

本发明提供了一种从外接存储设备中读取文件的方法,该方法当终端设备按字节读取该外接存储设备所下载的该文件时,并实时记录当前读取位置,当终端设备读取外接存储设备所下载的该文件的过程中遇到外接存储设备与终端设备没有连接上或外接存储设备被拔掉的情况,即出现外接存储设备与终端设备连接异常时,终端设备能够根据所述标识信息,在网络可用的情况下,从网络端下载并读取发生异常时所述文件当前读取位置之后的字节,继续读取完未读完的剩余文件内容,由于本发明是在读取文件过程中检测外接存储设备是否与终端设备相连,在不相连的时候根据终端设备中保存的标识信息转由网络进行读取,从而使文件读取过程不会中断,充分利用已读取资源、提高系统应用的稳定性和实用性。此外,本发明进一步的提供了与上述方法对应的系统。The present invention provides a method for reading a file from an external storage device. When the terminal device reads the file downloaded by the external storage device by byte, the current reading position is recorded in real time. When the terminal device reads the file In the process of fetching the file downloaded from the external storage device, the external storage device and the terminal device are not connected or the external storage device is unplugged, that is, when the connection between the external storage device and the terminal device is abnormal, the terminal device can The above identification information, when the network is available, download and read the byte after the current reading position of the file when an exception occurs from the network, and continue to read the remaining file content that has not been read. In the process of reading files, it is detected whether the external storage device is connected to the terminal device. When it is not connected, it is transferred to the network for reading according to the identification information stored in the terminal device, so that the file reading process will not be interrupted and the read file can be fully utilized. Resources, improve the stability and practicality of system applications. In addition, the present invention further provides a system corresponding to the above method.

附图说明Description of drawings

图1是本发明的从外接存储设备中读取文件的方法实施例一的流程图;Fig. 1 is a flow chart of Embodiment 1 of the method for reading files from an external storage device according to the present invention;

图2是本发明的从外接存储设备中读取文件的方法实施例二的流程图;Fig. 2 is a flowchart of Embodiment 2 of the method for reading files from an external storage device according to the present invention;

图3是本发明的从外接存储设备中读取文件的方法实施例三的流程图;FIG. 3 is a flow chart of Embodiment 3 of the method for reading files from an external storage device according to the present invention;

图4是本发明的从外接存储设备中读取文件的方法实施例四的流程图;FIG. 4 is a flow chart of Embodiment 4 of the method for reading files from an external storage device according to the present invention;

图5是本发明的从外接存储设备中读取文件的系统一实施例的结构示意图。Fig. 5 is a schematic structural diagram of an embodiment of a system for reading files from an external storage device according to the present invention.

本发明目的的实现、功能特点及优点将结合实施例,参照附图做进一步说明。The realization of the purpose of the present invention, functional characteristics and advantages will be further described in conjunction with the embodiments and with reference to the accompanying drawings.

具体实施方式detailed description

应当理解,此处所描述的具体实施例仅仅用以解释本发明,并不用于限定本发明。It should be understood that the specific embodiments described here are only used to explain the present invention, not to limit the present invention.

本发明提供了一种从外接存储设备中读取文件的方法,该方法通过与外接存储设备相连的终端设备从网络端下载文件的同时保存唯一标识该文件的标识信息,在终端设备读取外接存储设备从网络端下载到的文件过程中,如果外接存储设备与终端设备没有连接上或在读取过程中外接存储设备被拔掉,终端设备并不会直接提示出错,而是会获取文件标识信息,里面包括了该文件的文件唯一标识等下载文件时所需的信息,在网络可用的情况下,可以从网络端继续读取未读完的剩余文件内容,从而使文件读取过程不会中断,充分利用已读取资源、提高系统应用的稳定性和实用性。The invention provides a method for reading a file from an external storage device. The method downloads the file from the network through a terminal device connected to the external storage device, and at the same time saves the identification information that uniquely identifies the file. When the storage device downloads files from the network, if the external storage device is not connected to the terminal device or the external storage device is unplugged during the reading process, the terminal device will not directly prompt an error, but will obtain the file ID Information, which includes the information required for downloading the file, such as the unique file identifier of the file. When the network is available, you can continue to read the unfinished remaining file content from the network side, so that the file reading process will not Interrupt, make full use of read resources, improve the stability and practicality of system applications.

参照附图1,图1是本发明的从外接存储设备中读取文件的方法实施例一的流程图。Referring to accompanying drawing 1, Fig. 1 is the flow chart of Embodiment 1 of the method for reading files from an external storage device according to the present invention.

本发明实施例一提出一种从外接存储设备中读取文件的方法,包括以下具体步骤:Embodiment 1 of the present invention proposes a method for reading files from an external storage device, including the following specific steps:

S11、终端设备获取外接存储设备中文件的标识信息以及下载地址,该标识信息用于唯一标识所述文件,所述标识信息和下载地址存放在终端设备中;S11. The terminal device obtains the identification information and download address of the file in the external storage device, the identification information is used to uniquely identify the file, and the identification information and download address are stored in the terminal device;

在步骤S11中,终端设备获取外接存储设备中的文件的标识信息,其中,外接存储设备中被获取的文件包含了可用于唯一识别该文件的标识信息,该标识信息可为生成的文件ID码或包括文件的文件名以及文件下载地址等文件属性,此外,终端设备还获取文件下载地址,该文件下载地址包括文件下载地址链接下载文件所必要的信息。获取文件标识信息用于唯一标识文件,还可以解决由于可能存在文件名相同时则无法仅用文件名进行区分进行处理的问题。In step S11, the terminal device acquires the identification information of the file in the external storage device, wherein the acquired file in the external storage device contains identification information that can be used to uniquely identify the file, and the identification information can be a generated file ID code Or include file attributes such as the file name of the file and the file download address. In addition, the terminal device also obtains the file download address, and the file download address includes the necessary information for downloading the file through the link of the file download address. Obtaining the file identification information is used to uniquely identify the file, and it can also solve the problem that when the file names may be the same, they cannot be distinguished only by the file name for processing.

此外,在终端设备读取外接存储设备中的文件可以是单个文件,也可以使多个文件组成的文件集合,该文件集合中的每个文件均包含了上述的标识信息。当终端设备读取外接存储设备中的文件集合时,终端设备获取到的标识信息中还包括该文件集合中的各个文件的标识信息组成的列表。In addition, the file in the external storage device read by the terminal device may be a single file, or a file collection composed of multiple files, and each file in the file collection includes the above-mentioned identification information. When the terminal device reads the file set in the external storage device, the identification information obtained by the terminal device also includes a list composed of identification information of each file in the file set.

S12、终端设备读取所述外接存储设备中文件;S12. The terminal device reads the file in the external storage device;

S13、终端设备检测到外接存储设备与终端设备连接异常时,记录当前读取位置;S13. When the terminal device detects that the connection between the external storage device and the terminal device is abnormal, record the current reading position;

在步骤S13中,终端设备在读取外接存储设备中的文件的过程中,会出现外接存储设备与终端设备出现未连接或者外接存储设备被拔出的情况,此时,终端设备无法继续从外接存储设备中读取该文件,此时,终端设备记录下当前读取文件所被读取的位置。或者,在读取多个文件时,当终端设备无法从外接存储设备中读取到上述文件集合中剩余的文件时,亦可以记录下所读取文件在列表中的位置和当前读取文件所被读取的位置。In step S13, during the process of the terminal device reading the files in the external storage device, the external storage device and the terminal device may not be connected or the external storage device is pulled out. The file is read from the storage device. At this time, the terminal device records the read position of the currently read file. Or, when reading multiple files, when the terminal device cannot read the remaining files in the above file collection from the external storage device, it can also record the position of the read file in the list and the location of the currently read file. The position to be read.

S14、终端设备根据所述标识信息和当前读取位置,从网络端读取所述文件的当前读取位置之后的所有内容。S14. The terminal device reads all content after the current reading position of the file from the network according to the identification information and the current reading position.

在步骤S14中,终端设备根据所记录下的该文件的读取位置后,并根据所获得的该文件的标识信息,在判断终端设备与网络端处于连接状态后,通过该标识信息并从所记录下的读取位置开始进行下载以及下载后的继续读取。或者,终端设备根据所记录下的文件集合中剩余文件的读取位置后,并根据所获得的标识信息的列表按顺序获得下一需要被读取文件的标识信息,在判断终端设于与网络端处于连接状态后,通过该标识信息并从所记录下的读取位置开始进行下载以及下载后的继续读取。In step S14, after the terminal device judges that the terminal device is connected to the network according to the recorded reading position of the file and the obtained identification information of the file, it passes the identification information and reads from the obtained The recorded reading position starts downloading and continues reading after downloading. Alternatively, the terminal device obtains the identification information of the next file to be read in order according to the read position of the remaining files in the recorded file collection and according to the list of the obtained identification information, and determines that the terminal is located in the network After the terminal is in the connected state, the identification information is used to start downloading from the recorded reading position and continue reading after downloading.

在本发明实施例中,终端设备在读取外接存储设备中文件前,把终端设备中保存的文件所对应的标识信息读取,终端设备在读取该文件的过程中按顺序逐字节读取文件,当读取过程中出现外接存储设备拔出等终端设备与外接存储设备连接异常的情况后,终端设备并不会直接提示出错,而是会记录对当前读取文件的当前读取位置,并根据所获取文件的标识信息,在网络可用的情况下,继续从网络中读取未读完的剩余文件内容,从而使文件读取过程不会中断,充分利用已读取资源、提高系统应用的稳定性和实用性。In the embodiment of the present invention, the terminal device reads the identification information corresponding to the file stored in the terminal device before reading the file in the external storage device, and the terminal device reads the file byte by byte in order during the process of reading the file. When reading the file, when the connection between the terminal device and the external storage device is abnormal such as the external storage device is pulled out during the reading process, the terminal device will not directly prompt an error, but will record the current reading position of the currently read file , and according to the identification information of the obtained file, when the network is available, continue to read the unfinished remaining file content from the network, so that the file reading process will not be interrupted, make full use of the read resources, improve the system App stability and usability.

在本发明实施例中,终端设备包括但不限于电脑、智能电视、智能手机、机顶盒等,外接存储设备包括但不限于SD卡、U盘、硬盘、软盘、光盘等具有存储功能的设置,网络端的连接通道包括但不限于网线、wifi 、3G、GSM、CDMA、蓝牙、红外等。In the embodiment of the present invention, terminal equipment includes but not limited to computers, smart TVs, smart phones, set-top boxes, etc., external storage devices include but not limited to SD cards, U disks, hard disks, floppy disks, optical disks, etc. Terminal connection channels include but are not limited to network cable, wifi, 3G, GSM, CDMA, bluetooth, infrared, etc.

参照图2,图2是本发明的从外接存储设备中读取文件的方法实施例二的流程图。Referring to FIG. 2 , FIG. 2 is a flow chart of Embodiment 2 of the method for reading files from an external storage device according to the present invention.

在本实施例中,所述步骤S11之前还包括步骤S10:与外接存储设备相连的终端设备从网络端下载并保存所述文件至外接存储设备中,同时将文件对应的标识信息、下载地址保存在终端设备中。In this embodiment, step S10 is also included before the step S11: the terminal device connected to the external storage device downloads and saves the file from the network to the external storage device, and at the same time saves the identification information and download address corresponding to the file in the terminal device.

在步骤S10中,在通过外接存储设备下载文件时,终端设备首先获取标识信息和下载地址,然后生成不重复的外接存储设备文件保存地址,将标识信息、下载地址以及文件保存地址关联保存至终端设备中(可以保存到数据库、文件或flash中等),然后下载文件并将该下载到的文件按照生成的文件保存地址保存至外接存储设备中,当终端设备读取外接存储设备中的文件时,首先获得保存在终端设备中文件的标识信息,这避免了外接存储设备与终端设备连接异常时,终端设备在读取外接存储设备中的文件时无法获得标识信息的问题。In step S10, when downloading a file through an external storage device, the terminal device first obtains the identification information and the download address, then generates a non-repetitive external storage device file storage address, and associates the identification information, download address and file storage address to the terminal device (can be saved to a database, file or flash, etc.), then download the file and save the downloaded file to the external storage device according to the generated file storage address. When the terminal device reads the file in the external storage device, First, the identification information of the file stored in the terminal device is obtained, which avoids the problem that the terminal device cannot obtain the identification information when reading the file in the external storage device when the connection between the external storage device and the terminal device is abnormal.

参照图3,图3是本发明的从外接存储设备中读取文件的方法实施例三的流程图。Referring to FIG. 3 , FIG. 3 is a flow chart of Embodiment 3 of the method for reading files from an external storage device according to the present invention.

本实施例在实施例一的基础上,所述步骤S14具体包括以下步骤:In this embodiment, on the basis of Embodiment 1, the step S14 specifically includes the following steps:

S141、终端设备根据所述标识信息在网络端查找所述文件;S141. The terminal device searches for the file on the network side according to the identification information;

S142、如存在所述文件,则根据所述当前读取位置,按顺序逐字节的从网络端边下载边读取所述文件当前读取位置之后的所有字节。S142. If the file exists, according to the current reading position, read all the bytes after the current reading position of the file from the network side while downloading byte by byte in sequence.

参照图4,图4是本发明的从外接存储设备中读取文件的方法实施例四的流程图。Referring to FIG. 4 , FIG. 4 is a flow chart of Embodiment 4 of the method for reading files from an external storage device according to the present invention.

本实施例在实施例一的基础上,所述步骤S141具体包括以下步骤:In this embodiment, on the basis of Embodiment 1, the step S141 specifically includes the following steps:

S1411、终端设备判断是否与网络端连接;S1411. The terminal device judges whether it is connected to the network;

S1412、若否,则提示用户与网络端未连接;S1412. If not, prompting that the user is not connected to the network;

S1413、若是,则根据所述标识信息在网络端查找所述文件;如不存在所述文件,则提示用户未找到文件。若存在,则执行步骤142。S1413. If yes, search for the file on the network side according to the identification information; if the file does not exist, prompt the user that the file is not found. If yes, go to step 142.

本发明进一步的提供了一种从外接存储设备中读取文件的系统。The present invention further provides a system for reading files from an external storage device.

参照图5,图5是本发明的从外接存储设备中读取文件的系统一实施例的结构示意图。Referring to FIG. 5 , FIG. 5 is a structural diagram of an embodiment of a system for reading files from an external storage device according to the present invention.

在本实施例中,一种从外接存储设备中读取文件的系统,包括终端设备1、外接存储设备2和网络端3,终端设备1与外接存储设备2连接,且终端设备1通过网络通道与网络端3相连,其中,In this embodiment, a system for reading files from an external storage device includes a terminal device 1, an external storage device 2, and a network terminal 3. The terminal device 1 is connected to the external storage device 2, and the terminal device 1 passes through a network channel Connected to network terminal 3, where,

所述终端设备1,用于保存、获取外接存储设备2中的文件的标识信息以及下载地址,该标识信息用于唯一标识所述文件,所述标识信息和下载地址存放在终端设备1中;读取所述文件;检测到外接存储设备2与终端设备1连接异常时,根据所述标识信息和当前读取位置,从网络端3读取所述文件的当前读取位置之后的所有内容,终端设备还用于生成外接存储设备不重复的文件保存地址;。The terminal device 1 is used to save and obtain the identification information and the download address of the file in the external storage device 2, the identification information is used to uniquely identify the file, and the identification information and the download address are stored in the terminal device 1; Read the file; when an abnormal connection between the external storage device 2 and the terminal device 1 is detected, according to the identification information and the current reading position, read all content after the current reading position of the file from the network terminal 3, The terminal device is also used to generate non-duplicate file storage addresses of the external storage device;.

终端设备1获取外接存储设备2中的文件的标识信息以及下载地址,该标识信息可为生成的文件ID码或包括文件的文件名以及文件下载地址等文件属性,下载地址包括文件下载地址链接等下载文件所必要的信息。The terminal device 1 obtains the identification information and download address of the file in the external storage device 2. The identification information can be a generated file ID code or file attributes including the file name and file download address of the file. The download address includes a file download address link, etc. Information necessary to download the file.

此外,在终端设备1读取外接存储设备2中的文件可以是单个文件,也可以是多个文件组成的文件集合,该文件集合中的每个文件均包含了上述的标识信息。当终端设备1读取外接存储设备2中的文件集合时,终端设备1获取到标识信息中还包括该文件集合中的各个文件的标识信息组成的列表。终端设备1在读取外接存储设备中的文件的过程中,会出现外接存储设备2与终端设备1出现未连接或者被拔出的情况,此时,终端设备1无法继续从外界存储设备2中读取该文件,此时,终端设备1记录下当前读取文件所被读取的位置。或者,当终端设备1无法读取到上述文件集合中剩余的文件时,亦可以记录下所读取文件在列表中的位置和当前读取文件所被读取的位置。In addition, the file in the external storage device 2 read by the terminal device 1 may be a single file or a file set composed of multiple files, and each file in the file set includes the above-mentioned identification information. When the terminal device 1 reads the file set in the external storage device 2 , the terminal device 1 obtains a list composed of identification information of each file in the file set in the identification information. During the process of terminal device 1 reading files in the external storage device, the external storage device 2 and terminal device 1 may be disconnected or pulled out. Read the file. At this time, the terminal device 1 records the read position of the currently read file. Or, when the terminal device 1 cannot read the rest of the files in the file collection, it can also record the position of the read file in the list and the read position of the currently read file.

终端设备1根据所记录下的该文件的读取位置后,并根据所获得的该文件的标识信息,在判断终端设于与网络端处于连接状态后,通过该标识信息并从所记录下的读取位置开始进行下载以及下载后的继续读取。或者,终端设备1根据所记录下的文件集合中剩余文件的读取位置后,并根据所获得的标识信息的列表按顺序获得下一需要被读取文件的标识信息,在判断终端设备与网络端处于连接状态后,通过该标识信息并从所记录下的读取位置开始进行下载以及下载后的继续读取。After the terminal device 1 judges that the terminal is set to be connected to the network according to the recorded reading position of the file, and according to the obtained identification information of the file, the terminal device 1 passes the identification information and reads from the recorded Read position to start downloading and continue reading after downloading. Alternatively, the terminal device 1 obtains the identification information of the next file to be read in sequence according to the read position of the remaining files in the recorded file collection and according to the list of the obtained identification information. After the terminal is in the connected state, the identification information is used to start downloading from the recorded reading position and continue reading after downloading.

所述外接存储设备2,用于存储所述文件,以供所述终端设备1获取;The external storage device 2 is configured to store the file for acquisition by the terminal device 1;

所述网络端3,用于提供所述文件和与该文件对应的标识信息和下载地址,以供与外接存储设备2相连的所述终端设备1下载。The network terminal 3 is configured to provide the file, identification information and download address corresponding to the file, for the terminal device 1 connected to the external storage device 2 to download.

在本发明实施例中,终端设备1在读取外接存储设备2中文件前,把文件所对应的标识信息获取,终端设备1在读取该文件的过程中按顺序逐字节读取文件,当读取过程中出现外接存储设备2拔出等终端设备与外接存储设备连接异常的情况后,终端设备1并不会直接提示出错,而是会记录对当前读取文件的当前读取位置,并根据所获取文件的标识信息,在网络可用的情况下,继续从网络端3读取未读完的剩余文件内容,从而使文件读取过程不会中断,充分利用已读取资源、提高系统应用的稳定性和实用性。In the embodiment of the present invention, before reading the file in the external storage device 2, the terminal device 1 obtains the identification information corresponding to the file, and the terminal device 1 reads the file byte by byte in order during the process of reading the file, When the connection between the terminal device and the external storage device is abnormal such as the external storage device 2 is pulled out during the reading process, the terminal device 1 will not directly prompt an error, but will record the current reading position of the currently read file. And according to the identification information of the acquired file, when the network is available, continue to read the unread remaining file content from the network terminal 3, so that the file reading process will not be interrupted, make full use of the read resources, improve the system App stability and usability.

在本发明实施例中,终端设备1包括但不限于电脑、智能电视、智能手机、机顶盒等,外接存储设备3包括但不限于SD卡、U盘、硬盘、软盘、光盘等具有存储功能的设置,网络端3的连接通道包括但不限于网线、wifi 、3G、GSM、CDMA、蓝牙、红外等。In the embodiment of the present invention, the terminal device 1 includes but not limited to computers, smart TVs, smart phones, set-top boxes, etc., and the external storage device 3 includes but not limited to SD cards, U disks, hard disks, floppy disks, optical disks, etc. , the connection channel of the network terminal 3 includes but not limited to network cable, wifi, 3G, GSM, CDMA, bluetooth, infrared, etc.

在进一步的实施过程中,所述终端设备1还用于:从网络端3下载所述文件和与该文件对应的所述标识信息。In a further implementation process, the terminal device 1 is further configured to: download the file and the identification information corresponding to the file from the network terminal 3 .

在进一步的实施过程中,所述终端设备1还用于:根据所述标识信息在网络端3查找所述文件;如存在所述文件,则根据所述当前读取位置,按顺序逐字节的从网络端3边下载边读取所述文件当前读取位置之后的所有字节。In a further implementation process, the terminal device 1 is also used to: search for the file at the network terminal 3 according to the identification information; if the file exists, perform byte-by-byte sequentially according to the current reading position Read all the bytes after the current read position of the file from the network terminal 3 while downloading.

在进一步的实施过程中,所述终端设备1还用于:判断所述终端设备1是否与网络端3连接;若否,则提示用户与网络端3未连接;若是,则根据所述标识信息在网络端3查找所述文件;当未找到所述文件时,则提示用户未找到文件。In a further implementation process, the terminal device 1 is also used to: determine whether the terminal device 1 is connected to the network terminal 3; if not, prompt the user that it is not connected to the network terminal 3; if so, then according to the identification information The file is searched at the network terminal 3; when the file is not found, the user is prompted that the file is not found.

相比现有技术的缺点和不足,本发明具有以下优点:本发明通过终端设备读取到外接存储设备上文件过程中,外接存储设备不存在或在读取过程中被拔掉,在网络可用的情况下,仍可以通过网络继续读取未读完的剩余文件内容,从而使文件读取过程不会中断,充分利用已读取资源、提高系统应用的稳定性和实用性。Compared with the disadvantages and deficiencies of the prior art, the present invention has the following advantages: in the process of reading the files on the external storage device through the terminal device, the external storage device does not exist or is unplugged during the reading process, and it is available on the network In the case of unreadable files, you can still continue to read the unfinished remaining file content through the network, so that the file reading process will not be interrupted, make full use of the read resources, and improve the stability and practicability of system applications.

以上所述仅为本发明的优选实施例,并非因此限制本发明的专利范围,凡是利用本发明说明书内容所作的等效变换,或直接或间接运用在其他相关的技术领域,均同理包括在本发明的专利保护范围内。The above is only a preferred embodiment of the present invention, and does not limit the patent scope of the present invention. All equivalent transformations made by using the contents of the description of the present invention, or directly or indirectly used in other related technical fields, are all included in the same principle. Within the scope of patent protection of the present invention.

Claims (10)

1. a kind of method that file is read from external storage equipment, it is characterised in that comprise the following steps:
Terminal device directly reads the identification information and download address of file in external storage equipment, and the identification information is used for only The one mark file, the identification information and download address are stored in terminal device;
Terminal device reads file in the external storage equipment;
When terminal device detects external storage equipment exception is connected with terminal device, current read position is recorded;
Terminal device reads the current read position of the file from network-side according to the identification information and current read position All the elements afterwards;
Wherein, the terminal device and the direct physical connection of both external storage equipments.
2. the method for file is read from external storage equipment as claimed in claim 1, it is characterised in that the terminal device Obtain in external storage equipment the identification information of file and the step of download address before also include:With external storage equipment phase Terminal device even is downloaded from network-side and preserves the file into external storage equipment, while the corresponding mark of file is believed Breath, download address are stored in terminal device.
3. the method for file is read from external storage equipment as claimed in claim 1, it is characterised in that the identification information Filename and download address at least including the file;
The terminal device reads the file and specifically included:The terminal device is byte-by-byte in order to read the file.
4. the method for file is read from external storage equipment as claimed in claim 1, it is characterised in that the terminal device It is all interior after the current read position for reading the file from network-side according to the identification information and current read position The step of appearance, specifically includes:
Terminal device searches the file according to the identification information in network-side;
The file as described in existing, then it is byte-by-byte in order to download side reading from network end edge according to the current read position All bytes after the file current read position.
5. the method for file is read from external storage equipment as claimed in claim 4, it is characterised in that the terminal device Specifically included according to the identification information the step of network-side searches the file:
Terminal device judges whether to be connected with network-side;
If it is not, then prompting user is not connected with network-side;
If so, then searching the file in network-side according to the identification information;Such as the file in the absence of as described in, then user is pointed out not Find file.
6. a kind of system that file is read from external storage equipment, it is characterised in that including terminal device, external storage equipment And network-side, the external storage equipment is connected with the terminal device, and the terminal device is connected with network-side, wherein,
The terminal device, identification information and download address for directly reading file in external storage equipment, the mark Information is used for file described in unique mark, and deposits the identification information and download address;Read the file;Detect external When storage device is connected exception with terminal device, current read position is recorded;According to the identification information and current read position, All the elements after the current read position for reading the file from network-side;
The external storage equipment, for storing the file, so that the terminal device is read;
The network-side, for providing the file and identification information corresponding with this document and download address, for it is outer The be connected terminal device of storage device is connect to download;
Wherein, the terminal device and the direct physical connection of both external storage equipments.
7. the system of file is read from external storage equipment as claimed in claim 6, it is characterised in that the terminal device It is additionally operable to:When being connected with external storage equipment, downloaded from network-side and preserve the file into external storage equipment, simultaneously The corresponding identification information of file, download address link are stored in terminal device.
8. the system of file is read from external storage equipment as claimed in claim 7, it is characterised in that the identification information Filename and download address including the file;
The terminal device is additionally operable to, byte-by-byte in order to read the file.
9. the system of file is read from external storage equipment as claimed in claim 8, it is characterised in that the terminal device It is additionally operable to:
The file is searched in network-side according to the identification information;The file as described in existing, then according to the current reading position Put, in order the byte-by-byte all bytes downloaded from network end edge after the file current read position is read on side.
10. the system of file is read from external storage equipment as claimed in claim 9, it is characterised in that the terminal is set It is standby to be additionally operable to:
Judge whether the terminal device is connected with network-side;If it is not, then prompting user is not connected with network-side;If so, then root According to the identification information file is searched in network-side;When not finding the file, then user is pointed out not find file.
CN201310202179.4A 2013-05-27 2013-05-27 The method and system of file are read from external storage equipment Expired - Fee Related CN103312792B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201310202179.4A CN103312792B (en) 2013-05-27 2013-05-27 The method and system of file are read from external storage equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201310202179.4A CN103312792B (en) 2013-05-27 2013-05-27 The method and system of file are read from external storage equipment

Publications (2)

Publication Number Publication Date
CN103312792A CN103312792A (en) 2013-09-18
CN103312792B true CN103312792B (en) 2017-09-15

Family

ID=49137570

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201310202179.4A Expired - Fee Related CN103312792B (en) 2013-05-27 2013-05-27 The method and system of file are read from external storage equipment

Country Status (1)

Country Link
CN (1) CN103312792B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103648053A (en) * 2013-12-23 2014-03-19 乐视致新电子科技(天津)有限公司 Method and device for connecting remote storage device in intelligent television
CN107360191B (en) * 2017-08-28 2021-02-02 腾讯科技(深圳)有限公司 File acquisition method and device and storage equipment

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1627290A (en) * 2003-12-12 2005-06-15 鸿富锦精密工业(深圳)有限公司 System and method for resuming data download
EP1276295B1 (en) * 2001-07-13 2009-04-08 Samsung Electronics Co., Ltd. Content downloading system
CN101459484A (en) * 2007-12-13 2009-06-17 财团法人工业技术研究院 System and method for recoverable data transfer
CN102271170A (en) * 2010-06-02 2011-12-07 深圳Tcl新技术有限公司 Method of providing server address for electronic product through mobile storage equipment

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1276295B1 (en) * 2001-07-13 2009-04-08 Samsung Electronics Co., Ltd. Content downloading system
CN1627290A (en) * 2003-12-12 2005-06-15 鸿富锦精密工业(深圳)有限公司 System and method for resuming data download
CN101459484A (en) * 2007-12-13 2009-06-17 财团法人工业技术研究院 System and method for recoverable data transfer
CN102271170A (en) * 2010-06-02 2011-12-07 深圳Tcl新技术有限公司 Method of providing server address for electronic product through mobile storage equipment

Also Published As

Publication number Publication date
CN103312792A (en) 2013-09-18

Similar Documents

Publication Publication Date Title
CN103176828B (en) Delete the method and device of application program Stub File
CN101198009B (en) Method for upgrading conference television terminal
CN102033758A (en) Firmware updating method of audio playing device and system using same
CN103176864B (en) Backup method and device based on android system and mobile terminal
CN103942058A (en) Embedded electronic equipment software updating method and system
CN106055363A (en) A method for identifying files and a mobile terminal
CN106293782A (en) A kind of method for upgrading system and terminal
WO2012089079A1 (en) Mobile terminal and method for processing test log thereof
CN105760183A (en) File processing method, device and communication system
CN103220352A (en) Terminal, server, file storage system and file storage method
CN105446975A (en) File packing method and device
WO2017000761A1 (en) Method and apparatus for extracting feature information of terminal device
CN105426761A (en) Identification method for illegal application and mobile terminal
CN103294951A (en) Malicious code sample extraction method and system based on document type bug
CN103312792B (en) The method and system of file are read from external storage equipment
CN105893068A (en) Offline upgrading method and device of intelligent equipment
JP2012070294A (en) Terminal application retrieval system
CN106909542A (en) The method and device of information erasing is carried out on the terminal device
CN103955372A (en) Method and device for detecting resources in mobile terminal
CN102637187B (en) Method and device for realizing electronic bookmark
US20160277477A1 (en) Information processing apparatus, terminal device, information processing method, and non-transitory computer readable recording medium
CN103778114B (en) File repair system and method
CN103020186B (en) A kind of document retrieval method based on embedded device, device and equipment
CN104572943B (en) Exempt from installation procedure method for cleaning and device
CN103886028B (en) Method and apparatus for copying files from storage device to advertisement machine

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
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: 20170915