Role permission-based routing query method and device, equipment and storage medium

By combining a role-permission mapping table and a directed acyclic graph model, a routing query method was developed to solve the problems of dynamic range adjustment and permission management in routing queries in logistics management systems. This improved query efficiency and intelligence, and enabled flexible adjustment of multi-dimensional data analysis and dynamic update frequency.

CN121563364APending Publication Date: 2026-02-24上海乾臻信息科技有限公司
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511822636.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-05
Publication Date
2026-02-24

AI Technical Summary

Technical Problem

The existing logistics management system's routing query function cannot dynamically adjust the query scope according to different roles, has chaotic permission management, a single query method and cumbersome operation, a single data display method that cannot meet the needs of multi-dimensional analysis, and the data update frequency is not flexible enough.

Method used

A decision tree algorithm based on a role-permission mapping table is used to identify roles and bind permission templates. A directed acyclic graph model is used for permission filtering. A breadth-first search strategy is combined to determine the data access scope. Personalized recommendations are provided through a site recommendation algorithm. An ordered route combination is generated using backtracking. A quick sorting algorithm is used for multi-dimensional data display.

Benefits of technology

It enables dynamic adjustment of the query scope based on roles, improves routing query efficiency, simplifies operation steps, provides multi-dimensional data analysis capabilities, and can dynamically adjust the data update frequency to ensure data security and permission isolation, thereby improving the intelligence level of queries and the relevance of results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121563364A_ABST
    Figure CN121563364A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of logistics, and discloses a role permission-based route query method, which comprises the following steps of: role identification: matching with a preset role database according to user login information, identifying a role and binding a permission template; permission filtering: modeling all website points into a directed acyclic graph, setting corresponding breadth-first search traversal starting points and ranges for different roles, and determining website data permissions which can be accessed by a user; site recommendation: calculating the correlation degree between the current user and the site, and outputting a final site recommendation result to the user; generating a combined site, generating all non-repeated site pair combinations for a plurality of sites, and generating an ordered routing combination list; and data sorting and display: supporting multi-dimensional sorting and performing data display. According to the method, the directed acyclic graph model and the role-based breadth-first search strategy are combined, so that the data access range of different roles is accurately, efficiently and dynamically delimited, and the data security and authority isolation are fundamentally guaranteed.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of logistics information technology, and in particular to a role-based access control-based routing query method, apparatus, device, and storage medium. Background Technology

[0002] The existing routing query function in the logistics management system has the following technical limitations, which restrict its application efficiency in actual business scenarios. Specifically, the limitations are as follows: (1) The routing query range is fixed and cannot be dynamically adjusted according to different roles such as collection and distribution, distribution, provincial headquarters, regional headquarters, and headquarters, resulting in chaotic permission management; (2) The site query method is single and lacks an intelligent recommendation mechanism. Users need to manually enter the site name when querying, which is cumbersome and increases time costs; moreover, the route combination query requires users to manually enter multiple site combinations, which is inefficient; (3) The data display method of the query is single and cannot meet the multi-dimensional analysis needs of different roles; (4) The query data cannot be dynamically adjusted according to business needs, and the update mechanism is not flexible enough.

[0003] Therefore, it is necessary to invent a role-based access control-based routing query method, device, equipment, and storage medium that can meet different query ranges, improve routing query efficiency, simplify query steps, deeply analyze query data, and dynamically adjust data update frequency. Summary of the Invention

[0004] This invention provides a role-based access control (RBAC) routing query method, apparatus, device, and storage medium, which can meet different query ranges, improve routing query efficiency, simplify query steps, enable in-depth analysis of query data, and dynamically adjust the data update frequency.

[0005] The first aspect of this invention provides a route query method based on role-based permissions, the route query method based on role-based permissions comprising: Role recognition employs a decision tree algorithm based on a role-permission mapping table. It matches user login information with a preset role database, identifies roles based on the matching results, and binds permission templates accordingly. Access control is achieved by modeling all website points as a directed acyclic graph, setting the starting point and range of a breadth-first search traversal for different roles, and determining the site data permissions that users can access based on the range of the subgraph obtained from the traversal. Site recommendation: Obtain the user's site query behavior sequence, calculate the relevance between the current user and the site, and output the final site recommendation result to the user; To generate combined sites, a backtracking algorithm is used to generate all non-duplicate site pairs for multiple sites. The combined sites are then sorted according to the lexicographical order of their names to generate an ordered list of route combinations. Data sorting and display employs a quick sorting algorithm, supporting multi-dimensional sorting and data display.

