Intelligent protection method and system for transaction data based on blockchain

By analyzing the differential characteristics of the transaction data to be stored and the stored transaction data, combining the transaction feature factor and user benchmark key, a unique encryption key is generated, which solves the problem of low quality of encryption keys in the prior art, and significantly improves the security and privacy protection level of transaction data.

CN119150364BActive Publication Date: 2025-04-04GUANGZHOU QIANNIAO E-COMMERCE TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202411640022.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-11-18
Publication Date
2025-04-04
Estimated Expiration
2044-11-18

AI Technical Summary

Technical Problem

When using blockchain to protect transaction data, the encryption keys obtained in the prior art are low in quality, resulting in unsatisfactory transaction data protection. Especially when the transaction scale and data volume increase, it is difficult to ensure the uniqueness and randomness of the encryption keys.

Method used

By obtaining the transaction data to be stored filtered through smart contracts, analyzing the distribution characteristics of stored transaction amount data, obtaining distribution characteristic parameters, analyzing the rationality of the transaction data to be stored, generating a block link impact factor, and combining the transaction feature factor and user benchmark key, a unique encryption key is generated to encrypt the transaction data to be stored.

Benefits of technology

By generating a unique encryption key based on blockchain, the security and privacy protection level of transaction data is significantly improved, and data leakage and security issues are avoided.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119150364B_ABST
    Figure CN119150364B_ABST
Patent Text Reader

Abstract

The present invention relates to the field of data protection technology, and specifically to a transaction data intelligent protection method and system based on blockchain. The present invention first obtains the transaction data to be stored that has been screened by a smart contract; further obtains the distribution characteristic parameters of the stored transaction amount data; further obtains the block link influence factor corresponding to the transaction data to be stored; further generates the transaction characteristic factor and combines the user base key and the block link influence factor to generate the encryption key of the transaction data to be stored; further obtains the encrypted ciphertext; finally, the encrypted ciphertext is stored in the relational database associated with the block, and the data summary of the encrypted ciphertext is stored in the main chain. The present invention generates a unique and reliable encryption key by analyzing the difference characteristics between the transaction data to be stored and the stored transaction data, combined with the unique properties of the transaction data to be stored and the uniqueness of the user base key, thereby ensuring the security of the subsequent stored information.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of data protection technology, and in particular to a blockchain-based transaction data intelligent protection method and system. Background Art

[0002] With the rapid development of the digital economy, the security and privacy protection of transaction data have received increasing attention. Blockchain technology, as a decentralized, tamper-proof distributed ledger technology, provides a new approach to solving this problem. Blockchain technology can effectively solve the security risks of traditional data protection methods by storing data on multiple nodes in a distributed network and using cryptography to ensure the security and integrity of data. Therefore, using blockchain technology to protect the security of transaction data has become one of the current research hotspots.

[0003] Existing technologies use distributed storage, encryption technology, and smart contracts to protect transaction data storage based on blockchain. Although these methods have improved the security of transaction data to a certain extent, there are still problems such as unsatisfactory encryption of transaction data and imperfect privacy protection. In particular, with the increase in transaction scale and data volume, the uniqueness and randomness of encryption keys obtained by traditional methods are difficult to guarantee. The encryption key directly determines the security and confidentiality of encrypted data, so low-quality encryption keys are prone to data leakage, causing serious security issues. Summary of the invention

[0004] In order to solve the technical problem that the encryption key quality obtained in the prior art is low, resulting in unsatisfactory protection of transaction data, the purpose of the present invention is to provide a transaction data intelligent protection method and system based on blockchain. The technical solution adopted is as follows:

[0005] A method for intelligently protecting transaction data based on blockchain, the method comprising:

[0006] Acquire transaction data to be stored that is screened by the smart contract; the transaction data to be stored includes at least transaction amount data;

[0007] Acquire stored transaction amount data in a relational database associated with the block, analyze the distribution characteristics of the stored transaction amount data, and obtain distribution characteristic parameters of the stored transaction amount data; analyze the rationality of the transaction amount data in the transaction data to be stored according to the distribution characteristic parameters, and obtain the block link influence factor corresponding to the transaction data to be stored;

[0008] Based on the transaction data to be stored, a transaction characteristic factor of the transaction data to be stored is generated; a user base key is obtained, and an encryption key of the transaction data to be stored is generated by combining the transaction characteristic factor and the block link influence factor; the transaction data to be stored is encrypted according to the encryption key to obtain an encrypted ciphertext;

