Organizational structure-based filtering and retrieval methods, devices, equipment, and storage media
By constructing a hierarchical mapping architecture and business line filtering, combined with visibility checks and network performance parameters, the problems of low retrieval efficiency and information leakage in existing technologies are solved, achieving efficient and secure knowledge base retrieval.
Patent Information
- Application Number
- CN202611587042.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-10-14
- Publication Date
- 2026-11-10
AI Technical Summary
Existing knowledge base systems perform searches across the entire document library and then filter out unauthorized results afterward, resulting in low retrieval efficiency and the risk of information leakage. They also lack a hierarchical business isolation mechanism and a linkage between pre-access permission verification and post-audit of retrieval results.
A screening and retrieval method based on organizational structure is adopted. By constructing a hierarchical mapping architecture, business line filtering is performed based on user role information and the set of visible business line nodes. The retrieval mode is determined by combining visibility checks and network performance parameters. This achieves an isolation retrieval strategy of first convergence and then fine screening, avoiding irrelevant documents from participating in vector matching calculations and information leakage.
It improves retrieval efficiency, reduces irrelevant documents involved in matching calculations by 70% to 90%, eliminates the risk of information leakage, and ensures the security and stability of retrieval results.
Smart Images

Figure CN123068624A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of information management technology, and in particular to a screening and retrieval method, apparatus, device, and storage medium based on organizational structure. Background Technology
[0002] Knowledge bases (such as internal corporate knowledge bases) store a large number of business documents, including product specifications, technical solutions, compliance policies, operation manuals, training materials, etc. These documents belong to different business lines, departments, or project teams and have different levels of confidentiality and visibility.
[0003] However, existing systems perform searches across the entire document scope and then filter out unauthorized results afterward, resulting in low retrieval efficiency. A large number of irrelevant documents participate in vector matching calculations, and documents that should be isolated may be mixed into highly relevant results, posing a risk of information leakage.
[0004] Therefore, existing technologies have shortcomings and need to be improved and developed. Summary of the Invention
[0005] This application provides a screening and retrieval method, apparatus, device, and storage medium based on organizational structure to solve the technical problems of low retrieval efficiency and easy information leakage risk in related technologies.
[0006] To achieve the above objectives, this application adopts the following technical solution: A filtering and retrieval method based on organizational structure, the method comprising: In response to a search request, the system obtains the information to be searched, which includes at least: a user identifier and a search query text; The user role information and the set of visible business line nodes corresponding to the user identifier are determined based on a pre-built hierarchical mapping architecture. Obtain the business line to which the user belongs; based on the user role information, the set of visible business line nodes, and the business line to which the user belongs, perform business line filtering on the preset document library to obtain an initial candidate set of documents that converges to the business line to which the user belongs. Visibility checks are performed on each document in the candidate document set, and the target document candidate set is determined based on the visibility check results; The current retrieval mode is determined based on the current network performance parameters. Under the current retrieval mode, the retrieval results are obtained by searching the target document candidate set according to the retrieval query text.
[0007] In one embodiment of this application, the hierarchical mapping architecture includes a root node and multiple business line nodes with hierarchical relationships. The document library includes multiple documents, each document corresponding to a document node. Each document node is associated with at least one lowest-level business line node. Each business line node includes: a node identifier, a node name, a parent node reference, a list of child nodes, and a node status attribute. Each document node includes: a document identifier, a business line identifier, a document category, a document tag, a visibility attribute, a document status, and a document metadata attribute.
[0008] In one embodiment of this application, determining the user role information and the set of visible service line nodes corresponding to the user identifier based on a pre-built hierarchical mapping architecture includes: The user role information corresponding to the user identifier is obtained by querying a preset user information table based on the user identifier. The user role information includes: username, user role, role status and user role group list. Identity authentication is performed based on the user role information; If the identity authentication is successful, the hierarchical mapping architecture is traversed to obtain the user role group identifier in the user role group list, the business line node that matches the user role group identifier is found, and the business line node and its subordinate child nodes are set as visible business line nodes.
[0009] In one embodiment of this application, based on the user role information, the set of visible business line nodes, and the business line to which the user belongs, a preset document library is filtered by business line to obtain an initial candidate set of documents that converges to the business line to which the user belongs, including: If the user role in the user role information is not an administrator role, then the documents associated with the business line nodes in the visible business line node set are filtered in the document library to form a first document set. If the search request carries a sub-business line identifier, then the documents corresponding to the sub-business line identifier are filtered in the document library to form a second document set; If the search request carries a business line identifier, then the documents corresponding to the business line identifier are filtered in the document library to form a third document set; The intersection of the first document set, the second document set, and the third document set is used to form an initial candidate document set that converges to the user's business line.
[0010] In one embodiment of this application, visibility checks are performed on each document in the document candidate set, and a target document candidate set is determined based on the visibility check results, including: Visibility checks are performed on each document in the document candidate set, and the visibility attribute of the document is used to record the user role group identifier that is allowed to access the corresponding document; If the document's visibility attribute does not record the user role group identifier, then the document is determined to be a publicly visible document within the business line to which the document belongs, and the document is retained in the document candidate set; If the visibility attribute record of a document has at least one user role group identifier, then the user role group identifiers in the user role group list are matched with the user role group identifiers in the visibility attribute record. If at least one matching user role group identifier exists, the document is retained; if no matching user role group identifier exists, the document is removed, so as to obtain a target document candidate set.
[0011] In one embodiment of this application, the current network performance parameters include: current network latency and current bandwidth; based on the current network performance parameters, a current retrieval mode is determined; under the current retrieval mode, the retrieval is performed in the target document candidate set according to the retrieval query text to obtain retrieval results, including: Based on the current network performance parameters, the current search mode is determined from the preset search modes, which include: local priority mode, cloud priority mode and full cloud mode; In the current search mode, vector search and keyword search are performed respectively in the target document candidate set according to the search query text to obtain vector search results and keyword search results; The vector retrieval results and keyword retrieval results are weighted and fused to obtain a comprehensive score; The search results are output in descending order of comprehensive score. Each search result includes at least one of the following: document identifier, document title, matched text content, comprehensive score, business line identifier, and sub-business line identifier.
[0012] In one embodiment of this application, the current retrieval mode is determined based on current network performance parameters. Under the current retrieval mode, the retrieval is performed in the target document candidate set according to the retrieval query text. After obtaining the retrieval results, the method further includes: Obtain the current status of the business line node to which the document belongs and the current document status in the search results, and verify the matching result between the user role group identifier of the visibility attribute record of the document in the search results and the user role group identifier in the user role group list; If the following conditions are met simultaneously: the current status of the business line node to which the document belongs in the search results is enabled, the current status of the document is valid, and the matching result shows that there is at least one matching user role group identifier, then each search result will be transmitted to the user interface for display. Based on the retrieval behavior obtained from the response to the retrieval request, the audit log corresponding to the retrieval behavior is obtained and stored in the audit log table. The audit log table supports query analysis by at least one dimension among user, time period and retrieval mode.
[0013] This application also provides a filtering and retrieval device based on organizational structure, the device comprising: The response module is used to respond to retrieval requests and obtain the information to be retrieved, which includes at least: user identifier and retrieval query text; The determination module is used to determine the user role information and the set of visible business line nodes corresponding to the user identifier based on a pre-built hierarchical mapping architecture. The filtering module is used to obtain the business line to which the user belongs, and based on the user role information, the set of visible business line nodes and the business line to which the user belongs, to perform business line filtering on the preset document library to obtain an initial candidate set of documents that converges to the business line to which the user belongs. The inspection module is used to perform visibility checks on each document in the document candidate set, and determine the target document candidate set based on the visibility check results; The retrieval module is used to determine the current retrieval mode based on the current network performance parameters. Under the current retrieval mode, the module searches the target document candidate set according to the retrieval query text to obtain the retrieval results.
[0014] This application also provides an apparatus comprising: a memory, a processor, and an organizational structure-based filtering and retrieval program stored in the memory and executable on the processor, wherein the organizational structure-based filtering and retrieval program, when executed by the processor, implements the steps of the organizational structure-based filtering and retrieval method as described above.
[0015] This application also provides a computer-readable storage medium storing a computer program that can be executed to implement the steps of the organizational structure-based filtering and retrieval method described above.
[0016] The beneficial effects of this invention are as follows: The method of this embodiment of the invention obtains information to be retrieved in response to a retrieval request. The information to be retrieved includes at least: a user identifier and a retrieval query text; it determines the user role information and a set of visible business line nodes corresponding to the user identifier based on a pre-built hierarchical mapping architecture; it obtains the business line to which the user belongs, and performs business line filtering on a preset document library based on the user role information, the set of visible business line nodes, and the business line to which the user belongs, to obtain an initial document candidate set that converges to the business line to which the user belongs; it performs visibility checks on each document in the document candidate set, and determines a target document candidate set based on the visibility check results; it determines the current retrieval mode based on the current network performance parameters, and in the current retrieval mode, it retrieves the target document candidate set according to the retrieval query text to obtain the retrieval result. This application achieves an isolated retrieval strategy of convergence followed by fine screening by performing business line filtering and visibility checks before retrieval, avoiding the participation of a large number of irrelevant documents in vector matching calculations and the risk of information leakage, thus improving retrieval efficiency. Attached Figure Description
[0017] Figure 1 This is a flowchart of a preferred embodiment of the organizational structure-based filtering and retrieval method in this invention.
[0018] Figure 2 This is a diagram showing the overall architecture and module connection relationships of the enterprise knowledge base isolation retrieval system in this invention.
[0019] Figure 3 This is a schematic diagram of the tree data structure of the hierarchical business mapping module in this invention.
[0020] Figure 4 This is a flowchart of the three-level filtering process of the business line filtering module in this invention.
[0021] Figure 5 This is a decision flowchart for the retrieval mode selection module in this invention.
[0022] Figure 6 This is a flowchart of the permission penetration verification module in this invention.
[0023] Figure 7 This is a functional principle block diagram of a preferred embodiment of the organizational structure-based filtering and retrieval device in this invention.
[0024] Figure 8 This is a functional principle block diagram of a preferred embodiment of the device in this invention. Detailed Implementation
[0025] To make the objectives, technical solutions, and advantages of this invention clearer and more explicit, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
[0026] Existing knowledge base retrieval solutions have the following technical problems: First, there is a lack of hierarchical business isolation mechanisms. The existing system uses a flat access control model, assigning each user a list of visible documents or role tags. This approach fails to reflect the true hierarchical organizational structure of the enterprise. When the organizational structure changes, the permission configurations of a large number of documents need to be modified one by one, resulting in high maintenance costs and a high risk of permission omissions or overreach.
[0027] Second, the search scope cannot be automatically converged according to business lines. The existing system searches the entire document scope and then filters out unauthorized results afterward, resulting in low search efficiency. A large number of irrelevant documents participate in vector matching calculations, and document summaries that should be isolated may be mixed into highly relevant results, causing the risk of information leakage.
[0028] Third, there is a lack of coordination between local and cloud-based retrieval. Some enterprises deploy both local and cloud-based vector databases, but these operate independently, lacking a unified retrieval mode selection mechanism and result fusion and ranking mechanism, resulting in unstable retrieval quality.
[0029] Fourth, there is a lack of linkage between pre-search permission verification and post-search auditing. The existing system filters the results after the search is completed, but it cannot limit the scope of secure documents before execution. Search behavior logs and permission verification logs are scattered across different subsystems, lacking a unified auditing module for linking and recording.
[0030] The following describes a filtering and retrieval method, apparatus, device, and storage medium based on organizational structure dimensions according to embodiments of this application, with reference to the accompanying drawings. Addressing the problems of low retrieval efficiency and the risk of information leakage in related technologies mentioned in the background section, this application provides a filtering and retrieval method based on organizational structure dimensions. In this method, in response to a retrieval request, information to be retrieved is obtained, which includes at least: a user identifier and a retrieval query text; based on a pre-constructed hierarchical mapping architecture, user role information and a set of visible business line nodes corresponding to the user identifier are determined; the business line to which the user belongs is obtained, and based on the user role information, the set of visible business line nodes, and the business line to which the user belongs, a preset document library is filtered by business line to obtain an initial document candidate set converging to the user's business line; visibility checks are performed on each document in the document candidate set, and a target document candidate set is determined based on the visibility check results; a current retrieval mode is determined based on current network performance parameters, and under the current retrieval mode, the retrieval is performed in the target document candidate set according to the retrieval query text to obtain retrieval results. This application implements an isolation retrieval strategy of first converging and then finely screening by performing business line filtering and visibility checks before retrieval. This avoids the participation of a large number of irrelevant documents in vector matching calculations and the risk of information leakage, thereby improving retrieval efficiency.
[0031] Please see Figure 1 The organizational structure-based filtering and retrieval method described in this embodiment of the invention includes the following steps: Step S100: Respond to the retrieval request and obtain the information to be retrieved. The information to be retrieved includes at least: user identifier and retrieval query text.
[0032] For example, such as Figure 2 The diagram illustrates the data flow direction and connections between ten functional modules, including the main data flow path, the hierarchical mapping data supply path, and the audit data collection path. The modules are connected sequentially according to the data flow direction: Hierarchical Business Mapping Module → User Identity Resolution Module → Business Line Filtering Module → Visibility Filtering Module → Search Mode Selection Module → Local Vector Search Module or Cloud Vector Search Module → Result Fusion and Sorting Module → Permission Penetration Verification Module → Audit Module. The Search Mode Selection Module is connected to both the Local Vector Search Module and the Cloud Vector Search Module, with both outputs connected to the input of the Result Fusion and Sorting Module. The Audit Module's inputs are connected to the User Identity Resolution Module, Business Line Filtering Module, Visibility Filtering Module, Search Mode Selection Module, and Permission Penetration Verification Module.
[0033] like Figure 1 As shown, the filtering and retrieval method based on organizational structure also includes the following steps: Step S200: Determine the user role information and the set of visible business line nodes corresponding to the user identifier based on the pre-built hierarchical mapping architecture.
[0034] In this embodiment, the hierarchical mapping architecture includes a root node and multiple business line nodes with hierarchical relationships. The document library includes multiple documents, each document corresponding to a document node. Each document node is associated with at least one lowest-level business line node. Each business line node includes: node identifier, node name, parent node reference, child node list, and node status attribute. Each document node includes: document identifier, business line identifier, document category, document tag, visibility attribute, document status, and document metadata attribute.
[0035] For example, such as Figure 3 The diagram illustrates a hierarchical structure: "Company Root Node → Business Line Node → Sub-Business Line Node → Document". Each business line contains several sub-business lines, and each sub-business line node holds a collection of documents. Each document contains a `visible_to` visibility attribute field. In other words, the hierarchical business mapping module maintains the hierarchical mapping relationship between the enterprise organizational structure and document resources. Each business line node includes a node identifier, node name, parent node reference, list of child nodes, and node status attributes. Each document node is bound to its corresponding business line node and includes a document identifier, its business line identifier, document category, document tag, visibility attribute (`visible_to`), document status, and document metadata attributes. When the visibility attribute is empty, the document is visible to all users within its respective business line.
[0036] The hierarchical business mapping module in this application supports dynamic adjustment of business line nodes. When adding a new business line node to the hierarchical mapping architecture, the parent node reference of the new node is specified, and the new node automatically inherits the permission policy under the parent node. When merging business line nodes, the business line identifier of all document nodes under the merged node is updated to the target node identifier. When splitting business line nodes, the documents under the original node are allocated to new child nodes according to the specified splitting rules. The underlying implementation uses a relational database (PostgreSQL), and the hierarchical relationship between business line nodes is established through the parent-child node reference field. The vector embedding data of the document is stored in the document vector embedding table. Each embedding record contains a document chunk index, chunk text content, a 1536-dimensional vector embedding array, and the associated document identifier.
[0037] For example, the hierarchical mapping architecture of this application can be a hierarchical business mapping tree of "company → business line → sub-business line → document", which binds document nodes to specific business line nodes and sets visibility attributes. In the retrieval link, user identity resolution, business line scope filtering, visibility filtering, retrieval mode selection, local or cloud vector retrieval, result fusion sorting and permission penetration verification modules are connected in series. This realizes a complete isolated retrieval link, which automatically converges the retrieval scope according to the user's business line before retrieval, conducts local and cloud collaborative retrieval and fusion sorting during retrieval, and finally verifies the permission and audit records after retrieval.
[0038] Additionally, the tree-like data structure in the hierarchical business mapping module can be replaced with a mapping structure based on a directed acyclic graph (DAG). In a DAG structure, a document node can belong to multiple business line nodes simultaneously, eliminating the need for cross-business line sharing through visibility attribute fields, making it suitable for organizations with complex document ownership relationships.
[0039] This application constructs a hierarchical mapping architecture, binding document nodes to specific business line nodes and setting visibility attributes, so that the retrieval scope automatically converges to the document set of the user's business line before the search is executed. Existing flat permission models require configuring document permissions one by one, with a maintenance workload of O(N×M) (N is the number of documents, M is the number of users). This application, however, reduces the maintenance workload to O(L) (L is the number of hierarchical nodes) through a tree structure. When the organizational structure is adjusted, only the node relationships need to be adjusted, reducing the number of documents participating in vector matching by 70%~90%.
[0040] In one embodiment of this application, step S200 specifically includes: Step S210: Query the preset user information table according to the user identifier to obtain the user role information corresponding to the user identifier. The user role information includes: username, user role, role status and user role group list. Step S220: Perform identity authentication based on the user role information; Step S230: If the identity authentication is successful, traverse the hierarchical mapping architecture, obtain the user role group identifier in the user role group list, find the business line node that matches the user role group identifier, and set the business line node and its subordinate child nodes as a set of visible business line nodes.
[0041] For example, this application receives external retrieval requests (containing at least a user identifier and retrieval query text) through a user identity resolution module. This module internally includes an identity authentication submodule and a business line affiliation determination submodule. The identity authentication submodule queries the user information table based on the user identifier to obtain the username, user role, role status, and a list of user role groups. The business line affiliation determination submodule traverses the hierarchical business mapping tree, searches for business line nodes matching the user role group identifier, and uses these nodes and all their subordinate child nodes as the user's set of visible business line nodes.
[0042] This application achieves natural document isolation through a hierarchical mapping architecture, thus avoiding the risk of information leakage.
[0043] like Figure 1 As shown, the filtering and retrieval method based on organizational structure also includes the following steps: Step S300: Obtain the business line to which the user belongs. Based on the user role information, the set of visible business line nodes, and the business line to which the user belongs, perform business line filtering on the preset document library to obtain an initial candidate set of documents that converges to the business line to which the user belongs.
[0044] In this embodiment, the step "based on the user role information, the set of visible business line nodes, and the business line to which the user belongs, perform business line filtering on a preset document library to obtain an initial document candidate set converged to the business line to which the user belongs" specifically includes: if the user role in the user role information is not an administrator role, then filter documents in the document library that are associated with business line nodes in the set of visible business line nodes to form a first document set; if the search request carries a sub-business line identifier, then filter documents in the document library that correspond to the sub-business line identifier to form a second document set; if the search request carries a business line identifier, then filter documents in the document library that correspond to the business line identifier to form a third document set; take the intersection of the first document set, the second document set, and the third document set to form an initial document candidate set converged to the business line to which the user belongs.
[0045] For example, such as Figure 4 As shown, this application receives a set of user-visible business line nodes through a business line filtering module and executes a three-layer filtering logic: the first layer filters documents based on the business line identifier in the set of visible business line nodes; administrators are not subject to this layer of filtering; the second layer further filters when a specific sub-business line identifier is requested; and the third layer further filters when a specific business line identifier is requested. After the three layers of filtering, a candidate set of documents that has converged within the business line scope is output.
[0046] The retrieval scope of this application automatically converges to the document set of the user's business line and its sub-business lines before the search is executed. Compared with full search and post-filtering solutions, the number of documents participating in vector matching is reduced by 70% to 90%, the retrieval response time is shortened accordingly, and the risk of information leakage in the post-filtering process is eliminated.
[0047] like Figure 1 As shown, the filtering and retrieval method based on organizational structure also includes the following steps: Step S400: Perform visibility checks on each document in the document candidate set, and determine the target document candidate set based on the visibility check results.
[0048] In this embodiment of the application, step S400 specifically includes: Visibility checks are performed on each document in the document candidate set, and the visibility attribute of the document is used to record the user role group identifier that is allowed to access the corresponding document; If the document's visibility attribute does not record the user role group identifier, then the document is determined to be a publicly visible document within the business line to which the document belongs, and the document is retained in the document candidate set; If the visibility attribute record of a document has at least one user role group identifier, then the user role group identifiers in the user role group list are matched with the user role group identifiers in the visibility attribute record. If at least one matching user role group identifier exists, the document is retained; if no matching user role group identifier exists, the document is removed, so as to obtain a target document candidate set.
[0049] For example, this application performs a visibility check on each document in the document candidate set through a visibility filtering module. If the visibility attribute of a document is empty, the document is visible to all users within its business line and passes directly; if it is not empty, it checks whether at least one role group identifier appears in the visibility attribute list in the user role group list. If it does, the document is retained; otherwise, it is removed. This mechanism enables cross-business line document-oriented sharing.
[0050] This application supports targeted document sharing across business lines by performing visibility checks on each document in the document candidate set, ensuring both isolation and collaboration flexibility.
[0051] This application implements a two-level progressive permission filtering by linking a business line filtering module and a visibility filtering module in the retrieval chain. The first level automatically narrows the scope based on business line affiliation, while the second level performs fine-grained control based on document visibility attributes. The two work together to achieve an isolated retrieval strategy of "convergence first, then fine-tuning." Compared to existing full-search and post-filtering solutions, this eliminates the risk of information leakage in the intermediate stages.
[0052] like Figure 1 As shown, the filtering and retrieval method based on organizational structure also includes the following steps: Step S500: Determine the current retrieval mode based on the current network performance parameters. Under the current retrieval mode, search the target document candidate set according to the retrieval query text to obtain the retrieval results.
[0053] In this embodiment of the application, the current network performance parameters include: current network latency and current bandwidth. Step S500 specifically includes: Step S510: Based on the current network performance parameters, determine the current search mode in the preset search modes. The search modes include: local priority mode, cloud priority mode and full cloud mode. Step S520: In the current search mode, perform vector search and keyword search in the target document candidate set according to the search query text to obtain vector search results and keyword search results; Step S530: The vector retrieval results and keyword retrieval results are weighted and fused to obtain a comprehensive score; Step S540: Output each search result in descending order of comprehensive score. Each search result includes at least one of the following: document identifier, document title, matched text content, comprehensive score, business line identifier, and sub-business line identifier.
[0054] For example, the retrieval mode selection module of this application selects from three retrieval modes based on network status and security policies. If the current network latency is higher than a preset first latency threshold (e.g., 200ms) or the current bandwidth is lower than a preset first bandwidth threshold (e.g., 10Mbps), local retrieval is prioritized, i.e., the local priority mode is selected, and cloud-based supplementation is initiated when insufficient. If the current network latency is lower than a second latency threshold (50ms) and bandwidth is sufficient (i.e., the current bandwidth is greater than a preset second bandwidth threshold), the cloud priority mode is selected. The full cloud mode is suitable for scenarios where the local vector database is not deployed. Wherein, the first latency threshold > the second latency threshold, and the first bandwidth threshold < the second bandwidth threshold. The module internally includes a network status detection submodule, a security policy reading submodule, and a mode decision submodule. Figure 5 As shown, the decision logic for automatically selecting the retrieval mode based on network latency RTT and available bandwidth BW is illustrated.
[0055] The local vector retrieval module of this application supports three methods: vector retrieval, keyword retrieval, and hybrid retrieval. Vector retrieval converts the query text into query vectors and then performs an approximate nearest neighbor search; keyword retrieval performs full-text matching; and hybrid retrieval performs both methods simultaneously and then weighted and merges them. The output results include document identifier, document title, matched text content, vector similarity score, and business line identifier. The cloud-based vector retrieval module connects to a remote vector database service via a secure communication link, supports the same three retrieval methods, and has the same output format as the local vector retrieval module. Furthermore, the parallel structure of the local and cloud-based vector retrieval modules can be replaced with a cascaded structure, i.e., local retrieval is performed first, and cloud retrieval is triggered only when the local results do not meet the conditions, reducing unnecessary cloud calls.
[0056] The result fusion and sorting module of this application performs the following processing flow: First, the search results from local and cloud sources are deduplicated according to document identifier and block index. When the same document block has results in both local and cloud, the result with the higher score is retained. Then, the scores from different search sources are normalized to the [0,1] range to eliminate the problem of inconsistent scoring scales among different search engines. The normalized scores are weighted and summed according to configurable weight ratios to obtain a comprehensive relevance score. Finally, the results are sorted and output from high to low according to the comprehensive score. Each result includes a document identifier, document title, matched text content (truncated to the first 500 characters), comprehensive score, business line identifier, and sub-business line identifier. Among them, the matched text content can be block text content.
[0057] This application can dynamically switch between three modes: local priority, cloud priority, and full cloud. Compared with the fixed search mode, when the network latency is higher than 200ms, it automatically degrades to the local priority mode, and the search availability is improved from 95% to 99.9%.
[0058] In addition, the three fixed modes of the search mode selection module can be replaced with a continuously adjustable mixed ratio mode. By setting the local weight coefficient w∈[0,1], the final score of the local search result is multiplied by w, and the final score of the cloud search result is multiplied by (1-w). The value of w is calculated in real time based on network latency, achieving a smoother search mode switching.
[0059] In this embodiment of the application, after step S500, the method further includes: Obtain the current status of the business line node to which the document belongs and the current document status in the search results, and verify the matching result between the user role group identifier of the visibility attribute record of the document in the search results and the user role group identifier in the user role group list; If the following conditions are met simultaneously: the current status of the business line node to which the document belongs in the search results is enabled, the current status of the document is valid, and the matching result shows that there is at least one matching user role group identifier, then each search result will be transmitted to the user interface for display. Based on the retrieval behavior obtained from the response to the retrieval request, the audit log corresponding to the retrieval behavior is obtained and stored in the audit log table. The audit log table supports query analysis by at least one dimension among user, time period and retrieval mode.
[0060] For example, such as Figure 6 As shown, the permission penetration verification module of this application performs a final permission verification before displaying the search results to the user. This involves checking whether the business line node to which the document belongs is still enabled; checking whether the document's current status is active; and re-verifying the matching relationship between the document's visibility attribute and the user role group. The verified result list is then passed to the user interface for display.
[0061] The audit module of this application records a complete audit log for each retrieval behavior, including user ID and timestamp, retrieval query text, identity resolution results, the number of document candidates at each filtering stage, the selected search mode, the number of results and average scores for local and cloud searches, the number of results output after fusion sorting, and the number of results removed during permission penetration verification. The audit log is persistently stored in the audit log table, supporting query analysis by user, time period, search mode, and other dimensions.
[0062] This application uses permission penetration verification and audit log recording to perform a final permission check before the results are displayed, preventing data leakage caused by changes in permission policies during the retrieval process, realizing a secure closed loop for the entire retrieval chain, and reducing the time for tracing security incidents from hours to minutes.
[0063] The system described in this application can be integrated with agents via the Model Context Protocol (MCP). Agents send retrieval requests to the system through a standardized tool call interface, and the system returns structured retrieval results after completing isolated retrievals. The MCP protocol uses JSON-RPC 2.0 as the message transmission format and implements communication between the agent and the knowledge base service through the stdio transport protocol. Documents in the system are processed into blocks upon entry into the database; each document is divided into multiple text blocks, and each text block is converted into a 1536-dimensional vector through an embedding model and stored, supporting incremental updates. The system supports three retrieval modes: hybrid retrieval, pure vector retrieval, and pure keyword retrieval, which can be specified through retrieval request parameters.
[0064] The following are specific examples for illustration.
[0065] Example 1: This example illustrates a user retrieval scenario within the investment banking department. The user in the investment banking business line inputs "Query Private Placement Business Operation Manual". The hierarchical business mapping module identifies the user role group as "Investment Banking - Fixed Income". The business line filtering module narrows the scope to documents within the investment banking business line and its sub-business lines. The visibility filtering module checks the visibility attribute (visible_to) of each document. The retrieval mode selection module detects that the local vector library is available and the network latency is 30ms, selecting the local priority mode. The local vector retrieval module performs a hybrid retrieval. The result fusion and sorting module normalizes the scores and sorts the results. The permission penetration verification module confirms that the document status and business line nodes are normal, and then returns the retrieval results.
[0066] Example 2: This example illustrates a cross-business line document sharing scenario. Users in the asset management business line need to access compliance documents shared by the investment banking department. The document's visibility attribute (visible_to) includes the role group ID of the asset management business line. When the visibility filtering module detects that the user's role group ID appears in the visible_to list, it retains the document and returns the search results normally.
[0067] Example 3: This example illustrates a network degradation scenario. In the local deployment environment, network latency rises to 300ms. The retrieval mode selection module detects that the latency exceeds the 200ms threshold and automatically switches to a local priority mode, prioritizing local vector retrieval. If local results are insufficient, cloud-based supplementation is initiated. The result fusion and sorting module deduplicates, normalizes, and weights the local and cloud results before sorting and outputting them.
[0068] In one embodiment, such as Figure 7 As shown, based on the above-described filtering and retrieval method based on organizational structure, the present invention also provides a corresponding filtering and retrieval device based on organizational structure, comprising: Response module 100 is used to respond to a retrieval request and obtain information to be retrieved, wherein the information to be retrieved includes at least: user identifier and retrieval query text; The determination module 200 is used to determine the user role information and the set of visible business line nodes corresponding to the user identifier based on a pre-built hierarchical mapping architecture. The filtering module 300 is used to obtain the business line to which the user belongs, and based on the user role information, the set of visible business line nodes and the business line to which the user belongs, to perform business line filtering on the preset document library to obtain an initial document candidate set that converges to the business line to which the user belongs. The inspection module 400 is used to perform visibility checks on each document in the document candidate set, and determine the target document candidate set based on the visibility check results; The retrieval module 500 is used to determine the current retrieval mode based on the current network performance parameters, and under the current retrieval mode, to retrieve the retrieval results from the target document candidate set according to the retrieval query text.
[0069] It should be noted that the foregoing explanation of the filtering and retrieval method embodiment based on organizational structure dimension also applies to the filtering and retrieval device based on organizational structure dimension in this embodiment, and will not be repeated here.
[0070] This invention discloses a filtering and retrieval device based on organizational structure. Upon responding to a retrieval request, it obtains information to be retrieved, including at least a user identifier and a retrieval query text. Based on a pre-constructed hierarchical mapping architecture, it determines the user role information and a set of visible business line nodes corresponding to the user identifier. It then obtains the business line to which the user belongs, and based on the user role information, the set of visible business line nodes, and the user's business line, performs business line filtering on a pre-defined document library to obtain an initial candidate set of documents converged to the user's business line. It performs visibility checks on each document in the candidate set and determines a target candidate set of documents based on the visibility check results. Finally, it determines the current retrieval mode based on current network performance parameters, and under the current retrieval mode, searches the target candidate set according to the retrieval query text to obtain the retrieval results. This application achieves an isolated retrieval strategy of convergence followed by fine-tuning by performing business line filtering and visibility checks before retrieval, avoiding the participation of a large number of irrelevant documents in vector matching calculations and the risk of information leakage, thus improving retrieval efficiency.
[0071] Figure 8 A schematic diagram of the device provided in an embodiment of this application. The device may include: The memory 501, the processor 502, and the computer program stored on the memory 501 and capable of running on the processor 502.
[0072] When the processor 502 executes the program, it implements the filtering and retrieval method based on the organizational structure dimension provided in the above embodiments.
[0073] Furthermore, the equipment also includes: Communication interface 503 is used for communication between memory 501 and processor 502.
[0074] The memory 501 is used to store computer programs that can run on the processor 502.
[0075] The memory 501 may include high-speed RAM memory, and may also include non-volatile memory, such as at least one disk storage device.
[0076] If the memory 501, processor 502, and communication interface 503 are implemented independently, they can be interconnected via a bus to communicate with each other. The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. Buses can be categorized as address buses, data buses, control buses, etc. For ease of representation, only one line is used in the diagram, but this does not imply that there is only one bus or one type of bus.
[0077] Optionally, in a specific implementation, if the memory 501, processor 502, and communication interface 503 are integrated on a single chip, then the memory 501, processor 502, and communication interface 503 can communicate with each other through an internal interface.
[0078] Processor 502 may be a central processing unit (CPU), an application specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of this application.
[0079] This embodiment also provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the above-described organizational structure-based filtering and retrieval method.
[0080] In the description of this specification, the references to terms such as "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of this application. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples. Moreover, without contradiction, those skilled in the art can combine and integrate the different embodiments or examples described in this specification, as well as the features of different embodiments or examples.
[0081] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one of that feature. In the description of this application, "N" means at least two, such as two, three, etc., unless otherwise explicitly specified.
[0082] Any process or method description in the flowchart or otherwise herein can be understood as representing a module, segment, or portion of code comprising one or N executable instructions for implementing custom logic functions or processes, and the scope of the preferred embodiments of this application includes additional implementations in which functions may be performed not in the order shown or discussed, including substantially simultaneously or in reverse order depending on the functions involved, as should be understood by those skilled in the art to which embodiments of this application pertain.
[0083] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as a ordered list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by, or in conjunction with, an instruction execution system, apparatus, or device (such as a computer-based system, a processor-included system, or other system that can read and execute instructions from or in conjunction with such an instruction execution system, apparatus, or device). For the purposes of this specification, "computer-readable medium" can be any means that can contain, store, communicate, propagate, or transmit programs for use by or in conjunction with an instruction execution system, apparatus, or device. More specific examples (a non-exhaustive list) of computer-readable media include: an electrical connection having one or more wires (electronic device), a portable computer disk drive (magnetic device), random access memory (RAM), read-only memory (ROM), erasable and editable read-only memory (EPROM or flash memory), fiber optic devices, and portable optical disc read-only memory (CDROM). In addition, computer-readable media can even be paper or other suitable media on which programs can be printed, because programs can be obtained electronically by optically scanning paper or other media, then editing, interpreting or otherwise processing them as necessary, and then storing them in computer memory.
[0084] It should be understood that the various parts of this application can be implemented using hardware, software, firmware, or a combination thereof. In the above embodiments, the N steps or methods can be implemented using software or firmware stored in memory and executed by a suitable instruction execution system. If implemented in hardware, as in another embodiment, it can be implemented using any one or a combination of the following techniques known in the art: discrete logic circuits having logic gates for implementing logical functions on data signals, application-specific integrated circuits (ASICs) having suitable combinational logic gates, programmable gate arrays (PGAs), field-programmable gate arrays (FPGAs), etc.
[0085] Those skilled in the art will understand that all or part of the steps of the methods described in the above embodiments can be implemented by a program instructing related hardware. The program can be stored in a computer-readable storage medium, and when executed, it includes one or a combination of the steps of the method embodiments.
[0086] Furthermore, the functional units in the various embodiments of this application can be integrated into a processing module, or each unit can exist physically separately, or two or more units can be integrated into a module. The integrated module can be implemented in hardware or as a software functional module. If the integrated module is implemented as a software functional module and sold or used as an independent product, it can also be stored in a computer-readable storage medium.
[0087] The storage medium mentioned above can be a read-only memory, a disk, or an optical disk, etc. Although embodiments of this application have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting this application. Those skilled in the art can make changes, modifications, substitutions, and variations to the above embodiments within the scope of this application.
Claims
1. A filtering and retrieval method based on organizational structure, characterized in that, The method includes: In response to a search request, the system obtains the information to be searched, which includes at least: a user identifier and a search query text; The user role information and the set of visible business line nodes corresponding to the user identifier are determined based on a pre-built hierarchical mapping architecture. Obtain the business line to which the user belongs; based on the user role information, the set of visible business line nodes, and the business line to which the user belongs, perform business line filtering on the preset document library to obtain an initial candidate set of documents that converges to the business line to which the user belongs. Visibility checks are performed on each document in the candidate document set, and the target document candidate set is determined based on the visibility check results; The current retrieval mode is determined based on the current network performance parameters. Under the current retrieval mode, the retrieval results are obtained by searching the target document candidate set according to the retrieval query text. Based on the user role information, the set of visible business line nodes, and the business line to which the user belongs, a preset document library is filtered by business line to obtain an initial candidate set of documents that converges to the business line to which the user belongs, including: If the user role in the user role information is not an administrator role, then the documents associated with the business line nodes in the visible business line node set are filtered in the document library to form a first document set. If the search request carries a sub-business line identifier, then the documents corresponding to the sub-business line identifier are filtered in the document library to form a second document set; If the search request carries a business line identifier, then the documents corresponding to the business line identifier are filtered in the document library to form a third document set; The intersection of the first document set, the second document set, and the third document set is used to form an initial candidate document set that converges to the user's business line.
2. The filtering and retrieval method based on organizational structure dimension according to claim 1, characterized in that, The hierarchical mapping architecture includes a root node and multiple business line nodes with hierarchical relationships. The document library includes multiple documents, each of which corresponds to a document node. Each document node is associated with at least one lowest-level business line node. Each business line node includes: node identifier, node name, parent node reference, list of child nodes, and node status attributes; each document node includes: document identifier, business line identifier, document category, document tag, visibility attributes, document status, and document metadata attributes.
3. The filtering and retrieval method based on organizational structure dimension according to claim 1, characterized in that, Based on a pre-built hierarchical mapping architecture, the user role information and the set of visible business line nodes corresponding to the user identifier are determined, including: The user role information corresponding to the user identifier is obtained by querying a preset user information table based on the user identifier. The user role information includes: username, user role, role status and user role group list. Identity authentication is performed based on the user role information; If the identity authentication is successful, the hierarchical mapping architecture is traversed to obtain the user role group identifier in the user role group list, the business line node that matches the user role group identifier is found, and the business line node and its subordinate child nodes are set as visible business line nodes.
4. The filtering and retrieval method based on organizational structure dimension according to claim 1, characterized in that, Perform visibility checks on each document in the candidate document set, and determine the target document candidate set based on the visibility check results, including: Visibility checks are performed on each document in the document candidate set, and the visibility attribute of the document is used to record the user role group identifier that is allowed to access the corresponding document; If the document's visibility attribute does not record the user role group identifier, then the document is determined to be a publicly visible document within the business line to which the document belongs, and the document is retained in the document candidate set; If the visibility attribute record of a document has at least one user role group identifier, then the user role group identifiers in the user role group list are matched with the user role group identifiers in the visibility attribute record. If at least one matching user role group identifier exists, the document is retained; if no matching user role group identifier exists, the document is removed, so as to obtain a target document candidate set.
5. The filtering and retrieval method based on organizational structure dimension according to claim 1, characterized in that, The current network performance parameters include: current network latency and current bandwidth; based on the current network performance parameters, a current retrieval mode is determined; under the current retrieval mode, the retrieval is performed in the target document candidate set according to the retrieval query text to obtain retrieval results, including: Based on the current network performance parameters, the current search mode is determined from the preset search modes, which include: local priority mode, cloud priority mode and full cloud mode; In the current search mode, vector search and keyword search are performed respectively in the target document candidate set according to the search query text to obtain vector search results and keyword search results; The vector retrieval results and keyword retrieval results are weighted and fused to obtain a comprehensive score; The search results are output in descending order of comprehensive score. Each search result includes at least one of the following: document identifier, document title, matched text content, comprehensive score, business line identifier, and sub-business line identifier.
6. The filtering and retrieval method based on organizational structure dimension according to claim 1, characterized in that, Based on the current network performance parameters, the current retrieval mode is determined. Under the current retrieval mode, the search is performed in the target document candidate set according to the search query text. After obtaining the search results, the process further includes: Obtain the current status of the business line node to which the document belongs and the current document status in the search results, and verify the matching result between the user role group identifier of the visibility attribute record of the document in the search results and the user role group identifier in the user role group list; If the following conditions are met simultaneously: the current status of the business line node to which the document belongs in the search results is enabled, the current status of the document is valid, and the matching result shows that there is at least one matching user role group identifier, then each search result will be transmitted to the user interface for display. Based on the retrieval behavior obtained from the response to the retrieval request, the audit log corresponding to the retrieval behavior is obtained and stored in the audit log table. The audit log table supports query analysis by at least one dimension among user, time period and retrieval mode.
7. A filtering and retrieval device based on organizational structure, characterized in that, The device includes: The response module is used to respond to retrieval requests and obtain the information to be retrieved, which includes at least: user identifier and retrieval query text; The determination module is used to determine the user role information and the set of visible business line nodes corresponding to the user identifier based on a pre-built hierarchical mapping architecture. The filtering module is used to obtain the business line to which the user belongs, and based on the user role information, the set of visible business line nodes and the business line to which the user belongs, to perform business line filtering on the preset document library to obtain an initial candidate set of documents that converges to the business line to which the user belongs. The inspection module is used to perform visibility checks on each document in the document candidate set, and determine the target document candidate set based on the visibility check results; The retrieval module is used to determine the current retrieval mode based on the current network performance parameters, and under the current retrieval mode, to retrieve the retrieval results from the target document candidate set according to the retrieval query text. Based on the user role information, the set of visible business line nodes, and the business line to which the user belongs, a preset document library is filtered by business line to obtain an initial candidate set of documents that converges to the business line to which the user belongs, including: If the user role in the user role information is not an administrator role, then the documents associated with the business line nodes in the visible business line node set are filtered in the document library to form a first document set. If the search request carries a sub-business line identifier, then the documents corresponding to the sub-business line identifier are filtered in the document library to form a second document set; If the search request carries a business line identifier, then the documents corresponding to the business line identifier are filtered in the document library to form a third document set; The intersection of the first document set, the second document set, and the third document set is used to form an initial candidate document set that converges to the user's business line.
8. A device, characterized in that, include: The system includes a memory, a processor, and an organizational structure-based filtering and retrieval program stored in the memory and executable on the processor, wherein the organizational structure-based filtering and retrieval program, when executed by the processor, implements the steps of the organizational structure-based filtering and retrieval method as described in any one of claims 1 to 6.
9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that can be executed to implement the steps of the organizational structure-based filtering and retrieval method as described in any one of claims 1 to 6.
