Message data encryption and decryption method and device, equipment and storage medium

By adopting the method of batch processing of message data in the encryption machine, the problem of low throughput performance of the existing encryption machine when processing small packets is solved, and higher throughput performance and more effective utilization of hardware resources are achieved.

CN119363464APending Publication Date: 2025-01-24NANJING HUADUN ELECTRIC POWER INFORMATION SAFETY EVALUATION CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411562893.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-05
Publication Date
2025-01-24

AI Technical Summary

Technical Problem

Existing encryption machines have low throughput performance when processing packets with short packet lengths, and cannot fully utilize their hardware performance advantages, and frequent function calls lead to performance bottlenecks.

Method used

Read message data in batches from the network card through the preset system network protocol stack, select the data to be distributed based on the number of messages, store it in the distribution buffer of the cryptographic module scheduler, process the message data to be processed in batches, and encapsulate it The encrypted decryption request is sent to the encryption machine.

Benefits of technology

It has significantly improved the throughput of the encryption machine, reduced the number of functions calls, and gives full play to the performance advantages of network cards, CPUs, and password modules.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119363464A_ABST
    Figure CN119363464A_ABST
Patent Text Reader

Abstract

The invention discloses a message data encryption and decryption method, device and equipment and a storage medium, and is applied to a network encryption machine, the network encryption machine comprises a system network protocol stack and a cryptographic module scheduler, and the method comprises the steps that a plurality of network message data are read from a preset network card through a preset system network protocol stack, and the network message data are sent to the network encryption machine; selecting a first target quantity of to-be-distributed message data based on the message quantity of the plurality of network message data; storing the to-be-distributed message data into a message distribution buffer area of a cryptographic module scheduler, and reading the to-be-processed message data from the message distribution buffer area based on a preset message reading sequence through the cryptographic module scheduler; and encapsulating the message data to be processed into a target encryption and decryption request through the cryptographic module scheduler, and sending the target encryption and decryption request to the target encryption machine, so that the target encryption machine performs data encryption and decryption operation on the message data to be processed. Therefore, the packet throughput performance of the encryption machine can be obviously improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of data sharing, and in particular to a message data encryption and decryption method, device, equipment and storage medium. Background Art

[0002] The network encryption machine is an important network security device that can protect the security and confidentiality of sensitive data through data encryption and decryption operations. It is widely used in finance, telecommunications, government and other fields, and is one of the important tools for ensuring network security. The working principle of the encryption machine is to receive network messages through the network card, encrypt and decrypt the data through the symmetric encryption algorithm module, and then send the network message through the network card. The sender and the receiver share the same encryption and decryption key before communication. When the sender uses the encryption machine to encrypt data, the plaintext data to be encrypted is first input into the encryption machine through the network. The encryption machine uses the encryption algorithm to convert it into ciphertext and then sends it to the receiver. After receiving the ciphertext, the receiver uses the same key to decrypt the ciphertext to obtain the original data. This processing method has problems such as frequent function calls and low CPU (Central Processing Unit) cache utilization, which leads to bottlenecks in the throughput performance of the encryption machine. In particular, the performance problem is particularly prominent when processing messages with short packet lengths, and the performance advantages of hardware such as network cards, CPUs, and cryptographic modules cannot be fully utilized. Therefore, how to improve the throughput capacity of encryption machines for encryption processing is a problem that needs to be solved. Summary of the invention

[0003] In view of this, the purpose of the present invention is to provide a message data encryption and decryption method, device, equipment and storage medium, which reduces the number of function calls in the system by batch processing and significantly improves the small packet throughput performance of the encryption machine. The specific scheme is as follows:

[0004] In a first aspect, the present application discloses a message data encryption and decryption method, which is applied to a network encryption machine, wherein the network encryption machine includes a system network protocol stack and a cryptographic module scheduler, and the method includes:

[0005] Reading a plurality of network message data from a preset network card through a preset system network protocol stack, and selecting a first target number of message data to be distributed based on the number of messages of the plurality of network message data;

[0006] The message data to be distributed is stored in the message distribution buffer of the password module scheduler, and the message data to be processed is read from the message distribution buffer by the password module scheduler based on a preset message reading order;

[0007] The to-be-processed message data is encapsulated into a target encryption and decryption request through the cryptographic module scheduler, and the target encryption and decryption request is sent to a target encryption machine so that the target encryption machine performs data encryption and decryption operations on the to-be-processed message data.

