Access data processing method, device and equipment for improving database stability
By encrypting the cloud computing database multiple times and setting access policies, and using supervised and unsupervised models for real-time detection, the illegal intrusion problem faced by the cloud computing database is solved and the security and stability of the data are improved.
Patent Information
- Application Number
- CN202410531841.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-04-29
- Publication Date
- 2024-08-23
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Cloud computing databases face serious consequences such as illegal intrusion and data loss, and it is difficult for existing technologies to effectively defend against illegal access.
When the data is loaded into the cloud, the data is encrypted multiple times through encryption policies, and access policies are set to detect and reject illegal intrusions. Supervised models and unsupervised models are used for real-time intrusion detection.
It improves the security of database data, prevents illegal acquisition and unauthorized access, ensures that data cannot be decrypted and identified after being illegally acquired, and enhances the stability and security of the database.
Smart Images

Figure CN118536151A
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to an access data processing method, device and equipment for improving database stability. Background Art
[0002] Cloud computing is a vital and rapidly growing industry, its capabilities and applications extending into every aspect of life. Cloud computing databases currently face numerous security issues, including scalability, integrity, confidentiality, and unauthorized access. Unauthorized access to a database can lead to serious consequences, such as database crashes and data loss. Existing technologies allow intruders to easily compromise data by obtaining database access keys, resulting in business or system losses. Summary of the Invention
[0003] In view of the above technical problems, the present invention provides an access data processing method, device and equipment for improving database stability, so as to solve the problem of illegal intrusion of database in the prior art.
[0004] Other features and advantages of the present disclosure will become apparent from the following detailed description, or may be learned in part by practice of the present disclosure.
[0005] According to one aspect of the present invention, a method for processing access data to improve database stability is disclosed, the method comprising:
[0006] When data is loaded into the cloud, the key is derived and combined with the data, encrypted multiple times according to the encryption strategy, and the encrypted data is stored in the database;
[0007] Set an access policy and store it in a JSON file. When a data access request session is received from a user, retrieve the corresponding access policy from the JSON file. If the requested data does not match the access policy, return an error message. If they do match, retrieve the encrypted data from the database, decrypt the data using the encryption policy and key, and return the decrypted data to the user.
[0008] Based on the supervised model and unsupervised model for intrusion detection, when the user submits a data access request, the supervised model is used to detect whether the current log matches the known pattern. If it does not match, the unsupervised model is used to compare the current log with the historical log. When there is a significant difference between the current log and the historical log, a warning message is returned and continuous monitoring is carried out. The supervised model and the unsupervised model are trained by neural networks.
[0009] Furthermore, the encryption strategy includes: byte replacement, row shift, column mixing, and encryption key. The byte replacement includes using a nonlinear replacement table to replace each byte in the data. The row shift includes cyclically shifting each row of bytes in the data by a preset offset. The column mixing includes performing a nonlinear transformation on each column of bytes in the data. The encryption key includes operating the derived key with the current state of the data. In each encryption, the current encryption is a repeated operation on the result of the previous encryption.
[0010] Furthermore, when performing the byte replacement, the operation is performed based on the following formula:
[0011]
[0012] Among them, b i is the i-th bit in the byte, C i For bits of a given byte with a specific value;
[0013] When performing the row shift, the operation is performed based on the following formula:
[0014] S′ r,c =S r,(c+shift(r,Nb))modNb ;
[0015] for0 <r<4and0≤c≤Nb;
[0016] Wherein, shift(r,Nb) is used to create an operation that shifts bytes to lower positions, which depends on the row value, S is the nonlinear substitution table, r is the row, c is the column, and Nb is the number of bytes;
[0017] When performing the column mixing, the operation is based on the following formula:
[0018] a(x)={03}x 3 +{01}x 2 +{01}x+{02};
[0019] Among them, {03}, {01}, and {02} are hexadecimal, representing 3, 2, and 1 in decimal, respectively. a(x) is used for multiplication operations on each column of bytes, and {03}, {01}, and {02} correspond to rows in the key matrix.
[0020] Furthermore, when deriving the key, the operation is performed based on the following formula:
[0021]
[0022] Where K[n] represents the nth key, s[i] represents a byte in the key, i is the index of the byte, k[n-1]:s[i] represents the byte of the key in the previous encryption, and k[n]:s[i] represents the byte in the current round of key. Represents the exclusive OR operation;
[0023] And, when obtaining the key for the first encryption, based on the following formula:
[0024]
[0025] Among them, R con [i] is the constant for the i-th key derivation, s0 represents the first byte of the key, which is used as the initial byte for generating the first key, k[n-1]:s0 represents the first byte of the previous key, SubByte represents a byte replacement operation, k[n-1]:s3 represents the fourth byte of the previous key, and >>8 represents shifting k[n-1]:s3 right by 8 bits.
[0026] Furthermore, the number of key derivations is calculated by the following formula:
[0027]
[0028] Among them, n r is the number of derivations, S k is the size of the initial key, S b is the byte block size of the key and j is the number of additional times.
[0029] Furthermore, when setting the access policy, it includes:
[0030] defining a set of attributes for each entity, including users, services, resources, and environments;
[0031] Form a superset of all user-defined security policies;
[0032] Setting an evaluation function based on the superset;
[0033] When matching the requested data with the access policy, it includes:
[0034] The received attribute sets are evaluated and compared, and when a corresponding relationship is found, the user is granted access rights.
[0035] Furthermore, when training the supervised model and the unsupervised model, the following operations are performed:
[0036] Obtain features from access logs, including categorical features and numerical features;
[0037] Mapping each value of the categorical feature into a multidimensional vector so that it has a numerical value;
[0038] Subtract the mean from the numerical feature and the mapped categorical feature and divide by the standard deviation to obtain a standardized feature;
[0039] Based on the formula Calculate the hidden layer of the neural network, based on the formula Calculate the output layer of the neural network, where h is the hidden layer, σ is the nonlinear activation function, and x i is the initial i-th node, and w is the weight.
[0040] According to a second aspect of the present disclosure, there is provided an access data processing device for improving database stability, comprising: an encryption module for combining a derived key with the data when the data is loaded into a cloud, performing multiple encryption according to an encryption strategy, and storing the encrypted data in a database;
[0041] A data access management module is used to set access policies and store them in a JSON file. Upon receiving a data access request session submitted by a user, the module retrieves the corresponding access policy from the JSON file. If the requested data does not match the access policy, an error message is returned. If they do match, the module retrieves the encrypted data from the database, decrypts the data using the encryption policy and key, and returns the decrypted data to the user.
[0042] The detection module uses a supervised model and an unsupervised model for intrusion detection. When a user submits a data access request, the supervised model is used to detect whether the current log matches a known pattern. If not, the unsupervised model is used to compare the current log with the historical log. When there is a significant difference between the current log and the historical log, a warning message is returned and continuous monitoring is carried out. The supervised model and the unsupervised model are trained by neural networks.
[0043] According to a third aspect of the present disclosure, there is provided an access data processing device for improving database stability, comprising: a processor; and a memory arranged to store computer-executable instructions, wherein the executable instructions, when executed, enable the processor to implement the access data processing method for improving database stability as described above.
[0044] The technical solution disclosed in this disclosure has the following beneficial effects:
[0045] The set encryption policy can encrypt the data in the database, ensuring that the data in the database cannot be decrypted and identified even if it is illegally obtained, thereby improving data security; the set access policy can reject illegal intrusions, limit unauthorized access, and prevent risks; based on the set supervisory model and unsupervised model, the database access process is detected in real time. In this way, even if the intruder successfully logs into the database, his abnormal behavior will be detected, greatly improving the security of the database. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] Figure 1 This is a flow chart of a method for processing access data to improve database stability according to an embodiment of this specification;
[0047] Figure 2 This is a structural block diagram of an access data processing device for improving database stability according to an embodiment of this specification;
[0048] Figure 3 A terminal device for implementing an access data processing method for improving database stability in an embodiment of this specification;
[0049] Figure 4 The computer-readable storage medium stores an access data processing method for improving database stability in the embodiments of this specification. DETAILED DESCRIPTION
[0050] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in a variety of forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that the present disclosure will be more comprehensive and complete and will fully convey the concepts of the example embodiments to those skilled in the art. The described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments. In the following description, many specific details are provided to provide a full understanding of the embodiments of the present disclosure. However, those skilled in the art will appreciate that the technical solutions of the present disclosure may be practiced while omitting one or more of the specific details, or that other methods, components, devices, steps, etc. may be employed. In other cases, well-known technical solutions are not shown or described in detail to avoid obscuring various aspects of the present disclosure.
[0051] The accompanying drawings are merely schematic illustrations of the present disclosure. Identical reference numerals in the drawings denote identical or similar components, and thus their repeated description will be omitted. Some of the blocks shown in the accompanying drawings represent functional entities that do not necessarily correspond to physically or logically independent entities. These functional entities may be implemented in software, in one or more hardware modules or integrated circuits, or in different networks and / or processor devices and / or microcontroller devices.
[0052] like Figure 1 As shown, the embodiment of this specification provides an access data processing method for improving database stability. The execution subject of this method can be a computer or a server. The method can specifically include the following steps S101 to S103:
[0053] In step S101, when data is loaded into the cloud, the key is derived and combined with the data and encrypted multiple times according to the encryption strategy, and the encrypted data is stored in the database.
[0054] In which, the data in the database is encrypted, and the encryption method can be one or more combinations of symmetric encryption, asymmetric encryption, hash function, digital signature, key exchange, random oracle, physically unclonable function, byte replacement, row shift, and column mixing; specifically, this embodiment adopts byte replacement, row shift, column mixing, and encryption key, the byte replacement includes using a nonlinear replacement table to replace each byte in the data, the row shift includes cyclic shifting of each row of bytes in the data by a preset offset, the column mixing includes performing a nonlinear transformation on each column of bytes in the data, and the encryption key includes operating the derived key with the current state of the data. In each encryption, the current encryption is a repeated operation on the last encryption result.
[0055] When performing the byte replacement, the operation is performed based on the following formula:
[0056]
[0057] Among them, b i is the i-th bit in the byte, C i A bit with a specific value for a given byte, i.e. a constant, Indicates exclusive OR operation, b (i+4)mod8 This means performing a modulo-8 addition of the i-th byte in the original byte and the (i+4)-th byte, and performing the XOR operation on the result. Modulo-8 addition means that if the addition result exceeds 8, it wraps around to ensure that the result remains a single byte. The purpose of byte replacement here is to introduce nonlinearity, increase encryption complexity, and make the encryption process more resistant to cryptanalysis attacks.
[0058] When performing the row shift, the operation is performed based on the following formula:
[0059] S′ r,c =S r,(c+shift(r,Nb))modNb ;
[0060] for0 <r<4and0≤c≤Nb;
[0061] Among them, shift(r,Nb) is used to create an operation that shifts bytes to lower positions. The shift amount is calculated based on the row value r and the number of bytes Nb. Generally speaking, Nb is usually 4 because the size of each block is 16 bytes and the state matrix is 4x4. S is the nonlinear substitution table, r is the row, c is the column, Nb is the number of bytes, and S′ r,c represents the new value in row r, column c of the transformed state matrix, represents the value in row r, column c of the original state matrix, and c+shift(r,Nb) represents the addition of column index c to the shift calculated based on row r. The purpose of the row shift step is to introduce a linear transformation that increases the complexity of the encrypted data, making the encryption process more resistant to certain types of cryptanalysis attacks, such as known-plaintext attacks.
[0062] When performing the column mixing, the operation is based on the following formula:
[0063] a(x)={03}x 3 +{01}x 2 +{01}x+{02};
[0064] Here, {03}, {01}, and {02} are hexadecimal representations of 3, 2, and 1, respectively. a(x) performs a multiplication operation on each column of bytes, and {03}, {01}, and {02} correspond to the rows of the key matrix. a(x) performs a nonlinear transformation on the bytes, enhancing data security.
[0065] In step S102, an access policy is set and stored in a JSON file. When a data access request session submitted by a user is received, the corresponding access policy is obtained from the JSON file. If the requested data does not match the access policy, an error message is returned. If they match, the encrypted data is obtained from the database, the data is decrypted using the encryption policy and key, and the decrypted data is returned to the user.
[0066] In step S103, based on the supervised model and the unsupervised model for intrusion detection, when the user submits a data access request, the supervised model is used to detect whether the current log matches the known pattern. If not, the unsupervised model is used to compare the current log with the historical log. When there is a significant difference between the current log and the historical log, a warning message is returned and continuous monitoring is carried out. The supervised model and the unsupervised model are trained by neural networks.
[0067] In supervised learning, the model learns from labeled training data and attempts to make accurate predictions or classifications of new, unknown data. This allows it to determine whether various user behaviors and attributes recorded in logs meet security standards. Since supervised models rely on known, labeled data, they have higher accuracy when detecting known types of attacks and abnormal behaviors. In unsupervised learning, it does not rely on labeled data, but instead attempts to discover hidden patterns or structures in the data. That is, by comparing it with historical logs, unsupervised models can discover new, unknown, or abnormal behavior patterns. In this way, unsupervised models can be used to identify and respond to new and complex threats that may evade detection by supervised models.
[0068] In one embodiment, when deriving the key, the operation is performed based on the following formula:
[0069]
[0070] Where K[n] represents the nth key, s[i] represents a byte in the key, i is the index of the byte, k[n-1]:s[i] represents the byte of the key in the previous encryption, and k[n]:s[i] represents the byte in the current round of key. represents an exclusive-or operation. That is, the i-th byte of the (n-1)-th key is taken and XORed with the i-th byte of the n-th key to obtain the i-th byte of the n-th key. This process is repeated to generate a new round key for each round until all required round keys are generated.
[0071] And, when obtaining the key for the first encryption, based on the following formula:
[0072]
[0073] Among them, R con [i] is the constant for the i-th round of key derivation, s0 represents the first byte of the key, which is used as the initial byte for generating the first round of key, k[n-1]:s0 represents the first byte of the previous key, in this case, it represents the initial key. SubByte represents the byte replacement operation, k[n-1]:s3 represents the fourth byte of the previous key, and >>8 represents shifting k[n-1]:s3 right by 8 bits. When calculating the first round of key, set n=1, then take the fourth byte of the initial key, shift it right by 8 bits, and then add it to R con [i] is XORed. Next, the result is nonlinearly transformed using the SubByte function. Finally, the result of this nonlinear transformation is XORed with the first byte of the initial key to obtain s0, the first round key.
[0074] And, the number of key derivations is calculated by the following formula:
[0075]
[0076] Among them, n r is the number of derivations, S k is the size of the initial key, S b is the byte block size of the key and j is the number of additional times.
[0077] In one embodiment, when setting the access policy, the following steps are included:
[0078] Define a set of attributes for each entity, including users, services, resources and environments; form a superset of all user-defined security policies; set an evaluation function based on the superset; when matching the requested data with the access policy, include: evaluating and comparing the received attribute set, and when a corresponding relationship is found, granting the user access rights.
[0079] As an explanation, when defining the attribute set of users, services, resources and environments, the following formula can be used:
[0080] A req ={ReqAttr i |i∈[1,I]};
[0081] A Serv ={ServAttr j |j∈[1,j]};
[0082] A res ={ResAttr k |k∈[1,K]};
[0083] A env ={EnvAttr l |l∈[1,L]};
[0084] A req A represents the attribute set of the requester. Serv A represents a set of service attributes. res A represents a set of resource attributes. env Represents the attribute set of the environment, i, j, k, l represent the index of the attribute, I, J, K, L represent the maximum number of attributes of the entity. All security policies, i.e., access policies, are formed in a superset P, P = {Pm∈[I,M],Pmisapolicy}, where Pm represents the mth policy; then, based on the function Pnf(A req A sero A res A eno)=permit or deny to decide whether to grant access rights, that is, it receives the attributes of the entity as input and outputs an access decision (allow or deny). When an authorized user requests data, the encrypted data is decrypted using the above encryption strategy so that the user can access the original data.
[0085] In one embodiment, when training the supervised model and the unsupervised model, the following operations are performed:
[0086] Acquire features from the access log, including classification features and numerical features; map each value of the classification feature to a multidimensional vector so that it has a numerical value; subtract the mean of the numerical feature and the mapped classification feature and divide by the standard deviation to obtain a standardized feature; based on the formula Calculate the hidden layer of the neural network, based on the formula Calculate the output layer of the neural network, where σ is a nonlinear activation function that helps the neural network learn complex patterns, x i is the initial i-th node; w is the weight, w j is the bias term, which adds a constant offset to the output of the neuron, w ij is the weight from the i-th input node to the j-th neuron in the hidden layer; h is the hidden layer, and h(x) represents the output of the neuron in the hidden layer.
[0087] Categorical features are discrete and can be user-defined categories or states, such as user type, operating system, or service type. They typically need to be converted into numerical data in machine learning models because most algorithms cannot directly process non-numeric data. Numerical features are continuous and can be any numerical data, such as request frequency, packet size, or duration. When mapping categorical features, if a categorical feature has n possible values, each value is mapped to a position in an n-dimensional vector, and the remaining positions are filled with 0, thus giving the feature a numerical value.
[0088] These features are recorded in the logs. In subsequent model testing, the supervised model and the unsupervised model can directly extract the log data generated by the current user access, extract features from the logs, and then perform corresponding testing.
[0089] Based on the same idea, Figure 2As shown, the exemplary embodiment of the present disclosure also provides an access data processing device for improving database stability, including: an encryption module 201, which is used to derive a key and combine it with the data when the data is loaded into the cloud, and encrypt it multiple times according to the encryption strategy, and store the encrypted data in the database; a data access management module 202, which is used to set the access strategy and store it in a JSON file. When a data access request session submitted by a user is received, the corresponding access strategy is obtained from the JSON file. If the requested data does not match the access strategy, an error message is returned. If it matches, the encrypted data is obtained from the database, the data is decrypted using the encryption strategy and the key, and the decrypted data is returned to the user; a detection module 203, which uses a supervised model and an unsupervised model for intrusion detection. When the user submits a data access request, the supervised model is used to detect whether the current log matches the known pattern. If it does not match, the unsupervised model is used to compare the current log with the historical log. When there is a significant difference between the current log and the historical log, a warning message is returned and continuous monitoring is performed. The supervised model and the unsupervised model are trained by a neural network.
[0090] The specific details of each module in the above device have been described in detail in the implementation method part. For details not disclosed, please refer to the implementation method part, and they will not be repeated here.
[0091] The encryption policy set in the above embodiment can encrypt the data in the database, ensuring that the data in the database cannot be decrypted and identified even if it is illegally obtained, thereby improving the security of the data; the set access policy can reject illegal intrusions, limit unauthorized access, and prevent risks; based on the set supervisory model and unsupervised model, the database access process is detected in real time. In this way, even if the intruder successfully logs into the database, his abnormal behavior will be detected, greatly improving the security of the database.
[0092] Based on the same idea, the embodiment of this specification also provides an access data processing device that improves the stability of the database, such as Figure 3 shown.
[0093] The access data processing device for improving database stability may be the terminal device or server provided in the above embodiment.
[0094] The access data processing device for improving database stability may have relatively large differences due to different configurations or performances, and may include one or more processors 301 and memory 302, and the memory 302 may store one or more storage applications or data. Among them, the memory 502 may include a readable medium in the form of a volatile storage unit, such as a random access memory unit (RAM) and / or a cache storage unit, and may further include a read-only storage unit. The application stored in the memory 302 may include one or more program modules (not shown in the figure), such program modules include but are not limited to: an operating system, one or more applications, other program modules and program data, each of these examples or some combination may include the implementation of a network environment. Furthermore, the processor 301 can be configured to communicate with the memory 302 to execute a series of computer executable instructions in the memory 302 on the video privacy protection device. The video privacy protection device may also include one or more power supplies 303, one or more wired or wireless network interfaces 304, one or more I / O interfaces (input and output interfaces) 305, and one or more external devices 306 (e.g., a keyboard, a pointing device, a Bluetooth device, etc.). The device may also communicate with one or more devices that enable a user to interact with the device, and / or with any device that enables the device to communicate with one or more other computing devices (e.g., a router, a modem, etc.). Such communication may be performed via the I / O interface 305. Furthermore, the device may also communicate with one or more networks (e.g., a local area network (LAN)) via the wired or wireless interface 304.
[0095] Specifically, in this embodiment, the video privacy protection device includes a memory and one or more programs, wherein the one or more programs are stored in the memory, and the one or more programs may include one or more modules, and each module may include a series of computer-executable instructions for the video privacy protection device, and the one or more programs are configured to be executed by one or more processors, including computer-executable instructions for performing the following:
[0096] When data is loaded into the cloud, the key is derived and combined with the data, encrypted multiple times according to the encryption strategy, and the encrypted data is stored in the database;
[0097] Set an access policy and store it in a JSON file. When a data access request session is received from a user, retrieve the corresponding access policy from the JSON file. If the requested data does not match the access policy, return an error message. If they do match, retrieve the encrypted data from the database, decrypt the data using the encryption policy and key, and return the decrypted data to the user.
[0098] Based on the supervised model and unsupervised model for intrusion detection, when the user submits a data access request, the supervised model is used to detect whether the current log matches the known pattern. If it does not match, the unsupervised model is used to compare the current log with the historical log. When there is a significant difference between the current log and the historical log, a warning message is returned and continuous monitoring is carried out. The supervised model and the unsupervised model are trained by neural networks.
[0099] Based on the same idea, the exemplary embodiments of the present disclosure also provide a computer-readable storage medium on which is stored a program product capable of implementing the methods described above in this specification. In some possible implementations, various aspects of the present disclosure may also be implemented in the form of a program product, which includes program code. When the program product is executed on a terminal device, the program code is used to cause the terminal device to execute the steps described in the "Exemplary Methods" section above according to various exemplary embodiments of the present disclosure.
[0100] refer to Figure 4 As shown, a program product 400 for implementing the above method according to an exemplary embodiment of the present disclosure is described. The program product 400 may be a portable compact disc read-only memory (CD-ROM) and include program code, and may be run on a terminal device, such as a personal computer. However, the program product of the present disclosure is not limited thereto. In this document, a readable storage medium may be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.
[0101] The program product may employ any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or component, or any combination thereof. More specific examples (a non-exhaustive list) of readable storage media include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof.
[0102] A computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, which carries readable program code. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A readable signal medium may also be any readable medium other than a readable storage medium that can transmit, propagate, or transfer a program for use by or in conjunction with an instruction execution system, apparatus, or device.
[0103] The program code embodied on the readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
[0104] The program code for performing the operations of the present disclosure may be written in any combination of one or more programming languages, including object-oriented programming languages such as Java, C++, and the like, as well as conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as a standalone software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server. In cases involving a remote computing device, the remote computing device may be connected to the user computing device via any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computing device (e.g., via the Internet using an Internet service provider).
[0105] Through the description of the above embodiments, it is easy for those skilled in the art to understand that the example embodiments described herein can be implemented by software or by combining software with necessary hardware. Therefore, the technical solution according to the embodiments of the present disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, and includes several instructions to enable a computing device (which can be a personal computer, a server, a terminal device, or a network device, etc.) to execute the method according to the exemplary embodiment of the present disclosure.
[0106] Furthermore, the figures above are merely illustrative of the processes included in the methods according to exemplary embodiments of the present disclosure and are not intended to be limiting. It is readily understood that the processes illustrated in the figures above do not indicate or limit the temporal order of these processes. Furthermore, it is readily understood that these processes may be executed synchronously or asynchronously, for example, in multiple modules.
[0107] It should be noted that although several modules or units of the device for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to the exemplary embodiments of the present disclosure, the features and functions of two or more modules or units described above can be concretized in one module or unit. Conversely, the features and functions of one module or unit described above can be further divided into multiple modules or units to be concretized.
[0108] Other embodiments of the present disclosure will readily occur to those skilled in the art after considering the specification and practicing the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary techniques in the art not disclosed herein. The description and embodiments are to be considered as exemplary only, with the true scope and spirit of the present disclosure being indicated by the claims.
Claims
1. A method for processing access data to improve database stability, characterized in that: The method comprises: When data is loaded into the cloud, the key is derived and combined with the data, encrypted multiple times according to the encryption strategy, and the encrypted data is stored in the database; An access policy is set and stored in a JSON file. When a data access request session submitted by a user is received, the corresponding access policy is obtained from the JSON file. If the requested data does not match the access policy, an error message is returned. If they match, the encrypted data is obtained from the database, the data is decrypted using the encryption policy and key, and the decrypted data is returned to the user. Based on the supervised model and unsupervised model for intrusion detection, when the user submits a data access request, the supervised model is used to detect whether the current log matches the known pattern. If it does not match, the unsupervised model is used to compare the current log with the historical log. When there is a significant difference between the current log and the historical log, a warning message is returned and continuous monitoring is performed. The supervised model and the unsupervised model are trained by neural networks.
2. The access data processing method for improving database stability according to claim 1, characterized in that: The encryption strategy includes: byte replacement, row shift, column mixing, and encryption key. The byte replacement includes using a non-linear replacement table to replace each byte in the data. The row shift includes cyclic shifting of each row of bytes in the data by a preset offset. The column mixing includes non-linear transformation of each column of bytes in the data. The encryption key includes operating the derived key with the current state of the data. In each encryption, the current encryption is a repeated operation on the result of the previous encryption.
3. The access data processing method for improving database stability according to claim 2, characterized in that: When performing the byte replacement, the operation is performed based on the following formula: b i =b i ⊕b (i+4)mod8 b (i+5)mod8 ⊕b (i+6)mod8 b (i+7)mod8 C i ; Among them, b i is the i-th bit in the byte, C i for bits of a given byte that have a specific value; When performing the row shift, the operation is performed based on the following formula: S′ r,c =S r,(c+shift(r,Nb))modNb ; for0 <r<4and0≤c≤Nb; Wherein, shift(r,Nb) is used to create an operation to shift bytes to a lower position, which depends on the row value, S is the non-linear substitution table, r is the row, c is the column, and Nb is the number of bytes; When performing the column mixing, the operation is based on the following formula: a(x)={03}x 3 +{01}x 2 +{01}x+{02}; Among them, {03}, {01}, and {02} are hexadecimal, representing 3, 2, and 1 in decimal, respectively. a(x) is used for multiplication operations on each column of bytes, and {03}, {01}, and {02} correspond to rows in the key matrix.
4. The access data processing method for improving database stability according to claim 1, characterized in that: When deriving the key, the operation is based on the following formula: K[n]:s[i]=k[n-1]:s[i]⊕k[n]:s[i]; Where K[n] represents the nth key, s[i] represents a byte in the key, i is the index of the byte, k[n-1]:s[i] represents the byte of the key in the previous encryption, k[n]:s[i] represents the byte in the current round of key, and ⊕ represents the XOR operation; And, when obtaining the key for the first encryption, based on the following formula: K[n]=s0=k[n-1]:s0⊕SubByte(k[n-1]:s3>>8⊕R con [i]); Among them, R con [i] is the constant for the i-th key derivation, s0 represents the first byte of the key, which is used as the initial byte for generating the first key, k[n-1]:s0 represents the first byte of the previous key, SubByte represents the byte replacement operation, k[n-1]:s3 represents the fourth byte of the previous key, and >>8 means shifting k[n-1]:s3 right by 8 bits.
5. The access data processing method for improving database stability according to claim 1, characterized in that: The number of key derivations is calculated using the following formula: Among them, n r is the number of derivations, S k is the size of the initial key, S b is the byte block size of the key and j is the number of additional times.
6. The access data processing method for improving database stability according to claim 1, characterized in that: When setting the access policy, it includes: defining a set of attributes for each entity, including users, services, resources, and environments; Form a superset of all user-defined security policies; Setting an evaluation function based on the superset; When matching the requested data with the access policy, it includes: The received attribute sets are evaluated and compared, and when a corresponding relationship is found, the user is granted access rights.
7. The access data processing method for improving database stability according to claim 1, characterized in that: When training the supervised model and the unsupervised model, the following operations are performed: Obtain features in access logs, including classification features and numerical features; Mapping each value of the classification feature into a multidimensional vector so that it has a numerical value; Subtract the mean from the numerical feature and the mapped categorical feature and divide by the standard deviation to obtain a standardized feature; Based on the formula Calculate the hidden layer of the neural network, based on the formula Calculate the output layer of the neural network, where h is the hidden layer, σ is the nonlinear activation function, and x i is the initial i-th node, and w is the weight.
8. An access data processing device for improving database stability, characterized in that: include: An encryption module, which is used to derive a key and combine it with the data when the data is loaded into the cloud, encrypt it multiple times according to the encryption strategy, and store the encrypted data in the database; A data access management module is used to set access policies and store them in a JSON file. When receiving a data access request session submitted by a user, the corresponding access policy is obtained from the JSON file. If the requested data does not match the access policy, an error message is returned. If they match, the encrypted data is obtained from the database, the data is decrypted using the encryption policy and key, and the decrypted data is returned to the user. The detection module adopts a supervised model and an unsupervised model for intrusion detection. When a user submits a data access request, the supervised model is used to detect whether the current log matches the known pattern. If not, the unsupervised model is used to compare the current log with the historical log. When there is a significant difference between the current log and the historical log, a warning message is returned and continuous monitoring is performed. The supervised model and the unsupervised model are trained by neural networks.
9. An access data processing device for improving database stability, characterized in that: include: processor; and a memory arranged to store computer executable instructions which, when executed, cause the processor to: When data is loaded into the cloud, the key is derived and combined with the data, encrypted multiple times according to the encryption strategy, and the encrypted data is stored in the database; An access policy is set and stored in a JSON file. When a data access request session submitted by a user is received, the corresponding access policy is obtained from the JSON file. If the requested data does not match the access policy, an error message is returned. If they match, the encrypted data is obtained from the database, the data is decrypted using the encryption policy and key, and the decrypted data is returned to the user. Based on the supervised model and unsupervised model for intrusion detection, when the user submits a data access request, the supervised model is used to detect whether the current log matches the known pattern. If it does not match, the unsupervised model is used to compare the current log with the historical log. When there is a significant difference between the current log and the historical log, a warning message is returned and continuous monitoring is performed. The supervised model and the unsupervised model are trained by neural networks.
