Web Application Routing and Jumping Method, Device, Equipment and Medium

By intercepting the jump instructions for web application routing, obtaining and matching the routing information configuration file, and exporting and executing the method functions of the route guard file, the problem of lengthy code and high development costs is solved, and efficient and secure routing is achieved.

CN115033826BActive Publication Date: 2025-06-24HANGZHOU DBAPPSECURITY CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210706549.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-06-21
Publication Date
2025-06-24
Estimated Expiration
2042-06-21

AI Technical Summary

Technical Problem

In the prior art, the lengthy code in the Web application routing guard program makes it difficult for developers to maintain, and it is necessary to manually write logical files to routing meta information, which increases the work cost of developers.

Method used

By intercepting the jump instruction of the destination page address, obtain the routing information configuration file, and match the destination page address with the preset route guard file to get the execution order of the route guard file. Based on this order, the method functions in the routing guard file are exported and executed to determine whether the execution result meets the preset conditions. If it is satisfied, it will jump to the destination page.

Benefits of technology

It reduces the development cost of web application routing jump, reduces the steps of developers to operate manually, improves development efficiency, and enhances the security of routing jump.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115033826B_ABST
    Figure CN115033826B_ABST
Patent Text Reader

Abstract

The present application discloses a Web application routing and jumping method, device, equipment and medium, which relates to the field of computer technology. The method includes: intercepting a jump instruction corresponding to a destination page address and obtaining a corresponding routing information configuration file; matching the destination page address with a corresponding preset routing guard file in the routing information configuration file to obtain the execution order of the routing guard file; exporting a method function in the preset routing guard file based on the execution order of the routing guard file and executing the method function to obtain a corresponding execution result; determining whether the execution result meets a first preset condition, and if so, jumping to a destination page corresponding to the destination page address. Through the above method, the cost during Web application routing and jumping can be reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and particularly to a Web application routing and jumping method, device, equipment and medium. Background Art

[0002] Before a user opens a Web application page through a browser, it is necessary to process the routing navigation logic through a routing guard program. During the process of processing the routing navigation logic, the routing guard program first reads the data, status verification, and status control required by the Web application page, and then navigates to the corresponding Web application page based on the obtained data and verification status. Then, when the routing navigation logic increases, it will lead to long code in the routing guard program, which will also cause difficulties for developers to maintain. Currently, in the prior art, to solve the problem of long code in the routing guard program, the routing guard program is split into multiple logic files, and developers need to manually write the logic files into the routing meta-information, which increases the development time of developers, thus further increasing the work cost of developers to a certain extent.

[0003] In summary, how to reduce the cost during Web application routing and jumping is a problem to be solved in this field. Summary of the Invention

[0004] In view of this, the purpose of the present invention is to provide a Web application routing and jumping method, device, equipment and medium, which can reduce the cost during Web application routing and jumping. The specific scheme is as follows:

[0005] In the first aspect, the present application discloses a Web application routing and jumping method, including:

[0006] Intercept a jump instruction corresponding to the destination page address, and obtain the corresponding routing information configuration file;

[0007] Match the destination page address with the corresponding preset routing guard file in the routing information configuration file to obtain the execution order of the routing guard file;

[0008] Export the method functions in the preset routing guard file based on the execution order of the routing guard file, and execute the method functions to obtain the corresponding execution results;

[0009] Judge whether the execution result meets the first preset condition. If it meets, jump to the destination page corresponding to the destination page address.

[0010] Optionally, before intercepting the jump instruction corresponding to the destination page address, it further includes:

[0011] The preset configuration information generator generates a routing information configuration file by using a first mapping relationship between a preset routing guard file and a preset routing guard name, and a second mapping relationship between the preset routing guard name and a preset page code file.

[0012] Optionally, before the preset configuration information generator generates a routing information configuration file by using a first mapping relationship between a preset routing guard file and a preset routing guard name, and a second mapping relationship between the preset routing guard name and a preset page code file, it further includes:

[0013] Split the preset routing guard logic into the preset routing guard file, and determine the first mapping relationship between the preset routing guard file and the preset routing guard name.

[0014] Optionally, before the preset configuration information generator generates a routing information configuration file by using a first mapping relationship between a preset routing guard file and a preset routing guard name, and a second mapping relationship between the preset routing guard name and a preset page code file, it further includes:

