WO2015184830A1 - Method and device for managing file in apparatus - Google Patents

Method and device for managing file in apparatus Download PDF

Info

Publication number
WO2015184830A1
WO2015184830A1 PCT/CN2015/071498 CN2015071498W WO2015184830A1 WO 2015184830 A1 WO2015184830 A1 WO 2015184830A1 CN 2015071498 W CN2015071498 W CN 2015071498W WO 2015184830 A1 WO2015184830 A1 WO 2015184830A1
Authority
WO
WIPO (PCT)
Prior art keywords
file
file information
subset
attribute
attributes
Prior art date
Application number
PCT/CN2015/071498
Other languages
French (fr)
Chinese (zh)
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 WO2015184830A1 publication Critical patent/WO2015184830A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor

Definitions

  • the present invention relates to file management technology, and more particularly to a method and apparatus for managing files in a device with an operating system installed.
  • file management software on the market usually provides file management related functions by reading the file index table to display the file tree structure. These functions usually include: displaying all the directories and files in any directory in the file tree structure, displaying the file attributes of the selected file, such as file size, modification date, type, etc., when the user starts global filtering based on file attributes, The file attributes in all files under the display file tree structure contain files set by the user for filtering keywords.
  • file management software on the market provides the above functions, it is necessary to read the file index table once or more. For some advanced functions of file management, such as global filtering based on file attributes, it is necessary to further read the file index table according to the file.
  • the location information of the file in the file, and the file attributes in the file header of the corresponding file on the memory are read. It is not difficult to see that when providing advanced functions of file management, the current file management software needs to access the file index table on one or more memories, and needs to access the file header on the memory for each file to obtain the file attributes. When it is necessary to continuously access hundreds or even thousands of files, since a large amount of memory access memory is required, and the access time of the memory is difficult to reduce by an order of magnitude, when the amount of access is increased by one or more The access time of the time-storage memory becomes a major obstacle to the efficient provision of advanced functions for file management, so that current file management software is often inefficient in providing advanced functions for file management, affecting the user experience of file management.
  • the embodiments of the present invention provide a method and an apparatus for managing files in a device, which can effectively improve the efficiency of implementing advanced functions of file management, thereby improving the user experience of file management.
  • a method of managing files in a device comprising:
  • the first statistical policy includes: a file set of the main file in the memory of the device, and a file attribute to be counted;
  • a file identifier FID that uniquely represents the file is generated, and a subset of file information containing the generated FID and the obtained file attributes is added to the main file information set.
  • the file attribute of the first statistical policy requirement statistics includes at least a file location.
  • the foregoing method further includes:
  • the second statistical policy includes: one or more slave file information sets in the memory of the device, and the file to be counted. Attributes;
  • the method further includes:
  • a subset of file information containing the generated FID and the obtained file attributes is added from the file information set.
  • the foregoing method further includes:
  • the foregoing method further includes:
  • the foregoing method further includes:
  • N slave file information sets where N is an integer whose value is the number of file attribute groups in the file attribute group sequence;
  • a device for managing files in a device comprising a reading unit and a new unit, wherein
  • the reading unit is configured to: obtain a file attribute that satisfies a preset first statistical policy in a file attribute of each file when the device is started; wherein the first statistical policy includes: a primary file information set in a memory of the device, Statistical file attributes;
  • the new unit is set to: for each file, generate a file identifier FID that uniquely represents the file, and add a file information subset containing the generated FID and the file attribute from the reading unit in the main file information set.
  • the file attribute of the first statistical policy requirement statistics includes at least a file location.
  • the reading unit is further configured to: obtain a file attribute that meets a preset second statistical policy in a file attribute of each file when the device is started; wherein the second statistical policy includes: in a memory of the device One or more file attributes from the file information set to be counted;
  • the new unit is further configured to: for each file, add a file information subset including the generated FID and the file attribute from the reading unit in the file information set.
  • the foregoing apparatus further includes: an updating unit, configured to: when detecting a broadcast message that notifies the file attribute update, determining the master file according to the updated content extracted from the broadcast message and the first statistical policy A subset of file information to be updated in the information set; updating the file attributes corresponding to the extracted updated content in the determined file information subset.
  • an updating unit configured to: when detecting a broadcast message that notifies the file attribute update, determining the master file according to the updated content extracted from the broadcast message and the first statistical policy A subset of file information to be updated in the information set; updating the file attributes corresponding to the extracted updated content in the determined file information subset.
  • the foregoing apparatus further includes an updating unit, configured to: when detecting a broadcast message notifying the file attribute update, according to the updated content extracted from the broadcast message, and the first statistical policy and/or the second statistic a policy, determining the master file information set and/or a subset of file information to be updated from the file information set; and updating the determined file information subset corresponding to the extracted update content.
  • an updating unit configured to: when detecting a broadcast message notifying the file attribute update, according to the updated content extracted from the broadcast message, and the first statistical policy and/or the second statistic a policy, determining the master file information set and/or a subset of file information to be updated from the file information set; and updating the determined file information subset corresponding to the extracted update content.
  • the above apparatus further includes a screening unit, configured to:
  • N slave file information sets where N is an integer whose value is the number of file attribute groups in the file attribute group sequence;
  • the file information subset determines whether the read file information subset contains the Mth group file attribute; if included, and M is equal to N, according to the current FID, the file information subset of the corresponding main file information set is read, And determining that the file corresponding to the current FID is the filtered file; if not, ending the processing for the current FID.
  • the embodiment of the invention further provides a computer readable storage medium storing program instructions, which can be implemented when the program instructions are executed.
  • the access time of the memory is at least one order of magnitude smaller than the access time of the accessor
  • the advanced functions of providing file management by reading the main file information set in the memory and the file information set are implemented. Based on the global filtering of file attributes, the efficiency of implementing advanced functions of file management is effectively improved, thereby improving the user experience of file management.
  • FIG. 1 is a flowchart of a method for managing a file in a device according to an embodiment of the present invention
  • FIG. 2 is a flowchart of implementing global filtering based on file attributes in a method according to an embodiment of the present invention
  • FIG. 3 is a schematic structural diagram of a device for managing a file in a device according to an embodiment of the present invention.
  • FIG. 1 is a flowchart of a method for managing a file in a device according to an embodiment of the present invention. As shown in FIG. 1 , the method includes:
  • Step 101 When the device starts, obtain a file attribute that satisfies a preset first statistical policy in a file attribute of each file.
  • the first statistical policy includes: a primary file information set in the memory of the device, and a file attribute to be counted.
  • the first statistical policy requires that at least the file location, such as file path information, be included in the file attributes of the statistics.
  • This step includes: when the device is started, according to the file index table provided by the operating system, reading each file attribute of each file in the memory of the device, and extracting the file attributes of the read file attributes that satisfy the first statistical policy. .
  • Step 102 For each file, generate a file identifier FID that uniquely represents the file, and add a file information subset containing the generated FID and the obtained file attribute in the main file information set.
  • the generating the FID may include: generating an FID by using an encoding method of sequential encoding.
  • adding a subset of file information including the generated FID and the obtained file attribute in the main file information set may be implemented by using database technology.
  • the master file information set preserves the tree structure of the file and the file attributes of each file, so efficient file management can be achieved through the master file information set.
  • the method of the embodiment of the present invention may further include the following steps: when the device is started, obtaining a file attribute that satisfies a preset second statistical policy in a file attribute of each file.
  • the second statistical policy includes: one or more slave file information sets in the memory of the device, and file attributes to be counted.
  • the method of the embodiment of the present invention may further include the step of: adding, for each file, a subset of the file information including the generated FID and the obtained file attribute in the file information set.
  • the file information subset of the main file information set includes the FID and the file.
  • the location, the subset of file information in the file information set 1 includes an FID, a file name, and an extension
  • the subset of file information in the file information set 2 includes an FID, a modification type, a time, and additional information from the file information set 3
  • the subset of file information includes the FID, the file type, and the name of the application that last opened the file.
  • the modification type of the file information subset in the file information set 2 may be newly created or modified, and the time may be the time corresponding to the newly created or modified file, and the additional information may be the main body of the newly created or modified file, for example, the main body may be System generation, Bluetooth transmission, or wireless LAN transmission; etc.; the file type in the file information subset from the file information set 3 may be a text file or a picture file.
  • the master file information set corresponding to the same file and the file information subset from the file information set contain the same FID, and therefore, they are related to each other through the FID.
  • the method of the present invention including the processing steps related to the file information set may further include the following two steps:
  • broadcast message notifying the file attribute update can be obtained from the operating system.
  • Determining the master file information set and/or the file information subset to be updated from the file information set in this step may include: determining, according to the file location in the extracted update content, the master file information set and/or including from the file information set A subset of the file information of the extracted file location.
  • the method in the embodiment of the present invention may further include a processing flow when the broadcast message of the newly added file/deleted file is detected.
  • the process flow is similar to the process flow when the method of the present invention detects the broadcast message of the notification file attribute update.
  • the person skilled in the art can easily implement the process of adding/removing related processes. I won't go into details here.
  • the common functions of file management can be implemented more efficiently by the method of the embodiment of the present invention, for example, displaying the file attributes of the selected file. It should be noted that when the file attribute of the selected file is displayed by the method of the present invention, more kinds of file attributes can be displayed efficiently.
  • the method of the embodiment of the present invention can also implement advanced functions of file management, such as global filtering based on file attributes, effectively improving the efficiency of providing advanced functions of file management.
  • the user sets the directory for filtering and one or more keywords for filtering.
  • the set keywords are: the time is within one day, the file type is a text file, and the extension is doc.
  • FIG. 2 is a flowchart of implementing global filtering based on file attributes in the embodiment of the present invention. As shown in FIG. 2, the method includes:
  • Step 201 When receiving the file filtering message, extract a file attribute group sequence containing one or more file attributes from the file filtering message.
  • each group of file attributes contains one or more file attributes in the same slave file information set.
  • the extracted file attribute group sequence is ⁇ (time: within one day), (file type: text file), (extension: doc) ⁇ , wherein the file attribute in the parentheses is A set of file attributes.
  • Step 202 According to the second set of file attributes in the sequence of file attribute groups, according to the second statistical policy Slightly determining the first slave file information set with the first set of file attributes; and so on until determining that the Nth file information set of the Nth group file attribute is determined; wherein N is an integer greater than or equal to 2, indicating The number of groupings of file attributes in the file attribute group sequence.
  • the first slave file information set is the slave file information set 2
  • the second slave file information set is the slave file information set 3
  • the third slave file information set is the slave file information set 1.
  • Step 203 Determine a subset of file information in the file information subset of the first file information set that includes the first group of file attributes; perform the following processing on each determined FID of the file information subset: setting the initial value of M 2, according to the current FID, read a corresponding subset of the file information in the Mth file information set, determine whether the read file information subset contains the M group file attribute; if included, and M is less than N, M plus 1 and returning execution according to the current FID, reading a subset of the file information in the corresponding Mth file information set, determining whether the read file information subset contains the Mth group file attribute; if included, and M is equal to N, according to the current FID, the file information subset of the corresponding main file information set is read, and the file corresponding to the current FID is determined to be the filtered file; if not, the processing for the current FID is ended.
  • step 203 by performing step 203, it is determined that the file attribute meets the corresponding one of the selected files of ⁇ (time: within one day), (file type: text file), (extension: doc) ⁇ .
  • a subset of the main file information set and the file information from the file information set It is easy for a person skilled in the art to display related information of the filtered file, such as the name of the file, the location of the file, and the like according to the file attributes in the determined subset of file information.
  • the related file attributes are placed in a file information set according to the second statistical policy, so that when the global filtering based on the file attributes is performed, the information from the file can be minimized.
  • Centralized access which improves access efficiency.
  • FIG. 3 is a schematic structural diagram of a device for managing a file in a device of the present invention. As shown in FIG. 3, the device of the present invention includes a reading unit and a new unit.
  • the reading unit is configured to obtain a file attribute of a file attribute of each file that satisfies a preset first statistical policy when the device is started.
  • the first statistical policy includes: a primary file information set in the memory of the device, and a file attribute to be counted.
  • the first statistical policy requires that the file attributes of the statistics include at least the file location, such as the file path. information.
  • a new unit is set to generate a file identifier FID uniquely representing the file for each file, and add a file information subset containing the generated FID and the file attribute from the reading unit in the main file information set.
  • the apparatus of the embodiment of the present invention further includes an updating unit, configured to: when detecting a broadcast message notifying the file attribute update, according to the updated content extracted from the broadcast message, and the first And a statistical policy, determining a subset of file information to be updated in the main file information set; and updating a file attribute corresponding to the extracted updated content in the determined file information subset.
  • the reading unit is further configured to: obtain a file attribute that satisfies a preset second statistical policy in a file attribute of each file when the device is started.
  • the second statistical policy includes: one or more slave file information sets in the memory of the device, and file attributes to be counted.
  • the new unit is also set to: for each file, a subset of file information containing the generated FID and file attributes from the reading unit is added from the file information set.
  • the apparatus of the present invention further includes an updating unit configured to: when detecting a broadcast message notifying the file attribute update, based on the updated content extracted from the broadcast message, and the first statistical policy and/or Or a second statistical policy, determining a master file information set and/or a file information subset to be updated from the file information set; and updating the file attributes corresponding to the extracted update content in the determined file information subset.
  • the apparatus of the present invention further includes a screening unit configured to:
  • a sequence of file attribute groups containing one or more file attributes is extracted therefrom; wherein each group of file attributes contains one or more statistics in the same a file attribute from the file information set;
  • N slave file information sets where N is an integer greater than or equal to 2, indicating the number of file attribute groups in the file attribute group sequence;
  • all or part of the steps of the above embodiments may also be implemented by using an integrated circuit. These steps may be separately fabricated into individual integrated circuit modules, or multiple modules or steps may be fabricated into a single integrated circuit module. achieve. Thus, the invention is not limited to any specific combination of hardware and software.
  • the devices/function modules/functional units in the above embodiments may be implemented by a general-purpose computing device, which may be centralized on a single computing device or distributed over a network of multiple computing devices.
  • each device/function module/functional unit in the above embodiment When each device/function module/functional unit in the above embodiment is implemented in the form of a software function module and sold or used as a stand-alone product, it can be stored in a computer readable storage medium.
  • the above mentioned computer readable storage medium may be a read only memory, a magnetic disk or an optical disk or the like.
  • the access time of the memory is at least one order of magnitude smaller than the access time of the accessor
  • the advanced functions of providing file management by reading the main file information set in the memory and the file information set are implemented. Based on the global filtering of file attributes, the efficiency of implementing advanced functions of file management is effectively improved, thereby improving the user experience of file management.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

