Data compliance security detection method and device based on adaptive prompt word optimization

Through the data compliance and security detection method optimized by adaptive prompt words, the initial detection results of predefined rules are reviewed using a large model, which solves the problem of high false alarm rate in traditional detection and achieves higher detection accuracy and lower false alarm rate.

CN120336492BActive Publication Date: 2025-09-19HANGZHOU HIKVISION DIGITAL TECHNOLOGY CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510811627.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-06-17
Publication Date
2025-09-19
Estimated Expiration
2045-06-17

AI Technical Summary

Technical Problem

Traditional data compliance detection has a large number of false positives when identifying long text or unstructured data.

Method used

A method based on adaptive prompt word optimization is adopted to perform initial detection through predefined rules, determine the target rules and target data content, and use a large model for review and detection, and adaptively select prompt words to improve accuracy.

Benefits of technology

It reduces the false positive rate of data compliance and security testing, improves the accuracy of large model review, and ensures the accuracy of test results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120336492B_ABST
    Figure CN120336492B_ABST
Patent Text Reader

Abstract

The present application provides a data compliance and security detection method and device based on adaptive prompt word optimization, the method comprising: performing data compliance detection on the data to be detected according to predefined rules, and determining the initial detection result of the data to be detected; when the initial detection result is that the data to be detected is non-compliant, determining the target rule hit by the data to be detected, and the non-compliant target data content in the data to be detected; determining the target prompt word that matches the target rule according to the target rule; based on the target data content and the target prompt word, using a large model, performing data compliance review detection on the target data content, and determining the final detection result. This method can reduce the false alarm rate of data compliance and security detection while ensuring the accuracy of data compliance and security detection.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of data compliance detection, and in particular to a data compliance security detection method and device based on adaptive prompt word optimization. Background Art

[0002] Data compliance testing refers to the review of data processing activities to ensure that they comply with relevant regulations, industry standards and corporate policies, covering data collection, storage, processing, transmission and other aspects to avoid risks and protect user privacy.

[0003] Traditional data compliance testing mostly uses rule-based matching, for example, scanning data based on predefined rules (such as GDPR (General Data Protection Regulation)) to identify violations. However, due to the diversity and complexity of predefined rules, when identifying long text or unstructured data, there is a high incidence of false positives. Summary of the Invention

[0004] In view of this, the present application provides a data compliance and security detection method and device based on adaptive prompt word optimization.

[0005] Specifically, this application is implemented through the following technical solutions:

[0006] According to a first aspect of an embodiment of the present application, a data compliance and security detection method based on adaptive prompt word optimization is provided, comprising:

[0007] Performing data compliance testing on the data to be tested according to predefined rules to determine the initial test results of the data to be tested;

[0008] In the case where the initial detection result is that the data to be detected is non-compliant, determining the target rule hit by the data to be detected, and the non-compliant target data content in the data to be detected;

[0009] Determining a target prompt word that matches the target rule according to the target rule;

[0010] Based on the target data content and the target prompt word, a large model is used to conduct a data compliance review and inspection on the target data content to determine the final inspection result.

[0011] According to a second aspect of an embodiment of the present application, a data compliance and security detection device based on adaptive prompt word optimization is provided, comprising:

[0012] A detection unit, configured to perform data compliance detection on the data to be detected according to predefined rules, and determine an initial detection result of the data to be detected;

[0013] a parsing unit, configured to determine, when the initial detection result indicates that the data to be detected is non-compliant, a target rule hit by the data to be detected and content of non-compliant target data in the data to be detected;

[0014] a determination unit, configured to determine, based on the target rule, a target prompt word that matches the target rule;

[0015] The review unit is used to perform data compliance review and detection on the target data content based on the target data content and the target prompt word using a large model to determine the final detection result.

[0016] According to a third aspect of an embodiment of the present application, there is provided an electronic device, including a processor and a memory, wherein:

[0017] Memory for storing computer programs;

[0018] The processor is used to implement the method provided in the first aspect when executing the program stored in the memory.

