Website multi-level menu processing method and device, equipment and storage medium

By receiving and parsing mind map files and using hash mapping to represent hierarchical relationships, the system enables rapid updates to multi-level menus on websites under maintenance. This solves the problems of complex and time-consuming operations in existing technologies and improves processing efficiency.

CN115437629BActive Publication Date: 2026-02-03CHINA UNITED NETWORK COMM GRP CO LTD +1
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202110615978.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-06-02
Publication Date
2026-02-03
Estimated Expiration
2041-06-02

AI Technical Summary

Technical Problem

In existing technologies, updating multi-level menus on a website is complex and time-consuming. After processing each submenu, the entire menu collapses and needs to be expanded again from the root menu, making the process cumbersome.

Method used

By receiving a mind map file based on the hierarchical relationship of the target website's menu, parsing and calling network requests, and using hash mapping to represent the hierarchical relationship, the system updates the multi-level menus of the website to be maintained, including adding, deleting, and querying menus.

Benefits of technology

It enables quick and convenient updates to multi-level menus, avoiding the complex operation of repeatedly expanding menus and improving processing efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115437629B_ABST
    Figure CN115437629B_ABST
Patent Text Reader

Abstract

The application provides a website multilevel menu processing method, device and equipment and a storage medium. The method comprises the following steps: receiving a mind map file established based on the hierarchical relationship of a target website menu, parsing the mind map file, calling a corresponding network request, updating the multilevel menu of a website to be maintained, and obtaining the updated multilevel menu consistent with the target website menu. The method can realize one-key update processing of the multilevel menu of the website to be maintained through the mind map, thereby avoiding the complex operation of repeatedly expanding the entire menu layer by layer when updating the multilevel menu. The processing process is convenient and fast, and the processing efficiency is high.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of Internet product maintenance technology, and in particular to a method, apparatus, device and storage medium for processing multi-level menus on websites. Background Technology

[0002] With the development of the internet, websites are becoming increasingly widely used in daily life. Some websites, such as internal company management websites or personal blogs, require users to manually update their multi-level menus.

[0003] Currently, the common approach is to directly add or delete multi-level menus on the website being maintained. However, when updating multi-level menus using this method, the entire menu collapses after each submenu is processed, leaving only the root menu visible. To continue processing other submenus, it is necessary to start from the root menu again and expand the entire menu layer by layer, which is complex and time-consuming.

[0004] Therefore, how to conveniently and quickly handle multi-level menus on a website is an urgent problem to be solved. Summary of the Invention

[0005] This application provides a method, apparatus, device, and storage medium for processing multi-level menus on a website, which facilitates and expedites the processing of multi-level menus on a website to be maintained.

[0006] In a first aspect, embodiments of this application provide a method for processing multi-level menus on a website, including:

[0007] Receive a website menu update instruction, the website menu update instruction including a mind map file based on the hierarchical relationship of the target website menu, the target website menu including multiple menu nodes;

[0008] The mind map file is parsed, and corresponding network requests are invoked to update the multi-level menu of the website to be maintained, resulting in an updated multi-level menu that is consistent with the target website menu. The network requests include those for adding, deleting, and querying menus.

[0009] Furthermore, as described above, the process of parsing the mind map file and invoking corresponding network requests to update the multi-level menus of the website to be maintained includes:

[0010] A traversal algorithm is used to traverse the mind map file, and the traversed mind map is stored in a hash map; wherein, the hash map is a key-value pair structure, and the hash map is used to represent the hierarchical relationship in the mind map file;

[0011] Based on the hierarchical relationship represented by the hash mapping, the corresponding network request is invoked to update the hierarchical relationship of the multi-level menu of the website to be maintained, and the updated multi-level menu is obtained.

[0012] Further, in the method described above, the step of invoking the corresponding network request based on the hierarchical relationship represented by the hash mapping to update the hierarchical relationship of the multi-level menu of the website to be maintained, and obtaining the updated multi-level menu, includes:

[0013] If there is no menu corresponding to the root node of the hash mapping in the multi-level menu of the website to be maintained, then the network request corresponding to adding the menu corresponding to the root node and all its child nodes is invoked to add the menu to the multi-level menu of the website to be maintained.

[0014] If there is a menu in the multi-level menu of the website to be maintained that corresponds to the root node of the hash mapping, then each child node of the root node is traversed, and it is determined whether there is a menu in the multi-level menu of the website to be maintained that corresponds to the child node. If there is no menu, then the network request corresponding to the addition of the menu is called to add the menu corresponding to the child node to the multi-level menu of the website to be maintained.