[0015] Configure the preset routing guard name in the corresponding preset page of the preset page code file to obtain the second mapping relationship between the preset routing guard name and the preset page code file.

[0016] Optionally, before intercepting the jump instruction corresponding to the destination page address, it further includes:

[0017] The preset configuration information generator uses the require method, the first mapping relationship, and the second mapping relationship to import the preset routing guard file into the corresponding preset page to generate a routing information configuration file.

[0018] Optionally, the matching of the destination page address with the corresponding preset routing guard file in the routing information configuration file to obtain the execution order of the routing guard file includes:

[0019] Match the destination page address with the corresponding preset page code file in the routing information configuration file to obtain the page order of the preset page code file;

[0020] Based on the page order and the second mapping relationship, determine the name order of the preset routing guard name, and based on the name order and the first mapping relationship, obtain the execution order of the routing guard file of the preset routing guard file.

[0021] Optionally, during the process of executing the method function to obtain the corresponding execution result, it further includes:

[0022] Execute the current method function. If it is detected that the preset next method needs to be executed, interrupt the execution of the current method function and jump to the corresponding next method function;

[0023] If the execution result of the next method function meets the second preset condition, jump back to the corresponding function position in the current method function and execute the current method function based on the function position.

[0024] In a second aspect, the present application discloses a Web application routing and jumping device, including:

[0025] A configuration file acquisition module, configured to intercept a jump instruction corresponding to a destination page address and acquire a corresponding routing information configuration file;

[0026] An execution order acquisition module, configured to match the destination page address with a preset routing guard file corresponding in the routing information configuration file to obtain an execution order of the routing guard file;

[0027] An execution result acquisition module, configured to export method functions in the preset routing guard file based on the execution order of the routing guard file and execute the method functions to obtain corresponding execution results;

[0028] A jump module, configured to determine whether the execution result meets a first preset condition, and if so, jump to a destination page corresponding to the destination page address.

[0029] In a third aspect, the present application discloses an electronic device, including:

[0030] A memory, configured to store a computer program;

[0031] A processor, configured to execute the computer program to implement the steps of the Web application routing and jumping method disclosed above.

[0032] In a fourth aspect, the present application discloses a computer-readable storage medium, configured to store a computer program; wherein, when the computer program is executed by a processor, the steps of the Web application routing and jumping method disclosed above are implemented.

[0033] It can be seen that the present application intercepts the jump instruction corresponding to the destination page address and obtains the corresponding routing information configuration file; matches the destination page address with the corresponding preset routing guard file in the routing information configuration file to obtain the execution order of the routing guard file; exports the method functions in the preset routing guard file based on the execution order of the routing guard file, and executes the method functions to obtain the corresponding execution results; determines whether the execution results meet the first preset condition, and if so, jumps to the destination page corresponding to the destination page address. Thus, it can be seen that the present application first intercepts the jump instruction corresponding to the destination page address, that is, it does not allow jumping to the destination page when the subsequent steps are not performed, so the security of the Web application routing jump is ensured; the destination page address is matched with the corresponding preset routing guard file in the routing information configuration file to obtain the execution order of the routing guard file. Because when the destination page address is matched with the preset routing guard file, the matching can be automatically performed, so the working time and working tasks of developers are greatly reduced; the method functions in the preset routing guard file are exported based on the execution order of the routing guard file, and the method functions are executed to obtain the corresponding execution results. If the execution results meet the first preset condition, then jump to the destination page corresponding to the destination page address. Description of the Drawings

[0034] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, the drawings in the following description are only the embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other drawings can also be obtained according to the provided drawings.

[0035] Figure 1 It is a flowchart of a method for Web application routing jump disclosed in the present application;

[0036] Figure 2 It is a flowchart of a specific method for Web application routing jump disclosed in the present application;

[0037] Figure 3 It is a schematic diagram of the generation of a specific routing information configuration file disclosed in the present application;

[0038] Figure 4 It is a schematic diagram of the structure of a Web application routing jump device disclosed in the present application;

[0039] Figure 5 It is a structural diagram of an electronic device disclosed in the present application. Detailed Embodiments

[0040] The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.

[0041] Currently, in the prior art, in order to solve the problem of long code in the route guard program, the route guard program is split into multiple logical files, and developers need to manually write the logical files into the route meta-information, which increases the development time of developers. In this way, the work cost of developers is further increased to a certain extent.

[0042] Therefore, the present application correspondingly provides a Web application route jump solution, which can reduce the cost when jumping the Web application route.