[0019] According to a fourth aspect of the embodiments of the present application, a computer program product is provided, wherein a computer program is stored in the computer program product. When a processor executes the computer program, the processor is prompted to implement the method provided in the first aspect.

[0020] According to the fifth aspect of the embodiment of the present application, a machine-readable storage medium is provided, which stores machine-executable instructions that can be executed by a processor; wherein the processor is used to execute the machine-executable instructions to implement the method provided in the first aspect.

[0021] The data compliance and security detection method based on adaptive prompt word optimization of the embodiment of the present application performs data compliance detection on the data to be detected according to predefined rules to determine the initial detection result of the data to be detected. When the initial detection result is that the data to be detected is non-compliant, the target rule hit by the data to be detected and the non-compliant target data content in the data to be detected are determined, and the target prompt word matching the target rule is determined according to the target rule. Then, based on the target data content and the target prompt word, a large model is used to perform data compliance review detection on the target data content to determine the final detection result. By using the large model to review the initial detection result of the data compliance and security detection, the false alarm rate of the data compliance and security detection can be reduced. By adaptively determining the corresponding target prompt word based on the target rule hit by the data to be detected, the accuracy of the large model review can be improved compared with the use of fixed and unified prompt words, thereby reducing the false alarm rate of the data compliance and security detection while ensuring the accuracy of the data compliance and security detection. BRIEF DESCRIPTION OF THE DRAWINGS

[0022] Figure 1 This is a flowchart of a data compliance and security detection method based on adaptive prompt word optimization, which is shown as an exemplary embodiment of the present application;

[0023] Figure 2 This is a module diagram of a data compliance and security detection solution based on adaptive prompt word optimization, shown as an exemplary embodiment of the present application;

[0024] Figure 3 This is a schematic diagram of an implementation process of a data compliance and security detection solution based on adaptive prompt word optimization, shown as an exemplary embodiment of the present application;

[0025] Figure 4 This is a structural diagram of a data compliance and security detection device based on adaptive prompt word optimization, shown as an exemplary embodiment of the present application;

[0026] Figure 5 The figure is a schematic diagram of the hardware structure of an electronic device shown as an exemplary embodiment of the present application. DETAILED DESCRIPTION

[0027] In order to enable those skilled in the art to better understand the technical solutions provided by the embodiments of the present application, and to make the above-mentioned purposes, features and advantages of the embodiments of the present application more obvious and easy to understand, the technical solutions in the embodiments of the present application are further described in detail below with reference to the accompanying drawings.

[0028] See Figure 1 , is a flow chart of a data compliance and security detection method based on adaptive prompt word optimization provided in an embodiment of the present application, such as Figure 1 As shown, the data compliance and security detection method based on adaptive prompt word optimization may include the following steps:

[0029] Step S100: Perform data compliance detection on the data to be detected according to predefined rules to determine the initial detection result of the data to be detected.

[0030] Exemplarily, the data source of the data to be detected may include but is not limited to log data or transmission flow data.

[0031] Among them, the data to be tested has the characteristics of being unstructured, different for different devices, and long text.

[0032] For example, take log data as an example, such as:

[0033] Device A log: -1117843015 2005.06.03 R21-M1-N6-C:J08-U11 2005-06-03-16.56.55.309974 R21-M1-N6-C:J08-U11 RAS KERNEL INFO 141 double-hummeralignment exceptions;

[0034] Device B log: 081109 204722 567 INFO dfs.DataNode$PacketResponder: Received block blk_5402003568334525940 of size 67108864 from / 10.251.214.112;

[0035] Device C log: [2023-04-14 00:00:46.020]04-05 00:51:19.599 1143 1241 Dheop : "netStatus": "connect";

[0036] Device D log: (2024.08.29 15:16:56.08908-29T07:17:06 ERROR otapprotocol.c:13817 method:

[0037] service module: modelbuf:{"additionInfo":{"ENAuthentication":{"userType":"administrator",

[0038] "userName":"123"}},"data":{"delRelatedOperatorInfoEnabled":true,"ID":1,"IDCreator":1,"sessionAuthEnabled":true,"sessionAuthInfo" :{"phoneNumSessionAuthInfo":"123"}},"userID":"1","userName":"1","userNickName":"1","userScope":"1","userType":"administrator"}}).

