Data cross-border law compliance automatic inspection method and system based on LLM and RAG

By adopting an automated data cross-border legal compliance inspection method based on LLM and RAG, combined with legal expert feedback and RAG technology, the problems of low efficiency and poor accuracy in compliance inspections during cross-border data flow have been solved, achieving efficient, accurate and low-cost compliance inspections.

CN121413622APending Publication Date: 2026-01-27AOKE QUALITY (ZHUHAI HENGQIN) TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511471807.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-10-15
Publication Date
2026-01-27

AI Technical Summary

Technical Problem

Existing technologies are inefficient and inaccurate in compliance checks during cross-border data flows, making them unsuitable for large-scale cross-border data flows. They are also costly and lack adaptability and professionalism.

Method used

We adopt an automated data cross-border legal compliance inspection method based on LLM and RAG. By training a dataset written by legal experts and combining RAG technology with feedback from legal experts, we build an automated mechanism that is highly adaptable, accurate, efficient and low-cost to achieve data cross-border compliance inspection.

Benefits of technology

It enables efficient, accurate, and low-cost cross-border data compliance checks, adapts to changes in legal provisions, improves professionalism and adaptability, and makes up for the shortcomings of LLM in professional fields.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121413622A_ABST
    Figure CN121413622A_ABST
Patent Text Reader

Abstract

The invention discloses a data cross-border law compliance automatic detection method and system based on LLM and RAG, and relates to the technical field of artificial intelligence. According to the method, based on an LLM base, the legal compliance examination ability obtained after language understanding, reasoning and training of the legal compliance LLM trained by a high-quality legal data set is utilized, the latest successful cases and legal clause change content provided by the RAG technology are combined, professional knowledge feedback and annotation are provided by legal experts, and the legal compliance examination ability is obtained. And an automatic mechanism of data cross-border compliance inspection with strong adaptability, high accuracy, high efficiency, low cost and strong professionality is realized.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of artificial intelligence, in particular to the technical field of data inspection using artificial intelligence, and more particularly to a data cross-border legal compliance automated inspection method and system based on LLM and RAG. BACKGROUND

[0002] With the rapid development of the Internet in recent years, the value of data is increasingly valued, and how to protect the cross-border compliance of data has become a hot issue of worldwide attention.

[0003] At present, some countries and regions have issued data-related laws and regulations, such as the GDPR of the European Union, the Data Security Law of the People's Republic of China, and the Data Outbound Security Assessment Measures, etc., which involve provisions for data privacy and security, rights protection, and cross-border circulation. However, considering the cost and feasibility of artificial inspection of cross-border data in accordance with the law, how to realize the automated compliance inspection of cross-border data has become a realistic and important problem.

[0004] The existing data cross-border circulation compliance inspection technology either relies on legal experts to check data cross-border filing applications, contract terms, and even data content itself, which is extremely inefficient and prone to errors, and cannot adapt to large-scale data cross-border circulation; or the legal provisions are disassembled into fixed text rules, and the pseudo-automatic compliance is realized through complete matching or partial matching of keywords or sentences, which has poor adaptability and low accuracy, and when the legal provisions change or new laws are promulgated, related rules need to be re-adjusted or added, which is costly. SUMMARY

[0005] In order to overcome the defects and deficiencies in the prior art, the present application provides a data cross-border legal compliance automated inspection method and system based on LLM and RAG, and the purpose of the present application is to solve the problems of low efficiency and poor accuracy of data compliance inspection in the existing data cross-border circulation scenario. The present application is based on LLM, uses the language understanding, reasoning and legal compliance review ability obtained after training of the legal compliance LLM trained by high-quality legal data set, combines the latest successful cases and legal provision changes provided by RAG technology, and provides professional knowledge feedback and annotation by legal experts, to realize an automated mechanism for data cross-border compliance inspection with strong adaptability, high accuracy, high efficiency, low cost and strong professionalism.

[0006] In order to solve the problems in the prior art, the present application is realized by the following technical scheme.