[0006] Optionally, in a first implementation of the first aspect of the present invention, the role recognition employs a decision tree algorithm based on a role-permission mapping table, matching user login information with a preset role database, identifying roles and binding permission templates based on the matching results, including: Build a pre-defined role database and a role-permission mapping table; Collect user login information; The user login information is matched with the judgment conditions of each node in the decision tree model; Based on the user roles matched by the decision tree model and the role-permission mapping table, the corresponding permission template is bound to the user.

[0007] Optionally, in a second implementation of the first aspect of the present invention, the permission filtering involves modeling the entire website as a directed acyclic graph, setting corresponding breadth-first search traversal starting points and ranges for different roles, and determining the site data permissions that users can access based on the ranges of the traversed subgraphs, including: Model all sites in the system and their membership relationships as a directed acyclic graph; The starting node and traversal range rules for breadth-first search traversal in a directed acyclic graph are predefined. For the current user role, perform a breadth-first search algorithm to obtain a subgraph; Define all sites contained in the subgraph as the site data permission scope that the user role can access.

[0008] Optionally, in a third implementation of the first aspect of the present invention, the site recommendation, which involves obtaining a user's site query behavior sequence, calculating the correlation between the current user and the site, and outputting the final site recommendation result to the user, includes: Obtain the user's historical site query behavior sequence and construct a user-site interaction matrix; The nearest neighbor recommendation algorithm is used to calculate the correlation between the current user and the site based on the user-site interaction matrix; Based on the calculated relevance scores, all sites are sorted in descending order, and candidate recommendation results are selected. The intersection of the candidate recommendation results and the site data permission range determined by permission filtering is taken to filter out sites that the user does not have permission to access, generating the final site recommendation list and outputting it to the current user.

[0009] Optionally, in the fourth implementation of the first aspect of the present invention, the generation of combined sites employs a backtracking method to implement a combined generation algorithm, generating all non-repeating site pairs for multiple sites, sorting them according to the lexicographical order of the site names, and generating an ordered list of route combinations, including: Obtain multiple sites that the current user is authorized to access, and form an initial set of sites; A backtracking algorithm is used to generate all possible combinations of non-repeating binary site pairs in an ordered site list; For binary site pairs, they are sorted according to the lexicographical order of their constituent site names; if the first site name of two pairs is the same, they are sorted according to the lexicographical order of the second site name; finally, a globally ordered list of route combinations is generated, which serves as the basis for subsequent data display and querying.

[0010] Optionally, in the fifth implementation of the first aspect of the present invention, the data sorting and display employs a quick sorting algorithm, supporting multi-dimensional sorting and data display, including: Extract sorting key values ​​from multiple dimensions of the routing data set to be displayed; The speed-sorting algorithm sorts the routing data set. When multi-dimensional comprehensive sorting is required, the system will merge multiple sorting key values ​​into a single comparison value according to their weight coefficients. The sorted data results processed by the quicksort algorithm are displayed on the user interface.

[0011] Optionally, in a fifth implementation of the first aspect of the present invention, the site recommendation, which involves obtaining a user's site query behavior sequence, calculating the correlation between the current user and the site, and outputting the final site recommendation result to the user, further includes: The system records the sequence of sites recently queried by the user and assigns a weight based on a time decay factor to each site query record in the sequence; Based on the weighted user behavior sequence, cosine similarity is used to calculate the similarity between the current user behavior and the feature vectors of each site; Based on the calculated similarity score, the website with the highest similarity to the user is recommended.

[0012] A second aspect of the present invention provides a role-based access control (RBAC) routing query device, comprising: The role recognition module uses a decision tree algorithm based on a role-permission mapping table to match user login information with a preset role database, identify roles based on the matching results, and bind permission templates. The role recognition module includes: The building unit is used to build a preset role database and a role-permission mapping table; The data collection unit is used to collect user login information; A matching unit is used to match the user login information with the judgment conditions of each node in the decision tree model; The binding unit is used to bind the corresponding permission template to the user based on the user role matched by the decision tree model and the role-permission mapping table.