[0009] The encrypted ciphertext is stored in a relational database associated with the block, and a data summary of the encrypted ciphertext is stored in the main chain.

[0010] Furthermore, the distribution characteristic parameters at least include a mean parameter and a variation range parameter of normal data of each dimension of the stored transaction amount data;

[0011] In each dimension, normal data is screened out, and the mean of the normal data is used as the mean parameter; the range of the normal data is used as the variation range parameter; the transaction amount data includes at least one dimension.

[0012] Furthermore, the method for obtaining the block link impact factor includes:

[0013] Under each dimension, according to the difference characteristics between the transaction amount data to be stored and the corresponding mean parameter, combined with the corresponding variation range parameter, the abnormality parameter corresponding to each dimension of the transaction amount data to be stored is obtained;

[0014] Obtaining rationality parameters of the transaction data to be stored according to the abnormality parameters of all dimensions of the transaction amount data to be stored;

[0015] Based on the rationality parameter, a block link influence factor corresponding to the transaction data to be stored is obtained.

[0016] Furthermore, the calculation formula of the rationality parameter includes: in, Indicates the rationality parameter corresponding to the current transaction data to be stored; The serial number representing the dimension of transaction amount data; The number of dimensions representing transaction amount data; Indicates the transaction amount data to be stored. The abnormality parameter of each dimension; Indicates the symbol for cumulative multiplication; is a natural constant.

[0017] Furthermore, the method for obtaining the block link influence factor corresponding to the transaction data to be stored based on the rationality parameter includes:

[0018] On the rationality parameter, two adjacent values ​​are selected in a preset direction to obtain adjacent value groups with a preset number of characters; after adding a hexadecimal prefix to the two values ​​of each adjacent value group, the corresponding characters are obtained in the preset coding table through a table lookup function, and the characters corresponding to all the adjacent value groups are connected to form a block linking influence factor.

[0019] Furthermore, the method for obtaining the transaction characteristic factor includes:

[0020] The transaction data to be stored at least includes transaction time data and transaction party data;

[0021] After converting the transaction data of both parties into binary numbers, performing a logical operation, and converting the logical operation result back into a character string as the transaction mixed code of the transaction data to be stored;

[0022] According to the order of each bit of data in the transaction mixed code, the bit parameter of each bit of data is obtained; the product of the transaction time data and the data of the two parties to the transaction is obtained, and the bit parameter of the product is raised to the power of the modulus operation of the table length of the preset coding table to obtain the shift distance of each bit of data; each bit of data in the transaction mixed code and the corresponding shift distance are subjected to the Caesar encryption algorithm to obtain the transaction characteristic factor.

[0023] Furthermore, the method for obtaining the encryption key includes:

[0024] The transaction characteristic factor is firstly subjected to a logical operation with the block link influence factor, and then subjected to a logical operation with the user reference key, and the obtained result is used as an encryption key.

[0025] Furthermore, the method for obtaining the encrypted ciphertext includes:

[0026] The encryption key is used to perform a DES encryption operation on the transaction data to be stored to obtain an encrypted ciphertext.

[0027] Furthermore, the method for obtaining normal data includes:

[0028] Under each dimension, obtain the Z-score of each stored transaction amount data, and mark the data whose absolute value of the Z-score is less than the preset screening parameter as normal data.

[0029] The present invention also proposes a blockchain-based intelligent transaction data protection system, the system comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, and the processor implements any one of the steps of the blockchain-based intelligent transaction data protection method when executing the computer program.

[0030] The present invention has the following beneficial effects:

