A method, apparatus, electronic device, and storage medium for linking page menus.

By constructing a data node tree for the page menu and implementing linked rendering, the problem of unrelated webpage menus was solved, achieving flexibility and efficient rendering of the page menu, while reducing performance consumption and data redundancy.

CN115904586BActive Publication Date: 2025-10-31BEIJING TOPSEC NETWORK SECURITY TECH +2
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211457310.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-11-21
Publication Date
2025-10-31
Estimated Expiration
2042-11-21

AI Technical Summary

Technical Problem

In existing technologies, web page menu settings are implemented by drawing two data trees, resulting in the navigation menu bar and the left menu bar being unrelated, consuming performance and containing duplicate data. This also limits the supported menu display scenarios and makes the technology inflexible.

Method used

By obtaining the hierarchical relationship of the page menu, a data node tree and data structure are constructed to realize the linkage of the page menu, reduce performance consumption, and perform linkage rendering according to the display type and attributes.

Benefits of technology

It achieves flexibility and variability in page menus, reduces costs, improves performance, reduces data redundancy and error probability, and enhances rendering efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115904586B_ABST
    Figure CN115904586B_ABST
Patent Text Reader

Abstract

This application provides a method, apparatus, electronic device, and storage medium for linking page menus. The method includes: obtaining the hierarchical relationship of the page menu; constructing a data node tree for the page menu based on the hierarchical relationship; constructing a data structure for the page menu based on the data node tree; linking the page menu and the corresponding page to obtain a linked data structure; and rendering the page menu and the page based on the linked data structure to obtain a linked menu page. Implementing this application embodiment allows page menus and pages to be associated, and data can be interconnected without consuming additional performance, making the page more flexible and versatile, reducing costs, and improving performance.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of front-end technology, and more specifically, to a method, apparatus, electronic device, and computer storage medium for linking page menus. Background Technology

[0002] With the rapid development of web front-end technologies, page layouts have evolved into various display methods, greatly enriching the presentation of web pages and making them more user-friendly, resulting in a better user experience. An excellent and convenient layout scheme can contribute to the promotion and development of a website. However, many websites today fail to consider user needs and neglect user experience during their design process.

[0003] In existing technologies, webpage menu settings are implemented by drawing two data trees, which are displayed as the navigation menu bar and the left menu bar respectively. The two modules are independent of each other, each displaying its own menu page. However, this method is relatively performance-intensive, and since both the navigation menu bar and the left menu bar are menus, their data cannot be shared, resulting in duplicate data being displayed on the same interface. Furthermore, it supports only a limited range of menu display scenarios and is not flexible enough. Summary of the Invention

[0004] The purpose of this application is to provide a method, apparatus, electronic device, and storage medium for linking page menus, which can associate page menus with pages and enable data communication without consuming more performance, making pages more flexible and versatile, reducing costs, and improving performance.

[0005] In a first aspect, embodiments of this application provide a method for linking page menus, the method comprising:

[0006] Obtain the hierarchical relationship of the page menu;

[0007] Construct the data node tree of the page menu based on the hierarchical relationship;

[0008] The data structure of the page menu is constructed based on the data node tree;

[0009] Link the page menu and the page corresponding to the page menu to obtain the linked data structure;

[0010] The page menu and the page are rendered based on the linked data structure to obtain the linked menu page.

[0011] In the above implementation process, by constructing a data node tree and data structure based on the hierarchical relationship of the page menu, the page menus at all levels can be closely linked, enabling data exchange between page menus at all levels. This associates the page menus with the pages without consuming more performance, making the pages more flexible and versatile, reducing costs, and improving performance.

[0012] Further, the step of constructing the data node tree of the page menu based on the hierarchical relationship includes:

[0013] Obtain the parent node information and child node information of the page menu;

[0014] Construct the parent-child node relationship between the parent node information and the child node information based on the hierarchical relationship;

[0015] The data node tree of the page menu is constructed based on the parent-child node relationship.

[0016] In the above implementation process, a data node tree is constructed based on the parent-child node relationship between parent node information and child node information, so that the data node tree can contain the relationship between page menus at all levels, and data connection between page menus can be realized according to the parent-child node relationship.

[0017] Furthermore, the step of constructing the data structure of the page menu based on the data node tree includes:

[0018] The ID of the page menu is obtained from the data node tree;

[0019] The data structure for constructing the page menu is based on the ID.