[0013] The permission filtering module is used to model all website points as a directed acyclic graph, set the corresponding breadth-first search traversal start point and range for different roles, and determine the site data permissions that users can access based on the range of the subgraph obtained by traversal. The permission filtering module includes: Modeling unit, used to model all site points in the system and their membership relationships as a directed acyclic graph; The search unit is used to pre-define the starting node and traversal range rules for breadth-first search traversal in the directed acyclic graph. The execution unit is used to execute a breadth-first search algorithm for the current user role to obtain a subgraph; The determination unit is used to determine the scope of site data permissions that the user role can access for all sites contained in the subgraph.

[0014] The site recommendation module is used to obtain the user's site query behavior sequence, calculate the relevance between the current user and the site, and output the final site recommendation results to the user; The site recommendation module includes: The first acquisition unit is used to acquire the user's historical site query behavior sequence and construct a user-site interaction matrix; The calculation unit is used to calculate the correlation between the current user and the site based on the user-site interaction matrix using the nearest neighbor recommendation algorithm. The first sorting unit is used to sort all sites in descending order based on the calculated relevance score and to filter out candidate recommendation results. The filtering unit is used to take the intersection of the candidate recommendation results and the site data permission range determined by permission filtering, filter out sites that the user does not have permission to access, generate the final site recommendation list and output it to the current user.

[0015] The module for generating combined sites is used to implement a combined generation algorithm using a backtracking method. It generates all non-duplicate site pairs for multiple sites, sorts them according to the lexicographical order of the site names, and generates an ordered list of route combinations. The module for generating combined sites includes: The second acquisition unit is used to acquire multiple sites that the current user is authorized to access, forming an initial site set; The generation unit is used to generate all possible combinations of non-repeating binary site pairs in an ordered list using a backtracking algorithm. The second sorting unit is used to sort binary site pairs according to the lexicographical order of the site names they contain; if the first site name of two pairs is the same, then they are sorted according to the lexicographical order of the second site name. The data sorting and display module is used to sort data in multiple dimensions and display it using a quick sorting algorithm.

[0016] The data sorting and display module includes: The extraction unit is used to extract sorting key values ​​of multiple dimensions from the set of routing data to be displayed; The third sorting unit is used to sort the routing data set using the fast sorting algorithm; The merging unit is used when a multi-dimensional comprehensive sorting is required, the system merges multiple sorting key values ​​into a single comparison value according to their weight coefficients; The display unit is used to show the ordered data results processed by the quicksort algorithm on the user interface.

[0017] The site recommendation process involves obtaining the user's site query behavior sequence, calculating the correlation between the current user and the sites, and outputting the final site recommendation result to the user. It also includes: The system records the sequence of sites recently queried by the user and assigns a weight based on a time decay factor to each site query record in the sequence; Based on the weighted user behavior sequence, cosine similarity is used to calculate the similarity between the current user behavior and the feature vectors of each site; Based on the calculated similarity score, the website with the highest similarity to the user is recommended.

[0018] A third aspect of the present invention provides a role-based access control routing query device, comprising a memory and at least one processor, wherein the memory stores computer-readable instructions; The at least one processor invokes the computer-readable instructions in the memory to perform the steps of the role-based permission-based routing query method as described above.

[0019] A fourth aspect of the present invention provides a computer-readable storage medium storing computer-readable instructions, which, when executed by a processor, implement the steps of the role-based access control routing query method described above.

[0020] This invention employs a decision tree algorithm based on a role-permission mapping table to achieve accurate and efficient role identification and permission binding, ensuring the rigor and automation of permission management. By combining a directed acyclic graph model with a role-based breadth-first search strategy, it achieves accurate and efficient dynamic delineation of data access scope for different roles, fundamentally guaranteeing data security and permission isolation. Simultaneously, by analyzing user behavior sequences for personalized site recommendations and utilizing a backtracking algorithm to generate ordered route combinations, it significantly improves the intelligence level and relevance of route queries. Attached Figure Description