[0007] The first aspect of the present application provides a data cross-border legal compliance automated inspection method based on LLM and RAG, which comprises the following steps: S1, a training step of data cross-border legal compliance LLM, taking data cross-border laws and regulations written by legal experts as training data set, pre-training based on selected open source LLM, obtaining a data cross-border legal compliance LLM applied to legal compliance check on data cross-border behavior; S2, a deployment step of data cross-border legal compliance LLM, according to the data cross-border legal compliance LLM obtained in S1 step, selecting corresponding computing resources, deploying the data cross-border legal compliance LLM to the data cross-border legal compliance automation checking system, and providing services through API; S3, a data cross-border legal compliance checking step, specifically including the following sub-steps, S301, the data cross-border legal compliance automation checking system receives the data cross-border legal compliance checking request submitted by the user; S302, the data cross-border legal compliance automation checking system retrieves the relevant legal compliance cases and the updated legal provisions in the data cross-border legal compliance case knowledge graph and the legal provisions database according to the checking request received in S301 step by using RAG technology, and submits the RAG technology retrieval result and the checking request as context data to the data cross-border legal compliance LLM together with the prompt words defined in advance, and processes the checking request by referring to the legal compliance cases and combining the updated relevant legal provisions knowledge to generate the compliance checking result; S303, the data cross-border legal compliance LLM returns the generated compliance checking result to the user, and the data cross-border legal compliance automation checking system collects the user's feedback after the user feeds back the quality of this checking result; S4, a continuous construction step of data cross-border legal compliance case knowledge graph and legal provisions database, specifically including the following sub-steps, S401, after the data cross-border legal compliance automation checking system receives the feedback of the user on the compliance checking result, a case is constructed based on the checking request, the compliance checking result and the feedback related to this compliance checking, and the case is saved in the data cross-border legal compliance case knowledge graph after being audited and revised by legal experts, forming a new case; S402, when the relevant legal provisions of data cross-border change, the changed legal provisions are registered to the data cross-border legal compliance automation checking system by legal experts, the attributes of the legal provisions are extracted by the data cross-border legal compliance automation checking system, and the legal provisions and their attributes are indexed and stored in the legal provisions database.

[0008] Further preferably, in the step S401, the constructed case is composed of entities and association relations, which are extracted from the compliance check request and the compliance check result.

[0009] Further preferably, in the step S402, the attributes of the legal provisions include the name of the legal document to which the legal provisions belong and the keywords.

[0010] Further preferably, in the step S402, the data cross-border legal compliance automation checking system stores the sparse index of the legal provisions and their attributes into a legal provision database; when a subsequent data cross-border legal compliance check request arrives, the data cross-border legal compliance automation checking system retrieves the legal provisions with the highest similarity from the legal provision database through a sparse retrieval technology, as the knowledge update of the data cross-border legal compliance LLM.

[0011] Further preferably, the sparse retrieval technology is a BM25 algorithm based on keyword matching.

[0012] Further preferably, in the step S402, the data cross-border legal compliance automation checking system stores the dense index of the legal provisions and their attributes into a legal provision database; when a subsequent data cross-border legal compliance check request arrives, the data cross-border legal compliance automation checking system retrieves the legal provisions with the highest similarity from the legal provision database through a dense retrieval technology, as the knowledge update of the data cross-border legal compliance LLM.

[0013] Further preferably, the dense retrieval technology is a vector similarity calculation method based on deep semantics.

[0014] The second aspect of the present application provides a data cross-border legal compliance automation checking system based on LLM and RAG, which comprises A data cross-border legal compliance check request module is configured to receive a data cross-border legal compliance check request submitted by a user; and utilize the RAG technology to retrieve the relevant legal provision update content and the relevant legal provision update content in the data cross-border legal compliance practical case knowledge graph and the legal provision database, and submit the RAG technology retrieval result and the check request as context data to the data cross-border legal compliance checking module in combination with the predefined prompt words. A data cross-border legal compliance checking module is configured to have a pre-trained data cross-border legal compliance LLM, which is configured to process the check request by referring to the practical case and combining the updated relevant legal provision knowledge, generate a compliance check result, and send the compliance check result to the user. a user compliance result feedback module configured to collect feedback of users on the quality of the inspection results, and to build a case based on the inspection request related to compliance inspection, the compliance inspection result and the feedback; a legal expert review and revision module configured to review and revise the case built by the user compliance result feedback module by legal experts, and to form a new practical case; a data cross-border legal compliance practical case knowledge graph configured to store data cross-border legal compliance practical cases; a legal provision database configured to store data cross-border related legal provisions; when the data cross-border related legal provisions change, the legal expert registers the changed legal provisions to the legal provision database, the legal provision database extracts the attributes of the legal provisions, and stores the legal provisions and the attributes after indexing.

[0015] Compared with the prior art, the beneficial technical effects brought by the present application are as follows: 1. The language understanding, reasoning and legal compliance review ability obtained after training of the legal compliance LLM trained by the high-quality legal data set, combined with the latest successful cases and legal provision change content provided by the RAG technology, and the professional knowledge feedback and annotation provided by the legal expert, realize an adaptive, high-accuracy, high-efficiency, low-cost and professional data cross-border compliance inspection automation mechanism.

[0016] 2. The present application combines LLM with RAG, uses RAG to compensate for the problems of LLM, such as hallucination, high pre-training cost and slow knowledge update, which may affect the accuracy of data cross-border compliance inspection. The present application uses sparse retrieval or dense retrieval to obtain the latest, semantically relevant professional field data, which can compensate for the defects of high knowledge update cost and poor adaptability of LLM in professional fields, and help to improve the accuracy of LLM in professional fields.

[0017] 3. Since the legal compliance inspection of data cross-border belongs to the legal professional field, the current language understanding and reasoning ability of LLM cannot independently complete this work, therefore, the present application complements the ability of LLM with the help of the professional knowledge and experience of legal experts, which is very key to solve the limitations of pure AI system in uncertainty processing, ethical judgment and complex scene adaptation.

[0018] 4、The application adopts LLM combined with RAG technology, and improves the professional knowledge feedback and labeling of legal experts through the "human-in-the-loop" mechanism, realizes an automatic mechanism of data cross-border compliance inspection with strong adaptability, high accuracy, high efficiency, low cost and strong professionalism, and is a technology worthy of attention and long-term research for solving the problem of legal automatic compliance inspection of data cross-border. BRIEF DESCRIPTION OF DRAWINGS

[0019] Figure 1 Pre-training schematic diagram of data cross-border legal compliance LLM of the application; Figure 2 Schematic diagram of data cross-border legal compliance inspection process of the application. DETAILED DESCRIPTION

[0020] In order to make the purpose, technical scheme and advantages of the application more clear and obvious, the application will be further described in detail below in combination with the drawings and examples. It should be understood that the specific examples described herein are only used to explain the application, and are not used to limit the application.

[0021] Example 1 As a preferred embodiment of the application, referring to the description and the accompanying drawings Figure 1 and Figure 2 shown, the embodiment discloses a data cross-border legal compliance automatic inspection method based on LLM and RAG, which comprises the following steps: S1, the training step of data cross-border legal compliance LLM, the data cross-border laws and regulations written by legal experts are used as training data set. In actual operation, legal experts will collect data cross-border legal regulations from multiple authoritative channels. These materials cover international conventions, domestic laws of various countries and industry standards, etc. Such as GDPR of European Union, "Data Security Law of the People's Republic of China", "Data Outbound Security Evaluation Method" and so on. They carefully comb, classify and label these materials, and carefully write high-quality data cross-border legal regulation training data set.

[0022] Based on the selected open-source LLM, pre-training is performed to obtain a data cross-border legal compliance LLM applied to legal compliance checks on data cross-border behavior. Specifically, the training team selects appropriate open-source LLMs such as LLaMA based on project requirements, resource conditions, and performance characteristics of open-source LLMs. A professional deep learning framework such as PyTorch is used to build a training environment. During training, parameters such as learning rate and optimization algorithms (e.g., Adam optimizer) are adjusted to pre-train the selected open-source LLM. After a large number of training rounds, the model can deeply learn the semantics, logic, and application scenarios of data cross-border laws and regulations, and finally obtain a data cross-border legal compliance LLM that can be accurately applied to legal compliance checks on data cross-border behavior.

[0023] S2, the deployment step of the data cross-border legal compliance LLM, according to the data cross-border legal compliance LLM obtained in step S1, selecting the corresponding computing resources, deploying the data cross-border legal compliance LLM into the data cross-border legal compliance automation checking system, and providing services through API; Specifically, considering factors such as the size of the model, the computational complexity, and the expected concurrent request volume, select the corresponding computing resources. After selecting the computing resources, deploy the data cross-border legal compliance LLM into the data cross-border legal compliance automation checking system. During deployment, the server environment needs to be configured, and the necessary dependent libraries and services need to be installed to ensure the stable operation of the model. At the same time, the functions of the model are provided to the outside through API (Application Programming Interface), and clear and easy-to-use API interface documents are developed to facilitate external systems or users to call.

[0024] S3, the data cross-border legal compliance checking step, specifically including the following sub-steps, S301, the data cross-border legal compliance automation checking system receives the data cross-border legal compliance checking request submitted by the user; For example, the data cross-border legal compliance automation checking system sets a special request receiving interface, which supports multiple data formats such as JSON, XML, etc. to adapt to different user submission methods. When the user submits a data cross-border legal compliance checking request, the system performs preliminary format verification and legality check on the request data to ensure data integrity and compliance. If the request data has problems, the system will return an error prompt to the user, requiring them to correct and resubmit.

[0025] S302, the data cross-border legal compliance automation checking system retrieves the relevant legal compliance cases and the updated legal provisions related to the semantic of the checking request in the data cross-border legal compliance case knowledge graph and the legal provision database according to the checking request received in S301, and submits the RAG technology retrieval result and the checking request as context data to the data cross-border legal compliance LLM, and combines the predefined prompt words to generate a compliance checking result. The prompt words refer to the Prompt submitted to the large model when using the large model, which can be customized according to different checking scenarios and requirements, for example, "please judge whether the data cross-border behavior is compliant according to the latest legal provisions and relevant cases, and explain the reasons in detail". The data cross-border legal compliance LLM processes the checking request by referring to the relevant legal provisions and knowledge of the updated relevant legal provisions, and generates a compliance checking result through its powerful language understanding and reasoning ability.

[0026] S303, the data cross-border legal compliance LLM returns the generated compliance checking result to the user, and after the user feeds back the quality of the checking result, the data cross-border legal compliance automation checking system collects the feedback of the user. S4, the step of continuously constructing the data cross-border legal compliance case knowledge graph and the legal provision database, specifically including the following sub-steps, S401, after the data cross-border legal compliance automation checking system receives the feedback of the user on the compliance checking result, a case is constructed based on the checking request, the compliance checking result and the feedback of this compliance checking, and the case is saved in the data cross-border legal compliance case knowledge graph after being audited and revised by legal experts, to form a new case; S402, when the legal provisions related to data cross-border change, the legal experts register the changed legal provisions to the data cross-border legal compliance automation checking system, the data cross-border legal compliance automation checking system extracts the attributes of the legal provisions, and stores the legal provisions and their attributes in the legal provision database after indexing. The system will regularly update and maintain the legal provision database to ensure the accuracy and timeliness of the data, so that the latest legal provision information can be obtained for subsequent data cross-border legal compliance checking requests.

[0027] Embodiment 2 As another preferred embodiment of the present application, this embodiment is a further detailed supplement and elaboration of the technical solutions of the present application based on the above-mentioned embodiment 1. In this embodiment, the S4 step is further supplemented and elaborated.

[0028] As an embodiment of the present embodiment, in step S401, the constructed case is composed of entities and association relations, and the entities and association relations are extracted from the compliance check request and the compliance check result of the compliance check.

[0029] As another embodiment of the present embodiment, in step S402, the attributes of the legal provisions include the name of the legal document to which the legal provisions belong and the keywords.

[0030] As an example of the present embodiment, in step S402, the data cross-border legal compliance automation checking system stores the sparse index of the legal provisions and their attributes into the legal provision database; when a subsequent data cross-border legal compliance checking request arrives, the data cross-border legal compliance automation checking system retrieves the legal provisions with the highest similarity from the legal provision database through the sparse retrieval technology, as the knowledge update of the data cross-border legal compliance LLM.

[0031] Specifically, the sparse retrieval technology is a BM25 algorithm based on keyword matching.

[0032] As another example of the present embodiment, in step S402, the data cross-border legal compliance automation checking system stores the dense index of the legal provisions and their attributes into the legal provision database; when a subsequent data cross-border legal compliance checking request arrives, the data cross-border legal compliance automation checking system retrieves the legal provisions with the highest similarity from the legal provision database through the dense retrieval technology, as the knowledge update of the data cross-border legal compliance LLM.

[0033] Specifically, the dense retrieval technology is a vector similarity calculation method based on deep semantics.

[0034] Embodiment 3 As another preferred embodiment of the present application, the present embodiment is based on the above-mentioned embodiment 1 or embodiment 2, and further supplements and describes the technical solutions of the present application in detail. The present embodiment is based on the checking system provided by the above-mentioned checking method, and specifically discloses a data cross-border legal compliance automation checking system based on LLM and RAG, which comprises A data cross-border legal compliance checking request module is used to receive a data cross-border legal compliance checking request submitted by a user; and utilize the RAG technology to retrieve the practical case and the related legal provision update content related to the semantic of the checking request in the data cross-border legal compliance practical case knowledge graph and the legal provision database, and submit the RAG technology retrieval result and the checking request as context data to the data cross-border legal compliance checking module together with the predefined prompt words. The data cross-border legal compliance checking module is deployed with a pre-trained data cross-border legal compliance LLM, the data cross-border legal compliance LLM processes the checking request by referring to practical cases and combining updated relevant legal provision knowledge, generates a compliance checking result, and sends the compliance checking result to the user; The user compliance result feedback module is configured to collect feedback on the quality of the checking result, and build a case based on the compliance checking related checking request, compliance checking result and feedback; The legal expert auditing and revising module is configured to audit and revise the case built by the user compliance result feedback module by a legal expert, and form a new practical case; The data cross-border legal compliance practical case knowledge graph is configured to store data cross-border legal compliance practical cases; The legal provision database is configured to store data cross-border related legal provisions; when the data cross-border related legal provisions change, the legal expert registers the changed legal provisions to the legal provision database, the legal provision database extracts the attributes of the legal provisions, and stores the legal provisions and their attributes after indexing.

[0035] The above is only a preferred embodiment of the present application, and does not limit the present application in other forms. Any skilled person in the art can modify or change the above disclosed technical content to equivalent embodiments applied to other fields, but any simple modification, equivalent change and modification made on the basis of the technical essence of the present application to the above embodiments without departing from the technical solution content of the present application still belongs to the protection scope of the present application.

Claims

1. An automated data cross-border legal compliance inspection method based on LLM and RAG, characterized by: The inspection method includes the following steps: S1. The training steps of the data cross-border legal compliance LLM are as follows: data cross-border laws and regulations written by legal experts are used as the training dataset. Based on the selected open source LLM, pre-training is performed to obtain a data cross-border legal compliance LLM that can be used to check the legal compliance of data cross-border behavior. S2. Deployment steps for the cross-border legal compliance LLM: Based on the cross-border legal compliance LLM obtained in step S1, select the corresponding computing resources, deploy the cross-border legal compliance LLM to the cross-border legal compliance automated inspection system, and provide services through API. S3. Data cross-border legal compliance check steps, specifically including the following sub-steps. S301. The automated data cross-border legal compliance inspection system receives data cross-border legal compliance inspection requests submitted by users. S302. The automated data cross-border legal compliance inspection system, based on the inspection request received in step S301, uses RAG technology to search for semantically relevant practical cases and updated legal provisions in the data cross-border legal compliance case knowledge graph and legal provision database. The RAG technology search results and the inspection request are used as context data, and combined with predefined prompts, are submitted to the data cross-border legal compliance LLM. The data cross-border legal compliance LLM then processes the inspection request with reference to practical cases and updated legal provisions to generate compliance inspection results. S303, Data Cross-border Legal Compliance LLM will return the generated compliance inspection results to the user. After the user provides feedback on the quality of the inspection results, the Data Cross-border Legal Compliance Automated Inspection System will collect the user's feedback. S4, the continuous construction steps of the knowledge graph of practical cases of cross-border data legal compliance and the database of legal provisions, specifically include the following sub-steps: S401. After receiving feedback from users regarding the compliance inspection results, the automated data cross-border legal compliance inspection system constructs a case based on the inspection requests, compliance inspection results, and feedback related to this compliance inspection. After being reviewed and revised by legal experts, this case is saved in the data cross-border legal compliance practical case knowledge graph to form a new practical case. S402. When legal provisions related to cross-border data change, legal experts shall register the changed legal provisions with the automated inspection system for cross-border data legal compliance. The automated inspection system for cross-border data legal compliance shall extract the attributes of the legal provisions, and store the legal provisions and their attributes in the legal provisions database after indexing them.

