A method and system for batch management of backend menus using templates

By adopting a template-based management method, the problem of low efficiency in game backend menu management was solved, and batch processing of menus and permissions was achieved, simplifying the workflow and improving management efficiency.

CN119292595BActive Publication Date: 2025-11-14福建天晴在线互动科技有限公司
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411312563.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-09-20
Publication Date
2025-11-14
Estimated Expiration
2044-09-20

AI Technical Summary

Technical Problem

In existing technologies, game backend menu management is inefficient. Adding new menus requires adding them separately for each game, resulting in a tedious and repetitive workload, while also affecting permission management.

Method used

A template-based management approach is adopted, defining configuration rules for menu and character templates. By recursively processing menu and character templates, batch management of menus and permissions is achieved. The @ symbol is used to replace game-specific information, generating database menu records and associating them with template item numbers.

Benefits of technology

It simplifies tedious and repetitive tasks, improves the efficiency of backend menu management, and retains the flexibility of independent function menus and permission management.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119292595B_ABST
    Figure CN119292595B_ABST
Patent Text Reader

Abstract

This invention relates to the field of computer management technology, specifically a method and system for batch management of backend menus using templates. The method comprises: Step 1: Defining menu template configuration rules, including configuring the menu hierarchy and configuring the attributes of menu items. The menu hierarchy includes a root node of the menu template, which contains all menu items; Step 2: Defining role template configuration rules, including configuring roles and role permissions; Step 3: When adding a new game, recursively processing the menu template based on the attributes of the root node and menu items; Step 4: When updating a template, iterating through the game list and recursively processing the menu template based on the attributes of the root node and menu items. This invention provides a method and system for batch management of backend menus using templates, which improves the management efficiency of backend menus.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of computer management technology, and in particular to a method and system for batch management of background menus using templates. Background Technology

[0002] The company's current game configuration backend includes management systems for multiple game businesses. Each game business has many common function menus as well as many independent function menus. Adding a menu that all games need to use would require adding this menu separately for each game, with the only difference being the game category parameter in the menu address. Furthermore, permissions for the new menu would need to be added to the corresponding roles, a tedious and repetitive task with a considerable workload. If all menus were dynamically rendered based on the current game list, it would result in no specific menus existing, making it impossible to manage independent function menus and also impacting access control. Summary of the Invention

[0003] To overcome the problem of low efficiency in backend menu management in existing technologies, the purpose of this invention is to provide a method and system for batch management of backend menus using templates, which can improve the management efficiency of backend menus.

[0004] This invention is implemented using the following scheme:

[0005] A method for batch management of backend menus using templates, the method comprising the following steps:

[0006] Step 1: Define the menu template configuration rules, including configuring the menu hierarchy and configuring the attributes of the menu items. The menu hierarchy includes the menu template root node, which contains all the menu items.

[0007] Step 2: Define the role template configuration rules, including configuring roles and role permissions;

[0008] Step 3: When adding a new game, recursively process the menu template based on the attributes of the root node of the menu template and the menu items;

[0009] Step 4: When updating the template, loop through the game list and recursively process the menu template based on the attributes of the root node of the menu template and the menu items.

[0010] Furthermore, the attributes of the menu item include menu name, menu type, template item number, sort index, menu path, and submenu list;

[0011] If the current menu is a first-level menu, the menu name is replaced by the placeholder @gamename. The sort index is used to determine the menu display order. The menu path is the menu URL path, and @gameid is used as the replacement symbol for game parameters in the menu path.

[0012] Furthermore, the role mentioned in step 2 is the root node of the role template. The root node of the role template contains all role items. Each role item has attributes, including role name and role permissions. Role permissions are an array of template item numbers that the role possesses.

[0013] Furthermore, step 3 specifically involves: when adding a new game, recursively processing the root node of the menu template and the list of submenus; if the menu name contains @gamename, then the menu name is replaced with the current game name; if the menu path contains @gameid, then the @gameid in the current menu path is replaced with the game number.

[0014] In other cases, add new menu records in the database according to the menu item configuration and generate actual database menu numbers. The menu records stored in the database must be associated with the template item numbers.

[0015] At the same time, based on the role template configuration, add permissions for the corresponding roles in the database. The menu number of the added permission should correspond to the template item number.

[0016] Furthermore, step 4 is further specified as follows: When updating the template, the game list is traversed in a loop, and the root node and submenu list of the menu template are processed recursively. If a new or updated menu is added, the database is first queried to see if there is menu data with the same game number and the same template menu item number. If it exists, the menu data is updated according to the rules when adding a new game; if it does not exist, the menu data is added according to the rules when adding a new game; if a menu is deleted, all menu data with the same template item number in the configuration template menu are deleted.

[0017] A system for batch management of backend menus via templates, the system comprising: a menu template configuration module, a character template configuration module, a game addition management module, and a template update management module;

[0018] The menu template configuration module is used to define menu template configuration rules, including configuring the menu hierarchy and configuring the attributes of menu items. The menu hierarchy includes a menu template root node, which contains all menu items.

[0019] The role template configuration module is used to define role template configuration rules, including configuring roles and role permissions;

[0020] The newly added game management module is used to recursively process menu templates based on the attributes of the root node and menu items when adding a new game.

[0021] The template update management module is used to iterate through the game list when updating the template, and recursively process the menu template according to the attributes of the root node of the menu template and the menu items.

[0022] Furthermore, the attributes of the menu item include menu name, menu type, template item number, sort index, menu path, and submenu list;

[0023] If the current menu is a first-level menu, the menu name is replaced by the placeholder @gamename. The sort index is used to determine the menu display order. The menu path is the menu URL path, and @gameid is used as the replacement symbol for game parameters in the menu path.

[0024] Furthermore, the role mentioned in the role configuration module is the root node of the role template. The root node of the role template contains all role items. Each role item has attributes, including role name and role permissions. Role permissions are an array of template item numbers that the role possesses.

[0025] Furthermore, when adding a new game, the root node of the menu template and the list of submenus are processed recursively. If the menu name contains @gamename, the menu name is replaced with the current game name; if the menu path contains @gameid, the @gameid in the current menu path is replaced with the game number.

[0026] In other cases, add new menu records in the database according to the menu item configuration and generate actual database menu numbers. The menu records stored in the database must be associated with the template item numbers.

[0027] At the same time, based on the role template configuration, add permissions for the corresponding roles in the database. The menu number of the added permission should correspond to the template item number.

[0028] Furthermore, the template update management module works as follows: When updating a template, it iterates through the game list and recursively processes the root node and submenu list of the menu template. If it is adding or updating a menu, it first checks the database to see if there is menu data with the same game number and the same template menu item number. If it exists, it updates the menu data according to the rules when adding a game; if it does not exist, it adds the menu data according to the rules when adding a game. If it is deleting a menu, it deletes all menu data with the same template item number in the configured template menu.

[0029] The beneficial effects of this invention are as follows:

[0030] This invention provides a method and system for batch management of backend menus using templates. Through template-based management, tedious repetitive work is simplified, management efficiency is improved, and the flexibility of independent function menus and permission management is retained. Attached Figure Description

[0031] Figure 1 This is a flowchart of the method of the present invention;

[0032] Figure 2 This is a structural block diagram of the system of the present invention. Detailed Implementation

[0033] The invention will now be further described with reference to the accompanying drawings.

[0034] See Figure 1 A method for batch management of backend menus using templates, the steps of which are as follows:

[0035] Step 1: Define the menu template configuration rules, including configuring the menu hierarchy and configuring the attributes of the menu items. The menu hierarchy includes the menu template root node, which contains all the menu items.

[0036] Step 2: Define the role template configuration rules, including configuring roles and role permissions;

[0037] Step 3: When adding a new game, recursively process the menu template based on the attributes of the root node of the menu template and the menu items;

[0038] Step 4: When updating the template, loop through the game list and recursively process the menu template based on the attributes of the root node of the menu template and the menu items.

[0039] The present invention will be further described below with reference to a specific embodiment:

[0040] A method for batch management of backend menus using templates, the method comprising the following steps:

[0041] Step 1: Define the menu template configuration rules, including the menu hierarchy and related attributes. The menu hierarchy includes the menu template root node, which contains all menu items.

