Data encryption method and device based on hybrid granularity reconfigurable computing architecture
By decoupling encryption tasks into coarse- and fine-grained subtasks through a hybrid granularity reconfigurable computing architecture, and using a control module to allocate parameters for parallel execution, the problem of poor efficiency of the AES encryption algorithm under coarse-grained architecture is solved, and efficient and flexible encryption processing is achieved.
Patent Information
- Application Number
- CN202511151600.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-08-18
- Publication Date
- 2025-12-12
AI Technical Summary
Existing AES encryption algorithms are inefficient at fine-grained or sparse computations under coarse-grained reconfigurable computing architectures, making it difficult to improve the efficiency of encryption algorithms.
A hybrid granularity reconfigurable computing architecture is adopted to decouple the encryption task into coarse-grained and fine-grained subtasks. The control module assigns task parameters to each subtask, and the subtasks are executed on the coarse-grained and fine-grained task execution modules respectively to finally determine the encrypted data.
It improves the efficiency and flexibility of encryption tasks, ensures the integrity and accuracy of the encryption process, and adapts to changes in different encryption algorithms and data scales.
Smart Images

Figure CN121118079A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of information security, in particular to a data encryption method and device based on a hybrid-granularity reconfigurable computing architecture. BACKGROUND
[0002] Encryption algorithms are the cornerstone of information security, and their development has effectively protected human information. With the progress of chip computing power, the security of the early DES (Data Encryption Standard) encryption algorithm has become a problem, and various new encryption algorithms have been developed to meet the increasing demand for faster encryption and decryption, driving the continuous progress of chip technology.
[0003] In related technologies, to address the security problem of the DES encryption algorithm, the AES (Advanced Encryption Standard) encryption algorithm is proposed. The AES encryption algorithm combines security, efficiency, and flexibility, and its core architecture uses the SPN (Substitution-Permutation Network). It uses a 128 / 192 / 256-bit variable key length and achieves a good balance between diffusion and confusion through 10-14 rounds of nonlinear transformation. It has a four-step cyclic structure of byte substitution, row shifting, column confusion, and round key addition, and has advanced defense capabilities in resisting differential / linear cryptanalysis. It has been widely used in TLS protocols, disk encryption, Internet of Things devices, and other fields. However, the coarse-grained reconfigurable computing architecture (CGRA) used by the AES encryption algorithm is suitable for computing dense tasks with coarse granularity, but it performs poorly for fine-grained or sparse computing, making it difficult to improve the efficiency of the existing AES encryption algorithm. SUMMARY
[0004] Therefore, it is necessary to provide a data encryption method and device based on a hybrid-granularity reconfigurable computing architecture to solve the above technical problems.
[0005] In a first aspect, the present application provides a data encryption method based on a hybrid-granularity reconfigurable computing architecture, wherein the hybrid-granularity reconfigurable computing architecture includes a computing task decoupling module, a control module, a coarse-grained task execution module, a fine-grained task execution module, and a data interaction module. The method includes:
[0006] decoupling the encryption task through the computing task decoupling module to obtain a plurality of subtasks of different granularities;
[0007] The control module controls the coarse-grained task execution module and the fine-grained task execution module to execute the subtasks based on the task parameters allocated to the subtasks, so as to process the to-be-processed data allocated to the subtasks to obtain target data; the to-be-processed data includes data exchanged between the coarse-grained task execution module and the fine-grained task execution module by the data exchange module.
[0008] The encryption data is determined based on the target data obtained by at least one subtask.
[0009] In one embodiment, the control module controls the coarse-grained task execution module and the fine-grained task execution module to execute the subtasks based on the task parameters allocated to the subtasks, so as to process the to-be-processed data allocated to the subtasks to obtain target data, including:
[0010] For each subtask, the control module determines a first mapping relationship, and based on the first mapping relationship, determines target configuration information corresponding to instruction information in the task parameters allocated to the subtask; the first mapping relationship includes a corresponding relationship between the instruction information and the configuration information.
[0011] The control module controls the coarse-grained task execution module and the fine-grained task execution module to process the to-be-processed data allocated to the subtask according to the target configuration information, to obtain the target data.
[0012] In one embodiment, the control module controls the coarse-grained task execution module and the fine-grained task execution module to process the to-be-processed data allocated to the subtask according to the target configuration information, to obtain the target data, including:
[0013] The control module determines a second mapping relationship, and based on the second mapping relationship, determines a target working mode corresponding to the target configuration information; the second mapping relationship includes a corresponding relationship between the configuration information and the working mode.
[0014] The control module controls the coarse-grained task execution module and the fine-grained task execution module to process the to-be-processed data allocated to the subtask based on the target working mode, to obtain the target data.
[0015] In one embodiment, the encryption data is determined based on the target data obtained by at least one subtask, including:
[0016] The computing task decoupling module determines a last subtask that performs data processing from the subtasks.
[0017] The target data obtained by the last subtask that performs data processing is determined as the encryption data.
[0018] In one of the embodiments, in the case that the subtask is a coarse-grained subtask, the target working mode corresponding to the coarse-grained subtask at least includes one of matrix multiplication and polynomial addition; in the case that the subtask is a fine-grained subtask, the target working mode corresponding to the fine-grained subtask at least includes one of matrix conversion mode, byte replacement mode, row shift mode and round key addition mode.
[0019] In one of the embodiments, in the case that the subtask is a coarse-grained subtask, the target configuration information corresponding to the coarse-grained subtask at least includes one of encryption round number configuration, round key scheduling table configuration and encryption mode configuration; in the case that the subtask is a fine-grained subtask, the target configuration information corresponding to the fine-grained subtask at least includes one of replacement box configuration, row shift rule configuration and current round key data.
[0020] In a second aspect, the present application further provides a data encryption device, which comprises:
[0021] a computing task decoupling module configured to decouple the encryption task to obtain a plurality of subtasks of different granularities;
[0022] a control module configured to control the coarse-grained task execution module and the fine-grained task execution module to execute the subtasks based on the task parameters allocated to the subtasks, so as to process the to-be-processed data allocated to the subtasks to obtain target data; the to-be-processed data includes data exchanged between the coarse-grained task execution module and the fine-grained task execution module by the data exchange module;
[0023] an encrypted data determination module configured to determine encrypted data based on the target data obtained by at least one subtask.
[0024] In a third aspect, the present application further provides a computer device, which comprises a memory and a processor, the memory stores a computer program, and the processor implements the following steps when executing the computer program:
[0025] a computing task decoupling module configured to decouple the encryption task to obtain a plurality of subtasks of different granularities;
[0026] a control module configured to control the coarse-grained task execution module and the fine-grained task execution module to execute the subtasks based on the task parameters allocated to the subtasks by the control module, so as to process the to-be-processed data allocated to the subtasks to obtain target data; the to-be-processed data includes data exchanged between the coarse-grained task execution module and the fine-grained task execution module by the data exchange module;
[0027] an encrypted data determination module configured to determine encrypted data based on the target data obtained by at least one subtask.
[0028] In a fourth aspect, the present application also provides a computer readable storage medium, which stores a computer program, and the computer program is executed by a processor to implement the following steps:
[0029] The encrypted task is decoupled by the computing task decoupling module to obtain a plurality of subtasks of different granularities;
[0030] Based on the task parameters allocated to each subtask by the control module, the coarse-grained task execution module and the fine-grained task execution module execute the subtasks to process the to-be-processed data allocated to the subtasks to obtain target data; the to-be-processed data includes data exchanged between the coarse-grained task execution module and the fine-grained task execution module by the data exchange module;
[0031] The encrypted data is determined based on the target data obtained by at least one subtask.
[0032] In a fifth aspect, the present application also provides a computer program product, which comprises a computer program, and the computer program is executed by a processor to implement the following steps:
[0033] The encrypted task is decoupled by the computing task decoupling module to obtain a plurality of subtasks of different granularities;
[0034] Based on the task parameters allocated to each subtask by the control module, the coarse-grained task execution module and the fine-grained task execution module execute the subtasks to process the to-be-processed data allocated to the subtasks to obtain target data; the to-be-processed data includes data exchanged between the coarse-grained task execution module and the fine-grained task execution module by the data exchange module;
[0035] The encrypted data is determined based on the target data obtained by at least one subtask.
[0036] The data encryption method and device based on the hybrid-granularity reconfigurable computing architecture are described above. The encrypted task is decoupled by the computing task decoupling module in the computing architecture to obtain a plurality of subtasks of different granularities, so that different subtasks can be executed in parallel subsequently, thereby improving the execution efficiency of the encrypted task. Then, based on the task parameters allocated to each subtask by the control module in the computing architecture, the subtasks are executed to ensure that each subtask can operate on data according to a predetermined rule, thereby ensuring the accuracy of the coarse-grained task execution module and the fine-grained task execution module in the computing architecture in processing the to-be-processed data allocated to the subtasks to obtain target data. Finally, the encrypted data is determined based on the target data obtained by at least one subtask, which can ensure the integrity of the entire encryption process. Since each subtask is a link in the encryption process, the encrypted data can be finally determined only when each subtask is correctly executed and the corresponding target data is obtained, thereby avoiding omission or errors in the encryption process. Attached Figure Description
[0037] Figure 1 This is a schematic diagram of the structure of a hybrid granularity reconfigurable computing architecture provided in some embodiments of this application;
[0038] Figure 2 This is a schematic diagram of the structure of the control module provided in some embodiments of this application;
[0039] Figure 3 This is a schematic diagram of the structure of a fine-grained task execution module provided in some embodiments of this application;
[0040] Figure 4 This is a schematic diagram of the structure of a Boolean processing array unit provided in some embodiments of this application;
[0041] Figure 5 This is a schematic diagram of the structure of a coarse-grained task execution module provided in some embodiments of this application;
[0042] Figure 6 This is a schematic diagram of the structure of an arithmetic processing array unit provided in some embodiments of this application;
[0043] Figure 7 This is a schematic diagram of the structure of a computational task decoupling module provided in some embodiments of this application;
[0044] Figure 8 This is a schematic diagram of the structure of a data interaction module provided in some embodiments of this application;
[0045] Figure 9 Flowcharts of a data encryption method and apparatus based on a hybrid granularity reconfigurable computing architecture provided in some embodiments of this application;
[0046] Figure 10 Flowcharts for determining target data provided in some embodiments of this application;
[0047] Figure 11 Flowcharts for determining target data provided in some embodiments of this application;
[0048] Figure 12 Flowcharts for determining encrypted data provided in some embodiments of this application;
[0049] Figure 13 Structural block diagrams of data encryption devices provided in some embodiments of this application;
[0050] Figure 14 This is an internal structural diagram of a computer device provided in some embodiments of this application.
[0051] Figure label:
[0052] 10. Computational Task Decoupling Module; 20. Control Module; 21. Hierarchical Information Storage Unit; 22. Control Unit; 23. Coarse-grained Task Configuration Unit; 24. Coarse-grained Data Storage Unit; 25. Fine-grained Task Configuration Unit; 30. Coarse-grained Task Execution Module; 31. Arithmetic Processing Submodule; 312. Arithmetic Processing Array Unit; 3120. Arithmetic Processing Subunit; 32. Second Data Storage Submodule; 33. Second Cross Switch Submodule; 40. Fine-grained Task Execution Module; 41. Instruction Allocation Submodule; 42. Logical Operation Submodule; 422. Boolean Processing Array Unit; 4220. Boolean Processing Subunit; 424. Internal Interconnection Submodule; 426. External Interconnection Submodule; 43. First Data Storage Submodule; 44. First Cross Switch Submodule; 50. Data Interaction Module. Detailed Implementation
[0053] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0054] The data encryption method and apparatus based on a hybrid granularity reconfigurable computing architecture provided in this application can be applied to various computer devices such as personal computers, laptops, smartphones, and tablets. These computer devices are equipped with a method such as... Figure 1 The hybrid granularity reconfigurable computing architecture shown includes a computing task decoupling module 10, a control module 20, a coarse-grained task execution module 30, a fine-grained task execution module 40, and a data interaction module 50. The computing task decoupling module 10 is used to acquire initial data and an encryption task for the initial data, and decouples the encryption task into coarse-grained subtasks and fine-grained subtasks according to a preset decoupling rule. The control module 20 is connected to the computing task decoupling module 10 and is used to assign a first parameter to the coarse-grained subtask and a second parameter to the fine-grained subtask. The coarse-grained task execution module 30 is connected to the control module 20 and is used to acquire the first parameter and the coarse-grained subtask, and based on... The first intermediate data is obtained by executing a coarse-grained subtask based on the first parameter; the fine-grained task execution module 40 is connected to the control module 20 and is used to obtain the second parameter and the fine-grained subtask, and execute the fine-grained subtask based on the second parameter to obtain the second intermediate data; the data interaction module 50 is connected between the fine-grained task execution module 40 and the coarse-grained task execution module 30 and is used to send the first intermediate data to the fine-grained task execution module 40 or send the second intermediate data to the coarse-grained task execution module 30, so that the target module can process the first intermediate data and the second intermediate data to obtain the target data; the target module includes the coarse-grained task execution module 30 or the fine-grained task execution module 40.
[0055] The initial data is data to be processed, which can be specific numerical data, text data, image data, etc. The encryption task includes a series of calculation operations on the initial data, representing the calculation target expected to be completed by the user. The type of encryption task is diverse, which can be mathematical calculation (such as matrix multiplication, numerical integration, etc.), data processing (such as data cleaning, feature extraction, etc.), image or video processing (such as image recognition, video encoding, etc.), etc. The preset decoupling rule can be a basis for decoupling an overall encryption task into coarse-grained subtasks and fine-grained subtasks, which can be determined based on factors such as the nature of the task, the calculation complexity, and the data dependency relationship. For example, the part with large calculation amount and overall framework can be taken as a coarse-grained subtask, and the part with small calculation amount and details can be taken as a fine-grained subtask; or the task of operating on the whole data can be taken as a coarse-grained subtask, and the task of operating on the local data can be taken as a fine-grained subtask.
[0056] The first parameter is related information allocated by the control module 20 for the coarse-grained subtask, which is used to guide the execution of the coarse-grained subtask. The first parameter can include configuration information (such as a calculation model, parallelism, etc.), data required for task execution (such as an input matrix, model parameters, etc.), control instructions (such as start and end conditions of the task), etc. The first intermediate data is the stage result obtained after the coarse-grained task execution module 30 executes the coarse-grained subtask based on the first parameter. The second parameter is related information allocated by the control module 20 for the fine-grained subtask, which is used to guide the execution of the fine-grained subtask. The second parameter is similar to the first parameter, and the second parameter can also include configuration information, data required for task execution, and control instructions, etc. The second intermediate data is the stage result obtained after the fine-grained task execution module 40 executes the fine-grained subtask based on the second parameter.
[0057] The target data is the result finally obtained after the first intermediate data and the second intermediate data are processed by the coarse-grained task execution module 30 and the fine-grained task execution module 40, which meets the requirements of the encryption task initially proposed by the user. Since the last subtask in the encryption task can be a coarse-grained subtask or a fine-grained subtask, when the last subtask in the encryption task is a coarse-grained subtask, the target module is the coarse-grained task execution module 30, that is, the first intermediate data and the second intermediate data are processed by the coarse-grained task execution module 30 to obtain the target data at this time; when the last subtask in the encryption task is a fine-grained subtask, the target module is the fine-grained task execution module 40, that is, the first intermediate data and the second intermediate data are processed by the fine-grained task execution module 40 to obtain the target data at this time.
[0058] Reference Figure 2In some embodiments, the control module 20 comprises a hierarchical information storage unit 21, a control unit 22, a coarse-grained task configuration unit 23, a coarse-grained data storage unit 24, and a fine-grained task configuration unit 25, wherein the hierarchical information storage unit 21 is configured to store initial data, first parameters, and second parameters; the control unit 22 is connected with the coarse-grained task configuration unit 23, the coarse-grained data storage unit 24, the fine-grained task configuration unit 25, a coarse-grained task execution module 30, and a data interaction module 50, and is configured to allocate the first parameters to the coarse-grained sub-tasks, and allocate the second parameters to the fine-grained sub-tasks; the coarse-grained task configuration unit 23 is connected with the hierarchical information storage unit 21, and is configured to obtain the first parameters corresponding to the coarse-grained sub-tasks; the coarse-grained data storage unit 24 is connected with the hierarchical information storage unit 21, and is configured to obtain the initial data corresponding to the coarse-grained sub-tasks; the fine-grained task configuration unit 25 is connected with the hierarchical information storage unit 21 and a fine-grained task execution module 40, and is configured to obtain the second parameters corresponding to the fine-grained sub-tasks, and generate task execution instructions according to the second parameters.
[0059] The hierarchized information storage unit 21 can be a hierarchized memory, which is a storage device or system with different storage hierarchy. The control unit 22 can be a component for controlling and coordinating the parallel execution units in the coarse-grained task execution module 30 and the fine-grained task execution module 40. In this embodiment, the control unit 22 can be a processing element array controller (PEA Controller). The coarse-grained task configuration unit 23 can be a processing element array configuration direct memory access unit (PEA Configuration DMA), which is a direct memory access component for configuring the parallel execution units, allowing the device to directly transmit data with the memory without the intervention of the CPU (Central Processing Unit), so as to improve the efficiency of data transmission. The coarse-grained data storage unit 24 can be a processing element array data direct memory access unit (PEA Data DMA), which can use DMA to transmit data, thereby reducing the burden of the CPU and speeding up the transmission speed of data. The fine-grained task configuration unit 25 can be a Boolean processing element array configuration unit (BPA Configuration Unit), which can obtain the second parameters corresponding to the fine-grained sub-tasks from the hierarchized information storage unit 21, generate task execution instructions according to the second parameters, and then send the instructions to the fine-grained task execution module 40 to guide the execution of the fine-grained sub-tasks. The task execution instructions are a series of instruction sets generated by the fine-grained task configuration unit 25 according to the second parameters, which are used to guide the fine-grained task execution module 40 how to execute the fine-grained sub-tasks.
[0060] With reference to Figure 3In some embodiments, the fine-grained task execution module 40 comprises an instruction distribution sub-module 41, a logic operation sub-module 42, and a first data storage sub-module 43. The instruction distribution sub-module 41 is connected to the fine-grained task configuration unit 25, and is configured to obtain a task execution instruction and send the task execution instruction to the logic operation sub-module 42. The logic operation sub-module 42 is connected to the instruction distribution sub-module 41, and is configured to receive the task execution instruction and execute a fine-grained sub-task according to the task execution instruction to obtain second intermediate data. The first data storage sub-module 43 is connected to the computing task decoupling module 10 and the logic operation sub-module 42, and is configured to store initial data and the second intermediate data required by the fine-grained sub-task.
[0061] With reference to Figure 3 and Figure 4 In some embodiments, the logic operation sub-module 42 comprises a plurality of Boolean processing array units 422. Each Boolean processing array unit 422 comprises a plurality of Boolean processing sub-units 4220. Adjacent two Boolean processing sub-units 4220 are connected through an internal interconnection sub-module 424. Each Boolean processing array unit 422 is connected through an external interconnection sub-module 426.
[0062] The Boolean processing sub-unit 4220 can be represented by a BPE (Boolean Processing Element). The Boolean processing sub-unit 4220 is a basic unit for performing Boolean logic operations, and can complete basic Boolean operations such as AND, OR, and NOT. The Boolean processing array unit 422 is a unit composed of a plurality of Boolean processing sub-units 4220, and can process a plurality of Boolean operation tasks in parallel, thereby improving the efficiency of logic operations. The internal interconnection sub-module 424 can be an intra-connect network. The internal interconnection sub-module 424 is configured to realize communication between adjacent two Boolean processing sub-units 4220 in the same Boolean processing array unit 422. The external interconnection sub-module 426 can be an inter-connect network. The external interconnection sub-module 426 allows each Boolean processing array unit 422 to exchange data and information, so that the entire logic operation sub-module 42 can process more complex logic operation tasks as a whole.
[0063] With reference to Figure 3 The fine-grained task execution module 40 further comprises a first crossbar sub-module 44. The first crossbar sub-module 44 is connected between the first data storage sub-module 43 and the logic operation sub-module 42. The first crossbar sub-module 44 is configured to realize data interaction between different Boolean processing sub-units 4220, or data interaction between the Boolean processing sub-units 4220 and the first data storage sub-module 43.
[0064] The instruction allocation sub-module 41 can be an instruction allocation unit (IAU), which mainly functions to receive and distribute task execution instructions to ensure that the logic operation sub-module 42 receives correct task execution instructions. The first data storage sub-module 43 can be a Boolean processing array shared memory (BPA Shared Memory), which is mainly used to store initial data required by fine-grained sub-tasks. The first crossbar sub-module 44 can be a Boolean processing array crossbar unit. In the Boolean processing array, different Boolean processing sub-units 4220 can need to cooperate with each other to complete complex logical operations, and through the setting of the first crossbar sub-module 44, data interaction between different Boolean processing sub-units 4220 can be achieved, thereby improving the flexibility and efficiency of task execution.
[0065] With reference to Figure 5 In some embodiments, the coarse-grained task execution module 30 includes an arithmetic processing sub-module 31, a second data storage sub-module 32, and a second crossbar sub-module 33. The arithmetic processing sub-module 31 is connected to the control unit 22 and the hierarchical information storage unit 21, and is used to obtain task operation instructions corresponding to the first parameter, and execute coarse-grained sub-tasks according to the task operation instructions to obtain first intermediate data. The second data storage sub-module 32 is connected to the hierarchical information storage unit 21 and the second crossbar sub-module 33, and is used to store initial data and first intermediate data. The second crossbar sub-module 33 is connected between the arithmetic processing sub-module 31 and the second data storage sub-module 32, and is used to send initial data from the second data storage sub-module 32 to the arithmetic processing sub-module 31, and send first intermediate data from the arithmetic processing sub-module 31 to the second data storage sub-module 32.
[0066] The arithmetic processing submodule 31 can be a processing element array (PEA), which is mainly responsible for executing task operation instructions corresponding to the first parameter, completing coarse-grained subtask calculation, and generating first intermediate data. Since the logic operation of fine-grained is removed, the calculation is more efficient and optimized for coarse-grained calculation. The second data storage submodule 32 can be a processing element array shared memory (PEA Shared Memory). The second crossbar submodule 33 can be a Boolean processing array configuration unit (BPA Configuration Unit), which can send the initial data from the second data storage submodule 32 to the arithmetic processing submodule 31, and send the first intermediate data from the arithmetic processing submodule 31 to the second data storage submodule 32, to realize efficient transmission and exchange of data.
[0067] Referring to Figure 5 and Figure 6 In some embodiments, the arithmetic processing submodule 31 includes a plurality of arithmetic processing array units 312, each of which includes a plurality of arithmetic processing subunits 3120. Adjacent two arithmetic processing subunits 3120 communicate with each other through an internal interconnection network. The second crossbar submodule 33 is also used to realize data interaction between different arithmetic processing array units 312. The arithmetic processing submodule 31 further includes a global register and a configuration memory, the global register being connected with the control unit 22, and the configuration memory being connected with the coarse-grained task configuration unit 23.
[0068] According to the foregoing, the arithmetic processing sub-module 31 can be an array of processing units, which can include a plurality of arithmetic processing array units 312, each of which includes a plurality of arithmetic processing sub-units 3120, which can be processing elements (PEs) that focus on executing task operation instructions corresponding to the first parameters, completing coarse-grained sub-task calculations, and generating first intermediate data. The internal interconnection network can be a network-on-chip (NoC). The second crossbar sub-module 33 can be a processing element array crossbar unit (PEA Crossbar Unit), which can implement multi-path data interaction. The global registers can be Global Registers Files that can store some key data and intermediate results during the arithmetic processing. The configuration memory can be a Configuration Memory that stores configuration information of the system, including the working mode of the arithmetic processing sub-module, the parameter settings of each arithmetic processing unit, the task scheduling strategy, and the like.
[0069] Referring to Figure 7 In some embodiments, the computing task decoupling module 10 includes a system bus 11, a central processor 12, an arithmetic processing array interface 13, and a Boolean processing array interface 14; the system bus 11 is connected to the central processor 12 and the hierarchical information storage unit 21; the central processor 12 is connected to the arithmetic processing array interface 13; the arithmetic processing array interface 13 is connected to the control unit 22 and the Boolean processing array interface 14; and the Boolean processing array interface 14 is connected to the fine-grained task execution module 40 and the fine-grained task configuration unit 25.
[0070] The system bus 11 is responsible for transmitting data, address and control signals between different hardware components. In the task decoupling module, the system bus 11 connects the central processor 12 and the hierarchical information storage unit 21, so that the central processor 12 can read the task-related configuration information and to-be-processed data from the hierarchical information storage unit 21, and also can write the processing result back to the storage unit. The central processor 12 (Central Processing Unit, CPU) is responsible for overall control and coordination of the entire task decoupling process. At the same time, the central processor 12 also interacts with the arithmetic processing array interface 13, sends control instructions to it, and starts the corresponding arithmetic processing operation. The arithmetic processing array interface 13 (Processing Element Array Interface, PEA Interface) is used to connect the central processor 12 and the arithmetic processing array, and is responsible for data and instruction transmission. The central processor 12 transmits task-related arithmetic operation instructions and data to the control unit 22 through the arithmetic processing array interface 13, and the control unit 22 performs arithmetic processing on the data according to these instructions. At the same time, the arithmetic processing array interface 13 also feeds back the processing result of the control unit 22 to the central processor 12 for subsequent processing. The Boolean processing array interface 14 (Boolean Processing Array Interface, BPA Interface) is used to receive instructions and data from the arithmetic processing array interface 13, and transmit them to the fine-grained task execution module 40 to start the execution of the fine-grained task; it also interacts with the fine-grained task configuration unit 25 to obtain the configuration information of the fine-grained task, and ensures that the fine-grained task can be executed according to the correct configuration. At the same time, it feeds back the execution result of the fine-grained task execution module 40 to the arithmetic processing array interface 13.
[0071] Referring to Figure 8 In some embodiments, the data interaction module 50 includes a first interaction sub-module 51 and a second interaction sub-module 52 connected to each other, the first interaction sub-module 51 communicates with the second interaction sub-module 52, the first interaction sub-module 51 is also connected with the control unit 22 and the arithmetic processing sub-module 31, and the second interaction sub-module 52 is also connected with the logical operation sub-module 42 and the Boolean processing array interface 14.
[0072] The first interaction sub-module 51 can be a processing element array data transmission unit (PEA Data Transmission Unit) responsible for data transmission and interaction between the control unit 22 and the arithmetic processing sub-module 31. The first interaction sub-module 51 ensures that the instructions and data issued by the control unit 22 are accurately transmitted to the arithmetic processing sub-module 31, and the operation results of the arithmetic processing sub-module 31 are fed back to the control unit 22 for subsequent decision-making and processing. The second interaction sub-module 52 can be a Boolean processing array data transmission unit (BPA Data Transmission Unit) responsible for data interaction between the logic operation sub-module 42 and the Boolean processing array interface 14. The second interaction sub-module 52 transmits the instructions and data from the Boolean processing array interface 14 to the logic operation sub-module 42, so that the logic operation sub-module 42 can perform logic operations as required, and the operation results of the logic operation sub-module 42 are fed back to the Boolean processing array interface 14 to realize information flow and task execution of the whole system.
[0073] The hybrid granularity reconfigurable computing architecture can decouple the encryption task for the initial data into coarse-grained sub-tasks and fine-grained sub-tasks through the computing task decoupling module 10, so as to lay a foundation for subsequent processing of different granularity tasks, so that the system can make more reasonable resource allocation and execution according to the characteristics of the task; the control module 20 can also allocate parameters for the decoupled coarse-grained sub-tasks and fine-grained sub-tasks, so that the coarse-grained task execution module 30 and the fine-grained task execution module 40 can run corresponding tasks synchronously, so as to improve the processing efficiency of data. In the data processing process, through the data interaction module 50, the intermediate data can be interacted between the coarse-grained task execution module 30 and the fine-grained task execution module 40, so that the target module can further process the intermediate data to obtain the final target data.
[0074] In one embodiment, as shown in Figure 9 , the method is applied to a computer device that can load the hybrid granularity reconfigurable computing architecture in Figures 1-8 . In this embodiment, the method includes the following steps:
[0075] Step 202: Decoupling the encryption task through the computing task decoupling module to obtain a plurality of sub-tasks of different granularity.
[0076] The encryption task refers to an operation of encrypting data using an AES (Advanced Encryption Standard) algorithm. In the AES encryption algorithm, the encryption task covers the entire process from the input of initial plaintext data, through a series of encryption steps of the hybrid-granularity reconfigurable computing architecture, to the final ciphertext output. Decoupling is a process of splitting a complex AES encryption task into multiple relatively independent subtasks with different functions and computing characteristics according to the inherent operation logic and characteristics of the AES encryption task. By decoupling, appropriate computing resources and processing methods can be used for different types of subtasks, thereby improving the efficiency and flexibility of encryption computing. For example, the serial-to-matrix conversion, round key addition, extended key calculation, byte substitution, row shift, column confusion, and other operations in the AES encryption process are processed as different subtasks.
[0077] Different-granularity subtasks refer to subtasks obtained by decomposing the encryption task according to the complexity of the computing task, the size of the data processing, and the computing method. Specifically, a coarse-granularity subtask usually has high computational complexity and large data processing scale, and focuses more on arithmetic operations; while a fine-granularity subtask has lower computational complexity and smaller data processing scale, and involves more logical operations and bit operations. In this embodiment, tasks involving arithmetic processing can be determined as coarse-granularity subtasks, and tasks involving Boolean logic processing can be determined as fine-granularity subtasks. For example, in the AES encryption algorithm, since the column confusion operation involves multiplication and addition operations on matrix elements, the column confusion operation belongs to a coarse-granularity subtask; while operations such as serial-to-matrix conversion, byte substitution, row shift, and round key addition involve logical calculations, and thus they all belong to fine-granularity subtasks.
[0078] Optionally, the encryption task can be decoupled by the computing task decoupling module 10 in the hybrid-granularity reconfigurable computing architecture to obtain coarse-granularity subtasks and fine-granularity subtasks. Specifically, coarse-granularity subtasks can be obtained by arithmetic processing array interface 12 decoupling, and fine-granularity subtasks can be obtained by Boolean processing array interface 14.
[0079] It can be understood that by decoupling the encryption task, a complex encryption task can be decomposed into multiple subtasks of different granularities, so as to allocate appropriate computing resources according to the characteristics of each subtask. For example, coarse-granularity subtasks usually require strong arithmetic operation capability and are suitable for execution on a dedicated arithmetic processing array unit 312; while fine-granularity subtasks focus more on logical operations and can be processed by a Boolean processing array unit 422. In this way, the advantages of different computing resources can be fully utilized, and resource waste can be avoided.
[0080] At step 204, based on the task parameters assigned to each subtask by the control module, the coarse-grained task execution module and the fine-grained task execution module are controlled to execute the subtasks to process the to-be-processed data assigned to the subtasks to obtain target data.
[0081] The task parameters are related information assigned to each subtask to guide the execution of specific operations. The task parameters at least include instruction information, which is used to indicate the specific operation content of the subtask.
[0082] The to-be-processed data is the original data assigned to each subtask for processing, and includes data exchanged between the coarse-grained task execution module and the fine-grained task execution module by the data exchange module. In the AES encryption process, the to-be-processed data can be plaintext data, key data, or intermediate result data obtained after processing by the previous subtask, wherein the intermediate result data can include first intermediate data and / or second intermediate data. For example, in the serial-to-matrix subtask, the to-be-processed data is serial plaintext data; in the round key addition subtask, the to-be-processed data is the plaintext matrix after matrix conversion and the corresponding group key.
[0083] The target data is the result data obtained after the subtask processes the to-be-processed data. Each subtask performs corresponding operations on the to-be-processed data according to its task parameters and working mode, and finally obtains the target data. For example, in the byte substitution subtask, the to-be-processed data is a state matrix, and the new state matrix obtained after the byte substitution operation is the target data.
[0084] Optionally, in the case of determining that the subtask is a coarse-grained subtask, the arithmetic processing array unit 312 in the hybrid-grained reconfigurable computing architecture can be controlled to process the subtask; in the case of determining that the subtask is a fine-grained subtask, the Boolean processing array unit 422 in the hybrid-grained reconfigurable computing architecture can be controlled to process the subtask.
[0085] It can be understood that by assigning specific task parameters to each subtask, the execution mode of the subtask can be flexibly adjusted according to different encryption requirements and scenarios. For example, in different encryption modes, by changing the instruction information in the task parameters, the subtask can adopt different configuration information and working modes, thereby realizing diversified encryption functions.
[0086] At step 206, the encrypted data is determined based on the target data obtained by at least one subtask.
[0087] The encrypted data is the ciphertext data obtained after processing the entire AES encryption task. The last subtask to perform data processing is selected from all subtasks, and the target data obtained from that subtask is designated as the encrypted data. Taking the AES-256 encryption algorithm as an example, the final state matrix obtained after 14 rounds of cyclic encryption is the encrypted data.
[0088] Optionally, the encrypted data can be determined based on the target data of the last subtask, or it can be determined based on the target data of the last few subtasks. The specific determination should be based on the actual encryption task.
[0089] Understandably, each subtask is a step in the encryption process. Only when all the necessary subtasks are executed correctly and the corresponding target data is obtained can the encrypted data be finally determined, thus avoiding omissions or errors in the encryption process.
[0090] The aforementioned data encryption method and apparatus based on a hybrid granularity reconfigurable computing architecture achieves efficient parallel processing and optimized resource utilization throughout the encryption process through the synergistic effect of three steps: decoupling, parameterized execution of subtasks, and determination of encrypted data. Subtasks of different granularities are executed in parallel on appropriate resources, and the processing method can be flexibly adjusted according to task parameters, greatly improving the speed and efficiency of encryption and meeting the needs of large-scale data encryption. Furthermore, the data encryption method and apparatus based on a hybrid granularity reconfigurable computing architecture of this application are highly adaptable and can be flexibly configured according to different encryption algorithms, data scales, and security requirements. Simultaneously, due to the independence and modular design of the subtasks, it is easy to add new subtasks or modify existing ones, enabling the system to easily cope with constantly changing encryption requirements and technological developments.
[0091] In one embodiment, such as Figure 10 As shown, based on the task parameters allocated to each subtask by the control module, the coarse-grained task execution module and the fine-grained task execution module are controlled to execute the subtasks, so as to process the data to be processed assigned to the subtasks to obtain the target data, including:
[0092] Step 302: For each subtask, the control module determines the first mapping relationship, and based on the first mapping relationship, determines the target configuration information corresponding to the instruction information in the task parameters allocated to the subtask.
[0093] The first mapping relationship includes the correspondence between instruction information and configuration information. This first mapping relationship can be a mapping table, a function, or other form. In the AES encryption algorithm, the first mapping relationship clearly defines which instruction information corresponds to specific configuration information.
[0094] The instruction information is part of the task parameter, and is used to indicate the specific operation type that the subtask needs to perform. For example, in the AES-256 encryption algorithm, the execution information can include an identifier indicating that the subtask performs byte substitution, row shifting, column confusion, round key addition, etc. For example, one instruction information can be "perform byte substitution operation", which informs the subtask that the current processing is related to byte substitution.
[0095] Optionally, the control module 20 can determine the target configuration information corresponding to the instruction information in the task parameter allocated to the subtask based on a preset mapping relationship table of the instruction information and the configuration information.
[0096] It can be understood that the purpose of this step is to provide accurate configuration basis for the specific execution of the subtask. The task parameter of the subtask only contains instruction information, and only knows the operation type to be performed, but does not know how to perform it specifically. Through the first mapping relationship, the instruction information is mapped to the target configuration information, so as to determine the detailed parameters and rules required for the subtask execution operation. For example, different encryption rounds can correspond to different configuration information, and through this step, the configuration required for the current round can be accurately obtained according to the instruction information.
[0097] Step 304, the control coarse-grained task execution module and fine-grained task execution module process the to-be-processed data allocated to the subtask according to the target configuration information, to obtain target data.
[0098] The configuration information is information corresponding to the instruction information, and is used to specify the specific execution mode and parameters of the subtask. The configuration information includes configuration information corresponding to the coarse-grained subtask and configuration information corresponding to the fine-grained subtask. The configuration information corresponding to the coarse-grained subtask includes at least one of encryption round number configuration, round key scheduling table configuration, and encryption mode configuration. For example, the encryption round number configuration determines how many encryption operations are performed in AES-256 encryption; the round key scheduling table configuration provides the key information required for each round of encryption. The configuration information corresponding to the fine-grained subtask includes at least one of substitution box configuration, row shifting rule configuration, and current round key data. For example, the substitution box configuration specifies the substitution rule of each byte in the byte substitution operation; the row shifting rule configuration describes the specific shifting mode of the row shifting operation.
[0099] Optionally, the arithmetic processing array unit 312 in the hybrid granularity reconfigurable computing architecture can process the data to be processed assigned to the coarse-grained subtasks according to the target configuration information to obtain the target data; and the Boolean processing array unit 422 in the fine-grained hybrid computing architecture can process the data to be processed assigned to the fine-grained subtasks according to the target configuration information to obtain the target data. For example, in the byte replacement subtask, each byte in the state matrix is replaced according to the target configuration information (replacement box configuration) to convert the data to be processed into a new state matrix (target data).
[0100] In this embodiment, through the first mapping relationship, different instruction information can correspond to different configuration information, allowing subtasks to be flexibly configured according to different needs. When it is necessary to improve the encryption algorithm or add new operation types, only the first mapping relationship and the corresponding configuration information need to be modified, without requiring large-scale modifications to the entire encryption system, thus exhibiting good scalability. Furthermore, separating instruction information and configuration information allows for quick retrieval of the corresponding configuration information based on the instruction information during subtask execution, avoiding the process of re-determining configuration parameters each time a subtask is executed, thereby improving the execution efficiency of the subtasks.
[0101] In one embodiment, such as Figure 11 As shown, the coarse-grained task execution module and the fine-grained task execution module process the data to be processed assigned to the subtasks according to the target configuration information to obtain the target data, including:
[0102] Step 402: Determine the second mapping relationship through the control module, and determine the target working mode corresponding to the target configuration information based on the second mapping relationship.
[0103] The second mapping relationship includes the correspondence between configuration information and operating modes. This second mapping relationship is also a pre-defined correspondence rule that describes the association between configuration information and operating modes. The second mapping relationship can also take the form of a mapping table, function, etc. Taking the AES-256 encryption algorithm as an example, the second mapping relationship clearly defines that different configuration information corresponds to specific operating modes.
[0104] Optionally, the target working mode corresponding to the target configuration information can be determined by the second mapping relationship stored in the control module 20.
[0105] Understandably, the target configuration information only specifies some parameters and rules, but does not directly indicate how the subtasks should operate. The target working mode is determined through the second mapping relationship, which solves the problem of the specific operating mode of the subtasks.
[0106] At step 404, based on the target working mode, the coarse-grained task execution module and the fine-grained task execution module are controlled to process the to-be-processed data allocated to the subtask to obtain target data.
[0107] Optionally, based on the determined target working mode, the coarse-grained task execution module 30 and the fine-grained task execution module 40 are controlled to perform actual operations on the to-be-processed data of the subtask, to convert the configuration information and the working mode into specific data processing actions, and finally obtain processed target data. For example, in a round key addition subtask, based on the round key addition mode, the state matrix is subjected to an exclusive OR operation with the current round key to complete the encryption processing of the data and obtain a new state matrix (target data).
[0108] In this embodiment, through the second mapping relationship, different target configuration information can correspond to different target working modes, so that the subtask can flexibly adjust the working mode according to specific encryption requirements and scenarios. When it is necessary to change some details of the encryption algorithm or to cope with different security requirements, it is only necessary to adjust the configuration information and the corresponding working mode, without the need to make large-scale modifications to the entire encryption system, thereby improving the adaptability of the system. In addition, the configuration information and the working mode are separated, and the corresponding target working mode can be quickly found according to the target configuration information when the subtask is executed, thereby avoiding the process of re-determining the working mode each time the subtask is executed, reducing unnecessary computational overhead, and improving the execution efficiency of the subtask.
[0109] In one embodiment, in the case where the subtask is a coarse-grained subtask, the target working mode corresponding to the coarse-grained subtask at least includes one of matrix multiplication and polynomial addition; in the case where the subtask is a fine-grained subtask, the target working mode corresponding to the fine-grained subtask at least includes one of a matrix conversion mode, a byte substitution mode, a row shift mode, and a round key addition mode.
[0110] It can be understood that, taking the AES encryption algorithm as an example, the column confusion operation is a matrix multiplication operation of a state matrix (a kind of matrix representation of data in the AES encryption process) and a fixed polynomial matrix. Specifically, each column of the state matrix is regarded as a polynomial, and the mixing and diffusion of data between columns are achieved by multiplication with a specific polynomial matrix, thereby enhancing the confusion effect of encryption. For example, for each column of the state matrix, it is subjected to multiplication with a 4*4 polynomial matrix, and this process is completed in the working mode of matrix multiplication. This operation causes complex transformation of data between columns, thereby increasing the security of the ciphertext.
[0111] For example, in the round key addition operation of the AES encryption process, although it is essentially an XOR operation, from the perspective of polynomials, XOR operation is equivalent to polynomial addition in a finite field. In this operation, performing bitwise XOR between the current round's subkey and the state matrix is equivalent to performing addition operation at the polynomial level. This step is performed in the target working mode of polynomial addition, which integrates key information into the data and further changes the state of the data.
[0112] In the first step of the AES encryption process, the input initial plaintext data needs to be converted into a state matrix according to certain rules, which is a matrix conversion mode, laying the foundation for subsequent encryption operations.
[0113] The byte substitution (SubBytes) operation adopts the byte substitution mode. In this mode, each byte in the state matrix will be replaced according to a pre-defined substitution box (S-box). The S-box is a 16*16 matrix that defines the replacement value for each byte. For example, for a byte in the state matrix, it is replaced by another byte by looking up the corresponding position in the S-box. This substitution operation is nonlinear, which can increase the confusion of encryption and make the relationship between plaintext and ciphertext more complex.
[0114] The row shift (ShiftRows) operation is performed in the row shift mode. In this mode, each row of the state matrix will be circularly shifted according to certain rules. Specifically, the first row remains unchanged, the second row moves one byte to the left, the third row moves two bytes to the left, and the fourth row moves three bytes to the left. This row shift operation realizes data diffusion in the row direction of the state matrix, making the data in different rows affect each other, further enhancing the security of encryption.
[0115] The round key addition (AddRoundKey) operation adopts the round key addition mode. In this mode, the bitwise XOR operation is performed between the current round's subkey and the state matrix. The subkey of each round is generated from the master key through the key expansion algorithm. Through the round key addition operation, the key information is combined with the data to change the state of the data, making the encryption process more complex and secure. The round key addition operation of each round is completed in this mode, which is an indispensable part of the AES encryption process.
[0116] In an embodiment, as shown in FIG. 1, the target data determined based on at least one subtask is used to determine encrypted data, including: Figure 12
[0117] Step 502, determining the last subtask that performs data processing from each subtask through a computing task decoupling module.
[0118] It can be understood that, taking the AES-256 encryption algorithm as an example, the entire encryption process is decoupled into a plurality of different sub-tasks by the computing task decoupling module 10, such as SubBytes, ShiftRows, MixColumns, and AddRoundKey, etc. These sub-tasks are executed in a certain order, and the last sub-task that performs data processing is determined from the sub-tasks. The last sub-task that performs data processing is determined, and the last sub-task that performs data processing in the AES-256 encryption algorithm is the AddRoundKey.
[0119] Step 504, the target data obtained by the last sub-task that performs data processing is determined as the encrypted data.
[0120] Optionally, when the last sub-task that performs data processing is a coarse-grained sub-task, the target data obtained by the arithmetic processing array unit 312 is determined as the encrypted data; when the last sub-task that performs data processing is a fine-grained sub-task, the target data obtained by the Boolean processing array unit 422 is determined as the encrypted data.
[0121] It can be understood that, taking the AES-256 encryption algorithm as an example, the target data obtained by the last round of the AddRoundKey is determined as the encrypted data, and is output from the fine-grained task execution module 40 in the mixed-grained reconfigurable computing architecture.
[0122] In this embodiment, by first determining the last sub-task that performs data processing from the sub-tasks, and then determining the target data obtained by the last sub-task that performs data processing as the encrypted data, the integrity of the entire encryption process can be ensured.
[0123] Exemplarily, taking the execution mechanism of the AES-256 encryption algorithm in the mixed-grained reconfigurable computing architecture as an example, the execution steps are as follows:
[0124] First step: the Boolean processing sub-unit 4220 is used to implement the operation of serial-to-matrix, the Boolean processing sub-unit 4220 is specified with the array number taking bit logic, and the 4*4 matrix division of taking 4 bytes can be directly implemented through the Boolean processing sub-unit 4220. The plaintext matrix and the ciphertext matrix are both presented in the form of a 4*4 matrix, and at the same time, the Boolean processing array unit 422 is interconnected in the form of a matrix on the layout of hardware;
[0125] The second step: first enter the initial round key addition, which is a 14-time cyclic pre-processing. The 256-bit key matrix data is output from the first data storage sub-module 43 and is divided into four key Wi (i: 0, 1, 2, 3) as the first group of grouped keys by four Boolean processing sub-units 4220 in the Boolean processing array unit 422, and then the XOR operation is performed on each row for a total of 8 times, and the operation is completed in one cycle by using eight Boolean processing sub-units 4220 to improve the speed.
[0126] The third step: this step is generally executed synchronously with the fourth step, but according to the order, the extended key needs to be calculated first and then given to the fourth step. The four groups of initial keys Wi (i: 0, 1, 2, 3) calculated in the second step are input from the continuous storage of the first data storage sub-module 43 to the calculation in the third step. Four Boolean processing sub-units 4220 are mapped as XOR logic, and other Boolean processing sub-units 4220 are mapped as G function operation calculation groups. W4i is first obtained by Boolean processing sub-unit 4220 XOR W4i-4 and G(W4i-1), and then W4i+1 is obtained by Boolean processing sub-unit 4220 XOR W4i-3 and W4i, W4i+2 and W4i+3 are calculated in the same way as W4i+1, and the generation of the grouped key is realized through this step, and 14 groups need to be generated. The calculation of the G function, first, the Boolean processing sub-unit 4220 left circularly shifts W4i-1 into four parts, then the coordinate value is replaced by the S-box from the first data storage sub-module 43 through the first cross switch sub-module 44 in the four Boolean processing sub-units 4220, and finally, the highest part of the four parts of W4i-1 is constant XOR by a Boolean processing sub-unit 4220;
[0127] The fourth step: the obtained state matrix is formally entered into the 14-round loop encryption. The first step is byte substitution. The byte substitution at the corresponding address is performed by the Boolean processing array unit 422 in combination with the S-box provided by the first data storage submodule 43. The fast output of the new state matrix is realized by the direct mapping of the calculation core in the Boolean processing submodule 4220. The second step is the row shift of the state matrix. The array composed of multiple Boolean processing submodules 4220 performs parallel shift of i bits on row i (i: 0, 1, 2, 3) according to the row number i. Compared with the serial, the speed is improved, and a single cycle can be completed. The third step is column confusion. The data exchange is performed by the data interaction submodule 50, and then the data in the data interaction submodule 50 is transmitted in batches to the arithmetic processing array unit 312. The arithmetic processing array unit 31 loads the column mixing matrix of the second data storage submodule 32 and performs matrix multiplication. The multiplication data also needs to be transmitted by the data interaction submodule 50. The result is obtained by the exclusive or calculation of the Boolean processing array unit 422. The product after the exclusive or of the matrix is the updated state matrix. The fourth step is round key addition. The updated state matrix is transmitted to the Boolean processing array unit 422 to perform round key addition. The latest state matrix is obtained by fast exclusive or of the array calculation of the Boolean processing array unit 422 and the W4i to W4i+3 group key. The above four steps are executed from the first round to the thirteenth round. In the fourteenth round, the column confusion operation is not performed. At this time, the arithmetic processing submodule 3120 is in a low-power running state. That is, the data obtained in the fourteenth round is the final encryption data.
[0128] Similarly, the decryption process is also similar operation. Therefore, the computer mechanism of the above-mentioned hybrid granularity reconfigurable computing architecture effectively improves the calculation speed of the AES-256 encryption algorithm.
[0129] It should be understood that although each step in the flowchart involved in each embodiment as described above is displayed in sequence according to the arrow, these steps are not necessarily executed in sequence according to the arrow. Unless otherwise stated herein, there is no strict order limitation for the execution of these steps, and these steps can be executed in other orders. Moreover, at least part of the steps in the flowchart involved in each embodiment as described above can include multiple steps or stages, which are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily sequential, but can be alternately executed with at least part of other steps or steps or stages in other steps.
[0130] Based on the same inventive concept, the embodiments of the present application also provide a data encryption device for implementing the mixed-granularity reconfigurable computing architecture as described above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme described in the above method, so the specific limitations in one or more data encryption device embodiments provided below can refer to the limitations of the mixed-granularity reconfigurable computing architecture described above, which will not be repeated here.
[0131] In one embodiment, as shown in Figure 13 a data encryption device is provided, comprising: a computing task decoupling module 602, a control module 604, and an encrypted data determination module 606, wherein:
[0132] The computing task decoupling module 602 is configured to decouple the encryption task to obtain a plurality of subtasks of different granularities.
[0133] The control module 604 is configured to control the coarse-granularity task execution module and the fine-granularity task execution module to execute the subtasks based on the task parameters allocated to each subtask, so as to process the to-be-processed data allocated to the subtasks to obtain target data; the to-be-processed data includes data exchanged between the coarse-granularity task execution module and the fine-granularity task execution module by the data exchange module.
[0134] The encrypted data determination module 606 is configured to determine the encrypted data based on the target data obtained by at least one subtask.
[0135] In one embodiment, the control module 604 is further configured to determine, for each subtask, a first mapping relationship, and determine, based on the first mapping relationship, target configuration information corresponding to instruction information in the task parameters allocated to the subtask; the first mapping relationship includes a correspondence between the instruction information and the configuration information; the coarse-granularity task execution module and the fine-granularity task execution module process the to-be-processed data allocated to the subtask according to the target configuration information to obtain the target data.
[0136] In one embodiment, the control module 604 is further configured to determine a second mapping relationship, and determine, based on the second mapping relationship, a target working mode corresponding to the target configuration information; the second mapping relationship includes a correspondence between the configuration information and the working mode; based on the target working mode, the coarse-granularity task execution module and the fine-granularity task execution module process the to-be-processed data allocated to the subtask to obtain the target data.
[0137] In one embodiment, the encrypted data determination module 606 is further configured to determine, by the computing task decoupling module, a last subtask that performs data processing from the subtasks; and determine the target data obtained by the last subtask that performs data processing as the encrypted data.
[0138] In one embodiment, the control module 604 is further configured to determine, when the subtask is a coarse-grained subtask, that the target working mode corresponding to the coarse-grained subtask includes at least one of matrix multiplication and polynomial addition; and when the subtask is a fine-grained subtask, that the target working mode corresponding to the fine-grained subtask includes at least one of matrix transformation mode, byte substitution mode, row shift mode, and round key addition mode.
[0139] In one embodiment, the control module 604 is further configured to determine, when the subtask is a coarse-grained subtask, that the target configuration information corresponding to the coarse-grained subtask includes at least one of the following: encryption round number configuration, round key scheduling table configuration, and encryption mode configuration; and when the subtask is a fine-grained subtask, that the target configuration information corresponding to the fine-grained subtask includes at least one of the following: replacement box configuration, row shift rule configuration, and current round key data.
[0140] Each module in the aforementioned data encryption device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in the processor of a computer device in hardware form or independent of it, or stored in the memory of the computer device in software form, so that the processor can call and execute the operations corresponding to each module.
[0141] In one embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be as follows: Figure 14 As shown, the computer device includes a processor, memory, communication interface, display screen, and input devices connected via a system bus. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The communication interface is used for wired or wireless communication with external terminals; wireless communication can be achieved through Wi-Fi, mobile cellular networks, NFC (Near Field Communication), or other technologies. When the computer program is executed by the processor, it implements a hybrid-granularity reconfigurable computing architecture. The display screen can be an LCD screen or an e-ink display screen. The input devices can be a touch layer covering the display screen, buttons, a trackball, or a touchpad mounted on the computer device casing, or an external keyboard, touchpad, or mouse.
[0142] Those skilled in the art will understand that Figure 14The structure shown in the figure is only a block diagram of part of the structure related to the scheme of the present application, and does not constitute a limitation on the computer device to which the scheme of the present application is applied. The specific computer device can include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0143] In an embodiment, a computer device is provided, including a memory and a processor, the memory storing a computer program, and the processor implementing the steps in the above method embodiments when executing the computer program.
[0144] In an embodiment, a computer readable storage medium is provided, storing a computer program, and the computer program implementing the steps in the above method embodiments when executed by a processor.
[0145] In an embodiment, a computer program product is provided, including a computer program, and the computer program implementing the steps in the above method embodiments when executed by a processor.
[0146] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data for analysis, stored data, displayed data, etc.) involved in the present application are all information and data authorized by the user or authorized by all parties.
[0147] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program. The computer program can be stored in a non-volatile computer readable storage medium, and when the computer program is executed, the processes of the above-mentioned embodiments of the methods can be included. Any reference to memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical storage, high-density embedded non-volatile memory, resistive memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration but not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM), etc. The database involved in the embodiments provided in the present application can include at least one of a relational database and a non-relational database. The non-relational database can include a distributed database based on a block chain, etc., without being limited thereto. The processor involved in the embodiments provided in the present application can be a general-purpose processor, a central processing unit, a graphics processing unit, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., without being limited thereto.
[0148] Any combination of the technical features of the above embodiments can be made. In order to make the description simple, all possible combinations of the technical features in the above embodiments are not described, however, as long as the combination of the technical features does not exist, it should be considered as the scope of the present application.
[0149] The above embodiments only express several implementation manners of the present application, and the description is more specific and detailed, but it should not be understood as a limitation on the scope of the patent of the present application. It should be pointed out that for ordinary skilled in the art, without departing from the concept of the present application, a number of modifications and improvements can be made, which are all within the protection scope of the present application. Therefore, the protection scope of the present application should be subject to the appended claims.
Claims
1. A data encryption method based on a hybrid-granularity reconfigurable computing architecture, characterized in that, The hybrid-granularity reconfigurable computing architecture comprises a computing task decoupling module, a control module, a coarse-granularity task execution module, a fine-granularity task execution module, and a data interaction module, and the method comprises the following steps: The computing task decoupling module is used to decouple an encryption task to obtain a plurality of subtasks of different granularities; The control module is used to assign task parameters to each of the subtasks, and the coarse-granularity task execution module and the fine-granularity task execution module are controlled to execute the subtasks to process the to-be-processed data assigned to the subtasks to obtain target data; the to-be-processed data comprises data exchanged between the coarse-granularity task execution module and the fine-granularity task execution module by the data interaction module; The target data obtained by at least one of the subtasks is used to determine encryption data.
2. The method of claim 1, wherein, The control module is used to determine a first mapping relationship for each of the subtasks, and based on the first mapping relationship, target configuration information corresponding to instruction information in the task parameters assigned to the subtask is determined; the first mapping relationship comprises a corresponding relationship between instruction information and configuration information; The coarse-granularity task execution module and the fine-granularity task execution module are controlled to process the to-be-processed data assigned to the subtask according to the target configuration information to obtain the target data. The control module is used to determine a second mapping relationship, and based on the second mapping relationship, a target working mode corresponding to the target configuration information is determined; the second mapping relationship comprises a corresponding relationship between the configuration information and the working mode; 3. The method of claim 2, wherein, The coarse-granularity task execution module and the fine-granularity task execution module are controlled to process the to-be-processed data assigned to the subtask according to the target working mode to obtain the target data. The control module is used to determine a last subtask that performs data processing from each of the subtasks; The target data obtained by the last subtask that performs data processing is determined as the encryption data.
4. The method according to any one of claims 1 to 3, characterized in that, In the case where the subtask is a coarse-granularity subtask, the target working mode corresponding to the coarse-granularity subtask comprises at least one of matrix multiplication and polynomial addition; in the case where the subtask is a fine-granularity subtask, the target working mode corresponding to the fine-granularity subtask comprises at least one of matrix conversion mode, byte replacement mode, row shift mode, and round key addition mode. 5. The method of claim 2, wherein, 6. The method of claim 2, wherein, In a case where the subtask is a coarse-grained subtask, the target configuration information corresponding to the coarse-grained subtask at least includes one of a number of encryption rounds configuration, a round key scheduling table configuration, and an encryption mode configuration; In a case where the subtask is a fine-grained subtask, the target configuration information corresponding to the fine-grained subtask at least includes one of a substitution box configuration, a row shift rule configuration, and current round key data.
7. A data encryption device, characterized by comprising: The apparatus comprises: a computing task decoupling module configured to decouple an encryption task to obtain a plurality of subtasks of different granularities; a control module configured to control the coarse-grained task execution module and the fine-grained task execution module to execute the subtasks based on task parameters allocated to the subtasks, so as to process to-be-processed data allocated to the subtasks to obtain target data; the to-be-processed data includes data exchanged between the coarse-grained task execution module and the fine-grained task execution module by the data exchange module; an encrypted data determination module configured to determine encrypted data based on the target data obtained by at least one of the subtasks.
8. A computer device comprising a memory and a processor, the memory storing a computer program, characterized in that, The processor executes the computer program to implement the steps of the method in any one of claims 1 to 6.
9. A computer-readable storage medium having stored thereon a computer program, characterized in that, The computer program is executed by the processor to implement the steps of the method in any one of claims 1 to 6.
10. A computer program product comprising a computer program, characterized in that, The computer program is executed by the processor to implement the steps of the method in any one of claims 1 to 6.