Method and apparatus for page jump
By unifying the middleware framework for page navigation and setting up the view controller, the problems of complex controllers and poor maintainability in existing technologies are solved, achieving simple and efficient page navigation and dynamic expansion.
Patent Information
- Application Number
- CN202010232112.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-03-27
- Publication Date
- 2025-10-21
- Estimated Expiration
- 2040-03-27
AI Technical Summary
Existing technologies often employ complex page navigation controllers with bloated code, poor maintainability and scalability, making it difficult to meet the business needs of large data volumes.
A unified redirection middleware framework is adopted, which sets the redirection page identifier and input parameters through the view controller, and updates the page identifier using the configuration center or static configuration file to achieve dynamic expansion and mapping page redirection.
It improves page redirection speed, simplifies code structure, enhances maintainability and scalability, and supports dynamically expanding newly added redirected pages.
Smart Images

Figure CN113449213B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a method and device for page jump. Background Art
[0002] The existing technologies mostly use one request link corresponding to one controller, and distribute access requests to different pages in different controllers to complete unified jump redirection; or multiple request links correspond to the same controller, and then the same controller completes unified jump redirection of multiple request links through parameter condition judgment.
[0003] In the process of implementing the present invention, the inventors discovered that the prior art has at least the following problems:
[0004] 1. The solution of corresponding one request link to one controller has the technical drawbacks of multiple and complex controllers, bloated code, and poor maintainability.
[0005] 2. In the solution where multiple request links correspond to the same controller, each time a redirection page is added, the "yes" and "no" states of the logical judgment statement processor need to be increased. The logical processing flow needs to be continuously increased, and the maintainability becomes increasingly poor. Summary of the Invention
[0006] In view of this, an embodiment of the present invention provides a method and apparatus for page jump, which can improve the speed of page jump, improve the conciseness of code, and increase the maintainability and scalability of page jump.
[0007] To achieve the above object, according to one aspect of an embodiment of the present invention, a method for page jump is provided, characterized by comprising:
[0008] Receive the user's jump request;
[0009] Sending the jump request to a middleware for unified jump;
[0010] Obtaining the redirection page of the unified jump output;
[0011] Map the redirect page to complete the page jump.
[0012] Optionally, before sending the jump request to the middleware for unified jump, the method includes:
[0013] Establishing the middleware framework for unified redirection;
[0014] Set up the view controller in said middleware;
[0015] Setting a redirect page identifier and input parameters for receiving a unified jump page request in the view controller;
[0016] According to the middleware, the redirect page identifier and the input parameters, the middleware for unified jump is established.
[0017] Optionally, before obtaining the redirection page outputted by the unified jump, the following steps are included:
[0018] Get the updated identifier of the page to be redirected;
[0019] Update the redirect page identifier in the view controller through the configuration center or static configuration file.
[0020] Optionally, the input parameters include: product number and order number.
[0021] According to another aspect of an embodiment of the present invention, a device for page jump is provided, characterized by comprising:
[0022] Request receiving module, used to receive the user's jump request;
[0023] A sending module, configured to send the jump request to a middleware for unified jump;
[0024] A page acquisition module, used to obtain the redirection page of the unified jump output;
[0025] The page jump module is used to map the redirect page and complete the page jump.
[0026] Optionally, before sending the jump request to the middleware for unified jump, the method includes:
[0027] Establishing the middleware framework for unified redirection;
[0028] Set up the view controller in said middleware;
[0029] Setting a redirect page identifier and input parameters for receiving a unified jump page request in the view controller;
[0030] According to the middleware, the redirect page identifier and the input parameters, the middleware for unified jump is established.
[0031] Optionally, before obtaining the redirection page outputted by the unified jump, the following steps are included:
[0032] Get the updated identifier of the page to be redirected;
[0033] Update the redirect page identifier in the view controller through the configuration center or static configuration file.
[0034] Optionally, the input parameters include: product number and order number.
[0035] According to another aspect of an embodiment of the present invention, a page jump electronic device is provided, comprising:
[0036] one or more processors;
[0037] a storage device for storing one or more programs,
[0038] When the one or more programs are executed by the one or more processors, the one or more processors implement the page jump method provided by the present invention.
[0039] According to another aspect of an embodiment of the present invention, a computer-readable medium is provided, on which a computer program is stored. When the program is executed by a processor, the page jump method provided by the present invention is implemented.
[0040] One embodiment of the above invention has the following advantages or beneficial effects:
[0041] This application solves the technical defects of poor maintainability and poor scalability in the existing technology by setting up a middleware for unified jump, thereby achieving the technical effects of increasing the speed of page jump, improving the simplicity of code, and increasing the maintainability and scalability of page jump.
[0042] The further effects of the above-mentioned non-conventional optional manner will be described below in conjunction with specific embodiments. BRIEF DESCRIPTION OF THE DRAWINGS
[0043] The accompanying drawings are provided for a better understanding of the present invention and are not intended to limit the present invention.
[0044] Figure 1 1 is a schematic diagram of the main process of a page jump method according to an embodiment of the present invention;
[0045] Figure 2 is a schematic diagram of a specific process of a page jump method according to an embodiment of the present invention;
[0046] Figure 3 is a schematic diagram of main modules of a device for page jump according to an embodiment of the present invention;
[0047] Figure 4 is an exemplary system architecture diagram in which embodiments of the present invention may be applied;
[0048] Figure 5 It is a schematic diagram of the structure of a computer system of a terminal device or a server suitable for implementing an embodiment of the present invention. DETAILED DESCRIPTION
[0049] The following description of exemplary embodiments of the present invention is made in conjunction with the accompanying drawings, in which various details of the embodiments of the present invention are included to facilitate understanding. These details should be considered as merely exemplary. Therefore, it should be appreciated by those skilled in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present invention. Similarly, for the sake of clarity and conciseness, descriptions of well-known functions and structures are omitted in the following description.
[0050] The existing technology can meet business needs to a certain extent when there are a small number of jump pages and the demand does not change much. However, as the number of connected unified jump pages increases and the related demand changes dramatically, its maintainability and scalability are restricted, making it increasingly difficult to meet business needs when there is a large amount of data. This application solves the technical defects of poor maintainability and scalability in the existing technology by providing a middleware for unified jump, thereby achieving the technical effects of increasing the speed of page jumps, making the code more concise, and increasing the maintainability and scalability of page jumps.
[0051] This solution also supports dynamic expansion of newly accessed redirect pages, thereby achieving the technical effect of configuring page jumps and managing them according to needs.
[0052] Figure 1 FIG. 1 is a schematic diagram of the main process of a page jump method according to an embodiment of the present invention. Figure 1 Shown, including:
[0053] Step S101: receiving a jump request from a user;
[0054] Step S102: Send the jump request to the middleware for unified jump;
[0055] Step S103: Obtain the redirection page of the unified jump output;
[0056] Step S104: Map the redirect page to complete the page jump.
[0057] Receiving the jump request from the user may include: clicking a page identifier for redirection on a pre-generated page.
[0058] For example, on an e-commerce platform, clicking on an order on the user's query page generates a jump request for the user to view the specific data information of the order. The necessary input parameters can be obtained on the query page, which in this embodiment can be the product number SKUId, order number orderId, etc.
[0059] The required input parameters can be determined based on the parameters in the original link, so that the page can be opened normally. Specifically, when a page for independent ordering such as video entertainment needs to be redirected, its SKUId is a required parameter. If a product is to be purchased, it is necessary to determine what the user wants to buy through parameters. The SKUId can clearly identify the product to be purchased, and the product is uniquely identified within the e-commerce platform where it is located. Therefore, in the e-commerce field, SKUId is a required parameter, and both the original link and the unified jump redirection link need to carry the required input parameters.
[0060] The purpose of setting up the middleware is to process the routing of URL request access and complete the access response of the requested page.
[0061] In this embodiment, a clickable order box provided on the query page is regarded as a redirect page identifier (topage).
[0062] Redirection is the process of redirecting network requests to other locations through various methods (for example, web page redirection, domain name redirection, and routing changes are also a form of redirection of the data packet path). Specifically, when toPage=home, accessing https: / / XXXXXXX is equivalent to accessing https: / / YYYYYYYY.
[0063] The prior art utilizes multiple controllers for redirection, wherein each controller corresponds to a redirection page; whereas the present application utilizes one controller, which is mapped to multiple processing blocks, and distinguishes different processing and mapping modules through parameters used for redirection.
[0064] The middleware for unified redirection is a program that can confirm the page corresponding to the redirection request. The logic of the middleware determines that the user's request is matched with the processor corresponding to the redirection page.
[0065] Optionally, before sending the jump request to the middleware for unified jump, the method includes:
[0066] Establishing the middleware framework for unified redirection;
[0067] Set up the view controller in said middleware;
[0068] Setting a redirect page identifier and input parameters for receiving a unified jump page request in the view controller;
[0069] According to the middleware, the redirect page identifier and the input parameters, the middleware for unified jump is established.
[0070] Optionally, before obtaining the redirection page outputted by the unified jump, the following steps are included:
[0071] Get the updated identifier of the page to be redirected;
[0072] Update the redirect page identifier in the view controller through the configuration center or static configuration file.
[0073] The technical means of updating the view controller through the configuration center solves the technical problems of the existing technology that are difficult to expand and have complicated codes when adding a redirect page identifier, thereby achieving the update setting of the redirect page without modifying the code.
[0074] Figure 2 : is a schematic diagram of a specific process of a page jump method according to an embodiment of the present invention; Figure 2 Shown, including:
[0075] The following describes in detail a method for page jump in the present application using a specific embodiment, including:
[0076] Step S201: Create a unified jump middleware (in this embodiment, the domain name is: vjump.m.jd.com), write a view controller in the middleware, implement the routing processing of URL request access, and then complete the access response of the requested page;
[0077] Step S202: Plan the processing block corresponding to the redirect page identifier (toPage processing block), wherein the topage processing block is mapped to the corresponding logic in the code through the toPage parameter. When querying data on the e-commerce platform, the necessary input parameters are: product ID skuId, order ID orderId, and they are set in the controller of the unified jump middleware as public parameters to receive the unified jump page request;
[0078] Step S203: inject the determined redirect page identifier into the topage processing block, perform a cyclic matching, map the identifier to the corresponding logic processing block, complete the matching page redirection route jump, and carry its necessary parameters;
[0079] Specifically, when toPage=home, it will redirect to the phone recharge homepage; that is, when toPage=home, find the logic corresponding to home and redirect to the relevant processing block of https: / / newcz.m.jd.com;
[0080] When toPage=cz, it will redirect to the traffic recharge homepage;
[0081] When toPage=newcz, it will redirect to the phone recharge homepage;
[0082] When toPage=game, it will redirect to the game recharge homepage.
[0083] When a new redirect page identifier needs to be connected, the injection is completed through the configuration center or static configuration file. The routing jump logic block shares the same logic processing block, identifies the redirect page identifier toPage through configuration, and maps it to the target page to be jumped to complete the unified jump redirection.
[0084] Inject the newly added page identifier (toPage=xxx) and redirection logic through configuration, that is, through the configuration center or configuration file.
[0085] The page identifier (toPage=xxx) loop matching process is used to replace the branch processing process, so that the scalability of the code is enhanced, so that configuration can be further used to map the page identifier and the jump target.
[0086] The topage processing block maps the above branch judgment logic through a loop, so that the scalability and maintainability are further enhanced.
[0087] The topage processing block refers to multiple branches from a logical level, and refers to the judgment module and the guidance module that can be dynamically added at the code level. For example, after going online, toPage=cz can be dynamically configured to redirect to https: / / cz.m.jd.com.
[0088] Figure 3 is a schematic diagram of the main modules of a device for page jump according to an embodiment of the present invention; Figure 3 Shown, including:
[0089] Request receiving module 301, used to receive a jump request from a user;
[0090] A sending module 302, configured to send the jump request to a middleware for unified jump;
[0091] The page acquisition module 303 is used to obtain the redirection page output by the unified jump;
[0092] The page jump module 304 is used to map the redirect page and complete the page jump.
[0093] Optionally, before sending the jump request to the middleware for unified jump, the method includes:
[0094] Establishing the middleware framework for unified redirection;
[0095] Set up the view controller in said middleware;
[0096] Setting a redirect page identifier and input parameters for receiving a unified jump page request in the view controller;
[0097] According to the middleware, the redirect page identifier and the input parameters, the middleware for unified jump is established.
[0098] Optionally, before obtaining the redirection page outputted by the unified jump, the following steps are included:
[0099] Get the updated identifier of the page to be redirected;
[0100] Update the redirect page identifier in the view controller through the configuration center or static configuration file.
[0101] Optionally, the input parameters include: product number and order number.
[0102] Figure 4 An exemplary system architecture 400 is shown to which the page jump method or the page jump apparatus according to the embodiment of the present invention can be applied.
[0103] like Figure 4 As shown, system architecture 400 may include terminal devices 401, 402, 403, a network 404, and a server 405. Network 404 is used to provide a medium for communication links between terminal devices 401, 402, 403 and server 405. Network 404 may include various connection types, such as wired or wireless communication links or fiber optic cables.
[0104] Users can use terminal devices 401, 402, and 403 to interact with server 405 via network 404 to receive or send messages, etc. Terminal devices 401, 402, and 403 can be installed with various communication client applications, such as shopping applications, web browser applications, search applications, instant messaging tools, email clients, social platform software, etc. (only as examples).
[0105] The terminal devices 401 , 402 , and 403 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop computers, and desktop computers.
[0106] Server 405 may be a server that provides various services, such as a backend management server (for example only) that supports shopping websites browsed by users using terminal devices 401, 402, and 403. The backend management server may analyze and process received data such as product information query requests, and feed back processing results (for example, target push information and product information—for example only) to the terminal device.
[0107] It should be noted that the page jump method provided in the embodiment of the present invention is generally executed by the server 405 , and accordingly, the page jump device is generally set in the server 405 .
[0108] It should be understood that Figure 4 The number of terminal devices, networks and servers in the embodiment is merely illustrative. Any number of terminal devices, networks and servers may be provided as required.
[0109] Reference below Figure 5 , which shows a schematic structural diagram of a computer system 500 of a terminal device suitable for implementing an embodiment of the present invention. Figure 5 The terminal device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.
[0110] like Figure 5 As shown, the computer system 500 includes a central processing unit (CPU) 501, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 502 or a program loaded from a storage unit 508 into a random access memory (RAM) 503. Various programs and data required for the operation of the system 500 are also stored in the RAM 503. The CPU 501, ROM 502, and RAM 503 are connected to each other via a bus 504. An input / output (I / O) interface 505 is also connected to the bus 504.
[0111] The following components are connected to the I / O interface 505: an input section 506 including a keyboard, a mouse, and the like; an output section 507 including devices such as a cathode ray tube (CRT), a liquid crystal display (LCD), and a speaker; a storage section 508 including a hard disk; and a communication section 509 including a network interface card such as a LAN card or a modem. The communication section 509 performs communication processing via a network such as the Internet. A drive 510 is also connected to the I / O interface 505 as needed. A removable medium 511, such as a magnetic disk, an optical disk, a magneto-optical disk, or a semiconductor memory, is installed in the drive 510 as needed, so that computer programs read therefrom can be installed into the storage section 508 as needed.
[0112] In particular, according to the embodiments disclosed in the present invention, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, the embodiments disclosed in the present invention include a computer program product comprising a computer program carried on a computer-readable medium, the computer program comprising program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network via the communication section 509, and / or installed from a removable medium 511. When the computer program is executed by the central processing unit (CPU) 501, the above-mentioned functions defined in the system of the present invention are performed.
[0113] It should be noted that the computer-readable medium described in the present invention can be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. A computer-readable storage medium can 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 of computer-readable storage media can include, but are not limited to, an electrical connection having one or more conductors, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In the present invention, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In the present invention, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. This propagated data signal can take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium that can transmit, propagate, or transport a program for use by or in conjunction with an instruction execution system, apparatus, or device. Program code embodied on a computer-readable medium may be transmitted using any suitable medium, including but not limited to wireless, wireline, optical fiber cable, RF, or any suitable combination thereof.
[0114] The flowcharts and block diagrams in the accompanying drawings illustrate the possible implementation architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present invention. In this regard, each box in the flowchart or block diagram can represent a module, program segment, or a part of code, and the above-mentioned module, program segment, or a part of code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in an order different from that marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flowchart, and the combination of boxes in the block diagram or flowchart, can be implemented with a dedicated hardware-based system that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0115] The modules involved in the embodiments of the present invention may be implemented in software or hardware. The modules described may also be provided in a processor. For example, they may be described as follows: a processor includes a sending module, an acquisition module, a determination module, and a first processing module. The names of these modules do not, in some cases, limit the modules themselves. For example, the sending module may also be described as a "module for sending a picture acquisition request to the connected server."
[0116] As another aspect, the present invention further provides a computer-readable medium, which may be included in the device described in the above embodiments, or may exist independently without being incorporated into the device. The computer-readable medium carries one or more programs, and when the one or more programs are executed by the device, the device includes:
[0117] Receive the user's jump request;
[0118] Sending the jump request to a middleware for unified jump;
[0119] Obtaining the redirection page of the unified jump output;
[0120] Map the redirect page to complete the page jump.
[0121] According to the technical solution of the embodiment of the present invention, the following beneficial effects can be achieved:
[0122] This application solves the technical defects of poor maintainability and poor scalability in the existing technology by setting up a middleware for unified jump, thereby achieving the technical effects of increasing the speed of page jump, improving the simplicity of code, and increasing the maintainability and scalability of page jump.
[0123] The above specific embodiments do not limit the scope of protection of the present invention. Those skilled in the art will appreciate that various modifications, combinations, sub-combinations, and substitutions may occur depending on design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention are intended to be included within the scope of protection of the present invention.
Claims
1. A page jump method, executed by a server, characterized in that: include: Establish a middleware framework for unified redirection; Set up the view controller in said middleware; A redirect page identifier and input parameters for receiving a unified jump page request are set in the view controller; wherein, a processing block corresponding to the redirect page identifier is planned, the determined redirect page identifier is injected into the processing block, and a cyclic matching is performed to map the identifier to the corresponding logic processing block, complete the matching page redirection route jump, and carry its necessary parameters; when a new redirect page identifier needs to be connected, the newly added redirect page identifier and redirection logic are injected through configuration, so as to achieve the injection through a configuration center or a static configuration file; the route jump logic block shares the same logic processing block, identifies the redirect page identifier through configuration, and maps it to the target page to be jumped to complete the unified jump redirection; the processing block refers to the logic mapped to the corresponding logic in the code through parameters; According to the middleware, the redirect page identifier and the input parameters, the middleware for unified jump is established; Receive the user's jump request; Sending the jump request to the middleware for unified jump; Obtaining the redirection page of the unified jump output; Map the redirect page to complete the page jump.
2. The method according to claim 1, characterized in that Before obtaining the redirect page of the unified jump output, it includes: Get the updated identifier of the page to be redirected; Update the redirect page identifier in the view controller through the configuration center or static configuration file.
3. The method according to claim 2, characterized in that The input parameters include: product number and order number.
4. A page jump device, provided in a server, characterized in that: include: Middleware module, used to establish a middleware framework for unified jump; Set up the view controller in said middleware; A redirect page identifier and input parameters for receiving a unified jump page request are set in the view controller; wherein, a processing block corresponding to the redirect page identifier is planned, the determined redirect page identifier is injected into the processing block, and a cyclic matching is performed to map the identifier to the corresponding logic processing block, complete the matching page redirection route jump, and carry its necessary parameters; when a new redirect page identifier needs to be connected, the newly added redirect page identifier and redirection logic are injected through configuration, so as to achieve the injection through a configuration center or a static configuration file; the route jump logic block shares the same logic processing block, identifies the redirect page identifier through configuration, and maps it to the target page to be jumped to complete the unified jump redirection; the processing block refers to the logic mapped to the corresponding logic in the code through parameters; According to the middleware, the redirect page identifier and the input parameters, the middleware for unified jump is established; Request receiving module, used to receive the user's jump request; A sending module, configured to send the jump request to the middleware for unified jump; A page acquisition module, used to obtain the redirection page of the unified jump output; The page jump module is used to map the redirect page and complete the page jump.
5. The device according to claim 4, characterized in that Before obtaining the redirect page of the unified jump output, it includes: Get the updated identifier of the page to be redirected; Update the redirect page identifier in the view controller through the configuration center or static configuration file.
6. The device according to claim 5, characterized in that The input parameters include: product number and order number.
7. An electronic device for page jump, characterized in that: include: one or more processors; a storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 3.
8. A computer-readable medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 3 is implemented.
Citation Information
Patent Citations
An application program page skipping method and device
CN109766082A
Page jumping method and device, electronic device and storage medium
CN110717119A