Multi-source heterogeneous data fusion and synchronization method and system based on distributed database

By encrypting multi-source heterogeneous data and generating and saving check codes, the problem of insufficient security of fused data in multi-source heterogeneous fusion data synchronization technology in the existing technology is solved, and real-time detection and repair of data is realized. Data security and consistency are ensured.

CN118585588BActive Publication Date: 2024-10-29BEIJING XUNAO TECH
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202411011900.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-26
Publication Date
2024-10-29
Estimated Expiration
2044-07-26

AI Technical Summary

Technical Problem

The existing multi-source heterogeneous fusion data synchronization technology has deficiencies in the security protection of fusion data, which makes the fusion data easily tampered with or damaged and fails to effectively prevent data tampering and damage.

Method used

By reading multi-source heterogeneous data in the distributed database for fusion, the data is encrypted and a data verification code is generated, and the verification code is saved to the distributed database, and the protected data is verified and restored based on the verification code. To ensure data integrity and security.

Benefits of technology

It improves the security of multi-source heterogeneous fusion data, can detect and repair data tampering or damage in real time, and ensure the synchronization consistency and integrity of data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118585588B_ABST
    Figure CN118585588B_ABST
Patent Text Reader

Abstract

The present invention discloses a multi-source heterogeneous data fusion and synchronization method and system based on a distributed database, relates to the technical field of multi-source heterogeneous fusion data synchronization, and comprises the following steps: reading a distributed database, acquiring multi-source heterogeneous data, fusing the multi-source heterogeneous data to obtain fused data; encrypting the fused data to obtain protected data; generating a data verification code based on the protected data; saving the data verification code to a distributed database, verifying the protected data based on the data verification code in the distributed database, and restoring the protected data through the data verification code when the protected data is abnormal; the present invention is used to solve the problem that the existing multi-source heterogeneous fusion data synchronization technology still has insufficient security protection for fused data, resulting in the problem that fused data is prone to errors.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of multi-source heterogeneous fusion data synchronization, and specifically to a multi-source heterogeneous data fusion synchronization method and system based on a distributed database. Background Art

[0002] Multi-source heterogeneous fusion data synchronization technology refers to the technical methods and tools that integrate heterogeneous data from different data sources into a unified data storage system through a series of processing and operations, and maintain data synchronization and consistency.

[0003] Existing multi-source heterogeneous fusion data synchronization technology usually integrates multiple heterogeneous data from multiple parties for fusion, and displays the fused data to users and stores it. The fused data is a collection of many data. If the fused data is tampered with or leaked, all multi-source heterogeneous data will become invalid. Therefore, it is necessary to pay attention to the security of the fused data to ensure the security of the fused data. In addition, the existing multi-source heterogeneous fusion data synchronization technology only prevents the data from being cracked when protecting the fused data. There are no corresponding measures for data damage or tampering, which makes the fused data easy to be tampered with. For example, in a Chinese patent with application publication number CN116186129A, a multi-source heterogeneous data processing method and device are disclosed. This solution only considers that the fused data is not cracked and leaked, and does not protect the data from tampering, which makes the fused data prone to errors. The existing multi-source heterogeneous fusion data synchronization technology also has insufficient security protection for the fused data, which makes the fused data prone to errors. Summary of the invention

[0004] The present invention aims to solve one of the technical problems in the prior art to at least a certain extent, by reading a distributed database to obtain multi-source heterogeneous data, fusing the multi-source heterogeneous data to obtain fused data, encrypting the fused data to obtain protection data, generating a data verification code based on the protection data, and then saving the data verification code to the distributed database, verifying the protection data based on the data verification code in the distributed database, and restoring the protection data through the data verification code when the protection data is abnormal, so as to solve the problem that the existing multi-source heterogeneous fusion data synchronization technology still has insufficient security protection for the fused data, resulting in the fused data being prone to errors.

[0005] To achieve the above objectives, in a first aspect, the present application provides a multi-source heterogeneous data fusion and synchronization method based on a distributed database, comprising the following steps:

[0006] Read distributed databases, obtain multi-source heterogeneous data, and fuse the multi-source heterogeneous data to obtain fused data;

[0007] Encrypt the fused data to obtain protected data;

[0008] Generate a data check code based on the protection data;

[0009] The data verification code is saved in the distributed database, the protection data is verified based on the data verification code in the distributed database, and the protection data is restored through the data verification code when the protection data is abnormal.

[0010] Furthermore, it is characterized in that reading the distributed database, obtaining multi-source heterogeneous data, fusing the multi-source heterogeneous data, and obtaining the fused data includes the following sub-steps:

[0011] Read distributed databases to obtain multi-source heterogeneous data;

[0012] Data mapping is performed on multi-source heterogeneous data, and after the mapping is completed, data fusion is performed to obtain fused data.

[0013] Furthermore, it is characterized in that encrypting the fused data to obtain the protected data comprises the following sub-steps:

[0014] Obtaining an encryption key and dividing nodes in a distributed database, wherein the nodes are database servers;

[0015] The fused data is encrypted using an encryption key.

