CN115794742A - File path data processing method, device, equipment and storage medium - Google Patents

File path data processing method, device, equipment and storage medium Download PDF

Info

Publication number
CN115794742A
CN115794742A CN202211610019.9A CN202211610019A CN115794742A CN 115794742 A CN115794742 A CN 115794742A CN 202211610019 A CN202211610019 A CN 202211610019A CN 115794742 A CN115794742 A CN 115794742A
Authority
CN
China
Prior art keywords
tree structure
deepest
level
current tree
node
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.)
Pending
Application number
CN202211610019.9A
Other languages
Chinese (zh)
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.)
Beijing Baidu Netcom Science and Technology Co Ltd
Original Assignee
Beijing Baidu Netcom Science and 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 Beijing Baidu Netcom Science and Technology Co Ltd filed Critical Beijing Baidu Netcom Science and Technology Co Ltd
Priority to CN202211610019.9A priority Critical patent/CN115794742A/en
Publication of CN115794742A publication Critical patent/CN115794742A/en
Pending legal-status Critical Current

Links

Images

Landscapes

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

Abstract

The disclosure provides a file path data processing method, a file path data processing device and a storage medium, and belongs to the technical field of data processing, in particular to the technical field of data visualization, front-end page development and file directory processing. The specific implementation scheme is as follows: determining a folder hierarchy and a file name according to a current file path data entry to be processed acquired from a rear end, searching a deepest node matched with each hierarchy in the folder hierarchy from shallow to deep in a current tree structure corresponding to a front-end page, and adding the file name in the current tree structure according to the matching condition of the deepest node and the deepest hierarchy in the folder hierarchy so as to update the current tree structure. By adopting the technical scheme, the tree structure can be updated according to the matching condition of the deepest node matched with each hierarchy of the current data item in the constructed tree structure and the deepest hierarchy in the current data item, the workload of the back end is reduced, the response speed of the back end interface can be improved, and the blockage of the front end interface is reduced.

Description

