Data processing method and apparatus

By intercepting and analyzing the feature data of user request text to generate a security evaluation score and determine the processing method, the problem of sensitive content leakage in large language models is solved, and the security of data processing is improved.

CN122365580APending Publication Date: 2026-07-10QILIN HESHENG NETWORK TECH INC
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
QILIN HESHENG NETWORK TECH INC
Filing Date
2026-05-09
Publication Date
2026-07-10

Smart Images

  • Figure CN122365580A_ABST
    Figure CN122365580A_ABST
Patent Text Reader

Abstract

This disclosure provides a data processing method and apparatus. The method includes: intercepting a current request text sent by a user terminal to a remote first large model; determining at least one of the following feature data: the frequency of occurrence of preset sensitive words in the current request text, the semantic information of the current request text, and historical request texts corresponding to the current request text; generating a security evaluation score for the current request text based on the determined feature data; determining and executing a processing method for the current request text based on the security evaluation score and a preset score threshold; the processing method includes one of the following: allowing the current request text to be sent to the first large model; desensitizing the current request text and then allowing the desensitized current request text to be sent to the first large model; terminating the sending of the current request text to the first large model and forwarding the current request text to a local second large model. This embodiment can reduce the risk of sensitive content leakage and improve data processing security.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This document relates to the field of artificial intelligence, and in particular to a data processing method and apparatus. Background Technology

[0002] With the rapid development of artificial intelligence technology, the application of large language models is becoming increasingly widespread. A large language model is an artificial intelligence model based on deep learning technology, with a large number of parameters, capable of processing and generating natural language text.

[0003] In related technologies, a large language model receives request text sent by a user terminal, generates response text based on the request text, and returns it to the user terminal. In practical applications, the request text may contain sensitive content, posing a risk of sensitive content leakage during the large language model's processing. Therefore, how to reduce the risk of sensitive content leakage and improve data processing security is a pressing technical problem that needs to be solved. Summary of the Invention

[0004] The purpose of this disclosure is to provide a data processing method and apparatus to address the problem of how to reduce the risk of leakage of sensitive content and improve the security of data processing.

[0005] To solve the above-mentioned technical problems, the embodiments in this specification are implemented as follows: In a first aspect, embodiments of this disclosure provide a data processing method, including: Intercept the current request text of the first major model sent by the user terminal to the remote end, and determine at least one of the following feature data: the number of times preset sensitive words appear in the current request text, the semantic information of the current request text, and the historical request text corresponding to the current request text; Based on the determined feature data, a security evaluation score is generated for the current request text; the security evaluation score is used to characterize the likelihood that the current request text contains sensitive content. Based on the security evaluation score and the preset score threshold, the processing method for the current request text is determined and executed; wherein, the processing method includes one of the following: allowing the current request text to be sent to the first large model; performing desensitization processing on the current request text, and then allowing the desensitized current request text to be sent to the first large model; terminating the sending of the current request text to the first large model, and forwarding the current request text to the second large model, wherein the second large model is deployed locally on the user terminal, or deployed on an intranet server in the same local area network as the user terminal.

[0006] In a second aspect, embodiments of this disclosure provide a data processing apparatus, including: The data determination unit is used to intercept the current request text of the first large model sent by the user terminal to the remote end, and determine at least one of the following feature data: the number of times preset sensitive words appear in the current request text, the semantic information of the current request text, and the historical request text corresponding to the current request text; A score generation unit is used to generate a security evaluation score for the current request text based on the determined feature data; the security evaluation score is used to characterize the probability that the current request text contains sensitive content. The text processing unit is used to determine and execute the processing method of the current request text based on the security evaluation score and a preset score threshold; wherein the processing method includes one of the following: allowing the current request text to be sent to the first large model; performing desensitization processing on the current request text, and then allowing the desensitized current request text to be sent to the first large model; terminating the sending of the current request text to the first large model, and forwarding the current request text to the second large model, wherein the second large model is deployed locally on the user terminal, or deployed on an intranet server located on the same local area network as the user terminal.

[0007] Thirdly, embodiments of this disclosure provide an electronic device, including: a memory, a processor, and computer-executable instructions stored in the memory and executable on the processor, wherein the computer-executable instructions, when executed by the processor, implement the steps of the data processing method as described in the first aspect above.

[0008] Fourthly, embodiments of this disclosure provide a computer-readable storage medium for storing computer-executable instructions that, when executed by a processor, implement the steps of the data processing method described in the first aspect above.

[0009] Fifthly, embodiments of this disclosure provide a computer program product, the computer program product including a computer program, which, when executed by a processor, implements the steps of the data processing method described in the first aspect.

[0010] In one or more embodiments of this disclosure, firstly, the current request text sent by the user terminal to the first large model at the remote end is intercepted, and at least one of the following feature data is determined: the number of times preset sensitive words appear in the current request text, the semantic information of the current request text, and the historical request text corresponding to the current request text; then, based on the determined feature data, a security evaluation score for the current request text is generated; the security evaluation score is used to characterize the probability that the current request text contains sensitive content; finally, based on the security evaluation score and a preset score threshold, the processing method for the current request text is determined and executed; wherein, the processing method includes one of the following: allowing the current request text to be sent to the first large model; performing desensitization processing on the current request text, and then allowing the desensitized current request text to be sent to the first large model; terminating the sending of the current request text to the first large model, and forwarding the current request text to the second large model, the second large model being deployed locally on the user terminal, or deployed on an intranet server in the same local area network as the user terminal. As can be seen, through the embodiments of this disclosure, on the one hand, by fully utilizing the occurrence frequency of preset sensitive words in the current request text, the semantic information of the current request text, and one or more of the historical request texts corresponding to the current request text to generate a security evaluation score, the probability of the current request text containing sensitive content is accurately quantified, providing a reliable basis for subsequent differentiated processing; on the other hand, based on the security evaluation score and preset score threshold, differentiated processing methods, including allowing access to the first major model, desensitizing before allowing access, and terminating access and forwarding to the second major model, can be dynamically adapted. Moreover, since the second major model is deployed on the user terminal's local machine or an intranet server, from the perspective of the overall processing flow of the current request text, the risk of sensitive content leakage can be effectively reduced, and the security of data processing can be improved. Attached Figure Description

[0011] To more clearly illustrate the technical solutions in one or more embodiments of this specification, the accompanying drawings used in the description of the embodiments or prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in this specification. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0012] Figure 1 A flowchart illustrating a data processing method provided in an embodiment of this disclosure; Figure 2 This is a schematic diagram of the structure of a data processing system provided in an embodiment of the present disclosure; Figure 3 This is a schematic diagram of the structure of a data processing apparatus provided in an embodiment of the present disclosure; Figure 4 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this disclosure. Detailed Implementation