[0020] In the above implementation process, based on the ID component data structure of the page menu, each page menu can be clearly identified according to the data structure, reducing data redundancy and improving the efficiency of the component data structure.

[0021] Furthermore, the step of linking the page menu and the page corresponding to the page menu to obtain the linked data structure includes:

[0022] Obtain the display type of the page corresponding to the page menu;

[0023] If the display type is a first preset type, obtain the first attribute;

[0024] The data structure of the menu is increased based on the Boolean type of the first attribute to obtain the linked data structure.

[0025] In the above implementation process, the linked data structure is obtained according to the display type of the page menu, ensuring that page menus of different display types can be linked with the page according to different attributes, making the linkage between pages and page menus more flexible and varied.

[0026] Further, the step of rendering the page menu and the page based on the linked data structure to obtain the linked menu page includes:

[0027] Obtain the left-side menu data from the linked data structure;

[0028] The page is rendered based on the data in the left-side menu.

[0029] Obtain the navigation menu data from the linked data structure;

[0030] Render the page menu based on the navigation menu data;

[0031] The linked menu page is obtained based on the rendered menu and the rendered page.

[0032] In the above implementation process, rendering is performed based on the left-side menu data and navigation menu data to ensure that the rendered page menu and page can be linked, improve the association between the page menu and page, and improve rendering efficiency.

[0033] Further, the step of rendering the page based on the left-side menu data includes:

[0034] Obtain the second-level data from the left-side menu data;

[0035] The page is rendered based on the second-level data.

[0036] In the above implementation process, the page is rendered based on the second-level data to ensure that the correct page can be obtained through the data in the left-side menu, thereby reducing the probability of errors.

[0037] Furthermore, after the step of linking the page menu and the page corresponding to the page menu to obtain the linked data structure, the method further includes:

[0038] If the display type is a second preset type, obtain the second attribute;

[0039] The first-level menu in the navigation menu data is rendered based on the second attribute and the data structure.

[0040] In the above implementation process, if the display type is the second preset type, the first-level menu in the navigation menu data is rendered according to the data structure, which can improve the efficiency of page menus and page linkage for different display types and shorten the rendering time.

[0041] Secondly, embodiments of this application also provide a page menu linkage device, the device comprising:

[0042] The acquisition module is used to acquire the hierarchical relationship of the page menu;

[0043] The construction module is used to construct the data node tree of the page menu according to the hierarchical relationship;

[0044] A component module is used to construct the data structure of the page menu based on the data node tree;

[0045] The linkage module is used to link the page menu and the page corresponding to the page menu to obtain the linked data structure;

[0046] The rendering module is used to render the page menu and the page according to the linked data structure to obtain the linked menu page.

[0047] In the above implementation process, by constructing a data node tree and data structure based on the hierarchical relationship of the page menu, the page menus at all levels can be closely linked, enabling data exchange between page menus at all levels. This associates the page menus with the pages without consuming more performance, making the pages more flexible and versatile, reducing costs, and improving performance.

[0048] Thirdly, an electronic device provided in this application includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of the method as described in any of the first aspects.

[0049] Fourthly, embodiments of this application provide a computer-readable storage medium storing instructions that, when executed on a computer, cause the computer to perform the method described in any of the first aspects.

[0050] Fifthly, embodiments of this application provide a computer program product that, when run on a computer, causes the computer to perform the method described in any of the first aspects.

[0051] Other features and advantages of this disclosure will be set forth in the following description, or some features and advantages may be inferred from the description or determined without doubt, or may be learned by practicing the techniques described above.

[0052] It can be implemented in accordance with the contents of the specification. The preferred embodiments of this application are described in detail below with reference to the accompanying drawings. Attached Figure Description

[0053] To more clearly illustrate the technical solutions of the embodiments of this application, the accompanying drawings used in the embodiments of this application will be briefly introduced below. It should be understood that the following drawings only show some embodiments of this application and should not be regarded as a limitation on the range. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.

[0054] Figure 1 A flowchart illustrating the page menu linkage method provided in this application embodiment;

[0055] Figure 2 A schematic diagram illustrating the structural composition of the linkage device for the page menu provided in this application embodiment;

[0056] Figure 3 This is a schematic diagram of the structural composition of the electronic device provided in the embodiments of this application. Detailed Implementation

[0057] The technical solutions in the embodiments of this application will now be described with reference to the accompanying drawings.

