Security Protection Method and Device for LLM-based Security Protection System
Through text processing and analysis of the LLM security protection system, accurate text deletion and interception are carried out according to user needs, the problem of LLM generating inaccurate content is solved, and security protection performance and user security are improved.
Patent Information
- Application Number
- CN202510645893.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-20
- Publication Date
- 2025-08-05
- Estimated Expiration
- 2045-05-20
AI Technical Summary
The existing LLM security protection system is difficult to adapt to the diversity and complexity of its output, resulting in the generation of inaccurate or misleading content, affecting the user experience.
By obtaining the pending text set, processing and analysis is carried out based on user processing requirements parameters, including text format conversion, similarity calculation, star prediction and risk conduction analysis, we determine whether text deletion or interception is required.
Reduces errors or misleading content in the processed text, improves the security protection performance of LLM, and thus improves the security of user information viewing and use.
Smart Images

Figure CN120181065B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of information security technology, and in particular to a security protection method and device based on an LLM security protection system. Background Art
[0002] In recent years, LLM (Large Language Model) technology has achieved deep understanding and efficient processing of natural language through deep learning and big data training. This model's ability to capture the complexity and diversity of language has led to its outstanding performance in various NLP (natural language processing) tasks. However, with the widespread adoption of LLM technology, the uncertainty of its output and potential safety risks have become increasingly prominent. For example, existing safety guardrail products mostly use rule-based or template-based methods for content filtering and correction, which are difficult to adapt to the diversity and complexity of LLM output. This can easily lead to the generation of inaccurate or misleading content, impacting the user experience. Therefore, it is crucial to develop a method to improve the safety protection performance of LLM. Summary of the Invention
[0003] The present invention provides a security protection method and device based on the LLM security protection system, which reduces the erroneous or misleading content in the processed text collection, thereby improving the security protection performance of the LLM, thereby improving the user's information viewing / use security.
[0004] In order to solve the above technical problems, the first aspect of the present invention discloses a security protection method based on the LLM security protection system, the method comprising:
[0005] Obtaining a set of texts to be processed, and performing a processing operation on the set of texts to be processed according to preset user processing requirement parameters to obtain a processed set of texts; the user processing requirement parameters include at least one of a text deduplication requirement parameter, a data visualization requirement parameter, a text business requirement parameter, and a text analysis accuracy requirement parameter;
[0006] According to the processed text set, performing an analysis operation on the processed text set to obtain an analysis result of the processed text set; the analysis operation includes a star rating prediction operation and / or a risk transmission analysis operation;
[0007] According to the analysis result of the processed text set, it is determined whether a target operation needs to be performed on the processed text set. If so, the target operation is performed on the processed text set; the target operation includes a text deletion operation or a text interception operation.
[0008] As an optional embodiment, in the first aspect of the present invention, performing a processing operation on the to-be-processed text set according to preset user processing requirement parameters to obtain a processed text set includes:
[0009] Acquiring text parameters of the to-be-processed text set; the text parameters of the to-be-processed text set include at least one of a text source parameter, a text time parameter, a text type parameter, and a text content parameter of each to-be-processed text in the to-be-processed text set;
[0010] Performing a preprocessing operation on the text set to be processed according to text parameters of the text set to be processed and preset user processing requirement parameters to obtain a preprocessed text set; the preprocessing operation includes at least one of a text format conversion operation, a text format normalization operation, a text word segmentation operation, and a word vector conversion operation;
[0011] Based on the preprocessed text set and the user processing requirement parameter, performing a similarity calculation operation on each pair of preprocessed texts in the preprocessed text set to obtain similarity parameters corresponding to each pair of preprocessed texts;
[0012] According to the similarity parameters corresponding to the preprocessed texts, the preprocessed texts whose similarity parameters are less than or equal to a preset similarity threshold are screened out from the preprocessed text set as the processed text set.
[0013] As an optional embodiment, in the first aspect of the present invention, performing a similarity calculation operation on each pair of preprocessed texts in the preprocessed text set based on the preprocessed text set and the user processing requirement parameter to obtain similarity parameters corresponding to each pair of the preprocessed texts includes:
[0014] Performing a historical data inverted index operation on the preprocessed text set according to the text parameters of the preprocessed text set to obtain keywords for each preprocessed text in the preprocessed text set;
[0015] Performing a sentence-level prefix tree construction operation on each of the preprocessed texts to obtain a prefix tree for each of the preprocessed texts;
[0016] Based on the keywords and corresponding prefix trees of each preprocessed text, the feature information of each preprocessed text is determined, and based on the feature information of all the preprocessed texts, the cosine similarity parameters and / or Hamming distance parameters of each of the preprocessed texts are determined as the similarity parameters corresponding to each of the preprocessed texts; the feature information includes at least one of text vector feature information, string feature information and binary feature information.
[0017] As an optional implementation manner, in the first aspect of the present invention, performing an analysis operation on the processed text set according to the processed text set to obtain an analysis result of the processed text set includes:
[0018] Determining target information of the processed text set based on the processed text set; the target information includes at least one of text sentiment information, user interest point information, text label information, and target object attribute information;
[0019] Determining star rating prediction parameters for the processed text set based on target information of the processed text set and a preset target library; the target library includes at least one of a knowledge base, a corpus, and a vocabulary; and the star rating prediction parameters for the processed text set include basic star rating prediction parameters for each processed text;
[0020] For each processed text, determining a prediction frequency parameter that matches the processed text from historical star rating prediction data;
[0021] According to the basic star rating prediction parameters and corresponding prediction frequency parameters of all the processed texts, the target star rating prediction parameters of the processed text set are determined as the analysis result of the processed text set.
[0022] As an optional implementation manner, in the first aspect of the present invention, performing an analysis operation on the processed text set according to the processed text set to obtain an analysis result of the processed text set further includes:
[0023] Determining target entity information of the processed text set according to the processed text set; the target entity information includes entity information of each processed text and entity relationship information between all processed texts;
[0024] Constructing a knowledge graph of the processed text set according to target entity information of the processed text set;
[0025] According to the knowledge graph of the processed text set, a target risk conduction parameter of the processed text set is determined as an analysis result of the processed text set.
[0026] As an optional implementation, in the first aspect of the present invention, determining the target risk transmission parameter of the processed text set based on the knowledge graph of the processed text set includes:
[0027] Determining risk transmission type parameters and risk transmission path parameters for each processed text according to the knowledge graph of the processed text set; the risk transmission path parameters include risk source parameters, risk receptor parameters, and risk transmission direction parameters;
[0028] Determining a risk transmission parameter for each processed text based on a risk transmission type parameter and a risk transmission path parameter of each processed text; the risk transmission parameter includes at least one of a risk transmission speed parameter, a risk impact range parameter, and a loss type parameter;
[0029] According to the risk conduction parameters of all the processed texts, a target risk conduction parameter of the processed text set is determined.
[0030] As an optional implementation, in the first aspect of the present invention, judging whether a target operation needs to be performed on the processed text set based on the analysis result of the processed text set includes:
[0031] Determining target scenario information of the processed text set; the target scenario information includes viewing scenario information and / or usage scenario information;
[0032] Determining a judgment parameter threshold of the processed text set according to the target scenario information; the judgment parameter threshold includes a star rating prediction parameter threshold and / or a risk transmission parameter threshold;
[0033] Based on the target parameters of the processed text set and the judgment parameter threshold, it is determined whether the target parameter is greater than or equal to the judgment parameter threshold. If so, it is determined that a target operation needs to be performed on the processed text set; the target parameters include the target star prediction parameters of the processed text set and / or the target risk conduction parameters of the processed text set.
[0034] A second aspect of the present invention discloses a safety protection device based on the LLM safety protection system, the device comprising:
[0035] An acquisition module is used to obtain the text set to be processed;
[0036] a processing module configured to process the to-be-processed text set according to preset user processing requirement parameters to obtain a processed text set; the user processing requirement parameters comprising at least one of a text deduplication requirement parameter, a data visualization requirement parameter, a text business requirement parameter, and a text analysis accuracy requirement parameter;
[0037] An analysis module, configured to perform an analysis operation on the processed text set according to the processed text set to obtain an analysis result of the processed text set; the analysis operation includes a star rating prediction operation and / or a risk transmission analysis operation;
[0038] A judgment module, configured to judge whether a target operation needs to be performed on the processed text set according to the analysis result of the processed text set;
[0039] The target operation module is used to perform a target operation on the processed text set when the judgment result of the judgment module is yes; the target operation includes a text deletion operation or a text interception operation.
[0040] As an optional embodiment, in the second aspect of the present invention, the processing module performs a processing operation on the to-be-processed text set according to preset user processing requirement parameters to obtain the processed text set, specifically comprising:
[0041] Acquiring text parameters of the to-be-processed text set; the text parameters of the to-be-processed text set include at least one of a text source parameter, a text time parameter, a text type parameter, and a text content parameter of each to-be-processed text in the to-be-processed text set;
[0042] Performing a preprocessing operation on the text set to be processed according to text parameters of the text set to be processed and preset user processing requirement parameters to obtain a preprocessed text set; the preprocessing operation includes at least one of a text format conversion operation, a text format normalization operation, a text word segmentation operation, and a word vector conversion operation;
[0043] Based on the preprocessed text set and the user processing requirement parameter, performing a similarity calculation operation on each pair of preprocessed texts in the preprocessed text set to obtain similarity parameters corresponding to each pair of preprocessed texts;
[0044] According to the similarity parameters corresponding to the preprocessed texts, the preprocessed texts whose similarity parameters are less than or equal to a preset similarity threshold are screened out from the preprocessed text set as the processed text set.
[0045] As an optional embodiment, in the second aspect of the present invention, the processing module performs a similarity calculation operation on each pair of preprocessed texts in the preprocessed text set based on the preprocessed text set and the user processing requirement parameter, and obtains the similarity parameters corresponding to each pair of the preprocessed texts in a manner specifically including:
[0046] Performing a historical data inverted index operation on the preprocessed text set according to the text parameters of the preprocessed text set to obtain keywords for each preprocessed text in the preprocessed text set;
[0047] Performing a sentence-level prefix tree construction operation on each of the preprocessed texts to obtain a prefix tree for each of the preprocessed texts;
[0048] Based on the keywords and corresponding prefix trees of each preprocessed text, the feature information of each preprocessed text is determined, and based on the feature information of all the preprocessed texts, the cosine similarity parameters and / or Hamming distance parameters of each of the preprocessed texts are determined as the similarity parameters corresponding to each of the preprocessed texts; the feature information includes at least one of text vector feature information, string feature information and binary feature information.
[0049] As an optional implementation, in the second aspect of the present invention, the analysis module performs an analysis operation on the processed text set according to the processed text set, and a method for obtaining an analysis result of the processed text set specifically includes:
[0050] Determining target information of the processed text set based on the processed text set; the target information includes at least one of text sentiment information, user interest point information, text label information, and target object attribute information;
[0051] Determining star rating prediction parameters for the processed text set based on target information of the processed text set and a preset target library; the target library includes at least one of a knowledge base, a corpus, and a vocabulary; and the star rating prediction parameters for the processed text set include basic star rating prediction parameters for each processed text;
[0052] For each processed text, determining a prediction frequency parameter that matches the processed text from historical star rating prediction data;
[0053] According to the basic star rating prediction parameters and corresponding prediction frequency parameters of all the processed texts, the target star rating prediction parameters of the processed text set are determined as the analysis result of the processed text set.
[0054] As an optional implementation, in the second aspect of the present invention, the analysis module performs an analysis operation on the processed text set based on the processed text set to obtain the analysis result of the processed text set, which specifically further includes:
[0055] Determining target entity information of the processed text set according to the processed text set; the target entity information includes entity information of each processed text and entity relationship information between all processed texts;
[0056] Constructing a knowledge graph of the processed text set according to target entity information of the processed text set;
[0057] According to the knowledge graph of the processed text set, a target risk conduction parameter of the processed text set is determined as an analysis result of the processed text set.
[0058] As an optional implementation, in the second aspect of the present invention, the analysis module determines the target risk transmission parameter of the processed text set based on the knowledge graph of the processed text set in a manner specifically including:
[0059] Determining risk transmission type parameters and risk transmission path parameters for each processed text according to the knowledge graph of the processed text set; the risk transmission path parameters include risk source parameters, risk receptor parameters, and risk transmission direction parameters;
[0060] Determining a risk transmission parameter for each processed text based on a risk transmission type parameter and a risk transmission path parameter of each processed text; the risk transmission parameter includes at least one of a risk transmission speed parameter, a risk impact range parameter, and a loss type parameter;
[0061] According to the risk conduction parameters of all the processed texts, a target risk conduction parameter of the processed text set is determined.
[0062] As an optional implementation, in the second aspect of the present invention, the judgment module judges whether the target operation needs to be performed on the processed text set based on the analysis result of the processed text set in a manner specifically including:
[0063] Determining target scenario information of the processed text set; the target scenario information includes viewing scenario information and / or usage scenario information;
[0064] Determining a judgment parameter threshold of the processed text set according to the target scenario information; the judgment parameter threshold includes a star rating prediction parameter threshold and / or a risk transmission parameter threshold;
[0065] Based on the target parameters of the processed text set and the judgment parameter threshold, it is determined whether the target parameter is greater than or equal to the judgment parameter threshold. If so, it is determined that a target operation needs to be performed on the processed text set; the target parameters include the target star prediction parameters of the processed text set and / or the target risk conduction parameters of the processed text set.
[0066] The third aspect of the present invention discloses another safety protection device based on the LLM safety protection system, the device comprising:
[0067] a memory storing executable program code;
[0068] a processor coupled to the memory;
[0069] The processor calls the executable program code stored in the memory to execute the security protection method based on the LLM security protection system disclosed in the first aspect of the present invention.
[0070] The fourth aspect of the present invention discloses a computer storage medium, which stores computer instructions. When the computer instructions are called, they are used to execute the security protection method based on the LLM security protection system disclosed in the first aspect of the present invention.
[0071] Compared with the prior art, the embodiments of the present invention have the following beneficial effects:
[0072] In an embodiment of the present invention, a processing operation is performed on the obtained set of text to be processed based on the user processing requirement parameters to obtain a processed set of text; based on the processed set of text, the processed set of text is analyzed to obtain an analysis result of the processed set of text; based on the analysis result of the processed set of text, it is determined whether a target operation needs to be performed on the processed set of text; if so, the target operation is performed on the processed set of text. It can be seen that the implementation of the present invention can process and analyze the set of text to be processed based on the user processing requirement parameters to obtain an analysis result of the processed set of text, and delete and / or intercept the processed set of text. In this way, erroneous or misleading content in the processed set of text is reduced, thereby improving the security protection performance of the LLM, thereby improving the user's information viewing / use security. BRIEF DESCRIPTION OF THE DRAWINGS
[0073] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0074] Figure 1 This is a flow chart of a security protection method based on the LLM security protection system disclosed in an embodiment of the present invention;
[0075] Figure 2 This is a flow chart of another security protection method based on the LLM security protection system disclosed in an embodiment of the present invention;
[0076] Figure 3 This is a schematic structural diagram of a safety protection device based on the LLM safety protection system disclosed in an embodiment of the present invention;
[0077] Figure 4 This is a structural diagram of another safety protection device based on the LLM safety protection system disclosed in an embodiment of the present invention. DETAILED DESCRIPTION
[0078] In order to enable those skilled in the art to better understand the solutions of the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments of the present invention without making any creative efforts shall fall within the scope of protection of the present invention.
[0079] The terms "first," "second," and so on, in the description and claims of the present invention and the accompanying drawings are used to distinguish between different items, not to describe a specific order. Furthermore, the terms "including," "having," and any variations thereof, are intended to cover non-exclusive inclusions. For example, a process, method, apparatus, product, or end comprising a series of steps or elements is not limited to the listed steps or elements but may optionally include steps or elements not listed therein, or may optionally include other steps or elements inherent to such process, method, product, or end.
[0080] References herein to "embodiments" mean that a particular feature, structure, or characteristic described in connection with the embodiments may be included in at least one embodiment of the present invention. The appearance of this phrase in various places in the specification does not necessarily refer to the same embodiment, nor does it constitute a separate or alternative embodiment that is mutually exclusive of other embodiments. It is understood, both explicitly and implicitly, by those skilled in the art that the embodiments described herein may be combined with other embodiments.
[0081] The present invention discloses a security protection method and device based on the LLM security protection system, which reduces erroneous or misleading content in the processed text collection, thereby improving the security protection performance of the LLM, thereby improving the user's information viewing / use security.
[0082] Example 1
[0083] See also Figure 1 , Figure 1 This is a flow chart of a security protection method based on the LLM security protection system disclosed in an embodiment of the present invention. Figure 1 The described security protection method based on the LLM security protection system can be applied to the fields of software code security, public security, enterprise security, etc., and the embodiments of the present invention do not limit this. Optionally, the method can be implemented by a security protection device, which can be integrated into a security protection device (such as a smart computer), or can be a local server or cloud server for processing the LLM security protection device process, and the embodiments of the present invention do not limit this. Figure 1 As shown, the security protection method based on the LLM security protection system may include the following operations:
[0084] 101. Obtain a text set to be processed, and perform processing operations on the text set to be processed according to preset user processing requirement parameters to obtain a processed text set.
[0085] In an embodiment of the present invention, this step can be implemented by the data layer of the LLM security protection system. Furthermore, storage operations can be performed on the text set to be processed. Optionally, the user processing requirement parameters include at least one of text deduplication requirement parameters (e.g., text repetition rate), data visualization requirement parameters (e.g., whether the data charts used are 2D or 3D), text business requirement parameters, and text analysis accuracy requirement parameters.
[0086] 102. Perform an analysis operation on the processed text set according to the processed text set to obtain an analysis result of the processed text set.
[0087] In an embodiment of the present invention, this step can be implemented by the data layer of the LLM security protection system. Optionally, the analysis operation includes a star rating prediction operation (which includes sentiment analysis, keyword extraction, and other processes) and / or a risk transmission analysis operation (which includes knowledge graphing, risk transmission analysis, and other processes).
[0088] 103. According to the analysis result of the processed text set, determine whether a target operation needs to be performed on the processed text set. If so, perform the target operation on the processed text set.
[0089] In an embodiment of the present invention, this step can be implemented by the service layer and application layer of the LLM security protection system. Optionally, the target operation includes a text deletion operation or a text interception operation. Furthermore, user parameters, such as user role parameters and user permission range parameters, can be combined to determine whether the target operation needs to be performed on the processed text set.
[0090] It can be seen that the implementation of the embodiment of the present invention can process and analyze the text set to be processed based on the user processing requirement parameters, obtain the analysis results of the processed text set, and delete and / or intercept the processed text set. In this way, the erroneous or misleading content in the processed text set is reduced, thereby improving the security protection performance of LLM, thereby improving the user's information viewing / use security.
[0091] Example 2
[0092] See also Figure 2 , Figure 2 This is a flow chart of another security protection method based on the LLM security protection system disclosed in an embodiment of the present invention. Figure 2The described security protection method based on the LLM security protection system can be applied to the fields of software code security, public security, enterprise security, etc., and the embodiments of the present invention do not limit this. Optionally, the method can be implemented by a security protection device, which can be integrated into a security protection device (such as a smart computer), or can be a local server or cloud server for processing the LLM security protection device process, and the embodiments of the present invention do not limit this. Figure 2 As shown, the security protection method based on the LLM security protection system may include the following operations:
[0093] 201. Obtain a text set to be processed and obtain text parameters of the text set to be processed.
[0094] In an embodiment of the present invention, optionally, the text parameters of the to-be-processed text set include at least one of a text source parameter, a text time parameter, a text type parameter, and a text content parameter of each to-be-processed text in the to-be-processed text set.
[0095] 202. Perform a preprocessing operation on the text set to be processed according to the text parameters of the text set to be processed and preset user processing requirement parameters to obtain a preprocessed text set.
[0096] In an embodiment of the present invention, optionally, the preprocessing operation includes at least one of a text format conversion operation, a text format normalization operation, a text word segmentation operation, and a word vector conversion operation.
[0097] 203. Based on the preprocessed text set and the user processing requirement parameters, perform a similarity calculation operation on each pair of preprocessed texts in the preprocessed text set to obtain similarity parameters corresponding to each pair of preprocessed texts.
[0098] In the embodiment of the present invention, the similarity calculation operation may include a cosine similarity calculation operation and / or a Hamming distance parameter calculation operation.
[0099] 204. Based on the similarity parameters corresponding to the pairwise preprocessed texts, select from the preprocessed text set pairs of preprocessed texts whose similarity parameters are less than or equal to a preset similarity threshold value as the processed text set.
[0100] In the embodiment of the present invention, the text set to be processed is first subjected to a deduplication operation to reduce the computational complexity and meet the user's visualization requirements. In addition, the processed text set may be subjected to stop word filtering, spelling correction, and text noise reduction operations to update the processed text set.
[0101] 205. Perform an analysis operation on the processed text set according to the processed text set to obtain an analysis result of the processed text set.
[0102] 206. Based on the analysis result of the processed text set, determine whether a target operation needs to be performed on the processed text set. If so, perform the target operation on the processed text set.
[0103] In the embodiment of the present invention, for other descriptions of step 205 and step 206, please refer to the detailed description of step 102 and step 103 in embodiment 1, which will not be repeated in this embodiment of the present invention.
[0104] It can be seen that the implementation of the embodiment of the present invention can process the text set to be processed by obtaining the text parameters of the text set to be processed and combining it with the specific processing needs of the user, such as text format conversion and normalization, text deduplication, etc., to obtain a processed text set. In this way, the processing reliability and accuracy of the text set to be processed are improved, and the subsequent analysis reliability and accuracy of the processed text set are improved, which is conducive to accurate deletion and interception operations on the processed text set, and realizes the high security protection performance of the LLM security protection system.
[0105] In an optional embodiment, in step 203, based on the preprocessed text set and the user processing requirement parameter, a similarity calculation operation is performed on each pair of preprocessed texts in the preprocessed text set to obtain similarity parameters corresponding to each pair of preprocessed texts, including:
[0106] According to the text parameters of the preprocessed text set, a historical data inverted index operation is performed on the preprocessed text set to obtain keywords of each preprocessed text in the preprocessed text set;
[0107] Perform sentence-level prefix tree construction on each preprocessed text to obtain a prefix tree for each preprocessed text;
[0108] Based on the keywords and the corresponding prefix tree of each preprocessed text, the feature information of each preprocessed text is determined, and based on the feature information of all preprocessed texts, the cosine similarity parameters and / or Hamming distance parameters of the preprocessed texts are determined as the similarity parameters corresponding to the preprocessed texts.
[0109] In this optional embodiment, the feature information optionally includes at least one of text vector feature information, string feature information, and binary feature information. Furthermore, when constructing an inverted index, the weight of each keyword in the text can be calculated, such as using methods such as TF-IDF (term frequency-inverse document frequency), which helps to more accurately evaluate the importance of keywords in subsequent similarity calculations. Furthermore, in order to improve the accuracy and efficiency of text similarity calculations, algorithms such as cosine similarity and Hamming distance can be optimized. For example, an approximate nearest neighbor search algorithm (such as LSH, HNSW, etc.) can be used to accelerate the search process for similar texts.
[0110] It can be seen that this optional embodiment can realize the similarity calculation of pairwise preprocessed texts in the preprocessed text set by combining the inverted index of historical data and the prefix tree construction technology, and obtain the similarity parameters corresponding to pairwise preprocessed texts. In this way, the efficiency and accuracy of text similarity calculation can be improved, the text processing time can be shortened, and the subsequent analysis accuracy and efficiency of the processed text set can be improved, thereby providing users with more reliable and accurate text processing results.
[0111] In another optional embodiment, the step 205 of performing an analysis operation on the processed text set to obtain an analysis result of the processed text set includes:
[0112] Determining target information of the processed text set according to the processed text set;
[0113] Determine the star rating prediction parameters of the processed text set based on the target information of the processed text set and the preset target library;
[0114] For each processed text, determine the predicted frequency parameter that matches the processed text from the historical star rating prediction data;
[0115] According to the basic star rating prediction parameters of all processed texts and the corresponding prediction frequency parameters, the target star rating prediction parameters of the processed text set are determined as the analysis results of the processed text set.
[0116] In this optional embodiment, the star rating prediction parameters for the processed text set include basic star rating prediction parameters for each processed text. Optionally, the target information includes at least one of text sentiment information, user interest point information, text tag information, and target object attribute information (such as service attributes, product attributes, activity attributes, etc.). Furthermore, optionally, the target library includes at least one of a knowledge base, a corpus, and a vocabulary.
[0117] Furthermore, dynamic adjustment factors can be introduced into the star-rating prediction parameters. These dynamic adjustment factors can be adjusted in real time based on external factors such as the latest market trends, user feedback, and competitor conditions, making the star-rating prediction more realistic.
[0118] Furthermore, the determination of the prediction frequency parameters can not only rely on historical star-rating prediction data, but also be determined in combination with factors such as the popularity and timeliness of the currently processed text. For example, texts with high popularity may have higher prediction frequency parameters, while texts with longer timeliness may have lower prediction frequency parameters.
[0119] As can be seen, this optional embodiment can accurately determine the star rating prediction parameters for the processed text set by combining multiple dimensions of information about the processed text set (such as text sentiment, user points of interest, text tags, target object attributes, etc.) with a preset target library and historical star rating prediction data. Furthermore, by introducing dynamic adjustment factors and optimizing prediction frequency parameters, the star rating prediction is made more realistic, further improving the accuracy and timeliness of the star rating prediction parameters. This enhances the readability and practicality of subsequent analysis results of the processed text set, providing users with more intuitive and comprehensive analysis results.
[0120] In another optional embodiment, the step 205 of performing an analysis operation on the processed text set to obtain an analysis result of the processed text set further includes:
[0121] Determining target entity information of the processed text set according to the processed text set;
[0122] Construct a knowledge graph of the processed text set based on the target entity information of the processed text set;
[0123] According to the knowledge graph of the processed text set, the target risk conduction parameter of the processed text set is determined as the analysis result of the processed text set.
[0124] In this optional embodiment, the target entity information includes entity information of each processed text (such as a person's name, a place name, an organization name, etc.) and entity relationship information between all processed texts.
[0125] Furthermore, as an optional implementation, determining the target risk transmission parameter of the processed text set based on the knowledge graph of the processed text set includes:
[0126] Determine the risk transmission type parameters and risk transmission path parameters of each processed text based on the knowledge graph of the processed text set;
[0127] Determine the risk transmission parameters of each processed text based on the risk transmission type parameters and risk transmission path parameters of each processed text;
[0128] According to the risk conduction parameters of all processed texts, the target risk conduction parameters of the processed text set are determined.
[0129] In this optional embodiment, the risk transmission path parameters include risk source parameters, risk receptor parameters, and risk transmission direction parameters. Optionally, the risk transmission parameters include at least one of risk transmission speed parameters, risk impact range parameters, and loss type parameters.
[0130] It can be seen that this optional embodiment can realize the analysis and mining of the processed text set through the knowledge graph and risk transmission parameters of the processed text set. In this way, it not only reveals the complex relationship between entities, but also provides an intuitive and visual risk transmission path, which helps users to more clearly understand the propagation mode and impact scope of risks in the entity network, and provides users with response strategies for developing risk warning systems.
[0131] In another optional embodiment, the step 206 of determining whether a target operation needs to be performed on the processed text set based on the analysis result of the processed text set includes:
[0132] Determine target scene information of the processed text set;
[0133] Determine the judgment parameter threshold of the processed text set based on the target scenario information; the judgment parameter threshold includes a star prediction parameter threshold and / or a risk transmission parameter threshold;
[0134] According to the target parameter of the processed text set and the judgment parameter threshold, it is determined whether the target parameter is greater than or equal to the judgment parameter threshold. If so, it is determined that the target operation needs to be performed on the processed text set.
[0135] In this optional embodiment, the target scenario information optionally includes viewing scenario information and / or usage scenario information, such as a review scenario, a fact-checking scenario, a user monitoring scenario, etc. Further optionally, the target parameter includes a target star rating prediction parameter for the processed text set and / or a target risk transmission parameter for the processed text set.
[0136] It can be seen that this optional embodiment can achieve more accurate and flexible risk judgment and management of the processed text set by introducing dynamic adjustment of judgment parameter thresholds, user feedback mechanism and diversified target operation methods, so that the text processing results are more in line with the actual needs of users, thereby effectively reducing the potential losses caused by text risks, thereby enhancing the practical value and competitiveness of the LLM security protection system in areas such as risk management and decision support.
[0137] Example 3
[0138] See also Figure 3 , Figure 3 This is a schematic diagram of the structure of a safety protection device based on the LLM safety protection system disclosed in an embodiment of the present invention. Figure 3 As shown, the safety protection device based on the LLM safety protection system may include:
[0139] An acquisition module 301 is used to acquire a text set to be processed;
[0140] The processing module 302 is used to process the text set to be processed according to preset user processing requirement parameters to obtain a processed text set;
[0141] An analysis module 303 is configured to perform an analysis operation on the processed text set according to the processed text set to obtain an analysis result of the processed text set;
[0142] A judgment module 304 is used to judge whether a target operation needs to be performed on the processed text set based on the analysis result of the processed text set;
[0143] The target operation module 305 is used to perform a target operation on the processed text set when the judgment result of the judgment module 304 is yes; the target operation includes a text deletion operation or a text interception operation.
[0144] In an embodiment of the present invention, user processing requirement parameters include at least one of text deduplication requirement parameters, data visualization requirement parameters, text business requirement parameters, and text analysis accuracy requirement parameters; the analysis operation includes a star-rating prediction operation and / or a risk transmission analysis operation.
[0145] It can be seen that implementation Figure 3 The described security protection device based on the LLM security protection system can process and analyze the text set to be processed based on the user processing requirement parameters, obtain the analysis results of the processed text set, and delete and / or intercept the processed text set. In this way, the erroneous or misleading content in the processed text set is reduced, thereby improving the security protection performance of the LLM, thereby improving the user's information viewing / use security.
[0146] In an optional embodiment, the processing module 302 performs processing operations on the to-be-processed text set according to preset user processing requirement parameters to obtain the processed text set in the following manner:
[0147] Get the text parameters of the text set to be processed;
[0148] According to the text parameters of the to-be-processed text set and the preset user processing requirement parameters, the to-be-processed text set is preprocessed to obtain a preprocessed text set;
[0149] Based on the preprocessed text set and the user processing requirement parameters, a similarity calculation operation is performed on each pair of preprocessed texts in the preprocessed text set to obtain similarity parameters corresponding to each pair of preprocessed texts;
[0150] According to the similarity parameters corresponding to the pairwise preprocessed texts, the pairwise preprocessed texts whose similarity parameters are less than or equal to a preset similarity threshold are screened out from the preprocessed text set as the processed text set.
[0151] In this optional embodiment, the text parameters of the text set to be processed include at least one of the text source parameters, text time parameters, text type parameters and text content parameters of each text to be processed in the text set to be processed; the preprocessing operation includes at least one of the text format conversion operation, text format normalization operation, text word segmentation operation and word vector conversion operation.
[0152] It can be seen that implementation Figure 3 The described security protection device based on the LLM security protection system can process the text set to be processed by obtaining the text parameters of the text set to be processed and combining it with the user's specific processing needs, such as text format conversion and normalization, text deduplication, etc., to obtain a processed text set. In this way, the processing reliability and accuracy of the text set to be processed are improved, and the subsequent analysis reliability and accuracy of the processed text set are improved, which is conducive to the accurate deletion and interception operations of the processed text set, and realizes the high security protection performance of the LLM security protection system.
[0153] In another optional embodiment, the processing module 302 performs a similarity calculation operation on each pair of preprocessed texts in the preprocessed text set according to the preprocessed text set and the user processing requirement parameter, and obtains the similarity parameters corresponding to each pair of preprocessed texts in a manner specifically including:
[0154] According to the text parameters of the preprocessed text set, a historical data inverted index operation is performed on the preprocessed text set to obtain keywords of each preprocessed text in the preprocessed text set;
[0155] Perform sentence-level prefix tree construction on each preprocessed text to obtain a prefix tree for each preprocessed text;
[0156] Based on the keywords and the corresponding prefix tree of each preprocessed text, the feature information of each preprocessed text is determined, and based on the feature information of all preprocessed texts, the cosine similarity parameters and / or Hamming distance parameters of the preprocessed texts are determined as the similarity parameters corresponding to the preprocessed texts.
[0157] In this optional embodiment, the feature information includes at least one of text vector feature information, character string feature information, and binary feature information.
[0158] It can be seen that implementation Figure 3The described security protection device based on the LLM security protection system can realize the similarity calculation of pairwise preprocessed texts in the preprocessed text set by combining the inverted index of historical data and the prefix tree construction technology, and obtain the similarity parameters corresponding to the pairwise preprocessed texts. In this way, the efficiency and accuracy of text similarity calculation can be improved, the text processing time can be shortened, and the subsequent analysis accuracy and efficiency of the processed text set can be improved, thereby providing users with more reliable and accurate text processing results.
[0159] In another optional embodiment, the analysis module 303 performs an analysis operation on the processed text set according to the processed text set, and obtains the analysis result of the processed text set in a manner specifically including:
[0160] Determining target information of the processed text set according to the processed text set;
[0161] Determine the star rating prediction parameters of the processed text set based on the target information of the processed text set and the preset target library;
[0162] For each processed text, determine the predicted frequency parameter that matches the processed text from the historical star rating prediction data;
[0163] According to the basic star rating prediction parameters of all processed texts and the corresponding prediction frequency parameters, the target star rating prediction parameters of the processed text set are determined as the analysis results of the processed text set.
[0164] In this optional embodiment, the target information includes at least one of text sentiment tendency information, user interest point information, text label information and target object attribute information; the target library includes at least one of a knowledge base, a corpus and a vocabulary library, and the star prediction parameters of the processed text set include the basic star prediction parameters of each processed text.
[0165] It can be seen that implementation Figure 3 The described security protection device, based on the LLM security protection system, accurately determines the star rating prediction parameters for the processed text set by combining multiple dimensions of information from the processed text set (such as text sentiment, user points of interest, text tags, and target object attributes), with a preset target library and historical star rating prediction data. Furthermore, by introducing dynamic adjustment factors and optimizing prediction frequency parameters, the star rating prediction is made more realistic, further improving the accuracy and timeliness of star rating prediction parameters. This enhances the readability and practicality of subsequent analysis results of the processed text set, providing users with more intuitive and comprehensive analysis results.
[0166] In another optional embodiment, the analysis module 303 performs an analysis operation on the processed text set according to the processed text set to obtain the analysis result of the processed text set, which specifically includes:
[0167] Determining target entity information of the processed text set according to the processed text set;
[0168] Construct a knowledge graph of the processed text set based on the target entity information of the processed text set;
[0169] According to the knowledge graph of the processed text set, the target risk conduction parameter of the processed text set is determined as the analysis result of the processed text set.
[0170] In this optional embodiment, the target entity information includes entity information of each processed text and entity relationship information between all processed texts.
[0171] Furthermore, as an optional implementation, the analysis module 303 determines the target risk transmission parameter of the processed text set according to the knowledge graph of the processed text set in the following manner:
[0172] Determine the risk transmission type parameters and risk transmission path parameters of each processed text based on the knowledge graph of the processed text set;
[0173] Determine the risk transmission parameters of each processed text based on the risk transmission type parameters and risk transmission path parameters of each processed text;
[0174] According to the risk conduction parameters of all processed texts, the target risk conduction parameters of the processed text set are determined.
[0175] In this optional embodiment, the risk transmission path parameters include risk source parameters, risk receptor parameters, and risk transmission direction parameters; the risk transmission parameters include at least one of risk transmission speed parameters, risk impact range parameters, and loss type parameters.
[0176] It can be seen that implementation Figure 3 The described security protection device based on the LLM security protection system can analyze and mine the processed text set through the knowledge graph and risk transmission parameters of the processed text set. In this way, it not only reveals the complex relationship between entities, but also provides an intuitive and visual risk transmission path, which helps users to more clearly understand the propagation mode and impact scope of risks in the entity network, and provides users with response strategies for developing risk warning systems.
[0177] In another optional embodiment, the determination module 304 determines whether a target operation needs to be performed on the processed text set based on the analysis result of the processed text set by:
[0178] Determine target scene information of the processed text set;
[0179] Determine the judgment parameter threshold of the processed text set based on the target scenario information; the judgment parameter threshold includes a star prediction parameter threshold and / or a risk transmission parameter threshold;
[0180] According to the target parameter of the processed text set and the judgment parameter threshold, it is determined whether the target parameter is greater than or equal to the judgment parameter threshold. If so, it is determined that the target operation needs to be performed on the processed text set.
[0181] In this optional embodiment, the target scenario information includes viewing scenario information and / or usage scenario information; the target parameters include target star rating prediction parameters of the processed text set and / or target risk conduction parameters of the processed text set.
[0182] It can be seen that implementation Figure 3 The described security protection device based on the LLM security protection system can achieve more accurate and flexible risk judgment and management of the processed text set by introducing dynamic adjustment of judgment parameter thresholds, user feedback mechanism and diversified target operation methods, so that the text processing results are more in line with the actual needs of users, thereby effectively reducing the potential losses caused by text risks, thereby enhancing the practical value and competitiveness of the LLM security protection system in areas such as risk management and decision support.
[0183] Example 4
[0184] See also Figure 4 , Figure 4 This is a schematic diagram of the structure of another safety protection device based on the LLM safety protection system disclosed in an embodiment of the present invention. Figure 4 As shown, the safety protection device based on the LLM safety protection system may include:
[0185] A memory 401 storing executable program code;
[0186] a processor 402 coupled to the memory 401;
[0187] The processor 402 calls the executable program code stored in the memory 401 to execute the steps of the security protection method based on the LLM security protection system described in the first embodiment of the present invention or the second embodiment of the present invention.
[0188] Example 5
[0189] An embodiment of the present invention discloses a computer storage medium, which stores computer instructions. When the computer instructions are called, they are used to execute the steps of the security protection method based on the LLM security protection system described in Example 1 or Example 2 of the present invention.
[0190] Example 6
[0191] An embodiment of the present invention discloses a computer program product, which includes a non-transitory computer-readable storage medium storing a computer program, and the computer program is operable to enable a computer to execute the steps of the security protection method based on the LLM security protection system described in Example 1 or Example 2.
[0192] The device embodiments described above are merely illustrative, wherein the modules described as separate components may or may not be physically separate, and the components shown as modules may or may not be physical modules, i.e., they may be located in one place or distributed across multiple network modules. Some or all of the modules may be selected based on actual needs to achieve the objectives of the present embodiment. Those skilled in the art can understand and implement the present invention without inventive effort.
[0193] Through the detailed description of the above embodiments, those skilled in the art will clearly understand that each embodiment can be implemented by means of software plus a necessary general hardware platform, or of course, by means of hardware. Based on this understanding, the above technical solution, in essence, or the portion that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as a read-only memory (ROM), a random access memory (RAM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), a one-time programmable read-only memory (OTPROM), an electronically erasable programmable read-only memory (EEPROM), a compact disc read-only memory (CD-ROM), or other optical disk storage, magnetic disk storage, magnetic tape storage, or any other computer-readable medium capable of carrying or storing data.
[0194] Finally, it should be noted that the security protection method and device based on the LLM security protection system disclosed in the embodiment of the present invention are only preferred embodiments of the present invention, and are only used to illustrate the technical solution of the present invention, rather than to limit it. Although the present invention has been described in detail with reference to the aforementioned embodiments, ordinary technicians in this field should understand that it is still possible to modify the technical solutions recorded in the aforementioned embodiments, or to make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the various embodiments of the present invention.
Claims
1. A security protection method based on the LLM security protection system, characterized in that: The method comprises: Obtaining a set of texts to be processed, and performing a processing operation on the set of texts to be processed according to preset user processing requirement parameters to obtain a processed set of texts; the user processing requirement parameters include at least one of a text deduplication requirement parameter, a data visualization requirement parameter, a text business requirement parameter, and a text analysis accuracy requirement parameter; According to the processed text set, performing an analysis operation on the processed text set to obtain an analysis result of the processed text set; the analysis operation includes a star rating prediction operation and / or a risk transmission analysis operation; According to the analysis result of the processed text set, determining whether a target operation needs to be performed on the processed text set, and if so, performing the target operation on the processed text set; the target operation includes a text deletion operation or a text interception operation; The processing operation is performed on the to-be-processed text set according to preset user processing requirement parameters to obtain a processed text set, including: Obtaining text parameters of the text set to be processed; Performing a preprocessing operation on the text set to be processed according to the text parameters of the text set to be processed and preset user processing requirement parameters to obtain a preprocessed text set; Performing a historical data inverted index operation on the preprocessed text set according to the text parameters of the preprocessed text set to obtain keywords for each preprocessed text in the preprocessed text set; Performing a sentence-level prefix tree construction operation on each of the preprocessed texts to obtain a prefix tree for each of the preprocessed texts; Determining feature information of each preprocessed text based on the keywords and the corresponding prefix tree of each preprocessed text, and determining a cosine similarity parameter and / or a Hamming distance parameter of each pair of preprocessed texts based on the feature information of all preprocessed texts as a similarity parameter corresponding to each pair of preprocessed texts; the feature information includes at least one of text vector feature information, string feature information, and binary feature information; According to the similarity parameters corresponding to the preprocessed texts, the preprocessed texts whose similarity parameters are less than or equal to a preset similarity threshold are screened out from the preprocessed text set as the processed text set.
2. The security protection method based on the LLM security protection system according to claim 1 is characterized in that: The text parameters of the to-be-processed text set include at least one of a text source parameter, a text time parameter, a text type parameter, and a text content parameter of each to-be-processed text in the to-be-processed text set; The preprocessing operation includes at least one of a text format conversion operation, a text format normalization operation, a text word segmentation operation, and a word vector conversion operation.
3. The security protection method based on the LLM security protection system according to claim 1 or 2, characterized in that: The step of performing an analysis operation on the processed text set according to the processed text set to obtain an analysis result of the processed text set includes: Determining target information of the processed text set based on the processed text set; the target information includes at least one of text sentiment information, user interest point information, text label information, and target object attribute information; Determining star rating prediction parameters for the processed text set based on target information of the processed text set and a preset target library; the target library includes at least one of a knowledge base, a corpus, and a vocabulary; and the star rating prediction parameters for the processed text set include basic star rating prediction parameters for each processed text; For each processed text, determining a prediction frequency parameter that matches the processed text from historical star rating prediction data; According to the basic star rating prediction parameters and corresponding prediction frequency parameters of all the processed texts, the target star rating prediction parameters of the processed text set are determined as the analysis result of the processed text set.
4. The security protection method based on the LLM security protection system according to claim 3 is characterized in that: The step of performing an analysis operation on the processed text set according to the processed text set to obtain an analysis result of the processed text set further includes: Determining target entity information of the processed text set according to the processed text set; the target entity information includes entity information of each processed text and entity relationship information between all processed texts; Constructing a knowledge graph of the processed text set according to target entity information of the processed text set; According to the knowledge graph of the processed text set, a target risk conduction parameter of the processed text set is determined as an analysis result of the processed text set.
5. The security protection method based on the LLM security protection system according to claim 4 is characterized in that: Determining a target risk transmission parameter of the processed text set based on the knowledge graph of the processed text set includes: Determining risk transmission type parameters and risk transmission path parameters for each processed text according to the knowledge graph of the processed text set; the risk transmission path parameters include risk source parameters, risk receptor parameters, and risk transmission direction parameters; Determining a risk transmission parameter for each processed text based on a risk transmission type parameter and a risk transmission path parameter of each processed text; the risk transmission parameter includes at least one of a risk transmission speed parameter, a risk impact range parameter, and a loss type parameter; According to the risk conduction parameters of all the processed texts, a target risk conduction parameter of the processed text set is determined.
6. The security protection method based on the LLM security protection system according to claim 5, characterized in that: The step of determining whether a target operation needs to be performed on the processed text set based on the analysis result of the processed text set includes: Determining target scenario information of the processed text set; the target scenario information includes viewing scenario information and / or usage scenario information; Determining a judgment parameter threshold of the processed text set according to the target scenario information; the judgment parameter threshold includes a star rating prediction parameter threshold and / or a risk transmission parameter threshold; Based on the target parameters of the processed text set and the judgment parameter threshold, it is determined whether the target parameter is greater than or equal to the judgment parameter threshold. If so, it is determined that a target operation needs to be performed on the processed text set; the target parameters include the target star prediction parameters of the processed text set and / or the target risk conduction parameters of the processed text set.
7. A safety protection device based on the LLM safety protection system, characterized in that: The device is used to execute the security protection method based on the LLM security protection system according to any one of claims 1 to 6, and the device includes: An acquisition module is used to obtain the text set to be processed; a processing module configured to process the to-be-processed text set according to preset user processing requirement parameters to obtain a processed text set; the user processing requirement parameters comprising at least one of a text deduplication requirement parameter, a data visualization requirement parameter, a text business requirement parameter, and a text analysis accuracy requirement parameter; An analysis module, configured to perform an analysis operation on the processed text set according to the processed text set to obtain an analysis result of the processed text set; the analysis operation includes a star rating prediction operation and / or a risk transmission analysis operation; A judgment module, configured to judge whether a target operation needs to be performed on the processed text set according to the analysis result of the processed text set; The target operation module is used to perform a target operation on the processed text set when the judgment result of the judgment module is yes; the target operation includes a text deletion operation or a text interception operation.
8. A safety protection device based on the LLM safety protection system, characterized in that: The device comprises: a memory storing executable program code; a processor coupled to the memory; The processor calls the executable program code stored in the memory to execute the security protection method based on the LLM security protection system as described in any one of claims 1-6.
9. A computer storage medium, characterized in that The computer storage medium stores computer instructions, which, when called, are used to execute the security protection method based on the LLM security protection system as described in any one of claims 1 to 6.
Citation Information
Patent Citations
LLM-driven adaptive industrial network security protection method and firewall device
CN118138362A