[0013] To enable those skilled in the art to better understand the technical solutions in one or more embodiments of this specification, the technical solutions in one or more embodiments of this specification will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this specification, and not all of the embodiments. Based on one or more embodiments of this specification, all other embodiments obtained by those skilled in the art without creative effort should fall within the protection scope of this document.

[0014] Figure 1 This is a flowchart illustrating a data processing method provided in an embodiment of the present disclosure.

[0015] The data processing method provided in this disclosure can be applied to a server, gateway, or user terminal, and can also be applied to other electronic devices not listed here. The following description uses a server as the executing entity for the data processing method; other electronic devices are similar to the server and will not be described further.

[0016] Step S102: Intercept the current request text of the first large model sent by the user terminal to the remote end, and determine at least one of the following feature data: the number of times preset sensitive words appear in the current request text, the semantic information of the current request text, and the historical request text corresponding to the current request text.

[0017] Step S104: Based on the determined feature data, generate a security evaluation score for the current request text; the security evaluation score is used to characterize the likelihood that the current request text contains sensitive content.

[0018] Step S106: Based on the security evaluation score and the preset score threshold, determine and execute the processing method for the current request text; wherein, the processing method includes the following: allow the current request text to be sent to the first major model; perform desensitization processing on the current request text, and then allow the desensitized current request text to be sent to the first major model; terminate the sending of the current request text to the first major model, and forward the current request text to the second major model, the second major model being deployed locally on the user terminal, or deployed on an intranet server in the same local area network as the user terminal.

[0019] In this embodiment, firstly, the current request text sent by the user terminal to the first large model at the remote end is intercepted, and at least one of the following feature data is determined: the number of times preset sensitive words appear in the current request text, the semantic information of the current request text, and the historical request text corresponding to the current request text; then, based on the determined feature data, a security evaluation score for the current request text is generated; the security evaluation score is used to characterize the probability that the current request text contains sensitive content; finally, based on the security evaluation score and a preset score threshold, the processing method for the current request text is determined and executed; wherein, the processing method includes one of the following: allowing the current request text to be sent to the first large model; performing desensitization processing on the current request text, and then allowing the desensitized current request text to be sent to the first large model; terminating the sending of the current request text to the first large model, and forwarding the current request text to the second large model, the second large model being deployed locally on the user terminal, or deployed on an intranet server in the same local area network as the user terminal. As can be seen, through the embodiments of this disclosure, on the one hand, by fully utilizing the occurrence frequency of preset sensitive words in the current request text, the semantic information of the current request text, and one or more of the historical request texts corresponding to the current request text to generate a security evaluation score, the probability of the current request text containing sensitive content is accurately quantified, providing a reliable basis for subsequent differentiated processing; on the other hand, based on the security evaluation score and preset score threshold, differentiated processing methods, including allowing access to the first major model, desensitizing before allowing access, and terminating access and forwarding to the second major model, can be dynamically adapted. Moreover, since the second major model is deployed on the user terminal's local machine or an intranet server, from the perspective of the overall processing flow of the current request text, the risk of sensitive content leakage can be effectively reduced, and the security of data processing can be improved.

[0020] In step S102 above, the server intercepts the current request text sent by the user terminal to the remote first large model. The first large model can be a large language model with text processing capabilities. This first large model can be deployed on a public cloud server or on other remote network devices that provide large model services. The current request text can be any interactive text presented in natural language, representing the user's current interaction request to the large language model.

[0021] In step S102 above, at least one of the following feature data is determined: the number of times preset sensitive words appear in the current request text, the semantic information of the current request text, and the historical request text corresponding to the current request text. The preset sensitive words can be freely set according to specific scenarios; for example, preset sensitive words include: salary, key, etc.

[0022] To determine the frequency of occurrence of preset sensitive words in the current request text, the following steps can be taken: input the current request text into a NER (Named Entity Recognition) model for named entity recognition processing to obtain the entities in the current request text; match the entities with preset sensitive words, and count the frequency of occurrence of preset sensitive words in the current request text based on the matching results.

[0023] Named entity recognition refers to the semantic parsing of text content to automatically identify and segment proprietary entities with specific practical meanings in the text, including personal names, place names, organization names, time information, and business-specific entities.

[0024] Another way to determine the frequency of occurrence of preset sensitive words in the current request text is to: build a regular expression library based on the preset sensitive words and corresponding matching rules; match the current request text with the regular expression library to obtain the number of times the current request text hits the preset sensitive words, and determine the number of hits as the frequency of occurrence.

[0025] Determining the frequency of occurrence of preset sensitive words in the current request text can also be done as follows: Input the current request text into a NER (Named Entity Recognition) model for named entity recognition processing to obtain the entities in the current request text; build a regular expression library based on the preset sensitive words and corresponding matching rules; match the entities in the current request text with the regular expression library to obtain the number of times the entity matches the preset sensitive words, and determine the number of matches as the frequency of occurrence.

[0026] Determining the semantic information of the current request text can be achieved by encoding the current request text to obtain a first vector, which represents the semantic information of the current request text.

[0027] Determining the semantic information of the current request text can also be achieved by performing named entity recognition processing on the current request text to obtain the entities in the text, and then aggregating the semantic information of the current request text based on these entities.

[0028] Determining the historical request text corresponding to the current request text can be done by: querying the corresponding dialogue text based on the dialogue identifier of the current request text, and identifying at least one request text in the dialogue text whose publication time is earlier than the current request text as the historical request text corresponding to the current request text. The dialogue text includes one or more request texts and response texts generated by the large language model based on each request text.

[0029] For example, in the same dialogue, if a user interacts with a large language model N times, the dialogue text includes N request texts and the response text generated by the large language model based on each request text. The current request text is the Nth request text issued by the user, and the 1st to (N-1th)th request texts issued by the user are identified as the historical request texts corresponding to the current request text. N is an integer greater than 1.

[0030] Determining the historical request text corresponding to the current request text can also be done as follows: Based on the dialogue identifier of the current request text, query the dialogue text corresponding to the current request text; filter the dialogue text based on the speaker and publication time of the current request text to obtain the historical speech texts of the same speaker as the current request text; and select the text from the historical speech texts used to initiate interaction requests to the large language model as the historical request text corresponding to the current request text. The dialogue text includes the speech texts of multiple speakers and the response text of the large language model to some of the speech texts.

[0031] For example, in the same dialogue, multiple users and an intelligent assistant supported by a large language model participate in the exchange. Users can converse with other users or with the intelligent assistant. The dialogue text then includes the spoken texts of multiple users and the intelligent assistant's response text to some of these spoken texts. The current request text is a request text issued by a user: "Intelligent assistant, please help me look up XXX." The texts from each of that user's historical spoken texts used to initiate interaction requests to the intelligent assistant are used as the historical request texts corresponding to the current request text.