[0039] Due to the above characteristics of the data to be tested, the test results of data compliance testing on the data to be tested based on predefined rules will have a high false alarm rate.

[0040] To address this issue, in order to reduce the false alarm rate, the test results (which can be called initial test results) determined by performing data compliance testing on the data to be tested based on predefined rules can be reviewed using a large model.

[0041] For example, a large model can be used to review the initial detection results of the "non-compliant data to be detected" situation (i.e., the presence of illegal data content in the data to be detected) to reduce the situation where "compliant data to be detected" is mistakenly detected as "non-compliant data to be detected".

[0042] Step S110: When the initial detection result shows that the data to be detected is non-compliant, determine the target rules hit by the data to be detected, and the non-compliant target data content in the data to be detected.

[0043] Step S120: Determine the target prompt word that matches the target rule according to the target rule.

[0044] In an embodiment of the present application, in order to improve the accuracy of data compliance review of the data to be tested using a large model, when the initial test result is that the data to be tested is non-compliant, a prompt word (which can be called a target prompt word) can be adaptively determined based on a predefined rule (which can be called a target rule) hit by the data to be tested, so that the initial test result can be reviewed using the large model based on the target prompt word.

[0045] For example, when the initial detection result is that the data to be detected is non-compliant, the target rule hit by the data to be detected and the non-compliant data content in the data to be detected (which can be called target data content) can be determined, and based on the target rule, the target prompt word that matches the target rule can be adaptively determined.

[0046] For example, in the process of performing data compliance detection on the data to be detected according to the predefined rules, any data to be detected may hit the target rules multiple times.

[0047] Each time the data to be detected hits a target rule, the hit target rule and the corresponding target data content can be determined.

[0048] Exemplarily, each time the data to be detected hits a target rule, an output result including the hit target rule and the corresponding target data content can be reconstructed.

[0049] For example, the refactored output could look like this:

[0050] Rule name (also called rule description): weak passwords and common passwords;

[0051] Hit rules: 12345678;

[0052] Original content (i.e., target data content): (""'i_id': 1096, 'c_name': '12345678-channel-0', "").

[0053] For example, in the process of determining the target prompt word that matches the target rule according to the target rule, the target prompt word that matches the target rule may be determined according to the rule name of the target rule.

[0054] In one example, when the target rule is a password-type rule (such as weak passwords and commonly used passwords), the target prompt word can be used to prompt the large model to output a correct initial detection result when it determines that the target data content completely matches or does not completely match the target rule; when it determines that the target data content completely does not match the target rule, it outputs an incorrect initial detection result.

[0055] In another example, when the target rule is a sensitive information test rule (such as a password test), the target prompt word can be used to prompt the large model to output a correct initial detection result when it determines that a specified type of sensitive information (such as a password) exists in the target data content; and to output an incorrect initial detection result when it determines that the specified type of sensitive information does not exist in the target data content.

[0056] Step S130: Based on the target data content and the target prompt word, the target data content is subjected to data compliance review and detection using the large model to determine the final detection result.

[0057] In an embodiment of the present application, when the target prompt words are determined in the above manner and the non-compliant target data content in the data to be tested is determined, the target data content can be reviewed and tested for data compliance based on the target data content and the target prompt words using a large model to determine the final test result.

[0058] Exemplarily, the target data content and the target prompt word can be input into the big model respectively, so that the big model uses the target prompt word to perform data compliance review and detection on the target data content and output the final detection result.

[0059] Exemplarily, the final detection result may include whether the initial detection result is correct or the initial detection result is incorrect.