[0015] If there is a menu in the multi-level menu of the website to be maintained that does not correspond to any node of the hash mapping, then the network request corresponding to the deletion of the menu is invoked to delete the menu and all its sub-menus from the multi-level menu of the website to be maintained.

[0016] Further, in the method described above, the step of invoking the corresponding network request based on the hierarchical relationship represented by the hash mapping to update the hierarchical relationship of the multi-level menu of the website to be maintained, and obtaining the updated multi-level menu, includes:

[0017] Detect whether the root node of the hash mapping corresponds to a submenu in the multi-level menu of the website to be maintained;

[0018] If so, then the network request corresponding to the query menu is invoked to query the sub-menu corresponding to the root node in the multi-level menu of the website to be maintained;

[0019] Based on the hierarchical relationship represented by the hash mapping, the corresponding network request is invoked to update the sub-menu and all its sub-menus in the multi-level menu of the website to be maintained, thereby obtaining the updated multi-level menu.

[0020] Furthermore, in the method described above, the method further includes:

[0021] If the root node of the hash mapping corresponds to a submenu in the multi-level menu of the website to be maintained, then the node name of the root node is set to a node name containing a predetermined identifier, and the node name is used to represent the level where the submenu is located.

[0022] The determination of whether the root node of the hash mapping corresponds to a sub-menu in the multi-level menu of the website to be maintained includes:

[0023] If the node name of the root node of the hash map contains the predetermined identifier, then the root node of the hash map corresponds to a sub-menu in the multi-level menu of the website to be maintained.

[0024] Secondly, embodiments of this application provide a website multi-level menu processing apparatus, comprising:

[0025] A receiving module is used to receive a website menu update instruction, wherein the website menu update instruction includes a mind map file established based on the hierarchical relationship of the target website menu, and the target website menu includes multiple menu nodes;

[0026] The processing module is used to parse the mind map file and make corresponding network requests to update the multi-level menu of the website to be maintained, so as to obtain the updated multi-level menu, which is consistent with the menu of the target website; the network requests include network requests for adding menus, deleting menus, and querying menus.

[0027] Furthermore, in the apparatus described above, the processing module is also used to detect whether the root node of the hash mapping corresponds to a sub-menu in the multi-level menu of the website to be maintained;

[0028] If so, then the network request corresponding to the query menu is invoked to query the sub-menu corresponding to the root node in the multi-level menu of the website to be maintained;

[0029] Based on the hierarchical relationship represented by the hash mapping, the corresponding network request is invoked to update the sub-menu and all its sub-menus in the multi-level menu of the website to be maintained, thereby obtaining the updated multi-level menu.

[0030] Thirdly, embodiments of this application provide an electronic device, including: a memory and a processor;

[0031] Memory: Memory used to store the processor's executable instructions;

[0032] The processor is used to invoke program instructions in the memory to execute the website multi-level menu processing method as described in the first aspect.

[0033] Fourthly, embodiments of this application provide a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, are used to implement the website multi-level menu processing method as described in the first aspect.

[0034] Fifthly, embodiments of this application provide a computer program product, including a computer program that, when executed by a processor, implements the website multi-level menu processing method as described in the first aspect.

[0035] This application provides a method, apparatus, device, and storage medium for processing multi-level menus on a website. It receives a mind map file based on the hierarchical relationship of the target website's menu, parses the mind map file, and invokes corresponding network requests to update the multi-level menus of the website to be maintained, obtaining an updated multi-level menu consistent with the target website's menu. In other words, it allows for one-click updating of multi-level menus on a website using a mind map, avoiding the complex operation of repeatedly expanding the entire menu layer by layer when updating multi-level menus. The processing is convenient, fast, and highly efficient. Attached Figure Description

[0036] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.

[0037] Figure 1 A schematic diagram illustrating one application scenario provided in this application;

[0038] Figure 2 A flowchart of the website multi-level menu processing method provided in this application;

[0039] Figure 3 A schematic diagram of the mind map file provided for this application;

[0040] Figure 4 A flowchart of the website multi-level menu processing method provided in this application;

[0041] Figure 5 A schematic diagram of yet another mind map file provided for this application;

[0042] Figure 6 A schematic diagram of the structure of the website multi-level menu processing device provided in this application;

[0043] Figure 7 This is a schematic diagram of the electronic device of this application.

[0044] The accompanying drawings have illustrated specific embodiments of this application, which will be described in more detail below. These drawings and descriptions are not intended to limit the scope of the concept in any way, but rather to illustrate the concept of this application to those skilled in the art through reference to specific embodiments. Detailed Implementation

[0045] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description relates to the drawings, unless otherwise indicated, the same numbers in different drawings denote the same or similar elements. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with this application. Rather, they are merely examples of apparatuses and methods consistent with some aspects of this application as detailed in the appended claims.