[0032] In step S104 above, a security evaluation score is generated for the current request text based on the determined feature data; the security evaluation score is used to characterize the likelihood that the current request text contains sensitive content.

[0033] For example, a security evaluation score can be a credibility score: the higher the credibility score, the less likely the current request text contains sensitive content; conversely, the lower the credibility score, the more likely the current request text contains sensitive content.

[0034] In one embodiment, the determined feature data includes the number of occurrences of preset sensitive words in the current request text; based on the determined feature data, a security evaluation score for the current request text is generated, including: counting the number of lexical units in the current request text to obtain the total number of lexical units in the current request text; calculating the word frequency statistics index of the preset sensitive words based on the total number of lexical units and the number of occurrences of preset sensitive words in the current request text; and generating a security evaluation score for the current request text based on the word frequency statistics index.

[0035] To count the number of tokens in the current request text and obtain the total number of tokens in the current request text, the following steps can be taken: Segment the current request text using a text segmentation tool to obtain multiple tokens (words), and then count the number of tokens to obtain the total number of tokens in the current request text.

[0036] In one example, the word frequency statistics of the preset sensitive words are calculated based on the total number of lexical units and the number of times the preset sensitive words appear in the current request text. The formula can be used as follows: (1) Where f(Rules) represents the frequency statistics of preset sensitive words, Count(Hit_Sensitives) represents the number of times preset sensitive words appear in the current request text, and Total_Tokens represents the total number of tokens in the current request text.

[0037] In another example, the frequency statistics of the preset sensitive words are calculated based on the total number of lexical units and the number of times the preset sensitive words appear in the current request text. The formula can be used as follows: (2) Where f(Rules) represents the frequency statistics of preset sensitive words. Represents the weight set for the i-th preset sensitive word, Count i (Hit_Sensitives) represents the number of times the i-th preset sensitive word appears in the request text, and Total_Tokens represents the total number of tokens in the current request text. n is an integer greater than 1, representing the total number of preset sensitive words.

[0038] Referring to the example above, by pre-setting a high weight for specific preset sensitive words, when the specific preset sensitive words appear in the current request text, the security evaluation score can drop rapidly, forming a rule-based rapid circuit breaker control mechanism.

[0039] Based on word frequency statistics, a security evaluation score for the current request text can be generated. This can be achieved by determining the word frequency statistics as the security evaluation score for the current request text.

[0040] Based on word frequency statistics, a security evaluation score for the current request text can be generated. Alternatively, the word frequency statistics can be compared with a preset security threshold. If the word frequency statistics are greater than or equal to the preset security threshold, the word frequency statistics are determined as the security evaluation score. If the word frequency statistics are less than the preset security threshold, the security evaluation score is set to the preset minimum value.

[0041] As can be seen, by normalizing the occurrence frequency of preset sensitive words using the total number of lexical units in this embodiment, the judgment bias caused by text length can be eliminated, and the risk of excessive risk control penalties when long texts contain only a small number of sensitive words can be effectively reduced.

[0042] In one embodiment, the determined feature data includes semantic information of the current request text; generating a security evaluation score for the current request text based on the determined feature data includes: obtaining general semantic information; generating the general semantic information based on various general corpora in a general corpus; calculating cosine similarity based on the semantic information of the current request text and the general semantic information; and generating a security evaluation score for the current request text based on the cosine similarity.

[0043] Obtain general semantic information; this information is generated based on various general corpora in a general corpus. For example, the general corpus can be the semantic vectors of the text. Aggregate and calculate the semantic vectors to obtain the average semantic vector, which is then used as the general semantic information.

[0044] The aforementioned general corpus can be a publicly available, large-scale collection of natural language texts that covers common daily contexts and cross-domains. It is composed of a massive amount of publicly available sentences, chapters, and dialogue texts and is used to represent common language rules, conventional semantics, and daily expressions.

[0045] The semantic information of the current request text can be represented by a first vector, and the general semantic information can be represented by an average semantic vector. The cosine similarity is calculated based on the semantic information of the current request text and the general semantic information, using the following formula: (3) in, and Similarity , Both ) represent the cosine similarity between the first vector and the average semantic vector. Denotes the first vector. This represents the average semantic vector.

[0046] The lower the cosine similarity score, the greater the semantic difference between the current request text and the general corpus. In this case, even if the current request text does not directly contain sensitive keywords, its content is very likely to contain sensitive information that is not suitable for public disclosure. For example, a user might ask or discuss the internal code architecture of a large language model that has not been made public.

[0047] Based on cosine similarity, a security evaluation score for the current request text is generated, which can be used to determine the security evaluation score of the current request text by using cosine similarity.

[0048] Based on cosine similarity, a security evaluation score for the current request text can be generated. Alternatively, the cosine similarity can be matched with multiple pre-set similarity intervals to obtain a target similarity interval that matches the cosine similarity. Based on the pre-set mapping relationship between the similarity interval and the evaluation score, the target evaluation score mapped by the target similarity interval is determined as the security evaluation score for the current request text.

[0049] As can be seen, this embodiment can overcome the limitations of sensitive word matching and realize the identification of implicit semantic risks in scenarios without explicit sensitive words.

[0050] In one embodiment, the determined feature data includes historical request texts corresponding to the current request text, and the number of historical request texts is multiple. Based on the determined feature data, a security evaluation score for the current request text is generated, including: obtaining the historical evaluation score corresponding to each historical request text; configuring corresponding weights for each historical request text based on the time-series information of each historical request text using an exponential decay model; weighting and summing the historical evaluation scores corresponding to each historical request text based on the weights corresponding to each historical request text to obtain a comprehensive historical evaluation score for the current request text; and generating a security evaluation score for the current request text based on the comprehensive historical evaluation score.

[0051] To obtain the historical evaluation score corresponding to each historical request text, the security of each historical request text can be evaluated using a first evaluation method to obtain a first score for each historical request text, and then the first score can be used as the historical evaluation score.

[0052] The first evaluation method can be preset according to needs. For example, it can evaluate the security of historical request texts based on the results of sensitive word detection, or it can evaluate the security of historical request texts based on the semantic similarity between historical request texts and general corpora, or it can evaluate the security of historical request texts based on the characteristics of users' historical interaction behavior, and so on.

[0053] Obtaining the historical evaluation score corresponding to each historical request text can also be done by: querying the pre-stored security evaluation score corresponding to each historical request text and using the security evaluation score as the historical evaluation score. For example, the current request text can be represented as... N historical request texts can be represented as: The security evaluation score corresponding to each historical request text obtained from the query can be represented as: The security evaluation score will be used as the historical evaluation score. Here, N is an integer greater than 1. t represents the current request text. The time sequence identifier represents the time point corresponding to the current request text; (t-1) represents the historical request text. The time sequence identifier indicates the historical request text. The corresponding time point; (tN) represents the historical request text. The time sequence identifier indicates the historical request text. The corresponding time point.

