Method and system for realizing cross-framework automatic routing and readable storage medium
By acquiring routing information protocols and monitoring directory file changes in real time, the routing configuration file is automatically updated, solving the problem of unified routing configuration across different platforms and frameworks, and achieving efficient and secure cross-framework and cross-platform route generation.
Patent Information
- Application Number
- CN202411207418.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-30
- Publication Date
- 2026-03-10
AI Technical Summary
Existing technologies cannot achieve unified routing configuration across different endpoints and frameworks, leading to increased repetitive work, complex and error-prone configuration, and significant limitations in routing functionality.
By acquiring routing information protocols, the system constructs project files and intercepts routing information during runtime, monitors directory file changes in real time, automatically updates routing configuration files, and supports cross-platform automatic generation of routing configurations across multiple frameworks.
It enables automatic routing configuration across frameworks and platforms, reducing manual configuration work, improving efficiency, reducing error risks, and supporting unified routing configuration across multiple frameworks.
Smart Images

Figure CN121644356A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of Internet program platform, and in particular relates to a method and system for realizing cross-frame automatic routing and a readable storage medium. BACKGROUND
[0002] WEB is originally a spider web and a net, and in webpage design, it is referred to as a webpage. WEB is widely translated as a network, an Internet, and other technical fields. It is manifested in three forms, namely, hypertext, hypermedia, and hypertext transfer protocol (HTTP).
[0003] However, the current WEB development is mainly based on PC and H5 mobile terminals, and the main technologies used are Vue (Vue series products provide a series of solutions for 3D natural environment animation production and rendering. The Vue series has many different products, which are designed to meet the needs of users at different levels: professional production studios can also meet the needs of 3D free artists) and React (React is a JavaScript library developed by Facebook and widely used for building user interfaces. It occupies an important position in the field of front-end development with its unique design concept and powerful functions), and the packaging tools are mainly webpack and vite. During the development process, there are some repetitive work.
[0004] Currently, the routes on the market cannot realize unified generation of route configurations for different terminals and different frameworks. Generally, different plug-ins need to be called manually, and the current routes on the market do not support custom information expansion. Only existing information can be used, and the function has limitations. Finally, the current routes on the market only provide configuration generation and do not provide configuration parsing. Generally, the front-end route configuration file needs to be added with the corresponding route when a new page is created in the project. Different terminals realize different front-end page route configurations. After a series of complex and time-consuming configurations, the front-end route can be mapped to the page for development. When the route information changes, the configuration file needs to be modified, which increases the risk of errors. SUMMARY
[0005] Therefore, the purpose of the present application is to provide a method and system for realizing cross-frame automatic routing and a readable storage medium to fundamentally solve the problem that the current routes on the market cannot realize unified generation of route configurations for different terminals and different frameworks.
[0006] According to the method for realizing cross-frame automatic routing, the method comprises the following steps: obtaining a route information protocol, constructing a project file according to the route information protocol, and running; Intercept the routing information protocol during operation and obtain the file name, and generate routing information corresponding to the file name based on preset rules; The system monitors changes to directory files in the routing information in real time and automatically updates the routing configuration file based on these changes.
[0007] Furthermore, the routing protocol information includes at least a protocol source and a data source. The protocol source includes at least a source address, a destination address, a technical framework, and a platform. The data source includes at least extensible information such as filename format, filename dynamic parameters, filename, file sorting, and file permissions.
[0008] Furthermore, the platform is a development platform for the target page, which includes at least a PC client and an H5 mobile client, and the source address is a directory file address, wherein the directory file address is used to generate the routing configuration file address.
[0009] Furthermore, the steps of obtaining the routing information protocol, constructing project files based on the routing information protocol, and running the project include: The routing information protocol is defined according to the preset configuration conditions, and the routing extension information is added according to the preset configuration conditions to finally build the project file.
[0010] Furthermore, the step of real-time monitoring of directory file changes in the routing information and automatically updating the routing configuration file based on the directory file changes includes: By parsing the routing configuration file and obtaining the target address in the routing configuration file, the target address is mapped to the target page, and the target page displays the routing configuration file information.
[0011] Furthermore, before the step of real-time monitoring of directory file changes in the routing information and automatically updating the routing configuration file based on the directory file changes, the method further includes: The corresponding routing configuration file is generated based on the routing information. The routing configuration file is formatted to generate a routing file, which is then written into the project file. The changes in the directory files in the project file are monitored in real time, and the routing configuration file is automatically updated based on the changes in the directory files. A system for implementing cross-frame automatic routing according to an embodiment of the present invention, the system comprising: The project building module is used to obtain routing information protocols, build project files based on the routing information protocols, and run them. The interception module is used to intercept the routing information protocol during operation and obtain the file name, and generate routing information corresponding to the file name based on preset rules; The route generation module is used to monitor changes in directory files in the route information in real time and automatically update the route configuration file based on the changes in the directory files.
[0012] The present invention also proposes a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the above-described method for implementing cross-frame automatic routing.
[0013] Compared with existing technologies, the method for implementing cross-framework automatic routing in the above embodiments of the present invention defines a routing configuration information protocol as needed, adds the necessary extended information for routing when creating a new file, so as to facilitate efficient and accurate interception. Through plugin interception, it obtains the desired information and inserts the required information. Finally, after formatting the routing data, Node writes it to the project to generate a routing configuration file. This supports multiple frameworks and routing configuration files required by different platforms. The purpose of this operation is to achieve cross-platform automatic generation and parsing of front-end routing configuration files through a single codebase, supporting multiple frameworks. Furthermore, building corresponding routing configuration files based on corresponding project files can efficiently ensure the security of the routing information protocol, solving the problem that current market routing methods cannot achieve unified generation of routing configurations for different platforms and frameworks. Attached Figure Description
[0014] Figure 1 This is a flowchart of the method for implementing cross-frame automatic routing in the first embodiment of the present invention; Figure 2 This is a flowchart of the method for implementing cross-frame automatic routing in the second embodiment of the present invention; Figure 3 This is a schematic diagram of the system for implementing cross-frame automatic routing in the third embodiment of the present invention.
[0015] The following detailed description of the embodiments will further illustrate the present invention in conjunction with the above-described accompanying drawings. Detailed Implementation
[0016] To facilitate understanding of the present invention, a more complete description will be given below with reference to the accompanying drawings. Several embodiments of the invention are illustrated in the drawings. However, the invention can be implemented in many different forms and is not limited to the embodiments described herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete.
[0017] It should be noted that when a component is said to be "fixed to" another component, it can be directly on the other component or there may be an intervening component. When a component is said to be "connected to" another component, it can be directly connected to the other component or there may be an intervening component. The terms "vertical," "horizontal," "left," "right," and similar expressions used in this document are for illustrative purposes only.
[0018] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains. The terminology used herein in the description of the invention is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention. The term "and / or" as used herein includes any and all combinations of one or more of the associated listed items.
[0019] Example 1 Please see Figure 1 The figure shows a method for implementing cross-frame automatic routing in the first embodiment of the present invention, applied to a vehicle TSP. The method specifically includes steps S01-S03.
[0020] Step S01: Obtain the routing information protocol, construct the project file according to the routing information protocol, and run it.
[0021] It should be noted that the routing protocol information includes at least a protocol source and a data source. The protocol source includes at least a source address, a target address, a technical framework, and a platform. The data source includes at least extensible information such as filename format, dynamic parameters for filenames, filenames, file sorting, and file permissions. The platform refers to the development platform of the target page. In some optional embodiments, the platform can be a PC or an H5 mobile client. The source address refers to the file address of the project directory. The target address refers to the address of the generated routing configuration file. The technical framework is the technology used to develop the target page. In some optional embodiments, it can be Vue, React (with bundling tools Webpack and Vite).
[0022] In practice, the routing information protocol is obtained from the front-end automatic routing database, and the routing information protocol is defined according to the configuration preset conditions. It should be noted that the configuration preset conditions are routing protocol files that the user selects and defines according to the current project file needs, which is understandable to those skilled in the art. Afterwards, the operator can add routing extension information according to the above conditions. The routing extension information includes the protocol source and the data source. Finally, the project file is built and run according to the routing information protocol.
[0023] Step S02: Intercept the routing information protocol during operation and obtain the file name, and generate routing information corresponding to the file name based on preset rules.
[0024] In practical implementation, interceptors are used to intercept project files during runtime. Plugin interception is a technique used to intercept, modify, or block certain behaviors, data, or requests during software or system runtime using specific plugins. This technique is widely used in various scenarios, including but not limited to browser ad blocking, network security protection, and application functionality enhancement. In some optional embodiments, the interceptor can also be a MyBatis interceptor, a form of plugin interception. In persistence layer frameworks like MyBatis, plugin interception allows developers to intercept calls at a specific point in the SQL statement execution process to enhance or modify components such as the Executor, ParameterHandler, and ResultSetHandler. MyBatis plugin interception is implemented using Java's dynamic proxy and chain of responsibility design pattern. After specifying the interceptor in the configuration file, MyBatis inserts the interceptor's logic before and after the corresponding method call, which is what we call generating routing information corresponding to the filename based on preset rules in this step.
[0025] Step S03: Monitor changes in directory files in the routing information in real time and automatically update the routing configuration file based on the changes in directory files.
[0026] In practical implementation, a corresponding routing configuration file is generated based on the routing information. This configuration file is then formatted to generate a routing file, which is written to the project file. The system monitors directory changes in the project file in real time and automatically updates the routing configuration file accordingly. Specifically, Node.js's read / write functionality for routing configuration files is used to read folders, filenames, and extended routing information within a specified directory of the project. In some optional embodiments, during the reading process, certain directory files within that directory can be filtered out and not parsed, generating the necessary routing data. After formatting the routing data, Node.js writes it to the project to generate the routing configuration file. This supports multiple frameworks and different routing configuration files required by different platforms. The purpose of this operation is to achieve cross-platform automatic generation and parsing of front-end routing configuration files with a single codebase, supporting multiple frameworks. Furthermore, building corresponding routing configuration files based on the corresponding project files efficiently ensures the security of routing information protocols.
[0027] In summary, the method for implementing cross-framework automatic routing in the above embodiments of the present invention defines a routing configuration information protocol as needed, adds the necessary extended information for routing when creating a new file to facilitate efficient and accurate interception, and uses a plugin-based interception method to obtain and insert the desired information. Finally, after formatting the routing data, Node writes it to the project to generate a routing configuration file, supporting multiple frameworks and routing configuration files required by different platforms. The purpose of this operation is to achieve cross-platform automatic generation and parsing of front-end routing configuration files through a single codebase, supporting multiple frameworks. At the same time, building corresponding routing configuration files based on corresponding project files can efficiently ensure the security of routing information protocols, solving the problem that current routing solutions on the market cannot achieve unified generation of routing configurations for different platforms and frameworks.
[0028] Example 2 The method for implementing cross-frame automatic routing in the second embodiment of the present invention specifically includes steps S11-S14.
[0029] Step S11: Obtain the routing information protocol, define the routing information protocol according to the preset configuration conditions, add routing extension information according to the preset configuration conditions, and finally build the project file.
[0030] Step S12: Intercept the routing information protocol during operation and obtain the file name, and generate routing information corresponding to the file name based on preset rules.
[0031] Step S13: Generate the corresponding routing configuration file based on the routing information, format the routing configuration file to generate a routing file, write it to the project file, and monitor the directory file changes in the project file in real time to automatically update the routing configuration file based on the directory file changes.
[0032] Step S14: Parse the routing configuration file and obtain the target address in the routing configuration file. Map the target address to the target page, and the target page displays the routing configuration file information.
[0033] It's important to note that this step involves parsing the routing configuration file using a route resolver. Route resolvers play a crucial role in network technology and software development, but their meaning and application vary across contexts. Firstly, in network technology, while routers themselves aren't directly called "route resolvers," they internally contain mechanisms for route resolution. Routers are network layer devices responsible for bridging data frames between two local area networks and selecting the optimal path based on the routing table when forwarding data. Here, "route resolution" refers to the router determining which network interface or next-hop router a data packet should be forwarded to based on its IP address and information in the routing table. Secondly, in software development, especially when building single-page applications (SPAs) or front-end frameworks (such as Angular and React), route resolvers enable navigation between pages on the client side without reloading the entire page. Both are key components for achieving efficient and flexible routing in network technology and software development. In network technology, it helps routers select the best path to forward data packets; in software development, it helps implement page navigation and data prefetching in single-page applications. The route resolver in this application mainly implements the decoding and matching functions of routing configuration files and routing information protocols, supports multiple frameworks and the routing configurations required by different terminals, and provides the information required for mapping to the front-end page and display. In other words, it enables different terminals and multiple frameworks to achieve unified page access functions.
[0034] In summary, the method for implementing cross-frame automatic routing in the above embodiments of the present invention differs from Embodiment 1 in that it adds a route resolver, which mainly performs decoding and matching functions for route configuration files and route information protocols. It supports multiple frameworks and the route configurations required by different ends, and provides information for mapping to the front-end page and display. In other words, it enables different ends and multiple frameworks to achieve a unified page access function.
[0035] Example 3 Another aspect of this invention provides a system for implementing automatic cross-frame routing; please refer to [link / reference needed]. Figure 3 The figure shows a system for implementing cross-frame automatic routing according to a third embodiment of the present invention. The system includes: Project building module 11 is used to obtain routing information protocols, build project files based on routing information protocols, and run them; Interception module 12 is used to intercept routing information protocols during operation and obtain file names, and generate routing information corresponding to the file names based on preset rules; The route generation module 13 is used to monitor changes in directory files in the route information in real time and automatically update the route configuration file based on the changes in directory files.
[0036] Furthermore, in some optional embodiments of the present invention, it also includes: The route resolution module is used to parse the route configuration file and obtain the target address in the route configuration file, map the target address to the target page, and then display the route configuration file information on the target page.
[0037] Example 4 This invention also proposes a computer-readable storage medium storing a computer program that, when executed by a processor, implements the method for implementing cross-frame automatic routing as described above.
[0038] Those skilled in the art will understand that the logic and / or steps represented in the flowcharts or otherwise described herein, for example, can be considered as a ordered list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by, or in conjunction with, an instruction execution system, system, or device (such as a computer-based system, a processor-included system, or other system that can fetch and execute instructions from, an instruction execution system, system, or device). For the purposes of this specification, "computer-readable medium" can mean any system that can contain, store, communicate, propagate, or transmit programs for use by, or in conjunction with, an instruction execution system, system, or device.
[0039] More specific examples of computer-readable media (a non-exhaustive list) include: electrical connections (electronic systems) with one or more wires, portable computer disk drives (magnetic systems), random access memory (RAM), read-only memory (ROM), erasable and editable read-only memory (EPROM or flash memory), fiber optic systems, and portable optical disc read-only memory (CDROM). Furthermore, computer-readable media can even be paper or other suitable media on which the program can be printed, because the program can be obtained electronically, for example, by optically scanning the paper or other medium, followed by editing, interpreting, or otherwise processing as necessary, and then stored in computer memory.
[0040] It should be understood that various parts of the present invention can be implemented in hardware, software, firmware, or a combination thereof. In the above embodiments, multiple steps or methods can be implemented in software or firmware stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, it can be implemented using any one or a combination of the following techniques known in the art: discrete logic circuits having logic gates for implementing logical functions on data signals, application-specific integrated circuits (ASICs) having suitable combinational logic gates, programmable gate arrays (PGAs), field-programmable gate arrays (FPGAs), etc.
[0041] In the description of this specification, references to terms such as "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of the invention. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples.
[0042] The embodiments described above are merely illustrative of several implementations of the present invention, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of the present invention. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of the present invention, and these modifications and improvements all fall within the scope of protection of the present invention. Therefore, the scope of protection of this patent should be determined by the appended claims.
Claims
1. A method for implementing cross-frame automatic routing, the method comprising: The method comprises: acquiring a routing information protocol, constructing a project file according to the routing information protocol and running; intercepting the routing information protocol during running and acquiring a file name, generating routing information corresponding to the file name based on preset rules; real-time monitoring of directory file changes in the routing information and automatic updating of the routing configuration file according to the directory file changes.
2. The method for implementing cross-frame automatic routing according to claim 1, wherein, The routing protocol information at least includes a protocol source and a data source, wherein the protocol source at least includes a source address, a target address, a technical framework and a platform, and the data source at least includes file name format, file name dynamic parameters, file name, file sorting and file permission and other expandable information.
3. The method of claim 2, wherein, The platform is a development platform of a target page, at least including a PC end and an H5 mobile end, and the source address is a directory file address, which is used to generate the routing configuration file address.
4. The method of claim 3, wherein, The step of acquiring the routing information protocol, constructing a project file according to the routing information protocol and running comprises: defining the routing information protocol according to preset conditions, adding routing expansion information corresponding to the preset configuration conditions according to rules, and finally constructing the project file.
5. The method of claim 4, wherein, The step of real-time monitoring of directory file changes in the routing information and automatic updating of the routing configuration file according to the directory file changes comprises: mapping the target address to the target page by parsing the target address in the routing configuration file and acquiring the target address in the routing configuration file, and displaying the routing configuration file information by the target page.
6. The method of claim 5, wherein, Before the step of real-time monitoring of directory file changes in the routing information and automatic updating of the routing configuration file according to the directory file changes, the step further comprises: generating a corresponding routing configuration file according to the routing information, performing format processing on the routing configuration file to generate a routing file, writing the routing file into the project file, and real-time monitoring of directory file changes in the project file and automatic updating of the routing configuration file according to the directory file changes.
7. A system for implementing cross-frame automatic routing, the system comprising: The system comprises: a project construction module, configured to acquire a routing information protocol, construct a project file according to the routing information protocol and run; an intercepting module, configured to intercept the routing information protocol during running and acquire a file name, generate routing information corresponding to the file name based on preset rules; a routing generation module, configured to real-time monitoring of directory file changes in the routing information and automatic updating of the routing configuration file according to the directory file changes.
8. A computer-readable storage medium having stored thereon a computer program, characterized in that, The program is executed by the processor to implement the method for realizing cross-frame automatic routing according to any one of claims 1-6.