Data encryption method and system for blockchain information transmission and storage medium
Patent Information
- Application Number
- CN202610970089.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-06-30
- Publication Date
- 2026-09-29
AI Technical Summary
[0005]本发明提供了一种用于区块链信息传输的数据加密方法、系统及存储介质,以解决现有技术中存在资源浪费问题
(1)本发明能够根据节点分布和通信模式动态调整加密策略,解决现有技术无法根据数据生命周期动态调整加密方式的不足,有效平衡休眠状态下数据的安全性和资源消耗。
Smart Images

Figure CN122845200A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of data encryption technology, and in particular to a data encryption method, system and storage medium for blockchain information transmission. Background Technology
[0002] Currently, in the field of information security and data storage, blockchain technology, due to its decentralized and immutable characteristics, has become an important means to ensure data integrity and trustworthiness, especially in scenarios such as finance, supply chain, and digital identity, where it has irreplaceable value. However, with the surge in data volume and the increasing complexity of application scenarios, how to efficiently and securely manage blockchain data has become an urgent issue to be addressed.
[0003] In a current blockchain technology, data is encrypted during writing via distributed nodes. Each node independently selects the encryption algorithm and parameters, storing the encrypted data on the blockchain. Once the data is written and enters a dormant state, the blockchain network is divided into multiple groups. Nodes within each group independently manage their stored data, and groups synchronize data through a consensus mechanism. However, once data enters a dormant state, the encryption method and parameters remain fixed. Nodes do not dynamically adjust their encryption strategies based on data usage frequency or lifecycle status. The independent selection of encryption algorithms and parameters by different nodes during data writing leads to a lack of a unified encryption strategy within the groups, making it impossible to adapt to the specific protection needs of dormant data and resulting in wasted resources.
[0004] In summary, existing technologies suffer from resource waste. Summary of the Invention
[0005] This invention provides a data encryption method, system, and storage medium for blockchain information transmission, in order to solve the problem of resource waste in the prior art.
[0006] Firstly, in order to solve the above-mentioned technical problems, the present invention provides a data encryption method for blockchain information transmission, comprising: The unified encryption parameters of the dormant data and the distribution data of each node in the group are obtained, and a matching analysis is performed based on the unified encryption parameters and the distribution data to obtain a set of encryption configurations applicable to all nodes. The group is a dynamic management unit in the blockchain that is divided to achieve encryption consistency of dormant data. The dormant data stored in each node is encrypted according to the encryption configuration set to obtain the encrypted dormant data record; Collect the status identifiers of each node, and mark the dormant data records corresponding to the nodes whose status identifiers are active as pending synchronization, thereby obtaining the data records to be synchronized; Analyze the frequency of data interaction and state switching triggering rules of the data records to be synchronized between groups, and generate a shared dormant state switching rule between groups; The system collects state switching request data during data interaction. When the state switching request data meets a preset threshold, a switching operation is performed according to the dormant state switching rules to obtain the data state after the state switching operation is performed. Based on the data status, obtain the synchronization feedback information of each node in the group to obtain the range of dormant data that has not been synchronized and the unsynchronized nodes within the range of dormant data; Monitor and collect resource usage data of the unsynchronized nodes. If the resource usage data exceeds the preset upper limit, adjust the data processing priority of the node. Based on the data processing priority, bandwidth and computing resources are reallocated to generate an optimized encryption task execution plan, and data synchronization is performed according to the encryption task execution plan.
[0007] In one optional implementation, the process involves acquiring unified encryption parameters for the dormant data and distribution data of each node within the group, and performing matching analysis based on the unified encryption parameters and the distribution data to obtain a set of encryption configurations applicable to all nodes. The group is a dynamically managed unit in the blockchain used to achieve consistent encryption of dormant data, comprising: Obtain the interaction frequency between nodes and the data transmission volume distribution under different interaction modes in historical data; Calculate the matching degree between the unified encryption parameters and the distribution data. If the matching degree is lower than the preset matching degree threshold, adjust the unified encryption parameters to obtain a preliminary combination of encryption parameters suitable for the node distribution. The nodes are sorted from high to low according to the interaction frequency. When the interaction frequency of a node is higher than the preset frequency value, the node is marked as a high-frequency communication node and an encryption level is set to obtain an encryption strength level applicable to the high-frequency communication node. Monitor the changes in the data transmission volume distribution. If the transmission volume exceeds the preset transmission volume threshold, dynamically adjust the initial encryption parameter combination to obtain a configuration scheme that adapts to the interaction mode. The initial encryption parameter combination is integrated based on the encryption strength level and the configuration scheme to obtain an encryption configuration set applicable to all nodes.
[0008] In one optional implementation, the step of collecting the status identifiers of each node and marking the dormant data records corresponding to the nodes whose status identifiers are active as pending synchronization records to obtain the data records to be synchronized includes: Collect the status identifiers of each node to obtain the nodes with active status identifiers and the nodes with dormant status identifiers; The dormant data records corresponding to the nodes with active status identifiers are processed to obtain the data records to be processed; Extract the portion that needs to be updated from the data record to be processed to obtain a data record unit; If the data recording unit meets the preset synchronization conditions, it is marked as pending synchronization, and a data record to be synchronized is obtained.
[0009] In one optional implementation, the step of analyzing the frequency of data interaction and state switching triggering rules of the data records to be synchronized between groups, and generating shared dormant state switching rules between groups, includes: Obtain the triggering conditions and coordination constraints for state transitions; Analyze the frequency of data interaction and state switching triggering rules of the data records to be synchronized between groups to obtain a set of data interaction frequencies between groups; If the data interaction frequency of a certain group exceeds the preset interaction threshold, it is marked as a high coordination need group. The triggering conditions that meet the coordination constraints are determined by comparing each of the high coordination demand groups one by one, thus obtaining a set of triggering conditions; Based on the set of triggering conditions, rules are generated to obtain sleep state switching rules suitable for sharing among groups.
[0010] In one optional implementation, the state switching request data during data collection interaction, when the state switching request data meets a preset threshold condition, then a switching operation is performed according to the dormant state switching rules to obtain the data state after the state switching operation, including: Collect state switching request data during data interaction to obtain the requested dataset; If the request frequency in the request dataset exceeds a preset frequency threshold, it is marked as a high-priority request, thus obtaining a set of high-priority requests; The hibernation state switching rule is executed according to the high-priority request set to obtain the corresponding state switching instruction; When the state switching instruction meets the preset conditions, the switching operation is executed to obtain the data state after the state switching operation is executed.
[0011] In one optional implementation, the step of obtaining synchronization feedback information of each node in the group based on the data status to obtain the range of dormant data that has not been synchronized and the unsynchronized nodes within the range of dormant data includes: Based on the data status, at least one synchronization feedback message is obtained from the group node and classified to obtain a sorted feedback data set. Calculate the progress value of the feedback data set. If the progress value is lower than the preset evaluation index, mark it as an unsynchronized node and obtain a list of unsynchronized nodes. Based on the list of nodes that have not been synchronized, obtain the dormant data of the corresponding nodes and divide the range to obtain the divided dormant data range; The nodes in the node list are categorized and labeled to obtain the unsynchronized nodes.
[0012] In one optional implementation, the step of reallocating bandwidth and computing resources according to the data processing priority, generating an optimized encryption task execution plan, and performing data synchronization according to the encryption task execution plan includes: Based on the data processing priority, at least one data processing record is obtained from the synchronization tasks of the unsynchronized node, and the priority of each synchronization task is determined to obtain a preliminary task sorting list. Each synchronous task is divided into multiple smaller tasks based on the task sorting list, resulting in a small task unit. The processing batches of the small task units are obtained by matching them according to their size and dependencies. According to the processing batch, the resource requirement information corresponding to each small task unit is obtained. If the resource requirement information exceeds the preset resource limit, the resource allocation is re-divided to obtain the adjusted resource configuration scheme. Based on the resource configuration scheme, a corresponding execution plan is generated to obtain the optimized encryption task execution plan; Data synchronization is performed according to the encryption task execution plan.
[0013] Secondly, the present invention provides a data encryption system for blockchain information transmission, comprising: The data acquisition module is used to acquire the unified encryption parameters of the dormant data and the distribution data of each node in the group, and to perform matching analysis based on the unified encryption parameters and the distribution data to obtain a set of encryption configurations applicable to all nodes. The group is a dynamic management unit in the blockchain that is divided to achieve encryption consistency of dormant data. The data encryption module is used to encrypt the dormant data stored in each node according to the encryption configuration set, so as to obtain the encrypted dormant data record; The data acquisition module is used to collect the status identifiers of each node, mark the dormant data records corresponding to the nodes whose status identifiers are active as pending synchronization, and obtain the data records to be synchronized. The data interaction module is used to analyze the frequency of data interaction and state switching triggering rules of the data to be synchronized between groups, and generate a shared dormant state switching rule between groups. The data switching module is used to collect state switching request data during data interaction. When the state switching request data meets the preset condition threshold, a switching operation is performed according to the dormant state switching rules to obtain the data state after the state switching operation is performed. The data tagging module is used to obtain the synchronization feedback information of each node in the group according to the data status, and to obtain the range of dormant data that has not been synchronized and the unsynchronized nodes within the range of dormant data. The data monitoring module is used to monitor and collect the resource usage data of the unsynchronized nodes. If the resource usage data exceeds the preset upper limit, the data processing priority of the node is adjusted. The data execution module is used to reallocate bandwidth and computing resources according to the data processing priority, generate an optimized encryption task execution plan, and perform data synchronization according to the encryption task execution plan.
[0014] Thirdly, the present invention also provides an electronic device, including a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, wherein the processor, when executing the computer program, implements the data encryption method for blockchain information transmission described in any one of the above.
[0015] Fourthly, the present invention also provides a computer-readable storage medium comprising a stored computer program, wherein, when the computer program is executed, it controls the device where the computer-readable storage medium is located to perform the data encryption method for blockchain information transmission described in any one of the above.
[0016] Compared with the prior art, the present invention has the following beneficial effects: (1) The present invention can dynamically adjust the encryption strategy according to the node distribution and communication mode, which solves the shortcomings of the existing technology that cannot dynamically adjust the encryption method according to the data life cycle, and effectively balances the security and resource consumption of data in the dormant state.
[0017] (2) The present invention can monitor the node status in real time and mark the dormant data of active nodes as the state to be synchronized. At the same time, it generates a dormant state switching rule shared between groups, which effectively solves the problem of difficult coordination between groups in the prior art and improves the efficiency and security of data synchronization.
[0018] (3) The present invention can monitor the resource usage of unsynchronized nodes and adjust the data processing priority. Combined with the dynamic adjustment mechanism of resource allocation, it optimizes the execution plan of encryption tasks, avoids waste or security risks caused by unreasonable resource allocation in the prior art, and improves resource utilization and data processing efficiency. Attached Figure Description
[0019] Figure 1 This is a schematic diagram of the data encryption method for blockchain information transmission provided in the first embodiment of the present invention; Figure 2 This is a schematic diagram of a data encryption system for blockchain information transmission provided in the second embodiment of the present invention. Detailed Implementation
[0020] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0021] Reference Figure 1 The first embodiment of the present invention provides a data encryption method for blockchain information transmission, comprising the following steps: S11, obtain the unified encryption parameters of the dormant data and the distribution data of each node in the group, and perform matching analysis based on the unified encryption parameters and the distribution data to obtain a set of encryption configurations applicable to all nodes, wherein the group is a dynamic management unit in the blockchain that is divided to achieve encryption consistency of dormant data; S12, encrypt the hibernation data stored in each node according to the encryption configuration set to obtain the encrypted hibernation data record; S13, collect the status identifiers of each node, mark the dormant data records corresponding to the nodes whose status identifiers are active as pending synchronization, and obtain the data records to be synchronized; S14, Analyze the frequency of data interaction and state switching triggering rules of the data to be synchronized between groups, and generate a shared dormant state switching rule between groups; S15, collect state switching request data during data interaction. When the state switching request data meets the preset condition threshold, perform a switching operation according to the dormant state switching rule to obtain the data state after the state switching operation is performed. S16, Based on the data status, obtain the synchronization feedback information of each node in the group, and obtain the range of dormant data that has not been synchronized and the unsynchronized nodes within the range of dormant data; S17, monitor and collect the resource usage data of the unsynchronized node. If the resource usage data exceeds the preset upper limit, adjust the data processing priority of the node. S18, reallocate bandwidth and computing resources according to the data processing priority, generate an optimized encryption task execution plan, and perform data synchronization according to the encryption task execution plan.
[0022] In step S11, the unified encryption parameters of the dormant data and the distribution data of each node in the group are obtained, and a matching analysis is performed based on the unified encryption parameters and the distribution data to obtain a set of encryption configurations applicable to all nodes. The group is a dynamic management unit in the blockchain that is divided to achieve encryption consistency of dormant data.
[0023] In one implementation, the process involves acquiring unified encryption parameters for the dormant data and distribution data of each node within a group, and performing matching analysis based on the unified encryption parameters and the distribution data to obtain a set of encryption configurations applicable to all nodes. The group is a dynamically managed unit within the blockchain used to achieve consistent encryption of dormant data, comprising: Obtain the interaction frequency between nodes and the data transmission volume distribution under different interaction modes in historical data; Calculate the matching degree between the unified encryption parameters and the distribution data. If the matching degree is lower than the preset matching degree threshold, adjust the unified encryption parameters to obtain a preliminary combination of encryption parameters suitable for the node distribution. The nodes are sorted from high to low according to the interaction frequency. When the interaction frequency of a node is higher than the preset frequency value, the node is marked as a high-frequency communication node and an encryption level is set to obtain an encryption strength level applicable to the high-frequency communication node. Monitor the changes in the data transmission volume distribution. If the transmission volume exceeds the preset transmission volume threshold, dynamically adjust the initial encryption parameter combination to obtain a configuration scheme that adapts to the interaction mode. The initial encryption parameter combination is integrated based on the encryption strength level and the configuration scheme to obtain an encryption configuration set applicable to all nodes.
[0024] It should be noted that a logging tool is used to extract historical data on node communication, including the interaction frequency between nodes and the data transmission volume distribution under different interaction modes. The logging tool can use the ELK Stack to collect, parse, and store historical data on node communication, helping to extract information on the interaction frequency between nodes and the data transmission volume distribution under different interaction modes. A unified set of parameters for dormant data is obtained from a pre-established group encryption policy library. The policy library exists in the form of a database and the corresponding parameter set can be obtained through SQL queries. The parameter set includes the encryption algorithm type, symmetric key length, and data fragment size. The matching degree between the unified encryption parameters and the distribution data is calculated, taking into account the influence of various factors of node distribution (such as node geographical location distribution and network topology) on the encryption parameters. A weight is assigned to each factor (e.g., node geographical location distribution can be assigned a weight of 1, and network topology can be assigned a weight of 0.8). Then, a weighted average is calculated based on the weights as the final matching degree.
[0025] If the matching degree is lower than a preset threshold, some values in the unified parameter set (encryption algorithm type and data fragment size) are adjusted to obtain a preliminary encryption parameter combination suitable for the node distribution. The preset matching degree threshold is determined by collecting a large amount of historical data, statistically analyzing the matching degree, and calculating its average value and standard deviation. Based on the analysis results, the threshold is set as the average value minus a certain multiple of the standard deviation, such as the average value - 2 × the standard deviation. Based on the preliminary encryption parameter combination, the interaction frequency between each node is analyzed. The interaction frequency in the historical data is sorted and classified according to its high or low frequency. Nodes with an interaction frequency higher than 100 times per day are classified as high-frequency communication nodes. The encryption configuration requirements of high-frequency communication nodes are determined. Factors such as increased data leakage risk due to high communication frequency and higher requirements for data transmission efficiency are considered. The encryption strength level of this node is defined as "high," and the encryption strength level suitable for the high-frequency communication nodes is determined.
[0026] Using the encryption strength level, traffic monitoring tools are employed to record changes in data transmission volume across each node under different interaction modes. These tools, such as Wireshark and tcpdump, can capture network traffic data to help monitor real-time data transmission volume changes across different interaction modes. If the transmission volume exceeds a preset threshold, the encryption configuration is dynamically adjusted to obtain a configuration scheme adapted to the interaction mode. Based on this configuration scheme, the encryption requirements of all nodes are integrated, and a configuration integration tool is used to generate the final encryption configuration set. This integration tool can be Ansible, enabling automated integration and management of the encryption configuration requirements of all nodes, generating a final unified encryption configuration set based on different encryption strength levels and configuration schemes adapted to different interaction modes.
[0027] In step S12, the hibernation data stored in each node is encrypted according to the encryption configuration set to obtain the encrypted hibernation data record.
[0028] It should be noted that, based on the encrypted configuration set, the dormant data within the group is processed by using a data sharding tool to segment the dormant data, resulting in a combination of sharded data units. The data sharding tool can use the Hadoop Distributed File System (HDFS), which has powerful data sharding capabilities and can divide large-scale dormant data into multiple smaller shards, each typically 128MB or 256MB, stored on different data nodes. For the combination of data units after sharding, a parallel processing tool is used to perform an encryption process on each unit. During the processing of the data unit combination, the start and end times of each node are recorded to determine the encryption completion time stamp of the node. The parallel processing tool can be Apache Hadoop MapReduce, a parallel processing framework based on the MapReduce programming model. In the dormant data encryption scenario, HDFS automatically generates a BlockID for each data block (128 MB / 256 MB) during sharding. The encryption configuration set is serialized (in the form of {Algorithm: AES-256, Key Length: 256 bit, Shard Size: 128 MB, Padding Mode: PKCS7, Working Mode: CBC}) and passed as the Configuration parameter to the MapReduce job. Each MapTask instance reads this parameter through Hadoop Counters. During the setup() phase, the MapTask parses the configuration into a local object, and subsequently uses these parameters directly for encryption of the data unit corresponding to the current BlockID.
[0029] The processing time data of each node is extracted from the encryption completion time stamp using a time monitoring tool. Combined with a traffic monitoring tool, the traffic information of each node during the processing of the data unit combination is obtained, resulting in a summary of the processed data volume for each node. If the total processed data volume exceeds a preset threshold, the node data volume and corresponding time exceeding the threshold are categorized and stored using a record integration tool. Subsequent processing resource allocation is increased (e.g., increasing the number of CPU cores and memory capacity), generating a final hibernation data record. The time monitoring tool uses the `time` command from the Unix system to measure the start and end times of encryption tasks executed in the command line, as well as the overall execution time of the task. It provides detailed information such as user time and system time, facilitating simple time monitoring of encryption tasks on individual nodes. The record integration tool uses the ELK Stack (Elasticsearch, Logstash, Kibana). Logstash collects log data such as processing time data and traffic information of encryption tasks on each node, parses and transforms it, and stores it in Elasticsearch. Kibana can visualize this data and also categorize, store, and query node data volume and corresponding time exceeding the threshold. The preset threshold can collect historical data on the time and traffic of each node in processing dormant data, calculate its average value and standard deviation, and set the threshold as the average value plus twice the standard deviation.
[0030] In step S13, the status identifiers of each node are collected, and the dormant data records corresponding to the nodes whose status identifiers are active are marked as pending synchronization, thus obtaining the data records to be synchronized.
[0031] In one implementation, the step of collecting the status identifiers of each node and marking the dormant data records corresponding to the nodes whose status identifiers are active as pending synchronization records, thereby obtaining the data records to be synchronized, includes: Collect the status identifiers of each node to obtain the nodes with active status identifiers and the nodes with dormant status identifiers; The dormant data records corresponding to the nodes with active status identifiers are processed to obtain the data records to be processed; Extract the portion that needs to be updated from the data record to be processed to obtain a data record unit; If the data recording unit meets the preset synchronization conditions, it is marked as pending synchronization, and a data record to be synchronized is obtained.
[0032] It should be noted that the status of the nodes is collected via a real-time communication interface. Status data is collected every 5 minutes, including the node's online status and resource utilization. The node's response time can be used to determine its active or dormant status. For example, nodes with a response time of less than 2 seconds are marked as active, while those with no response for more than 10 seconds are marked as dormant. For nodes with an active status, their corresponding dormant data records are processed, and task allocation can be prioritized. Assuming 6 nodes are marked as active, and each node has 2GB of associated dormant data records, the system will include these records in the pending processing scope, forming a total of 12GB of data records to be synchronized, thus determining the data records to be processed.
[0033] A data record classification tool, Apache NiFi, is used to extract the parts that need updating from the data records to be processed, resulting in classified data record units. Apache NiFi provides powerful data classification and routing capabilities. Classification can be performed based on attributes (such as filename, data type, timestamp, etc.) or content (such as the value of a specific field) of dormant data records by configuring processors (such as RouteOnAttribute). For the classified data record units, if the unit meets preset synchronization conditions, it is marked as pending synchronization by a synchronization status processing tool, resulting in data records to be synchronized. For example, if the synchronization condition is that the update interval of the data record exceeds 24 hours, then a 3GB data unit meeting this condition will be marked as pending synchronization. The synchronization status processing tool can be Apache Kafka. Kafka can be used for synchronization status processing, sending data records to be synchronized to a specific topic. Consumers can consume these data records from the topic according to their processing capabilities and needs, and mark them as pending synchronization locally.
[0034] In step S14, the frequency of data interaction and state switching triggering rules of the data to be synchronized between groups are analyzed, and a hibernation state switching rule shared between groups is generated.
[0035] In one implementation, the step of analyzing the frequency of data interaction and state switching triggering rules of the data records to be synchronized between groups, and generating shared dormant state switching rules between groups, includes: Obtain the triggering conditions and coordination constraints for state transitions; Analyze the frequency of data interaction and state switching triggering rules of the data records to be synchronized between groups to obtain a set of data interaction frequencies between groups; If the data interaction frequency of a certain group exceeds the preset interaction threshold, it is marked as a high coordination need group. The triggering conditions that meet the coordination constraints are determined by comparing each of the high coordination demand groups one by one, thus obtaining a set of triggering conditions; Based on the set of triggering conditions, rules are generated to obtain sleep state switching rules suitable for sharing among groups.
[0036] It should be noted that, based on the dormant records marked as awaiting synchronization, a data classification tool is used to group these dormant records. The distribution characteristics of the data interaction frequency among these groups are analyzed to obtain a set of data interaction frequencies between the groups. The data classification tool can use machine learning libraries (such as scikit-learn) to classify data based on features, such as data frequency, timestamps, and data types, categorizing data into different groups. If the frequency of successful data interaction in a certain group exceeds the preset threshold, it is marked as a high-coordination-demand group, with the threshold set at 20 data interactions per hour. For the high-coordination-requirement group, the trigger conditions and coordination constraints for state switching are obtained from the system configuration file. Node load and response speed can be considered; for example, trigger conditions include node load below 50% and response time less than 3 seconds, while coordination constraints require at least 3 nodes in the group to meet the conditions. After comparing each condition using a condition matching tool, a set of trigger conditions that meet the requirements is selected. The condition matching tool can use a rule engine (such as Drools) and can define frequency threshold rules (frequency exceeding the threshold: 20 times / hour) to match trigger conditions and coordination constraints. When the data meets the rules, the corresponding action can be executed. Based on the set of trigger conditions, the switching rules are adjusted using a rule generation tool to obtain dormant state switching rules suitable for sharing among groups. The rule generation tool can use a machine learning framework (such as TensorFlow) and can be used to generate new rules based on historical data (such as group-level interaction logs from the past 30 days) and patterns. It can train models to predict future data interaction patterns and generate corresponding rules.
[0037] In step S15, state switching request data during data interaction is collected. When the state switching request data meets the preset condition threshold, a switching operation is performed according to the dormant state switching rule to obtain the data state after the state switching operation is performed.
[0038] In one implementation, the state switching request data during data collection interaction, when the state switching request data meets a preset condition threshold, then a switching operation is performed according to the dormant state switching rule to obtain the data state after the state switching operation, including: Collect state switching request data during data interaction to obtain the requested dataset; If the request frequency in the request dataset exceeds a preset frequency threshold, it is marked as a high-priority request, thus obtaining a set of high-priority requests; The hibernation state switching rule is executed according to the high-priority request set to obtain the corresponding state switching instruction; When the state switching instruction meets the preset conditions, the switching operation is executed to obtain the data state after the state switching operation is executed.
[0039] It should be noted that the state switching request data is obtained from inter-group data interaction through the real-time monitoring system for the switching requests. For the request dataset, a logical comparison tool is used in conjunction with a preset frequency threshold for analysis. The threshold can be set to 500 requests per hour. The logical comparison tool can use a scripting language (such as Python), and scripts can be written to implement the logical comparison function. For example, Python's conditional statements (if-else) can be used to determine whether the request frequency exceeds the preset threshold. If the frequency in the request dataset exceeds the frequency threshold, it is marked as a high-priority request, and a set of high-priority requests is determined. The hibernation state switching rule is executed through the set of high-priority requests to obtain the corresponding state switching instruction. An instruction parsing tool is used to process the instruction. For example, if an instruction requires a switch to be performed when the node load is below 40%, the parsing tool will verify whether the current condition is met. If the condition is met, the switching operation is performed, and the data state after the switch is obtained. Based on the switched state information, the instruction parsing tool can use a scripting language (such as Python) to write scripts to parse the state switching instructions. For example, Python's string processing functions or regular expressions can be used to parse the instruction content and extract key information such as operation type and target node.
[0040] In step S16, the synchronization feedback information of each node in the group is obtained according to the data status, and the range of dormant data that has not been synchronized and the unsynchronized nodes within the range of dormant data are obtained.
[0041] In one implementation, obtaining synchronization feedback information from each node in the group based on the data status to determine the range of dormant data that has not been synchronized and the unsynchronized nodes within the dormant data range includes: Based on the data status, at least one synchronization feedback message is obtained from the group node and classified to obtain a sorted feedback data set. Calculate the progress value of the feedback data set. If the progress value is lower than the preset evaluation index, mark it as an unsynchronized node and obtain a list of unsynchronized nodes. Based on the list of nodes that have not been synchronized, obtain the dormant data of the corresponding nodes and divide the range to obtain the divided dormant data range; The nodes in the node list are categorized and labeled to obtain the unsynchronized nodes.
[0042] It should be noted that, based on the data state after the state switch, at least one synchronization feedback message is obtained from the group nodes. This synchronization feedback message is then categorized using a pre-established processing tool to obtain a processed feedback data set. The processing tool can use Apache Spark, leveraging Spark's distributed computing capabilities to process and categorize the synchronization feedback message. Data transformation and aggregation operations are performed using Spark's RDD or DataFrame API to generate the processed feedback data set. For the processed feedback data set, a logical comparison tool combined with preset evaluation metrics is used for progress analysis. These evaluation metrics measure the degree to which nodes have completed their synchronization tasks. The progress value is calculated as the ratio of the amount of data that has been synchronized to the total amount of data. If the progress value is lower than a preset threshold (which can be set to 80%), the node is marked as an incomplete synchronization node, thus determining the list of incomplete synchronization nodes. By obtaining the list of nodes that have not been synchronized, the corresponding dormant data content is retrieved. This dormant data content is then divided into ranges using a parsing tool. The parsing tool can utilize the Pandas library in Python, which provides powerful data processing and parsing capabilities. Pandas can be used to read the dormant data content, perform data cleaning, transformation, and analysis, and extract the required dormant data ranges. Based on the combined data ranges, the nodes that have not been synchronized are categorized and labeled to obtain the unsynchronized nodes.
[0043] In step S17, the resource usage data of the unsynchronized node is monitored and collected. If the resource usage data exceeds the preset upper limit, the data processing priority of the node is adjusted.
[0044] In one implementation, a pre-established monitoring system acquires at least one resource usage data point from nodes that have not yet completed synchronization. The computational data and storage resource information within this data are categorized and organized. A logical comparison tool is used to match this data against a preset upper limit to determine if the usage exceeds the limit. The preset upper limit can be dynamically calculated using the "average value + 2 standard deviations" method. Based on the determination of the resource usage data, for nodes exceeding the upper limit, their current processing order information is acquired, and a sorting tool is used to adjust the order and determine the data processing priority of each node. The sorting tool can be a custom script that sorts nodes according to a weighted priority score based on resource usage. For example, the priority can be determined based on the weighted average of computational resource utilization and storage resource utilization.
[0045] In step S18, bandwidth and computing resources are reallocated according to the data processing priority to generate an optimized encryption task execution plan, and data synchronization is performed according to the encryption task execution plan.
[0046] In one implementation, the step of reallocating bandwidth and computing resources according to the data processing priority, generating an optimized encryption task execution plan, and performing data synchronization according to the encryption task execution plan includes: Based on the data processing priority, at least one data processing record is obtained from the synchronization tasks of the unsynchronized node, and the priority of each synchronization task is determined to obtain a preliminary task sorting list. Each synchronous task is divided into multiple smaller tasks based on the task sorting list, resulting in a small task unit. The processing batches of the small task units are obtained by matching them according to their size and dependencies. According to the processing batch, the resource requirement information corresponding to each small task unit is obtained. If the resource requirement information exceeds the preset resource limit, the resource allocation is re-divided to obtain the adjusted resource configuration scheme. Based on the resource configuration scheme, a corresponding execution plan is generated to obtain the optimized encryption task execution plan; Data synchronization is performed according to the encryption task execution plan.
[0047] It should be noted that, through a pre-established scheduling tool, at least one data processing record is obtained from the tasks that have not yet completed synchronization. This scheduling tool, which can use Apache Spark, is capable of distributed processing and scheduling of large-scale data, and schedules tasks and allocates resources based on data processing priorities. The task size and complexity information in the data processing records is then organized using a classification tool to obtain a preliminary task ranking list. This classification tool can use the Pandas library in Python, which provides powerful data processing and classification capabilities for efficient classification and analysis of large-scale data. Based on this preliminary task ranking list, a data sharding tool is used to split each synchronization task into multiple smaller task units with a base block size of 128 MB. A logical comparison tool is used to match the size and dependencies of these smaller task units to determine their processing batches. Through these processing batches, the resource requirements for each smaller task unit are obtained. These resource requirements (such as CPU, memory, bandwidth, etc.) can be specified in the task's configuration file, which is read during task scheduling to obtain the resource requirement information. If the resource usage exceeds a preset limit (the preset limit is 80% of the total resources), the resource allocation is re-divided to obtain an adjusted resource configuration scheme. When multiple tasks simultaneously exceed the 80% limit, if the task priorities are different, the high-priority task preempts 100% of the demand, and the low-priority task is reduced to 0 (suspended). If the task priorities are the same, the remaining resources are divided equally. According to the adjusted resource configuration scheme, for the encrypted tasks associated with the small task unit, an integration tool is used to generate corresponding execution plans. Combining the priority and resource configuration information, the execution order of the task unit is determined, and finally, an optimized encrypted task execution plan is obtained. Data synchronization is performed according to the encrypted task execution plan. The integration tool can use Apache Airflow, which can be used for workflow management and task scheduling, and can integrate different task units, generate execution plans, and execute tasks.
[0048] In summary, this invention can dynamically adjust the encryption strategy based on node distribution and communication modes, overcoming the shortcomings of existing technologies that cannot dynamically adjust encryption methods according to data lifecycle, and effectively balancing data security and resource consumption in dormant states. This invention can monitor node status in real time and mark dormant data of active nodes as pending synchronization, while generating shared dormant state switching rules between groups, effectively solving the problem of difficult inter-group coordination in existing technologies and improving the efficiency and security of data synchronization. This invention can monitor the resource usage of unsynchronized nodes and adjust data processing priorities, optimizing the encryption task execution plan in conjunction with a dynamic resource allocation adjustment mechanism, avoiding waste or security risks caused by unreasonable resource allocation in existing technologies, and improving resource utilization and data processing efficiency.
[0049] Reference Figure 2 The second embodiment of the present invention provides a data encryption system for blockchain information transmission, comprising: The data acquisition module is used to acquire the unified encryption parameters of the dormant data and the distribution data of each node in the group, and to perform matching analysis based on the unified encryption parameters and the distribution data to obtain a set of encryption configurations applicable to all nodes. The group is a dynamic management unit in the blockchain that is divided to achieve encryption consistency of dormant data. The data encryption module is used to encrypt the dormant data stored in each node according to the encryption configuration set, so as to obtain the encrypted dormant data record; The data acquisition module is used to collect the status identifiers of each node, mark the dormant data records corresponding to the nodes whose status identifiers are active as pending synchronization, and obtain the data records to be synchronized. The data interaction module is used to analyze the frequency of data interaction and state switching triggering rules of the data to be synchronized between groups, and generate a shared dormant state switching rule between groups. The data switching module is used to collect state switching request data during data interaction. When the state switching request data meets the preset condition threshold, a switching operation is performed according to the dormant state switching rules to obtain the data state after the state switching operation is performed. The data tagging module is used to obtain the synchronization feedback information of each node in the group according to the data status, and to obtain the range of dormant data that has not been synchronized and the unsynchronized nodes within the range of dormant data. The data monitoring module is used to monitor and collect the resource usage data of the unsynchronized nodes. If the resource usage data exceeds the preset upper limit, the data processing priority of the node is adjusted. The data execution module is used to reallocate bandwidth and computing resources according to the data processing priority, generate an optimized encryption task execution plan, and perform data synchronization according to the encryption task execution plan.
[0050] It should be noted that the data encryption system for blockchain information transmission provided in this embodiment of the invention is used to execute all the process steps of the data encryption method for blockchain information transmission in the above embodiment. The working principles and beneficial effects of the two are one-to-one, so they will not be described again.
[0051] This invention also provides an electronic device. The electronic device includes a processor, a memory, and a computer program stored in the memory and executable on the processor, such as an encryption program. When the processor executes the computer program, it implements the steps described in the above-described embodiments of data encryption methods for blockchain information transmission, for example... Figure 1 The step S11 shown. Alternatively, when the processor executes the computer program, it implements the functions of each module / unit in the above-described device embodiments, such as a data encryption module for blockchain information transmission.
[0052] For example, the computer program may be divided into one or more modules / units, which are stored in the memory and executed by the processor to complete the present invention. The one or more modules / units may be a series of computer program instruction segments capable of performing a specific function, which describe the execution process of the computer program in the electronic device.
[0053] The electronic device may be a desktop computer, laptop, handheld computer, or smart tablet, etc. The electronic device may include, but is not limited to, a processor and memory. Those skilled in the art will understand that the above components are merely examples of electronic devices and do not constitute a limitation on the electronic device. It may include more or fewer components than described above, or combine certain components, or different components. For example, the electronic device may also include input / output devices, network access devices, buses, etc.
[0054] The processor can be a Central Processing Unit (CPU), or other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor can be a microprocessor or any conventional processor. The processor is the control center of the electronic device, connecting all parts of the electronic device via various interfaces and lines.
[0055] The memory can be used to store the computer programs and / or modules. The processor implements various functions of the electronic device by running or executing the computer programs and / or modules stored in the memory and by calling data stored in the memory. The memory may mainly include a program storage area and a data storage area. The program storage area may store the operating system, at least one application program required for a function (such as sound playback function, image playback function, etc.), etc.; the data storage area may store data created according to the use of the mobile phone (such as audio data, phonebook, etc.). In addition, the memory may include high-speed random access memory, and may also include non-volatile memory, such as hard disk, memory, plug-in hard disk, smart media card (SMC), secure digital (SD) card, flash card, at least one disk storage device, flash memory device, or other volatile solid-state storage device.
[0056] Wherein, if the modules / units integrated in the electronic device are implemented as software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, all or part of the processes in the methods of the above embodiments of the present invention can also be implemented by a computer program instructing related hardware. The computer program can be stored in a computer-readable storage medium, and when executed by a processor, it can implement the steps of the various method embodiments described above. The computer program includes computer program code, which can be in the form of source code, object code, executable files, or certain intermediate forms. The computer-readable medium can include: any entity or device capable of carrying the computer program code, recording media, USB flash drives, portable hard drives, magnetic disks, optical disks, computer memory, read-only memory (ROM), random access memory (RAM), electrical carrier signals, telecommunication signals, and software distribution media, etc. It should be noted that the content included in the computer-readable medium can be appropriately added or removed according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer-readable media do not include electrical carrier signals and telecommunication signals.
[0057] It should be noted that the device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Furthermore, in the accompanying drawings of the device embodiments provided by this invention, the connection relationships between modules indicate that they have communication connections, which can be specifically implemented as one or more communication buses or signal lines. Those skilled in the art can understand and implement this without any creative effort.
[0058] The specific embodiments described above further illustrate the purpose, technical solution, and beneficial effects of the present invention. It should be understood that the above descriptions are merely specific embodiments of the present invention and are not intended to limit the scope of protection of the present invention. In particular, it should be noted that any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention for those skilled in the art.
Claims
1. A data encryption method for blockchain information transmission, characterized in that, include: The unified encryption parameters of the dormant data and the distribution data of each node in the group are obtained, and a matching analysis is performed based on the unified encryption parameters and the distribution data to obtain a set of encryption configurations applicable to all nodes. The group is a dynamic management unit in the blockchain that is divided to achieve encryption consistency of dormant data. The dormant data stored in each node is encrypted according to the encryption configuration set to obtain the encrypted dormant data record; Collect the status identifiers of each node, and mark the dormant data records corresponding to the nodes whose status identifiers are active as pending synchronization, thereby obtaining the data records to be synchronized; Analyze the frequency of data interaction and state switching triggering rules of the data records to be synchronized between groups, and generate a shared dormant state switching rule between groups; The system collects state switching request data during data interaction. When the state switching request data meets a preset threshold, a switching operation is performed according to the dormant state switching rules to obtain the data state after the state switching operation is performed. Based on the data status, obtain the synchronization feedback information of each node in the group to obtain the range of dormant data that has not been synchronized and the unsynchronized nodes within the range of dormant data; Monitor and collect resource usage data of the unsynchronized nodes. If the resource usage data exceeds a preset upper limit, adjust the data processing priority of the node. Based on the data processing priority, bandwidth and computing resources are reallocated to generate an optimized encryption task execution plan, and data synchronization is performed according to the encryption task execution plan.
2. The data encryption method for blockchain information transmission according to claim 1, characterized in that, The process involves acquiring unified encryption parameters for dormant data and the distribution data of each node within the group, and performing matching analysis based on the unified encryption parameters and the distribution data to obtain a set of encryption configurations applicable to all nodes. The group is a dynamically managed unit in the blockchain used to achieve consistent encryption of dormant data, and includes: Obtain the interaction frequency between nodes and the data transmission volume distribution under different interaction modes in historical data; Calculate the matching degree between the unified encryption parameters and the distribution data. If the matching degree is lower than the preset matching degree threshold, adjust the unified encryption parameters to obtain a preliminary combination of encryption parameters suitable for the node distribution. The nodes are sorted from high to low according to the interaction frequency to obtain the high-frequency communication nodes; Determine the adjustment requirements of the high-frequency communication node for the initial encryption parameter combination, and generate an encryption strength level suitable for the high-frequency communication node; Monitor the changes in the data transmission volume distribution. If the transmission volume exceeds a preset transmission volume threshold, dynamically adjust the initial encryption parameter combination to obtain a configuration scheme that adapts to the interaction mode. The initial encryption parameter combination is integrated based on the encryption strength level and the configuration scheme to obtain an encryption configuration set applicable to all nodes.
3. The data encryption method for blockchain information transmission according to claim 1, characterized in that, The process involves collecting the status identifiers of each node, marking the dormant data records corresponding to nodes with active status identifiers as pending synchronization, and obtaining the pending synchronization data records, including: Collect the status identifiers of each node to obtain the nodes with active status identifiers and the nodes with dormant status identifiers; The dormant data records corresponding to the nodes with active status identifiers are processed to obtain the data records to be processed; Extract the portion that needs to be updated from the data record to be processed to obtain a data record unit; If the data recording unit meets the preset synchronization conditions, it is marked as pending synchronization, and a data record to be synchronized is obtained.
4. The data encryption method for blockchain information transmission according to claim 1, characterized in that, The analysis of the frequency of data interaction and state switching triggering rules of the data records to be synchronized between groups generates shared dormant state switching rules between groups, including: Obtain the triggering conditions and coordination constraints for state transitions; Analyze the frequency of data interaction and state switching triggering rules of the data records to be synchronized between groups to obtain a set of data interaction frequencies between groups; If the data interaction frequency of a certain group exceeds the preset interaction threshold, it is marked as a high coordination need group. Based on the comparison of each of the high coordination requirement groups, the triggering conditions that meet the coordination constraints are determined, and a set of triggering conditions is obtained. Based on the set of triggering conditions, rules are generated to obtain sleep state switching rules suitable for sharing among groups.
5. The data encryption method for blockchain information transmission according to claim 1, characterized in that, When the state switching request data during data collection and interaction meets a preset threshold, a switching operation is performed according to the dormant state switching rules to obtain the data state after the state switching operation, including: Collect state switching request data during data interaction to obtain the requested dataset; If the request frequency in the request dataset exceeds a preset frequency threshold, it is marked as a high-priority request, thus obtaining a set of high-priority requests; The hibernation state switching rule is executed according to the high-priority request set to obtain the corresponding state switching instruction; When the state switching instruction meets the preset conditions, the switching operation is executed to obtain the data state after the state switching operation is executed.
6. The data encryption method for blockchain information transmission according to claim 1, characterized in that, The step of obtaining synchronization feedback information from each node in the group based on the data status, and obtaining the range of dormant data that has not been synchronized and the unsynchronized nodes within the range of dormant data, includes: Based on the data status, at least one synchronization feedback message is obtained from the group node and classified to obtain a sorted feedback data set. Calculate the progress value of the feedback data set. If the progress value is lower than the preset evaluation index, mark it as an unsynchronized node and obtain a list of unsynchronized nodes. Based on the list of nodes that have not been synchronized, obtain the dormant data of the corresponding nodes and divide the range to obtain the divided dormant data range; The nodes in the node list are categorized and labeled to obtain the unsynchronized nodes.
7. The data encryption method for blockchain information transmission according to claim 1, characterized in that, The step of reallocating bandwidth and computing resources according to the data processing priority, generating an optimized encryption task execution plan, and performing data synchronization according to the encryption task execution plan includes: Based on the data processing priority, at least one data processing record is obtained from the synchronization tasks of the unsynchronized node, and the priority of each synchronization task is determined to obtain a preliminary task sorting list. Each synchronous task is divided into multiple smaller tasks based on the task sorting list, resulting in a small task unit. The processing batches of the small task units are obtained by matching them according to their size and dependencies. According to the processing batch, the resource requirement information corresponding to each small task unit is obtained. If the resource requirement information exceeds the preset resource limit, the resource allocation is re-divided to obtain the adjusted resource configuration scheme. Based on the resource configuration scheme, a corresponding execution plan is generated to obtain the optimized encryption task execution plan; Data synchronization is performed according to the encryption task execution plan.
8. A data encryption system for blockchain information transmission, characterized in that, include: The data acquisition module is used to acquire the unified encryption parameters of the dormant data and the distribution data of each node in the group, and to perform matching analysis based on the unified encryption parameters and the distribution data to obtain a set of encryption configurations applicable to all nodes. The group is a dynamic management unit in the blockchain that is divided to achieve encryption consistency of dormant data. The data encryption module is used to encrypt the dormant data stored in each node according to the encryption configuration set, so as to obtain the encrypted dormant data record; The data acquisition module is used to collect the status identifiers of each node, mark the dormant data records corresponding to the nodes whose status identifiers are active as pending synchronization, and obtain the data records to be synchronized. The data interaction module is used to analyze the frequency of data interaction and state switching triggering rules of the data to be synchronized between groups, and generate a shared dormant state switching rule between groups. The data switching module is used to collect state switching request data during data interaction. When the state switching request data meets the preset condition threshold, a switching operation is performed according to the dormant state switching rules to obtain the data state after the state switching operation is performed. The data tagging module is used to obtain the synchronization feedback information of each node in the group according to the data status, and to obtain the range of dormant data that has not been synchronized and the unsynchronized nodes within the range of dormant data. The data monitoring module is used to monitor and collect the resource usage data of the unsynchronized nodes. If the resource usage data exceeds the preset upper limit, the data processing priority of the node is adjusted. The data execution module is used to reallocate bandwidth and computing resources according to the data processing priority, generate an optimized encryption task execution plan, and perform data synchronization according to the encryption task execution plan.
9. An electronic device, characterized in that, It includes a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, wherein the processor, when executing the computer program, implements the data encryption method for blockchain information transmission as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes a stored computer program, wherein, when the computer program is executed, it controls the device containing the computer-readable storage medium to perform the data encryption method for blockchain information transmission as described in any one of claims 1 to 7.