[0021] Figure 1 This is a first flowchart of a role-based access control-based routing query method provided in an embodiment of the present invention. Figure 2 This is a second flowchart of the role-based access control routing query method provided in an embodiment of the present invention; Figure 3 This is a third flowchart of the role-based access control routing query method provided in an embodiment of the present invention. Figure 4 This is a fourth flowchart of the role-based permission-based routing query method provided in an embodiment of the present invention; Figure 5 This is a fifth flowchart of the role-based access control routing query method provided in this embodiment of the invention. Figure 6 The sixth flowchart of the role-based access control routing query method provided in this embodiment of the invention; Figure 7 A schematic diagram of the structure of a role-based access control routing query device provided in an embodiment of the present invention; Figure 8 This is a schematic diagram of the structure of a role-based access control routing query device provided in an embodiment of the present invention. Detailed Implementation

[0022] This invention provides a role-based access control (RBAC) routing query method, apparatus, device, and storage medium. The method is used to establish dynamic customer profiles and manage customers based on these dynamic customer profiles.

[0023] The terms "first," "second," "third," "fourth," etc. (if present) in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" or "having" and any variations thereof are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0024] For ease of understanding, the specific process of the embodiments of the present invention is described below. Please refer to [link / reference]. Figure 1 The first embodiment of a role-based access control (RBAC) routing query method in this invention includes: S101. Role recognition: A decision tree algorithm based on a role-permission mapping table is used to match user login information with a preset role database, identify roles based on the matching results, and bind permission templates. S102, Permission Filtering: Model all website points as a directed acyclic graph, set the corresponding breadth-first search traversal starting point and range for different roles, and determine the site data permissions that users can access based on the range of the subgraph obtained by traversal. S103, Site Recommendation: Obtain the user's site query behavior sequence, calculate the correlation between the current user and the site, and output the final site recommendation result to the user; S104. Generate combined sites. The backtracking method is used to implement the combined generation algorithm. All non-duplicate site pairs are generated for multiple sites. The sites are sorted according to the lexicographical order of their names to generate an ordered list of route combinations. S105. Data sorting and display: Employs a quick sorting algorithm, supports multi-dimensional sorting, and displays the data.

[0025] This invention employs a decision tree algorithm based on a role-permission mapping table to achieve accurate and efficient role identification and permission binding, ensuring the rigor and automation of permission management. By combining a directed acyclic graph model with a role-based breadth-first search strategy, it achieves accurate and efficient dynamic delineation of data access scope for different roles, fundamentally guaranteeing data security and permission isolation. Simultaneously, by analyzing user behavior sequences for personalized site recommendations and utilizing a backtracking algorithm to generate ordered route combinations, it significantly improves the intelligence level and relevance of route queries.

[0026] Please see Figure 2The second embodiment of the role-based permission routing query method in this invention involves role identification using a decision tree algorithm based on a role-permission mapping table. This algorithm matches user login information with a preset role database, identifies roles based on the matching results, and binds them to permission templates. The method includes: S201. Construct a preset role database and a role-permission mapping table; S202. Collect user login information; S203. Match the user login information with the judgment conditions of each node in the decision tree model; S204. Based on the user roles matched by the decision tree model and the role-permission mapping table, bind the corresponding permission template to the user.

[0027] This invention transforms the role recognition process into an efficient and accurate data-driven decision-making process. The decision tree model can quickly match user login information with preset judgment conditions, accurately locate user roles, and automatically bind corresponding permission templates. This not only significantly improves the efficiency and accuracy of permission allocation and avoids errors and delays that may be caused by manual configuration, but also establishes a standardized and scalable permission management foundation from the system bottom layer, providing a reliable prerequisite for the subsequent implementation of refined data permission filtering.

[0028] Please see Figure 3 This invention provides a third embodiment of a role-based access control (RBAC) routing query method. The access control filtering model the entire website as a directed acyclic graph (DAG), sets corresponding breadth-first search traversal starting points and ranges for different roles, and determines the user's access permissions for website data based on the ranges of the traversed subgraphs. This includes: S301. Model all website points in the system and their membership relationships as a directed acyclic graph; S302. Pre-define the starting node and traversal range rules for breadth-first search traversal in the directed acyclic graph. S303. For the current user role, execute the breadth-first search algorithm to obtain the subgraph; S304. Determine the scope of site data permissions that the user role can access for all sites contained in the subgraph.

[0029] The beneficial effect of this invention is that it transforms the abstract permission control problem into a precise graph traversal operation. By presetting the traversal starting point and range for different roles, the system can automatically and efficiently calculate the site subgraphs that each role can access, thereby realizing the automated and precise delineation of data permission ranges.