[0031] Acquire the transaction data to be stored that has been screened by the smart contract, ensure that the received information meets the predetermined standards and regulations, prevent false information or non-compliant information from being entered into the system, and thus improve the quality and integrity of the data; further analyze the distribution characteristics of the stored transaction amount data, obtain the distribution characteristic parameters of the stored transaction amount data, and provide a basis for the subsequent analysis of the rationality characteristics of the transaction amount data in the transaction data to be stored, and obtain the block link influence factor, so as to prepare for the final generation of the unique encryption key for this transaction; further analyze the rationality of the transaction amount data in the transaction data to be stored according to the distribution characteristic parameters, obtain the block link influence factor corresponding to the transaction data to be stored, characterize the rationality characteristics of the current transaction amount data to be stored relative to the stored transaction amount data, and prepare for the subsequent acquisition of reliable encryption keys; further based on the transaction to be stored Easy data, using the unique characteristics of each transaction data to be stored, generates transaction characteristic factors of the transaction data to be stored, providing more basis for the subsequent generation of safer encryption keys; further obtains the user base key, combines the transaction characteristic factors and the block link influence factors, generates a safe and unique encryption key for the transaction data to be stored, and provides a guarantee basis for the transaction data; further encrypts the transaction data to be stored according to the encryption key, obtains the encrypted ciphertext, and protects the security of the transaction data; finally, the encrypted ciphertext is stored in the relational database associated with the block, and the data summary of the encrypted ciphertext is stored in the main chain to prepare for the call when the next block is generated, and at the same time, the content stored in the block is guaranteed to be accurate in the relational database associated with the block. The relevant information has no readability and digability. The present invention generates a unique and reliable encryption key by analyzing the difference characteristics between the transaction data to be stored and the stored transaction data, combining the unique properties of the transaction data to be stored and the uniqueness of the user base key, thereby ensuring the security of the subsequent stored information. BRIEF DESCRIPTION OF THE DRAWINGS

[0032] In order to more clearly illustrate the technical solutions and advantages in the embodiments of the present invention or the prior art, the drawings required for use in the embodiments or the prior art descriptions are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0033] Figure 1 A flowchart of a blockchain-based intelligent transaction data protection method provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0034] In order to further explain the technical means and effects adopted by the present invention to achieve the predetermined invention purpose, the following is a detailed description of the specific implementation method, structure, features and effects of a blockchain-based intelligent transaction data protection method and system proposed by the present invention in combination with the accompanying drawings and preferred embodiments. In the following description, different "one embodiment" or "another embodiment" does not necessarily refer to the same embodiment. In addition, specific features, structures or characteristics in one or more embodiments may be combined in any suitable form.

[0035] Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs.

[0036] The following is a detailed description of a specific solution of a blockchain-based transaction data intelligent protection method and system provided by the present invention in conjunction with the accompanying drawings.

[0037] See also Figure 1 , which shows a flowchart of a blockchain-based intelligent transaction data protection method provided by an embodiment of the present invention, specifically including:

[0038] Step S1: Obtain the transaction data to be stored that has been screened by the smart contract; the transaction data to be stored includes at least transaction amount data and a user base key.

[0039] In an embodiment of the present invention, the transaction data information uploaded by the user is first screened through a smart contract to obtain the transaction data to be stored, ensuring that the received information complies with predetermined standards and regulations, preventing false information or non-compliant information from being entered into the system, thereby improving the quality and integrity of the data, and at the same time reducing the amount of unnecessary data in the system and improving the processing efficiency and performance of the system.

[0040] In one embodiment of the present invention, the transaction data to be stored includes transaction time data, transaction party data, and transaction amount data, wherein the transaction party data includes identity information of the seller and buyer of the transaction; in other embodiments of the present invention, the implementer adds other types of transaction data.

[0041] Step S2: Obtain stored transaction amount data in the relational database associated with the block, analyze the distribution characteristics of the stored transaction amount data, and obtain distribution characteristic parameters of the stored transaction amount data; analyze the rationality of the transaction amount data in the transaction data to be stored according to the distribution characteristic parameters, and obtain the block link influence factor corresponding to the transaction data to be stored.

[0042] In the embodiment of the present invention, considering that in the relational database associated with the block, the stored transaction amount data has a certain distribution pattern, storing the transaction amount data to be stored will have a certain impact on the existing distribution characteristics, this impact characteristic is shared by the data stored this time and the stored data, and is unique, the encryption key and encrypted ciphertext generated subsequently using this characteristic will be more secure, and more conducive to protecting the transaction data; and in order to analyze the transaction amount data to be stored, it is first necessary to analyze the stored transaction amount data, so firstly obtain the stored transaction data in the relational database associated with the block, analyze the distribution characteristics of the stored transaction amount data, and obtain the distribution characteristic parameters of the stored transaction amount data.