[0046] With the development of internet technology, websites are becoming increasingly widely used. Some websites require users to manually update their multi-level menus. Current technology typically involves directly adding or deleting items from the multi-level menus. However, when updating multi-level menus using this method, the entire menu collapses after each submenu is processed, leaving only the root menu displayed. To continue processing other submenus, it's necessary to start from the root menu again, expanding the entire menu layer by layer – a complex and time-consuming process.

[0047] The website multi-level menu processing method, apparatus, device and storage medium provided in this application are intended to solve the above-mentioned technical problems of the prior art.

[0048] The technical solution of this application and how the technical solution of this application solves the above-mentioned technical problems are described in detail below with specific embodiments. These specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments. The embodiments of this application will now be described with reference to the accompanying drawings.

[0049] Figure 1 A schematic diagram illustrating an application scenario provided in this application, such as... Figure 1 As shown, the Figure 1 The top image shows a mind map file built based on the hierarchical relationship of the target website's menu. The middle image shows the application used to receive and parse this mind map file. The bottom image shows the updated multi-level menu of the website to be maintained.

[0050] In practical application, users simply click the "Select Use Case File" button on the application, select the pre-created mind map file, and then click the "Import" button. The program will automatically parse the mind map file and make the corresponding network requests to update the multi-level menu of the website to be maintained, thus obtaining the updated multi-level menu. It can be seen that the hierarchical relationship of the updated multi-level menu is consistent with the hierarchical relationship of the mind map file built based on the hierarchical relationship of the target website's menu.

[0051] Example 1

[0052] Figure 2 A flowchart of the website multi-level menu processing method provided in this application is shown below. Figure 2 As shown, the website multi-level menu processing method provided in this embodiment includes the following steps:

[0053] Step 101: Receive a website menu update instruction. The website menu update instruction includes a mind map file based on the hierarchical relationship of the target website menu, and the target website menu includes multiple menu nodes.

[0054] Step 102: Parse the mind map file and call the corresponding network requests to update the multi-level menu of the website to be maintained, and obtain the updated multi-level menu. The updated multi-level menu is consistent with the menu of the target website. The network requests include network requests for adding menus, deleting menus, and querying menus.

[0055] It should be noted that the execution entity of the website multi-level menu processing method provided in this embodiment can be a website multi-level menu processing device. In practical applications, this website multi-level menu processing device can be implemented by a computer program, such as application software or computer programs, or by a medium storing the relevant computer program, such as a USB flash drive or optical disc; or it can be implemented by a physical device that integrates or installs the relevant computer program, such as a chip.

[0056] In this embodiment, to avoid the complex operation of repeatedly expanding the entire menu layer by layer when updating multi-level menus, a mind map file is used for updating the multi-level menus. Specifically, the website multi-level menu processing device first receives a website menu update instruction. This instruction includes a mind map file based on the hierarchical relationship of the target website menu. The target website menu is the menu to be ultimately presented, and its hierarchical relationship includes the names of each level of menu and the dependencies between each sub-menu and its parent and sibling menus.

[0057] It should be noted that the target website menu is a target website menu that includes multiple menu nodes.

[0058] The specific method for receiving update instructions can be through manual import by the user or through other suitable methods; this embodiment does not limit this method.

[0059] Next, the website multilevel menu processing device can parse the mind map file and call the corresponding network requests to update the multilevel menu of the website to be maintained, thereby obtaining the updated multilevel menu, which is consistent with the menu that is ultimately presented, i.e., the target website menu.

[0060] The network requests include those for adding, deleting, and querying menus. These network requests can be directly invoked by the website multi-level menu processing device through the website to be maintained, or the corresponding links of the network requests can be saved in advance for invocation by the website multi-level menu processing device. This embodiment does not limit this.

[0061] Furthermore, the method for parsing mind map files will be described in detail in Example 2, and will not be repeated here.

[0062] This embodiment provides a method for processing multi-level menus on websites. It receives a mind map file based on the hierarchical relationship of the target website's menu, parses the mind map file, and invokes corresponding network requests to update the multi-level menus of the website to be maintained, obtaining an updated multi-level menu consistent with the target website's menu. In other words, this embodiment allows for one-click updating of multi-level menus on a website using a mind map, avoiding the complex operation of repeatedly expanding the entire menu layer by layer when updating multi-level menus. The process is convenient, fast, and highly efficient.

[0063] Example 2