[0008] Optionally, the step of reading a plurality of network message data from a preset network card through a preset system network protocol stack, and selecting a first target number of message data to be distributed based on the number of messages of the plurality of network message data, includes:

[0009] Reading a number of network message data from a preset network card based on a polling network card method through a preset system network protocol stack, and determining whether the number of messages of the number of network message data is greater than a preset batch threshold;

[0010] If the number of messages of the plurality of network message data is greater than the preset batch threshold, a first target number of message data to be distributed is selected based on the preset batch threshold; the first target number is equal to the preset batch threshold.

[0011] Optionally, the preset message reading order is determined based on message receiving order numbers of the plurality of network message data.

[0012] Optionally, the reading the to-be-processed message data from the message distribution buffer by the cryptographic module scheduler based on a preset message reading order includes:

[0013] A second target quantity of to-be-processed message data is read from the message distribution buffer by the cryptographic module scheduler based on a preset message reading order; the second target quantity is not greater than the first target quantity.

[0014] Optionally, after sending the target encryption and decryption request to a target encryption machine so that the target encryption machine performs data encryption and decryption operations on the message data to be processed, the method further includes:

[0015] Acquiring, through the cryptographic module scheduler, response data obtained by the target encryption machine performing data encryption and decryption operations on the message data to be processed;

[0016] The data header in the response data is removed to obtain the encrypted and decrypted message, and the encrypted and decrypted message is sequentially placed into the message sorting buffer of the cryptographic module scheduler based on the message receiving sequence number.

[0017] Optionally, after placing the encrypted and decrypted messages in the message sorting buffer of the cryptographic module scheduler in sequence based on the message receiving sequence number, the method further includes:

[0018] A plurality of encrypted and decrypted messages are read from the message sorting buffer in the cryptographic module scheduler based on a polling network card method through the preset system network protocol stack, and sent to a target network card.

[0019] In a second aspect, the present application discloses a message data encryption and decryption device, which is applied to a network encryption machine, wherein the network encryption machine includes a system network protocol stack and a cryptographic module scheduler, and the device includes:

[0020] A module for selecting message data to be distributed, used for reading a plurality of network message data from a preset network card through a preset system network protocol stack, and selecting a first target number of message data to be distributed based on the number of messages of the plurality of network message data;

[0021] A message distribution module, used for storing the message data to be distributed into the message distribution buffer of the password module scheduler, and reading the message data to be processed from the message distribution buffer through the password module scheduler based on a preset message reading order;

[0022] The data encryption and decryption module is used to encapsulate the message data to be processed into a target encryption and decryption request through the password module scheduler, and send the target encryption and decryption request to the target encryption machine so that the target encryption machine performs data encryption and decryption operations on the message data to be processed.

[0023] Optionally, the module for selecting message data to be distributed includes:

[0024] A quantity determination unit, configured to read a plurality of network message data from a preset network card based on a polling network card method through a preset system network protocol stack, and determine whether the message quantity of the plurality of network message data is greater than a preset batch threshold;

[0025] The message selection unit is used to select a first target number of message data to be distributed based on the preset batch threshold if the number of messages in the plurality of network message data is greater than the preset batch threshold; the first target number is equal to the preset batch threshold.

[0026] In a third aspect, the present application discloses an electronic device, comprising:

[0027] Memory, used to store computer programs;

[0028] A processor is used to execute the computer program to implement the aforementioned message data encryption and decryption method.

[0029] In a fourth aspect, the present application discloses a computer-readable storage medium for storing a computer program, which implements the aforementioned message data encryption and decryption method when executed by a processor.

[0030] It can be seen that in this application, a number of network message data are read from a preset network card through a preset system network protocol stack, and a first target number of message data to be distributed is selected based on the number of messages of the number of network message data; the message data to be distributed is stored in the message distribution buffer of the password module scheduler, and the message data to be processed is read from the message distribution buffer by the password module scheduler based on the preset message reading order; the message data to be processed is encapsulated into a target encryption and decryption request by the password module scheduler, and the target encryption and decryption request is sent to the target encryption machine, so that the target encryption machine performs data encryption and decryption operations on the message data to be processed. That is, the number of function calls when the encryption machine processes small packets is reduced by batch processing, and the small packet encryption and decryption throughput performance is improved. BRIEF DESCRIPTION OF THE DRAWINGS