[0060] It can be seen that in Figure 1In the method flow shown, data compliance detection is performed on the data to be detected according to predefined rules to determine the initial detection result of the data to be detected. When the initial detection result is that the data to be detected is non-compliant, the target rule hit by the data to be detected and the non-compliant target data content in the data to be detected are determined, and based on the target rule, the target prompt word matching the target rule is determined. Then, based on the target data content and the target prompt word, the target data content is reviewed and tested for data compliance using a large model to determine the final detection result. By using the large model to review the initial detection result of the data compliance and security detection, the false alarm rate of the data compliance and security detection can be reduced. By adaptively determining the corresponding target prompt word based on the target rule hit by the data to be detected, the accuracy of the large model review can be improved compared with the use of fixed and unified prompt words, thereby reducing the false alarm rate of the data compliance and security detection while ensuring the accuracy of the data compliance and security detection.

[0061] In some embodiments, determining the target prompt word that matches the target rule according to the target rule may include:

[0062] According to the target rule, the matching relationship between the predefined rule and the prompt word is queried to determine the target prompt word that matches the target rule.

[0063] For example, in order to improve the efficiency of determining the target prompt word that matches the target rule, a matching relationship between the predefined rule and the prompt word may be pre-established.

[0064] Accordingly, when the target rule is determined, the matching relationship between the predefined rule and the prompt word can be queried according to the target rule to determine the target prompt word that matches the target rule.

[0065] In one example, the matching relationship between the above predefined rules and the prompt words can be constructed in the following way:

[0066] For any predefined rule in the rule library, a prompt word matching the predefined rule is determined, and a matching relationship between the predefined rule and the prompt word is stored.

[0067] For example, in order to improve the accuracy of the target prompt word matching and further improve the review accuracy of the large model, in the process of constructing the matching relationship between the predefined rules and the prompt words, for any predefined rule in the rule library, the prompt word that matches the predefined rule can be determined, and the matching relationship between the predefined rule and the prompt word can be stored.

[0068] Exemplarily, the matching relationship between the predefined rule and the prompt word may include a matching relationship between the rule name of the predefined rule and the prompt word.

[0069] It should be noted that, in this implementation, for any predefined rule newly added to the rule base, a prompt word matching the newly added predefined rule can be determined, and a matching relationship exists between the newly added predefined rule and the prompt word.

[0070] In another example, the matching relationship between the above predefined rules and the prompt words can be constructed in the following way:

[0071] Categorize the predefined rules in the rule base;

[0072] For any category of predefined rules, a prompt word matching the category of predefined rules is determined, and a matching relationship between the category of predefined rules and the prompt word is stored.

[0073] For example, in order to reduce the storage resources occupied by the matching relationship between the predefined rule and the prompt word, for the predefined rules in the rule base, the matching prompt word may be determined according to category.

[0074] Accordingly, in the process of constructing the matching relationship between the predefined rules and the prompt words, the predefined rules existing in the rule base may be classified.

[0075] For example, the predefined rules in the rule base can be classified from the perspective of attributes, such as being divided into two categories: exact matching and fuzzy matching.

[0076] For example, any of the above two categories can be further divided into subcategories.

[0077] Exemplarily, for any category of predefined rules, a prompt word matching the category of predefined rules may be determined, and a matching relationship between the category of predefined rules and the prompt word may be stored.

[0078] Exemplarily, in this implementation, in the process of determining the target prompt word that matches the target rule based on the target rule, the category of the target rule can be determined, and based on the category of the target rule, the matching relationship between the predefined rule and the prompt word can be queried to determine the target prompt word that matches the target rule.

[0079] As an example, when the matching relationship between the predefined rules and the prompt words is a matching relationship between predefined rules and prompt words of different categories, the following may also be included:

[0080] For any predefined rule newly added to the rule base, determine the target category of the predefined rule;

[0081] Determine whether there is a matching relationship between the predefined rule of the target category and the prompt word;

[0082] When it is determined that there is no matching relationship between the predefined rule of the target category and the prompt word, a prompt word matching the predefined rule of the target category is determined, and the matching relationship between the predefined rule of the target category and the prompt word is stored.

[0083] For example, when a new predefined rule is added to the rule library, the category of the new predefined rule (which may be called a target category) may be determined, and whether a matching relationship between the predefined rule of the target category and the prompt word already exists.

