Method for dynamically adjusting menu content in plug-in mode

By defining unified plug-in interfaces and menu standards, plug-in dynamic adjustment of menu content is achieved, which solves the flexibility and scalability problems of traditional menu design, improves the flexibility and user experience of the software system, and simplifies the adjustment process of menu content. .

CN118733138AActive Publication Date: 2024-10-01HANGZHOU ARCVIDEO TECHNOLOGY CO LTD
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202410646463.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-05-23
Publication Date
2024-10-01
Estimated Expiration
2044-05-23

AI Technical Summary

Technical Problem

Traditional menu design adopts a hard-coding method, which leads to the need to directly modify the source code to modify and adjust the menu content, which increases the difficulty of development and limits the flexibility and scalability of the software system. The existing plug-in technology has insufficient integration between the plug-in and the main program. High, the problem of unsmooth collaborative work.

Method used

Define a unified plug-in interface and menu standard, and realize the generation and logical processing of menu content according to the interface and standard through the plug-in. The main program loads and collects the menu content provided by the plug-in, merges, filters and sorts it, and passes it to the front-end for rendering display and user interaction. Trigger backend service logic.

Benefits of technology

It improves the flexibility and scalability of the software system, simplifies the adjustment and maintenance process of menu content, provides personalized user experience, reduces maintenance costs, and improves the maintainability and market competitiveness of the system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118733138A_ABST
    Figure CN118733138A_ABST
Patent Text Reader

Abstract

The invention discloses a method for dynamically adjusting menu content in a plug-in mode, which is applied to a system for dynamically adjusting the menu content in the plug-in mode and comprising an access client, a main program and a plurality of plug-ins, and comprises the following steps: S10, defining a unified plug-in interface and a menu standard; s20, developing and registering a plug-in, wherein the plug-in realizes generation and logic processing of menu contents according to a unified interface and standard; the main program realizes own menu information declaration according to a format defined by the menu standard definition module; s30, loading the registered plug-in in the main program, and collecting menu contents provided by the plug-in; s40, merging, filtering and sorting the collected menu contents according to a preset rule; s50, the main program and the plug-in transmit the processed menu content to a front end for rendering display; and S60, when the user interacts with the menu item by accessing the client, triggering the corresponding back-end service logic.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the technical field of computer software, and in particular relates to a method for dynamically adjusting menu contents through plug-in. Background Art

[0002] With the rapid development of information technology, computer software has become an indispensable tool in all walks of life. In the user interface of computer software, the menu is an important entry point for users to interact with the software. Its design and richness of functions directly affect the user experience and the usability of the software. However, traditional menu design often adopts a hard-coded method. Modifying and adjusting the menu content requires directly modifying the source code, which not only increases the difficulty of development, but also limits the flexibility and scalability of the software system.

[0003] In recent years, with the continuous advancement of software technology and the continuous changes in user needs, plug-in technology has gradually become a hot trend in software development. Plug-in technology modularizes software functions, allowing developers or third parties to expand and customize the functions of software systems by writing plug-ins. This technology makes it possible to dynamically adjust menu content, making the menu interface of the software system more flexible and personalized.

[0004] In the prior art, the following methods are usually adopted: (1) Static menu configuration technology: At present, many software systems still use static menu configuration technology. This technology usually predefines the menu content in the configuration file and adjusts the menu content by modifying the configuration file. Although this method is relatively simple, it lacks flexibility and scalability. Once the menu content needs to be modified, it is necessary to re-edit the configuration file and redeploy the software system, which is impractical for large and complex software systems. (2) Template-based menu generation technology: Some software systems use template-based menu generation technology to generate menu interfaces by defining templates. This method can generate different menu styles based on different templates, but modifying the menu content still requires modifying the template file, and for complex menu structures, the writing and maintenance of templates will also become quite complicated. (3) Preliminary attempts at plug-in menu technology: In recent years, a few software systems have begun to try to use plug-in technology to achieve dynamic adjustment of menus. These systems define plug-in interfaces to allow developers to write plug-ins to expand menu content. However, these preliminary attempts often have some problems, such as low integration between plug-ins and main programs, and insufficient coordination between plug-ins, which makes it difficult to achieve ideal results in actual applications. Summary of the invention

