Data encryption method and device, computer equipment and storage medium
By combining deep learning algorithms and traditional encryption technology, feature data is extracted and encryption processed according to encryption level and key type, the problems of inefficiency and inconvenience of traditional data encryption methods are solved, and efficient and convenient data encryption is achieved.
Patent Information
- Application Number
- CN202411578820.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-06
- Publication Date
- 2025-02-14
AI Technical Summary
Traditional data encryption methods have problems such as low encryption efficiency or low convenience, which is difficult to meet the needs of mobile data security.
Data encryption methods combining deep learning algorithms and traditional encryption technology are adopted to achieve data encryption through steps such as feature extraction, encryption level classification and key type determination. The specific steps include receiving the data to be encrypted, performing feature extraction, inputting the feature data set to obtain the encryption level and encryption policy, and encrypting processing according to the key type and encryption policy.
It improves the efficiency and convenience of data encryption, and can intelligently analyze and adaptively determine data encryption strategies based on different data types and security needs to realize adaptive data encryption.
Smart Images

Figure CN119442285A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing technology, and in particular to a data encryption method, device, computer equipment and storage medium. Background Art
[0002] With the widespread use of mobile devices, data security issues have become increasingly prominent. This paper proposes an innovative solution for mobile data encryption using artificial intelligence (AI). By combining deep learning algorithms with traditional encryption technology, the design principles, key technologies, view display, and flow charts of the solution are elaborated in detail, and the specific implementation methods of AI technology in the solution are emphasized, providing a new solution for mobile data security.
[0003] However, traditional data encryption methods have problems such as low encryption efficiency or low convenience. Summary of the invention
[0004] Based on this, it is necessary to provide a data encryption method, device, computer equipment and storage medium that can improve encryption efficiency and convenience in response to the above technical problems.
[0005] In a first aspect, a data encryption method is provided, the method comprising:
[0006] Receiving the data to be encrypted of the software application sent by the mobile terminal, and performing feature extraction on the data to be encrypted to obtain a feature data set; wherein the data to be encrypted includes text, pictures, audio and video;
[0007] The feature data set is input into the pre-trained encryption level classification neural network model to obtain the data encryption level, and the corresponding encryption strategy is obtained by querying the encryption strategy database according to the data encryption level; the encryption strategy is used to characterize the data encryption method and data encryption complexity;
[0008] Obtain the key type corresponding to the data to be encrypted, and encrypt the data to be encrypted according to the key type and encryption strategy to obtain the encrypted data.
[0009] In one of the examples, feature extraction is performed on the encrypted data to obtain a feature data set, including:
[0010] The data to be encrypted is input into a pre-trained feature extraction neural network model to obtain a feature data set; wherein the feature data set includes one or more of data texture features, data shape features, data semantic features, user behavior features and data environment features.
[0011] In one of the embodiments, the method also includes: obtaining a preset number of historical data to be encrypted and corresponding security labels of software applications; the security labels are used to characterize the historical data encryption levels of the corresponding data samples to be encrypted; feature extraction is performed on the historical data to be encrypted to obtain historical feature data sets and corresponding security labels; each historical feature data set and the corresponding security label is randomly divided to generate a training sample set and a test sample set; a preset encryption level classification initial neural network model is trained according to the training sample set, and the encryption level classification initial neural network model is tested according to the test sample set, and the model parameters of the encryption level classification initial neural network model are adjusted based on the indicators obtained from the training and testing until the indicators meet the preset requirements, and an encryption level classification neural network model is generated to output the data encryption level based on the encryption level classification neural network model; wherein the encryption level classification initial neural network model adopts a CNN convolutional neural network, an RNN recurrent neural network or an LSTM long short-term memory network.
[0012] In one of the embodiments, obtaining the key type corresponding to the data to be encrypted includes: obtaining the data access phase of the data to be encrypted; wherein the data access phase includes the system initialization phase, the system startup phase or the data transmission phase of the software application; determining the corresponding key type according to the data access phase; wherein the key type includes a master key, a session key or a data key.
[0013] In one of the embodiments, encrypting the data to be encrypted according to the key type and the encryption strategy to obtain the encrypted data includes: calling a random number generator to generate an encryption key according to the key type and the encryption strategy; encrypting the data to be encrypted according to the encryption key to obtain the encrypted data.
[0014] In one of the embodiments, the method also includes: storing encrypted data; in response to receiving key verification information sent by the software application when accessing data, performing key verification processing according to the key verification information to obtain a key verification result and a corresponding decryption key; the key verification result includes verification success or verification failure; if the key verification result is verification success, decrypting the encrypted data according to the decryption key to obtain decrypted encrypted data; if the key verification result is verification failure, feeding back the key verification result.
[0015] In one of the embodiments, the method further includes: monitoring the data traffic of the software application, and determining whether the software application has data access anomalies based on the data traffic; if there is a data access anomaly, outputting access anomaly alarm information to update the data encryption level based on the access anomaly alarm information.
[0016] In a second aspect, a data encryption device is provided, the device comprising a data receiving module, a policy query module and an encryption processing module.
[0017] Among them, the data receiving module is used to receive the data to be encrypted of the software application sent by the mobile terminal, and perform feature extraction on the data to be encrypted to obtain a feature data set; wherein the data to be encrypted includes text, pictures, audio and video; the policy query module is used to input the feature data set into a pre-trained encryption level classification neural network model to obtain the data encryption level, and obtain the corresponding encryption policy after querying the encryption policy database according to the data encryption level; the encryption policy is used to characterize the data encryption method and data encryption complexity; the encryption processing module is used to obtain the key type corresponding to the data to be encrypted, and obtain the encrypted data after encrypting the data to be encrypted according to the key type and encryption strategy.
[0018] In a third aspect, a computer device is provided. The computer device includes a memory and a processor. The memory stores a computer program. When the processor executes the computer program, the steps of any method in the above method embodiments are implemented.
[0019] In a fourth aspect, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps of any method in the above method embodiments are implemented.
[0020] The above-mentioned data encryption method, device, computer equipment and storage medium receive the data to be encrypted of the software application sent by the mobile terminal, and extract features of the data to be encrypted to obtain a feature data set; wherein the data to be encrypted includes text, pictures, audio and video; then, the feature data set is input into a pre-trained encryption level classification neural network model to obtain the data encryption level, and the corresponding encryption policy is obtained after querying the encryption policy database according to the data encryption level; the encryption policy is used to characterize the data encryption method and data encryption complexity; then, the secret key type corresponding to the data to be encrypted is obtained, and the encrypted data is obtained after encrypting the data according to the secret key type and the encryption policy, which improves the efficiency and convenience of obtaining the data encryption level and is conducive to adaptively obtaining the data encryption level of the data to be encrypted. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] Figure 1 A diagram of an application environment of a data encryption method in an embodiment;
[0022] Figure 2 A first flow chart of a data encryption method in one embodiment;
[0023] Figure 3 A second flow chart of a data encryption method in one embodiment;
[0024] Figure 4A schematic diagram of a process for obtaining a key type corresponding to data to be encrypted in one embodiment;
[0025] Figure 5 A schematic diagram of a process of obtaining encrypted data after encrypting the data to be encrypted according to the key type and the encryption strategy in one embodiment;
[0026] Figure 6 A third flow chart of a data encryption method in one embodiment;
[0027] Figure 7 A fourth flow chart of a data encryption method in one embodiment;
[0028] Figure 8 is a structural block diagram of a data encryption device in one embodiment;
[0029] Fig. 9 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0030] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0031] In order to facilitate understanding of the present application, the present application will be described more fully below with reference to the relevant drawings. Embodiments of the present application are provided in the drawings. However, the present application can be implemented in many different forms and is not limited to the embodiments described herein. On the contrary, the purpose of providing these embodiments is to make the disclosure of the present application more thorough and comprehensive.
[0032] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein in the specification of this application are only for the purpose of describing specific embodiments and are not intended to limit this application.
[0033] It is understood that the terms "first", "second", etc. used in this application may be used herein to describe various elements, but these elements are not limited by these terms. These terms are only used to distinguish a first element from another element. For example, without departing from the scope of this application, a first resistor may be referred to as a second resistor, and similarly, a second resistor may be referred to as a first resistor. Both the first resistor and the second resistor are resistors, but they are not the same resistor.
[0034] It can be understood that the “connection” in the following embodiments should be understood as “electrical connection”, “communication connection”, etc. if the connected circuits, modules, units, etc. have electrical signals or data transmission between each other.
[0035] When used herein, the singular forms "a", "an", and "said / the" may also include plural forms, unless the context clearly indicates otherwise. It should also be understood that the terms "include / comprise" or "have" etc. specify the presence of stated features, wholes, steps, operations, components, parts or combinations thereof, but do not exclude the possibility of the presence or addition of one or more other features, wholes, steps, operations, components, parts or combinations thereof.
[0036] The data encryption method provided in this application can be applied to Figure 1 In the application environment shown, the mobile terminal 102 communicates with the server 104 through a network. The mobile terminal 102 may be, but is not limited to, various personal computers, laptops, smart phones, tablet computers, and portable wearable devices, and the server 104 may be implemented as an independent server or a server cluster consisting of multiple servers.
[0037] In one embodiment, Figure 2 As shown, a data encryption method is provided, which is applied to Figure 1 The server 104 in the example is used for explanation, and the steps include the following steps 201 to 203.
[0038] Step 201: receiving data to be encrypted of a software application sent by a mobile terminal, and performing feature extraction on the data to be encrypted to obtain a feature data set.
[0039] The data to be encrypted includes text, pictures, audio and video. Specifically, the server 104 receives the data to be encrypted of the software application sent by the mobile terminal 102, and performs feature extraction on the data to be encrypted to obtain a feature data set.
[0040] In one of the examples, feature extraction is performed on the encrypted data to obtain a feature data set, including:
[0041] The data to be encrypted is input into a pre-trained feature extraction neural network model to obtain a feature data set.
[0042] The feature data set includes one or more of data texture features, data shape features, data semantic features, user behavior features, and data environment features. The server 104 can input the data to be encrypted into a pre-trained feature extraction neural network model to obtain a feature data set, thereby improving the efficiency, accuracy, and convenience of feature extraction.
[0043] In this embodiment, the data to be encrypted is input into a pre-trained feature extraction neural network model to obtain a feature data set, thereby improving the efficiency, accuracy and convenience of feature extraction.
[0044] Step 202, input the feature data set into a pre-trained encryption level classification neural network model to obtain the data encryption level, and query the encryption policy database according to the data encryption level to obtain the corresponding encryption policy.
[0045] The encryption strategy is used to characterize the data encryption method and data encryption complexity. The encryption strategy database is used to store the encryption strategy corresponding to each data encryption level. In a specific example, the data encryption method may include, but is not limited to, symmetric encryption and asymmetric encryption. The data encryption complexity is used to characterize the complexity of the encryption key. The above are only specific examples, which can be flexibly set according to user needs in actual applications and are not limited here.
[0046] Specifically, the server 104 obtains the data encryption level after inputting the feature data set into the pre-trained encryption level classification neural network model, and obtains the corresponding encryption policy after querying the encryption policy database according to the data encryption level.
[0047] In one embodiment, if Figure 3 As shown, the method further includes steps 301 to 304.
[0048] Step 301: Obtain a preset number of historical data to be encrypted and corresponding security tags of software applications.
[0049] Step 302: extract features from historical data to be encrypted to obtain a historical feature data set and a corresponding security label.
[0050] Step 303: Randomly divide each historical feature data set and the corresponding security label to generate a training sample set and a test sample set.
[0051] Step 304, train the preset encryption level classification initial neural network model according to the training sample set, and test the encryption level classification initial neural network model according to the test sample set, adjust the model parameters of the encryption level classification initial neural network model based on the indicators obtained from the training and testing, until the indicators meet the preset requirements, generate the encryption level classification neural network model, and output the data encryption level based on the encryption level classification neural network model.
[0052] Among them, the security label is used to characterize the historical data encryption level of the corresponding data sample to be encrypted; the encryption level classification initial neural network model adopts CNN convolutional neural network, RNN recurrent neural network or LSTM long short-term memory network. The server 104 obtains a preset number of historical data to be encrypted and the corresponding security labels of the software application; then, the historical data to be encrypted is feature extracted to obtain a historical feature data set and a corresponding security label; then, each historical feature data set and the corresponding security label are randomly divided to generate a training sample set and a test sample set; finally, the preset encryption level classification initial neural network model is trained according to the training sample set, and the encryption level classification initial neural network model is tested according to the test sample set, and the model parameters of the encryption level classification initial neural network model are adjusted based on the indicators obtained from the training and testing until the indicators meet the preset requirements, and the encryption level classification neural network model is generated, so as to output the data encryption level based on the encryption level classification neural network model, thereby improving the efficiency and convenience of obtaining the data encryption level, and facilitating the adaptive acquisition of the data encryption level of the data to be encrypted.
[0053] In this embodiment, a preset number of historical data to be encrypted and corresponding security labels of software applications are obtained; then, feature extraction is performed on the historical data to be encrypted to obtain a historical feature data set and a corresponding security label; then, each historical feature data set and the corresponding security label is randomly divided to generate a training sample set and a test sample set; finally, a preset encryption level classification initial neural network model is trained according to the training sample set, and the encryption level classification initial neural network model is tested according to the test sample set, and the model parameters of the encryption level classification initial neural network model are adjusted based on the indicators obtained from the training and testing until the indicators meet the preset requirements, and an encryption level classification neural network model is generated to output the data encryption level based on the encryption level classification neural network model, thereby improving the efficiency and convenience of obtaining the data encryption level, and facilitating the adaptive acquisition of the data encryption level of the data to be encrypted.
[0054] Step 203, obtaining the key type corresponding to the data to be encrypted, and encrypting the data to be encrypted according to the key type and the encryption strategy to obtain encrypted data.
[0055] Specifically, the server 104 obtains the key type corresponding to the data to be encrypted, and obtains encrypted data after encrypting the data according to the key type and encryption strategy, thereby improving the efficiency, security and convenience of data encryption, and can perform intelligent analysis and adaptively determine the data encryption strategy according to different data types and security requirements, thus realizing adaptive data encryption.
[0056] In one embodiment, if Figure 4As shown, obtaining the key type corresponding to the data to be encrypted includes steps 401 to 402.
[0057] Step 401, data access phase for obtaining data to be encrypted.
[0058] The data access phase includes a system initialization phase, a system startup phase, or a data transmission phase of a software application. Specifically, the server 104 acquires the data to be encrypted during the data access phase.
[0059] Step 402, determining the corresponding key type according to the data access phase.
[0060] The key type includes a master key, a session key or a data key. Specifically, the server 104 can determine the corresponding key type according to the data access stage, thereby improving the efficiency and convenience of obtaining the key type corresponding to the data to be encrypted.
[0061] In this embodiment, the data access phase of the data to be encrypted is obtained; then, the corresponding key type can be determined according to the data access phase, thereby improving the efficiency and convenience of obtaining the key type corresponding to the data to be encrypted.
[0062] In one embodiment, if Figure 5 As shown, the encrypted data is obtained by encrypting the data to be encrypted according to the key type and the encryption strategy, including steps 501 to 502.
[0063] Step 501, call the random number generator to generate an encryption key according to the key type and encryption strategy.
[0064] Step 502: encrypt the data to be encrypted according to the encryption key to obtain encrypted data.
[0065] Specifically, the server 104 calls a random number generator to generate an encryption key according to the key type and encryption strategy; then, the encrypted data is encrypted according to the encryption key to obtain the encrypted data, thereby improving the efficiency and convenience of the encryption process.
[0066] In this embodiment, a random number generator is called to generate an encryption key according to the key type and encryption strategy; then, the data to be encrypted is encrypted according to the encryption key to obtain encrypted data, thereby improving the efficiency and convenience of encryption processing.
[0067] Based on this, the above-mentioned data encryption method receives the data to be encrypted of the software application sent by the mobile terminal, and extracts features of the data to be encrypted to obtain a feature data set; wherein the data to be encrypted includes text, pictures, audio and video; then, the feature data set is input into a pre-trained encryption level classification neural network model to obtain the data encryption level, and the corresponding encryption policy is obtained after querying the encryption policy database according to the data encryption level; the encryption policy is used to characterize the data encryption method and the data encryption complexity; then, the secret key type corresponding to the data to be encrypted is obtained, and the encrypted data is obtained after encrypting the data according to the secret key type and the encryption strategy, which improves the efficiency and convenience of obtaining the data encryption level, and is conducive to adaptively obtaining the data encryption level of the data to be encrypted.
[0068] In one embodiment, if Figure 6 As shown, the method also includes steps 601 to 604.
[0069] Step 601, store encrypted data.
[0070] Step 602, in response to receiving key verification information sent by the software application when accessing data, perform key verification processing according to the key verification information to obtain a key verification result and a corresponding decryption key.
[0071] Step 603: If the key verification result is successful, the encrypted data is decrypted according to the decryption key to obtain the decrypted encrypted data.
[0072] Step 604: If the key verification result is a verification failure, the key verification result is fed back.
[0073] Among them, the key verification result includes verification success or verification failure. The server 104 can store the encrypted data; then, in response to receiving the key verification information sent by the software application when accessing the data, perform key verification processing according to the key verification information to obtain the key verification result and the corresponding decryption key; then, if the key verification result is verification success, decrypt the encrypted data according to the decryption key to obtain the decrypted encrypted data; at the same time, if the key verification result is verification failure, feedback the key verification result, thereby improving the security of the data and the convenience of data processing.
[0074] In an embodiment, encrypted data is stored; then, in response to receiving key verification information sent by a software application when accessing data, key verification is performed according to the key verification information to obtain a key verification result and a corresponding decryption key; then, if the key verification result is a successful verification, the encrypted data is decrypted according to the decryption key to obtain decrypted encrypted data; at the same time, if the key verification result is a failed verification, the key verification result is fed back, thereby improving data security and data processing convenience.
[0075] In one embodiment, if Figure 7 As shown, the method further includes step 701 to step 702.
[0076] Step 701 , monitoring the data flow of the software application, and determining whether the software application has data access anomalies based on the data flow.
[0077] Step 702: If there is a data access anomaly, output access anomaly warning information to update the data encryption level according to the access anomaly warning information.
[0078] Specifically, the server 104 monitors the data traffic of the software application and determines whether there is a data access anomaly in the software application based on the data traffic; then, if there is a data access anomaly, it outputs access anomaly alarm information to update the data encryption level based on the access anomaly alarm information, thereby improving the convenience of anomaly monitoring.
[0079] In this embodiment, the data traffic of the software application is monitored, and it is determined whether the software application has data access anomalies based on the data traffic; then, if there are data access anomalies, access anomaly alarm information is output to update the data encryption level based on the access anomaly alarm information, thereby improving the convenience of anomaly monitoring.
[0080] It should be understood that although Figure 2-7 The steps in the flowchart are shown in sequence as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified in this document, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. Moreover, Figure 2-7 At least part of the steps may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least part of the sub-steps or stages of other steps.
[0081] Second, as Figure 8 As shown, a data encryption device is provided, which includes a data receiving module 810, a policy query module 820 and an encryption processing module 830.
[0082] Among them, the data receiving module 810 is used to receive the data to be encrypted of the software application sent by the mobile terminal, and perform feature extraction on the data to be encrypted to obtain a feature data set; wherein the data to be encrypted includes text, pictures, audio and video; the policy query module 820 is used to input the feature data set into a pre-trained encryption level classification neural network model to obtain the data encryption level, and obtain the corresponding encryption policy after querying the encryption policy database according to the data encryption level; the encryption policy is used to characterize the data encryption method and data encryption complexity; the encryption processing module 830 is used to obtain the key type corresponding to the data to be encrypted, and obtain the encrypted data after encrypting the data to be encrypted according to the key type and encryption strategy.
[0083] In one embodiment, the data receiving module 810 includes a data extraction unit.
[0084] Among them, the data extraction unit is used to input the data to be encrypted into a pre-trained feature extraction neural network model to obtain a feature data set; wherein the feature data set includes one or more of data texture features, data shape features, data semantic features, user behavior features and data environment features.
[0085] In one of the embodiments, the device also includes a model training module.
[0086] Among them, the model training module is used to obtain a preset number of historical data to be encrypted and the corresponding security labels of the software application; the security label is used to characterize the historical data encryption level of the corresponding data sample to be encrypted; the model training module is used to extract features of the historical data to be encrypted to obtain a historical feature data set and a corresponding security label; the model training module is used to randomly divide each historical feature data set and the corresponding security label to generate a training sample set and a test sample set; the model training module is used to train a preset encryption level classification initial neural network model according to the training sample set, and test the encryption level classification initial neural network model according to the test sample set, adjust the model parameters of the encryption level classification initial neural network model based on the indicators obtained from the training and testing, until the indicators meet the preset requirements, generate an encryption level classification neural network model, and output the data encryption level based on the encryption level classification neural network model; wherein, the encryption level classification initial neural network model adopts a CNN convolutional neural network, an RNN recurrent neural network or an LSTM long short-term memory network.
[0087] In one embodiment, the encryption processing module 830 includes a key type determination unit.
[0088] Among them, the key type determination unit is used to obtain the data access phase of the data to be encrypted; wherein the data access phase includes the system initialization phase, the system startup phase or the data transmission phase of the software application; the key type determination unit is used to determine the corresponding key type according to the data access phase; wherein the key type includes a master key, a session key or a data key.
[0089] In one embodiment, the encryption processing module 830 includes an encryption processing unit.
[0090] Among them, the encryption processing unit is used to call the random number generator to generate an encryption key according to the key type and encryption strategy; the encryption processing unit is used to encrypt the data to be encrypted according to the encryption key to obtain the encrypted data.
[0091] In one of the embodiments, the device further includes a data decryption module.
[0092] Among them, the data decryption module is used to store encrypted data; the data decryption module is used to respond to the key verification information sent by the software application when accessing the data, perform key verification processing according to the key verification information, and obtain the key verification result and the corresponding decryption key; the key verification result includes verification success or verification failure; the data decryption module is used to decrypt the encrypted data according to the decryption key to obtain the decrypted encrypted data if the key verification result is verification success; the data decryption module is used to feedback the key verification result if the key verification result is verification failure.
[0093] In one of the embodiments, the device further includes an abnormality monitoring module.
[0094] Among them, the anomaly monitoring module is used to monitor the data flow of the software application and determine whether there is a data access anomaly in the software application based on the data flow; the anomaly monitoring module is used to output access anomaly alarm information if there is a data access anomaly, so as to update the data encryption level according to the access anomaly alarm information.
[0095] For the specific definition of the data encryption device, please refer to the definition of the data encryption method above, which will not be repeated here. Each module in the above data encryption device can be implemented in whole or in part by software, hardware and a combination thereof. The above modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.
[0096] In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as follows: Fig. 9As shown. The computer device includes a processor, a memory, a network interface and a database connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store data to be encrypted of the software application. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a data encryption method is implemented.
[0097] Those skilled in the art will understand that Fig. 9 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0098] In a third aspect, a computer device is provided. The computer device includes a memory and a processor. The memory stores a computer program. When the processor executes the computer program, the steps of any method in the above method embodiments are implemented.
[0099] In a fourth aspect, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps of any method in the above method embodiments are implemented.
[0100] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing related hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application may include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), RAMbus direct RAM (RDRAM), direct RAMbus dynamic RAM (DRDRAM), and RAMbus dynamic RAM (RDRAM), etc.
[0101] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0102] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be subject to the attached claims.
Claims
1. A data encryption method, the method comprising: Receiving data to be encrypted of a software application sent by a mobile terminal, and performing feature extraction on the data to be encrypted to obtain a feature data set; wherein the data to be encrypted includes text, pictures, audio and video; The characteristic data set is input into a pre-trained encryption level classification neural network model to obtain the data encryption level, and the corresponding encryption strategy is obtained after querying the encryption strategy database according to the data encryption level; the encryption strategy is used to characterize the data encryption method and data encryption complexity; The key type corresponding to the data to be encrypted is obtained, and the data to be encrypted is encrypted according to the key type and the encryption strategy to obtain encrypted data.
2. The method according to claim 1, characterized in that The step of extracting features from the data to be encrypted to obtain a feature data set includes: The data to be encrypted is input into a pre-trained feature extraction neural network model to obtain the feature data set; wherein the feature data set includes one or more of data texture features, data shape features, data semantic features, user behavior features and data environment features.
3. The method according to claim 1, characterized in that The method further comprises: Acquire a preset number of historical data to be encrypted of the software application and corresponding security labels; the security labels are used to characterize the encryption level of the corresponding historical data samples to be encrypted; Extracting features of the historical data to be encrypted to obtain a historical feature data set and the corresponding security label; Randomly divide each of the historical feature data sets and the corresponding security tags to generate a training sample set and a test sample set; The preset encryption level classification initial neural network model is trained according to the training sample set, and the encryption level classification initial neural network model is tested according to the test sample set, and the model parameters of the encryption level classification initial neural network model are adjusted based on the indicators obtained from the training and testing until the indicators meet the preset requirements, and the encryption level classification neural network model is generated to output the data encryption level based on the encryption level classification neural network model; wherein, the encryption level classification initial neural network model adopts a CNN convolutional neural network, an RNN recurrent neural network or an LSTM long short-term memory network.
4. The method according to claim 1, characterized in that: The obtaining the key type corresponding to the data to be encrypted includes: Acquiring the data access phase of the data to be encrypted; wherein the data access phase includes the system initialization phase, the system startup phase or the data transmission phase of the software application; The corresponding key type is determined according to the data access stage; wherein the key type includes a master key, a session key or a data key.
5. The method according to claim 1, characterized in that The step of encrypting the data to be encrypted according to the key type and the encryption strategy to obtain the encrypted data includes: Calling a random number generator to generate an encryption key according to the key type and the encryption strategy; The encrypted data is obtained by encrypting the data to be encrypted according to the encryption key.
6. The method according to claim 1, characterized in that The method further comprises: storing the encrypted data; In response to receiving the key verification information sent by the software application when accessing data, performing key verification processing according to the key verification information to obtain a key verification result and a corresponding decryption key; the key verification result includes verification success or verification failure; If the key verification result is that the verification is successful, decrypting the encrypted data according to the decryption key to obtain the decrypted encrypted data; If the key verification result is the verification failure, the key verification result is fed back.
7. The method according to claim 1, characterized in that The method further comprises: Monitoring the data flow of the software application, and determining whether the software application has data access anomalies according to the data flow; If the data access exception exists, the access exception warning information is output to update the data encryption level according to the access exception warning information.
8. A data encryption device, characterized in that: The device comprises: A data receiving module, used to receive the data to be encrypted of the software application sent by the mobile terminal, and perform feature extraction on the data to be encrypted to obtain a feature data set; wherein the data to be encrypted includes text, pictures, audio and video; A policy query module is used to obtain the data encryption level after inputting the feature data set into a pre-trained encryption level classification neural network model, and obtain the corresponding encryption policy after querying the encryption policy database according to the data encryption level; the encryption policy is used to characterize the data encryption method and data encryption complexity; The encryption processing module is used to obtain the key type corresponding to the data to be encrypted, and to encrypt the data to be encrypted according to the key type and the encryption strategy to obtain encrypted data.
9. A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.