[0064] Based on the above embodiment one, in order to further illustrate the website multi-level menu processing method of this application, step 102 includes: traversing the mind map file using a traversal algorithm, and storing the traversed mind map in a hash map; wherein, the hash map is a key-value pair structure, and the hash map is used to represent the hierarchical relationship in the mind map file; according to the hierarchical relationship represented by the hash map, calling the corresponding network request to update the hierarchical relationship of the multi-level menu of the website to be maintained, and obtaining the updated multi-level menu.

[0065] In this embodiment, to enable the mind map file to be used in the website and thus achieve the updating of multi-level menus, the mind map file needs to be parsed. Specifically, the website multi-level menu processing device can start from the root node of the mind map file, use a traversal algorithm to traverse all child nodes in the mind map file, and store the traversed mind map in a hash map.

[0066] The traversal algorithm can be a breadth-first recursive traversal algorithm or other suitable algorithms; this embodiment does not limit the specific algorithm used.

[0067] Furthermore, the hash map is a key-value pair structure used to represent the hierarchical relationships in the mind map file. These hierarchical relationships include the names of each node in the mind map file and the dependencies between each child node and its parent and sibling nodes. It should be noted that the names of each node in the mind map file are the names of the various levels of menus in the target website's menu, and the dependencies between each child node and its parent and sibling nodes in the mind map file are the same as the dependencies between each sub-menu and its parent and sibling menus in the target website's menu.

[0068] In one alternative implementation, the hash map stores node names as keys and lists as values. It stores a recursive hash map, terminating when a leaf node is encountered and storing the results as a string. In other words, the hash map can represent the hierarchical relationships in a mind map file through nested structures.

[0069] For example, Figure 3 A schematic diagram of the mind map file provided in this application, such as Figure 3 As shown, the root node of this mind map file is named "test", and its child node names include "Level 1 Menu 1", "Level 1 Menu 2", "Level 1 Menu 1's Level 2 Menu 1", "Level 1 Menu 1's Level 2 Menu 2", "Level 1 Menu 2's Level 2 Menu", and "Level 3 Menu". The leaf node names include "Level 1 Menu 1's Level 2 Menu 1", "Level 1 Menu 1's Level 2 Menu 2", and "Level 3 Menu". Correspondingly, the result of parsing and storing this mind map file after hash mapping is: "{test=[{Level 1 Menu 1=[Level 1 Menu 1's Level 2 Menu 1, Level 1 Menu 1's Level 2 Menu 2]},{Level 1 Menu 2=[{Level 1 Menu 2's Level 2 Menu=[Level 3 Menu]}]}]}".

[0070] Next, the website multilevel menu processing device can call the corresponding network requests based on the hierarchical relationship represented by the hash mapping to update the hierarchical relationship of the multilevel menu of the website to be maintained, and obtain the updated multilevel menu.

[0071] The website multi-level menu processing method provided in this embodiment stores the mind map file as a hash mapping data structure that can represent the hierarchical relationship in the mind map file by traversing. This hierarchical relationship can then be applied to the website to be maintained, thereby realizing the update processing of multi-level menus. This effectively solves the technical problem that mind map files cannot be directly applied to websites.

[0072] Based on the above embodiment two, the step of calling the corresponding network request according to the hierarchical relationship represented by the hash mapping to update the hierarchical relationship of the multi-level menu of the website to be maintained, and obtaining the updated multi-level menu, includes: if there is no menu corresponding to the root node of the hash mapping in the multi-level menu of the website to be maintained, then calling the network request corresponding to adding the root node and all its child nodes to the multi-level menu of the website to be maintained; if there is a menu corresponding to the root node of the hash mapping in the multi-level menu of the website to be maintained, then traversing each child node of the root node, and determining whether there is a menu corresponding to that child node in the multi-level menu of the website to be maintained. If not, calling the network request corresponding to adding the menu, and adding the menu corresponding to the child node to the multi-level menu of the website to be maintained; if there is a menu in the multi-level menu of the website to be maintained that does not correspond to any node of the hash mapping, then calling the network request corresponding to deleting the menu, and deleting the menu and all its child menus from the multi-level menu of the website to be maintained.

[0073] In this embodiment, after the website multi-level menu processing device stores the traversed mind map in a hash map, it can invoke the corresponding network request according to the hierarchical relationship represented by the hash map to update the hierarchical relationship of the multi-level menu of the website to be maintained, thereby obtaining the updated multi-level menu. The specific processing method is as follows:

[0074] If the multi-level menu of the website to be maintained does not contain a menu name corresponding to the root node name in the hash mapping, it indicates that the multi-level menu of the website to be maintained lacks a menu corresponding to the root node and all its child nodes. Therefore, the website multi-level menu processing device can invoke the network request corresponding to adding a menu, and use the node names of the root node and all its child nodes as the corresponding menu names to add them to the multi-level menu of the website to be maintained.