[0005] In view of the above problems, the present invention provides a method for dynamically adjusting menu contents through plug-in.

[0006] In order to solve the above technical problems, the present invention adopts the following technical solutions:

[0007] A method for dynamically adjusting menu contents by plug-in is applied to a system for dynamically adjusting menu contents by plug-in including an access client, a main program and several plug-ins. The system principle block diagram is shown in Figure 2 As shown, the following steps are included:

[0008] S10, define unified plug-in interface and menu standards;

[0009] S20, develop and register plug-ins, which implement the generation and logic processing of menu content according to unified interfaces and standards; the main program implements its own menu information declaration according to the format defined by the menu standard definition module;

[0010] S30, loading the registered plug-in in the main program, and collecting the menu content provided by the plug-in;

[0011] S40, merging, filtering and sorting the collected menu contents according to preset rules;

[0012] S50, the main program and the plug-in pass the processed menu content to the front end for rendering and display;

[0013] S60: When the user interacts with the menu item by accessing the client, the corresponding backend service logic is triggered.

[0014] In one possible implementation, the definition of a unified plug-in interface and menu standard in S10 includes: setting a main program to include a menu standard definition module, the menu standard definition module is used to define interface standards and data standards, wherein the interface standard is used for the current module to call a unified interface to obtain all menu implementations including the main program; the data standard is used to define a standard format for menu information, ensuring that all plug-ins and the main program declare menu information in a unified format, the menu information including menu ID, name, link, icon and permission identifier.

[0015] In a possible implementation, in S20, the main program implements its own menu information declaration according to the format defined by the menu standard definition module, including: setting the main program to include a main program menu standard implementation module, wherein the main program includes the menu standard implementation module, which means that the main program implements its own menu information declaration according to the format defined by the menu standard definition module.

[0016] In one possible implementation, the plug-in in S20 implements the generation and logical processing of menu content according to a unified interface and standard, including: setting the plug-in to include a plug-in menu standard implementation module, the menu standard implementation module is the plug-in implementing its own menu information declaration according to the format defined by the main program menu standard definition module.

[0017] In a possible implementation, collecting the menu content provided by the plug-in in S30 includes: setting the main program to include a menu collection module, wherein the menu collection module is used to collect menu information of all plug-ins and the main program itself.

[0018] In a possible implementation, merging the collected menu contents according to preset rules in S40 includes: setting the main program to include a menu merging module, the menu merging module is used to receive menu information of all plug-ins and the main program itself, and perform merging processing according to menu IDs.

[0019] In a possible implementation, filtering the collected menu content according to preset rules in S40 includes: setting the main program to include a menu filtering module, wherein the menu filtering module is used to filter and sort the merged menu information based on the permission identifier in the menu data standard according to user permissions and system configuration.

[0020] In one possible implementation, S50, the main program and the plug-in pass the processed menu content to the front end for rendering and display, including: setting the main program to include a main program front-end resource rendering module, and the main program front-end resource rendering module is used to generate the resources required for front-end rendering according to the filtered and sorted main program menu information.

[0021] In one possible implementation, S50, the main program and the plug-in pass the processed menu content to the front end for rendering and display, including: setting the plug-in to include a plug-in front-end resource rendering module, and the plug-in front-end resource rendering module is used to generate the resources required for front-end rendering according to the filtered and sorted plug-in menu information.

[0022] In a possible implementation, the resources required for generating the front-end rendering adopt VUE front-end resources, and the link in the menu data standard is the VUE file link of the current module.

[0023] The present invention has the following beneficial effects:

[0024] (1) Improve the flexibility and scalability of the software system: Through plug-in technology, developers or third parties are allowed to expand and customize the menu content of the software system without modifying the main program code. This allows the software system to more flexibly adapt to different user needs and usage scenarios, improving the scalability of the system.

[0025] (2) Simplify the process of adjusting and maintaining menu content: Traditionally, adjusting menu content usually involves modifying source code and redeploying the software system, which is a cumbersome and error-prone process. The embodiment of the present invention simplifies the process of adjusting and maintaining menu content through a plug-in mechanism. Developers only need to write plug-ins to dynamically adjust menu content, thereby reducing maintenance costs.