[0043] See Figure 1 As shown, the embodiments of the present application disclose a Web application route jump method, including:

[0044] Step S11: Intercept the jump instruction corresponding to the destination page address and obtain the corresponding route information configuration file.

[0045] In this embodiment, a Web (World Wide Web) application refers to an application that can be accessed through a URL (uniform resource locator) in a browser. Routing is a program that can allocate a corresponding page program to the browser through the URL, allowing users to access the specified Web application page through it. It should be noted that before intercepting the jump instruction corresponding to the destination page address, a routing information configuration file needs to be created in advance. The routing information configuration file contains both the first mapping relationship between the preset routing guard file and the preset routing guard name, and the second mapping relationship between the preset routing guard name and the preset page code file. Among them, the initial routing guard logic splits its own logic into multiple individual code files, namely preset routing guard files. For example, the complete initial routing guard logic is split into files such as fetchSystemData.js, authenticate.js, and verifyPermission.js. The preset routing guard name "name" of the fetchSystemData.js file is "fetchSystemData" for obtaining system data logic, the preset routing guard name "name" of the authenticate.js file is "authenticate" for judging the login status, and the preset routing guard name "name" of the verifyPermission.js file is "verifyPermission" for permission verification. The preset page code files are, for example, the login page and the home page. Then, the preset routing guard name of the login page is the file for obtaining system data logic, and the preset routing guard names of the home page are the file for obtaining system data logic and the file for judging the login status.

[0046] Step S12: Match the destination page address with the corresponding preset routing guard file in the routing information configuration file to obtain the execution order of the routing guard files.

[0047] In this embodiment, the corresponding destination page can be obtained based on the destination page address. It can be understood that there is a third mapping relationship between the destination page and the preset page code file in the routing information configuration file. Therefore, after matching the destination page with the preset page code file, based on the second mapping relationship, the destination page can be matched with the preset routing guard name. Then, developers can intuitively see the preset routing guard name corresponding to the destination page, and thus can determine the routing guard logic corresponding to the destination page, which reduces the workload and cost of developers. Also, because there is a first mapping relationship between the preset routing guard name and the preset routing guard file, there is a fourth mapping relationship between the preset routing guard file and the destination page. Therefore, based on the order of the destination page, the execution order of the routing guard files of the preset routing guard file can be obtained.

[0048] Step S13: Export the method functions in the preset route guard file based on the execution order of the route guard file, and execute the method functions to obtain corresponding execution results.

[0049] In this embodiment, the executing the method functions to obtain corresponding execution results specifically includes: executing the current method function, and if it is monitored that a preset next method needs to be executed, interrupt the execution of the current method function and jump to the corresponding next method function; if the execution result of the next method function meets the second preset condition, re-jump to the corresponding function position in the current method function, and execute the current method function based on the function position.

[0050] Step S14: Determine whether the execution result meets the first preset condition, and if it meets, jump to the destination page corresponding to the destination page address.

[0051] In this embodiment, it can be understood that a route guard refers to a navigation program that reads the data required by the destination page, verifies the status, and then determines whether to jump or cancel before the route allocation destination processing program module of a Web application. Therefore, if the execution result meets the first preset condition, it means that the current condition for jumping to the destination page address is met, that is, the data and status verification of the route guard have passed.

[0052] It can be seen that this application intercepts the jump instruction corresponding to the destination page address and obtains the corresponding route information configuration file; matches the destination page address with the corresponding preset route guard file in the route information configuration file to obtain the execution order of the route guard file; exports the method functions in the preset route guard file based on the execution order of the route guard file, and executes the method functions to obtain corresponding execution results; determines whether the execution result meets the first preset condition, and if it meets, jumps to the destination page corresponding to the destination page address. Thus, it can be seen that this application first intercepts the jump instruction corresponding to the destination page address, that is, it does not allow jumping to the destination page without performing subsequent steps, so it ensures the security of Web application route jumps; matches the destination page address with the corresponding preset route guard file in the route information configuration file to obtain the execution order of the route guard file. Because the matching can be automatically performed when the destination page address is matched with the preset route guard file, it greatly reduces the working time and tasks of developers; exports the method functions in the preset route guard file based on the execution order of the route guard file, and executes the method functions to obtain corresponding execution results. If the execution result meets the first preset condition, it jumps to the destination page corresponding to the destination page address.