[0075] If a multi-level menu of the website to be maintained contains a menu name corresponding to the root node's name in the hash mapping, it indicates that a menu corresponding to that root node exists in the multi-level menu of the website to be maintained. However, it does not necessarily contain menus corresponding to all child nodes of that root node. Therefore, the website multi-level menu processing device can traverse each child node of the root node and determine one by one whether a menu name corresponding to the node name of that child node exists in the multi-level menu of the website to be maintained. If it does not exist, it indicates that a menu corresponding to that child node is missing in the multi-level menu of the website to be maintained. Therefore, the network request corresponding to adding a menu can be invoked to add the node name of that child node as its corresponding menu name to the multi-level menu of the website to be maintained.

[0076] If a multi-level menu on the website to be maintained contains a menu that does not correspond to any node in the hash mapping, it indicates that the menu and all its submenus are redundant. Therefore, the website multi-level menu processing device can invoke the network request corresponding to the menu deletion to remove the menu and all its submenus from the multi-level menu of the website to be maintained.

[0077] The above method allows for convenient and quick updates to the hierarchical relationships of multi-level menus on a website, resulting in high processing efficiency.

[0078] Figure 4 A flowchart of the website multi-level menu processing method provided in this application is shown below. Figure 4 As shown, the website multi-level menu processing method provided in this embodiment, based on the above embodiment two, includes the following steps: According to the hierarchical relationship represented by the hash mapping, the method calls the corresponding network request to update the hierarchical relationship of the multi-level menu of the website to be maintained, and obtains the updated multi-level menu.

[0079] Step 201: Detect whether the root node of the hash mapping corresponds to a sub-menu in the multi-level menu of the website to be maintained.

[0080] Step 202: If yes, then call the network request corresponding to the query menu to query the sub-menu corresponding to the root node in the multi-level menu of the website to be maintained.

[0081] Step 203: Based on the hierarchical relationship represented by the hash mapping, call the corresponding network request to update the sub-menu and all its sub-menus in the multi-level menu of the website to be maintained, and obtain the updated multi-level menu.

[0082] In this embodiment, in order to update the hierarchical relationship of the multi-level menu of the website to be maintained more accurately and efficiently, it is necessary to first determine whether the multi-level menu to be processed is the entire multi-level menu or a sub-menu within the multi-level menu before processing.

[0083] Specifically, the website multi-level menu processing device can detect whether the root node of the hash mapping corresponds to a submenu within the multi-level menu of the website to be maintained. If so, it indicates that the submenu to be processed is a submenu within the multi-level menu. Therefore, in order to accurately identify which submenu to be processed is, the website multi-level menu processing device can invoke the network request corresponding to the menu query to query the submenu corresponding to the root node in the multi-level menu of the website to be maintained, which is the submenu to be processed.

[0084] Next, the website multilevel menu processing device can call the corresponding network request according to the hierarchical relationship represented by the hash mapping to update the sub-menu to be processed and all its sub-menus in the multilevel menu of the website to be maintained, and obtain the updated multilevel menu.

[0085] It should be noted that the specific detection method can be to detect whether the node name of the root node of the hash mapping contains a predetermined identifier, or other suitable detection methods. This embodiment does not limit this.

[0086] The website multi-level menu processing method provided in this embodiment detects whether the root node of the hash mapping corresponds to a sub-menu in the multi-level menu of the website to be maintained, and determines whether the entire multi-level menu or a sub-menu in the multi-level menu needs to be processed. If it is a sub-menu, the sub-menu is found by querying, and the sub-menu and all its sub-menus are updated, thereby making the processing more accurate and efficient.

[0087] Example 3

[0088] Based on any other embodiment, in order to further illustrate the website multi-level menu processing method of this application, the method further includes: if the root node of the hash mapping corresponds to a sub-menu in the multi-level menu of the website to be maintained, then the node name of the root node is set to a node name containing a predetermined identifier, and the node name is used to represent the level where the sub-menu is located.

[0089] The step of detecting whether the root node of the hash mapping corresponds to a sub-menu in the multi-level menu of the website to be maintained includes: if the node name of the root node of the hash mapping contains the predetermined identifier, then it is determined that the root node of the hash mapping corresponds to a sub-menu in the multi-level menu of the website to be maintained.

[0090] In this embodiment, to facilitate detection of whether the menu to be processed is a submenu within a multi-level menu of the website to be maintained, the node name of the root node of the hash map needs to be set. Specifically, if the root node of the hash map corresponds to a submenu within a multi-level menu of the website to be maintained, the node name of the root node is set to a node name containing a predetermined identifier. This node name containing the predetermined identifier can be used to characterize the level at which the submenu resides.