[0026] (3) Provide personalized user experience: By dynamically adjusting menu content through plug-ins, a personalized menu interface can be customized according to user preferences and habits. This can not only improve user satisfaction and loyalty, but also help enhance the market competitiveness of the software system. BRIEF DESCRIPTION OF THE DRAWINGS

[0027] Figure 1 A flowchart of the steps of the method for dynamically adjusting menu content based on a plug-in according to an embodiment of the present invention;

[0028] Figure 2 It is a principle block diagram of a system for dynamically adjusting menu contents through plug-in in a method for dynamically adjusting menu contents through plug-in according to an embodiment of the present invention. DETAILED DESCRIPTION

[0029] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0030] See also Figure 1 , which is a flowchart of the steps of a method for dynamically adjusting menu content based on a plug-in according to an embodiment of the present invention, is applied to a system for dynamically adjusting menu content based on a plug-in including an access client, a main program and several plug-ins, wherein the access client is responsible for triggering the call and rendering effect; the main program includes a menu collection module, a menu standard definition module, a menu merging module, a menu filtering module, a main program menu standard implementation module, a main program front-end resource rendering module and a main program back-end service logic module and other sub-modules; the plug-in includes a plug-in menu standard implementation module, a menu front-end resource rendering module, a menu back-end service logic and other sub-modules, including the following steps:

[0031] S10, define unified plug-in interface and menu standards;

[0032] S20, develop and register plug-ins, which implement the generation and logic processing of menu content according to unified interfaces and standards; the main program implements its own menu information declaration according to the format defined by the menu standard definition module;

[0033] S30, loading the registered plug-in in the main program, and collecting the menu content provided by the plug-in;

[0034] S40, merging, filtering and sorting the collected menu contents according to preset rules;

[0035] S50, the main program and the plug-in pass the processed menu content to the front end for rendering and display;

[0036] S60: When the user interacts with the menu item by accessing the client, the corresponding backend service logic is triggered.

[0037] Another embodiment of the present invention is a method for dynamically adjusting menu content through plug-ins, wherein the definition of a unified plug-in interface and menu standards in S10 includes: setting a menu standard definition module on the main program, wherein the menu standard definition module is used to define interface standards and data standards, wherein the interface standard is used for the current module to call a unified interface to obtain all menu implementations including the main program; the data standard is used to define the standard format of menu information, ensuring that all plug-ins and the main program declare menu information in a unified format, wherein the menu information includes menu ID, name, link, icon, and permission identifier. In an embodiment of the present invention, the plug-in rewrites the menu content of the main program or other plug-ins through the menu ID. Specifically, when the plug-in declares a menu, if the ID of a menu is the same as the menu ID that already exists in the main program or other plug-ins, then the menu content of the plug-in will overwrite the original menu content. In this way, developers can easily expand or modify the menu content without modifying the code of the main program.

[0038] According to another embodiment of the present invention, a method for dynamically adjusting menu contents by plug-in is provided. In S20, the main program implements its own menu information declaration according to the format defined by the menu standard definition module, including: setting the main program to include the main program menu standard implementation module, the main program includes the menu standard implementation module in the format defined by the main program according to the menu standard definition module, and implements its own menu information declaration: first implement the interface standard, and then respond according to the data standard. At the same time, the plug-in implements the generation and logical processing of the menu contents according to the unified interface and standard, including: setting the plug-in to include the plug-in menu standard implementation module, the menu standard implementation module is the plug-in in the format defined by the main program menu standard definition module, and implements its own menu information declaration. First implement the interface standard, and then respond according to the data standard. If you want to rewrite the menu contents of the main program or other plug-ins, you only need to set the menu ID to the menu ID of the main program or other plug-ins. In addition, you can also specify the priority or rewriting rules of the plug-in by means of configuration files or annotations. For example, each plug-in can be assigned a priority value. When multiple plug-ins rewrite the same menu, the plug-in with a high priority will overwrite the plug-in with a low priority. In addition, you can define specific rewrite rules, such as allowing a plug-in to completely rewrite the menu content of other plug-ins, or only allowing the value of specific properties to be modified.

