Data compliance security detection method and equipment based on adaptive cue word optimization
Through the data compliance and security detection method optimized by adaptive prompt word, the initial detection results of predefined rules are reviewed using a large model, which solves the problem of high false alarm rates in traditional detection and achieves higher detection accuracy.
Patent Information
- Application Number
- CN202510811627.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-17
- Publication Date
- 2025-07-18
- Estimated Expiration
- 2045-06-17
AI Technical Summary
Traditional data compliance detection has a large number of false positives when identifying long text or unstructured data.
Through the method based on adaptive prompt word optimization, the initial detection results of predefined rules are reviewed using a large model, the target prompt word is adaptively selected, and data compliance review and detection are carried out.
Reduces the false alarm rate of data compliance and security detection and improves the accuracy of detection.
Smart Images

Figure CN120336492A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of data compliance detection, and particularly to a data compliance security detection method and device based on adaptive prompt optimization. Background Art
[0002] Data compliance detection refers to the review of data processing activities to ensure compliance with relevant regulations, industry standards, and enterprise policies, covering data collection, storage, processing, transmission, etc., to avoid risks and protect user privacy.
[0003] Most traditional data compliance detections adopt rule matching methods, such as scanning data based on predefined rules (such as GDPR (General Data Protection Regulation)), to identify non-compliance items. However, due to the variety and complexity of predefined rules, there are a large number of false positive detection results in the case of identifying long text data or unstructured data. Summary of the Invention
[0004] In view of this, this application provides a data compliance security detection method and device based on adaptive prompt optimization.
[0005] Specifically, this application is implemented through the following technical solutions: According to the first aspect of the embodiments of this application, a data compliance security detection method based on adaptive prompt optimization is provided, including: Performing 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; In the case that 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 target data content that is non-compliant in the data to be detected; Determining the target prompt word that matches the target rule according to the target rule; Performing data compliance review detection on the target data content by using a large model according to the target data content and the target prompt word to determine the final detection result.
[0006] According to the second aspect of the embodiments of this application, a data compliance security detection device based on adaptive prompt optimization is provided, including: A detection unit for performing 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; An analysis unit for determining the target rule hit by the data to be detected, and the target data content that is non-compliant in the data to be detected in the case that the initial detection result indicates that the data to be detected is non-compliant; A determination unit, configured to determine a target prompt word that matches the target rule according to the target rule; A review unit, configured to perform a data compliance review and detection on the target data content by using a large model according to the target data content and the target prompt word, and determine a final detection result.
[0007] According to a third aspect of the embodiments of the present application, there is provided an electronic device, including a processor and a memory, where The memory is used to store a computer program; The processor, when executing the program stored on the memory, implements the method provided in the first aspect.
[0008] According to a fourth aspect of the embodiments of the present application, there is provided a computer program product, in which a computer program is stored. When the processor executes the computer program, the processor is prompted to implement the method provided in the first aspect.
[0009] According to a fifth aspect of the embodiments of the present application, there is provided a machine-readable storage medium, 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.
[0010] The data compliance security detection method based on adaptive prompt word optimization in the embodiments of the present application performs data compliance detection on the data to be detected according to a predefined rule, and determines an initial detection result of the data to be detected. In the case that the initial detection result is that the data to be detected is non-compliant, it determines the target rule hit by the data to be detected, and the target data content that is non-compliant in the data to be detected, and determines a target prompt word that matches the target rule according to the target rule. Furthermore, according to the target data content and the target prompt word, it uses a large model to perform a data compliance review and detection on the target data content, and determines a final detection result. By using the large model to review the initial detection result of the data compliance security detection, the false positive rate of the data compliance security detection can be reduced; by adaptively determining the corresponding target prompt word according to the target rule hit by the data to be detected, compared with using a fixed and unified prompt word, the accuracy of the large model review can be improved. Thus, the false positive rate of the data compliance security detection can be reduced while ensuring the accuracy of the data compliance security detection. BRIEF DESCRIPTION OF THE DRAWINGS
[0011] Figure 1 It is a schematic flowchart of a data compliance security detection method based on adaptive prompt word optimization shown in an exemplary embodiment of the present application; Figure 2Schematic diagram of a module for a data compliance and security detection solution optimized based on adaptive prompts, shown in an exemplary embodiment of the present application; Figure 3 Schematic diagram of the implementation process of a data compliance and security detection solution optimized based on adaptive prompts, shown in an exemplary embodiment of the present application; Figure 4 Schematic diagram of the structure of a data compliance and security detection device optimized based on adaptive prompts, shown in an exemplary embodiment of the present application; Figure 5 Schematic diagram of the hardware structure of an electronic device, shown in an exemplary embodiment of the present application. Detailed implementation manners
[0012] To enable those skilled in the art to better understand the technical solutions provided in the embodiments of the present application, and to make the above-mentioned objects, features, and advantages of the embodiments of the present application more obvious and understandable, the technical solutions in the embodiments of the present application will be further described in detail below with reference to the accompanying drawings.
[0013] Please refer to Figure 1 , which is a schematic diagram of the process of a data compliance and security detection method optimized based on adaptive prompts provided in an embodiment of the present application. As Figure 1 shown, the data compliance and security detection method optimized based on adaptive prompts may include the following steps: Step S100: Perform data compliance detection on the data to be detected according to predefined rules, and determine the initial detection result of the data to be detected.
[0014] Exemplarily, the data source of the data to be detected may include but is not limited to log data or transmission traffic data, etc.
[0015] Among them, the data to be detected has characteristics such as unstructured, device differentiation, and long text.
[0016] For example, taking log data as an example, for instance: 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; Device B Log: 081109 204722 567 INFO dfs.DataNode$PacketResponder:Received block blk_5402003568334525940 of size 67108864 from / 10.251.214.112; Device C Log: [2023-04-14 00:00:46.020]04-05 00:51:19.599 1143 1241 Dheop : "netStatus": "connect"; Device D Log: (2024.08.29 15:16:56.08908-29T07:17:06 ERROR otapprotocol.c:13817 method: service module: modelbuf:{"additionInfo":{"ENAuthentication":{"userType":"administrator", "userName":"123"}},"data":{"delRelatedOperatorInfoEnabled":true,"ID":1,"IDCreator":1,"sessionAuthEnabled":true,"sessionAuthInfo":{"phoneNumSessionAuthInfo":"123"}},"userID":"1","userName":"1","userNickName":"1","userScope":"1","userType":"administrator"}}).
[0017] Due to the above characteristics of the data to be detected, there will be a problem of high false alarm rate in the detection results of data compliance detection for the data to be detected according to the predefined rules.
[0018] To address this issue and reduce the false alarm rate, for the detection results determined by data compliance detection of the data to be detected according to the predefined rules (which can be called the initial detection results), a large model can be used to review the initial detection results.
[0019] Exemplarily, a large model can be used to review the initial detection results of the situation where "the data to be detected is non-compliant" (i.e., it is detected that there is non-compliant data content in the data to be detected), so as to reduce the situation where "the data to be detected is compliant" is misdetected as "the data to be detected is non-compliant".
[0020] Step S110: When the initial detection result indicates that the data to be detected is non-compliant, determine the target rule(s) hit by the data to be detected and the non-compliant target data content in the data to be detected.
[0021] Step S120: Determine the target prompt words that match the target rule(s) based on the target rule(s).
[0022] In the embodiments of the present application, in order to improve the accuracy of using a large model to perform data compliance review on the data to be detected, when the initial detection result indicates that the data to be detected is non-compliant, the prompt words (which can be referred to as target prompt words) can be adaptively determined according to the predefined rule(s) (which can be referred to as target rule(s)) hit by the data to be detected, so as to use the large model to review the initial detection result based on the target prompt words.
[0023] Exemplarily, when the initial detection result indicates that the data to be detected is non-compliant, the target rule(s) hit by the data to be detected and the non-compliant data content (which can be referred to as target data content) in the data to be detected can be determined, and the target prompt words that match the target rule(s) can be adaptively determined according to the target rule(s).
[0024] Exemplarily, in the process of performing data compliance detection on the data to be detected according to the predefined rule(s), for any data to be detected, it may hit the target rule(s) multiple times.
[0025] For each time the data to be detected hits the target rule(s), the hit target rule(s) and the corresponding target data content can be determined.
[0026] Exemplarily, for each time the data to be detected hits the target rule(s), an output result including the hit target rule(s) and the corresponding target data content can be reconstructed.
[0027] For example, the reconstructed output result may be as follows: Rule name (which can also be referred to as rule description): Weak password and common password; Hit rule: 12345678; Original content (i.e., target data content): (""'i_id': 1096, 'c_name': '12345678-channel-0', "").
[0028] Exemplarily, in the process of determining the target prompt words that match the target rule(s) according to the target rule(s), the target prompt words that match the target rule(s) can be determined according to the rule name of the target rule(s).
[0029] In one example, when the target rule is a password - related rule (such as weak passwords and common passwords, etc.), the target prompt word can be used to prompt the large - model to output that the initial detection result is correct when it determines that the target data content completely matches or does not completely match the target rule; and to output that the initial detection result is incorrect when it determines that the target data content completely does not match the target rule.
[0030] In another example, when the target rule is a sensitive - information - testing rule (such as password testing), the target prompt word can be used to prompt the large - model to output that the initial detection result is correct when it determines that there is sensitive information of a specified type (such as a password) in the target data content; and to output that the initial detection result is incorrect when it determines that there is no sensitive information of the specified type in the target data content.
[0031] Step S130: Based on the target data content and the target prompt word, use the large - model to conduct a data compliance review and detection on the target data content to determine the final detection result.
[0032] In the embodiments of the present application, when the target prompt word is determined in the above - mentioned manner and the non - compliant target data content in the data to be detected is determined, based on the target data content and the target prompt word, the large - model can be used to conduct a data compliance review and detection on the target data content to determine the final detection result.
[0033] Exemplarily, the target data content and the target prompt word can be respectively input into the large - model, so that the large - model uses the target prompt word to conduct a data compliance review and detection on the target data content and outputs the final detection result.
[0034] Exemplarily, the final detection result can include that the initial detection result is correct or the initial detection result is incorrect.
[0035] It can be seen that in Figure 1In the method flow shown, by performing data compliance detection on the data to be detected according to predefined rules, the initial detection result of the data to be detected is determined. In the case where the initial detection result indicates that the data to be detected is non-compliant, the target rule hit by the data to be detected, as well as the target data content that is non-compliant in the data to be detected, are determined. Then, according to the target rule, the target prompt word that matches the target rule is determined. Furthermore, based on the target data content and the target prompt word, using a large model, a data compliance review detection is performed 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 security detection, the false alarm rate of the data compliance security detection can be reduced; by adaptively determining the corresponding target prompt word according to the target rule hit by the data to be detected, compared with using a fixed and unified prompt word, the accuracy of the large model review can be improved. Thus, the false alarm rate of the data compliance security detection can be reduced while ensuring the accuracy of the data compliance security detection.
[0036] In some embodiments, the above-mentioned determining the target prompt word that matches the target rule according to the target rule may include: According to the target rule, query the matching relationship between the predefined rule and the prompt word, and determine the target prompt word that matches the target rule.
[0037] Exemplarily, in order to improve the determination efficiency of the target prompt word that matches the target rule, the matching relationship between the predefined rule and the prompt word may be pre-constructed.
[0038] Correspondingly, in the case where the target rule is determined, according to the target rule, query the matching relationship between the predefined rule and the prompt word, and determine the target prompt word that matches the target rule.
[0039] In one example, the matching relationship between the above-mentioned predefined rule and the prompt word may be constructed in the following manner: For any predefined rule existing in the rule library, determine the prompt word that matches the predefined rule, and store the matching relationship between the predefined rule and the prompt word.
[0040] Exemplarily, in order to improve the accuracy of the target prompt word matching and further improve the review accuracy of the large model, during the process of constructing the matching relationship between the predefined rule and the prompt word, 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.
[0041] Exemplarily, the matching relationship between the above-mentioned predefined rule and the prompt word may include the matching relationship between the rule name of the predefined rule and the prompt word.
[0042] It should be noted that in this implementation manner, for any newly added predefined rule in the rule library, a prompt word that matches the newly added predefined rule can be determined, and there is a matching relationship between the newly added predefined rule and the prompt word.
[0043] In another example, the matching relationship between the above-mentioned predefined rule and the prompt word can be constructed in the following way: Classify the existing predefined rules in the rule library; For any category of predefined rules, determine the prompt word that matches the predefined rules of this category, and store the matching relationship between the predefined rules of this category and the prompt word.
[0044] Exemplarily, 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 library, the matching prompt words can be determined according to the category.
[0045] Correspondingly, in the process of constructing the matching relationship between the predefined rule and the prompt word, the existing predefined rules in the rule library can be classified.
[0046] For example, the predefined rules in the rule library can be classified from the perspective of attributes, such as being divided into two categories: exact match and fuzzy match.
[0047] Exemplarily, for any of the above two categories, further subcategory division can be carried out.
[0048] Exemplarily, for any category of predefined rules, determine the prompt word that matches the predefined rules of this category, and store the matching relationship between the predefined rules of this category and the prompt word.
[0049] Exemplarily, in this implementation manner, in the process of determining the target prompt word that matches the target rule according to the target rule, the category of the target rule can be determined, and according to 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.
[0050] As an example, in the case where the matching relationship between the predefined rule and the prompt word is the matching relationship between different categories of predefined rules and the prompt word, it may further include: For any newly added predefined rule in the rule library, determine the target category of the predefined rule; Determine whether there is a matching relationship between the predefined rules of the target category and the prompt word; In the case where it is determined that there is no matching relationship between the predefined rules of the target category and the prompt words, determine the prompt words that match the predefined rules of the target category, and store the matching relationship between the predefined rules of the target category and the prompt words.
[0051] Exemplarily, in the case of adding a predefined rule to the rule library, the category of the newly added predefined rule (which can be referred to as the target category) can be determined, and it can be determined whether there is currently a matching relationship between the predefined rules of the target category and the prompt words.
[0052] In the case where it is determined that there is no matching relationship between the predefined rules of the target category and the prompt words, a matching relationship between the predefined rules of the target category and the prompt words can be constructed.
[0053] Exemplarily, the prompt words that match the predefined rules of the target category can be determined, and the matching relationship between the predefined rules of the target category and the prompt words can be stored.
[0054] In some embodiments, the above-mentioned data compliance review and detection of the target data content using the large model based on the target data content and the target prompt words to determine the final detection result may include: Set the system role and auxiliary information for the large model; Input the target data content and the target prompt words into the large model, so that the large model, in this system role, based on the auxiliary information and the target prompt words, conducts data compliance review and detection on the target data content to determine the final detection result.
[0055] Exemplarily, in order to further improve the accuracy of the large model in conducting data compliance review and detection, during the process of using the large model for data compliance review and detection, the system role of the large model can also be set, as well as auxiliary information (which can also be referred to as auxiliary understanding information), and then the target data content and the target prompt words are input into the large model.
[0056] The large model can, in the set system role, based on the set auxiliary information, and the input target prompt words, conduct data compliance review and detection on the input target data content to determine the final detection result.
[0057] In one example, the above-mentioned setting of the system role and auxiliary information for the large model may include: Based on the target data content and the target prompt words, determine the target system role and the target auxiliary information corresponding to the target data content and the target prompt words; Based on the target system role and the target auxiliary information, set the system role and the auxiliary information for the large model.
[0058] Exemplarily, to improve the accuracy of system role and auxiliary information settings, and further improve the review accuracy of the large model, the target to be reviewed currently can be determined based on the target data content and the target prompt, so as to set the system role and auxiliary information for the large model specifically.
[0059] Exemplarily, the system role corresponding to the target data content and the target prompt (which can be called the target system role) and the auxiliary information (which can be called the target auxiliary information) can be determined based on the target data content and the target prompt, and the system role and auxiliary information can be set for the large model based on the target system role and the target auxiliary information.
[0060] 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.
[0061] Exemplarily, the final detection result can include that the initial detection result is correct or the initial detection result is wrong.
[0062] When the final detection result is that the initial detection result is wrong, the final detection result is inconsistent with the initial detection result. In this case, the output of the large model can include not only the final detection result but also the reason why the final detection result is inconsistent with the initial detection result, so that relevant personnel can better understand the review result.
[0063] For example, taking the hit rule as "password" as an example, assuming the initial detection result is that the data to be detected includes a password; the final detection result can be that the initial detection result is wrong, and the reason output by the large model can be: the original detection is wrong, no actual password information is found in the original content, only device configuration information.
[0064] 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 will be described below in conjunction with specific examples.
[0065] In this embodiment, a data compliance and security detection solution based on adaptive prompt optimization is provided. This solution introduces a large model to verify (review) the detection result on the basis of the initial detection result determined by the method of matching predefined rules; by pre-setting the prompts that match the predefined rules, and during use, according to the rules hit by the pre-set initial detection result (i.e., the above-mentioned target rules), the prompts are adaptively selected to enhance the semantic understanding of the large model for the initial detection result and the target rules, so as to achieve effective review of the initial detection result, effectively reduce the false alarm rate of the initial detection result, and can provide an interpretable explanation for the detection result.
[0066] Please refer to Figure 2 , which is a schematic diagram of the module of the data compliance security detection scheme optimized based on adaptive prompts for this embodiment. As Figure 2 shown, the data compliance security detection scheme optimized based on adaptive prompts may include an input module, a compliance detection module, an analysis module, a prompt adaptive selection module, an analysis module based on a large model, and an output module.
[0067] Among them, the input module is used to input the data to be detected; the compliance detection module is used to perform compliance detection on the data to be detected to determine the initial detection result; the analysis module is used to analyze the initial detection result; the prompt adaptive selection module is used to adaptively select prompts, and the prompts are used for the large model to review the initial detection result; the analysis module based on the large model is used to review the initial detection result using the large model according to the selected prompts; the output module is used to output the final detection result.
[0068] Please refer to Figure 3 , which is a schematic diagram of the implementation process of the data compliance security detection scheme optimized based on adaptive prompts for this embodiment. As Figure 3 shown, the data compliance security detection scheme optimized based on adaptive prompts may include: S1. Input the data to be detected (which can also be called the original data to be detected).
[0069] Exemplarily, the data sources of the data to be detected may include but are not limited to product log data, transmission traffic data, etc.
[0070] Among them, the data to be detected has the characteristics of being unstructured, different device differentiations, and long texts.
[0071] S2. Perform data compliance detection on the data to be detected based on predefined rules.
[0072] Exemplarily, the predefined rules may include but are not limited to some or all of relevant regulations, industry standards, enterprise policies, and user business custom rules.
[0073] In one example, in the process of performing data compliance detection on the data to be detected based on predefined rules, a full - volume rule matching detection method may be used for detection.
[0074] For example, the predefined rules may include the following rules: Rule R1: password (Rule name: Password test) Rule R2: [\w - ]+@[\w - ]+(.[\w - ]+)+ (Rule name: Email address) Rule R3: 123456 (Rule Name: Weak Password) S3. Output the initial detection result and perform parsing.
[0075] Exemplarily, the initial detection result may include that the data to be detected is compliant or the data to be detected is non - compliant.
[0076] Exemplarily, when the initial detection result is that the data to be detected is non - compliant, the output result can be reconstructed and S4 is executed.
[0077] Exemplarily, reconstructing the output result may include outputting the hit rule R, that is, which rule R is violated, and the specific data content D in the data to be detected that violates rule R.
[0078] For example, the reconstructed output result may be as follows: Rule Name (which can also be called rule description): Weak Password and Common Passwords; Hit Rule: 12345678; Original Content: (""'i_id': 1096, 'c_name': '12345678 - channel - 0', """).
[0079] Another example, the reconstructed output result may also be as follows: Rule Name: Password Test; Hit Rule: password; Original Content: "{""deviceid"":""615"",""netzone id"":""0"",""password"":""wntiivmc="","}"".
[0080] S4. According to the hit rule R, adaptively select a prompt word P that matches the hit rule R.
[0081] Exemplarily, according to the rule name of the hit rule R, the matching relationship between the pre - constructed predefined rule and the prompt word (such as the matching relationship between the rule name of the predefined rule and the prompt word) can be queried to determine the matching prompt word P.
[0082] For example, assuming the hit rule is "12345678" and the rule name is "Weak Password and Common Passwords", the matching prompt word P may be as follows: "Comprehensively understand the original content. If the information in the original content has nothing to do with passwords, the detection is incorrect. If it is related to passwords, refer to the password in the "Hit Rule" and perform fuzzy information matching on the original content.
[0083] When the true value of the password in the original content does not exactly match the example in the "Hit Rule", to ensure security, the original content should be determined to be in violation of the regulations.
[0084] In summary, if a weak password or a common password is found, regardless of whether it exactly matches the hit rule, answer "The original detection is correct"; otherwise, answer "The original detection is incorrect" and briefly explain the reason. Please keep the reply concise and clear, answering in one sentence. For another example, assume the hit rule is "password" and the rule name is "Password Test", then the matching prompt word P can be as follows: The "Hit Rule" in the original content is the suspected password sequence detected. Please determine whether this string is actually used as a password. Only the sequence actually used as a password function belongs to the content in violation of the regulations.
[0085] In summary, if it is considered to contain sensitive information or exists in the form of a weak password, answer "The original detection is correct"; otherwise, answer "The original detection is incorrect" and briefly explain the reason. Please keep the reply concise and clear, answering in one sentence. S5. Set the corresponding system role and auxiliary information for the large model, and input the data content D and the prompt word P into the large model to construct the complete call content.
[0086] For example, the setting of the system role and auxiliary information can be as follows: 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 detection". Set the auxiliary information of the large model as: "The following are some results of data compliance detection. My task is: understand the 'Rule Name', with the help of the hint of the 'Hit Rule', analyze and check the 'Original Content', and judge whether there are data compliance issues described by the 'Rule Name' or the 'Hit Rule' in the original content based on my understanding of the 'Rule Name'.
[0087] Exemplarily, the data content D and the prompt word P can be input into the large model in sequence, and the large model can be used to review the data content D.
[0088] S6. Output the final detection result.
[0089] Exemplarily, the final detection result can include that the initial detection result is correct or the initial detection result is incorrect.
[0090] Exemplarily, when the final detection result is that the initial detection result is incorrect, 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.
[0091] For example, taking the rule name as "Password Test" as an example, when the final detection result is inconsistent with the initial detection result, the output reason can be "The original detection was incorrect. No actual password information was found in the original content, only device configuration information."
[0092] 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 by rechecking the detection results based on predefined rules (i.e., the initial detection results), the false alarm rate of the original detection is reduced on the basis of ensuring the accuracy; in addition, by adaptively selecting matching prompt words according to the hit rules, the semantic understanding difference between the original content and the rules is effectively solved, and the accuracy of the recheck is improved.
[0093] The method provided by this application has been described above. Next, the device provided by this application will be described: Please refer to Figure 4 , which is a schematic structural diagram of a data compliance security detection device optimized based on adaptive prompt words provided by an embodiment of this application. As Figure 4 shown, the data compliance security detection device optimized based on adaptive prompt words may include: A detection unit, configured to perform data compliance detection on the data to be detected according to predefined rules, and determine the initial detection result of the data to be detected; An analysis unit, configured to determine the target rule hit by the data to be detected and the target data content that does not comply with the rules in the data to be detected when the initial detection result indicates that the data to be detected does not comply; A determination unit, configured to determine a target prompt word that matches the target rule according to the target rule; A recheck unit, configured to perform data compliance recheck detection on the target data content by using a large model according to the target data content and the target prompt word, and determine the final detection result.
[0094] An embodiment of this application also provides an electronic device, including a processor and a memory. The memory is used to store a computer program; the processor is configured to implement the data compliance security detection method optimized based on adaptive prompt words described above when executing the program stored in the memory.
[0095] Please refer to Figure 5, which is a schematic diagram of the hardware structure of an electronic device provided by 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. And by reading and executing the machine-executable instructions corresponding to the data compliance and security detection logic optimized based on adaptive prompts in the memory 502, the processor 501 may execute the data compliance and security detection method optimized based on adaptive prompts described above.
[0096] The memory 502 mentioned in this article can be any electronic, magnetic, optical or other physical storage device that can contain or store information, such as executable instructions, data, and so on. For example, the machine-readable storage medium can be: RAM (Random Access Memory), volatile memory, non-volatile memory, flash memory, storage drives (such as hard disk drives), solid-state drives, any type of storage disk (such as optical discs, DVDs, etc.), or similar storage media, or a combination thereof.
[0097] In some embodiments, a machine-readable storage medium is also provided, such as Figure 5 the memory 502 in, which stores machine-executable instructions, and when the machine-executable instructions are executed by the processor, the data compliance and security detection method optimized based on adaptive prompts described above is implemented. For example, the machine-readable storage medium can be ROM, RAM, CD-ROM, magnetic tapes, floppy disks, and optical data storage devices, etc.
[0098] The embodiment of the present application also provides a computer program product, storing a computer program, and when the processor executes the computer program, it causes the processor to execute the data compliance and security detection method optimized based on adaptive prompts described above.
Claims
1. A data compliance and security detection method based on adaptive prompt optimization, characterized in that, Including: Performing 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; In the case where 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 target data content that is non-compliant in the data to be detected; Determining a target prompt word that matches the target rule according to the target rule; Performing data compliance review 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.
2. The method according to claim 1, characterized in that The determining a target prompt word that matches the target rule according to the target rule includes: Querying the matching relationship between the predefined rule and the prompt word according to the target rule to determine the target prompt word that matches the target rule.
3. The method according to claim 2, wherein The matching relationship between the predefined rule and the prompt word is constructed in the following manner: For any predefined rule existing in the rule library, determining the prompt word that matches the predefined rule and storing the matching relationship between the predefined rule and the prompt word; Or, Performing category division on the predefined rules existing in the rule library; For the predefined rules of any category, determining the prompt word that matches the predefined rules of the category and storing the matching relationship between the predefined rules of the category and the prompt word.
4. The method according to claim 3, wherein In the case where the matching relationship between the predefined rule and the prompt word is the matching relationship between the predefined rules of different categories and the prompt words, the method further includes: For any newly added predefined rule in the rule library, determining the target category of the predefined rule; Determining whether there is a matching relationship between the predefined rules of the target category and the prompt words; In the case where it is determined that there is no matching relationship between the predefined rules of the target category and the prompt words, determining the prompt word that matches the predefined rules of the target category and storing the matching relationship between the predefined rules of the target category and the prompt word.
5. The method according to claim 1, wherein The performing data compliance review 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 a system role and auxiliary information for the large model; Inputting the target data content and the target prompt word into the large model so that the large model, in the system role, performs data compliance review 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 setting a 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; Setting a system role and auxiliary information for the large model based on the target system role and target auxiliary information.
7. The method according to claim 1, characterized in that, In the case where 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. An data compliance security detection device based on adaptive prompt optimization, characterized in that, Including: A detection unit, configured to perform data compliance detection on data to be detected according to predefined rules, and determine an initial detection result of the data to be detected; An analysis unit, configured to, when the initial detection result indicates that the data to be detected is non-compliant, determine a target rule hit by the data to be detected, and target data content in the data to be detected that is non-compliant; A determination unit, configured to determine a target prompt word that matches the target rule according to the target rule; A review unit, configured to perform data compliance review detection on the target data content by using a large model according to the target data content and the target prompt word, and determine a final detection result.
9. An electronic device, characterized in that, It includes a processor and a memory, wherein, The memory is used to store a computer program; The processor is configured to implement the method according to any one of claims 1 to 7 when executing the program stored on the 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 the processor, the method according to any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Data quality detection method and device, electronic equipment, medium and program product
CN118916349A
Content compliance detection method and device and readable storage medium
CN119719164A
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
Method and apparatus for prompt word management, device, and storage medium
WO2025026189A1
Cited By
Visual content security detection method and device based on large model and CNN dynamic collaboration
CN120580629A