WO2017008655A1 - 呈现树形文件的方法、装置及设备 - Google Patents
呈现树形文件的方法、装置及设备 Download PDFInfo
- Publication number
- WO2017008655A1 WO2017008655A1 PCT/CN2016/088326 CN2016088326W WO2017008655A1 WO 2017008655 A1 WO2017008655 A1 WO 2017008655A1 CN 2016088326 W CN2016088326 W CN 2016088326W WO 2017008655 A1 WO2017008655 A1 WO 2017008655A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- file
- folder
- tree
- identifier
- target
- 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.)
- Ceased
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/10—File systems; File servers
- G06F16/14—Details of searching files based on file metadata
- G06F16/156—Query results presentation
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/10—File systems; File servers
- G06F16/14—Details of searching files based on file metadata
- G06F16/148—File search processing
Definitions
- the present application relates to the field of communications technologies, and in particular, to a method, apparatus, and device for presenting a tree file.
- a typical WEB application is a tree file interaction.
- a tree file can present two parts of content on the WEB side, a tree structure representing a subordination relationship between files or folders, and another part being a tree structure. The selected file and its file contents.
- the tree object can only be positioned from the tree structure to the selected object file, and then the file content of the object file is presented, that is, the file structure is controlled by operating the tree structure, so the interaction between the tree structure and the file is performed.
- the single method makes the file rendering effect less flexible.
- the present application provides a method, device and device for presenting a tree file to solve the problem that the existing WEB end tree file presentation effect is not flexible enough.
- a method for presenting a tree file comprising:
- an apparatus for presenting a tree file comprising:
- a searching unit configured to find a file identifier of the target file when receiving a command to open the tree file on the WEB side;
- An obtaining unit configured to acquire file data associated with the target file according to the file identifier
- a rendering unit configured to present, according to the file data, a tree structure of the target file tree to which the target file belongs according to the WEB page of the WEB end.
- a WEB end device including:
- processor a memory for storing the processor executable instructions
- processor is configured to:
- the file data associated with the target file may be obtained, and the tree structure of the target file tree is reversely located from the target file, and the tree structure is directly presented. Based on the unidirectional positioning of the tree structure to the target file, the two-way interaction between the tree structure and the file is realized, and the flexibility of presenting the tree file on the WEB side is improved by extending the interaction mode.
- FIG. 1 is a schematic diagram of presenting a tree file on a WEB page in the embodiment of the present application
- FIG. 2 is a flow chart of one embodiment of a method for presenting a tree file according to the present application
- 3A is a flow chart of another embodiment of a method for presenting a tree file according to the present application.
- FIG. 3B is a schematic structural diagram of a folder entry in the embodiment shown in FIG. 3A;
- 3C is a schematic structural diagram of a file entry in the embodiment shown in FIG. 3A;
- FIG. 3D is a schematic diagram showing the application of the WEB page of the embodiment shown in FIG. 3A;
- FIG. 4 is a hardware structural diagram of a device where a device for presenting a tree file is presented in the present application
- FIG. 5 is a block diagram of an embodiment of an apparatus for presenting a tree file according to the present application.
- FIG. 6 is a block diagram of another embodiment of an apparatus for presenting a tree file in the present application.
- first, second, third, etc. may be used to describe various information in this application, such information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other.
- first information may also be referred to as the second information without departing from the scope of the present application.
- second information may also be referred to as the first information.
- word "if” as used herein may be interpreted as "when” or “when” or “in response to a determination.”
- FIG. 1 is a schematic diagram of a tree file presented on a WEB page of a WEB end in the embodiment of the present application.
- the WEB page of the tree file presented in FIG. 1 is divided into two areas, which are respectively a tree structure on the left side.
- the parent folder of the layer is folder 2, the folder 2 contains file B, and the parent folder of folder 2 is folder 1; the file rendering area is used to display the opened file, and the opened file includes the activated file.
- the file name of the file A is highlighted (shown as a gray background in FIG. 1) and displayed in the name column of the file presentation area, and the file content is displayed in the content column of the file presentation area, and is opened.
- the file also includes selected files, such as file B, file C, and file D in Figure 1, which display the file name only in the name column.
- the file tree to which the activated file belongs can be obtained by the reversed activation file of the last time the WEB page is closed, and The tree structure of the file tree is directly presented in the tree structure presentation area, thereby improving the flexibility of presenting the tree file while realizing the two-way interaction between the tree structure and the file, and enabling the WEB end user to open the WEB.
- the page is paged, quickly locate the location of the activated file in its own file tree.
- a flow chart of one embodiment of a method for presenting a tree file according to the present application is as follows:
- Step 201 When receiving the command to open the tree file on the WEB side, find the file identifier of the target file.
- the file identifier of the file opened in the file presentation area of the WEB page can be maintained through the database.
- the file identifier of the activated file when the database is closed is recorded in the database. Therefore, when receiving the command to open the tree file on the WEB side, you can check from the database.
- the file identifier of the activated file recorded in the database when the WEB page was last closed is inquired as the file identifier of the target file in this embodiment.
- Step 202 Acquire file data associated with the target file according to the file identifier.
- the WEB-side tree file is composed of a folder and a file, and the data structure for associating the relationship between the folder and the file is pre-stored in the database, wherein each folder data is saved as a file in the data structure.
- Folder entries each file data is saved as a file table entry in the data structure, the folder entry contains the folder identifier of the folder, the folder name, and the folder identifier of the parent folder to which the folder belongs; the file entry The file identifier of the file, the file name, and the folder ID of the parent folder to which the file belongs; the folder identifier of the parent folder in the table entry can be associated with the folder entry of the parent folder of the parent.
- the data structure of the pre-saved tree file may be searched in the database according to the file identifier, and the folder entry of each parent folder to which the target file belongs is obtained; Find the file table entries and file file entries of the folders contained in each level of the parent folder according to the folder identifier of each level of the parent folder. For example, in combination with the relationship between the folder and the file shown in FIG. 1, it can be known that, if the target file is file A, the folder entry of the folder 2 and the folder entry of the folder 1 can be searched up in turn, and then Further find the file entry of the file B contained in the folder 2.
- Step 203 Present a tree structure of the target file tree to which the target file belongs according to the file data on the WEB page of the WEB end.
- the target file tree to which the target file belongs is rendered, and the target is presented on the WEB page of the WEB end.
- the embodiment when the tree file is presented on the WEB page, the embodiment can obtain the tree data associated with the target file by reversely positioning the target file from the target file to the tree structure of the target file tree, thereby directly presenting the tree shape.
- the structure realizes the two-way interaction between the tree structure and the file based on the existing one-way positioning from the tree structure to the object file, and the flexibility of presenting the tree file on the WEB side is improved by extending the interaction mode. .
- FIG. 3A a flowchart of another embodiment of a method for presenting a tree file according to the present application, which describes a process of rendering a tree file in detail:
- Step 301 Maintain, by the database, a file identifier of the file opened in the file rendering area of the WEB page.
- the file identifier of the file opened in the file presentation area of the WEB page can be maintained through the database.
- the opened file includes the activated file content.
- the switching action may trigger a switch request to be sent to the database, so that the database updates the file identifier of the currently activated file to the file identifier of file C, and the file
- the file identifier of A is updated to the file identifier of the selected file; in addition, when any file in the opened file is closed, for example, the activated file A is closed, the currently activated file may default to the selected file.
- the file before the file A is activated assuming the file C, may trigger a delete request to the database to cause the database
- Step 302 When receiving the command to open the tree file on the WEB end, query the file identifier of the target file from the database, and the file identifier of the target file is the file of the activated file recorded in the database when the WEB page is last closed. logo.
- step 301 when the WEB page is closed, the file identifier of the activated file when the database is closed is recorded in the database; when the command to open the tree file on the WEB end is received, the WEB page can be queried from the database.
- Step 303 Acquire file data associated with the target file according to the file identifier of the target file.
- the WEB-side tree file is composed of a folder and a file, and the data structure for associating the relationship between the folder and the file is pre-stored in the database, wherein each folder data is saved as a file in the data structure.
- each file data is saved as a file entry in the data structure, as shown in FIG. 3B, which is a schematic diagram of a folder entry in the embodiment of the present application, and a folder folder is included in the folder entry.
- the identifier (id), the folder name (name), and the folder identifier of the parent folder to which the folder belongs (parentFolderid); as shown in FIG.
- the structure of a file entry in the embodiment of the present application the file entry
- the file identifier (id) of the file, the file name (name), the folder identifier (parentFolderid) of the parent folder of the file, and the file content (content); the folder identifier of the parent folder in the entry can be associated The folder entry to the parent folder of the previous level.
- the data structure of the pre-saved tree file may be searched in the database according to the file identifier, and the folder entry of each parent folder to which the target file belongs is obtained;
- the folder identifier of each level of the parent folder finds the file table entries of the folder entries and files of the folder contained in each level of the parent folder. Referring to the relationship between the folder and the file shown in FIG.
- the target file is file A
- the file entry of the file A can be found according to the file id of the file A
- the folder id of the parent folder of the file A is found in the file entry of the file A, that is, the folder id of the folder 2, further according to the file
- the folder id of folder 2 finds the folder entry of folder 2
- the folder id of the parent folder of folder 2 is found in the folder entry of folder 2, that is, the folder id of folder 1
- the folder entry of the folder 1 is found; then, according to the folder id of the folder 2, the file entry of the file B with the folder 2 as the parent folder, that is, the file, can be found.
- the parentFolderid in the file entry of B is the folder id of folder 2.
- all the file data associated with the file A are found, including the file table entry of the file A, the folder entry of the folder 2, the folder entry of the folder 1, and the file entry of the file B.
- Step 304 The tree structure of the target file tree to which the target file belongs is presented on the WEB page according to the acquired file data.
- the target file tree to which the target file belongs is rendered, and the target file is presented on the WEB page of the WEB end.
- Step 305 Find the file content of the target file according to the file identifier of the target file.
- Step 306 The target file is used as the activated file, and the file content of the target file is presented in the file rendering area.
- steps 303 to 304 and the execution of the steps 305 to 306 are not sequential, and may be performed simultaneously. Steps 305 to 306 may be performed first.
- the step relationship shown in FIG. 3A is only shown in the figure. Convenience.
- the activated file is file A before the WEB page is closed last time.
- the file A is directly presented in the file presentation area, and is displayed in the content column.
- the file content of the file A at the same time in the tree structure presentation area presents the tree structure of the object file tree to which the file A belongs, and for other tree structures, only the first level parent folder is displayed, as shown in the folder in FIG. 3D. 3.
- the embodiment when the tree file is presented on the WEB page, the embodiment can obtain the tree data associated with the target file by reversely positioning the target file from the target file to the tree structure of the target file tree, thereby directly presenting the tree shape.
- the structure realizes the two-way interaction between the tree structure and the file based on the existing one-way positioning from the tree structure to the object file, and the flexibility of presenting the tree file on the WEB side is improved by extending the interaction mode.
- the target file when the WEB page is opened, in addition to the tree structure of the target file tree, the target file can be activated in the file rendering area, and the file content of the target file is presented, so that the WEB end user directly views the WEB page once.
- the file content before closing improves the flexibility of file rendering, and improves the operation of the tree file on the WEB side. Convenience.
- Embodiments of the apparatus for presenting a tree file may be applied to a WEB end device.
- the device embodiment may be implemented by software, or may be implemented by hardware or a combination of hardware and software. Taking the software implementation as an example, as a logical means, the processor of the device in which it is located reads the corresponding computer program instructions in the non-volatile memory into the memory. From a hardware level, as shown in FIG. 4, a hardware structure diagram of a device in which a device for presenting a tree file is presented in this application, except for the processor, memory, network interface, and non-volatile memory shown in FIG. In addition, the device in which the device is located in the embodiment may also include other hardware according to the actual function of the device, which is not shown in FIG. 4 .
- FIG. 5 a block diagram of an embodiment of an apparatus for presenting a tree file is provided in the present application:
- the apparatus includes a lookup unit 510, an acquisition unit 520, and a presentation unit 530.
- the searching unit 510 is configured to: when receiving the command to open the tree file on the WEB end, find the file identifier of the target file;
- the obtaining unit 520 is configured to acquire file data associated with the target file according to the file identifier
- the presenting unit 530 is configured to present, according to the file data, a tree structure of a target file tree to which the target file belongs according to the WEB page of the WEB end.
- FIG. 6 a block diagram of another embodiment of an apparatus for presenting a tree file according to the present application is as follows:
- the apparatus includes a maintenance unit 610, a lookup unit 620, an acquisition unit 630, and a presentation unit 640.
- the maintenance unit 610 is configured to maintain, by using a database, a file identifier of an open file in a file rendering area of the WEB page, where the opened file includes an activated file that has rendered the file content, and a file that does not present the file content. Check the file;
- the searching unit 620 is configured to query, from the database, a file identifier of the target file, where the file identifier of the target file is a file identifier of the activated file recorded in the database when the WEB page is last closed;
- the obtaining unit 630 is configured to obtain file data associated with the target file according to the file identifier
- the presentation unit 640 is configured to present, according to the file data, a tree structure of a target file tree to which the target file belongs according to the WEB page of the WEB end.
- the maintenance unit 610 can include (not shown in FIG. 6):
- an update subunit configured to: when the activated file in the opened file is switched, updating the file identifier of the switched activated file and the file identifier of the selected file in the database;
- Deleting a subunit for deleting in the database when any of the files in the opened file is closed The file identifier of the file being closed.
- the searching unit 620 is further configured to search, according to the file identifier of the target file, the file content of the target file;
- the presentation unit 640 is further configured to use the target file as an activated file, and present file content of the target file in the file presentation area.
- the obtaining unit 630 may include (not shown in FIG. 6):
- a first search subunit configured to search a data structure of a pre-saved tree file in a database according to the file identifier, and obtain a folder entry of each parent folder to which the target file belongs;
- a second search subunit configured to search, according to the folder identifier of each level of the parent folder, a file entry of a folder entry and a file of a folder included in each level of the parent folder;
- each folder entry includes a folder identifier of the folder, a folder name, and a folder identifier of the parent folder to which the folder belongs
- each file entry includes a file identifier, a file name, and a file of the file.
- the folder ID of the parent folder is a folder identifier of the folder, a folder name, and a folder identifier of the parent folder to which the folder belongs.
- the rendering unit 640 can include (not shown in FIG. 6):
- a rendering subunit configured to render a target file tree to which the target file belongs according to an association relationship between the found folder table item and the file table item;
- a presentation subunit configured to present a tree structure of the target file tree on a WEB page of the WEB end, where the tree structure includes a folder name and a file file of each level folder of the target file tree name.
- the device embodiment since it basically corresponds to the method embodiment, reference may be made to the partial description of the method embodiment.
- the device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separate, and the components displayed as units may or may not be physical units, ie may be located A place, or it can be distributed to multiple network units. Some or all of the modules may be selected according to actual needs to achieve the objectives of the present application. Those of ordinary skill in the art can understand and implement without any creative effort.
- the foregoing embodiment when the tree file is presented in the WEB page, the foregoing embodiment can obtain the tree data associated with the target file by reversely positioning the target file from the target file to the tree structure of the target file tree, and then directly present the tree shape.
- the structure realizes the tree structure and files on the basis of the existing one-way positioning from the tree structure to the target file.
- the two-way interaction between the two increases the flexibility of rendering tree files on the WEB side by extending the interaction mode.
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)
- Library & Information Science (AREA)
- Information Retrieval, Db Structures And Fs Structures Therefor (AREA)
Abstract
一种呈现树形文件的方法、装置及设备,所述方法包括:当接收到在WEB端打开树形文件的命令时,查找目标文件的文件标识(201);根据所述文件标识获取与所述目标文件关联的文件数据(202);根据所述文件数据在所述WEB端的WEB页面呈现所述目标文件所属的目标文件树的树形结构(203)。本方法通过获取与目标文件关联的文件数据,从目标文件反向定位到目标文件树的树形结构,进而直接呈现该树形结构,在现有从树形结构单向定位到目标文件的基础上,实现了树形结构与文件之间的双向交互,通过扩展交互方式,从而提高了在WEB端呈现树形文件的灵活性。
Description
本申请要求2015年07月13日递交的申请号为201510409171.4、发明名称为“呈现树形文件的方法、装置及设备”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
本申请涉及通信技术领域,尤其涉及呈现树形文件的方法、装置及设备。
随着WEB应用功能逐渐强大,在编写WEB应用时,可以利用树形组件、前端缓存技术、前端文件编辑器、数据库技术等,使得WEB应用在WEB端(例如,浏览器)的使用便利性和可扩展性逐步与客户端应用一致。现有技术中,一种典型的WEB应用为树形文件的交互,通常树形文件可以在WEB端呈现两部分内容,一部分为表示文件或文件夹之间从属关系的树形结构,另一部分为已选中的文件及其文件内容。但是,现有技术中只能单向从树形结构定位到选中的目标文件,进而呈现目标文件的文件内容,即通过操作树形结构控制文件的呈现,因此树形结构与文件之间的交互方式单一,导致文件呈现效果不够灵活。
发明内容
本申请提供呈现树形文件的方法、装置及设备,以解决现有WEB端树形文件呈现效果不够灵活的问题。
根据本申请实施例的第一方面,提供一种呈现树形文件的方法,所述方法包括:
当接收到在WEB端打开树形文件的命令时,查找目标文件的文件标识;
根据所述文件标识获取与所述目标文件关联的文件数据;
根据所述文件数据在所述WEB端的WEB页面呈现所述目标文件所属的目标文件树的树形结构。
根据本申请实施例的第二方面,提供一种呈现树形文件的装置,所述装置包括:
查找单元,用于当接收到在WEB端打开树形文件的命令时,查找目标文件的文件标识;
获取单元,用于根据所述文件标识获取与所述目标文件关联的文件数据;
呈现单元,用于根据所述文件数据在所述WEB端的WEB页面呈现所述目标文件所属的目标文件树的树形结构。
根据本申请实施例的第三方面,提供一种WEB端设备,包括:
处理器;用于存储所述处理器可执行指令的存储器;
其中,所述处理器被配置为:
当接收到在WEB端打开树形文件的命令时,查找目标文件的文件标识;
根据所述文件标识获取与所述目标文件关联的文件数据;
根据所述文件数据在所述WEB端的WEB页面呈现所述目标文件所属的目标文件树的树形结构。
应用本申请实施例在WEB页面呈现树形文件时,可以通过获取与目标文件关联的文件数据,从目标文件反向定位到目标文件树的树形结构,进而直接呈现该树形结构,在现有从树形结构单向定位到目标文件的基础上,实现了树形结构与文件之间的双向交互,通过扩展交互方式,从而提高了在WEB端呈现树形文件的灵活性。
应当理解的是,以上的一般描述和后文的细节描述仅是示例性和解释性的,并不能限制本申请。
此处的附图被并入说明书中并构成本说明书的一部分,示出了符合本申请的实施例,并与说明书一起用于解释本申请的原理。
图1为本申请实施例中在WEB页面呈现树形文件的示意图;
图2为本申请呈现树形文件的方法的一个实施例流程图;
图3A为本申请呈现树形文件的方法的另一个实施例流程图;
图3B为图3A所示实施例中一个文件夹表项的结构示意图;
图3C为图3A所示实施例中一个文件表项的结构示意图;
图3D为应用图3A所示实施例的WEB页面呈现示意图;
图4为本申请呈现树形文件的装置所在设备的一种硬件结构图;
图5为本申请呈现树形文件的装置的一个实施例框图;
图6为本申请呈现树形文件的装置的另一个实施例框图。
在本申请使用的术语是仅仅出于描述特定实施例的目的,而非旨在限制本申请。在本申请和所附权利要求书中所使用的单数形式的“一种”、“所述”和“该”也旨在包括多数形式,除非上下文清楚地表示其他含义。还应当理解,本文中使用的术语“和/或”是指并包含一个或多个相关联的列出项目的任何或所有可能组合。
应当理解,尽管在本申请可能采用术语第一、第二、第三等来描述各种信息,但这些信息不应限于这些术语。这些术语仅用来将同一类型的信息彼此区分开。例如,在不脱离本申请范围的情况下,第一信息也可以被称为第二信息,类似地,第二信息也可以被称为第一信息。取决于语境,如在此所使用的词语“如果”可以被解释成为“在……时”或“当……时”或“响应于确定”。
参见图1,为本申请实施例中在WEB端的WEB页面呈现树形文件的示意图:图1示出的呈现树形文件的WEB页面,分为两个区域,分别是左侧的树形结构呈现区和右侧的文件呈现区,其中,树形结构呈现区用于显示文件树的树形结构,以图1中示出的文件A所属文件树的树形结构为例,文件A的上一层父文件夹为文件夹2,文件夹2中同时包含文件B,文件夹2的上一层父文件夹为文件夹1;文件呈现区用于显示被打开文件,被打开文件包括被激活文件,例如图1中的文件A,此时文件A的文件名称突出(如图1中用灰色背景示出)显示在文件呈现区的名称栏,文件内容显示在文件呈现区的内容栏,被打开文件还包括被选中文件,如图1中的文件B、文件C和文件D,上述三个文件仅在名称栏显示文件名称。
现有技术中,当树形文件WEB页面开启时,仅会在树形结构呈现区中呈现第一级文件夹,此时WEB端用户要从第一级文件夹开始,自上而下逐层点击,才能定位到想要查看的文件,因此操作繁琐,呈现效果不灵活;本申请实施例中,可以通过WEB页面上次关闭时的被激活文件反向获取被激活文件所属的文件树,并直接在树形结构呈现区呈现该文件树的树形结构,从而在实现树形结构与文件之间的双向交互的同时,提高了呈现树形文件的灵活性,可以使得WEB端用户在打开WEB页面时,快速定位到被激活文件在其所属文件树中的位置。下面将结合具体的实施例对申请进行详细描述。
参见图2,为本申请呈现树形文件的方法的一个实施例流程图:
步骤201:当接收到在WEB端打开树形文件的命令时,查找目标文件的文件标识。
本实施例中,当WEB页面打开后,可以通过数据库维护在WEB页面的文件呈现区内被打开文件的文件标识,当WEB页面关闭时,由于数据库中记录了关闭时被激活文件的文件标识,因此当接收到在WEB端打开树形文件的命令时,可以从该数据库中查
询到该WEB页面上一次关闭时在数据库中记录的被激活文件的文件标识,作为本实施例中目标文件的文件标识。
步骤202:根据该文件标识获取与目标文件关联的文件数据。
本实施例中,WEB端树形文件由文件夹和文件组成,用于关联文件夹和文件之间关系的数据结构预先保存在数据库中,其中,每个文件夹数据在数据结构中保存为文件夹表项,每个文件数据在数据结构中保存为文件表项,文件夹表项中包含文件夹的文件夹标识、文件夹名称、以及文件夹所属父文件夹的文件夹标识;文件表项中包含文件的文件标识、文件名称、以及文件所属父文件夹的文件夹标识;通过表项中的父文件夹的文件夹标识可以关联到上一级父文件夹的文件夹表项。
本步骤中,在获取到目标文件的文件标识后,可以根据文件标识在数据库中查找预先保存的树形文件的数据结构,获得目标文件所属的每一级父文件夹的文件夹表项;然后根据每一级父文件夹的文件夹标识查找每一级父文件夹所包含文件夹的文件夹表项和文件的文件表项。例如,结合图1示出的文件夹与文件之间的关系可知,假设目标文件为文件A,则可以向上依次查找到文件夹2的文件夹表项和文件夹1的文件夹表项,然后进一步查找到文件夹2中所包含文件B的文件表项。
步骤203:根据该文件数据在WEB端的WEB页面呈现目标文件所属的目标文件树的树形结构。
本步骤中,可以按照查找到的文件夹表项和文件表项之间的关联关系,即步骤202中获取到的关联数据,渲染出目标文件所属的目标文件树,在WEB端的WEB页面呈现目标文件树的树形结构,该树形结构中包含目标文件树的每一级文件夹的文件夹名称和文件的文件名称。
由上述实施例可见,该实施例在WEB页面呈现树形文件时,可以通过获取与目标文件关联的文件数据,从目标文件反向定位到目标文件树的树形结构,进而直接呈现该树形结构,在现有从树形结构单向定位到目标文件的基础上,实现了树形结构与文件之间的双向交互,通过扩展交互方式,从而提高了在WEB端呈现树形文件的灵活性。
参见图3A,为本申请呈现树形文件的方法的另一个实施例流程图,该实施例对树形文件的呈现过程进行详细描述:
步骤301:通过数据库维护在WEB页面的文件呈现区内被打开文件的文件标识。
本实施例中,当WEB页面打开后,可以通过数据库维护在WEB页面的文件呈现区内被打开文件的文件标识,结合图1可知,该被打开文件包括已呈现文件内容的被激活
文件、以及未呈现文件内容的被选中文件,对应数据库中可以分别保存文件A(被激活文件)的文件标识,以及文件B、文件C和文件D(被选中文件)的文件标识;当被激活文件发生切换时,例如,从文件A切换到文件C,则该切换动作可以触发向数据库发送一个切换请求,以使数据库将当前被激活文件的文件标识更新为文件C的文件标识,并将文件A的文件标识更新为被选中文件的文件标识;另外,当被打开文件中的任一文件被关闭时,例如,被激活文件A被关闭,则当前被激活文件可以默认为被选中文件中,在文件A被激活之前的文件,假设为文件C,则上述关闭动作可以触发向数据库发送一个删除请求,以使数据库将当前被激活文件A的文件标识删除,并更新为文件C的文件标识。
步骤302:当接收到在WEB端打开树形文件的命令时,从数据库中查询目标文件的文件标识,该目标文件的文件标识为WEB页面上一次关闭时在数据库中记录的被激活文件的文件标识。
由步骤301可知,当WEB页面关闭时,数据库中记录了关闭时被激活文件的文件标识;当接收到在WEB端打开树形文件的命令时,可以从该数据库中查询到该WEB页面上一次关闭时在数据库中记录的被激活文件的文件标识,作为本实施例中目标文件的文件标识。
步骤303:根据目标文件的文件标识获取与目标文件关联的文件数据。
本实施例中,WEB端树形文件由文件夹和文件组成,用于关联文件夹和文件之间关系的数据结构预先保存在数据库中,其中,每个文件夹数据在数据结构中保存为文件夹表项,每个文件数据在数据结构中保存为文件表项,如图3B所述,为本申请实施例中一个文件夹表项的结构示意图,文件夹表项中包含文件夹的文件夹标识(id)、文件夹名称(name)、以及文件夹所属父文件夹的文件夹标识(parentFolderid);如图3C所示,为本申请实施例中一个文件表项的结构示意图,文件表项中包含文件的文件标识(id)、文件名称(name)、文件所属父文件夹的文件夹标识(parentFolderid)、以及文件内容(content);通过表项中的父文件夹的文件夹标识可以关联到上一级父文件夹的文件夹表项。
本步骤中,在获取到目标文件的文件标识后,可以根据文件标识在数据库中查找预先保存的树形文件的数据结构,获得目标文件所属的每一级父文件夹的文件夹表项;根据每一级父文件夹的文件夹标识查找每一级父文件夹所包含文件夹的文件夹表项和文件的文件表项。结合图1示出的文件夹与文件之间的关系可知,假设目标文件为文件A,
则可以根据文件A的文件id查找到文件A的文件表项,在文件A的文件表项中查找到文件A的父文件夹的文件夹id,即文件夹2的文件夹id,进一步根据文件夹2的文件夹id查找到文件夹2的文件夹表项,在文件夹2的文件夹表项中查找到文件夹2的父文件夹的文件夹id,即文件夹1的文件夹id,根据文件夹1的文件夹id查找到文件夹1的文件夹表项;然后进一步可以根据文件夹2的文件夹id查找到以文件夹2为父文件夹的文件B的文件表项,即文件B的文件表项中的parentFolderid为文件夹2的文件夹id。通过上述查找过程查找到文件A关联的所有文件数据,包括文件A的文件表项,文件夹2的文件夹表项,文件夹1的文件夹表项,以及文件B的文件表项。
步骤304:根据获取的文件数据在WEB页面呈现目标文件所属的目标文件树的树形结构。
本步骤中,可以按照查找到的文件夹表项和文件表项之间的关联关系,即步骤303中获取到的关联数据,渲染目标文件所属的目标文件树,在WEB端的WEB页面呈现目标文件树的树形结构,该树形结构中包含目标文件树的每一级文件夹的文件夹名称和文件的文件名称。
步骤305:根据目标文件的文件标识查找目标文件的文件内容。
步骤306:将目标文件作为被激活文件,在文件呈现区内呈现目标文件的文件内容。
需要说明的是,步骤303至步骤304,与步骤305至步骤306之间的执行没有先后时间顺序,可以同时执行,也可以先执行步骤305至步骤306,图3A所示步骤关系仅为图示方便。
结合图1,假设WEB页面上一次关闭前,被激活文件为文件A,则应用本实施例再次打开WEB页面时,如图3D所示,在文件呈现区直接呈现文件A,并在内容栏显示文件A的文件内容,同时在树形结构呈现区呈现出文件A所属的目标文件树的树形结构,对于其他树形结构,则仅展现第一级父文件夹,如图3D中的文件夹3。
由上述实施例可见,该实施例在WEB页面呈现树形文件时,可以通过获取与目标文件关联的文件数据,从目标文件反向定位到目标文件树的树形结构,进而直接呈现该树形结构,在现有从树形结构单向定位到目标文件的基础上,实现了树形结构与文件之间的双向交互,通过扩展交互方式,从而提高了在WEB端呈现树形文件的灵活性;并且,在WEB页面打开时,除了可以呈现目标文件树的树形结构,还可以在文件呈现区激活目标文件,并呈现目标文件的文件内容,从而使WEB端用户直接查看到WEB页面上一次关闭前的文件内容,提高了文件呈现的灵活性,提升了在WEB端操作树形文件
的便利性。
本申请呈现树形文件的装置的实施例可以应用WEB端设备上。装置实施例可以通过软件实现,也可以通过硬件或者软硬件结合的方式实现。以软件实现为例,作为一个逻辑意义上的装置,是通过其所在设备的处理器将非易失性存储器中对应的计算机程序指令读取到内存中运行形成的。从硬件层面而言,如图4所示,为本申请呈现树形文件的装置所在设备的一种硬件结构图,除了图4所示的处理器、内存、网络接口、以及非易失性存储器之外,实施例中装置所在的设备通常根据该设备的实际功能,还可以包括其他硬件,图4中不再一一示出。
参见图5,为本申请呈现树形文件的装置的一个实施例框图:
该装置包括:查找单元510、获取单元520和呈现单元530。
其中,查找单元510,用于当接收到在WEB端打开树形文件的命令时,查找目标文件的文件标识;
获取单元520,用于根据所述文件标识获取与所述目标文件关联的文件数据;
呈现单元530,用于根据所述文件数据在所述WEB端的WEB页面呈现所述目标文件所属的目标文件树的树形结构。
参见图6,为本申请呈现树形文件的装置的另一个实施例框图:
该装置包括:维护单元610、查找单元620、获取单元630和呈现单元640。
其中,维护单元610,用于通过数据库维护在所述WEB页面的文件呈现区内被打开文件的文件标识,所述被打开文件包括已呈现文件内容的被激活文件、以及未呈现文件内容的被选中文件;
查找单元620,用于从所述数据库中查询所述目标文件的文件标识,所述目标文件的文件标识为所述WEB页面上一次关闭时在所述数据库中记录的被激活文件的文件标识;
获取单元630,用于根据所述文件标识获取与所述目标文件关联的文件数据;
呈现单元640,用于根据所述文件数据在所述WEB端的WEB页面呈现所述目标文件所属的目标文件树的树形结构。
在一个可选的实现方式中,所述维护单元610可以包括(图6中未示出):
更新子单元,用于当所述被打开文件中的被激活文件发生切换时,在所述数据库中更新切换后的被激活文件的文件标识和被选中文件的文件标识;
删除子单元,用于当所述被打开文件中的任一文件被关闭时,在所述数据库中删除
被关闭文件的文件标识。
在另一个可选的实现方式中:
所述查找单元620,还可以用于根据所述目标文件的文件标识查找所述目标文件的文件内容;
所述呈现单元640,还可以用于将所述目标文件作为被激活文件,在所述文件呈现区内呈现所述目标文件的文件内容。
在另一个可选的实现方式中,所述获取单元630可以包括(图6中未示出):
第一查找子单元,用于根据所述文件标识在数据库中查找预先保存的树形文件的数据结构,获得所述目标文件所属的每一级父文件夹的文件夹表项;
第二查找子单元,用于根据所述每一级父文件夹的文件夹标识查找所述每一级父文件夹所包含文件夹的文件夹表项和文件的文件表项;
其中,每个文件夹表项中包含文件夹的文件夹标识、文件夹名称、以及文件夹所属父文件夹的文件夹标识,每个文件表项中包含文件的文件标识、文件名称、以及文件所属父文件夹的文件夹标识。
在另一个可选的实现方式中,所述呈现单元640可以包括(图6中未示出):
渲染子单元,用于按照查找到的文件夹表项和文件表项之间的关联关系渲染所述目标文件所属的目标文件树;
呈现子单元,用于在所述WEB端的WEB页面呈现所述目标文件树的树形结构,所述树形结构中包含所述目标文件树的每一级文件夹的文件夹名称和文件的文件名称。
上述装置中各个单元的功能和作用的实现过程具体详见上述方法中对应步骤的实现过程,在此不再赘述。
对于装置实施例而言,由于其基本对应于方法实施例,所以相关之处参见方法实施例的部分说明即可。以上所描述的装置实施例仅仅是示意性的,其中所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部模块来实现本申请方案的目的。本领域普通技术人员在不付出创造性劳动的情况下,即可以理解并实施。
由上述实施例可见,上述实施例在WEB页面呈现树形文件时,可以通过获取与目标文件关联的文件数据,从目标文件反向定位到目标文件树的树形结构,进而直接呈现该树形结构,在现有从树形结构单向定位到目标文件的基础上,实现了树形结构与文件
之间的双向交互,通过扩展交互方式,从而提高了在WEB端呈现树形文件的灵活性。
本领域技术人员在考虑说明书及实践这里公开的发明后,将容易想到本申请的其它实施方案。本申请旨在涵盖本申请的任何变型、用途或者适应性变化,这些变型、用途或者适应性变化遵循本申请的一般性原理并包括本申请未公开的本技术领域中的公知常识或惯用技术手段。说明书和实施例仅被视为示例性的,本申请的真正范围和精神由下面的权利要求指出。
应当理解的是,本申请并不局限于上面已经描述并在附图中示出的精确结构,并且可以在不脱离其范围进行各种修改和改变。本申请的范围仅由所附的权利要求来限制。
Claims (13)
- 一种呈现树形文件的方法,其特征在于,所述方法包括:当接收到在WEB端打开树形文件的命令时,查找目标文件的文件标识;根据所述文件标识获取与所述目标文件关联的文件数据;根据所述文件数据在所述WEB端的WEB页面呈现所述目标文件所属的目标文件树的树形结构。
- 根据权利要求1所述的方法,其特征在于,所述方法还包括:通过数据库维护在所述WEB页面的文件呈现区内被打开文件的文件标识,所述被打开文件包括已呈现文件内容的被激活文件、以及未呈现文件内容的被选中文件;所述查找目标文件的文件标识,包括:从所述数据库中查询所述目标文件的文件标识,所述目标文件的文件标识为所述WEB页面上一次关闭时在所述数据库中记录的被激活文件的文件标识。
- 根据权利要求2所述的方法,其特征在于,通过数据库维护在所述WEB页面的文件呈现区内被打开文件的文件标识,包括:当所述被打开文件中的被激活文件发生切换时,在所述数据库中更新切换后的被激活文件的文件标识和被选中文件的文件标识;当所述被打开文件中的任一文件被关闭时,在所述数据库中删除被关闭文件的文件标识。
- 根据权利要求2所述的方法,其特征在于,所述方法还包括:根据所述目标文件的文件标识查找所述目标文件的文件内容;将所述目标文件作为被激活文件,在所述文件呈现区内呈现所述目标文件的文件内容。
- 根据权利要求1所述的方法,其特征在于,所述根据所述文件标识获取与所述目标文件关联的文件数据,包括:根据所述文件标识在数据库中查找预先保存的树形文件的数据结构,获得所述目标文件所属的每一级父文件夹的文件夹表项;根据所述每一级父文件夹的文件夹标识查找所述每一级父文件夹所包含文件夹的文件夹表项和文件的文件表项;其中,每个文件夹表项中包含文件夹的文件夹标识、文件夹名称、以及文件夹所属父文件夹的文件夹标识,每个文件表项中包含文件的文件标识、文件名称、以及文件所 属父文件夹的文件夹标识。
- 根据权利要求5所述的方法,其特征在于,所述根据所述文件数据在所述WEB端的WEB页面呈现所述目标文件所属的目标文件树的树形结构,包括:按照查找到的文件夹表项和文件表项之间的关联关系渲染所述目标文件所属的目标文件树;在所述WEB端的WEB页面呈现所述目标文件树的树形结构,所述树形结构中包含所述目标文件树的每一级文件夹的文件夹名称和文件的文件名称。
- 一种呈现树形文件的装置,其特征在于,所述装置包括:查找单元,用于当接收到在WEB端打开树形文件的命令时,查找目标文件的文件标识;获取单元,用于根据所述文件标识获取与所述目标文件关联的文件数据;呈现单元,用于根据所述文件数据在所述WEB端的WEB页面呈现所述目标文件所属的目标文件树的树形结构。
- 根据权利要求7所述的装置,其特征在于,所述装置还包括:维护单元,用于通过数据库维护在所述WEB页面的文件呈现区内被打开文件的文件标识,所述被打开文件包括已呈现文件内容的被激活文件、以及未呈现文件内容的被选中文件;所述查找单元,具体用于从所述数据库中查询所述目标文件的文件标识,所述目标文件的文件标识为所述WEB页面上一次关闭时在所述数据库中记录的被激活文件的文件标识。
- 根据权利要求8所述的装置,其特征在于,所述维护单元包括:更新子单元,用于当所述被打开文件中的被激活文件发生切换时,在所述数据库中更新切换后的被激活文件的文件标识和被选中文件的文件标识;删除子单元,用于当所述被打开文件中的任一文件被关闭时,在所述数据库中删除被关闭文件的文件标识。
- 根据权利要求8所述的装置,其特征在于,所述查找单元,还用于根据所述目标文件的文件标识查找所述目标文件的文件内容;所述呈现单元,还用于将所述目标文件作为被激活文件,在所述文件呈现区内呈现所述目标文件的文件内容。
- 根据权利要求7所述的装置,其特征在于,所述获取单元包括:第一查找子单元,用于根据所述文件标识在数据库中查找预先保存的树形文件的数据结构,获得所述目标文件所属的每一级父文件夹的文件夹表项;第二查找子单元,用于根据所述每一级父文件夹的文件夹标识查找所述每一级父文件夹所包含文件夹的文件夹表项和文件的文件表项;其中,每个文件夹表项中包含文件夹的文件夹标识、文件夹名称、以及文件夹所属父文件夹的文件夹标识,每个文件表项中包含文件的文件标识、文件名称、以及文件所属父文件夹的文件夹标识。
- 根据权利要求11所述的装置,其特征在于,所述呈现单元包括:渲染子单元,用于按照查找到的文件夹表项和文件表项之间的关联关系渲染所述目标文件所属的目标文件树;呈现子单元,用于在所述WEB端的WEB页面呈现所述目标文件树的树形结构,所述树形结构中包含所述目标文件树的每一级文件夹的文件夹名称和文件的文件名称。
- 一种WEB端设备,其特征在于,包括:处理器;用于存储所述处理器可执行指令的存储器;其中,所述处理器被配置为:当接收到在WEB端打开树形文件的命令时,查找目标文件的文件标识;根据所述文件标识获取与所述目标文件关联的文件数据;根据所述文件数据在所述WEB端的WEB页面呈现所述目标文件所属的目标文件树的树形结构。
Applications Claiming Priority (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201510409171.4A CN106339400B (zh) | 2015-07-13 | 2015-07-13 | 呈现树形文件的方法、装置及设备 |
| CN201510409171.4 | 2015-07-13 |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| WO2017008655A1 true WO2017008655A1 (zh) | 2017-01-19 |
Family
ID=57757315
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| PCT/CN2016/088326 Ceased WO2017008655A1 (zh) | 2015-07-13 | 2016-07-04 | 呈现树形文件的方法、装置及设备 |
Country Status (2)
| Country | Link |
|---|---|
| CN (1) | CN106339400B (zh) |
| WO (1) | WO2017008655A1 (zh) |
Families Citing this family (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN109522282B (zh) * | 2018-09-29 | 2024-02-02 | 中国平安人寿保险股份有限公司 | 图片管理方法、装置、计算机装置及存储介质 |
| CN109814778B (zh) * | 2018-12-24 | 2020-12-22 | 天津字节跳动科技有限公司 | 小程序选项卡的实现方法、装置、电子设备及介质 |
| CN110442553B (zh) * | 2019-07-05 | 2021-02-26 | 深圳赛安特技术服务有限公司 | 文件管理方法、装置、计算机设备和存储介质 |
Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN102722487A (zh) * | 2011-03-30 | 2012-10-10 | 腾讯科技(深圳)有限公司 | 文件管理方法和装置 |
| CN103077199A (zh) * | 2012-12-26 | 2013-05-01 | 北京思特奇信息技术股份有限公司 | 一种文件资源查找定位方法及装置 |
| CN103440271A (zh) * | 2013-08-02 | 2013-12-11 | 亚太宝龙科技(湖南)有限公司 | 操作系统中展示历史目录的方法及其装置 |
| CN104598260A (zh) * | 2013-10-31 | 2015-05-06 | 安凯(广州)微电子技术有限公司 | 一种列表项标识、添加和修改的方法及装置 |
Family Cites Families (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US7062532B1 (en) * | 1999-03-25 | 2006-06-13 | Autodesk, Inc. | Method and apparatus for drawing collaboration on a network |
| US20090006201A1 (en) * | 2003-08-28 | 2009-01-01 | Faseler Jr Walter L | Method and apparatus for storing and accessing URL links |
| CN102819572B (zh) * | 2012-07-20 | 2015-09-09 | 迈普通信技术股份有限公司 | 文档管理系统中目录数据的显示方法及系统 |
| CN102999591B (zh) * | 2012-11-16 | 2016-07-06 | 北京奇虎科技有限公司 | 文件管理方法及装置 |
| CN103023972B (zh) * | 2012-11-16 | 2015-11-25 | 北京奇虎科技有限公司 | 一种对文件进行管理的方法和装置 |
-
2015
- 2015-07-13 CN CN201510409171.4A patent/CN106339400B/zh active Active
-
2016
- 2016-07-04 WO PCT/CN2016/088326 patent/WO2017008655A1/zh not_active Ceased
Patent Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN102722487A (zh) * | 2011-03-30 | 2012-10-10 | 腾讯科技(深圳)有限公司 | 文件管理方法和装置 |
| CN103077199A (zh) * | 2012-12-26 | 2013-05-01 | 北京思特奇信息技术股份有限公司 | 一种文件资源查找定位方法及装置 |
| CN103440271A (zh) * | 2013-08-02 | 2013-12-11 | 亚太宝龙科技(湖南)有限公司 | 操作系统中展示历史目录的方法及其装置 |
| CN104598260A (zh) * | 2013-10-31 | 2015-05-06 | 安凯(广州)微电子技术有限公司 | 一种列表项标识、添加和修改的方法及装置 |
Also Published As
| Publication number | Publication date |
|---|---|
| CN106339400B (zh) | 2019-09-17 |
| CN106339400A (zh) | 2017-01-18 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US11836112B2 (en) | Path resolver for client access to distributed file systems | |
| CN102937980B (zh) | 一种集群数据库数据查询方法 | |
| US20100274784A1 (en) | Virtual disk from network shares and file servers | |
| JP2020506461A5 (zh) | ||
| US9877183B2 (en) | Terminal and processing method for head portrait of contact person | |
| JP2017529627A5 (zh) | ||
| US8898208B2 (en) | Method and system for processing images | |
| WO2014042889A3 (en) | Software-defined network attachable storage system and method | |
| JP2016520919A5 (zh) | ||
| CA2974394A1 (en) | Distributed index for fault tolerant object memory fabric | |
| CN109491560B (zh) | 应用程序的启动方法和装置 | |
| JP2008257338A5 (zh) | ||
| CN102262650A (zh) | 链接的数据库 | |
| CN103268343A (zh) | 将关系数据库和缓存透明结合的系统和方法 | |
| WO2017008655A1 (zh) | 呈现树形文件的方法、装置及设备 | |
| US20210248107A1 (en) | Kv storage device and method of using kv storage device to provide file system | |
| CN109040222A (zh) | 一种定位寻物系统及方法 | |
| WO2019041441A1 (zh) | 列表视图的更新装置、方法及计算机可读存储介质 | |
| US12124409B1 (en) | Systems and methods for real-time file storage and retrieval | |
| CN105338073A (zh) | 一种文件目录的处理方法、服务器和系统 | |
| WO2016192456A1 (zh) | 网络盘本地挂载处理方法、装置及系统 | |
| US10891259B2 (en) | User driven data pre-fetch | |
| CN105138275B (zh) | 一种Lustre存储系统数据共享方法 | |
| RU2017109775A (ru) | Унифицированный поиск на персональном вычислительном устройстве | |
| CN105138246A (zh) | 一种切换搜索类型的方法和装置 |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| 121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 16823802 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: 16823802 Country of ref document: EP Kind code of ref document: A1 |