[0058] It should be noted that similar reference numerals and letters in the following figures indicate similar items; therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures. Furthermore, in the description of this application, terms such as "first," "second," etc., are used only to distinguish descriptions and should not be construed as indicating or implying relative importance.

[0059] The specific embodiments of this application will be described in further detail below with reference to the accompanying drawings and examples. The following examples are used to illustrate this application, but are not intended to limit the scope of this application.

[0060] Example 1

[0061] Figure 1 This is a flowchart illustrating the page menu linkage method provided in an embodiment of this application, as shown below. Figure 1 As shown, the method includes:

[0062] S1, retrieve the hierarchy of the page menu;

[0063] S2, construct the data node tree of the page menu based on the hierarchical relationship;

[0064] S3, construct the data structure for the page menu based on the data node tree;

[0065] S4, link the page menu and the page corresponding to the page menu to obtain the linked data structure;

[0066] S5 renders the page menu and page based on the linked data structure to obtain the linked menu page.

[0067] In the above implementation process, by constructing a data node tree and data structure based on the hierarchical relationship of the page menu, the page menus at all levels can be closely linked, enabling data exchange between page menus at all levels. This associates the page menus with the pages without consuming more performance, making the pages more flexible and versatile, reducing costs, and improving performance.

[0068] The embodiments of this application can solve the page display problem in some special scenarios, such as machine status such as operating systems and microcontrollers, and scenarios such as monitoring and user management, which only display the page dynamics that need to be paid attention to, and do not need to be displayed in the global menu at all times.

[0069] When building navigation menus and left-side menus, data does not need to be loaded repeatedly, improving page performance.

[0070] In this embodiment, menu attributes are configured in the navigation menu data (i.e., the navigation menu), and the menu hierarchy is invoked to form a navigation structure consistent with the menu hierarchy. The menu structure is displayed in the navigation menu, and the left-side menu data (i.e., the left-side menu) only displays menus at level two or below. That is, when a menu in the navigation menu is clicked, all menus displayed on the left side of the entire interface are at the same level and related to the currently operated menu.

[0071] When users want to view monitoring-related content, clicking the navigation menu will show only monitoring-related content, greatly improving the display effect of the navigation menu.

[0072] Furthermore, S2 includes:

[0073] Get the parent and child node information of the page menu;

[0074] Construct the parent-child node relationship between parent node information and child node information based on the hierarchical relationship;

[0075] Construct a data node tree for the page menu based on parent-child node relationships.

[0076] In the above implementation process, a data node tree is constructed based on the parent-child node relationship between parent node information and child node information, so that the data node tree can contain the relationship between page menus at all levels, and data connection between page menus can be realized according to the parent-child node relationship.

[0077] Based on the hierarchical relationship of the page menu, a data node tree is constructed to store the parent-child node relationships of each level of the page menu, thereby improving page performance.

[0078] Furthermore, S3 includes:

[0079] Obtain the ID of the page menu based on the data node tree;

[0080] The data structure for creating the page menu is based on the ID.

[0081] In the above implementation process, based on the ID component data structure of the page menu, each page menu can be clearly identified according to the data structure, reducing data redundancy and improving the efficiency of the component data structure.

[0082] Construct a data structure from the first-level page menu to the bottom-level page menu based on the ID or pID of each page menu level. This ensures that when changing page menus, page navigation can be performed based on the ID without any lag.

[0083] Furthermore, S4 includes:

[0084] Get the display type of the page corresponding to the page menu;

[0085] If the display type is the first preset type, retrieve the first attribute;

[0086] The data structure of the menu is added based on the boolean type of the first attribute to obtain the linked data structure.

[0087] In the above implementation process, the linked data structure is obtained according to the display type of the page menu, ensuring that page menus of different display types can be linked with the page according to different attributes, making the linkage between pages and page menus more flexible and varied.

[0088] For example, when displaying page menus for special scenarios, a first attribute is provided, which can optionally be the showAllInLeft attribute (this attribute does not manipulate real data, but only controls the page effect through basic CSS show / hide methods). When displaying page menu items that require the attention of administrators or other special roles, the display type can be adapted according to the special scenario. The menu content does not need to be exposed in the navigation menu, but only displayed on the left side. It is only necessary to configure the showAllInLeft attribute when creating the menu.

