CN109189728B - Intelligent hardware device, magnetic disk data processing method and storage medium - Google Patents

Intelligent hardware device, magnetic disk data processing method and storage medium Download PDF

Info

Publication number
CN109189728B
CN109189728B CN201810791052.3A CN201810791052A CN109189728B CN 109189728 B CN109189728 B CN 109189728B CN 201810791052 A CN201810791052 A CN 201810791052A CN 109189728 B CN109189728 B CN 109189728B
Authority
CN
China
Prior art keywords
directory
node
file
directory node
data
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.)
Active
Application number
CN201810791052.3A
Other languages
Chinese (zh)
Other versions
CN109189728A (en
Inventor
朱世伟
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Onething Technology Co Ltd
Original Assignee
Shenzhen Onething Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Onething Technology Co Ltd filed Critical Shenzhen Onething Technology Co Ltd
Priority to CN201810791052.3A priority Critical patent/CN109189728B/en
Publication of CN109189728A publication Critical patent/CN109189728A/en
Application granted granted Critical
Publication of CN109189728B publication Critical patent/CN109189728B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

The invention discloses an intelligent hardware device, a disk data processing method and a storage medium. The invention scans the file directory of the data file; extracting one or more directory tags from the scanned file directory; respectively associating and mapping each data file under each file directory with a corresponding directory label, and establishing a corresponding relation; after receiving a file query request with a directory tag sent by a user terminal, determining preset type file information of each data file corresponding to the directory tag in the query request according to the corresponding relation data, and generating and feeding back a file query result corresponding to the query request to the user terminal. Compared with the prior art, the file query method and the file query device improve the efficiency and accuracy of file query and are simple to operate.

Description

Intelligent hardware device, magnetic disk data processing method and storage medium
Technical Field
The present invention relates to the field of intelligent hardware technologies, and in particular, to an intelligent hardware device, a disk data processing method, and a storage medium.
Background
Along with the improvement of people's standard of living, people also more and more powerful to intelligent hardware (intelligent hardware refers to through the mode of software and hardware combination, reforms transform traditional equipment, and then lets it possess intelligent function, and after the intellectuality, the hardware possesses the ability of connecting, realizes the loading of internet service, has possessed added values such as big data, for example, smart mobile phone, smart watch, smart television, intelligent bracelet etc.). One of the most convenient functions provided by intelligent hardware for users is that the intelligent hardware can be remotely controlled by means of remote access. For example, in a communication system architecture composed of an intelligent hardware device, a server, and a user terminal, the user terminal often needs to perform data interaction (e.g., query, storage, deletion, etc. of a file) with the intelligent hardware device.
However, in the disk of the existing intelligent hardware device, data files are generally managed in the form of a file directory (for example, file query, storage, deletion, etc.), for example, a user wants to perform file query in the disk (the disk refers to a non-volatile memory, such as a hard disk). The general query method includes: the method is characterized in that a user needs to be very familiar with the directory structure of a disk, the disk directory of the user is well organized and classified by the user, so that the user can quickly find the desired object, the operation is complex, and errors are easy to occur; and in the second mode, the required data file is searched by searching the key word, and the mode requires that the user knows the file name or the key word of the data file required by the user, otherwise, the data file cannot be searched and the speed is low.
Therefore, how to import the data file into the disk for storage to quickly and accurately query the desired data file has become a technical problem to be solved.
Disclosure of Invention
The invention mainly aims to provide intelligent hardware equipment, a disk data processing method and a storage medium, and aims to solve the problem that how to quickly and accurately query a desired data file after the data file is imported into a disk for storage.
In order to achieve the above object, the present invention provides an intelligent hardware device, which includes a first memory and a processor, where the first memory stores a disk data processing program operable on the processor, and the disk data processing program, when executed by the processor, implements the following steps:
a scanning step: scanning a file directory of data files in real time or at regular time or after receiving a classifying and storing instruction, wherein the data files are stored in electronic equipment in communication connection with the intelligent hardware equipment;
the extraction step comprises: extracting one or more directory tags from the scanned file directory according to a predetermined tag extraction rule;
a mapping establishing step: respectively associating and mapping each data file under each file directory with a corresponding directory label, and establishing a corresponding relation between preset type file information of each data file and the directory label associated and mapped;
a storage step: storing the corresponding relation data;
and (3) query step: after a file query request with a directory tag is sent by a corresponding user terminal, determining preset type file information of each data file corresponding to the directory tag in the query request according to the corresponding relation data, generating a file query result corresponding to the query request based on the determined preset type file information, and feeding the generated file query result back to the user terminal.
Preferably, the electronic device in communication connection with the intelligent hardware device includes a first storage area and a second storage area, the data file and the file directory of the data file are stored in the first storage area, and the correspondence data is stored in the second storage area.
Preferably, the processor executes the disk data processing program, and after the extracting step, further implements the steps of:
and establishing an association relation among the directory labels.
Preferably, the predetermined tag extraction rule is:
establishing a node tree for each directory node of the file directory, wherein the node tree comprises a plurality of directory node branches, each directory node branch comprises a main directory node and a subdirectory node, and each superior directory node is a main directory node of a subordinate directory node of the superior directory node;
determining the lowest common directory node in each directory node branch, wherein the lowest common directory node of one directory node branch refers to a directory node which is shared by other directory node branches and all corresponding lower subdirectory nodes in the directory node branches are not common directory nodes;
and respectively combining the determined common directory node at the lowest level of each directory node branch and the node names of all the corresponding upper level directory nodes according to the position sequence of the corresponding directory node branch to generate a combined name, wherein the combined name is the directory label of the corresponding directory node branch.
Preferably, the predetermined tag extraction rule is:
establishing a node tree for each directory node of a file directory, wherein the node tree comprises a plurality of directory node branches, each directory node branch comprises a main directory node and a subdirectory node, and each superior directory node is a main directory node of a subordinate directory node of the superior directory node;
respectively determining the ith-level directory node in each directory node branch, wherein i is a positive integer greater than 1;
and respectively combining the determined ith-level directory node of each directory node branch and the node names of all the corresponding upper-level directory nodes according to the position sequence of the corresponding directory node branch to generate a combined name, wherein the combined name is the directory label of the corresponding directory node branch.
Preferably, the processor executes the disk data processing program, and before the storing step, further implements the steps of:
respectively determining the number of data files corresponding to each directory label;
sequencing the directory labels according to the size sequence of the number of the corresponding data files;
when the size sequence is from large to small, the preset number of directory tags in the front are reserved, and the other directory tags except the reserved directory tags are deleted, or when the size sequence is from small to large, the preset number of directory tags in the back are reserved, and the other directory tags except the reserved directory tags are deleted.
Preferably, the processor executes the magnetic disk data processing program, and before the storing step, further implements the steps of:
respectively determining the number of data files corresponding to each directory label;
and deleting the directory label when the number of the data files corresponding to the directory label is less than a preset threshold value.
In addition, in order to achieve the above object, the present invention further provides an intelligent hardware device, where the intelligent hardware device includes a second memory and a processor, the second memory stores a disk data processing program operable on the processor, and the disk data processing program, when executed by the processor, implements the following steps:
a scanning step: scanning a file directory of data files in real time or at regular time or after receiving a classifying and storing instruction, wherein the data files are stored in the second memory;
the extraction step comprises: extracting one or more directory tags from the scanned file directory according to a predetermined tag extraction rule;
a mapping establishing step: respectively associating and mapping each data file under each file directory with a corresponding directory label, and establishing a corresponding relation between preset type file information of each data file and the directory label associated and mapped;
a storage step: storing the corresponding relation data;
and (3) query step: responding to a file query request with a directory tag sent by a user terminal, determining preset type file information of each data file corresponding to the directory tag in the query request according to the corresponding relation data, generating a file query result corresponding to the query request based on the determined preset type file information, and feeding the generated file query result back to the user terminal.
Preferably, the second memory further includes a first storage area and a second storage area, the data file and the file directory of the data file are stored in the first storage area, and the correspondence data is stored in the second storage area.
Preferably, the processor executes the disk data processing program, and after the extracting step, further implements the steps of:
and establishing an association relation among the directory labels.
Preferably, the predetermined tag extraction rule is:
establishing a node tree for each directory node of the file directory, wherein the node tree comprises a plurality of directory node branches, each directory node branch comprises a main directory node and a subdirectory node, and each superior directory node is a main directory node of a subordinate directory node of the superior directory node;
determining the lowest common directory node in each directory node branch, wherein the lowest common directory node of one directory node branch refers to a directory node which is shared by other directory node branches and all corresponding lower subdirectory nodes in the directory node branches are not common directory nodes;
and respectively combining the determined common directory node at the lowest level of each directory node branch and the node names of all the corresponding upper level directory nodes according to the position sequence of the corresponding directory node branch to generate a combined name, wherein the combined name is the directory label of the corresponding directory node branch.
Preferably, the predetermined tag extraction rule is:
establishing a node tree for each directory node of a file directory, wherein the node tree comprises a plurality of directory node branches, each directory node branch comprises a main directory node and a subdirectory node, and each superior directory node is a main directory node of a subordinate directory node of the superior directory node;
respectively determining the ith-level directory node in each directory node branch, wherein i is a positive integer greater than 1;
and respectively combining the determined ith-level directory node of each directory node branch and the node names of all the corresponding upper-level directory nodes according to the position sequence of the corresponding directory node branch to generate a combined name, wherein the combined name is the directory label of the corresponding directory node branch.
Preferably, the processor executes the disk data processing program, and before the storing step, further implements the steps of:
respectively determining the number of data files corresponding to each directory label;
sequencing the directory labels according to the size sequence of the number of the corresponding data files;
when the size sequence is from large to small, the preset number of directory tags in the front are reserved, and the other directory tags except the reserved directory tags are deleted, or when the size sequence is from small to large, the preset number of directory tags in the back are reserved, and the other directory tags except the reserved directory tags are deleted.
Preferably, the processor executes the disk data processing program, and before the storing step, further implements the steps of:
respectively determining the number of data files corresponding to each directory label;
and deleting the directory label when the number of the data files corresponding to the directory label is smaller than a preset threshold value.
In addition, in order to achieve the above object, the present invention further provides a disk data processing method, which is applied to an intelligent hardware device storing a data file, or an intelligent hardware device communicatively connected to an electronic device storing the data file, and is characterized in that the method includes the steps of:
a scanning step: scanning a file directory of the data file in real time or at regular time or after receiving a classifying and storing instruction;
the extraction step comprises: extracting one or more directory tags from the scanned file directory according to a predetermined tag extraction rule;
a mapping establishing step: respectively associating and mapping each data file under each file directory with a corresponding directory label, and establishing a corresponding relation between preset type file information of each data file and the directory label associated and mapped;
a storage step: storing the corresponding relation data;
and (3) query step: responding to a file query request with a directory tag sent by a user terminal, determining preset type file information of each data file corresponding to the directory tag in the query request according to the corresponding relation data, generating a file query result corresponding to the query request based on the determined preset type file information, and feeding the generated file query result back to the user terminal.
Preferably, after the extracting step, the method further comprises:
and establishing an association relation among the directory labels.
Preferably, the predetermined tag extraction rule is:
establishing a node tree for each directory node of the file directory, wherein the node tree comprises a plurality of directory node branches, each directory node branch comprises a main directory node and a subdirectory node, and each superior directory node is a main directory node of a subordinate directory node of the superior directory node;
determining the lowest common directory node in each directory node branch, wherein the lowest common directory node of one directory node branch refers to a directory node which is shared by other directory node branches and all corresponding lower subdirectory nodes in the directory node branches are not common directory nodes;
and respectively combining the determined common directory node at the lowest level of each directory node branch and the node names of all the corresponding upper level directory nodes according to the position sequence of the corresponding directory node branch to generate a combined name, wherein the combined name is the directory label of the corresponding directory node branch.
Preferably, the predetermined tag extraction rule is:
establishing a node tree for each directory node of a file directory, wherein the node tree comprises a plurality of directory node branches, each directory node branch comprises a main directory node and a subdirectory node, and each superior directory node is a main directory node of a subordinate directory node of the superior directory node;
respectively determining the ith-level directory node in each directory node branch, wherein i is a positive integer greater than 1;
and respectively combining the determined ith-level directory node of each directory node branch and the node names of all the corresponding upper-level directory nodes according to the position sequence of the corresponding directory node branch to generate a combined name, wherein the combined name is the directory label of the corresponding directory node branch.
Preferably, before the storing step, the method further comprises:
respectively determining the number of data files corresponding to each directory label;
sequencing the directory labels according to the size sequence of the number of the corresponding data files;
when the size sequence is from large to small, the preset number of directory tags in the front are reserved, and the other directory tags except the reserved directory tags are deleted, or when the size sequence is from small to large, the preset number of directory tags in the back are reserved, and the other directory tags except the reserved directory tags are deleted.
Preferably, before the storing step, the method further comprises:
respectively determining the number of data files corresponding to each directory label;
and deleting the directory label when the number of the data files corresponding to the directory label is smaller than a preset threshold value.
Further, to achieve the above object, the present invention also proposes a computer-readable storage medium storing a disk data processing program, the disk data processing program being executable by at least one processor to cause the at least one processor to execute the steps of the disk data processing method according to any one of the above.
The invention scans the file directory of the data file; extracting one or more directory tags from the scanned file directory; respectively associating and mapping each data file under each file directory with a corresponding directory label, and establishing a corresponding relation; after receiving a file query request with a directory tag sent by a user terminal, determining preset type file information of each data file corresponding to the directory tag in the query request according to the corresponding relation data, and generating and feeding back a file query result corresponding to the query request to the user terminal. Compared with the prior art, the method and the device have the advantages that the mapping relation is established between the directory labels extracted from the file directory and the data files, when the files are inquired, the corresponding data files can be quickly and accurately inquired only by providing the directory labels through the user terminal, the file inquiry efficiency and accuracy are improved, and the operation is simple.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the structures shown in the drawings without creative efforts.
FIG. 1 is a schematic diagram of an alternative operating environment of the first, second and third embodiments of the disk data processing program of the present invention;
FIG. 2 is a schematic diagram of an alternative operating environment of the first, second and third embodiments of the disk data processing program of the present invention;
FIG. 3 is a block diagram of a first and second embodiment of a disk data processing program according to the present invention;
FIG. 4 is a schematic view of a node tree of a file directory;
FIG. 5 is a program block diagram of a third embodiment of a disk data processing program according to the present invention;
FIG. 6 is a flowchart illustrating a first embodiment of a method for processing disk data according to the present invention;
FIG. 7 is a flowchart illustrating a second embodiment of a disk data processing method according to the present invention;
FIG. 8 is a flowchart illustrating a disk data processing method according to a third embodiment of the present invention.
The implementation, functional features and advantages of the objects of the present invention will be further explained with reference to the accompanying drawings.
Detailed Description
The principles and features of this invention are described below in conjunction with the following drawings, which are set forth by way of illustration only and are not intended to limit the scope of the invention.
The invention provides a disk data processing program.
Referring to fig. 1, an optional operation environment of the first, second, and third embodiments of the disk data processing program 10 according to the present invention is shown.
In the embodiment, the present invention can be applied to an application environment including, but not limited to, the smart hardware device 1 and the user terminal 2. The intelligent hardware device 1 is in communication connection with the user terminal 2.
The intelligent hardware device 1 is configured to receive and respond to a service request (e.g., a file query request, etc.) sent by the user terminal 2, and feed back a service request processing result to the user terminal 2.
The user terminal 2 is configured to send a service request to the intelligent hardware device 1, and receive a service request processing result fed back by the intelligent hardware device 1.
In the present embodiment, the disk data processing program 10 is installed and run in the intelligent hardware device 1. The intelligent hardware device 1 may be a desktop computer, a notebook, a palm computer, a server, or other computing devices. The intelligent hardware device 1 may include, but is not limited to, a memory 11, a processor 12, and a display 13. Fig. 2 only shows the intelligent hardware device 1 with components 11-13, but it is to be understood that not all of the shown components are required to be implemented, and that more or fewer components may be implemented instead.
The memory 11 may in some embodiments be an internal storage unit of the intelligent hardware device 1, such as a hard disk or a memory of the intelligent hardware device 1. The memory 11 may also be an external storage device of the intelligent hardware device 1 in other embodiments, such as a plug-in hard disk provided on the intelligent hardware device 1, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and so on. Further, the memory 11 may also include both an internal storage unit and an external storage device of the intelligent hardware device 1. The memory 11 is used for storing application software installed in the intelligent hardware device 1 and various types of data, such as program codes of the disk data processing program 10. The memory 11 may also be used to temporarily store data that has been output or is to be output. In the present embodiment, the memory 11 includes a first storage area 111 (e.g., a local database) and a second storage area 112, and the first storage area 111 is used for storing data files.
Processor 12, which in some embodiments may be a Central Processing Unit (CPU), microprocessor or other data Processing chip, executes program code stored in memory 11 or processes data, such as executes disk data Processing program 10.
The display 13 may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an OLED (Organic Light-Emitting Diode) touch panel, or the like in some embodiments. The display 13 is used for displaying information processed in the intelligent hardware device 1 and for displaying a visualized user interface. The components 11-13 of the intelligent hardware device 1 communicate with each other via a program bus.
Referring to fig. 2, it is a schematic diagram of another optional operating environment of the first, second, and third embodiments of the disk data processing program 10 according to the present invention.
In the embodiment, the present invention can also be applied to application environments including, but not limited to, the intelligent hardware device 1, the user terminal 2, and the electronic device 3. The intelligent hardware device 1 is in communication connection with the user terminal 2 and the electronic device 3 respectively.
Fig. 2 differs from fig. 1 in that a first storage area 111 and a second storage area 112 are provided in an electronic device 3 (e.g., a personal computer, a plug-in hard disk, a smart memory card, etc.) communicatively connected to the smart hardware device 1.
It should be noted that the second storage area 112 may be disposed in any other suitable device or apparatus besides the intelligent hardware device 1 and the electronic device 3.
Referring to fig. 3, a block diagram of a first and a second embodiment of the disk data processing program 10 according to the present invention is shown. In this embodiment, the disk data processing program 10 may be divided into one or more modules, and the one or more modules are stored in the memory 11 and executed by one or more processors (in this embodiment, the processor 12) to complete the present invention. For example, in fig. 3, the disk data processing program 10 may be divided into a scanning module 101, an extracting module 102, a mapping establishing module 103, a storage module 104, and a query module 105. The module referred to in the present invention refers to a series of computer program instruction segments capable of performing specific functions, and is more suitable than a program for describing the execution process of the disk data processing program 10 in the intelligent hardware device 1, wherein:
the scanning module 101 is configured to scan a file directory of the data file in real time or at regular time or after receiving the sorting and storing instruction.
The data files may be stored in the first storage area 111, and a file directory of the data files may be stored in the second storage area 112. An extracting module 102, configured to extract one or more directory tags from the scanned file directory according to a predetermined tag extraction rule.
Specifically, taking file directory D: \ PDF \ Setup Files as an example, the file directory is subjected to tag extraction to generate directory tags "D" and "PDF".
Preferably, in this embodiment, the predetermined tag extraction rule may refer to the following two schemes:
the first scheme is as follows:
first, a node tree is established for each directory node of the file directory, the node tree including a plurality of directory node branches (e.g., directory node branches "X1-X2-X3-X4", "X1-X2-X5-X6", "X1-X2-X5-X7", "X1-Z1-Z2-Z3", "X1-Y1-Y2", etc. in fig. 4). Each directory node branch includes a main directory node and a sub-directory node, each upper directory node is a main directory node of its lower directory node, for example, node X1 is a main directory node of nodes X1, Z1, Y1, and node X2 is a main directory node of nodes X3, X5.
Then, the lowest common directory node in each directory node branch is determined, the lowest common directory node of one directory node branch refers to a directory node which is common to other directory node branches and all corresponding lower subdirectory nodes in the directory node branch are not common directory nodes. For example, the lowest common directory node corresponding to the directory node branch "X1-X2-X3-X4" is node X2, and the lowest common directory nodes corresponding to "X1-X2-X5-X6" and "X1-X2-X5-X7" are both node X5.
And finally, respectively combining the determined lowest-level common directory node of each directory node branch and the node names of all the corresponding upper-level directory nodes according to the position sequence of the corresponding directory node branches to generate a combined name. The combination name is a directory label of the corresponding directory node branch, for example, the directory label corresponding to the directory node branch "X1-X2-X3-X4" is "X1-X2".
Scheme II:
first, a node tree is established for each directory node of the file directory, the node tree including a plurality of directory node branches (e.g., directory node branches "X1-X2-X3-X4", "X1-X2-X5-X6", "X1-X2-X5-X7", "X1-Z1-Z2-Z3", "X1-Y1-Y2", etc. in fig. 4). Each directory node branch includes a main directory node and a sub-directory node, each upper directory node is a main directory node of its lower directory node, for example, node X1 is a main directory node of nodes X1, Z1, Y1, and node X2 is a main directory node of nodes X3, X5.
Then, the ith level directory node in each directory node branch is determined separately, i being a positive integer greater than 1, i may be 2, for example, and the 2 nd level directory node of directory node branch "X1-X2-X3-X4" is "X2".
And finally, respectively combining the determined ith-level directory node of each directory node branch and the node names of all the corresponding upper-level directory nodes according to the position sequence of the corresponding directory node branch to generate a combined name. The combination name is a directory label of the corresponding directory node branch, for example, the directory label corresponding to the directory node branch "X1-X2-X3-X4" is "X1-X2".
The mapping establishing module 103 is configured to associate and map each data file in each file directory with a corresponding directory tag, and establish a corresponding relationship between preset type file information of each data file and the directory tag associated and mapped.
Specifically, each data file under each file directory is marked with a corresponding directory tag, for example, if the directory tag corresponding to the file directory a1 is a1, and the directory tag corresponding to the file directory a2 is a 2. Each data file under file directory A1 is mapped in association with directory tag a1, and each data file under file directory A2 is mapped in association with directory tag a 2. And establishing a corresponding relation between the preset type file information of each data file and the associated and mapped directory label.
The preset type file information includes storage path information, file name, and the like.
And the storage module 104 is configured to store the corresponding relationship data. For example, the storage module 104 stores the correspondence data in the second storage area 112.
The query module 105 is configured to respond to a file query request with a directory tag sent by a user terminal, determine preset type file information of each data file corresponding to the directory tag in the query request according to the corresponding relationship data, generate a file query result (e.g., a file query list) corresponding to the query request based on the determined preset type file information, and feed back the generated file query result to the user terminal.
The embodiment scans the file directory of the data file; extracting one or more directory tags from the scanned file directory; respectively associating and mapping each data file under each file directory with a corresponding directory label, and establishing a corresponding relation; after receiving a file query request with a directory tag sent by a user terminal, determining preset type file information of each data file corresponding to the directory tag in the query request according to the corresponding relation data, and generating and feeding back a file query result corresponding to the query request to the user terminal. Compared with the prior art, the embodiment establishes the mapping relationship between the directory tag extracted from the file directory and the data file, and when the file is queried, the corresponding data file can be queried quickly and accurately only by providing the directory tag through the user terminal, so that the efficiency and the accuracy of file query are improved, and the operation is simple.
Referring to fig. 3 again, in a second embodiment of the magnetic disk data processing program 10 of the present invention, in this embodiment, on the basis of the first embodiment, the mapping establishing module 103 is further configured to establish an association relationship between directory tags.
For example, directory hierarchy: the method comprises the following steps of/photo/shenzheng/nanshan/dsc _001.jpg, and two directory labels can be proposed according to the top two-layer directory name of the dsc _001.jpg file: shenzheng, nanshan, and when opening the shenzheng directory tag, also displaying an associated directory tag in association with: nanshan.
The scenario of associating tags may be in several ways:
in the first way, two tags are in a relationship of upper and lower layers, as in the above example, the two tags of shenzheng and nanchan belong to the relationship of upper and lower layers, and both tags have the same file dsc _001.jpg below, and thus belong to the associated tag.
In the second mode, both tags are associated with the A file. If the user manually marks a 'landscape' label on the/photo/scenzheng/nanshan/dsc _001.jpg file, the 'landscape' labels are all associated labels, and when any label is opened, the next associated label column displays the other two associated labels.
The mode III is that the labels have the same name: from the/photo/shenzheng/nanshan/dsc _001.jpg file can be extracted: two tags: shenzheng, nanshan, according to/video/shenzheng/DJI _002.MOV, also extracts: two tags, video, shenzheng, where the shenzheng tag already exists, so the shenzheng tag associates dsc _001.jpg and DJI _002.MOV files, and nanhan, video also has an association with both files, so: shenzheng, Nanshan and video belong to the related tags.
According to the embodiment, the incidence relation is established among the directory labels, so that the response accuracy of the user file query request can be further improved, and the query efficiency is effectively improved.
Referring to fig. 5, fig. 5 is a block diagram of a third embodiment of the disk data processing program 10 according to the present invention.
In this embodiment, on the basis of the first and second embodiments, the program further includes a deleting module 106, where the deleting module 106 is configured to:
first, the number of data files corresponding to each directory tag is determined.
And then, deleting the directory label when the number of the data files corresponding to the directory label is smaller than a preset threshold value.
In this embodiment, the deleting module 106 is further configured to:
first, the number of data files corresponding to each directory tag is determined.
Then, the directory labels are sorted according to the size sequence of the number of the corresponding data files. For example, the sorting is performed in a large-to-small order or a small-to-large order.
And finally, when the size sequence is from large to small, reserving the directory tags with the preset number in the front sequence, and deleting the directory tags except the reserved directory tags. Or if the size sequence is from small to large, reserving a preset number of directory tags ordered later, and deleting other directory tags except the reserved directory tags.
The embodiment deletes part of the target tags, which is beneficial to reducing the occupancy rate of the storage space.
In addition, the invention provides a disk data processing method.
As shown in fig. 6, fig. 6 is a flowchart illustrating a first embodiment of a disk data processing method according to the present invention.
In this embodiment, the method is applicable to an intelligent hardware device (for example, an intelligent hardware device configured with a first storage area and a second storage area) storing a data file, or an intelligent hardware device communicatively connected to an electronic device (for example, an electronic device configured with a first storage area and a second storage area) storing the data file, and the method includes:
step S10, scanning the file directory of the data file in real time or at regular time or after receiving the storage classifying instruction.
The data file may be stored in the first storage area, and a file directory of the data file may be stored in the second storage area. In other embodiments, the file directory of the data file may be stored in any other suitable device or apparatus besides the intelligent hardware device and the electronic device.
Step S20, extracting one or more directory tags from the scanned file directory according to a predetermined tag extraction rule.
Specifically, taking file directory D: \ PDF \ Setup Files as an example, the file directory is subjected to tag extraction to generate directory tags "D" and "PDF".
Preferably, in this embodiment, the predetermined tag extraction rule may refer to the following two schemes:
the first scheme is as follows:
first, a node tree is established for each directory node of the file directory, where the node tree includes a plurality of directory node branches (e.g., directory node branches "X1-X2-X3-X4", "X1-X2-X5-X6", "X1-X2-X5-X7", "X1-Z1-Z2-Z3", "X1-Y1-Y2", etc. in fig. 4). Each directory node branch includes a main directory node and a sub-directory node, each upper directory node is a main directory node of its lower directory node, for example, node X1 is a main directory node of nodes X1, Z1, Y1, and node X2 is a main directory node of nodes X3, X5.
Then, the lowest common directory node in each directory node branch is determined, the lowest common directory node of one directory node branch refers to a directory node which is common to other directory node branches and all corresponding lower subdirectory nodes in the directory node branch are not common directory nodes. For example, the lowest common directory node corresponding to the directory node branch "X1-X2-X3-X4" is node X2, and the lowest common directory nodes corresponding to "X1-X2-X5-X6" and "X1-X2-X5-X7" are both node X5.
And finally, respectively combining the determined lowest-level common directory node of each directory node branch and the node names of all the corresponding upper-level directory nodes according to the position sequence of the corresponding directory node branches to generate a combined name. The combination name is a directory label of the corresponding directory node branch, for example, the directory label corresponding to the directory node branch "X1-X2-X3-X4" is "X1-X2".
Scheme II:
first, a node tree is established for each directory node of the file directory, the node tree including a plurality of directory node branches (e.g., directory node branches "X1-X2-X3-X4", "X1-X2-X5-X6", "X1-X2-X5-X7", "X1-Z1-Z2-Z3", "X1-Y1-Y2", etc. in fig. 4). Each directory node branch includes a main directory node and a sub-directory node, each upper directory node is a main directory node of its lower directory node, for example, node X1 is a main directory node of nodes X1, Z1, Y1, and node X2 is a main directory node of nodes X3, X5.
Then, the ith level directory node in each directory node branch is determined separately, i being a positive integer greater than 1, i may be 2, for example, and the 2 nd level directory node of directory node branch "X1-X2-X3-X4" is "X2".
And finally, respectively combining the determined ith-level directory node of each directory node branch and the node names of all the corresponding upper-level directory nodes according to the position sequence of the corresponding directory node branch to generate a combined name. The combination name is a directory label of the corresponding directory node branch, for example, the directory label corresponding to the directory node branch "X1-X2-X3-X4" is "X1-X2".
Step S30, respectively associating and mapping each data file in each file directory with a corresponding directory label, and establishing a corresponding relationship between the preset type file information of each data file and the directory label associated and mapped.
Specifically, each data file under each file directory is marked with a corresponding directory tag, for example, if the directory tag corresponding to the file directory a1 is a1, and the directory tag corresponding to the file directory a2 is a 2. Each data file under file directory A1 is mapped in association with directory tag a1, and each data file under file directory A2 is mapped in association with directory tag a 2. And establishing a corresponding relation between the preset type file information of each data file and the associated and mapped directory label.
The preset type file information includes storage path information, file name, and the like.
And step S40, storing the corresponding relation data. For example, the correspondence data is stored in the second storage area.
Step S50, after responding to a file query request with a directory tag sent by a user terminal, determining preset type file information of each data file corresponding to the directory tag in the query request according to the corresponding relationship data, generating a file query result (e.g., a file query list) corresponding to the query request based on the determined preset type file information, and feeding back the generated file query result to the user terminal.
The embodiment scans the file directory of the data file; extracting one or more directory tags from the scanned file directory; respectively associating and mapping each data file under each file directory with a corresponding directory label, and establishing a corresponding relation; after receiving a file query request with a directory tag sent by a user terminal, determining preset type file information of each data file corresponding to the directory tag in the query request according to the corresponding relation data, and generating and feeding back a file query result corresponding to the query request to the user terminal. Compared with the prior art, the embodiment establishes the mapping relationship between the directory tag extracted from the file directory and the data file, and when the file is queried, the corresponding data file can be queried quickly and accurately only by providing the directory tag through the user terminal, so that the efficiency and the accuracy of file query are improved, and the operation is simple.
FIG. 7 is a flow chart of a second embodiment of a disk data processing method according to the present invention, and is shown in FIG. 7.
This embodiment is based on the first embodiment, and after step S20, the method further includes:
step S60, an association relationship is established between the directory labels.
For example, directory hierarchy: the upper two-layer directory name of the dsc _001.jpg file can be used to provide two directory tags: shenzhen, nanshan, and when opening the shenzhen directory tag, also displaying an associated directory tag in association with: nanshan.
The scenario of associating tags may be in several ways:
in the first way, two tags are in a relationship of upper and lower layers, as in the above example, the two tags of shenzhen and nanshan belong to the relationship of upper and lower layers, and both tags have the same file dsc _001.jpg below, and thus belong to the associated tag.
In the second mode, both tags are associated with the A file. If the user manually marks a 'landscape' label on the/photo/shenzhen/nanshan/dsc _001.jpg file, the labels 'shenzhen', 'nanshan' and 'landscape' are all associated labels, and when any one label is opened, the next associated label column displays the other two associated labels.
The mode III is that the labels have the same name: from the/photo/shenzhen/nanshan/dsc _001.jpg file can be extracted: two tags: shenzhen, nanshan, according to/video/shenzhen/DJI _002.MOV, also extracts: two tags, video, shenzhen, where the shenzhen tag already exists, so the shenzhen tag associates dsc _001.jpg and DJI _002.MOV files, and nanhan, video also has an association with both files, so: the shenzhen, nanshan and video belong to the associated tags.
According to the embodiment, the incidence relation is established among the directory labels, so that the response accuracy of the user file query request can be further improved, and the query efficiency is effectively improved.
FIG. 8 is a flow chart of a third embodiment of a disk data processing method according to the present invention, and is shown in FIG. 8.
In this embodiment, on the basis of the first and second embodiments, before the step S40, the method further includes:
in step S70, the number of data files corresponding to each directory label is determined.
Step S80, when the number of the data files corresponding to the directory label is smaller than the preset threshold value, deleting the directory label.
In this embodiment, the steps S70 and S80 may be replaced by the following steps:
first, the number of data files corresponding to each directory tag is determined.
Then, the directory labels are sorted according to the size sequence of the number of the corresponding data files. For example, the order is from large to small or from small to large.
And finally, when the size sequence is from large to small, reserving a preset number of directory tags sorted in the front, and deleting other directory tags except the reserved directory tags. Or if the sequence of the sizes is from small to large, reserving the directory tags of the preset number after the sequence, and deleting the directory tags except the reserved directory tags.
The embodiment deletes part of the target tags, which is beneficial to reducing the occupancy rate of the storage space.
Further, the present invention also provides a computer-readable storage medium, which stores a disk data processing program, where the disk data processing program is executable by at least one processor, so as to make the at least one processor execute the disk data processing method in any of the above embodiments.
The above description is only a preferred embodiment of the present invention, and is not intended to limit the scope of the present invention, and all modifications and equivalents of the present invention, which are made by the contents of the present specification and the accompanying drawings, or directly/indirectly applied to other related technical fields, are included in the scope of the present invention.

Claims (14)

1. An intelligent hardware device, comprising a first memory and a processor, wherein the first memory stores a disk data processing program operable on the processor, and the disk data processing program, when executed by the processor, implements the steps of:
a scanning step: scanning a file directory of data files in real time or at regular time or after receiving a classifying and storing instruction, wherein the data files are stored in electronic equipment in communication connection with the intelligent hardware equipment;
the extraction step comprises: extracting one or more directory tags from the scanned file directory according to a predetermined tag extraction rule that: establishing a node tree for each directory node of the file directory, wherein the node tree comprises a plurality of directory node branches, each directory node branch comprises a main directory node and a subdirectory node, and each superior directory node is a main directory node of a subordinate directory node of the superior directory node; determining the lowest common directory node in each directory node branch, wherein the lowest common directory node of one directory node branch refers to a directory node which is shared by other directory node branches and all corresponding lower subdirectory nodes in the directory node branches are not common directory nodes; respectively combining the determined lowest common directory node of each directory node branch and the node names of all the corresponding upper directory nodes according to the position sequence of the corresponding directory node branch to generate a combined name, wherein the combined name is the directory label of the corresponding directory node branch;
a mapping establishing step: respectively associating and mapping each data file under each file directory with a corresponding directory label, and establishing a corresponding relation between preset type file information of each data file and the directory label associated and mapped, wherein the preset type file information comprises storage path information and a file name;
a storage step: storing the corresponding relation data;
and (3) query step: responding to a file query request with a directory tag sent by a user terminal, determining preset type file information of each data file corresponding to the directory tag in the query request according to the corresponding relation data, generating a file query result corresponding to the query request based on the determined preset type file information, and feeding the generated file query result back to the user terminal.
2. The intelligent hardware device of claim 1, wherein the electronic device communicatively coupled to the intelligent hardware device comprises a first storage area and a second storage area, wherein the data files and file directories of the data files are stored in the first storage area, and wherein the correspondence data is stored in the second storage area.
3. The intelligent hardware device of claim 1, wherein said processor executes said disk data handler, and after said extracting step, further performs the steps of:
and establishing an association relation among the directory labels.
4. The intelligent hardware device of any of claims 1-3, wherein the predetermined tag extraction rule is:
establishing a node tree for each directory node of a file directory, wherein the node tree comprises a plurality of directory node branches, each directory node branch comprises a main directory node and a subdirectory node, and each superior directory node is a main directory node of a subordinate directory node of the superior directory node;
respectively determining the ith-level directory node in each directory node branch, wherein i is a positive integer greater than 1;
and respectively combining the determined ith-level directory node of each directory node branch and the node names of all the corresponding upper-level directory nodes according to the position sequence of the corresponding directory node branch to generate a combined name, wherein the combined name is the directory label of the corresponding directory node branch.
5. The intelligent hardware device according to any of claims 1 to 3, wherein the processor executes the disk data handler, further implementing, prior to the storing step, the steps of:
respectively determining the number of data files corresponding to each directory label;
sequencing the directory labels according to the size sequence of the number of the corresponding data files;
when the size sequence is from large to small, the preset number of directory tags in the front are reserved, and the other directory tags except the reserved directory tags are deleted, or when the size sequence is from small to large, the preset number of directory tags in the back are reserved, and the other directory tags except the reserved directory tags are deleted.
6. The intelligent hardware device according to any of claims 1 to 3, wherein the processor executes the disk data handler, further implementing, prior to the storing step, the steps of:
respectively determining the number of data files corresponding to each directory label;
and deleting the directory label when the number of the data files corresponding to the directory label is smaller than a preset threshold value.
7. An intelligent hardware device, comprising a second memory and a processor, wherein the second memory stores a disk data processing program operable on the processor, and the disk data processing program, when executed by the processor, implements the steps of:
a scanning step: scanning a file directory of data files in real time or at regular time or after receiving a classifying and storing instruction, wherein the data files are stored in the second memory;
the extraction step comprises: extracting one or more directory tags from the scanned file directory according to a predetermined tag extraction rule that: establishing a node tree for each directory node of the file directory, wherein the node tree comprises a plurality of directory node branches, each directory node branch comprises a main directory node and a subdirectory node, and each higher-level directory node is a main directory node of a lower-level directory node of the higher-level directory node; determining the lowest common directory node in each directory node branch, wherein the lowest common directory node of one directory node branch refers to a directory node which is shared by other directory node branches and all corresponding lower subdirectory nodes in the directory node branches are not common directory nodes; respectively combining the determined lowest common directory node of each directory node branch and the node names of all the corresponding upper directory nodes according to the position sequence of the corresponding directory node branch to generate a combined name, wherein the combined name is the directory label of the corresponding directory node branch;
a mapping establishing step: respectively associating and mapping each data file under each file directory with a corresponding directory label, and establishing a corresponding relation between preset type file information of each data file and the directory label associated and mapped, wherein the preset type file information comprises storage path information and a file name;
a storage step: storing the corresponding relation data;
and (3) query step: responding to a file query request with a directory tag sent by a user terminal, determining preset type file information of each data file corresponding to the directory tag in the query request according to the corresponding relation data, generating a file query result corresponding to the query request based on the determined preset type file information, and feeding the generated file query result back to the user terminal.
8. The intelligent hardware device of claim 7, wherein the second memory further comprises a first storage area and a second storage area, the data files and a file directory of the data files are stored in the first storage area, and the correspondence data is stored in the second storage area.
9. A disk data processing method is suitable for an intelligent hardware device with a data file stored therein or an intelligent hardware device in communication connection with an electronic device with the data file stored therein, and is characterized by comprising the following steps:
a scanning step: scanning a file directory of the data file in real time or at regular time or after receiving a classifying and storing instruction;
the extraction step comprises: extracting one or more directory tags from the scanned file directory according to predetermined tag extraction rules, the predetermined tag extraction rules being: establishing a node tree for each directory node of the file directory, wherein the node tree comprises a plurality of directory node branches, each directory node branch comprises a main directory node and a subdirectory node, and each superior directory node is a main directory node of a subordinate directory node of the superior directory node; determining the lowest common directory node in each directory node branch, wherein the lowest common directory node of one directory node branch refers to a directory node which is shared by other directory node branches and all corresponding lower subdirectory nodes in the directory node branches are not common directory nodes; respectively combining the determined lowest common directory node of each directory node branch and the node names of all the corresponding upper directory nodes according to the position sequence of the corresponding directory node branch to generate a combined name, wherein the combined name is the directory label of the corresponding directory node branch;
a mapping establishing step: respectively associating and mapping each data file under each file directory with a corresponding directory label, and establishing a corresponding relation between preset type file information of each data file and the directory label associated and mapped, wherein the preset type file information comprises storage path information and a file name;
a storage step: storing the corresponding relation data;
and (3) query step: responding to a file query request with a directory tag sent by a user terminal, determining preset type file information of each data file corresponding to the directory tag in the query request according to the corresponding relation data, generating a file query result corresponding to the query request based on the determined preset type file information, and feeding the generated file query result back to the user terminal.
10. The disk data processing method of claim 9, wherein after the extracting step, the method further comprises:
and establishing an association relation among the directory labels.
11. The magnetic disk data processing method according to claim 9 or 10, wherein the predetermined tag extraction rule is:
establishing a node tree for each directory node of a file directory, wherein the node tree comprises a plurality of directory node branches, each directory node branch comprises a main directory node and a subdirectory node, and each superior directory node is a main directory node of a subordinate directory node of the superior directory node;
respectively determining the ith-level directory node in each directory node branch, wherein i is a positive integer greater than 1;
and respectively combining the determined ith-level directory node of each directory node branch and the node names of all the corresponding upper-level directory nodes according to the position sequence of the corresponding directory node branch to generate a combined name, wherein the combined name is the directory label of the corresponding directory node branch.
12. A method of processing disc data according to claim 9 or 10, wherein prior to said storing step, the method further comprises:
respectively determining the number of data files corresponding to each directory label;
sequencing the directory labels according to the size sequence of the number of the corresponding data files;
when the size sequence is from large to small, the preset number of directory tags in the front are reserved, and the other directory tags except the reserved directory tags are deleted, or when the size sequence is from small to large, the preset number of directory tags in the back are reserved, and the other directory tags except the reserved directory tags are deleted.
13. A method of processing disc data according to claim 9 or 10, wherein prior to said storing step, the method further comprises:
respectively determining the number of data files corresponding to each directory label;
and deleting the directory label when the number of the data files corresponding to the directory label is smaller than a preset threshold value.
14. A computer-readable storage medium storing a disk data processing program executable by at least one processor to cause the at least one processor to perform the steps of the disk data processing method according to any one of claims 9 to 13.
CN201810791052.3A 2018-07-18 2018-07-18 Intelligent hardware device, magnetic disk data processing method and storage medium Active CN109189728B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810791052.3A CN109189728B (en) 2018-07-18 2018-07-18 Intelligent hardware device, magnetic disk data processing method and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810791052.3A CN109189728B (en) 2018-07-18 2018-07-18 Intelligent hardware device, magnetic disk data processing method and storage medium

Publications (2)

Publication Number Publication Date
CN109189728A CN109189728A (en) 2019-01-11
CN109189728B true CN109189728B (en) 2022-08-12

Family

ID=64936191

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810791052.3A Active CN109189728B (en) 2018-07-18 2018-07-18 Intelligent hardware device, magnetic disk data processing method and storage medium

Country Status (1)

Country Link
CN (1) CN109189728B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110532231B (en) * 2019-09-02 2021-12-17 Oppo(重庆)智能科技有限公司 File query method, file query device and terminal equipment
CN111966633B (en) * 2020-08-14 2024-04-09 北京百度网讯科技有限公司 Method, device, electronic equipment and medium for inquiring child node under directory

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103942205A (en) * 2013-01-18 2014-07-23 深圳市腾讯计算机系统有限公司 Method, device and system for storing and reading catalogue index
CN105550252A (en) * 2015-12-09 2016-05-04 北京金山安全软件有限公司 File positioning method and device and electronic equipment

Family Cites Families (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101183367B (en) * 2007-01-23 2010-06-09 腾讯科技(深圳)有限公司 Method for managing document by label, instantaneous communications customer terminal and system
CN102722487B (en) * 2011-03-30 2016-08-24 腾讯科技(深圳)有限公司 File management method and device
CN102609532B (en) * 2012-02-15 2014-07-23 大唐移动通信设备有限公司 Method and device for monitoring file directory
CN105721527B (en) * 2014-12-04 2019-03-01 金蝶软件(中国)有限公司 A kind of data processing method and server
CN104469518B (en) * 2014-12-16 2017-09-22 广东欧珀移动通信有限公司 The access method and electronic equipment of audio-video document
CN105243081B (en) * 2015-09-07 2017-06-16 河南大学 A kind of file system directory structures method for organizing based on formal notion
CN106331075B (en) * 2016-08-18 2020-01-17 华为技术有限公司 Method for storing file, metadata server and manager
CN106886610A (en) * 2017-04-11 2017-06-23 广东浪潮大数据研究有限公司 The file management method and device of a kind of distributed file system
CN107562786A (en) * 2017-07-27 2018-01-09 平安科技(深圳)有限公司 File memory method, terminal and computer-readable recording medium

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103942205A (en) * 2013-01-18 2014-07-23 深圳市腾讯计算机系统有限公司 Method, device and system for storing and reading catalogue index
CN105550252A (en) * 2015-12-09 2016-05-04 北京金山安全软件有限公司 File positioning method and device and electronic equipment

Also Published As

Publication number Publication date
CN109189728A (en) 2019-01-11

Similar Documents

Publication Publication Date Title
US20150363640A1 (en) Automatically organizing images
WO2019085474A1 (en) Calculation engine implementing method, electronic device, and storage medium
CN108536745B (en) Shell-based data table extraction method, terminal, equipment and storage medium
CN113032105B (en) Kubernetes cluster access control method, system and related equipment
CN109189728B (en) Intelligent hardware device, magnetic disk data processing method and storage medium
CN113626223A (en) Interface calling method and device
US20130346405A1 (en) Systems and methods for managing data items using structured tags
CN110674087A (en) File query method and device and computer readable storage medium
CN111986553B (en) Method, device and storage medium for map association based on semantic label
WO2018228001A1 (en) Electronic device, information query control method, and computer-readable storage medium
CN111177387A (en) User list information processing method, electronic device and computer readable storage medium
WO2019085591A1 (en) Intelligent hardware device, intelligent disk data processing method, and storage medium
CN116594683A (en) Code annotation information generation method, device, equipment and storage medium
JP6279797B1 (en) Business card information management server, business card information management system, business card information management method, and business card information management program
US9460139B2 (en) Distributed storage system with pluggable query processing
US20180314698A1 (en) Media sharing based on identified physical objects
CN111585897B (en) Request route management method, system, computer system and readable storage medium
CN113434585A (en) Resource saving method and equipment
CN112685078A (en) Interface document generation and query method, device and computer readable storage medium
CN101840401A (en) Dictionary assistance searching system and method thereof
CN111782834A (en) Image retrieval method, device, equipment and computer readable storage medium
CN113064984A (en) Intention recognition method and device, electronic equipment and readable storage medium
CN113127574A (en) Service data display method, system, equipment and medium based on knowledge graph
CN111143293A (en) Metadata acquisition method, device, equipment and computer readable storage medium
CN111159182A (en) Intelligent searching method and device for regional asset data and computer readable storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant