A method and system for bidirectional data security processing based on a private large model
By implementing differentiated security processing for southbound and northbound traffic of private large-scale models, the problems of sensitive data leakage and malicious responses in network queries of private large-scale models are solved, achieving precise protection of southbound traffic and secure processing of northbound traffic, thereby improving data security protection capabilities.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-30
- Publication Date
- 2026-03-13
AI Technical Summary
Existing technologies lack professional security protection solutions for private large-scale model network query scenarios, resulting in sensitive data in southbound traffic being vulnerable to injection attacks and unauthorized access risks, while model responses in northbound traffic may leak original data or output malicious commands. Traditional security protection cannot provide accurate protection against the different risk characteristics of these two types of traffic.
A bidirectional data security processing method based on a private large model is adopted. By acquiring southbound and northbound traffic data, a rule module is provided to perform semantic recognition, intent analysis, sentiment recognition, malicious code detection, and intellectual property detection. Combined with differentiated security processing strategies, data security processing is performed on southbound and northbound traffic respectively.
It achieves accurate identification and protection against sensitive information and malicious intent in southbound traffic, and effective identification and handling of security threats in northbound traffic, ensuring the security of private large-scale models and the normal operation of business functions. It is suitable for high-security scenarios such as finance and government affairs.
Smart Images

