A Blockchain-Based Method for Protecting the Privacy of Power Data
The method uses binary trees to transform user passwords into encrypted sequences, addressing vulnerabilities in existing encryption methods, ensuring secure storage and access control for electric power data.
Patent Information
- Application Number
- CN202411085015.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-08
- Publication Date
- 2025-07-15
- Estimated Expiration
- 2044-08-08
AI Technical Summary
The existing power data management platform has risks in encrypting user login information. When the key is leaked or the server is illegally accessed, the encrypted user information may be cracked, threatening the security of user information.
The blockchain-based power data privacy protection method is adopted to obtain registration information through the registration unit and generate a mapping password sequence. The binary tree structure of capital English letters, lowercase English letters and numbers is used to generate a unique mapping code based on the characteristics of characters in the registration password, and the converted mapping password sequence is stored to avoid storing the registration password in plain text.
Improves the security and complexity of the registration password, ensures that only authorized users can access sensitive data, and enhances the privacy and security of user power data.
Smart Images

Figure CN119203206B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of data protection, and particularly relates to a method for protecting the privacy of power data based on a blockchain. Background Art
[0002] Currently, with the sharp increase in the amount of power data, the traditional centralized management mode has been difficult to meet the requirements of efficient and secure data management; therefore, adopting advanced blockchain technology to split and distribute power data for storage in multiple cloud servers has become an effective means to ensure data integrity and traceability; at the same time, in order to better manage and control user access to data and improve security and convenience, a unified resource management platform has been constructed. This platform not only has efficient data indexing and retrieval functions, but also can monitor data access permissions in real time. By setting up unified login authentication, the management of power data is made more convenient, ensuring that every data interaction is authorized and encrypted;
[0003] However, this poses higher requirements for the storage security of authentication information in the unified resource management platform, especially in the encryption processing of user login information. There are certain risks in the existing key encryption methods. Currently, user login information is encrypted in the form of keys. This encryption method requires storing the encrypted user information and the corresponding encryption keys on the server. This undoubtedly increases the risk of leakage of user login information, because once the key is leaked or the server is illegally accessed, the encrypted user information may be cracked, thus threatening the information security of users;
[0004] To solve the above problems, the present invention proposes a solution. Summary of the Invention
[0005] The purpose of the present invention is to provide a method for protecting the privacy of power data based on a blockchain to solve the problems raised in the above background art.
[0006] The purpose of the present invention can be achieved by the following technical solutions:
[0007] A method for protecting the privacy of power data based on a blockchain includes the following steps:
[0008] Step 1: A registration unit obtains the registration information typed in by the currently pre-registered user. The registration information includes a registration name and a registration password;
[0009] Step 2: An account management unit creates binary trees related to uppercase English letters, lowercase English letters, and numbers respectively according to 26 uppercase and lowercase English letters and 10 numbers from 0 to 9;
[0010] Step 3: After the account management unit receives the registration information typed by the current pre-registered user transmitted, it extracts the account password carried therein, and generates a mapped password sequence of the current pre-registered user according to the upper and lower case English letter characters and numeric characters constituting the account password, in combination with the binary tree related to upper case English letters, lower case English letters and numbers according to the preset privacy management rules.
[0011] Further, after completing Step 3, the following steps also need to be completed:
[0012] The account management unit stores the account name carried in the registration information typed by the current pre-registered user and the mapped password sequence of the current pre-registered user together as the authentication account information of the current pre-registered user.
[0013] Further, the login unit obtains the login information typed by the current pre-login user. The login information includes the login name and the login password. The account management unit authenticates the login information typed by the current pre-login user. After successful authentication, the resource management unit opens the data permission for the current pre-login user to enable it to operate on the power data of the current pre-login user stored in several cloud servers.
[0014] Further, the steps to create binary trees related to upper case English letters, lower case English letters and numbers are as follows:
[0015] S11: Create a binary tree related to upper case English letters according to the preset upper case creation rules. The upper case creation rules are as follows:
[0016] S111: Use the newNode() function to create 26 new nodes in sequence. Each new node is mapped to the upper case English characters A, B,..., Z in the order of its creation;
[0017] S112; Take the new node mapped to A as the root node, and take the new nodes mapped to B and C as the left and right child nodes of the root node respectively;
[0018] S113: Then take D and E as the left and right child nodes of the new node mapped to B respectively, and take F and G as the left and right child nodes of the new node mapped to C respectively;
[0019] S114: Then take H and I as the left and right child nodes of the new node mapped to D respectively, take J and K as the left and right child nodes of the new node mapped to E respectively, take L and M as the left and right child nodes of the new node mapped to F respectively, and take N and O as the left and right child nodes of the new node mapped to G respectively;
[0020] S115: Finally, take P and Q as the left and right child nodes of the new node mapped to H respectively, take R and S as the left and right child nodes of the new node mapped to I respectively, take T and U as the left and right child nodes of the new node mapped to J respectively, take V and W as the left and right child nodes of the new node mapped to K respectively, take X and Y as the left and right child nodes of the new node mapped to L respectively, take Z as the left child node of the new node mapped to M, and after creation, obtain a binary tree related to capital English letters;
[0021] S12: Create a binary tree related to lowercase English letters according to the preset lowercase creation rule;
[0022] S13: Create a binary tree related to numbers according to the preset number creation rule. The number creation rule is as follows:
[0023] S131: Use the newNode() function to create 10 new nodes in sequence, and each new node is mapped to the numeric characters 0, 1,..., 9 in the order of its creation;
[0024] S132: Take the new node mapped to 0 as the root node, and take the new nodes mapped to 1 and 2 as the left and right child nodes of the root node respectively;
[0025] S133: Then take 3 and 4 as the left and right child nodes of the new node mapped to 1 respectively, and take 5 and 6 as the left and right child nodes of the new node mapped to 2 respectively;
[0026] S134: Finally, take 7 and 8 as the left and right child nodes of the new node mapped to 5 respectively, take 9 as the left child node of the new node mapped to 6, and after creation, obtain a binary tree related to numbers.
[0027] Advantages of the present invention:
[0028] (1) By setting up a registration unit to obtain registration information in the present invention, the account management unit generates a corresponding mapped password sequence according to the registration password in the registration information. Among them, by creating binary trees related to capital English letters, lowercase English letters and numbers, and combining each capital letter, lowercase letter and numeric character included in the registration password, a unique mapped code is provided for each character. In this way, the registration password is not stored in plain text in the system, and the conversion of the registration password depends on the conversion logic and does not need to rely on specific data such as keys. Therefore, only the converted mapped password sequence needs to be stored for the storage of the registration password and there is no need to store too much other data, making the storage of the registration password in the system more secure and further ensuring the privacy and security of the user's power data;
[0029] (2) By combining the binary tree structure, in the process of obtaining the mapping codes for uppercase and lowercase English letters in the registration password, it only depends on the depth, layer number, and direction of the new nodes corresponding to the uppercase and lowercase English letters in the binary tree. Combining the characteristics of the binary tree, different characters may have the same mapping codes, so even if the password is leaked, third parties cannot infer the conversion logic of the mapping codes from the leaked password;
[0030] In the process of obtaining the mapping codes for numeric characters in the registration password, the difference between two adjacent numbers is used as the positioning feature after binary tree rotation, strengthening the strong correlation of the numbers in the registration password. Moreover, the positioning process of each numeric character is based on the characteristics of its own character and the rotation of the original binary tree. In this way, not only the randomness and complexity of the mapping codes are increased, but also the security of the entire password system is improved;
[0031] (3) In the present invention, by setting up a login unit to obtain the corresponding login information during the user login process, and the account management unit conducts authentication and comparison on it. Only after the comparison passes will the operation permission for the corresponding power data be opened to it. This process not only improves the security of the system but also ensures that only authorized users can access sensitive data. BRIEF DESCRIPTION OF THE DRAWINGS
[0032] The present invention will be further described below with reference to the accompanying drawings.
[0033] Figure 1 is a flowchart for securely storing the registration information of registered users in the present invention;
[0034] Figure 2 is a system block diagram of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0035] The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all of the embodiments. All other embodiments obtained by those of ordinary skill in the art based on the embodiments of the present invention without creative efforts shall fall within the protection scope of the present invention.
[0036] As Figure 1 、 2 shown, a blockchain-based power data privacy protection method includes a registration and login module and a unified resource management platform;
[0037] The registration and login module is used for trusted users to register and log in to the unified resource management platform. The registration and login module includes a registration unit and a login unit;
[0038] A registration unit, which is used for a user to register an account on the unified resource management platform. After obtaining the registration information typed by the currently pre-registered user, the registration unit transmits it to the unified resource management platform. The registration information includes a registration name and a registration password. In this embodiment, the registration password is composed of uppercase and lowercase letters and numbers, and the number of digits is between 14 and 16;
[0039] The unified resource management platform is used for securely managing the power data of trusted users. The unified resource management platform includes an account management unit and a resource management unit;
[0040] After receiving the registration information typed by the currently pre-registered user transmitted, the unified resource management platform transmits it to the account management unit;
[0041] After receiving the registration information of the currently pre-registered user transmitted, the account management unit securely stores the registration information according to the preset privacy management rules. The privacy management rules are as follows:
[0042] S11: Create a binary tree related to uppercase English letters according to the preset uppercase creation rules. The uppercase creation rules are as follows:
[0043] S111: Use the newNode() function to create 26 new nodes in sequence. Each new node is mapped to the uppercase English characters A, B,..., Z in the order of its creation;
[0044] S112; Use the new node mapped to A as the root node, and use the new nodes mapped to B and C as the left and right child nodes of the root node respectively;
[0045] S113: Then use D and E as the left and right child nodes of the new node mapped to B respectively, and use F and G as the left and right child nodes of the new node mapped to C respectively;
[0046] S114: Then use H and I as the left and right child nodes of the new node mapped to D respectively, use J and K as the left and right child nodes of the new node mapped to E respectively, use L and M as the left and right child nodes of the new node mapped to F respectively, and use N and O as the left and right child nodes of the new node mapped to G respectively;
[0047] S115: Finally, use P and Q as the left and right child nodes of the new node mapped to H respectively, use R and S as the left and right child nodes of the new node mapped to I respectively, use T and U as the left and right child nodes of the new node mapped to J respectively, use V and W as the left and right child nodes of the new node mapped to K respectively, use X and Y as the left and right child nodes of the new node mapped to L respectively, and use Z as the left child node of the new node mapped to M;
[0048] After creation, a binary tree related to capital English letters is obtained. At this time, all new nodes of the binary tree are read in the order of level traversal, and the reading order is the new nodes mapped to A, B,..., Z in sequence;
[0049] S12: Create a binary tree related to lowercase English letters according to the preset lowercase creation rules. The lowercase creation rules are as follows:
[0050] S121: Use the newNode() function to create 26 new nodes in sequence. Each new node is mapped to the lowercase English characters a, b,..., z in the order of its creation;
[0051] S122; Use the new node mapped to a as the root node, and use the new nodes mapped to b and c as the left and right child nodes of the root node respectively;
[0052] S123: Then use d and e as the left and right child nodes of the new node mapped to b respectively, and use f and g as the left and right child nodes of the new node mapped to c respectively;
[0053] S124: Next, use h and i as the left and right child nodes of the new node mapped to d respectively, use j and k as the left and right child nodes of the new node mapped to e respectively, use l and m as the left and right child nodes of the new node mapped to f respectively, and use n and o as the left and right child nodes of the new node mapped to g respectively;
[0054] S125: Finally, use p and q as the left and right child nodes of the new node mapped to h respectively, use r and s as the left and right child nodes of the new node mapped to i respectively, use t and u as the left and right child nodes of the new node mapped to j respectively, use v and w as the left and right child nodes of the new node mapped to k respectively, use x and y as the left and right child nodes of the new node mapped to l respectively, and use z as the left child node of the new node mapped to m;
[0055] After creation, a binary tree related to lowercase English letters is obtained. At this time, all new nodes of the binary tree are read in the order of level traversal, and the reading order is the new nodes mapped to a, b,..., z in sequence;
[0056] S13: Create a binary tree related to numbers according to the preset number creation rules. The number creation rules are as follows:
[0057] S131: Use the newNode() function to create 10 new nodes in sequence. Each new node is mapped to the numeric characters 0, 1,..., 9 in the order of its creation;
[0058] S132: Use the new node mapped to 0 as the root node, and use the new nodes mapped to 1 and 2 as the left and right child nodes of the root node respectively;
[0059] S133: Then use 3 and 4 as the left and right child nodes of the new node mapped to 1 respectively, and use 5 and 6 as the left and right child nodes of the new node mapped to 2 respectively;
[0060] S134: Finally, use 7 and 8 as the left and right child nodes of the new node mapped to 5 respectively, and use 9 as the left child node of the new node mapped to 6;
[0061] After creation, a binary tree related to numbers is obtained. At this time, read all the new nodes of the binary tree in the level-order traversal method, and the reading order is the new nodes mapped to 0, 1,..., 9 in sequence;
[0062] S14: According to the order in which the characters are typed in the registration password, mark all the capital English letters in the registration password as A1, A2,..., Aa in sequence, mark all the lowercase English letters in it as B1, B2,..., Bb in sequence, and mark all the numeric characters in it as C1, C2,..., Cc in sequence. Here, a, b, and c in the marks are the total numbers of capital English letters, lowercase English letters, and numeric characters in the registration password respectively;
[0063] S15: Calculate and obtain the mapping codes of the capital English letters A1, A2,..., Aa according to the preset letter calculation rules. The letter calculation rules are as follows:
[0064] S151: Traverse the binary tree related to capital English letters, obtain the new node mapped to the capital English letter A1 from it, and determine its left and right child nodes;
[0065] If the new node is the left child node of a certain new node, then use the binary number 10 as the direction string of the new node, otherwise use the binary number 11 as the direction string of the new node;
[0066] Among them, the binary numbers 10 and 11 are used to assist the computer in distinguishing the left and right child nodes in the binary tree related to capital English letters;
[0067] S152: Obtain the layer number D1 and depth E1 of the new node in the binary tree, calculate and obtain the position feature value F1 of the new node using the formula F1 = D1 × E1, and perform binary conversion on F1 to obtain the position string of the new node;
[0068] S153: Concatenate the direction string and the position string of the new node to obtain the mapping code of the capital English letter. In the concatenation process, the direction string is in the front and the position string is in the back;
[0069] S154: Calculate and obtain the mapping codes of capital English letters A2, ..., Aa in sequence according to S151 to S153;
[0070] S16: Calculate and obtain the mapping codes of lowercase English letters B1, B2, ..., Bb in sequence according to S15. During the process of calculating the mapping codes of lowercase English letters, traverse the binary tree related to lowercase English letters;
[0071] And when respectively obtaining new nodes mapped to lowercase English letters B1, B2, ..., Bb from the binary tree and determining their left and right child nodes, if the new node is the left child node of a certain new node, then use the binary number 00 as the direction string of the new node; otherwise, use the binary number 01 as the direction string of the new node;
[0072] S17: Calculate and obtain the mapping codes of digital characters C1, C2, ..., Cc according to the preset digital calculation rules. The digital calculation rules are as follows:
[0073] S171: Traverse the binary tree related to numbers, obtain the layer number G1 and depth H1 of the new node mapped to the digital character C1 from it, calculate and obtain the position feature value I1 of the new node using the formula I1 = G1 × H1, and perform binary conversion on I1 to obtain the mapping code of the digital character C1;
[0074] S172: Compare the sizes of C1 and C2, and obtain the mapping code of the digital character C2 based on the comparison result:
[0075] S21: If C1 ≥ C2, first calculate and obtain the rotation feature record value J1 of the binary tree based on the digital character C2 using the formula J1 = C1 - C2;
[0076] Then perform several rotations on the binary tree to obtain the binary tree based on the digital character C2 until the new node mapped to the digital character C2 becomes the root node of the binary tree, and record the number of rotations K1 at this time;
[0077] Obtain the layer number G2 and depth H2 of the new node mapped to the rotation feature record value J1 in the binary tree based on the digital character C2 at this time, calculate and obtain the position feature value I2 of the new node using the formula I2 = G2 × H2, splice I2 and K1, and perform binary conversion on the spliced result to obtain the mapping code of the digital character C2;
[0078] S22: If C1 < C2, first calculate and obtain the rotation feature record value J1 of the binary tree based on the digital character C2 using the formula J1 = C2 - C1;
[0079] Then, perform several rotations on the binary tree to obtain a binary tree based on the digital character C2 until a new node mapped to the digital character C2 serves as the root node of the binary tree, and record the number of rotations K1 at this time;
[0080] Obtain the layer number G2 and depth H2 of the new node mapped to the rotation feature record value J1 in the binary tree based on the digital character C2 at this time, calculate and obtain the position feature value I2 of the new node using the formula I2 = G2 × H2, splice I2 and K1, and perform binary conversion on the spliced result to obtain the mapping code of the digital character C2;
[0081] S173: According to S172, compare the sizes of C1 and C3, C1 and C4,..., C1 and Cc in turn, and correspondingly obtain the mapping codes of the digital characters C3, C4,..., Cc based on the comparison results. Here, it should be noted that when rotating to obtain a binary tree based on the corresponding digital character after comparison, it is based on the initial binary tree, that is, the rotation is performed according to the binary tree related to numbers;
[0082] S18: According to the order in which each character is typed, splice the mapping codes of each character in the registration password to obtain the mapping password sequence of the current pre-registered user;
[0083] The account management unit securely stores the registration name and mapping password sequence of the current pre-registered user as the authentication account information of the pre-registered user;
[0084] After the current pre-login user types in the login information, the login unit obtains it and transmits it to the unified resource management platform. The login information includes the login name and login password;
[0085] After the unified resource management platform receives the transmitted login information, it extracts the login password contained therein and generates the mapping password sequence of the trusted user according to the preset privacy management rules;
[0086] Then, extract the login name from the login information, obtain the mapping password sequence corresponding to the registration name consistent with the login name from the account management unit according to the login name, compare its consistency with the mapping password sequence of the trusted user, and if the comparison passes, generate an authentication pass instruction and transmit it to the resource management unit;
[0087] After the resource management unit receives the transmitted authentication pass instruction, it opens the data permission to the pre-login user, enabling it to operate on the power data of the trusted user stored in several cloud servers. The operation types include viewing, adding, deleting, modifying, etc.;
[0088] In the description of the specification, the descriptions referring to terms such as "one embodiment", "example", "specific example", etc. mean that the specific features, structures, materials or characteristics described in connection with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic expressions of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described can be combined in a suitable manner in any one or more embodiments or examples.
[0089] The above content is only an example and illustration of the present invention. Those skilled in the art to which this technology belongs can make various modifications or supplements to the described specific embodiments or use similar ways to replace them. As long as they do not deviate from the invention or exceed the scope defined by the claims of the present invention, they should all fall within the protection scope of the present invention.
[0090] The above has described in detail one embodiment of the present invention, but the content described is only a preferred embodiment of the present invention and cannot be considered as being used to limit the scope of implementation of the present invention. All equivalent changes and improvements made according to the scope of the application of the present invention should still fall within the scope covered by the patent of the present invention.
Claims
1. A blockchain-based method for protecting the privacy of power data, characterized in that, It includes the following steps: Step 1: The registration unit obtains the registration information typed by the current pre-registered user. The registration information includes a registration name and a registration password. Step 2: The account management unit creates binary trees related to uppercase English letters, lowercase English letters, and numbers respectively according to 26 uppercase and lowercase English letters and 10 numbers from 0 to 9. Step 3: After receiving the transmitted registration information typed by the current pre-registered user, the account management unit extracts the account password carried therein, and generates a mapping password sequence for the current pre-registered user according to the uppercase and lowercase English letter characters and numeric characters that make up the account password. Specifically: In the order in which the characters are typed in the registration password, all the uppercase English letters, lowercase English letters, and numeric characters in the registration password are sequentially marked as A1, A2,..., Aa, B1, B2,..., Bb, and C1, C2,..., Cc respectively. Obtain the mapping code of uppercase English letters according to the following rules: Traverse the binary tree of uppercase English letters, select the new node mapped to the uppercase English letter A1. If the selected new node is the left child node of some other new node, the direction string of the selected new node is the binary number 10, otherwise it is the binary number 11. Perform binary conversion on the product of the layer number D1 and the depth E1 of the selected new node in the binary tree to obtain the position string of the selected new node, and splice the direction string and the position string in the order of the direction string first and the position string second to obtain the mapping code corresponding to the first uppercase English letter A1. Obtain the mapping codes of A2,..., Aa in sequence according to the mapping code obtaining steps of the first uppercase English letter A1. Obtain the mapping codes of all lowercase English letters in the same way as obtaining the mapping codes of uppercase English letters. Among them, obtain the node mapped to the lowercase English letter from the binary tree of lowercase English letters. If it is the left child node, its direction string is the binary number 00, otherwise it is the binary number 01. Obtain the mapping codes of all numeric characters C1, C2,..., Cc according to the preset numeric calculation rules. In the order in which all the characters of the registration password are typed, splice the mapping codes corresponding to each character in the registration password to obtain the mapping password sequence of the current pre-registered user.
2. The method for protecting power data privacy based on blockchain according to claim 1, wherein The registration password is composed of uppercase and lowercase letters and numbers, and the character length is 14 to 16 bits.
3. A method for protecting the privacy of power data based on blockchain according to claim 1, characterized in that, After completing Step 3, the following steps also need to be completed: The account management unit stores the account name carried in the registration information typed by the current pre-registered user and the mapping password sequence of the current pre-registered user together as the authentication account information of the current pre-registered user.
4. A method for protecting the privacy of power data based on blockchain according to claim 1, characterized in that, The login unit obtains the login information typed by the current pre-login user. The login information includes a login name and a login password. The account management unit authenticates the login information typed by the current pre-login user. After successful authentication, the resource management unit grants data access rights to the current pre-login user, enabling it to operate on the power data of the current pre-login user stored in several cloud servers.
5. A method for protecting the privacy of power data based on blockchain according to claim 1, characterized in that, The steps to create binary trees related to capital English letters, lowercase English letters, and numbers are as follows: S11: Create a binary tree related to capital English letters according to a preset capital creation rule. The capital creation rule is as follows: S111: Use the newNode() function to create 26 new nodes in sequence. Each new node is mapped to capital English characters A, B,..., Z in the order of their creation; S112; Take the new node mapped to A as the root node, and take the new nodes mapped to B and C as the left and right child nodes of the root node respectively; S113: Then take D and E as the left and right child nodes of the new node mapped to B respectively, and take F and G as the left and right child nodes of the new node mapped to C respectively; S114: Next, take H and I as the left and right child nodes of the new node mapped to D respectively, take J and K as the left and right child nodes of the new node mapped to E respectively, take L and M as the left and right child nodes of the new node mapped to F respectively, and take N and O as the left and right child nodes of the new node mapped to G respectively; S115: Finally, take P and Q as the left and right child nodes of the new node mapped to H respectively, take R and S as the left and right child nodes of the new node mapped to I respectively, take T and U as the left and right child nodes of the new node mapped to J respectively, take V and W as the left and right child nodes of the new node mapped to K respectively, take X and Y as the left and right child nodes of the new node mapped to L respectively, and take Z as the left child node of the new node mapped to M. After creation, a binary tree related to capital English letters is obtained; S12: Create a binary tree related to lowercase English letters according to a preset lowercase creation rule; S13: Create a binary tree related to numbers according to a preset number creation rule. The number creation rule is as follows: S131: Use the newNode() function to create 10 new nodes in sequence. Each new node is mapped to numeric characters 0, 1,..., 9 in the order of their creation; S132: Take the new node mapped to 0 as the root node, and take the new nodes mapped to 1 and 2 as the left and right child nodes of the root node respectively; S133: Then take 3 and 4 as the left and right child nodes of the new node mapped to 1 respectively, and take 5 and 6 as the left and right child nodes of the new node mapped to 2 respectively; S134: Finally, take 7 and 8 as the left and right child nodes of the new node mapped to 5 respectively, and take 9 as the left child node of the new node mapped to 6. After creation, a binary tree related to numbers is obtained.
6. The method for protecting the privacy of power data based on blockchain according to claim 1, wherein The digital calculation rule for calculating the mapping codes of numeric characters C1, C2,..., Cc is as follows: S171: Traverse the binary tree related to numbers, obtain the layer number G1 and depth H1 of the new node mapped to numeric character C1 from it, calculate and obtain the position feature value I1 of the new node using the formula I1 = G1 × H1, and perform binary conversion on I1 to obtain the mapping code of numeric character C1; S172: Determine the mapping code of numeric character C2 according to numeric character C1: Perform several rotations on the binary tree to obtain a binary tree with a new node mapped to the digital character C2 as the root node, and record the number of rotations K1 at this time; At the same time, mark the absolute value of the difference between C1 and C2 as the rotation feature record value J1 of the binary tree with the new node mapped to the digital character C2 as the root node; Obtain the layer number G2 and depth H2 of the new node mapped to the rotation feature record value J1 in the binary tree with the new node mapped to the digital character C2 as the root node at this time, calculate and obtain the position feature value I2 of the new node using the formula I2 = G2 × H2, splice I2 and K1, and perform binary conversion on the spliced result to obtain the mapping code of the digital character C2; S173: According to S172, compare the sizes of C1 and C3, C1 and C4,..., C1 and Cc in sequence, and obtain the mapping codes of the digital characters C3, C4,..., Cc based on the comparison results.
7. A method for protecting the privacy of power data based on blockchain according to claim 6, characterized in that In S173, when performing size comparison and then rotating to obtain a binary tree with the corresponding digital character as the root node, the rotation is always based on the binary tree related to the number.
Citation Information
Patent Citations
Data encryption method, data decryption method, data encryption device, data decryption device, and data encryption and decryption system
CN108075879A
User authentication system
JP2022052398A
Encryption method for supporting range query in multi-client environment and apparatus using the same
KR102123440B1