A Data Security Processing Method and System Based on a Large Model
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2026-04-28
- Publication Date
- 2026-08-14
AI Technical Summary
[0003]本发明目的在于,提供一种基于大模型的数据安全处理方法及系统,以解决上述采用静态配置模式导致的不能保证数据安全或影响用户正常获取查询结果的问题
本发明根据用户状态和用户想要查询的事件ID确定是否将用户的数据查询申请输入到大模型进行推理,基于大模型实现了业务应用和数据库的隔离,提高了数据的安全性;用户状态和用户想要查询的事件ID决定了用户的授权情况,用户状态变化或者用户想要查询的事件ID变化时用户的授权情况也会改变,本发明实现了用户的动态配置授权,避免了现有技术中采用静态配置模式存在的数据易泄露或影响用户正常获取查询结果的问题,能够保证数据安全。而且,本发明在根据用户状态和用户想要查询的事件ID确定不能将用户的数据查询申请输入到大模型进行推理的情况下,还结合用户ID与事件ID的关系类型和查询内容对应的查询类型共同判断是否将用户的数据查询申请输入到大模型进行推理,由此,本发明可以灵活配置用户权限,可以根据用户与事件的不同关系为用户分配不同查询内容的查询授权,能够适用于复杂业务场景,提升扩展性。
Smart Images