[0030] Please see Figure 4The fourth embodiment of a role-based access control (RBAC) routing query method in this invention includes the following steps: First, the site recommendation method acquires a user's site query behavior sequence, calculates the correlation between the current user and the sites, and outputs the final site recommendation result to the user. S401. Obtain the user's historical site query behavior sequence and construct a user-site interaction matrix; S402. Using the nearest neighbor recommendation algorithm, calculate the correlation between the current user and the site based on the user-site interaction matrix; S403. Based on the calculated relevance scores, sort all sites in descending order and select candidate recommendation results; S404. Take the intersection of the candidate recommendation results and the site data permission range determined by permission filtering, filter out sites that the user does not have permission to access, generate the final site recommendation list and output it to the current user.

[0031] This invention effectively improves the system's usability and intelligence. By analyzing user history and calculating relevance, the system can proactively provide highly personalized site recommendations, significantly reducing users' manual search costs and optimizing the query experience. Furthermore, the recommendation results are intersected with the accessible site range after permission filtering, ensuring that all recommended content strictly falls within the user's authorized data boundaries.

[0032] Please see Figure 5 The fifth embodiment of a role-based access control (RBAC) routing query method in this invention involves generating combined sites using a backtracking algorithm. This algorithm generates all non-duplicate site pairs from multiple sites, sorts them lexicographically by site name, and generates an ordered list of route combinations, including: S501. Obtain multiple sites that the current user is authorized to access, and form an initial site set; S502. Use a backtracking algorithm to generate all possible combinations of non-repeating binary site pairs in the ordered site list; S503. For binary site pairs, sort them according to the lexicographical order of their contained site names; if the first site name of two pairs is the same, sort them according to the lexicographical order of the second site name; finally, generate a globally ordered list of route combinations as the basis for subsequent data display and query.

[0033] The embodiments of the present invention ensure that all possible valid route combinations can be generated exhaustively and without omission from the set of sites accessible to the user, providing a complete and accurate data foundation for subsequent path planning and querying; the use of backtracking ensures the rigor and comprehensiveness of the generated combinations, avoiding omissions or errors that may be caused by manual enumeration.

[0034] Please see Figure 6 The sixth embodiment of a role-based access control-based routing query method in this invention includes data sorting and display using a fast sorting algorithm, supporting multi-dimensional sorting and data display, comprising: S601. Extract sorting key values ​​for multiple dimensions from the routing data set to be displayed; S602, the speed-sorting algorithm sorts the routing data set; S603. When multi-dimensional comprehensive sorting is required, the system will merge multiple sorting key values ​​into a single comparison value according to their weight coefficients. S604. Display the ordered data results processed by the quicksort algorithm on the user interface.

[0035] In some embodiments, the site recommendation, which involves obtaining a user's site query behavior sequence, calculating the correlation between the current user and the site, and outputting the final site recommendation result to the user, further includes: The system records the sequence of sites recently queried by the user and assigns a weight based on a time decay factor to each site query record in the sequence; Based on the weighted user behavior sequence, cosine similarity is used to calculate the similarity between the current user behavior and the feature vectors of each site; Based on the calculated similarity score, the website with the highest similarity to the user is recommended.

[0036] The beneficial effects of this invention are as follows: by utilizing the efficiency of the quick sorting algorithm, the system can quickly and flexibly sort massive routing data according to single or multiple dimensions, ensuring timely response of query results and customized presentation according to user needs; by introducing a time decay factor to give higher weight to recent behaviors and using cosine similarity for accurate calculation, the site recommendation is highly personalized, can dynamically reflect the latest user interests and preferences, and improves the accuracy and practicality of the recommendation.