[0053] See Figure 2As shown, an embodiment of the present application discloses a specific Web application routing and jumping method, including:

[0054] Step S21: Use a preset configuration information generator to generate a routing information configuration file by using a first mapping relationship between a preset routing guard file and a preset routing guard name, and a second mapping relationship between the preset routing guard name and a preset page code file.

[0055] In this embodiment, before using the preset configuration information generator to generate a routing information configuration file by using a first mapping relationship between a preset routing guard file and a preset routing guard name, and a second mapping relationship between the preset routing guard name and a preset page code file, it further includes: splitting the preset routing guard logic into the preset routing guard file, and determining the first mapping relationship between the preset routing guard file and the preset routing guard name.

[0056] In this embodiment, before using the preset configuration information generator to generate a routing information configuration file by using a first mapping relationship between a preset routing guard file and a preset routing guard name, and a second mapping relationship between the preset routing guard name and a preset page code file, it further includes: configuring the preset routing guard name in a corresponding preset page of the preset page code file to obtain the second mapping relationship between the preset routing guard name and the preset page code file.

[0057] In this embodiment, the preset routing guard file is imported into the corresponding preset page by the preset configuration information generator by using the require method, the first mapping relationship, and the second mapping relationship to generate a routing information configuration file. After the file reading unit of the preset configuration information generator obtains the first mapping relationship and the second mapping relationship, the configuration generation unit of the preset configuration information generator automatically imports the preset routing guard file into the corresponding preset page based on the first mapping relationship and the second mapping relationship by using the require method to generate a routing information configuration file. For example Figure 3A schematic diagram of generating a specific routing information configuration file is shown. The preset page code file pageFile is login.js, and the corresponding preset routing guard name name is fetchSystemData. The corresponding preset routing guard file file is automatically imported using the require method, and the corresponding preset routing guard file is fetchSystemData.js; the preset page code file pageFile is home.js, and the corresponding preset routing guard name name is authenticate. The corresponding preset routing guard file file is automatically imported using the require method, and the corresponding preset routing guard file is authenticate.js; the preset page code file pageFile is home.js, and the corresponding preset routing guard name name is also verifyPermission. The corresponding preset routing guard file file is automatically imported using the require method, and the corresponding preset routing guard file is verifyPermission.js.

[0058] Step S22: Intercept the jump instruction corresponding to the destination page address, and obtain the corresponding routing information configuration file generated by the preset configuration information generator.

[0059] Step S23: Match the destination page address with the corresponding preset routing guard file in the routing information configuration file to obtain the execution order of the routing guard files.

[0060] In this embodiment, the matching of the destination page address with the corresponding preset routing guard file in the routing information configuration file to obtain the execution order of the routing guard files specifically includes: matching the destination page address with the corresponding preset page code file in the routing information configuration file to obtain the page order of the preset page code file; determining the name order of the preset routing guard names based on the page order and the second mapping relationship, and obtaining the execution order of the preset routing guard files based on the name order and the first mapping relationship. The information matching unit in the preset guard logic executor can automatically match the destination page address with the corresponding preset routing guard file in the routing information configuration file, and obtain the execution order of the preset routing guard files based on the name order and the first mapping relationship.

[0061] Step S24: Export the method functions in the preset routing guard file based on the execution order of the routing guard files, and execute the method functions to obtain the corresponding execution results.

[0062] In this embodiment, the execution unit in the preset guard logic executor can be used to execute each method function in the form of a pipeline according to the middleware mode. The middleware mode is a method of organizing code, which divides a large piece of logic into multiple modules. The function bodies of each module call the next function body within themselves, just like a series of connected pipelines. Each method function is executed in a preset order. For example, the logic of executing the method function can be to execute the first method function in sequence. If the second method function needs to be executed in the first method function, then the next method is specified at a designated position within the first method function. The meaning of executing the next method is as follows: at the position where the next method is executed, the logic of the second method function is run. If the second method function is executed successfully, the remaining logic of the first method function is continued. Then, in this application, it can be determined whether the second method function needs to be executed and when to execute the second method function by executing the next method in the first method function. In the first method function, the execution of the next method serves as a dividing line. Since the lower part of the first method function depends on the successful execution of the second method function, the second method function needs to be executed through the next method, so that the execution of two related pieces of logic can be completed within one method function. For example, if the second method function executed by the next method is to obtain data, then the first method function will wait for the second method function to complete the data acquisition and then execute the lower part of the first method function. For example, the upper part of the first method function starts the "loading" animation of the web application and needs to wait for the next method to call the second method function to complete the data acquisition, and then close the "loading" animation in the lower part of the first method function.