Figure CN122197076B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of electronic digital data processing technology, and in particular to a data security processing method and system based on a large model. Background Technology
[0002] In the field of data querying, data security is paramount. To prevent data leakage and improve query security, existing technologies often perform authorization verification on users before outputting query results. However, current technologies mostly employ a static configuration model for user permissions, meaning that the permissions of the same user are pre-fixed and do not change with user status or query content. This static configuration model is prone to causing excessive weighting, leading to data leakage risks and failing to guarantee data security; or it can easily lead to insufficient weighting, affecting users' ability to obtain query results normally. Summary of the Invention
[0003] The purpose of this invention is to provide a data security processing method and system based on a large model, so as to solve the problems caused by the above-mentioned static configuration mode, which cannot guarantee data security or affect users' normal access to query results.
[0004] According to a first aspect of the present invention, a data security processing method based on a large model is provided, the method comprising the following steps: S100, Receive user's data query request; the data query request includes user ID, event ID and query content; the query content is related to the event ID.
[0005] S200: Obtain the user status based on the user ID. If the user status is the first preset status, proceed to S300.
[0006] S300: Obtain the user's list of authorized event IDs based on the user ID, and determine whether the event IDs included in the data query request are in the user's list of authorized event IDs; the user's list of authorized event IDs includes several event IDs authorized to the user.
[0007] S400: If the event ID included in the data query request is in the user's authorized event ID list, then input the query content included in the data query request into the large model so that the large model outputs the query result corresponding to the data query request; otherwise, proceed to S500.
[0008] S500, parse the preset user event relationship graph to obtain the relationship type of user ID and event ID included in the data query application; the nodes of the user event relationship graph are user ID and event ID, and the edges of the user event relationship graph are used to connect two user IDs, two event IDs, or one user ID and one event ID.
[0009] S600 parses the query content and obtains the query type corresponding to the query content.
[0010] S700: Based on the preset relational query type mapping table, determine whether the relational type of the user ID and event ID included in the data query application matches the query type corresponding to the query content. If they match, input the query content included in the data query application into the large model so that the large model outputs the query result corresponding to the data query application; otherwise, output the preset query failure information.
[0011] According to a second aspect of the present invention, a large-model-based data security processing system is provided, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the above-described large-model-based data security processing method.
[0012] Compared with the prior art, the present invention has at least the following beneficial effects: This invention determines whether to input a user's data query request into a large model for inference based on the user's status and the event ID the user wants to query. This large model isolates business applications from the database, improving data security. The user's status and the event ID they want to query determine their authorization status; changes in user status or the event ID change their authorization status. This invention implements dynamic user authorization configuration, avoiding the data leakage or interference with normal query result retrieval issues inherent in static configuration methods in existing technologies, thus ensuring data security. Furthermore, when it's determined that the user's data query request cannot be input into the large model for inference based on the user's status and the event ID, this invention also considers the relationship type between the user ID and the event ID, as well as the query type corresponding to the query content, to jointly determine whether to input the user's data query request into the large model for inference. Therefore, this invention allows for flexible configuration of user permissions, assigning different query authorizations to users based on different relationships between users and events, making it applicable to complex business scenarios and improving scalability. Attached Figure Description
[0013] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0014] Figure 1 This is a flowchart of a data security processing method based on a large model provided in Embodiment 1 of the present invention. Detailed Implementation
[0015] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0016] Example 1: According to this embodiment, as Figure 1 As shown, a data security processing method based on a large model is provided, the method including the following steps: S100, Receive user's data query request; the data query request includes user ID, event ID and query content; the query content is related to the event ID.
[0017] In this embodiment, the user ID is a string that uniquely identifies the user (such as a user employee number); the event ID is a string that uniquely identifies the query object (such as a business event); the query content is the specific information that the user needs to obtain (such as detailed information about the personnel related to event A), and this content is related to the event ID (for example, the query content is information about the personnel involved in the event ID, the query content is information about the vehicles involved in the event ID, or the query content is a detailed description of the event ID, etc.).
[0018] As a specific implementation method, the system receives user-submitted query requests through a business application interface (such as an API), performs format validation on the requests (such as whether they contain user ID, event ID, and query content), and processes them after the validation is successful; if the format does not match, it directly returns a preset request format error message.
[0019] S200: Obtain the user status based on the user ID. If the user status is the first preset status, proceed to S300.
[0020] In this embodiment, S200 further includes: if the user status is a second preset status, then output a preset query failure message.
[0021] In this embodiment, the user status is an attribute that represents the user's current business identity or the conditions under which permissions are effective (such as being on duty or not on duty). The first preset status is the status that allows initiating queries (such as being on duty, meaning the user is in a normal working state and has the basic permissions to perform queries). The second preset status is the status that prohibits initiating queries (such as not on duty, meaning the user is not currently qualified to perform queries).
[0022] As a specific implementation method, the user status management system interface is called according to the user ID to obtain the user's current status (such as on-duty or off-duty status); if the status is the first preset status (such as on-duty), proceed to S300; if the status is the second preset status (such as off-duty), the preset query failure information is directly output (such as the current status cannot initiate a query).
[0023] In this embodiment, user permissions are strongly correlated with user status. Requests that do not meet the basic conditions are filtered out through status verification, reducing invalid subsequent processing and blocking query attempts by users in non-compliant statuses (such as users who are off duty being unable to access sensitive data) from the source, thereby improving data security.
[0024] S300: Obtain the user's list of authorized event IDs based on the user ID, and determine whether the event IDs included in the data query request are in the user's list of authorized event IDs; the user's list of authorized event IDs includes several event IDs authorized to the user.
[0025] In this embodiment, the authorized event ID list is a pre-configured set of event IDs for which users are explicitly granted query permissions (e.g., if user A's authorized list contains event 1 and event 2, it means that user A can directly query all data related to these two events).
[0026] As a specific implementation method, the authorized event ID list of the user is retrieved from the permission management database based on the user ID (this list is maintained by the administrator through the permission configuration system and supports dynamic addition, deletion and modification); the event ID in the data query application is verified to exist in the list: if it exists, proceed to S400; if it does not exist, proceed to S500.
[0027] This embodiment performs the first-level permission verification based on the direct authorization relationship between users and events, quickly responds to explicitly authorized query requests, reduces complex logic calls, and enables efficient verification.
[0028] S400: If the event ID included in the data query request is in the user's authorized event ID list, then input the query content included in the data query request into the large model so that the large model outputs the query result corresponding to the data query request; otherwise, proceed to S500.
[0029] In this embodiment, the large model is a pre-trained model with natural language understanding and data processing capabilities (such as a dedicated model based on the GPT architecture or an industry-customized large model), which is used to parse query content and generate results. At the same time, it serves as an intermediate layer to isolate business applications from business databases and reduce the risk of data exposure.
[0030] S500, parse the preset user event relationship graph to obtain the relationship type of user ID and event ID included in the data query application; the nodes of the user event relationship graph are user ID and event ID, and the edges of the user event relationship graph are used to connect two user IDs, two event IDs, or one user ID and one event ID.
[0031] In this embodiment, the user event relationship graph is a graph structure data with user ID and event ID as nodes and association relationships as edges, used to represent the indirect relationships between users, events, and users and events.
[0032] In this embodiment, the relationship type is a parameter that quantifies the strength of the indirect association between a user and an event. In this embodiment, when a user has no direct authorization (i.e., the event ID included in the data query request is not in the user's list of authorized event IDs), the indirect association between the user and the event is mined through graph analysis to expand the reasonable query scope, avoiding the lack of flexibility caused by a single direct authorization and improving the applicability to complex scenarios. As a specific implementation, S500 includes: S510, locates the user ID node included in the data query application and the event ID node included in the data query application.
[0033] In this embodiment, the two core nodes, user ID node and event ID node, included in the data query application are locked in the graph to provide the starting point and ending point for subsequent path search.
[0034] S520, determine whether there exists a path that meets preset target conditions; the preset target conditions include: the starting node and ending node of the path are the user ID node and event ID node included in the data query application; if the path includes an edge connecting two user ID nodes, the two user IDs connected by the edge conform to a preset user ID relationship; if the path includes an edge connecting two event ID nodes, the two event IDs connected by the edge conform to a preset event ID relationship; if the path includes an edge connecting a user ID node and an event ID node, the event ID connected by the edge exists in the authorized event ID list corresponding to the user ID.
[0035] In this embodiment, if the path contains a user-user edge (first type edge), the two users must conform to a preset user relationship (such as a superior-subordinate relationship, which can be defined by business rules); if the path contains an event-event edge (second type edge), the two events must conform to a preset event relationship (such as a causal relationship, which can be defined by business rules); if the path contains a user-event edge (third type edge), the event must be in the user's authorized event ID list (i.e., only edges based on direct authorization are valid).
[0036] As a specific implementation method, a graph traversal algorithm (such as breadth-first search BFS) is used to start from the user ID node and search for all possible paths to the event ID node; each path is checked one by one to see if it meets the preset target conditions, and a valid path is selected; if there is at least one valid path, proceed to S530; if there is no valid path, output the query failure information directly.
[0037] S530, if it exists, then determine the relationship type between user ID and event ID based on the type of edges included in the path that satisfies the preset target conditions and the number of edges corresponding to each type.
[0038] In this embodiment, the indirect association characteristics between users and events are quantified by the number of edges of different types in the path, providing a basis for subsequent query type matching. As a specific implementation, S530 includes: S531, obtain the number q1 of the first type edges included in the j-th path that satisfies the preset target conditions; the first type edge is the edge connecting two user ID nodes; the value of j ranges from 1 to p, and p is the number of paths that satisfy the preset target conditions.
[0039] S532, obtain the number q2 of the second type edges included in the j-th path that satisfies the preset target conditions; the second type edges are the edges connecting two event ID nodes.
[0040] S533, obtain the number q3 of the third type edges included in the j-th path that satisfies the preset target conditions; the third type edges are the edges connecting the user ID node and the event ID node.
[0041] S534, (q1,q2,q3) is determined as the j-th relation type of user ID and event ID included in the data query application.
[0042] Based on S531-S534, the quantification of relation types is realized, providing a clear basis for subsequent matching with query types.
[0043] S600 parses the query content and obtains the query type corresponding to the query content.
[0044] In this embodiment, the query type is a parameter that characterizes the sensitivity or importance of the query content (in this embodiment, it is represented by the maximum weight of the keyword; the greater the weight, the more sensitive or important the query content).
[0045] As one specific implementation, S600 includes: S610, perform keyword extraction processing on the query content according to the preset keyword library. If the extraction is successful, obtain the extracted keywords and the weight corresponding to each keyword. The preset keyword library includes several keywords and the weight corresponding to each keyword.
[0046] In this embodiment, the preset keyword library is a database containing common query keywords in business scenarios and their corresponding weights.
[0047] As a specific implementation method, the query content is segmented into words, and the segmentation results are compared with a preset keyword library; if a matching keyword is extracted, the weight corresponding to each keyword is obtained.
[0048] S620 compares the weights of the extracted keywords and obtains the maximum weight of the extracted keywords.
[0049] S630, the maximum weight of the extracted keywords is determined as the query type corresponding to the query content.
[0050] Based on S610-S630, this embodiment realizes the quantification of query types, providing a basis for determining whether user permissions are suitable for query content.
[0051] As a specific implementation, S610 further includes: if extraction fails, using an entity recognition model to determine the entity type in the query content, and determining the query type corresponding to the query content based on the entity type in the query content.
[0052] In this embodiment, the entity recognition model is a natural language processing-based model (such as BERT or LSTM) used to identify preset entity types in the query content (the preset entity types can be preferentially set according to business needs; for example, preset entity types include user privacy types, financial data types, etc.). As a specific implementation method, a mapping relationship between different entity types and weights is pre-set. This allows the acquisition of the weights corresponding to different entity types in the query content, and the maximum weight is determined as the query type corresponding to the query content.
[0053] S700: Based on the preset relational query type mapping table, determine whether the relational type of the user ID and event ID included in the data query application matches the query type corresponding to the query content. If they match, input the query content included in the data query application into the large model so that the large model outputs the query result corresponding to the data query application; otherwise, output the preset query failure information.
[0054] In this embodiment, the preset relationship query type mapping table includes the correspondence between relationship types and query types. For example, the preset relationship query type mapping table is a predefined rule table for the correspondence between relationship types and query types, which is used to determine whether the relationship between a user and an event is sufficient to support the query content (e.g., rule (1,0,1) → weight≤3 means that a user with relationship type (1,0,1) can query content with weight≤3).
[0055] S700 includes: if there is a corresponding relationship between the relationship type of user ID and event ID and the query type corresponding to the query content, then it is determined that the relationship type of user ID and event ID matches the query type corresponding to the query content; otherwise, it is determined that the relationship type of user ID and event ID does not match the query type corresponding to the query content.
[0056] As a specific implementation, the allowed query type range (e.g., weight ≤ 4) corresponding to the relation type (e.g., (1,1,1)) determined in S530 is retrieved from the mapping table; the query type (e.g., weight 3) determined in S630 is compared to see if it is within the allowed range: if it matches (e.g., 3≤4), the query content is input into the large model, and the large model outputs the query result; if it does not match (e.g., query type is 5, exceeding the allowed range), a preset query failure message (e.g., insufficient permissions, unable to query) is output.
[0057] In this embodiment, a preset relationship query type mapping table is used to constrain the compatibility between the strength of the user-event relationship and the sensitivity of the query content. This ensures that users can only query content that matches their relationship (e.g., users with weak relationships cannot query highly sensitive content), which can prevent users with insufficient permissions from obtaining sensitive data, while avoiding excessive restrictions on reasonable queries, thus balancing security and flexibility.
[0058] In this embodiment, if the number of paths (i.e., p) that meet the preset target conditions in S520 is greater than or equal to 2, then the relationship type between the user ID and the event ID corresponding to each path that meets the preset target conditions is obtained, and it is determined whether the relationship type between the user ID and the event ID corresponding to each path that meets the preset target conditions matches the query type corresponding to the query content. If they do not match, then the preset query failure information is output; otherwise, the query content is input into the large model, and the large model outputs the query result.
[0059] This embodiment determines whether to input a user's data query request into the large model for inference based on the user's status and the event ID the user wants to query. The large model isolates business applications from the database, improving data security. The user's status and the event ID they want to query determine their authorization status; changes in user status or the event ID change their authorization status. This embodiment implements dynamic user authorization configuration, avoiding the data leakage or interference with normal query result retrieval issues present in existing static configuration models, thus ensuring data security. Furthermore, if this embodiment determines that the user's data query request cannot be input into the large model for inference based on the user's status and the event ID, it also considers the relationship type between the user ID and the event ID, as well as the query type corresponding to the query content, to jointly determine whether to input the user's data query request into the large model for inference. Therefore, this embodiment allows for flexible configuration of user permissions, assigning different query authorizations to users based on different relationships between users and events, making it applicable to complex business scenarios and improving scalability.
[0060] Example 2: This embodiment provides a data security processing system based on a large model, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, it performs the following steps: S100, Receive user's data query request; the data query request includes user ID, event ID and query content; the query content is related to the event ID.
[0061] S200: Obtain the user status based on the user ID. If the user status is the first preset status, proceed to S300.
[0062] S300: Obtain the user's list of authorized event IDs based on the user ID, and determine whether the event IDs included in the data query request are in the user's list of authorized event IDs; the user's list of authorized event IDs includes several event IDs authorized to the user.
[0063] S400: If the event ID included in the data query request is in the user's authorized event ID list, then input the query content included in the data query request into the large model so that the large model outputs the query result corresponding to the data query request; otherwise, proceed to S500.
[0064] S500, parse the preset user event relationship graph to obtain the relationship type of user ID and event ID included in the data query application; the nodes of the user event relationship graph are user ID and event ID, and the edges of the user event relationship graph are used to connect two user IDs, two event IDs, or one user ID and one event ID.
[0065] S600 parses the query content and obtains the query type corresponding to the query content.
[0066] S700: Based on the preset relational query type mapping table, determine whether the relational type of the user ID and event ID included in the data query application matches the query type corresponding to the query content. If they match, input the query content included in the data query application into the large model so that the large model outputs the query result corresponding to the data query application; otherwise, output the preset query failure information.
[0067] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments of the above methods. Any references to memory, storage, databases, or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), RAMbus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.
[0068] While specific embodiments of the invention have been described in detail by way of example, those skilled in the art should understand that the examples are for illustrative purposes only and not intended to limit the scope of the invention. It should also be understood that various modifications can be made to the embodiments without departing from the scope and spirit of the invention. The scope of the invention is defined by the appended claims.
Claims
1. A data security processing method based on a large model, characterized in that, The method includes the following steps: S100, Receive a user's data query request; the data query request includes a user ID, an event ID, and query content; the query content is related to the event ID; S200: Obtain the user status based on the user ID. If the user status is the first preset status, proceed to S300. S300: Obtain the user's list of authorized event IDs based on the user ID, and determine whether the event IDs included in the data query request are in the user's list of authorized event IDs; the user's list of authorized event IDs includes several event IDs authorized to the user; S400: If the event ID included in the data query request is in the user's authorized event ID list, then input the query content included in the data query request into the large model so that the large model outputs the query result corresponding to the data query request; otherwise, proceed to S500. S500, parse the preset user event relationship graph to obtain the relationship type between user ID and event ID included in the data query application; the nodes of the user event relationship graph are user ID and event ID, and the edges of the user event relationship graph are used to connect two user IDs, two event IDs, or one user ID and one event ID; S600, parse the query content and obtain the query type corresponding to the query content; S700: Based on the preset relational query type mapping table, determine whether the relational type of the user ID and event ID included in the data query application matches the query type corresponding to the query content. If they match, input the query content included in the data query application into the large model so that the large model outputs the query result corresponding to the data query application; otherwise, output the preset query failure information.
2. The data security processing method based on a large model according to claim 1, characterized in that, The S500 includes: S510, locates the user ID node included in the data query application and the event ID node included in the data query application; S520, determine whether there exists a path that meets preset target conditions; the preset target conditions include: the starting node and ending node of the path are the user ID node and event ID node included in the data query application; if the path includes an edge connecting two user ID nodes, the two user IDs connected by the edge conform to a preset user ID relationship; if the path includes an edge connecting two event ID nodes, the two event IDs connected by the edge conform to a preset event ID relationship; if the path includes an edge connecting a user ID node and an event ID node, the event ID connected by the edge exists in the authorized event ID list corresponding to the user ID; S530, if it exists, then determine the relationship type between user ID and event ID based on the type of edges included in the path that satisfies the preset target conditions and the number of edges corresponding to each type.
3. The data security processing method based on a large model according to claim 2, characterized in that, The S530 includes: S531, obtain the number q1 of the first type edges included in the j-th path that satisfies the preset target conditions; the first type edge is the edge connecting two user ID nodes; the value of j ranges from 1 to p, and p is the number of paths that satisfy the preset target conditions; S532, obtain the number q2 of the second type edges included in the j-th path that satisfies the preset target conditions; the second type edges are the edges connecting two event ID nodes; S533, obtain the number q3 of the third type edges included in the j-th path that satisfies the preset target conditions; the third type edges are the edges connecting the user ID node and the event ID node; S534, (q1,q2,q3) is determined as the j-th relation type of user ID and event ID included in the data query application.
4. The data security processing method based on a large model according to claim 1, characterized in that, The S600 includes: S610, perform keyword extraction processing on the query content according to the preset keyword library. If the extraction is successful, obtain the extracted keywords and the weight corresponding to each keyword. The preset keyword library includes several keywords and the weight corresponding to each keyword. S620: Compare the weights of the extracted keywords and obtain the maximum weight of the extracted keywords; S630, the maximum weight of the extracted keywords is determined as the query type corresponding to the query content.
5. The data security processing method based on a large model according to claim 1, characterized in that, The preset relationship query type mapping table includes the correspondence between relationship types and query types. S700 includes: if there is a correspondence between the relationship type of user ID and event ID and the query type corresponding to the query content, then it is determined that the relationship type of user ID and event ID matches the query type corresponding to the query content; otherwise, it is determined that the relationship type of user ID and event ID does not match the query type corresponding to the query content.
6. The data security processing method based on a large model according to claim 4, characterized in that, S610 also includes: if extraction fails, use an entity recognition model to determine the entity type in the query content, and determine the query type corresponding to the query content based on the entity type in the query content.
7. The data security processing method based on a large model according to claim 1, characterized in that, S200 also includes: if the user status is a second preset status, output a preset query failure message.
8. A data security processing system based on a large model, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the computer program, it implements the data security processing method based on a large model as described in any one of claims 1 to 7.
Citation Information
Patent Citations
Event processing method and device based on knowledge graph, equipment and storage medium
CN110489520A
Authorization verification management method and system based on customer privacy protection
CN112632493A