[0037] The above describes the role-based access control (RBAC) routing query method in the embodiments of the present invention. The following describes the apparatus in the embodiments of the present invention. Please refer to [link / reference]. Figure 7 The implementation methods of the role-based access control routing query device in this invention include: The role recognition module 701 is used to use a decision tree algorithm based on a role-permission mapping table to match user login information with a preset role database, identify roles and bind permission templates based on the matching results; The permission filtering module 702 is used to model the entire website as a directed acyclic graph, set the corresponding breadth-first search traversal start point and range for different roles, and determine the site data permissions that users can access based on the range of the subgraph obtained by traversal. The site recommendation module 703 is used to obtain the user's site query behavior sequence, calculate the correlation between the current user and the site, and output the final site recommendation result to the user. The combined site generation module 704 is used to implement the combined generation algorithm using a backtracking method, generate all non-duplicate site pairs for multiple sites, sort them according to the lexicographical order of the site names, and generate an ordered list of route combinations. The data sorting and display module 705 is used to employ a quick sorting algorithm, support multi-dimensional sorting, and display data.

[0038] In some embodiments, the role recognition module 701 includes: Building unit 7011 is used to build a preset role database and a role-permission mapping table; The data acquisition unit 7012 is used to collect user login information; The matching unit 7013 is used to match the user login information with the judgment conditions of each node in the decision tree model; Binding unit 7014 is used to bind the corresponding permission template to the user based on the user role matched by the decision tree model and the role-permission mapping table.

[0039] This invention transforms the role recognition process into an efficient and accurate data-driven decision-making process. The decision tree model can quickly match user login information with preset judgment conditions, accurately locate user roles, and automatically bind corresponding permission templates. This not only significantly improves the efficiency and accuracy of permission allocation and avoids errors and delays that may be caused by manual configuration, but also establishes a standardized and scalable permission management foundation from the system bottom layer, providing a reliable prerequisite for the subsequent implementation of refined data permission filtering.

[0040] In some embodiments, the permission filtering module 702 includes: Modeling unit 7021 is used to model all site points in the system and their membership relationships as a directed acyclic graph; The search unit 7021 is used to pre-set the starting node and traversal range rules for breadth-first search traversal in the directed acyclic graph. Execution unit 7023 is used to execute a breadth-first search algorithm for the current user role to obtain a subgraph; The determination unit 7024 is used to determine all sites contained in the subgraph as the site data permission scope that the user role can access.

[0041] The beneficial effect of this invention is that it transforms the abstract permission control problem into a precise graph traversal operation. By presetting the traversal starting point and range for different roles, the system can automatically and efficiently calculate the site subgraphs that each role can access, thereby realizing the automated and precise delineation of data permission ranges.

[0042] In some embodiments, the site recommendation module 703 includes: The first acquisition unit 7031 is used to acquire the user's historical site query behavior sequence and construct a user-site interaction matrix; The calculation unit 7032 is used to calculate the correlation between the current user and the site based on the user-site interaction matrix using the nearest neighbor recommendation algorithm; The first sorting unit 7033 is used to sort all sites in descending order based on the calculated relevance score and filter out candidate recommendation results; The filtering unit 7034 is used to take the intersection of the candidate recommendation results and the site data permission range determined by permission filtering, filter out sites that the user does not have permission to access, generate the final site recommendation list and output it to the current user.

[0043] This invention effectively improves the system's usability and intelligence. By analyzing user history and calculating relevance, the system can proactively provide highly personalized site recommendations, significantly reducing users' manual search costs and optimizing the query experience. Furthermore, the recommendation results are intersected with the accessible site range after permission filtering, ensuring that all recommended content strictly falls within the user's authorized data boundaries.

[0044] In some embodiments, the combined site generation module 704 includes: The second acquisition unit 7042 is used to acquire multiple sites that the current user is authorized to access, forming an initial site set; The generation unit 7042 is used to generate all possible combinations of non-repeating binary site pairs in the ordered site list using a backtracking algorithm; The second sorting unit 7043 is used to sort binary site pair combinations according to the lexicographical order of the site names they contain; if the first site name of two combinations is the same, then they are sorted according to the lexicographical order of the second site name. The embodiments of the present invention ensure that all possible valid route combinations can be generated exhaustively and without omission from the set of sites accessible to the user, providing a complete and accurate data foundation for subsequent path planning and querying; the use of backtracking ensures the rigor and comprehensiveness of the generated combinations, avoiding omissions or errors that may be caused by manual enumeration.

[0045] In some embodiments, the data sorting and display module 705 includes: Extraction unit 7051 is used to extract sorting key values ​​of multiple dimensions from the routing data set to be displayed; The third sorting unit 7052 is used to sort the routing data set using the fast sorting algorithm; The merging unit 7053 is used to merge multiple sorting key values ​​into a single comparison value according to their weight coefficients when multi-dimensional comprehensive sorting is required. Display unit 7054 is used to display the ordered data results processed by the quicksort algorithm on the user interface.