[0043] Preferably, in one embodiment of the present invention, considering that the stored transaction amount data has a certain range, most of the data is distributed in a stable range, while there are a few outlier data, which may lead to misjudgment of data features and affect the results of data analysis; in order to ensure accurate evaluation and analysis of data features, it is necessary to screen the data;

[0044] Considering that the mean of the normal data screened reflects the average level of the stored transaction amount data, and the range reflects the dispersion of the data, the distribution characteristic parameters at least include the mean parameter and variation range parameter of the normal data of each dimension of the stored transaction amount data; the specific acquisition method includes:

[0045] In each dimension, normal data is screened out, and the mean of the normal data is used as the mean parameter; the range of the normal data is used as the variation range parameter; the transaction amount data includes at least one dimension.

[0046] It should be noted that the transaction amount data includes at least one dimension. The specific number of dimensions is determined by the data characteristics in the implementation scenario and is not limited here. In other embodiments of the present invention, the implementer may also obtain other distribution characteristic parameters such as the median and quartiles to subsequently analyze the characteristics of the transaction amount data in the transaction data to be stored.

[0047] Preferably, in one embodiment of the present invention, considering that the Z-score is a commonly used method for detecting abnormal data, the Z-score of each stored transaction amount data is obtained in each dimension, and the data whose absolute value of the Z-score is less than the preset screening parameter is marked as normal data.

[0048] It should be noted that, in one embodiment of the present invention, the preset screening parameter is 3; in other embodiments of the present invention, the implementer may also use other methods such as the distribution-based boxplot method, the clustering-based BDSCAN algorithm, the tree-based isolation forest algorithm, etc. to screen out abnormal data and mark other data as normal data, which are all technical means well known to those skilled in the art and will not be elaborated here.

[0049] After obtaining the distribution characteristic parameters of the stored transaction amount data, the rationality characteristics of the transaction amount data to be stored can be analyzed based on the distribution characteristic parameters, thereby evaluating the impact parameters of the transaction amount data to be stored on the relational database, obtaining the block link impact factor, and providing a basis for subsequent acquisition of the encryption key.

[0050] Preferably, in one embodiment of the present invention, considering that in each dimension, the greater the difference between the transaction amount data to be stored and the corresponding mean parameter, the greater the difference between the average level of the transaction amount data to be stored and the stored transaction amount data, and in order to better reflect the degree of deviation of the data to be stored relative to the stored data in each dimension without being affected by the absolute value, the variation range parameter is combined for analysis to obtain the abnormality parameter of each dimension, and all dimensions are combined to obtain reasonable characteristic parameters characterizing the transaction data to be stored, so as to facilitate the subsequent use of the reasonableness parameter to obtain the block link influence factor;

[0051] Based on this, the methods for obtaining the block link impact factor include:

[0052] Under each dimension, according to the difference characteristics between the transaction amount data to be stored and the corresponding mean parameter, combined with the corresponding variation range parameter, the abnormality parameter corresponding to each dimension of the transaction amount data to be stored is obtained;

[0053] According to the abnormality parameters of all dimensions of the transaction amount data to be stored, the rationality parameters of the transaction data to be stored are obtained;

[0054] Based on the rationality parameter, a block link impact factor corresponding to the transaction data to be stored is obtained.

[0055] Preferably, in one embodiment of the present invention, considering that the greater the absolute value of the difference between the data value of a certain dimension of the transaction amount data to be stored and the mean parameter of the corresponding dimension, the greater the average level difference between the transaction amount data to be stored and the stored transaction amount data, the absolute value of the difference between the data value of a certain dimension of the transaction amount data to be stored and the mean parameter of the corresponding dimension is placed in the numerator; in order to reflect the degree of deviation relative to the stored data, the variation range parameter is placed in the denominator; considering that the fluctuation range of the transaction amount data in different implementation scenarios is different, the control parameter is added to facilitate the implementer to control, and the calculation formula of the abnormality parameter includes:

[0056] ;in, The serial number representing the dimension of transaction amount data; Indicates the transaction amount data to be stored. The abnormality parameter of each dimension; Indicates the transaction amount data to be stored. The data value of each dimension; Indicates The mean parameter of the dimensions; Indicates The variation range parameter of each dimension; It represents the preset regulatory parameters used to regulate the differential characteristics represented by the molecules; Indicates a preset zero division parameter. In one embodiment of the present invention, , .