[0084] In the case where it is determined that there is no matching relationship between the predefined rule of the target category and the prompt word, a matching relationship between the predefined rule of the target category and the prompt word may be constructed.

[0085] Exemplarily, a prompt word that matches a predefined rule of the target category may be determined, and a matching relationship between the predefined rule of the target category and the prompt word may be stored.

[0086] In some embodiments, the data compliance review and detection of the target data content using the large model based on the target data content and the target prompt word to determine the final detection result may include:

[0087] Set system roles and auxiliary information for large models;

[0088] The target data content and target prompt words are input into the big model so that the big model, in the role of the system, performs data compliance review and detection on the target data content based on the auxiliary information and target prompt words to determine the final detection result.

[0089] For example, in order to further improve the accuracy of the big model in conducting data compliance review and detection, in the process of using the big model for data compliance review and detection, the system role and auxiliary information (also called auxiliary understanding information) can be set for the big model, and then the target data content and target prompt words can be input into the big model.

[0090] The large model can perform data compliance review and detection on the input target data content based on the set system role, the set auxiliary information, and the input target prompt words to determine the final detection result.

[0091] In one example, setting the system role and auxiliary information for the large model may include:

[0092] Determine the target system role and target auxiliary information corresponding to the target data content and the target prompt word according to the target data content and the target prompt word;

[0093] According to the target system role and target auxiliary information, set the system role and auxiliary information for the large model.

[0094] For example, in order to improve the accuracy of the system role and auxiliary information settings, and further improve the review accuracy of the large model, the target that currently needs to be reviewed can be determined based on the target data content and target prompt words, so that the system role and auxiliary information can be set for the large model in a targeted manner.

[0095] For example, based on the target data content and the target prompt words, the system role (which may be called the target system role) and auxiliary information (which may be called the target auxiliary information) corresponding to the target data content and the target prompt words can be determined, and based on the target system role and the target auxiliary information, the system role and auxiliary information can be set for the large model.

[0096] In some embodiments, when the final detection result is inconsistent with the initial detection result, the output of the large model includes the final detection result and the reason why the final detection result is inconsistent with the initial detection result.

[0097] Exemplarily, the final detection result may include whether the initial detection result is correct or the initial detection result is incorrect.

[0098] In the case where the final test result is an error in the initial test result, the final test result is inconsistent with the initial test result. In this case, the output of the large model may include not only the final test result but also the reason why the final test result is inconsistent with the initial test result, so that relevant personnel can better understand the review results.

[0099] For example, taking the hit rule of "password" as an example, assuming that the initial detection result is that the data to be detected includes the password; the final detection result may be that the initial detection result is wrong, and the reason output by the large model may be: the original detection is wrong, and the original content does not find the actual password information, but only the device configuration information.

[0100] In order to enable those skilled in the art to better understand the technical solutions provided by the embodiments of the present application, the technical solutions provided by the embodiments of the present application are described below with reference to specific examples.

[0101] In this embodiment, a data compliance and security detection scheme based on adaptive prompt word optimization is provided. This scheme introduces a large model to verify (review) the detection results based on the initial detection results determined by matching predefined rules; by pre-setting prompt words that match the predefined rules, and during use, according to the rules hit by the previous initial detection results (that is, the above-mentioned target rules), the prompt words are adaptively selected to enhance the large model's semantic understanding of the initial detection results and the target rules, thereby achieving effective review of the initial detection results, effectively reducing the false alarm rate of the initial detection results, and providing an explainable description of the detection results.

[0102] See Figure 2 , which is a module diagram of the data compliance security detection solution based on adaptive prompt word optimization provided by this embodiment, such as Figure 2 As shown, the data compliance and security detection solution based on adaptive prompt word optimization may include an input module, a compliance detection module, a parsing module, a prompt word adaptive selection module, a large model-based analysis module, and an output module.

[0103] Among them, the input module is used to input the data to be tested; the compliance detection module is used to perform compliance detection on the data to be tested and determine the initial detection results; the parsing module is used to parse the initial detection results; the prompt word adaptive selection module is used to adaptively select prompt words, and the prompt words are used by the large model to review the initial detection results; the analysis module based on the large model is used to review the initial detection results using the large model based on the selected prompt words; the output module is used to output the final detection results.