[0046] In some embodiments, the site recommendation, which involves obtaining a user's site query behavior sequence, calculating the correlation between the current user and the site, and outputting the final site recommendation result to the user, further includes: The system records the sequence of sites recently queried by the user and assigns a weight based on a time decay factor to each site query record in the sequence; Based on the weighted user behavior sequence, cosine similarity is used to calculate the similarity between the current user behavior and the feature vectors of each site; Based on the calculated similarity score, the website with the highest similarity to the user is recommended.

[0047] The beneficial effects of this invention are as follows: by utilizing the efficiency of the quick sorting algorithm, the system can quickly and flexibly sort massive routing data according to single or multiple dimensions, ensuring timely response of query results and customized presentation according to user needs; by introducing a time decay factor to give higher weight to recent behaviors and using cosine similarity for accurate calculation, the site recommendation is highly personalized, can dynamically reflect the latest user interests and preferences, and improves the accuracy and practicality of the recommendation.

[0048] Figure 7 The structure of the role-based access control routing query device shown does not constitute a limitation on the role-based access control routing query device, and can implement the steps of the role-based access control routing query method provided in the above method embodiments.

[0049] above Figure 7 The role-based routing query device in this embodiment of the invention is described in detail from the perspective of modular functional entities. The role-based routing query device in this embodiment of the invention is described in detail from the perspective of hardware processing.

[0050] Figure 8This is a schematic diagram of a role-based access control (RBAC) routing query device according to an embodiment of the present invention. The device 800 can vary significantly due to different configurations or performance characteristics. It may include one or more central processing units (CPUs) 810 (e.g., one or more processors) and a memory 820, and one or more storage media 830 (e.g., one or more mass storage devices) for storing application programs 833 or data 832. The memory 820 and storage media 830 can be temporary or persistent storage. The program stored in the storage media 830 may include one or more modules (not shown), each module including a series of instruction operations on the device 800. Furthermore, the processor 810 may be configured to communicate with the storage media 830 and execute the series of instruction operations in the storage media on the device 800.

[0051] Device 800 may also include one or more power supplies 840, one or more wired or wireless network interfaces 850, one or more input / output interfaces 860, and / or one or more operating systems 831, such as Windows Server, Mac OS X, Unix, Linux, FreeBSD, etc.

[0052] This invention also provides a computer-readable storage medium, which can be a non-volatile computer-readable storage medium or a volatile computer-readable storage medium. The computer-readable storage medium stores instructions that, when executed on a computer, cause the computer to perform the steps of a role-based access control routing query method.

[0053] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working process of the system, device, or unit described above can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.

[0054] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0055] The above-described embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A route query method based on role-based access control, characterized in that, The role-based access control (RBAC) routing query method includes: Role recognition employs a decision tree algorithm based on a role-permission mapping table. It matches user login information with a preset role database, identifies roles based on the matching results, and binds permission templates accordingly. Access control is implemented by modeling all website points as a directed acyclic graph. For different roles, a breadth-first search traversal starting point and range are set. Based on the range of the subgraph obtained from the traversal, the access permissions of the website data that the user can access are determined. Site recommendation: Obtain the user's site query behavior sequence, calculate the relevance between the current user and the site, and output the final site recommendation result to the user; To generate combined sites, a backtracking algorithm is used to generate all non-duplicate site pairs for multiple sites. The combined sites are then sorted according to their lexicographical order to generate an ordered list of route combinations. Data sorting and display employs a quick sorting algorithm, supporting multi-dimensional sorting and data display.

2. The role-based access control (RBAC) routing query method according to claim 1, characterized in that, The role recognition employs a decision tree algorithm based on a role-permission mapping table. It matches user login information against a preset role database, identifies roles based on the matching results, and binds them to permission templates, including: Build a pre-defined role database and a role-permission mapping table; Collect user login information; The user login information is matched with the judgment conditions of each node in the decision tree model; Based on the user roles matched by the decision tree model and the role-permission mapping table, the corresponding permission template is bound to the user.