File path data processing method, device, equipment and storage medium
Technical Field
The present disclosure relates to the field of data processing technologies, and in particular, to the field of data visualization, front-end page development, and file directory processing technologies.
Background
The file path data at the back end is usually stored in a one-dimensional data format, each file corresponds to one piece of storage path data, and when the file path data is displayed at the front end, the file path data is usually displayed in a tree structure in order to reflect the hierarchical relationship of file directories.
At present, both the back end and the front end need to comply with an agreed data format, the back end needs to recombine file path data in order to output the data format required by the front end, and the front end needs to further convert the file path data into a tree structure and display the file path data after receiving the recombined file path data transmitted by the back end.
Disclosure of Invention
The disclosure provides a file path data processing method, device, equipment and storage medium.
According to an aspect of the present disclosure, there is provided a file path data processing method, including:
determining file path information according to a current data item to be processed acquired from a back end, wherein the data item comprises a file path data item, and the file path information comprises a folder hierarchy and a file name;
searching a deepest node matched with each level in the folder level from shallow to deep in a current tree structure corresponding to a front-end page, wherein the current tree structure comprises a file directory structure which is constructed according to processed data items and used for displaying on the front-end page;
and adding the file name in the current tree structure according to the matching condition of the deepest node and the deepest level in the folder level so as to update the current tree structure.
According to another aspect of the present disclosure, there is provided a file path data processing apparatus including:
the file path information determining module is used for determining file path information according to a current data item to be processed acquired from a back end, wherein the data item comprises a file path data item, and the file path information comprises a folder hierarchy and a file name;
a deepest node searching module, configured to search a deepest node, which is matched with each level in the folder levels, from shallow to deep in a current tree structure corresponding to a front-end page, where the current tree structure includes a file directory structure, which is constructed according to processed data items and is used for displaying on the front-end page;
and the tree structure updating module is used for adding the file name in the current tree structure according to the matching condition of the deepest node and the deepest level in the folder level so as to update the current tree structure.
According to another aspect of the present disclosure, there is provided an electronic device including:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein, the first and the second end of the pipe are connected with each other,
the memory stores instructions executable by the at least one processor to cause the at least one processor to perform the method of the embodiments of the present disclosure.
According to another aspect of the present disclosure, there is provided a non-transitory computer readable storage medium having stored thereon computer instructions for causing the computer to perform the method of the embodiments of the present disclosure.
According to another aspect of the present disclosure, there is provided a computer program product comprising a computer program which, when executed by a processor, implements the method of any of the embodiments of the present disclosure.
It should be understood that the statements in this section do not necessarily identify key or critical features of the embodiments of the present disclosure, nor do they limit the scope of the present disclosure. Other features of the present disclosure will become apparent from the following description.
Drawings
The drawings are included to provide a better understanding of the present solution and are not to be construed as limiting the present disclosure. Wherein:
fig. 1 is a schematic diagram of a file path data processing method provided according to an embodiment of the present disclosure;
FIG. 2 is a schematic diagram of a tree structure provided in accordance with an embodiment of the present disclosure;
FIG. 3 is a schematic diagram of another tree structure provided in accordance with an embodiment of the present disclosure;
FIG. 4 is a schematic diagram of another file path data processing method provided in accordance with an embodiment of the present disclosure;
FIG. 5 is a schematic diagram of another file path data processing method provided in accordance with an embodiment of the present disclosure;
FIG. 6 is a schematic structural diagram of a file path data processing apparatus according to an embodiment of the present disclosure;
fig. 7 is a block diagram of an electronic device for implementing a file path data processing method of an embodiment of the present disclosure.
Detailed Description
Exemplary embodiments of the present disclosure are described below with reference to the accompanying drawings, in which various details of the embodiments of the disclosure are included to assist understanding, and which are to be considered as merely exemplary. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the present disclosure. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
Fig. 1 is a schematic diagram of a file path data processing method according to an embodiment of the present disclosure, which is applicable to a case where a tree structure of file path data at a back end is displayed at a front end. The method can be executed by a file path data processing device, which can be implemented in hardware and/or software and can be configured in an electronic device. Referring to fig. 1, the method specifically includes the following steps:
s101, determining file path information according to a current data item to be processed acquired from a back end, wherein the data item comprises a file path data entry, and the file path information comprises a folder hierarchy and a file name;
s102, searching the deepest node matched with each level in the folder level from shallow to deep in the current tree structure corresponding to the front-end page, wherein the current tree structure comprises a file directory structure which is constructed according to the processed data items and is used for displaying on the front-end page;
s103, adding the file name in the current tree structure according to the matching condition of the deepest node and the deepest level in the folder level, so as to update the current tree structure.
The back end may include a server, the electronic device may be configured as a front end, and may interact with a user through an application such as a browser running in the electronic device, and the front end page may include a web page. The file path data at the back end is typically stored in a one-dimensional data format. The source of the file path data at the back end is not limited, and for example, the file path data may be obtained by uploading a compressed packet (the compressed packet includes a plurality of files to be uploaded) by a user through a command line tool or the like, and decompressing the compressed packet at the back end.
For example, the following description will be given by taking file path data stored in the backend as an example:
let treeList={
{
fileUrls:[
{
folderPath:‘cluster/performance0/report/content/css’,
filePath:‘cluster/performance0/report/content/css/dashboard.css’
},
{
folderPath:‘cluster/performance0/report/content/js’,
filePath:‘cluster/performance0/report/content/js/curvedLines.js’
},
{
folderPath:‘cluster/performance0/report’,
filePath:‘cluster/performance0/report/index.html’
},
{
folderPath:‘cluster’,
filePath:‘cluster/report.html’
},
]
}
fig. 2 is a schematic diagram of a tree structure provided according to an embodiment of the present disclosure, where the file path data in the foregoing example needs to be converted into a corresponding tree structure, and is shown in fig. 2 in a front-end page.
In the related technology, both the back end and the front end need to comply with an agreed data format, code maintenance is difficult, and the back end needs to traverse all file path data for multiple times and to reassemble a data format in order to output a data format required by the front end.
In the embodiment of the disclosure, the front end can be used for directly constructing the tree structure according to the file path data of the one-dimensional data format stored in the back end, the back end does not need to perform additional conversion operation, the workload of the back end is reduced, the response speed of the back end interface can be improved, the pause of the front end interface is reduced, and the user experience is improved.
In the embodiment of the present disclosure, a tree structure for displaying on a front-end page may be gradually constructed and updated in units of data items, and the tree structure may embody a file directory structure. The data item includes a file path data entry, which may be understood as a piece of data in the file path data, and the first data item in the above example may be:
folderPath:‘cluster/performance0/report/content/css’,
filePath:‘cluster/performance0/report/content/css/dashboard.css’
optionally, each data item in the file path data may become a current data item to be processed in sequence according to a preset sequence. Wherein the preset order may be a storage order of the data items.
Optionally, file path data corresponding to the same compressed packet may be obtained from the back end, and then each data item in the file path data may be processed; or acquiring file path data corresponding to the same compressed package from the back end one by one or in batches, and then processing the currently acquired data items.
For example, the folder hierarchy may include a nesting relationship of folders included in the data item, as in the first data item in the example above, a cluster folder includes a performance0 folder, a performance0 folder includes a report folder, a report folder includes a content folder, and a content folder includes a css folder, and then the hierarchy of the folders includes, from a shallow layer to a deep layer, the cluster, the performance0 folder, the report, the content, and the css. Cs is the file name in the first data item in the example above.
Illustratively, for the first data item, the current tree structure is empty, and the deepest node in the current tree structure that matches each level in the folder level may be considered to be 0, and the initial tree structure may be constructed from the first data item. Fig. 3 is a schematic diagram of another tree structure provided according to an embodiment of the present disclosure, and fig. 3 illustrates an initial tree structure constructed according to a first data item, where nodes in the tree structure are, from shallow to deep, cluster, performance0, report, content, and css, respectively, and are matched with each level in a folder level determined according to the first data item one by one, and a filename of the first data item is included below the css node.
For example, after the initial tree structure is built, the second data item may be determined as the data item to be currently processed, and the folder hierarchy is determined to be cluster, performance0, report, content, and js in sequence from the shallow layer to the deep layer, where the file name is curredlines.
For example, in the current tree structure corresponding to the front-end page, the deepest node matching each level in the folder levels is searched from shallow to deep, and the current tree structure may be traversed from the shallowest node to determine whether the current node matches a certain level in the folder levels, for example, determine whether the node name of the current node is the same as the folder name of the certain level in the folder levels, if so, take the next node (which may be another node at the same depth or a node at a deeper level) as the current node and determine whether the next node matches the certain level in the folder levels, until the certain node does not match any level in the folder levels, determine the previous node of the node as the searched deepest node.
As an example, if the cluster, performance0, report, and content in the current tree structure match the cluster, performance0, report, and content in the folder hierarchy, the deepest node is the content.
It should be noted that, a plurality of sub-folders may be included in the same folder, and a plurality of sub-nodes with the same depth may exist in the corresponding node, and for nodes with the same depth level, the traversal order is not limited.
Illustratively, after the deepest node is determined, the deepest node is matched with the deepest level in the folder hierarchy, for example, content is matched with js, an adding mode for adding a file name to the current tree structure is determined according to a matching result, and then the current tree structure is updated, that is, the current data item to be processed is processed. The adding mode can include directly adding the file name to a certain node in the current tree structure; or adding a new node on the basis of the current tree structure, then adding the file name to the new node, and the like.
According to the file path data processing scheme provided by the embodiment of the disclosure, a folder hierarchy and a file name are determined according to a current file path data entry to be processed, which is acquired from a back end, a deepest node matched with each hierarchy in the folder hierarchy is searched from shallow to deep in a current tree structure corresponding to a front-end page, and a file name is added to the current tree structure according to the matching condition of the deepest node and the deepest hierarchy in the folder hierarchy, so that the current tree structure is updated. By adopting the technical scheme, the front end can directly traverse the file path data stored at the rear end one by one, the tree structure is gradually updated according to the matching condition of the deepest node matched with each level of the current data item in the constructed tree structure and the deepest level in the current data item, the data items do not need to be traversed for many times, the rear end does not need to carry out extra conversion operation, the workload of the rear end is reduced, the response speed of a rear end interface can be improved, the pause of the front end interface is reduced, and the user experience is improved.
In an optional embodiment, the adding the file name to the current tree structure according to a matching condition of the deepest node and a deepest level in the folder level to update the current tree structure includes: if the deepest node does not match a deepest level of the folder hierarchy, adding nodes corresponding to all deep levels of a target level of the folder hierarchy under the deepest node, wherein the target level comprises a level matching the deepest node; and filling the file name into the tail-end node of the added nodes so as to update the current tree structure. The advantage of this arrangement is that if the deepest node does not match the deepest level, it indicates that part of the folders in the current data item are not included in the current tree structure, and a new node is added to the current tree structure to ensure the accuracy of the tree structure, and the file name is filled into the newly added endmost node to complete the update of the current tree structure.
Illustratively, all deep levels of the target level may be understood as all levels deeper than the target level. As for the first data item in the above example, the current tree structure is empty, the deepest node in the current tree structure that matches each level in the folder levels may be regarded as 0, the deepest level of the first data item is css, the deepest node does not match the deepest level, and the target level that matches the deepest node may be regarded as 0, then all levels in the first data item may be regarded as deep levels of 0, nodes corresponding to all levels in the first data item are added to the empty tree structure to obtain an updated tree structure, and the file name dashboard.
As with the second data item in the above example, if the deepest node found in the current tree structure is content, the content does not match the deepest level js in the second data item, and the target level matching the deepest node is content, then the node js corresponding to the deep level js of the content in the second data item is added to the current tree structure, and the file name ved lines.
In an optional embodiment, the adding the file name to the current tree structure according to a matching condition of the deepest node and a deepest level in the folder level to update the current tree structure includes: and if the deepest node is matched with the deepest level in the folder level, filling the file name into the deepest node so as to update the current tree structure. The advantage of such an arrangement is that if the deepest node matches the deepest level, it indicates that all folders in the current data item are contained in the current tree structure, and the file name is directly filled into the deepest node without adding a new node in the current tree structure, thereby quickly completing the update of the current tree structure.
Illustratively, as for the third data item in the above example, if the deepest node found in the current tree structure is a report, and the report matches the deepest node in the third data item, html in the third data item may be directly added to the report node in the current tree structure, so as to complete the update of the current tree structure.
In an optional implementation manner, after the adding the file name in the current tree structure according to the matching condition of the deepest node and the deepest level in the folder level to update the current tree structure, the method further includes: judging whether unprocessed data items exist or not; if the data item exists, the current data item to be processed is determined again, and the relevant steps of determining the file path information according to the current data item to be processed acquired from the back end are executed repeatedly, so that the current tree structure is updated until no unprocessed data item exists. The advantage of this arrangement is that the integrity and accuracy of the file directory displayed on the front-end page is ensured by traversing all data items one by one and constantly updating the current tree structure.
Illustratively, whether unprocessed data items exist or not is judged, if yes, the current data items to be processed are re-determined to obtain new data items, new file path information is determined according to the current new data items to be processed acquired from the rear end, a new deepest node matched with each level in the new folder level is searched from shallow to deep in a current tree structure corresponding to a front-end page, and a new file name is added in the current tree structure according to the matching condition of the new deepest node and the new deepest level in the new folder level to update the current tree structure until no unprocessed data items exist.
Fig. 4 is a schematic diagram of another file path data processing method provided according to an embodiment of the present disclosure, and this embodiment proposes an alternative scheme based on the foregoing optional embodiments, and further explains the presentation of the current tree structure. After adding a file name in the current tree structure according to the matching condition of the deepest node and the deepest level in the folder level so as to update the current tree structure, the method further comprises the following steps: and displaying the updated current tree structure in a front-end page. The method has the advantages that the tree structure displayed in the front-end page is dynamically updated, the duration of the display margin of the page is reduced, the waiting time of a user is reduced, and the user experience is further improved.
Referring to fig. 4, the method includes:
step 401, determining a current data item to be processed acquired from the back end.
Step 402, determining file path information according to the data item to be processed currently, wherein the file path information comprises a folder hierarchy and a file name.
And step 403, searching the deepest node matched with each level in the folder level from shallow to deep in the current tree structure corresponding to the front page.
Wherein the current tree structure includes a file directory structure constructed from the processed data items for presentation on the front end page.
Step 404, judging whether the deepest node is matched with the deepest level in the folder level, if so, executing step 405; otherwise, step 406 is performed.
Step 405, filling the file name into the deepest node to update the current tree structure, and executing step 407.
And 406, adding nodes corresponding to all deep levels of a target level in the folder level below the deepest node, and filling the file name into the endmost node in the added nodes so as to update the current tree structure.
Wherein the target level comprises a level matching the deepest node.
And 407, displaying the updated current tree structure in a front-end page.
In the embodiment of the present disclosure, each time one data item is processed, the current tree structure after the update is displayed in the front-end page, so that the user can view partial file directory structure information in time. Optionally, the tree structure before the display update may be switched to the tree structure after the display update in the front-end page in a page refresh manner.
Step 408, judging whether unprocessed data items exist, if so, executing step 401; otherwise, the flow ends.
For example, if there are no unprocessed data items, the currently displayed tree structure in the front-end page can be considered as the final tree structure. Optionally, a prompt message may be displayed on the front-end page to prompt that the file directory is completely loaded.
According to the file path data processing method provided by the embodiment of the disclosure, a front end can directly traverse file path data stored in a back end one by one, if a deepest node matched with each level of a current data item in a built tree structure is matched with a deepest level in the current data item, a file name is directly added, if the deepest node is not matched with the deepest level, a node which does not exist in the tree structure in the current data item is added, the file name is added, so that the tree structure is gradually updated, after the tree structure is updated, the tree structure in a front-end page is timely and synchronously displayed and updated, the time of the existence of display margins of the page is reduced, the user waiting time is reduced, the user experience is effectively improved, and in the scheme, the front-end interactive data format is simple, the code readability is good, the method is easy to maintain, is suitable for various front-end technology stacks, and has a wide application range.
Fig. 5 is a schematic diagram of another file path data processing method provided according to an embodiment of the present disclosure, and this embodiment proposes an alternative scheme based on the foregoing optional embodiments, and further explains the presentation of the current tree structure. After adding a file name in the current tree structure according to the matching condition of the deepest node and the deepest level in the folder level so as to update the current tree structure, the method further comprises the following steps: judging whether unprocessed data items exist or not; and if not, displaying the updated current tree structure in the front-end page. The method has the advantages that after all data items are processed, the final tree structure is displayed in the front-end page, the influence of the display updating of the page content on the updating speed of the tree structure is reduced, and the updating efficiency of the tree structure is improved.
Referring to fig. 5, the method includes:
step 501, determining a current data item to be processed acquired from the back end.
Step 502, determining file path information according to the data item to be processed currently, wherein the file path information includes a folder hierarchy and a file name.
Step 503, in the current tree structure corresponding to the front page, the deepest node matched with each level in the folder level is searched from shallow to deep.
Wherein the current tree structure comprises a file directory structure constructed from the processed data items for presentation on the front end page.
Step 504, judging whether the deepest node is matched with the deepest level in the folder level, if so, executing step 505; otherwise, step 506 is performed.
Step 505, filling the file name into the deepest node to update the current tree structure, and executing step 507.
Step 506, adding nodes corresponding to all deep levels of the target level in the folder level under the deepest node, and filling the file name into the endmost node in the added nodes to update the current tree structure.
Wherein the target level comprises a level matching the deepest node.
Step 507, judging whether unprocessed data items exist, if so, executing step 501; otherwise, step 508 is performed.
In the embodiment of the present disclosure, each time a data item is processed, it is determined whether there is still another unprocessed data item, if yes, the step returns to step 501, the current tree structure is continuously updated according to the next data item, and if not, the current tree structure is the final tree structure and can be displayed in the front-end page, so that the user can directly view the correct and complete file directory.
And step 508, displaying the updated current tree structure in the front-end page.
According to the file path data processing method provided by the embodiment of the disclosure, the front end can directly traverse file path data stored at the back end one by one, if the deepest node matched with each level of the current data item in the built tree structure is matched with the deepest level in the current data item, the file name is directly added, if the deepest node is not matched with the deepest level in the current data item, the node which is not in the tree structure in the current data item is added, the file name is added, the tree structure is gradually updated, after all data items are processed, the final tree structure is obtained, the final tree structure is displayed on the front end page, the tree structure building efficiency is improved, the user waiting time is shortened, and the user experience is effectively improved.
Fig. 6 is a schematic structural diagram of a file path data processing apparatus according to an embodiment of the present disclosure, where the embodiment of the present disclosure is applicable to a case where a tree structure of file path data at a back end is displayed at a front end. The device can be realized by hardware and/or software and can be configured in electronic equipment. Referring to fig. 6, the file path data processing apparatus 600 includes:
a file path information determining module 601, configured to determine file path information according to a current data item to be processed, where the data item includes a file path data entry, and the file path information includes a folder hierarchy and a file name;
a deepest node searching module 602, configured to search a deepest node, which is matched with each level in the folder level, from shallow to deep in a current tree structure corresponding to a front-end page, where the current tree structure includes a file directory structure constructed according to processed data items and used for displaying on the front-end page;
and a tree structure updating module 603, configured to add the file name to the current tree structure according to a matching condition between the deepest node and a deepest level in the folder level, so as to update the current tree structure.
According to the file path data processing scheme provided by the embodiment of the disclosure, the front end can directly traverse file path data stored at the back end one by one, and the tree structure is gradually updated according to the matching condition of the deepest node matched with each level of the current data item in the constructed tree structure and the deepest level in the current data item, so that all data items do not need to be traversed for many times, extra conversion operation does not need to be carried out at the back end, the workload of the back end is reduced, the response speed of the back end interface can be improved, the jam of the front end interface is reduced, and the user experience is improved.
In an alternative embodiment, the tree structure updating module includes:
a node adding unit configured to add, under the deepest node, nodes corresponding to all deep levels of a target level in the folder level if the deepest node does not match a deepest level in the folder level, wherein the target level includes a level matching the deepest node;
a first updating unit, configured to populate the file name into an endmost node of the added nodes, so as to update the current tree structure.
In an alternative embodiment, the tree structure update module comprises:
and the second updating unit is used for filling the file name into the deepest node to update the current tree structure under the condition that the deepest node is matched with the deepest level in the folder level.
In an alternative embodiment, the apparatus further comprises:
and the first display module is used for adding the file name in the current tree structure according to the matching condition of the deepest node and the deepest level in the folder level so as to display the updated current tree structure in the front-end page after updating the current tree structure.
In an alternative embodiment, the apparatus further comprises:
and the second display module is used for adding the file name in the current tree structure according to the matching condition of the deepest node and the deepest level in the folder level so as to judge whether unprocessed data items exist or not after the current tree structure is updated, and if the unprocessed data items do not exist, displaying the updated current tree structure in the front-end page.
In an alternative embodiment, the apparatus further comprises:
and the repeated processing module is used for adding the file name in the current tree structure according to the matching condition of the deepest node and the deepest level in the folder level so as to update the current tree structure, judging whether unprocessed data items exist or not, if so, re-determining the current data items to be processed, and repeatedly executing the related steps of determining file path information according to the current data items to be processed acquired from the rear end so as to update the current tree structure until no unprocessed data items exist.
In the technical scheme of the disclosure, the collection, storage, use, processing, transmission, provision, disclosure and the like of the personal information of the related user all conform to the regulations of related laws and regulations, and do not violate the good custom of the public order.
The present disclosure also provides an electronic device, a readable storage medium, and a computer program product according to embodiments of the present disclosure.
FIG. 7 illustrates a schematic block diagram of an example electronic device 700 that can be used to implement embodiments of the present disclosure. Electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be examples only, and are not meant to limit implementations of the disclosure described and/or claimed herein.
As shown in fig. 7, the device 700 comprises a computing unit 701, which may perform various suitable actions and processes according to a computer program stored in a Read Only Memory (ROM) 702 or a computer program loaded from a storage unit 708 into a Random Access Memory (RAM) 703. In the RAM703, various programs and data required for the operation of the device 700 can be stored. The computing unit 701, the ROM 702, and the RAM703 are connected to each other by a bus 704. An input/output (I/O) interface 705 is also connected to bus 704.
Various components in the device 700 are connected to the I/O interface 705, including: an input unit 706 such as a keyboard, a mouse, or the like; an output unit 707 such as various types of displays, speakers, and the like; a storage unit 708 such as a magnetic disk, optical disk, or the like; and a communication unit 709 such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 709 allows the device 700 to exchange information/data with other devices via a computer network, such as the internet, and/or various telecommunication networks.
Computing unit 701 may be a variety of general purpose and/or special purpose processing components with processing and computing capabilities. Some examples of the computing unit 701 include, but are not limited to, a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), various dedicated Artificial Intelligence (AI) computing chips, various computing units running machine learning model algorithms, a Digital Signal Processor (DSP), and any suitable processor, controller, microcontroller, and so forth. The calculation unit 701 executes the respective methods and processes described above, such as the file path data processing method. For example, in some embodiments, the file path data processing method may be implemented as a computer software program tangibly embodied in a machine-readable medium, such as storage unit 708. In some embodiments, part or all of a computer program may be loaded onto and/or installed onto device 700 via ROM 702 and/or communications unit 709. When the computer program is loaded into the RAM703 and executed by the computing unit 701, one or more steps of the file path data processing method described above may be performed. Alternatively, in other embodiments, the computing unit 701 may be configured to perform the file path data processing method by any other suitable means (e.g., by means of firmware).
Various implementations of the systems and techniques described here above may be implemented in digital electronic circuitry, integrated circuitry, field Programmable Gate Arrays (FPGAs), application Specific Integrated Circuits (ASICs), application Specific Standard Products (ASSPs), system on a chip (SOCs), complex Programmable Logic Devices (CPLDs), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs that are executable and/or interpretable on a programmable system including at least one programmable processor, which may be special or general purpose, receiving data and instructions from, and transmitting data and instructions to, a storage system, at least one input device, and at least one output device.
Program code for implementing the methods of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general purpose computer, special purpose computer, or other programmable data processing apparatus, such that the program codes, when executed by the processor or controller, cause the functions/operations specified in the flowchart and/or block diagram to be performed. The program code may execute entirely on the machine, partly on the machine, as a stand-alone software package partly on the machine and partly on a remote machine or entirely on the remote machine or server.
In the context of this disclosure, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
To provide for interaction with a user, the systems and techniques described here can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and a pointing device (e.g., a mouse or a trackball) by which a user can provide input to the computer. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form, including acoustic, speech, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a back-end component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such back-end, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), wide Area Network (WAN) blockchain networks, and the internet.
The computer system may include clients and servers. A client and server are generally remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. The server can be a cloud server, also called a cloud computing server or a cloud host, and is a host product in a cloud computing service system, so that the defects of high management difficulty and weak service expansibility in the traditional physical host and VPS service are overcome. The server may also be a server of a distributed system, or a server incorporating a blockchain.
Artificial intelligence is the subject of research that makes computers simulate some human mental processes and intelligent behaviors (such as learning, reasoning, thinking, planning, etc.), both at the hardware level and at the software level. Artificial intelligence hardware technologies generally include technologies such as sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, big data processing, and the like; the artificial intelligence software technology mainly comprises a computer vision technology, a voice recognition technology, a natural language processing technology, a machine learning/deep learning technology, a big data processing technology, a knowledge map technology and the like.
Cloud computing (cloud computing) refers to accessing an elastically extensible shared physical or virtual resource pool through a network, where resources may include servers, operating systems, networks, software, applications, storage devices, and the like, and may be a technical system that deploys and manages resources in a self-service manner as needed. Through the cloud computing technology, high-efficiency and strong data processing capacity can be provided for technical application and model training of artificial intelligence, block chains and the like.
It should be understood that various forms of the flows shown above, reordering, adding or deleting steps, may be used. For example, the steps described in this disclosure may be performed in parallel, sequentially, or in a different order, as long as the desired results of the technical solutions provided by this disclosure can be achieved, and are not limited herein.
The above detailed description should not be construed as limiting the scope of the disclosure. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may be made, depending on design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present disclosure should be included in the scope of protection of the present disclosure.

