A routing processing method and device, a storage medium and an electronic device
Patent Information
- Application Number
- CN202311372226.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-10-23
- Publication Date
- 2026-09-18
- Estimated Expiration
- 2043-10-23
AI Technical Summary
[0004]有鉴于此,本发明提供一种路由处理方法、装置、存储介质及电子设备,以解决增加新的路由地址的操作复杂,效率较低,进而使得基于路由地址生成路由对象的生成过程复杂,效率低的问题
[0040]This invention provides a routing processing method, apparatus, storage medium, and electronic device. In this invention, upon determining that a user has adjusted routing configuration information, the adjusted target routing configuration information is obtained, and routing address generation rules are acquired. Based on the hierarchical relationship of each sub-information in the target routing configuration information and the routing address generation rules, a routing address corresponding to each sub-information is generated. That is, this invention can generate routing addresses corresponding to sub-information in the target routing configuration information based on user operations, realizing dynamic changes in routing addresses. Therefore, when adding a new routing address, only the user needs to adjust the routing configuration information, eliminating the need for developers to rewrite and deploy code, simplifying operations and improving efficiency. Furthermore, after obtaining the changed routing address, the page template identifier configured for each sub-information can be obtained, and a routing object for that sub-information can be generated based on the corresponding routing address and the page template identifier, further improving the efficiency of routing object generation.
Smart Images

