CN-122018748-A - Menu display method, device, system and equipment
Abstract
The application relates to a menu display method, a device, a system and equipment, wherein the method is applied to a system comprising a model layer and a view layer, when a display instruction of a target menu item is received, the view layer determines a target menu item ID corresponding to the target menu item according to the target menu item and sends the target menu item ID to the model layer, the model layer determines target business logic data corresponding to the target menu item ID according to the target menu item ID and returns the target business logic data to the view layer, the view layer matches and determines target display configuration data to be used in a display configuration data set according to the menu item type in the target business logic data, and the view layer performs data rendering according to the target business logic data and the target display configuration data and displays the target menu item.
Inventors
- Su Qianyin
- HOU YUYANG
- CHEN WENKE
- YANG PENG
- ZHANG JIAN
- FENG YONG
- YOU GAO
- LIU XIAOYUAN
- Liao Chunchen
Assignees
- 北京航天测控技术有限公司
Dates
- Publication Date
- 20260512
- Application Date
- 20251230
Claims (10)
- 1. The menu display method is characterized in that the method is applied to a system comprising a model layer and a view layer, the model layer comprises a plurality of menu item nodes, each menu item node comprises a menu item ID and business logic data corresponding to the menu item ID, the business logic data at least comprises menu item types, the view layer stores standardized display configuration data sets classified according to the menu item types, and each type corresponds to one set of display configuration data, wherein: When a display instruction of the target menu item is received, the view layer determines a target menu item ID corresponding to the target menu item according to the target menu item, and sends the target menu item ID to a model layer; The model layer determines target business logic data corresponding to the target menu item ID according to the target menu item ID, and returns the target business logic data to the view layer; The view layer matches and determines target display configuration data to be used in the display configuration data set according to the menu item type in the target business logic data; And the view layer performs data rendering according to the target business logic data and the target display configuration data, and displays the target menu item.
- 2. The method of claim 1, wherein after displaying the target menu item, the method further comprises: When receiving a user operation instruction of the target menu item, the view layer captures the user operation and generates a standardized state change instruction, and sends the target menu item ID and the state change instruction to the model layer; The model layer determines target business logic data corresponding to the target menu item ID according to self preset business logic, updates the state in the target business logic data to obtain updated business logic data, and sends the updated business logic data to the view layer; And the view layer receives the updated service logic data, and locally updates the display state of the target menu item according to the menu item type matching corresponding display configuration data in the updated service logic data.
- 3. The method of claim 1, wherein after displaying the target menu item, the method further comprises: When the model layer receives updated business logic data corresponding to the target menu item node, the model layer pushes the target menu item ID and the updated business logic data to the view layer; And the view layer matches corresponding target display configuration data according to the menu item type in the updated business logic data, performs local re-data rendering based on the updated business logic data and the target display configuration data, and redisplays the target menu item.
- 4. The method according to claim 1, wherein the method further comprises: when the model layer detects that the creation of a new menu item node is finished, detecting whether the new menu item is displayed or not; when the new menu item needs to be displayed, the model layer acquires a new menu item ID and new business logic data of the new menu item in the new menu item node, and sends the new menu item ID and the new business logic data to the view layer; The view layer is matched with corresponding display configuration data in the display configuration data set according to the menu item types in the new service logic data, the view layer is automatically adapted to render new menu items based on the new service logic data and the display configuration data to detect the number of the menu items to be displayed, and when the number of the menu items is larger than the maximum number of the menu items displayed on the current display page, the menu items to be displayed are divided according to a preset rule to obtain a plurality of menu item sets; When the menu item in the menu item set is the menu item displayed first, rendering and displaying are carried out according to the menu item in the menu item set and a first preset menu item; When the menu item in the menu item set is not the first displayed menu item and is not the last displayed menu item, rendering and displaying are carried out according to the menu item, the first preset menu item and the second preset menu item in the menu item set; And when the menu item in the menu item set is the last displayed menu item, rendering and displaying are carried out according to the menu item in the menu item set and a second preset menu item.
- 5. The method according to claim 1, wherein the method further comprises: when a switching instruction of a target display mode is received, loading a rendering template corresponding to the target display mode by the view layer, wherein the rendering template is irrelevant to the model layer business logic data; and the view layer matches corresponding display configuration data under the rendering template according to the menu item type in the target business logic data, and finishes the re-rendering of the menu based on the loaded target rendering template, target business logic data and corresponding display configuration data.
- 6. The method of claim 5, wherein the method further comprises: The view layer acquires the target size of the current screen in real time through a size monitoring event, and determines a target display mode matched with the target size according to a preset mapping rule of the screen size and the display mode; And the view layer generates a display mode switching instruction according to the target display mode, triggers loading and rendering of the target display mode, and completes interface adaptation based on menu item type matching display configuration data under a target rendering template.
- 7. The method of claim 5, wherein after the model layer receives the menu item ID, the method further comprises: and the model layer detects whether the menu item ID is legal, and when the menu item ID is legal, the model layer determines the target business logic data corresponding to the target menu item ID.
- 8. The menu display device is characterized by comprising a system of a model layer and a view layer, wherein the model layer comprises a plurality of menu item nodes, each menu item node comprises a menu item ID and service logic data corresponding to the menu item ID, the service logic data at least comprises a menu item type, the view layer stores standardized display configuration data sets classified according to the menu item type, and each type corresponds to one set of display configuration data, and the view layer comprises a display configuration data set, wherein the standardized display configuration data sets are classified according to the menu item type, and the display configuration data sets are selected according to the menu item type, and the view layer comprises a display configuration data set, wherein the standardized display configuration data sets are selected according to the menu item type. The first determining unit is used for determining a target menu item ID corresponding to the target menu item according to the target menu item when a display instruction of the target menu item is received, and sending the target menu item ID to the model layer; The second determining unit is used for determining target business logic data corresponding to the target menu item ID according to the target menu item ID by the model layer and returning the target business logic data to the view layer; the third determining unit is used for the view layer to match and determine target display configuration data to be used in the display configuration data set according to the menu item type in the target business logic data; and the rendering unit is used for performing data rendering on the view layer according to the target business logic data and the target display configuration data and displaying the target menu item.
- 9. The menu display system is characterized by comprising a model layer and a view layer, wherein the model layer comprises a plurality of menu item nodes, each menu item node comprises a menu item ID and service logic data corresponding to the menu item ID, the service logic data at least comprises menu item types, the view layer stores standardized display configuration data sets classified according to the menu item types, and each type corresponds to one set of display configuration data, wherein: The view layer is used for determining a target menu item ID corresponding to the target menu item according to the target menu item when a display instruction of the target menu item is received, sending the target menu item ID to the model layer, and matching and determining target display configuration data to be used in the display configuration data set according to the menu item type in the target service logic data, wherein the view layer performs data rendering according to the target service logic data and the target display configuration data and displays the target menu item And the model layer is used for determining target business logic data corresponding to the target menu item ID according to the target menu item ID, and returning the target business logic data to the view layer.
- 10. A menu display apparatus comprising at least one communication interface, at least one bus coupled to the at least one communication interface, at least one processor coupled to the at least one bus, and at least one memory coupled to the at least one bus, wherein the processor is configured to: When a display instruction of the target menu item is received, the view layer determines a target menu item ID corresponding to the target menu item according to the target menu item, and sends the target menu item ID to a model layer; The model layer determines target business logic data corresponding to the target menu item ID according to the target menu item ID, and returns the target business logic data to the view layer; The view layer matches and determines target display configuration data to be used in the display configuration data set according to the menu item type in the target business logic data; And the view layer performs data rendering according to the target business logic data and the target display configuration data, and displays the target menu item.
Description
Menu display method, device, system and equipment Technical Field The present application relates to the field of computer technologies, and in particular, to a menu display method, apparatus, system, and device. Background In the embedded HMI system, a menu is used as a core entrance of human-computer interaction, plays a key role in function navigation, state visualization and operation instruction triggering, namely, a user intuitively knows the function architecture of equipment through the menu, grasps the running state of the system in real time, rapidly executes various control operations, and the design rationality directly influences the usability, the operation efficiency and the user experience of the equipment. However, when the menu state (such as on/off of a switch) or the display style (such as title text) needs to be modified, all codes need to be changed, and the whole body is pulled to be moved, which increases the complexity of development and maintenance. Disclosure of Invention The application provides a menu display method, a device, a system and equipment, wherein a model layer is only responsible for management of business logic data, a view layer is only responsible for interface rendering and user operation capturing, and the two are not directly dependent on each other through standardized menu tree ID and signal interaction, one party is modified without changing the code of the other party, and the maintenance cost is greatly reduced. In a first aspect, the present application provides a menu display method, the method being applied to a system comprising a model layer and a view layer, the model layer comprising a plurality of menu item nodes, each menu item node comprising a menu item ID and service logic data corresponding to the menu item ID, the service logic data comprising at least a menu item type, the view layer storing a standardized set of display configuration data categorized by the menu item type, each type corresponding to a set of display configuration data, wherein: When a display instruction of the target menu item is received, the view layer determines a target menu item ID corresponding to the target menu item according to the target menu item, and sends the target menu item ID to a model layer; The model layer determines target business logic data corresponding to the target menu item ID according to the target menu item ID, and returns the target business logic data to the view layer; The view layer matches and determines target display configuration data to be used in the display configuration data set according to the menu item type in the target business logic data; And the view layer performs data rendering according to the target business logic data and the target display configuration data, and displays the target menu item. In a second aspect, the application provides a menu display device, the device comprising a system of a model layer and a view layer, the model layer comprising a plurality of menu item nodes, each menu item node comprising a menu item ID and business logic data corresponding to the menu item ID, the business logic data comprising at least a menu item type, the view layer storing a standardized set of display configuration data categorized by the menu item type, each type corresponding to a set of display configuration data, wherein: the first determining unit is used for determining a target menu item ID corresponding to the target menu item according to the target menu item when a display instruction of the target menu item is received, and sending the target menu item ID to the model layer; The second determining unit is used for determining target business logic data corresponding to the target menu item ID according to the target menu item ID by the model layer and returning the target business logic data to the view layer; the third determining unit is used for the view layer to match and determine target display configuration data to be used in the display configuration data set according to the menu item type in the target business logic data; and the rendering unit is used for performing data rendering on the view layer according to the target business logic data and the target display configuration data and displaying the target menu item. In a third aspect, the present application provides a menu display system, comprising a model layer and a view layer, wherein the model layer comprises a plurality of menu item nodes, each menu item node comprises a menu item ID and service logic data corresponding to the menu item ID, the service logic data at least comprises a menu item type, the view layer stores a standardized display configuration data set classified according to the menu item type, and each type corresponds to a set of display configuration data, wherein: The view layer is used for determining a target menu item ID corresponding to the target menu item according to the target menu item when a display instruction