Claims (14)

1. A file path data processing method comprises the following steps:
determining file path information according to a current data item to be processed acquired from a back end, wherein the data item comprises a file path data item, and the file path information comprises a folder hierarchy and a file name;
searching a deepest node matched with each level in the folder level from shallow to deep in a current tree structure corresponding to a front-end page, wherein the current tree structure comprises a file directory structure which is constructed according to processed data items and used for displaying on the front-end page;
and adding the file name in the current tree structure according to the matching condition of the deepest node and the deepest level in the folder level so as to update the current tree structure.
2. The method of claim 1, wherein said adding the file name in the current tree structure to update the current tree structure according to the matching of the deepest node with the deepest level of the folder hierarchy comprises:
if the deepest node does not match a deepest level of the folder hierarchy, adding nodes corresponding to all deep levels of a target level of the folder hierarchy under the deepest node, wherein the target level comprises a level matching the deepest node;
and filling the file name into the most terminal node in the added nodes so as to update the current tree structure.
3. The method of claim 1, wherein said adding the file name in the current tree structure to update the current tree structure according to the matching of the deepest node with the deepest level of the folder hierarchy comprises:
and if the deepest node is matched with the deepest level in the folder level, filling the file name into the deepest node so as to update the current tree structure.
4. The method of claim 1, further comprising, after said adding the file name to the current tree structure to update the current tree structure according to a match of the deepest node to a deepest level of the folder hierarchy:
and displaying the updated current tree structure in the front-end page.
5. The method of claim 1, further comprising, after said adding the file name to the current tree structure to update the current tree structure according to a match of the deepest node to a deepest level of the folder hierarchy:
judging whether unprocessed data items exist or not;
and if not, displaying the updated current tree structure in the front-end page.
6. The method according to any one of claims 1-5, further comprising, after said updating the current tree structure by adding said file name to the current tree structure according to the matching of said deepest node with the deepest level of said folder levels:
judging whether unprocessed data items exist or not;
if the data item exists, the current data item to be processed is determined again, and the relevant steps of determining the file path information according to the current data item to be processed acquired from the back end are executed repeatedly so as to update the current tree structure until no unprocessed data item exists.
7. A file path data processing apparatus comprising:
the file path information determining module is used for determining file path information according to a current data item to be processed acquired from a back end, wherein the data item comprises a file path data entry, and the file path information comprises a folder hierarchy and a file name;
a deepest node searching module, configured to search a deepest node, which is matched with each level in the folder levels, from shallow to deep in a current tree structure corresponding to a front-end page, where the current tree structure includes a file directory structure, which is constructed according to processed data items and is used for displaying on the front-end page;
and the tree structure updating module is used for adding the file name in the current tree structure according to the matching condition of the deepest node and the deepest level in the folder level so as to update the current tree structure.
8. The apparatus of claim 7, wherein the tree structure update module comprises:
a node adding unit configured to add, under the deepest node, nodes corresponding to all deep levels of a target level in the folder level if the deepest node does not match a deepest level in the folder level, wherein the target level includes a level matching the deepest node;
and the first updating unit is used for filling the file name into the endmost node in the added nodes so as to update the current tree structure.
9. The apparatus of claim 7, wherein the tree structure update module comprises:
a second updating unit, configured to, in a case that the deepest node matches a deepest level in the folder hierarchy, populate the file name into the deepest node to update a current tree structure.
10. The apparatus of claim 7, further comprising:
and the first display module is used for adding the file name in the current tree structure according to the matching condition of the deepest node and the deepest level in the folder level so as to display the updated current tree structure in the front-end page after updating the current tree structure.
11. The apparatus of claim 7, further comprising:
and the second display module is used for adding the file name in the current tree structure according to the matching condition of the deepest node and the deepest level in the folder level so as to judge whether unprocessed data items exist or not after updating the current tree structure, and if not, displaying the updated current tree structure in the front-end page.
12. The apparatus of claims 7-11, further comprising:
and the repeated processing module is used for adding the file name in the current tree structure according to the matching condition of the deepest node and the deepest level in the folder level so as to update the current tree structure, judging whether unprocessed data items exist or not, if so, re-determining the current data items to be processed, and repeatedly executing the related steps of determining file path information according to the current data items to be processed acquired from the rear end so as to update the current tree structure until no unprocessed data items exist.
13. An electronic device, comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein, the first and the second end of the pipe are connected with each other,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-6.
14. A non-transitory computer readable storage medium having stored thereon computer instructions for causing the computer to perform the method of any one of claims 1-6.
CN202211610019.9A 2022-12-14 2022-12-14 File path data processing method, device, equipment and storage medium Pending CN115794742A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211610019.9A CN115794742A (en) 2022-12-14 2022-12-14 File path data processing method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211610019.9A CN115794742A (en) 2022-12-14 2022-12-14 File path data processing method, device, equipment and storage medium

