Real-time encryption method and device based on network attached storage device
By creating socket pairs and encryption processing threads in the NAS device, the AES algorithm is used to perform real-time encryption processing on the data to be encrypted. The encryption progress log file enables breakpoint resumption and resource optimization allocation, which solves the real-time and security problems of traditional NAS devices in scenarios with large files or multi-threaded access, and realizes an efficient and secure encryption and decryption process.
Patent Information
- Application Number
- CN202511449540.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-11
- Publication Date
- 2025-11-11
- Estimated Expiration
- 2045-10-11
AI Technical Summary
Traditional NAS devices suffer from poor real-time performance and insufficient security in data encryption, especially in scenarios involving large files or multi-threaded access. Existing AES encryption and decryption schemes struggle to balance high security and high efficiency.
By creating socket pairs and encryption processing threads in the NAS device, the AES algorithm is used to perform real-time encryption of the data to be encrypted. Breakpoint resumption and resource optimization allocation are achieved through encryption progress logging files, thereby improving the security and real-time performance of the encryption and decryption process.
It enables efficient, secure, and real-time AES encryption and decryption for NAS devices in scenarios involving large files or multi-threaded access, improving the security, real-time performance, and continuity of the encryption and decryption process.
Smart Images

Figure CN120934906A_ABST
Abstract
Description
Technical Field
[0001] This application belongs to the field of digital information technology, and specifically relates to a real-time encryption method and apparatus based on a network-attached storage device. Background Technology
[0002] With the development of information technology, the coordinated protection of data confidentiality, integrity, and availability has become a core requirement for information security in enterprise-level data storage and cloud services. NAS (Network Attached Storage) devices, as the core of enterprise data storage, are widely used for backup, sharing, and remote access. However, traditional NAS devices suffer from poor real-time performance and insufficient security in data encryption, making them unsuitable for massive amounts of data and complex network environments. The AES (Advanced Encryption Standard) algorithm boasts high encryption strength and efficiency, making it the preferred solution for data encryption in NAS devices. However, its implementation in NAS deployments faces several challenges: AES encryption and decryption can slow down NAS I / O performance, and balancing high security with high concurrency access is difficult. Existing software-based AES encryption schemes consume significant CPU (Central Processing Unit) resources, and existing hardware-based AES encryption schemes only support fixed data block encryption, making it difficult to flexibly address the encryption needs of file-level or streaming data.
[0003] Therefore, how to overcome the above shortcomings and achieve efficient, secure, and real-time AES encryption and decryption for NAS devices is a problem that urgently needs to be solved by people in this field. Summary of the Invention
[0004] This application provides a real-time encryption method and apparatus based on a network attached storage device (NAS), aiming to achieve efficient, secure, and real-time AES encryption and decryption for NAS devices, especially for large files or multi-threaded access scenarios, to improve the security, real-time performance, and continuity of the encryption and decryption process.
[0005] In a first aspect, embodiments of this application provide a real-time encryption method based on a network-attached storage device, the method comprising: Upon receiving an encryption request from the requesting end, a corresponding socket pair and an encryption processing thread are created based on the encryption request; wherein, the socket pair includes a server socket and a client socket, and the server socket and the client socket belong to the same transmission control protocol; Bind the server socket to the encryption processing thread; Upon receiving the data to be encrypted sent by the requesting end, the data to be encrypted is transmitted to the server socket through the client socket. The encryption processing thread bound to the server socket performs real-time encryption processing on the data to be encrypted to obtain the encryption result.
[0006] Optionally, the method further includes: Create an encryption progress log file to determine the real-time encryption progress position; The real-time encryption progress position is stored in the encryption progress record file according to a preset cycle.
[0007] Optionally, after storing the real-time encryption progress position in the encryption progress record file according to a preset period, the method further includes: Upon receiving the encryption interruption location request sent by the requesting end, the encryption interruption location is determined based on the encryption progress record file; The encryption interruption location is sent to the requesting end so that the requesting end can resend the encryption request and continue transmitting the data to be encrypted based on the encryption interruption location.
[0008] Optionally, after creating the encrypted progress log file, the method further includes: Based on the encrypted progress record file, an interrupted resume verification message is generated and sent to the requesting end. Accordingly, determining the encryption interruption location based on the encryption progress record file includes: Upon receiving the encryption interruption location request from the requesting end, and after verifying the interruption resumption verification information in the encryption interruption location request, the encryption interruption location is determined based on the encryption progress record file.
[0009] Optionally, generating interrupted resume verification information based on the encrypted progress record file includes: Based on the universally unique identifier of the encryption request and the file identification information and generation time information of the encryption progress record file, interrupted resume verification information is generated.
[0010] Optionally, before creating the corresponding socket pair and encryption processing thread based on the encryption request, the method further includes: The processing priority is determined based on the encryption request, and the preset resource allocation information is determined based on the processing priority; wherein, the preset resource allocation information includes the central processing unit quota and input / output bandwidth; Accordingly, the creation of the corresponding socket pair and encryption processing thread based on the encryption request includes: Socket pairs are created based on the input / output bandwidth, and encryption processing threads are created based on the central processing unit quota. Accordingly, the step of transmitting the data to be encrypted to the server socket through the client socket, and then performing real-time encryption processing on the data to be encrypted by the encryption processing thread bound to the server socket to obtain the encryption result, includes: Obtain current resource occupancy information, and if it is identified that the current resource occupancy information cannot meet the preset resource allocation information, determine the target resource allocation information corresponding to the encryption request based on the processing priority and the current resource occupancy information; Based on the target input / output bandwidth in the target resource allocation information, the data to be encrypted is transmitted to the server socket through the client socket. The encryption processing thread bound to the server socket performs real-time encryption processing on the data to be encrypted based on the target CPU quota in the target resource allocation information to obtain the encryption result.
[0011] Optionally, after obtaining the encryption result, the method further includes: Upon receiving a decryption request from the requesting client, a corresponding socket pair and a decryption processing thread are created based on the decryption request; wherein, the socket pair includes a server socket and a client socket; Bind the server socket to the decryption processing thread; The client socket and the server socket are used to receive the decryption processing result of the encrypted data corresponding to the decryption request from the decryption processing thread in real time, and send the decryption processing result to the requesting end in real time.
[0012] Secondly, embodiments of this application provide a real-time encryption device based on a network-attached storage device, the device comprising: A creation module is used to create a corresponding socket pair and an encryption processing thread based on the encryption request sent by the requesting end when the encryption request is received; wherein, the socket pair includes a server socket and a client socket, and the server socket and the client socket belong to the same transmission control protocol; A binding module is used to bind the server-side socket to the encryption processing thread; The encryption module is used to transmit the data to be encrypted to the server socket through the client socket when it receives the data to be encrypted sent by the requesting end, and to perform real-time encryption processing on the data to be encrypted by the encryption processing thread bound to the server socket to obtain the encryption result.
[0013] Optionally, the device is also used for: Create an encryption progress log file to determine the real-time encryption progress position; The real-time encryption progress position is stored in the encryption progress record file according to a preset cycle.
[0014] Optionally, the device is also used for: Upon receiving the encryption interruption location request sent by the requesting end, the encryption interruption location is determined based on the encryption progress record file; The encryption interruption location is sent to the requesting end so that the requesting end can resend the encryption request and continue transmitting the data to be encrypted based on the encryption interruption location.
[0015] Optionally, the device is also used for: Based on the encrypted progress record file, an interrupted resume verification message is generated and sent to the requesting end. Accordingly, determining the encryption interruption location based on the encryption progress record file includes: Upon receiving the encryption interruption location request from the requesting end, and after verifying the interruption resumption verification information in the encryption interruption location request, the encryption interruption location is determined based on the encryption progress record file.
[0016] Optionally, the device is also used for: Based on the universally unique identifier of the encryption request and the file identification information and generation time information of the encryption progress record file, interrupted resume verification information is generated.
[0017] Optionally, the device is also used for: The processing priority is determined based on the encryption request, and the preset resource allocation information is determined based on the processing priority; wherein, the preset resource allocation information includes the central processing unit quota and input / output bandwidth; Accordingly, the creation module is specifically used for: Upon receiving an encryption request from the requesting end, a socket pair is created based on the input / output bandwidth, and an encryption processing thread is created based on the central processing unit quota; wherein, the socket pair includes a server socket and a client socket, and the server socket and the client socket belong to the same transmission control protocol; Accordingly, the encryption module is specifically used for: Obtain current resource occupancy information, and if it is identified that the current resource occupancy information cannot meet the preset resource allocation information, determine the target resource allocation information corresponding to the encryption request based on the processing priority and the current resource occupancy information; Based on the target input / output bandwidth in the target resource allocation information, the data to be encrypted is transmitted to the server socket through the client socket. The encryption processing thread bound to the server socket performs real-time encryption processing on the data to be encrypted based on the target CPU quota in the target resource allocation information to obtain the encryption result.
[0018] Optionally, the device is also used for: Upon receiving a decryption request from the requesting client, a corresponding socket pair and a decryption processing thread are created based on the decryption request; wherein, the socket pair includes a server socket and a client socket; Bind the server socket to the decryption processing thread; The client socket and the server socket are used to receive the decryption processing result of the encrypted data corresponding to the decryption request from the decryption processing thread in real time, and send the decryption processing result to the requesting end in real time.
[0019] Thirdly, embodiments of this application provide an electronic device including a processor, a memory, and a program or instructions stored in the memory and executable on the processor, wherein the program or instructions, when executed by the processor, implement the method described in the first aspect.
[0020] Fourthly, embodiments of this application provide a readable storage medium on which a program or instructions are stored, which, when executed by a processor, implement the method described in the first aspect.
[0021] In this embodiment, upon receiving an encryption request from the requesting end, a corresponding socket pair and an encryption processing thread are created based on the encryption request. The socket pair includes a server socket and a client socket, both belonging to the same Transmission Control Protocol (TCP). The server socket is bound to the encryption processing thread. Upon receiving data to be encrypted from the requesting end, the data is transmitted to the server socket via the client socket. The encryption processing thread bound to the server socket performs real-time encryption on the data to be encrypted, yielding an encryption result. This real-time encryption method based on network attached storage (NAS) devices enables efficient, secure, and real-time AES encryption and decryption, especially for large files or multi-threaded access scenarios, improving the security, real-time performance, and continuity of the encryption and decryption process. Attached Figure Description
[0022] Figure 1This is a flowchart illustrating a real-time encryption method based on a network-attached storage device provided in an embodiment of this application; Figure 2 This is a system architecture diagram of the real-time encryption processing procedure provided in the embodiments of this application; Figure 3 This is a flowchart illustrating another real-time encryption method based on a network-attached storage device provided in this application embodiment; Figure 4 This is a flowchart illustrating another real-time encryption method based on a network-attached storage device provided in an embodiment of this application; Figure 5 This is a flowchart illustrating another real-time encryption method based on a network-attached storage device provided in an embodiment of this application; Figure 6 This is a system architecture diagram of the real-time decryption process provided in the embodiments of this application; Figure 7 This is a schematic diagram of the structure of a real-time encryption device based on a network-attached storage device provided in an embodiment of this application; Figure 8 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0023] To make the objectives, technical solutions, and advantages of this application clearer, specific embodiments of this application will be described in further detail below with reference to the accompanying drawings. It should be understood that the specific embodiments described herein are merely for explaining this application and not for limiting it. It should also be noted that, for ease of description, only the parts relevant to this application are shown in the drawings, not all of them. Before discussing exemplary embodiments in more detail, it should be mentioned that some exemplary embodiments are described as processes or methods depicted as flowcharts. Although the flowcharts describe operations (or steps) as sequential processes, many of these operations can be performed in parallel, concurrently, or simultaneously. Furthermore, the order of the operations can be rearranged. The process can be terminated when its operation is completed, but may also have additional steps not included in the drawings. The process can correspond to a method, function, procedure, subroutine, subprogram, etc.
[0024] The technical solutions of the embodiments of this application will be clearly described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this application. All other embodiments obtained by those skilled in the art based on the embodiments of this application are within the scope of protection of this application.
[0025] The terms "first," "second," etc., used in the specification and claims of this application are used to distinguish similar objects and not to describe a specific order or sequence. It should be understood that such use of data can be interchanged where appropriate so that embodiments of this application can be implemented in orders other than those illustrated or described herein, and the objects distinguished by "first," "second," etc., are generally of the same class and the number of objects is not limited; for example, a first object can be one or more. Furthermore, in the specification and claims, "and / or" indicates at least one of the connected objects, and the character " / " generally indicates that the preceding and following objects are in an "or" relationship.
[0026] The real-time encryption method and apparatus based on network-attached storage devices provided in this application will be described in detail below with reference to the accompanying drawings, through specific embodiments and application scenarios.
[0027] First, this application applies to scenarios where data storage is performed using network-attached storage devices. Based on this usage scenario, it can be understood that the execution entity of this application can be the main thread of the network-attached storage device. Specifically, the creation of sockets and encryption processing threads, as well as the transmission of data to be encrypted, can be performed by the main thread, enabling real-time reception and encryption of the data to be encrypted.
[0028] Among them, network-attached storage devices can be dedicated file storage devices that connect to a network and provide file-level data storage services.
[0029] The main thread can be the primary thread process within the network attached storage device (NETD) responsible for coordinating all core tasks and serving as the main control flow for the NETD's operation. In this solution, the main thread is specifically dedicated to processing requests sent by the requesting client.
[0030] The requesting end can be a terminal device or application in the network that needs to send data storage, encryption, decryption, and other requests to the network-attached storage device, such as a personal computer, mobile terminal, server application, and Internet of Things device, which establishes a connection and interacts with the network-attached storage device through network communication protocols.
[0031] Figure 1 This is a flowchart illustrating a real-time encryption method based on a network-attached storage device provided in an embodiment of this application. Figure 1 As shown, the specific steps include the following: S101, upon receiving an encryption request from the requesting end, a corresponding socket pair and an encryption processing thread are created based on the encryption request; wherein, the socket pair includes a server socket and a client socket, and the server socket and the client socket belong to the same transmission control protocol.
[0032] An encryption request can be a message sent by the requesting end to a network-attached storage device, requesting that specific data be encrypted.
[0033] In one embodiment, the method of receiving the encryption request sent by the requesting end can be achieved by using a network communication protocol between the requesting end and the network-attached storage device to enable the requesting end to send the encryption request and the main thread to receive the encryption request.
[0034] A socket pair can be a pair of related socket instances created within the same network-attached storage device for inter-process or inter-thread communication. A socket pair includes a server socket and a client socket. A socket can be a network programming interface used to enable communication between different hosts or different processes within the same host, supporting data sending and receiving operations.
[0035] Specifically, for encrypted requests, the server-side socket can be the socket in the socket pair that primarily listens and receives data transmission requests; the client-side socket can be the socket in the socket pair that primarily initiates connections and sends data. Both server-side and client-side sockets belong to the same Transmission Control Protocol (TCP). The Transmission Control Protocol (TCP) is a connection-oriented, reliable, byte-stream-based transport layer communication protocol that guarantees the order and integrity of data transmission.
[0036] In one embodiment, the method of creating a corresponding socket pair based on an encrypted request can be achieved by using a socket programming interface (such as the socket() function) to create the socket pair based on the encrypted request.
[0037] The encryption processing thread can be a sub-thread specifically designed to perform data encryption operations. It is dynamically created by the main thread based on the encryption request, has an independent execution path, and can use a preset encryption algorithm to encrypt the received data to be encrypted without affecting the normal operation of the main thread.
[0038] In one embodiment, the method of creating a corresponding encryption processing thread based on an encryption request can be achieved by using multi-threaded programming techniques (such as the pthread_create() function). The execution environment of the encryption processing thread (including encryption algorithm configuration, key loading, etc.) is initialized based on the encryption parameters specified in the encryption request. After creation, the thread state is set to start, waiting to receive the data to be encrypted.
[0039] S102, bind the server socket to the encryption processing thread.
[0040] In one embodiment, binding the server socket to the encryption processing thread can be achieved by establishing a mapping table that associates and stores the identifier of the server socket with the identifier of the encryption processing thread.
[0041] S103, upon receiving the data to be encrypted sent by the requesting end, the data to be encrypted is transmitted to the server socket through the client socket, and the encryption processing thread bound to the server socket performs real-time encryption processing on the data to be encrypted to obtain the encryption result.
[0042] The data to be encrypted can be the original data that the requesting party needs to store in the network-attached storage device, including but not limited to document files, image data, video clips, database records, etc. This data needs to be encrypted before storage to ensure security.
[0043] In one embodiment, the method of receiving the data to be encrypted sent by the requesting end can be achieved by using a network communication protocol between the requesting end and the network-attached storage device to send the data to be encrypted and for the main thread to receive the data to be encrypted.
[0044] In one embodiment, the method of transmitting data to be encrypted to a server socket via a client socket can be achieved by having the client socket encapsulate the received data to be encrypted according to the TCP protocol specification and send it to the server socket through an internal communication channel. The server socket then decapsulates the data upon receiving it, restoring it to the original data to be encrypted.
[0045] In one embodiment, the encryption processing thread bound to the server socket performs real-time encryption processing on the data to be encrypted to obtain the encryption result. This can be achieved by triggering the corresponding encryption processing thread to read the data from the server socket when the server socket receives the data to be encrypted, using the aforementioned mapping table, and then encrypting the received data using a preset encryption algorithm. In this solution, the preset encryption algorithm can be AES (Advanced Encryption Standard).
[0046] The encryption result can be encrypted data that is securely stored as a file on a network-attached storage device.
[0047] Figure 2 This is a system architecture diagram of the real-time encryption processing procedure provided in the embodiments of this application. For example... Figure 2As shown, the requesting end transmits the data to be encrypted to the main thread of the network-attached storage device in real time. The main thread then transmits the data to be encrypted to the server socket in real time through the client socket, so that the encryption processing thread bound to the server socket can receive the data to be encrypted in real time and perform real-time encryption processing on the received data.
[0048] In this embodiment, upon receiving an encryption request from the requesting end, a corresponding socket pair and an encryption processing thread are created based on the encryption request. The socket pair includes a server socket and a client socket, both belonging to the same Transmission Control Protocol (TCP). The server socket is bound to the encryption processing thread. Upon receiving data to be encrypted from the requesting end, the data is transmitted to the server socket via the client socket. The encryption processing thread bound to the server socket performs real-time encryption on the data to be encrypted, yielding an encryption result. This real-time encryption method based on network attached storage (NAS) devices enables efficient, secure, and real-time AES encryption and decryption, especially for large files or multi-threaded access scenarios, improving the security, real-time performance, and continuity of the encryption and decryption process.
[0049] Figure 3 This is a flowchart illustrating another real-time encryption method based on a network-attached storage device provided in this application embodiment. For example... Figure 3 As shown, the specific steps include the following: S301, upon receiving an encryption request from the requesting end, a corresponding socket pair and an encryption processing thread are created based on the encryption request; wherein, the socket pair includes a server socket and a client socket, and the server socket and the client socket belong to the same transmission control protocol.
[0050] S302, bind the server socket to the encryption processing thread.
[0051] S303, upon receiving the data to be encrypted sent by the requesting end, the data to be encrypted is transmitted to the server socket through the client socket, and the encryption processing thread bound to the server socket performs real-time encryption processing on the data to be encrypted to obtain the encryption result.
[0052] S304, Create an encryption progress log file to determine the real-time encryption progress position.
[0053] The encryption progress log file can be a file used to record the progress of the encryption processing of the data to be encrypted in real time, and can be stored in the temporary storage area of a network-attached storage device.
[0054] In one embodiment, the encryption progress record file can be created by having the main thread generate a file named with a unique identifier for the encryption task in a specified directory and initialize the file content when the encryption processing thread starts.
[0055] The real-time encryption progress position can be the specific location of the data that the current encryption processing thread has completed encrypting within the entire data to be encrypted. In this scheme, the real-time encryption progress position can specifically refer to the offset value, that is, the number of bytes between the start position of the data to be encrypted and the end position of the already encrypted portion.
[0056] In one embodiment, the method for determining the real-time encryption progress position can be that the encryption processing thread updates the offset value in real time based on the number of bytes processed after each segment of data is encrypted, and then synchronizes this value to the main thread.
[0057] S305, according to a preset cycle, store the real-time encryption progress position in the encryption progress record file.
[0058] The preset period can refer to a pre-set time interval for periodically storing the real-time encryption progress position.
[0059] In one embodiment, storing the real-time encryption progress position in the encryption progress record file according to a preset period can be achieved by setting a timer to trigger a write operation of the real-time encryption progress position every preset period.
[0060] Understandably, the step of "determining the real-time encryption progress position and storing the real-time encryption progress position in the encryption progress record file according to a preset period" is executed synchronously with S303.
[0061] Optionally, once all the data to be encrypted has been encrypted, the encryption progress record file can be deleted.
[0062] Optionally, after storing the real-time encryption progress position in the encryption progress record file according to a preset period, the method further includes: Upon receiving the encryption interruption location request sent by the requesting end, the encryption interruption location is determined based on the encryption progress record file; The encryption interruption location is sent to the requesting end so that the requesting end can resend the encryption request and continue transmitting the data to be encrypted based on the encryption interruption location.
[0063] The encryption interruption location request can be a request message sent by the requesting end to the main thread of the network-attached storage device after the encryption process is interrupted, used to query the encryption interruption location. The encryption interruption location can be the real-time encryption progress position at the time of the interruption.
[0064] In one embodiment, the method of receiving the encrypted interruption location request sent by the requesting end can be achieved by using the network communication protocol between the requesting end and the network attached storage device to realize the sending of the encrypted interruption location request by the requesting end and the receiving of the encrypted interruption location request by the main thread.
[0065] In one embodiment, the method of determining the encryption interruption position based on the encryption progress record file can be as follows: after receiving the encryption interruption position request, the main thread searches for the corresponding encryption progress record file according to the encryption task identifier carried in the encryption interruption position request, and reads the latest real-time encryption progress position stored in the encryption progress record file as the encryption interruption position.
[0066] The method of sending the encrypted interrupt location to the requesting end can be achieved by using the network communication protocol between the requesting end and the network attached storage device, so that the main thread can send the encrypted interrupt location and the requesting end can receive the encrypted interrupt location.
[0067] In this context, enabling the requesting end to resend the encryption request and resume the transmission of the data to be encrypted based on the encryption interruption position can mean that after obtaining the encryption interruption position, the requesting end resends an encryption request containing the interruption position information to the main thread of the network attached storage device, and starts transmitting the remaining data to be encrypted from the encryption interruption position.
[0068] Optionally, after creating the encrypted progress log file, the method further includes: Based on the encrypted progress record file, an interrupted resume verification message is generated and sent to the requesting end. Accordingly, determining the encryption interruption location based on the encryption progress record file includes: Upon receiving the encryption interruption location request from the requesting end, and after verifying the interruption resumption verification information in the encryption interruption location request, the encryption interruption location is determined based on the encryption progress record file.
[0069] Among them, the interrupted resume verification information can be used to uniquely identify the resume permission of the encrypted task, and has timeliness and uniqueness.
[0070] In one embodiment, the method of generating interrupted resume verification information based on the encrypted progress record file can be achieved by performing a hash operation on the metadata of the encrypted progress record file and combining it with a randomly generated time factor to generate an encrypted string as the interrupted resume verification information.
[0071] Optionally, generating interrupted resume verification information based on the encrypted progress record file includes: Based on the universally unique identifier of the encryption request and the file identification information and generation time information of the encryption progress record file, interrupted resume verification information is generated.
[0072] The universally unique identifier for an encryption request can be a globally unique string identifier (UUID) assigned to each encryption request from the requesting end. It is usually dynamically generated by the main thread of the network-attached storage device when receiving a request, and is used to distinguish different encryption tasks and avoid confusion between task identifiers.
[0073] The file identification information of the encrypted progress record file can be a unique identifier for the encrypted progress record file, such as the file name, the file's inode number, or the file's unique hash code, which is used to accurately locate the corresponding encrypted progress record file.
[0074] The generation time information of the encrypted progress record file can be the specific timestamp when the encrypted progress record file was created.
[0075] In one embodiment, the method for generating interrupted resume verification information based on the universally unique identifier of the encryption request and the file identifier and generation time information of the encryption progress record file can be as follows: concatenate the universally unique identifier of the encryption request, the file identifier and generation time information of the encryption progress record file into an original string according to a preset format, and then use a preset hash algorithm to perform encryption operation on the original string to generate a hash value of fixed length. This hash value is the interrupted resume verification information.
[0076] The advantage of this scheme is that by generating interrupted resume verification information based on the universally unique identifier of the encryption request and the file identification information and generation time information of the encrypted progress record file, the exclusive attributes of the interrupted resume verification information can be ensured from three dimensions: task uniqueness, file association, and time validity, making the interrupted resume verification information have extremely high uniqueness and unforgeability.
[0077] In one embodiment, the method of sending the interrupted resume verification information to the requesting end can be achieved by using the network communication protocol between the requesting end and the network attached storage device, so as to realize the main thread sending the interrupted resume verification information and the requesting end receiving the interrupted resume verification information.
[0078] In particular, the successful verification of the interruption resumption verification information in the encrypted interruption location request can mean that the main thread compares the interruption resumption verification information sent by the requesting end with the verification information of the corresponding encrypted task stored locally, confirms that the two are consistent and have not exceeded the validity period, and thus determines that the verification is successful.
[0079] The advantage of this solution is that by generating interrupted resume verification information based on the encrypted progress log file and sending the verification information to the requesting end, and upon receiving the encrypted interruption location request from the requesting end and verifying the interrupted resume verification information in the encrypted interruption location request, the encrypted interruption location can be determined based on the encrypted progress log file. This effectively prevents unauthorized requesting ends from obtaining encrypted progress information or maliciously initiating resume requests, thus enhancing the security of the interrupted resume process.
[0080] The advantage of this scheme is that, upon receiving an encryption interruption location request from the requesting end, the encryption interruption location is determined based on the encryption progress log file, and the encryption interruption location is sent to the requesting end. This allows the requesting end to resend the encryption request and resume the transmission of the data to be encrypted based on the encryption interruption location. This enables the interruption-resumption function of the encryption process, avoids the reprocessing of already transmitted data due to interruption, and significantly reduces network bandwidth consumption and data processing time.
[0081] The advantage of this solution is that by creating an encryption progress record file, the real-time encryption progress position can be determined. The real-time encryption progress position is stored in the encryption progress record file according to a preset period. This allows the encryption progress to be quickly determined based on the encryption progress record file when the encryption process is unexpectedly interrupted.
[0082] Figure 4 This is a flowchart illustrating another real-time encryption method based on a network-attached storage device provided in an embodiment of this application. Figure 4 As shown, the specific steps include the following: S401, upon receiving an encryption request from the requesting end, a processing priority is determined based on the encryption request, and preset resource allocation information is determined based on the processing priority; wherein, the preset resource allocation information includes a central processing unit quota and input / output bandwidth.
[0083] The processing priority can be a task processing priority level set based on factors such as the urgency of the encryption request, the importance of the data, and the permission level of the requesting party.
[0084] In one embodiment, the method for determining the processing priority based on the encryption request can be by parsing the priority identifier field carried in the encryption request, or by determining it based on the preset priority level of the requesting end, or by comprehensively determining it based on the data type of the data to be encrypted.
[0085] The preset resource allocation information can be a system resource allocation standard set in advance for different processing priorities to ensure the smooth execution of encryption tasks. The preset resource allocation information may include the central processing unit quota and input / output bandwidth.
[0086] Specifically, the CPU quota can be the percentage of CPU usage allocated to the encryption processing thread or the upper limit of computing resources; the input / output bandwidth can be the maximum data transfer rate allowed for a socket pair when transmitting data to be encrypted.
[0087] In one embodiment, determining the preset resource allocation information based on processing priority can be achieved by querying a preset processing priority-resource mapping table to obtain the preset resource allocation information corresponding to the current processing priority. For example, if the processing priority is high, its corresponding CPU quota is 30% and its input / output bandwidth is 100 Mbps; if the processing priority is medium, its corresponding CPU quota is 20% and its input / output bandwidth is 50 Mbps; and if the processing priority is low, its corresponding CPU quota is 10% and its input / output bandwidth is 20 Mbps.
[0088] S402, create a socket pair based on the input / output bandwidth, and create an encryption processing thread based on the central processing unit quota; wherein, the socket pair includes a server socket and a client socket, and the server socket and the client socket belong to the same transmission control protocol.
[0089] In one embodiment, the method of creating socket pairs based on input / output bandwidth can be achieved by setting parameters such as the size of the socket's send / receive buffer and the upper limit of the transmission rate through system calls when creating the socket pair, so that the transmission capability of the socket pair matches the preset input / output bandwidth standard.
[0090] In one embodiment, the method of creating encryption processing threads based on central processing unit quotas can be achieved by allocating computing resources matching the central processing unit quota to the encryption processing thread through a thread scheduling strategy when it is created.
[0091] S403, bind the server socket to the encryption processing thread.
[0092] S404, obtain current resource occupancy information, and if it is identified that the current resource occupancy information cannot meet the preset resource allocation information, determine the target resource allocation information corresponding to the encryption request based on the processing priority and the current resource occupancy information.
[0093] Among them, the current resource usage information can be the real-time system resource usage status of the network-attached storage device when it receives an encryption request.
[0094] In one embodiment, the current resource usage information can be obtained by calling the resource monitoring interface provided by the operating system of the network-attached storage device.
[0095] The statement that "the current resource occupancy information cannot meet the preset resource allocation information" can refer to a situation where the available resources are insufficient to allocate resources for the encryption request according to the preset resource allocation information. In this case, the resource allocation scheme needs to be dynamically adjusted, so the target resource allocation information corresponding to the encryption request needs to be determined based on the processing priority and the current resource occupancy information.
[0096] The target resource allocation information can be the resource configuration that can actually be allocated to the encryption request, which is determined dynamically based on the processing priority under the current resource occupancy status. It can include the target CPU quota and the target input / output bandwidth.
[0097] In one embodiment, the method of determining the target resource allocation information corresponding to the encryption request based on the processing priority and the current resource occupancy information can adopt a dynamic resource adjustment algorithm. That is, for encryption requests with high processing priority, their resource needs are guaranteed first, and the allocated resources of encryption requests with low processing priority are appropriately reduced to make up for them. For encryption requests with medium and low processing priority, their currently allocated resources are reduced according to the ratio of available resources to preset resource allocation information.
[0098] S405, based on the target input / output bandwidth in the target resource allocation information, the data to be encrypted is transmitted to the server socket through the client socket, and the encryption processing thread bound to the server socket performs real-time encryption processing on the data to be encrypted based on the target central processing unit quota in the target resource allocation information to obtain the encryption result.
[0099] In one embodiment, based on the target input / output bandwidth in the target resource allocation information, the method of transmitting the data to be encrypted to the server socket through the client socket can be achieved by monitoring the transmission rate in real time during the data transmission process and adjusting parameters such as data transmission frequency and fragment size to keep the actual transmission rate stable within the target input / output bandwidth range.
[0100] In one embodiment, the encryption processing thread bound to the server socket performs real-time encryption processing on the data to be encrypted based on the target CPU quota in the target resource allocation information to obtain the encryption result. This can be achieved by dynamically adjusting the concurrency or time slice ratio of the encryption operation of the encryption processing thread to ensure that the CPU utilization does not exceed the target CPU quota.
[0101] The advantage of this scheme is that, when the current resource occupancy information cannot meet the preset resource allocation information, the target resource allocation information corresponding to the encryption request can be determined based on the processing priority and the current resource occupancy information. This enables dynamic optimization of resource allocation, improves resource utilization, allows more encryption tasks to be processed in parallel with limited resources, and enhances the overall service efficiency and stability of network-attached storage devices.
[0102] Figure 5 This is a flowchart illustrating another real-time encryption method based on a network-attached storage device provided in an embodiment of this application. Figure 5 As shown, the specific steps include the following: S501, upon receiving an encryption request from the requesting end, a corresponding socket pair and an encryption processing thread are created based on the encryption request; wherein, the socket pair includes a server socket and a client socket, and the server socket and the client socket belong to the same transmission control protocol.
[0103] S502, bind the server socket to the encryption processing thread.
[0104] S503, upon receiving the data to be encrypted sent by the requesting end, the data to be encrypted is transmitted to the server socket through the client socket, and the encryption processing thread bound to the server socket performs real-time encryption processing on the data to be encrypted to obtain the encryption result.
[0105] S504, In the case of a decryption request sent by the requesting end, a corresponding socket pair and a decryption processing thread are created based on the decryption request; wherein, the socket pair includes a server socket and a client socket.
[0106] Here, a decryption request can be a command message sent by the requesting end to the network-attached storage device, requesting the decryption of encrypted data.
[0107] In one embodiment, the method of receiving the decryption request sent by the requesting end can be achieved by using the network communication protocol between the requesting end and the network attached storage device to realize the sending of the decryption request by the requesting end and the receiving of the decryption request by the main thread.
[0108] Specifically, for decryption requests, the client socket can be the socket that is mainly in a listening state in the socket pair and is used to receive data transmission requests; the server socket can be the socket that is mainly initiating connections in the socket pair and is used to send data.
[0109] In one embodiment, the method of creating a corresponding socket pair based on a decryption request can be achieved by using a socket programming interface (such as the socket() function) to create the socket pair based on the decryption request.
[0110] The decryption processing thread can be a sub-thread specifically designed to perform data decryption operations. It is dynamically created by the main thread based on the decryption request, has an independent execution path, and can use a preset decryption algorithm to decrypt the encrypted data corresponding to the decryption request without affecting the normal operation of the main thread.
[0111] In one embodiment, the method of creating a corresponding decryption processing thread based on a decryption request can be achieved by using multithreaded programming techniques (such as the pthread_create() function). The execution environment of the decryption processing thread (including decryption algorithm configuration, decryption key loading, encrypted data address mapping, etc.) is initialized based on the decryption parameters specified in the decryption request. After creation, the thread state is set to start.
[0112] S505, bind the server socket to the decryption processing thread.
[0113] In one embodiment, binding the server socket to the decryption processing thread can be achieved by establishing a mapping table to associate and store the identifier of the server socket with the identifier of the decryption processing thread.
[0114] S506, through the client socket and the server socket, the decryption processing thread receives the decryption processing result of the encrypted data corresponding to the decryption request in real time, and sends the decryption processing result to the requesting end in real time.
[0115] Among them, the decryption result of the encrypted data corresponding to the decryption request can be the original data restored after decryption, that is, plaintext information that is consistent with the data to be encrypted before encryption, which can be directly read and used by the requesting party.
[0116] In one embodiment, the method of receiving the decryption processing result of the encrypted data corresponding to the decryption request in real time through the client socket and the server socket can be achieved by the decryption processing thread sending the data stream of the decryption processing result in segments through the server socket to the client socket, and the client socket receiving and splicing the segments to form a complete decryption processing result.
[0117] In one embodiment, the method of sending the decryption processing result to the requesting end in real time can be achieved by using a network communication protocol between the requesting end and the network-attached storage device, so as to realize the real-time sending of the decryption processing result by the main thread and the real-time reception of the decryption processing result by the requesting end.
[0118] Figure 6 This is a system architecture diagram of the real-time decryption processing procedure provided in the embodiments of this application. For example... Figure 6 As shown, the decryption processing thread transmits the decryption processing result to the client socket in real time through the server socket, so that the main thread can receive the decryption processing result in real time and transmit the decryption processing result to the requesting end in real time.
[0119] Optionally, the method further includes: Create a decryption progress log file to determine the real-time decryption progress position; The real-time decryption progress position is stored in the decryption progress record file according to a preset cycle.
[0120] Optionally, after storing the real-time decryption progress position in the decryption progress record file according to a preset period, the method further includes: Upon receiving a decryption interruption location request from the requesting end, the decryption interruption location is determined based on the decryption progress record file; Send the decryption interruption location to the requesting end so that the requesting end resends the decryption request.
[0121] Optionally, after creating the decryption progress log file, the method further includes: Based on the decryption progress record file, an interrupted resume verification message is generated and sent to the requesting end. Accordingly, determining the decryption interruption location based on the decryption progress record file includes: Upon receiving the decryption interruption location request from the requesting end, and after verifying the interruption resumption verification information in the decryption interruption location request, the decryption interruption location is determined based on the decryption progress record file.
[0122] Optionally, generating interrupted resume verification information based on the decryption progress record file includes: Based on the universally unique identifier of the decryption request and the file identification information and generation time information of the decryption progress record file, interrupted resume verification information is generated.
[0123] Optionally, before creating the socket pair and the decryption processing thread, the following steps are also included: The processing priority is determined based on the decryption request, and preset resource allocation information is determined based on the processing priority; wherein, the preset resource allocation information includes the central processing unit quota and input / output bandwidth; Accordingly, the socket pair creation and decryption processing thread includes: Socket pairs are created based on the input / output bandwidth, and encryption processing threads are created based on the central processing unit quota. Accordingly, the step of receiving the decryption processing result of the encrypted data corresponding to the decryption request from the decryption processing thread in real time through the client socket and the server socket, and sending the decryption processing result to the requesting end in real time, includes: Obtain current resource occupancy information, and if it is identified that the current resource occupancy information cannot meet the preset resource allocation information, determine the target resource allocation information corresponding to the decryption request based on the processing priority and the current resource occupancy information; The decryption processing thread, bound to the server socket, performs real-time decryption processing based on the target CPU quota in the target resource allocation information to obtain the decryption processing result. Based on the target input / output bandwidth in the target resource allocation information, the decryption processing result is transmitted to the client socket through the server socket.
[0124] The advantage of this approach is that, upon receiving a decryption request from the requesting end, a corresponding socket pair and decryption processing thread are created based on the decryption request. The decryption processing result is received through the socket pair and sent back to the requesting end in real time. This decouples the decryption process from the main thread, preventing the decryption operation from occupying main thread resources and affecting the processing efficiency of other requests. At the same time, by utilizing the local high-efficiency communication characteristics of the socket pair, the real-time transmission of the decryption result can be guaranteed, improving the response speed of the requesting end in obtaining the decrypted data.
[0125] Figure 7 This is a schematic diagram of a real-time encryption device based on a network-attached storage device provided in an embodiment of this application. Figure 7 As shown, the device includes: A creation module 710 is used to create a corresponding socket pair and an encryption processing thread based on the encryption request received from the requesting end; wherein, the socket pair includes a server socket and a client socket, and the server socket and the client socket belong to the same transmission control protocol; Binding module 720 is used to bind the server socket to the encryption processing thread; The encryption module 730 is used to transmit the data to be encrypted to the server socket through the client socket when it receives the data to be encrypted sent by the requesting end, and to perform real-time encryption processing on the data to be encrypted by the encryption processing thread bound to the server socket to obtain the encryption result.
[0126] Optionally, the device is also used for: Create an encryption progress log file to determine the real-time encryption progress position; The real-time encryption progress position is stored in the encryption progress record file according to a preset cycle.
[0127] Optionally, the device is also used for: Upon receiving the encryption interruption location request sent by the requesting end, the encryption interruption location is determined based on the encryption progress record file; The encryption interruption location is sent to the requesting end so that the requesting end can resend the encryption request and continue transmitting the data to be encrypted based on the encryption interruption location.
[0128] Optionally, the device is also used for: Based on the encrypted progress record file, an interrupted resume verification message is generated and sent to the requesting end. Accordingly, determining the encryption interruption location based on the encryption progress record file includes: Upon receiving the encryption interruption location request from the requesting end, and after verifying the interruption resumption verification information in the encryption interruption location request, the encryption interruption location is determined based on the encryption progress record file.
[0129] Optionally, the device is also used for: Based on the universally unique identifier of the encryption request and the file identification information and generation time information of the encryption progress record file, interrupted resume verification information is generated.
[0130] Optionally, the device is also used for: The processing priority is determined based on the encryption request, and the preset resource allocation information is determined based on the processing priority; wherein, the preset resource allocation information includes the central processing unit quota and input / output bandwidth; Accordingly, the creation module is specifically used for: Upon receiving an encryption request from the requesting end, a socket pair is created based on the input / output bandwidth, and an encryption processing thread is created based on the central processing unit quota; wherein, the socket pair includes a server socket and a client socket, and the server socket and the client socket belong to the same transmission control protocol; Accordingly, the encryption module 730 is specifically used for: Obtain current resource occupancy information, and if it is identified that the current resource occupancy information cannot meet the preset resource allocation information, determine the target resource allocation information corresponding to the encryption request based on the processing priority and the current resource occupancy information; Based on the target input / output bandwidth in the target resource allocation information, the data to be encrypted is transmitted to the server socket through the client socket. The encryption processing thread bound to the server socket performs real-time encryption processing on the data to be encrypted based on the target CPU quota in the target resource allocation information to obtain the encryption result.
[0131] Optionally, the device is also used for: Upon receiving a decryption request from the requesting client, a corresponding socket pair and a decryption processing thread are created based on the decryption request; wherein, the socket pair includes a server socket and a client socket; Bind the server socket to the decryption processing thread; The client socket and the server socket are used to receive the decryption processing result of the encrypted data corresponding to the decryption request from the decryption processing thread in real time, and send the decryption processing result to the requesting end in real time.
[0132] In this embodiment, a creation module is used to create a corresponding socket pair and an encryption processing thread based on the encryption request received from the requesting end. The socket pair includes a server socket and a client socket, both belonging to the same Transmission Control Protocol (TCP). A binding module is used to bind the server socket to the encryption processing thread. An encryption module is used to, upon receiving data to be encrypted from the requesting end, transmit the data to be encrypted to the server socket via the client socket, and perform real-time encryption processing on the data via the encryption processing thread bound to the server socket to obtain the encryption result. This real-time encryption device based on a network attached storage device (NAS) enables efficient, secure, and real-time AES encryption and decryption for NAS devices, especially for large files or multi-threaded access scenarios, improving the security, real-time performance, and continuity of the encryption and decryption process.
[0133] The real-time encryption device based on network attached storage in this application embodiment can be a device, or it can be a component, integrated circuit, or chip in a terminal. The device can be a mobile electronic device or a non-mobile electronic device. For example, mobile electronic devices can be mobile phones, tablets, laptops, PDAs, in-vehicle electronic devices, wearable devices, ultra-mobile personal computers (UMPCs), netbooks, or personal digital assistants (PDAs), etc., while non-mobile electronic devices can be servers, network attached storage (NAS), personal computers (PCs), televisions (TVs), ATMs, or self-service machines, etc. This application embodiment does not impose specific limitations.
[0134] The real-time encryption device based on network-attached storage in this application embodiment can be a device with an operating system. This operating system can be Android, iOS, or other possible operating systems; this application embodiment does not specifically limit it.
[0135] The real-time encryption device based on network-attached storage provided in this application can implement the various processes implemented in the above embodiments. To avoid repetition, it will not be described again here.
[0136] Figure 8 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. For example... Figure 8 As shown, this application embodiment also provides an electronic device 800, including a processor 801, a memory 802, and a program or instructions stored in the memory 802 and executable on the processor 801. When the program or instructions are executed by the processor 801, they implement the various processes of the above-described real-time encryption method embodiment based on network-attached storage device and achieve the same technical effect. To avoid repetition, they will not be described again here.
[0137] It should be noted that the electronic devices in the embodiments of this application include the mobile electronic devices and non-mobile electronic devices described above.
[0138] This application also provides a readable storage medium storing a program or instructions. When the program or instructions are executed by a processor, they implement the various processes of the above-described real-time encryption method embodiment based on a network-attached storage device and achieve the same technical effect. To avoid repetition, they will not be described again here.
[0139] The processor is the processor in the electronic device described in the above embodiments. The readable storage medium includes computer-readable storage media, such as computer read-only memory (ROM), random access memory (RAM), magnetic disk, or optical disk.
[0140] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element. Furthermore, it should be noted that the scope of the methods and apparatuses in the embodiments of this application is not limited to performing functions in the order shown or discussed, but may also include performing functions substantially simultaneously or in the reverse order, depending on the functions involved. For example, the described methods may be performed in a different order than described, and various steps may be added, omitted, or combined. Additionally, features described with reference to certain examples may be combined in other examples.
[0141] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a computer software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) and includes several instructions to cause a terminal (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods described in the various embodiments of this application.
[0142] The embodiments of this application have been described above with reference to the accompanying drawings. However, this application is not limited to the specific embodiments described above. The specific embodiments described above are merely illustrative and not restrictive. Those skilled in the art can make many other forms under the guidance of this application without departing from the spirit and scope of the claims, and all of these forms are within the protection scope of this application.
[0143] The above description is merely a preferred embodiment and the technical principles employed in this application. This application is not limited to the specific embodiments described herein, and various obvious changes, readjustments, and substitutions that can be made by those skilled in the art will not depart from the scope of protection of this application. Therefore, although this application has been described in detail through the above embodiments, this application is not limited to the above embodiments, and may include more other equivalent embodiments without departing from the concept of this application, the scope of which is determined by the scope of the claims.
Claims
1. A real-time encryption method based on a network-attached storage device, applied to a network-attached storage device, characterized in that, The method includes: Upon receiving an encryption request from the requesting end, a corresponding socket pair and an encryption processing thread are created based on the encryption request; wherein, the socket pair includes a server socket and a client socket, and the server socket and the client socket belong to the same transmission control protocol; Bind the server socket to the encryption processing thread; Upon receiving the data to be encrypted sent by the requesting end, the data to be encrypted is transmitted to the server socket through the client socket. The encryption processing thread bound to the server socket performs real-time encryption processing on the data to be encrypted to obtain the encryption result.
2. The real-time encryption method based on a network-attached storage device according to claim 1, characterized in that, The method further includes: Create an encryption progress log file to determine the real-time encryption progress position; The real-time encryption progress position is stored in the encryption progress record file according to a preset cycle.
3. The real-time encryption method based on a network-attached storage device according to claim 2, characterized in that, After storing the real-time encryption progress position in the encryption progress record file according to a preset period, the method further includes: Upon receiving the encryption interruption location request sent by the requesting end, the encryption interruption location is determined based on the encryption progress record file; The encryption interruption location is sent to the requesting end so that the requesting end can resend the encryption request and continue transmitting the data to be encrypted based on the encryption interruption location.
4. The real-time encryption method based on a network-attached storage device according to claim 3, characterized in that, After creating the encrypted progress log file, the method further includes: Based on the encrypted progress record file, an interrupted resume verification message is generated and sent to the requesting end. Accordingly, determining the encryption interruption location based on the encryption progress record file includes: Upon receiving the encryption interruption location request from the requesting end, and after verifying the interruption resumption verification information in the encryption interruption location request, the encryption interruption location is determined based on the encryption progress record file.
5. The real-time encryption method based on a network-attached storage device according to claim 4, characterized in that, The generation of interrupted resume verification information based on the encrypted progress record file includes: Based on the universally unique identifier of the encryption request and the file identification information and generation time information of the encryption progress record file, interrupted resume verification information is generated.
6. The real-time encryption method based on a network-attached storage device according to any one of claims 1-5, characterized in that, Before creating the corresponding socket pair and encryption processing thread based on the encryption request, the method further includes: The processing priority is determined based on the encryption request, and the preset resource allocation information is determined based on the processing priority; wherein, the preset resource allocation information includes the central processing unit quota and input / output bandwidth; Accordingly, the creation of the corresponding socket pair and encryption processing thread based on the encryption request includes: Socket pairs are created based on the input / output bandwidth, and encryption processing threads are created based on the central processing unit quota. Accordingly, the step of transmitting the data to be encrypted to the server socket through the client socket, and then performing real-time encryption processing on the data to be encrypted by the encryption processing thread bound to the server socket to obtain the encryption result, includes: Obtain current resource occupancy information, and if it is identified that the current resource occupancy information cannot meet the preset resource allocation information, determine the target resource allocation information corresponding to the encryption request based on the processing priority and the current resource occupancy information; Based on the target input / output bandwidth in the target resource allocation information, the data to be encrypted is transmitted to the server socket through the client socket. The encryption processing thread bound to the server socket performs real-time encryption processing on the data to be encrypted based on the target CPU quota in the target resource allocation information to obtain the encryption result.
7. The real-time encryption method based on a network-attached storage device according to claim 1, characterized in that, After obtaining the encryption result, the following is also included: Upon receiving a decryption request from the requesting client, a corresponding socket pair and a decryption processing thread are created based on the decryption request; wherein, the socket pair includes a server socket and a client socket; Bind the server socket to the decryption processing thread; The client socket and the server socket are used to receive the decryption processing result of the encrypted data corresponding to the decryption request from the decryption processing thread in real time, and send the decryption processing result to the requesting end in real time.
8. A real-time encryption device based on a network-attached storage device, characterized in that, The device includes: A creation module is used to create a corresponding socket pair and an encryption processing thread based on the encryption request sent by the requesting end when the encryption request is received; wherein, the socket pair includes a server socket and a client socket, and the server socket and the client socket belong to the same transmission control protocol; A binding module is used to bind the server-side socket to the encryption processing thread; The encryption module is used to transmit the data to be encrypted to the server socket through the client socket when it receives the data to be encrypted sent by the requesting end, and to perform real-time encryption processing on the data to be encrypted by the encryption processing thread bound to the server socket to obtain the encryption result.
9. An electronic device, characterized in that, It includes a processor, a memory, and a program or instructions stored in the memory and executable on the processor, wherein the program or instructions, when executed by the processor, implement the real-time encryption method based on a network-attached storage device as described in any one of claims 1-7.
10. A readable storage medium, characterized in that, The readable storage medium stores a program or instructions, which, when executed by a processor, implement the real-time encryption method based on a network-attached storage device as described in any one of claims 1-7.
Citation Information
Patent Citations
Communication method, communication device, computer equipment and readable storage medium
CN110768928A
High-efficiency interrupt recoverable image hiding encryption transmission method, device and system
CN111107245A
Breakpoint resume method and device based on encryption protocol bandwidth, terminal and medium
CN117527793A
Disk decryption method, encryption system and computing device
CN119622777A
Systems and methods for initializing a distributed cryptography as a service application
WO2025080372A1