[0016] Furthermore, it is characterized in that obtaining the encryption key and dividing the nodes in the distributed database comprises the following sub-steps:

[0017] Obtaining an encryption key input by a user, wherein the encryption key includes at least one uppercase letter, lowercase letter, and number;

[0018] The nodes in the distributed database are numbered by symbol D n Indicates, where n is a non-zero natural number and n is the sequence number of D;

[0019] For D n , calculate the remainder of n%3, marked as storing the remainder, where % is the modulus operator;

[0020] If the storage remainder is 1, the first storage signal is output; if the storage remainder is 2, the second storage signal is output; if the storage remainder is 0, the third storage signal is output; if the first storage signal is output, D n is marked as the first storage node; if the second storage signal is output, D n is marked as the second storage node; if the third storage signal is output, D n Marked as the third storage node.

[0021] Furthermore, it is characterized in that encrypting the fused data by using the encryption key comprises the following sub-steps:

[0022] Convert the fused data into Unicode code and name it as initial code, and convert the encryption key into Unicode code and name it as initial key;

[0023] The initial code is converted into a matrix form according to a group of 4 characters, which is named as the code matrix; the initial key is converted into a matrix form according to a group of 4 characters, which is named as the key matrix;

[0024] The encoding matrix is ​​numbered using the symbol EM i Indicates, where i is a non-zero natural number and i is the serial number of EM; the key matrix is ​​numbered and represented by the symbol KM j Indicates, where j is a non-zero natural number and j is the serial number of KM;

[0025] For EM i , determine whether i is an odd number or an even number. If i is an odd number, an odd number calculation signal is output; if it is an even number, an even number processing signal is output;

[0026] The encoding matrix is ​​processed accordingly based on the output signal.

[0027] Furthermore, it is characterized in that performing corresponding processing on the encoding matrix based on the output signal comprises the following sub-steps:

[0028] If the output is an odd number, then the formula Calculate EM i The protection matrix, where PM i To protect the matrix, max() is the maximum value operator. KM for j=2×m-1 j ;

[0029] If the output is an even number, then the formula Calculate EM i The protection matrix is KM for j=2×m j ;

[0030] Each element in the protection matrix is ​​completed to four digits by adding "10" or "100" to the first digit, and then restored to a string with the same format as the initial code, named protection code; if the element is a two-digit number, add "10", and if it is a one-digit number, add "100";

[0031] Convert the protection code from Unicode to Chinese to obtain the protection data. When multi-source heterogeneous data changes, the protection data will be synchronized in real time.

[0032] Furthermore, it is characterized in that generating a data check code based on the protection data comprises the following sub-steps:

[0033] Obtain a protection code, named as a second code, regard the protection code as a complete number, convert the protection code into a decimal code and a binary code, named as a first code and a third code respectively;

[0034] A first check code, a second check code and a third check code are set, wherein the first check code is composed of the number 9 which is the same as the first code; the second check code is composed of the hexadecimal number F which is the same as the second code; and the third check code is composed of the thirty binary digits Z which is the same as the third code;

[0035] Calculate the first check code and subtract the first code to obtain the first data check code; calculate the second check code and subtract the second code to obtain the second data check code; calculate the third check code and subtract the third code to obtain the third data check code;

[0036] The first data check code, the second data check code and the third data check code are collectively referred to as data check codes.

[0037] Furthermore, it is characterized in that the data verification code is saved in a distributed database, the protection data is verified based on the data verification code in the distributed database, and when the protection data is abnormal, the protection data is restored by the data verification code, which includes the following sub-steps:

[0038] The first data check code is stored in the first storage node, the second data check code is stored in the second storage node, and the third data check code is stored in the third storage node;

[0039] When the user reads the fused data, he / she enters the password and runs the decryption program through the password to decrypt the protected data. The password is the encryption key and the decryption program is the inverse operation of the data encryption.

[0040] The protection data is verified based on the data verification code in the distributed database, and the protection data is restored through the data verification code when the protection data is abnormal.

[0041] Furthermore, it is characterized in that the protection data is verified based on the data verification code in the distributed database, and when the protection data is abnormal, the protection data is restored by the data verification code, which includes the following sub-steps:

[0042] Calculate the first check code and subtract the first data check code to obtain a first restoration code; calculate the second check code and subtract the second data check code to obtain a second restoration code; calculate the third check code and subtract the third data check code to obtain a third restoration code;

[0043] The first restoration code and the second restoration code are converted into hexadecimal codes, all the converted first restoration codes and the third restoration codes are named together with the second restoration code as restoration check codes, and the restoration check code with the highest degree of repetition among the restoration check codes is marked as a fusion restoration code;

[0044] Get the protection data, convert the protection data into Unicode code, name it as the code to be verified, compare the code to be verified with the fusion restoration code, and if the code to be verified is equal to the fusion restoration code, output a normal data signal; otherwise, output a data abnormal signal;

[0045] If an abnormal data signal is output, the fused restoration code will be used as the protection code, converted into Chinese to obtain the protection data, and the protection data will be synchronized to the user in a timely manner.