[0057] It should be noted that in other embodiments of the present invention, other basic mathematical operations or function mappings may be used to implement the correlation mapping, which are all technical means well known to those skilled in the art and will not be described in detail here. Among them, a positive correlation relationship indicates that the dependent variable will increase as the independent variable increases, and the dependent variable will decrease as the independent variable decreases. The specific relationship may be a multiplication relationship, an addition relationship, or the power of an exponential function, which is determined by actual application; a negative correlation relationship indicates that the dependent variable will decrease as the independent variable increases, and the dependent variable will increase as the independent variable decreases. It may be a subtraction relationship, a division relationship, etc., which is determined by actual application.

[0058] Preferably, in one embodiment of the present invention, considering that when the block link influence factor is used to generate an encryption key, the key needs a certain length, so the block link influence factor needs a certain length. Considering that the square root operation is easy to obtain longer data, the abnormality parameter of each dimension is negatively correlated and normalized, and the normalized result is multiplied and then squared. The square root result is used as a reasonableness parameter to facilitate the subsequent acquisition of the block link influence factor; the calculation formula of the reasonableness parameter includes: in, Indicates the rationality parameter corresponding to the current transaction data to be stored; The serial number representing the dimension of transaction amount data; The number of dimensions representing transaction amount data; Indicates the transaction amount data to be stored. The abnormality parameter of each dimension; Indicates the symbol for cumulative multiplication; is a natural constant.

[0059] It should be noted that in other embodiments of the present invention, the anomaly parameters of all dimensions can be summed up and then negatively correlated and mapped, and the mapping result can be used as a reasonableness parameter; the negative correlation mapping result can also be normalized and then used as a reasonableness parameter; other basic mathematical operations or function mappings can also be used to achieve correlation mapping, which are all technical means well known to those skilled in the art and will not be described in detail here. Among them, a positive correlation relationship indicates that the dependent variable will increase as the independent variable increases, and the dependent variable will decrease as the independent variable decreases. The specific relationship can be a multiplication relationship, an addition relationship, or the power of an exponential function, which is determined by actual application; a negative correlation relationship indicates that the dependent variable will decrease as the independent variable increases, and the dependent variable will increase as the independent variable decreases. It can be a subtraction relationship, a division relationship, etc., which is determined by actual application.

[0060] Preferably, in one embodiment of the present invention, in order to enhance the reliability of the block link influence factor, the two adjacent digits of the rationality parameter are added with a hexadecimal prefix to achieve an encryption effect; at the same time, in order to unify the data format when generating the encryption key later, the data is converted into characters using a table lookup function; based on this, on the rationality parameter, two adjacent values ​​are selected in a preset direction to obtain adjacent value groups with a preset number of characters; after adding a hexadecimal prefix to the two values ​​of each adjacent value group, the corresponding characters are obtained in the preset coding table through the table lookup function, and the characters corresponding to all adjacent value groups are connected to form the block link influence factor.

[0061] The calculation formula of the block link impact factor includes:

[0062] ;in, Indicates the block link impact factor corresponding to the current transaction data to be stored; Is a hexadecimal identifier; Indicates the rationality parameter corresponding to the current transaction data to be stored; The number of bits representing the reasonableness parameter; Indicates the preset upper limit parameter of the number of digits; The first parameter representing the rationality The value of the bit; Indicates a table lookup function. You can use the hexadecimal number in the brackets to look up the encoding table to get the corresponding character.

[0063] It should be noted that, in one embodiment of the present invention, , the preset number of characters is 31, the preset encoding table is the ASCII encoding table, and the preset direction is from left to right, that is, sorting from the high position to the low position of the rationality parameter. If the number in R is less than 32, zero is added to the end of the decimal point of the number; in other embodiments of the present invention, the product of the adjacent two-digit values ​​of the rationality parameter can also be encrypted by adding a hexadecimal prefix; or other encoding tables such as Unicode and UTF-8 are used, which are technical means well known to those skilled in the art and will not be described in detail here.

[0064] Step S3: Based on the transaction data to be stored, generate a transaction characteristic factor of the transaction data to be stored; obtain a user base key, and generate an encryption key for the transaction data to be stored in combination with the transaction characteristic factor and the block link influence factor; encrypt the transaction data to be stored according to the encryption key to obtain an encrypted ciphertext.