[0054] Using an exponential decay model, corresponding weights are assigned to each historical request text based on its temporal information.

[0055] The temporal sequence information of each historical request text can represent the chronological order of these texts. For each historical request text, the earlier it appears in the sequence, the smaller the weight assigned to it using the exponential decay model; conversely, the later it appears in the sequence, the larger the weight assigned to it using the exponential decay model. This approach allows for a natural reduction in weighting of long-term historical behavior and a focus on assigning weight to recent historical behavior, thereby preventing the historical evaluation scores of outdated historical request texts from continuously interfering with the current security evaluation and mitigating the impact of obsolete and ineffective behavior.

[0056] Based on the weights corresponding to each historical request text, the historical evaluation scores corresponding to each historical request text are weighted and accumulated to obtain the comprehensive historical evaluation score of the current request text, as shown in the following formula: (4) in, This represents the overall historical evaluation score of the current request text. Indicates the history request text The historical evaluation score, Exp_Decay(·), represents the exponential decay model and can be used to configure corresponding weights for each historical request text.

[0057] Based on the comprehensive historical evaluation score, a security evaluation score for the current request text can be generated. This can be achieved by determining the comprehensive historical evaluation score as the security evaluation score for the current request text.

[0058] Based on the comprehensive historical evaluation score, the security evaluation score of the current request text can be generated. Alternatively, the security of the current request text can be evaluated using a first evaluation method to obtain a first score for the current request text. The first score of the current request text can then be merged with the comprehensive historical evaluation score to obtain the security evaluation score of the current request text.

[0059] As can be seen, this embodiment employs an exponential decay model to accumulate historical risks, thereby identifying abnormal dialogue trends. For example, such abnormal dialogue trends may indicate that the user is gradually guiding the large language model to delve deeper into private and sensitive content.

[0060] In another embodiment, the determined feature data includes the frequency of occurrence of preset sensitive words in the current request text, the semantic information of the current request text, and the historical request text corresponding to the current request text. Based on the determined feature data, a security evaluation score for the current request text is generated, including: determining the word frequency statistics of preset sensitive words based on the frequency of occurrence of preset sensitive words in the current request text; calculating the cosine similarity between the semantic information of the current request text and the general semantic information; generating a comprehensive historical evaluation score for the current request text based on the historical request text corresponding to the current request text; and weighted summing the word frequency statistics, cosine similarity, and comprehensive historical evaluation score to obtain the security evaluation score for the current request text.

[0061] Specifically, determining the word frequency statistical index of preset sensitive words based on the frequency of occurrence of preset sensitive words in the current request text can refer to the corresponding explanation in the above method embodiment: "Count the number of word units in the current request text to obtain the total number of word units in the current request text; calculate the word frequency statistical index of preset sensitive words based on the total number of word units and the frequency of occurrence of preset sensitive words in the current request text." Calculating the cosine similarity between the semantic information of the current request text and the general semantic information can refer to the corresponding explanation in the above method embodiment: "Obtain general semantic information; generate general semantic information based on various general corpora in the general corpus; calculate cosine similarity based on the semantic information of the current request text and the general semantic information." Generating a comprehensive historical evaluation score for the current request text based on the historical request texts corresponding to the current request text can refer to the corresponding explanation in the above method embodiment: "Obtain the historical evaluation score corresponding to each historical request text; configure corresponding weights for each historical request text based on the temporal information of each historical request text using an exponential decay model; weighted summation of the historical evaluation scores corresponding to each historical request text based on the corresponding weights of each historical request text to obtain the comprehensive historical evaluation score of the current request text."

[0062] The security evaluation score of the current request text is obtained by weighted summing of word frequency statistics, cosine similarity, and comprehensive historical evaluation score, as shown in the following formula: (5) Where S represents the security evaluation score of the current request text. This represents the frequency statistics of preset sensitive words. Represents cosine similarity. This represents the overall historical evaluation score of the current request text.

[0063] This indicates deterministic weights. In scenarios with extremely high security requirements, the proportion of deterministic weights can be increased when setting weights, for example, =0.6, which prioritizes the safety evaluation score to ensure compliance.

[0064] This represents the intelligence weight. In general communication scenarios, the weight of intelligence can be increased when setting the weight, so that the security evaluation score focuses on whether the understanding of user intent deviates from the boundaries of public knowledge.

[0065] This indicates the weight of coherence. In multi-turn dialogue scenarios, the weight of coherence can be increased when setting weights, thereby reducing the risk of users trying to extract private information by asking questions in segments.

[0066] The above , as well as The sum is 1, and the weight values ​​can be flexibly set according to specific scenarios.

[0067] The various safety evaluation score calculation methods listed in the above embodiments are merely illustrative examples. In practical applications, one or more of the above methods can be combined to calculate the safety evaluation score.

[0068] In step S106 above, the processing method for the current request text is determined and executed based on the security evaluation score and the preset score threshold.

[0069] The processing methods include the following: allowing the current request text to be sent to the first major model; desensitizing the current request text and then sending the desensitized current request text to the first major model; terminating the sending of the current request text to the first major model and forwarding the current request text to the second major model.

[0070] The second major model mentioned above can be a large language model with text processing capabilities. This second major model can be deployed locally on the user terminal or on an intranet server located on the same local area network as the user terminal. Compared to the first major model deployed remotely, the second major model has a higher level of security, and the risk of data leakage is lower when the current request text is processed through the second major model.

[0071] In one example, the preset score thresholds include a first score threshold and a second score threshold, where the first score threshold is greater than the second score threshold. Based on the security evaluation score and the preset score thresholds, the processing method for the current request text can be determined as follows: If the security evaluation score is greater than the first score threshold, then the current request text is to be allowed to pass through the first large model and the corresponding operation is performed. If the security evaluation score is less than or equal to the first score threshold and the security evaluation score is greater than the second score threshold, then the current request text is determined to be processed by de-identifying the current request text, and then the de-identified current request text is allowed to be sent to the first large model and the corresponding operation is performed. If the security evaluation score is less than or equal to the second score threshold, the current request text is to be processed by terminating the passage of the current request text to the first major model, forwarding the current request text to the second major model, and performing the corresponding operation.

[0072] In another example, the processing method for the current request text can be determined based on the security evaluation score and a preset score threshold. Alternatively, if the security evaluation score is less than the preset score threshold, the current request text can be input into a pre-trained text classification model for content classification processing to obtain the content classification result. Based on the content classification result, the processing method for the current request text can be determined.

