Page routing method, apparatus, device, medium, and program product
Patent Information
- Application Number
- CN202510352744.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-24
- Publication Date
- 2026-09-25
AI Technical Summary
[0005]本公开的目的在于提供一种页面路由方法、装置、设备、介质及程序产品,至少在一定程度上解决现有技术中页面显示异常时,只能显示错误页面或错误提示,浪费流量,无法正常的提供服务的问题
[0052]根据本公开的再一个方面,还提供了一种计算机程序产品或计算机程序,该计算机程序产品或计算机程序包括计算机指令,该计算机指令存储在计算机可读存储介质中。计算机设备的处理器从计算机可读存储介质读取该计算机指令,处理器执行该计算机指令,使得该计算机设备执行上述第一方面中的方法。
Smart Images

Figure CN122817575A_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of computer technology, and in particular to a page routing method, apparatus, device, medium, and program product. Background Technology
[0002] When a terminal page displays content, it relies on the normal return of data from the server-side business data service interface, as well as the normal execution and processing of some scripting languages on the front end of the page. In particular, in some applications, there is additional risk control management when accessing the server to obtain the corresponding page display content, such as the risk control management of mini-programs and mini-program pages. Only when all of the above-mentioned links are normal can the front end render and display the page normally.
[0003] In related technologies, when a page displays abnormally due to an anomaly in one of the aforementioned steps, only an error page or error message can be displayed, which not only wastes bandwidth but also prevents the normal provision of services.
[0004] It should be noted that the information disclosed in the background section above is only used to enhance the understanding of the background of this disclosure, and therefore may include information that does not constitute prior art known to those skilled in the art. Summary of the Invention
[0005] The purpose of this disclosure is to provide a page routing method, apparatus, device, medium, and program product, which at least to some extent solves the problem in the prior art that when a page is displayed abnormally, only an error page or error message can be displayed, wasting bandwidth and failing to provide normal service.
[0006] Other features and advantages of this disclosure will become apparent from the following detailed description, or may be learned in part from practice of this disclosure.
[0007] According to a first aspect of this disclosure, a page routing method is provided for use on a server, the method comprising:
[0008] Based on the page request, route to the first page;
[0009] If the first page of the route is abnormal, retrieve the preset parameters from the page request;
[0010] Map preset route configurations based on preset parameters;
[0011] According to the preset routing configuration, the second page is routed so that the terminal device can obtain and render the second page and display it on the user interface; the content of the second page is the same as that of the first page.
[0012] In one possible embodiment, routing the second page according to a preset routing configuration includes:
[0013] Determine whether the first application to which the first page belongs is a mini-program;
[0014] If not, retrieve the routing information for the second page from the preset routing configuration and route the second page;
[0015] If so, then determine if the first application in the routing table is abnormal;
[0016] If not, then based on the first route configuration information corresponding to the first application, route to the first application, and obtain the route information of the second page in the preset route configuration, and route the second page.
[0017] In one possible embodiment, the method further includes:
[0018] If the primary application in the route fails, retrieve the main information of the backup mini-program from the preset route configuration;
[0019] Based on the main information of the backup mini-program, determine the configuration information of the second route corresponding to the backup mini-program;
[0020] Based on the second route configuration information, a backup route mini-program is available.
[0021] In one possible embodiment, obtaining the main information of the backup mini-program in the preset route configuration includes:
[0022] If the page request does not include the main information of the first application's mini-program and does not include the channel code, then obtain the main information of the backup mini-program; the channel code is used to indicate the channel corresponding to the resource slot where the mini-program is located; or,
[0023] If the main information of the first application's mini-program is not in the main information supervision pool, then obtain the main information of the backup mini-program; or,
[0024] If the channel code of the first application is not in the channel code supervision pool, then obtain the main information of the backup mini program.
[0025] In one possible embodiment, the method further includes:
[0026] If the routing of the second page fails, a routing error message is returned so that the terminal device can route the third page from its local cache and display it in the user interface.
[0027] In one possible embodiment, the method further includes:
[0028] A three-layer caching mechanism is used to cache the second page, third page, and backup mini-program in the preset route configuration, as well as the corresponding route configuration information. The three-layer caching mechanism includes: Redis caching, local caching, and CDN caching.
[0029] According to another aspect of this disclosure, a page routing method is provided, applied to a terminal device, the method comprising:
[0030] In response to user input in the user interface, a page request is sent so that the server can route the first page according to the page request. If the routing of the first page is abnormal, the preset parameters in the page request are obtained, the preset route configuration is mapped based on the preset parameters, and the second page is routed according to the preset route configuration.
[0031] Retrieve and render the second page, displaying it on the user interface; the content of the second page is the same as that of the first page.
[0032] In one possible embodiment, the method further includes:
[0033] Receive routing failure message; the routing failure message is sent after the server fails to route to the second page;
[0034] The third-party page is routed in the local cache through the front-end routing media component and displayed on the user interface.
[0035] In one possible embodiment, the method further includes:
[0036] If rendering the second page fails, the third page is routed from the local cache and displayed in the user interface.
[0037] According to another aspect of this disclosure, a page routing apparatus is provided, comprising:
[0038] The receiving unit is used to route the first page based on the page request;
[0039] The first acquisition unit is used to acquire preset parameters in the page request if the first page of the route is abnormal;
[0040] The second acquisition unit is used to map a preset route configuration based on preset parameters;
[0041] The routing unit is used to route the second page according to the preset routing configuration, so that the terminal device can obtain and render the second page and display it on the user interface; the content of the second page is the same as that of the first page.
[0042] In one possible embodiment, the routing unit is further configured to return a routing error message if routing the second page fails, so that the terminal device routes the third page in the local cache and displays it on the user interface.
[0043] In one possible embodiment, the page routing device further includes:
[0044] The caching unit is used to cache the second page, third page, and backup mini-program in the preset route configuration, as well as the corresponding route configuration information, through a three-layer caching mechanism. The three-layer caching mechanism includes: Redis caching, local caching, and CDN caching.
[0045] According to another aspect of this disclosure, a page routing apparatus is provided, comprising:
[0046] The sending unit is used to respond to the user's input operation in the user interface and send a page request so that the server can route the first page according to the page request. If the routing of the first page is abnormal, the preset parameters in the page request are obtained, the preset route configuration is mapped based on the preset parameters, and the second page is routed according to the preset route configuration.
[0047] The display unit is used to acquire and render the second page, which is then displayed on the user interface; the content of the second page is the same as that of the first page.
[0048] In one possible embodiment, the display unit is further configured to receive a routing failure message; the routing failure message is issued after the server fails to route the second page; the third page is routed in the local cache through the front-end routing media component and displayed on the user interface.
[0049] In one possible embodiment, the display unit is further configured to route a third page from the local cache and display it on the user interface if rendering the second page fails.
[0050] According to another aspect of this disclosure, an electronic device is provided, comprising: a processor; and a memory for storing executable instructions of the processor; wherein the processor is configured to perform the method of any one of the first aspects by executing the executable instructions.
[0051] According to another aspect of this disclosure, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the method of any one of the first aspects.
[0052] According to another aspect of this disclosure, a computer program product or computer program is also provided, comprising computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the method described in the first aspect above.
[0053] This disclosure provides a page routing method, apparatus, device, medium, and program product, relating to the field of computer technology. The method includes: routing a first page according to a page request; if routing the first page fails, obtaining a preset routing configuration corresponding to preset parameters in the page request; and routing a second page according to the preset routing configuration, so that a terminal device obtains and renders the second page, displaying it on the user interface; the content of the second page is the same as the first page. By adding preset parameters to the page request, a new routing method is triggered when routing the first page fails, ensuring that the terminal's user interface can display the page normally, without wasting bandwidth, enabling the server to provide normal service capabilities, ensuring service connectivity and integrity, and the entire process is imperceptible to the user, thereby improving the user experience.
[0054] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit this disclosure. Attached Figure Description
[0055] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this disclosure and, together with the description, serve to explain the principles of this disclosure. It is obvious that the drawings described below are merely some embodiments of this disclosure, and those skilled in the art can obtain other drawings based on these drawings without any inventive effort.
[0056] Figure 1 This diagram illustrates an exemplary application system architecture for a page routing method according to an embodiment of the present disclosure.
[0057] Figure 2 This diagram illustrates a page routing method according to an embodiment of the present disclosure.
[0058] Figure 3 This diagram illustrates a flowchart of a routing method for a second page according to an embodiment of the present disclosure;
[0059] Figure 4 This diagram illustrates a flowchart of a routing backup applet in an embodiment of the present disclosure;
[0060] Figure 5 This diagram illustrates a flowchart of determining routing configuration information according to an embodiment of the present disclosure;
[0061] Figure 6 A flowchart illustrating another page routing method in an embodiment of this disclosure is shown;
[0062] Figure 7 This diagram illustrates the structure of a page routing device according to an embodiment of the present disclosure.
[0063] Figure 8This diagram illustrates the structure of another page routing device in an embodiment of the present disclosure.
[0064] Figure 9 A schematic diagram of the structure of an electronic device according to an embodiment of the present disclosure is shown. Detailed Implementation
[0065] Exemplary embodiments will now be described more fully with reference to the accompanying drawings. However, these exemplary embodiments can be implemented in many forms and should not be construed as limited to the examples set forth herein; rather, they are provided so that this disclosure will be more comprehensive and complete, and will fully convey the concept of the exemplary embodiments to those skilled in the art. The described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments.
[0066] Furthermore, the accompanying drawings are merely illustrative of this disclosure and are not necessarily drawn to scale. The same reference numerals in the drawings denote the same or similar parts, and therefore repeated descriptions of them will be omitted. Some block diagrams shown in the drawings are functional entities and do not necessarily correspond to physically or logically independent entities. These functional entities may be implemented in software, in one or more hardware modules or integrated circuits, or in different network and / or processor devices and / or microcontroller devices.
[0067] When a terminal page displays content, it relies on the normal return of data from the server-side business data service interface, as well as the normal execution and processing of some scripting languages on the front end of the page. In particular, in some applications, there is additional risk control management when accessing the server to obtain the corresponding page display content, such as the risk control management of mini-programs and mini-program pages. Only when all of the above-mentioned links are normal can the front end render and display the page normally.
[0068] In related technologies, due to an anomaly in one of the aforementioned multiple processes, existing technologies currently only provide targeted general anomaly handling when an anomaly occurs in a specific process. As a result, when the page displays abnormally, only an error page or error message can be displayed, which not only wastes user and business marketing traffic, but also fails to provide normal service.
[0069] This disclosure provides a page routing method, apparatus, device, medium, and program product. The method includes: routing a first page according to a page request; if routing the first page fails, obtaining a preset routing configuration corresponding to preset parameters in the page request; and routing a second page according to the preset routing configuration, so that a terminal device obtains and renders the second page and displays it on the user interface; the content of the second page is the same as that of the first page. By adding preset parameters to the page request, a new routing method is triggered when routing the first page fails, ensuring that the terminal's user interface can display the page normally, without wasting bandwidth, enabling the server to provide normal service capabilities, ensuring service connectivity and integrity, and the entire process is imperceptible to the user, thereby improving the user experience.
[0070] Figure 1 A schematic diagram of an exemplary application system architecture to which a page routing method according to embodiments of this disclosure can be applied is shown. For example... Figure 1 As shown, the system architecture may include terminal device 101, network 102 and server 103.
[0071] Network 102 is a medium used to provide a communication link between terminal device 101 and server 103, and can be a wired network or a wireless network.
[0072] Optionally, the aforementioned wireless or wired networks use standard communication technologies and / or protocols. The network is typically the Internet, but can also be any network, including but not limited to Local Area Networks (LANs), Metropolitan Area Networks (MANs), Wide Area Networks (WANs), mobile, wired or wireless networks, private networks, or any combination of virtual private networks. In some embodiments, technologies and / or formats including Hyper Text Markup Language (HTML), Extensible Markup Language (XML), etc., are used to represent data exchanged over the network. Furthermore, conventional encryption technologies such as Secure Socket Layer (SSL), Transport Layer Security (TLS), Virtual Private Networks (VPNs), and Internet Protocol Security (IPSec) can be used to encrypt all or some links. In other embodiments, custom and / or dedicated data communication technologies can be used to replace or supplement the aforementioned data communication technologies.
[0073] Terminal device 101 can be various electronic devices, including but not limited to smartphones, tablets, laptops, desktop computers, smart speakers, smartwatches, wearable devices, augmented reality devices, virtual reality devices, etc.
[0074] Optionally, the client of the application installed on different terminal devices 101 may be the same, or the client of the same type of application based on different operating systems. Depending on the terminal platform, the specific form of the application client may also be different; for example, the application client may be a mobile client, a PC client, etc.
[0075] Server 103 can be a server that provides various services, such as a backend management server that supports the device operated by the user using terminal device 101. The backend management server can analyze and process received requests and other data, and feed the processing results back to the terminal device.
[0076] Optionally, the server can be a standalone physical server, a server cluster or distributed system consisting of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms.
[0077] Those skilled in the art will know that Figure 1 The number of terminal devices, networks, and servers shown is merely illustrative; any number of terminal devices, networks, and servers can be included depending on actual needs. This disclosure does not limit the scope of the embodiments.
[0078] This disclosure describes the method through the following embodiments.
[0079] Figure 2 This diagram illustrates a page routing method according to an embodiment of the present disclosure, applied to a server, such as... Figure 2 As shown, the steps include:
[0080] S202: Based on the page request, route the first page.
[0081] In one possible embodiment, a page request may include a page identifier (ID), which is used to represent the ID of a specific page, is globally unique, and identifies a unique page parameter of the current front-end page request.
[0082] The page can be of various types, such as H5 page, native page, hybrid page, etc., and no limitation is made in this disclosure.
[0083] The page request for the first page can be triggered in various ways, such as at least one of the following: page display, page hiding, page unloading, pull-to-refresh, etc.
[0084] S204: If the first page of the route is abnormal, retrieve the preset parameters from the page request.
[0085] The methods for obtaining the first page of the route exception can include: obtaining exception information by the server-side autonomous listening, and / or, the front-end media service component can capture the page exception, and after capturing the page exception, send the exception message to the server, and the server obtains the event of the route to the first page exception.
[0086] S206: Map preset route configurations based on preset parameters.
[0087] In one possible implementation, the preset parameter can be a special parameter key in the page request parameters. The preset parameter can be added to the original request parameters of the first page in various ways, such as direct concatenation or using a hash value.
[0088] In the event of an error on the first page of the route, if the preset parameters are obtained, it indicates that the issue can be handled using the preset route configuration corresponding to those parameters. If the preset parameters are not obtained, the server will send a normal response to the front end.
[0089] Pre-configured routes can be configured in advance through the routing medium. The routing medium configuration is mainly to meet the different routing rules configured for different pages and different channels when the business is handling abnormal routes, and to provide a query service for the corresponding configuration information.
[0090] S208: According to the preset routing configuration, route the second page so that the terminal device can obtain and render the second page and display it on the user interface. The content of the second page is the same as that of the first page.
[0091] The method disclosed herein can be applied to scenarios where business marketing campaign display pages are needed. For example, in a business marketing scenario where a first page needs to be displayed, the method disclosed herein can display the same business marketing campaign to the user.
[0092] It should be noted that the second page can be freely configured to have the same content as the first page.
[0093] By employing the above method, in scenarios where an anomaly occurs when the front-end sends a page request to the routing page, the server can route the request to a new, identical page and provide feedback. This addresses the current issue where the front-end can only display "system busy," a blank page, an error, or a page error message. By adding preset parameters to the page request, a new routing method is triggered when the first page encounters an anomaly, ensuring the terminal's user interface can display the page normally, avoiding wasted bandwidth, enabling the server to provide normal service capabilities, and guaranteeing service connectivity and integrity. Furthermore, the entire process is seamless for the user, thus improving the user experience. Additionally, mapping preset route configurations with preset parameters enhances security; even if external parties obtain the preset parameters but do not have the complete configuration mapping, it will not cause leakage of configuration paths for other pages.
[0094] Furthermore, besides the pages that can be directly displayed, there are other situations where there are unexpected exceptions during the routing process. For example, the normal display of a page in a mini-program depends not only on the normal routing and display of the page, but also on whether the mini-program itself is normal and whether the page's risk control is normal. Only when the mini-program is free of exceptions can the page content be routed normally and the front-end be displayed normally.
[0095] Currently, when an exception occurs in a single stage of a mini-program, only targeted exception handling is performed. It does not have the capability to handle exceptions from the front-end and back-end as a whole, step by step, and automatically degrade or route them to other normal pages or services.
[0096] In one possible implementation, if the first page of the route is abnormal, there are several possibilities: (1) the first page may be inaccessible, or (2) the first page may be a page within a mini-program, which may be inaccessible. Therefore, the routing strategy of handling each step and automatically degrading in the preset routing configuration can be implemented.
[0097] Figure 3 A flowchart illustrating a routing second page according to an embodiment of this disclosure is shown, such as... Figure 3 As shown, it includes the following steps:
[0098] S302: Determine whether the first application to which the first page belongs is a mini-program; if not, execute S304; if yes, execute S306.
[0099] S304: Retrieve the routing information for the second page in the preset routing configuration, and route the second page.
[0100] S306: Determine if the first application of the route is abnormal; if not, execute S308.
[0101] S308: Based on the first routing configuration information corresponding to the first application, route to the first application, and obtain the routing information of the second page in the preset routing configuration, and route the second page.
[0102] For example, after the first page routing fails, the mechanism for handling the failed routing can directly route to the second page based on the routing information for the second page in the preset routing configuration for the first application that is not a mini-program.
[0103] For example, for the page routing of the first application of the mini-program type, it can first be determined whether there is a problem with the mini-program. If there is no problem and the mini-program can be opened normally, then the routing abnormality of the first page is only a page routing abnormality. Then the first application can be routed, and the second page can be routed based on the first application.
[0104] In one possible embodiment, Figure 4 A flowchart of a routing backup applet according to an embodiment of this disclosure is shown, such as... Figure 4 As shown, it includes the following steps:
[0105] S402: If routing to the first application fails, retrieve the main information of the backup mini-program from the preset routing configuration.
[0106] S404: Determine the second route configuration information corresponding to the backup mini-program based on the backup mini-program's main information.
[0107] S406: Based on the second route configuration information, a backup route app is created.
[0108] In one possible embodiment, if the first application route is abnormal, a new backup mini-program is opened according to the backup mini-program main information in the preset route configuration, and the page is opened in the new backup mini-program.
[0109] In one possible embodiment, for the case where the first application is a mini-program, the situation where the routing of the first application is abnormal may include at least one of the following:
[0110] Example 1: The page request does not carry the main information of the first application's mini-program, nor does it carry the channel code (scheme).
[0111] Example 2: The main information of the mini-program in the first application is not located in the main information supervision pool.
[0112] Example 3: The channel code for the first application is not in the channel code censorship pool.
[0113] The above method is used to determine if there is an anomaly. If there is an anomaly, a new mini-program is obtained, along with the main information of the backup mini-program and the second route configuration information corresponding to the main information of the backup mini-program. The new mini-program is then routed to. If there is no anomaly, the first route configuration information of the first application is returned.
[0114] The channel code indicates the channel corresponding to the resource slot where the mini-program is located. It can include multiple channels. If the mini-program is in the channel code supervision pool, it can be routed to the mini-program on the corresponding channel, allowing the mini-program to be opened normally.
[0115] For example, if the first application is located in two channels, as long as the channel code can be obtained and it is in the channel code supervision pool, the first application can be opened normally.
[0116] Figure 5 The flowchart illustrating one embodiment of determining routing configuration information in this disclosure is merely an exemplary flowchart; the specific methods for determining this information may include various approaches, such as... Figure 5 As shown, it includes the following steps:
[0117] S502: Determine whether the app's main information is carried; if yes, execute S504; if no, execute S506.
[0118] S504: Determine whether the main information of the mini-program is in the main information supervision pool; if yes, execute S510; if no, execute S512.
[0119] S506: Determine whether the channel code of the first application is carried; if yes, execute S508; if no, execute S512.
[0120] S508: Determine whether the channel code is in the channel code supervision pool. If yes, execute S510; otherwise, execute S512.
[0121] S510: Determine the configuration information of the first route.
[0122] S512: Obtain the main information of the backup mini-program in the preset route configuration, and determine the second route configuration information corresponding to the main information of the backup mini-program.
[0123] Using the above method, the routing configuration information can be determined, the application to be opened can be routed according to the routing configuration information, and the page can be returned to the terminal based on the application routing.
[0124] In one possible implementation, after opening the backup mini-program, the first page can be directly routed. If the routing is successful, there is no need to route the second page. If the routing fails, the second page is routed according to the preset routing configuration.
[0125] Using the above method, the routing error mechanism can be executed step by step to address the issue of routing errors on the first page. Based on the preset routing configuration, the following types of error routing mechanisms can be executed.
[0126] (1) Directly route to the second page.
[0127] (2) First route the normal mini-program, then route the second page.
[0128] (3) First route the backup mini-program, then route the first page.
[0129] (4) First route the backup mini-program, then route the second page.
[0130] Based on this, this disclosure provides a standard method for automatic routing and progressive degradation of page service exceptions across the entire front-end and back-end, resolving the issue of abnormal scenarios in page services that could lead to wasted business and marketing traffic.
[0131] If the first page is an H5 page and the first application is a mini-program, the method in this disclosure introduces preset parameters in the page request. This can be triggered by abnormal situations and automatically matched to other normal program entities, and then routed to the second page to take over business marketing traffic, complete automatic routing degradation, and ensure the continuity and availability of the overall service.
[0132] Automatic routing degradation can be understood as the ability of a network device or software system to automatically redirect traffic from a routing service to an alternative path or service when a problem occurs or maintenance is required, in order to ensure service continuity and availability.
[0133] In one possible embodiment, the second page, the third page, and the backup mini-program targeted in the preset routing configuration of this disclosure, as well as the routing configuration information corresponding to the second page, the third page, and the backup mini-program, need to be cached, which can be done based on a three-layer caching mechanism.
[0134] The three-layer caching mechanism includes: Redis caching, local caching, and CDN caching.
[0135] In one possible embodiment, if routing the second page fails, a routing error message is returned, causing the terminal device to route the third page from its local cache and display it on the user interface.
[0136] The third page can be a fallback page for terminal devices, stored in the local cache of the terminal device. It can be understood as a page containing business content that the terminal device can display in any situation, with routing completed directly in the local cache.
[0137] When second-page routing and other methods fail, a fallback display is shown on the terminal device, allowing the terminal device to show a page to the user on the front end, thus preventing page bandwidth from being wasted.
[0138] The third page can be configured to be the same as the first page, or it can be configured with other business content. As the final fallback page, the third page can be configured as a static page to display some business content to save caching overhead. If the local cache is sufficient, the second page can be completely cached locally, and the terminal device can directly route the second page locally through the routing configuration information of the second page in the preset routing configuration.
[0139] The routing method disclosed herein can be provided based on a complete media service, the media components of which include: a front-end media service component, a server-side media service component, and routing media configuration.
[0140] The front-end media service component is used to retrieve front-end page routing information and control routing in case of exceptions.
[0141] The server-side media service is used to fetch and load routing information from the service provider, as well as to control abnormal routing.
[0142] The routing media configuration section is mainly used to meet the different routing rules configured for different pages and channels when the business handles abnormal routes, and to provide a query service for the corresponding routing configuration information. Among them, it provides high-performance front-end configuration push to CDN service for the front end, and can use a three-layer caching mechanism to complete the caching of content.
[0143] Through media services, combined with three-layer caching media, the front-end media service component provides high-performance acquisition and loading methods to meet the high-traffic and high-performance requirements of the Internet. The server can meet the requirements of exception monitoring and automatic return of routing information.
[0144] Figure 6 A flowchart of another page routing method in an embodiment of this disclosure is shown, such as... Figure 6 As shown, when applied to a terminal device, it includes the following steps:
[0145] S602: In response to the user's input on the user interface, a page request is sent so that the server can route the first page according to the page request. If the routing of the first page is abnormal, the preset parameters in the page request are obtained, the preset route configuration is mapped based on the preset parameters, and the second page is routed according to the preset route configuration.
[0146] S604: Get and render the second page, and display it on the user interface. The content of the second page is the same as that of the first page.
[0147] In one possible embodiment, there may also be situations where the page cannot be displayed on the terminal device side, which may include the following two situations:
[0148] (1) The server cannot return a normal page.
[0149] (2) The terminal device cannot render the page normally.
[0150] For example, the terminal device receives a routing failure message, which is sent after the server fails to route the second page. The third page is then routed in the local cache through the front-end routing media component and displayed on the user interface.
[0151] For example, if rendering the second page fails, the third page is routed from the local cache and displayed on the user interface.
[0152] Based on the same inventive concept as the above method embodiments, this application also provides a page routing device. Figure 7 A schematic diagram of the structure of a page routing device provided in an embodiment of this application is shown.
[0153] The device 70 includes: a receiving unit 701, configured to route a first page according to a page request; a first obtaining unit 702, configured to obtain preset parameters in the page request if routing the first page fails; a second obtaining unit 703, configured to map a preset routing configuration based on the preset parameters; and a routing unit 704, configured to route a second page according to the preset routing configuration, so that the terminal device can obtain and render the second page and display it on the user interface; the content of the second page is the same as that of the first page.
[0154] Figure 8 A schematic diagram of another page routing device provided in an embodiment of this application is shown.
[0155] The device 80 includes: a sending unit 801, for sending a page request in response to a user's input on the user interface; and a display unit 802, for acquiring and rendering a second page and displaying it on the user interface; the content of the second page is the same as that of the first page.
[0156] Those skilled in the art will understand that various aspects of the present invention can be implemented as systems, methods, or program products. Therefore, various aspects of the present invention can be specifically implemented in the following forms: entirely hardware implementations, entirely software implementations (including firmware, microcode, etc.), or implementations combining hardware and software aspects, collectively referred to herein as “circuits,” “modules,” or “systems.”
[0157] The following reference Figure 9 To describe an electronic device 900 according to this embodiment of the present invention. Figure 9The electronic device 900 shown is merely an example and should not impose any limitations on the functionality and scope of use of the embodiments of the present invention.
[0158] like Figure 9 As shown, the electronic device 900 is manifested in the form of a general-purpose computing device. The components of the electronic device 900 may include, but are not limited to: at least one processing unit 910, at least one storage unit 920, and a bus 930 connecting different system components (including the storage unit 920 and the processing unit 910).
[0159] The storage unit stores program code, which can be executed by the processing unit 910, causing the processing unit 910 to perform the steps described in the "Exemplary Methods" section of this specification according to various exemplary embodiments of the present invention.
[0160] Storage unit 920 may include readable media in the form of volatile storage units, such as random access memory (RAM) 9201 and / or cache memory 9202, and may further include read-only memory (ROM) 9203.
[0161] Storage unit 920 may also include a program / utility 9204 having a set (at least one) program module 9205, such program module 9205 including but not limited to: operating system, one or more application programs, other program modules and program data, each or some combination of these examples may include an implementation of a network environment.
[0162] Bus 930 can represent one or more of several types of bus structures, including a memory cell bus or memory cell controller, a peripheral bus, a graphics acceleration port, a processing unit, or a local bus using any of the various bus structures.
[0163] Electronic device 900 can also communicate with one or more external devices 940 (e.g., keyboard, pointing device, Bluetooth device, etc.), and with one or more devices that enable a user to interact with electronic device 900, and / or with any device that enables electronic device 900 to communicate with one or more other computing devices (e.g., router, modem, etc.). This communication can be performed via input / output (I / O) interface 950. Furthermore, electronic device 900 can also communicate with one or more networks (e.g., local area network (LAN), wide area network (WAN), and / or public networks, such as the Internet) via network adapter 960. As shown, network adapter 960 communicates with other modules of electronic device 900 via bus 930. It should be understood that, although not shown in the figures, other hardware and / or software modules can be used in conjunction with electronic device 900, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.
[0164] From the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein can be implemented by software or by combining software with necessary hardware. Therefore, the technical solutions according to the embodiments of this disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (such as a CD-ROM, USB flash drive, external hard drive, etc.) or on a network, including several instructions to cause a computing device (such as a personal computer, server, terminal device, or network device, etc.) to execute the methods according to the embodiments of this disclosure.
[0165] In exemplary embodiments of this disclosure, a computer-readable storage medium is also provided, on which a program product capable of implementing the methods described above is stored. In some possible embodiments, various aspects of the present invention may also be implemented as a program product comprising program code that, when the program product is run on a terminal device, causes the terminal device to perform the steps of the various exemplary embodiments of the present invention described in the "Exemplary Methods" section above.
[0166] A program product for implementing the above-described method according to embodiments of the present invention is described. This product may employ a portable compact disc read-only memory (CD-ROM) and include program code, and may run on a terminal device, such as a personal computer. However, the program product of the present invention is not limited thereto. In this document, the readable storage medium may be any tangible medium containing or storing a program that may be used by or in conjunction with an instruction execution system, apparatus, or device.
[0167] The program product may employ any combination of one or more readable media. A readable medium may be a readable signal medium or a readable storage medium. A readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples (a non-exhaustive list) of readable storage media include: electrical connections having one or more wires, portable disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.
[0168] Computer-readable signal media may include data signals propagated in baseband or as part of a carrier wave, carrying readable program code. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A readable signal medium may also be any readable medium other than a readable storage medium, capable of sending, propagating, or transmitting programs for use by or in conjunction with an instruction execution system, apparatus, or device.
[0169] The program code contained on the readable medium may be transmitted using any suitable medium, including but not limited to wireless, wired, optical fiber, RF, etc., or any suitable combination thereof.
[0170] Program code for performing the operations of this invention can be written in any combination of one or more programming languages, including object-oriented programming languages such as Java and C++, and conventional procedural programming languages such as C or similar languages. The program code can execute entirely on the user's computing device, partially on the user's computing device, as a standalone software package, partially on the user's computing device and partially on a remote computing device, or entirely on a remote computing device or server. In cases involving remote computing devices, the remote computing device can be connected to the user's computing device via any type of network, including a local area network (LAN) or a wide area network (WAN), or it can be connected to an external computing device (e.g., via the Internet using an Internet service provider).
[0171] It should be noted that although several modules or units for the device used to perform actions have been mentioned in the detailed description above, this division is not mandatory. In fact, according to embodiments of this disclosure, the features and functions of two or more modules or units described above can be embodied in one module or unit. Conversely, the features and functions of one module or unit described above can be further divided and embodied by multiple modules or units.
[0172] Furthermore, although the steps of the method in this disclosure are described in a specific order in the accompanying drawings, this does not require or imply that the steps must be performed in that specific order, or that all the steps shown must be performed to achieve the desired result. Additional or alternative steps may be omitted, multiple steps may be combined into one step, and / or a step may be broken down into multiple steps.
[0173] From the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein can be implemented by software or by combining software with necessary hardware. Therefore, the technical solutions according to the embodiments of this disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (such as a CD-ROM, USB flash drive, external hard drive, etc.) or on a network, including several instructions to cause a computing device (such as a personal computer, server, mobile terminal, or network device, etc.) to execute the methods according to the embodiments of this disclosure.
[0174] Other embodiments of this disclosure will readily occur to those skilled in the art upon consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of this disclosure that follow the general principles of this disclosure and include common knowledge or customary techniques in the art not disclosed herein. The specification and examples are to be considered exemplary only, and the true scope and spirit of this disclosure are indicated by the appended claims.
Claims
1. A page routing method, characterized in that, Applied to the server side, the method includes: Based on the page request, route to the first page; If the routing of the first page fails, then the preset parameters in the page request are retrieved; Based on the preset parameters, map the preset route configuration; According to the preset routing configuration, the second page is routed so that the terminal device can obtain and render the second page and display it on the user interface; the content of the second page is the same as that of the first page.
2. The method according to claim 1, characterized in that, The step of routing the second page according to the preset routing configuration includes: Determine whether the first application to which the first page belongs is a mini-program; If not, then obtain the routing information of the second page in the preset routing configuration, and route the second page; If so, determine whether the first application is abnormal in routing; If not, then based on the first routing configuration information corresponding to the first application, route to the first application, and obtain the routing information of the second page in the preset routing configuration, and route to the second page.
3. The method according to claim 2, characterized in that, The method further includes: If the routing of the first application fails, the main information of the backup mini-program in the preset routing configuration is obtained; Based on the main information of the backup mini-program, determine the second route configuration information corresponding to the backup mini-program; Based on the second route configuration information, a backup route app is created.
4. The method according to claim 3, characterized in that, The step of obtaining the backup mini-program main information in the preset route configuration includes: If the page request does not carry the main information of the first application's mini-program and does not carry the channel code, then the backup mini-program's main information is obtained; the channel code is used to indicate the channel corresponding to the resource slot where the mini-program is located; or, If the main information of the first application's mini-program is not in the main information supervision pool, then obtain the backup mini-program's main information; or, If the channel code of the first application is not in the channel code supervision pool, then obtain the main information of the backup mini-program.
5. The method according to claim 1, characterized in that, The method further includes: If the routing of the second page fails, a routing error message is returned, prompting the terminal device to route the third page from its local cache and display it on the user interface.
6. The method according to claim 1, characterized in that, The method further includes: A three-layer caching mechanism is used to cache the second page, third page, and backup mini-program in the preset route configuration, as well as the corresponding route configuration information; the three-layer caching mechanism includes: Redis cache, local cache, and CDN cache.
7. A page routing method, characterized in that, Applied to a terminal device, the method includes: In response to user input on the user interface, a page request is sent so that the server routes the first page according to the page request. If routing the first page fails, the server obtains the preset parameters in the page request, maps the preset route configuration based on the preset parameters, and routes the second page according to the preset route configuration. The second page is acquired and rendered, and displayed on the user interface; the content of the second page is the same as that of the first page.
8. The method according to claim 7, characterized in that, The method further includes: Receive routing failure message; the routing failure message is sent by the server after it fails to route the second page; The third page is routed from the local cache using the front-end routing media component and displayed in the user interface.
9. The method according to claim 7, characterized in that, The method further includes: If rendering the second page fails, the third page is routed from the local cache and displayed in the user interface.
10. A page routing device, characterized in that, include: The receiving unit is used to route the first page based on the page request; The first acquisition unit is used to acquire preset parameters in the page request if the routing of the first page is abnormal; The second acquisition unit is used to map a preset route configuration based on the preset parameters; The routing unit is used to route the second page according to the preset routing configuration, so that the terminal device can obtain and render the second page and display it on the user interface; The content of the second page is the same as that of the first page.
11. A page routing device, characterized in that, include: The sending unit is used to respond to the user's input operation on the user interface and send a page request so that the server can route the first page according to the page request. If the routing of the first page is abnormal, the server obtains the preset parameters in the page request, maps the preset route configuration based on the preset parameters, and routes the second page according to the preset route configuration. A display unit is used to acquire and render the second page and display it on the user interface; The content of the second page is the same as that of the first page.
12. An electronic device, characterized in that, include: processor; and memory for storing the executable instructions of the processor; The processor is configured to execute the method of any one of claims 1 to 6 or 7 to 9 by executing the executable instructions.
13. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the method described in any one of claims 1 to 6 or 7 to 9.
14. A computer program product comprising: A computer program or instruction, characterized in that, when executed by a processor, the computer program or instruction implements the method described in any one of claims 1 to 6 or 7 to 9.