[0046] In a second aspect, the present application provides a multi-source heterogeneous data fusion and synchronization system based on a distributed database, including a multi-source heterogeneous fusion module, a fusion data protection module, a check code generation module and a fusion data verification module; the multi-source heterogeneous fusion module, the fusion data protection module and the fusion data verification module are respectively connected to the check code generation module data;

[0047] The multi-source heterogeneous fusion module is used to read the distributed database, obtain multi-source heterogeneous data, and fuse the multi-source heterogeneous data to obtain fused data;

[0048] The fusion data protection module is used to encrypt the fusion data to obtain protected data;

[0049] The verification code generation module is used to generate a data verification code based on the protection data;

[0050] The fused data verification module is used to save the data verification code to the distributed database, verify the protection data based on the data verification code in the distributed database, and restore the protection data through the data verification code when the protection data is abnormal.

[0051] Beneficial effects of the present invention: The present invention obtains multi-source heterogeneous data by reading a distributed database, fuses the multi-source heterogeneous data to obtain fused data, and then encrypts the fused data to obtain protected data. The advantage is that the fused data is a collection of multi-source heterogeneous data. If leakage occurs, all data will be leaked. Therefore, it is necessary to focus on strengthening the security protection of the fused data, thereby improving the security of the multi-source heterogeneous fused data.

[0052] The present invention generates a data verification code based on the protection data, then saves the data verification code to a distributed database, verifies the protection data based on the data verification code in the distributed database, and restores the protection data through the data verification code when the protection data is abnormal. The advantage is that the data verification code can verify whether the protection data has been tampered with or damaged, and restore it at the same time. Storing it in a distributed database can prevent the data verification code from being tampered with. Unless the data verification codes in most or even all nodes in the distributed database are tampered with, the protection data can be prevented from being restored and synchronized to the user in a timely manner, thereby improving the security of multi-source heterogeneous fusion data and the security of data synchronization. BRIEF DESCRIPTION OF THE DRAWINGS

[0053] Figure 1 It is a functional block diagram of the system of the present invention.

[0054] Figure 2 Schematic diagram of the database server of the present invention.

[0055] Figure 3 The present invention is a flowchart of the steps of verifying the protection data.

[0056] Figure 4 The figure is a flow chart of the steps of the method of the present invention. DETAILED DESCRIPTION

[0057] 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.

[0058] Example 1, please refer to Figure 1 As shown, the present application provides a multi-source heterogeneous data fusion synchronization system based on a distributed database, including a multi-source heterogeneous fusion module, a fusion data protection module, a check code generation module and a fusion data verification module; the multi-source heterogeneous fusion module, the fusion data protection module and the fusion data verification module are respectively connected to the check code generation module data;

[0059] The multi-source heterogeneous fusion module is used to read the distributed database, obtain multi-source heterogeneous data, fuse the multi-source heterogeneous data, and obtain fused data;

[0060] The multi-source heterogeneous fusion module is configured with a multi-source heterogeneous fusion strategy, which includes:

[0061] Read distributed databases to obtain multi-source heterogeneous data;

[0062] Perform data mapping on multi-source heterogeneous data, and then perform data fusion after the mapping is completed to obtain fused data;

[0063] In practical applications, data mapping and data fusion of multi-source heterogeneous data are implemented using existing technologies. The present invention only protects the security issues of fused data during the synchronization process. The fusion process of multi-source heterogeneous data is no different from the existing technology, and there are only differences in synchronization and security protection processing. Therefore, this embodiment omits the specific steps for the fusion of multi-source heterogeneous data; the fused data obtained is "temperature sensor: 30°C".

[0064] The fusion data protection module is used to encrypt the fusion data to obtain protected data; the fusion data protection module includes a node division unit, an encryption judgment unit and an encryption processing unit;

[0065] See also Figure 2 As shown, the node division unit is used to obtain the encryption key and divide the nodes in the distributed database, and the nodes are database servers;

[0066] The node partitioning unit is configured with a node partitioning strategy, which includes:

[0067] Get the encryption key input by the user. The encryption key contains at least one uppercase letter, lowercase letter and number.

[0068] The nodes in the distributed database are numbered by symbol D n Indicates, where n is a non-zero natural number and n is the sequence number of D;

[0069] For D n , calculate the remainder of n%3, marked as storing the remainder, % is the modulus operator;

[0070] If the storage remainder is 1, the first storage signal is output; if the storage remainder is 2, the second storage signal is output; if the storage remainder is 0, the third storage signal is output; if the first storage signal is output, D n is marked as the first storage node; if the second storage signal is output, D n is marked as the second storage node; if the third storage signal is output, D n Marked as the third storage node;