[0073] In one embodiment, the data processing method further includes: obtaining the processing method of the previous request text of the current request text; determining the large model for processing the previous request text in the first large model and the second large model based on the processing method of the previous request text; and determining the large model for processing the current request text in the first large model and the second large model based on the processing method of the current request text; if the large model for processing the previous request text is different from the large model for processing the current request text, extracting the semantic information of the historical request text corresponding to the current request text, generating prompt information based on the semantic information of the historical request text to guide the large model for processing the current request text to generate text, and inputting the prompt information into the large model for processing the current request text.

[0074] Obtain the processing method of the previous request text before the current request text. Based on the processing method of the previous request text, determine the major model for processing the previous request text from the first major model and the second major model. Also, based on the processing method of the current request text, determine the major model for processing the current request text from the first major model and the second major model.

[0075] For example, the current request text The previous request text The processing method indicates: terminate the release of the previous request text to the first major model. and the previous request text Forward to the second major model. Based on this processing method, the processing of the previous request text can be determined. The largest model is the second largest model.

[0076] Current request text The processing method is to allow the current request text to be sent to the first major model. Based on this processing method, the current request text can be determined for processing. The largest model is the first largest model.

[0077] If the large model that processed the previous request text is different from the large model that processes the current request text, then the semantic information of the historical request text corresponding to the current request text is extracted. Based on the semantic information of the historical request text, a prompt message is generated to guide the large model that processes the current request text to generate text, and the prompt message is input into the large model that processes the current request text.

[0078] For example, processing the previous request text The largest model is the second largest model, which processes the current request text. The largest model is the first largest model, which differs from the second largest model. In this case, the embedding semantic vector of the historical request text corresponding to the current request text can be extracted. Based on this embedding semantic vector, a prompt message is generated to guide the first largest model in text generation, and this prompt message is input into the first largest model.

[0079] Embedding semantic vectors are used to determine in the semantic space whether the "understanding baseline" of the new and old models is aligned, that is, whether the first model can produce an understanding of the preceding dialogue similar to that of the second model.

[0080] As can be seen, this embodiment can achieve seamless continuity of conversational semantics between different large models, reduce the risk of misunderstanding due to model differences, and improve the coherence and integrity of dialogue in multi-model interaction scenarios.

[0081] In one embodiment, the data processing method further includes: after processing multiple request texts sequentially through a first major model or a second major model, collecting feedback data on the processing results for each request text; based on the feedback data on the processing results for each request text, counting the number of feedback data that meet preset statistical conditions; the preset statistical conditions include: the processing result is generated by the second major model, and the feedback data represents negative feedback; when the number of feedback data that meet the preset statistical conditions reaches a specified threshold, adjusting the preset score threshold.

[0082] After processing multiple request texts sequentially through either the first or second major model, feedback data is collected regarding the processing results for each request text. Feedback data can include likes or dislikes submitted in response to the processing results. Alternatively, feedback data can also include user evaluation texts.

[0083] In one example, the feedback data is user review text. For the processing result of the i-th request text, the (i+1)-th request text is obtained, and the user review text related to the processing result of the i-th request text is extracted from the (i+1)-th request text. i is an integer greater than 0.

[0084] Based on the feedback data of the processing results for each request text, the number of feedback data that meet the preset statistical conditions is counted; the preset statistical conditions include: the processing results are generated by the second largest model, and the feedback data represents negative feedback.

[0085] For example, the processing result of the first request text is generated by the first large model, and the feedback data represents positive feedback; the processing result of the second request text is generated by the first large model, and the feedback data represents negative feedback; ...; the processing result of the i-th request text is generated by the second large model, and the feedback data represents negative feedback, and so on. i is an integer greater than 2. By statistically analyzing each feedback data, we can obtain the number of feedback data that meet the preset statistical result "the processing result is generated by the second large model, and the feedback data represents negative feedback".

[0086] When the number of feedback data that meets the preset statistical conditions reaches a specified threshold, the preset score threshold is adjusted. For example, the number of feedback data is set to N, where N is an integer greater than 1. Each request text has a corresponding feedback data. When the number of feedback data that meets the preset statistical result "the processing result is generated by the second largest model, and the feedback data represents negative feedback" reaches N, the preset score threshold is adjusted according to the preset adjustment direction and preset value.

[0087] It should be noted that in this embodiment, the adjustment of the preset score threshold is always based on the preset safety baseline threshold, and the adjustment process will not reduce the overall safety protection level.

[0088] As can be seen, through this embodiment, when the text processing performance of the first large model is better than that of the second large model, the negative feedback from users on the processing results of each request text by the second large model can be used as a reference to adjust the preset score threshold in a timely manner, so that more request texts are assigned to the first large model with better text processing performance, thereby optimizing the text processing quality.

[0089] In one embodiment, the current request text is de-identified, which includes: performing named entity recognition on the current request text to obtain the entities in the current request text; and replacing the entities in the current request text with preset entities to obtain the de-identified current request text.

[0090] Named entity recognition (NER) is performed on the current request text to obtain the entities in the current request text. Alternatively, the current request text can be input into a NER model for named entity recognition processing to obtain the entities in the current request text.

[0091] The current request text is de-identified by replacing entities in the current request text with preset entities. The preset entities can be obtained according to the entity type, and the entities in the current request text can be replaced with the preset entities to obtain the de-identified current request text.

[0092] As can be seen, by replacing the specific entity in the current request text with a preset entity that does not pose a risk of sensitive data leakage through this embodiment, the first large model at the remote end can remain completely independent of the real specific entity, thereby reducing the risk of sensitive data leakage and improving the security of text processing.

[0093] In summary, in the embodiments described above, firstly, the current request text sent by the user terminal to the first large model at the remote end is intercepted, and at least one of the following feature data is determined: the number of times preset sensitive words appear in the current request text, the semantic information of the current request text, and the historical request text corresponding to the current request text; then, based on the determined feature data, a security evaluation score for the current request text is generated; the security evaluation score is used to characterize the probability that the current request text contains sensitive content; finally, based on the security evaluation score and a preset score threshold, the processing method for the current request text is determined and executed; wherein, the processing method includes one of the following: allowing the current request text to be sent to the first large model; performing desensitization processing on the current request text, and then allowing the desensitized current request text to be sent to the first large model; terminating the sending of the current request text to the first large model, and forwarding the current request text to the second large model, the second large model being deployed locally on the user terminal, or deployed on an intranet server located on the same local area network as the user terminal. As can be seen, through the embodiments of this disclosure, on the one hand, by fully utilizing the occurrence frequency of preset sensitive words in the current request text, the semantic information of the current request text, and one or more of the historical request texts corresponding to the current request text to generate a security evaluation score, the probability of the current request text containing sensitive content is accurately quantified, providing a reliable basis for subsequent differentiated processing; on the other hand, based on the security evaluation score and preset score threshold, differentiated processing methods, including allowing access to the first major model, desensitizing before allowing access, and terminating access and forwarding to the second major model, can be dynamically adapted. Moreover, since the second major model is deployed on the user terminal's local machine or an intranet server, from the perspective of the overall processing flow of the current request text, the risk of sensitive content leakage can be effectively reduced, and the security of data processing can be improved.