[0065] In an embodiment of the present invention, in order to make the encryption key more secure and better protect the transaction data, considering that each transaction data to be stored has its own unique characteristics, a transaction characteristic factor of the transaction data to be stored is generated based on the transaction data to be stored, so as to provide more basis for the subsequent generation of a more secure encryption key.

[0066] Preferably, in one embodiment of the present invention, considering that there are uncertainties in the buyer and seller, transaction amount and transaction time for the transaction information, and the transaction amount and time have strong randomness, when they are combined with the buyer and seller information, the possibility of conflict can be greatly reduced, so that the generated characteristic factor has sufficient uniqueness, and therefore these values ​​can be used to generate a unique transaction characteristic factor based on the transaction data, providing more basis for the subsequent generation of encryption keys, and ensuring the uniqueness and non-tamperability of the transaction information;

[0067] Considering that the bitwise XOR operation is relatively simple and has a certain encryption effect, the data of both parties of the transaction are subjected to a bitwise XOR operation. At the same time, the data format of the data of both parties of the transaction is the same, so the data of both parties of the transaction are first converted into binary numbers, and then subjected to a bitwise XOR operation. The XOR result is converted back into a string as the transaction mixed code of the transaction data to be stored;

[0068] Considering that Caesar encryption is a simple substitution encryption method, but the moving distance of the traditional encryption process is fixed, which makes Caesar encryption easy to crack, the security of Caesar encryption is improved by changing the moving distance each time; based on this, according to the order of each bit of data in the transaction mixed code, the position parameter of each bit of data is obtained; the product of the transaction time data and the data of the two parties to the transaction is obtained, and the position parameter of the product is raised to the power of the table length of the preset coding table to obtain the displacement distance of each bit of data; each bit of data in the transaction mixed code and the corresponding displacement distance are subjected to the Caesar encryption algorithm to obtain the transaction characteristic factor.

[0069] The calculation formula for transaction mixing code includes: in, Indicates transaction mixed code; The string can be converted into binary form according to the encoding table; The binary number can be converted into a string according to the encoding table; Indicates transaction seller data; Represents transaction buyer data; Represents a bitwise exclusive-or operation.

[0070] The calculation formula of the transaction characteristic factor includes:

[0071] ;in, Indicates the serial number of each bit of data in the transaction mixed code, also known as the position parameter; The first Bit data; Indicates the transaction code Bit data; Represents the right shift operation symbol; Represents the transaction amount data in the transaction data to be stored; Represents transaction time data in the transaction data to be stored; Represents the modulus operator; Indicates the length of the encoding table.

[0072] It should be noted that the coding tables used in the calculation formulas for transaction mixed codes and transaction characteristic factors are all ASCII coding tables. In other embodiments of the present invention, when calculating the transaction mixed code, a bitwise AND logic operation can also be used. When calculating the transaction characteristic factor, a left shift can also be performed. When performing a modulus operation, It can also be other positive integers set by the implementer.

[0073] It should be noted that the transaction time data corresponds to a timestamp, for example, 1713259664 corresponds to 2024-04-16-17:27:44. In one embodiment of the present invention, in order to facilitate power calculation, only the number of seconds corresponding to the timestamp is taken, that is, 44 in the example. In other embodiments of the present invention, the implementer may also analyze the numbers at specific positions corresponding to the timestamp.

[0074] It should be noted that, in another embodiment of the present invention, it is also considered that the number of transactions and the transaction number are also unique, wherein the number of transactions includes the number of transactions of the buyer, the number of transactions of the seller, and the number of transactions between the two parties of the transaction data to be stored. When calculating the transaction mixed code, the number of transactions of the buyer and the number of transactions of the seller can also be used for calculation; when calculating the transaction characteristic factor, the transaction code can be used to replace the transaction amount or transaction time, or any one of the transaction numbers can be used to replace any one of the transaction amount and transaction time; in other embodiments of the present invention, the implementer can also obtain the transaction characteristic factor through other parameters with unique characteristics.

[0075] After obtaining the transaction characteristic factor with unique characteristics and the block link influence factor representing the influence characteristics of the transaction data to be stored, it is possible to generate a unique encryption key for the transaction data to be stored in combination with the user base key;

[0076] Preferably, in one embodiment of the present invention, the transaction feature factor is first bitwise ANDed with the block link influence factor, and then bitwise XORed with the user reference key, and the obtained result is used as the encryption key; in other embodiments of the present invention, the order of logical operations or the type of logical operations can also be adjusted.