[0042] `resources` is the root node of the menu template, containing all template menu items. Each menu item must have the following attributes: `name` (menu name, replaced by `@gamename` placeholder if the current menu is a first-level menu), `type` (menu type), `tid` (template item number), `sortIndex` (sorting index used to determine the menu display order), `path` (menu URL path, where `@gameid` is used as a replacement symbol for game parameters), and `children` (list of child menus).

[0043] If multiple games require functions such as server query, server disable, mass announcements, and individual announcements, this information can be configured in the menu template. The steps are as follows: In the configuration file, define `resources` as the root node of the menu template, containing all template menu items. Each menu item has the following attributes: `name` (menu name, using `@gamename` as a placeholder for a first-level menu), `type` (menu type, 1 for directory, 2 for page), `tid` (template item number), `sortIndex` (sorting index, used to determine the menu display order), `path` (menu URL path, where `@gameid` is used as a replacement symbol for game parameters), and `children` (list of submenus, for items with submenus). The configured result is as follows:

[0044]

[0045]

[0046] Step 2: Define the role template configuration rules, including the relationship between roles and their menu permissions. The role is the root node of the role template, containing all role items. Each role item has attributes, including the role name and role permissions. Role permissions are an array of template item numbers that the role possesses.

[0047] For example, consider two roles: Operations and Planning. Operations requires server management functions, while Planning requires announcement management functions. Therefore, you need to assign corresponding template item numbers to the menu permissions for these two roles. The steps are as follows: In the configuration file, define `roles` as the root node for role templates, containing all role template items. Each role item requires the following attributes: `name` (role name) and `powers` (role permissions). The resulting configuration will look like this:

[0048]

[0049] Step 3: When adding a new game, recursively process the root node of the menu template and the list of submenus. If the menu name contains @gamename, replace the menu name with the current game name; if the menu path contains @gameid, replace @gameid in the current menu path with the game number.

[0050] In other cases, add new menu records in the database according to the menu item configuration and generate actual database menu numbers. The menu records saved in the database must be associated with the template item numbers.

[0051] At the same time, based on the role template configuration, add permissions for the corresponding roles in the database. The menu number of the added permission should correspond to the template item number.

[0052] For example, let's add a new game named "Game A" with game ID 58. First, create a menu ID mapping map to store the mapping between configuration template item IDs and database menu IDs.

[0053] Next, the root node `resource` of the recursive menu template and the list of submenus `children` are processed. First, a database menu object is instantiated. The database menu object contains the following attributes: `id` (number), `name` (menu name), `type` (type), `sort` (sorting), `tid` (template item number), `pid` (parent number), `path` (menu path), and `gameid` (game number). When the configured menu name `name` is `@gamename`, `@gamename` is replaced with the game name "Game A", so the menu name `name` = "Game A". The menu type is set to `type=1` to indicate a directory. The template item number association is set to `tid=1`, and the game number `gameid` = 58. Since `resource` is a top-level menu without a parent, the parent number `pid` is set to 0. This menu is inserted into the database, and the menu number is 501. `tid=1` is used as the key, and 501 is used as the value to store the mapping relationship `map`.

[0054] Next, iterate through the child menu list, instantiate a new database menu object, and set the menu name (name) to Server Management if it does not contain @gamename. Set the menu type to 1, the menu template item number (tid) to 11, the game number (gameid) to 58, and the parent menu to the parent menu number (pid) to 501. Insert this menu into the database to get the menu number 502, and store tid=11 as the key and 502 as the value in the mapping relationship map.

[0055] Next, iterate through the children list of sub-menus under "Server Management", and re-instantiate a database menu object. The menu configuration name is "server query", the menu type is "type" indicating a page, and the configured menu URL path contains "@gameid", so replace it with game number 58 to get the menu path "path = https: / / manage.xxx.com / server / 58", the template item number is "tid" = 111, the game number is "gameid" = 58, the parent menu is set to the parent template item number "pid" = 502, insert this menu into the database to get the menu number 503, and store "tid" = 111 as the key and 503 as the value in the mapping relationship map.

[0056] Following this pattern, after inserting all the template configuration menus in a loop, start adding menu permissions. Loop through the root node `roles` of the role templates, and find the database menu numbers corresponding to template menu item numbers 1, 11, 111, and 112 in `powers` from the mapping relationship, obtaining 501, 502, 503, and 504. Add permissions for these four menu numbers to the operations role. Continue this process, inserting permissions for all template configurations in a loop.