[0071] In actual application, the encryption key obtained is "Test123". There are 6 database servers, i.e. 6 nodes, in the distributed database of this embodiment. The nodes are obtained by numbering as D1 to D6, 1≤n≤6; when n=1 or 4 is calculated, the storage remainder is 1, and the first storage signal is output; when n=2 or 5, the storage remainder is 2, and the second storage signal is output; when n=3 or 6, the storage remainder is 0, and the third storage signal is output; the nodes corresponding to D1 and D4 are marked as the first storage nodes, the nodes corresponding to D2 and D5 are marked as the second storage nodes, and the nodes corresponding to D3 and D6 are marked as the third storage nodes; the database server is used to store multi-source heterogeneous data and data verification codes. When users read fused data, it is done through the fusion server, and the fusion server is also used to perform data encryption and generate data verification codes;

[0072] The encryption judgment unit is configured with an encryption judgment strategy, which includes:

[0073] Convert the fused data into Unicode code and name it as initial code, and convert the encryption key into Unicode code and name it as initial key;

[0074] In actual application, the initial code obtained by conversion is "\u6e29\u5ea6\u4f20\u611f\u5668\uff1a\u0033\u0030\u2103". Because only hexadecimal numbers need to be processed during the processing, it is necessary to remove the "\u" in the Unicode code, and the initial code is "6e295ea64f20611f5668ff1a003300302103". When it is restored to Chinese later, it is only necessary to add "\u" before each 4-digit hexadecimal code. Similarly, the initial key converted is "0054006500730074003100320033".

[0075] The initial code is converted into a matrix form according to a group of 4 characters, which is named as the code matrix; the initial key is converted into a matrix form according to a group of 4 characters, which is named as the key matrix;

[0076] The encoding matrix is ​​numbered using the symbol EM i Indicates, where i is a non-zero natural number and i is the serial number of EM; the key matrix is ​​numbered and represented by the symbol KM j Indicates, where j is a non-zero natural number and j is the serial number of KM;

[0077] For EM i , determine whether i is an odd number or an even number. If i is an odd number, an odd number calculation signal is output; if it is an even number, an even number processing signal is output;

[0078] Perform corresponding processing on the encoding matrix based on the output signal;

[0079] In practical applications, the encoding matrix is ​​converted to , , , , , , , as well as , EM1 to EM9, 1≤i≤9; the key matrix is , , , , , as well as , KM1 to KM7, 1≤j≤7; by comparison, i in EM1, EM3, EM5, EM7 and EM9 is an odd number, and an odd number processing signal is output, that is, , , , as well as Perform odd number processing; by comparing, it is found that i in EM2, EM4, EM6 and EM8 is an even number, and an even number processing signal is output, that is, , , as well as Perform even number processing;

[0080] The encryption processing unit is configured with an encryption processing strategy, which includes:

[0081] If the output is an odd number, then the formula Calculate EM i The protection matrix, where PM i To protect the matrix, max() is the maximum value operator. KM for j=2×m-1 j ;

[0082] If the output is an even number, then the formula Calculate EM i The protection matrix is KM for j=2×m j ;

[0083] Each element in the protection matrix is ​​completed to four digits by adding "10" or "100" to the first digit, and then restored to a string with the same format as the initial code, named protection code; if the element is a two-digit number, add "10", and if it is a one-digit number, add "100";

[0084] Convert the protection code from Unicode to Chinese to obtain the protection data. When multi-source heterogeneous data changes, the protection data will be synchronized in real time.

[0085] In practical applications, the maximum value of j is 7, that is, max(j)=7, that is, max(j) / 2+max(j)%2=7 / 2+ / %2=4.5. Since m is an integer, only the integer part is retained, that is, max(j) / 2+max(j)%2=7 / 2+ / %2=4. This embodiment only demonstrates the calculation process of EM1, and the other EM i The calculation process is the same as that of EM1, so it will not be demonstrated in detail. For EM1, an odd number processing signal is output, that is, the calculation , after substituting into the matrix, ,get ; Since the maximum value of the elements in the protection matrix calculated by this method is two digits, you can add 10 or 100 to complete it. When deleting it later, you only need to find out whether the third digit is 0. If so, remove the first three digits. If not, remove the first two digits to get the original protection matrix; each element in the protection matrix is ​​completed to a four-digit number by adding "10" or "100" to the first digit, and you get , and then restore it to a string with the same format as the initial code, and get the partial protection code as 1006100e10141014. When converting to Chinese, you need to add "\u" before every 4 characters, that is, \u1006\u100e\u1014\u1014. The partial protection code corresponding to PM2 is connected to the end of PM1. Calculate all PM i After that, the complete protection code is "1006100e101410141005100e101C10111004100f1014100B100610011013101A1005100610181013100f100f10131015100010001015100E100010001015100B100210011012100E"; when converted to Chinese, you need to enter "\u1006\u100e\u1014\u1014\u100 5\u100e\u101C\u1011\u1004\u100f\u1014\u100B\u1006\u1001\u1013\u101A\u1005\u1006\u1018\u1013\u100f\u100f\u1013\u1015\u1000\u1000\u1015\u100E\u1000\u1000\u1015\u100B\u1002\u1001\u1012\u100E” is converted into Chinese to obtain the protected data.

[0086] The verification code generation module is used to generate a data verification code based on the protection data;

[0087] The verification code generation module is configured with a verification code generation strategy, which includes:

[0088] Obtain a protection code, named as a second code, regard the protection code as a complete number, convert the protection code into a decimal code and a binary code, named as a first code and a third code respectively;

[0089] In practical applications, the protection code, that is, the second code is "1006100e101410141005100e101C10111004100f1014100B100610011013101A1005100610181013100f100f10131015100010001015100E100010001015100B100210011012100E", which is converted into a decimal code to obtain the first code "15481030549091626060391118659641505344143682648703197182318121456 718913493517816237742620375606623023100363596278449518768977550854727088129253583258175914216377937193734158, converted into thirty binary code to get the third code "4062071050G2G80A40E20E1048G0G80Y40M205H01GG0481640T202H01GG3081640F207H04RG2M80040020AH03GG0080040N205H00GG0481440E";

[0090] Set a first check code, a second check code and a third check code, wherein the first check code is composed of the number 9 which is the same as the first code; the second check code is composed of the hexadecimal number F which is the same as the second code; and the third check code is composed of the thirty binary digits Z which is the same as the third code;

[0091] Calculate the first check code and subtract the first code to obtain the first data check code; calculate the second check code and subtract the second code to obtain the second data check code; calculate the third check code and subtract the third code to obtain the third data check code;

[0092] The first data check code, the second data check code and the third data check code are collectively referred to as data check codes;

[0093] In practical applications, the numbers 9, F, and Z are set to calculate the data check code in a complementary manner to verify the protection code; the first code is 173 digits, so the first check code is composed of 173 digits 9, and the second check code is composed of 144 digits F, and the third check code is composed of 115 digits Z; the first check code is calculated to be "8451896945090837393 960888134035849465585631735129680281768187854328108650648218376225737962439337697689963640372155048123102244914527291187074641674182408578362206 2806265841”; the second check code is “eff9eff1efebefebeffaeff1efe3efeeeffbeff0efebeff4eff9effeefecefe5effaeff9efe7efeceff0eff0efecefeaefffefffefeaeff1efffefffefeaeff4effdeffeefedeff1”; the third check code is “VZSXZRYZTZFXFQZNVZHXZHYZVQFZFQZ1VZBXZTEZYFFZVQYSVZ5XZXEZYFFWZQYSVZGXZREZV7FXBQZZVZZXZNEZWFFZZQZZVZAXZTEZZFFZVQYVVZH”.

[0094] The fusion data verification module is used to save the data verification code to the distributed database, verify the protection data based on the data verification code in the distributed database, and restore the protection data through the data verification code when the protection data is abnormal; the fusion data verification module includes a data verification code storage unit and a data verification unit;

[0095] The data check code storage unit is configured with a data check code storage strategy, and the data check code storage strategy includes:

[0096] The first data check code is stored in the first storage node, the second data check code is stored in the second storage node, and the third data check code is stored in the third storage node;

[0097] When the user reads the fused data, he / she enters the password and runs the decryption program through the password to decrypt the protected data. The password is the encryption key and the decryption program is the inverse operation of the data encryption.

[0098] Verify the protected data based on the data verification code in the distributed database, and restore the protected data through the data verification code when the protected data is abnormal;

[0099] In practical applications, the first data check code is stored in the first storage nodes D1 and D4, the second data check code is stored in the second storage nodes D2 and D5, and the third data check code is stored in the third storage nodes D3 and D6; since the decryption procedure is the inverse operation of data encryption, it will not be explained in detail in this embodiment;

[0100] See also Figure 3 As shown, the data verification unit is configured with a data verification strategy, which includes:

[0101] Calculate the first check code and subtract the first data check code to obtain a first restoration code; calculate the second check code and subtract the second data check code to obtain a second restoration code; calculate the third check code and subtract the third data check code to obtain a third restoration code;

[0102] The first restoration code and the second restoration code are converted into hexadecimal codes, all the converted first restoration codes and the third restoration codes are named together with the second restoration code as restoration check codes, and the restoration check code with the highest degree of repetition among the restoration check codes is marked as a fusion restoration code;

[0103] Get the protection data, convert the protection data into Unicode code, name it as the code to be verified, compare the code to be verified with the fusion restoration code, and if the code to be verified is equal to the fusion restoration code, output a normal data signal; otherwise, output a data abnormal signal;

[0104] If the output data is abnormal, the fusion restoration code will be used as the protection code, converted into Chinese to obtain the protection data, and the protection data will be synchronized to the user in time;

[0105] In actual applications, a data verification code is stored in each node. When the restoration verification code is calculated, a corresponding restoration verification code will also be stored in each node. In this embodiment, there are 6 nodes in total, that is, there are 6 restoration verification codes in total. If three of the calculated restoration verification codes are the same and the other three are different, then any one of the three identical restoration verification codes will be marked as a fusion restoration code; it is difficult for an attacker to attack all nodes at the same time and tamper with the data therein. Therefore, as long as the data verification codes in at least two nodes are not tampered with, there will be no errors in the fusion data stored in the entire multi-source heterogeneous data fusion synchronization program.