[0077] It should be noted that the user base key is automatically assigned by the system when the user who uploads the information registers. The user base key can be regarded as the user's identity or a way to verify the user's identity, which facilitates user identity verification and authorization management.

[0078] After obtaining the encryption key, the encryption key can be used to encrypt the transaction data to be stored to ensure the security and privacy of the data during storage and transmission.

[0079] Preferably, in one embodiment of the present invention, DES encryption is widely used to protect the security of sensitive data, so the encryption key is used to perform a DES encryption operation on the transaction data to be stored to obtain an encrypted ciphertext.

[0080] The specific encryption steps are as follows:

[0081] First, the transaction data to be stored is padded to make its size an integer multiple of 128, and then it is divided into multiple 128-bit blocks; then based on the encryption key, the key expansion algorithm is used to generate the round keys required for multi-round encryption, and then 16 round addition operations are performed; finally, each encrypted block is connected to obtain the final encrypted ciphertext.

[0082] It should be noted that the DES encryption algorithm and the key expansion algorithm are technical means well known to those skilled in the art and will not be described in detail here. In other embodiments of the present invention, the implementer may also set other block lengths and other numbers of round addition operations. Other existing encryption algorithms such as AES and Blowfish may also be used, which are all technical means well known to those skilled in the art and will not be described in detail here.

[0083] Step S4: Store the encrypted ciphertext in the relational database associated with the block, and store the data summary of the encrypted ciphertext in the main chain.

[0084] In an embodiment of the present invention, after the encrypted ciphertext is obtained, the encrypted ciphertext is stored in the relational database associated with the block, and the relational database is updated to prepare for the call when the next block is generated; at the same time, in order to ensure that the content stored in the block does not have any readability and digability on the basis of being able to accurately query relevant information in the relational database associated with the block, the data summary of the encrypted ciphertext is stored in the main chain.

[0085] It should be noted that, in one embodiment of the present invention, a hash algorithm is used to obtain the data summary of the encrypted ciphertext. In other embodiments of the present invention, the implementer may also use other data summary algorithms such as the MD5 algorithm. These are technical means well known to those skilled in the art and will not be described in detail here.

[0086] After the data is stored, the block is connected to the main chain and waits for the next block generation and block connection.

[0087] An embodiment of the present invention also provides a blockchain-based intelligent transaction data protection system, the system includes a memory, a processor and a computer program, wherein the memory is used to store the corresponding computer program, the processor is used to run the corresponding computer program, and when the computer program runs in the processor, it can implement a blockchain-based intelligent transaction data protection method described in steps S1-S4.

[0088] In summary, the present invention aims at the technical problem that the encryption key quality obtained by the prior art is low, resulting in unsatisfactory protection of transaction data, and proposes a transaction data intelligent protection method and system based on blockchain. The present invention first obtains the transaction data to be stored screened by the smart contract; further analyzes the distribution characteristics of the stored transaction amount data, and obtains the distribution characteristic parameters of the stored transaction amount data; further analyzes the rationality of the transaction amount data in the transaction data to be stored, and obtains the block link influence factor corresponding to the transaction data to be stored; further based on the transaction data to be stored, generates the transaction characteristic factor of the transaction data to be stored; further obtains the user base key, combines the transaction characteristic factor and the block link influence factor, and generates the encryption key of the transaction data to be stored; further encrypts the transaction data to be stored according to the encryption key to obtain the encrypted ciphertext; finally, the encrypted ciphertext is stored in the relational database associated with the block, and the data summary of the encrypted ciphertext is stored in the main chain. The present invention generates a unique and reliable encryption key by analyzing the difference characteristics between the transaction data to be stored and the stored transaction data, combined with the unique properties of the transaction data to be stored and the uniqueness of the user base key, thereby ensuring the security of the subsequent stored information.

[0089] It should be noted that the sequence of the above embodiments of the present invention is only for description and does not represent the advantages and disadvantages of the embodiments. The processes depicted in the accompanying drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.

[0090] The various embodiments in this specification are described in a progressive manner, and the same or similar parts between the various embodiments can be referenced to each other, and each embodiment focuses on the differences from other embodiments.

Claims