[0031] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying creative work.

[0032] Figure 1 A flow chart of a message data encryption and decryption method disclosed in this application;

[0033] Figure 2 A flowchart of a specific message data encryption and decryption method disclosed in this application;

[0034] Figure 3 This is a schematic diagram of the structure of a message data encryption and decryption device disclosed in this application;

[0035] Figure 4 This is a structural diagram of an electronic device disclosed in this application. DETAILED DESCRIPTION

[0036] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0037] When a traditional encryption machine encrypts and decrypts network messages, a message goes through the steps of receiving, encrypting and decrypting, and sending in sequence, and then the encryption machine continues to receive the next message and performs the above processing again. In this way, the performance problem is particularly prominent when processing messages with shorter packet lengths, and the performance advantages of hardware such as network cards, CPUs, and cryptographic modules cannot be fully utilized. Therefore, this application will introduce a message data encryption and decryption method that can improve the message processing capability.

[0038] See also Figure 1 As shown, the embodiment of the present application discloses a message data encryption and decryption method, which is applied to a network encryption machine, wherein the network encryption machine includes a system network protocol stack and a cryptographic module scheduler, and the method includes:

[0039] Step S11: reading a plurality of network message data from a preset network card through a preset system network protocol stack, and selecting a first target number of message data to be distributed based on the message quantity of the plurality of network message data.

[0040] In this embodiment, the method of reading a plurality of network message data from a preset network card through a preset system network protocol stack, and selecting a first target number of message data to be distributed based on the number of messages of the plurality of network message data, includes: reading a plurality of network message data from a preset network card based on a polling network card method through a preset system network protocol stack, and determining whether the number of messages of the plurality of network message data is greater than a preset batch threshold; if the number of messages of the plurality of network message data is greater than the preset batch threshold, selecting a first target number of message data to be distributed based on the preset batch threshold; the first target number is equal to the preset batch threshold. Specifically, a plurality of network messages are read in batches through a polling network card method through a preset system protocol stack. The preset batch threshold is set to K. Then, when the number of messages in the network card hardware buffer is less than the batch threshold K, the preset system protocol stack will read all network messages and store them in the message distribution buffer; when the number of messages in the network card hardware receiving buffer is greater than the batch threshold K, the system protocol stack will only read K network messages and store them in the message distribution buffer.

[0041] Step S12: storing the message data to be distributed into the message distribution buffer of the password module scheduler, and reading the message data to be processed from the message distribution buffer by the password module scheduler based on a preset message reading order.

[0042] In this embodiment, the preset message reading order is determined based on the message receiving order numbers of the plurality of network message data. The reading of the to-be-processed message data from the message distribution buffer by the password module scheduler based on the preset message reading order includes: reading a second target number of to-be-processed message data from the message distribution buffer by the password module scheduler based on the preset message reading order; the second target number is not greater than the first target number. That is, the preset password module scheduler reads a batch of network messages not greater than the batch threshold K from the message distribution buffer according to the size of the message receiving order numbers.

[0043] Step S13: Encapsulating the message data to be processed into a target encryption and decryption request through the cryptographic module scheduler, and sending the target encryption and decryption request to the target encryption machine, so that the target encryption machine performs data encryption and decryption operations on the message data to be processed.

[0044] In this embodiment, the cryptographic module scheduler encapsulates the to-be-processed message data into a batch message encryption and decryption request that can be recognized by the cryptographic module, and sends it to a relatively idle cryptographic module. After receiving the corresponding to-be-processed message data, the relatively idle cryptographic module performs the corresponding data encryption and decryption operation, and further includes: obtaining the response data obtained by the target encryption machine performing the data encryption and decryption operation on the to-be-processed message data through the cryptographic module scheduler; removing the data header in the response data to obtain the message after encryption and decryption processing, and placing the message after encryption and decryption processing into the message sorting buffer of the cryptographic module scheduler in sequence based on the message receiving sequence number. In this embodiment, after receiving the batch message encryption and decryption response data, the cryptographic module scheduler removes the batch message encryption and decryption request data header, and then places the encrypted and decrypted messages into the message sorting buffer in sequence according to the sequence number. After the encrypted and decrypted messages are sequentially placed into the message sorting buffer of the cryptographic module scheduler based on the message receiving sequence number, the method further includes: reading a number of encrypted and decrypted messages from the message sorting buffer in the cryptographic module scheduler based on the polling network card method through the preset system network protocol stack, and sending them to the target network card. Specifically, the system network protocol stack reads a number of network messages not greater than a batch threshold K in batches according to the order of message needs from small to large through the polling method, and writes them into the network card hardware sending buffer in sequence.