[0106] Example 2, please refer to Figure 4 As shown, the present application provides a multi-source heterogeneous data fusion and synchronization method based on a distributed database, comprising the following steps:

[0107] Step S1, reading a distributed database, obtaining multi-source heterogeneous data, and fusing the multi-source heterogeneous data to obtain fused data; Step S1 includes the following sub-steps:

[0108] Step S101, reading a distributed database to obtain multi-source heterogeneous data;

[0109] Step S102, performing data mapping on multi-source heterogeneous data, and then performing data fusion after the mapping is completed to obtain fused data;

[0110] Step S2, encrypting the fused data to obtain protected data; Step S2 includes the following sub-steps:

[0111] Step S201, obtaining an encryption key and dividing the nodes in the distributed database, where the nodes are database servers;

[0112] Step S201 includes the following sub-steps:

[0113] Step S2011, obtaining an encryption key input by a user, wherein the encryption key includes at least one uppercase letter, lowercase letter and number;

[0114] Step S2012: number the nodes in the distributed database, using the symbol D n Indicates, where n is a non-zero natural number and n is the sequence number of D;

[0115] Step S2013, for D n , calculate the remainder of n%3, marked as storing the remainder, % is the modulus operator;

[0116] Step S2014, if the storage remainder is 1, output the first storage signal; if the storage remainder is 2, output the second storage signal; if the storage remainder is 0, output the third storage signal; if the first storage signal is output, D n is marked as the first storage node; if the second storage signal is output, D n is marked as the second storage node; if the third storage signal is output, D n Marked as the third storage node;

[0117] Step S202, encrypting the fused data using an encryption key;

[0118] Step S202 includes the following sub-steps:

[0119] Step S2021, converting the fused data into Unicode code, named as initial code, and converting the encryption key into Unicode code, named as initial key;

[0120] Step S2022, converting the initial code into a matrix form according to the 4-bit characters as a group, named as the code matrix; converting the initial key into a matrix form according to the 4-bit characters as a group, named as the key matrix;

[0121] Step S2023: number the encoding matrix, using the symbol EM i Indicates, where i is a non-zero natural number and i is the serial number of EM; the key matrix is ​​numbered and represented by the symbol KM j Indicates, where j is a non-zero natural number and j is the serial number of KM;

[0122] Step S2024, for EM i , determine whether i is an odd number or an even number. If i is an odd number, an odd number calculation signal is output; if it is an even number, an even number processing signal is output;

[0123] Step S2025, performing corresponding processing on the encoding matrix based on the output signal;

[0124] Step S2025 includes the following sub-steps:

[0125] Step S2025.a, if an odd number processing signal is output, then the formula Calculate EM i The protection matrix, where PM i To protect the matrix, max() is the maximum value operator. KM for j=2×m-1 j ;

[0126] Step S2025.b, if the output is an even number processing signal, then the formula Calculate EM i The protection matrix is KM for j=2×m j ;

[0127] Step S2025.c, complete each element in the protection matrix to a four-digit number by adding "10" or "100" to the first digit, and then restore it to a string with the same format as the initial code, named protection code; if the element is a two-digit number, add "10", if it is a single-digit number, add "100";

[0128] Step S2025.d, convert the protection code from Unicode to Chinese to obtain protection data. When the multi-source heterogeneous data changes, the protection data will be synchronized in real time;

[0129] Step S3, generating a data verification code based on the protection data; Step S3 includes the following sub-steps:

[0130] Step S301, obtaining a protection code, named as a second code, treating the protection code as a complete number, converting the protection code into a decimal code and a thirty-digit binary code, named as a first code and a third code respectively;

[0131] Step S302, setting a first check code, a second check code and a third check code, wherein the first check code is composed of the number 9, which is the same as the first code; the second check code is composed of the hexadecimal number F, which is the same as the second code; and the third check code is composed of the thirty binary digits Z, which is the same as the third code;

[0132] Step S303, calculating the first check code minus the first code to obtain the first data check code; calculating the second check code minus the second code to obtain the second data check code; calculating the third check code minus the third code to obtain the third data check code;

[0133] Step S304, the first data check code, the second data check code and the third data check code are collectively referred to as data check codes;

[0134] Step S4, saving the data verification code to the distributed database, verifying the protection data based on the data verification code in the distributed database, and restoring the protection data through the data verification code when the protection data is abnormal; Step S4 includes the following sub-steps:

[0135] Step S401, storing a first data check code in a first storage node, storing a second data check code in a second storage node, and storing a third data check code in a third storage node;

[0136] Step S402, when the user reads the fused data, he / she enters the password, and runs the decryption program through the password to decrypt the protected data. The password is the encryption key, and the decryption program is the inverse operation of the data encryption;

[0137] Step S403, verifying the protection data based on the data verification code in the distributed database, and restoring the protection data through the data verification code when the protection data is abnormal;

[0138] Step S403 includes the following sub-steps:

[0139] Step S4031, calculate the first check code minus the first data check code to obtain a first restoration code; calculate the second check code minus the second data check code to obtain a second restoration code; calculate the third check code minus the third data check code to obtain a third restoration code;

