Menu display method, device, system and equipment
By adopting a model layer and view layer separation design in the embedded HMI system, independent management of menu status and display style is achieved, solving the problem of high complexity in menu modification in existing technologies, reducing maintenance costs and improving system usability.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- BEIJING AEROSPACE MEASUREMENT & CONTROL TECH
- Filing Date
- 2025-12-30
- Publication Date
- 2026-05-12
AI Technical Summary
In embedded HMI systems, modifying menu states or display styles requires changing all the code, resulting in high development and maintenance complexity.
The design adopts a separation of model layer and view layer. The model layer is responsible for business logic data management, while the view layer is responsible for interface rendering and user operation capture. Through standardized menu tree IDs and signal interaction, they do not directly depend on each other, and modifying one side does not require modifying the code of the other side.
This significantly reduced menu maintenance costs, improved system usability and operational efficiency, and reduced the complexity of code modifications.
Smart Images

Figure CN122018748A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and in particular to a menu display method, apparatus, system and device. Background Technology
[0002] In embedded HMI systems, the menu serves as the core entry point for human-computer interaction, playing a crucial role in function navigation, status visualization, and triggering operation commands. Users can intuitively understand the device's functional architecture, monitor the system's operating status in real time, and quickly execute various control operations through the menu. Its design rationality directly affects the device's ease of use, operational efficiency, and user experience.
[0003] However, when it is necessary to modify the menu status (such as on / off switch) or display style (such as title text), all the code must be modified, which affects the whole system and increases the complexity of development and maintenance. Summary of the Invention
[0004] This application provides a menu display method, apparatus, system, and device. The model layer in this application is only responsible for the management of business logic data, and the view layer is only responsible for interface rendering and user operation capture. The two interact through standardized menu tree IDs and signals, and do not directly depend on each other. Modifying one side does not require modifying the code of the other side, which greatly reduces maintenance costs.
[0005] Firstly, this application provides a menu display method, which is applied to a system including a model layer and a view layer. The model layer includes multiple menu item nodes, each menu item node including a menu item ID and business logic data corresponding to the menu item ID, the business logic data including at least a menu item type; the view layer stores a standardized display configuration data set categorized by menu item type, with each type corresponding to a set of display configuration data, wherein: When the display instruction for the target menu item is received, the view layer determines the target menu item ID corresponding to the target menu item based on the target menu item, and sends the target menu item ID to the model layer; The model layer determines the target business logic data corresponding to the target menu item ID based on the target menu item ID, and returns the target business logic data to the view layer; The view layer determines the target display configuration data to be used by matching the menu item type in the target business logic data set; The view layer renders data based on the target business logic data and the target display configuration data, and displays the target menu item.
[0006] Secondly, this application provides a menu display device, the device comprising a model layer and a view layer system. The model layer includes multiple menu item nodes, each menu item node including a menu item ID and business logic data corresponding to the menu item ID, the business logic data including at least a menu item type. The view layer stores a standardized display configuration data set categorized by menu item type, with each type corresponding to a set of display configuration data, wherein: The first determining unit is configured to, when receiving the display instruction of the target menu item, determine the target menu item ID corresponding to the target menu item based on the target menu item, and send the target menu item ID to the model layer; The second determining unit is used by the model layer to determine the target business logic data corresponding to the target menu item ID based on the target menu item ID, and return the target business logic data to the view layer; The third determining unit is used by the view layer to match and determine the target display configuration data to be used in the display configuration data set based on the menu item type in the target business logic data. The rendering unit is used by the view layer to render data based on the target business logic data and the target display configuration data, and to display the target menu item.
[0007] Thirdly, this application provides a menu display system, characterized in that the system includes a model layer and a view layer. The model layer includes multiple menu item nodes, each menu item node including a menu item ID and business logic data corresponding to the menu item ID, the business logic data including at least a menu item type. The view layer stores a standardized display configuration data set categorized by menu item type, with each type corresponding to a set of display configuration data, wherein: The view layer, upon receiving a display instruction for the target menu item, determines the target menu item ID corresponding to the target menu item and sends the target menu item ID to the model layer; and matches and determines the target display configuration data to be used in the display configuration data set based on the menu item type in the target business logic data; the view layer performs data rendering based on the target business logic data and the target display configuration data to display the target menu item. The model layer is used to determine the target business logic data corresponding to the target menu item ID based on the target menu item ID, and return the target business logic data to the view layer.
[0008] Fourthly, this application provides a menu display device, characterized in that it includes: at least one communication interface; at least one bus connected to the at least one communication interface; at least one processor connected to the at least one bus; and at least one memory connected to the at least one bus, wherein the processor is configured to: When the display instruction for the target menu item is received, the view layer determines the target menu item ID corresponding to the target menu item based on the target menu item, and sends the target menu item ID to the model layer; The model layer determines the target business logic data corresponding to the target menu item ID based on the target menu item ID, and returns the target business logic data to the view layer; The view layer determines the target display configuration data to be used by matching the menu item type in the target business logic data set; The view layer renders data based on the target business logic data and the target display configuration data, and displays the target menu item.
[0009] Fifthly, this application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the above-described menu display method.
[0010] Compared with the prior art, the technical solution provided in this application has the following advantages: This application is applied to a system including a model layer and a view layer. The model layer includes multiple menu item nodes, each menu item node including a menu item ID and business logic data corresponding to the menu item ID. The business logic data includes at least a menu item type. The view layer stores a standardized display configuration data set classified by menu item type, with each type corresponding to a set of display configuration data. When a display instruction for the target menu item is received, the view layer determines the target menu item ID corresponding to the target menu item based on the target menu item and sends the target menu item ID to the model layer. The model layer determines the target business logic data corresponding to the target menu item ID based on the target menu item ID and returns the target business logic data to the view layer. The view layer matches and determines the target display configuration data to be used in the display configuration data set based on the menu item type in the target business logic data. The view layer performs data rendering based on the target business logic data and the target display configuration data to display the target menu item. In this application, the model layer is only responsible for managing business logic data, and the view layer is only responsible for interface rendering and user operation capture. The two interact through standardized menu tree IDs and signals, and do not directly depend on each other. Modifying one does not require modifying the code of the other, which greatly reduces maintenance costs. Attached Figure Description
[0011] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention.
[0012] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0013] One or more embodiments are illustrated by way of example with reference numerals in the accompanying drawings. These illustrations do not constitute a limitation on the embodiments. Elements with the same reference numerals in the drawings are denoted as similar elements. Unless otherwise stated, the figures in the drawings are not to be limited by scale.
[0014] Figure 1 A schematic diagram illustrating a menu display method provided in an embodiment of this application; Figure 2 A schematic diagram illustrating another menu display method provided in an embodiment of this application; Figure 3 A flowchart illustrating a menu display method provided in an embodiment of this application; Figure 4 A flowchart illustrating a menu item status update method provided in an embodiment of this application; Figure 5 A flowchart illustrating a business logic data update method provided in an embodiment of this application; Figure 6 This is a schematic flowchart of a menu display device provided in an embodiment of this application; Figure 7 This is a schematic diagram of a menu display device provided in an embodiment of this application. Detailed Implementation
[0015] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0016] The following disclosure provides numerous different embodiments or examples for implementing various structures of the invention. To simplify the disclosure, specific examples of components and arrangements are described below. These are merely examples and are not intended to limit the scope of the invention. Furthermore, reference numerals and / or letters may be repeated in different examples. Such repetition is for simplification and clarity and does not in itself indicate a relationship between the various embodiments and / or arrangements discussed.
[0017] like Figure 1 As shown, this application is applied to a system that includes a model layer and a view layer. Wherein, as Figure 2 As shown, the core responsibility of the model layer is to manage the business logic data of menu items, containing multiple independent menu item nodes. Each menu item node is uniquely associated with a menu item ID and stores the complete business logic data corresponding to that ID. This business logic data includes at least the menu item type (e.g., plain text, switch control, function trigger, multi-select list, etc.) and may also include the menu item title, current state (e.g., switch on / off, selected item in the list), visibility identifier, sub-menu item references, and other core business data. The model layer is only responsible for data storage, querying, and updating, and does not participate in any display-related logic processing. The core responsibility of the view layer is standardized rendering and display, and user operation capture, without involving modification of business logic data. The view layer pre-stores a set of standardized display configuration data categorized by menu item type. Each menu item type corresponds to unique display configuration data, which includes fixed layout rules (e.g., horizontal arrangement, vertical arrangement, grid layout), style parameters (e.g., font size, color, background style, rounded corners), and control rendering rules (e.g., plain text corresponds to label controls, switch corresponds to switch button controls, and function corresponds to trigger button controls). For example, a regular text menu item is configured with a vertical layout, 14-point font, black text, and a white background, corresponding to a label-type display control; a switch control menu item is configured with a horizontal layout, 14-point font, black text, and a light gray background, corresponding to a combination control of "text label + switch button"; and a function trigger menu item is configured with a vertical layout, 16-point bold font, blue text, and a white background, corresponding to a trigger button control.
[0018] The view layer also deploys a user operation capture module, which supports capturing common interactive operations such as touch clicks and button triggers. It only records operation information (including the target menu item ID) and forwards it to the authorization module, without participating in any data modification processing.
[0019] Based on the above system, this application provides a menu display method. In this method, the model layer is only responsible for managing business logic data, and the view layer is only responsible for interface rendering and user operation capture. The two interact through standardized menu tree IDs and signals, and do not directly depend on each other. Modifying one does not require changing the code of the other, significantly reducing maintenance costs. Figure 3 As shown, the specific steps include: Step 301: When the display instruction for the target menu item is received, the view layer determines the target menu item ID corresponding to the target menu item based on the target menu item, and sends the target menu item ID to the model layer.
[0020] The target menu item is the menu item to be displayed, which can be any type such as system information display menu item, sound switch menu item, device startup menu item, working mode selection menu item, etc.
[0021] In this step, the view layer receives the display instruction for the target menu item through system initialization calls, user-triggered operations, or external module notifications. This instruction directly carries the target menu item ID and sends the target menu item ID in the display instruction directly to the model layer through a preset communication interface (such as the signal-slot mechanism or function call interface) to initiate a business logic data request.
[0022] Step 302: The model layer determines the target business logic data corresponding to the target menu item ID based on the target menu item ID, and returns the target business logic data to the view layer.
[0023] In this step, after receiving the target menu item ID, the model layer finds the menu item node corresponding to the target menu item ID and extracts the target business logic data stored in the node. For example, when the target menu item is a sound switch menu item, the target business logic data includes data such as type, title, current status, visibility, and associated parameters. The target business logic data is then returned to the view layer through the communication interface.
[0024] Step 303: The view layer matches and determines the target display configuration data to be used in the display configuration data set based on the menu item type in the target business logic data.
[0025] In this step, after the view layer receives the target business logic data, it extracts the menu item type information and performs precise matching in a pre-stored standardized display configuration data set to determine the target display configuration data corresponding to that type of menu item.
[0026] For example, the display configuration for switch control menu items is "horizontal layout, 14-point font, black text, light gray background, switch button size 30×15mm"; the display configuration for multi-select list menu items is "vertical layout, 14-point font, black text, white background, drop-down list width 120mm".
[0027] Step 304: The view layer renders the data based on the target business logic data and the target display configuration data, and displays the target menu items.
[0028] In this step, the view layer, based on the specific content in the target business logic data and combined with the matched target display configuration data, calls the corresponding control rendering interface to dynamically generate interface components and complete the layout: for example, the sound switch menu item generates a combination control of "text label + switch button" and arranges it in a horizontal layout; the working mode selection menu item generates a combination control of "text label + drop-down list" and arranges it in a vertical layout, and finally presents the target menu item on the display device.
[0029] Throughout the interaction, the view layer only performs data rendering (converting business logic data into a visual interface) and user operation capture (such as touching and clicking sound switch buttons, selecting drop-down list options for working mode), without directly modifying the original business logic data stored in the model layer, thus ensuring data consistency and security.
[0030] In this embodiment, the application is applied to a system including a model layer and a view layer. The model layer includes multiple menu item nodes, each menu item node including a menu item ID and business logic data corresponding to the menu item ID. The business logic data includes at least a menu item type. The view layer stores a standardized display configuration data set categorized by menu item type, with each type corresponding to a set of display configuration data. When a display instruction for the target menu item is received, the view layer determines the target menu item ID corresponding to the target menu item and sends the target menu item ID to the model layer. The model layer determines the target business logic data corresponding to the target menu item ID based on the target menu item ID and returns the target business logic data to the view layer. The view layer matches and determines the target display configuration data to be used in the display configuration data set based on the menu item type in the target business logic data. The view layer performs data rendering based on the target business logic data and the target display configuration data to display the target menu item. In this application, the model layer is only responsible for managing business logic data, and the view layer is only responsible for interface rendering and user operation capture. The two interact through standardized menu tree IDs and signals, and do not directly depend on each other. Modifying one does not require modifying the code of the other, which greatly reduces maintenance costs.
[0031] In this embodiment, when a user clicks a target menu item, the view layer captures the operation, generates a standardized state change instruction, determines the target menu item ID, and sends the state change instruction and the target menu item ID to the model layer. The model layer, based on preset business rules, finds the business logic data corresponding to the menu item ID, updates its state, generates updated business logic data, and then sends it back to the view layer. The view layer receives the updated data, matches the corresponding display configuration data according to the menu item type, and only updates the display state of the target menu item, without refreshing the entire page. Therefore, this embodiment provides a menu item state update method, as follows: Figure 4 As shown, the specific steps include: Step 401: When a user operation instruction for the target menu item is received, 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.
[0032] In this step, the user interacts with the displayed target menu item. When the view layer captures this user action through the action capture module, the view layer generates a standardized state change instruction, determines the target menu item ID, and sends the target menu item ID and the corresponding standardized state change instruction to the model layer through the communication interface.
[0033] Step 402: The model layer determines the target business logic data corresponding to the target menu item ID based on its own 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.
[0034] In this step, after receiving the target menu item ID and standardized state change command, the model layer determines the target business logic data corresponding to the target menu item ID based on its built-in preset business logic, and updates the state information accordingly. For example, upon receiving the "On" command for the sound switch menu item, its state is updated from "Off" to "On". The updated business logic data is obtained through this method. The model layer then feeds back the updated business logic data to the view layer via a communication interface.
[0035] Step 403: The view layer receives the updated business logic data, matches the corresponding display configuration data according to the menu item type in the updated business logic data, and partially updates the display status of the target menu item.
[0036] In this step, after the view layer receives the updated business logic data, it extracts the menu item type from the updated business logic data, determines the corresponding display configuration data, and performs partial rendering refresh for the target menu item based on the display configuration data and the updated business logic data.
[0037] In this embodiment, when the model layer obtains the updated business logic data corresponding to the target menu item, it actively pushes the target menu item ID and the updated business logic data to the view layer. After receiving the data, the view layer matches the predefined corresponding display configuration data according to the menu item type in the updated business logic data. Combining the updated business logic data with the matched display configuration data, it performs only partial re-rendering of the target menu item, completing the update and re-display of the menu item's interface state. Therefore, this application provides a method for updating business logic data, as follows: Figure 5 As shown, the specific steps include: Step 501: When the model layer receives the 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.
[0038] In this step, the business logic data of the target menu item is modified according to the business needs of the technical personnel, and the target menu item ID and the updated business logic data are sent to the model layer. The model layer receives and verifies the validity of the data. After verifying the validity of the updated business logic data, the model layer updates the business logic data of the corresponding menu item node stored in its own storage, and at the same time actively pushes the target menu item ID and the updated business logic data to the view layer through a preset communication interface, without requiring the view layer to actively query or poll.
[0039] Step 502: The view layer matches the corresponding target display configuration data according to the menu item type in the updated business logic data, performs partial re-data rendering based on the updated business logic data and the target display configuration data, and re-displays the target menu item.
[0040] In this step, after the view layer receives the target menu item ID and the updated business logic data pushed by the model layer, it extracts the menu item type from the updated business logic data and determines the corresponding target display configuration data in the standardized display configuration data set. Then, based on the updated business logic data and the target display configuration data, it performs partial re-data rendering only on the interface component corresponding to the target menu item.
[0041] In this embodiment, when the current display page needs to display multiple menu items, the limited size of the current display page means that one display page cannot accommodate all the menu items. Therefore, multiple display pages can be used to display these menu items. To facilitate page turning, a backward page-turning menu item and / or a forward page-turning menu item can be added to each display page to enable page turning functionality. After the model layer detects the creation of a new menu item node, it first determines whether the new menu item needs to be displayed on the interface. If it is determined that it needs to be displayed, the model layer extracts the new menu item ID and new business logic data from the new menu item node and sends these two sets of core data to the view layer. After receiving the data, the view layer matches the corresponding display configuration in the display configuration data set according to the menu item type in the new business logic data. Finally, by combining the new business logic data and the matched display configuration, the rendering and display of the new menu item is automatically adapted and completed. The specific steps include: when the model layer detects that a new menu item node has been created, it checks whether to display the new menu item; when the new menu item needs to be displayed, the model layer obtains the new menu item ID and new business logic data from 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 matches the corresponding display configuration data in the display configuration data set according to the menu item type in the new business logic data, and automatically adapts and renders the new menu item based on the new business logic data and the display configuration data.
[0042] In this step, the model layer monitors the creation status of menu item nodes in real time. When a new menu item node is detected as being created, it checks whether the new menu item needs to be displayed based on built-in display judgment rules. These rules can be preset to be triggered by display commands from external modules. When it is determined that the new menu item needs to be displayed, the model layer extracts the new menu item ID and new business logic data from the new menu item node and actively sends them to the view layer via a preset communication interface. Upon receiving the new menu item ID and new business logic data, the view layer first extracts the menu item type from the new business logic data and matches the corresponding display configuration data in the standardized display configuration data set. Then, based on the specific content in the new business logic data and the matched display configuration data, it automatically calls the corresponding control rendering interface to dynamically generate interface components and complete the layout. The specific steps are as follows: The view layer detects the number of menu items to be displayed. When the number of menu items is greater than the maximum number of menu items displayed on the current page, the menu items to be displayed are divided according to preset rules to obtain multiple menu item sets. When a menu item in a menu item set is the first menu item to be displayed, it is rendered and displayed based on the menu items in the menu item set and the first preset menu item. When a menu item in a menu item set is neither the first nor the last menu item to be displayed, it is rendered and displayed based on the menu items in the menu item set, the first preset menu item, and the second preset menu item. When a menu item in a menu item set is the last menu item to be displayed, it is rendered and displayed based on the menu items in the menu item set and the second preset menu item.
[0043] The first preset menu item indicates whether to turn to the next page; when triggered, it displays the menu item for the next page. The second preset menu item indicates whether to turn to the previous page; when triggered, it displays the menu item for the previous page. Since the functions of these two menu items are fixed, their required data can be set in the view layer, or it can be accessed through... Figure 3 The method described above is used to obtain the data corresponding to these two menu items for rendering.
[0044] The above preset rules are related to the display page corresponding to the set. When the display page corresponding to the set is the first display page, the number of menu items in its corresponding menu item set is the maximum number of menu items minus one. When the display page corresponding to the set is the last display page, the number of menu items in its corresponding menu item set is less than or equal to the maximum number of menu items minus one. When the display page corresponding to the set is a middle display page, the number of menu items in its corresponding menu item set is equal to the maximum number of menu items minus two.
[0045] In this way, the number corresponding to each menu item set can be determined. Based on these numbers, the menu items can be divided into multiple menu item sets. The specific division method can be random or other methods; it is not limited here.
[0046] Then, based on the corresponding display page, it is determined whether the menu item in the corresponding menu item set is the first menu item displayed, or neither the first nor the last menu item displayed, or the last menu item displayed. When the display page corresponding to the set is the first display page, it means that the menu item in the menu item set is the first menu item displayed, and rendering is performed based on the menu item in the menu item set and the first preset menu item; when the display page corresponding to the set is a middle display page, it means that the menu item in the menu item set is neither the first nor the last menu item displayed, and rendering is performed based on the menu item in the menu item set, the first preset menu item, and the second preset menu item; when the display page corresponding to the set is the last display page, it means that the menu item in the menu item set is the last menu item displayed, and rendering is performed based on the menu item in the menu item set and the second preset menu item.
[0047] In this embodiment, after receiving a display mode switching instruction, the view layer first loads a rendering template corresponding to the target display mode, which is unrelated to the business logic data of the model layer. Then, it matches the corresponding display configuration data under the template based on the menu item type in the target business logic data. Finally, it combines the rendering template, business logic data, and display configuration data to complete the menu re-rendering. The specific steps include: when receiving a target display mode switching instruction, the view layer loads a rendering template corresponding to the target display mode, which is unrelated to the business logic data of the model layer; the view layer matches the corresponding display configuration data under the rendering template based on the menu item type in the target business logic data; and based on the loaded target rendering template, target business logic data, and corresponding display configuration data, completes the menu re-rendering.
[0048] In this embodiment, the view layer obtains the target size by listening to the screen size, determines the target display mode according to a preset mapping rule between size and display mode, generates a switching command to trigger the loading and rendering of the mode, and finally completes the interface adaptation by matching the menu item type display configuration in the corresponding rendering template. The specific steps include: the view layer obtains the target size of the current screen in real time through a size listening event; the view layer determines the target display mode that matches the target size according to a preset mapping rule between screen size and display mode; the view layer generates a display mode switching command based on the target display mode, triggers the loading and rendering of the target display mode, and completes the interface adaptation by matching the menu item type display configuration data under the target rendering template.
[0049] In this embodiment, after the model layer receives the menu item ID, it checks whether the menu item ID is valid. If the menu item ID is valid, it determines the target business logic data corresponding to the target menu item ID. For example, it checks whether the menu item ID conforms to logic or valid state conventions to determine whether the menu item ID is valid.
[0050] like Figure 6 As shown in the illustration, this application provides a menu display device, which corresponds to the method embodiment. The device includes a system with a model layer and a view layer. The model layer includes multiple menu item nodes, each menu item node including a menu item ID and business logic data corresponding to the menu item ID. The business logic data includes at least a menu item type. The view layer stores a standardized display configuration data set categorized by menu item type. Each type corresponds to a set of display configuration data, specifically including: The first determining unit 601 is used to, when receiving the display instruction of the target menu item, determine the target menu item ID corresponding to the target menu item according to the target menu item, and send the target menu item ID to the model layer; The second determining unit 602 is used for the model layer to determine the target business logic data corresponding to the target menu item ID based on the target menu item ID, and to return the target business logic data to the view layer; The third determining unit 603 is used for the view layer to match and determine the 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; The rendering unit 604 is used for the view layer to render data based on the target business logic data and the target display configuration data, and to display the target menu item.
[0051] Optionally, after displaying the target menu item, the device further includes a fourth determining unit 605, the fourth determining unit 605 being configured to: When a user operation instruction for the target menu item is received, 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 the target business logic data corresponding to the target menu item ID based on its own 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. The view layer receives the updated business logic data, matches the corresponding display configuration data according to the menu item type in the updated business logic data, and partially updates the display status of the target menu item.
[0052] Optionally, after displaying the target menu item, the device further includes a fifth determining unit 606, the fifth determining unit 606 being configured to: When the model layer receives the 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. The view layer matches the corresponding target display configuration data according to the menu item type in the updated business logic data, performs partial re-data rendering based on the updated business logic data and the target display configuration data, and re-displays the target menu item.
[0053] Optionally, the device further includes a sixth determining unit 607, the sixth determining unit 607 being configured to: The view layer detects the number of menu items to be displayed. When the number of menu items is greater than the maximum number of menu items displayed on the current display page, the menu items to be displayed are divided according to a preset rule to obtain multiple menu item sets. When the menu item in the menu item set is the first menu item to be displayed, the menu item is rendered and displayed according to the menu item in the menu item set and the first preset menu item; When a menu item in the set of menu items is neither the first menu item displayed nor the last menu item displayed, the menu item is rendered and displayed according to the menu item in the set of menu items, the first preset menu item, and the second preset menu item. When the menu item in the menu item set is the last menu item to be displayed, the menu item in the menu item set and the second preset menu item are rendered and displayed. When the model layer detects that a new menu item node has been created, it checks whether to display the new menu item. When the new menu item needs to be displayed, the model layer obtains the new menu item ID and new business logic data of the new menu item from the new menu item node, and sends the new menu item ID and new business logic data to the view layer. The view layer matches the corresponding display configuration data in the display configuration data set according to the menu item type in the new business logic data, and automatically adapts and renders the new menu item based on the new business logic data and the display configuration data.
[0055] Optionally, the device further includes a seventh determining unit 608, the seventh determining unit 608 being configured to: When a switching instruction for the target display mode is received, the view layer loads a rendering template corresponding to the target display mode. The rendering template is unrelated to the business logic data of the model layer. The view layer matches the corresponding display configuration data under the rendering template according to the menu item type in the target business logic data, and completes the menu re-rendering based on the loaded target rendering template, target business logic data and corresponding display configuration data.
[0056] Optionally, the device further includes an eighth determining unit 609, the eighth determining unit 609 being configured to: The view layer obtains the target size of the current screen in real time through size listening events; the view layer determines the target display mode that matches the target size according to the pre-set mapping rules between screen size and display mode; The view layer generates a display mode switching instruction based on the target display mode, triggers the loading and rendering of the target display mode, and completes the interface adaptation by matching the display configuration data based on the menu item type under the target rendering template.
[0057] Optionally, after the model layer receives the menu item ID, the device further includes a ninth determining unit 610, the ninth determining unit 610 being configured to: The model layer checks whether the menu item ID is valid. When the menu item ID is valid, it determines the target business logic data corresponding to the target menu item ID.
[0058] like Figure 7 As shown in the figure, this application embodiment provides a menu display device, including a processor 701, a communication interface 702, a memory 703, and a communication bus 704, wherein the processor 701, the communication interface 702, and the memory 703 communicate with each other through the communication bus 704. Memory 703 is used to store computer programs; In one embodiment of this application, when the processor 701 executes a program stored in the memory 703, it implements the menu display method provided in any of the foregoing method embodiments, including: When the display instruction for the target menu item is received, the view layer determines the target menu item ID corresponding to the target menu item based on the target menu item, and sends the target menu item ID to the model layer; The model layer determines the target business logic data corresponding to the target menu item ID based on the target menu item ID, and returns the target business logic data to the view layer; The view layer determines the target display configuration data to be used by matching the menu item type in the target business logic data set; The view layer renders data based on the target business logic data and the target display configuration data, and displays the target menu item.
[0059] This application also provides a computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the steps performed by the menu display method provided in any of the foregoing method embodiments.
[0060] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs.
[0061] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented using software plus a general-purpose hardware platform, or of course, using hardware. Based on this understanding, the above technical solutions, in essence or the parts that contribute to the related technology, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.
[0062] It should be understood that the terminology used herein is for the purpose of describing particular exemplary embodiments only and is not intended to be limiting. Unless the context clearly indicates otherwise, the singular forms “a,” “an,” and “described” as used herein may also include the plural forms. The terms “comprising,” “including,” “containing,” and “having” are inclusive and therefore indicate the presence of the stated features, steps, operations, elements, and / or components, but do not exclude the presence or addition of one or more other features, steps, operations, elements, components, and / or combinations thereof. The method steps, processes, and operations described herein are not construed as requiring them to be performed in a particular order described or illustrated unless the order of performance is explicitly indicated. It should also be understood that additional or alternative steps may be used.
[0063] The above description is merely a specific embodiment of the present invention, enabling those skilled in the art to understand or implement the invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the invention. Therefore, the present invention is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features claimed herein.
Claims
1. A menu display method, characterized in that, The method is applied to a system comprising a model layer and a view layer. The model layer includes multiple menu item nodes, each menu item node including a menu item ID and corresponding business logic data, wherein the business logic data includes at least a menu item type. The view layer stores a standardized display configuration data set categorized by menu item type, with each type corresponding to a set of display configuration data, wherein: When the display instruction for the target menu item is received, the view layer determines the target menu item ID corresponding to the target menu item based on the target menu item, and sends the target menu item ID to the model layer; The model layer determines the target business logic data corresponding to the target menu item ID based on the target menu item ID, and returns the target business logic data to the view layer; The view layer determines the target display configuration data to be used by matching the menu item type in the target business logic data set; The view layer renders data based on the target business logic data and the target display configuration data, and displays the target menu item.
2. The method according to claim 1, characterized in that, After displaying the target menu item, the method further includes: When a user operation instruction for the target menu item is received, 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 the target business logic data corresponding to the target menu item ID based on its own 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. The view layer receives the updated business logic data, matches the corresponding display configuration data according to the menu item type in the updated business logic data, and partially updates the display status of the target menu item.
3. The method according to claim 1, characterized in that, After displaying the target menu item, the method further includes: When the model layer receives the 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. The view layer matches the corresponding target display configuration data according to the menu item type in the updated business logic data, performs partial re-data rendering based on the updated business logic data and the target display configuration data, and re-displays the target menu item.
4. The method according to claim 1, characterized in that, The method further includes: When the model layer detects that a new menu item node has been created, it checks whether to display the new menu item. When the new menu item needs to be displayed, the model layer obtains the new menu item ID and new business logic data of the new menu item from the new menu item node, and sends the new menu item ID and new business logic data to the view layer. The view layer matches the corresponding display configuration data in the display configuration data set according to the menu item type in the new business logic data, and automatically adapts and renders the new menu item based on the new business logic data and the display configuration data. The view layer detects the number of menu items to be displayed. When the number of menu items is greater than the maximum number of menu items displayed on the current display page, the menu items to be displayed are divided according to preset rules to obtain multiple menu item sets. When the menu item in the menu item set is the first menu item to be displayed, the menu item is rendered and displayed according to the menu item in the menu item set and the first preset menu item; When a menu item in the menu item set is neither the first nor the last menu item displayed, the menu item is rendered and displayed according to the menu item in the menu item set, the first preset menu item, and the second preset menu item. When the menu item in the menu item set is the last menu item displayed, the menu item is rendered and displayed according to the menu item in the menu item set and the second preset menu item.
5. The method according to claim 1, characterized in that, The method further includes: When a switching instruction for the target display mode is received, the view layer loads a rendering template corresponding to the target display mode. The rendering template is unrelated to the business logic data of the model layer. The view layer matches the corresponding display configuration data under the rendering template according to the menu item type in the target business logic data, and completes the menu re-rendering based on the loaded target rendering template, target business logic data and corresponding display configuration data.
6. The method according to claim 5, characterized in that, The method further includes: The view layer obtains the target size of the current screen in real time through size listening events; the view layer determines the target display mode that matches the target size according to the pre-set mapping rules between screen size and display mode; The view layer generates a display mode switching instruction based on the target display mode, triggers the loading and rendering of the target display mode, and completes the interface adaptation by matching the display configuration data based on the menu item type under the target rendering template.
7. The method according to claim 5, characterized in that, After the model layer receives the menu item ID, the method further includes: The model layer checks whether the menu item ID is valid. When the menu item ID is valid, it determines the target business logic data corresponding to the target menu item ID.
8. A menu display device, characterized in that, The device comprises a model layer and a view layer. The model layer includes multiple menu item nodes, each menu item node including a menu item ID and corresponding business logic data. The business logic data includes at least the menu item type. The view layer stores a standardized display configuration data set categorized by menu item type, with each type corresponding to a set of display configuration data. The first determining unit is configured to, when receiving the display instruction of the target menu item, determine the target menu item ID corresponding to the target menu item based on the target menu item, and send the target menu item ID to the model layer; The second determining unit is used by the model layer to determine the target business logic data corresponding to the target menu item ID based on the target menu item ID, and return the target business logic data to the view layer; The third determining unit is used by the view layer to match and determine the target display configuration data to be used in the display configuration data set based on the menu item type in the target business logic data. The rendering unit is used by the view layer to render data based on the target business logic data and the target display configuration data, and to display the target menu item.
9. A menu display system, characterized in that, The system comprises a model layer and a view layer. The model layer includes multiple menu item nodes, each containing a menu item ID and corresponding business logic data. The business logic data includes at least the menu item type. The view layer stores a standardized display configuration data set categorized by menu item type, with each type corresponding to a set of display configuration data. The view layer, upon receiving a display instruction for the target menu item, determines the target menu item ID corresponding to the target menu item and sends the target menu item ID to the model layer; and matches and determines the target display configuration data to be used in the display configuration data set based on the menu item type in the target business logic data; the view layer performs data rendering based on the target business logic data and the target display configuration data to display the target menu item. The model layer is used to determine the target business logic data corresponding to the target menu item ID based on the target menu item ID, and return the target business logic data to the view layer.
10. A menu display device, characterized in that, include: At least one communication interface; At least one bus connected to the at least one communication interface; at least one processor connected to the at least one bus; At least one memory connected to the at least one bus, wherein the processor is configured to: When the display instruction for the target menu item is received, the view layer determines the target menu item ID corresponding to the target menu item based on the target menu item, and sends the target menu item ID to the model layer; The model layer determines the target business logic data corresponding to the target menu item ID based on the target menu item ID, and returns the target business logic data to the view layer; The view layer determines the target display configuration data to be used by matching the menu item type in the target business logic data set; The view layer renders data based on the target business logic data and the target display configuration data, and displays the target menu item.