[0039] In another embodiment of the present invention, a method for dynamically adjusting menu content by plug-in is provided, wherein the menu content provided by the plug-in is collected in S30, including: setting a menu collection module on the main program, and the menu collection module is used to collect menu information of all plug-ins and the main program itself. In order to facilitate the rendering of menu links, the embodiment of the present invention adopts the remote loading principle of the VUE component, that is: the menu link is used as the source, and its content is dynamically rendered to a fixed interface. For example, the commonly used system has a menu on the left and a fixed display interface on the right, achieving a single-page front-end effect. VUE is a JavaScript framework for building user interfaces. It is built based on standard HTML, CSS, and JavaScript, and provides a declarative, componentized programming model that can efficiently develop user interfaces.

[0040] In another embodiment of the present invention, a method for dynamically adjusting menu contents by plug-in is provided, wherein the collected menu contents are merged according to preset rules in S40, including: setting a main program to include a menu merging module, the menu merging module is used to receive menu information of all plug-ins and the main program itself, and merge the menu information according to the menu ID. For example, if multiple menus have the same ID, the final menu contents are determined according to the priority of the plug-in or a specific rewriting rule.

[0041] In another embodiment of the present invention, a method for dynamically adjusting menu content through plug-in, filtering the collected menu content according to preset rules in S40 includes: setting the main program to include a menu filtering module, the menu filtering module is used to filter and sort the merged menu information based on the permission identifier in the menu data standard according to the user permission and system configuration. Only menus that meet the permission requirements will be displayed to the user.

[0042] Another embodiment of the present invention is a method for dynamically adjusting menu content through plug-in, S50, the main program and the plug-in pass the processed menu content to the front end for rendering and display, including: setting the main program to include a main program front-end resource rendering module, the main program front-end resource rendering module is used to generate resources required for front-end rendering according to the filtered and sorted main program menu information. At the same time, setting the plug-in to include a plug-in front-end resource rendering module, the plug-in front-end resource rendering module is used to generate resources required for front-end rendering according to the filtered and sorted plug-in menu information. The VUE front-end resources used to generate the resources required for front-end rendering, the link in the menu data standard is the current module VUE file link.

[0043] In another embodiment of the present invention, a method for dynamically adjusting menu content through plug-in is provided. In S60, triggering the corresponding backend service logic includes setting a main program backend service logic module on the main program, and the main program backend service logic module processes the backend service logic related to the menu, such as permission verification, data interaction, etc., according to the filtered and sorted main program menu information. At the same time, setting a plug-in backend service logic module on the plug-in, and the plug-in backend service logic module processes the backend service logic related to the menu, such as permission verification, data interaction, etc., according to the filtered and sorted plug-in menu information.

[0044] Through the plug-in method for dynamically adjusting menu content set up above, the access client is mainly used to trigger calls and rendering effects, and the access client sends the trigger call request to the main program. After the main program processes the request, it returns the corresponding menu content to the access client. The access client renders according to the returned menu content and displays it to the user. The main program is responsible for providing menu content to the access client and collecting and processing related menu data, and is the main functional module for implementing the embodiment of the invention. The plug-in is responsible for providing menu data according to the menu standard of the main program. The plug-in and the main program use the same operating entity, but are implemented by different loading methods. For example, the same JVM environment is used in the Java language, and different ClassLoaders are used to load related codes. The menu standard interface is shared in different ClassLoaders. The plug-in is the basis for the dynamic implementation of the entire invention embodiment.

[0045] When the accessing client is accessing the homepage, the main program loads itself and the plug-in menu, merges and filters the menus, and then returns the corresponding menu list to the accessing client; when the accessing client is accessing the main program menu content, the main program internal interface logic is executed, the content is rendered, and then the corresponding main program menu content is returned to the client; when the accessing client is accessing the menu content provided by a plug-in, the main program forwards to the corresponding plug-in, the corresponding plug-in executes the plug-in internal interface logic, renders the content, and then returns the corresponding plug-in menu content to the client.

[0046] From the above description, it can be seen that through the plug-in method for dynamically adjusting menu content in the embodiment of the present invention, developers can more flexibly expand and modify menu content, thereby improving the maintainability and scalability of the software system. At the same time, due to the use of a plug-in architecture, different teams or developers can independently develop plug-ins to achieve decoupling and reuse of functions.

[0047] It should be understood that the exemplary embodiments described herein are illustrative rather than restrictive. Although one or more embodiments of the present invention have been described in conjunction with the accompanying drawings, it should be understood by those skilled in the art that various changes in form and detail may be made without departing from the spirit and scope of the present invention as defined by the appended claims.