[0091] It should be noted that the name of the root node of this hash mapping is the same as the name of the root node of the mind map file. The name of the root node of the hash mapping can be set by setting the name of the root node of the mind map file.

[0092] For example, Figure 5 An illustration of another mind map file provided in this application, such as Figure 5 As shown, the root node name of this mind map file is the node name containing a predefined identifier, where the predefined identifier is “=>”. This node name indicates that the sub-menu in the multi-level menu of the website to be maintained corresponding to this root node is located at the level of “System Management” sub-menu of “Data Encryption System WEB” under “Security Service System”.

[0093] Accordingly, if the root node of the hash map contains a predetermined identifier in its node name, the website multilevel menu processing device can determine that the root node of the hash map corresponds to a submenu in the multilevel menu of the website to be maintained.

[0094] The website multi-level menu processing method provided in this embodiment determines whether the root node corresponding to the hash mapping is a sub-menu in the multi-level menu of the website to be maintained by setting the node name of the root node containing a predetermined identifier, thereby laying the foundation for subsequent processing.

[0095] Example 4

[0096] Figure 6 A schematic diagram of the structure of the website multi-level menu processing device provided in this application is shown below. Figure 6 As shown, the website multi-level menu processing device provided in this embodiment includes a receiving module 31 and a processing module 32. The receiving module 31 is used to receive a website menu update instruction, which includes a mind map file established based on the hierarchical relationship of the target website menu, and the target website menu includes multiple menu nodes. The processing module 32 is used to parse the mind map file and invoke corresponding network requests to update the multi-level menu of the website to be maintained, obtaining an updated multi-level menu. The updated multi-level menu is consistent with the target website menu; the network requests include network requests corresponding to adding menus, deleting menus, and querying menus.

[0097] The website multi-level menu processing device provided in this embodiment receives a mind map file established based on the hierarchical relationship of the target website's menu, parses the mind map file, and invokes the corresponding network requests to update the multi-level menu of the website to be maintained, obtaining an updated multi-level menu consistent with the target website's menu. In other words, the device of this application can achieve one-click updating of the multi-level menu of the website to be maintained through a mind map, thereby avoiding the complex operation of repeatedly expanding the entire menu layer by layer when updating multi-level menus. The processing is convenient, fast, and highly efficient.

[0098] In an optional embodiment, the processing module 32 is further configured to traverse the mind map file using a traversal algorithm and store the traversed mind map in a hash map; wherein the hash map is a key-value pair structure, and the hash map is used to represent the hierarchical relationship in the mind map file; according to the hierarchical relationship represented by the hash map, the corresponding network request is invoked to update the hierarchical relationship of the multi-level menu of the website to be maintained, and the updated multi-level menu is obtained.

[0099] In an optional implementation, the processing module 32 is further configured to: if there is no menu corresponding to the root node of the hash mapping in the multi-level menu of the website to be maintained, call the network request corresponding to adding the root node and all its child nodes to the multi-level menu of the website to be maintained; if there is a menu corresponding to the root node of the hash mapping in the multi-level menu of the website to be maintained, traverse each child node of the root node and determine whether there is a menu corresponding to that child node in the multi-level menu of the website to be maintained; if not, call the network request corresponding to adding the menu corresponding to the child node to the multi-level menu of the website to be maintained; if there is a menu in the multi-level menu of the website to be maintained that does not correspond to any node of the hash mapping, call the network request corresponding to deleting the menu to delete the menu and all its child menus from the multi-level menu of the website to be maintained.

[0100] In an optional implementation, the processing module 32 is further configured to detect whether the root node of the hash mapping corresponds to a sub-menu in the multi-level menu of the website to be maintained; if so, it calls the network request corresponding to the menu query to query the sub-menu corresponding to the root node in the multi-level menu of the website to be maintained; according to the hierarchical relationship represented by the hash mapping, it calls the corresponding network request to update the sub-menu and all its sub-menus in the multi-level menu of the website to be maintained, and obtain the updated multi-level menu.

[0101] In an optional implementation, if the root node of the hash map corresponds to a submenu in the multi-level menu of the website to be maintained, then the node name of the root node is set to a node name containing a predetermined identifier, wherein the node name is used to represent the level of the submenu. Accordingly, the processing module 32 is further configured to determine that the root node of the hash map corresponds to a submenu in the multi-level menu of the website to be maintained if the node name of the root node of the hash map contains the predetermined identifier.

[0102] It should be noted that the technical solution and effects of the website multi-level menu processing device provided in this embodiment can be found in the relevant content of the foregoing method embodiments, and will not be repeated here.

[0103] Example 5