[0140] Step S4032, converting the first restoration code and the second restoration code into hexadecimal codes, naming all the converted first restoration codes and the third restoration codes together with the second restoration code as a restoration check code, and marking the restoration check code with the highest degree of repetition among the restoration check codes as a fused restoration code;

[0141] Step S4033, obtaining the protection data, converting the protection data into Unicode code, naming it as the code to be verified, comparing the code to be verified with the fusion restoration code, and outputting a data normal signal if the code to be verified is equal to the fusion restoration code; otherwise, outputting a data abnormal signal;

[0142] Step S4034, if a data abnormality signal is output, the fused restoration code is used as the protection code, converted into Chinese to obtain the protection data, and the protection data is synchronized to the user in a timely manner.

[0143] Embodiment 3, the present application provides an electronic device, which may include: a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other through the communication bus. The memory stores computer-readable instructions, and the processor can call the instructions in the memory. When the computer-readable instructions are executed by the processor, the steps in the multi-source heterogeneous data fusion and synchronization method based on a distributed database are executed to achieve the following functions: read the distributed database, obtain multi-source heterogeneous data, fuse the multi-source heterogeneous data, and obtain fused data; encrypt the fused data to obtain protection data; generate a data verification code based on the protection data; save the data verification code to the distributed database, verify the protection data based on the data verification code in the distributed database, and restore the protection data through the data verification code when the protection data is abnormal.

[0144] In addition, the logic instructions in the above-mentioned memory can be implemented in the form of software functional units and can be stored in a computer-readable storage medium when sold or used as an independent product. Based on this understanding, the technical solution of the present application can be essentially or partly embodied in the form of a software product that contributes to the prior art. The computer software product is stored in a storage medium, including several instructions to enable a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc. Various media that can store program codes.

[0145] Embodiment 4, the present application also provides a computer-readable storage medium, and the present application provides a storage medium on which a computer program is stored. When the computer program is executed by a processor, the steps in the multi-source heterogeneous data fusion and synchronization method based on a distributed database are executed to achieve the following functions: read the distributed database, obtain multi-source heterogeneous data, fuse the multi-source heterogeneous data, and obtain fused data; encrypt the fused data to obtain protected data; generate a data verification code based on the protected data; save the data verification code to the distributed database, verify the protected data based on the data verification code in the distributed database, and restore the protected data through the data verification code when the protected data is abnormal.

[0146] Through the description of the above implementation methods, the embodiments of the present invention can be provided as methods, systems or computer program products. Based on such an understanding, the above technical solutions can be essentially or partly contributed to the prior art in the form of software products, which can be stored in a computer-readable storage medium, such as ROM / RAM, a magnetic disk, an optical disk, etc., and include several instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.

[0147] In the embodiments provided in the present application, it should be understood that the disclosed system or method can be implemented in other ways. The embodiments described above are merely schematic. For example, the division of modules or units is only a logical function division. There may be other division methods in actual implementation. For example, multiple modules or units can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some communication interfaces, and the indirect coupling or communication connection of systems, modules and units can be electrical, mechanical or other forms.

[0148] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application.

Claims

1. A multi-source heterogeneous data fusion and synchronization method based on a distributed database, characterized in that: The steps include: Read distributed databases, obtain multi-source heterogeneous data, and fuse the multi-source heterogeneous data to obtain fused data; Encrypt the fused data to obtain protected data; Encrypting the fused data to obtain protected data includes the following sub-steps: Obtaining an encryption key and dividing nodes in a distributed database, wherein the nodes are database servers; Encrypting the fused data using an encryption key; Obtaining the encryption key and partitioning the nodes in the distributed database includes the following sub-steps: Obtaining an encryption key input by a user, wherein the encryption key includes at least one uppercase letter, lowercase letter, and number; The nodes in the distributed database are numbered by symbol D n Indicates, where n is a non-zero natural number and n is the sequence number of D; For D n , calculate the remainder of n%3, marked as storing the remainder, where % is the modulus operator; If the storage remainder is 1, the first storage signal is output; if the storage remainder is 2, the second storage signal is output; if the storage remainder is 0, the third storage signal is output; if the first storage signal is output, D n is marked as the first storage node; if the second storage signal is output, D n is marked as the second storage node; if the third storage signal is output, D n Marked as the third storage node; Encrypting the fused data using an encryption key includes the following sub-steps: Convert the fused data into Unicode code and name it as initial code, and convert the encryption key into Unicode code and name it as initial key; The initial code is converted into a matrix form according to a group of 4 characters, which is named as the code matrix; the initial key is converted into a matrix form according to a group of 4 characters, which is named as the key matrix; The encoding matrix is ​​numbered using the symbol EM i Indicates, where i is a non-zero natural number and i is the serial number of EM; the key matrix is ​​numbered and represented by the symbol KM j Indicates, where j is a non-zero natural number and j is the serial number of KM; For EM i , determine whether i is an odd number or an even number. If i is an odd number, an odd number calculation signal is output; if it is an even number, an even number processing signal is output; Perform corresponding processing on the encoding matrix based on the output signal; The corresponding processing of the encoding matrix based on the output signal includes the following sub-steps: If the output is an odd number, then the formula Calculate EM i The protection matrix, where PM i To protect the matrix, max() is the maximum value operator. KM for j=2×m-1 j ; If the output is an even number, then the formula Calculate EM i The protection matrix is KM for j=2×m j ; Each element in the protection matrix is ​​completed to four digits by adding "10" or "100" to the first digit, and then restored to a string with the same format as the initial code, named the protection code; if the element is a two-digit number, add "10", and if it is a one-digit number, add "100"; Convert the protection code from Unicode to Chinese to obtain the protection data. When multi-source heterogeneous data changes, the protection data will be synchronized in real time. Generate a data check code based on the protection data; Generating a data check code based on the protection data includes the following sub-steps: Obtain a protection code, named as a second code, regard the protection code as a complete number, convert the protection code into a decimal code and a binary code, named as a first code and a third code respectively; A first check code, a second check code and a third check code are set, wherein the first check code is composed of the number 9 which is the same as the first code; the second check code is composed of the hexadecimal number F which is the same as the second code; and the third check code is composed of the thirty binary digits Z which is the same as the third code; Calculate the first check code and subtract the first code to obtain the first data check code; calculate the second check code and subtract the second code to obtain the second data check code; calculate the third check code and subtract the third code to obtain the third data check code; The first data check code, the second data check code and the third data check code are collectively referred to as data check codes; The data verification code is saved in the distributed database, the protection data is verified based on the data verification code in the distributed database, and the protection data is restored through the data verification code when the protection data is abnormal.