[0045] It can be seen that in this embodiment, a number of network message data are read from a preset network card through a preset system network protocol stack, and a first target number of message data to be distributed is selected based on the number of messages of the number of network message data; the message data to be distributed is stored in the message distribution buffer of the password module scheduler, and the message data to be processed is read from the message distribution buffer by the password module scheduler based on the preset message reading order; the message data to be processed is encapsulated into a target encryption and decryption request by the password module scheduler, and the target encryption and decryption request is sent to the target encryption machine, so that the target encryption machine performs data encryption and decryption operations on the message data to be processed. That is, the number of function calls when the encryption machine processes small packets is reduced by batch processing, and the small packet encryption and decryption throughput performance is improved.

[0046] refer to Figure 2 The embodiment of the present application also discloses a specific message data encryption and decryption method, which is applied to a network encryption machine. The network encryption machine includes a system network protocol stack and a cryptographic module scheduler. The method includes: the system protocol stack batch reads a number of network messages by polling the network card. When the number of messages in the network card hardware buffer is less than the batch threshold K, the system protocol stack will read all network messages and store them in the message distribution buffer; when the number of messages in the network card hardware receiving buffer is greater than the batch threshold K, the system protocol stack only reads K network messages and stores them in the message distribution buffer. The cryptographic module scheduler reads a number of network messages not greater than the batch threshold K from the message distribution buffer in batches according to the size of the message receiving sequence number N, encapsulates them into batch message encryption and decryption requests that the cryptographic module can recognize, and sends them to a relatively idle cryptographic module. After receiving the batch message encryption and decryption response data, the cryptographic module scheduler removes the batch message encryption and decryption request data header, and then puts the encrypted and decrypted messages into the message sorting buffer in sequence according to the sequence number N. The system network protocol stack uses polling to batch read network messages not greater than the batch threshold K in the order of message needs from small to large, and writes them into the network card hardware sending buffer in sequence. That is, a unified batch message processing method is used by software and hardware modules such as the network card that supports processing batch messages, the password module, and the password module scheduler that supports batch data scheduling; and in the case of batch message processing and multiple password modules processing in parallel, a method of message order preservation is performed by combining the message sorting buffer and the message sequence number. In this way, the number of function calls in the system is reduced by using batch processing in the key link of message encryption and decryption processing, and the small packet throughput performance of the encryption machine is significantly improved. In addition, the distribution of messages in the encryption machine memory is continuous through the batch access network message method. This layout can give full play to the advantages of the CPU cache mechanism and significantly improve the throughput performance of the encryption machine.

[0047] refer to Figure 3The embodiment of the present application also discloses a message data encryption and decryption device, which is applied to a network encryption machine. The network encryption machine includes a system network protocol stack and a cryptographic module scheduler. The device includes:

[0048] The to-be-distributed message data selection module 11 is used to read a plurality of network message data from a preset network card through a preset system network protocol stack, and select a first target number of to-be-distributed message data based on the message quantity of the plurality of network message data;

[0049] A message distribution module 12, used for storing the message data to be distributed into the message distribution buffer of the password module scheduler, and reading the message data to be processed from the message distribution buffer through the password module scheduler based on a preset message reading order;

[0050] The data encryption and decryption module 13 is used to encapsulate the message data to be processed into a target encryption and decryption request through the password module scheduler, and send the target encryption and decryption request to the target encryption machine so that the target encryption machine performs data encryption and decryption operations on the message data to be processed.

[0051] It can be seen that in this application, the module for selecting message data to be distributed is used to read a number of network message data from a preset network card through a preset system network protocol stack, and select a first target number of message data to be distributed based on the number of messages of the number of network message data; the message distribution module is used to store the message data to be distributed in the message distribution buffer of the password module scheduler, and read the message data to be processed from the message distribution buffer through the password module scheduler based on the preset message reading order; the data encryption and decryption module is used to encapsulate the message data to be processed into a target encryption and decryption request through the password module scheduler, and send the target encryption and decryption request to the target encryption machine, so that the target encryption machine performs data encryption and decryption operations on the message data to be processed. That is, the number of function calls when the encryption machine processes small packets is reduced through batch processing, and the small packet encryption and decryption throughput performance is improved.