[0094] Figure 2 This is a schematic diagram of the structure of a data processing system provided in an embodiment of the present disclosure.

[0095] like Figure 2 As shown, the data processing system includes at least: a rule filtering module 201, a semantic offset calculation module 202, a context association module 203, a trusted quantification engine 204, a first large model 205, an edge desensitization gateway 206, a second large model 207, and a semantic compensation module.

[0096] The aforementioned data processing system can be used to intercept user input requests sent from the user terminal to the remote first large model 205, which carry the current request text.

[0097] The rule filtering module 201 can be used to filter entities in the current request text using pre-set keyword matching rules. In specific implementation, the rule filtering module 201 can determine the occurrence frequency of preset sensitive words in the current request text, and determine the word frequency statistics of the preset sensitive words based on the occurrence frequency.

[0098] The semantic offset calculation module 202 can be used to determine the semantic information of the current request text and calculate the cosine similarity between the semantic information of the current request text and the general semantic information. This cosine similarity can characterize the degree of semantic offset of the current request text relative to the general corpus.

[0099] The context association module 203 can be used to determine the historical request text corresponding to the current request text, and generate a comprehensive historical evaluation score for the current request text based on the historical request text corresponding to the current request text. The historical request text can be regarded as the contextual features of the current request text, representing the behavioral trends and semantic relationships of the user's continuous dialogue, and providing temporal dimension feature support for the security evaluation of the current request text.

[0100] The trustworthy quantification engine 204 can generate a trustworthiness score for the current request text based on preset sensitive word frequency statistics, cosine similarity, and comprehensive historical evaluation scores. This trustworthiness score is then used as the security evaluation score. The security evaluation score characterizes the likelihood that the current request text contains sensitive content.

[0101] The first large model 205 can be a large language model with text processing capabilities. This first large model 205 can be deployed on a public cloud server or on other remote network devices that provide large model services to the outside world.

[0102] The edge-sensitization gateway 206 can be used to desensitize the received current request text.

[0103] The second major model 207 can be a large language model with text processing capabilities. This second major model 207 can be deployed locally on the user terminal or on an intranet server located on the same local area network as the user terminal. Compared to the first major model 205 deployed remotely, the second major model 207 has a higher level of security, and the risk of data leakage is lower when the current request text is processed through the second major model 207.

[0104] The aforementioned data processing system can also be used to compare the size of the security evaluation score, the first score threshold, and the second score threshold.

[0105] If the security evaluation score is greater than the first score threshold, the current request text is to be processed as follows: allow the current request text to be sent to the first large model 205 and perform the corresponding operation. If the security evaluation score is less than or equal to the first score threshold and the security evaluation score is greater than the second score threshold, then the current request text is processed as follows: first, the current request text is desensitized through the edge desensitization gateway 206, then the desensitized current request text is allowed to the first large model 205, and the corresponding operation is performed. If the security evaluation score is less than or equal to the second score threshold, the current request text is to be processed as follows: stop allowing the current request text to be sent to the first large model 205, forward the current request text to the second large model 207, and perform the corresponding operation.

[0106] The semantic compensation module 208 can be used to extract semantic information from the preceding dialogue and generate prompt information when the large models of two adjacent request texts are different.

[0107] In practice, if the large model that processes the previous request text is different from the large model that processes the current request text, the semantic information of the historical request text corresponding to the current request text is extracted. Based on the semantic information of the historical request text, prompt information is generated to guide the large model that processes the current request text to generate text, and the prompt information is input into the large model that processes the current request text.

[0108] Since the technical concept is the same, this embodiment is described in a relatively simple way. You can refer to the corresponding description of the foregoing method embodiments.

[0109] Figure 3 This is a schematic diagram of the structure of a data processing apparatus provided in an embodiment of this disclosure. Figure 3 As shown, the data processing apparatus includes: The data determination unit 301 is used to intercept the current request text of the first large model sent by the user terminal to the remote end, and determine at least one of the following feature data: the number of times preset sensitive words appear in the current request text, the semantic information of the current request text, and the historical request text corresponding to the current request text. The score generation unit 302 is used to generate a security evaluation score for the current request text based on the determined feature data; the security evaluation score is used to characterize the probability that the current request text contains sensitive content. The text processing unit 303 is used to determine and execute the processing method of the current request text based on the security evaluation score and a preset score threshold; wherein the processing method includes one of the following: allowing the current request text to be sent to the first large model; performing desensitization processing on the current request text, and then allowing the desensitized current request text to be sent to the first large model; terminating the sending of the current request text to the first large model, and forwarding the current request text to the second large model, wherein the second large model is deployed locally on the user terminal, or deployed on an intranet server in the same local area network as the user terminal.

[0110] Optionally, the determined feature data includes the number of times preset sensitive words appear in the current request text; the score generation unit 302 is specifically used for: The total number of words in the current request text is obtained by counting the number of words in the current request text. The word frequency statistics of the preset sensitive words are calculated based on the total number of word units and the number of times the preset sensitive words appear in the current request text. Based on the word frequency statistics, a security evaluation score is generated for the current request text.

[0111] Optionally, the determined feature data includes the semantic information of the current request text; the score generation unit 302 is specifically used for: Obtain general semantic information; the general semantic information is generated based on various general corpora in a general corpus. Calculate the cosine similarity based on the semantic information of the current request text and the general semantic information; Based on the cosine similarity, a security evaluation score is generated for the current request text.

[0112] Optionally, the determined feature data includes historical request texts corresponding to the current request text, and the number of historical request texts is multiple; the score generation unit 302 is specifically used for: Obtain the historical evaluation score corresponding to each of the aforementioned historical request texts; Using an exponential decay model, corresponding weights are assigned to each of the historical request texts based on their temporal information. Based on the weights corresponding to each of the historical request texts, the historical evaluation scores corresponding to each of the historical request texts are weighted and accumulated to obtain the comprehensive historical evaluation score of the current request text. Based on the comprehensive historical evaluation score, the security evaluation score of the current request text is generated.

[0113] Optionally, the data processing device further includes a mode acquisition module, a model determination module, and an input prompt module; The method acquisition module is used to acquire the processing method of the previous request text of the current request text; The model determination module is used to determine the large model for processing the previous request text in the first large model and the second large model based on the processing method of the previous request text, and to determine the large model for processing the current request text in the first large model and the second large model based on the processing method of the current request text. The prompt input module is used to extract the semantic information of the historical request text corresponding to the current request text if the large model processing the previous request text is different from the large model processing the current request text, generate prompt information based on the semantic information of the historical request text to guide the large model processing the current request text to generate text, and input the prompt information into the large model processing the current request text.