[0089] For example, when the boolean type of the showAllInLeft property is true, an additional layer is added to the organized data structure. That is, if the initial bottom layer is three levels, when the navigation menu data is hidden and only the left menu data is displayed, the data layer displays the fourth level of data, and so on.

[0090] Furthermore, S5 includes:

[0091] Retrieve the left-side menu data from the linked data structure;

[0092] The page is rendered based on the data in the left-hand menu.

[0093] Retrieve the navigation menu data from the linked data structure;

[0094] Render the page menu based on the navigation menu data;

[0095] The linked menu page is obtained based on the rendered menu and the rendered page.

[0096] In the above implementation process, rendering is performed based on the left-side menu data and navigation menu data to ensure that the rendered page menu and page can be linked, improve the association between the page menu and page, and improve rendering efficiency.

[0097] Furthermore, the steps for rendering the page based on the data from the left-hand menu include:

[0098] Retrieve the second-level data from the left-side menu;

[0099] The page is rendered based on the second-level data.

[0100] In the above implementation process, the page is rendered based on the second-level data to ensure that the correct page can be obtained through the data in the left-side menu, thereby reducing the probability of errors.

[0101] The left-side menu data is rendered starting from the second-level data, and only one second-level menu is displayed in the entire page view. The drop-down navigation menu data is rendered according to the data structure for all page menus. Each menu has a unique ID, so even if other page menus are hidden, you can still navigate to the next page by its ID.

[0102] Furthermore, after the step of linking the page menu and the corresponding page to obtain the linked data structure, the process also includes:

[0103] If the display type is the second preset type, retrieve the second attribute;

[0104] The first-level menu in the navigation menu data is rendered based on the second attribute and the data structure.

[0105] In the above implementation process, if the display type is the second preset type, the first-level menu in the navigation menu data is rendered according to the data structure, which can improve the efficiency of page menus and page linkage for different display types and shorten the rendering time.

[0106] For example, product display pages with strong functionalities such as operating systems and firewalls often need to be able to globally display all supported page menu items, providing a second attribute. Optionally, this could be the `isShowHeaderMenu` attribute (this attribute does not manipulate actual data, but only controls the page effect through basic CSS show / hide methods). The data structure still uses the initially constructed data structure, but the navigation menu data only displays the main first-level menu, and each level menu has detailed sub-menus. When a certain level menu is selected, the page can display the corresponding content, that is, both the navigation menu and the left-side menu are displayed. Users can jump to other page menus based on the navigation menu data, or they can jump based on the page menu ID.

[0107] Example 2

[0108] In order to execute the method corresponding to Embodiment 1 above and achieve the corresponding functions and technical effects, a page menu linkage device is provided below, such as... Figure 2 As shown, the device includes:

[0109] Module 1 is used to retrieve the hierarchical relationship of the page menu;

[0110] Module 2 is used to build a data node tree for the page menu based on hierarchical relationships;

[0111] Module 3 is used to construct the data structure of the page menu based on the data node tree;

[0112] Linkage module 4 is used to link the page menu and the page corresponding to the page menu to obtain the linked data structure;

[0113] Rendering module 5 is used to render the page menu and page according to the linked data structure to obtain the linked menu page.

[0114] In the above implementation process, by constructing a data node tree and data structure based on the hierarchical relationship of the page menu, the page menus at all levels can be closely linked, enabling data exchange between page menus at all levels. This associates the page menus with the pages without consuming more performance, making the pages more flexible and versatile, reducing costs, and improving performance.

[0115] Furthermore, Module 2 is also used for:

[0116] Get the parent and child node information of the page menu;

[0117] Construct the parent-child node relationship between parent node information and child node information based on the hierarchical relationship;

[0118] Construct a data node tree for the page menu based on parent-child node relationships.

[0119] In the above implementation process, a data node tree is constructed based on the parent-child node relationship between parent node information and child node information, so that the data node tree can contain the relationship between page menus at all levels, and data connection between page menus can be realized according to the parent-child node relationship.

[0120] Furthermore, module 3 is also used for:

[0121] Obtain the ID of the page menu based on the data node tree;

[0122] The data structure for creating the page menu is based on the ID.

[0123] In the above implementation process, based on the ID component data structure of the page menu, each page menu can be clearly identified according to the data structure, reducing data redundancy and improving the efficiency of the component data structure.

[0124] Furthermore, the linkage module 4 is also used for:

