Password encryption and decryption method and system based on multiprocessor architecture
By dynamically adjusting and optimizing the data block allocation and encryption and decryption algorithm of the processor core, combining load balancing and machine learning, the problem of insufficient computing power in traditional methods is solved, high-performance password encryption and decryption processing is realized, and the overall system is improved Performance and resource utilization efficiency.
Patent Information
- Application Number
- CN202411029049.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-30
- Publication Date
- 2024-11-29
AI Technical Summary
The traditional domestic cryptographic encryption and decryption methods lack computing power when processing large-scale data, cannot meet high-performance requirements, and lack automatic adaptation mechanisms, resulting in waste of resources and degradation of performance.
By obtaining the historical and real-time data of the processor core, dynamically adjusting the data block size and task allocation, using load balancing algorithms and machine learning prediction models to optimize data allocation, combining OpenMP and GPU acceleration to perform multi-level parallel strategies, optimize password encryption and decryption algorithms and Overall performance, introduce fault tolerance mechanism.
It significantly improves the efficiency and overall performance of password encryption and decryption, avoids processor core overload and resource waste, and achieves higher automation and adjustable performance advantages.
Smart Images

Figure CN119046959A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of encryption and decryption, and in particular to a password encryption and decryption method and system based on a multi-processor architecture. Background Art
[0002] With the rapid development of information technology, cryptographic encryption and decryption technology plays an increasingly important role in protecting information security. As an important part of national security, the performance of domestic cryptographic algorithms is directly related to the security and efficiency of national information. However, traditional cryptographic encryption and decryption methods often face performance bottlenecks due to insufficient computing power when processing large-scale data. Especially in a multi-processor architecture, how to effectively utilize the computing power of each processor core to achieve parallel processing of cryptographic encryption and decryption has become a hot topic in current research.
[0003] Traditional domestic cryptographic encryption and decryption methods mainly rely on a single processor for serial calculations. This method is inefficient when processing large amounts of data and cannot meet high-performance requirements. In addition, due to the lack of an automatic adaptation mechanism, traditional methods are unable to fully utilize the advantages of multi-processor architectures, resulting in resource waste and performance degradation. Therefore, developing a high-performance cryptographic encryption and decryption method based on automatic adaptation of multi-processor architectures is of great significance for improving the overall performance of domestic cryptographic algorithms. Summary of the invention
[0004] In view of the above-mentioned problems, the present invention is proposed.
[0005] Therefore, the technical problem solved by the present invention is: the present invention solves the problem that the traditional method is inefficient when processing large amounts of data and cannot meet the requirements of high performance. In addition, due to the lack of an automatic adaptation mechanism, the traditional method is difficult to fully utilize the advantages of a multi-processor architecture, resulting in a waste of resources and performance degradation.
[0006] In order to solve the above technical problems, the present invention provides the following technical solutions:
[0007] In a first aspect, the present invention provides a cryptographic encryption and decryption method based on a multi-processor architecture, comprising:
[0008] Acquire historical data and real-time data of processor core performance, and use the historical data and real-time data to reallocate data blocks currently stored in the processor core to different processor cores to obtain remaining space of different processor cores;
[0009] Acquire data to be encrypted, divide the data to be encrypted into multiple data blocks, dynamically adjust the size of the data blocks according to the remaining space of the different processor cores, and use a load balancing algorithm to allocate each data block to different processor cores for parallel computing, and tune the parallel computing framework to obtain a first data block set;
[0010] Setting a priority for the first data block set, and dynamically adjusting task allocation according to the priority to obtain a second data block set;
[0011] Perform fine-grained optimization processing on the encryption and decryption algorithm of the second data block set to obtain a high-performance algorithm;
[0012] The overall performance of cryptographic encryption and decryption of the core performance of the processor is optimized, and a fault-tolerant mechanism is introduced to obtain an optimized cryptographic encryption and decryption method for a multi-processor architecture.
[0013] As a preferred solution of the cryptographic encryption and decryption method based on a multi-processor architecture described in the present invention, wherein: using the historical data and real-time data to reallocate the data blocks currently existing in different processor cores to the processor cores comprises:
[0014] Extracting a first feature from historical data and real-time data, using a machine learning algorithm and the first feature to train a prediction model, predicting the core performance of the processor using the prediction model, and obtaining a prediction result;
[0015] Analyze the data blocks existing in different processor cores, assign different priorities to the data blocks, match the prediction results to the processor cores corresponding to the priorities, and if the priorities are the same, compare the response times of the data blocks, and select the one with the shorter response time for priority allocation;
[0016] Real-time data is used to evaluate the performance of the processor core. An adaptive algorithm is used, including setting a temperature threshold. If the temperature threshold is greater than a safety standard, the data block task load of the processor core is reduced. If the reduced task load cannot meet the safety standard, the processor core is reallocated to obtain a processor core after the data blocks existing in different processor cores are allocated.
[0017] As a preferred solution of the cryptographic encryption and decryption method based on a multi-processor architecture described in the present invention, dynamically adjusting the data block size according to the remaining space of the different processor cores includes:
[0018] According to the remaining space and performance of the processor core and the amount of data in the data block, the optimal size of each data block is calculated, which is expressed as:
[0019]
[0020] Among them, max(P i ) is the highest performance indicator among all cores, max(T i ) is the longest processing time among all cores at the current data block size, N is the total number of available cores in the processor, and P i For each core performance indicator, D totalis the total amount of data to be processed, T i The time required to allocate a data block to each core processing;
[0021] As a preferred solution of the cryptographic encryption and decryption method based on a multi-processor architecture described in the present invention, wherein: using a load balancing algorithm to allocate each data block to different processor cores for parallel computing includes:
[0022] The load balancing operation is as follows: create a particle swarm consisting of multiple particles, and randomly initialize the position of each particle (x i ) and speed (v i );
[0023] Calculate the fitness value according to the task allocation scheme of the data block represented by each particle;
[0024] Record the best position found by each particle, and determine the best position among the individual optimal positions of all particles in the entire particle swarm;
[0025] Update the speed and position of each particle according to the individual optimum and the global optimum;
[0026] Repeat the load balancing operation until the maximum number of iterations is met, and take the global optimal position in the iteration process as the data block task allocation scheme.
[0027] As a preferred solution of the cryptographic encryption and decryption method based on a multi-processor architecture described in the present invention, the optimization of the parallel computing framework includes:
[0028] Use OpenMP to parallelize nested loops and constructs to execute independent tasks asynchronously;
[0029] Embed performance monitoring in parallel regions and adaptively adjust parallel strategies and the number of threads based on monitoring results;
[0030] Combine OpenMP and GPU acceleration to implement a multi-level parallel strategy, divide the tasks into CPU parallel tasks and GPU accelerated tasks, and establish a mapping relationship; establish a synchronization and data exchange mechanism between the CPU and GPU, use OpenMP instructions to download data and computing tasks to the GPU, and wait for the GPU tasks to complete.
[0031] As a preferred solution of the cryptographic encryption and decryption method based on a multi-processor architecture described in the present invention, the fine-grained optimization processing of the cryptographic encryption and decryption algorithm of the second data block set includes:
[0032] Use automatic optimization tools to identify performance bottlenecks of encryption and decryption algorithms, and make modifications based on optimization suggestions provided by the automatic optimization tools;
[0033] Secondary identification of the performance bottleneck of the identified encryption and decryption algorithm is performed to obtain the memory access pattern of the performance bottleneck, analyze the data structure of the encryption and decryption algorithm, reduce the size of the data structure, compress the holes in the data structure, and reduce memory fragmentation;
[0034] Putting data with access times greater than a first threshold together, and storing related data in a continuous memory area according to the order in which the data are used;
[0035] The fields in the structure whose access times are greater than the first threshold are placed at the beginning of the structure, and the layout of the data in the memory is arranged according to the life cycle of the data.
[0036] As a preferred solution of the cryptographic encryption and decryption method based on a multi-processor architecture described in the present invention, the overall performance optimization of cryptographic encryption and decryption of the core performance of the processor includes:
[0037] Perform an overall performance evaluation of the cryptographic encryption and decryption of the processor core performance to obtain potential areas for energy efficiency optimization, and dynamically adjust the voltage and frequency according to the processing load.
[0038] When the overall performance does not reach the expected target of the active state, switch to the low-power state; when the overall performance is higher than the expected target, switch the processor from the low-power state back to the active state;
[0039] When optimizing overall performance, introduce a fault-tolerant mechanism, analyze the types of overall performance failures, and identify key components for introducing the fault-tolerant mechanism;
[0040] Use RAID technology to build fault-tolerant storage arrays for key components, divide the same type of disks into the same RAID group, distribute the same RAID group to different racks, and reserve a certain number of hot spare disks in the RAID group. When the working disk fails, the hot spare disk can automatically take over and rebuild the data;
[0041] Utilize the error detection mechanism to trigger the data recovery process when an error is detected.
[0042] In a second aspect, the present invention provides a system for cryptographic encryption and decryption based on a multi-processor architecture, comprising:
[0043] A data acquisition module is used to acquire historical data and real-time data of the performance of the processor core, and to use the historical data and real-time data to reallocate data blocks currently stored in the processor core to different processor cores to obtain remaining space of different processor cores;
[0044] A computing module, used for obtaining data to be encrypted, dividing the data to be encrypted into a plurality of data blocks, dynamically adjusting the size of the data blocks according to the remaining space of the different processor cores, and using a load balancing algorithm to allocate each data block to different processor cores for parallel computing, and optimizing the parallel computing framework to obtain a first data block set;
[0045] An allocation module, used for setting a priority for the first data block set, dynamically adjusting task allocation according to the priority, and obtaining a second data block set;
[0046] A fine-grained optimization processing module, used for performing fine-grained optimization processing on the encryption and decryption algorithm of the second data block set to obtain a high-performance algorithm;
[0047] The performance optimization module is used to optimize the overall performance of cryptographic encryption and decryption of the core performance of the processor, introduce a fault-tolerant mechanism, and obtain an optimized cryptographic encryption and decryption method for a multi-processor architecture.
[0048] In a third aspect, the present invention provides a computing device, comprising:
[0049] Memory and processor;
[0050] The memory is used to store computer-executable instructions, and the processor is used to execute the computer-executable instructions. When the computer-executable instructions are executed by the processor, the steps of the cryptographic encryption and decryption method based on the multi-processor architecture are implemented.
[0051] In a fourth aspect, the present invention provides a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, implement the steps of the cryptographic encryption and decryption method based on a multi-processor architecture.
[0052] The beneficial effects of the present invention are as follows: the cryptographic encryption and decryption method based on a multi-processor architecture proposed in the present invention adopts an advanced load balancing algorithm to ensure that data blocks are more reasonably distributed among different processor cores, avoiding the situation where some cores are overloaded while other cores are idle; setting priorities for data block sets, and dynamically adjusting task allocation according to the priorities, so that key tasks can obtain more computing resources and speed up processing; performing fine-grained optimization processing on the cryptographic encryption and decryption algorithm, improving the execution efficiency of the algorithm, especially the performance when processing large amounts of data; the implementation process has high automation, adjustability and performance advantages, which can greatly improve the encryption and decryption efficiency and overall performance of the cryptographic algorithm. BRIEF DESCRIPTION OF THE DRAWINGS
[0053] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following briefly introduces the drawings required for describing the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative labor. Among them:
[0054] Figure 1 An overall flow chart of a cryptographic encryption and decryption method based on a multi-processor architecture provided by the present invention. DETAILED DESCRIPTION
[0055] In order to make the above-mentioned purposes, features and advantages of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are described in detail below in conjunction with the drawings of the specification. Obviously, the described embodiments are part of the embodiments of the present invention, but not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary persons in the art without creative work should fall within the scope of protection of the present invention.
[0056] In the following description, many specific details are set forth to facilitate a full understanding of the present invention, but the present invention may also be implemented in other ways different from those described herein, and those skilled in the art may make similar generalizations without violating the connotation of the present invention. Therefore, the present invention is not limited to the specific embodiments disclosed below.
[0057] Secondly, the term "one embodiment" or "embodiment" as used herein refers to a specific feature, structure, or characteristic that may be included in at least one implementation of the present invention. The term "in one embodiment" that appears in different places in this specification does not necessarily refer to the same embodiment, nor does it refer to a separate or selective embodiment that is mutually exclusive with other embodiments.
[0058] The present invention is described in detail with reference to schematic diagrams. When describing the embodiments of the present invention, for the sake of convenience, the cross-sectional diagrams showing the device structure will not be partially enlarged according to the general scale, and the schematic diagrams are only examples, which should not limit the scope of protection of the present invention. In addition, in actual production, the three-dimensional dimensions of length, width and depth should be included.
[0059] At the same time, in the description of the present invention, it should be noted that the directions or positional relationships indicated by the terms "upper, lower, inner and outer" are based on the directions or positional relationships shown in the drawings, and are only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific direction, be constructed and operated in a specific direction, and therefore cannot be understood as limiting the present invention. In addition, the terms "first, second or third" are only used for descriptive purposes and cannot be understood as indicating or implying relative importance.
[0060] In the present invention, unless otherwise clearly specified and limited, the terms "install, connect, connect" should be understood in a broad sense, for example: it can be a fixed connection, a detachable connection or an integral connection; it can also be a mechanical connection, an electrical connection or a direct connection, or it can be indirectly connected through an intermediate medium, or it can be the internal communication of two components. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.
[0061] Example 1
[0062] Reference Figure 1 , as an embodiment of the present invention, provides a password encryption and decryption method based on a multi-processor architecture, comprising:
[0063] S100: Acquire historical data and real-time data of processor core performance, and use the historical data and real-time data to reallocate data blocks currently stored in the processor core to different processor cores to obtain remaining space of different processor cores;
[0064] In the embodiment of the present application, a first feature is extracted from historical data and real-time data, a prediction model is trained using a machine learning algorithm and the first feature, and the processor core performance is predicted using the prediction model to obtain a prediction result;
[0065] Analyze the data blocks existing in different processor cores, assign different priorities to the data blocks, match the prediction results to the processor cores corresponding to the priorities, and if the priorities are the same, compare the response times of the data blocks, and select the one with the shorter response time for priority allocation;
[0066] Real-time data is used to evaluate the performance of the processor core. An adaptive algorithm is used, including setting a temperature threshold. If the temperature threshold is greater than a safety standard, the data block task load of the processor core is reduced. If the reduced task load cannot meet the safety standard, the processor core is reallocated to obtain a processor core after the data blocks existing in different processor cores are allocated.
[0067] Specifically, historical and real-time data of processor core performance are obtained, including CPU usage, memory usage, task completion time, processor temperature, etc., features are selected from historical and real-time data, including CPU usage, memory usage, I / O operations, etc., and regression analysis, neural networks or other machine learning algorithms and selected features are used to train prediction models. Real-time data is used to evaluate the accuracy of the prediction models, check whether the models can accurately predict processor load and task completion time, compare the prediction results with the actual results, identify deviations and errors in the model predictions, and problems in the scheduling strategy; the prediction model is run regularly to predict future load conditions, and based on the prediction results, the scheduling algorithm will decide how to allocate tasks to each core processor and appreciation to achieve optimal load balance, and feedback and adjustments are made according to actual conditions to continuously optimize the prediction model and scheduling strategy;
[0068] Monitor the temperature, frequency, voltage and other hardware status parameters of the processor core in real time, evaluate the processor core performance based on the monitoring data, identify performance bottlenecks or overheating risks, and set the temperature threshold according to the hardware specifications and safe operation standards. When the temperature of the processor core approaches or exceeds the temperature threshold, the task core is in an overheated state. When a core is detected to be close to overheating, reduce the core tasks to reduce the load and heat generation; when selecting other cores for allocation, consider the following situations: select the core with lower current load to ensure overall load balance; select the core with better performance to ensure that the task can be completed efficiently; avoid assigning tasks to the core that is close to overheating or is overheating; consider the long-term operation status and health of the core to avoid assigning too many tasks to the core that may fail.
[0069] Implement multi-layer resource management, including operating system level and application level, in order to better coordinate and utilize system resources, and establish a coordination mechanism between the operating system and applications, including: the operating system provides a set of standardized application programming interfaces for applications to call to request resources or receive information related to resource management; both the operating system and applications need to implement a set of resource management policies, which define how to request, allocate, monitor and release resources; clarify how to exchange information between applications and the operating system, including resource requests, status reports, performance feedback, etc.; the operating system and applications can use signals, events or callback mechanisms to synchronize operations and respond to events related to resource management; the operating system monitors resource usage and feeds back relevant information to applications, and applications adjust their behavior based on this information; the operating system can set resource usage quotas for applications to prevent any single application from consuming too many resources; the operating system contains one or more coordination services, which serve as a bridge between the operating system and applications and are responsible for coordinating and managing resource requests and allocations; regularly check whether the resource management policies of the operating system and applications are consistent to ensure that no conflicts or inconsistencies occur; define an exception handling mechanism, so that when there is a resource conflict or insufficient resources, the coordination mechanism can take appropriate measures, such as resource reallocation or task priority adjustment.
[0070] It should be noted that dynamically adjusting the task allocation strategy based on the real-time processor core performance and temperature and other hardware conditions is a more proactive optimization process that aims to optimize task allocation based on the real-time status of the hardware and long-term performance trends. This process involves continuous evaluation and prediction of the performance characteristics of the processor core, and adjusting the long-term strategy of task allocation based on the evaluation results; using intelligent scheduling algorithms, adaptive task allocation, and multi-level resource management, it can ensure that the cryptographic encryption and decryption methods based on the multi-processor architecture achieve higher efficiency and intelligence in resource management and task scheduling, thereby improving the overall system performance and stability.
[0071] S200: Obtain data to be encrypted, divide the data to be encrypted into multiple data blocks, dynamically adjust the size of the data blocks according to the remaining space of different processor cores, and use a load balancing algorithm to allocate each data block to different processor cores for parallel computing, and optimize the parallel computing framework to obtain a first data block set;
[0072] In the embodiment of the present application, the optimal size of each data block is calculated according to the remaining space and performance of the processor core and the amount of data in the data block, which is expressed as:
[0073]
[0074] Among them, max(P i) is the highest performance indicator among all cores, max(T i ) is the longest processing time among all cores at the current data block size, N is the total number of available cores in the processor, and P i For each core performance indicator, D total is the total amount of data to be processed, T i The time required to allocate a data block to each core processing;
[0075] Specifically, the performance of each processor core is evaluated, including parameters such as processing speed and memory bandwidth. The data to be processed is analyzed, the total data volume is estimated, and the processing time is predicted based on the data characteristics. Based on the number and performance of processor cores and the estimated data volume, the optimal size of each data block is dynamically calculated. The goal is to make the processing time of each core as close as possible, that is, T1≈T2≈…≈T N , thereby preventing some cores from completing tasks too early and waiting idle; during the data processing process, monitor the load of each core, and make adjustments immediately if the data block size is unevenly distributed or the core load is too high; compare the actual processing results with the predicted results, adjust the calculation model of the data block size according to the differences, and continuously optimize the dynamic adjustment strategy.
[0076] In the embodiment of the present application, the load balancing operation is as follows: creating a particle swarm consisting of multiple particles, randomly initializing the position (x i ) and speed (v i );
[0077] Calculate the fitness value according to the task allocation scheme of the data block represented by each particle;
[0078] Record the best position found by each particle, and determine the best position among the individual optimal positions of all particles in the entire particle swarm;
[0079] Update the speed and position of each particle according to the individual optimum and the global optimum;
[0080] Repeat the load balancing operation until the maximum number of iterations is met, and take the global optimal position in the iteration process as the data block task allocation scheme.
[0081] Specifically, the load balancing algorithm can be a genetic algorithm or a particle swarm optimization algorithm. The present invention preferably uses a particle swarm optimization algorithm, and the speed and position of each particle are updated according to the individual optimum and the global optimum, which is expressed as:
[0082] v i (t+1)=w·v i (t)+c1·r1·(pBest i -x i(t))+c2·r2·(gBest-x i (t))x i (t+1)
[0083] =x i (t)+v i (t+1)
[0084] Among them, ww is the inertia weight, c1 and c2 are cognitive and social acceleration coefficients, r1 and r2 are random numbers in the interval [0,1], and pBest i is the personal best position of particle i, gBest is the global best position of the entire particle swarm, and v i (t) is the velocity of particle i at time t, x i (t) is the position of particle i at time t, x i (t+1) is the new position of particle i at time t+1;
[0085] The global optimal position found in the iterative process is used as the final task allocation scheme, which is applied to actual data processing. Tasks are assigned to each processor core. The task allocation performance in actual applications is monitored and evaluated, including processing time and resource utilization. If the performance evaluation results are not ideal, the parameters of the particle swarm optimization algorithm are adjusted, the algorithm is re-executed, and the iterative optimization is continued.
[0086] It should be noted that the particle swarm optimization algorithm can help automate and optimize task allocation and improve load balancing and overall performance in multi-processor systems.
[0087] In the embodiment of the present application, OpenMP is used to parallelize nested loops and construct them to asynchronously execute independent tasks;
[0088] Embed performance monitoring in parallel regions and adaptively adjust parallel strategies and the number of threads based on monitoring results;
[0089] Combine OpenMP and GPU acceleration to implement a multi-level parallel strategy, divide the tasks into CPU parallel tasks and GPU accelerated tasks, and establish a mapping relationship; establish a synchronization and data exchange mechanism between the CPU and GPU, use OpenMP instructions to download data and computing tasks to the GPU, and wait for the GPU tasks to complete.
[0090] Specifically, the parallel computing framework may be OpenMP 5.0 or MPI 3.0. The present invention preferably uses OpenMP 5.0 to optimize the parallel computing framework. According to the selected OpenMP 5.0 parallel computing framework, the existing encryption and decryption code is reconstructed, and the parallel processing of data is realized by using the parallel instructions and API provided by the framework. The tuning guide of OpenMP, a performance analysis tool provided by the framework, is used to tune the parallel code to ensure the efficiency of parallel computing. The first data block set is a data block of multiple data blocks allocated to the processor core;
[0091] It should be noted that OpenMP 5.0 allows for more sophisticated resource management, including thread creation and destruction, as well as dynamic adjustment of the number of threads, making resource use more efficient. OpenMP 5.0 is optimized for multi-core processors, making better use of the multi-core characteristics of modern processors and improving the performance of parallel computing. By adjusting the data block size, load balancing algorithm, and parallel computing framework optimization, the efficiency and performance of data block parallel processing can be significantly improved, achieving faster and more efficient cryptographic encryption and decryption operations.
[0092] S300: setting a priority for the first data block set, and dynamically adjusting task allocation according to the priority to obtain a second data block set;
[0093] Specifically, the performance data of the processor cores is monitored in real time, and the performance data is analyzed in real time to identify which cores are experiencing high loads and which cores are idle or underloaded. Based on the results of the performance analysis, the scheduling system makes decisions quickly and adjusts task allocation, such as reallocating tasks to reduce the burden on high-load cores or adding tasks to low-load cores.
[0094] Combine historical data and current trends to predict future task loads. Based on the prediction results, formulate task scheduling strategies to pre-allocate resources to cope with expected load peaks or optimize resource allocation to cope with load decreases. Perform task pre-allocation in advance before predicting high-load periods to ensure that critical and time-sensitive tasks can be processed in a timely manner.
[0095] Introduce a task priority management mechanism to define the priority of each task in the system, which is usually set according to the urgency, importance and impact of the task on the system response time; classify tasks into different priority categories, such as high-priority tasks, ordinary tasks and low-priority tasks; determine resource allocation strategies to ensure that high-priority tasks can obtain processor resources first, while low-priority tasks are processed when resources are sufficient. The second data block set is the reallocated data blocks.
[0096] It should be noted that the intelligence level of task scheduling in multi-processor systems can be significantly improved, achieving more efficient, reliable and timely resource management and task processing, which will help improve the overall performance of the system, reduce waiting time, and ensure that critical tasks are given priority.
[0097] It should also be noted that timely task reallocation to processor cores after tasks have already started is a more reactive optimization process, the main purpose of which is to ensure the immediate responsiveness and load balance of the system. This process includes monitoring the current task execution and making rapid adjustments when load imbalance or other performance issues are found. Adaptive task allocation focuses more on long-term optimization based on hardware status and performance trends, while dynamic task adjustment focuses on short-term adjustments based on real-time monitoring data. The two complement each other and jointly ensure that the system can maintain optimal performance and resource utilization at different times and under different workloads. Therefore, although both involve the adjustment of task allocation, they have obvious differences in implementation process and goals and do not constitute duplication.
[0098] S400: performing fine-grained optimization processing on the encryption and decryption algorithm of the second data block set to obtain a high-performance algorithm;
[0099] In the embodiment of the present application, an automatic optimization tool is used to identify the performance bottleneck of the password encryption and decryption algorithm, and modifications are made according to the optimization suggestions provided by the automatic optimization tool;
[0100] Secondary identification of the performance bottleneck of the identified encryption and decryption algorithm is performed to obtain the memory access pattern of the performance bottleneck, analyze the data structure of the encryption and decryption algorithm, reduce the size of the data structure, compress the holes in the data structure, and reduce memory fragmentation;
[0101] Putting data with access times greater than a first threshold together, and storing related data in a continuous memory area according to the order in which the data are used;
[0102] The fields in the structure whose access times are greater than the first threshold are placed at the beginning of the structure, and the layout of the data in the memory is arranged according to the life cycle of the data.
[0103] Specifically, select an automatic code optimization tool, such as Intel VTune Amplifier, and configure it according to project requirements; use the optimization tool to conduct a comprehensive performance analysis of the cryptographic encryption and decryption algorithm to identify performance bottlenecks, such as CPU cache misses, branch prediction errors, instruction pipeline conflicts, etc.; make necessary modifications and adjustments to the cryptographic encryption and decryption algorithm based on the analysis results and optimization suggestions provided by the tool.
[0104] Analyze the memory access patterns in the cryptographic encryption and decryption algorithms, identify the memory access patterns that lead to performance bottlenecks, such as random access, large-scale memory copying, etc., and improve the cache hit rate by reducing the size of the data structure or reorganizing the data layout. The first threshold is set as an empirical value and can be adjusted based on actual performance to determine which data items or fields have a significantly higher access frequency than other items to set the first threshold.
[0105] It should be noted that optimization can significantly improve the performance of cryptographic encryption and decryption algorithms, reduce memory access latency, and design more efficient parallel algorithms, thereby improving overall system performance and processing efficiency.
[0106] S500: Optimize the overall performance of cryptographic encryption and decryption of the core performance of the processor, introduce a fault-tolerant mechanism, and obtain an optimized cryptographic encryption and decryption method for a multi-processor architecture;
[0107] In the embodiment of the present application, the overall performance of the cryptographic encryption and decryption of the core performance of the processor is evaluated to obtain the potential area for energy efficiency optimization, and the voltage and frequency are dynamically adjusted according to the processing load.
[0108] When the overall performance does not reach the expected target of the active state, switch to the low-power state; when the overall performance is higher than the expected target, switch the processor from the low-power state back to the active state;
[0109] When optimizing overall performance, introduce a fault-tolerant mechanism, analyze the types of overall performance failures, and identify key components for introducing the fault-tolerant mechanism;
[0110] Use RAID technology to build fault-tolerant storage arrays for key components, divide the same type of disks into the same RAID group, distribute the same RAID group to different racks, and reserve a certain number of hot spare disks in the RAID group. When the working disk fails, the hot spare disk can automatically take over and rebuild the data;
[0111] Utilize the error detection mechanism to trigger the data recovery process when an error is detected.
[0112] Specifically, the current energy consumption and performance of the system are evaluated, potential areas for energy efficiency optimization are identified, and dynamic voltage and frequency adjustment technology is implemented to dynamically adjust the CPU frequency and voltage according to the processor load to reduce energy consumption. The frequency and voltage are reduced when the load is low, while sufficient performance is provided when the load is high. Based on the performance monitoring results, the energy efficiency strategy is continuously iterated and optimized to achieve the best balance between energy consumption and performance.
[0113] Introduce a fault-tolerant mechanism, analyze the types of failures and fault-tolerant requirements encountered by the system, determine the key components and services that need to introduce a fault-tolerant mechanism, design redundancy for the key components and services, and the method of designing redundancy can be through mirroring or backup, or it can be fault-tolerant storage. The present invention prefers fault-tolerant storage and uses RAID technology to build a fault-tolerant storage array. When a single disk fails, data can be automatically rebuilt to ensure service continuity; implement error detection mechanisms, such as parity checks, CRC checks, etc., and corresponding error recovery strategies, such as automatic restart, data recovery, etc., verify the effectiveness of the fault-tolerant mechanism through fault simulation and stress testing, and ensure that the system can run stably in the face of actual failures.
[0114] Through user surveys and feedback collection, we can understand the pain points and needs of users in the process of using encryption and decryption task management, optimize the interaction process between users and the system, reduce user operation steps, and provide clear guidance and feedback.
[0115] It should be noted that the fault-tolerant storage system uses mechanisms such as data replication and checksums to ensure that the stored data remains accurate even in the event of hardware failure. Through built-in fault detection and recovery mechanisms, the fault-tolerant storage system can respond quickly when problems arise, reducing the risk of system crashes. The fault-tolerant storage system can continue to operate in the event of hardware or software failures, thereby improving the reliability of the overall system.
[0116] Optimizing the overall system performance significantly improves the system's energy efficiency, enhances the system's reliability and fault tolerance, and provides a more user-friendly interactive experience, thereby improving user satisfaction and the overall performance of the system, improving the performance of cryptographic encryption and decryption methods based on a multi-processor architecture, and achieving more efficient, stable, and reliable data processing capabilities. These optimizations can not only improve the system's performance, but also enhance the user experience and improve the system's practicality and market competitiveness.
[0117] The above is a schematic scheme of a password encryption and decryption method based on a multi-processor architecture in this embodiment. It should be noted that the technical scheme of the password encryption and decryption device based on a multi-processor architecture and the technical scheme of the password encryption and decryption method based on a multi-processor architecture belong to the same concept, and the details of the technical scheme of the password encryption and decryption device based on a multi-processor architecture in this embodiment that are not described in detail can all be referred to the description of the technical scheme of the password encryption and decryption method based on a multi-processor architecture.
[0118] The password encryption and decryption device based on the multi-processor architecture in this embodiment includes:
[0119] A data acquisition module is used to acquire historical data and real-time data of the performance of the processor core, and to use the historical data and real-time data to reallocate data blocks currently stored in the processor core to different processor cores to obtain remaining space of different processor cores;
[0120] A computing module, used for obtaining data to be encrypted, dividing the data to be encrypted into a plurality of data blocks, dynamically adjusting the size of the data blocks according to the remaining space of the different processor cores, and using a load balancing algorithm to allocate each data block to different processor cores for parallel computing, and optimizing the parallel computing framework to obtain a first data block set;
[0121] An allocation module, used for setting a priority for the first data block set, dynamically adjusting task allocation according to the priority, and obtaining a second data block set;
[0122] A fine-grained optimization processing module, used for performing fine-grained optimization processing on the encryption and decryption algorithm of the second data block set to obtain a high-performance algorithm;
[0123] The performance optimization module is used to optimize the overall performance of cryptographic encryption and decryption of the core performance of the processor, introduce a fault-tolerant mechanism, and obtain an optimized cryptographic encryption and decryption method for a multi-processor architecture.
[0124] This embodiment also provides a computing device, which is applicable to cryptographic encryption and decryption based on a multi-processor architecture, including:
[0125] Memory and processor; the memory is used to store computer executable instructions, and the processor is used to execute computer executable instructions to implement the cryptographic encryption and decryption method based on a multi-processor architecture as proposed in the above embodiment.
[0126] This embodiment also provides a storage medium on which a computer program is stored. When the program is executed by a processor, the cryptographic encryption and decryption method based on a multi-processor architecture as proposed in the above embodiment is implemented.
[0127] The storage medium proposed in this embodiment and the method for implementing cryptographic encryption and decryption based on a multi-processor architecture proposed in the above embodiment belong to the same inventive concept. The technical details not fully described in this embodiment can be found in the above embodiment, and this embodiment has the same beneficial effects as the above embodiment.
[0128] Through the above description of the implementation methods, the technicians in the relevant field can clearly understand that the present invention can be implemented by means of software and necessary general hardware, and of course can also be implemented by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as a computer floppy disk, read-only memory (ReadOnly, Memory, ROM), random access memory (RandomAccess Memory, RAM), flash memory (FLASH), hard disk or optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, server, or network device, etc.) to perform the methods of various embodiments of the present invention.
[0129] Example 2
[0130] Referring to Table 1, an embodiment of the present invention provides a password encryption and decryption method based on a multi-processor architecture to verify and illustrate the technical effects used in the method.
[0131] The server cluster of the present invention is as follows: processor: model: Intel Xeon Platinum 8280 (assumption); number of cores: 28 cores per CPU; number of threads: 56 threads per CPU; basic frequency: 2.7GHz; maximum turbo frequency: 4.0GHz; memory: capacity: 512GB DDR4; speed: 3200MHz; storage: type: SSD RAID array; capacity: 10TB; read and write speed: read up to 3500MB / s, write up to 2500MB / s; network: interface: 10Gigabit Ethernet; bandwidth: up to 10Gbps; cooling system: type: liquid cooling or air cooling; capacity: sufficient to maintain stable operation of the server under high load; power supply: power: 2000W; efficiency: at least 80%;
[0132] The single processor server of the traditional method includes: Processor: Model: Intel Xeon E-2288G (assumption); Number of cores: 8 cores; Number of threads: 16 threads; Base frequency: 3.7GHz; Maximum turbo frequency: 4.8GHz; Memory: Capacity: 64GB DDR4; Speed: 2666MHz; Storage: Type: SSD; Capacity: 1TB; Read and write speed: Read up to 2500MB / s, write up to 1500MB / s; Network: Interface: 1Gigabit Ethernet; Bandwidth: Up to 1Gbps; Cooling system: Type: Air cooling; Capacity: Sufficient to maintain stable operation of the server under normal load Power supply: Power: 750W; Efficiency: At least 80%;
[0133] Other equipment:
[0134] Data generator, type: software or hardware; function: generate datasets of fixed pattern and size
[0135] Performance monitoring software, Type: Software; Function: Real-time monitoring of processor performance indicators
[0136] Encryption and decryption software, type: software; function: perform encryption and decryption operations of cryptographic algorithms
[0137] Data recording and analysis tool, Type: Software; Function: Collect experimental data, perform data analysis and visualization
[0138] Experimental process:
[0139] Preparation phase: Install and configure server clusters and single-processor servers; install performance monitoring software and encryption and decryption software; generate fixed-size data sets to ensure data consistency for each experiment.
[0140] Compare key performance indicators such as encryption and decryption speed, resource utilization, energy consumption, and error rate.
[0141] The method of the present invention is implemented on a multi-processor server to record encryption and decryption time and resource usage.
[0142] Implementing traditional encryption and decryption methods on a single processor server records the same metrics.
[0143] Use performance monitoring software to collect all key performance data during the experiment.
[0144] In order to ensure the reliability of the results, the experiment was repeated several times and the average value was taken. The experimental results are shown in Table 1.
[0145] Table 1 Experimental results
[0146] index Method of the present invention Traditional methods Percentage increase Encryption and decryption speed (GB / s) 10 3 233% CPU usage (%) 70 95 -25% Memory usage (GB) 4 6 -33% Energy consumption (W) 150 200 -25% Error rate (%) 0.01 0.05 80%
[0147] As can be seen from the above table, the encryption and decryption speed of the method of the present invention is 10GB / s, while the traditional method is only 3GB / s. The encryption and decryption speed of the method of the present invention is increased by 233%. Compared with the traditional method, the method of the present invention can greatly improve the throughput and efficiency of encryption and decryption.
[0148] The CPU utilization rate of the method of the present invention is 70%, while that of the traditional method is as high as 95%. Compared with the traditional method, the CPU utilization rate of the method of the present invention is reduced by 25%. This means that the method of the present invention can more efficiently utilize CPU resources and reduce CPU load.
[0149] The memory usage of the method of the present invention is 4GB, while that of the traditional method is 6GB. Compared with the traditional method, the memory usage of the method of the present invention is reduced by 33%. This means that the method of the present invention can manage and utilize memory resources more efficiently.
[0150] The energy consumption of the method of the present invention is 150W, while the traditional method is 200W. Compared with the traditional method, the energy consumption of the method of the present invention is reduced by 25%. This means that the use of the method of the present invention can greatly reduce the energy consumption of the system and improve the energy utilization efficiency.
[0151] The error rate of the method of the present invention is 0.01%, while that of the traditional method is 0.05%. Compared with the traditional method, the error rate of the method of the present invention is reduced by 80%. This means that the accuracy and reliability of data processing can be greatly improved by using the method of the present invention.
[0152] The comparison of these performance indicators shows that the method of the present invention is significantly superior to traditional methods in terms of encryption and decryption speed, CPU utilization, memory usage, energy consumption and error rate, reflecting a significant performance improvement.
[0153] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit the present invention. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solutions of the present invention may be modified or replaced by equivalents without departing from the spirit and scope of the technical solutions of the present invention, which should all be included in the scope of the claims of the present invention.
Claims
1. A password encryption and decryption method based on a multi-processor architecture, characterized in that: include: Acquire historical data and real-time data of processor core performance, and use the historical data and real-time data to reallocate data blocks currently stored in the processor core to different processor cores to obtain remaining space of different processor cores; Acquire data to be encrypted, divide the data to be encrypted into multiple data blocks, dynamically adjust the size of the data blocks according to the remaining space of the different processor cores, and use a load balancing algorithm to allocate each data block to different processor cores for parallel computing, and tune the parallel computing framework to obtain a first data block set; Setting a priority for the first data block set, and dynamically adjusting task allocation according to the priority to obtain a second data block set; Perform fine-grained optimization processing on the encryption and decryption algorithm of the second data block set to obtain a high-performance algorithm; The overall performance of cryptographic encryption and decryption of the core performance of the processor is optimized, and a fault-tolerant mechanism is introduced to obtain an optimized cryptographic encryption and decryption method for a multi-processor architecture.
2. The cryptographic encryption and decryption method based on a multi-processor architecture as claimed in claim 1, characterized in that: Using the historical data and real-time data to reallocate the processor cores to the data blocks currently stored in different processor cores includes: Extracting a first feature from historical data and real-time data, using a machine learning algorithm and the first feature to train a prediction model, predicting the core performance of the processor using the prediction model, and obtaining a prediction result; Analyze the data blocks existing in different processor cores, assign different priorities to the data blocks, match the prediction results to the processor cores corresponding to the priorities, and if the priorities are the same, compare the response times of the data blocks, and select the one with the shorter response time for priority allocation; Real-time data is used to evaluate the performance of the processor core. An adaptive algorithm is used, including setting a temperature threshold. If the temperature threshold is greater than a safety standard, the data block task load of the processor core is reduced. If the reduced task load cannot meet the safety standard, the processor core is reallocated to obtain a processor core after the data blocks existing in different processor cores are allocated.
3. The cryptographic encryption and decryption method based on a multi-processor architecture as claimed in claim 2, characterized in that: Dynamically adjusting the data block size according to the remaining space of different processor cores includes: According to the remaining space and performance of the processor core and the amount of data in the data block, the optimal size of each data block is calculated, which is expressed as: Among them, max(P i ) is the highest performance indicator among all cores, max(T i ) is the longest processing time among all cores at the current data block size, N is the total number of available cores in the processor, and P i For each core performance indicator, D total is the total amount of data to be processed, T i The time required to allocate a chunk of data to each core for processing.
4. The cryptographic encryption and decryption method based on a multi-processor architecture as claimed in claim 3, characterized in that: Using a load balancing algorithm to assign each data block to different processor cores for parallel computing includes: The load balancing operation is as follows: create a particle swarm consisting of multiple particles, and randomly initialize the position of each particle (x i ) and speed (v i ); Calculate the fitness value according to the task allocation scheme of the data block represented by each particle; Record the best position found by each particle, and determine the best position among the individual optimal positions of all particles in the entire particle swarm; Update the speed and position of each particle according to the individual optimum and the global optimum; Repeat the load balancing operation until the maximum number of iterations is met, and take the global optimal position in the iteration process as the data block task allocation scheme.
5. The cryptographic encryption and decryption method based on a multi-processor architecture as claimed in claim 4, characterized in that: Tuning the parallel computing framework includes: Use OpenMP to parallelize nested loops and constructs to execute independent tasks asynchronously; Embed performance monitoring in parallel regions and adaptively adjust parallel strategies and the number of threads based on monitoring results; Combine OpenMP and GPU acceleration to implement a multi-level parallel strategy, divide the tasks into CPU parallel tasks and GPU accelerated tasks, and establish a mapping relationship; establish a synchronization and data exchange mechanism between the CPU and GPU, use OpenMP instructions to download data and computing tasks to the GPU, and wait for the GPU tasks to complete.
6. The cryptographic encryption and decryption method based on a multi-processor architecture as claimed in any one of claims 2 to 5, characterized in that: The fine-grained optimization processing of the encryption and decryption algorithm of the second data block set includes: Use automatic optimization tools to identify performance bottlenecks of encryption and decryption algorithms, and make modifications based on optimization suggestions provided by the automatic optimization tools; Secondary identification of the performance bottleneck of the identified encryption and decryption algorithm is performed to obtain the memory access pattern of the performance bottleneck, analyze the data structure of the encryption and decryption algorithm, reduce the size of the data structure, compress the holes in the data structure, and reduce memory fragmentation; Putting data with access times greater than a first threshold together, and storing related data in a continuous memory area according to the order in which the data are used; The fields in the structure whose access times are greater than the first threshold are placed at the beginning of the structure, and the layout of the data in the memory is arranged according to the life cycle of the data.
7. The cryptographic encryption and decryption method based on a multi-processor architecture as claimed in claim 6, characterized in that: The overall performance optimization of cryptographic encryption and decryption of the processor core performance includes: Perform an overall performance evaluation of the cryptographic encryption and decryption of the processor core performance to obtain potential areas for energy efficiency optimization, and dynamically adjust the voltage and frequency according to the processing load. When the overall performance does not reach the expected target of the active state, switch to the low-power state; when the overall performance is higher than the expected target, switch the processor from the low-power state back to the active state; When optimizing overall performance, introduce a fault-tolerant mechanism, analyze the types of overall performance failures, and identify key components for introducing the fault-tolerant mechanism; Use RAID technology to build fault-tolerant storage arrays for key components, divide the same type of disks into the same RAID group, distribute the same RAID group to different racks, and reserve a certain number of hot spare disks in the RAID group. When the working disk fails, the hot spare disk can automatically take over and rebuild the data; Utilize the error detection mechanism to trigger the data recovery process when an error is detected.
8. A system for a cryptographic encryption and decryption method based on a multi-processor architecture, characterized in that: include: A data acquisition module is used to acquire historical data and real-time data of the performance of the processor core, and to use the historical data and real-time data to reallocate data blocks currently stored in the processor core to different processor cores to obtain remaining space of different processor cores; A computing module, used for obtaining data to be encrypted, dividing the data to be encrypted into a plurality of data blocks, dynamically adjusting the size of the data blocks according to the remaining space of the different processor cores, and using a load balancing algorithm to allocate each data block to different processor cores for parallel computing, and optimizing the parallel computing framework to obtain a first data block set; An allocation module, used for setting a priority for the first data block set, dynamically adjusting task allocation according to the priority, and obtaining a second data block set; A fine-grained optimization processing module, used for performing fine-grained optimization processing on the encryption and decryption algorithm of the second data block set to obtain a high-performance algorithm; The performance optimization module is used to optimize the overall performance of cryptographic encryption and decryption of the core performance of the processor, introduce a fault-tolerant mechanism, and obtain an optimized cryptographic encryption and decryption method for a multi-processor architecture.
9. An electronic device, characterized in that: The device comprises: processor; a memory for storing processor-executable instructions; The processor is configured to call the instructions stored in the memory to execute the method according to any one of claims 1 to 7.
10. A computer-readable storage medium having computer program instructions stored thereon, characterized in that: When the computer program instructions are executed by a processor, the method according to any one of claims 1 to 7 is implemented.
Citation Information
Cited By
Road condition analysis system and method based on multi-source data fusion
CN120086537A