[0057] Step 4: When updating the template, loop through the game list and recursively process the root node and submenu list of the menu template. If it is a new or updated menu, first check the database to see if there is menu data with the same game number and the same template menu item number. If it exists, update the menu data according to the rules when adding a new game; if it does not exist, add the menu data according to the rules when adding a new game. If it is a deleted menu, delete all menu data with the same template item number in the configuration template menu.

[0058] For example, there are two games, Game A with game ID 58 and Game B with game ID 59. The menu template needs to be updated. The server query has been removed from the configuration template, and an announcement query has been added. The modified configuration is as follows:

[0059]

[0060]

[0061]

[0062] The program iterates through the game list, recursively processing the root node of the menu template and the submenu list. First, it checks the database for a menu item with gameid=58 and template item number tid=1. If it exists, it updates the menu's type, name, sort, and path data according to the menu configuration. If it doesn't exist, it adds the menu as described in step 3. This process is repeated for the root node and submenu list. When deleting a configured menu, it deletes all menu items and permission data with the same template item number tid (i.e., tid=111).

[0063] Next, loop through the root node `roles` of the menu permissions, checking if the Operations role has permissions for tid 1, 11, 112. Retrieve the menu numbers 1, 11, 112 from the mapping map to get 501, 502, 504. If the permission exists, skip this step. Next, check if the Planner role has menu permissions for template item numbers tid 1, 12, 121, 122, 123. Retrieve the menu numbers 1, 12, 121, 122, 123 from the mapping map to get 501, 602, 603, 604, 605. Since the menu permission for 605 does not exist, add the permission for menu number 605 to the Planner role.

[0064] See Figure 2 A system for batch management of backend menus via templates, the system comprising: a menu template configuration module, a character template configuration module, a game addition management module, and a template update management module;

[0065] The menu template configuration module is used to define menu template configuration rules, including configuring the menu hierarchy and configuring the attributes of menu items. The menu hierarchy includes a menu template root node, which contains all menu items.

[0066] The role template configuration module is used to define role template configuration rules, including configuring roles and role permissions;

[0067] The newly added game management module is used to recursively process the menu template based on the attributes of the root node and menu items when adding a new game.

[0068] The template update management module is used to iterate through the game list and recursively process the menu template based on the attributes of the root node and menu items when updating the template.

[0069] In one embodiment of the present invention, the attributes of the menu item include menu name, menu type, template item number, sorting index, menu path, and submenu list;

[0070] If the current menu is a first-level menu, the menu name is replaced by the placeholder @gamename. The sort index is used to determine the menu display order. The menu path is the menu URL path, and @gameid is used as the replacement symbol for game parameters in the menu path.

[0071] In one embodiment of the present invention, the role in the role configuration module is the root node of the role template. The root node of the role template contains all role items. Each role item has attributes, including role name and role permissions. Role permissions are an array of template item numbers that the role possesses.

[0072] In one embodiment of the present invention, when adding a new game, the root node of the menu template and the submenu list are processed recursively. If the menu name contains @gamename, the menu name is replaced with the current game name; if the menu path contains @gameid, the @gameid in the current menu path is replaced with the game number.

[0073] In other cases, add new menu records in the database according to the menu item configuration and generate actual database menu numbers. The menu records stored in the database must be associated with the template item numbers.

[0074] At the same time, based on the role template configuration, add permissions for the corresponding roles in the database. The menu number of the added permission should correspond to the template item number.

[0075] In one embodiment of the present invention, step 4 specifically involves: when updating the template, iterating through the game list and recursively processing the root node and submenu list of the menu template; if it is adding or updating a menu, first querying the database to see if there is menu data with the same game number and the same template menu item number; if it exists, updating the menu data according to the rules when adding a game; if it does not exist, adding menu data according to the rules when adding a game; if it is deleting a menu, deleting all menu data with the same template item number in the configuration template menu.

[0076] The above description is only a preferred embodiment of the present invention. All equivalent changes and modifications made within the scope of the claims of the present invention should be included in the scope of the present invention.

Claims