[0104] See Figure 3 , which is a schematic diagram of the implementation process of the data compliance and security detection solution based on adaptive prompt word optimization provided in this embodiment, such as Figure 3 As shown, the data compliance and security detection solution based on adaptive prompt word optimization may include:

[0105] S1. Input the data to be tested (also called the original data to be tested).

[0106] Exemplarily, the data source of the data to be detected may include but is not limited to product log data, transmission flow data, etc.

[0107] Among them, the data to be tested has the characteristics of being unstructured, different for different devices, and long text.

[0108] S2. Perform data compliance detection on the data to be detected based on predefined rules.

[0109] Exemplarily, the predefined rules may include, but are not limited to, relevant regulations, industry standards, corporate policies, and part or all of user-defined business rules.

[0110] In one example, in the process of performing data compliance detection on the data to be detected based on predefined rules, the detection can be performed in a full rule matching detection manner.

[0111] For example, predefined rules may include the following:

[0112] Rule R1: password (Rule name: Password test)

[0113] Rule R2: [\w-]+@[\w-]+(.[\w-]+)+ (Rule name: Email address)

[0114] Rule R3: 123456 (Rule Name: Weak Password)

[0115] S3. Output the initial detection results and analyze them.

[0116] Exemplarily, the initial detection result may include whether the data to be detected is compliant or whether the data to be detected is non-compliant.

[0117] Exemplarily, when the initial detection result indicates that the data to be detected is non-compliant, the output result may be reconstructed and S4 may be executed.

[0118] Exemplarily, the reconstructed output result may include outputting the hit rule R, that is, which rule R is violated, and the specific data content D in the to-be-detected data that violates the rule R.

[0119] For example, the rebuilt output might look like this:

[0120] Rule name (also called rule description): weak passwords and common passwords;

[0121] Hit rules: 12345678;

[0122] Original content: (""'i_id': 1096, 'c_name': '12345678-channel-0', "").

[0123] For another example, the reconstructed output can also be as follows:

[0124] Rule name: Password test;

[0125] Hit rule: password;

[0126] Original content: "{"deviceid"":"615"","netzone id"":"0"","password"":"wntiivmc="",}".

[0127] S4. According to the hit rule R, adaptively select a prompt word P that matches the hit rule R.

[0128] For example, the matching relationship between pre-built predefined rules and prompt words (such as the matching relationship between the rule name of the predefined rule and the prompt word) can be queried according to the rule name of the hit rule R to determine the matching prompt word P.

[0129] For example, assuming the matching rule is "12345678" and the rule name is "weak and commonly used passwords", the matching prompt word P can be as follows:

[0130] Understand the original content as a whole. If the original content information is not related to the password, the detection is wrong. If it is related to the password, refer to the password in the "hit rule" and perform fuzzy information matching on the original content.

[0131] When the true password value in the original content does not completely match the example in the "Hit Rule", the original content must be determined to be illegal to ensure security.

[0132] In summary, if a weak or commonly used password is found, it does not need to match the hit rule exactly. In both cases, answer "Original detection is correct." Otherwise, answer "Original detection is incorrect" and briefly explain the reason. Please keep your response concise and clear, with one sentence.

[0133] For another example, assuming the matching rule is "password" and the rule name is "password test", the matching prompt word P can be as follows:

[0134] The "hit rule" in the original content is a suspected password sequence. Please determine whether the string is actually used as a password. Only sequences that are actually used as passwords are considered illegal content.

[0135] In summary, if you believe the password contains sensitive information or is weak, answer "The original test is correct"; otherwise, answer "The original test is wrong" and briefly explain the reason. Please keep your response concise and clear, with one sentence.

[0136] S5. Set the corresponding system role and auxiliary information for the large model, and input the data content D and prompt word P into the large model to construct a complete call content.

[0137] For example, the system role and auxiliary information settings can be as follows:

[0138] Set the role of the large model system as: "You are an expert in efficiently capturing sensitive data and need to complete the task of product data compliance testing";

[0139] The auxiliary information for the large model is set as follows: "Below are some data compliance test results. My task is to understand the "Rule Name", use the "Hit Rule" prompts to analyze and inspect the "Original Content", and combine my understanding of the "Rule Name" to determine whether the original content has any data compliance issues described by the "Rule Name" or "Hit Rule".

[0140] For example, the data content D and the prompt word P may be input into the large model in sequence, and the data content D may be reviewed using the large model.

[0141] S6. Output the final detection result.

[0142] Exemplarily, the final detection result may include whether the initial detection result is correct or the initial detection result is incorrect.

[0143] Exemplarily, in the case where the final detection result is an error in the initial detection result, it is determined that the final detection result is inconsistent with the initial detection result. In this case, the reason for the different output results can be supplemented.

[0144] For example, taking the rule name "Password Test" as an example, if the final detection result is inconsistent with the initial detection result, the output reason may be "Original detection error, the original content did not find the actual password information, only the device configuration information."

[0145] It can be seen that in the technical solution provided by the implementation of this application, by introducing a large model to assist in data compliance detection, especially reviewing the original detection results based on predefined rules (i.e., the initial detection results), the false alarm rate of the original detection is reduced while ensuring the accuracy; in addition, by adaptively selecting matching prompt words based on the hit rules, the semantic understanding differences between the original content and the rules are effectively resolved, thereby improving the accuracy of the review.

[0146] The above describes the method provided by this application. The following describes the device provided by this application:

[0147] See Figure 4 , which is a structural diagram of a data compliance and security detection device based on adaptive prompt word optimization provided by an embodiment of the present application, such as Figure 4 As shown, the data compliance and security detection device based on adaptive prompt word optimization may include:

[0148] A detection unit, configured to perform data compliance detection on the data to be detected according to predefined rules, and determine an initial detection result of the data to be detected;

[0149] a parsing unit, configured to determine, when the initial detection result indicates that the data to be detected is non-compliant, a target rule hit by the data to be detected and content of non-compliant target data in the data to be detected;

[0150] a determination unit, configured to determine, based on the target rule, a target prompt word that matches the target rule;

[0151] The review unit is used to perform data compliance review and detection on the target data content based on the target data content and the target prompt word using a large model to determine a final detection result.

[0152] An embodiment of the present application also provides an electronic device including a processor and a memory, wherein the memory is used to store computer programs; and the processor is used to implement the data compliance and security detection method based on adaptive prompt word optimization described above when executing the program stored in the memory.

[0153] See Figure 5 , is a schematic diagram of the hardware structure of an electronic device provided in an embodiment of the present application. The electronic device may include a processor 501 and a memory 502 storing machine-executable instructions. The processor 501 and the memory 502 may communicate via a system bus 503. Furthermore, by reading and executing the machine-executable instructions corresponding to the data compliance and security detection logic based on adaptive prompt word optimization in the memory 502, the processor 501 may execute the data compliance and security detection method based on adaptive prompt word optimization described above.

[0154] The memory 502 mentioned herein may be any electronic, magnetic, optical, or other physical storage device that may contain or store information, such as executable instructions, data, and the like. For example, the machine-readable storage medium may be: RAM (Random Access Memory), volatile memory, non-volatile memory, flash memory, a storage drive (such as a hard disk drive), a solid-state drive, any type of storage disk (such as a CD, DVD, etc.), or similar storage media, or a combination thereof.

[0155] In some embodiments, a machine-readable storage medium is also provided. Figure 5 The memory 502 in the machine-readable storage medium stores machine-executable instructions. When executed by the processor, the machine-executable instructions implement the data compliance and security detection method based on adaptive prompt word optimization described above. For example, the machine-readable storage medium can be ROM, RAM, CD-ROM, magnetic tape, floppy disk, or optical data storage device.

[0156] An embodiment of the present application also provides a computer program product that stores a computer program, and when a processor executes the computer program, it prompts the processor to execute the data compliance and security detection method based on adaptive prompt word optimization described above.

