Data security storage method based on relational database
By exchanging the position and column of the table data in a relational database, and combining encryption logic and timestamp sorting, the problem of insufficient encryption of data storage in the prior art is solved, and an efficient data encryption storage and decryption process is realized.
Patent Information
- Application Number
- CN202411864667.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-18
- Publication Date
- 2025-03-18
- Estimated Expiration
- 2044-12-18
AI Technical Summary
The prior art fails to effectively set the data itself in relational databases, resulting in the lack of sufficient encryption protection for the data during the storage process.
By performing position and column swap on the tabular data in the relational database, combining preset encryption logic and timestamp sorting, the encrypted tabular data is generated and stored, and decrypted during extraction.
It realizes efficient encrypted storage of data, enhances the security of data in the storage process, and improves the difficulty of cracking keys.
Smart Images

Figure CN119337406B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of relational databases, and in particular to a data security storage method based on a relational database. Background Art
[0002] A relational database is a database built on the basis of a relational model. It organizes data into a series of tables, which are connected to each other through relationships (such as one-to-one, one-to-many, many-to-many); for example, in a school management system, there are "student" tables and "course" tables. The "student" table stores basic information about students, such as student ID, name, age, etc., and the "course" table stores information about courses, such as course number, course name, credits, etc.; these two tables can be connected through the "selected courses" relationship to indicate which courses students have selected.
[0003] The application with publication number CN115694784A discloses a data security storage method, including: converting the grayscale values of all pixels in the grayscale image of the image to be encrypted into eight-bit binary codes, converting the binary codes into base codes, and converting the grayscale image to be encrypted into multiple base matrices; performing chaotic mapping on the chaotic sequence to obtain a key image, and generating multiple key two-dimensional base matrices according to the key image; calculating the preferred degree of the base matrix operation rule, and performing encryption operation on the base matrix according to the preferred degree of the base matrix operation rule and the key two-dimensional base matrix to obtain an encrypted base matrix; performing an inverse transformation on the encrypted base matrix to obtain an encrypted grayscale value; decrypting the encrypted image according to the optimal operation rule corresponding to the chaotic sequence parameters and the base matrix. The encrypted image of the present invention is more different from the image before encryption, and the generated encryption matrix is more random, which increases the difficulty of cracking the key.
[0004] When it comes to secure storage of data in a relational database, it generally ensures the secure storage of the corresponding data by setting relevant encryption keys for the data storage path. However, this encryption processing method only encrypts the data storage space, and does not effectively set up security for the data itself and complete the relevant encryption settings, so that the corresponding data itself has a certain storage encryption effect. Summary of the invention
[0005] In view of the deficiencies of the prior art, the present invention provides a data security storage method based on a relational database, which solves the problem of ineffective security settings for the data itself.
[0006] To achieve the above objectives, the present invention is implemented through the following technical solutions: A data security storage method based on a relational database comprises the following steps:
[0007] Step 1: Input the batch data to be stored in the relational database, confirm the associated data belonging to different objects from the batch data, and then lock the feature table associated with the corresponding object. Based on the different associated items of several groups of associated data of the object, fill them into the associated feature table in sequence to generate several groups of to-be-stored tables belonging to this batch data.
[0008] Step 2: Perform initial encryption processing on several groups of tables to be stored confirmed by this batch of data. Based on the different data filled in different positions of different rows in the table to be stored and the front and back sorting positions of the data, confirm the specific position of the data, and then scramble the different data in each different row based on the preset encryption processing logic to complete the initial encryption process of the corresponding table to be stored and mark it as the initial encrypted table. The specific sub-steps are:
[0009] S21. Based on the confirmed table to be stored, confirm the different data associated with each row, and mark the position of the confirmed data. i , where i represents different rows, and B i =1, 2, ..., n, B i When it is 1, it means that the data marked at this position is in the first row. i When it is n, it means that the data marked at this position is located in the last row;
[0010] S22, after marking the positions of several groups of data belonging to the same row, i Sort from the first row to the last row, confirm the position sequence of several groups of data in this row {1, 2, ..., n}, and swap the positions of related data in the same row based on this position sequence:
[0011] S221, B i = 1 keep the position unchanged, and sort the second group of position marks that appear later in B i =1, when confirming the third set of data, according to the parameters of the first two sets of position marks and confirming the position marks associated with them, when confirming the data at the subsequent corresponding positions, according to the parameters of the data position marks of the first two sets of positions at this position and confirming the position mark B of the data filled in the current position i , and fill the data of the corresponding position mark to the current position, and so on, confirm the data to be filled in the subsequent consecutive positions in sequence, and when the parameter confirmed by a subsequent position does not exist in the position sequence, execute step S222;
[0012] S222, remove the position marks associated with the data that have completed the filling process in the position sequence, and then re-sort the position sequence in a descending order to confirm the subsequent sequence, and fill the data associated with the first position mark in the subsequent sequence to the subsequent position, and then confirm the position mark B of the data filled in the current position by the parameters of the data position marks of the first two groups of positions at this position in the same way as step S221. i , and fill the corresponding position marked data to the current position, and so on, until the position exchange processing of the relevant data in the same row is completed, and then the relevant data positions of other rows are exchanged in turn, and the table to be stored after the exchange processing is marked as the initial encryption table;
[0013] After the initial encryption table is generated, the location mark carried by the corresponding data is deleted;
[0014] Step 3: Based on the several groups of initially encrypted tables confirmed by the batch data, according to the different time entry characteristics of different initially encrypted tables, the data in different columns of the initially encrypted tables are exchanged, and the several groups of initially encrypted tables after the exchange process are marked as storage tables, and the several groups of storage tables confirmed by the batch are placed in the specified storage location of the relational database for storage, and the specific method is as follows:
[0015] S31. Based on the confirmed groups of initial encrypted tables of the batch data, the initial encrypted tables contain different time entry features, which exist when the table to be stored is generated and are timestamps automatically assigned by the system. The groups of initial encrypted tables are sorted according to the order of the time entry features to confirm the table set.
[0016] S32, marking the sorting positions of different initial encryption tables in the table set as W k , where k represents different initial encryption tables, and W k =1, 2, ..., m, when W k =1, indicating that the original encrypted table is located at the first position. k = m, it means that this initial encryption table is at the last position;
[0017] According to the sorting position W corresponding to the initial encryption table k , mark the corresponding digital column in the corresponding initial encrypted table as the swap column, and the swap column includes different data associated with the corresponding column. If there is no corresponding digital column in the corresponding initial encrypted table, the end data column of the initial encrypted table is used as the swap column;
[0018] Sorting position W based on the original encrypted table k And the determined swap column, the swap column and the sort position are (W k+1) to swap the same number columns in the initial encrypted table to complete the swap process. If the sort position is (W k +1) does not exist in the initial encryption table with W k The same number column, then the sort position is (W k +1) the last data column of the initial encryption table is used as the same number column;
[0019] Similarly, all the confirmed transposed columns in each initial encryption table are transposed. k = m's initial encrypted table does not participate in the confirmation process of the exchange column. After the exchange process of several groups of initial encrypted tables of this batch of data is completed, the several groups of initial encrypted tables are marked as storage tables;
[0020] Step 4: After the storage of several groups of storage tables associated with the corresponding batch data is completed, when such storage tables are subsequently extracted, the columns of several groups of storage tables stored at the storage location are preferentially swapped, and then the rows of the swapped tables are decrypted to obtain the original stored tables to be stored.
[0021] Preferably, the specific method of performing column swapping on several groups of storage tables is:
[0022] According to the groups of storage tables stored at the corresponding storage locations, the table sets of the groups of storage tables are confirmed in the same manner as step S31, and the columns of different storage tables in the table set are swapped in the same manner as step S32 to complete the preliminary decryption process.
[0023] Preferably, the specific method of decrypting the rows of the swapped table is:
[0024] Perform secondary decryption on the table that has completed the initial decryption: confirm the number of data G associated with the corresponding row in the corresponding table i , where i represents different rows, and G i is an integer, and generates a set of digital sequences {1, 2, ..., G i};
[0025] The digital sequence is swapped, the positions of the numbers 1, 2 and 3 are kept unchanged, and the numbers in the subsequent positions are the sum of the first two groups of numbers. The numbers in the subsequent different positions are confirmed in sequence. When the numbers confirmed in the subsequent positions are not in the digital sequence, the selected numbers in the digital sequence are removed, and the digital sequence after the removal is marked as a second-class sequence;
[0026] The second-class sequence is then processed and readjusted in the order of value from small to large. The first digit of the second-class sequence is placed after the confirmed digit, and the digits at the subsequent positions are confirmed. The digits at the subsequent positions are the sum of the first two groups of digits. The digits at different subsequent positions are confirmed in sequence. When the subsequently confirmed digits are not in the digit sequence, the selected digits in the digit sequence are removed, and the digit sequence after the removal process is marked as the third-class sequence.
[0027] The processing method of the third type of sequence is the same as that of the second type of sequence, and so on, until the digital sequence is completely processed, the re-determined related sequence is used as the decryption sequence. This decryption sequence is the related sequence after the digital sequence is digitally replaced;
[0028] Based on the different decryption sequences associated with different rows in the table, digital parameters are assigned to the data at different positions in the row from front to back. After the digital parameters are assigned, the data associated with the corresponding digital parameters are filled in the corresponding positions of the corresponding rows in order from small to large according to the numerical values of the digital parameters, thus completing the decryption process of the corresponding table.
[0029] The present invention provides a data security storage method based on a relational database. Compared with the prior art, it has the following beneficial effects:
[0030] The present invention swaps the positions of data in different rows in the table data, confirms the positions based on the corresponding setting logic, confirms the data filled in the subsequent positions, and scrambles the data associated with the original rows, so that the corresponding table presents a chaotic situation in data performance, and then performs relevant decryption according to a specific decryption logic, which can effectively make the corresponding table data in secure storage, and can achieve a better encryption storage effect;
[0031] The tables that have completed the initial encryption are re-encrypted. Several groups of tables are sorted according to the chronological order, and the sorted tables are re-processed. The columns of adjacent tables are swapped. Based on the corresponding swap process, the corresponding tables are re-encrypted to achieve better encryption processing effects and enable the table data to be effectively and securely stored. BRIEF DESCRIPTION OF THE DRAWINGS
[0032] Figure 1 It is a schematic diagram of the process of the present invention;
[0033] Figure 2 This is a schematic diagram of the encryption logic of the present invention. DETAILED DESCRIPTION
[0034] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0035] See also Figure 1 and Figure 2 , the present application provides a data security storage method based on a relational database, comprising the following steps:
[0036] Step 1: Input the batch data to be stored in the relational database, confirm the associated data belonging to different objects from the batch data, and then lock the feature table associated with the corresponding object. Based on the different associated items of several groups of associated data of the object, fill them in the associated feature table in turn to generate several groups of to-be-stored tables belonging to this batch data. Specifically, the feature tables are all preset tables, which are preset in advance by relevant operators. Different rows and columns in each feature table correspond to different feature items, and different feature items correspond to different associated data, so that different associated data can be filled in the corresponding feature items in turn to generate corresponding relational table data, which is convenient for storage.
[0037] Among them, the specific sub-steps of generating the feature table are:
[0038] S11. Based on the currently confirmed batch data, based on the headers of different related data, confirm different objects to which the corresponding related data belong (the headers are all preset in advance), and confirm different feature tables associated with different objects from the database, and the feature tables are all preset tables;
[0039] S12, based on different feature tables corresponding to different associated data, compare the associated items of different data in the associated data with the preset feature items in the feature table one by one, determine the feature item corresponding to the associated item, and fill the data associated with the associated item to the designated data position of the corresponding feature item. If there are multiple groups of data associated with the associated item, fill the corresponding associated data in sequence according to the time sequence;
[0040] After the several groups of associated data associated with the designated object are filled, the filled feature table is marked as a table to be stored;
[0041] Specifically, different objects have different feature tables, and there are multiple groups of internal related items in different objects. The feature items in the feature tables will cover several groups of related items of the specified object. There is only a situation where data is not entered into the feature items in the feature table, and there is no situation where the corresponding related items of the corresponding object are not filled with data. That is, the feature items in the feature table include all the related items of the corresponding object. Under normal circumstances, they are one-to-one corresponding. In a few cases, there will be missing data, resulting in the absence of fill-in data for the feature items in some areas of the corresponding feature table.
[0042] Step 2: Perform initial encryption processing on several groups of tables to be stored confirmed by this batch of data. Based on the different data filled in different positions of different rows in the table to be stored and the front and back sorting positions of the data, confirm the specific position of the data, and then scramble the different data of each different row based on the preset encryption processing logic to complete the initial encryption process of the corresponding table to be stored and mark it as the initial encrypted table. Specifically, in the associated data of each row of the corresponding table to be stored, there are several groups of different data belonging to different feature items. In order to fully hide the data features of the table to be stored, the corresponding different data are scrambled to complete the data hiding encryption process of the corresponding table to be stored and achieve a better encryption processing effect. The specific sub-steps of encrypting the table to be stored are as follows:
[0043] S21. Based on the confirmed table to be stored, confirm the different data associated with each row, and mark the position of the confirmed data. i , where i represents different rows, and B i =1, 2, ..., n, B i When it is 1, it means that the data marked at this position is in the first row. i When it is n, it means that the data marked at this position is in the last row, and the first row and the last row are marked in advance;
[0044] S22, after marking the positions of several groups of data belonging to the same row, i Sort from the first row to the last row, confirm the position sequence of several groups of data in this row {1, 2, ..., n}, and swap the positions of related data in the same row based on this position sequence:
[0045] S221, B i = 1 keep the position unchanged, and sort the second group of position marks that appear later in B i =1 data (then B i =2), when confirming the third set of data, based on the parameters of the first two sets of position marks and confirming the position marks associated with them (current B i=3, the third group of data remains unchanged), when confirming the data at the subsequent corresponding position, the position mark B of the data filled in the current position is confirmed based on the parameters of the data position mark of the first two groups of positions at this position and i , and fill the corresponding position mark data to this position (current B j =5, because the data at the fourth position is the sum of the position marks of the first two groups of data, that is, 2+3=5, so the data sorted at the fourth position is B i =5), and so on, the data to be filled in the subsequent positions are confirmed in sequence. When the parameter confirmed in a subsequent position does not exist in the position sequence, step S222 is executed;
[0046] S222, remove the position marks associated with the data that have completed the filling process in the position sequence, and then re-sort the position sequence in a descending order to confirm the subsequent sequence, and fill the data associated with the first position mark in the subsequent sequence to the subsequent position, and then confirm the position mark B of the data filled in the current position by the parameters of the data position marks of the first two groups of positions at this position in the same way as step S221. i , and fill the corresponding position marked data to the current position, and so on, until the position swapping of the relevant data in the same row is completed, and then the relevant data positions of other rows are swapped in turn, and the table to be stored after the swapping process is marked as the initial encrypted table (if a group of tables to be stored has only one column of data, that is, there is only one group of data in each row, it is directly marked as the initial encrypted table, which is generally rare);
[0047] After the initial encryption table is generated, the position mark carried by the corresponding data is deleted.
[0048] For example, suppose that there are ten sets of data in a row of table A to be stored. According to the determined first row and last row, the ten sets of data will carry different position marks respectively. The expression sequence of the position marks is {1, 2, ..., 10}. Then, the data will be shuffled according to the above steps:
[0049] The data positions marked as 1 and 2 remain unchanged, and data filling is performed starting from the third position. The data filled in the third position is the relevant data of the position mark (1+2), that is, the data marked as 3. The data filled in the fourth position is the relevant data of the position mark (2+3), that is, the data marked as 5. The data filled in the fifth position is the relevant data of the position mark (3+5), that is, the data of the position data 8. The parameter sum confirmed by the data filled in the sixth position is (8+5)=13. The data 13 does not exist in the representation sequence, so step S222 is executed, that is, the data filled in from top to bottom in step S221 are: 1, 2, 3, 5, 8, and the remaining subsequent sequence is represented as {4, 6, 7, 9, 10};
[0050] Fill the data marked as 4, which is located after the data marked as 8. 4+8=12, which does not exist in the corresponding sequence;
[0051] Then the sequence is transformed into {6, 7, 9, 10}, and the data marked as position 6 is filled in the corresponding position, which is located after the data marked as position 4. 4+6=10, so the position of the data filled in successively is marked as 10;
[0052] The remaining sequence is {7, 9}, which can be filled in according to the above rules;
[0053] Then the original ten positions are filled with data 1, 2, ..., 10. After the data positions are swapped, the position marks of the swapped data are expressed as: 1, 2, 3, 5, 8, 4, 6, 10, 7, 9. After the data positions are effectively swapped, the data of the corresponding rows are subsequently retrimmed according to the corresponding association logic to obtain the original related data.
[0054] Step 3: Based on the several groups of initially encrypted tables confirmed by the batch data, the data in different columns of the initially encrypted tables are exchanged according to the different time entry characteristics of different initially encrypted tables, and the several groups of initially encrypted tables after the exchange process are marked as storage tables, and the several groups of storage tables confirmed by the batch are placed in the specified storage location of the relational database for storage, wherein the specific sub-steps of marking as storage tables are as follows:
[0055] S31. Based on the confirmed groups of initial encrypted tables of the batch data, the initial encrypted tables contain different time entry features, which exist when the table to be stored is generated and are timestamps automatically assigned by the system. The groups of initial encrypted tables are sorted according to the order of the time entry features to confirm the table set.
[0056] S32, marking the sorting positions of different initial encryption tables in the table set as W k , where k represents different initial encryption tables, and W k =1, 2, ..., m, when W k =1, indicating that the original encrypted table is located at the first position. k = m, it means that this initial encryption table is at the last position;
[0057] According to the sorting position W corresponding to the initial encryption table k , mark the corresponding digital column in the corresponding initial encryption table as the swap column (that is, W k = 1, the first column in the table is marked as the swap column. k =5, the fifth column in the table is marked as the swap column), the swap column includes different data associated with the corresponding column, if there is no corresponding digital column in the corresponding initial encrypted table, the end data column of the initial encrypted table is used as the swap column;
[0058] Sorting position W based on the original encrypted table k And the determined swap column, the swap column and the sort position are (W k +1) to swap the same number columns in the initial encrypted table to complete the swap process. If the sort position is (W k +1) does not exist in the initial encryption table with W k The same number column, then the sort position is (W k +1) the last data column of the initial encryption table is used as the same number column;
[0059] Similarly, all the confirmed transposed columns in each initial encryption table are transposed. k =m's initial encrypted table does not participate in the confirmation process of the exchanged columns. After the exchange process of several groups of initial encrypted tables of this batch of data is completed, the several groups of initial encrypted tables are marked as storage tables. Because even if the exchanged columns of the last group of tables are confirmed, the table of (m+1) cannot be found, so there is no need to confirm the exchanged columns;
[0060] Example: Suppose there are five sets of initial encryption tables, then the associated sort positions W k =1, 2, ..., 5, W k =1 is marked as the exchange column. The first column of the first and second groups of initial encryption tables are exchanged, the second columns of the second and third groups are exchanged, the third columns of the third and fourth groups are exchanged, and so on, completing the specific column exchange process of the five groups of initial encryption tables.
[0061] Step 4: After the storage of the corresponding batch data is completed, when the storage tables are subsequently extracted, the columns of the storage tables are preferentially swapped according to the storage tables stored at the storage location, and then the swapped tables are decrypted row by row to obtain the original stored tables to be stored, wherein the decryption method is:
[0062] S41, according to the plurality of groups of storage tables stored at the corresponding storage locations, confirming a table set of the plurality of groups of storage tables in the same manner as step S31, and swapping columns of different storage tables in the table set in the same manner as step S32, thereby completing the preliminary decryption process;
[0063] S42, perform secondary decryption processing on the table that has completed the initial decryption: confirm the number of data G associated with the corresponding row in the corresponding table i , where i represents different rows, and G i is an integer, and generates a set of digital sequences {1, 2, ..., G i};
[0064] The digital sequence is swapped, the positions of the numbers 1, 2 and 3 are kept unchanged, and the numbers in the subsequent positions are the sum of the first two groups of numbers. The numbers in the subsequent different positions are confirmed in sequence. When the numbers confirmed in the subsequent positions are not in the digital sequence, the selected numbers in the digital sequence are removed, and the digital sequence after the removal is marked as a second-class sequence;
[0065] The second-class sequence is then processed and readjusted in the order of value from small to large. The first digit of the second-class sequence is placed after the confirmed digit, and the digits at the subsequent positions are confirmed. The digits at the subsequent positions are the sum of the first two groups of digits. The digits at different subsequent positions are confirmed in sequence. When the subsequently confirmed digits are not in the digit sequence, the selected digits in the digit sequence are removed, and the digit sequence after the removal process is marked as the third-class sequence.
[0066] The processing method of the third type of sequence is the same as that of the second type of sequence, and so on, until the digital sequence is completely processed, the re-determined related sequence is used as the decryption sequence. This decryption sequence is the related sequence after the digital sequence is digitally replaced;
[0067] S43. Based on the different decryption sequences associated with different rows in the table, digital parameters are assigned to the data at different positions in the row from front to back (the data at the first position is assigned 1, ..., the data at the fourth position is assigned 5, and so on). After all the digital parameters are assigned, the data associated with the corresponding digital parameters are filled in the corresponding positions of the corresponding rows in order from small to large according to the numerical values of the digital parameters, thereby completing the decryption process of the corresponding table.
[0068] Some of the data in the above formulas are dimensionless and numerically calculated. Meanwhile, the contents not described in detail in this specification belong to the prior art known to those skilled in the art.
[0069] The above embodiments are only used to illustrate the technical method of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical method of the present invention may be modified or replaced by equivalents without departing from the spirit and scope of the technical method of the present invention.
Claims
1. A data security storage method based on a relational database, characterized in that: The following steps are involved: Step 1: Input the batch data to be stored in the relational database, confirm the associated data belonging to different objects from the batch data, and then lock the feature table associated with the corresponding object. Based on the different associated items of several groups of associated data of the object, fill them into the associated feature table in sequence to generate several groups of to-be-stored tables belonging to this batch data. Step 2: Perform initial encryption processing on several groups of to-be-stored tables confirmed by the batch data. Based on the different data filled in different positions of different rows in the to-be-stored tables and the front-to-back sorting positions of the data, confirm the specific positions of the data. Then, based on the preset encryption processing logic, scramble the different data in each different row to complete the initial encryption process of the corresponding to-be-stored tables and mark them as the initial encrypted tables. Step 3: Based on the several groups of initial encrypted tables confirmed by the batch data, according to the different time entry characteristics of different initial encrypted tables, the data of different columns in the initial encrypted tables are re-exchanged, the several groups of initial encrypted tables after the exchange process are marked as storage tables, and the several groups of storage tables confirmed by the batch are placed in the specified storage location of the relational database for storage; Step 4: After the storage of several groups of storage tables associated with the corresponding batch data is completed, when such storage tables are subsequently extracted, the columns of several groups of storage tables stored at the storage location are preferentially swapped, and then the rows of the swapped tables are decrypted to obtain the original stored tables to be stored.
2. The data security storage method based on relational database according to claim 1 is characterized in that: In step 1, the specific sub-steps of generating the feature table are: S11, based on the currently confirmed batch data, based on the headers of different associated data, confirm the different objects to which the corresponding associated data belong, and confirm the different feature tables associated with the different objects from the database, Its characteristic tables are all preset tables; S12, based on different feature tables corresponding to different associated data, compare the associated items of different data in the associated data with the preset feature items in the feature table one by one, determine the feature item corresponding to the associated item, and fill the data associated with the associated item to the designated data position of the corresponding feature item. If there are multiple groups of data associated with the associated item, fill the corresponding associated data in sequence according to the time sequence; After a number of groups of associated data associated with a designated object are filled, the filled feature table is marked as a table to be stored.
3. The data security storage method based on relational database according to claim 1 is characterized in that: In the step 2, the specific sub-steps of encrypting the table to be stored are: S21. Based on the confirmed table to be stored, confirm the different data associated with each row, and mark the position of the confirmed data. i , where i represents different rows, and B i =1, 2, ..., n, B i When it is 1, it means that the data marked at this position is in the first row. i When it is n, it means that the data marked at this position is located in the last row; S22, after marking the positions of several groups of data belonging to the same row, i Sort from the first row to the last row, confirm the position sequence {1, 2, ..., n} of several groups of data in this row, and based on this position sequence, swap the positions of related data in the same row to confirm the initial encryption table.
4. The data security storage method based on relational database according to claim 3 is characterized in that: In step S22, the specific sub-steps of replacing the positions of the relevant data in the same row based on the position sequence are: S221, B i = 1 keep the position unchanged, and sort the second group of position marks that appear later in B i =1, when confirming the third set of data, according to the parameters of the first two sets of position marks and confirming the position marks associated with them, when confirming the data at the subsequent corresponding positions, according to the parameters of the data position marks of the first two sets of positions at this position and confirming the position mark B of the data filled in the current position i , and fill the data of the corresponding position mark to the current position, and so on, confirm the data to be filled in the subsequent consecutive positions in sequence, and when the parameter confirmed by a subsequent position does not exist in the position sequence, execute step S222; S222, remove the position marks associated with the data that have completed the filling process in the position sequence, and then re-sort the position sequence in a descending order to confirm the subsequent sequence, and fill the data associated with the first position mark in the subsequent sequence to the subsequent position, and then confirm the position mark B of the data filled in the current position by the parameters of the data position marks of the first two groups of positions at this position in the same way as step S221. i , and fill the corresponding position marked data to the current position, and so on, until the position exchange processing of the relevant data in the same row is completed, and then the relevant data positions of other rows are exchanged in turn, and the table to be stored after the exchange processing is marked as the initial encryption table; After the initial encryption table is generated, the position mark carried by the corresponding data is deleted.
5. The data security storage method based on relational database according to claim 1 is characterized in that: In step 3, the specific method of calibrating the storage table is: S31. Based on the confirmed groups of initial encrypted tables of the batch data, the initial encrypted tables contain different time entry features, which exist when the table to be stored is generated and are timestamps automatically assigned by the system. The groups of initial encrypted tables are sorted according to the order of the time entry features to confirm the table set. S32, marking the sorting positions of different initial encryption tables in the table set as W k , where k represents different initial encryption tables, and W k =1, 2, ..., m, when W k =1, indicating that the original encrypted table is located at the first position. k = m, it means that this initial encryption table is at the last position; According to the sorting position W corresponding to the initial encryption table k , mark the corresponding digital column in the corresponding initial encrypted table as the swap column, and the swap column includes different data associated with the corresponding column. If there is no corresponding digital column in the corresponding initial encrypted table, the end data column of the initial encrypted table is used as the swap column; Sorting position W based on the original encrypted table k And the determined swap column, the swap column and the sort position are (W k +1) to swap the same number columns in the initial encrypted table to complete the swap process. If the sort position is (W k +1) does not exist in the initial encryption table with W k The same number column, then the sort position is (W k +1) the last data column of the initial encryption table is used as the same number column; Similarly, all the confirmed transposed columns in each initial encryption table are transposed. k =m does not participate in the confirmation process of the exchange column. After the exchange processing of several groups of initial encryption tables of this batch data is completed, the several groups of initial encryption tables are marked as storage tables.
6. The data security storage method based on relational database according to claim 5 is characterized in that: In step 4, the specific method of performing column swapping on several groups of storage tables is as follows: According to the groups of storage tables stored at the corresponding storage locations, the table sets of the groups of storage tables are confirmed in the same manner as step S31, and the columns of different storage tables in the table set are swapped in the same manner as step S32 to complete the preliminary decryption process.
7. The data security storage method based on relational database according to claim 6 is characterized in that: In step 4, the specific method of decrypting the rows of the swapped table is: Perform secondary decryption on the table that has completed the initial decryption: confirm the number of data G associated with the corresponding row in the corresponding table i , where i represents different rows, and G i is an integer, and generates a set of digital sequences {1, 2, ..., G i }; The digital sequence is swapped, the positions of the numbers 1, 2 and 3 are kept unchanged, and the numbers in the subsequent positions are the sum of the first two groups of numbers. The numbers in the subsequent different positions are confirmed in sequence. When the numbers confirmed in the subsequent positions are not in the digital sequence, the selected numbers in the digital sequence are removed, and the digital sequence after the removal is marked as a second-class sequence; The second-class sequence is then processed and readjusted in the order of value from small to large. The first digit of the second-class sequence is placed after the confirmed digit, and the digits at the subsequent positions are confirmed. The digits at the subsequent positions are the sum of the first two groups of digits. The digits at different subsequent positions are confirmed in sequence. When the subsequently confirmed digits are not in the digit sequence, the selected digits in the digit sequence are removed, and the digit sequence after the removal process is marked as the third-class sequence. The processing method of the third type of sequence is the same as that of the second type of sequence, and so on, until the digital sequence is completely processed, the re-determined related sequence is used as the decryption sequence. This decryption sequence is the related sequence after the digital sequence is digitally replaced; Based on the different decryption sequences associated with different rows in the table, digital parameters are assigned to the data at different positions in the row from front to back. After the digital parameters are assigned, the data associated with the corresponding digital parameters are filled in the corresponding positions of the corresponding rows in order from small to large according to the numerical values of the digital parameters, thus completing the decryption process of the corresponding table.
Citation Information
Patent Citations
Data security storage method
CN115694784A
Data encryption transmission method and device, storage medium and computer equipment
CN117692129A
Private data storage method, private data reading method, private data storage device, private data reading device and computer equipment
CN117932678A