[0063] In this embodiment, if, during the execution of the first method function, it is necessary to call the second method function, but if the current conditions do not meet the requirements for executing the second method function, the execution of the second method function will not continue. At this time, it is possible to re-navigate to other pages that meet the conditions. For example, the first method function determines whether the user is currently logged in, and the second method function is related operations that can be performed in the logged-in state. If the first method function determines that the user is currently not logged in, then the execution of the second method function can be interrupted and redirected to the method function corresponding to the login page so that the user can perform the login operation.

[0064] It can be understood that the middleware provided in this embodiment provides more flexible rules. Instead of simply calling each middleware in a loop, it can execute the second method function at a specified position in the first method function, can pause execution in the method function, wait for the server data to be returned and then continue to execute downward, and can split a method function into upper and lower parts. First, execute the upper half of the first method function, and then execute the lower half of the first method function after the second method is executed. This provides a more flexible middleware control method for developers and is applicable to more scenarios.

[0065] Step S25: Determine whether the execution result meets the first preset condition. If it meets, jump to the destination page corresponding to the destination page address.

[0066] In this embodiment, if all method functions are executed completely, the execution result indicates that all the data and status judgments required for accessing the Web application page are satisfied, that is, it indicates that the work of the execution unit has been completed and the destination page can be jumped.

[0067] It can be seen that this application splits the preset route guard logic to obtain several corresponding preset route guard files. Through the pipelined one-level-by-one-level call, it can solve the problems of long and complex logic code of the preset route guard logic and difficult maintenance.

[0068] See Figure 4 As shown in the figure, an embodiment of this application discloses a Web application route jump device, including:

[0069] A configuration file acquisition module 11, configured to intercept a jump instruction corresponding to a destination page address and acquire a corresponding routing information configuration file;

[0070] An execution order acquisition module 12, configured to match the destination page address with a corresponding preset route guard file in the routing information configuration file to obtain the execution order of the route guard file;

[0071] An execution result acquisition module 13, configured to export method functions in the preset route guard file based on the execution order of the route guard file and execute the method functions to obtain corresponding execution results;

[0072] A jump module 14, configured to determine whether the execution result meets the first preset condition. If it meets, jump to the destination page corresponding to the destination page address.

[0073] It can be seen that this application intercepts the jump instruction corresponding to the destination page address and obtains the corresponding routing information configuration file; matches the destination page address with the corresponding preset routing guard file in the routing information configuration file to obtain the execution order of the routing guard file; exports the method functions in the preset routing guard file based on the execution order of the routing guard file, and executes the method functions to obtain the corresponding execution results; determines whether the execution results meet the first preset condition, and if so, jumps to the destination page corresponding to the destination page address. Thus, it can be seen that this application first intercepts the jump instruction corresponding to the destination page address, that is, it does not allow jumping to the destination page without performing subsequent steps, so it ensures the security of Web application route jumps; matches the destination page address with the corresponding preset routing guard file in the routing information configuration file to obtain the execution order of the routing guard file, because when the destination page address is matched with the preset routing guard file, it can be automatically matched, so it greatly reduces the working time and tasks of developers; exports the method functions in the preset routing guard file based on the execution order of the routing guard file, and executes the method functions to obtain the corresponding execution results, and if the execution results meet the first preset condition, it jumps to the destination page corresponding to the destination page address.

[0074] In some specific embodiments, the Web application route jump device further includes:

[0075] A first configuration file generation unit, configured to generate a routing information configuration file by using a preset configuration information generator based on a first mapping relationship between a preset routing guard file and a preset routing guard name and a second mapping relationship between the preset routing guard name and a preset page code file.

[0076] In some specific embodiments, the Web application route jump device further includes:

[0077] A first mapping relationship acquisition unit, configured to split the preset routing guard logic into the preset routing guard files and determine the first mapping relationship between the preset routing guard files and the preset routing guard name.

[0078] In some specific embodiments, the Web application route jump device further includes:

[0079] A second mapping relationship acquisition unit, configured to configure the corresponding preset pages of the preset routing guard name in the preset page code file to obtain the second mapping relationship between the preset routing guard name and the preset page code file.

[0080] In some specific embodiments, the Web application route jump device further includes:

[0081] A second configuration file generation unit, configured to use the require method, the first mapping relationship, and the second mapping relationship through the preset configuration information generator to import the preset routing guard file into the corresponding preset page, so as to generate a routing information configuration file.

[0082] In some specific embodiments, the execution order acquisition module 12 includes:

[0083] A routing guard file execution order acquisition unit, configured to match the destination page address with the corresponding preset page code file in the routing information configuration file to obtain the page order of the preset page code file; determine the name order of the preset routing guard name based on the page order and the second mapping relationship, and obtain the routing guard file execution order of the preset routing guard file based on the name order and the first mapping relationship.

[0084] In some specific embodiments, the execution result acquisition module 13 includes:

[0085] A function execution unit, configured to execute the current method function. If it is monitored that a preset next method needs to be executed, the execution of the current method function is interrupted, and the execution jumps to the corresponding next method function; if the execution result of the next method function meets the second preset condition, the execution jumps back to the corresponding function position in the current method function, and the current method function is executed based on the function position.

[0086] Figure 5 A schematic structural diagram of an electronic device provided by an embodiment of the present application. Specifically, it may include: at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input / output interface 25, and a communication bus 26. Among them, the memory 22 is used to store a computer program, and the computer program is loaded and executed by the processor 21 to implement the relevant steps in the Web application routing jump method executed by the electronic device disclosed in any of the foregoing embodiments.

[0087] In this embodiment, the power supply 23 is used to provide a working voltage for each hardware device on the electronic device; the communication interface 24 can create a data transmission channel between the electronic device and external devices, and the communication protocol it follows is any communication protocol applicable to the technical solution of the present application, and specific limitations are not imposed here; the input / output interface 25 is used to obtain external input data or output data to the outside, and the specific interface type can be selected according to specific application needs, and specific limitations are not imposed here.

[0088] Among them, the processor 21 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 21 may be implemented in at least one hardware form of DSP (Digital Signal Processing), FPGA (Field-Programmable Gate Array), or PLA (Programmable Logic Array). The processor 21 may also include a main processor and a coprocessor. The main processor is a processor used to process data in the wake state, also known as the CPU (Central Processing Unit); the coprocessor is a low-power processor used to process data in the standby state. In some embodiments, the processor 21 may be integrated with a GPU (Graphics Processing Unit), and the GPU is responsible for the rendering and drawing of the content to be displayed on the display screen. In some embodiments, the processor 21 may further include an AI (Artificial Intelligence) processor, and the AI processor is used to process computational operations related to machine learning.

[0089] In addition, the memory 22, as a carrier for resource storage, may be a read-only memory, a random access memory, a disk, or an optical disc, etc. The resources stored thereon include an operating system 221, a computer program 222, data 223, etc., and the storage method may be temporary storage or permanent storage.

[0090] Among them, the operating system 221 is used to manage and control each hardware device and the computer program 222 on the electronic device, so as to enable the processor 21 to perform operations and processing on the massive data 223 in the memory 22. It may be Windows, Unix, Linux, etc. In addition to the computer program that can be used to complete the Web application routing jump method executed by the electronic device disclosed in any of the foregoing embodiments, the computer program 222 may further include a computer program that can be used to complete other specific tasks. The data 223 may include not only the data transmitted by external devices received by the electronic device, but also the data collected by its own input / output interface 25, etc.

[0091] Furthermore, the embodiments of the present application also disclose a computer-readable storage medium. When the computer program stored in the storage medium is loaded and executed by a processor, the method steps executed during the Web application routing jump disclosed in any of the foregoing embodiments are implemented.

[0092] Finally, it should also be noted that in this text, relational terms such as first and second are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the term "comprising", "including" or any other variant thereof is intended to cover non-exclusive inclusion, so that a process, method, article or device comprising a series of elements not only includes those elements, but also includes other elements not expressly listed, or elements inherent to such process, method, article or device. Without further limitation, an element defined by the statement "comprising an..." does not exclude the presence of additional identical elements in the process, method, article or device comprising said element.

[0093] The above has introduced in detail a Web application routing and jumping method, device, equipment and medium provided by the present invention. Specific examples are used in this text to elaborate on the principle and implementation manner of the present invention. The description of the above embodiments is only used to help understand the method and its core idea of the present invention; at the same time, for those of ordinary skill in the art, according to the idea of the present invention, there will be changes in the specific implementation manner and application scope. In summary, the content of this specification should not be construed as a limitation to the present invention.