Claims

1. A data compliance and security detection method based on adaptive prompt word optimization, characterized in that: include: According to predefined rules, data compliance detection is performed on the data to be detected by using the predefined rule matching method to determine the initial detection result of the data to be detected; If the initial detection result indicates that the data to be detected is non-compliant, determining the target rule hit by the data to be detected and the non-compliant target data content in the data to be detected; wherein, if the data to be detected hits the target rule multiple times, for each case where the data to be detected hits the target rule, reconstructing an output result including the hit target rule and the corresponding target data content; Determining a target prompt word that matches the target rule according to the target rule; Based on the target data content and the target prompt word, a large model is used to conduct a data compliance review and inspection on the target data content to determine the final inspection result.

2. The method according to claim 1, characterized in that Determining a target prompt word that matches the target rule according to the target rule includes: According to the target rule, a matching relationship between a predefined rule and a prompt word is searched to determine a target prompt word that matches the target rule.

3. The method according to claim 2, characterized in that The matching relationship between the predefined rules and the prompt words is constructed in the following way: For any predefined rule in the rule base, determine the prompt word that matches the predefined rule, and store the matching relationship between the predefined rule and the prompt word; or, Categorize the predefined rules in the rule base; For any category of predefined rules, a prompt word matching the category of predefined rules is determined, and a matching relationship between the category of predefined rules and the prompt word is stored.

4. The method according to claim 3, characterized in that In a case where the matching relationship between the predefined rule and the prompt word is a matching relationship between predefined rules and prompt words of different categories, the method further includes: For any predefined rule newly added to the rule base, determine the target category of the predefined rule; Determine whether there is a matching relationship between the predefined rule of the target category and the prompt word; When it is determined that there is no matching relationship between the predefined rule of the target category and the prompt word, a prompt word matching the predefined rule of the target category is determined, and the matching relationship between the predefined rule of the target category and the prompt word is stored.

5. The method according to claim 1, wherein The method of performing data compliance review and detection on the target data content using a large model based on the target data content and the target prompt word to determine the final detection result includes: Setting system roles and auxiliary information for the large model; The target data content and the target prompt word are input into the big model so that the big model, in the role of the system, performs data compliance review and detection on the target data content based on the auxiliary information and the target prompt word to determine the final detection result.

6. The method according to claim 5, characterized in that The step of setting the system role and auxiliary information for the large model includes: Determining a target system role and target auxiliary information corresponding to the target data content and the target prompt word according to the target data content and the target prompt word; According to the target system role and target auxiliary information, the system role and auxiliary information are set for the large model.

7. The method according to claim 1, characterized in that In the case that the final detection result is inconsistent with the initial detection result, the output of the large model includes the final detection result and the reason why the final detection result is inconsistent with the initial detection result.

8. A data compliance and security detection device based on adaptive prompt word optimization, characterized in that: include: A detection unit is used to perform data compliance detection on the data to be detected according to predefined rules and by matching the predefined rules, and determine an initial detection result of the data to be detected; a parsing unit configured to, when the initial detection result indicates that the data to be detected is non-compliant, determine the target rule hit by the data to be detected and the non-compliant target data content in the data to be detected; wherein, when the data to be detected hits the target rule multiple times, reconstruct an output result including the hit target rule and the corresponding target data content for each time the data to be detected hits the target rule; a determination unit, configured to determine, based on the target rule, a target prompt word that matches the target rule; The review unit is used to perform data compliance review and detection on the target data content based on the target data content and the target prompt word using a large model to determine a final detection result.

9. An electronic device, characterized in that: comprising a processor and a memory, wherein Memory for storing computer programs; A processor, configured to implement the method according to any one of claims 1 to 7 when executing a program stored in a memory.

10. A computer program product, characterized in that The computer program product stores a computer program, and when the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.

Citation Information

Patent Citations

  • Large model sensitive content review method and device based on thinking chain

    CN119862872A

  • Multi-level multi-model collaborative compliance detection system and method based on large model

    CN119862874A