Data security document generation method and system based on RAG technology
Through the data security document generation method based on RAG technology, the problems of low efficiency and insufficient accuracy of data security document generation in the prior art are solved, and efficient, accurate and professional data security document generation are achieved to ensure compliance and quality.
Patent Information
- Application Number
- CN202510040055.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-10
- Publication Date
- 2025-02-18
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The existing technology is difficult to generate data security documents efficiently and accurately. Traditional manual writing is inefficient, costly and prone to errors. Large language models lack professional knowledge, and RAG technology is difficult to quickly and accurately retrieve relevant knowledge in massive data.
Using the data security document generation method based on RAG technology, we use data security-related data collection from multiple data sources, perform isolation processing and encryption, build a private data security database, and generate documents using a large language model.
It realizes efficient and accurate generation of data security documents, ensuring compliance, accuracy and professionalism, reducing labor costs, and improving the quality and efficiency of documents.
Smart Images

Figure CN119475436A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of artificial intelligence technology, and in particular to a data security document generation method and system based on RAG technology. Background Art
[0002] In the current digital wave, data security documents are responsible for ensuring corporate compliance operations and protecting the security of data assets. Their importance is self-evident. Moreover, as professional documents required by national and industry policies and regulations, data security documents have extremely strict writing requirements. The content must be accurate, comprehensive, and compliant, and must keep up with the latest developments in policies, regulations, and technological developments. The traditional manually-led data security document writing model is inefficient, has high labor costs, and is prone to errors.
[0003] With the rise of artificial intelligence, although the existing large language model (LLM) has powerful language generation capabilities, firstly, due to the lack of professional data security knowledge and experience, the generated document content is not accurate or comprehensive enough; secondly, since LLM is generated based on training data, if the training data is not updated in time, it will be difficult to reflect the latest policies, regulations and technical requirements; in addition, when generating text, LLM may not fully consider the specific format and requirements of data security documents, resulting in the generated documents not meeting the standards.
[0004] Although retrieval-augmented generation (RAG) technology can improve the accuracy and credibility of answers generated by LLM by integrating external knowledge, in the data security document writing scenario, RAG technology cannot quickly and accurately retrieve data security-related knowledge and information from massive data, and cannot ensure that the retrieved information is consistent with the context of the data security document, nor can it effectively integrate the retrieved information into the data security document generation process.
[0005] Therefore, there is an urgent need for a method that can efficiently and accurately generate data security documents to overcome the existing difficulties. Summary of the invention
[0006] In view of this, the present invention proposes a data security document generation method and system based on RAG technology, which can generate data security documents efficiently and accurately, and can ensure the compliance, accuracy and professionalism of the data security documents.
[0007] To achieve the above object, the present invention provides the following technical solutions: A method for generating data security documents based on RAG technology, comprising: Collect data security related data from multiple data sources, and obtain data source information corresponding to the data security related data; Based on the data source information, the data security-related data is isolated to obtain private data corresponding to different enterprises or institutions, and based on the preset sensitive data classification rules, it is determined whether there is sensitive data in the private data. If so, the sensitive data is encrypted to obtain encrypted data; Storing the encrypted data and unencrypted private data in a private data security database, and updating massive data security vertical industry data to the private data security database in real time; In response to a request for generating a data security document, obtaining user requirements, the user requirements including document type, document subject, document template selection requirements and document content requirements, and determining a final document template from a document template library based on the document template selection requirements; Extract keywords corresponding to the user needs, perform similarity search in the private data security database based on the keywords, and obtain corpus data with the highest similarity to the keywords; The corpus data, the user requirements and the final document template are input into a large language model to generate a data security document.
[0008] On the basis of the above technical solution, the present invention can also be improved as follows: Optionally, before the step of obtaining the data source information corresponding to the data security-related data, the method further includes: Use deduplication algorithms to remove duplicate data records from data security-related data to ensure data uniqueness; Identify and remove noise information in data security-related data through denoising technology to eliminate noise interference; Convert data security related data in different formats into a preset standard format; Identify missing values in the data security related data and fill in the missing values to ensure the integrity and availability of the data; Parse the identification field in the data security related data, and confirm the data source based on the identification field.
[0009] Optionally, isolating the data security-related data based on the data source information to obtain private data corresponding to different enterprises or institutions includes: Set up independent storage areas for each enterprise or organization in advance; Confirm the enterprise or institution to which the data security-related data after data processing belongs based on the data source; The data security-related data after data processing is routed to a corresponding storage area based on the data source.
[0010] Optionally, storing the encrypted data and the unencrypted private data in a private data security database, and updating the massive data security vertical industry data to the private data security database in real time, further includes: After receiving the access request initiated by the user, the private data security database obtains the identity authentication information corresponding to the access request, and determines whether the identity authentication information is correct. If it is correct, the access to the private data security database is allowed; if it is incorrect, the access to the private data security database is denied; Record access logs and operation logs of private data security repositories.
[0011] Optionally, the real-time updating of the massive data security vertical industry data to the private data security database further includes: Collect each user's historical search records and historical preference data, and generate a user demand profile for each user based on each user's historical search records and historical preference data; The latest information with a matching value greater than a preset value with the user demand profile is screened out from the private data security database through an intelligent matching algorithm, and the latest information is pushed to the user end; The matching value is calculated by formula (1); ; In the formula, is the matching value, For user demand portrait vector The eigenvalues in dimensions, is the information vector in the database The eigenvalues in dimensions, It is the number of features contained in the user demand portrait vector and the database information vector.
[0012] Optionally, the data security document generation method based on the RAG technology further includes: Monitor data changes in the private data security database in real time. When data changes are detected, start the data comparison program to compare the difference between the new data and the old data. Pre-build warning trigger conditions. When the difference data meets the warning trigger conditions, generate a warning signal and determine the warning signal type based on the difference data. The warning signal is sent to the user end through multiple communication channels, and the corresponding solution is determined based on the type of the warning signal.
[0013] Optionally, the data security document generation method based on the RAG technology further includes: Building a compliance verification mechanism based on a private data security database, which is dynamically adjusted based on massive data security vertical industry data updated in real time in the private data security database; Based on the compliance verification mechanism, a compliance check is performed on the generated data security document to determine whether the data security document is fully compliant. If it is fully compliant, the data security document is determined to be compliant. If it is not fully compliant, a violation prompt information is generated. The violation prompt information includes the basis for the violation, the location of the violation content, the violation content and suggestions for rectification of the violation. Rectification is performed on the violations based on the violation prompt information until the data security document is fully compliant.
[0014] A data security document generation system based on RAG technology, comprising: A data collection and processing module is used to collect data security related data from multiple data sources and obtain data source information corresponding to the data security related data; A data isolation and security protection module, which is used to isolate the data security-related data based on the data source information to obtain private data corresponding to different enterprises or institutions, and to determine whether there is sensitive data in the private data based on preset sensitive data classification rules. If so, encrypt the sensitive data to obtain encrypted data; A data storage module, used to store the encrypted data and unencrypted private data in a private data security database, and to update massive data security vertical industry data to the private data security database in real time; A user interaction module, configured to obtain user requirements in response to a request for generating a data security document, wherein the user requirements include a document type, a document subject, a document template selection requirement, and a document content requirement, and determine a final document template from a document template library based on the document template selection requirement; A RAG search enhancement module is used to extract keywords corresponding to the user needs, perform similarity search in the private data security database based on the keywords, and obtain corpus data with the highest similarity to the keywords; The data security document generation module is used to input the corpus data, the user requirements and the final document template into a large language model to generate a data security document.
[0015] An electronic device comprises a memory, a processor and a computer program stored in the memory and running on the processor, wherein the processor implements the steps of the method when executing the computer program.
[0016] A non-transitory computer-readable storage medium stores a computer program, which implements the steps of the method when executed by a processor.
[0017] The present invention has the following advantages: The data security document generation method based on RAG technology in the present invention collects data security-related data from multiple data sources, breaks data silos, greatly expands knowledge reserves, lays a comprehensive material foundation for subsequent document generation, and ensures that the document can cover security points from multiple perspectives.
[0018] The data security document generation method based on RAG technology in the present invention accurately isolates the private data of each enterprise or institution according to the data source information, strictly divides the data boundaries, prevents privacy leakage caused by data mixing, creates exclusive data space for different subjects, maintains data ownership rights and interests, encrypts sensitive data according to preset sensitive data classification rules, follows high-standard security specifications, and strictly protects confidential information.
[0019] The data security document generation method based on RAG technology in the present invention constructs a private data security database to store encrypted and unencrypted private data, provides a centralized and orderly management environment, facilitates efficient data call, reduces retrieval time, improves overall operating efficiency, prepares a "raw material library" that is available at any time for document generation, and updates massive data security vertical industry information in real time, so that the private data security database can always keep up with the evolution of policies and regulations and the pace of technological innovation.
[0020] The data security document generation method based on RAG technology in the present invention searches in a private data security database based on keywords corresponding to user needs, finds the corpus with the highest similarity, ensures the quality of the input large language model material, avoids interference from irrelevant redundant information, and inputs the corpus data with the highest similarity to the keyword, user needs and the final document template into the large language model together. Multiple factors work together to generate documents that integrate professional knowledge, compliance points and user personalized demands, and produce high-quality, compliant and practical data security documents to meet complex business needs in one stop. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] For the purpose of illustration and not limitation, the present invention is now described in conjunction with the embodiments of the present invention and the accompanying drawings, in which: Figure 1 It is a flowchart of a method for generating a data security document based on RAG technology in an embodiment of the present invention; Figure 2 A schematic diagram of the main components of a data security document generation system based on RAG technology in an embodiment of the present invention; Figure 3 This is a schematic diagram of the physical structure of the electronic device provided by the present invention. DETAILED DESCRIPTION
[0022] In order to enable those skilled in the art to better understand the solution of the present invention, the technical solution in the implementation of the present invention will be clearly and completely described below in conjunction with the drawings in the implementation of the present invention. Obviously, the described implementation is only a part of the implementation of the present invention, not all of the implementations. Based on the implementation of the present invention, all other implementations obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.
[0023] It should be noted that the terms "first", "second", etc. in the specification of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so as to describe the embodiments of the present invention described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0024] It should be noted that, in the absence of conflict, the embodiments of the present invention and the features in the embodiments can be combined with each other. The embodiments of the present invention will be described in detail below with reference to the accompanying drawings.
[0025] Figure 1 FIG. 1 is a flow chart of a method for generating a data security document based on RAG technology in an embodiment of the present invention. Figure 1 As shown, the data security document generation method based on RAG technology provided by the embodiment of the present invention includes the following steps S101 to S106.
[0026] S101, collecting data security related data from multiple data sources, and obtaining data source information corresponding to the data security related data.
[0027] The various data sources include databases, file servers, and network distributed crawling. The data sources widely cover authoritative industry databases, government public regulatory reports, security white papers issued by major companies, and technical sharing posts on professional security forums. Using network distributed crawling technology, accurately crawl data security-related content according to preset rules, such as detailed regulations, vulnerability cases, and new protection technologies. After crawling, immediately carry out data processing work, including deduplication, denoising, format conversion, missing value processing, etc., and then use data tagging methods to mark in detail which specific database, website, or document each piece of data comes from, providing clear clues for subsequent tracing.
[0028] Before the step of obtaining the data source information corresponding to the data security related data, the step further includes: Deduplication algorithms are used to remove duplicate data records from data security-related data to ensure the uniqueness of the data. Duplicate data not only takes up valuable storage space, but also interferes with the accuracy of subsequent data analysis and processing. After removing duplicate records, data storage costs can be effectively reduced.
[0029] De-noising technology is used to identify and remove noise information in data security-related data to eliminate noise interference; after removing the noise, the data analysis algorithm can focus on real and effective data features to avoid triggering false alarms or formulating unreasonable data security policies due to misleading noise. For example, in an intrusion detection system, the denoised data can accurately present the real network access mode, improve the accuracy of identifying malicious intrusion behaviors, and ensure the stable operation of the system security protection mechanism.
[0030] Convert data security-related data in different formats into a preset standard format; data in the field of data security comes from a wide range of sources and in various formats, such as structured database tables, semi-structured JSON files, plain text logs, etc. The unified format lays the foundation for the standardization of data processing procedures. In the future, whether it is data storage, analysis and mining based on specific algorithms, or data interaction and sharing between different modules, they can be seamlessly connected without the need to frequently adapt to the compatibility problems caused by different formats, greatly improving the overall data processing efficiency, accelerating the data circulation cycle from collection to application, and ensuring timely response to data security work.
[0031] Identify missing values in data security-related data and fill in missing values to ensure data integrity and availability. Data missingness may be caused by a variety of reasons, such as interruptions in the collection process, and some data sources restricting access to certain fields. If missing values are not processed, a large number of data analysis algorithms will not be able to operate normally, resulting in numerous loopholes in data security situation assessment. After filling in missing values, the data set is restored to integrity, and complex analyses such as time series-based security trend analysis and multi-dimensional association rule mining can be carried out smoothly. From the perspective of data integrity, security decisions are fully considered to maximize data availability and uncover potential security risks and opportunities hidden behind complete data.
[0032] The data source information corresponding to the data security-related data obtained after data processing may specifically include: Parse the identification fields in data security-related data and confirm the data source based on the identification fields. The algorithm carefully scans the data at the byte level and accurately locates the position of the identification fields. Then, it uses complex character conversion, decoding rules and semantic parsing models to convert obscure codes into clear data source details, and confirm the data source based on these identification fields.
[0033] S102, based on the data source information, isolate the data security related data to obtain the private data corresponding to different enterprises or institutions, and determine whether there is sensitive data in the private data based on the preset sensitive data classification rules. If so, encrypt the sensitive data to obtain encrypted data.
[0034] The above-mentioned data security-related data is isolated based on data source information to obtain private data corresponding to different enterprises or institutions, including: Set up independent storage areas for each enterprise or organization in advance; Confirm the enterprise or organization to which the data security-related data after data processing belongs based on the data source; Based on the data source, the processed data security-related data is routed to the corresponding storage area. According to the unique identification fields of different enterprises or institutions, the massive data security-related data is divided into their respective exclusive storage areas in an orderly manner. Through data isolation technology, the private data of different enterprises or institutions are ensured to remain independent during storage, processing and use.
[0035] Encrypted data storage can ensure that sensitive information is highly confidential when it is statically stored. Even if the database is subject to physical illegal intrusion or accidental leakage, encryption makes the data like a solid lock, which is difficult for attackers to crack and steal. This maintains the security of the core data assets of enterprises or institutions, and effectively resists external threats in scenarios such as financial institutions storing customer financial details and enterprises keeping trade secret formulas.
[0036] S103, storing the encrypted data and the unencrypted private data in a private data security database, and updating the massive data security vertical industry data in the private data security database in real time.
[0037] In the ever-changing field of data security, regulations and policies change frequently, and technological innovations change with each passing day. Real-time updates ensure that private data security databases are always filled with "fresh blood". When the enterprise security team formulates strategies and writes compliance documents, they can always produce solutions that keep up with the times based on the latest industry standards and cutting-edge attack and defense technology knowledge to avoid falling into the risk of violations due to information lags or being defenseless when facing new types of network attacks. For example, timely absorption of the latest data leakage prevention guidelines can quickly adjust the company's internal data storage architecture to strengthen protection; refine access permission settings based on newly issued regulations to ensure compliance throughout the operation.
[0038] The above-mentioned real-time update of massive data security vertical industry data to the private data security database includes: Collect each user's historical search records and historical preference data, and generate a user demand profile for each user based on each user's historical search records and historical preference data; Through intelligent matching algorithms, the latest information with a matching value greater than the preset value with the user's demand profile is screened out from the private data security database, and the latest information is pushed to the user end; The matching value is calculated by formula (1); ; In the formula, is the matching value, For user demand portrait vector The eigenvalues in dimensions, is the information vector in the database The eigenvalues in dimensions, It is the number of features contained in the user demand portrait vector and the database information vector.
[0039] Assume that the user demand portrait vector is U={ , ....... }, the information vector in the private data security database is I={ , ....... } What is calculated is the inner product of the user demand profile vector U and the database information vector I. The inner product reflects the degree of synergy between the two vectors in each dimension. If both the user demand profile and the database information have high values in a certain dimension, then this dimension contributes more to the inner product. Adding 1 is to ensure that the numerator is always a positive number, which helps to calculate the matching value between 0 and 1 in the subsequent calculation.
[0040] They are the modulus (Euclidean norm) of the user demand portrait vector U and the database information vector I. The modulus of a vector measures the size of the vector.
[0041] The denominator plays a normalizing role as a whole, ensuring matching values The range is between 0 and 1.
[0042] Final The calculation results are further mapped to the range of 0 to 1, so that the matching value can intuitively reflect the matching degree between user needs and database information.
[0043] Formula (1) essentially adjusts the cosine similarity of two vectors (user demand portrait vector and database information vector) so that the result is between 0 and 1, which is convenient for judging whether it exceeds the preset value to filter information.
[0044] The above-mentioned storing encrypted data and unencrypted private data in a private data security database, and updating massive data security vertical industry data in the private data security database in real time, also includes: After receiving the access request initiated by the user, the private data security database obtains the authentication information corresponding to the access request and determines whether the authentication information is correct. If it is correct, access to the private data security database is allowed; if it is incorrect, access to the private data security database is denied; the access log and operation log of the private data security database are recorded. Access logs and operation logs can track abnormal access tracks in security audits, such as frequent logins of the same account from different locations in a short period of time, and abnormal batch downloads of specific data, to quickly identify potential sources of threats and help companies respond in time to stop losses. From a compliance perspective, detailed records meet regulatory requirements, and regulatory authorities have evidence to rely on when conducting reviews to prove the standardization of data management; in internal management, logs are analyzed to optimize authority allocation and process design, and improve the overall level of data security governance. If it is found that a certain position frequently requests unnecessary data, the rationality of its authority can be re-evaluated.
[0045] Build a solid first line of defense to accurately identify legitimate users and potential intruders. Strict identity authentication prevents unauthorized personnel from getting their hands on sensitive data, prevents internal employees from illegally viewing confidential information, or external hackers from sneaking in with stolen accounts and passwords, and protects data privacy. For example, corporate financial personnel can only access financial-related data sets, and the R&D department cannot access sales-sensitive data. Strict management and control are carried out according to responsibilities to maintain data access order, reduce data leakage risks, protect the stability of corporate operations, and avoid business crises caused by data abuse.
[0046] S104, in response to a request to generate a data security document, obtaining user requirements, which include document type, document subject, document template selection requirements and document content requirements, and determining a final document template from a document template library based on the document template selection requirements.
[0047] Specifically, by fully obtaining user needs, especially clarifying document types, whether it is writing a detailed annual data security audit report, an emergency response plan for dealing with sudden vulnerabilities, or a data security planning blueprint for planning the launch of a new system, we can be targeted and ensure that the generated documents are highly adapted to the actual business processes and current tasks, so that data security work can be accurately embedded in all aspects of corporate operations. For example, financial institutions can quickly obtain targeted financial data security verification reports during the quarterly settlement period to assist in risk control.
[0048] Locking on the topic of the document, such as focusing on the compliance problems of cross-border transmission of patient imaging data in the healthcare industry, or the key points of data encryption throughout the entire manufacturing supply chain, means that subsequent document generation can be precisely focused on the core. Large language models and related systems can select professional and relevant content from massive knowledge reserves, deeply analyze the security crux of specific fields, and output content that is not general. It provides professional solutions to professional problems, helps companies overcome data security difficulties in subdivided fields, and improves industry competitiveness.
[0049] The final template is determined based on the user's document template selection requirements. This action greatly saves the time of building a document framework from scratch. Enterprises do not need to spend manpower on basic work such as typesetting layout and chapter setting. Different style templates (simple reporting type, in-depth research type, standardized approval type) are on standby at any time, suitable for different reporting levels and communication scenarios, and can directly focus on filling and optimizing key content, so that data security documents can be quickly formed, and they can also respond efficiently when urgent tasks are issued, accelerating the pace of enterprise decision-making and execution.
[0050] The user's all-round needs are taken into consideration, giving the user the power to lead the direction of document generation. Business personnel and security experts can customize the appearance and content of documents according to their own ideas, no longer passively accept fixed format output, increase the enthusiasm and satisfaction of interacting with the system, and make the final output document more in line with the company's internal culture and communication habits, reduce the cost of understanding, promote smooth cross-departmental collaboration, and lay a good communication foundation for the dissemination of data security concepts within the company.
[0051] S105, extracting keywords corresponding to the user's needs, performing similarity search in the private data security database based on the keywords, and obtaining corpus data with the highest similarity to the keywords.
[0052] Specifically, the RAG search enhancement module uses vector databases (such as Faiss, Milvus, etc.) to achieve efficient data retrieval. The RAG search enhancement module receives data from the private data security repository and user requirements from the user interaction end.
[0053] When obtaining keywords corresponding to user needs, the RAG retrieval enhancement module will use semantic analysis technology (such as BERT, GPT, etc.) to convert the keywords into vector representations and search in the vector database. The RAG retrieval enhancement module will find data related to user needs based on semantic similarity calculations and send these data to LLM for data security document generation.
[0054] The RAG search enhancement module also provides real-time update function for search results to ensure the timeliness and accuracy of data. When the search keywords are obtained again, the RAG search enhancement module will re-search and return the latest data results.
[0055] S106, the corpus data, user requirements and final document template are input into the large language model to generate a data security document.
[0056] Specifically, a large language model (such as GPT-3, T5, etc.) technology is used to generate data security documents. The large language model will receive relevant data retrieved from the RAG retrieval enhancement module and generate preliminary content of the document. The generated content will be optimized by grammar checking, spelling checking, format adjustment, etc. Natural language processing tools (such as NLTK, SpaCy, etc.) are used to verify and modify data security documents to ensure the accuracy and readability of data security documents. The processed data security documents will be sent to the user interaction terminal for display and download. Users can view the preview effect of the data security document on the interaction terminal, and perform editing and saving operations. The export function of data security documents is provided, and data security documents can be exported to PDF, Word and other formats to meet the different needs of users.
[0057] The data security document generation method based on RAG technology also includes: Monitor data changes in the private data security database in real time. When data changes are detected, start the data comparison program to compare the difference between the new data and the old data. Pre-build warning trigger conditions. When the difference data meets the warning trigger conditions, generate a warning signal and determine the type of warning signal based on the difference data. The warning signal is sent to the user end through various communication channels, and the corresponding solution is determined based on the type of warning signal.
[0058] The data security document generation method based on RAG technology also includes: A compliance verification mechanism is built based on a private data security database, and the compliance verification mechanism is dynamically adjusted based on the massive data security vertical industry data updated in real time in the private data security database; Based on the compliance verification mechanism, the generated data security documents are checked for compliance to determine whether the data security documents are fully compliant. If they are fully compliant, the data security documents are deemed compliant. If they are not fully compliant, a violation prompt message is generated. The violation prompt message includes the basis for the violation, the location of the violation content, the violation content, and suggestions for rectification of the violation. Rectification of the violations is performed based on the violation prompt message until the data security documents are fully compliant.
[0059] A preferred embodiment is: Suppose a financial enterprise needs to write a document on the data security system of the financial enterprise. The enterprise user first enters the basic information of the document (such as document title, author, date, etc.), content requirements (such as the objectives and scope of application of the data security system, etc.) and format requirements (such as font, font size, paragraph format, etc.) through the data security document writing user interface.
[0060] The user interaction module sends the data input by the user to the RAG retrieval enhancement module. The RAG retrieval enhancement module uses the vector database to search from the private data security database, finds the data related to the data security policy of the financial industry, and sends it to the data security document generation module based on the large language model.
[0061] The data security document generation module uses a large language model to generate the preliminary content of the data security system, and performs optimization processing such as grammar checking, spelling checking, and format adjustment. The processed data security document is sent to the user interaction end for display and download. Enterprise users can view the preview effect of the document on the interaction end and perform necessary editing and saving operations. Finally, enterprise users can export the data security document to PDF format and distribute it to relevant personnel or departments.
[0062] Through the above embodiments, enterprise users can efficiently write, store, retrieve and generate data security documents to meet the data security needs of the enterprise.
[0063] Figure 2 FIG. 1 is a schematic diagram of the main components of the data security document generation system based on the RAG technology in an embodiment of the present invention. Figure 2 As shown, the data security document generation system 1 based on RAG technology provided by an embodiment of the present invention includes a data acquisition and processing module 10, a data isolation and security protection module 20, a data storage module 30, a user interaction module 40, a RAG retrieval enhancement module 50 and a data security document generation module 60.
[0064] The data collection and processing module 10 is used to collect data security related data from various data sources and obtain data source information corresponding to the data security related data; The data isolation and security protection module 20 is used to isolate the data security related data based on the data source information to obtain the private data corresponding to different enterprises or institutions, and determine whether there is sensitive data in the private data based on the preset sensitive data classification rules. If so, encrypt the sensitive data to obtain encrypted data; The data storage module 30 is used to store the above-mentioned encrypted data and unencrypted private data in a private data security database, and to update the massive data security vertical industry data to the private data security database in real time; The user interaction module 40 is used to respond to the data security document generation request, obtain user requirements, the user requirements include document type, document subject, document template selection requirements and document content requirements, and determine the final document template from the document template library based on the document template selection requirements; The RAG search enhancement module 50 is used to extract keywords corresponding to the above user needs, and perform similarity search in the private data security database based on the keywords to obtain the corpus data with the highest similarity to the keywords; The data security document generation module 60 is used to input the above corpus data, the above user requirements and the above final document template into the large language model to generate a data security document.
[0065] Figure 3 A schematic diagram of the physical structure of an electronic device provided in an embodiment of the present invention, such as Figure 3 As shown, the electronic device 70 includes: a processor 701 (processor), a memory 702 (memory) and a bus 703; The processor 701 and the memory 702 communicate with each other via the bus 703; The processor 701 is used to call the program instructions in the memory 702 to execute the methods provided by the above-mentioned method embodiments, so as to execute the methods provided by the implementation mode of the present invention.
[0066] This embodiment provides a non-transitory computer-readable storage medium, which stores computer instructions. The computer instructions enable a computer to execute the method provided by the embodiment of the present invention.
[0067] A person skilled in the art can understand that all or part of the steps of implementing the above method embodiment can be completed by hardware related to program instructions, and the aforementioned program can be stored in a computer-readable storage medium. When the program is executed, it executes the steps of the above method embodiment; and the aforementioned storage medium includes: ROM, RAM, magnetic disk or optical disk, etc., various storage media that can store program codes.
[0068] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may occur depending on design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A data security document generation method based on RAG technology, characterized in that: include: Collect data security related data from multiple data sources, and obtain data source information corresponding to the data security related data; Based on the data source information, the data security-related data is isolated to obtain private data corresponding to different enterprises or institutions, and based on the preset sensitive data classification rules, it is determined whether there is sensitive data in the private data. If so, the sensitive data is encrypted to obtain encrypted data; Storing the encrypted data and unencrypted private data in a private data security database, and updating massive data security vertical industry data to the private data security database in real time; In response to a request for generating a data security document, obtaining user requirements, the user requirements including document type, document subject, document template selection requirements and document content requirements, and determining a final document template from a document template library based on the document template selection requirements; Extract keywords corresponding to the user needs, perform similarity search in the private data security database based on the keywords, and obtain corpus data with the highest similarity to the keywords; The corpus data, the user requirements and the final document template are input into a large language model to generate a data security document.
2. The method for generating data security documents based on RAG technology according to claim 1, characterized in that: Before the step of obtaining the data source information corresponding to the data security related data, the step further includes: Use deduplication algorithms to remove duplicate data records from data security-related data to ensure data uniqueness; Identify and remove noise information in data security-related data through denoising technology to eliminate noise interference; Convert data security related data in different formats into a preset standard format; Identify missing values in the data security related data and fill in the missing values to ensure the integrity and availability of the data; Parse the identification field in the data security related data, and confirm the data source based on the identification field.
3. The data security document generation method based on RAG technology according to claim 1 is characterized in that: The isolating the data security related data based on the data source information to obtain private data corresponding to different enterprises or institutions includes: Set up independent storage areas for each enterprise or organization in advance; Confirm the enterprise or institution to which the data security-related data after data processing belongs based on the data source; The data security-related data after data processing is routed to a corresponding storage area based on the data source.
4. The method for generating data security documents based on RAG technology according to claim 1, characterized in that: The storing of the encrypted data and the unencrypted private data in a private data security database, and updating the massive data security vertical industry data to the private data security database in real time, also includes: After receiving the access request initiated by the user, the private data security database obtains the identity authentication information corresponding to the access request, and determines whether the identity authentication information is correct. If it is correct, the access to the private data security database is allowed; if it is incorrect, the access to the private data security database is denied; Record access logs and operation logs of private data security repositories.
5. The method for generating data security documents based on RAG technology according to claim 1, characterized in that: The real-time updating of the massive data security vertical industry data to the private data security database also includes: Collect each user's historical search records and historical preference data, and generate a user demand profile for each user based on each user's historical search records and historical preference data; The latest information with a matching value greater than a preset value with the user demand profile is screened out from the private data security database through an intelligent matching algorithm, and the latest information is pushed to the user end; The matching value is calculated by formula (1); ; In the formula, is the matching value, For user demand portrait vector The eigenvalues in dimensions, is the information vector in the database The eigenvalues in dimensions, It is the number of features contained in the user demand portrait vector and the database information vector.
6. The method for generating data security documents based on RAG technology according to claim 1, characterized in that: The data security document generation method based on the RAG technology also includes: Monitor data changes in the private data security database in real time. When data changes are detected, start the data comparison program to compare the difference between the new data and the old data. Pre-build warning trigger conditions. When the difference data meets the warning trigger conditions, generate a warning signal and determine the type of warning signal based on the difference data. The warning signal is sent to the user end through multiple communication channels, and the corresponding solution plan is determined based on the type of the warning signal.
7. The method for generating data security documents based on RAG technology according to claim 1, characterized in that: The data security document generation method based on the RAG technology also includes: Building a compliance verification mechanism based on a private data security database, which is dynamically adjusted based on massive data security vertical industry data updated in real time in the private data security database; Based on the compliance verification mechanism, a compliance check is performed on the generated data security document to determine whether the data security document is fully compliant. If it is fully compliant, the data security document is determined to be compliant. If it is not fully compliant, a violation prompt information is generated. The violation prompt information includes the basis for the violation, the location of the violation content, the violation content and suggestions for rectification of the violation. Rectification is performed on the violations based on the violation prompt information until the data security document is fully compliant.
8. A system for generating data security documents based on RAG technology, characterized in that: include: A data collection and processing module is used to collect data security related data from multiple data sources and obtain data source information corresponding to the data security related data; A data isolation and security protection module, which is used to isolate the data security-related data based on the data source information to obtain private data corresponding to different enterprises or institutions, and to determine whether there is sensitive data in the private data based on preset sensitive data classification rules. If so, encrypt the sensitive data to obtain encrypted data; A data storage module, used to store the encrypted data and unencrypted private data in a private data security database, and to update massive data security vertical industry data to the private data security database in real time; A user interaction module, configured to obtain user requirements in response to a request for generating a data security document, wherein the user requirements include a document type, a document subject, a document template selection requirement, and a document content requirement, and determine a final document template from a document template library based on the document template selection requirement; A RAG search enhancement module is used to extract keywords corresponding to the user needs, perform similarity search in the private data security database based on the keywords, and obtain corpus data with the highest similarity to the keywords; The data security document generation module is used to input the corpus data, the user requirements and the final document template into a large language model to generate a data security document.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.
10. A non-transitory computer readable medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.
Citation Information
Patent Citations
Data security control method for establishing intelligent assistant based on AIGC + enterprise internal knowledge base
CN117573819A
Intelligent document query method and system for enterprise knowledge base
CN118779404A
Report automatic generation retrieval enhancement optimization method and system based on local knowledge base
CN118981476A
Security management and retrieval method based on Internet of Vehicles data
CN119150349A
RAG data query method and device based on privacy protection, equipment and medium
CN119202339A
Cited By
Self-adaptive document pushing method and system based on user portrait and storage medium
CN121502087A
Multi-level security RAG retrieval method, system and device and storage medium
CN122087872A