1. A blockchain-based transaction data intelligent protection method, characterized in that: The method comprises: Acquire transaction data to be stored that is screened by the smart contract; the transaction data to be stored includes at least transaction amount data; Acquire stored transaction amount data in a relational database associated with the block, analyze the distribution characteristics of the stored transaction amount data, and obtain distribution characteristic parameters of the stored transaction amount data; analyze the rationality of the transaction amount data in the transaction data to be stored according to the distribution characteristic parameters, and obtain the block link influence factor corresponding to the transaction data to be stored; Based on the transaction data to be stored, a transaction characteristic factor of the transaction data to be stored is generated; a user base key is obtained, and an encryption key of the transaction data to be stored is generated by combining the transaction characteristic factor and the block link influence factor; the transaction data to be stored is encrypted according to the encryption key to obtain an encrypted ciphertext; The encrypted ciphertext is stored in a relational database associated with the block, and the data summary of the encrypted ciphertext is stored in the main chain; The distribution characteristic parameters at least include a mean parameter and a variation range parameter of normal data of each dimension of the stored transaction amount data; Under each dimension, normal data is screened out, and the mean of the normal data is used as the mean parameter; the range of the normal data is used as the variation range parameter; the transaction amount data includes at least one dimension; The method for obtaining the block link impact factor includes: Under each dimension, according to the difference characteristics between the transaction amount data to be stored and the corresponding mean parameter, combined with the corresponding variation range parameter, the abnormality parameter corresponding to each dimension of the transaction amount data to be stored is obtained; Obtaining rationality parameters of the transaction data to be stored according to the abnormality parameters of all dimensions of the transaction amount data to be stored; Based on the rationality parameter, obtaining a block link impact factor corresponding to the transaction data to be stored; The calculation formula of the rationality parameter includes: Where R represents the rationality parameter corresponding to the current transaction data to be stored; j represents the serial number of the dimension of the transaction amount data; J represents the number of dimensions of the transaction amount data; K j represents the abnormality parameter of the jth dimension of the transaction amount data to be stored; Π represents the cumulative multiplication symbol; e is a natural constant; The method for obtaining the block link influence factor corresponding to the transaction data to be stored based on the rationality parameter includes: On the rationality parameter, two adjacent values ​​are selected in a preset direction to obtain adjacent value groups with a preset number of characters; after adding a hexadecimal prefix to the two values ​​of each adjacent value group, the corresponding characters are obtained in a preset coding table through a table lookup function, and the characters corresponding to all the adjacent value groups are connected to form a block linking influence factor; The method for obtaining the transaction characteristic factor includes: The transaction data to be stored at least includes transaction time data and transaction party data; After converting the transaction data of both parties into binary numbers, performing a logical operation, and converting the logical operation result back into a character string as the transaction mixed code of the transaction data to be stored; According to the order of each bit of data in the transaction mixed code, the bit parameter of each bit of data is obtained; the product of the transaction time data and the data of the two parties to the transaction is obtained, and the bit parameter of the product is raised to the power of the modulus operation of the table length of the preset coding table to obtain the shift distance of each bit of data; each bit of data in the transaction mixed code and the corresponding shift distance are subjected to the Caesar encryption algorithm to obtain the transaction characteristic factor.

2. According to claim 1, a blockchain-based intelligent transaction data protection method is characterized in that: The method for obtaining the encryption key includes: The transaction characteristic factor is firstly subjected to a logical operation with the block link influence factor, and then subjected to a logical operation with the user reference key, and the obtained result is used as an encryption key.

3. According to the blockchain-based intelligent transaction data protection method of claim 1, it is characterized in that: The method for obtaining the encrypted ciphertext includes: The encryption key is used to perform a DES encryption operation on the transaction data to be stored to obtain an encrypted ciphertext.

4. According to claim 1, a blockchain-based transaction data intelligent protection method is characterized in that: The method for obtaining normal data includes: Under each dimension, obtain the Z-score of each stored transaction amount data, and mark the data whose absolute value of the Z-score is less than the preset screening parameter as normal data.

5. A blockchain-based transaction data intelligent protection system, the system comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the intelligent protection method for transaction data based on blockchain as described in any one of claims 1 to 4 are implemented.

Citation Information

Patent Citations

  • System and method for information protection

    CN110337665A

  • Electronic commerce transaction system for data encryption transmission

    CN115065458A