A flow of a method for managing a file in an apparatus, and a device therefor. The method comprises: when an apparatus is started, acquiring a file attribute satisfying a preset first counting policy from file attributes of each file, wherein the first counting policy comprises a main file information set in a memory of the apparatus and file attributes to be counted; and for each file, generating a unique file identifier (FID) representing the file, and adding a file information subset containing the generated FID and the obtained file attribute into the main file information set.

Description

一种设备中管理文件的方法和装置Method and device for managing files in a device 技术领域Technical field
本发明涉及文件管理技术,尤指一种安装有操作系统的设备中管理文件的方法和装置。The present invention relates to file management technology, and more particularly to a method and apparatus for managing files in a device with an operating system installed.
背景技术Background technique
众所周知,安装有操作系统如微软公司的视窗(Windows)操作系统、谷歌公司的安卓(Android)操作系统和苹果公司的苹果手机操作系统(iOS)等的设备(为描述的方便,下文中将安装有操作系统的设备简称为设备)如移动终端、平板电脑和计算机等,广泛地应用于生产和生活的各个领域。在这些设备中,往往需要存储大量的文件,文件管理成为各种操作系统必须提供的基础功能。操作系统通常按照文件树型结构的方式管理和显示文件目录,其中,操作系统通过设备的存储器如硬盘上的文件索引表保存文件树形结构。为了提高文件管理的效率和灵活性,各种运行在操作系统上的文件管理软件纷纷推向市场。It is well known that there are operating systems such as Microsoft's Windows (Windows) operating system, Google's Android (Android) operating system and Apple's Apple mobile operating system (iOS) devices (for the convenience of description, the following will be installed Devices with operating systems are referred to as devices, such as mobile terminals, tablets, and computers, and are widely used in various fields of production and life. In these devices, it is often necessary to store a large number of files, and file management becomes a basic function that various operating systems must provide. The operating system usually manages and displays the file directory in a file tree structure in which the operating system saves the file tree structure through the device's memory, such as a file index table on the hard disk. In order to improve the efficiency and flexibility of file management, various file management software running on the operating system has been introduced to the market.
目前,市场上的文件管理软件通常通过读取文件索引表显示文件树型结构的方式提供文件管理的相关功能。这些功能通常包括:显示文件树型结构中的任意目录下的所有目录和文件,显示选定的文件的文件属性如文件大小、修改日期、类型等,当用户启动基于文件属性的全局筛选时,显示文件树型结构下的全部文件中文件属性包含有用户设置的用于筛选的关键字的文件。目前,市场上的文件管理软件提供上述功能时,均需要读取文件索引表一次或一次以上,对于一些文件管理的高级功能如基于文件属性的全局筛选,需要再根据读取出的文件索引表中的文件的位置信息,读取存储器上的相应的文件的文件头中的各文件属性。不难看出,在提供文件管理的高级功能时,目前的文件管理软件均需要访问一次或一次以上存储器上的文件索引表、且需要针对每个要获取文件属性的文件访问存储器上的文件头,当需要连续访问成百上千甚至更多文件时,由于需要大量甚至是海量访问存储器,且存储器的访问时间很难降低一个数量级,因此当访问量提高一个或一个以上数量 级时存储器的访问时间成为高效提供文件管理的高级功能的主要阻碍因素,这样目前的文件管理软件往往在提供文件管理的高级功能时效率不高,影响了文件管理的用户体验。Currently, file management software on the market usually provides file management related functions by reading the file index table to display the file tree structure. These functions usually include: displaying all the directories and files in any directory in the file tree structure, displaying the file attributes of the selected file, such as file size, modification date, type, etc., when the user starts global filtering based on file attributes, The file attributes in all files under the display file tree structure contain files set by the user for filtering keywords. At present, when the file management software on the market provides the above functions, it is necessary to read the file index table once or more. For some advanced functions of file management, such as global filtering based on file attributes, it is necessary to further read the file index table according to the file. The location information of the file in the file, and the file attributes in the file header of the corresponding file on the memory are read. It is not difficult to see that when providing advanced functions of file management, the current file management software needs to access the file index table on one or more memories, and needs to access the file header on the memory for each file to obtain the file attributes. When it is necessary to continuously access hundreds or even thousands of files, since a large amount of memory access memory is required, and the access time of the memory is difficult to reduce by an order of magnitude, when the amount of access is increased by one or more The access time of the time-storage memory becomes a major obstacle to the efficient provision of advanced functions for file management, so that current file management software is often inefficient in providing advanced functions for file management, affecting the user experience of file management.
发明内容Summary of the invention
本发明实施例提供了一种设备中管理文件的方法和装置,能够有效提高实现文件管理的高级功能的效率,从而能够较好地改善文件管理的用户体验。The embodiments of the present invention provide a method and an apparatus for managing files in a device, which can effectively improve the efficiency of implementing advanced functions of file management, thereby improving the user experience of file management.
一种设备中管理文件的方法,包括:A method of managing files in a device, comprising:
设备启动时,获取每个文件的文件属性中满足预先设置的第一统计策略的文件属性;其中,第一统计策略包括:设备的内存中的主文件信息集,要统计的文件属性;When the device is started, the file attributes of each file that meet the preset first statistical policy are obtained. The first statistical policy includes: a file set of the main file in the memory of the device, and a file attribute to be counted;
针对每个文件,生成唯一代表文件的文件标识FID,并在主文件信息集中增加包含有生成的FID和获得的文件属性的文件信息子集。For each file, a file identifier FID that uniquely represents the file is generated, and a subset of file information containing the generated FID and the obtained file attributes is added to the main file information set.
所述第一统计策略要求统计的文件属性中至少包括文件位置。The file attribute of the first statistical policy requirement statistics includes at least a file location.
可选地,上述方法还包括:Optionally, the foregoing method further includes:
设备启动时,获取每个文件的文件属性中满足预先设置的第二统计策略的文件属性;其中,第二统计策略包括:设备的内存中的一个或一个以上从文件信息集,要统计的文件属性;When the device is started, the file attribute of each file that meets the preset second statistical policy is obtained. The second statistical policy includes: one or more slave file information sets in the memory of the device, and the file to be counted. Attributes;
相应地,所述生成唯一代表文件的FID之后,上述方法还包括:Correspondingly, after the generating the FID that uniquely represents the file, the method further includes:
针对每个文件,在从文件信息集中增加包含有生成的FID和获得的文件属性的文件信息子集。For each file, a subset of file information containing the generated FID and the obtained file attributes is added from the file information set.
可选地,上述方法还包括:Optionally, the foregoing method further includes:
当检测到通知文件属性更新的广播消息时,根据从广播消息中提取出的更新内容、以及所述第一统计策略,确定所述主文件信息集中要更新的文件信息子集;Determining, according to the updated content extracted from the broadcast message, and the first statistical policy, a subset of the file information to be updated in the primary file information set when the broadcast message of the notification file attribute update is detected;
更新确定出的文件信息子集中与提取出的更新内容对应的文件属性。Updating the file attribute corresponding to the extracted update content in the determined file information subset.
可选地,上述方法还包括: Optionally, the foregoing method further includes:
当检测到通知文件属性更新的广播消息时,根据从广播消息中提取出的更新内容、以及所述第一统计策略和/或第二统计策略,确定所述主文件信息集和/或从文件信息集中要更新的文件信息子集;When the broadcast message notifying the file attribute update is detected, determining the master file information set and/or the slave file according to the update content extracted from the broadcast message, and the first statistical policy and/or the second statistical policy a subset of file information to be updated in the information set;
更新确定出的文件信息子集中与提取出的更新内容对应的文件属性。Updating the file attribute corresponding to the extracted update content in the determined file information subset.
可选地,上述方法还包括:Optionally, the foregoing method further includes:
当接收到文件筛选消息时,从其中提取出包含有一组或一组以上文件属性的文件属性组序列;其中,每组文件属性包含有一个或一个以上统计在同一个从文件信息集中的文件属性;When a file filtering message is received, a sequence of file attribute groups containing one or more file attributes is extracted therefrom; wherein each group of file attributes contains one or more file attributes in the same slave file information set ;
针对文件属性组序列中的第一组文件属性,根据第二统计策略确定统计有第一组文件属性的第一个从文件信息集;依此类推,直至确定统计有第N组文件属性的第N个从文件信息集;其中N为数值为文件属性组序列中的文件属性组的数量的整数;For the first set of file attributes in the sequence of file attribute groups, determining, according to the second statistical policy, the first set of secondary file information of the first set of file attributes; and so on, until determining that the statistics have the attribute of the Nth set of file attributes. N slave file information sets; where N is an integer whose value is the number of file attribute groups in the file attribute group sequence;
确定第一个从文件信息集的文件信息子集中包含有第一组文件属性的文件信息子集;针对每个确定出的文件信息子集中的FID:设置M初始值为2,根据当前的FID,读取对应的第M个从文件信息集中的文件信息子集,确定读取出的文件信息子集中是否包含第M组文件属性;如果包含,且M小于N,将M加1,并返回执行根据当前的FID,读取对应的第M个从文件信息集中的文件信息子集,确定读取出的文件信息子集中是否包含第M组文件属性;如果包含,且M等于N,根据当前的FID,读取对应的主文件信息集中的文件信息子集,并确定当前的FID对应的文件为筛选出的文件;如果不包含,结束针对当前的FID的处理。Determining a subset of file information of the first set of file information sets containing the first set of file attributes; for each determined file information subset FID: setting M initial value of 2, according to the current FID And reading the corresponding subset of file information in the Mth file information set, determining whether the read file information subset contains the Mth group file attribute; if included, and M is less than N, adding M to 1 and returning Performing, according to the current FID, reading a subset of the file information in the corresponding Mth file information set, and determining whether the read file information subset includes the Mth group file attribute; if included, and M is equal to N, according to the current The FID reads the subset of file information in the corresponding main file information set, and determines that the file corresponding to the current FID is the filtered file; if not, ends the processing for the current FID.
一种设备中管理文件的装置,该装置包括读取单元和新增单元,其中,A device for managing files in a device, the device comprising a reading unit and a new unit, wherein
读取单元,设置为:设备启动时,获取每个文件的文件属性中满足预先设置的第一统计策略的文件属性;其中,第一统计策略包括:设备的内存中的主文件信息集,要统计的文件属性;The reading unit is configured to: obtain a file attribute that satisfies a preset first statistical policy in a file attribute of each file when the device is started; wherein the first statistical policy includes: a primary file information set in a memory of the device, Statistical file attributes;
新增单元,设置为:针对每个文件,生成唯一代表文件的文件标识FID,并在主文件信息集中增加包含有生成的FID和来自读取单元的文件属性的文件信息子集。 The new unit is set to: for each file, generate a file identifier FID that uniquely represents the file, and add a file information subset containing the generated FID and the file attribute from the reading unit in the main file information set.
所述第一统计策略要求统计的文件属性中至少包括文件位置。The file attribute of the first statistical policy requirement statistics includes at least a file location.
可选地,所述读取单元还设置为:设备启动时,获取每个文件的文件属性中满足预先设置的第二统计策略的文件属性;其中,第二统计策略包括:设备的内存中的一个或一个以上从文件信息集,要统计的文件属性;Optionally, the reading unit is further configured to: obtain a file attribute that meets a preset second statistical policy in a file attribute of each file when the device is started; wherein the second statistical policy includes: in a memory of the device One or more file attributes from the file information set to be counted;
相应地,所述新增单元还设置为:针对每个文件,在从文件信息集中增加包含有生成的FID和来自所述读取单元的文件属性的文件信息子集。Accordingly, the new unit is further configured to: for each file, add a file information subset including the generated FID and the file attribute from the reading unit in the file information set.
可选地,上述装置还包括更新单元,设置为:当检测到通知文件属性更新的广播消息时,根据从广播消息中提取出的更新内容、以及所述第一统计策略,确定所述主文件信息集中要更新的文件信息子集;更新确定出的文件信息子集中与提取出的更新内容对应的文件属性。Optionally, the foregoing apparatus further includes: an updating unit, configured to: when detecting a broadcast message that notifies the file attribute update, determining the master file according to the updated content extracted from the broadcast message and the first statistical policy A subset of file information to be updated in the information set; updating the file attributes corresponding to the extracted updated content in the determined file information subset.
可选地,上述装置还包括更新单元,设置为:当检测到通知文件属性更新的广播消息时,根据从广播消息中提取出的更新内容、以及所述第一统计策略和/或第二统计策略,确定所述主文件信息集和/或从文件信息集中要更新的文件信息子集;更新确定出的文件信息子集中与提取出的更新内容对应的文件属性。Optionally, the foregoing apparatus further includes an updating unit, configured to: when detecting a broadcast message notifying the file attribute update, according to the updated content extracted from the broadcast message, and the first statistical policy and/or the second statistic a policy, determining the master file information set and/or a subset of file information to be updated from the file information set; and updating the determined file information subset corresponding to the extracted update content.
可选地,上述装置还包括筛选单元,设置为:Optionally, the above apparatus further includes a screening unit, configured to:
当接收到文件筛选消息时,从其中提取出包含有一组或一组以上文件属性的文件属性组序列;其中,每组文件属性包含有一个或一个以上统计在同一个从文件信息集中的文件属性;When a file filtering message is received, a sequence of file attribute groups containing one or more file attributes is extracted therefrom; wherein each group of file attributes contains one or more file attributes in the same slave file information set ;
针对文件属性组序列中的第一组文件属性,根据第二统计策略确定统计有第一组文件属性的第一个从文件信息集;依此类推,直至确定统计有第N组文件属性的第N个从文件信息集;其中N为数值为文件属性组序列中的文件属性组的数量的整数;For the first set of file attributes in the sequence of file attribute groups, determining, according to the second statistical policy, the first set of secondary file information of the first set of file attributes; and so on, until determining that the statistics have the attribute of the Nth set of file attributes. N slave file information sets; where N is an integer whose value is the number of file attribute groups in the file attribute group sequence;
确定第一个从文件信息集的文件信息子集中包含有第一组文件属性的文件信息子集;针对每个确定出的文件信息子集中的FID:设置M初始值为2,根据当前的FID,读取对应的第M个从文件信息集中的文件信息子集,确定读取出的文件信息子集中是否包含第M组文件属性;如果包含,且M小于N,将M加1,并返回执行根据当前的FID,读取对应的第M个从文件信息集中 的文件信息子集,确定读取出的文件信息子集中是否包含第M组文件属性;如果包含,且M等于N,根据当前的FID,读取对应的主文件信息集中的文件信息子集,并确定当前的FID对应的文件为筛选出的文件;如果不包含,结束针对当前的FID的处理。Determining a subset of file information of the first set of file information sets containing the first set of file attributes; for each determined file information subset FID: setting M initial value of 2, according to the current FID And reading the corresponding subset of file information in the Mth file information set, determining whether the read file information subset contains the Mth group file attribute; if included, and M is less than N, adding M to 1 and returning Execute according to the current FID, read the corresponding Mth file information set The file information subset determines whether the read file information subset contains the Mth group file attribute; if included, and M is equal to N, according to the current FID, the file information subset of the corresponding main file information set is read, And determining that the file corresponding to the current FID is the filtered file; if not, ending the processing for the current FID.
本发明实施例还提供一种计算机可读存储介质,存储有程序指令,当该程序指令被执行时可实现上述方法。The embodiment of the invention further provides a computer readable storage medium storing program instructions, which can be implemented when the program instructions are executed.
本发明实施例中,由于内存的访问时间比存取器的访问时间至少小于一个数量级,这样实现了通过读取内存中的主文件信息集和从文件信息集的方式提供文件管理的高级功能如基于文件属性的全局筛选,从而有效地提高了实现文件管理的高级功能的效率,从而较好地改善了文件管理的用户体验。In the embodiment of the present invention, since the access time of the memory is at least one order of magnitude smaller than the access time of the accessor, the advanced functions of providing file management by reading the main file information set in the memory and the file information set are implemented. Based on the global filtering of file attributes, the efficiency of implementing advanced functions of file management is effectively improved, thereby improving the user experience of file management.
本发明的其它特征和优点将在随后的说明书中阐述,并且,部分地从说明书中变得显而易见,或者通过实施本发明而了解。本发明的目的和其他优点可通过在说明书、权利要求书以及附图中所特别指出的结构来实现和获得。Other features and advantages of the invention will be set forth in the description which follows, The objectives and other advantages of the invention may be realized and obtained by means of the structure particularly pointed in the appended claims.
附图概述BRIEF abstract
附图用来提供对本发明技术方案的进一步理解,并且构成说明书的一部分,与本申请的实施例一起用于解释本发明的技术方案,并不构成对本发明技术方案的限制。The drawings are used to provide a further understanding of the technical solutions of the present invention, and constitute a part of the specification, which together with the embodiments of the present application are used to explain the technical solutions of the present invention, and do not constitute a limitation of the technical solutions of the present invention.
图1为本发明实施例的设备中管理文件的方法的流程图;1 is a flowchart of a method for managing a file in a device according to an embodiment of the present invention;
图2为本发明实施例的方法中实现基于文件属性的全局筛选的流程图;2 is a flowchart of implementing global filtering based on file attributes in a method according to an embodiment of the present invention;
图3为本发明实施例的设备中管理文件的装置的组成结构示意图。FIG. 3 is a schematic structural diagram of a device for managing a file in a device according to an embodiment of the present invention.
本发明的较佳实施方式Preferred embodiment of the invention
下文中将结合附图对本发明的实施例进行详细说明。需要说明的是,在不冲突的情况下,本申请中的实施例及实施例中的特征可以相互任意组合。Embodiments of the present invention will be described in detail below with reference to the accompanying drawings. It should be noted that, in the case of no conflict, the features in the embodiments and the embodiments in the present application may be arbitrarily combined with each other.
在附图的流程图示出的步骤可以在诸如一组计算机可执行指令的计算机系统中执行。并且,虽然在流程图中示出了逻辑顺序,但是在某些情况下,可以以不同于此处的顺序执行所示出或描述的步骤。 The steps illustrated in the flowchart of the figures may be executed in a computer system such as a set of computer executable instructions. Also, although logical sequences are shown in the flowcharts, in some cases the steps shown or described may be performed in a different order than the ones described herein.
图1为本发明实施例的设备中管理文件的方法的流程图,如图1所示,包括:FIG. 1 is a flowchart of a method for managing a file in a device according to an embodiment of the present invention. As shown in FIG. 1 , the method includes:
步骤101:设备启动时,获取每个文件的文件属性中满足预先设置的第一统计策略的文件属性。Step 101: When the device starts, obtain a file attribute that satisfies a preset first statistical policy in a file attribute of each file.
其中,第一统计策略包括:设备的内存中的主文件信息集,要统计的文件属性。第一统计策略要求统计的文件属性中至少包括文件位置如文件路径信息。The first statistical policy includes: a primary file information set in the memory of the device, and a file attribute to be counted. The first statistical policy requires that at least the file location, such as file path information, be included in the file attributes of the statistics.
本步骤包括:设备启动时,根据操作系统提供的文件索引表,读取设备的存储器中的每个文件的各文件属性,并提取读取出的各文件属性中满足第一统计策略的文件属性。This step includes: when the device is started, according to the file index table provided by the operating system, reading each file attribute of each file in the memory of the device, and extracting the file attributes of the read file attributes that satisfy the first statistical policy. .
步骤102:针对每个文件,生成唯一代表文件的文件标识FID,并在主文件信息集中增加包含有生成的FID和获得的文件属性的文件信息子集。Step 102: For each file, generate a file identifier FID that uniquely represents the file, and add a file information subset containing the generated FID and the obtained file attribute in the main file information set.
其中,生成FID可以包括:通过顺序编码的编码方式生成FID。The generating the FID may include: generating an FID by using an encoding method of sequential encoding.
其中,在主文件信息集中增加包含有生成的FID和获得的文件属性的文件信息子集,可以采用数据库技术来实现。Wherein, adding a subset of file information including the generated FID and the obtained file attribute in the main file information set may be implemented by using database technology.
在本发明的一个实施例中,主文件信息集保存了文件的树形结构和各文件的文件属性,因此通过主文件信息集可以实现高效的文件管理。In one embodiment of the present invention, the master file information set preserves the tree structure of the file and the file attributes of each file, so efficient file management can be achieved through the master file information set.
可选地,Optionally,
本发明实施例的方法还可以包括如下步骤:设备启动时,获取每个文件的文件属性中满足预先设置的第二统计策略的文件属性。The method of the embodiment of the present invention may further include the following steps: when the device is started, obtaining a file attribute that satisfies a preset second statistical policy in a file attribute of each file.
其中,第二统计策略包括:设备的内存中的一个或一个以上从文件信息集,要统计的文件属性。The second statistical policy includes: one or more slave file information sets in the memory of the device, and file attributes to be counted.
相应地,Correspondingly,
生成唯一代表文件的FID之后,本发明实施例的方法还可以包括如下步骤:针对每个文件,在从文件信息集中增加包含有生成的FID和获得的文件属性的文件信息子集。After the FID of the unique representative file is generated, the method of the embodiment of the present invention may further include the step of: adding, for each file, a subset of the file information including the generated FID and the obtained file attribute in the file information set.
在本发明实施例1中,主文件信息集中的文件信息子集包括FID和文件 位置,从文件信息集1中的文件信息子集包括FID、文件名称和扩展名,从文件信息集2中的文件信息子集包括FID、修改类型、时间和附加信息,从文件信息集3中的文件信息子集包括FID、文件类型和上次打开文件的应用程序的名称。In Embodiment 1 of the present invention, the file information subset of the main file information set includes the FID and the file. The location, the subset of file information in the file information set 1 includes an FID, a file name, and an extension, and the subset of file information in the file information set 2 includes an FID, a modification type, a time, and additional information from the file information set 3 The subset of file information includes the FID, the file type, and the name of the application that last opened the file.
其中,从文件信息集2中的文件信息子集中的修改类型可以为新建或修改等,时间可以为新建或修改文件对应的时间,附加信息可以为新建或修改文件的主体,例如,主体可以为系统生成、蓝牙传送、或无线局域网传送等;从文件信息集3中的文件信息子集中的文件类型可以为文本文件或图片文件等。The modification type of the file information subset in the file information set 2 may be newly created or modified, and the time may be the time corresponding to the newly created or modified file, and the additional information may be the main body of the newly created or modified file, for example, the main body may be System generation, Bluetooth transmission, or wireless LAN transmission; etc.; the file type in the file information subset from the file information set 3 may be a text file or a picture file.
在上述实施例中,不难看出,每个从文件信息集统计的文件属性具有相关性,这种按照第二统计策略将相关的文件属性放在一个从文件信息集中统计的方式,可以提高管理文件属性的效率。In the above embodiment, it is not difficult to see that each file attribute counted from the file information set has relevance, and the related file attribute is placed in a file information set according to the second statistical policy, which can improve management. The efficiency of file attributes.
本领域技术人员应该理解的是,同一个文件对应的主文件信息集和从文件信息集中的文件信息子集,包含有相同的FID,因此,它们通过FID实现了相互关联。It should be understood by those skilled in the art that the master file information set corresponding to the same file and the file information subset from the file information set contain the same FID, and therefore, they are related to each other through the FID.
可选地,在如图1所示的本发明实施例的方法中,还可以包括如下2个步骤:Optionally, in the method of the embodiment of the present invention as shown in FIG. 1, the following two steps may also be included:
1)当检测到通知文件属性更新的广播消息时,根据从广播消息中提取出的更新内容、以及所述第一统计策略,确定所述主文件信息集中要更新的文件信息子集;1) when a broadcast message notifying the file attribute update is detected, determining a subset of the file information to be updated in the main file information set according to the updated content extracted from the broadcast message and the first statistical policy;
2)更新确定出的文件信息子集中与提取出的更新内容对应的文件属性。2) Updating the file attribute corresponding to the extracted update content in the determined file information subset.
类似地,如图1所示的本发明实施例方法的基础上,包括从文件信息集相关处理步骤的本发明方法还可以包括如下2个步骤:Similarly, on the basis of the method of the embodiment of the present invention as shown in FIG. 1, the method of the present invention including the processing steps related to the file information set may further include the following two steps:
1)当检测到通知文件属性更新的广播消息时,根据从广播消息中提取出的更新内容、以及第一统计策略和/或第二统计策略,确定主文件信息集和/或从文件信息集中要更新的文件信息子集。1) when a broadcast message notifying the file attribute update is detected, determining the master file information set and/or the slave file information set according to the update content extracted from the broadcast message, and the first statistical policy and/or the second statistical policy A subset of file information to update.
本领域技术人员应该理解是,通知文件属性更新的广播消息可以从操作系统中获取。 Those skilled in the art should understand that the broadcast message notifying the file attribute update can be obtained from the operating system.
本步骤中确定主文件信息集和/或从文件信息集中要更新的文件信息子集可以包括:根据提取出的更新内容中的文件位置,确定主文件信息集和/或从文件信息集中包含有提取出的文件位置的文件信息子集。Determining the master file information set and/or the file information subset to be updated from the file information set in this step may include: determining, according to the file location in the extracted update content, the master file information set and/or including from the file information set A subset of the file information of the extracted file location.
2)更新确定出的文件信息子集中与提取出的更新内容对应的文件属性。2) Updating the file attribute corresponding to the extracted update content in the determined file information subset.
需要说明的是,本发明实施例的方法还可以包括检测到通知新增文件/删除文件的广播消息时的处理流程。该处理流程类似于本发明方法检测到通知文件属性更新的广播消息时的处理流程,在更新相关的处理流程的基础上,本领域技术人员可以容易地实现新增/删除相关的处理流程,此处不再赘述。It should be noted that the method in the embodiment of the present invention may further include a processing flow when the broadcast message of the newly added file/deleted file is detected. The process flow is similar to the process flow when the method of the present invention detects the broadcast message of the notification file attribute update. On the basis of updating the related process flow, the person skilled in the art can easily implement the process of adding/removing related processes. I won't go into details here.
相比于目前市场上的文件管理软件,通过本发明实施例的方法可以更高效地实现文件管理的常见功能,例如,显示选定的文件的文件属性。需要说明的是,通过本发明方法实现显示选定的文件的文件属性时,可以高效地显示更多种文件属性。Compared with the file management software currently on the market, the common functions of file management can be implemented more efficiently by the method of the embodiment of the present invention, for example, displaying the file attributes of the selected file. It should be noted that when the file attribute of the selected file is displayed by the method of the present invention, more kinds of file attributes can be displayed efficiently.
相比于目前市场上的文件管理软件,本发明实施例的方法还可以实现文件管理的高级功能如基于文件属性的全局筛选,有效地提高了提供文件管理的高级功能时的效率。Compared with the file management software currently on the market, the method of the embodiment of the present invention can also implement advanced functions of file management, such as global filtering based on file attributes, effectively improving the efficiency of providing advanced functions of file management.
当用户想使用基于文件属性的全局筛选时,用户设置用于筛选的目录和用于筛选的一个或一个以上关键字。在本发明实施例1中,假设设置的关键字分别为:时间为一天以内,文件类型为文本文件,扩展名为doc。When a user wants to use a global filter based on file attributes, the user sets the directory for filtering and one or more keywords for filtering. In the embodiment 1 of the present invention, it is assumed that the set keywords are: the time is within one day, the file type is a text file, and the extension is doc.
图2为本发明实施例中实现基于文件属性的全局筛选的流程图,如图2所示,包括:2 is a flowchart of implementing global filtering based on file attributes in the embodiment of the present invention. As shown in FIG. 2, the method includes:
步骤201:当接收到文件筛选消息时,从其中提取出包含有一组或一组以上文件属性的文件属性组序列。Step 201: When receiving the file filtering message, extract a file attribute group sequence containing one or more file attributes from the file filtering message.
其中,每组文件属性包含有一个或一个以上统计在同一个从文件信息集中的文件属性。Among them, each group of file attributes contains one or more file attributes in the same slave file information set.
在本发明实施例1中,假设提取出的文件属性组序列为{(时间:一天以内)、(文件类型:文本文件)、(扩展名:doc)},其中,小括号内的文件属性为一组文件属性。In the first embodiment of the present invention, it is assumed that the extracted file attribute group sequence is {(time: within one day), (file type: text file), (extension: doc)}, wherein the file attribute in the parentheses is A set of file attributes.
步骤202:针对文件属性组序列中的第一组文件属性,根据第二统计策 略确定统计有第一组文件属性的第一个从文件信息集;依此类推,直至确定统计有第N组文件属性的第N个从文件信息集;其中N为大于等于2的整数,表示文件属性组序列中的文件属性的分组的数量。Step 202: According to the second set of file attributes in the sequence of file attribute groups, according to the second statistical policy Slightly determining the first slave file information set with the first set of file attributes; and so on until determining that the Nth file information set of the Nth group file attribute is determined; wherein N is an integer greater than or equal to 2, indicating The number of groupings of file attributes in the file attribute group sequence.
在本发明实施例1中,第一个从文件信息集为从文件信息集2,第二个从文件信息集为从文件信息集3,第三个从文件信息集为从文件信息集1。In the first embodiment of the present invention, the first slave file information set is the slave file information set 2, the second slave file information set is the slave file information set 3, and the third slave file information set is the slave file information set 1.
步骤203:确定第一个从文件信息集的文件信息子集中包含有第一组文件属性的文件信息子集;针对每个确定出的文件信息子集中的FID进行如下处理:设置M初始值为2,根据当前的FID,读取对应的第M个从文件信息集中的文件信息子集,确定读取出的文件信息子集中是否包含第M组文件属性;如果包含,且M小于N,将M加1,并返回执行根据当前的FID,读取对应的第M个从文件信息集中的文件信息子集,确定读取出的文件信息子集中是否包含第M组文件属性;如果包含,且M等于N,根据当前的FID,读取对应的主文件信息集中的文件信息子集,并确定当前的FID对应的文件为筛选出的文件;如果不包含,结束针对当前的FID的处理。Step 203: Determine a subset of file information in the file information subset of the first file information set that includes the first group of file attributes; perform the following processing on each determined FID of the file information subset: setting the initial value of M 2, according to the current FID, read a corresponding subset of the file information in the Mth file information set, determine whether the read file information subset contains the M group file attribute; if included, and M is less than N, M plus 1 and returning execution according to the current FID, reading a subset of the file information in the corresponding Mth file information set, determining whether the read file information subset contains the Mth group file attribute; if included, and M is equal to N, according to the current FID, the file information subset of the corresponding main file information set is read, and the file corresponding to the current FID is determined to be the filtered file; if not, the processing for the current FID is ended.
在本发明实施例1中,通过执行步骤203,确定出文件属性符合{(时间:一天以内)、(文件类型:文本文件)、(扩展名:doc)}的各筛选出的文件的对应的主文件信息集和从文件信息集中的文件信息子集。本领域技术人员容易实现的是,根据确定出的文件信息子集中的文件属性,显示筛选出的文件的相关信息,例如文件的名称,文件的位置等信息。In the first embodiment of the present invention, by performing step 203, it is determined that the file attribute meets the corresponding one of the selected files of {(time: within one day), (file type: text file), (extension: doc)}. A subset of the main file information set and the file information from the file information set. It is easy for a person skilled in the art to display related information of the filtered file, such as the name of the file, the location of the file, and the like according to the file attributes in the determined subset of file information.
需要说明的是,在本发明实施例1中,按照第二统计策略将相关的文件属性放在一个从文件信息集中统计,这样当进行基于文件属性的全局筛选时,可以实现尽量减少从文件信息集中的访问,从而较好地提高访问效率。It should be noted that, in the first embodiment of the present invention, the related file attributes are placed in a file information set according to the second statistical policy, so that when the global filtering based on the file attributes is performed, the information from the file can be minimized. Centralized access, which improves access efficiency.
图3为本发明设备中管理文件的装置的组成结构示意图,如图3所示,本发明装置包括读取单元和新增单元,其中,3 is a schematic structural diagram of a device for managing a file in a device of the present invention. As shown in FIG. 3, the device of the present invention includes a reading unit and a new unit.
读取单元,设置为设备启动时,获取每个文件的文件属性中满足预先设置的第一统计策略的文件属性。The reading unit is configured to obtain a file attribute of a file attribute of each file that satisfies a preset first statistical policy when the device is started.
其中,第一统计策略包括:设备的内存中的主文件信息集,要统计的文件属性。第一统计策略要求统计的文件属性中至少包括文件位置如文件路径 信息。The first statistical policy includes: a primary file information set in the memory of the device, and a file attribute to be counted. The first statistical policy requires that the file attributes of the statistics include at least the file location, such as the file path. information.
新增单元,设置为针对每个文件,生成唯一代表文件的文件标识FID,并在主文件信息集中增加包含有生成的FID和来自读取单元的文件属性的文件信息子集。A new unit is set to generate a file identifier FID uniquely representing the file for each file, and add a file information subset containing the generated FID and the file attribute from the reading unit in the main file information set.
可选地,Optionally,
在本发明一个实施例中,本发明实施例的装置还包括更新单元,设置为:当检测到通知文件属性更新的广播消息时,根据从广播消息中提取出的更新内容、以及所述第一统计策略,确定所述主文件信息集中要更新的文件信息子集;更新确定出的文件信息子集中与提取出的更新内容对应的文件属性。In an embodiment of the present invention, the apparatus of the embodiment of the present invention further includes an updating unit, configured to: when detecting a broadcast message notifying the file attribute update, according to the updated content extracted from the broadcast message, and the first And a statistical policy, determining a subset of file information to be updated in the main file information set; and updating a file attribute corresponding to the extracted updated content in the determined file information subset.
可选地,Optionally,
读取单元还设置为:设备启动时,获取每个文件的文件属性中满足预先设置的第二统计策略的文件属性。The reading unit is further configured to: obtain a file attribute that satisfies a preset second statistical policy in a file attribute of each file when the device is started.
其中,第二统计策略包括:设备的内存中的一个或一个以上从文件信息集,要统计的文件属性。The second statistical policy includes: one or more slave file information sets in the memory of the device, and file attributes to be counted.
相应地,Correspondingly,
新增单元还设置为:针对每个文件,在从文件信息集中增加包含有生成的FID和来自读取单元的文件属性的文件信息子集。The new unit is also set to: for each file, a subset of file information containing the generated FID and file attributes from the reading unit is added from the file information set.
可选地,Optionally,
在本发明另一个实施例中,本发明装置还包括更新单元,设置为:当检测到通知文件属性更新的广播消息时,根据从广播消息中提取出的更新内容、以及第一统计策略和/或第二统计策略,确定主文件信息集和/或从文件信息集中要更新的文件信息子集;更新确定出的文件信息子集中与提取出的更新内容对应的文件属性。In another embodiment of the present invention, the apparatus of the present invention further includes an updating unit configured to: when detecting a broadcast message notifying the file attribute update, based on the updated content extracted from the broadcast message, and the first statistical policy and/or Or a second statistical policy, determining a master file information set and/or a file information subset to be updated from the file information set; and updating the file attributes corresponding to the extracted update content in the determined file information subset.
可选地,Optionally,
本发明装置还包括筛选单元,设置为:The apparatus of the present invention further includes a screening unit configured to:
当接收到文件筛选消息时,从其中提取出包含有一组或一组以上文件属性的文件属性组序列;其中,每组文件属性包含有一个或一个以上统计在同 一个从文件信息集中的文件属性;When a file filtering message is received, a sequence of file attribute groups containing one or more file attributes is extracted therefrom; wherein each group of file attributes contains one or more statistics in the same a file attribute from the file information set;
针对文件属性组序列中的第一组文件属性,根据第二统计策略确定统计有第一组文件属性的第一个从文件信息集;依此类推,直至确定统计有第N组文件属性的第N个从文件信息集;其中N为大于等于2的整数,表示文件属性组序列中的文件属性组的数量;For the first set of file attributes in the sequence of file attribute groups, determining, according to the second statistical policy, the first set of secondary file information of the first set of file attributes; and so on, until determining that the statistics have the attribute of the Nth set of file attributes. N slave file information sets; where N is an integer greater than or equal to 2, indicating the number of file attribute groups in the file attribute group sequence;
确定第一个从文件信息集的文件信息子集中包含有第一组文件属性的文件信息子集;针对每个确定出的文件信息子集中的FID:设置M的初始值为2,根据当前的FID,读取对应的第M个从文件信息集中的文件信息子集,确定读取出的文件信息子集中是否包含第M组文件属性;如果包含,且M小于N,将M加1,并返回执行根据当前的FID,读取对应的第M个从文件信息集中的文件信息子集,确定读取出的文件信息子集中是否包含第M组文件属性;如果包含,且M等于N,根据当前的FID,读取对应的主文件信息集中的文件信息子集,并确定当前的FID对应的文件为筛选出的文件;如果不包含,结束针对当前的FID的处理。Determining a subset of file information of the first set of file information sets containing the first set of file attributes; for each determined subset of file information FID: setting the initial value of M to 2, according to the current FID, reading a corresponding subset of the file information in the Mth file information set, determining whether the read file information subset contains the Mth group file attribute; if included, and M is less than N, adding M to 1, and Returning execution according to the current FID, reading a subset of the file information in the corresponding Mth file information set, determining whether the read file information subset contains the M group file attribute; if included, and M is equal to N, according to The current FID reads the file information subset of the corresponding main file information set, and determines that the file corresponding to the current FID is the filtered file; if not, ends the processing for the current FID.
本领域普通技术人员可以理解上述实施例的全部或部分步骤可以使用计算机程序流程来实现,所述计算机程序可以存储于一计算机可读存储介质中,所述计算机程序在相应的硬件平台上(如系统、设备、装置、器件等)执行,在执行时,包括方法实施例的步骤之一或其组合。One of ordinary skill in the art will appreciate that all or a portion of the steps of the above-described embodiments can be implemented using a computer program flow, which can be stored in a computer readable storage medium, such as on a corresponding hardware platform (eg, The system, device, device, device, etc. are executed, and when executed, include one or a combination of the steps of the method embodiments.
可选地,上述实施例的全部或部分步骤也可以使用集成电路来实现,这些步骤可以被分别制作成一个个集成电路模块,或者将它们中的多个模块或步骤制作成单个集成电路模块来实现。这样,本发明不限制于任何特定的硬件和软件结合。Alternatively, all or part of the steps of the above embodiments may also be implemented by using an integrated circuit. These steps may be separately fabricated into individual integrated circuit modules, or multiple modules or steps may be fabricated into a single integrated circuit module. achieve. Thus, the invention is not limited to any specific combination of hardware and software.
上述实施例中的各装置/功能模块/功能单元可以采用通用的计算装置来实现,它们可以集中在单个的计算装置上,也可以分布在多个计算装置所组成的网络上。The devices/function modules/functional units in the above embodiments may be implemented by a general-purpose computing device, which may be centralized on a single computing device or distributed over a network of multiple computing devices.
上述实施例中的各装置/功能模块/功能单元以软件功能模块的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。上述提到的计算机可读取存储介质可以是只读存储器,磁盘或光盘等。When each device/function module/functional unit in the above embodiment is implemented in the form of a software function module and sold or used as a stand-alone product, it can be stored in a computer readable storage medium. The above mentioned computer readable storage medium may be a read only memory, a magnetic disk or an optical disk or the like.
工业实用性 Industrial applicability
本发明实施例中,由于内存的访问时间比存取器的访问时间至少小于一个数量级,这样实现了通过读取内存中的主文件信息集和从文件信息集的方式提供文件管理的高级功能如基于文件属性的全局筛选,从而有效地提高了实现文件管理的高级功能的效率,从而较好地改善了文件管理的用户体验。 In the embodiment of the present invention, since the access time of the memory is at least one order of magnitude smaller than the access time of the accessor, the advanced functions of providing file management by reading the main file information set in the memory and the file information set are implemented. Based on the global filtering of file attributes, the efficiency of implementing advanced functions of file management is effectively improved, thereby improving the user experience of file management.

Claims (13)

  1. 一种设备中管理文件的方法,包括:A method of managing files in a device, comprising:
    设备启动时,获取每个文件的文件属性中满足预先设置的第一统计策略的文件属性;其中,第一统计策略包括:设备的内存中的主文件信息集,以及要统计的文件属性;When the device is started, the file attributes of each file that meet the preset first statistical policy are obtained. The first statistical policy includes: a set of the main file information in the memory of the device, and a file attribute to be counted;
    针对每个文件,生成唯一代表文件的文件标识FID,并在所述主文件信息集中增加包含有生成的FID和获得的文件属性的文件信息子集。For each file, a file identifier FID uniquely representing the file is generated, and a subset of the file information including the generated FID and the obtained file attribute is added in the main file information set.
  2. 根据权利要求1所述的方法,其中,所述第一统计策略要求统计的文件属性中至少包括文件位置。The method according to claim 1, wherein the first statistical policy requires that at least a file location is included in a file attribute of the statistics.
  3. 根据权利要求1所述的方法,该方法还包括:The method of claim 1 further comprising:
    设备启动时,获取每个文件的文件属性中满足预先设置的第二统计策略的文件属性;其中,第二统计策略包括:设备的内存中的一个或一个以上从文件信息集,要统计的文件属性;When the device is started, the file attribute of each file that meets the preset second statistical policy is obtained. The second statistical policy includes: one or more slave file information sets in the memory of the device, and the file to be counted. Attributes;
    所述生成唯一代表文件的FID之后,该方法还包括:After the generating the FID that uniquely represents the file, the method further includes:
    针对每个文件,在从文件信息集中增加包含有生成的FID和获得的文件属性的文件信息子集。For each file, a subset of file information containing the generated FID and the obtained file attributes is added from the file information set.
  4. 根据权利要求1或2所述的方法,该方法还包括:The method of claim 1 or 2, further comprising:
    当检测到通知文件属性更新的广播消息时,根据从广播消息中提取出的更新内容、以及所述第一统计策略,确定所述主文件信息集中要更新的文件信息子集;Determining, according to the updated content extracted from the broadcast message, and the first statistical policy, a subset of the file information to be updated in the primary file information set when the broadcast message of the notification file attribute update is detected;
    更新确定出的文件信息子集中与提取出的更新内容对应的文件属性。Updating the file attribute corresponding to the extracted update content in the determined file information subset.
  5. 根据权利要求3所述的方法,该方法还包括:The method of claim 3, further comprising:
    当检测到通知文件属性更新的广播消息时,根据从广播消息中提取出的更新内容、以及所述第一统计策略和/或第二统计策略,确定所述主文件信息集和/或从文件信息集中要更新的文件信息子集;When the broadcast message notifying the file attribute update is detected, determining the master file information set and/or the slave file according to the update content extracted from the broadcast message, and the first statistical policy and/or the second statistical policy a subset of file information to be updated in the information set;
    更新确定出的文件信息子集中与提取出的更新内容对应的文件属性。 Updating the file attribute corresponding to the extracted update content in the determined file information subset.
  6. 根据权利要求5所述的方法,该方法还包括:The method of claim 5, further comprising:
    当接收到文件筛选消息时,从其中提取出包含有一组或一组以上文件属性的文件属性组序列;其中,每组文件属性包含有一个或一个以上统计在同一个从文件信息集中的文件属性;When a file filtering message is received, a sequence of file attribute groups containing one or more file attributes is extracted therefrom; wherein each group of file attributes contains one or more file attributes in the same slave file information set ;
    针对文件属性组序列中的第一组文件属性,根据第二统计策略确定统计有第一组文件属性的第一个从文件信息集;依此类推,直至确定统计有第N组文件属性的第N个从文件信息集;其中N为大于等于2的整数,表示文件属性组序列中的文件属性组的数量;For the first set of file attributes in the sequence of file attribute groups, determining, according to the second statistical policy, the first set of secondary file information of the first set of file attributes; and so on, until determining that the statistics have the attribute of the Nth set of file attributes. N slave file information sets; where N is an integer greater than or equal to 2, indicating the number of file attribute groups in the file attribute group sequence;
    确定第一个从文件信息集的文件信息子集中包含有第一组文件属性的文件信息子集;针对每个确定出的文件信息子集中的FID:设置M的初始值为2,根据当前的FID,读取对应的第M个从文件信息集中的文件信息子集,确定读取出的文件信息子集中是否包含第M组文件属性;如果包含,且M小于N,将M加1,并返回执行根据当前的FID,读取对应的第M个从文件信息集中的文件信息子集,确定读取出的文件信息子集中是否包含第M组文件属性;如果包含,且M等于N,根据当前的FID,读取对应的主文件信息集中的文件信息子集,并确定当前的FID对应的文件为筛选出的文件;如果不包含,结束针对当前的FID的处理。Determining a subset of file information of the first set of file information sets containing the first set of file attributes; for each determined subset of file information FID: setting the initial value of M to 2, according to the current FID, reading a corresponding subset of the file information in the Mth file information set, determining whether the read file information subset contains the Mth group file attribute; if included, and M is less than N, adding M to 1, and Returning execution according to the current FID, reading a subset of the file information in the corresponding Mth file information set, determining whether the read file information subset contains the M group file attribute; if included, and M is equal to N, according to The current FID reads the file information subset of the corresponding main file information set, and determines that the file corresponding to the current FID is the filtered file; if not, ends the processing for the current FID.
  7. 一种设备中管理文件的装置,该装置包括读取单元和新增单元,其中,A device for managing files in a device, the device comprising a reading unit and a new unit, wherein
    所述读取单元,设置为:设备启动时,获取每个文件的文件属性中满足预先设置的第一统计策略的文件属性;其中,第一统计策略包括:设备的内存中的主文件信息集,要统计的文件属性;The reading unit is configured to: obtain, when the device is started, a file attribute that satisfies a preset first statistical policy in a file attribute of each file; wherein the first statistical policy includes: a primary file information set in a memory of the device , the file attributes to be counted;
    所述新增单元,设置为:针对每个文件,生成唯一代表文件的文件标识FID,并在主文件信息集中增加包含有生成的FID和来自读取单元的文件属性的文件信息子集。The new unit is configured to: for each file, generate a file identifier FID uniquely representing the file, and add a file information subset including the generated FID and the file attribute from the reading unit in the main file information set.
  8. 根据权利要求7所述的装置,其中,所述第一统计策略要求统计的文件属性中至少包括文件位置。The apparatus according to claim 7, wherein the first statistical policy requires that at least a file location is included in a file attribute of the statistics.
  9. 根据权利要求7所述的装置,其中,The apparatus according to claim 7, wherein
    所述读取单元还设置为:设备启动时,获取每个文件的文件属性中满足 预先设置的第二统计策略的文件属性;其中,第二统计策略包括:设备的内存中的一个或一个以上从文件信息集,要统计的文件属性;The reading unit is further configured to: when the device starts, obtain the file attribute of each file to satisfy a file attribute of a second statistical policy set in advance; wherein the second statistical policy includes: one or more slave file information sets in the memory of the device, and file attributes to be counted;
    所述新增单元还设置为:针对每个文件,在从文件信息集中增加包含有生成的FID和来自所述读取单元的文件属性的文件信息子集。The adding unit is further configured to: for each file, add a file information subset including the generated FID and the file attribute from the reading unit in the file information set.
  10. 根据权利要求7或8所述的装置,该装置还包括更新单元,设置为:当检测到通知文件属性更新的广播消息时,根据从广播消息中提取出的更新内容、以及所述第一统计策略,确定所述主文件信息集中要更新的文件信息子集;更新确定出的文件信息子集中与提取出的更新内容对应的文件属性。The apparatus according to claim 7 or 8, further comprising an updating unit configured to: when the broadcast message notifying the file attribute update is detected, based on the updated content extracted from the broadcast message, and the first statistic The policy determines a subset of file information to be updated in the main file information set; and updates a file attribute corresponding to the extracted updated content in the determined file information subset.
  11. 根据权利要求9所述的装置,其特征在于,该装置还包括更新单元,设置为:当检测到通知文件属性更新的广播消息时,根据从广播消息中提取出的更新内容、以及所述第一统计策略和/或第二统计策略,确定所述主文件信息集和/或从文件信息集中要更新的文件信息子集;更新确定出的文件信息子集中与提取出的更新内容对应的文件属性。The apparatus according to claim 9, wherein the apparatus further comprises an updating unit configured to: when the broadcast message notifying the file attribute update is detected, based on the updated content extracted from the broadcast message, and the a statistical policy and/or a second statistical policy, determining the subset of file information and/or a subset of file information to be updated from the file information set; updating the determined file information subset and the file corresponding to the extracted updated content Attributes.
  12. 根据权利要求11所述的装置,该装置还包括筛选单元,设置为:The apparatus of claim 11 further comprising a screening unit configured to:
    当接收到文件筛选消息时,从其中提取出包含有一组或一组以上文件属性的文件属性组序列;其中,每组文件属性包含有一个或一个以上统计在同一个从文件信息集中的文件属性;When a file filtering message is received, a sequence of file attribute groups containing one or more file attributes is extracted therefrom; wherein each group of file attributes contains one or more file attributes in the same slave file information set ;
    针对文件属性组序列中的第一组文件属性,根据第二统计策略确定统计有第一组文件属性的第一个从文件信息集;依此类推,直至确定统计有第N组文件属性的第N个从文件信息集;其中N为大于等于2的整数,表示文件属性组序列中的文件属性组的数量;For the first set of file attributes in the sequence of file attribute groups, determining, according to the second statistical policy, the first set of secondary file information of the first set of file attributes; and so on, until determining that the statistics have the attribute of the Nth set of file attributes. N slave file information sets; where N is an integer greater than or equal to 2, indicating the number of file attribute groups in the file attribute group sequence;
    确定第一个从文件信息集的文件信息子集中包含有第一组文件属性的文件信息子集;针对每个确定出的文件信息子集中的FID:设置M的初始值为2,根据当前的FID,读取对应的第M个从文件信息集中的文件信息子集,确定读取出的文件信息子集中是否包含第M组文件属性;如果包含,且M小于N,将M加1,并返回执行根据当前的FID,读取对应的第M个从文件信息集中的文件信息子集,确定读取出的文件信息子集中是否包含第M组文件属性;如果包含,且M等于N,根据当前的FID,读取对应的主文件信息集 中的文件信息子集,并确定当前的FID对应的文件为筛选出的文件;如果不包含,结束针对当前的FID的处理。Determining a subset of file information of the first set of file information sets containing the first set of file attributes; for each determined subset of file information FID: setting the initial value of M to 2, according to the current FID, reading a corresponding subset of the file information in the Mth file information set, determining whether the read file information subset contains the Mth group file attribute; if included, and M is less than N, adding M to 1, and Returning execution according to the current FID, reading a subset of the file information in the corresponding Mth file information set, determining whether the read file information subset contains the M group file attribute; if included, and M is equal to N, according to The current FID, read the corresponding master file information set A subset of the file information in the file, and determine that the file corresponding to the current FID is the filtered file; if not, the processing for the current FID is ended.
  13. 一种计算机可读存储介质,存储有程序指令,当该程序指令被执行时可实现权利要求1-6任一项所述的方法。 A computer readable storage medium storing program instructions that, when executed, can implement the method of any of claims 1-6.
PCT/CN2015/071498 2014-10-24 2015-01-23 Method and device for managing file in apparatus WO2015184830A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201410579090.4A CN105589888B (en) 2014-10-24 2014-10-24 Method and device for managing files in equipment
CN201410579090.4 2014-10-24

Publications (1)

Publication Number Publication Date
WO2015184830A1 true WO2015184830A1 (en) 2015-12-10

Family

ID=54766064

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2015/071498 WO2015184830A1 (en) 2014-10-24 2015-01-23 Method and device for managing file in apparatus

Country Status (2)

Country Link
CN (1) CN105589888B (en)
WO (1) WO2015184830A1 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111258953B (en) * 2020-01-08 2024-04-30 中联财联网科技有限公司 Method for normalizing conversion of financial data into evaluation data

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101364221A (en) * 2007-08-07 2009-02-11 富士施乐株式会社 Document management apparatus, and document management system and method
CN101630322A (en) * 2009-08-26 2010-01-20 中国人民解放军信息工程大学 Method for storing and accessing file set under tree directory structure in database
CN103646063A (en) * 2013-11-27 2014-03-19 中国航天科技集团公司第五研究院第五一三研究所 Satellite-borne high-speed file management system
US8856065B2 (en) * 2011-08-31 2014-10-07 Canon Kabushiki Kaisha Information processing apparatus, document access method, and computer program

Family Cites Families (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4876734B2 (en) * 2006-06-22 2012-02-15 富士ゼロックス株式会社 Document use management system and method, document management server and program thereof
CN100492370C (en) * 2007-12-14 2009-05-27 清华大学 Document management method facing to integration business model
CN101719141B (en) * 2009-12-24 2011-09-07 成都市华为赛门铁克科技有限公司 File processing method and system based on directory object
CN102289451A (en) * 2011-06-17 2011-12-21 奇智软件(北京)有限公司 Method and device for searching files or folders
CN103577500B (en) * 2012-08-10 2018-07-27 腾讯科技(深圳)有限公司 Distributed file system carries out the method and the distributed file system of data processing
JP6013895B2 (en) * 2012-12-12 2016-10-25 株式会社日立情報通信エンジニアリング File management system and method, program
CN103902260B (en) * 2012-12-25 2016-08-31 华中科技大学 A kind of forecasting method of object-based file system
US9183246B2 (en) * 2013-01-15 2015-11-10 Microsoft Technology Licensing, Llc File system with per-file selectable integrity
JP5907101B2 (en) * 2013-03-22 2016-04-20 富士ゼロックス株式会社 Document management apparatus and program
US9075722B2 (en) * 2013-04-17 2015-07-07 International Business Machines Corporation Clustered and highly-available wide-area write-through file system cache
CN103488706A (en) * 2013-09-06 2014-01-01 北京东方艾迪普科技发展有限公司 Processing method and device for mass data base

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101364221A (en) * 2007-08-07 2009-02-11 富士施乐株式会社 Document management apparatus, and document management system and method
CN101630322A (en) * 2009-08-26 2010-01-20 中国人民解放军信息工程大学 Method for storing and accessing file set under tree directory structure in database
US8856065B2 (en) * 2011-08-31 2014-10-07 Canon Kabushiki Kaisha Information processing apparatus, document access method, and computer program
CN103646063A (en) * 2013-11-27 2014-03-19 中国航天科技集团公司第五研究院第五一三研究所 Satellite-borne high-speed file management system

Also Published As

Publication number Publication date
CN105589888B (en) 2020-10-16
CN105589888A (en) 2016-05-18

Similar Documents

Publication Publication Date Title
CN108536761B (en) Report data query method and server
CN107077483B (en) Synchronization of shared folders and files
CN109997126B (en) Event driven extraction, transformation, and loading (ETL) processing
CN111046034B (en) Method and system for managing memory data and maintaining data in memory
CN107590277B (en) Data synchronization method and device, electronic equipment and storage medium
US20170212781A1 (en) Parallel execution of blockchain transactions
JP6521402B2 (en) Method for updating data table of KeyValue database and apparatus for updating table data
CN105373541B (en) The processing method and system of the data operation request of database
US20170031948A1 (en) File synchronization method, server, and terminal
BR112012017294B1 (en) method, system and server for collecting software versions
CN108134696A (en) A kind of micro services configuration update method and device
WO2016110203A1 (en) File path storing and local file accessing method and device
US20110264703A1 (en) Importing Tree Structure
CN110784377A (en) Method for uniformly managing cloud monitoring data in multi-cloud environment
CN112559913B (en) Data processing method, device, computing equipment and readable storage medium
WO2015184830A1 (en) Method and device for managing file in apparatus
CN111753141B (en) Data management method and related equipment
WO2016206395A1 (en) Weekly report information processing method and device
CN107526816B (en) Stream distribution record storage method and device and electronic equipment
CN107463618B (en) Index creating method and device
CN115470189A (en) Data query method and device and readable storage medium
CN108573042B (en) Report synchronization method, electronic equipment and computer readable storage medium
CN110598072B (en) Feature data aggregation method and device
CN108595552B (en) Data cube publishing method and device, electronic equipment and storage medium
CN109063201B (en) Impala online interactive query method based on mixed storage scheme

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

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

Country of ref document: EP

Kind code of ref document: A1