[0104] Figure 7 This is a schematic diagram of the structure of the electronic device of this application, as shown below. Figure 7 As shown, this application also provides an electronic device 400, including: a memory 401 and a processor 402.

[0105] Memory 401 is used to store programs. Specifically, the program may include program code, which includes computer-executable instructions. Memory 401 may include high-speed RAM memory, and may also include non-volatile memory, such as at least one disk storage device.

[0106] Processor 402 is used to execute the program stored in memory 401.

[0107] The computer program is stored in memory 401 and configured to be executed by processor 402 to implement the website multi-level menu processing method provided in any embodiment of this application. Related descriptions can be understood by referring to the relevant descriptions and effects corresponding to the steps in the accompanying drawings, and will not be elaborated upon here.

[0108] In this embodiment, the memory 401 and the processor 402 are connected via a bus. The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 7 The bus is represented by a single thick line, but this does not mean that there is only one bus or one type of bus.

[0109] Example 6

[0110] This application also provides a computer-readable storage medium storing a computer program thereon, which is executed by a processor to implement the website multi-level menu processing method provided in any embodiment of this application.

[0111] Example 7

[0112] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the website multi-level menu processing method provided in any embodiment of this application.

[0113] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of modules is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple modules or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between apparatuses or modules may be electrical, mechanical, or other forms.

[0114] The modules described as separate components may or may not be physically separate. Similarly, the components shown as modules may or may not be physical modules; they may be located in one place or distributed across multiple network modules. Some or all of the modules can be selected to achieve the purpose of this embodiment, depending on actual needs.

[0115] Furthermore, the functional modules in the various embodiments of this application can be integrated into one processing module, or each module can exist physically separately, or two or more modules can be integrated into one module. The integrated module can be implemented in hardware or in a combination of hardware and software functional modules.

[0116] The program code used to implement the methods of this application may be written in any combination of one or more programming languages. This program code may be provided to the processor or controller of a general-purpose computer, special-purpose computer, or other programmable multi-level menu processing device, such that when executed by the processor or controller, the functions / operations specified in the flowcharts and / or block diagrams are implemented. The program code may be executed entirely on the machine, partially on the machine, as a standalone software package partially on the machine and partially on a remote machine, or entirely on a remote machine or server.

[0117] In the context of this application, 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. Machine-readable media 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 fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.

[0118] Furthermore, although the operations are described in a specific order, this should be understood as requiring that such operations be performed in the specific order shown or in sequential order, or requiring that all illustrated operations be performed to achieve the desired result. In certain environments, multitasking and parallel processing may be advantageous. Similarly, although several specific implementation details are included in the above discussion, these should not be construed as limiting the scope of this application. Certain features described in the context of individual embodiments may also be implemented in combination in a single implementation. Conversely, various features described in the context of a single implementation may also be implemented individually or in any suitable sub-combination in multiple implementations.

[0119] Other embodiments of this application will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of this application that follow the general principles of this application and include common knowledge or customary techniques in the art not disclosed herein. The specification and examples are to be considered exemplary only, and the true scope and spirit of this application are indicated by the following claims.

[0120] It should be understood that this application is not limited to the precise structure described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this application is limited only by the appended claims.

Claims

1. A method for processing multi-level menus on a website, characterized in that, include: Receive a website menu update instruction, the website menu update instruction including a mind map file based on the hierarchical relationship of the target website menu, the target website menu including multiple menu nodes; The mind map file is parsed, and corresponding network requests are invoked to update the multi-level menu of the website to be maintained, resulting in an updated multi-level menu that is consistent with the menu of the target website. The network requests include those for adding, deleting, and querying menus. The process of parsing the mind map file and making corresponding network requests to update the multi-level menus of the website to be maintained includes: A traversal algorithm is used to traverse the mind map file, and the traversed mind map is stored in a hash map; wherein, the hash map is a key-value pair structure, and the hash map is used to represent the hierarchical relationship in the mind map file; Based on the hierarchical relationship represented by the hash mapping, the corresponding network request is invoked to update the hierarchical relationship of the multi-level menu of the website to be maintained, and the updated multi-level menu is obtained. The hash mapping represents the hierarchical relationship in the mind map file through nesting. In the hash mapping, the key stores the node name, the value is a list type, and the stored hash mapping is a recursive hash mapping. The recursion terminates when a leaf node is encountered, and the value is stored as a string type. The step of invoking corresponding network requests based on the hierarchical relationship represented by the hash mapping to update the hierarchical relationship of the multi-level menu of the website to be maintained, and obtaining the updated multi-level menu, includes: Detect whether the root node of the hash mapping corresponds to a submenu in the multi-level menu of the website to be maintained; If so, then the network request corresponding to the query menu is invoked to query the sub-menu corresponding to the root node in the multi-level menu of the website to be maintained; Based on the hierarchical relationship represented by the hash mapping, the corresponding network request is invoked to update the sub-menus and all their sub-menus in the multi-level menu of the website to be maintained, thereby obtaining the updated multi-level menu; or... If there is no menu corresponding to the root node of the hash mapping in the multi-level menu of the website to be maintained, then the network request corresponding to adding the menu corresponding to the root node and all its child nodes is invoked to add the menu to the multi-level menu of the website to be maintained. If there is a menu in the multi-level menu of the website to be maintained that corresponds to the root node of the hash mapping, then each child node of the root node is traversed, and it is determined whether there is a menu in the multi-level menu of the website to be maintained that corresponds to the child node. If there is no menu, then the network request corresponding to the addition of the menu is called to add the menu corresponding to the child node to the multi-level menu of the website to be maintained. If there is a menu in the multi-level menu of the website to be maintained that does not correspond to any node of the hash mapping, then the network request corresponding to the deletion of the menu is invoked to delete the menu and all its sub-menus from the multi-level menu of the website to be maintained.