Claims

1. A Web application routing and jumping method, characterized in that, Including: Intercept the jump instruction corresponding to the destination page address and obtain the corresponding routing information configuration file; before intercepting the jump instruction corresponding to the destination page address, it further includes: generating the routing information configuration file by using a preset configuration information generator with the first mapping relationship between the preset routing guard file and the preset routing guard name and the second mapping relationship between the preset routing guard name and the preset page code file; wherein the initial routing guard logic splits its own logic into multiple individual code files to obtain the preset routing guard file; Match the destination page address with the corresponding preset routing guard file in the routing information configuration file to obtain the execution order of the routing guard files; Export the method functions in the preset routing guard file based on the execution order of the routing guard files and execute the method functions to obtain the corresponding execution results; Judge whether the execution result meets the first preset condition, and if it meets, jump to the destination page corresponding to the destination page address.

2. The Web application routing and jumping method according to claim 1, wherein Before generating the routing information configuration file by using a preset configuration information generator with the first mapping relationship between the preset routing guard file and the preset routing guard name and the second mapping relationship between the preset routing guard name and the preset page code file, it further includes: Split the preset routing guard logic into the preset routing guard files and determine the first mapping relationship between the preset routing guard files and the preset routing guard names.

3. The Web application routing and jumping method according to claim 2, wherein Before generating the routing information configuration file by using a preset configuration information generator with the first mapping relationship between the preset routing guard file and the preset routing guard name and the second mapping relationship between the preset routing guard name and the preset page code file, it further includes: Configure the preset routing guard name in the corresponding preset page of the preset page code file to obtain the second mapping relationship between the preset routing guard name and the preset page code file.

4. The Web application routing and jumping method according to claim 3, wherein The generated routing information configuration file is to import the preset routing guard file into the corresponding preset page by using the require method, the first mapping relationship and the second mapping relationship through the preset configuration information generator to generate the routing information configuration file.

5. The Web application routing and jumping method according to claim 4, wherein The matching of the destination page address with the corresponding preset routing guard file in the routing information configuration file to obtain the execution order of the routing guard files includes: Match the destination page address with the corresponding preset page code file in the routing information configuration file to obtain the page order of the preset page code file; Determine the name order of the preset routing guard names based on the page order and the second mapping relationship, and obtain the execution order of the routing guard files of the preset routing guard files based on the name order and the first mapping relationship.

6. The Web application routing and jumping method according to any one of claims 1 to 5, characterized in that During the execution of the method functions to obtain the corresponding execution, it further includes: Execute the current method function. If it is monitored that the preset next method needs to be executed, interrupt the execution of the current method function and jump to the corresponding next method function; If the execution result of the next method function meets the second preset condition, re-jump to the corresponding function position in the current method function and execute the current method function based on the function position.

7. A Web application routing and jumping device, characterized in that, Comprising: A configuration file acquisition module, configured to intercept a jump instruction corresponding to a destination page address and acquire a corresponding routing information configuration file; wherein, before intercepting the jump instruction corresponding to the destination page address, it further includes: generating a routing information configuration file by a preset configuration information generator using a first mapping relationship between a preset routing guard file and a preset routing guard name and a second mapping relationship between the preset routing guard name and a preset page code file; wherein the initial routing guard logic splits its own logic into multiple individual code files to obtain the preset routing guard file; An execution order acquisition module, configured to match the destination page address with the corresponding preset routing guard file in the routing information configuration file to obtain the execution order of the routing guard file; An execution result acquisition module, configured to export the method functions in the preset routing guard file based on the execution order of the routing guard file and execute the method functions to obtain corresponding execution results; A jump module, configured to determine whether the execution result meets the first preset condition, and if so, jump to the destination page corresponding to the destination page address.

8. An electronic device, characterized in that, Comprising: A memory, configured to store a computer program; A processor, configured to execute the computer program to implement the steps of the Web application routing jump method according to any one of claims 1 to 6.

9. A computer-readable storage medium, characterized in that, For storing a computer program; wherein the computer program, when executed by the processor, implements the steps of the Web application routing jump method according to any one of claims 1 to 6.

Citation Information

Patent Citations

  • Page cache skipping method and device, electronic equipment and storage medium

    CN114036431A

  • WEB performance optimization method and device, computer equipment and storage medium

    CN114282233A