[0114] Optionally, the data processing device further includes a feedback acquisition module, a quantity statistics module, and a threshold adjustment module; The feedback acquisition module is used to collect feedback data on the processing results of each request text after processing multiple request texts sequentially through the first large model or the second large model. The quantity statistics module is used to count the number of feedback data that meet preset statistical conditions based on the feedback data of the processing results for each of the request texts; the preset statistical conditions include: the processing results are generated by the second large model, and the feedback data represents negative feedback. The threshold adjustment module is used to adjust the preset score threshold when the number of feedback data that meet the preset statistical conditions reaches a specified number threshold.

[0115] Optionally, the data processing device further includes an entity recognition module and an entity replacement module; The entity recognition module is used to perform named entity recognition on the current request text to obtain the entities in the current request text; The entity replacement module is used to replace entities in the current request text with preset entities to obtain the de-identified current request text.

[0116] Through the embodiments of this disclosure, on the one hand, by fully utilizing the occurrence frequency of preset sensitive words in the current request text, the semantic information of the current request text, and one or more of the historical request texts corresponding to the current request text, a security evaluation score is generated, which realizes the accurate quantification of the probability that the current request text contains sensitive content, providing a reliable basis for subsequent differentiated processing; on the other hand, based on the security evaluation score and preset score threshold, differentiated processing methods, including allowing access to the first major model, desensitizing before allowing access, and terminating access and forwarding to the second major model, can be dynamically adapted. Since the second major model is deployed on the user terminal's local machine or an intranet server, from the perspective of the overall processing flow of the current request text, the risk of leakage of sensitive content can be effectively reduced, and the security of data processing can be improved.

[0117] The data processing apparatus provided in this disclosure can implement the various processes in the aforementioned data processing method embodiments and achieve the same functions and effects, which will not be repeated here.

[0118] Furthermore, embodiments of this disclosure also provide an electronic device, Figure 4 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present disclosure, such as... Figure 4 As shown, the device includes: a memory 401, a processor 402, a bus 403, and a communication interface 404. The memory 401, the processor 402, and the communication interface 404 communicate via the bus 403. The communication interface 404 may include input / output interfaces, including but not limited to a keyboard, mouse, monitor, microphone, and loudspeaker.

[0119] Figure 4 In the memory 401, computer-executable instructions that can run on the processor 402 are stored. When the computer-executable instructions are executed by the processor 402, the following process is implemented: Intercept the current request text of the first major model sent by the user terminal to the remote end, and determine at least one of the following feature data: the number of times preset sensitive words appear in the current request text, the semantic information of the current request text, and the historical request text corresponding to the current request text; Based on the determined feature data, a security evaluation score is generated for the current request text; the security evaluation score is used to characterize the likelihood that the current request text contains sensitive content. Based on the security evaluation score and the preset score threshold, the processing method for the current request text is determined and executed; wherein, the processing method includes one of the following: allowing the current request text to be sent to the first large model; performing desensitization processing on the current request text, and then allowing the desensitized current request text to be sent to the first large model; terminating the sending of the current request text to the first large model, and forwarding the current request text to the second large model, wherein the second large model is deployed locally on the user terminal, or deployed on an intranet server in the same local area network as the user terminal.

[0120] This embodiment achieves two main benefits. First, by fully utilizing the frequency of occurrence of preset sensitive words in the current request text, the semantic information of the current request text, and one or more of the historical request texts corresponding to the current request text, a security evaluation score is generated. This enables precise quantification of the likelihood that the current request text contains sensitive content, providing a reliable basis for subsequent differentiated processing. Second, based on the security evaluation score and preset score thresholds, differentiated processing methods, including allowing access to the first major model, desensitizing before allowing access, and terminating access and forwarding to the second major model, can be dynamically adapted. Furthermore, since the second major model is deployed on the user terminal's local machine or an intranet server, from the perspective of the overall processing flow of the current request text, the risk of sensitive content leakage can be effectively reduced, and the security of data processing can be improved.

[0121] The electronic device provided in one embodiment of this specification can implement the various processes in the aforementioned data processing method embodiments and achieve the same functions and effects, which will not be repeated here.

[0122] Furthermore, one embodiment of this specification also provides a computer-readable storage medium for storing computer-executable instructions, which, when executed by a processor, implement the following process: Intercept the current request text of the first major model sent by the user terminal to the remote end, and determine at least one of the following feature data: the number of times preset sensitive words appear in the current request text, the semantic information of the current request text, and the historical request text corresponding to the current request text; Based on the determined feature data, a security evaluation score is generated for the current request text; the security evaluation score is used to characterize the likelihood that the current request text contains sensitive content. Based on the security evaluation score and the preset score threshold, the processing method for the current request text is determined and executed; wherein, the processing method includes one of the following: allowing the current request text to be sent to the first large model; performing desensitization processing on the current request text, and then allowing the desensitized current request text to be sent to the first large model; terminating the sending of the current request text to the first large model, and forwarding the current request text to the second large model, wherein the second large model is deployed locally on the user terminal, or deployed on an intranet server in the same local area network as the user terminal.

[0123] This embodiment achieves two main benefits. First, by fully utilizing the frequency of occurrence of preset sensitive words in the current request text, the semantic information of the current request text, and one or more of the historical request texts corresponding to the current request text, a security evaluation score is generated. This enables precise quantification of the likelihood that the current request text contains sensitive content, providing a reliable basis for subsequent differentiated processing. Second, based on the security evaluation score and preset score thresholds, differentiated processing methods, including allowing access to the first major model, desensitizing before allowing access, and terminating access and forwarding to the second major model, can be dynamically adapted. Furthermore, since the second major model is deployed on the user terminal's local machine or an intranet server, from the perspective of the overall processing flow of the current request text, the risk of sensitive content leakage can be effectively reduced, and the security of data processing can be improved.

[0124] The computer-readable storage medium mentioned above includes read-only memory (ROM), random access memory (RAM), magnetic disk, or optical disk, etc.

[0125] The computer-readable storage medium provided in one embodiment of this specification can implement the various processes in the aforementioned data processing method embodiments and achieve the same functions and effects, which will not be repeated here.

