A Local Area Network Encryption / Decryption Accelerator System Based on Ethernet Communication
By using a LAN encryption/decryption accelerator system based on network interface communication, and by employing a custom MAC layer protocol and a maximum flow minimum cost algorithm, the system solves the problems of limited device encryption/decryption performance and unbalanced load, thereby improving data transmission efficiency and device performance.
Patent Information
- Application Number
- CN202211240518.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-10-14
- Publication Date
- 2025-11-14
- Estimated Expiration
- 2042-10-14
AI Technical Summary
In existing technologies, the device's own encryption and decryption operations consume a lot of computing resources, and the encryption and decryption performance is limited by CPU performance. Traditional heuristic algorithms cannot achieve load balancing.
The LAN encryption/decryption accelerator system based on network interface communication utilizes a custom MAC layer protocol to enable direct communication between the accelerator and the host, employs a maximum flow minimum cost algorithm for task allocation, and constructs a flow network model to balance the computational resource load.
It improved the encryption and decryption performance of the device, reduced the consumption of computing resources, achieved load balancing, and improved data transmission efficiency.
Smart Images

Figure CN115514745B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of communication technology, and in particular to a local area network encryption / decryption accelerator system based on network port communication. Background Technology
[0002] With the continuous development of information science and technology, the security and efficiency of data transmission are becoming increasingly important. Data encryption and decryption are generally used to ensure data transmission security. Traditional encryption and decryption operations are performed by the device itself, which consumes significant computing resources. While optimizations to existing encryption algorithms have improved performance to some extent, they haven't fundamentally solved the problem; the device's encryption and decryption performance remains limited by its CPU performance. Furthermore, while traditional heuristic algorithms can achieve good results in task allocation, they often fail to achieve load balancing in resource allocation. Summary of the Invention
[0003] In view of the shortcomings and problems of the existing technologies and algorithms described above, the purpose of this invention is to provide a local area network encryption and decryption accelerator system based on network interface communication, so as to solve the problem that the device itself consumes a lot of computing resources for encrypting and decrypting data; to solve the problem that existing encryption algorithms cannot fundamentally solve the problem that the encryption and decryption performance of the device is limited by the CPU performance of the device itself; and to solve the problem that traditional heuristic algorithms cannot achieve load balancing when allocating tasks.
[0004] The first aspect of this invention provides a local area network encryption / decryption accelerator system based on Ethernet communication. The accelerator is externally placed on the host to be encrypted / decrypted through an RJ45 Ethernet interface. Communication and data transmission between the accelerator and the host are realized through a custom protocol based on the MAC layer, and the encryption / decryption tasks are dynamically and evenly distributed to each accelerator.
[0005] Preferably, when the accelerator and the host are transmitting data within a local area network, the custom protocol based on the MAC layer requires the accelerator and the host not to use the standard and complete TCP / IP protocol stack, but to bypass the upper transport layer and network layer and transmit data directly through the MAC layer, thereby improving the data transmission speed and efficiency.
[0006] Preferably, a local area network is constructed using the same router, and the accelerator and the host communicate and transmit data within the local area network.
[0007] Preferably, the custom protocol setting based on the MAC layer is to use a custom frame format on the basis of the standard MAC layer frame format, and add optional fields to represent data transmission information to ensure reliable and stable transmission.
[0008] Preferably, after the host connects to the accelerator via a custom protocol based on the MAC layer, it uses an encryption / decryption task allocation algorithm to distribute tasks to the accelerator in a suitable manner.
[0009] Preferably, when the accelerator computing power is balanced, unexecuted tasks are treated as virtual host nodes to construct a computing power balanced flow network model. Based on the maximum flow minimum cost method, similar tasks with large computing loads are allocated sequentially until all tasks are evenly allocated to the accelerator.
[0010] Preferably, when the computing power of the accelerators is uneven, the accelerators are expanded into multiple virtual nodes with balanced computing power based on the size of their computing power to construct an uneven computing power flow network model.
[0011] Preferably, when the computational load of encryption and decryption tasks is different, the weights are converted and the tasks are assigned to each accelerator.
[0012] Preferably, encryption and decryption computing resources within the local area network are dynamically allocated, and accelerator computing resources in the network are dynamically adjusted in real time.
[0013] Preferably, implementing communication and data transmission between the accelerator and the host through a custom protocol based on the MAC layer includes the following steps:
[0014] When the host program starts, the initialization function is called to initialize the global variables, threads, and slave devices required for operation in the host system;
[0015] The user then calls the function interface to pass in the encryption / decryption task data, writes the encryption / decryption data to be processed into the system data pool, and assigns a data pool number.
[0016] The host calculates how to allocate the task to the slave accelerator based on the scheduling algorithm of maximum flow and minimum cost, and writes the task into the queue to be sent;
[0017] Obtain the data number to be sent, retrieve the data from the corresponding location in the data pool, assemble the data into packets, and send them to each accelerator;
[0018] Each accelerator performs encryption and decryption operations, and then sends the processed encrypted and decrypted data back to the host; the host parses the returned data packets and then writes the data back to the data pool.
[0019] The data is timed out based on the sending time to determine whether the host has received the data packet returned by the slave. If a timeout occurs, the task is retransmitted, and the process is repeated until the encryption / decryption task is completed.
[0020] Users retrieve the final encrypted / decrypted data by calling the function interface through the data pool number.
[0021] A second aspect of this invention provides a local area network encryption / decryption accelerator system based on network port communication, comprising a host system, the host system including:
[0022] An initialization module initializes the global variables, threads, and slave system required for program execution.
[0023] The sending thread sends the data packets to be sent to the slave system.
[0024] A receiving thread receives and parses data, and then writes the parsed data back to the data pool.
[0025] The retransmission module detects data timeout retransmissions and the operating status of the slave system.
[0026] A daemon process that ensures the sustainability of program operation and restarts the system when a fatal problem occurs in the program.
[0027] As described above, the present invention provides a local area network encryption / decryption accelerator technology and system based on network port communication, which has the following beneficial effects:
[0028] The encryption / decryption accelerator technology and system of this invention aim to offload computationally intensive encryption / decryption operations to external hardware accelerators. This solves the problem that the performance limitations of encryption / decryption algorithms cannot fundamentally address the limitation of the device's own CPU performance, thus improving the device's encryption / decryption performance. This invention addresses the communication and data transmission issues between the host device and the accelerator through a custom MAC layer protocol. This custom protocol allows data transmission to bypass the transport and network layers, removing unnecessary redundant headers, thereby increasing the effective data payload ratio and improving data transmission efficiency. This invention also implements a task scheduling mechanism to achieve high-speed and reasonable allocation of encryption / decryption tasks from the encryption / decryption device to the accelerator. For both balanced and unbalanced accelerator computing power scenarios, task allocation algorithms based on the maximum flow minimum cost algorithm are designed to construct a flow network model and perform optimal task allocation. This improves the accelerator's encryption / decryption efficiency while balancing the load on the accelerator's computing resources, thereby enhancing the device's encryption / decryption performance. This invention proposes a technology and system for distributing computationally intensive encryption / decryption tasks to external hardware accelerators within a local area network. This encryption / decryption accelerator technology and system successfully enables any host device within a local area network to perform encryption and decryption operations, and successfully improves the encryption and decryption performance of the host device. Attached Figure Description
[0029] Figure 1 This is a schematic diagram of the system framework of an encryption / decryption accelerator system provided in one embodiment;
[0030] Figure 2 This is a schematic diagram illustrating an application scenario of an encryption / decryption accelerator system provided in one embodiment.
[0031] Figure 3 This is a schematic diagram illustrating the data encryption and decryption process of an encryption / decryption accelerator provided in one embodiment.
[0032] Figure 4 A schematic diagram of the encryption / decryption accelerator task allocation process provided in one embodiment;
[0033] Figure 5 This is a schematic diagram illustrating the hardware modules and processes of an encryption / decryption accelerator system provided in one embodiment. Detailed Implementation
[0034] The following specific examples illustrate the implementation of the present invention. Those skilled in the art can easily understand other advantages and effects of the present invention from the content disclosed in this specification. The present invention can also be implemented or applied through other different specific embodiments, and various details in this specification can also be modified or changed based on different viewpoints and applications without departing from the spirit of the present invention. It should be noted that, unless otherwise specified, the following embodiments and features described therein can be combined with each other.
[0035] It should be noted that the illustrations provided in the following embodiments are only schematic representations of the basic concept of the present invention. Therefore, the drawings only show the components related to the present invention and are not drawn according to the actual number, shape and size of the components in the actual implementation. In the actual implementation, the form, quantity and proportion of each component can be arbitrarily changed, and the layout of the components may also be more complex.
[0036] Please see Figure 1 This invention provides an encryption / decryption accelerator technology and system. In this system, the encryption / decryption device acts as the host, offloading the most computationally intensive encryption / decryption operations to an external hardware accelerator. The system first implements communication and data transmission between the slave accelerators and the host through a custom protocol designed based on the MAC layer; then, through a task scheduling algorithm, it allocates encryption / decryption tasks to the slave accelerators in the most suitable way, achieving accelerator load balancing.
[0037] Please see Figure 2 This invention provides an encryption / decryption accelerator technology and system. Using this system, host devices can delegate encryption / decryption operations to the accelerator, improving the host device's encryption / decryption performance without requiring hardware upgrades. Furthermore, the encryption / decryption resources of slave devices can be flexibly allocated across multiple local area network devices. This system can be widely applied in daily work and life.
[0038] Please see Figure 3This invention provides an encryption / decryption accelerator technology and system. The process of completing an encryption / decryption task using this technology and system includes the following steps:
[0039] S100, when starting the host program, the initialization function is called to initialize the global variables, threads and slave devices required for operation in the host system;
[0040] S200, then the user calls the function interface to pass in the encryption / decryption task data, writes the encryption / decryption data to be processed into the system data pool, and assigns a data pool number;
[0041] S300: The host calculates how to allocate the task to the slave accelerator based on the scheduling algorithm based on maximum flow and minimum cost, and writes the task into the queue to be sent.
[0042] S400 obtains the data number to be sent, retrieves the data from the corresponding location in the data pool, assembles the data into packets, and sends them to each accelerator.
[0043] In the S500, each accelerator performs encryption and decryption operations, and then sends the processed encrypted and decrypted data back to the host. The host parses the returned data packets and then writes the data back to the data pool.
[0044] The S600 performs timeout checks on the data based on the transmission time to determine whether the host has received the data packet returned by the slave. If a timeout occurs, the task is retransmitted, and the process is repeated until the encryption / decryption task is completed.
[0045] In the S700, users can obtain the final encrypted / decrypted data by calling the function interface through the data pool number.
[0046] Please see Figure 4 The present invention also designs a task allocation method, comprising the following steps:
[0047] S100, sort all encryption and decryption tasks according to computational complexity;
[0048] S200 allocates tasks based on the results of the maximum flow minimum cost algorithm for the same type of task with the highest computational cost.
[0049] S300 updates the flow network model and the task status of all hosts and slaves;
[0050] S400: Determine if all tasks have been assigned, and loop until all types of tasks have been assigned.
[0051] like Figure 5 As shown, the present invention provides an encryption / decryption accelerator system, comprising:
[0052] The initialization module M10 is used to initialize the global variables, threads, and slave system required for program execution;
[0053] Sending thread M20 is used to receive data requests for encryption / decryption tasks, write the encryption / decryption data to be processed into the system data pool, calculate how to allocate the task to the slave accelerator based on the scheduling algorithm based on maximum flow and minimum cost, finally obtain the data number to be sent, retrieve the data from the corresponding position in the data pool, assemble the data into packets, and send them to the slave accelerator.
[0054] Receive thread M30 is used to receive and obtain the data packets returned by each slave accelerator after encryption and decryption, parse the data packets, and write the parsed data back to the data pool;
[0055] The retransmission module M40 is used to perform timeout detection on data based on the data transmission time retained by the sending thread to determine whether data needs to be retransmitted; and to determine the slave device's operating status based on the number of timeout retransmissions.
[0056] The daemon M50 is used to ensure the sustainability of program operation and to restart the system when a fatal problem occurs in the program.
[0057] In summary, this invention provides a LAN encryption / decryption accelerator system based on Ethernet communication. The system completes encryption / decryption operations by first calling an initialization function during host program startup to initialize global variables, threads, and slave devices required for operation within the host system. Then, the user calls a function interface to input encryption / decryption task data, writing the data to be processed into the system data pool and assigning a data pool number. Next, the host calculates how to allocate the task to the slave accelerators based on a maximum flow minimum cost scheduling algorithm and writes the task into a send queue. The system obtains the data pool number to be sent, retrieves the data from the corresponding position in the data pool, assembles it into packets, and sends them to each accelerator. Each accelerator performs encryption / decryption operations and then sends the processed encryption / decryption data back to the host. The host parses the returned data packets and writes the data back to the data pool. Timeout checks are performed based on the sending time to determine if the host has received the data packets returned by the slave. If a timeout occurs, the task is retransmitted, and this process continues until the encryption / decryption task is completed. Finally, the user retrieves the final encryption / decryption data by calling a function interface using the data pool number. This technology and system first solves the communication and data transmission problem between the host device and the accelerator by designing a custom protocol based on the MAC layer. Using this custom protocol allows data transmission to bypass the transport and network layers, removing unnecessary redundant headers, thereby increasing the effective data payload ratio and improving data transmission efficiency. The invention also implements a task scheduling mechanism to achieve high-speed and reasonable allocation of encryption and decryption tasks from the encryption / decryption device to the accelerator. For both balanced and unbalanced accelerator computing power scenarios, task allocation algorithms based on the maximum flow minimum cost algorithm are designed to construct a flow network model and perform optimal task allocation. This improves the encryption / decryption efficiency of the accelerator while balancing the load on the accelerator's computing resources, thus enhancing the device's encryption / decryption performance.
[0058] The above embodiments are merely illustrative of the principles and effects of the present invention and are not intended to limit the invention. Any person skilled in the art can modify or alter the above embodiments without departing from the spirit and scope of the present invention. Therefore, all equivalent modifications or alterations made by those skilled in the art without departing from the spirit and technical concept disclosed in the present invention should still be covered by the claims of the present invention.
Claims
1. A local area network encryption / decryption accelerator system based on network port communication, characterized in that, include: The system consists of an RJ45 Ethernet interface, a host, and accelerators. The accelerators are externally placed on the host that needs encryption / decryption via the RJ45 Ethernet interface. Communication and data transmission between the accelerators and the host are achieved through a custom protocol based on the MAC layer, and the encryption / decryption tasks are dynamically and evenly distributed to each accelerator. After the host connects to the accelerator via a custom protocol based on the MAC layer, it uses an encryption / decryption task allocation algorithm to distribute tasks to the accelerator in a suitable manner. When the accelerator computing power is balanced, the unexecuted tasks are treated as virtual host nodes to build a computing power balanced flow network model. The same type of tasks with large computing power are allocated in turn according to the maximum flow minimum cost method until all tasks are evenly allocated to the accelerator. When the computing power of accelerators is uneven, the accelerators are expanded into multiple virtual nodes with balanced computing power based on the size of their computing power to construct a network model for uneven computing power flow.
2. The LAN encryption / decryption accelerator system based on network port communication according to claim 1, characterized in that, When the accelerator and the host are communicating and transmitting data within a local area network, the custom protocol based on the MAC layer requires the accelerator and the host not to use the standard and complete TCP / IP protocol stack. Instead, they bypass the upper transport layer and network layer and transmit data directly through the MAC layer, which improves the data transmission speed and efficiency.
3. The LAN encryption / decryption accelerator system based on network port communication according to claim 2, characterized in that, A local area network (LAN) is built using the same router, and the accelerator and the host communicate and transmit data within the LAN.
4. The LAN encryption / decryption accelerator system based on network port communication according to claim 2, characterized in that, Custom protocol settings based on the MAC layer are based on the standard MAC layer frame format, using a custom frame format and adding optional fields to represent data transmission information to ensure reliable and stable transmission.
5. The LAN encryption / decryption accelerator system based on network port communication according to claim 1, characterized in that, When the computational load of encryption and decryption tasks differs, weights are converted to allocate the tasks to various accelerators.
6. The LAN encryption / decryption accelerator system based on network port communication according to claim 1, characterized in that, Dynamically allocate encryption and decryption computing resources within the local area network and dynamically adjust the computing resources of accelerators in the network in real time.
7. The LAN encryption / decryption accelerator system based on network port communication according to claim 1, characterized in that, Implementing communication and data transmission between the accelerator and the host using a custom protocol based on the MAC layer includes the following steps: When the host program starts, the initialization function is called to initialize the global variables, threads, and slave devices required for operation in the host system; The user then calls the function interface to pass in the encryption / decryption task data, writes the encryption / decryption data to be processed into the system data pool, and assigns a data pool number. The host calculates how to allocate the task to the slave accelerator based on the scheduling algorithm of maximum flow and minimum cost, and writes the task into the queue to be sent; Obtain the data number to be sent, retrieve the data from the corresponding location in the data pool, assemble the data into packets, and send them to each accelerator; Each accelerator performs encryption and decryption operations, and then sends the processed encrypted and decrypted data back to the host; the host parses the returned data packets and then writes the data back to the data pool. The data is timed out based on the sending time to determine whether the host has received the data packet returned by the slave. If a timeout occurs, the task is retransmitted, and the process is repeated until the encryption / decryption task is completed. Users retrieve the final encrypted / decrypted data by calling the function interface through the data pool number.
8. A local area network encryption / decryption accelerator system based on network port communication according to any one of claims 1-7, characterized in that, It also includes a host system, the host system comprising: An initialization module initializes the global variables, threads, and slave system required for program execution. The sending thread sends the data packets to be sent to the slave system. A receiving thread receives and parses data, and then writes the parsed data back to the data pool. The retransmission module detects data timeout retransmissions and the operating status of the slave system. A daemon process that ensures the sustainability of program operation and restarts the system when a fatal problem occurs in the program.
Citation Information
Patent Citations
Packet transmission method, transmission apparatus and system within LAN
CN101141375A
Centralized invoice authentification system and authentification method
CN101751712A