Parallel cryptographic calculation strategy optimization method for numerical control system
By optimizing the parallel cryptographic calculation strategy through an improved genetic algorithm, the communication and synchronization overhead and load balancing problems in parallel encryption technology in CNC systems are solved, the encryption and decryption efficiency and system stability are improved, and more efficient resource utilization is achieved.
Patent Information
- Application Number
- CN202410650170.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-24
- Publication Date
- 2024-09-10
AI Technical Summary
In CNC systems, existing parallel encryption technology has communication and synchronization overhead and load balancing problems, which affects the efficiency of encryption and decryption tasks and system stability.
An improved genetic algorithm is used to optimize the data distribution plan under the constraints of the parallel cryptographic computing strategy. Through the load balancing penalty function and the communication cost penalty function, a reasonable parallel cryptographic computing strategy is designed to ensure efficient distribution of tasks among multiple computing units. and sync.
It significantly improves password calculation efficiency and system stability, reduces the risk of crash due to calculation overload, makes full use of computing resources, and improves resource utilization.
Smart Images

Figure CN118631431A
Abstract
Description
Technical Field
[0001] The invention relates to a parallel cryptographic calculation strategy optimization method for a numerical control system, and belongs to the field of industrial control network communication security. Background Art
[0002] CNC system, short for digital control system, is the core component of the manufacturing industry in the digital age. It achieves precise control of machine tool movement through mathematical models and control algorithms, thereby achieving high-precision and high-efficiency processing operations. CNC system not only provides production equipment for the equipment manufacturing industry, but also is the cornerstone of all manufacturing industries. Its technological development level is directly related to the industrial development level and comprehensive competitiveness of the country's manufacturing industry.
[0003] In the current information age, with the continuous advancement of information technology, network security issues have become increasingly prominent. As the core basic equipment of key manufacturing industries, the information security of CNC systems is particularly important. Cryptography technology, as a technology that uses specific transformation methods to encrypt and protect information and perform security authentication, provides a strong guarantee for the security of CNC systems. Specifically, the importance of using cryptography technology in CNC systems is reflected in the following aspects:
[0004] Ensure data security: Cryptography technology can effectively protect the data in the CNC system from being illegally obtained or tampered with. In the CNC system, a large amount of control programs, process parameters and production data are stored. Once this information is leaked or destroyed, it may lead to production interruption, quality degradation and even safety accidents. Through the application of cryptography technology, the security of data during transmission and storage can be ensured to prevent unauthorized access and tampering.
[0005] Improve system reliability: Cryptography technology can also enhance the reliability and stability of the CNC system. Through identity authentication and access control mechanisms, only authorized personnel can access and operate the CNC system, preventing damage to the system caused by misoperation or malicious attacks. At the same time, cryptography technology can also be used to implement system security audits and log records, helping administrators to promptly discover and respond to potential security risks.
[0006] Promote industrial upgrading: With the rapid development of the industrial Internet, CNC systems are gradually being deeply integrated with cloud computing, big data and other technologies. The application of cryptographic technology will help promote the intelligent and networked upgrading of CNC systems and enhance the overall competitiveness of the manufacturing industry.
[0007] In summary, the importance of using cryptographic technology in CNC systems is self-evident. Under the current network security situation, strengthening the application of cryptographic technology in CNC systems is an inevitable choice to ensure the safety of the manufacturing industry and promote industrial upgrading.
[0008] However, in CNC systems, processing large amounts of data and control information requires efficient computing power. Through parallel processing, parallel encryption calculations can significantly improve the speed and efficiency of encryption algorithms. Encrypted data can be divided into multiple data blocks and executed simultaneously on multiple computing units, thereby greatly shortening the encryption and decryption time and improving the real-time and response speed of the system. However, in the process of data encryption and decryption in CNC systems, not only the computing power of the computing units should be considered, but also the communication costs between the CNC system and different computing units. Both have a huge impact on the time it takes to complete the data encryption and decryption tasks in the CNC system. Current technology often only considers that although the existing parallel encryption technology has improved the speed and efficiency of the encryption process to a certain extent, it still has some shortcomings:
[0009] 1. Communication and synchronization overhead: In parallel encryption technology, data needs to be cut, distributed, and synchronized among multiple computing resources. This increases communication overhead and may lead to performance bottlenecks. Especially in big data and complex encryption tasks, communication and synchronization issues may be more prominent.
[0010] 2. Load balancing problem: Parallel encryption technology requires that tasks be evenly distributed to various computing resources to achieve efficient parallel processing. However, due to factors such as performance differences in computing resources, different task complexities, and network latency, achieving load balancing is a challenge.
[0011] Therefore, it is particularly important to design a reasonable and efficient parallel cryptographic computing strategy optimization method for CNC systems based on comprehensive consideration of communication and synchronization overhead and load balancing issues, which has good practical significance and good application prospects. Summary of the invention
[0012] In view of the above-mentioned technical deficiencies, the purpose of the present invention is to provide a parallel cryptographic computing strategy optimization method for CNC systems, establish a parallel cryptographic computing benefit model for CNC systems; define the total benefit, and establish the constraints of parallel cryptographic computing; through an improved genetic algorithm, under the constraints of the parallel cryptographic computing strategy, achieve more reasonable and efficient parallel cryptographic computing of CNC systems.
[0013] The technical solution adopted by the present invention to achieve the above-mentioned purpose is:
[0014] A parallel cryptographic computing strategy optimization method for a numerical control system comprises the following steps:
[0015] Establish a parallel cryptographic computing strategy profit model for CNC systems;
[0016] According to the parallel cryptographic computing strategy model of the numerical control system, the optimization target of the parallel cryptographic computing strategy of the numerical control system is determined, and the constraint conditions of the parallel cryptographic computing strategy of the numerical control system are established;
[0017] Under the constraint conditions of the parallel cryptographic computing strategy of the numerical control system, the improved genetic algorithm is used to optimize the parallel cryptographic computing strategy of the numerical control system, and the optimized parallel cryptographic computing strategy that meets the optimization target of the parallel cryptographic computing strategy is used as the final parallel cryptographic computing strategy of the numerical control system;
[0018] The parallel cryptographic calculation of the numerical control system is implemented according to the optimized parallel cryptographic calculation strategy.
[0019] The parallel cryptographic calculation strategy profit model of the numerical control system is specifically:
[0020]
[0021] Among them, S is the parallel cryptographic calculation strategy benefit of the CNC system, and the task time is T total ,The load balancing penalty function is C1, and the communication cost penalty function is C2. ,α represents the load balancing penalty weight, and β represents the communication cost penalty weight;
[0022] The task takes time T total Specifically, assume that a piece of data can be divided into n data blocks, with a total of m computing units. For each data block i, 1≤i≤n, when it is assigned to computing unit j, 1≤j≤m, the communication time is T comm (i,j), the cryptographic operation time is T enc (i,j), then:
[0023]
[0024] The load balancing penalty function C1 is specifically: for each allocation scheme, assuming that the load of computing unit i is L i , the average load of all computing units is L average ,but:
[0025]
[0026] The average load L average , specifically: Assume that the load of computing unit i is L i , then it is expressed as:
[0027]
[0028] The communication cost penalty function C2 is specifically: Assuming that the optimization algorithm iterates p times, that is, there are p allocation schemes, the average communication cost of all allocation schemes is T average For, then:
[0029]
[0030] The average communication cost T average , specifically:
[0031]
[0032] The parallel cryptographic calculation strategy constraints include: the maximum computing power constraint of the computing unit and the maximum task time constraint, where:
[0033] The maximum computing power constraint of the computing unit is: a single computing unit in the task allocation plan cannot exceed its own maximum computing power threshold;
[0034] The maximum task duration constraint is: the duration of an encryption task cannot exceed the set maximum time threshold.
[0035] The method of using an improved genetic algorithm to optimize the parallel cryptographic calculation strategy of a numerical control system comprises the following steps:
[0036] Step 1: Assume that a piece of data is divided into n data blocks, with a total of m operation units. Each gene represents data block i, 1≤i≤n, and it is assigned to operation unit j, 1≤j≤m. Construct a parallel cryptographic calculation strategy gene string Q(j1,j2,...,j n ), j∈Z∩(1,m);
[0037] Step 2: randomly generate a certain number of gene strings as the initial population;
[0038] Step three, for each iteration, select the optimal gene string that maximizes the benefit of the parallel cryptographic calculation strategy and satisfies the parallel cryptographic calculation constraints of the CNC system to update the historical optimal gene string; when the number of iterations reaches the set value, the optimization process stops and the optimal gene string at this time is output, which is the parallel cryptographic calculation strategy of the CNC system.
[0039] The method of selecting the optimal gene string that satisfies the parallel cryptographic calculation constraint conditions of the numerical control system to update the historical optimal gene string includes the following steps:
[0040] 1) Determine the load balancing penalty weight α0, the communication cost penalty weight β0, and initially generate a total of j gene strings as the initial population;
[0041] 2) Calculate the i-th gene string Q in the population i The cumulative probability P i ,
[0042]
[0043] Among them, S i is the benefit of the i-th gene string;
[0044] 3) Generate a random number n and select the current optimal gene string Q in the form of roulette best :
[0045]
[0046] 4) Randomly select the optimal gene string Q best The x loci in the genotype are mutated to generate j gene strings, and steps 2) to 3) are repeated to update the optimal gene string Q best ;
[0047] 5) Generate a random number h, adjust the load balancing penalty weight α, and set the calculated α to α0:
[0048]
[0049] Among them, S best is the optimal calculation strategy return model, that is, the maximum value of the calculation strategy return model;
[0050] 6) Generate a random number k, adjust the communication cost penalty weight β, and set the calculated β to β0:
[0051]
[0052] 7) Repeat steps 2) to 6) to obtain a new gene string after each iteration, completing the update process of the optimal gene string.
[0053] The step 7) is specifically:
[0054] After each iteration, the obtained parallel password calculation strategy gene string Q (j1, j2, ..., j n ), j∈Z∩(1,m) to perform parallel cryptographic computing strategy constraint test, and select the parallel cryptographic computing strategy gene string Q(j1,j2,...,j n ) continues to the next iteration process, otherwise directly enters the next optimization iteration process.
[0055] The parallel cryptographic calculation strategy constraint test is specifically as follows:
[0056] According to the parallel cryptographic computing strategy target, the parallel cryptographic computing strategy gene string Q (j1, j2, ..., j n), j∈Z∩(1,m) corresponds to the total benefit S, and compares it with the total benefit that corresponds to the historical optimal gene string at the previous moment. If the total benefit at the current moment is greater, the current Q will replace the historical optimal gene string with the largest total benefit at the previous moment, and proceed to the next iterative process; otherwise, the historical optimal gene string at the previous moment will be used to directly proceed to the next genetic variation optimization iterative process.
[0057] A parallel cryptographic computing strategy optimization system for numerical control systems, comprising:
[0058] A parallel cryptographic computing strategy model building module is used to establish a parallel cryptographic computing strategy benefit model;
[0059] A parallel cryptographic computing strategy initialization module is used to determine the parallel cryptographic computing strategy objectives and establish the parallel cryptographic computing strategy constraints according to the parallel cryptographic computing strategy benefit model;
[0060] A parallel cryptographic computing strategy optimization module is used to optimize the parallel cryptographic computing strategy in the numerical control system using a genetic algorithm under the condition of the parallel cryptographic computing strategy, and use the optimized parallel cryptographic computing strategy that meets the parallel cryptographic computing strategy optimization target as the optimized parallel cryptographic computing strategy;
[0061] The parallel cryptographic calculation strategy execution module is used to implement the parallel cryptographic calculation of the numerical control system according to the optimized parallel cryptographic calculation strategy.
[0062] A parallel cryptographic computing strategy optimization device for numerical control systems comprises a memory and a processor; the memory is used to store a computer program; the processor is used to implement the parallel cryptographic computing strategy optimization method for numerical control systems when executing the computer program.
[0063] A computer-readable storage medium stores a computer program. When the computer program is executed by a processor, the method for optimizing a parallel cryptographic calculation strategy for a numerical control system is implemented.
[0064] The present invention has the following beneficial effects and advantages:
[0065] 1. Improve the efficiency of cryptographic calculations: Parallel cryptographic calculation technology can decompose encryption tasks into multiple subtasks and perform them simultaneously on the computing unit. This parallel processing method greatly reduces the total time required for encryption and significantly improves the efficiency of cryptographic calculations.
[0066] 2. Improve the stability of cryptographic calculations: Different from traditional technologies, the present invention comprehensively considers the load pressure and communication cost of the budget unit, and designs a responsive penalty mechanism to constrain the generation of parallel cryptographic calculation strategies, which helps to improve the stability and reliability of the system and reduce the risk of system crash or performance degradation due to computing overload.
[0067] 3. Optimize resource utilization: Parallel cryptographic computing strategies can be dynamically adjusted according to the performance of computing resources and task complexity to achieve load balancing, which helps to make full use of system resources, improve resource utilization and avoid resource waste. BRIEF DESCRIPTION OF THE DRAWINGS
[0068] Figure 1 It is a flow chart of the optimization method of parallel cryptographic computing strategy for numerical control systems;
[0069] Figure 2 It is a schematic diagram of the benefit model of parallel cryptographic computing strategy for numerical control systems;
[0070] Figure 3 It is the improved genetic algorithm optimization flow chart under constraints. DETAILED DESCRIPTION
[0071] The present invention is further described in detail below in conjunction with the accompanying drawings and embodiments.
[0072] The present invention proposes a parallel cryptographic computing strategy optimization method for numerical control systems, establishes a parallel cryptographic computing benefit model for numerical control systems; defines the total benefit and establishes constraints for parallel cryptographic computing; and through an improved genetic algorithm, achieves more reasonable and efficient parallel cryptographic computing for numerical control systems under the constraints of parallel cryptographic computing strategies.
[0073] A parallel cryptographic computing strategy optimization method for a numerical control system comprises the following steps:
[0074] Establish a parallel cryptographic computing strategy profit model for CNC systems;
[0075] According to the parallel cryptographic computing strategy model of the numerical control system, the optimization target of the parallel cryptographic computing strategy of the numerical control system is determined, and the constraint conditions of the parallel cryptographic computing strategy of the numerical control system are established;
[0076] Under the constraints of the parallel cryptographic computing strategy of the CNC system, an improved genetic algorithm is used to optimize the parallel cryptographic computing strategy of the CNC system, and the optimized parallel cryptographic computing strategy of the CNC system that meets the optimization target of the parallel cryptographic computing strategy of the CNC system is used as the final parallel cryptographic computing strategy of the CNC system.
[0077] The parallel cryptographic calculation strategy profit model of the numerical control system is specifically:
[0078]
[0079] Among them, S is the parallel cryptographic calculation strategy benefit of the CNC system, and the task time is T total , the load balancing penalty function is C1, and the communication cost penalty function is C2. α represents the load balancing penalty weight, and β represents the communication cost penalty weight.
[0080] The task takes time T total Specifically, assuming that a piece of data can be divided into n data blocks, there are m computing units in total. For each data block i (1≤i≤n), when it is assigned to computing unit j (1≤j≤m), the communication time is T comm (i,j), the cryptographic operation time is T enc (i,j), then:
[0081]
[0082] The load balancing penalty function C1 is specifically assumed to be that a piece of data can be divided into n data blocks, with a total of m computing units. For each allocation scheme, the load of computing unit i is L i , the average load of all computing units is L average , then the load balancing penalty function can be expressed as:
[0083]
[0084] The average load L average Specifically, assume that a piece of data can be divided into n data blocks, with a total of m computing units, and the load of computing unit i is L i , then the average load L average It can be expressed as:
[0085]
[0086] The communication cost penalty function C2 is specifically: assuming that a piece of data can be divided into n data blocks, with a total of m operation units, for each data block i (1≤i≤n), when it is assigned to the operation unit j (1≤j≤m), the communication time is T comm (i, j), the optimization algorithm iterates p times (i.e., there are p allocation schemes in total), and the average communication cost of all allocation schemes is T average The communication cost penalty function can be expressed as:
[0087]
[0088] The average communication cost T averageSpecifically, assuming that a piece of data can be divided into n data blocks, there are m computing units in total. For each data block i (1≤i≤n), when it is assigned to computing unit j (1≤j≤m), the communication time is T comm (i, j), the optimization algorithm iterates p times (i.e., there are p allocation schemes), then the average load T average It can be expressed as:
[0089]
[0090] The method of using an improved genetic algorithm to optimize the parallel cryptographic calculation strategy of a numerical control system comprises the following steps:
[0091] Step 1: Assume that a piece of data can be divided into n data blocks, with a total of m operation units. Each gene represents a data block i (1≤i≤n), which is assigned to an operation unit j (1≤j≤m). Construct a parallel cryptographic calculation strategy gene string Q (j1, j2, ..., j n )(j∈Z∩(1,m));
[0092] Step 2: randomly generate a certain number of gene strings as the initial population;
[0093] Step three, for each iteration, select the optimal gene string that maximizes the benefit of the parallel cryptographic calculation strategy and satisfies the parallel cryptographic calculation constraints of the CNC system to update the historical optimal gene string; when the number of iterations reaches the set value, the optimization process stops and the optimal gene string at this time is output, which is the parallel cryptographic calculation strategy of the CNC system.
[0094] The parallel cryptographic calculation strategy constraints include: the maximum computing power constraint of the computing unit and the maximum task time constraint;
[0095] The specific constraints for satisfying the parallel cryptographic calculation strategy are:
[0096] Meet the maximum computing power threshold of the computing unit: a single computing unit in the task allocation plan cannot exceed its own maximum computing power threshold;
[0097] Meet the maximum task time threshold: The duration of an encryption task cannot exceed the set maximum time threshold.
[0098] Selecting the optimal gene string that meets the parallel cryptographic calculation constraint of the numerical control system to update the historical optimal gene string includes the following steps:
[0099] Step 1: Determine the load balancing penalty weight α0, the communication cost penalty weight β0, and initially generate a total of j gene strings as the initial population;
[0100] Step 2: Calculate the i-th gene string Q in the population i The cumulative probability Pi ,
[0101]
[0102] Among them, S i is the benefit of the i-th gene string;
[0103] Step 3: Generate a random number n between 0 and 1 to select the current optimal gene string Q in the form of roulette best :
[0104]
[0105] Step 4: Randomly pair the gene string Q best The x loci in the genotype are mutated to generate j gene strings. Steps 2 to 3 are repeated to generate a new optimal gene string Q. best ;
[0106] Step 5: Generate a random number h between 0.9 and 1, adjust the load balancing penalty weight α, and set the calculated α to α0:
[0107]
[0108] Step 6: Generate a random number k between 0.9 and 1, adjust the communication cost penalty weight β, and set the calculated β to β0:
[0109]
[0110] Step 7: Repeat steps 2 to 6, and obtain a new gene string after each iteration through the above formula to complete the update process of the optimal gene string.
[0111] The process of updating the optimal gene string is specifically as follows:
[0112] For the parallel cryptographic calculation strategy gene string Q(j1, j2, ..., j n )(j∈Z∩(1,m)) performs parallel cryptographic computing strategy constraint test, and performs parallel cryptographic computing strategy gene string Q(j1,j2,...,j) that meets the constraint condition. n )(j∈Z∩(1,m)) continues to the next iteration process, otherwise directly enters the next optimization iteration process.
[0113] The parallel cryptographic calculation strategy constraint test is specifically as follows:
[0114] According to the parallel cryptographic computing strategy target, the parallel cryptographic computing strategy gene string Q (j1, j2, ..., j nThe total benefit S corresponding to )(j∈Z∩(1,m)) is compared with the total benefit corresponding to the historical optimal gene string at the previous moment; if the total benefit at this time is greater, the current Q will replace the historical optimal gene string with the largest total benefit at the previous moment, and the next iterative process will be carried out; otherwise, the historical optimal gene string at the previous moment will be used to directly carry out the next genetic variation optimization iterative process.
[0115] A parallel cryptographic computing strategy optimization system for numerical control systems, comprising:
[0116] A parallel cryptographic computing strategy model building module is used to establish a parallel cryptographic computing strategy benefit model;
[0117] A parallel cryptographic computing strategy initialization module is used to determine the parallel cryptographic computing strategy objectives and establish the parallel cryptographic computing strategy constraints according to the parallel cryptographic computing strategy benefit model;
[0118] A parallel cryptographic computing strategy optimization module is used to optimize the parallel cryptographic computing strategy in the numerical control system using a genetic algorithm under the condition of the parallel cryptographic computing strategy, and use the optimized parallel cryptographic computing strategy that meets the parallel cryptographic computing strategy optimization target as the optimized parallel cryptographic computing strategy;
[0119] The parallel cryptographic calculation strategy execution module is used to implement the parallel cryptographic calculation of the numerical control system according to the optimized parallel cryptographic calculation strategy.
[0120] Example
[0121] Establish a parallel cryptographic computing strategy profit model for CNC systems;
[0122] According to the characteristics of the parallel cryptographic computing strategy benefit model of the numerical control system, the parallel cryptographic computing strategy objectives are defined;
[0123] A parallel cryptographic computing strategy constraint method is proposed from two aspects: the maximum computing power threshold of the computing unit and the maximum task time threshold;
[0124] Under the constraint method of parallel cryptographic calculation strategy, the improved genetic algorithm is used to optimize the parallel cryptographic calculation strategy in the numerical control system, and the optimized parallel cryptographic calculation strategy is obtained.
[0125] According to the background of parallel cryptographic computing strategy of numerical control system, the parallel cryptographic computing strategy gene string is defined;
[0126] Based on the row password calculation strategy constraint method, the optimization is carried out using an improved genetic algorithm;
[0127] According to the maximum number of iterations set in advance, the improved genetic algorithm steps are repeatedly executed to complete the execution of the parallel cryptographic calculation strategy.
[0128] The parallel cryptographic calculation strategy profit model for the numerical control system is established as follows:
[0129] like Figure 2 As shown in Figure 1, the model is divided into three parts: encryption task time, load balancing penalty, and communication cost penalty. The encryption task time consists of the cryptographic operation time and communication time of the encryption task.
[0130] The goal of the parallel cryptographic computing strategy optimization is to find the maximum value of the parallel cryptographic computing strategy benefit, specifically expressed as S. The research goal is to increase the benefits of the parallel cryptographic computing strategy. The system is divided into three parts through optimization modeling. The first part represents the time consumption of the encryption task, the second part represents the load balancing penalty, and the third part represents the communication cost penalty. In order to make the benefit result more significant, the inverse processing is performed.
[0131] The parallel cryptographic computing strategy constraint method is specifically manifested in taking into account two aspects of constraint conditions: the maximum computing power threshold of the computing unit and the maximum task time threshold.
[0132] In the context of this problem, these two constraints will be applied to the subsequent optimization process.
[0133] The improved genetic algorithm is used to optimize the parallel cryptographic calculation strategy, specifically:
[0134] Step 1: Assume that a piece of data can be divided into 5 data blocks, with a total of 4 operation units. Each gene represents data block i (1≤i≤5), which is assigned to operation unit j (1≤j≤4). Construct the parallel cryptographic calculation strategy gene string Q (j1, j2, ..., j 10 )(j∈Z∩(1,4);
[0135] Step 2: According to the limitations in the parallel cryptographic calculation strategy constraint method, three initial values that meet the conditions can be set, which are:
[0136] Q1(1,2,3,3,1), Q2(1,4,2,2,3), Q3(1,1,1,2,4)
[0137] The benefits of the three gene strings are calculated according to the parallel password calculation benefit model, and finally Q2 is found to have the largest benefit, and Q2 is selected as the current optimal gene string;
[0138] Step three: Each gene string obtained in each iteration needs to be checked for constraints in the parallel cryptographic calculation strategy constraint method. Only when the constraints in the parallel cryptographic calculation strategy constraint method are met can the historical gene string be optimally updated.
[0139] Through the above steps, the communication path selection strategy can be optimized.
[0140] The improved genetic algorithm optimization process for optimizing the parallel cryptographic calculation strategy using the improved genetic algorithm is cycled to obtain the final parallel cryptographic calculation strategy. The improved genetic algorithm cycle process needs to set the maximum number of iterations in advance.
[0141] Through the above steps, a more reasonable and efficient parallel cryptographic computing technology can be implemented while meeting the application background of the CNC system, thereby improving the efficiency of cryptographic computing while making full use of system resources and reducing the risk of system crash or performance degradation due to computing overload.
[0142] The present invention provides a parallel cryptographic calculation strategy optimization method for a numerical control system, which promotes the improvement of the cryptographic calculation efficiency and security of the numerical control system.
[0143] like Figure 1 As shown, the specific steps include:
[0144] Step 1: Model the benefits of the parallel cryptographic calculation strategy of the CNC system. The model is divided into three parts. The first part represents the time consumption of the encryption task, the second part represents the load balancing penalty, and the third part represents the communication cost penalty. In order to make the benefit results more significant, the inverse processing is performed.
[0145] Step 2: Define the benefits of the CNC system parallel cryptographic calculation strategy:
[0146]
[0147] Among them, S is the parallel cryptographic calculation strategy benefit of the CNC system, and the task time is T total , the load balancing penalty function is C1, and the communication cost penalty function is C2. α represents the load balancing penalty weight, which is 0.2 in this implementation, and β represents the communication cost penalty weight, which is 0.1 in this implementation.
[0148] The task takes time T total Specifically, assuming that a piece of data can be divided into 5 data blocks, there are 4 operation units in total. For each data block i (1≤i≤5), when it is assigned to the operation unit j (1≤j≤4), the communication time is T comm (i, j), encryption time is T enc (i, j), then:
[0149]
[0150] The load balancing penalty function C1, for each allocation scheme, the load of computing unit i is L i , the average load of all computing units is L average , then the load balancing penalty function can be expressed as:
[0151]
[0152] The average load L average Specifically, assume that a piece of data can be divided into n data blocks, with a total of m computing units, and the load of computing unit i is L i , then the average load L average It can be expressed as:
[0153]
[0154] The communication cost penalty function C2, the optimization algorithm iterates a total of p times, which is set to 50 times in this scheme, and the average communication cost of all allocation schemes is T average The communication cost penalty function can be expressed as:
[0155]
[0156] The average communication cost T average For each data block i (1≤i≤5), when it is assigned to the computing unit j (1≤j≤m), the communication time is T comm (i, j), then the average load T average It can be expressed as:
[0157]
[0158] This transforms the parallel computing strategy benefit model into a non-restrictive planning problem, and ultimately derives a set of optimal parallel cryptographic computing strategies to determine how parallel computing tasks are executed.
[0159] Step 3: According to the setting in step 2, establish a parallel cryptographic computing strategy constraint method. In the communication path selection constraint process, there are two restrictions: 1. The maximum computing power threshold of the computing unit, and 2. The maximum task time threshold.
[0160] 1. Maximum computing power threshold of computing unit: The tasks assigned to a single computing unit cannot exceed the maximum computing power of the computing unit.
[0161] 2. Maximum task time threshold: The time to complete an encryption task cannot exceed the specified maximum task time.
[0162] In the context of this problem, these two aspects of parallel cryptographic computation strategy constraints will be applied to the subsequent optimization process.
[0163] After step 4 and step 3, the present invention intends to use an improved genetic algorithm to optimize the parallel cryptographic computing strategy, and the fitness function is the benefit in the present invention. Assume that the gene string of the parallel cryptographic computing strategy for encrypting a segment of data is Q(1, 2, 3, 4, 4)(j∈Z∩(1, 4)). For the parallel computing strategy, if the first data segment is assigned to the No. 1 operation unit in the strategy, the element with sequence number 1 is defined as 1 in the matrix, and so on. The total benefit can be calculated through this matrix.
[0164] According to the restrictions in step three, three initial values that meet the conditions can be set, namely: Q1 (1, 2, 3, 3, 1), Q2 (1, 4, 2, 2, 3), Q3 (1, 1, 1, 2, 4), determine the load balancing penalty weight α0 to be 0.2, the communication cost penalty weight β0 to be 0.1, and calculate the benefits of the three gene strings respectively according to the parallel cryptographic calculation benefit model. Finally, Q2 has the largest benefit and is selected as the current optimal gene string.
[0165] Random pair of gene strings Q best The two loci in the genotype are mutated to generate three gene strings. Steps 2 to 3 are repeated to generate a new optimal gene string Q. best ;
[0166] Step 5: Generate a random number between 0.9 and 1, 0.95, adjust the load balancing penalty weight α, and set the calculated α to α0:
[0167]
[0168] Step 6: Generate a random number 0.97 between 0.9 and 1, adjust the communication cost penalty weight β, and set the calculated β to β0:
[0169]
[0170] Step 7: Repeat steps 2 to 6, and obtain a new gene string after each iteration through the above formula to complete the update process of the optimal gene string.
[0171] The specific improved genetic algorithm optimization process is as follows: Figure 3 As shown, it is worth noting that the particles and populations obtained in each iteration need to undergo the constraint check in step three. Only when the constraints in step three are met can the historical optimal gene string be updated.
[0172] Step 5: Through steps 3 and 4, the present invention can obtain the final optimized communication path selection strategy after setting the initial value. The specific initial value includes the maximum number of iterations K, which is set to 50 in this scheme. When the number of iterations reaches 50, the optimization process stops and the optimal gene string at this time is output;
[0173] Through this step, we will finally get a parallel cryptographic computing strategy for CNC systems.
[0174] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of embodiments in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code.
[0175] The present invention is described with reference to the method flow chart according to the embodiment of the present application. It should be understood that each process in the flow chart can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the process in the flow chart. Figure 1 A device that specifies functions in a process or multiple processes.
[0176] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A function specified in a process or multiple processes.
[0177] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 The steps of a specified function in a process or multiple processes.
[0178] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the above embodiments, ordinary technicians in the relevant field should understand that the specific implementation methods of the present invention can still be modified or replaced by equivalents. Any modification or equivalent replacement that does not depart from the spirit and scope of the present invention should be covered within the scope of protection of the claims of the present invention.
Claims
1. A parallel cryptographic computing strategy optimization method for numerical control systems, characterized in that: The following steps are involved: Establish a parallel cryptographic computing strategy profit model for CNC systems; According to the parallel cryptographic computing strategy model of the numerical control system, the optimization target of the parallel cryptographic computing strategy of the numerical control system is determined, and the constraint conditions of the parallel cryptographic computing strategy of the numerical control system are established; Under the constraint conditions of the parallel cryptographic computing strategy of the numerical control system, the improved genetic algorithm is used to optimize the parallel cryptographic computing strategy of the numerical control system, and the optimized parallel cryptographic computing strategy that meets the optimization target of the parallel cryptographic computing strategy is used as the final parallel cryptographic computing strategy of the numerical control system; The parallel cryptographic calculation of the numerical control system is implemented according to the optimized parallel cryptographic calculation strategy.
2. The method for optimizing parallel cryptographic computing strategies for numerical control systems according to claim 1, characterized in that: The parallel cryptographic calculation strategy profit model of the numerical control system is specifically: Among them, S is the parallel cryptographic calculation strategy benefit of the CNC system, and the task time is T total ,The load balancing penalty function is C1, and the communication cost penalty function is C2. ,α represents the load balancing penalty weight, and β represents the communication cost penalty weight; The task takes time T total Specifically, assume that a piece of data can be divided into n data blocks, with a total of m computing units. For each data block i, 1≤i≤n, when it is assigned to computing unit j, 1≤j≤m, the communication time is T comm (i,j), the cryptographic operation time is T enc (i,j), then: The load balancing penalty function C1 is specifically: for each allocation scheme, assuming that the load of computing unit i is L i , the average load of all computing units is L average ,but: The average load L average , specifically: Assume that the load of computing unit i is L i , then it is expressed as: The communication cost penalty function C2 is specifically: Assuming that the optimization algorithm iterates p times, that is, there are p allocation schemes, the average communication cost of all allocation schemes is T average For, then: The average communication cost T average , specifically:
3. The method for optimizing parallel cryptographic computing strategies for numerical control systems according to claim 1, characterized in that: The parallel cryptographic calculation strategy constraints include: the maximum computing power constraint of the computing unit and the maximum task time constraint, where: The maximum computing power constraint of the computing unit is: a single computing unit in the task allocation plan cannot exceed its own maximum computing power threshold; The maximum task duration constraint is: the duration of an encryption task cannot exceed the set maximum time threshold.
4. The method for optimizing parallel cryptographic computing strategies for numerical control systems according to claim 1, characterized in that: The method of using an improved genetic algorithm to optimize the parallel cryptographic calculation strategy of a numerical control system comprises the following steps: Step 1: Assume that a piece of data is divided into n data blocks, with a total of m operation units. Each gene represents data block i, 1≤i≤n, and it is assigned to operation unit j, 1≤j≤m. Construct a parallel cryptographic calculation strategy gene string Q(j1,j2,...,j n ), j∈Z∩(1,m); Step 2: randomly generate a certain number of gene strings as the initial population; Step three, for each iteration, select the optimal gene string that maximizes the benefit of the parallel cryptographic calculation strategy and satisfies the parallel cryptographic calculation constraints of the CNC system to update the historical optimal gene string; when the number of iterations reaches the set value, the optimization process stops and the optimal gene string at this time is output, which is the parallel cryptographic calculation strategy of the CNC system.
5. The method for optimizing parallel cryptographic computing strategies for numerical control systems according to claim 4, characterized in that: The method of selecting the optimal gene string that satisfies the parallel cryptographic calculation constraint conditions of the numerical control system to update the historical optimal gene string includes the following steps: 1) Determine the load balancing penalty weight α0, the communication cost penalty weight β0, and initially generate a total of j gene strings as the initial population; 2) Calculate the i-th gene string Q in the population i The cumulative probability P i , Among them, S i is the benefit of the i-th gene string; 3) Generate a random number n and select the current optimal gene string Q in the form of roulette best : 4) Randomly select the optimal gene string Q best The x loci in the genotype are mutated to generate j gene strings, and steps 2) to 3) are repeated to update the optimal gene string Q best ; 5) Generate a random number h, adjust the load balancing penalty weight α, and set the calculated α to α0: Among them, S best is the optimal calculation strategy return model, that is, the maximum value of the calculation strategy return model; 6) Generate a random number k, adjust the communication cost penalty weight β, and set the calculated β to β0: 7) Repeat steps 2) to 6) to obtain a new gene string after each iteration, completing the update process of the optimal gene string.
6. The method for optimizing parallel cryptographic computing strategies for numerical control systems according to claim 5, characterized in that: The step 7) is specifically: After each iteration, the obtained parallel password calculation strategy gene string Q(j1,j2,...,j n ), j∈Z∩(1,m) performs parallel cryptographic computing strategy constraint test, and performs parallel cryptographic computing strategy gene string Q(j1,j2,...,j n ) continues to the next iteration process, otherwise directly enters the next optimization iteration process.
7. The method for optimizing parallel cryptographic computing strategies for numerical control systems according to claim 6, characterized in that: The parallel cryptographic calculation strategy constraint test is specifically as follows: According to the parallel cryptographic computing strategy target, the parallel cryptographic computing strategy gene string Q(j1, j2, ..., j n ), the total benefit S corresponding to j∈Z∩(1,m) is compared with the total benefit corresponding to the historical optimal gene string at the previous moment. If the total benefit at the current moment is greater, the current Q replaces the historical optimal gene string with the largest total benefit at the previous moment, and the next iteration process is carried out; otherwise, the historical optimal gene string at the previous moment is used to directly carry out the next genetic variation optimization iteration process.
8. A parallel cryptographic computing strategy optimization system for numerical control systems, characterized in that: include: A parallel cryptographic computing strategy model building module is used to establish a parallel cryptographic computing strategy benefit model; A parallel cryptographic computing strategy initialization module is used to determine the parallel cryptographic computing strategy objectives and establish the parallel cryptographic computing strategy constraints according to the parallel cryptographic computing strategy benefit model; A parallel cryptographic computing strategy optimization module is used to optimize the parallel cryptographic computing strategy in the numerical control system using a genetic algorithm under the condition of the parallel cryptographic computing strategy, and use the optimized parallel cryptographic computing strategy that meets the parallel cryptographic computing strategy optimization target as the optimized parallel cryptographic computing strategy; The parallel cryptographic calculation strategy execution module is used to implement the parallel cryptographic calculation of the numerical control system according to the optimized parallel cryptographic calculation strategy.
9. A parallel cryptographic computing strategy optimization device for numerical control systems, characterized in that: It comprises a memory and a processor; the memory is used to store a computer program; the processor is used to implement a parallel cryptographic computing strategy optimization method for a numerical control system as described in any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium, characterized in that: The storage medium stores a computer program, and when the computer program is executed by a processor, a parallel cryptographic calculation strategy optimization method for a numerical control system as described in any one of claims 1 to 7 is implemented.