Publications (1)

Publication Number Publication Date
CN115794742A true CN115794742A (en) 2023-03-14

Family

ID=85419377

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211610019.9A Pending CN115794742A (en) 2022-12-14 2022-12-14 File path data processing method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN115794742A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117891786A (en) * 2024-03-15 2024-04-16 浙江研通信息科技有限公司 File path hooking method and system based on Monte Carlo algorithm

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117891786A (en) * 2024-03-15 2024-04-16 浙江研通信息科技有限公司 File path hooking method and system based on Monte Carlo algorithm
CN117891786B (en) * 2024-03-15 2024-05-31 浙江研通信息科技有限公司 File path hooking method and system based on Monte Carlo algorithm

Similar Documents

Publication Publication Date Title
EP3913545A2 (en) Method and apparatus for updating parameter of multi-task model, and electronic device
KR20220005416A (en) Method for training multivariate relationship generation model, electronic device and medium
CN113342345A (en) Operator fusion method and device of deep learning framework
CN112560496A (en) Training method and device of semantic analysis model, electronic equipment and storage medium
CN114548110A (en) Semantic understanding method and device, electronic equipment and storage medium
CN113836314B (en) Knowledge graph construction method, device, equipment and storage medium
CN112528641A (en) Method and device for establishing information extraction model, electronic equipment and readable storage medium
WO2023221416A1 (en) Information generation method and apparatus, and device and storage medium
JP7357114B2 (en) Training method, device, electronic device and storage medium for living body detection model
CN115794742A (en) File path data processing method, device, equipment and storage medium
CN114861059A (en) Resource recommendation method and device, electronic equipment and storage medium
CN113849581A (en) Alarm information processing method, device, equipment and storage medium
CN113609100A (en) Data storage method, data query method, data storage device, data query device and electronic equipment
CN113344074A (en) Model training method, device, equipment and storage medium
CN113656533A (en) Tree control processing method and device and electronic equipment
CN113157877A (en) Multi-semantic recognition method, device, equipment and medium
EP4092544A1 (en) Method, apparatus and storage medium for deduplicating entity nodes in graph database
CN115186738B (en) Model training method, device and storage medium
JP2023012541A (en) Question answering method, device, and electronic apparatus based on table
CN114995719A (en) List rendering method, device, equipment and storage medium
CN114969444A (en) Data processing method and device, electronic equipment and storage medium
CN114385829A (en) Knowledge graph creating method, device, equipment and storage medium
CN113033179A (en) Knowledge acquisition method and device, electronic equipment and readable storage medium
CN114398130B (en) Page display method, device, equipment and storage medium
EP4113328A1 (en) Method and apparatus for processing data based on knowledge graph, electronic device and 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