Figure CN117439945B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of route generation, and more specifically, to a route processing method, apparatus, storage medium, and electronic device. Background Technology
[0002] In front-end frameworks such as Vue, the list of route addresses used when generating route objects is pre-written in the front-end code. When the front-end project starts, it needs to obtain the pre-written list of route addresses to achieve a dynamic effect.
[0003] Since the list of route addresses is hardcoded, adding a new route address requires developers to rewrite and deploy the code for it to take effect. This makes adding a new route address complex and inefficient, which in turn makes generating route objects based on route addresses inefficient. Summary of the Invention
[0004] In view of this, the present invention provides a routing processing method, apparatus, storage medium and electronic device to solve the problems that adding new routing addresses is complex and inefficient, which in turn makes the process of generating routing objects based on routing addresses complex and inefficient.
[0005] To solve the above-mentioned technical problems, the present invention adopts the following technical solution:
[0006] A routing processing method, comprising:
[0007] Once it is determined that the user has adjusted the routing configuration information, obtain the adjusted target routing configuration information;
[0008] Obtain the routing address generation rules; the routing address generation rules include sub-rules for routing address generation at different levels;
[0009] Based on the hierarchical relationship of each sub-information in the target routing configuration information and the routing address generation rules, a routing address corresponding to each sub-information is generated;
[0010] Obtain the page template identifier configured for each of the sub-information, and generate the routing object of the sub-information based on the routing address corresponding to the sub-information and the page template identifier.
[0011] Optionally, based on the hierarchical relationship of each sub-information in the target routing configuration information and the routing address generation rules, a routing address corresponding to each sub-information is generated, including:
[0012] Based on the hierarchical relationship of each sub-information in the target routing configuration information, each sub-information is obtained sequentially and used as the target sub-information;
[0013] Determine the level of the target sub-information and obtain the target route address generation sub-rule corresponding to the level in the route address generation rule; the target route address generation sub-rule includes: multiple route address keywords;
[0014] Based on the hierarchy and content of the target sub-information, the content of each routing address keyword in the target routing address generation sub-rule is determined to generate the routing address corresponding to the target sub-information.
[0015] Optionally, a route object for the sub-information is generated based on the route address corresponding to the sub-information and the page template identifier, including:
[0016] Obtain the page name and keyword information corresponding to the sub-information;
[0017] Add the route address, the page template identifier, the page name, and the keyword information to the route object code template to generate the route object for the sub-information.
[0018] Optionally, after generating the route object of the sub-information based on the route address corresponding to the sub-information and the page template identifier, the method further includes:
[0019] Generate a list of route objects according to their data hierarchy and store them in the backend database.
[0020] Optionally, after generating the list of route objects according to the data hierarchy of the route objects, the following may also be included:
[0021] Generate the directory corresponding to the list of route objects.
[0022] Optionally, after generating the directory from the routing object based on each of the sub-information in the target routing configuration information, the method further includes:
[0023] Get the user's click actions on directory entries in the directory;
[0024] Obtain keyword information from the routing object corresponding to the directory entry, and query the data to be displayed corresponding to the keyword information from the backend database;
[0025] The data to be displayed is rendered in the page template corresponding to the page template identifier in the routing object.
[0026] A routing processing device, comprising:
[0027] The information acquisition module is used to acquire the adjusted target route configuration information when it is determined that the user has adjusted the route configuration information.
[0028] The rule acquisition module is used to acquire routing address generation rules; the routing address generation rules include routing address generation sub-rules at different levels;
[0029] The route generation module is used to generate a route address corresponding to each of the sub-information based on the hierarchical relationship of each sub-information in the target route configuration information and the route address generation rules;
[0030] The object generation module is used to obtain the page template identifier configured for each of the sub-information, and generate the routing object of the sub-information according to the routing address corresponding to the sub-information and the page template identifier.
[0031] Optionally, the route generation module includes:
[0032] The information acquisition submodule is used to sequentially acquire each piece of information based on the hierarchical relationship of each piece of information in the target routing configuration information, and use it as the target sub-information;
[0033] The rule acquisition submodule is used to determine the level of the target sub-information and acquire the target route address generation sub-rule corresponding to the level in the route address generation rule; the target route address generation sub-rule includes: multiple route address keywords;
[0034] The address generation submodule is used to determine the content of each routing address keyword in the target routing address generation sub-rule according to the hierarchy and content of the target sub-information, so as to generate the routing address corresponding to the target sub-information.
[0035] A computer-readable storage medium storing at least one instruction that, when executed by a processor, implements the routing processing method described above.
[0036] An electronic device includes: a memory and a processor;
[0037] The memory is used to store programs;
[0038] The processor calls the program and executes one of the routing processing methods described above.
[0039] Compared with the prior art, the present invention has the following beneficial effects:
[0040] This invention provides a routing processing method, apparatus, storage medium, and electronic device. In this invention, upon determining that a user has adjusted routing configuration information, the adjusted target routing configuration information is obtained, and routing address generation rules are acquired. Based on the hierarchical relationship of each sub-information in the target routing configuration information and the routing address generation rules, a routing address corresponding to each sub-information is generated. That is, this invention can generate routing addresses corresponding to sub-information in the target routing configuration information based on user operations, realizing dynamic changes in routing addresses. Therefore, when adding a new routing address, only the user needs to adjust the routing configuration information, eliminating the need for developers to rewrite and deploy code, simplifying operations and improving efficiency. Furthermore, after obtaining the changed routing address, the page template identifier configured for each sub-information can be obtained, and a routing object for that sub-information can be generated based on the corresponding routing address and the page template identifier, further improving the efficiency of routing object generation. Attached Figure Description
[0041] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.
[0042] Figure 1 A flowchart of a routing processing method provided in an embodiment of the present invention;
[0043] Figure 2 This is a schematic diagram of routing configuration information provided in an embodiment of the present invention;
[0044] Figure 3 A flowchart of a method for generating a routing address provided in an embodiment of the present invention;
[0045] Figure 4 A scenario flowchart of a routing processing method provided in an embodiment of the present invention;
[0046] Figure 5 A schematic diagram of a page template provided in an embodiment of the present invention;
[0047] Figure 6 A schematic diagram of the content of a routing object provided in an embodiment of the present invention;
[0048] Figure 7 A schematic diagram illustrating another routing object content provided in an embodiment of the present invention;
[0049] Figure 8This is a schematic diagram of a routing processing device provided in an embodiment of the present invention. Detailed Implementation
[0050] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0051] In front-end frameworks, such as Vue (a progressive front-end framework for building user interfaces), the list of route addresses used when generating the route object (in front-end technology, a route is a state manager for different front-end pages, which can achieve the effect of multiple pages directly through front-end technology without sending requests to the back-end) is hardcoded in the front-end code. When the front-end project starts, it needs to obtain the hardcoded list of route addresses to achieve a dynamic effect.
[0052] Since the list of route addresses is hardcoded, adding a new route address requires developers to rewrite and deploy the code for it to take effect. This makes adding a new route address complex and inefficient, which in turn makes generating route objects based on route addresses inefficient.
[0053] In addition, the list of route addresses can also be stored in the backend database and retrieved via an API when the frontend project starts. If a new route address is added, even if it's added to the route list, the corresponding page still needs to be configured in the frontend code; that is, developers need to rewrite and redeploy the code for it to take effect.
[0054] To avoid the problems of high workload and low efficiency caused by rewriting code, routes can be generated through interface configuration on the backend platform. However, this requires users to have a certain coding foundation, write simple JS (JavaScript) code, then configure, and then redeploy. This requires high technical skills from users and cannot generate route addresses and route objects without rewriting code, nor can it dynamically and in real time generate route addresses and objects without the user's awareness during project operation.
[0055] To address this, this invention provides a routing processing method, apparatus, storage medium, and electronic device. This method generates corresponding routing addresses based on user actions and pre-reserves page templates in the code according to business logic. Subsequently, a mapping relationship between the page templates and routing addresses is established, thereby dynamically generating a routing object in real time and storing it in the backend database. Whenever a user reopens the software, the frontend retrieves the latest routing address object from the backend interface. This ensures that the data added by the user on the frontend page and the dynamically generated routing objects remain permanently valid.
[0056] Specifically, in this invention, upon determining that a user has adjusted their routing configuration information, the adjusted target routing configuration information is obtained, routing address generation rules are acquired, and based on the hierarchical relationship of each sub-information in the target routing configuration information and the routing address generation rules, a routing address corresponding to each sub-information is generated. That is, this invention can generate routing addresses corresponding to sub-information in the target routing configuration information based on user operations, achieving dynamic changes in routing addresses. Therefore, when adding a new routing address, only the user needs to adjust the routing configuration information, eliminating the need for developers to rewrite and deploy code, simplifying operations and improving efficiency. Furthermore, after obtaining the changed routing address, the page template identifier configured for each sub-information can also be obtained, and a routing object for that sub-information can be generated based on the routing address corresponding to that sub-information and the page template identifier, further improving the efficiency of routing object generation.
[0057] It should be noted that the front-end framework used in this invention can be such as Vue, React, or Angular. The specific framework used can be selected according to the actual scenario. Regardless of the framework used, all of them support one of the routing processing methods, devices, storage media, and electronic devices in this invention.
[0058] Based on the above, refer to Figure 1 This invention provides a routing processing method, which may include:
[0059] S11. If it is determined that the user has adjusted the routing configuration information, obtain the adjusted target routing configuration information.
[0060] In this embodiment, the routing configuration information can be business information, that is, the business information is reused to generate routing addresses and routing objects as routing configuration information.
[0061] In the business information, users can configure it according to actual business needs. The business information can include multiple data, and there can be a hierarchical relationship between the multiple data. For example, data 1, data 2, data 3, and data 4 are parallel, data 1 includes data 1-1 and data 1-2, and data 1-1 includes data 1-1-1 and data 1-1-2, etc.
[0062] Users can perform add, delete, and modify operations on business information, such as deleting data 1-1-2, adding data 1-1-3, and changing the content of data 1-1-2. Regardless of the operation, it is considered that the user has adjusted the business information, that is, adjusted the routing configuration information.
[0063] Business information is usually stored in the form of tables, such as Excel spreadsheets. When a user opens an application configured with this business information, such as the XXX system, the front end retrieves the latest list of routing objects from the back end database through an interface and renders it to the side directory, which the user can see on the application interface.
[0064] It should be noted that the directory generated in this embodiment corresponds to the business information; that is, the generated directory is the directory corresponding to the business information. For details, please refer to [link / reference needed]. Figure 2 The left-hand menu.
[0065] When a user adds, deletes, or modifies at least one piece of data in the business information section of an application page, such as page A, the updated business information will be obtained, which is the updated Excel spreadsheet data, i.e., the adjusted target route configuration information, and then the subsequent route address generation operation will be triggered.
[0066] S12. Obtain the routing address generation rules.
[0067] In practical applications, the routing address generation rules include sub-rules for routing address generation at different levels.
[0068] Generally, routing address generation sub-rules can be categorized into first-level, second-level, third-level, and fourth-level routing address generation sub-rules, etc. Lower-level routing address generation sub-rules are related to the higher-level routing address generation sub-rules and are generated by adding the routing address keywords of the current level to the routing address keywords in the higher-level routing address generation sub-rules.
[0069] For example, a sub-rule for generating a first-level route address could be: business keyword + index.
[0070] Among them, the business keyword can be a fixed word of the application, such as competitionDisplay. The index can be configured as the name of the first-level route, such as data1, data2, etc., or it can be configured as the identifier of the first-level route, such as 0, 1, 2, etc. Then the first-level route address can be such as competitionDisplay0.
[0071] It should be noted that when there are no duplicate names among primary routes, either the name or the identifier can be used as the index. However, if there are duplicate names among primary routes, using the name as the index may result in the inability to distinguish between duplicate routes. Therefore, in this case, the identifier should be chosen as the index.
[0072] Sub-rules for generating secondary route addresses can be, for example, business keyword + index + name.
[0073] Here, name is the name of the secondary route. For example, if data is 11, the secondary route address can be competitionDisplay0data11.
[0074] A sub-rule for generating a third-level routing address can be, for example, business keyword + index + index + name.
[0075] The sub-rule for generating a level 4 routing address can be like this: business keyword + index + index + index + name. The explanations for level 3 and 4 routing address generation sub-rules are the same as those for level 1 and 2. Furthermore, the sub-rules for level 5, 6, and beyond are similar; simply append the corresponding index and name. This recursive approach allows for multi-level routing addresses while maintaining the global uniqueness of the routes.
[0076] S13. Based on the hierarchical relationship of each sub-information in the target routing configuration information and the routing address generation rules, generate a routing address corresponding to each sub-information.
[0077] In this embodiment, for example, the routing configuration information includes data 1, data 2, data 3, and data 4 in a parallel relationship. Data 1 includes data 1-1 and data 1-2, and data 1-1 includes data 1-1-1 and data 1-1-2, etc. Therefore, it is necessary to generate the routing address for each data item sequentially, which is referred to as the sub-information routing address in this embodiment. That is, it is necessary to generate the routing address for each sub-information such as data 1, data 1-2, and data 1-1-2.
[0078] It should be noted that, since there is a hierarchical relationship between the various sub-information items, such as data 1 including data 1-1 and data 1-2, and data 2 following data 1, the data list composed of sub-information items is traversed according to this hierarchical traversal.
[0079] In another implementation of the present invention, reference is made to... Figure 3 Step S13 may include:
[0080] S21. Based on the hierarchical relationship of each sub-information in the target routing configuration information, obtain each sub-information in sequence and use it as the target sub-information.
[0081] Specifically, for example, the routing configuration information includes data such as data 1, data 2, data 3, and data 4, which are in a parallel relationship. Under data 1, there are data 1-1 and data 1-2, and under data 1-1, there are data 1-1-1 and data 1-1-2, and so on.
[0082] According to the hierarchical relationship, data 2 is located after data 1. Data 1 includes data 1-1 and data 1-2. Data 1-1 includes data 1-1-1 and data 1-1-2. Therefore, data 1, data 1-1, data 1-1-1, data 1-1-2, data 1-2, data 2, data 3, and data 4 are regarded as target sub-information in sequence.
[0083] S22. Determine the level of the target sub-information and obtain the target route address generation sub-rule corresponding to the level in the route address generation rule; the target route address generation sub-rule includes: multiple route address keywords.
[0084] Specifically, taking data 1 as the target sub-information as an example, if the level is level one, then the level one routing address is obtained to generate a sub-rule, which is then used as the target routing address to generate a sub-rule. If data 1-1-2 is at level three, then the level three routing address is obtained to generate a sub-rule.
[0085] Each target route address generation sub-rule includes multiple route address keywords, such as the business keyword, index, and name mentioned above. The business keyword can remain fixed, so in this embodiment, only the values of index and name need to be determined.
[0086] S23. Based on the hierarchy and content of the target sub-information, determine the content of each routing address keyword in the target routing address generation sub-rule to generate the routing address corresponding to the target sub-information.
[0087] In this embodiment, taking data 1 as the target sub-information as an example, the level is 1. If the index in the first-level routing address generation sub-rule is configured as an identifier, and the identifier of data 1 is 0, then the index is 0. If the business keyword is competitionDisplay, then the routing address of data 1 is competitionDisplay0.
[0088] The routing address for data 1-1 is competitionDisplay0 for data 11.
[0089] To enable those skilled in the art to more clearly understand the process of generating routing addresses in this invention, the following is combined with... Figure 4 Steps S31-311 in the text will be explained.
[0090] Specifically, after a user opens the application, the front end retrieves the latest route list from the back end database via an interface. This list typically refers to a list of route objects, which is then rendered into the sidebar directory, allowing users to view this directory on the application interface.
[0091] If a user adds a new data entry on the current business information page, such as page A, the updated table data will be retrieved, which is the Excel data mentioned above.
[0092] Then, iterate through the data list composed of sub-information, checking if the index is less than the list length. For example, if there are four data items in the first level, the list length is 4. The index usually starts from 0, so when the index is not less than 4, it means that the four first-level data items and the data contained within them have been processed. In practical applications, we first process data 1 and its sub-data items, then data 2, and then data 3 and 4 in sequence. After processing data 4 and its sub-data items, the index becomes 4, which is not less than the list length, indicating that processing is complete.
[0093] When it is determined that the index is less than 4, such as when processing data 1, the index is 0. Based on the data content and the routing generation rules, a first-level route address is generated. After processing data 1, the child data 1-1 is processed. At this time, the same as the index length judgment rule is used to determine whether the child index is less than the child data length. If it is less, a second-level route address is generated based on the data content and the routing generation rules. Then, the child data 1-1-1 is judged, and the route address of data 1-1-1 is generated. After generating the route address of data 1-1-1, since data 1-1-1 no longer contains child data, data 1-1-2 is processed. After processing, the other child data 1-2 of data 1 is processed, and so on, until all the child data of data 1 is processed. Then, data 2 is processed, and the above steps are followed until data 4 and its child data are processed. After processing, multiple routing addresses at different levels can be obtained. At this point, the sidebar page directory is updated based on the routing addresses, and then the latest route list, which refers to the route address list, is updated to the backend database.
[0094] It's important to note that since the route addresses are not yet mapped to corresponding pages, the pages cannot be accessed at this point. Access can be achieved after the route addresses are mapped to the pages (i.e., after generating the route objects), by updating the sidebar page directory based on the route objects. Then, the latest list of route objects should be updated in the backend database.
[0095] S14. Obtain the page template identifier configured for each of the sub-information, and generate the routing object of the sub-information according to the routing address corresponding to the sub-information and the page template identifier.
[0096] In this embodiment, page templates are reserved in the code in advance according to business logic, and the correspondence between data and page templates is set. For example, first-level data uses page template one, second-level data uses page template two, third-level data uses page template three, and so on. The specific correspondence is configured according to the actual scenario.
[0097] You can refer to the example of the page template. Figure 5 It should be noted that, Figure 5 The page template already contains data retrieved from the backend database. In actual application, if the page template does not contain data, it will be a bar chart with multiple data to be filled. The horizontal and vertical axes, length, data, and the meaning and name of the bar chart all need to be retrieved from the backend database.
[0098] The page template will be configured with a corresponding page template identifier, such as page template one, page template two, etc. When using the page template later, the corresponding page template will be queried based on the page template identifier and rendered to obtain the final page template with added data.
[0099] Page templates can also be configured in Vue files, meaning the page template is pre-defined in the corresponding Vue file. In this example, the template can be:
[0100] '@ / views / modules / competitiveAnalysis / competitionDisplay / index.vue'.
[0101] The routing object in this invention may include information such as the page name corresponding to the information, keyword information, routing address, and the page template identifier, as detailed in the following reference. Figure 6 .
[0102] Figure 6 The document provides the content of the route object corresponding to the first-level route address. Here, path represents the route address, name represents the route name, and component represents the page template identifier. The specific information can be obtained by querying the correspondence between the data and the page template identifier. For example, if the sub-information being processed is first-level data, then the page template identifier is page template one.
[0103] The meta tag is for comments, specifically including title, noCache, parentName, and info. title represents the page name, i.e., the target item name, which will ultimately map to the page name in the project directory menu list. noCache represents a system attribute. parentName represents the parent page, such as a system name. info contains key information that can represent a specific page, such as the unique identifier key for each piece of data in page A, which is the retrieval information used when querying data from the backend database. Specific data access parameters for the page (the unique identifier key corresponding to each piece of data in page A) can be passed to the template page via the info field through routing. In this embodiment, noCache and parentName can be fixed, while title and info can specifically represent data content, such as data 1, data 1-2, etc., as mentioned above.
[0104] To generate route objects quickly, you can configure a route object code template. The path, component, title, and info fields in the template are initially blank; you need to add data as needed. Then, add the path, component, title, and info fields to the route object code template to obtain the desired data. Figure 6 .
[0105] For secondary routing objects, please refer to Figure 7 The specific implementation is similar to the process of generating routing objects.
[0106] In summary, generating a route object for the sub-information based on its corresponding route address and page template identifier can include:
[0107] Obtain the page name and keyword information corresponding to the sub-information, and add the route address, the page template identifier, the page name, and the keyword information to the route object code template to generate the route object of the sub-information.
[0108] It should be noted that the specific fields configured in the routing object code template can be added or deleted according to the actual scenario. This embodiment of the invention does not limit the number or content of the fields.
[0109] After generating the routing objects for each sub-information through the above steps, a list of routing objects can be generated according to the data hierarchy of the routing objects and stored in the backend database.
[0110] In this embodiment, the data hierarchy can be a hierarchy of routing objects. For example, the routing object for data 1 is level 1, the routing object for data 1-1 is level 2, and the routing object for data 1-1-1 is level 3. A list of routing objects is generated according to the hierarchy and added to the existing routing list of the project, which takes effect in real time. At the same time, the front end sends the latest list of routing objects to the back end and stores it in the back end database. When storing, it can be stored in string format.
[0111] In this step, the latest route object list is updated to the database via an interface to ensure that the latest route object list is displayed every time the application is accessed, and to ensure that dynamically generated route objects are permanently valid.
[0112] In this embodiment, upon determining that the user has adjusted the routing configuration information, the adjusted target routing configuration information is obtained, and routing address generation rules are acquired. Based on the hierarchical relationship of each sub-information in the target routing configuration information and the routing address generation rules, a routing address corresponding to each sub-information is generated. That is, in this invention, routing addresses corresponding to sub-information in the target routing configuration information can be generated according to user operations, realizing dynamic changes in routing addresses. Therefore, when adding a new routing address, only the user needs to adjust the routing configuration information, eliminating the need for developers to rewrite and deploy code, simplifying operations and improving efficiency. Furthermore, after obtaining the changed routing address, the page template identifier configured for each sub-information can also be obtained, and a routing object for that sub-information can be generated based on the routing address corresponding to that sub-information and the page template identifier, further improving the efficiency of routing object generation.
[0113] In addition, since page templates are reserved in the code in advance, a mapping relationship between page templates and routing addresses can be established after dynamic routing addresses are generated based on user operations. That is, a routing object is generated to ensure that the routing address is valid and the corresponding page can be accessed.
[0114] Furthermore, this invention, based on frameworks such as Vue, provides a solution for dynamically editing routes and directories in real-time based on user data during program execution. This eliminates the need for developers to modify or redeploy code. Within a Vue project, routes and menus are dynamically added or deleted in real-time based on user-added data, providing a solution from scratch. It eliminates the need for developers to redevelop and redeploy code, and requires no programming experience from users. Routes are generated dynamically and in real-time during user interaction, achieving true real-time and dynamic functionality, significantly improving work efficiency and user experience.
[0115] Based on the above, in another embodiment of the present invention, after generating a list of routing objects according to the data hierarchy of the routing objects, a directory corresponding to the list of routing objects can also be generated.
[0116] Specifically, the list of route objects is rendered to obtain a directory, which can be a side page directory displayed on the side for easy viewing by users. Routes and side page directories can be generated in real time and dynamically based on user data operations, achieving true real-time and dynamic capabilities, which greatly improves work efficiency and user experience.
[0117] In this embodiment, the routing information is added to the project directory menu list, so that clicking the corresponding directory will jump to the template page.
[0118] In detail, after the directory is generated, users can access pages by clicking on directory entries. Specifically, when a user clicks on a directory entry, the system retrieves the user's click action. For example, if the user clicks on the directory entry for data 1, it determines that the user needs to access the page corresponding to data 1. The system then retrieves the keyword information from the routing object corresponding to the directory entry, queries the backend database for the data to be displayed corresponding to the keyword information, and renders the data to be displayed in the page template corresponding to the page template identifier in the routing object.
[0119] Specifically, when generating the route object, the keyword is already passed to the page template corresponding to the page template identifier in the route object of the directory entry clicked by the user through the info field in the route. After receiving the keyword, before the page is rendered after the user clicks the directory entry, that is, during the lifecycle creation of the created stage, the page template obtains the info parameter passed in from the route object, retrieves the page data to be displayed from the backend through the keyword, and completes the page rendering.
[0120] In this embodiment, after dynamically creating the routing address, the corresponding page can be accessed according to the user's page access operation, realizing the query and access of user data at any time.
[0121] Based on the above-described embodiments of the routing processing method, another embodiment of the present invention provides a processing device, referring to... Figure 8 It can include:
[0122] The information acquisition module 11 is used to acquire the adjusted target route configuration information when it is determined that the user has adjusted the route configuration information;
[0123] The rule acquisition module 12 is used to acquire routing address generation rules; the routing address generation rules include routing address generation sub-rules at different levels;
[0124] The route generation module 13 is used to generate a route address corresponding to each of the sub-information based on the hierarchical relationship of each sub-information in the target route configuration information and the route address generation rules;
[0125] The object generation module 14 is used to obtain the page template identifier configured for each of the sub-information, and generate the routing object of the sub-information according to the routing address corresponding to the sub-information and the page template identifier.
[0126] Furthermore, the route generation module includes:
[0127] The information acquisition submodule is used to sequentially acquire each piece of information based on the hierarchical relationship of each piece of information in the target routing configuration information, and use it as the target sub-information;
[0128] The rule acquisition submodule is used to determine the level of the target sub-information and acquire the target route address generation sub-rule corresponding to the level in the route address generation rule; the target route address generation sub-rule includes: multiple route address keywords;
[0129] The address generation submodule is used to determine the content of each routing address keyword in the target routing address generation sub-rule according to the hierarchy and content of the target sub-information, so as to generate the routing address corresponding to the target sub-information.
[0130] Furthermore, the object generation module 14 is specifically used for:
[0131] Obtain the page name and keyword information corresponding to the sub-information, and add the route address, the page template identifier, the page name, and the keyword information to the route object code template to generate the route object of the sub-information.
[0132] Furthermore, it also includes:
[0133] The data storage module is used to generate a list of routing objects according to the data hierarchy of the routing objects and store them in the backend database.
[0134] Furthermore, it also includes:
[0135] The directory generation module is used to generate the directories corresponding to the list of route objects.
[0136] Furthermore, it also includes:
[0137] An operation acquisition module is used to acquire user click operations on directory entries in the directory;
[0138] The data determination module is used to obtain keyword information from the routing object corresponding to the directory entry, and query the data to be displayed corresponding to the keyword information from the backend database.
[0139] The data display module is used to render the data to be displayed in the page template corresponding to the page template identifier in the routing object.
[0140] In this embodiment, upon determining that the user has adjusted the routing configuration information, the adjusted target routing configuration information is obtained, and routing address generation rules are acquired. Based on the hierarchical relationship of each sub-information in the target routing configuration information and the routing address generation rules, a routing address corresponding to each sub-information is generated. That is, in this invention, routing addresses corresponding to sub-information in the target routing configuration information can be generated according to user operations, realizing dynamic changes in routing addresses. Therefore, when adding a new routing address, only the user needs to adjust the routing configuration information, eliminating the need for developers to rewrite and deploy code, simplifying operations and improving efficiency. Furthermore, after obtaining the changed routing address, the page template identifier configured for each sub-information can also be obtained, and a routing object for that sub-information can be generated based on the routing address corresponding to that sub-information and the page template identifier, further improving the efficiency of routing object generation.
[0141] It should be noted that the working process of each module and sub-module in this embodiment is described in the corresponding descriptions in the above embodiments, and will not be repeated here.
[0142] Based on the above-described embodiments of the routing processing method and apparatus, another embodiment of the present invention provides a computer-readable storage medium, characterized in that the computer-readable storage medium stores at least one instruction, which, when executed by a processor, implements the above-described routing processing method.
[0143] In this embodiment, upon determining that the user has adjusted the routing configuration information, the adjusted target routing configuration information is obtained, and routing address generation rules are acquired. Based on the hierarchical relationship of each sub-information in the target routing configuration information and the routing address generation rules, a routing address corresponding to each sub-information is generated. That is, in this invention, routing addresses corresponding to sub-information in the target routing configuration information can be generated according to user operations, realizing dynamic changes in routing addresses. Therefore, when adding a new routing address, only the user needs to adjust the routing configuration information, eliminating the need for developers to rewrite and deploy code, simplifying operations and improving efficiency. Furthermore, after obtaining the changed routing address, the page template identifier configured for each sub-information can also be obtained, and a routing object for that sub-information can be generated based on the routing address corresponding to that sub-information and the page template identifier, further improving the efficiency of routing object generation.
[0144] Based on the above-described embodiments of the routing processing method and apparatus, another embodiment of the present invention provides an electronic device, including: a memory and a processor;
[0145] The memory is used to store programs;
[0146] The processor calls the program and executes one of the routing processing methods described above.
[0147] Specifically, a routing processing method includes:
[0148] Once it is determined that the user has adjusted the routing configuration information, obtain the adjusted target routing configuration information;
[0149] Obtain the routing address generation rules; the routing address generation rules include sub-rules for routing address generation at different levels;
[0150] Based on the hierarchical relationship of each sub-information in the target routing configuration information and the routing address generation rules, a routing address corresponding to each sub-information is generated;
[0151] Obtain the page template identifier configured for each of the sub-information, and generate the routing object of the sub-information based on the routing address corresponding to the sub-information and the page template identifier.
[0152] Furthermore, based on the hierarchical relationship of each sub-information in the target routing configuration information and the routing address generation rules, a routing address corresponding to each sub-information is generated, including:
[0153] Based on the hierarchical relationship of each sub-information in the target routing configuration information, each sub-information is obtained sequentially and used as the target sub-information;
[0154] Determine the level of the target sub-information and obtain the target route address generation sub-rule corresponding to the level in the route address generation rule; the target route address generation sub-rule includes: multiple route address keywords;
[0155] Based on the hierarchy and content of the target sub-information, the content of each routing address keyword in the target routing address generation sub-rule is determined to generate the routing address corresponding to the target sub-information.
[0156] Further, based on the routing address corresponding to the sub-information and the page template identifier, a routing object for the sub-information is generated, including:
[0157] Obtain the page name and keyword information corresponding to the sub-information;
[0158] Add the route address, the page template identifier, the page name, and the keyword information to the route object code template to generate the route object for the sub-information.
[0159] Furthermore, after generating the route object for the sub-information based on the route address corresponding to the sub-information and the page template identifier, the method further includes:
[0160] Generate a list of route objects according to their data hierarchy and store them in the backend database.
[0161] Furthermore, after generating the list of route objects according to their data hierarchy, the process also includes:
[0162] Generate the directory corresponding to the list of route objects.
[0163] Furthermore, after generating the directory from the route object based on each of the sub-information in the target route configuration information, the method further includes:
[0164] Get the user's click actions on directory entries in the directory;
[0165] Obtain keyword information from the routing object corresponding to the directory entry, and query the data to be displayed corresponding to the keyword information from the backend database;
[0166] The data to be displayed is rendered in the page template corresponding to the page template identifier in the routing object.
[0167] In this embodiment, upon determining that the user has adjusted the routing configuration information, the adjusted target routing configuration information is obtained, and routing address generation rules are acquired. Based on the hierarchical relationship of each sub-information in the target routing configuration information and the routing address generation rules, a routing address corresponding to each sub-information is generated. That is, in this invention, routing addresses corresponding to sub-information in the target routing configuration information can be generated according to user operations, realizing dynamic changes in routing addresses. Therefore, when adding a new routing address, only the user needs to adjust the routing configuration information, eliminating the need for developers to rewrite and deploy code, simplifying operations and improving efficiency. Furthermore, after obtaining the changed routing address, the page template identifier configured for each sub-information can also be obtained, and a routing object for that sub-information can be generated based on the routing address corresponding to that sub-information and the page template identifier, further improving the efficiency of routing object generation.
[0168] The above description of the disclosed embodiments enables those skilled in the art to make or use the invention. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the invention. Therefore, the invention is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A routing processing method, characterized in that, include: Once it is determined that the user has adjusted the routing configuration information, obtain the adjusted target routing configuration information; Obtain the routing address generation rules; The routing address generation rules include routing address generation sub-rules at different levels. The lower-level routing address generation sub-rules are generated by adding the routing address keywords of the current level to the routing address keywords of the routing address generation sub-rules of the previous level. Based on the hierarchical relationship of each sub-information in the target routing configuration information and the routing address generation rules, a routing address corresponding to each sub-information is generated, including: sequentially obtaining each sub-information based on the hierarchical relationship of each sub-information in the target routing configuration information and using it as the target sub-information; determining the hierarchy of the target sub-information and obtaining the target routing address generation sub-rule corresponding to the hierarchy in the routing address generation rules; the target routing address generation sub-rule includes: multiple routing address keywords; determining the content of each routing address keyword in the target routing address generation sub-rule according to the hierarchy and content of the target sub-information, so as to generate the routing address corresponding to the target sub-information; Obtain the page template identifier configured for each of the sub-information, and generate the routing object of the sub-information based on the routing address corresponding to the sub-information and the page template identifier.
2. The routing processing method according to claim 1, characterized in that, Based on the routing address corresponding to the sub-information and the page template identifier, a routing object for the sub-information is generated, including: Obtain the page name and keyword information corresponding to the sub-information; Add the route address, the page template identifier, the page name, and the keyword information to the route object code template to generate the route object for the sub-information.
3. The routing processing method according to claim 1, characterized in that, After generating the route object for the sub-information based on the route address and page template identifier corresponding to the sub-information, the method further includes: Generate a list of route objects according to their data hierarchy and store them in the backend database.
4. The routing processing method according to claim 3, characterized in that, After generating the list of route objects according to their data hierarchy, the following is also included: Generate the directory corresponding to the list of route objects.
5. The routing processing method according to claim 4, characterized in that, After generating the directory from the route object based on each of the sub-information in the target route configuration information, the following is also included: Get the user's click actions on directory entries in the directory; Obtain keyword information from the routing object corresponding to the directory entry, and query the data to be displayed corresponding to the keyword information from the backend database; The data to be displayed is rendered in the page template corresponding to the page template identifier in the routing object.
6. A routing processing device, characterized in that, include: The information acquisition module is used to acquire the adjusted target route configuration information when it is determined that the user has adjusted the route configuration information. The rule acquisition module is used to acquire routing address generation rules; the routing address generation rules include routing address generation sub-rules at different levels, wherein the lower-level routing address generation sub-rules are generated by adding the routing address keywords of the current level to the routing address keywords in the routing address generation sub-rules of the previous level; The route generation module is used to generate a route address corresponding to each of the sub-information based on the hierarchical relationship of each sub-information in the target route configuration information and the route address generation rules; The object generation module is used to obtain the page template identifier configured for each of the sub-information, and generate the routing object of the sub-information according to the routing address corresponding to the sub-information and the page template identifier; The route generation module includes: The information acquisition submodule is used to sequentially acquire each piece of information based on the hierarchical relationship of each piece of information in the target routing configuration information, and use it as the target sub-information; The rule acquisition submodule is used to determine the level of the target sub-information and acquire the target route address generation sub-rule corresponding to the level in the route address generation rule; the target route address generation sub-rule includes: multiple route address keywords; The address generation submodule is used to determine the content of each routing address keyword in the target routing address generation sub-rule according to the hierarchy and content of the target sub-information, so as to generate the routing address corresponding to the target sub-information.
7. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores at least one instruction, which, when executed by a processor, implements a routing processing method as described in any one of claims 1 to 5.
8. An electronic device, characterized in that, include: Memory and processor; The memory is used to store programs; The processor calls the program and executes a routing processing method as described in any one of claims 1 to 5.
Citation Information
Patent Citations
Routing method and device for web front end
CN113268260A
Access request processing method and device, computer equipment and storage medium
CN116126330A