A method and system for identity encryption based on large language model
Keyword replacement and semantic encoding are carried out through large language models and artificial intelligence technology to generate ciphertexts, solving the problem of insufficient security in the context of enhanced computing power and quantum computing in traditional encryption methods, and achieving more efficient identity information protection.
Patent Information
- Application Number
- CN202411406894.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-10
- Publication Date
- 2024-12-13
- Estimated Expiration
- 2044-10-10
AI Technical Summary
Traditional encryption methods face the risk of being cracked in the context of enhanced computing power and development of quantum computing technology, and have shortcomings in availability and flexibility, and cannot effectively protect the security of user identity and sensitive information.
Using the identity encryption method based on the large language model, multiple synonyms replacement messages to be encrypted are generated through keyword recognition and synonyms replacement, and cross-domain semantic association encoding is used for semantic understanding algorithms of artificial intelligence and natural language processing technology to generate ciphertexts , to enhance the privacy protection capabilities of information.
While maintaining information integrity, it significantly enhances the security of identity information, uses artificial intelligence technology to achieve more intelligent identity encryption, and improves the ability and robustness of complex information.
Smart Images

Figure CN118916904B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of intelligent encryption, and more specifically, to an identity encryption method and system based on a large language model. Background Art
[0002] In the Internet age, personal identity information is widely collected and stored, and users' privacy faces potential threats. With the rapid development of information technology, data security and privacy protection have become increasingly important. Especially in the fields of scientific research and business, the encrypted transmission of user identity and sensitive information is the basis for ensuring information security and preventing information leakage and abuse.
[0003] Traditional encryption methods mainly rely on mathematical algorithms (such as RSA, AES, etc.) to encrypt and decrypt information through keys. However, with the increase in computing power, traditional encryption algorithms are at risk of being cracked, especially in the context of the development of quantum computing technology, some existing encryption standards may become insecure. In addition, although existing encryption methods can protect data security to a certain extent, they often lack usability and flexibility.
[0004] Therefore, an optimized identity encryption scheme is desired. Summary of the invention
[0005] In order to solve the above technical problems, the present application is proposed. The embodiment of the present application provides an identity encryption method and system based on a large language model, which can generate multiple versions of synonymous replacement messages to be encrypted by using a large language model for keyword recognition and synonym replacement after collecting messages to be encrypted, so as to enhance the privacy protection capability of information while maintaining the integrity of the information. Then, a semantic understanding algorithm based on artificial intelligence and natural language processing technology is introduced at the back end to perform comprehensive analysis and cross-domain semantic association encoding on multiple synonymous replacement messages to be encrypted and messages to be encrypted, so as to perform synonymous coverage and enhanced representation of the semantics of the encrypted message, thereby encrypting and generating ciphertext. In this way, more intelligent identity encryption can be achieved by using artificial intelligence technology and a large language model, thereby enhancing the security of identity information while ensuring the integrity of the message to be encrypted.
[0006] According to one aspect of the present application, an identity encryption method based on a large language model is provided, which includes: obtaining a message to be encrypted; performing keyword recognition and keyword synonym replacement on the message to be encrypted to obtain multiple synonymous replacement messages to be encrypted; performing semantic encoding on the message to be encrypted and the multiple synonymous replacement messages to be encrypted to obtain a semantic encoding feature vector of the message to be encrypted and multiple semantic encoding feature vectors of the synonymous replacement messages to be encrypted; using the semantic encoding feature vector of the message to be encrypted as a query feature vector and a feature matrix obtained by arranging the semantic encoding feature vectors of the multiple synonymous replacement messages to be encrypted as an initial key matrix, inputting the query feature vector and the initial key matrix into a cross-domain attention gate query encoder based on local correlation enhancement of the key matrix to obtain a semantic synonymous coverage enhanced feature vector of the message to be encrypted; and generating a ciphertext of the message to be encrypted based on the semantic synonymous coverage enhanced feature vector of the message to be encrypted.
[0007] According to another aspect of the present application, an identity encryption system based on a large language model is provided, which includes: a message acquisition module to be encrypted, used to acquire a message to be encrypted; a keyword recognition module, used to perform keyword recognition on the message to be encrypted and perform keyword synonym replacement to obtain multiple synonym replacement messages to be encrypted; a semantic encoding module, used to perform semantic encoding on the message to be encrypted and the multiple synonym replacement messages to be encrypted to obtain a semantic encoding feature vector of the message to be encrypted and multiple semantic encoding feature vectors of the synonym replacement messages to be encrypted; a cross-domain attention gate query encoding module, used to use the semantic encoding feature vector of the message to be encrypted as a query feature vector and the feature matrix obtained by arranging the semantic encoding feature vectors of the multiple synonym replacement messages to be encrypted as an initial key matrix, and input the query feature vector and the initial key matrix into a cross-domain attention gate query encoder based on local correlation enhancement of the key matrix to obtain a semantic synonym coverage enhanced feature vector of the message to be encrypted; a ciphertext generation module, used to generate the ciphertext of the message to be encrypted based on the semantic synonym coverage enhanced feature vector of the message to be encrypted.
[0008] Compared with the prior art, the present application provides an identity encryption method and system based on a large language model, which can generate multiple versions of synonymous replacement messages to be encrypted by using a large language model to perform keyword recognition and synonym replacement after collecting messages to be encrypted, so as to enhance the privacy protection capability of information while maintaining the integrity of the information. Then, a semantic understanding algorithm based on artificial intelligence and natural language processing technology is introduced at the back end to perform comprehensive analysis and cross-domain semantic association encoding on multiple synonymous replacement messages to be encrypted and messages to be encrypted, so as to perform synonymous coverage and enhanced representation of the semantics of the encrypted message, thereby encrypting and generating ciphertext. In this way, more intelligent identity encryption can be achieved by using artificial intelligence technology and a large language model, thereby enhancing the security of identity information while ensuring the integrity of the message to be encrypted. BRIEF DESCRIPTION OF THE DRAWINGS
[0009] By describing the embodiments of the present application in more detail in conjunction with the accompanying drawings, the above and other purposes, features and advantages of the present application will become more apparent. The accompanying drawings are used to provide a further understanding of the embodiments of the present application and constitute a part of the specification. Together with the embodiments of the present application, they are used to explain the present application and do not constitute a limitation of the present application. In the accompanying drawings, the same reference numerals generally represent the same components or steps.
[0010] Figure 1 The figure is a flowchart of an identity encryption method based on a large language model according to an embodiment of the present application.
[0011] Figure 2 Schematic diagram of data flow of the identity encryption method based on a large language model according to an embodiment of the present application.
[0012] Figure 3 It is a block diagram of an identity encryption system based on a large language model according to an embodiment of the present application. DETAILED DESCRIPTION
[0013] Below, the exemplary embodiments according to the present application will be described in detail with reference to the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all the embodiments of the present application, and it should be understood that the present application is not limited to the exemplary embodiments described here.
[0014] As shown in this application and claims, unless the context clearly indicates an exception, the words "a", "an", "an" and / or "the" do not refer to the singular and may also include the plural. Generally speaking, the terms "include" and "comprise" only indicate the inclusion of the steps and elements that have been clearly identified, and these steps and elements do not constitute an exclusive list. The method or device may also include other steps or elements.
[0015] Although the present application makes various references to certain modules in the system according to the embodiments of the present application, any number of different modules can be used and run on the user terminal and / or server. The modules are only illustrative, and different aspects of the system and method can use different modules.
[0016] Flowcharts are used in the present application to illustrate the operations performed by the system according to the embodiments of the present application. It should be understood that the preceding or following operations are not necessarily performed accurately in order. On the contrary, various steps may be processed in reverse order or simultaneously as required. Meanwhile, other operations may also be added to these processes, or a certain step or several steps of operations may be removed from these processes.
[0017] Below, the exemplary embodiments according to the present application will be described in detail with reference to the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all the embodiments of the present application, and it should be understood that the present application is not limited to the exemplary embodiments described here.
[0018] Traditional encryption methods mainly rely on mathematical algorithms (such as RSA, AES, etc.) to encrypt and decrypt information through keys. However, with the increase in computing power, traditional encryption algorithms are at risk of being cracked, especially in the context of the development of quantum computing technology, some existing encryption standards may become insecure. In addition, although existing encryption methods can protect data security to a certain extent, they often lack usability and flexibility. Therefore, an optimized identity encryption solution is desired.
[0019] In recent years, advances in the field of natural language processing (NLP) have brought new possibilities to cryptography. In particular, the development of large language models has made information hiding and encryption based on language understanding possible. Large language models can understand and generate human language, which gives them a unique advantage in text processing. Using these models to encrypt information can not only improve the randomness and complexity of the encrypted content, but also resist attacks against traditional encryption algorithms to a certain extent.
[0020] In the technical solution of the present application, an identity encryption method based on a large language model is proposed. Figure 1 The figure is a flowchart of an identity encryption method based on a large language model according to an embodiment of the present application. Figure 2 Schematic diagram of data flow of the identity encryption method based on a large language model according to an embodiment of the present application. Figure 1 and Figure 2 As shown, according to the embodiment of the present application, the wind-solar power generation energy storage management method includes the following steps: S1, obtaining a message to be encrypted; S2, performing keyword recognition on the message to be encrypted and performing keyword synonym replacement to obtain a plurality of synonym replacement messages to be encrypted; S3, performing semantic encoding on the message to be encrypted and the plurality of synonym replacement messages to be encrypted to obtain a semantic encoding feature vector of the message to be encrypted and a plurality of semantic encoding feature vectors of the synonym replacement messages to be encrypted; S4, using the semantic encoding feature vector of the message to be encrypted as a query feature vector and using the feature matrix obtained by arranging the semantic encoding feature vectors of the plurality of synonym replacement messages to be encrypted as an initial key matrix, inputting the query feature vector and the initial key matrix into a cross-domain attention gate query encoder based on local association enhancement of the key matrix to obtain a semantic synonym coverage enhanced feature vector of the message to be encrypted; S5, generating a ciphertext of the message to be encrypted based on the semantic synonym coverage enhanced feature vector of the message to be encrypted.
[0021] In particular, the S1 and S2 obtain the message to be encrypted; and perform keyword recognition and keyword synonym replacement on the message to be encrypted to obtain multiple synonym replacement messages to be encrypted. In the technical solution of the present application, multiple versions of synonym replacement messages to be encrypted are generated by applying a large language model for keyword recognition and synonym replacement, so as to enhance the privacy protection capability of identity information while maintaining the integrity of the information. In this way, the original single message to be encrypted can be converted into multiple versions, each version retains the core meaning of the original message, but differs in the specific expression. This diversity makes it difficult for an attacker to determine the original content even if he can intercept part of the message, because any single version cannot be directly mapped back to the original text, thereby avoiding the leakage of identity information.
[0022] In particular, the S3 performs semantic encoding on the message to be encrypted and the multiple synonymous replacement messages to be encrypted to obtain a semantic encoding feature vector of the message to be encrypted and a multiple semantic encoding feature vector of the synonymous replacement messages to be encrypted. In order to be able to perform semantic understanding on the message to be encrypted and the multiple synonymous replacement messages to be encrypted to capture the semantic features of these messages, in the technical solution of the present application, the message to be encrypted and the multiple synonymous replacement messages to be encrypted are further semantically encoded to extract the message semantic encoding feature information contained in the message to be encrypted and the multiple synonymous replacement messages to be encrypted, respectively, so as to obtain the semantic encoding feature vector of the message to be encrypted and the multiple semantic encoding feature vectors of the synonymous replacement messages to be encrypted. The semantic encoding process ensures that even after the message is replaced by a synonym, its core meaning and semantic features can still be captured and retained, which helps to retain the key features of the message during the encryption process, while removing redundant information, making the encryption process more efficient. In addition, in the subsequent encryption and decryption process, the receiver can reconstruct the original information content based on the feature vector without losing the true meaning of the information due to replacement.
[0023] In particular, in S4, the semantic coding feature vector of the message to be encrypted is used as the query feature vector and the feature matrix obtained by arranging the multiple semantic coding feature vectors of the synonymous replacement messages to be encrypted is used as the initial key matrix, and the query feature vector and the initial key matrix are input into the cross-domain attention gate query encoder based on the local association enhancement of the key matrix to obtain the semantic synonymous coverage enhancement feature vector of the message to be encrypted. Considering that each of the semantic coding feature vectors of the synonymous replacement messages to be encrypted in the multiple semantic coding feature vectors of the synonymous replacement messages to be encrypted respectively contains the semantic coding features of multiple synonymous replacement messages to be encrypted after different synonymous replacements of the message to be encrypted, these semantic coding features of the synonymous replacement messages to be encrypted have implicit associations and semantic connections, which can reflect the actual semantic information of the message to be encrypted. However, the traditional context coding method can usually only focus on the association between the query vector and the key vector, while ignoring the potential association between the semantic coding feature vectors of the synonymous replacement messages to be encrypted as key vectors. If the implicit association information contained in the key matrix composed of the semantic coding feature vectors of the message to be encrypted can be utilized, the accuracy of the semantic coverage enhancement feature representation and ciphertext generation of the message to be encrypted can be significantly improved. Based on this, in the technical solution of the present application, the semantic coding feature vector of the message to be encrypted is further used as the query feature vector and the feature matrix obtained by arranging the plurality of semantic coding feature vectors of the message to be encrypted is used as the initial key matrix, and the query feature vector and the initial key matrix are input into the cross-domain attention gate query encoder based on the local association enhancement of the key matrix to obtain the semantic coverage enhancement feature vector of the message to be encrypted. Specifically, the cross-domain attention gate query encoder based on the local association enhancement of the key matrix first calculates the feature distribution difference between the query feature vector and each row vector (key vector) in the initial key matrix to obtain a set of difference energy coefficients. That is, the semantic coding feature of the message to be encrypted is used as a soft anchor reference point and the feature distribution difference between the query feature vector and each key vector in the initial key matrix is measured by the feature distribution energy difference coefficient to obtain a set of difference energy coefficients. It should be understood that, considering that the query feature vector is a common soft anchor reference point, the set of feature distribution energy difference coefficients as a whole also contains the semantic association information between the semantic coding features of the to-be-encrypted synonymous replacement message. Therefore, the obtained difference energy coefficients reflect the similarity between the query vector and the key vector, and contain the semantic association information between the semantic coding feature vectors of the to-be-encrypted synonymous replacement message, i.e., the key vectors.Then, the energy coefficient of the feature distribution difference between the semantic coding feature of the message to be encrypted and the semantic coding feature of the message to be encrypted with the synonymous replacement is compared with a predetermined threshold. For the case where the coefficient is less than the threshold, the row vector in the key matrix is updated using the mean vector of the query feature vector and the corresponding row vector. Here, the update operation strengthens the feature vector corresponding to the semantic feature of the message to be encrypted with the synonymous replacement, which is more similar to the semantic coding feature of the message to be encrypted, that is, the features and semantics with higher relevance to the semantics of the message to be encrypted in the multiple semantic coding feature vectors of the message to be encrypted with the synonymous replacement are strengthened. Through the association strengthening mechanism, the pertinence of the key matrix and the quality of subsequent semantic query and semantic synonymous coverage strengthening are improved, which helps to generate identity encrypted ciphertext more accurately. Then, the semantic coding feature vector of the message to be encrypted is used as the query vector, each updated row vector in the updated key matrix is used as the key vector, and the semantic value vector of the message to be encrypted is used as the value vector. The cross-domain attention gate query module based on the Transformer structure is used to combine the query vector, the key vector and the value vector to perform feature self-attention calculation to achieve cross-domain information integration. The effect of the cross-domain attention mechanism is to allow the model to flow and integrate information between different semantic feature domains, improve the richness of information transmission and fusion representation between the semantic features of the message to be encrypted and the semantic features of the message to be encrypted with synonymous replacement, and thus generate a more comprehensive and representative feature vector, which not only contains the information of the original message, but also contains the information of its synonymous replacement version. Finally, by calculating the positional mean of the sequence of the cross-domain query attention vector of the semantics of the message to be encrypted with synonymous replacement, the final semantics of the message to be encrypted with synonymous coverage enhancement feature vector is obtained. The purpose is to comprehensively consider the information of all cross-domain query attention vectors in the sequence and generate a comprehensive semantic feature representation of the message to be encrypted. This feature representation comprehensively considers the semantic information of the original message to be encrypted and all synonymous replacement messages, improves the overall understanding ability of complex messages to be encrypted, as well as the robustness of the model and the expressiveness of the semantics of the message to be encrypted with synonymous coverage enhancement.
[0024] In an embodiment of the present application, the semantic coding feature vector of the message to be encrypted is used as a query feature vector and the feature matrix obtained by arranging the multiple semantic coding feature vectors of the synonymous replacement messages to be encrypted is used as an initial key matrix, and the query feature vector and the initial key matrix are input into a cross-domain attention gate query encoder based on the local association enhancement of the key matrix to obtain a semantic synonymous coverage enhanced feature vector of the message to be encrypted, including: using each semantic coding feature vector of the synonymous replacement messages to be encrypted in the multiple semantic coding feature vectors of the synonymous replacement messages to be encrypted as a row vector of the feature matrix to construct the initial key matrix; calculating the feature distribution difference energy coefficient between the semantic coding feature vector of the message to be encrypted and each row vector in the initial key matrix to obtain a set of semantic feature distribution difference energy coefficients of the synonymous replacement messages to be encrypted; comparing each semantic feature distribution difference energy coefficient of the synonymous replacement messages to be encrypted in the set of semantic feature distribution difference energy coefficients of the synonymous replacement messages to be encrypted with a predetermined threshold, and in response to the semantic feature distribution difference energy coefficients of the synonymous replacement messages to be encrypted, The energy coefficient of the difference in distribution of the semantic features of the encrypted synonymous replacement message is less than a predetermined threshold value, and the mean vector between the row vector in the initial key matrix corresponding to the energy coefficient of the difference in distribution of the semantic features of the synonymous replacement message to be encrypted and the semantic coding feature vector of the message to be encrypted is used as the updated row vector to obtain the updated key matrix; the semantic coding feature vector of the message to be encrypted is processed using the value embedding matrix and the value embedding vector to obtain the semantic value vector of the message to be encrypted; the semantic coding feature vector of the message to be encrypted is used as the query vector, each updated row vector in the updated key matrix is used as the key vector, and the semantic value vector of the message to be encrypted is used as the value vector, and the query vector, the key vector and the value vector are input into a cross-domain attention gate query module based on the Transformer structure to obtain a sequence of semantic cross-domain query attention vectors of the synonymous replacement message to be encrypted; the positional mean vector of the sequence of semantic cross-domain query attention vectors of the synonymous replacement message to be encrypted is calculated to obtain the semantic synonymous coverage enhancement feature vector of the message to be encrypted.
[0025] Among them, the process of calculating the feature distribution difference energy coefficients between the semantic coding feature vector of the message to be encrypted and each row vector in the initial key matrix to obtain a set of semantic feature distribution difference energy coefficients of the message to be encrypted synonymous replacement includes: calculating the semantic feature association representation vector of the message to be encrypted-the semantic feature association representation vector of the message to be encrypted between the semantic coding feature vector of the message to be encrypted and the predetermined row vector in the initial key matrix; extracting the maximum feature value in the semantic feature association representation vector of the message to be encrypted-the semantic feature association representation vector of the message to be encrypted-the semantic feature association representation vector of the message to be encrypted synonymous replacement to be encrypted to obtain the maximum representation value of the semantic feature association of the message to be encrypted-the semantic feature association representation vector of the message to be encrypted synonymous replacement to be encrypted; calculating the mean and variance of the predetermined row vectors in the initial key matrix to obtain the semantic feature association representation vector of the message to be encrypted synonymous replacement to be encrypted. The first feature distribution difference energy factor is obtained by adding the semantic feature variance of the synonymous replacement message to be encrypted and the hyperparameter. The square of the difference between the maximum representation value of the semantic association between the message to be encrypted and the semantic feature mean of the synonymous replacement message to be encrypted is calculated to obtain the semantic feature difference value. The semantic feature variance of the synonymous replacement message to be encrypted is multiplied by a constant two and then added to the semantic feature difference value and the hyperparameter to obtain the second feature distribution difference energy factor. The first feature distribution difference energy factor is divided by the second feature distribution difference energy factor to obtain the semantic feature distribution difference energy coefficient of the synonymous replacement message to be encrypted. Specifically, the process of calculating the semantic feature association representation vector of the message to be encrypted - the semantic feature association representation vector of the message to be encrypted replaced by a synonym between the semantic encoding feature vector of the message to be encrypted and the predetermined row vector in the initial key matrix includes: respectively calculating the positional difference, positional dot multiplication and positional addition between the semantic encoding feature vector of the message to be encrypted and the predetermined row vector in the initial key matrix to obtain the semantic feature vector of the message to be encrypted - the semantic feature difference of the message to be encrypted replaced by a synonym, the semantic feature vector of the message to be encrypted - the semantic dot product feature vector of the message to be encrypted replaced by a synonym and the semantic feature vector of the message to be encrypted - the semantic feature sum feature vector of the message to be encrypted replaced by a synonym; cascading the semantic feature vector of the message to be encrypted - the semantic feature difference of the message to be encrypted replaced by a synonym, the semantic feature vector of the message to be encrypted - the semantic feature dot product feature vector of the message to be encrypted - the semantic feature sum feature vector of the message to be encrypted - the semantic feature sum of the message to be encrypted replaced by a synonym, and processing them through a one-dimensional convolutional layer, and performing maximum pooling processing on the obtained feature vector to obtain the semantic feature association representation vector of the message to be encrypted - the semantic feature association representation vector of the message to be encrypted replaced by a synonym.
[0026] More specifically, the process of using a value embedding matrix and a value embedding vector to process the semantic encoding feature vector of the message to be encrypted to obtain the semantic value vector of the message to be encrypted includes: calculating the matrix multiplication between the semantic encoding feature vector of the message to be encrypted and the value embedding matrix, and then adding it positionally with the value embedding vector to obtain the semantic value vector of the message to be encrypted.
[0027] More specifically, the process of taking the semantic encoding feature vector of the message to be encrypted as the query vector, each updated row vector in the update key matrix as the key vector and the semantic value vector of the message to be encrypted as the value vector, and inputting the query vector, the key vector and the value vector into a cross-domain attention gate query module based on the Transformer structure to obtain a sequence of semantic cross-domain query attention vectors of synonymous replacement message to be encrypted includes: after calculating the product between the query vector and the transposed vector of the key vector, dividing the obtained query-key feature association value by the square root of the length of the key vector to obtain a query-key feature association coefficient; inputting the query-key feature association coefficient into a softmax function to obtain a query-key feature association weight value; and using the query-key feature association weight value as a weight to weight the transposed vector of the value vector to obtain the semantic cross-domain query attention vector of synonymous replacement message to be encrypted.
[0028] In summary, in the above embodiment, the semantic coding feature vector of the message to be encrypted is used as the query feature vector and the feature matrix obtained by arranging the semantic coding feature vectors of the message to be encrypted by replacing the multiple synonyms is used as the initial key matrix, and the query feature vector and the initial key matrix are input into the cross-domain attention gate query encoder based on the local association enhancement of the key matrix to obtain the semantic synonym coverage enhancement feature vector of the message to be encrypted, including: using the semantic coding feature vector of the message to be encrypted as the query feature vector and the feature matrix obtained by arranging the semantic coding feature vectors of the message to be encrypted by replacing the multiple synonyms is used as the initial key matrix, and the query feature vector and the initial key matrix are input into the cross-domain attention gate query encoder based on the local association enhancement of the key matrix to process with the following cross-domain attention gate query formula to obtain the semantic synonym coverage enhancement feature vector of the message to be encrypted; wherein, the cross-domain attention gate query formula is: ;in, is the initial key matrix obtained by arranging the semantic encoding feature vectors of the multiple synonymous replacement messages to be encrypted, for each of the plurality of semantic encoding feature vectors of synonymous replacement messages to be encrypted, The first of the plurality of semantic encoding feature vectors of the synonymous replacement messages to be encrypted is The semantic encoding feature vector of the synonymous substitution message to be encrypted, is the query feature vector, , and Respectively represent positional subtraction, positional dot multiplication, and positional addition, Indicates cascade processing, is a one-dimensional convolution operation, is the maximum pooling operation, For the said The feature association representation vector corresponding to the semantic encoding feature vector of the synonymous replacement message to be encrypted, Indicates the maximum value operation. and They are respectively The feature mean and feature variance corresponding to the semantic encoding feature vector of the synonymous replacement message to be encrypted, is a hyperparameter, For the said The energy coefficient of feature distribution difference corresponding to the semantic encoding feature vector of the synonymous replacement message to be encrypted, is the predetermined threshold, For the said The updated semantic encoding feature vector of the to-be-encrypted synonymous replacement message corresponding to the semantic encoding feature vector of the to-be-encrypted synonymous replacement message is, The updated key matrix is obtained by matrixing the semantic encoding feature vectors of each updated synonymous replacement message to be encrypted. is the value embedding matrix, is the value embedding vector, is the value vector corresponding to the query feature vector, for function, is the length of the semantic encoding feature vector of each updated synonymous replacement message to be encrypted, For the said The cross-domain query attention vector corresponding to the semantic encoding feature vector of the synonymous replacement message to be encrypted, is the number of vectors in the semantic encoding feature vectors of the multiple synonymous replacement messages to be encrypted, The semantic proximity coverage enhancement feature vector of the message to be encrypted.
[0029] In particular, the S5 generates the ciphertext of the message to be encrypted based on the semantic synonymous coverage enhancement feature vector of the message to be encrypted. In a specific example of the present application, the semantic synonymous coverage enhancement feature vector of the message to be encrypted is input into a decoder-based ciphertext generator to obtain the ciphertext corresponding to the message to be encrypted. That is, the decoding regression is performed using the synonymous coverage enhancement feature of the semantics of the message to be encrypted to generate the ciphertext. In this way, not only the semantic characteristics of the message to be encrypted are taken into account, but also through the design of the ciphertext generator, even the same original text can generate different ciphertexts in different encryption scenarios, thereby enhancing the overall security of the identity encryption scheme.
[0030] In a preferred example, the input of the semantic synonymous coverage enhancement feature vector of the message to be encrypted into a decoder-based ciphertext generator to obtain the ciphertext corresponding to the message to be encrypted includes: determining the maximum eigenvalue of the semantic synonymous coverage enhancement of the message to be encrypted and the minimum eigenvalue of the semantic synonymous coverage enhancement of the message to be encrypted of the semantic synonymous coverage enhancement feature vector of the message to be encrypted, and calculating the mean of the semantic synonymous coverage enhancement of the message to be encrypted and the standard deviation of the semantic synonymous coverage enhancement of the message to be encrypted of the feature set of the semantic synonymous coverage enhancement feature vector of the message to be encrypted; calculating the quotient of the mean of the semantic synonymous coverage enhancement of the message to be encrypted and the standard deviation of the semantic synonymous coverage enhancement of the message to be encrypted to obtain the statistical normalized value of the semantic synonymous coverage enhancement of the message to be encrypted; calculating the inverse of each eigenvalue of the semantic synonymous coverage enhancement feature vector of the message to be encrypted, and quoting it with the maximum eigenvalue of the semantic synonymous coverage enhancement and the standard deviation of the semantic synonymous coverage enhancement of the message to be encrypted. After multiplying the difference of the minimum eigenvalues of the semantic synonymous coverage enhancement of the message to be encrypted, the difference is subtracted from the statistical normalized value of the semantic synonymous coverage enhancement of the message to be encrypted to obtain an approximate vector of the semantic synonymous coverage enhancement distribution of the message to be encrypted; an exponential function of each eigenvalue of the approximate vector of the semantic synonymous coverage enhancement distribution of the message to be encrypted is calculated with a natural constant as the base to obtain an approximate vector of the semantic synonymous coverage enhancement distribution of the message to be encrypted; the approximate vector of the semantic synonymous coverage enhancement distribution of the message to be encrypted is added to the statistical normalized value of the semantic synonymous coverage enhancement of the message to be encrypted, and the logarithm with base two of the absolute value of each eigenvalue of the added vector is calculated to obtain an optimized semantic synonymous coverage enhancement feature vector of the message to be encrypted; and the optimized semantic synonymous coverage enhancement feature vector of the message to be encrypted is input into a decoder-based ciphertext generator to obtain a ciphertext corresponding to the message to be encrypted.
[0031] Among them, the semantic close coverage enhanced feature vector of the message to be encrypted is recorded as The optimization expression is: ;in, is the semantic close coverage enhanced feature vector of the message to be encrypted, is the semantic proximity coverage enhancement mean of the message to be encrypted, is the semantic proximity coverage enhancement standard deviation of the message to be encrypted, The statistical normalization value of semantic proximity coverage of the message to be encrypted is strengthened, and are respectively the maximum eigenvalue of the semantics proximity coverage enhancement of the message to be encrypted and the minimum eigenvalue of the semantics proximity coverage enhancement of the message to be encrypted, and is the difference between the maximum eigenvalue of the semantic proximity coverage enhancement of the message to be encrypted and the minimum eigenvalue of the semantic proximity coverage enhancement of the message to be encrypted, is the semantic close-meaning coverage reinforcement distribution approximate vector of the message to be encrypted, is the exponential operation, is the logarithm to base 2, For point addition, is the dot product, For point reduction, It is the optimized semantic proximity coverage enhanced feature vector of the message to be encrypted.
[0032] Here, in the preferred example, since the semantic encoding feature vector of the message to be encrypted and the multiple semantic encoding feature vectors of the synonymous replacement messages to be encrypted respectively represent the encoded semantic features of the message to be encrypted and the synonymous replacement messages to be encrypted, when they are input into the cross-domain attention gate query encoder based on the local association enhancement of the key matrix, the encoded semantic differences attributed to the source semantic differences of each message will also cause the local association enhancement attention differences of the key matrix, so that the semantic synonymous coverage enhancement feature vector of the message to be encrypted will also have a diversified set expression distribution of cross-domain query-style aggregated features. Therefore, it is expected to improve the balance between the regression mapping accuracy and completeness when the semantic synonymous coverage enhancement feature vector of the message to be encrypted is input into the decoder-based ciphertext generator for decoding regression, thereby improving the semantic accuracy of the obtained ciphertext.
[0033] Therefore, by performing random statistical normalization on the diversified feature set of the semantic synonymous coverage enhanced feature vector of the message to be encrypted, the confidence space constructed based on the overall feature value of the semantic synonymous coverage enhanced feature vector of the message to be encrypted is approximated by the standardized continuous probability density distribution relative to the response hypothesis test of each feature value of the semantic synonymous coverage enhanced feature vector of the message to be encrypted, so as to establish the target reachability of the diversified feature distribution of the semantic synonymous coverage enhanced feature vector of the message to be encrypted to the unified regression target, so as to achieve the balanced executableness between mapping accuracy and mapping completeness in the decoding regression process based on the diversified feature distribution of the semantic synonymous coverage enhanced feature vector of the message to be encrypted, and improve the semantic accuracy of the ciphertext corresponding to the message to be encrypted obtained by the semantic synonymous coverage enhanced feature input to the decoder-based ciphertext generator. In this way, more intelligent identity encryption can be realized by using artificial intelligence technology and large language models, thereby enhancing the security of identity information while ensuring the integrity of the message to be encrypted.
[0034] In summary, the identity encryption method based on the large language model according to the embodiment of the present application is explained, which can generate multiple versions of synonymous replacement messages to be encrypted by using the large language model for keyword recognition and synonym replacement after collecting the message to be encrypted, so as to enhance the privacy protection ability of the information while maintaining the integrity of the information. Then, a semantic understanding algorithm based on artificial intelligence and natural language processing technology is introduced at the back end to perform comprehensive analysis and cross-domain semantic association encoding on multiple synonymous replacement messages to be encrypted and messages to be encrypted, so as to perform synonymous coverage and enhanced representation of the semantics of the encrypted message, thereby encrypting and generating ciphertext. In this way, more intelligent identity encryption can be achieved by using artificial intelligence technology and a large language model, thereby enhancing the security of identity information while ensuring the integrity of the message to be encrypted.
[0035] Furthermore, an identity encryption system based on a large language model is also provided.
[0036] Figure 3 FIG. 1 is a block diagram of an identity encryption system based on a large language model according to an embodiment of the present application. Figure 3As shown, according to the embodiment of the present application, the identity encryption system 300 based on the large language model includes: a message acquisition module 310 to be encrypted, which is used to obtain the message to be encrypted; a keyword recognition module 320, which is used to perform keyword recognition on the message to be encrypted and perform keyword synonym replacement to obtain multiple synonym replacement messages to be encrypted; a semantic encoding module 330, which is used to perform semantic encoding on the message to be encrypted and the multiple synonym replacement messages to be encrypted to obtain a semantic encoding feature vector of the message to be encrypted and a plurality of semantic encoding feature vectors of the synonym replacement messages to be encrypted; a cross-domain attention gate query encoding module 340, which is used to use the semantic encoding feature vector of the message to be encrypted as a query feature vector and the feature matrix obtained by arranging the semantic encoding feature vectors of the multiple synonym replacement messages to be encrypted as an initial key matrix, and input the query feature vector and the initial key matrix into a cross-domain attention gate query encoder based on the local association enhancement of the key matrix to obtain a semantic synonym coverage enhanced feature vector of the message to be encrypted; a ciphertext generation module 350, which is used to generate the ciphertext of the message to be encrypted based on the semantic synonym coverage enhanced feature vector of the message to be encrypted.
[0037] As described above, the identity encryption system 300 based on a large language model according to the embodiment of the present application can be implemented in various wireless terminals, such as a server with an identity encryption algorithm based on a large language model. In a possible implementation, the identity encryption system 300 based on a large language model according to the embodiment of the present application can be integrated into the wireless terminal as a software module and / or a hardware module. For example, the identity encryption system 300 based on a large language model can be a software module in the operating system of the wireless terminal, or can be an application developed for the wireless terminal; of course, the identity encryption system 300 based on a large language model can also be one of the many hardware modules of the wireless terminal.
[0038] Alternatively, in another example, the large language model-based identity encryption system 300 and the wireless terminal may also be separate devices, and the large language model-based identity encryption system 300 may be connected to the wireless terminal via a wired and / or wireless network and transmit interactive information in accordance with an agreed data format.
[0039] In a specific example, the decryption process is as follows: 1. Define encryption rules: (1) Design a set of rules based on character replacement, position transformation or other cryptographic techniques.
[0040] (2) These rules should be reversible so that the receiver can decrypt the information.
[0041] (3) The rules should be complex enough to prevent them from being easily cracked by unauthorized third parties.
[0042] 2. Prepare training data: (1) Prepare a large amount of training data related to the selected encryption rules.
[0043] (2) This data may include pairs of plaintext and corresponding ciphertext, or text that has been tokenized in some form so that the model can learn how to apply these rules.
[0044] 3. Train the language model: (1) Use the above training dataset to train a large language model.
[0045] (2) The training process should enable the model to learn to recognize and generate text that conforms to encryption rules.
[0046] 4. Generate encrypted text: (1) When a message needs to be encrypted, use the trained model to generate the encrypted text.
[0047] (2) This can be achieved by giving the plaintext and letting the model generate the corresponding ciphertext based on the learned rules.
[0048] 5. Decryption process: (1) The receiver should have the same decryption rules and preferably have access to the same or similar language model in order to correctly decode the received information.
[0049] (2) The decryption process can be regarded as a reverse encryption process, during which the model converts the ciphertext back to plaintext according to the decryption rules.
[0050] The embodiments of the present disclosure have been described above, and the above description is exemplary, not exhaustive, and is not limited to the disclosed embodiments. Many modifications and changes will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described embodiments. The selection of terms used herein is intended to best explain the principles of the embodiments, practical applications, or improvements to the technology in the market, or to enable other persons of ordinary skill in the art to understand the embodiments disclosed herein.
Claims
1. An identity encryption method based on a large language model, characterized in that: include: Get the message to be encrypted; Performing keyword recognition on the message to be encrypted and performing keyword synonymous replacement to obtain a plurality of synonymous replacement messages to be encrypted; The message to be encrypted and the multiple synonymous replacement messages to be encrypted are semantically encoded to obtain a semantic encoding feature vector of the message to be encrypted and multiple semantic encoding feature vectors of the synonymous replacement messages to be encrypted; the semantic encoding feature vector of the message to be encrypted is used as a query feature vector and a feature matrix obtained by arranging the semantic encoding feature vectors of the multiple synonymous replacement messages to be encrypted is used as an initial key matrix, the query feature vector and the initial key matrix are input into a cross-domain attention gate query encoder based on local correlation enhancement of the key matrix to obtain a semantic synonymous coverage enhanced feature vector of the message to be encrypted; based on the semantic synonymous coverage enhanced feature vector of the message to be encrypted, a ciphertext of the message to be encrypted is generated.
2. The identity encryption method based on a large language model according to claim 1, characterized in that: The semantic coding feature vector of the message to be encrypted is used as a query feature vector and the feature matrix obtained by arranging the multiple semantic coding feature vectors of the synonymous replacement messages to be encrypted is used as an initial key matrix, and the query feature vector and the initial key matrix are input into a cross-domain attention gate query encoder based on the local association enhancement of the key matrix to obtain the semantic synonymous coverage enhanced feature vector of the message to be encrypted, including: using each semantic coding feature vector of the synonymous replacement message to be encrypted in the multiple semantic coding feature vectors of the synonymous replacement messages to be encrypted as a row vector of the feature matrix to construct the initial key matrix; calculating the feature distribution difference energy coefficient between the semantic coding feature vector of the message to be encrypted and each row vector in the initial key matrix to obtain a set of semantic feature distribution difference energy coefficients of the synonymous replacement messages to be encrypted; comparing each semantic feature distribution difference energy coefficient of the synonymous replacement messages to be encrypted in the set of semantic feature distribution difference energy coefficients of the synonymous replacement messages to be encrypted with a predetermined threshold, and in response to the synonymous replacement messages to be encrypted, The energy coefficient of the difference in the distribution of the semantic features of the replacement message is less than a predetermined threshold value, and the row vector in the initial key matrix corresponding to the energy coefficient of the difference in the distribution of the semantic features of the replacement message to be encrypted and the mean vector between the semantic coding feature vector of the message to be encrypted are used as the updated row vector to obtain the updated key matrix; the semantic coding feature vector of the message to be encrypted is processed using the value embedding matrix and the value embedding vector to obtain the semantic value vector of the message to be encrypted; the semantic coding feature vector of the message to be encrypted is used as the query vector, each updated row vector in the updated key matrix is used as the key vector, and the semantic value vector of the message to be encrypted is used as the value vector, and the query vector, the key vector and the value vector are input into the cross-domain attention gate query module based on the Transformer structure to obtain a sequence of the semantic cross-domain query attention vector of the synonymous replacement message to be encrypted; the positional mean vector of the sequence of the semantic cross-domain query attention vector of the synonymous replacement message to be encrypted is calculated to obtain the semantic synonymous coverage enhancement feature vector of the message to be encrypted.
3. The identity encryption method based on a large language model according to claim 2, characterized in that: The feature distribution difference energy coefficients between the semantic coding feature vector of the message to be encrypted and each row vector in the initial key matrix are calculated to obtain a set of semantic feature distribution difference energy coefficients of the message to be encrypted, including: calculating the semantic feature association representation vector of the message to be encrypted-semantic feature association representation vector of the message to be encrypted between the semantic coding feature vector of the message to be encrypted and the predetermined row vector in the initial key matrix; extracting the maximum feature value in the semantic feature association representation vector of the message to be encrypted-semantic feature association representation vector of the message to be encrypted-semantic feature association representation vector of the message to be encrypted to obtain the maximum representation value of the semantic feature association of the message to be encrypted-semantic feature association of the message to be encrypted-semantic feature association of the message to be encrypted; calculating the mean and variance of the predetermined row vector in the initial key matrix to obtain the semantic feature of the message to be encrypted The method comprises the following steps: calculating the mean and variance of the semantic features of the synonymous replacement message to be encrypted; adding the variance of the semantic features of the synonymous replacement message to be encrypted and the hyperparameter to obtain a first feature distribution difference energy factor; calculating the square of the difference between the maximum representation value of the semantic association between the message to be encrypted and the semantics of the synonymous replacement message to be encrypted and the mean of the semantic features of the synonymous replacement message to be encrypted to obtain a semantic feature difference value; multiplying the variance of the semantic features of the synonymous replacement message to be encrypted by a constant two and then adding it to the semantic feature difference value and the hyperparameter to obtain a second feature distribution difference energy factor; dividing the first feature distribution difference energy factor by the second feature distribution difference energy factor to obtain the semantic feature distribution difference energy coefficient of the synonymous replacement message to be encrypted.
4. The identity encryption method based on a large language model according to claim 3, characterized in that: Calculate the semantics of the message to be encrypted - the semantics of the message to be encrypted replaced by a synonym between the semantic coding feature vector of the message to be encrypted and the predetermined row vector in the initial key matrix, including: respectively calculating the positional difference, positional dot multiplication and positional addition between the semantic coding feature vector of the message to be encrypted and the predetermined row vector in the initial key matrix to obtain the semantics of the message to be encrypted - the semantics of the message to be encrypted replaced by a synonym differential feature vector, the semantics of the message to be encrypted - the semantics dot product feature vector of the message to be encrypted replaced by a synonym and the semantics of the message to be encrypted - the semantics sum feature vector of the message to be encrypted replaced by a synonym; cascade the semantics of the message to be encrypted - the semantics difference feature vector of the message to be encrypted replaced by a synonym, the semantics dot product feature vector of the message to be encrypted - the semantics sum feature vector of the message to be encrypted replaced by a synonym and the semantics of the message to be encrypted - the semantics sum feature vector of the message to be encrypted replaced by a synonym, and then process them through a one-dimensional convolutional layer, and perform maximum pooling on the obtained feature vector to obtain the semantics of the message to be encrypted - the semantics of the message to be encrypted replaced by a synonym associative feature vector.
5. The identity encryption method based on a large language model according to claim 4 is characterized in that: The semantic encoding feature vector of the message to be encrypted is processed using a value embedding matrix and a value embedding vector to obtain a semantic value vector of the message to be encrypted, including: calculating matrix multiplication between the semantic encoding feature vector of the message to be encrypted and the value embedding matrix, and then adding the matrix multiplication with the value embedding vector positionally to obtain the semantic value vector of the message to be encrypted.
6. The identity encryption method based on a large language model according to claim 5, characterized in that: The semantic encoding feature vector of the message to be encrypted is used as a query vector, each updated row vector in the update key matrix is used as a key vector, and the semantic value vector of the message to be encrypted is used as a value vector. The query vector, the key vector and the value vector are input into a cross-domain attention gate query module based on a Transformer structure to obtain a sequence of semantic cross-domain query attention vectors of synonymous replacement messages to be encrypted, including: after calculating the product between the query vector and the transposed vector of the key vector, the obtained query-key feature association value is divided by the square root of the length of the key vector to obtain a query-key feature association coefficient; the query-key feature association coefficient is input into a softmax function to obtain a query-key feature association weight value; the query-key feature association weight value is used as a weight to weight the transposed vector of the value vector to obtain the semantic cross-domain query attention vector of synonymous replacement messages to be encrypted.
7. The identity encryption method based on a large language model according to claim 6, characterized in that: Based on the semantic proximity coverage enhancement feature vector of the message to be encrypted, generating the ciphertext of the message to be encrypted, including: inputting the semantic proximity coverage enhancement feature vector of the message to be encrypted into a decoder-based ciphertext generator to obtain the ciphertext corresponding to the message to be encrypted.
8. An identity encryption system based on a large language model, characterized in that: include: A module for obtaining a message to be encrypted, used to obtain the message to be encrypted; A keyword recognition module, used for performing keyword recognition on the message to be encrypted and performing keyword synonymous replacement to obtain a plurality of synonymous replacement messages to be encrypted; A semantic encoding module is used to perform semantic encoding on the message to be encrypted and the multiple synonymous replacement messages to be encrypted to obtain a semantic encoding feature vector of the message to be encrypted and multiple semantic encoding feature vectors of the synonymous replacement messages to be encrypted; a cross-domain attention gate query encoding module is used to use the semantic encoding feature vector of the message to be encrypted as a query feature vector and a feature matrix obtained by arranging the semantic encoding feature vectors of the multiple synonymous replacement messages to be encrypted as an initial key matrix, and input the query feature vector and the initial key matrix into a cross-domain attention gate query encoder based on local correlation enhancement of the key matrix to obtain a semantic synonymous coverage enhanced feature vector of the message to be encrypted; a ciphertext generation module is used to generate a ciphertext of the message to be encrypted based on the semantic synonymous coverage enhanced feature vector of the message to be encrypted.