Claims

1. A plug-in method for dynamically adjusting menu content. It is characterized in that A system for dynamically adjusting menu contents through plug-ins, which is applied to an access client, a main program and several plug-ins, comprises the following steps: S10, define unified plug-in interface and menu standards; S20, develop and register plug-ins, which implement the generation and logic processing of menu content according to unified interfaces and standards; the main program implements its own menu information declaration according to the format defined by the menu standard definition module; S30, loading the registered plug-in in the main program, and collecting the menu content provided by the plug-in; S40, merging, filtering and sorting the collected menu contents according to preset rules; S50, the main program and the plug-in pass the processed menu content to the front end for rendering and display; S60: When the user interacts with the menu item by accessing the client, the corresponding backend service logic is triggered.

2. The method for dynamically adjusting menu content based on plug-in as claimed in claim 1, It is characterized in that Defining a unified plug-in interface and menu standard in S10 includes: setting a main program to include a menu standard definition module, wherein the menu standard definition module is used to define interface standards and data standards, wherein the interface standard is used for the current module to call a unified interface to obtain all menu implementations including the main program; the data standard is used to define a standard format for menu information, ensuring that all plug-ins and the main program declare menu information in a unified format, wherein the menu information includes a menu ID, name, link, icon, and permission identifier.

3. The method for dynamically adjusting menu contents by plug-in as claimed in claim 2, It is characterized in that In S20, the main program implements its own menu information declaration according to the format defined by the menu standard definition module, including: setting the main program to include a main program menu standard implementation module, wherein the main program includes the menu standard implementation module, which means that the main program implements its own menu information declaration according to the format defined by the menu standard definition module.

4. The method for dynamically adjusting menu contents by plug-in as claimed in claim 2, It is characterized in that In S20, the plug-in implements the generation and logic processing of menu content according to the unified interface and standard, including: setting the plug-in to include a plug-in menu standard implementation module, the menu standard implementation module is the plug-in implementing its own menu information declaration according to the format defined by the main program menu standard definition module.

5. The method for dynamically adjusting menu contents by plug-in as claimed in claim 2, It is characterized in that Collecting the menu content provided by the plug-in in S30 includes: setting the main program to include a menu collection module, wherein the menu collection module is used to collect menu information of all plug-ins and the main program itself.

6. The method for dynamically adjusting menu contents by plug-in as claimed in claim 2, It is characterized in that In S40, merging the collected menu contents according to preset rules includes: setting the main program to include a menu merging module, the menu merging module is used to receive menu information of all plug-ins and the main program itself, and perform merging processing according to menu IDs.

7. The method for dynamically adjusting menu contents by plug-in as claimed in claim 2, It is characterized in that S40 filters the collected menu contents according to preset rules, including: setting the main program to include a menu filtering module, the menu filtering module is used to filter and sort the merged menu information based on the authority identifier in the menu data standard according to user authority and system configuration.

8. The method for dynamically adjusting menu contents by plug-in as claimed in claim 2, It is characterized in that S50, the main program and the plug-in pass the processed menu content to the front end for rendering and display, including: setting the main program to include a main program front-end resource rendering module, and the main program front-end resource rendering module is used to generate resources required for front-end rendering according to the filtered and sorted main program menu information.

9. The method for dynamically adjusting menu contents by plug-in as claimed in claim 2, It is characterized in that S50, the main program and the plug-in pass the processed menu content to the front end for rendering and display, including: setting the plug-in to include a plug-in front-end resource rendering module, and the plug-in front-end resource rendering module is used to generate resources required for front-end rendering according to the filtered and sorted plug-in menu information.

10. The method for dynamically adjusting menu content based on plug-in as claimed in claim 8 or 9, It is characterized in that The resources required for generating front-end rendering use VUE front-end resources, and the link in the menu data standard is the VUE file link of the current module.

Citation Information

Patent Citations

  • Information processing apparatus and control method

    CN101866292A

  • Method and device for achieving plug-in

    CN103544058A

  • MVC component-type program development framework establishing system and method

    CN108427551A

  • Plug-in configuration desktop software architecture and implementation method

    CN117331613A

  • Information processing apparatus, control method, and program

    EP2241967A2