[0052] In some specific embodiments, the to-be-distributed message data selection module 11 may specifically include:

[0053] A quantity determination unit, configured to read a plurality of network message data from a preset network card based on a polling network card method through a preset system network protocol stack, and determine whether the message quantity of the plurality of network message data is greater than a preset batch threshold;

[0054] The message selection unit is used to select a first target number of message data to be distributed based on the preset batch threshold if the number of messages in the plurality of network message data is greater than the preset batch threshold; the first target number is equal to the preset batch threshold.

[0055] In some specific embodiments, the message distribution module 12 can be specifically used to read a second target number of to-be-processed message data from the message distribution buffer through the cryptographic module scheduler based on a preset message reading order; the second target number is not greater than the first target number.

[0056] In some specific embodiments, the message data encryption and decryption device may further include:

[0057] A response data acquisition module, used for acquiring, through the cryptographic module scheduler, response data obtained by the target encryption machine performing data encryption and decryption operations on the message data to be processed;

[0058] The data placement module is used to remove the data header in the response data to obtain the encrypted and decrypted message, and put the encrypted and decrypted message into the message sorting buffer of the cryptographic module scheduler in sequence based on the message receiving sequence number.

[0059] In some specific embodiments, the message data encryption and decryption device may further include:

[0060] The data sending module is used to read a number of encrypted and decrypted messages from the message sorting buffer in the password module scheduler based on the polling network card method through the preset system network protocol stack, and send them to the target network card.

[0061] Furthermore, the present application also discloses an electronic device. Figure 4 This is a structural diagram of an electronic device 20 according to an exemplary embodiment. The content in the diagram cannot be regarded as any limitation on the scope of use of the present application.

[0062] Figure 4 A schematic diagram of the structure of an electronic device 20 provided in an embodiment of the present application. The electronic device 20 may specifically include: at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input / output interface 25, and a communication bus 26. The memory 22 is used to store a computer program, which is loaded and executed by the processor 21 to implement the relevant steps in the message data encryption / decryption method disclosed in any of the aforementioned embodiments. In addition, the electronic device 20 in this embodiment may specifically be an electronic computer.

[0063] In this embodiment, the power supply 23 is used to provide working voltage for each hardware device on the electronic device 20; the communication interface 24 can create a data transmission channel between the electronic device 20 and the external device, and the communication protocol it follows is any communication protocol that can be applied to the technical solution of the present application, and is not specifically limited here; the input and output interface 25 is used to obtain external input data or output data to the outside world, and its specific interface type can be selected according to specific application needs and is not specifically limited here.

[0064] In addition, the memory 22, as a carrier for storing resources, can be a read-only memory, a random access memory, a disk or an optical disk, etc. The resources stored thereon can include an operating system 221, a computer program 222, etc., and the storage method can be temporary storage or permanent storage.

[0065] The operating system 221 is used to manage and control the hardware devices and computer program 222 on the electronic device 20, which can be Windows Server, Netware, Unix, Linux, etc. In addition to including a computer program that can be used to complete the message data encryption and decryption method performed by the electronic device 20 disclosed in any of the aforementioned embodiments, the computer program 222 can further include a computer program that can be used to complete other specific tasks.

[0066] Furthermore, the present application also discloses a computer-readable storage medium for storing a computer program; wherein, when the computer program is executed by a processor, the aforementioned disclosed message data encryption and decryption method is implemented. The specific steps of the method can refer to the corresponding contents disclosed in the aforementioned embodiments, and will not be repeated here.

[0067] In this specification, each embodiment is described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts between the embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part.

[0068] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.

[0069] The steps of the method or algorithm described in conjunction with the embodiments disclosed herein may be implemented directly using hardware, a software module executed by a processor, or a combination of the two. The software module may be placed in a random access memory (RAM), a memory, a read-only memory (ROM), an electrically programmable ROM, an electrically erasable programmable ROM, a register, a hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art.

[0070] Finally, it should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the presence of other identical elements in the process, method, article or device including the elements.

[0071] The technical solution provided by the present application is introduced in detail above. Specific examples are used in this article to illustrate the principles and implementation methods of the present application. The description of the above embodiments is only used to help understand the method of the present application and its core idea. At the same time, for general technicians in this field, according to the idea of ​​the present application, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as a limitation on the present application.

Claims

