Interface routing methods, devices, equipment and media
By using routing modules and routing dictionaries, the problem of redundant code in multi-target interface navigation in HTML5 pages is solved, and unified management and efficient code maintenance of application interface navigation are achieved.
Patent Information
- Application Number
- CN202211726021.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-30
- Publication Date
- 2026-03-06
- Estimated Expiration
- 2042-12-30
AI Technical Summary
The problem of generating a large amount of repetitive and redundant code when navigating between multiple target interfaces in an HTML5 page.
The target interface identifier is obtained by the routing module, and the navigation is performed using the registered interface relationship data in the routing dictionary, which reduces the storage and management of redundant code in the application module.
It enables unified management of application interface navigation, reduces the editing and maintenance of redundant code, and improves code maintainability and efficiency.
Smart Images

Figure CN116302243B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of computer technology, and in particular to an interface routing method, apparatus, device, and medium. Background Technology
[0002] As applications (apps) iterate, many pages that were originally implemented natively need to be upgraded / downgraded using the new Hypertext Markup Language (HTML5) pages, or redirected to existing native pages via HTML5 pages. These are essentially hard-coded redirection logics that require constant modification with each version iteration. Furthermore, within HTML5 pages, if there are multiple instances requiring redirection to a target interface, the redirection process needs to be implemented multiple times in code, resulting in a large amount of repetitive and redundant code. Summary of the Invention
[0003] Therefore, it is necessary to provide an interface routing method, device, equipment, and medium to address the aforementioned technical problems and solve the problem of generating a large amount of repetitive and redundant code when navigating between multiple target interfaces in an HTML5 page.
[0004] A user interface routing method, applied to a routing module, the method comprising:
[0005] Receive a routing request sent by the application module that links to the target interface, and obtain the target interface identifier associated with the target interface in the routing request;
[0006] Determine whether the routing dictionary stored in the routing module includes a registered interface identifier that matches the target interface identifier; the routing dictionary includes multiple sets of registered routing relationship data, each set of registered routing relationship data includes a registered interface identifier and a registered interface address associated with the registered interface identifier;
[0007] When it is determined that the routing dictionary includes a registered interface identifier that matches the target interface identifier, the registered interface address associated with the registered interface identifier that matches the target interface identifier is determined as the target interface address;
[0008] Based on the target interface address, redirect to the target interface.
[0009] A UI routing method, applied to an application module, the method comprising:
[0010] Obtain the jump request corresponding to the target interface triggered through the interactive interface of the application module;
[0011] Obtain the target interface identifier corresponding to the target interface based on the jump request;
[0012] A routing request linking to the target interface and containing the target interface identifier is sent to the routing module via an API interface. The routing module then determines, after identifying a registered interface identifier matching the target interface identifier in the routing dictionary, the registered interface address associated with that matching identifier as the target interface address, and redirects the user to the target interface based on that address. The routing dictionary includes multiple sets of registered routing relationship data, each set including a registered interface identifier and a registered interface address associated with that identifier.
[0013] An interface routing device includes a routing module, the routing module comprising:
[0014] The receiving unit is used to receive a routing request sent by the application module that links to the target interface, and to obtain the target interface identifier associated with the target interface in the routing request.
[0015] The judgment unit is used to determine whether the routing dictionary stored in the routing module includes a registered interface identifier that matches the target interface identifier; the routing dictionary includes multiple sets of registered routing relationship data, each set of registered routing relationship data includes a registered interface identifier and a registered interface address associated with the registered interface identifier;
[0016] The determining unit is configured to, when determining that the routing dictionary includes a registered interface identifier that matches the target interface identifier, determine the registered interface address associated with the registered interface identifier that matches the target interface identifier as the target interface address;
[0017] The jump unit is used to jump to the target interface according to the target interface address.
[0018] An interface routing device includes an application module, the application module comprising:
[0019] The first acquisition unit is used to acquire a jump request corresponding to the target interface triggered by the interactive interface of the application module;
[0020] The second acquisition unit is used to acquire the target interface identifier corresponding to the target interface according to the jump request;
[0021] The sending unit is configured to send a routing request linking to the target interface and containing the target interface identifier to the routing module via an API interface. This allows the routing module to determine, after identifying a registered interface identifier matching the target interface identifier in the routing dictionary, the registered interface address associated with the matching identifier to be designated as the target interface address, and then redirect to the target interface based on the target interface address. The routing dictionary includes multiple sets of registered routing relationship data, each set including a registered interface identifier and a registered interface address associated with that identifier.
[0022] A terminal device includes a routing module and an application module. The routing module is used to execute the steps of the interface routing method described above, and the application module is used to execute the steps of the interface routing method described above.
[0023] A computer-readable storage medium storing a computer program, characterized in that the computer program, when executed by a processor, implements the steps of the interface routing method described above.
[0024] In this invention, a target interface identifier associated with the target interface is obtained through a routing module. The target interface address corresponding to the target interface identifier is then determined in the routing dictionary, and the user is redirected to the target interface via this address. In this process, the registered interface identifier and address corresponding to each registered interface (e.g., a target interface contained within a registered interface) of the application running in the application module are first integrated and stored in the routing module as a set of registered routing relationship data. Then, when an application in the application module needs to redirect to the target interface, the corresponding registered interface address is retrieved from the registered routing relationship data in the routing module based on the target interface identifier. The routing module then performs the redirection based on the retrieved registered interface address, ultimately achieving the redirection to the target interface that the application needs to access. This invention reduces the need to edit and store repetitive and redundant code for different redirection interfaces of each application in the application module, and achieves unified management of application interface redirections for all application modules managed by the routing module. Attached Figure Description
[0025] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the description of the embodiments of the present invention will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0026] Figure 1This is a flowchart illustrating the interface routing method in one embodiment of the present invention.
[0027] Figure 2 This is a flowchart illustrating step S120 of the interface routing method in one embodiment of the present invention.
[0028] Figure 3 This is a flowchart illustrating the interface routing method in another embodiment of the present invention.
[0029] Figure 4 This is a flowchart illustrating the interface routing method in another embodiment of the present invention.
[0030] Figure 5 This is a flowchart illustrating the interface routing method in another embodiment of the present invention.
[0031] Figure 6 This is a flowchart illustrating the interface routing method in another embodiment of the present invention.
[0032] Figure 7 This is a schematic diagram of the routing module in one embodiment of the present invention.
[0033] Figure 8 This is a schematic diagram of the application module in one embodiment of the present invention. Detailed Implementation
[0034] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0035] like Figure 1 As shown, in one embodiment, a user interface routing method is provided. This user interface routing method can be applied to applications such as... Figure 7 In the routing module shown, the method includes the following steps S110-S140:
[0036] S110: Receive a routing request from the application module linking to a target interface, and obtain the target interface identifier associated with the target interface in the routing request. Understandably, the routing request includes the target interface identifier associated with the target interface. The routing request can be generated and sent to the routing module after a screen jump button in a certain interface (e.g., the initial interface before navigation) of the application managed by the application module is triggered. Upon receiving the routing request, the routing module will directly navigate to the target interface based on the target interface identifier associated with the target interface in the routing request, without requiring the application itself to perform the navigation action. Further, the routing module receives the routing request sent by the application module through an API (Application Program Interface). The target interface is the page that needs to be switched and navigated to after triggering the screen jump button in a certain initial interface of the APP on the application module. The routing request includes the target interface identifier associated with the target interface. The target interface identifier can be the Uniform Resource Locator (URL) corresponding to the target interface.
[0037] S120, determine whether the routing dictionary stored in the routing module includes a registered interface identifier that matches the target interface identifier; the routing dictionary includes multiple sets of registered routing relationship data, each set of registered routing relationship data including a registered interface identifier and a registered interface address associated with the registered interface identifier. Understandably, the registered routing relationship data refers to the registered interface identifier and the registered interface address associated with the registered interface identifier that are already stored in the routing dictionary in a preset format. For example, in the routing dictionary stored in a preset format, the registered interface identifier is stored as a dictionary index, and the registered interface address is the retrieval content that can be found in the routing dictionary according to the dictionary index. Alternatively, the routing dictionary can be a dictionary with a hash data structure, such as a Key-Value structure dictionary, where the Key and Value are related, the Key being the registered interface identifier and the Value being the registered interface address. The routing module pre-stores the routing dictionary. When the routing module receives a registered interface identifier, it can query the corresponding registered interface address through the registered interface identifier and enter the corresponding interface through the registered interface address.
[0038] like Figure 2As shown, in one embodiment, step S120, determining whether the routing dictionary stored in the routing module includes a registered interface identifier that matches the target interface identifier, includes steps S121-S123:
[0039] S121, query the routing dictionary to see if there is a registered interface identifier that matches the target interface identifier. Understandably, the routing dictionary can be a dictionary of hash data structures, such as a Key-Value dictionary, where the Key and Value are related, with the Key being the registered interface identifier and the Value being the registered interface address.
[0040] S122, if no registered interface identifier matching the target interface identifier exists, confirm that the routing dictionary does not contain a registered interface identifier matching the target interface identifier. It can be understood that if the routing dictionary does not contain a registered interface identifier matching the target interface identifier, it means that the target interface identifier has not yet been registered as registered routing relationship data and stored in the routing dictionary, and the routing module cannot query the corresponding target interface address through the target interface identifier.
[0041] S123, if a registered interface identifier matching the target interface identifier exists, confirm that the routing dictionary includes a registered interface identifier matching the target interface identifier. It can be understood that if the routing dictionary contains a registered interface identifier matching the target interface identifier, it means that the target interface identifier has been registered as registered routing relationship data and stored in the routing dictionary, and the routing module can query the corresponding target interface address through the target interface identifier.
[0042] S130: When it is determined that the routing dictionary includes a registered interface identifier that matches the target interface identifier, the registered interface address associated with the registered interface identifier that matches the target interface identifier is determined as the target interface address. It can be understood that if the routing dictionary includes a registered interface identifier that matches the target interface identifier, it means that the target interface identifier has been registered as registered routing relationship data and stored in the routing dictionary. In this case, the routing module can query the corresponding target interface address in the routing dictionary through the target interface identifier and proceed to step S140.
[0043] S140, based on the target interface address, redirect to the target interface. It can be understood that the target interface address is the actual routing address required to redirect to the target interface. The routing module can redirect to the target interface (i.e., the final interface the user needs to access) based on the target interface address.
[0044] The interface routing method provided by this invention obtains the target interface identifier associated with the target interface through a routing module, determines the target interface address corresponding to the target interface identifier in the routing dictionary based on the target interface identifier, and then jumps to the target interface through the target interface address. In this process, firstly, the registered interface identifier and registered interface address corresponding to each registered interface (e.g., the target interface contained within a registered interface) of the application running the application module are integrated and stored as a set of registered routing relationship data in the routing module. Then, when an application in the application module needs to jump to the target interface, the corresponding registered interface address is obtained by querying the registered routing relationship data in the routing module based on the target interface identifier. The routing module then performs the jump based on the retrieved registered interface address, thus achieving the final jump to the target interface that the application needs to jump to. This invention reduces the need to edit and store repetitive and redundant code for different jump interfaces of each application in the application module, and realizes unified management of application interface jumps managed by all application modules through the routing module.
[0045] like Figure 3 As shown, in one embodiment, before receiving the routing request linking to the target interface sent by the application module in step S110, the method further includes:
[0046] S150: Receive a route registration request sent by the application module and obtain the registered route relationship data corresponding to the registered interface from the route registration request. Understandably, the routing module receives the route registration request sent by the application module through an API interface. Any interface in the initial interface of the application managed by the application module can obtain its corresponding registered interface address, which is the actual route address of the interface in the current memory, through instantiation. Then, a custom address is assigned to this registered interface address, which is the registered interface identifier corresponding to that address. The above process is the registration process of the interface in the application module. The interface after registration is a registered interface, and the registered route relationship data corresponding to the registered interface is the aforementioned registered interface address and its corresponding registered interface identifier. After registering the interface in the application module, the aforementioned registered route relationship data can be sent to the routing module to store it in the routing dictionary.
[0047] S160, the registered routing relationship data is stored in the routing dictionary of the routing module according to a preset format. It is understood that the preset format includes, but is not limited to, hash data structure formats, such as Key-Value data structures, where the Key and Value are interrelated, with the Key being the registered interface identifier and the Value being the registered interface address. In another embodiment, in the routing dictionary stored in the preset format, the registered interface identifier is stored as a dictionary index, and the registered interface address is the retrieval content that can be found in the routing dictionary based on the dictionary index. In this embodiment, by storing all the registered routing relationship data in the routing dictionary of the routing module, the integration of all registered routing relationship data related to interface navigation is achieved through the routing module.
[0048] like Figure 4 As shown, in one embodiment, after determining whether the routing dictionary stored in the routing module includes a registered interface identifier that matches the target interface identifier in step S120, the method further includes:
[0049] S170, if it is determined that the routing dictionary does not contain a registered interface identifier matching the target interface identifier, a target interface redirection failure message is sent to the application module. It can be understood that if the routing dictionary does not contain a registered interface identifier matching the target interface identifier, it means that the target interface identifier has not yet been registered as registered routing relationship data and stored in the routing dictionary. The routing module cannot query the corresponding target interface address through the target interface identifier. Therefore, a target interface redirection failure message is sent to the application module to remind the user that the redirection failed.
[0050] like Figure 5 As shown, in one embodiment, an interface routing method is also provided. The interface routing method provided in this embodiment can be applied to applications such as... Figure 8 In the application module shown, the method includes:
[0051] S210: Obtain a jump request corresponding to the target interface triggered by the interactive interface of the application module. Understandably, the application module can be an application module set up in the terminal device for managing applications. The interactive interface can be the jump interface of the application displayed on the terminal device's display screen. The jump request can be automatically generated when the interface jump button displayed in the interactive interface is triggered, and after the application module receives the jump request, it will proceed to the subsequent step S220 to determine the target interface identifier corresponding to the target interface requested in the jump request, and then generate a routing request based on the target interface identifier and send it to the routing module.
[0052] S220, obtain the target interface identifier corresponding to the target interface according to the redirection request. It can be understood that the redirection request includes the target interface identifier corresponding to the target interface; therefore, the routing module can obtain the target interface identifier corresponding to the target interface through the redirection request.
[0053] S230: A routing request linking to the target interface and containing the target interface identifier is sent to the routing module via an API interface. The routing module, after determining that the routing dictionary includes a registered interface identifier matching the target interface identifier, identifies the registered interface address associated with the matched identifier as the target interface address and redirects to the target interface based on that address. The routing dictionary includes multiple sets of registered routing relationship data, each set including a registered interface identifier and a registered interface address associated with that identifier. Understandably, the routing request includes the target interface identifier.
[0054] like Figure 6 As shown, in one embodiment, before step S230, which involves sending a routing request linking to the target interface and containing the target interface identifier to the routing module via the API interface, the method further includes:
[0055] S240, obtain the registered routing relationship data corresponding to the currently configured and stored registered interfaces. The registered routing relationship data includes the registered interface address and a registered interface identifier generated according to preset rules corresponding to the registered interface address. It can be understood that the currently configured and stored registered interfaces have corresponding registered interface addresses. The application module generates a registered interface identifier corresponding to the registered interface address based on the routing address and / or routing identifier. The registered interface identifier and the registered interface address are mutually associated. The registered interface address is also the actual routing address of the registered interface, and the registered interface identifier is also the URL corresponding to the registered interface. The registered routing relationship data can be hash-type relationship data, such as Key-Value relationship data, where the Key and Value are mutually associated, with the Key being the registered interface identifier and the Value being the registered interface address.
[0056] Understandably, any interface in the initial interface of the application managed by the application module can obtain its corresponding registered interface address, which is also the actual routing address of the interface in the current memory, through instantiation. Then, a custom address is assigned to this registered interface address, which is the registered interface identifier corresponding to that address. This process constitutes the registration process of the interface in the application module. The interface after registration is a registered interface, and the registered routing relationship data corresponding to the registered interface is the aforementioned registered interface address and its corresponding registered interface identifier.
[0057] S250, a route registration request containing the registered route relationship data is sent to the routing module, so that the routing module stores the received registered route relationship data in its routing dictionary according to a preset format. Understandably, the routing dictionary includes at least one set of registered route relationship data, each set including a registered interface identifier and a registered interface address associated with the registered interface identifier. The preset format includes, but is not limited to, a hash data structure format, such as a Key-Value data structure, where the Key and Value are mutually associated, with the Key being the registered interface identifier and the Value being the registered interface address. Understandably, if the target interface in the above embodiments of the present invention is one of the registered interfaces, its corresponding target interface identifier will be stored as part of the registered route relationship data and associated with its corresponding registered interface identifier in the routing dictionary of the routing module. In this case, a registered interface identifier consistent with the target interface identifier can be found in the routing dictionary. Otherwise, if the target interface is not a registered interface, the routing dictionary will not store the corresponding registered route relationship data. In this case, the routing dictionary will not be able to find a registered interface identifier that matches the target interface identifier.
[0058] It should be understood that the sequence number of each step in the above embodiments does not imply the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present invention.
[0059] like Figure 7 As shown, in one embodiment, an interface routing device is also provided, including a routing module, the routing module comprising:
[0060] The receiving unit 11 is used to receive a routing request sent by the application module that links to the target interface, and to obtain the target interface identifier associated with the target interface in the routing request.
[0061] The judgment unit 12 is used to determine whether the routing dictionary stored in the routing module includes a registered interface identifier that matches the target interface identifier; the routing dictionary includes multiple sets of registered routing relationship data, and each set of registered routing relationship data includes a registered interface identifier and a registered interface address associated with the registered interface identifier;
[0062] The determining unit 13 is used to determine the registered interface address associated with the registered interface address that matches the target interface address when it is determined that the routing dictionary includes a registered interface address that matches the target interface address;
[0063] The jump unit 14 is used to jump to the target interface according to the target interface address.
[0064] The execution functions of this routing module correspond one-to-one with the interface routing methods in the above embodiments. Specific limitations of the routing module can be found in the limitations of the interface routing methods above, and will not be repeated here. Each unit in the above routing module can be implemented entirely or partially through software, hardware, or a combination thereof. Each unit can be embedded in or independent of the processor in the computer device in hardware form, or stored in the memory of the computer device in software form, so that the processor can call and execute the operations corresponding to each unit.
[0065] like Figure 8 As shown, in one embodiment, an interface routing device is also provided, including an application module, the application module comprising:
[0066] The first acquisition unit 21 is used to acquire a jump request corresponding to the target interface triggered by the interactive interface of the application module;
[0067] The second acquisition unit 22 is used to acquire the target interface identifier corresponding to the target interface according to the jump request;
[0068] The sending unit 23 is configured to send a routing request linking to the target interface and containing the target interface identifier to the routing module via an API interface. This allows the routing module to determine, after identifying a registered interface identifier matching the target interface identifier in the routing dictionary, the registered interface address associated with the registered interface identifier matching the target interface identifier as the target interface address, and to redirect to the target interface based on the target interface address. The routing dictionary includes multiple sets of registered routing relationship data, each set including a registered interface identifier and a registered interface address associated with that identifier.
[0069] The execution functions of this application module correspond one-to-one with the interface routing methods in the above embodiments. Specific limitations of the application module can be found in the limitations of the interface routing methods described above, and will not be repeated here. Each unit in the above application module can be implemented entirely or partially through software, hardware, or a combination thereof. Each unit can be embedded in or independent of the processor in the computer device in hardware form, or stored in the memory of the computer device in software form, so that the processor can call and execute the operations corresponding to each unit.
[0070] In one embodiment, a terminal device is also provided, including a routing module and an application module. The routing module is used to execute the steps of the interface routing method described above, and the application module is used to execute the steps of the interface routing method described above.
[0071] In one embodiment, a computer-readable storage medium is also provided, which stores a computer program that, when executed by a processor, implements the steps of the interface routing method described above.
[0072] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by instructing related hardware with computer-readable instructions. These computer-readable instructions can be stored in a non-volatile readable storage medium or a volatile readable storage medium. When executed, these computer-readable instructions can include the processes of the embodiments of the above methods. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), RAMbus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
[0073] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is used as an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the system can be divided into different functional units or modules to complete all or part of the functions described above.
[0074] The above-described embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be included within the protection scope of the present invention.
Claims
1. An interface routing method, characterized by, The method is applied to a routing module, and comprises the following steps: receiving a routing request for linking to a target interface sent by an application module, and obtaining a target interface identifier associated with the target interface in the routing request; determining whether a registered interface identifier matching the target interface identifier is included in a routing dictionary stored in the routing module; the routing dictionary includes a plurality of sets of registered routing relationship data, and each set of registered routing relationship data includes a registered interface identifier and a registered interface address associated with the registered interface identifier; when it is determined that the registered interface identifier matching the target interface identifier is included in the routing dictionary, determining a registered interface address associated with the registered interface identifier matching the target interface identifier as a target interface address; jumping to the target interface according to the target interface address; the determining whether the registered interface identifier matching the target interface identifier is included in the routing dictionary stored in the routing module comprises the following steps: inquiring whether a registered interface identifier consistent with the target interface identifier exists in the routing dictionary; when the registered interface identifier consistent with the target interface identifier does not exist, confirming that the registered interface identifier matching the target interface identifier is not included in the routing dictionary; when the registered interface identifier consistent with the target interface identifier exists, confirming that the registered interface identifier matching the target interface identifier is included in the routing dictionary.
2. The inter-facility routing method of claim 1, wherein, before the receiving the routing request for linking to a target interface sent by an application module, the method further comprises the following steps: receiving a routing registration request sent by an application module, and obtaining registered routing relationship data corresponding to a registered interface in the routing registration request; storing the registered routing relationship data in a routing dictionary of the routing module according to a preset format.
3. The inter-facility routing method of claim 1, wherein, after the determining whether the registered interface identifier matching the target interface identifier is included in the routing dictionary stored in the routing module, the method further comprises the following steps: when it is determined that the registered interface identifier matching the target interface identifier is not included in the routing dictionary, sending target interface jump failure information to the application module.
4. A terminal device, characterized by comprising: a routing module is included, and the routing module is used for executing steps of the interface routing method in any one of claims 1 to 3.
5. A computer-readable storage medium storing a computer program, the computer program comprising instructions that, when executed by a computer, cause the computer to perform the method of any one of claims 1 to 4. the computer program is executed by a processor to realize steps of the interface routing method in any one of claims 1 to 3.
Citation Information
Patent Citations
Page routing document generation method and device, computer device and storage medium
CN110308900A
Page navigation method, device and readable storage medium
CN113778720A