2. The multi-source heterogeneous data fusion and synchronization method based on a distributed database according to claim 1 is characterized in that: Reading distributed databases, obtaining multi-source heterogeneous data, and fusing multi-source heterogeneous data to obtain fused data includes the following sub-steps: Read distributed databases to obtain multi-source heterogeneous data; Data mapping is performed on multi-source heterogeneous data, and after the mapping is completed, data fusion is performed to obtain fused data.

3. The multi-source heterogeneous data fusion and synchronization method based on a distributed database according to claim 2 is characterized in that: Saving the data verification code to the distributed database, verifying the protected data based on the data verification code in the distributed database, and restoring the protected data by the data verification code when the protected data is abnormal includes the following sub-steps: The first data check code is stored in the first storage node, the second data check code is stored in the second storage node, and the third data check code is stored in the third storage node; When the user reads the fused data, he / she enters the password and runs the decryption program through the password to decrypt the protected data. The password is the encryption key and the decryption program is the inverse operation of the data encryption. The protection data is verified based on the data verification code in the distributed database, and the protection data is restored through the data verification code when the protection data is abnormal.

4. The multi-source heterogeneous data fusion and synchronization method based on a distributed database according to claim 3 is characterized in that: Verifying the protected data based on the data verification code in the distributed database and restoring the protected data through the data verification code when the protected data is abnormal includes the following sub-steps: Calculate the first check code minus the first data check code to obtain a first restoration code; Calculate the second check code minus the second data check code to obtain a second restoration code; Calculate the third check code minus the third data check code to obtain a third restoration code; The first restoration code and the second restoration code are converted into hexadecimal codes, all the converted first restoration codes and the third restoration codes are named together with the second restoration code as restoration check codes, and the restoration check code with the highest degree of repetition among the restoration check codes is marked as a fusion restoration code; Get the protection data, convert the protection data into Unicode code, name it as the code to be verified, compare the code to be verified with the fusion restoration code, and output a data normal signal if the code to be verified is equal to the fusion restoration code; Otherwise, a data abnormality signal is output; If an abnormal data signal is output, the fused restoration code will be used as the protection code, converted into Chinese to obtain the protection data, and the protection data will be synchronized to the user in a timely manner.

5. A multi-source heterogeneous data fusion and synchronization system based on a distributed database, used to implement the multi-source heterogeneous data fusion and synchronization method based on a distributed database according to any one of claims 1 to 4, characterized in that: It includes a multi-source heterogeneous fusion module, a fusion data protection module, a check code generation module and a fusion data verification module; the multi-source heterogeneous fusion module, the fusion data protection module and the fusion data verification module are respectively data-connected with the check code generation module; The multi-source heterogeneous fusion module is used to read the distributed database, obtain multi-source heterogeneous data, and fuse the multi-source heterogeneous data to obtain fused data; The fusion data protection module is used to encrypt the fusion data to obtain protected data; The verification code generation module is used to generate a data verification code based on the protection data; The fused data verification module is used to save the data verification code to the distributed database, verify the protection data based on the data verification code in the distributed database, and restore the protection data through the data verification code when the protection data is abnormal.

Citation Information

Patent Citations

  • Multi-source heterogeneous data processing method and device

    CN116186129A

  • Data management method and device based on block chain

    CN111259413A

  • Wearable computer control method and system, storage medium and terminal

    CN111679865A