2. The method according to claim 1, characterized in that, The method further includes: If the root node of the hash mapping corresponds to a submenu in the multi-level menu of the website to be maintained, then the node name of the root node is set to a node name containing a predetermined identifier, and the node name is used to represent the level where the submenu is located. The determination of whether the root node of the hash mapping corresponds to a sub-menu in the multi-level menu of the website to be maintained includes: If the node name of the root node of the hash map contains the predetermined identifier, then the root node of the hash map corresponds to a sub-menu in the multi-level menu of the website to be maintained.

3. A website multi-level menu processing device, characterized in that, include: A receiving module is used to receive a website menu update instruction, wherein the website menu update instruction includes a mind map file established based on the hierarchical relationship of the target website menu, and the target website menu includes multiple menu nodes; The processing module is used to parse the mind map file and make corresponding network requests to update the multi-level menu of the website to be maintained, so as to obtain the updated multi-level menu, which is consistent with the menu of the target website; the network requests include network requests for adding menus, deleting menus, and querying menus. The processing module is specifically used to traverse the mind map file using a traversal algorithm and store the traversed mind map in a hash map; wherein, the hash map is a key-value pair structure, the hash map is used to represent the hierarchical relationship in the mind map file, the hash map represents the hierarchical relationship in the mind map file through nesting, in the hash map, the key stores the node name, the value is a list type, the stored hash map is recursive, the recursion terminates when a leaf node is encountered, and it is stored as a string type; Based on the hierarchical relationship represented by the hash mapping, the corresponding network request is invoked to update the hierarchical relationship of the multi-level menu of the website to be maintained, and the updated multi-level menu is obtained. The processing module is also used to detect whether the root node of the hash mapping corresponds to a sub-menu in the multi-level menu of the website to be maintained. If so, then the network request corresponding to the query menu is invoked to query the sub-menu corresponding to the root node in the multi-level menu of the website to be maintained; Based on the hierarchical relationship represented by the hash mapping, the corresponding network request is invoked to update the sub-menus and all their sub-menus in the multi-level menu of the website to be maintained, thereby obtaining the updated multi-level menu; or... The processing module is further configured to, if there is no menu corresponding to the root node of the hash mapping in the multi-level menu of the website to be maintained, call the network request corresponding to the addition of the menu to add the menu corresponding to the root node and all its child nodes to the multi-level menu of the website to be maintained. If there is a menu in the multi-level menu of the website to be maintained that corresponds to the root node of the hash mapping, then each child node of the root node is traversed, and it is determined whether there is a menu in the multi-level menu of the website to be maintained that corresponds to the child node. If there is no menu, then the network request corresponding to the addition of the menu is called to add the menu corresponding to the child node to the multi-level menu of the website to be maintained. If there is a menu in the multi-level menu of the website to be maintained that does not correspond to any node of the hash mapping, then the network request corresponding to the deletion of the menu is invoked to delete the menu and all its sub-menus from the multi-level menu of the website to be maintained.

4. An electronic device, characterized in that, include: Memory, processor; Memory: Memory used to store the processor's executable instructions; The processor is used to invoke program instructions in the memory to execute the website multi-level menu processing method as described in claim 1 or 2.

5. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer-executable instructions, which, when executed by a processor, are used to implement the website multi-level menu processing method as described in claim 1 or 2.

6. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by the processor, it implements the website multi-level menu processing method as described in claim 1 or 2.

Citation Information

Patent Citations

  • Mind map-based Web application development method and apparatus, and electronic device

    CN111414168A