1. A message data encryption and decryption method, characterized in that: Applied to a network encryption machine, the network encryption machine includes a system network protocol stack and a cryptographic module scheduler, the method includes: Reading a plurality of network message data from a preset network card through a preset system network protocol stack, and selecting a first target number of message data to be distributed based on the number of messages of the plurality of network message data; The message data to be distributed is stored in the message distribution buffer of the password module scheduler, and the message data to be processed is read from the message distribution buffer by the password module scheduler based on a preset message reading order; The to-be-processed message data is encapsulated into a target encryption and decryption request through the cryptographic module scheduler, and the target encryption and decryption request is sent to a target encryption machine so that the target encryption machine performs data encryption and decryption operations on the to-be-processed message data.

2. The message data encryption and decryption method according to claim 1, characterized in that: The step of reading a plurality of network message data from a preset network card through a preset system network protocol stack, and selecting a first target number of message data to be distributed based on the number of messages of the plurality of network message data, includes: Reading a number of network message data from a preset network card based on a polling network card method through a preset system network protocol stack, and determining whether the number of messages of the number of network message data is greater than a preset batch threshold; If the number of messages of the plurality of network message data is greater than the preset batch threshold, a first target number of message data to be distributed is selected based on the preset batch threshold; the first target number is equal to the preset batch threshold.

3. The message data encryption and decryption method according to claim 1, characterized in that: The preset message reading sequence is determined based on the message receiving sequence numbers of the plurality of network message data.

4. The message data encryption and decryption method according to claim 1, characterized in that: The reading of the to-be-processed message data from the message distribution buffer by the cryptographic module scheduler based on a preset message reading order includes: A second target quantity of to-be-processed message data is read from the message distribution buffer by the cryptographic module scheduler based on a preset message reading order; the second target quantity is not greater than the first target quantity.

5. The message data encryption and decryption method according to claim 4, characterized in that: After sending the target encryption and decryption request to the target encryption machine so that the target encryption machine performs data encryption and decryption operations on the message data to be processed, the method further includes: Acquiring, through the cryptographic module scheduler, response data obtained by the target encryption machine performing data encryption and decryption operations on the message data to be processed; The data header in the response data is removed to obtain the encrypted and decrypted message, and the encrypted and decrypted message is sequentially placed into the message sorting buffer of the cryptographic module scheduler based on the message receiving sequence number.

6. The message data encryption and decryption method according to claim 5, characterized in that: After the encrypted and decrypted messages are sequentially placed into the message sorting buffer of the cryptographic module scheduler based on the message receiving sequence number, the method further includes: A plurality of encrypted and decrypted messages are read from the message sorting buffer in the cryptographic module scheduler based on a polling network card method through the preset system network protocol stack, and sent to a target network card.

7. A message data encryption and decryption device, characterized in that: Applied to a network encryption machine, the network encryption machine includes a system network protocol stack and a cryptographic module scheduler, and the device includes: A module for selecting message data to be distributed, used for reading a plurality of network message data from a preset network card through a preset system network protocol stack, and selecting a first target number of message data to be distributed based on the number of messages of the plurality of network message data; A message distribution module, used for storing the message data to be distributed into the message distribution buffer of the password module scheduler, and reading the message data to be processed from the message distribution buffer through the password module scheduler based on a preset message reading order; The data encryption and decryption module is used to encapsulate the message data to be processed into a target encryption and decryption request through the password module scheduler, and send the target encryption and decryption request to the target encryption machine so that the target encryption machine performs data encryption and decryption operations on the message data to be processed.

8. The message data encryption and decryption device according to claim 7, characterized in that: The module for selecting the message data to be distributed includes: A quantity determination unit, configured to read a plurality of network message data from a preset network card based on a polling network card method through a preset system network protocol stack, and determine whether the message quantity of the plurality of network message data is greater than a preset batch threshold; The message selection unit is used to select a first target number of message data to be distributed based on the preset batch threshold if the number of messages in the plurality of network message data is greater than the preset batch threshold; the first target number is equal to the preset batch threshold.

9. An electronic device, characterized in that: include: Memory, used to store computer programs; A processor, used to execute the computer program to implement the message data encryption and decryption method as described in any one of claims 1 to 6.

10. A computer-readable storage medium, characterized in that: Used to store a computer program, which, when executed by a processor, implements the message data encryption and decryption method according to any one of claims 1 to 6.