[0125] Get the display type of the page corresponding to the page menu;

[0126] If the display type is the first preset type, retrieve the first attribute;

[0127] The data structure of the menu is added based on the boolean type of the first attribute to obtain the linked data structure.

[0128] In the above implementation process, the linked data structure is obtained according to the display type of the page menu, ensuring that page menus of different display types can be linked with the page according to different attributes, making the linkage between pages and page menus more flexible and varied.

[0129] Furthermore, rendering module 5 is also used for:

[0130] Retrieve the left-side menu data from the linked data structure;

[0131] The page is rendered based on the data in the left-hand menu.

[0132] Retrieve the navigation menu data from the linked data structure;

[0133] Render the page menu based on the navigation menu data;

[0134] The linked menu page is obtained based on the rendered menu and the rendered page.

[0135] In the above implementation process, rendering is performed based on the left-side menu data and navigation menu data to ensure that the rendered page menu and page can be linked, improve the association between the page menu and page, and improve rendering efficiency.

[0136] Furthermore, rendering module 5 is also used for:

[0137] Retrieve the second-level data from the left-side menu;

[0138] The page is rendered based on the second-level data.

[0139] In the above implementation process, the page is rendered based on the second-level data to ensure that the correct page can be obtained through the data in the left-side menu, thereby reducing the probability of errors.

[0140] Furthermore, rendering module 5 is also used for:

[0141] If the display type is the second preset type, retrieve the second attribute;

[0142] The first-level menu in the navigation menu data is rendered based on the second attribute and the data structure.

[0143] In the above implementation process, if the display type is the second preset type, the first-level menu in the navigation menu data is rendered according to the data structure, which can improve the efficiency of page menus and page linkage for different display types and shorten the rendering time.

[0144] The aforementioned page menu linkage device can implement the method of Embodiment 1. The options in Embodiment 1 are also applicable to this embodiment, and will not be described in detail here.

[0145] The remaining contents of this embodiment can be referred to the contents of Embodiment 1 above, and will not be repeated in this embodiment.

[0146] Example 3

[0147] This application provides an electronic device, including a memory and a processor. The memory stores a computer program, and the processor runs the computer program to enable the electronic device to execute the page menu linkage method of Embodiment 1.

[0148] Alternatively, the aforementioned electronic device may be a server.

[0149] Please see Figure 3 , Figure 3 This is a schematic diagram illustrating the structural composition of an electronic device provided in an embodiment of this application. The electronic device may include a processor 31, a communication interface 32, a memory 33, and at least one communication bus 34. The communication bus 34 is used to enable direct communication between these components. In this embodiment, the communication interface 32 is used for signaling or data communication with other node devices. The processor 31 may be an integrated circuit chip with signal processing capabilities.

[0150] The processor 31 described above can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), an off-the-shelf programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this application. The general-purpose processor can be a microprocessor, or the processor 31 can be any conventional processor.

[0151] The memory 33 may be, but is not limited to, random access memory (RAM), read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), etc. The memory 33 stores computer-readable instructions. When these computer-readable instructions are executed by the processor 31, the device can perform the aforementioned operations. Figure 1 The various steps involved in the method implementation examples.

[0152] Optionally, the electronic device may also include a storage controller and an input / output unit. The memory 33, storage controller, processor 31, peripheral interface, and input / output unit are electrically connected directly or indirectly to each other to achieve data transmission or interaction. For example, these components can be electrically connected to each other via one or more communication buses 34. The processor 31 is used to execute executable modules stored in the memory 33, such as software function modules or computer programs included in the device.

[0153] Input / output units are used to enable users to create tasks and set optional start periods or preset execution times for those tasks, facilitating user-server interaction. Input / output units can be, but are not limited to, a mouse and keyboard.

[0154] Understandable. Figure 3 The structure shown is for illustrative purposes only; the electronic device may also include components that are more advanced than those shown. Figure 3 The more or fewer components shown, or having the same Figure 3 The different configurations shown. Figure 3The components shown can be implemented using hardware, software, or a combination thereof.

[0155] In addition, this application also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the page menu linkage method of Embodiment 1.

[0156] This application also provides a computer program product that, when run on a computer, causes the computer to perform the method described in the method embodiment.