3. The role-based access control (RBAC) routing query method according to claim 1, characterized in that, The permission filtering method models the entire website as a directed acyclic graph (DAG). It sets corresponding breadth-first search traversal starting points and ranges for different roles, and determines the site data permissions that users can access based on the ranges of the traversed subgraphs. This includes: Model all website points and their membership relationships in the system as a directed acyclic graph; The starting node and traversal range rules for breadth-first search traversal in a directed acyclic graph are predefined. For the current user role, perform a breadth-first search algorithm to obtain a subgraph; Define all sites contained in the subgraph as the site data permission scope that the user role can access.

4. The role-based access control (RBAC) routing query method according to claim 3, characterized in that, The site recommendation process involves acquiring the user's site query behavior sequence, calculating the correlation between the current user and the sites, and outputting the final site recommendation results to the user, including: Obtain the user's historical site query behavior sequence and construct a user-site interaction matrix; The nearest neighbor recommendation algorithm is used to calculate the correlation between the current user and the site based on the user-site interaction matrix; Based on the calculated relevance scores, all sites are sorted in descending order, and candidate recommendation results are selected. The intersection of the candidate recommendation results and the site data permission range determined by permission filtering is taken to filter out sites that the user does not have permission to access, generating the final site recommendation list and outputting it to the current user.

5. The role-based access control (RBAC) routing query method according to claim 4, characterized in that, The generation of combined sites employs a backtracking algorithm to generate all non-repeating site pairs from multiple sites. These pairs are then sorted lexicographically by site name to generate an ordered list of route combinations, including: Obtain multiple sites that the current user is authorized to access, and form an initial set of sites; A backtracking algorithm is used to generate all possible combinations of non-repeating binary site pairs in an ordered site list; For binary site pairs, they are sorted according to the lexicographical order of their contained site names; if the first site name of two pairs is the same, they are sorted according to the lexicographical order of the second site name; finally, a globally ordered list of route combinations is generated, which serves as the basis for subsequent data display and query.

6. The role-based access control (RBAC) routing query method according to claim 5, characterized in that, The data sorting and display employs a fast sorting algorithm, supporting multi-dimensional sorting and data display, including: Extract sorting key values ​​from multiple dimensions of the routing data set to be displayed; The speed-sorting algorithm sorts the routing data set. When multi-dimensional comprehensive sorting is required, the system will merge multiple sorting key values ​​into a single comparison value according to their weight coefficients. The sorted data results processed by the quicksort algorithm are displayed on the user interface.

7. The role-based access control (RBAC) routing query method according to claim 4, characterized in that, The site recommendation process involves obtaining the user's site query behavior sequence, calculating the correlation between the current user and the sites, and outputting the final site recommendation result to the user. It also includes: The system records the sequence of sites recently queried by the user and assigns a weight based on a time decay factor to each site query record in the sequence; Based on the weighted user behavior sequence, cosine similarity is used to calculate the similarity between the current user behavior and the feature vectors of each site; Based on the calculated similarity score, the website with the highest similarity to the user is recommended.

8. A role-based access control (RBAC) routing query device, characterized in that, include: The role recognition module uses a decision tree algorithm based on a role-permission mapping table to match user login information with a preset role database, identify roles based on the matching results, and bind permission templates. The permission filtering module is used to model all website points as a directed acyclic graph, set the corresponding breadth-first search traversal start point and range for different roles, and determine the site data permissions that users can access based on the range of the subgraph obtained by traversal. The site recommendation module is used to obtain the user's site query behavior sequence, calculate the relevance between the current user and the site, and output the final site recommendation results to the user; The module for generating combined sites is used to implement a combined generation algorithm using a backtracking method. It generates all non-repeating site pairs for multiple sites, sorts them according to the lexicographical order of the site names, and generates an ordered list of route combinations. The data sorting and display module is used to sort data in multiple dimensions and display it using a quick sorting algorithm.

9. A role-based access control (RBAC) routing query device, characterized in that, It includes a memory and at least one processor, wherein the memory stores computer-readable instructions; The at least one processor invokes the computer-readable instructions in the memory to perform the steps of the role-based access control routing query method as described in any one of claims 1-7.

10. A computer-readable storage medium storing computer-readable instructions thereon, characterized in that, When the computer-readable instructions are executed by the processor, they implement the steps of the role-based access control routing query method as described in any one of claims 1-7.