1. A method for batch management of backend menus using templates, characterized in that, The method steps are as follows: Step 1: Define the menu template configuration rules, including configuring the menu hierarchy and configuring the attributes of the menu items. The menu hierarchy includes the menu template root node, which contains all the menu items. Step 2: Define the role template configuration rules, including configuring roles and role permissions; Step 3: When adding a new game, recursively process the menu template based on the attributes of the root node and menu items of the menu template; Step 4: When updating the template, loop through the game list and recursively process the menu template based on the attributes of the root node and menu items of the menu template; The attributes of the menu item include menu name, menu type, template item number, sort index, menu path, and submenu list; If the current menu is a first-level menu, the @gamename placeholder is used to replace the menu name. The sort index is used to determine the menu display order. The menu path is the menu URL path. In the menu path, @gameid is used as the replacement symbol for game parameters. Step 3 specifically involves: when adding a new game, recursively processing the root node of the menu template and the list of submenus; if the menu name contains @gamename, then replace the menu name with the current game name; if the menu path contains @gameid, then replace @gameid in the current menu path with the game number. In other cases, add new menu records in the database according to the menu item configuration and generate actual database menu numbers. The menu records saved in the database must be associated with the template item numbers. At the same time, based on the role template configuration, add permissions for the corresponding roles in the database. The menu number of the added permission should correspond to the template item number.

2. The method for batch management of background menus using templates according to claim 1, characterized in that, The role mentioned in step 2 is the root node of the role template. The root node of the role template contains all role items. Each role item has attributes, including role name and role permissions. Role permissions are an array of template item numbers that the role possesses.

3. The method for batch management of background menus using templates according to claim 1, characterized in that, Step 4 specifically involves: When updating the template, iterating through the game list and recursively processing the root node and submenu list of the menu template. If a new or updated menu is added, first check the database to see if there is menu data with the same game number and the same template menu item number. If it exists, update the menu data according to the rules when adding a new game; if it does not exist, add the menu data according to the rules when adding a new game. If you are deleting a menu item, then delete all menu items with the same template item number in the configuration template menu.

4. A system for batch management of background menus using templates, characterized in that, The system includes: a menu template configuration module, a character template configuration module, a game addition management module, and a template update management module; The menu template configuration module is used to define menu template configuration rules, including configuring the menu hierarchy and configuring the attributes of menu items. The menu hierarchy includes a menu template root node, which contains all menu items. The role template configuration module is used to define role template configuration rules, including configuring roles and role permissions; The newly added game management module is used to recursively process the menu template based on the attributes of the root node and menu items when adding a new game. The template update management module is used to iterate through the game list and recursively process the menu template based on the attributes of the root node and menu items when updating the template. The attributes of the menu item include menu name, menu type, template item number, sort index, menu path, and submenu list; If the current menu is a first-level menu, the @gamename placeholder is used to replace the menu name. The sort index is used to determine the menu display order. The menu path is the menu URL path. In the menu path, @gameid is used as the replacement symbol for game parameters. When adding a new game, the root node of the menu template and the list of submenus are processed recursively. If the menu name contains @gamename, the menu name is replaced with the current game name; if the menu path contains @gameid, the @gameid in the current menu path is replaced with the game number. In other cases, add new menu records in the database according to the menu item configuration and generate actual database menu numbers. The menu records saved in the database must be associated with the template item numbers. At the same time, based on the role template configuration, add permissions for the corresponding roles in the database. The menu number of the added permission should correspond to the template item number.

5. A system for batch management of background menus via templates according to claim 4, characterized in that, The role mentioned in the role configuration module is the root node of the role template. The root node of the role template contains all role items. Each role item has attributes, including role name and role permissions. Role permissions are an array of template item numbers that the role has.

6. A system for batch management of background menus via templates according to claim 4, characterized in that, The template update management module works as follows: When updating a template, it iterates through the game list and recursively processes the root node and submenu list of the menu template. If it is a new or updated menu, it first checks the database to see if there is menu data with the same game number and the same template menu item number. If it exists, it updates the menu data according to the rules when adding a new game; if it does not exist, it adds the menu data according to the rules when adding a new game. If you are deleting a menu item, then delete all menu items with the same template item number in the configuration template menu.

Citation Information

Patent Citations

  • Data batch import method and device and related equipment

    CN113127428A

  • Dynamic menu generation method and device, equipment and storage medium

    CN113986217A