[0157] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can also be implemented in other ways. The apparatus embodiments described above are merely illustrative; for example, the flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of apparatus, methods, and computer program products according to various embodiments of this application. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions marked in the blocks may occur in a different order than those marked in the drawings. For example, two consecutive blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram and / or flowchart, and combinations of blocks in block diagrams and / or flowcharts, can be implemented using dedicated hardware-based apparatus that performs the specified function or action, or using a combination of dedicated hardware and computer instructions.

[0158] In addition, the functional modules in the various embodiments of this application can be integrated together to form an independent part, or each module can exist independently, or two or more modules can be integrated to form an independent part.

[0159] If the aforementioned functions are implemented as software functional modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, external hard drives, ROM, RAM, magnetic disks, or optical disks.

[0160] The above description is merely an embodiment of this application and is not intended to limit the scope of protection of this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of protection of this application. It should be noted that similar reference numerals and letters in the following figures indicate similar items; therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures.

[0161] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of protection of the claims.

[0162] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

Claims

1. A method for linking page menus, characterized in that, The method includes: Obtain the hierarchical relationship of the page menu; Construct the data node tree of the page menu based on the hierarchical relationship; The data structure of the page menu is constructed based on the data node tree; Link the page menu and the page corresponding to the page menu to obtain the linked data structure; The page menu and the page are rendered based on the linked data structure to obtain the linked menu page; The step of linking the page menu and the page corresponding to the page menu to obtain the linked data structure includes: Obtain the display type of the page corresponding to the page menu; If the display type is a first preset type, obtain the first attribute; The data structure of the menu is increased based on the Boolean type of the first attribute to obtain the linked data structure; The step of rendering the page menu and the page according to the linked data structure to obtain the linked menu page includes: Obtain the left-side menu data from the linked data structure; The page is rendered based on the data in the left-side menu. Obtain the navigation menu data from the linked data structure; Render the page menu based on the navigation menu data; The linked menu page is obtained based on the rendered menu and the rendered page.

2. The method for linking page menus according to claim 1, characterized in that, The step of constructing the data node tree of the page menu based on the hierarchical relationship includes: Obtain the parent node information and child node information of the page menu; Construct the parent-child node relationship between the parent node information and the child node information based on the hierarchical relationship; The data node tree of the page menu is constructed based on the parent-child node relationship.

3. The method for linking page menus according to claim 1, characterized in that, The step of constructing the data structure of the page menu based on the data node tree includes: The ID of the page menu is obtained from the data node tree; The data structure for constructing the page menu is based on the ID.

4. The method for linking page menus according to claim 1, characterized in that, The step of rendering the page based on the left-side menu data includes: Obtain the second-level data from the left-side menu data; The page is rendered based on the second-level data.

5. The method for linking page menus according to claim 1, characterized in that, After the step of linking the page menu and the page corresponding to the page menu to obtain the linked data structure, the method further includes: If the display type is a second preset type, obtain the second attribute; The first-level menu in the navigation menu data is rendered based on the second attribute and the data structure.

6. A linkage device for a page menu, characterized in that, The device includes: The acquisition module is used to acquire the hierarchical relationship of the page menu; The construction module is used to construct the data node tree of the page menu according to the hierarchical relationship; A component module is used to construct the data structure of the page menu based on the data node tree; The linkage module is used to link the page menu and the page corresponding to the page menu to obtain the linked data structure; The rendering module is used to render the page menu and the page according to the linked data structure to obtain the linked menu page; The linkage module is also used for: Obtain the display type of the page corresponding to the page menu; If the display type is a first preset type, obtain the first attribute; The data structure of the menu is increased based on the Boolean type of the first attribute to obtain the linked data structure; The rendering module is also used for: Obtain the left-side menu data from the linked data structure; The page is rendered based on the data in the left-side menu. Obtain the navigation menu data from the linked data structure; Render the page menu based on the navigation menu data; The linked menu page is obtained based on the rendered menu and the rendered page.

7. An electronic device, characterized in that, The device includes a memory and a processor, the memory being used to store a computer program, and the processor running the computer program to cause the electronic device to perform the page menu linkage method according to any one of claims 1 to 5.

8. A computer-readable storage medium, characterized in that, It stores a computer program that, when executed by a processor, implements the page menu linkage method as described in any one of claims 1 to 5.

Citation Information

Patent Citations

  • Method and device for displaying function menu in Web application, equipment and medium

    CN113568540A

  • Information processing method and device, electronic equipment and storage medium

    CN114385672A