[0126] This specification also provides a computer program product in one embodiment, the computer program product including a computer program, which, when executed by a processor, implements the following process: Intercept the current request text of the first major model sent by the user terminal to the remote end, and determine at least one of the following feature data: the number of times preset sensitive words appear in the current request text, the semantic information of the current request text, and the historical request text corresponding to the current request text; Based on the determined feature data, a security evaluation score is generated for the current request text; the security evaluation score is used to characterize the likelihood that the current request text contains sensitive content. Based on the security evaluation score and the preset score threshold, the processing method for the current request text is determined and executed; wherein, the processing method includes one of the following: allowing the current request text to be sent to the first large model; performing desensitization processing on the current request text, and then allowing the desensitized current request text to be sent to the first large model; terminating the sending of the current request text to the first large model, and forwarding the current request text to the second large model, wherein the second large model is deployed locally on the user terminal, or deployed on an intranet server in the same local area network as the user terminal.

[0127] This embodiment achieves two main benefits. First, by fully utilizing the frequency of occurrence of preset sensitive words in the current request text, the semantic information of the current request text, and one or more of the historical request texts corresponding to the current request text, a security evaluation score is generated. This enables precise quantification of the likelihood that the current request text contains sensitive content, providing a reliable basis for subsequent differentiated processing. Second, based on the security evaluation score and preset score thresholds, differentiated processing methods, including allowing access to the first major model, desensitizing before allowing access, and terminating access and forwarding to the second major model, can be dynamically adapted. Furthermore, since the second major model is deployed on the user terminal's local machine or an intranet server, from the perspective of the overall processing flow of the current request text, the risk of sensitive content leakage can be effectively reduced, and the security of data processing can be improved.

[0128] The computer program product provided in one embodiment of this specification can implement the various processes in the aforementioned data processing method embodiments and achieve the same functions and effects, which will not be repeated here.

[0129] The various embodiments in this specification are described in a progressive manner. Similar or identical parts between embodiments can be referred to interchangeably. Each embodiment focuses on describing the differences from other embodiments. In particular, the system embodiments are basically similar to the method embodiments, so the description is relatively simple; relevant parts can be referred to the descriptions in the method embodiments.

[0130] The above description is merely an embodiment of this specification and is not intended to limit this document. Various modifications and variations can be made to the embodiments described in this specification by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this document should be included within the scope of the claims of this document.

Claims

1. A data processing method, characterized in that, include: Intercept the current request text of the first major model sent by the user terminal to the remote end, and determine at least one of the following feature data: the number of times preset sensitive words appear in the current request text, the semantic information of the current request text, and the historical request text corresponding to the current request text; Based on the determined feature data, a security evaluation score is generated for the current request text; The security evaluation score is used to characterize the likelihood that the current request text contains sensitive content; Based on the security evaluation score and the preset score threshold, the processing method for the current request text is determined and executed; wherein, the processing method includes one of the following: allowing the current request text to be passed to the first large model; The current request text is anonymized, and then the anonymized current request text is allowed to the first large model; the current request text is then allowed to the first large model, and the current request text is forwarded to the second large model, which is deployed locally on the user terminal or on an intranet server in the same local area network as the user terminal.

2. The method according to claim 1, characterized in that, The identified feature data includes the number of times preset sensitive words appear in the current request text; The step of generating the security evaluation score for the current request text based on the determined feature data includes: The total number of words in the current request text is obtained by counting the number of words in the current request text. The word frequency statistics of the preset sensitive words are calculated based on the total number of word units and the number of times the preset sensitive words appear in the current request text. Based on the word frequency statistics, a security evaluation score is generated for the current request text.

3. The method according to claim 1, characterized in that, The determined feature data includes the semantic information of the current request text; generating the security evaluation score of the current request text based on the determined feature data includes: Obtain general semantic information; the general semantic information is generated based on various general corpora in a general corpus. Calculate the cosine similarity based on the semantic information of the current request text and the general semantic information; Based on the cosine similarity, a security evaluation score is generated for the current request text.

4. The method according to claim 1, characterized in that, The determined feature data includes historical request texts corresponding to the current request text, and the number of historical request texts is multiple; the step of generating the security evaluation score of the current request text based on the determined feature data includes: Obtain the historical evaluation score corresponding to each of the aforementioned historical request texts; Using an exponential decay model, corresponding weights are assigned to each of the historical request texts based on their temporal information. Based on the weights corresponding to each of the historical request texts, the historical evaluation scores corresponding to each of the historical request texts are weighted and accumulated to obtain the comprehensive historical evaluation score of the current request text. Based on the comprehensive historical evaluation score, the security evaluation score of the current request text is generated.

5. The method according to claim 1, characterized in that, The method further includes: Obtain the processing method of the previous request text of the current request text; Based on the processing method of the previous request text, a large model for processing the previous request text is determined in the first large model and the second large model; and based on the processing method of the current request text, a large model for processing the current request text is determined in the first large model and the second large model. If the large model for processing the previous request text is different from the large model for processing the current request text, then the semantic information of the historical request text corresponding to the current request text is extracted. Based on the semantic information of the historical request text, a prompt message is generated to guide the large model for processing the current request text to generate text, and the prompt message is input into the large model for processing the current request text.

6. The method according to claim 1, characterized in that, The method further includes: After processing multiple request texts sequentially through the first or second major model, feedback data on the processing results for each of the request texts is collected. Based on the feedback data of the processing results for each of the request texts, the number of feedback data that meet the preset statistical conditions is counted; the preset statistical conditions include: the processing results are generated by the second large model, and the feedback data represents negative feedback; When the number of feedback data that meet the preset statistical conditions reaches a specified threshold, the preset score threshold is adjusted.

7. The method according to claim 1, characterized in that, The process of desensitizing the current request text includes: Named entity recognition is performed on the current request text to obtain the entities in the current request text; The entities in the current request text are replaced with preset entities to obtain the de-identified current request text.

8. A data processing apparatus, characterized in that, include: The data determination unit is used to intercept the current request text of the first large model sent by the user terminal to the remote end, and determine at least one of the following feature data: the number of times preset sensitive words appear in the current request text, the semantic information of the current request text, and the historical request text corresponding to the current request text; A score generation unit is used to generate a security evaluation score for the current request text based on the determined feature data. The security evaluation score is used to characterize the likelihood that the current request text contains sensitive content; A text processing unit is configured to determine and execute a processing method for the current request text based on the security evaluation score and a preset score threshold; wherein the processing method includes one of the following: allowing the current request text to be passed to the first large model; The current request text is anonymized, and then the anonymized current request text is allowed to the first large model; the current request text is then allowed to the first large model, and the current request text is forwarded to the second large model, which is deployed locally on the user terminal or on an intranet server in the same local area network as the user terminal.

9. An electronic device, characterized in that, include: processor; And a memory configured to store computer-executable instructions, which, when executed, cause the processor to perform the data processing method as described in any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium is used to store computer-executable instructions that, when executed by a processor, implement the data processing method as described in any one of claims 1 to 7.

11. A computer program product, characterized in that, It includes a computer program that, when executed by a processor, implements the data processing method as described in any one of claims 1 to 7.