Multi-system menu integration method and device and electronic equipment
By establishing a cache container in the front-end page to store the cache data of the system menu, and executing operation instructions according to the cache data of the target menu, the problem of menu data loss in the existing technology is solved, and the rendering efficiency and user experience are improved.
Patent Information
- Application Number
- CN202410900797.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-05
- Publication Date
- 2024-09-24
AI Technical Summary
Existing front-end page rendering technology cannot effectively cache menu data when switching subsystems, causing the user experience to be affected.
By obtaining the menu operation page associated with the main system, a cache container is established to store the cache data of the system menu, and the menu operation instructions are executed according to the cache data of the target menu to realize the loading, refreshing and switching operations of the menu.
Improved rendering efficiency, improved user experience, and solved the problem of menu data loss after switching subsystems.
Smart Images

Figure CN118689478A
Abstract
Description
Technical Field
[0001] The present invention relates to the field of front-end page technology, and in particular to a multi-system menu integration method, device and electronic equipment. Background Art
[0002] With the rapid development of front-end technology, the front-end page loading and rendering methods of modern Web applications are also being continuously optimized and innovated. At present, the mainstream front-end page loading and rendering methods include single system loading corresponding resources in the system, micro-service architecture based on domain name switching for page rendering, and micro-service framework based on Single-SPA encapsulation. These methods each have their own unique advantages and applicable scenarios, but they also face some common challenges.
[0003] First, the method of loading corresponding resources in a single system achieves centralized management and fast loading of resources by packaging the entire application into one or more files. However, as the application scale continues to expand, this method will cause the page loading speed to slow down, and the menu information cannot be effectively cached when switching between different systems, affecting the user experience.
[0004] Secondly, the microservice architecture based on domain name switching splits a single application into multiple small services, improving the scalability and maintainability of the system. In the front-end page loading and rendering, different subsystems are accessed through different domain names to achieve independent rendering of the page. However, since the domain name switching causes the browser to reload the page, the user will lose the previous interaction information, including menu status, when switching subsystems, which also reduces the user experience.
[0005] Finally, the microservice framework based on Single-SPA encapsulation allows multiple single-page applications (SPA) to be combined into a whole application, which is managed and scheduled through Single-SPA. This approach achieves decoupling and independent deployment of applications while maintaining the advantages of SPA's refresh-free switching. However, when switching between different systems, especially when the browser refreshes or jumps to other pages and then returns, the menu cache information may be lost, thus affecting the consistency of the user experience.
[0006] Therefore, when rendering the front-end page, it is necessary to solve the problem of not being able to cache menu data after switching subsystems, so as to improve rendering efficiency and improve user experience. Summary of the invention
[0007] In order to provide a basic understanding of some aspects of the disclosed embodiments, a brief summary is given below. The summary is not an extensive review, nor is it intended to identify key / critical components or delineate the scope of protection of these embodiments, but rather serves as a prelude to the detailed description that follows.
[0008] In view of the above-mentioned shortcomings of the prior art, the present application discloses a multi-system menu integration method, device and electronic device to improve rendering efficiency.
[0009] The present application discloses a multi-system menu integration method, comprising: obtaining a menu operation page corresponding to a main system, wherein the main system is associated with multiple system menus; establishing a cache container corresponding to the menu display page to store cache data corresponding to at least a portion of the system menus through the cache container, wherein the menu operation page is used to load the system menu according to the cache data in the cache container; receiving a menu operation instruction corresponding to a target menu through the menu operation page, wherein the target menu is any system menu; and executing the menu operation instruction according to the cache data corresponding to the target menu.
[0010] In one embodiment of the present application, obtaining a menu operation page corresponding to the main system includes: obtaining system menus corresponding to one or more original systems; constructing system information corresponding to each of the original systems, wherein the system information includes one or more of a system name, a system identifier, and a system address; constructing original menu information corresponding to each of the system menus, wherein the original menu information includes a menu name, a menu identifier, a menu address, and a system address corresponding to the system menu; developing a page according to a system display area, a menu display area, and a page display area to obtain a menu operation page, wherein the system display area is used to display each of the original systems, the menu display area is used to display the system menus corresponding to each of the original systems, and the page display area is used to display the menu page after the system menu is loaded.
[0011] In one embodiment of the present application, the menu operation instruction is executed according to the cache data corresponding to the target menu, including: if the menu operation instruction is a menu loading instruction, determining whether the cache data corresponding to the target menu exists in the cache container; if the cache data corresponding to the target menu does not exist in the cache container, using the original menu information corresponding to the target menu as the cache menu information, and adding an Iframe tag corresponding to the target system to the menu operation page, obtaining an Iframe identifier corresponding to the Iframe tag, so as to generate the cache data corresponding to the target menu according to the cache menu information and the IFrame identifier, wherein the target system is the original system corresponding to the target menu; if the cache data corresponding to the target menu exists in the cache container, extracting the cache data corresponding to the target menu from the cache container; extracting the Iframe tag corresponding to the target menu according to the Iframe identifier of the target menu in the cache data, and configuring the Iframe tag corresponding to the target menu according to the cache menu information of the target menu in the cache data, so as to load the target menu on the menu operation page through the configured Iframe tag.
[0012] In one embodiment of the present application, the menu operation instruction is executed according to the cache data corresponding to the target menu, including: if the menu operation instruction is a menu refresh instruction, determining whether the cache data corresponding to the target menu exists in the cache container; if the cache data corresponding to the target menu does not exist in the cache container, generating refresh exception information; if the cache data corresponding to the target menu exists in the cache container, extracting the cache data corresponding to the target menu from the cache container; extracting the Iframe tag corresponding to the target menu according to the Iframe identifier of the target menu in the cache data, and refreshing the page resources through the Iframe tag corresponding to the target menu.
[0013] In one embodiment of the present application, the menu operation instruction is executed according to the cache data corresponding to the target menu, including: if the menu operation instruction is a menu switching instruction, determining whether the cache data corresponding to the target menu exists in the cache container; if the cache data corresponding to the target menu does not exist in the cache container, generating switching exception information; if the cache data corresponding to the target menu exists in the cache container, extracting the cache data corresponding to the target menu from the cache container; extracting the Iframe tag corresponding to the target menu according to the Iframe identifier of the target menu in the cache data, so as to display the target menu on the menu operation page through the extracted Iframe tag.
[0014] In one embodiment of the present application, the menu operation instruction is executed according to the cache data corresponding to the target menu, including: if the menu operation instruction is a cache deletion instruction, determining whether the cache data corresponding to the target menu exists in the cache container; if the cache data corresponding to the target menu exists in the cache container, deleting the cache data corresponding to the target menu from the cache container, and deleting the Iframe tag corresponding to the target menu from the menu operation page.
[0015] In one embodiment of the present application, the menu operation instruction is executed according to the cache data corresponding to the target menu, including: if the menu operation instruction is a data transfer instruction, the current menu displayed on the menu operation page is obtained; if the current menu is the same as the target menu, the data transfer instruction is executed according to the current menu; if the current menu is different from the target menu, it is determined whether the cache data corresponding to the target menu exists in the cache container; if the cache data corresponding to the target menu exists in the cache container, the cache data corresponding to the target menu is extracted from the cache container; according to the Iframe identifier of the target menu in the cache data, the Iframe tag corresponding to the target menu is extracted, so as to execute the data transfer instruction through the extracted Iframe tag.
[0016] In one embodiment of the present application, the menu operation instruction includes at least the following parts: a protocol type field, used to carry a preset protocol type identifier; a message type field, used to carry a message type, wherein the message type includes a message type corresponding to a menu loading instruction, a message type corresponding to a menu refresh instruction, a message type corresponding to a menu switching instruction, a message type corresponding to a cache deletion instruction, and a message type corresponding to a data transfer instruction; a menu identifier field, used to carry a menu identifier corresponding to the target menu; and a parameter field, used to carry an instruction parameter corresponding to the menu operation instruction.
[0017] The present application discloses a multi-system menu integration device, comprising: an acquisition module, used to acquire a menu operation page corresponding to a main system, wherein the main system is associated with multiple system menus; a cache module, used to establish a cache container corresponding to the menu display page, so as to store cache data corresponding to at least a part of the system menus through the cache container, wherein the menu operation page is used to load the system menu according to the cache data in the cache container; a receiving module, used to receive a menu operation instruction corresponding to a target menu through the menu operation page, wherein the target menu is any system menu; and an execution module, used to execute the menu operation instruction according to the cache data corresponding to the target menu.
[0018] The present application discloses an electronic device, comprising: a processor and a memory; the memory is used to store a computer program, and the processor is used to execute the computer program stored in the memory, so that the electronic device executes the above method.
[0019] Beneficial effects of this application:
[0020] By acquiring a main system associated with multiple system menus, and storing cache data corresponding to at least a portion of the system menus through a cache container, the menu operation page corresponding to the main system loads the system menu according to the cache data, and receives the menu operation instruction corresponding to the target menu through the menu operation page, and executes the menu operation instruction according to the cache data corresponding to the target menu. In this way, multiple system menus are associated with the main system, and cache data corresponding to different system menus are stored through a cache container, so that operations such as loading the system menu and executing the menu operation instruction are implemented based on the cache data in the menu operation interface corresponding to the main system, thereby integrating multiple system menus into the main system through the cache data, solving the problem that the existing rendering method cannot cache the menu data after switching the subsystem, thereby improving the rendering efficiency and improving the user experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] Figure 1 is a flowchart of a multi-system menu integration method in an embodiment of the present invention;
[0022] Figure 2 is a schematic diagram of the structure between a main system and an original system in an embodiment of the present invention;
[0023] Figure 3 It is a structural schematic diagram of a menu operation page in an embodiment of the present invention;
[0024] Figure 4 is a flowchart of another multi-system menu integration method in an embodiment of the present invention;
[0025] Figure 5 is a structural diagram of a multi-system menu integration system in an embodiment of the present invention;
[0026] Figure 6 It is a schematic diagram of the structure of an electronic device in an embodiment of the present invention. DETAILED DESCRIPTION
[0027] The following describes the embodiments of the present invention through specific examples, and those skilled in the art can easily understand other advantages and effects of the present invention from the contents disclosed in this specification. The present invention can also be implemented or applied through other different specific embodiments, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present invention. It should be noted that the following embodiments and sub-samples in the embodiments can be combined with each other without conflict.
[0028] It should be noted that the illustrations provided in the following embodiments are only schematic illustrations of the basic concept of the present invention, and thus the drawings only show components related to the present invention rather than being drawn according to the number, shape and size of components in actual implementation. In actual implementation, the type, quantity and proportion of each component may be changed arbitrarily, and the component layout may also be more complicated.
[0029] In the following description, numerous details are discussed to provide a more thorough explanation of the embodiments of the present invention. However, it is obvious to those skilled in the art that the embodiments of the present invention can be implemented without these specific details. In other embodiments, well-known structures and devices are shown in the form of block diagrams rather than in detail to avoid making the embodiments of the present invention difficult to understand.
[0030] The terms "first", "second", etc. in the specification and claims of the embodiments of the present disclosure and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the terms used in this way can be interchanged where appropriate, so that the embodiments of the embodiments of the present disclosure described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions.
[0031] Unless otherwise stated, the term "plurality" means two or more.
[0032] In the embodiment of the present disclosure, the character " / " indicates that the preceding and following objects are in an "or" relationship. For example, A / B indicates: A or B.
[0033] The term "and / or" is a description of the association relationship between objects, indicating that three relationships can exist. For example, A and / or B means: A or B, or, A and B.
[0034] Combination Figure 1 As shown, the embodiment of the present disclosure provides a multi-system menu integration method, including:
[0035] Step S101, obtaining a menu operation page corresponding to the main system;
[0036] Among them, the main system is associated with multiple system menus;
[0037] Step S102, establishing a cache container corresponding to the menu display page, so as to store cache data corresponding to at least a portion of the system menu through the cache container;
[0038] Among them, the menu operation page is used to load the system menu according to the cache data in the cache container;
[0039] Step S103, receiving a menu operation instruction corresponding to the target menu through the menu operation page;
[0040] Wherein, the target menu is any system menu;
[0041] Step S104: executing the menu operation instruction according to the cache data corresponding to the target menu.
[0042] Through the multi-system menu integration method provided by the embodiment of the present disclosure, by acquiring the main system associated with multiple system menus, and storing the cache data corresponding to at least a part of the system menus through the cache container, the menu operation page corresponding to the main system loads the system menu according to the cache data, and receives the menu operation instruction corresponding to the target menu through the menu operation page, and executes the menu operation instruction according to the cache data corresponding to the target menu. In this way, multiple system menus are associated with the main system, and the cache data corresponding to different system menus are stored through the cache container, so that the menu operation interface corresponding to the main system can load the system menu, execute the menu operation instruction and other operations based on the cache data, thereby integrating multiple system menus into the main system through the cache data, solving the problem that the existing rendering method cannot cache the menu data after switching the subsystem, thereby improving the rendering efficiency and improving the user experience.
[0043] Optionally, obtaining a menu operation page corresponding to the main system includes: obtaining system menus corresponding to one or more original systems; constructing system information corresponding to each original system, wherein the system information includes one or more of a system name, a system identifier, and a system address; constructing original menu information corresponding to each system menu, wherein the original menu information includes a menu name, a menu identifier, a menu address, and a system address corresponding to the system menu; developing a page according to a system display area, a menu display area, and a page display area to obtain a menu operation page, wherein the system display area is used to display each original system, the menu display area is used to display the system menus corresponding to each original system, and the page display area is used to display the menu page after the system menu is loaded.
[0044] In some embodiments, the system information includes the system name (SysName), the system identifier (SysID), and the system address (SysPath); the original menu information includes the menu name (MenuName), the menu identifier (MenuName), the menu address (Path), and the system address (SysPath) corresponding to the system menu.
[0045] In some embodiments, in combination Figure 2 As shown, the system menus corresponding to one or more original systems are obtained, the original systems include system A, system B and system C, the system menu of system A includes menu A_1 and menu A_2, etc., the system menu of system B includes menu B_1 and menu B_2, etc., and the system menu of system C includes menu C_1 and menu C_2, etc., wherein menu A_1, menu B_1 and menu C_1 are independent of each other; pages are developed according to the system menus, and the main system obtained is recorded as main system X, and the system menu of main system X includes menu A_1, menu A_2, menu B_1, menu B_2, menu C_1, menu C_2, etc.
[0046] In some embodiments, the menu operation page is as follows: Figure 3 As shown, the menu operation page includes a system display area, a menu display area and a page display area. The system display area is used to display each original system, the menu display area is used to display the system menu corresponding to each original system, and the page display area is used to display the menu page after the system menu is loaded.
[0047] Optionally, the menu operation instruction includes at least the following parts: a protocol type field, used to carry a preset protocol type identifier; a message type field, used to carry a message type, wherein the message type includes a message type corresponding to a menu loading instruction, a message type corresponding to a menu refresh instruction, a message type corresponding to a menu switching instruction, a message type corresponding to a cache deletion instruction, and a message type corresponding to a data transfer instruction; a menu identification field, used to carry a menu identification corresponding to a target menu; and a parameter field, used to carry instruction parameters corresponding to the menu operation instruction.
[0048] In some embodiments, a communication protocol format shared by the original system and the main system is established; the protocol type field in the communication protocol format is used to carry a preset protocol type identifier, for example, a fixed value WSS is used as the protocol type identifier; the message type field in the communication protocol format is used to carry the message type (Loading) corresponding to the menu loading instruction, the message type (Refresh) corresponding to the menu refresh instruction, the message type (Exchange) corresponding to the menu switching instruction, the message type (Destroy) corresponding to the cache deletion instruction, and the message type (Message) corresponding to the data transfer instruction; the menu identification field is used to carry the system menu ID that needs to be loaded, refreshed, switched, or destroyed, or the ID of the system menu that needs to receive a message; the parameter field is used to carry the data required for loading, refreshing, switching, or destroying the system menu, or the data that needs to be passed to a specified system, wherein multiple instruction parameters are connected by &.
[0049] In some embodiments, the communication protocol format is {protocol type field}: / / {message type field} / {menu identification field}?{parameter field}, and the menu operation instruction generated based on the communication protocol format is WSS: / / loading / 00010?name=zhangsan&age=20; the menu operation instruction is parsed according to the communication protocol format to obtain the message type, menu identification and instruction parameters in the menu operation instruction.
[0050] In some embodiments, a message sending method shared by the original system and the main system is established, including window.postMessage({menu operation instruction},*), where "*" is a fixed value.
[0051] In some embodiments, a message receiving method shared by the original system and the main system is established, including window.addEventListener('Message',{business processing function}).
[0052] In some embodiments, if a corresponding cache container (IframeList) exists for the menu operation page, the cache container is used; if a cache container does not exist for the menu operation page, a cache container is established, and cache data is saved through the cache container. Each set of cache data includes an Iframe identifier and cache menu information (item), wherein each original system has a corresponding Iframe tag, and the Iframe identifier is the Iframe address corresponding to the Iframe tag.
[0053] Optionally, a menu operation instruction is executed according to the cache data corresponding to the target menu, including: if the menu operation instruction is a menu loading instruction, determining whether there is cache data corresponding to the target menu in the cache container; if there is no cache data corresponding to the target menu in the cache container, using the original menu information corresponding to the target menu as the cache menu information, and adding an Iframe tag corresponding to the target system on the menu operation page, obtaining an Iframe identifier corresponding to the Iframe tag, and generating cache data corresponding to the target menu according to the cache menu information and the IFrame identifier, wherein the target system is the original system corresponding to the target menu; if there is cache data corresponding to the target menu in the cache container, extracting the cache data corresponding to the target menu from the cache container; extracting the Iframe tag corresponding to the target menu according to the Iframe identifier of the target menu in the cache data, and configuring the Iframe tag corresponding to the target menu according to the cache menu information of the target menu in the cache data, so as to load the target menu on the menu operation page through the configured Iframe tag.
[0054] In some embodiments, determining whether there is cache data corresponding to a target menu in a cache container includes: matching original menu data (menu) corresponding to the target menu according to a menu identifier corresponding to the target menu; traversing all cache data in the cache container, and performing consistency determination on cached menu data in each cache data according to the original menu data corresponding to the target menu to obtain a consistency determination result, wherein the consistency determination may be for the entire menu data or for a part of the menu data, such as a system address in the menu data; if there is cached menu data consistent with the original menu data, then there is cached data corresponding to the target menu in the cache container; if there is no cached menu data consistent with the original menu data, then there is no cached data corresponding to the target menu in the cache container.
[0055] In some embodiments, the Iframe tag corresponding to the target menu is added to the body tag of the menu operation page.
[0056] In some embodiments, if there is cache data corresponding to the target menu, the Iframe tag corresponding to the target menu is extracted according to the Iframe identifier in the cache data, and the scr attribute of the extracted Iframe tag is set according to the menu address in the cache data to load the page resources corresponding to the target menu; the stacking level attribute (z-index) corresponding to the extracted Iframe tag is set to a first preset value, and the stacking level attributes corresponding to other Iframe tags are set to a second preset value, wherein the first preset value is greater than the second preset value, for example, the first preset value is 10000 and the second preset value is -10000; the target menu is displayed at the top layer of the menu operation page through the extracted Iframe tag.
[0057] Optionally, a menu operation instruction is executed according to the cache data corresponding to the target menu, including: if the menu operation instruction is a menu refresh instruction, determining whether cache data corresponding to the target menu exists in the cache container; if cache data corresponding to the target menu does not exist in the cache container, generating refresh exception information; if cache data corresponding to the target menu exists in the cache container, extracting the cache data corresponding to the target menu from the cache container; extracting the Iframe tag corresponding to the target menu according to the Iframe identifier of the target menu in the cache data, and refreshing the page resources through the Iframe tag corresponding to the target menu.
[0058] In some embodiments, the page of the Iframe tag corresponding to the target menu is refreshed by a preset refresh method, for example, the preset refresh method includes location.reload().
[0059] Optionally, a menu operation instruction is executed according to the cache data corresponding to the target menu, including: if the menu operation instruction is a menu switching instruction, determining whether cache data corresponding to the target menu exists in the cache container; if cache data corresponding to the target menu does not exist in the cache container, generating switching exception information; if cache data corresponding to the target menu exists in the cache container, extracting the cache data corresponding to the target menu from the cache container; extracting the Iframe tag corresponding to the target menu according to the Iframe identifier of the target menu in the cache data, so as to display the target menu on the menu operation page through the extracted Iframe tag.
[0060] In some embodiments, the stacking level attribute (z-index) corresponding to the extracted Iframe tag is set to a first preset value, and the stacking level attributes corresponding to other Iframe tags are set to a second preset value, wherein the first preset value is greater than the second preset value, for example, the first preset value is 10000 and the second preset value is -10000; the target menu is displayed at the top level of the menu operation page through the extracted Iframe tag.
[0061] Optionally, a menu operation instruction is executed according to the cache data corresponding to the target menu, including: if the menu operation instruction is a cache deletion instruction, determining whether cache data corresponding to the target menu exists in the cache container; if cache data corresponding to the target menu exists in the cache container, deleting the cache data corresponding to the target menu from the cache container, and deleting the Iframe tag corresponding to the target menu from the menu operation page.
[0062] In some embodiments, if the cache data corresponding to the target menu does not exist in the cache container, it means that the cache data to be deleted does not exist, and no subsequent operation is performed.
[0063] In some embodiments, the cache data corresponding to the target menu is deleted from the cache container, and the Iframe tag corresponding to the target menu is deleted from the body tag of the browser.
[0064] Optionally, executing menu operation instructions according to cached data corresponding to the target menu includes: if the menu operation instruction is a data transfer instruction, obtaining the current menu displayed on the menu operation page; if the current menu is the same as the target menu, executing the data transfer instruction according to the current menu; if the current menu is different from the target menu, determining whether cached data corresponding to the target menu exists in the cache container; if cached data corresponding to the target menu exists in the cache container, extracting the cached data corresponding to the target menu from the cache container; extracting the Iframe tag corresponding to the target menu according to the Iframe identifier of the target menu in the cache data, so as to execute the data transfer instruction through the extracted Iframe tag.
[0065] In some embodiments, if the cache data corresponding to the target menu does not exist in the cache container, it means that the cache data to be transferred does not exist, and no subsequent operation is performed.
[0066] In some embodiments, if the current menu is the same as the target menu, indicating that the current system is the message recipient, the data transfer instruction is executed according to the current menu; if the current menu is different from the target menu, indicating that the current system is not the message recipient, the message sender is determined from the cache container.
[0067] Combination Figure 4 As shown, the embodiment of the present disclosure provides a multi-system menu integration method, including:
[0068] Step S401, obtaining the menu operation page corresponding to the main system;
[0069] Among them, the main system is identified by topWindow;
[0070] Step S402, establishing a cache container, and deepening the menu label displayed on the menu operation page through the system menu in the cache container;
[0071] Step S403, in response to the menu operation page receiving a user selection instruction corresponding to any original system, establishing system information, menu information, etc. corresponding to the original system;
[0072] Among them, the menu label corresponding to the current menu is deepened, indicating that the current menu is in an activated state and other menus are in an inactivated state;
[0073] Step S404, in response to the menu operation instruction corresponding to the target menu, querying the cache data corresponding to the target menu from the cache container;
[0074] Among them, the menu operation command is sent to the main system through topWindow.postMessage({menu operation command},*);
[0075] The menu loading instruction includes WSS: / / loading / {menu identifier};
[0076] Step S405, determining whether there is cache data corresponding to the target menu in the cache container, if yes, jump to step S406, if no, jump to step S408;
[0077] Step S406, extracting cache data corresponding to the target menu from the cache container;
[0078] Step S407: executing the menu operation instruction according to the cache data corresponding to the target menu.
[0079] Step S408, creating cache data corresponding to the target menu in the cache container, and jumping to step S407.
[0080] Through the multi-system menu integration method provided by the embodiment of the present disclosure, by acquiring the main system associated with multiple system menus, and storing the cache data corresponding to at least a part of the system menus through the cache container, the menu operation page corresponding to the main system loads the system menu according to the cache data, and receives the menu operation instruction corresponding to the target menu through the menu operation page, and executes the menu operation instruction according to the cache data corresponding to the target menu. In this way, multiple system menus are associated with the main system, and the cache data corresponding to different system menus are stored through the cache container, so that the menu operation interface corresponding to the main system can load the system menu, execute the menu operation instruction and other operations based on the cache data, thereby integrating multiple system menus into the main system through the cache data, solving the problem that the existing rendering method cannot cache the menu data after switching the subsystem, thereby improving the rendering efficiency and improving the user experience.
[0081] Combination Figure 5 As shown, the embodiment of the present disclosure provides a multi-system menu integration device, including an acquisition module 501, a cache module 502, a receiving module 503 and an execution module 504.
[0082] The acquisition module 501 is used to acquire a menu operation page corresponding to the main system, wherein the main system is associated with multiple system menus.
[0083] The cache module 502 is used to establish a cache container corresponding to the menu display page to store cache data corresponding to at least a portion of the system menu through the cache container, wherein the menu operation page is used to load the system menu according to the cache data in the cache container.
[0084] The receiving module 503 is used to receive a menu operation instruction corresponding to a target menu through a menu operation page, wherein the target menu is any system menu.
[0085] The execution module 504 is used to execute the menu operation instruction according to the cache data corresponding to the target menu.
[0086] Through the multi-system menu integration device provided by the embodiment of the present disclosure, by acquiring the main system associated with multiple system menus, at least a portion of the cache data corresponding to the system menus is stored through the cache container, so that the menu operation page corresponding to the main system loads the system menu according to the cache data, and receives the menu operation instruction corresponding to the target menu through the menu operation page, and executes the menu operation instruction according to the cache data corresponding to the target menu. In this way, multiple system menus are associated with the main system, and the cache data corresponding to different system menus are stored through the cache container, so that the menu operation interface corresponding to the main system can load the system menu, execute the menu operation instruction and other operations based on the cache data, thereby integrating multiple system menus into the main system through the cache data, solving the problem that the existing rendering method cannot cache the menu data after switching the subsystem, thereby improving the rendering efficiency and improving the user experience.
[0087] An embodiment of the present disclosure further provides an electronic device, including: a processor and a memory; the memory is used to store a computer program, and the processor is used to execute the computer program stored in the memory, so that the electronic device executes the above method.
[0088] Figure 6 The structure diagram of the computer system suitable for implementing the electronic device of the embodiment of the present application is shown. It should be noted that: Figure 6 The computer system 600 of the electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present application.
[0089] like Figure 6 As shown, the computer system 600 includes a central processing unit (CPU) 601, which can perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 602 or the program loaded from the storage part 608 to the random access memory (RAM) 603, such as executing the method in the above embodiment. In the RAM 603, various programs and data required for system operation are also stored. The CPU 601, ROM 602 and RAM 603 are connected to each other through a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.
[0090] The following components are connected to the I / O interface 605: an input section 606 including a keyboard, a mouse, etc.; an output section 607 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 608 including a hard disk, etc.; and a communication section 609 including a network interface card such as a LAN (Local Area Network) card, a modem, etc. The communication section 609 performs communication processing via a network such as the Internet. A drive 610 is also connected to the I / O interface 605 as needed. A removable medium 611, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 610 as needed so that a computer program read therefrom is installed into the storage section 608 as needed.
[0091] The electronic device disclosed in this embodiment includes a processor, a memory, a transceiver and a communication interface. The memory and the communication interface are connected to the processor and the transceiver and complete communication with each other. The memory is used to store computer programs, the communication interface is used to communicate, and the processor and the transceiver are used to run the computer program so that the electronic device executes each step of the above method.
[0092] The above description and accompanying drawings fully illustrate the embodiments of the present disclosure so that those skilled in the art can practice them. Other embodiments may include structural, logical, electrical, process and other changes. The embodiments represent possible changes only. Unless explicitly required, separate components and functions are optional, and the order of operation may vary. Parts and subsamples of some embodiments may be included in or replace parts and subsamples of other embodiments. Moreover, the words used in this application are only used to describe the embodiments and are not used to limit the claims. As used in the description of the embodiments and claims, unless the context clearly indicates, the singular forms of "a", "an" and "the" are intended to include plural forms as well. Similarly, the term "and / or" as used in this application refers to any and all possible combinations of listings containing one or more associated ones. In addition, when used in the present application, the term "comprise" and its variants "comprises" and / or comprising refer to the presence of a stated sub-sample, whole, step, operation, element, and / or component, but do not exclude the presence or addition of one or more other sub-samples, wholes, steps, operations, elements, components and / or groups of these. In the absence of further restrictions, the elements defined by the sentence "comprising a ..." do not exclude the presence of other identical elements in the process, method or device comprising the elements. In this article, each embodiment may focus on the differences from other embodiments, and the same and similar parts between the various embodiments may refer to each other. For the methods, products, etc. disclosed in the embodiments, if they correspond to the method part disclosed in the embodiments, then the relevant parts can refer to the description of the method part.
[0093] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software may depend on the specific application and design constraints of the technical solution. Technicians can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the embodiments of the present disclosure. Technicians can clearly understand that for the convenience and simplicity of description, the specific working process of the above-described system, device and unit can refer to the corresponding process in the aforementioned method embodiment, and will not be repeated here.
[0094] In the embodiments disclosed herein, the disclosed methods and products (including but not limited to devices, equipment, etc.) can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of units can be only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some sub-samples can be ignored or not executed. In addition, the coupling or direct coupling or communication connection between each other shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms. The units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the units may be selected according to actual needs to implement this embodiment. In addition, each functional unit in the embodiment of the present disclosure may be integrated in a processing unit, or each unit may exist physically alone, or two or more units may be integrated in one unit.
[0095] The flowchart and block diagram in the accompanying drawings show the possible architecture, functions and operations of the system, method and computer program product according to the embodiment of the present disclosure. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of the code, and a part of the module, program segment or code contains one or more executable instructions for realizing the specified logical function. In some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, which can depend on the functions involved. In the description corresponding to the flowchart and block diagram in the accompanying drawings, the operations or steps corresponding to different boxes can also occur in a different order from the order disclosed in the description, and sometimes there is no specific order between different operations or steps. For example, two consecutive operations or steps can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, which can depend on the functions involved. Each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, may be implemented by a dedicated hardware-based system that performs the specified functions or actions, or may be implemented by a combination of dedicated hardware and computer instructions.
Claims
1. A multi-system menu integration method, characterized in that: include: Obtaining a menu operation page corresponding to the main system, wherein the main system is associated with multiple system menus; Establishing a cache container corresponding to the menu display page to store cache data corresponding to at least a portion of the system menu through the cache container, wherein the menu operation page is used to load the system menu according to the cache data in the cache container; Receiving a menu operation instruction corresponding to a target menu through the menu operation page, wherein the target menu is any system menu; The menu operation instruction is executed according to the cache data corresponding to the target menu.
2. The method according to claim 1, characterized in that Get the menu operation page corresponding to the main system, including: Get the system menus corresponding to one or more original systems; Constructing system information corresponding to each of the original systems, wherein the system information includes one or more of a system name, a system identifier, and a system address; Constructing original menu information corresponding to each of the system menus, wherein the original menu information includes a menu name, a menu identifier, a menu address, and a system address corresponding to the system menu; Page development is performed according to the system display area, menu display area and page display area to obtain a menu operation page, wherein the system display area is used to display each of the original systems, the menu display area is used to display the system menu corresponding to each of the original systems, and the page display area is used to display the menu page after the system menu is loaded.
3. The method according to claim 2, characterized in that Executing the menu operation instruction according to the cache data corresponding to the target menu includes: If the menu operation instruction is a menu loading instruction, determining whether cache data corresponding to the target menu exists in the cache container; If the cache data corresponding to the target menu does not exist in the cache container, the original menu information corresponding to the target menu is used as the cache menu information, and an Iframe tag corresponding to the target system is added to the menu operation page to obtain an Iframe identifier corresponding to the Iframe tag, so as to generate the cache data corresponding to the target menu according to the cache menu information and the IFrame identifier, wherein the target system is the original system corresponding to the target menu; If the cache data corresponding to the target menu exists in the cache container, extracting the cache data corresponding to the target menu from the cache container; The Iframe tag corresponding to the target menu is extracted according to the Iframe identifier of the target menu in the cache data, and the Iframe tag corresponding to the target menu is configured according to the cache menu information of the target menu in the cache data, so as to load the target menu on the menu operation page through the configured Iframe tag.
4. The method according to claim 2, characterized in that: Executing the menu operation instruction according to the cache data corresponding to the target menu includes: If the menu operation instruction is a menu refresh instruction, determining whether cache data corresponding to the target menu exists in the cache container; If the cache data corresponding to the target menu does not exist in the cache container, generating refresh exception information; If the cache data corresponding to the target menu exists in the cache container, extracting the cache data corresponding to the target menu from the cache container; The Iframe tag corresponding to the target menu is extracted according to the Iframe identifier of the target menu in the cache data, and the page resources are refreshed through the Iframe tag corresponding to the target menu.
5. The method according to claim 2, characterized in that: Executing the menu operation instruction according to the cache data corresponding to the target menu includes: If the menu operation instruction is a menu switching instruction, determining whether cache data corresponding to the target menu exists in the cache container; If the cache data corresponding to the target menu does not exist in the cache container, generating switching abnormal information; If the cache data corresponding to the target menu exists in the cache container, extracting the cache data corresponding to the target menu from the cache container; The Iframe tag corresponding to the target menu is extracted according to the Iframe identifier of the target menu in the cache data, so as to display the target menu on the menu operation page through the extracted Iframe tag.
6. The method according to claim 2, characterized in that Executing the menu operation instruction according to the cache data corresponding to the target menu includes: If the menu operation instruction is a cache deletion instruction, determining whether cache data corresponding to the target menu exists in the cache container; If cache data corresponding to the target menu exists in the cache container, the cache data corresponding to the target menu is deleted from the cache container, and the Iframe tag corresponding to the target menu is deleted from the menu operation page.
7. The method according to claim 2, characterized in that: Executing the menu operation instruction according to the cache data corresponding to the target menu includes: If the menu operation instruction is a data transfer instruction, obtaining the current menu displayed on the menu operation page; If the current menu is the same as the target menu, executing the data transfer instruction according to the current menu; If the current menu is different from the target menu, determining whether cache data corresponding to the target menu exists in the cache container; If the cache data corresponding to the target menu exists in the cache container, extracting the cache data corresponding to the target menu from the cache container; The Iframe tag corresponding to the target menu is extracted according to the Iframe identifier of the target menu in the cache data, so as to execute the data transfer instruction through the extracted Iframe tag.
8. The method according to any one of claims 1 to 7, characterized in that: The menu operation instruction includes at least one of the following: The protocol type field is used to carry the preset protocol type identifier; A message type field is used to carry the message type, wherein the message type includes a message type corresponding to a menu loading instruction, a message type corresponding to a menu refreshing instruction, a message type corresponding to a menu switching instruction, a message type corresponding to a cache deletion instruction, and a message type corresponding to a data transfer instruction; A menu identification field, used to carry the menu identification corresponding to the target menu; The parameter field is used to carry the instruction parameters corresponding to the menu operation instruction.
9. A multi-system menu integration device, characterized in that: include: An acquisition module, used to acquire a menu operation page corresponding to a main system, wherein the main system is associated with a plurality of system menus; A cache module, used to establish a cache container corresponding to the menu display page, so as to store cache data corresponding to at least a part of the system menu through the cache container, wherein the menu operation page is used to load the system menu according to the cache data in the cache container; A receiving module, used for receiving a menu operation instruction corresponding to a target menu through the menu operation page, wherein the target menu is any system menu; The execution module is used to execute the menu operation instruction according to the cache data corresponding to the target menu.
10. An electronic device, characterized in that: include: Processor and memory; The memory is used to store a computer program, and the processor is used to execute the computer program stored in the memory, so that the electronic device executes the method according to any one of claims 1 to 8.