2. The automated cross-border legal compliance inspection method based on LLM and RAG as described in claim 1, characterized in that: In step S401, the constructed case consists of entities and relationships, which are extracted from the compliance check request and the compliance check results.

3. The automated cross-border legal compliance inspection method based on LLM and RAG as described in claim 1 or 2, characterized in that: In step S402, the attributes of the legal provisions include the name of the legal document to which the legal provisions belong and keywords.

4. The automated cross-border legal compliance inspection method based on LLM and RAG as described in claim 3, characterized in that: In step S402, the automated data cross-border legal compliance inspection system stores the legal provisions and their attributes in a legal provisions database after creating a sparse index. When a subsequent data cross-border legal compliance inspection request arrives, the automated data cross-border legal compliance inspection system retrieves the legal provisions with the highest similarity from the legal provisions database using sparse retrieval technology, which serves as a knowledge update for the data cross-border legal compliance LLM.

5. The automated cross-border legal compliance inspection method based on LLM and RAG as described in claim 4, characterized in that: The sparse retrieval technology is the BM25 algorithm based on keyword matching.

6. The automated cross-border legal compliance inspection method based on LLM and RAG as described in claim 3, characterized in that: In step S402, the automated data cross-border legal compliance inspection system stores the legal provisions and their attributes in a legal provisions database after creating a dense index. When a subsequent data cross-border legal compliance inspection request arrives, the automated data cross-border legal compliance inspection system retrieves the legal provisions with the highest similarity from the legal provisions database using dense retrieval technology, which serves as a knowledge update for the data cross-border legal compliance LLM.

7. The automated cross-border legal compliance inspection method for data based on LLM and RAG as described in claim 6, characterized in that: The dense retrieval technology is a vector similarity calculation method based on deep semantics.

8. An automated data cross-border legal compliance inspection system based on LLM and RAG, characterized by: The system includes, The Data Cross-border Legal Compliance Inspection Request Module is used to receive data cross-border legal compliance inspection requests submitted by users. The system utilizes RAG technology to search for relevant case studies and updated legal provisions in the knowledge graph of cross-border legal compliance practice cases and the legal provisions database. The RAG search results and the inspection request are used as contextual data and combined with predefined prompts, and then submitted to the cross-border legal compliance inspection module. The data cross-border legal compliance check module is equipped with a pre-trained data cross-border legal compliance LLM. The data cross-border legal compliance LLM processes the check request by referring to practical cases and combining the latest relevant legal provisions, generates compliance check results, and sends the compliance test results to the user. The user compliance result feedback module is used to collect user feedback on the quality of the inspection results; And construct a case based on the compliance inspection requests, compliance inspection results and feedback; The legal expert review and revision module involves legal experts reviewing and revising the cases built by the user compliance result feedback module to create new practical cases. A knowledge graph of practical cases on cross-border data legal compliance, used to store practical cases on cross-border data legal compliance. The legal provisions database is used to store legal provisions related to cross-border data. When the legal provisions related to cross-border data change, legal experts register the changed legal provisions with the legal provisions database. The legal provisions database extracts the attributes of the legal provisions and stores them after indexing the legal provisions and their attributes.