Figure CN121217422B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of large model data security processing technology, and in particular to a bidirectional data security processing method and system based on a private large model. Background Technology
[0002] With the rapid development of artificial intelligence technology, private deployment of large-scale models has become an important choice for enterprises to protect trade secrets, and the online query function, as a key capability for large-scale models to obtain real-time data, is widely used. However, existing technologies lack professional security protection solutions for online query scenarios of private large-scale models. This leads to risks such as injection attacks, unauthorized access, and traffic forgery for sensitive data including personal information and business instructions in the user request direction (southbound traffic). In the model response direction (northbound traffic), the generated text, code, and other content may implicitly leak original data or output malicious instructions and illegal content, facing threats such as response implantation attacks and intellectual property leakage. More importantly, southbound traffic and northbound traffic differ significantly in data sensitivity, attack surface, and behavioral patterns, but traditional security protection solutions use a single processing mechanism, which cannot provide precise protection for the different risk characteristics of the two types of traffic. It is difficult to effectively identify sensitive information and malicious intent at the semantic level, and often over-processes, resulting in damage to business functions. This seriously restricts the secure application of private large-scale models in high-security scenarios such as finance and government affairs. Summary of the Invention
[0003] In view of this, this invention proposes a bidirectional data security processing method and system based on a private large model, capable of performing specific data security processing on southbound and northbound traffic data. This invention provides the following technical solution:
[0004] A bidirectional data security processing method based on a private large model, the method comprising:
[0005] Obtain southbound and northbound traffic data during the network query process of the private large model;
[0006] A rules module is provided, which includes security rules, sensitive information identification standards, malicious code signature library and security operation algorithms;
[0007] Security diagnostics, including semantic recognition, intent analysis, and sentiment recognition, are performed on the southbound traffic data; security diagnostics, including malware detection, sensitive information detection, and intellectual property detection, are performed on the northbound traffic data.
[0008] Based on the security diagnosis results of the southbound and northbound traffic data and the rule module, data security processing is performed on the southbound and northbound traffic data respectively;
[0009] The processed southbound traffic data is submitted to the corresponding processing unit, and the processed northbound traffic data is returned to the user.
[0010] Optionally, the method further includes:
[0011] Record the original information, processed information, and processing time of the southbound and northbound traffic data.
[0012] Optionally, the acquisition of southbound and northbound traffic data during the private large model network query process includes:
[0013] Intercept southbound traffic data sent by the client or model application and northbound traffic data returned by the large model during the network query process of the private large model;
[0014] The intercepted southbound and northbound traffic data are decoded. The southbound traffic data includes at least one of user input queries, Prompt requests, and plugin calls. The northbound traffic data includes at least one of generated text, code, and external knowledge answers.
[0015] Optionally, the rules module also includes multiple types of security tokens, a security dictionary, and operation algorithm parameters;
[0016] The security tokens include personal information tokens, trade secret tokens, and important data tokens;
[0017] The security dictionary includes sensitive content, illegal content, and malicious code;
[0018] The operation algorithm parameters include at least one of the following: de-identification algorithm parameters, tokenization algorithm parameters, alphanumeric character replacement algorithm parameters, and null character replacement algorithm parameters.
[0019] Optionally, the security diagnostics performed on the southbound traffic data, including semantic recognition, intent analysis, and sentiment recognition, include:
[0020] A semantic recognition model is used to identify entity relationships in southbound traffic data, and to detect and label the personal information, trade secrets and important data contained therein;
[0021] A multi-head attention mechanism is used to perform intent analysis on southbound traffic data, calculate the authorization probability of user access, prioritize multi-intent behaviors, and identify normal access, unauthorized access, subjective disclosure and non-subjective disclosure scenarios.
[0022] Sentiment analysis of southbound traffic data is performed based on the integrated VADER sentiment dictionary to detect requests containing threatening tones such as extortion and inducement.
[0023] Optionally, the security diagnostics performed on the northbound traffic data, including malware detection, sensitive information detection, and intellectual property detection, include:
[0024] Malicious code detection is performed on northbound traffic data based on Abstract Syntax Tree (AST) analysis, identifying system instruction injection, code injection, and model hint poisoning attacks.
[0025] A dual-engine approach using regular expressions and deep learning is employed to detect sensitive information in northbound traffic data, identifying potentially leaked trade secrets and personal information.
[0026] The system connects to the intellectual property protection system to perform watermark detection on northbound traffic data and identify protected intellectual property content.
[0027] Optionally, the step of performing data security processing on the southbound and northbound traffic data based on the security diagnosis results of the southbound and northbound traffic data and the rule module respectively includes:
[0028] When performing data security processing on southbound traffic data:
[0029] When the security diagnostic results indicate the presence of sensitive information and the confidence level is higher than a preset first threshold, a de-identification operation is performed. The de-identification operation includes synonym replacement, interception, obfuscation, and expansion.
[0030] When the security diagnostic results indicate the existence of trade secrets or important data and the confidence level is higher than a preset second threshold, a tokenization operation is performed, which includes deterministic tokenization and reversible tokenization.
[0031] When performing data security processing on northbound traffic data:
[0032] When the security diagnostic results indicate the presence of malicious code and the confidence level is higher than the preset third threshold, a complete deletion operation is performed to delete the content containing system instruction injection or code injection.
[0033] When the security diagnostic result indicates the presence of sensitive information and the confidence level is higher than the fourth preset threshold, a content replacement operation is performed. The content replacement operation includes equivalence character replacement, empty character replacement, differential privacy algorithm processing, and dynamic token mapping.
[0034] When the security diagnostic results indicate the presence of intellectual property content and the confidence level is higher than the preset fifth threshold, the watermark data deletion or replacement operation is performed.
[0035] This invention further discloses a bidirectional data security processing system based on a private large model, the system comprising:
[0036] The data acquisition module is used to acquire southbound and northbound traffic data during the network query process of the private large model;
[0037] The rules module provides rules, which includes security rules, sensitive information identification standards, malicious code signature library, and security operation algorithms.
[0038] The security diagnostic module is used to perform security diagnostics on the southbound traffic data, including semantic recognition, intent analysis, and sentiment recognition, and to perform security diagnostics on the northbound traffic data, including malicious code detection, sensitive information detection, and intellectual property detection.
[0039] The data security processing module is used to perform data security processing on the southbound traffic data and northbound traffic data respectively based on the security diagnosis results of the southbound traffic data and the northbound traffic data and the rules module;
[0040] The data transmission module is used to submit the processed southbound traffic data to the corresponding processing unit and return the processed northbound traffic data to the user.
[0041] The present invention further discloses a computer-readable storage medium storing a computer program that, when executed by a processor, implements the above-described method.
[0042] The present invention further discloses an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the above-described method.
[0043] According to the technical solution of this invention, a bidirectional data security processing method based on a private large-scale model effectively solves the key security problems in the process of privately deployed large-scale model network query. Unlike traditional single security protection mechanisms, a north-south bidirectional differentiated processing architecture is adopted. By separately acquiring and specifically processing southbound and northbound traffic data during the private large-scale model network query process, accurate identification and protection against the unique risks of these two types of traffic are achieved. Specifically, the rule module provided by this invention integrates multi-dimensional security strategies such as security rules, sensitive information identification standards, malicious code feature libraries, and secure operation algorithms. This enables the system to perform multimodal security diagnostics on southbound traffic, including semantic recognition, intent analysis, and sentiment recognition, accurately detecting sensitive information and illegal intent in user requests; simultaneously, it performs malicious code detection, sensitive information detection, and intellectual property detection on northbound traffic, effectively identifying security threats in model responses. Based on this, differentiated data security processing is performed on northbound and southbound traffic according to the diagnostic results and rule modules. This avoids the shortcomings of traditional solutions in protecting sensitive data such as personal information and business instructions contained in southbound traffic from injection attacks and unauthorized access risks. It also addresses the security risks of potential hidden leakage of raw data or output of malicious instructions and illegal content in northbound traffic model responses. Through this integrated security processing mechanism, while ensuring the normal operation of the private large-scale model's online query function, data security protection capabilities are significantly improved, achieving a balance between security protection and business functions. This enables the private large-scale model to be used securely and reliably in high-security scenarios such as finance and government affairs, providing a practical and feasible technical solution for the secure deployment of private large-scale models. Attached Figure Description
[0044] For illustrative and not limiting purposes, the present invention will now be described in conjunction with embodiments and accompanying drawings, wherein:
[0045] Figure 1 This is a schematic diagram of a bidirectional data security processing method based on a private large model in an embodiment of the present invention;
[0046] Figure 2 This is a schematic diagram of the structure of the bidirectional data security processing system based on a private large model in an embodiment of the present invention;
[0047] Figure 3 This is a schematic diagram of the structure of the electronic device in an embodiment of the present invention;
[0048] Figure 4 This is a schematic diagram of the data processing flow of the southbound module in an embodiment of the present invention;
[0049] Figure 5 This is a schematic diagram of the data processing flow of the northbound module in an embodiment of the present invention. Detailed Implementation
[0050] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present application.
[0051] It should be noted that, where there is no conflict, the embodiments and features of the embodiments in this application can be combined with each other. The embodiments of this application will be described in detail below with reference to the accompanying drawings.
[0052] refer to Figure 1 , Figure 4 and Figure 5 This embodiment discloses a bidirectional data security processing method based on a private large model, the method comprising the following steps:
[0053] S100: Obtain southbound and northbound traffic data during the private large model network query process.
[0054] In a private large-scale model deployment environment, the deployment of the data security gateway can adopt two modes: First, deploy a hardware gateway at the business domain data egress point. This hardware gateway uses network mirroring or traffic mirroring technology to capture all network communication traffic between the DMZ area and the internal system in real time, especially HTTP / HTTPS requests and responses for the large-scale model's network query interface. Second, integrate the data security gateway software into the unified interface gateway system, acting as middleware to intercept all API call requests passing through the interface gateway.
[0055] When a user initiates a network query request to the private large-scale model through a client, the request first passes through the interception module of the data security gateway. For example, if a user enters a query request such as "List of non-performing loan customers and contact information for XX Bank in the first quarter of 2025", the data security gateway captures the request packet through the configured traffic mirroring port and identifies it as southbound traffic data, including the user's input query content. Simultaneously, when the private large-scale model obtains external data through the network query plugin and generates a response, such as returning "To harden the ETL server, execute rm -rf / * clear historical logs", the data security gateway also captures this response data through the mirroring port or API interception mechanism, identifying it as northbound traffic data, including the generated code content.
[0056] After capturing traffic, the data security gateway decodes the intercepted southbound and northbound traffic data. In this embodiment, the data security gateway includes a southbound module and a northbound module. The southbound module decodes the southbound traffic data to form query1, and the northbound module decodes the northbound traffic data to form response1. For southbound traffic, when the original request may have been processed by Base64 encoding, URL encoding, or a custom encryption algorithm, the gateway first calls the corresponding decoder to decode it and form the original query content. For example, when receiving the encoded request "VGVzdCBtZXNzYWdlIGZvciBkZWNvZGluZw==", the gateway automatically recognizes it as Base64 encoding and decodes it to restore it to "Testmessagefordecoding". For northbound traffic, the same processing is applied to the encrypted or encoded responses returned by the model, such as restoring escape characters in JSON format responses to ensure that subsequent security diagnostics can be analyzed based on the original semantic content.
[0057] After decoding, NLP word segmentation and slicing technology is used to preprocess the southbound and northbound traffic data. For southbound traffic, for example, upon receiving a request that "the internal financial system ETL server host 192.168.1.133 has a deserialization security vulnerability, and there are available remediation methods," the system calls the Chinese word segmentation engine to segment the data, forming a word sequence "internal network / financial system / ETL / server / host / 192.168.1.133 / exists / deserialization / security vulnerability / , / available / remediation / methods / have," providing a basic unit for subsequent security diagnosis. For northbound traffic, for example, upon receiving a response that "under root privileges, execute the following POC script to strengthen the security vulnerability," word segmentation is also performed, forming a sequence "under / root / privileges / , / execute / the following / POC / script / to / strengthen / security / vulnerability."
[0058] In summary, the steps outlined in this implementation not only achieve comprehensive capture and preprocessing of north-south traffic during the network query process of a private large model, but also adapt to the needs of different security level scenarios through flexible deployment modes, preparing for subsequent security diagnosis and data processing.
[0059] S200: Provides a rules module, which includes security rules, sensitive information identification standards, malicious code signature library and security operation algorithms.
[0060] In this implementation, the rules module, as the core decision engine of the data security gateway, adopts a layered architecture to manage differentiated security policies for southbound and northbound traffic. Specifically, the rules module first initializes through the configuration center, loading predefined security rule sets, sensitive information identification standard libraries, malicious code signature libraries, and security operation algorithm libraries. In actual deployment, this module adopts a dual-library separation architecture, physically isolating the southbound and northbound rule libraries while sharing basic security tokens and dictionary resources. This ensures both processing efficiency and accurate matching of differentiated security policies for northbound and southbound traffic.
[0061] The aforementioned rules module comprises three core components: a security token management subsystem, a security dictionary management subsystem, and an operation algorithm management subsystem. The security token management subsystem maintains personal information tokens (such as ID card numbers, mobile phone numbers, email addresses, etc.), trade secret tokens (such as company names, product codes, internal system identifiers, etc.), and important data tokens (such as financial transaction data, government confidential data, etc.). Each type of token is configured with detailed metadata information, including data type, sensitivity level, matching pattern, and processing priority. The security dictionary management subsystem contains multi-dimensional dictionary resources. The southbound dictionary focuses on semantic recognition and intent analysis, including a sensitive content dictionary, a violation content dictionary, and an intent recognition dictionary. The northbound dictionary focuses on malicious code and sensitive information detection, including a malicious code signature database, a sensitive content dictionary, and an intellectual property watermark signature database. In practical applications, the dictionaries support a dynamic update mechanism. Administrators can add or modify dictionary entries in real time through a web interface, and the system automatically recompiles the dictionary index to ensure immediate effectiveness of updates. The operation algorithm management subsystem implements the core algorithms for differentiated processing between southbound and northbound traffic. The southbound operation algorithms include: a synonym replacement algorithm, configured with a similarity threshold and an upper limit on the number of replacement words; an interception algorithm, configured with a regular expression matching template and rule priority; an obfuscation algorithm, configured with an obfuscation strategy and mask parameters; an expansion algorithm, configured with a hierarchical generalization table and a numerical generalization strategy; and tokenization algorithms, including deterministic tokenization and reversible tokenization. The northbound operation algorithms include: an equiposition character replacement algorithm, configured with a character mapping table; an empty character replacement algorithm, configured with a zero-width character type and insertion position strategy; a differential privacy algorithm, configured with a privacy budget and noise parameters; and a dynamic token mapping algorithm, configured with a token lifecycle and mapping table maintenance strategy.
[0062] This implementation further introduces an intelligent evolutionary closed-loop mechanism into the rules module, enabling the rules module to evolve from a static configuration optimization to a dynamic optimization system. Specifically, this includes:
[0063] Decision log collection mechanism: The online gateway does not perform any online model training; it is only responsible for strictly enforcing the current policy and recording the complete processing of each request as a structured log. ,in, It is a state space, but it removes traditional graph features, workload, history counts, etc., and specifically refers to multidimensional feature vectors. ,in It is the combination of actions taken in the previous moment, that is This enables the system to perceive historical decision sequences. The ∈{"relative","standard","strict","intercept"} simplifies the continuous action space into a discrete action space, greatly reducing the learning difficulty. This makes rule evolution stable and reliable. In the example, Each action level corresponds to a pre-set set of security parameter configurations, such as malicious detection threshold and desensitization strength. For joint risk scoring.
[0064] The collected decision logs are periodically fed into an offline simulation environment, where a large-scale simulated model and an external network environment are built. Training data is expanded using experience replay and adversarial example generation techniques. Reinforcement learning algorithms such as DQN are employed for policy training, and the reward function is designed as follows: ,in Indicates the number of missed reports. Indicates the number of false alarms. The weighting factor is used. After the newly trained policy model undergoes rigorous A / B testing in the simulation environment, it is deployed to the online gateway to replace the old policy, thereby achieving continuous optimization and security evolution of the rule module.
[0065] This implementation provides the following exemplary process: the rules module dynamically loads and matches rules through the policy engine. For example, when processing southbound traffic "Query Zhang San's loan record at XX Bank", the rules module first calls the security token management subsystem to identify "Zhang San" as a personal information token and "XX Bank" as a trade secret token. Then, it confirms through the security dictionary management subsystem that the request contains sensitive content. Finally, according to preset security rules (such as "Execute tokenization when personal information confidence level > 0.85"), it calls the operation algorithm management subsystem to select a deterministic tokenization algorithm to replace "Zhang San" with the unique identifier "USER_9A3F8B" and "XX Bank" with "ORG_5C2D7E", generating a securely processed request "Query USER_9A3F8B's loan record at ORG_5C2D7E". For the northbound traffic "Zhang San, ID number 11010119900307XXXX, mobile phone number 138xxxx8000, loan balance 500,000 yuan", the rules module triggers the northbound processing rules, using an empty character replacement algorithm to insert a U+200B zero-width space into the sensitive information, generating "Zhang San, ID number 11010119900307XXXX, mobile phone number 138001380000, loan balance 500,000 yuan", effectively preventing the direct extraction of sensitive information.
[0066] S300: Perform security diagnostics on the southbound traffic data, including semantic recognition, intent analysis, and sentiment recognition; and perform security diagnostics on the northbound traffic data, including malicious code detection, sensitive information detection, and intellectual property detection.
[0067] After southbound traffic data undergoes decoding and NLP segmentation, semantic recognition is performed first. In this implementation, a deep learning model based on BiLSTM-CRF is used to identify entity relationships in the segmented sequences, accurately detecting sensitive information. The model was trained using a million-level labeled dataset covering multiple industries such as finance and government, enabling it to accurately identify nested entities and complex semantic relationships.
[0068] Subsequently, intent analysis is performed on southbound traffic data, employing a multi-head attention mechanism to calculate the authorization probability of user access. This mechanism identifies scenarios such as normal access, unauthorized access, subjective disclosure, and non-subjective disclosure by analyzing keywords, contextual relationships, and historical behavior patterns in the query content. For complex queries containing multiple intents, intents are prioritized, processing high-risk intents first, followed by relatively low-risk intents.
[0069] Meanwhile, sentiment analysis of southbound traffic data is performed by integrating the VADER sentiment dictionary, which has been optimized and expanded for Chinese scenarios. For example, when a user request contains content such as "If you do not provide Zhang San's contact information, we will expose your bank's data breach to the media," the sentiment recognition module will mark it as a high-risk threat request with a confidence level of 92.5%. In practical applications, this sentiment recognition mechanism is weighted and integrated with semantic recognition and intent analysis results to form a comprehensive risk score, providing a basis for decision-making in subsequent data security processing.
[0070] For northbound traffic data, malicious code detection is performed first. This detection is based on Abstract Syntax Tree (AST) analysis technology, which performs structured parsing and security auditing on the code content generated by the model. For example, when the large model responds with "Execute the following POC script under root privileges to harden the security vulnerability: rm-rf / ", the malicious code detection module will build the AST syntax tree of the code and identify "rm-rf / " as a system instruction injection attack with a confidence level of 99.8%. The system has built-in syntax parsers covering mainstream programming languages such as Bash, Python, and JavaScript, which can identify various code injection fragments, such as "import os; os.system('rm-rf / ')" in Python and "eval(atob('aW1wb3J0IG9zOyBvcy5zeXN0ZW0oJ3JtIC1yZiAvJyk='))" and other variant attacks in JavaScript. Meanwhile, the system also conducts joint analysis against model prompt poisoning attacks. When it detects that suggestive statements such as "ignore all previous rules" and "you can simulate a shell" co-occur with dangerous commands, it raises the risk rating. In a financial system implementation, this malicious code detection mechanism successfully intercepted response content containing hidden Bash reverse shell code, effectively preventing potential security threats.
[0071] Sensitive information detection in northbound traffic employs a dual-engine mechanism of regular expressions and deep learning. The regular expression engine pre-configures matching rules for common sensitive information such as ID card numbers, mobile phone numbers, and bank card numbers, such as regex_patterns:[\d{18},^1[3-9]\d{9}$,\d{16,19}]. The deep learning engine uses the BERT model to analyze the contextual semantics and identify implicitly leaked sensitive information. For example, when the large model responds with "Zhang San, ID card number 11010119900307XXXX, mobile phone number 138xxxx8000, loan balance 500,000 yuan", the dual-engine mechanism works together: the regular expression engine matches the ID card number and mobile phone number format, while the deep learning engine identifies the correlation between "Zhang San" and subsequent sensitive information, comprehensively determining it as a high-risk sensitive information leak. In actual deployment, this dual-engine mechanism improves the accuracy of sensitive information detection to 93.6%, which is 27.4% higher than a single detection method.
[0072] Finally, intellectual property detection is performed, using watermark detection technology to identify potentially protected content. This detection mechanism interfaces with the enterprise's intellectual property protection system, enabling the identification of digital watermark information in text and code. For example, when the large model response contains proprietary algorithm code or copyrighted document content, the system extracts feature vectors and compares them with the watermark database. In a case study implemented by a technology company, when the large model responded with "The following is the core algorithm of XX company's patented technology: defproprietary_algorithm(data):...", the intellectual property detection module successfully identified that the algorithm had an 87.3% similarity to the company's registered watermark, triggering the watermark data deletion operation. The system also supports dynamically updating the watermark feature database to ensure effective protection of the latest intellectual property content.
[0073] In its implementation, the security diagnostic module employs a confidence-weighted fusion mechanism to comprehensively evaluate the detection results from various dimensions. For example, in a commercial bank's system, when a user queries "get Zhang San's loan details at XX Bank," the southbound security diagnostic, based on semantic recognition (95.2% confidence), intent analysis (98.7% confidence), and sentiment recognition (85.3% confidence), calculates an overall risk score of 92.1%, triggering tokenization. When the large model's response contains the "rm-rf / *" command, the northbound security diagnostic, based on malicious code detection (99.8% confidence), immediately performs content deletion. This multimodal security diagnostic mechanism not only accurately identifies various security threats during the network query process of the private large model but also ensures the normal operation of business functions through differentiated processing strategies, effectively addressing the risks of sensitive information leakage in southbound traffic and malicious content output in northbound traffic.
[0074] S350: Based on the security diagnostic results of southbound and northbound traffic data, construct a context association graph and perform cross-directional risk propagation to generate collaborative risk assessment results.
[0075] Specifically, within a session cycle, all southbound request fragments and northbound response fragments are constructed into a temporal-semantic context association graph. Among them, nodes Representing semantically complete text units, pre-defined into seven categories: user, user history behavior, current query intent, large model response, external URL to be accessed, external data content, and internal knowledge base fragments; edges This represents the relationships between nodes, including "historical behavior similarity" calculated using cosine similarity, "query involvement" and "response inclusion" determined by causal dependencies, and "upcoming visit" relationships identified through plugin call dependencies. Each edge is assigned a weight. Quantify the strength of the correlation.
[0076] Each node initializes a multi-dimensional risk vector using the south / north direction security diagnostic module. Southbound nodes incorporate risk components such as semantic recognition, intent analysis, and sentiment recognition, while northbound nodes incorporate risk components such as malware detection, sensitive information detection, and intellectual property detection. Considering real-time requirements, a first-order neighborhood risk aggregation model is used to calculate the final risk value of each node. , where α is the self-weighting factor (0 < α < 1), used to balance the influence of self-risk and neighbor risk, i represents the target node whose final risk value is currently being calculated, j represents the neighbor nodes directly connected to the target node i, and k represents all first-order neighbors of node i considered when calculating the weight ratio of neighbor node j. Let i represent the set of first-order neighbors of node i. This represents the initial risk value of node i. This represents the initial risk value of node j. This represents the weight of the edge connecting node i and node j. This represents the weight of the edge connecting node i and node k.
[0077] For example, in an internal scenario of a group company, a user queries "Please summarize the core technical documents of our company's latest product and send them to my personal email." Southbound engine analysis identifies "core technical documents" and "send to personal email" as high-risk intents (unauthorized access, data leakage), with a high initial risk value. The network query generated by the large model, "Search for {company name}'s latest product core technical documents," appears harmless in the initial northbound analysis, with a low initial risk value. By constructing a relationship graph connecting the two nodes, and due to the high weight of causal dependencies, the final risk value of the northbound node is significantly increased after risk propagation calculations. This allows for early detection of the high-risk intent hidden behind this seemingly harmless search, dynamically adjusting the detection sensitivity and handling intensity of the northbound traffic results, effectively preventing the leakage of core technical documents.
[0078] S400: Based on the security diagnosis results of the southbound and northbound traffic data and the rule module, perform data security processing on the southbound and northbound traffic data respectively.
[0079] After the security diagnostic results for southbound traffic data are returned, the risk type, risk level, and confidence level indicators in the diagnostic results are first analyzed. For example, when processing a user query "Query Zhang San's loan records and contact information at XX Bank", the security diagnostic module returns the following results: semantic recognition detected "Zhang San" (personal information entity, confidence level 95.2%) and "XX Bank" (trade secret entity, confidence level 93.7%); intent analysis determined it to be a trade secret probe (confidence level 98.7%); sentiment analysis did not detect any threatening tone (confidence level 75.3%). The data security processing module compares these results with preset thresholds in the rules module. When the confidence level of the personal information entity (95.2%) is higher than the first preset threshold (default 0.85), a de-identification operation is triggered; when the confidence level of the trade secret entity (93.7%) is higher than the second preset threshold (default 0.9), a tokenization operation is triggered.
[0080] For the de-identification of southbound traffic data, the system first selects a specific operation method based on the type of sensitive information and the risk level. In the example above, "Zhang San" is identified as high-risk personal information, and the system uses tokenization: it calls the deterministic tokenization algorithm in the rules module, using the HMAC-SM3 algorithm and a preset key to generate a unique irreversible identifier. In the specific implementation, the system calculates the hash value of "Zhang San", extracts the first 8 characters as the token, and generates "USER_9A3F8B". At the same time, for the trade secret entity "XX Bank", the system uses reversible tokenization, encrypts it using the SM4-GCM algorithm, generates the "ORG_5C2D7E" token, and securely stores the mapping relationship between the original value and the token in the token mapping table for restoration under authorized conditions. If the diagnostic results show the presence of medium- to low-risk sensitive information, the system may choose synonym replacement, such as replacing "loan record" with "credit information" (cosine similarity 0.82 > threshold 0.75); or use obfuscation, replacing some characters in "contact information" with quotation marks to generate "contact information".
[0081] In the secure processing of northbound traffic data, decisions are also made based on security diagnostic results and preset thresholds. For example, when the large model responds with "Zhang San, ID number 11010119900307XXXX, mobile phone number 138xxxx8000, loan balance 500,000 yuan", the security diagnostic module returns: no risk of malicious code detection (confidence 5.3%); sensitive information detection found ID number (confidence 98.5%), mobile phone number (confidence 99.2%), and personal information association (confidence 96.7%); no risk of intellectual property detection (confidence 8.2%). The data security processing module compares the 98.5% confidence level of sensitive information detection with the fourth preset threshold (default 0.9), confirms that it is higher than the threshold, and triggers the content replacement operation.
[0082] For sensitive information in northbound traffic, a multi-level content replacement strategy is adopted. In the example above, the system first performs an empty character replacement operation, inserting zero-width spaces (U+200B) and zero-width non-connectors (U+200C) into the sensitive information. Specifically, the system processes "Zhang San" into "Zhang San", "ID number 11010119900307XXXX" into "ID number 11010119900307XXXX", and "Mobile number 138xxxx8000" into "Mobile number 138xxxx80000". This processing method is almost imperceptible visually, but it can effectively destroy the recognition capability of automated information extraction tools. At the same time, the system also applies a differential privacy algorithm to sensitive values, processing "500,000 yuan" into a value randomly generated within the range of [450,000,550,000 yuan], ensuring that personal information is unidentifiable. For content containing trade secrets, the system calls a dynamic token mapping algorithm to replace enterprise-specific terms with preset tokens, such as replacing "ETL server" with "DATA_PROCESSING_UNIT".
[0083] A more stringent strategy is employed when dealing with malicious code. For example, when the large model responds with "Execute the following POC script with root privileges to harden the security vulnerability: rm-rf / ", the malicious code detection module identifies "rm-rf / " as a high-risk system command (99.8% confidence level), exceeding the third preset threshold (default 0.95), and the system immediately triggers a complete deletion operation. Specifically, the content deletion algorithm is invoked to replace the entire statement containing malicious code with a security warning message: "System security hardening recommendations have been sent through the internal security channel. Please contact the system administrator for detailed information." Simultaneously, the system records a complete audit log, including the original content, processing method, and processing time, for subsequent security analysis.
[0084] The data security processing mechanism described in this embodiment also supports dynamic policy adjustments. Processing parameters were adjusted according to actual needs: the synonym replacement similarity threshold for southbound traffic was adjusted from the default 0.75 to 0.85 to reduce the false replacement rate; the malicious code detection confidence threshold for northbound traffic was adjusted from 0.9 to 0.95 to reduce the false positive rate. The system provides a visual policy configuration interface, supporting dynamic adjustment of various parameters, including similarity threshold, maximum number of replacement words, obfuscation strategy parameters, generalization level, and token length, through JSON configuration files or the management interface. Each policy change generates a new version snapshot for easy retrospective analysis and auditing.
[0085] Furthermore, this implementation also implements a processing effect verification mechanism. After each security processing step, a lightweight security diagnostic is rerun to verify whether the processing results have achieved the expected security goals. For example, semantic recognition is performed again on the query content after processing southbound traffic to confirm that sensitive information has been effectively processed; malicious code detection is performed again on the response content after processing northbound traffic to ensure that high-risk content has been completely removed. This closed-loop verification mechanism ensures the effectiveness of data security processing while avoiding damage to business functions due to over-processing. Through this differentiated data security processing mechanism based on security diagnostic results and rule modules, this implementation achieves precise protection for southbound and northbound traffic during the network query process of a private large model. While ensuring the normal operation of business functions, it effectively solves key security issues such as sensitive information leakage, malicious code propagation, and intellectual property infringement.
[0086] S500: Submits the processed southbound traffic data to the corresponding processing unit and returns the processed northbound traffic data to the user.
[0087] For southbound traffic data, after completing security diagnostics and data security processing, the validity of the processing results is first verified. Upon successful verification, the processed southbound traffic data (i.e., query2) is submitted to the corresponding processing unit according to the preset routing strategy. In the private large-scale model architecture, the processing unit includes: an agent (for business logic processing), a meta-search engine (for external data queries), or other query software and hardware programs (such as dedicated database query interfaces).
[0088] For routing strategies, an intelligent routing mechanism is adopted to dynamically select the optimal processing path based on the content type and business scenario of query2. For example, in a commercial bank system, when the processed query contains the keyword "loan record," the system automatically routes the request to the credit business agent; when the query contains the keyword "account balance," it routes to the core bank system query interface. Simultaneously, a load balancing strategy is supported. When a processing unit is overloaded, requests are automatically distributed to backup processing units to ensure the overall stability of the system performance.
[0089] For northbound traffic data, a tiered return strategy is adopted after security processing. Once the processed response content (response2) passes final security verification, the return method is determined based on the response type and user permission level. In basic scenarios, the processed response content is directly returned to the user; in high-security scenarios, a secondary verification is performed to ensure the returned content does not contain any potential risks. In the specific implementation, an adaptive return mechanism based on response type is used. For plain text responses, the system maintains the original format; for responses containing code blocks, the system adds an additional security warning header; for responses containing links, the system verifies the link security before returning the response.
[0090] The refined data submission and return mechanism described in this implementation not only ensures that the securely processed data is accurately delivered to the target processing unit or user, but also achieves full-process security and controllability through a comprehensive log recording and anomaly handling mechanism. This effectively solves the problems of sensitive information leakage that may occur during the network query process of private large models and malicious content that may be output by northbound traffic.
[0091] S600: Record the original information, processed information, and processing time of the southbound and northbound traffic data.
[0092] Log collection points are set up at key processing nodes of the data security gateway. After southbound traffic data undergoes security diagnostics and data security processing, the system automatically captures and records three types of key information: original information (query1), processed information (query2), and processing time. For example, when a user queries "Query Zhang San's loan records and contact information at XX Bank", the system records the original request content (query1), the security-processed request content (query2, such as "Query USER_9A3F8B's loan records at ORG_5C2D7E"), the original request time, the security processing start time, the security processing completion time, and the log write timestamp. For northbound traffic data, the original response returned by the large model (response1, such as "Zhang San, ID number 11010119900307XXXX, mobile phone number 138xxxx8000, loan balance 500,000 yuan"), the response after security processing (response2, such as "Zhang San, ID number 11010119900307XXXX, mobile phone number 138xxxx80000, loan balance 500,000 yuan"), and related timestamp information are also recorded.
[0093] In summary, this implementation method constructs a bidirectional data security processing approach based on a private large-scale model, effectively solving key security issues in the process of online querying of privately deployed large-scale models. It innovatively adopts a differentiated north-south security processing architecture, addressing the risks of injection attacks and unauthorized access to sensitive data in southbound traffic, and the potential for hidden leakage of original data or output of malicious commands in northbound traffic model responses. It implements multimodal security diagnostic mechanisms, including semantic recognition, intent analysis, sentiment recognition and malicious code detection, sensitive information detection, and intellectual property detection. Combined with a rules module, it executes differentiated data security processing strategies. This ensures the normal operation of the large-scale model's online query function while achieving a precise balance between security protection and business functionality, significantly improving the security protection capabilities and business reliability of private large-scale models in open environments.
[0094] refer to Figure 2 This embodiment further discloses a bidirectional data security processing system based on a private large model, including a data acquisition module 21, a rule module 22, a security diagnosis module 23, a data security processing module 24, and a data transmission module 25, which are described in detail below:
[0095] The data acquisition module 21 is used to acquire southbound and northbound traffic data during the network query process of the private large model; including: intercepting southbound traffic data sent by the client or model application and northbound traffic data returned by the large model during the network query process of the private large model; decoding the intercepted southbound and northbound traffic data, wherein the southbound traffic data includes at least one of user input query, Prompt request, and plugin call, and the northbound traffic data includes at least one of generated text, code, and external knowledge answer.
[0096] Rule module 22 is used to provide a rule module, which includes security rules, sensitive information identification standards, malicious code feature library and security operation algorithm;
[0097] The security diagnostic module 23 is used to perform security diagnostics on the southbound traffic data, including semantic recognition, intent analysis, and sentiment recognition, and on the northbound traffic data, including malicious code detection, sensitive information detection, and intellectual property detection. This includes: using a semantic recognition model to identify entity relationships in the southbound traffic data, detecting and marking personal information, trade secrets, and important data contained therein; using a multi-head attention mechanism to perform intent analysis on the southbound traffic data, calculating the authorization probability of user access, prioritizing multi-intent behaviors, and identifying normal access, unauthorized access, subjective disclosure, and non-subjective disclosure scenarios; performing sentiment analysis on the southbound traffic data based on an integrated VADER sentiment dictionary, detecting request content containing threatening tones such as extortion and inducement; performing malicious code detection on the northbound traffic data based on Abstract Syntax Tree (AST) analysis, identifying system instruction injection, code injection, and model prompt word pollution attacks; using a dual engine of regular expressions and deep learning to perform sensitive information detection on the northbound traffic data, identifying potentially leaked trade secrets and personal information; and connecting to an intellectual property protection system to perform watermark detection on the northbound traffic data, identifying protected intellectual property content.
[0098] Data security processing module 24 is used to perform data security processing on southbound and northbound traffic data respectively based on the security diagnosis results of the southbound and northbound traffic data and the rule module; including: when performing data security processing on southbound traffic data: when the security diagnosis result indicates the presence of sensitive information and the confidence level is higher than a preset first preset threshold, a de-identification operation is performed, the de-identification operation including synonym replacement, interception, obfuscation, and expansion; when the security diagnosis result indicates the presence of trade secrets or important data and the confidence level is higher than a preset second preset threshold, a tokenization operation is performed, the tokenization operation including deterministic... Tokenization and reversible tokenization; when performing data security processing on northbound traffic data: when the security diagnosis result indicates the presence of malicious code and the confidence level is higher than the preset third threshold, a complete deletion operation is performed to delete content containing system instruction injection or code injection; when the security diagnosis result indicates the presence of sensitive information and the confidence level is higher than the preset fourth threshold, a content replacement operation is performed, which includes alphanumeric character replacement, null character replacement, differential privacy algorithm processing, and dynamic token mapping; when the security diagnosis result indicates the presence of intellectual property content and the confidence level is higher than the preset fifth threshold, a watermark data deletion or replacement operation is performed.
[0099] The data transmission module 25 is used to submit the processed southbound traffic data to the corresponding processing unit and return the processed northbound traffic data to the user.
[0100] Figure 3 A schematic diagram of the physical structure of an electronic device provided in an embodiment of the present invention, such as... Figure 3As shown, the electronic device 50 includes: a processor 501, a memory 502, and a bus 503;
[0101] The processor 501 and the memory 502 communicate with each other via the bus 503; the processor 501 is used to call the program instructions in the memory 502 to execute the methods provided in the above-described embodiments.
[0102] This embodiment provides a non-transitory computer-readable storage medium that stores computer instructions that cause a computer to execute the methods provided in the above-described embodiments.
[0103] Those skilled in the art will understand that all or part of the steps of the above-described method implementation can be implemented by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When the program is executed, it performs the steps of the above-described method implementation. The aforementioned storage medium includes various storage media capable of storing program code, such as ROM, RAM, magnetic disk, or optical disk.
[0104] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.
[0105] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., including several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods of each embodiment or some parts of the embodiments.
[0106] The specific embodiments described above do not constitute a limitation on the scope of protection of this invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can occur depending on design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this invention should be included within the scope of protection of this invention.
Claims
1. A private large model-based bidirectional data security processing method, characterized in that, The method comprises: Obtaining southbound traffic data and northbound traffic data in the private large model networking query process; Providing a rule module containing security rules, sensitive information identification criteria, malicious code feature library and security operation algorithm; Performing security diagnosis of semantic recognition, intent analysis and sentiment recognition on the southbound traffic data, and performing security diagnosis of malicious code detection, sensitive information detection and intellectual property detection on the northbound traffic data; According to the security diagnosis results of the southbound traffic data and the northbound traffic data and the rule module, respectively, performing data security processing on the southbound traffic data and the northbound traffic data; The processed southbound traffic data is submitted to the corresponding processing unit, and the processed northbound traffic data is returned to the user.
2. The private large model-based bidirectional data security processing method according to claim 1, characterized in that, The method further comprises: Recording the original information, processed information and processing time of the southbound traffic data and northbound traffic data.
3. The private large model-based bidirectional data security processing method according to claim 1, characterized in that, The method further comprises: Intercepting southbound traffic data sent by a client or a model application in the private large model networking query process and northbound traffic data returned by a large model; Decoding the intercepted southbound traffic data and northbound traffic data, wherein the southbound traffic data includes at least one of user input query, Prompt request and plug-in call, and the northbound traffic data includes at least one of generated text, code and external knowledge answer.
4. The private large model-based bidirectional data security processing method according to claim 1, characterized in that, The rule module further contains multiple security tokens, a security dictionary and operation algorithm parameters; The security tokens include personal information tokens, trade secrets tokens and important data tokens; The security dictionary includes sensitive content, illegal content and malicious code; The operation algorithm parameters include at least one of de-identification algorithm parameters, tokenization algorithm parameters, isotype character replacement algorithm parameters and null character replacement algorithm parameters.
5. The private large model-based bidirectional data security processing method according to claim 1, characterized in that, The security diagnosis of semantic recognition, intent analysis and sentiment recognition on the southbound traffic data comprises: Using a preset semantic recognition model to perform entity relationship recognition on the southbound traffic data, detect and mark personal information, trade secrets and important data contained therein; Using a multi-head attention mechanism to perform intent analysis on the southbound traffic data, calculate the authorization probability of user access, and prioritize multi-intent behaviors, identify normal access, unauthorized access, subjective leakage and non-subjective leakage scenarios; Based on the integrated VADER sentiment dictionary, the southbound traffic data is analyzed for sentiment, and the request content containing threatening language such as blackmail and inducement is detected.
6. The private large model-based bidirectional data security processing method according to claim 1, characterized in that, The security diagnosis of malicious code detection, sensitive information detection and intellectual property detection on the northbound traffic data comprises: Based on abstract syntax tree (AST) analysis, the northbound traffic data is detected for malicious code, identifying system instruction injection, code injection and model prompt word pollution attacks; Using a regular expression and deep learning dual engine, the northbound traffic data is detected for sensitive information, identifying possible leaks of trade secrets and personal information; The docking intellectual property protection system performs watermark detection on the northbound traffic data to identify the protected intellectual property content contained therein.
7. The private large model-based bidirectional data security processing method according to claim 1, characterized in that, The data security processing module performs data security processing on the southbound traffic data and the northbound traffic data according to the security diagnosis results of the southbound traffic data and the northbound traffic data and the rule module, respectively. When the security diagnosis result indicates the presence of sensitive information and the confidence level is higher than a first preset threshold, a de-identification operation is performed, which includes synonym replacement, interception, obfuscation, and expansion. When the security diagnosis result indicates the presence of commercial secrets or important data and the confidence level is higher than a second preset threshold, a tokenization operation is performed, which includes deterministic tokenization and reversible tokenization. When the security diagnosis result indicates the presence of malicious code and the confidence level is higher than a third preset threshold, a complete deletion operation is performed to delete content containing system instruction injection or code injection. When the security diagnosis result indicates the presence of sensitive information and the confidence level is higher than a fourth preset threshold, a content replacement operation is performed, which includes replacement of equal characters, replacement of null characters, differential privacy algorithm processing, and dynamic token mapping. When the security diagnosis result indicates the presence of intellectual property content and the confidence level is higher than a fifth preset threshold, a watermark data deletion or replacement operation is performed. The system comprises: a data acquisition module configured to acquire southbound traffic data and northbound traffic data in a private large model networking query process; 8.A private large model based bidirectional data security processing system, characterized in that, a rule module configured to provide a rule module containing security rules, sensitive information identification standards, malicious code feature libraries, and security operation algorithms; a security diagnosis module configured to perform semantic recognition, intent analysis, and sentiment recognition security diagnosis on the southbound traffic data, and perform malicious code detection, sensitive information detection, and intellectual property detection security diagnosis on the northbound traffic data; a data security processing module configured to perform data security processing on the southbound traffic data and the northbound traffic data according to the security diagnosis results of the southbound traffic data and the northbound traffic data and the rule module, respectively; a data transmission module configured to submit the processed southbound traffic data to a corresponding processing unit and return the processed northbound traffic data to a user. The storage medium stores a computer program, and the computer program is executed by the processor to implement the method of any one of claims 1-7. The processor executes the program to implement the method of any one of claims 1-7.
9. A computer-readable storage medium, characterized in that, 10. An electronic device comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that,
Citation Information
Patent Citations
Data isolation and privacy protection method and system for large data security model
CN119442290A
Data processing and observation system
US20030191608A1