File path data processing method and device, equipment and storage medium
By building a tree structure directly on the front end, the performance issues caused by back end restructuring and front end conversion were resolved, resulting in faster response times and a better user experience.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- BAIDU ONLINE NETWORK TECH (BEIJIBG) CO LTD
- Filing Date
- 2022-12-14
- Publication Date
- 2026-07-03
AI Technical Summary
In existing technologies, the backend and frontend need to adhere to the agreed data format, which requires the backend to reorganize file path data and the frontend to further convert it into a tree structure. This results in a large workload for the backend, slow interface response, and a laggy frontend interface, leading to a poor user experience.
The front-end directly constructs a tree structure based on the one-dimensional data format stored on the back-end. By finding the deepest node in the current tree structure on the front-end page and adding the file name, the tree structure is updated step by step, reducing the back-end conversion operations.
It improves the response speed of backend interfaces, reduces lag in the frontend interface, enhances the user experience, simplifies code maintenance, and is suitable for various frontend technology stacks.
Smart Images

Figure CN115794742B_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of data processing technology, and in particular to the fields of data visualization, front-end page development, and file directory processing technology. Background Technology
[0002] Backend file path data is usually stored in a one-dimensional data format, with each file corresponding to a storage path. However, when displayed on the frontend, it is usually displayed in a tree structure to reflect the hierarchical relationship of the file directory.
[0003] Currently, both the backend and the frontend need to adhere to the agreed-upon data format. In order to output the data format required by the frontend, the backend needs to reorganize the file path data. After receiving the reorganized file path data from the backend, the frontend also needs to further convert it into a tree structure before displaying it. Summary of the Invention
[0004] This disclosure provides a method, apparatus, device, and storage medium for processing file path data.
[0005] According to one aspect of this disclosure, a method for processing file path data is provided, comprising:
[0006] Based on the data items to be processed obtained from the backend, determine the file path information, wherein the data items include file path data entries, and the file path information includes folder level and file name;
[0007] In the current tree structure corresponding to the front-end page, the deepest node that matches each level in the folder hierarchy is searched from shallow to deep. The current tree structure includes a file directory structure for display on the front-end page, constructed based on the processed data items.
[0008] Based on the matching between the deepest node and the deepest level in the folder hierarchy, the file name is added to the current tree structure to update the current tree structure.
[0009] According to another aspect of this disclosure, a file path data processing apparatus is provided, comprising:
[0010] The file path information determination module is used to determine file path information based on the currently pending data items obtained from the backend. The data items include file path data entries, and the file path information includes folder hierarchy and file name.
[0011] The deepest node search module is used to search for the deepest node that matches each level in the folder hierarchy from shallow to deep in the current tree structure corresponding to the front-end page. The current tree structure includes a file directory structure constructed based on the processed data items for display on the front-end page.
[0012] The tree structure update module is used to add the file name to the current tree structure based on the matching between the deepest node and the deepest level in the folder hierarchy, so as to update the current tree structure.
[0013] According to another aspect of this disclosure, an electronic device is provided, comprising:
[0014] At least one processor; and
[0015] A memory communicatively connected to the at least one processor; wherein,
[0016] The memory stores instructions that can be executed by the at least one processor to enable the at least one processor to perform the methods described in the embodiments of this disclosure.
[0017] According to another aspect of this disclosure, a non-transitory computer-readable storage medium is provided storing computer instructions, wherein the computer instructions are configured to cause the computer to perform the methods described in embodiments of this disclosure.
[0018] According to another aspect of this disclosure, a computer program product is provided, including a computer program that, when executed by a processor, implements the methods described in any embodiment of this disclosure.
[0019] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of this disclosure, nor is it intended to limit the scope of this disclosure. Other features of this disclosure will become readily apparent from the following description. Attached Figure Description
[0020] The accompanying drawings are provided to better understand this solution and do not constitute a limitation of this disclosure. Wherein:
[0021] Figure 1 This is a schematic diagram of a file path data processing method provided according to an embodiment of the present disclosure;
[0022] Figure 2 This is a schematic diagram of a tree structure provided according to an embodiment of the present disclosure;
[0023] Figure 3 This is a schematic diagram of another tree structure provided according to an embodiment of the present disclosure;
[0024] Figure 4 This is a schematic diagram of another file path data processing method provided according to an embodiment of this disclosure;
[0025] Figure 5 This is a schematic diagram of yet another file path data processing method provided according to an embodiment of the present disclosure;
[0026] Figure 6 This is a schematic diagram of a file path data processing device provided according to an embodiment of the present disclosure;
[0027] Figure 7 This is a block diagram of an electronic device used to implement the file path data processing method of the embodiments of this disclosure. Detailed Implementation
[0028] The exemplary embodiments of this disclosure are described below with reference to the accompanying drawings, including various details of the embodiments to aid understanding, and should be considered merely exemplary. Therefore, those skilled in the art will recognize that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of this disclosure. Similarly, for clarity and brevity, descriptions of well-known functions and structures are omitted in the following description.
[0029] Figure 1 This diagram illustrates a file path data processing method according to an embodiment of this disclosure. This embodiment is applicable to situations where a tree structure is displayed on a front-end for file path data from a back-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. (Reference) Figure 1 The method specifically includes the following:
[0030] S101. Determine file path information based on the currently pending data items obtained from the backend, wherein the data items include file path data entries, and the file path information includes folder level and file name;
[0031] S102. In the current tree structure corresponding to the front-end page, search from shallow to deep for the deepest node that matches each level in the folder hierarchy, wherein the current tree structure includes a file directory structure constructed based on the processed data items for display on the front-end page.
[0032] S103. Based on the matching between the deepest node and the deepest level in the folder hierarchy, add the file name to the current tree structure to update the current tree structure.
[0033] The backend can include a server, and the electronic device can be configured as the frontend, interacting with the user through applications such as browsers running on the device. The frontend page can include web pages. The backend file path data is typically stored in a one-dimensional data format. The source of the backend file path data is not limited; for example, it could be a compressed package (containing multiple files to be uploaded) uploaded by the user via command-line tools, and the backend obtains the file path data by decompressing the package.
[0034] For example, the following example illustrates the use of file path data stored in the backend:
[0035] let treeList = {
[0036] {
[0037] fileUrls:[
[0038] {
[0039] folderPath:'cluster / performance0 / report / content / css',
[0040] filePath:'cluster / performance0 / report / content / css / dashboard.css'
[0041] },
[0042] {
[0043] folderPath:'cluster / performance0 / report / content / js',
[0044] filePath:'cluster / performance0 / report / content / js / curvedLines.js'
[0045] },
[0046] {
[0047] folderPath:'cluster / performance0 / report',
[0048] filePath:'cluster / performance0 / report / index.html'
[0049] },
[0050] {
[0051] folderPath:'cluster',
[0052] filePath:'cluster / report.html'
[0053] }, ]
[0055] }
[0056] Figure 2 This is a schematic diagram of a tree structure provided according to an embodiment of this disclosure. The file path data exemplified above needs to be converted into a corresponding tree structure and displayed on the front-end page as follows. Figure 2 The display shown.
[0057] In related technologies, both the backend and frontend need to adhere to the agreed-upon data format, making code maintenance difficult. To output the data format required by the frontend, the backend needs to traverse the file path data multiple times and reorganize the data format. For example, in one approach, the backend needs to first traverse all file path data to find the top-level node, then traverse all file path data again to find all second-level nodes and store them in the children of the top-level node, then traverse all file path data again to find all third-level nodes and store them in the children of the second-level nodes, and so on. This results in a large workload and significant time consumption for the backend, slow backend interface response, and time-consuming requests. Furthermore, after receiving the reorganized file path data from the backend, the frontend needs to further convert it into a tree structure, leading to long rendering times for the frontend interface, which can easily cause interface lag and a poor user experience.
[0058] In this embodiment of the disclosure, the front end can directly construct a tree structure based on the file path data in the one-dimensional data format stored in the back end, without requiring additional conversion operations from the back end. This reduces the workload of the back end, improves the response speed of the back end interface, reduces lag in the front end interface, and enhances the user experience.
[0059] In this embodiment, a tree structure for display on the front-end page can be progressively constructed and updated on a data item basis. This tree structure reflects the file directory structure. The data item includes a file path data entry, which can be understood as a single data entry within the file path data. For example, the first data item in the above example could be:
[0060] folderPath:'cluster / performance0 / report / content / css',
[0061] filePath:'cluster / performance0 / report / content / css / dashboard.css'
[0062] Optionally, the data items in the file path data can become the current data items to be processed in a preset order. The preset order can be the storage order of the data items.
[0063] Optionally, file path data corresponding to the same compressed package can be obtained from the backend, and then each data item can be processed; alternatively, file path data corresponding to the same compressed package can be obtained from the backend one by one or in batches, and then the currently obtained data item can be processed.
[0064] For example, the folder hierarchy can include the nesting relationship of folders within a data item. In the first data item example above, the `cluster` folder contains the `performance0` folder, which in turn contains the `report` folder, which contains the `content` folder, and the `content` folder contains the `css` folder. The folder hierarchy from shallowest to deepest is: `cluster`, `performance0`, `report`, `content`, and `css`. The filename in the first data item example above is `dashboard.css`.
[0065] For example, 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 hierarchy can be considered as 0. An initial tree structure can be constructed based on the first data item. Figure 3 This is a schematic diagram of another tree structure provided according to an embodiment of the present disclosure. Figure 3 The initial tree structure constructed based on the first data item is shown, where the nodes in the tree structure, from shallow to deep, are cluster, performance0, report, content, and css, which match the levels in the folder hierarchy determined based on the first data item. The css node contains the file name of the first data item.
[0066] For example, after constructing the initial tree structure, the second data item can be identified as the current data item to be processed, and the folder hierarchy can be determined from shallow to deep as cluster, performance0, report, content, and js, with the file name curvedLines.js.
[0067] For example, in the current tree structure corresponding to the front-end page, the deepest node that matches each level in the folder hierarchy can be found from shallow to deep. This can be done by traversing the current tree structure starting from the shallowest node and determining whether the current node matches a certain level in the folder hierarchy. For example, it can be determined whether the name of the current node is the same as the name of a folder at a certain level in the folder hierarchy. If so, the next node (which can be another node at the same depth or a node at a deeper level) is taken as the current node and determined, that is, whether the next node matches a certain level in the folder hierarchy. This process continues until a node does not match any level in the folder hierarchy. Then, the previous node of that node is determined as the deepest node found.
[0068] As in the example above, if cluster, performance0, report, and content in the current tree structure all match cluster, performance0, report, and content in the folder hierarchy, then the deepest node is content.
[0069] It should be noted that a folder may contain multiple subfolders, and a corresponding node may have multiple child nodes at the same depth. For nodes at the same depth level, the traversal order is not restricted.
[0070] For example, after determining the deepest node, it is matched with the deepest level in the folder hierarchy, such as matching `content` with `js`. Based on the matching result, the method of adding the file name to the current tree structure is determined, and the current tree structure is updated, meaning that the data item to be processed is now complete. The method of adding the file name can include directly adding the file name to a node in the current tree structure; or adding a new node to the current tree structure and then adding the file name to the new node, etc.
[0071] The file path data processing scheme provided in this disclosure determines the folder level and file name based on the current file path data entries to be processed obtained from the backend. In the current tree structure corresponding to the frontend page, it searches from shallow to deep for the deepest node that matches each level in the folder level. Based on the matching between the deepest node and the deepest level in the folder level, the file name is added to the current tree structure to update the current tree structure. By adopting the above technical solution, the frontend can directly traverse the file path data stored in the backend one by one, gradually updating the tree structure based on the matching between the deepest node matching each level of the current data item and the deepest level of the current data item. This eliminates the need to traverse all data items multiple times, eliminates the need for additional conversion operations by the backend, reduces backend workload, improves backend interface response speed, reduces frontend interface lag, and enhances user experience.
[0072] In one optional implementation, the step of adding the file name to the current tree structure based on the matching of the deepest node with the deepest level in the folder hierarchy to update the current tree structure includes: if the deepest node does not match the deepest level in the folder hierarchy, adding nodes corresponding to all deep levels of the target level in the folder hierarchy under the deepest node, wherein the target level includes levels that match the deepest node; and filling the file name into the last node of the added nodes to update the current tree structure. The advantage of this setting is that if the deepest node does not match the deepest level, it indicates that some folders in the current data item are not included in the current tree structure. Adding new nodes to the current tree structure ensures the accuracy of the tree structure, and filling the file name into the newly added last node completes the update of the current tree structure.
[0073] For example, all deep levels of the target level can be understood as all levels deeper than the target level. In the first data item example above, the current tree structure is empty. The deepest node in the current tree structure that matches each level in the folder hierarchy can be considered 0. The deepest level of the first data item is CSS. The deepest node does not match the deepest level. The target level that matches the deepest node can be considered level 0. Therefore, all levels in the first data item can be considered deep levels of level 0. Add the nodes corresponding to all levels of the first data item to the empty tree structure to obtain the updated tree structure, and add the file name dashboard.css from the first data item to the CSS of the last node.
[0074] For example, in the second data item in the above example, the deepest node found in the current tree structure is content. However, content does not match the deepest level js in the second data item. The target level that matches the deepest node is content. Therefore, add the node js corresponding to the deepest level js of content in the second data item to the current tree structure, and add the file name curvedLines.js to the node js in the current tree structure to complete the update of the current tree structure.
[0075] In one optional implementation, the step of adding the file name to the current tree structure based on the matching of the deepest node with the deepest level in the folder hierarchy to update the current tree structure includes: if the deepest node matches the deepest level in the folder hierarchy, then the file name is filled into the deepest node to update the current tree structure. The advantage of this setting is that if the deepest node matches the deepest level, it means that all folders in the current data item are already included in the current tree structure. There is no need to add new nodes to the current tree structure; the file name is directly filled into the deepest node, quickly completing the update of the current tree structure.
[0076] For example, as in the third data item in the example above, the deepest node found in the current tree structure is "report". Since "report" matches the deepest level "report" in the third data item, the file name "index.html" in the third data item can be directly added to the "report" node in the current tree structure to complete the update of the current tree structure.
[0077] In one optional implementation, after updating the current tree structure by adding the file name to the current tree structure based on the matching of the deepest node with the deepest level in the folder hierarchy, the method further includes: determining whether there are any unprocessed data items; if so, re-determining the current data item to be processed, and repeatedly executing the steps of determining file path information based on the current data item to be processed obtained from the backend to update the current tree structure, until there are no more unprocessed data items. The advantage of this approach is that by traversing all data items one by one and continuously updating the current tree structure, the integrity and accuracy of the file directory displayed on the front-end page are ensured.
[0078] For example, it is determined whether there are any unprocessed data items. If so, the data items to be processed are redefined to obtain new data items. Based on the new data items to be processed obtained from the backend, the new file path information is determined. In the current tree structure corresponding to the front-end page, the new deepest node that matches each level in the new folder hierarchy is searched from shallow to deep. Based on the matching of the new deepest node with the new deepest level in the new folder hierarchy, a new file name is added to the current tree structure to update the current tree structure until there are no more unprocessed data items.
[0079] Figure 4 This is a schematic diagram illustrating another file path data processing method provided by an embodiment of this disclosure. Based on the aforementioned optional embodiments, this embodiment proposes an optional solution to further explain the display of the current tree structure. After updating the current tree structure by adding file names to it based on the matching between the deepest node and the deepest level in the folder hierarchy, the method further includes displaying the updated current tree structure on the front-end page. The advantage of this setting is that it dynamically updates the tree structure displayed on the front-end page, reducing the time the page has blank space, reducing user waiting time, and further improving the user experience.
[0080] See Figure 4 The method includes:
[0081] Step 401: Determine the data items to be processed currently obtained from the backend.
[0082] Step 402: Determine the file path information based on the current data items to be processed. The file path information includes the folder level and the file name.
[0083] Step 403: In the current tree structure corresponding to the front-end page, search from shallow to deep for the deepest node that matches each level in the folder hierarchy.
[0084] The current tree structure includes a file directory structure built from the processed data items for display on the front-end page.
[0085] Step 404: Determine if the deepest node matches the deepest level in the folder hierarchy. If yes, proceed to step 405; otherwise, proceed to step 406.
[0086] Step 405: Fill the deepest node with the file name to update the current tree structure, then proceed to step 407.
[0087] Step 406: Add all nodes corresponding to the target level in the folder hierarchy under the deepest node, and fill the file name into the last node of the added nodes to update the current tree structure.
[0088] The target level includes the level that matches the deepest node.
[0089] Step 407: Display the updated current tree structure on the front-end page.
[0090] In this embodiment of the disclosure, after each data item is processed, the updated tree structure is displayed on the front-end page, allowing users to view some file directory structure information in a timely manner. Optionally, the display of the tree structure before the update can be switched to the display of the updated tree structure on the front-end page through a page refresh.
[0091] Step 408: Determine if there are any unprocessed data items. If yes, proceed to step 401; otherwise, end the process.
[0092] For example, if there are no unprocessed data items, the tree structure currently displayed on the front-end page can be considered the final tree structure. Optionally, a prompt message can be displayed on the front-end page to indicate that the file directory has been loaded.
[0093] The file path data processing method provided in this disclosure allows the front-end to directly traverse the file path data stored in the back-end one by one. If the deepest node in the constructed tree structure that matches each level of the current data item matches the deepest level of the current data item, then the file name is directly added. If they do not match, then nodes in the current data item that do not exist in the tree structure are added, and then the file name is added, thereby gradually updating the tree structure. After updating the tree structure, the tree structure on the front-end page is updated synchronously in a timely manner, reducing the time that the page has blank space, reducing user waiting time, and effectively improving user experience. Furthermore, the data format for front-end and back-end interaction in this solution is simple, the code is readable, easy to maintain, and it is applicable to various front-end technology stacks, thus having a wide range of applications.
[0094] Figure 5 This is a schematic diagram illustrating another file path data processing method provided by an embodiment of this disclosure. Based on the aforementioned optional embodiments, this embodiment proposes an optional solution to further explain the display of the current tree structure. After updating the current tree structure by adding file names based on the matching between the deepest node and the deepest level in the folder hierarchy, the method further includes: determining whether there are any unprocessed data items; if not, displaying the updated current tree structure on the front-end page. The advantage of this setting is that after all data items have been processed, the final tree structure is displayed on the front-end page, reducing the impact of page content updates on the tree structure update speed and improving the tree structure update efficiency.
[0095] See Figure 5 The method includes:
[0096] Step 501: Determine the data items to be processed currently obtained from the backend.
[0097] Step 502: Determine the file path information based on the current data items to be processed. The file path information includes the folder level and the file name.
[0098] Step 503: In the current tree structure corresponding to the front-end page, search from shallow to deep for the deepest node that matches each level in the folder hierarchy.
[0099] The current tree structure includes a file directory structure built from the processed data items for display on the front-end page.
[0100] Step 504: Determine if the deepest node matches the deepest level in the folder hierarchy. If yes, proceed to step 505; otherwise, proceed to step 506.
[0101] Step 505: Fill the deepest node with the file name to update the current tree structure, then proceed to step 507.
[0102] Step 506: Add all nodes corresponding to the target level in the folder hierarchy under the deepest node, and fill the file name into the last node of the added nodes to update the current tree structure.
[0103] The target level includes the level that matches the deepest node.
[0104] Step 507: Determine if there are any unprocessed data items. If yes, proceed to step 501; otherwise, proceed to step 508.
[0105] In this embodiment of the disclosure, after each data item is processed, it is determined whether there are any data items that have not yet been processed. If there are, the process returns to step 501 and continues to update the current tree structure according to the next data item. If there are no data items, it means that the current tree structure is the final tree structure and can be displayed on the front-end page, so that users can directly view the correct and complete file directory.
[0106] Step 508: Display the updated current tree structure on the front-end page.
[0107] The file path data processing method provided in this embodiment allows the front end to directly traverse the file path data stored in the back end one by one. If the deepest node in the constructed tree structure that matches each level of the current data item matches the deepest level of the current data item, then the file name is directly added. If they do not match, then nodes in the current data item that do not exist in the tree structure are added, and then the file name is added, thereby gradually updating the tree structure. After processing all data items, the final tree structure is obtained, and the final tree structure is displayed on the front end page, which improves the efficiency of tree structure construction, reduces user waiting time, and effectively enhances user experience.
[0108] Figure 6 This is a schematic diagram of a file path data processing device according to an embodiment of the present disclosure. This embodiment is applicable to situations where a tree structure is displayed on a front-end for file path data on a back-end. The device can be implemented in hardware and / or software and can be configured in an electronic device. (Reference) Figure 6 The file path data processing device 600 includes:
[0109] The file path information determination module 601 is used to determine file path information based on the currently pending data items obtained from the backend, wherein the data items include file path data entries, and the file path information includes folder hierarchy and file name;
[0110] The deepest node search module 602 is used to search for the deepest node that matches each level in the folder hierarchy from shallow to deep in the current tree structure corresponding to the front-end page, wherein the current tree structure includes a file directory structure constructed based on the processed data items for display on the front-end page;
[0111] The tree structure update module 603 is used to add the file name to the current tree structure according to the matching situation between the deepest node and the deepest level in the folder hierarchy, so as to update the current tree structure.
[0112] The file path data processing scheme provided in this embodiment allows the front end to directly traverse the file path data stored in the back end one by one. Based on the matching situation between the deepest node matching each level of the current data item in the constructed tree structure and the deepest level of the current data item, the tree structure is gradually updated. This eliminates the need to traverse all data items multiple times and eliminates the need for additional conversion operations by the back end, thereby reducing the workload of the back end, improving the response speed of the back end interface, reducing lag in the front end interface, and enhancing the user experience.
[0113] In one alternative implementation, the tree structure update module includes:
[0114] A node adding unit is used to add nodes corresponding to all deep levels of the target level in the folder hierarchy under the deepest node when the deepest node does not match the deepest level in the folder hierarchy, wherein the target level includes the level that matches the deepest node;
[0115] The first update unit is used to fill the file name into the last node of the added nodes in order to update the current tree structure.
[0116] In one optional implementation, the tree structure update module includes:
[0117] The second update unit is used to fill the deepest node with the file name when the deepest node matches the deepest level in the folder hierarchy, so as to update the current tree structure.
[0118] In one alternative embodiment, the device further includes:
[0119] The first display module is used to display the updated current tree structure on the front-end page after updating the current tree structure by adding the file name to the current tree structure based on the matching of the deepest node with the deepest level in the folder hierarchy.
[0120] In one alternative embodiment, the device further includes:
[0121] The second display module is used to determine whether there are any unprocessed data items after updating the current tree structure by adding the file name to the current tree structure based on the matching of the deepest node with the deepest level in the folder hierarchy. If there are no unprocessed data items, the updated current tree structure is displayed on the front-end page.
[0122] In one alternative embodiment, the device further includes:
[0123] The repetition processing module is used to, after updating the current tree structure by adding the file name to the current tree structure based on the matching of the deepest node with the deepest level in the folder hierarchy, determine whether there are any unprocessed data items. If so, the module redetermines the current data item to be processed and repeats the steps of determining the file path information based on the current data item to be processed obtained from the backend to update the current tree structure until there are no unprocessed data items.
[0124] The collection, storage, use, processing, transmission, provision, and disclosure of user personal information involved in this technical solution comply with the provisions of relevant laws and regulations and do not violate public order and good morals.
[0125] According to embodiments of this disclosure, this disclosure also provides an electronic device, a readable storage medium, and a computer program product.
[0126] Figure 7 A schematic block diagram of an example electronic device 700 that can be used to implement embodiments of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the present disclosure described and / or claimed herein.
[0127] like Figure 7 As shown, device 700 includes a computing unit 701, which can perform various appropriate actions and processes based on a computer program stored in read-only memory (ROM) 702 or a computer program loaded into random access memory (RAM) 703 from storage unit 708. RAM 703 may also store various programs and data required for the operation of device 700. The computing unit 701, ROM 702, and RAM 703 are interconnected via bus 704. Input / output (I / O) interface 705 is also connected to bus 704.
[0128] Multiple components in device 700 are connected to I / O interface 705, including: input unit 706, such as keyboard, mouse, etc.; output unit 707, such as various types of monitors, speakers, etc.; storage unit 708, such as disk, optical disk, etc.; and communication unit 709, such as network card, modem, wireless transceiver, etc. Communication unit 709 allows device 700 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.
[0129] The computing unit 701 can 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 special-purpose artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit 701 performs the various 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 contained in a machine-readable medium, such as storage unit 708. In some embodiments, part or all of the computer program may be loaded and / or installed on device 700 via ROM 702 and / or communication unit 709. When the computer program is loaded into RAM 703 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).
[0130] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.
[0131] The program code used to implement the methods of this disclosure may be written in any combination of one or more programming languages. This program code may be provided to a processor or controller of a general-purpose computer, special-purpose computer, or other programmable data processing apparatus, such that when executed by the processor or controller, the program code causes the functions / operations specified in the flowcharts and / or block diagrams to be implemented. The program code may be executed entirely on a machine, partially on a machine, as a standalone software package partially on a machine and partially on a remote machine, or entirely on a remote machine or server.
[0132] In the context of this disclosure, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0133] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device for displaying information to the user (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor); and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the computer. Other types of devices can also be used to provide interaction with the 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 sound input, voice input, or tactile input).
[0134] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as data servers), or computing systems that include middleware components (e.g., application servers), or computing systems that include frontend components (e.g., user computers with graphical user interfaces or web browsers through which users can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., communication networks). Examples of communication networks include local area networks (LANs), wide area networks (WANs), blockchain networks, and the Internet.
[0135] Computer systems can include clients and servers. Clients and servers are generally geographically separated and typically interact via communication networks. The client-server relationship is established by computer programs running on the respective computers and having a client-server relationship with each other. A server can be a cloud server, also known as a cloud computing server or cloud host, a hosting product within the cloud computing service ecosystem that addresses the management difficulties and weak business scalability inherent in traditional physical hosting and VPS services. Servers can also be servers for distributed systems or servers integrated with blockchain technology.
[0136] Artificial intelligence (AI) is the study of enabling computers to simulate certain human thought processes and intelligent behaviors (such as learning, reasoning, thinking, and planning). It encompasses both hardware and software technologies. AI hardware technologies generally include sensors, dedicated AI chips, cloud computing, distributed storage, and big data processing. AI software technologies mainly include computer vision, speech recognition, natural language processing, machine learning / deep learning, big data processing, and knowledge graph technologies.
[0137] Cloud computing refers to a technology system that enables access to a shared pool of physical or virtual resources via a network. These resources can include servers, operating systems, networks, software, applications, and storage devices, and can be deployed and managed on demand and in a self-service manner. Cloud computing technology can provide efficient and powerful data processing capabilities for applications such as artificial intelligence and blockchain, as well as for model training.
[0138] It should be understood that the various forms of processes shown above can be used to reorder, add, or delete steps. For example, the steps described in this disclosure can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution provided in this disclosure can be achieved, and this is not limited herein.
[0139] The specific embodiments described above do not constitute a limitation on the scope of protection of this disclosure. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this disclosure should be included within the scope of protection of this disclosure.
Claims
1. A method for processing file path data, comprising: Based on the data items to be processed obtained from the backend, determine the file path information, wherein the data items include file path data entries, and the file path information includes folder level and file name; In the current tree structure corresponding to the front-end page, the deepest node that matches each level in the folder hierarchy is searched from shallow to deep. The current tree structure includes a file directory structure for display on the front-end page, constructed based on the processed data items. Based on the matching between the deepest node and the deepest level in the folder hierarchy, add the file name to the current tree structure to update the current tree structure; The step of adding the file name to the current tree structure based on the matching between the deepest node and the deepest level in the folder hierarchy to update the current tree structure includes: If the deepest node does not match the deepest level in the folder hierarchy, then nodes corresponding to all deep levels of the target level in the folder hierarchy are added under the deepest node, wherein the target level includes the level that matches the deepest node; and all deep levels are all levels deeper than the target level. The file name is filled into the last node of the added node to update the current tree structure.
2. The method according to claim 1, wherein, The step of adding the file name to the current tree structure based on the matching between the deepest node and the deepest level in the folder hierarchy to update the current tree structure includes: If the deepest node matches the deepest level in the folder hierarchy, then the file name is filled into the deepest node to update the current tree structure.
3. The method according to claim 1, after updating the current tree structure by adding the file name to the current tree structure based on the matching between the deepest node and the deepest level in the folder hierarchy, further includes: The updated current tree structure is displayed on the front-end page.
4. The method according to claim 1, after updating the current tree structure by adding the file name to the current tree structure based on the matching between the deepest node and the deepest level in the folder hierarchy, further includes: Determine if there are any unprocessed data items; If it does not exist, the updated current tree structure will be displayed on the front-end page.
5. The method according to any one of claims 1-4, after updating the current tree structure by adding the file name to the current tree structure based on the matching of the deepest node with the deepest level in the folder hierarchy, further comprising: Determine if there are any unprocessed data items; If it exists, the current data item to be processed is re-determined, and the relevant steps of determining the file path information based on the current data item to be processed obtained from the backend are repeated to update the current tree structure until there are no unprocessed data items.
6. A file path data processing apparatus, comprising: The file path information determination module is used to determine file path information based on the currently pending data items obtained from the backend. The data items include file path data entries, and the file path information includes folder hierarchy and file name. The deepest node search module is used to search for the deepest node that matches each level in the folder hierarchy from shallow to deep in the current tree structure corresponding to the front-end page. The current tree structure includes a file directory structure constructed based on the processed data items for display on the front-end page. The tree structure update module is used to add the file name to the current tree structure based on the matching between the deepest node and the deepest level in the folder hierarchy, so as to update the current tree structure. The tree structure update module includes: A node adding unit is configured to add nodes corresponding to all deep levels of a target level in the folder hierarchy under the deepest node when the deepest node does not match the deepest level in the folder hierarchy, wherein the target level includes levels that match the deepest node; and all deep levels are all levels deeper than the target level. The first update unit is used to fill the file name into the last node of the added nodes in order to update the current tree structure.
7. The apparatus according to claim 6, wherein, The tree structure update module includes: The second update unit is used to fill the file name into the deepest node when the deepest node matches the deepest level in the folder hierarchy, so as to update the current tree structure.
8. The apparatus according to claim 6, further comprising: The first display module is used to display the updated current tree structure on the front-end page after updating the current tree structure by adding the file name to the current tree structure based on the matching of the deepest node with the deepest level in the folder hierarchy.
9. The apparatus according to claim 6, further comprising: The second display module is used to determine whether there are any unprocessed data items after updating the current tree structure by adding the file name to the current tree structure based on the matching of the deepest node with the deepest level in the folder hierarchy. If there are no unprocessed data items, the updated current tree structure is displayed on the front-end page.
10. The apparatus according to any one of claims 6-9, further comprising: The repetition processing module is used to, after updating the current tree structure by adding the file name to the current tree structure based on the matching of the deepest node with the deepest level in the folder hierarchy, determine whether there are any unprocessed data items. If so, the module redetermines the current data item to be processed and repeats the steps of determining the file path information based on the current data item to be processed obtained from the backend to update the current tree structure until there are no unprocessed data items.
11. An electronic device, comprising: At least one processor; as well as A memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-5.
12. A non-transitory computer-readable storage medium storing computer instructions, wherein, The computer instructions are used to cause the computer to perform the method according to any one of claims 1-5.