Message processing method and device and electronic equipment

By estimating the processing time and time of M messages by the encryption card, the timing of the CPU pulling packets from the encryption card is optimized, the resource waste caused by regular pulling is solved, and the utilization rate of system resources is improved.

CN119316133APending Publication Date: 2025-01-14HILLSTONE NETWORKS CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411418993.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-11
Publication Date
2025-01-14

AI Technical Summary

Technical Problem

In the prior art, when the CPU periodically pulls packet processing results from multiple encryption cards, there is a situation where the pull is invalid, which wastes the utilization rate of CPU resources.

Method used

By obtaining the estimated processing time of M messages by the target encryption card, the time when the processing is completed is estimated, and the message results are pulled at that time, the estimated processing time is adjusted based on the historical pull results and actual processing situation to avoid invalidation Pull.

Benefits of technology

It effectively avoids the invalidity of regularly pulling the encryption card processing results, improves the utilization rate of CPU resources, and reduces the waste of system resources.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119316133A_ABST
    Figure CN119316133A_ABST
Patent Text Reader

Abstract

The invention discloses a message processing method and device and electronic equipment. Relates to the technical field of network security, and the method comprises the steps: obtaining the estimated processing duration of a target encryption card for processing each message in M messages; according to the estimated processing duration of each message in the M messages, estimating the moment when the M messages are processed by the target encryption card to obtain an estimated moment; and at the estimated moment, pulling the message processed by the target encryption card to obtain a pulling result. According to the message processing method and device, the technical problem that CPU resources are wasted due to the fact that a CPU pulls the processing result of the message to be processed by the encryption card in a regular data pulling mode in the related technology is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of network security technology, and in particular to a message processing method, device and electronic equipment. Background Art

[0002] In the related art, an encryption card is a hardware device specifically used for data encryption and decryption. After the encryption card completes processing of a message, the CPU (Central Processing Unit) is required to periodically pull the processed message from each of the multiple encryption cards. However, different encryption cards have different processing efficiencies for different messages. Therefore, when the CPU pulls messages from the encryption card, there is an invalid pull, which wastes the utilization of CPU resources.

[0003] To address the above-mentioned problems, no effective solution has been proposed yet. Summary of the invention

[0004] The embodiments of the present invention provide a message processing method, device and electronic device to at least solve the technical problem in the related art that the CPU uses a method of periodically pulling data to pull the processing results of the encryption card on the message to be processed, thereby wasting CPU resources.

[0005] According to one aspect of an embodiment of the present invention, a message processing method is provided, including: obtaining an estimated processing time for a target encryption card to process each of M messages; estimating the moment when the M messages are processed by the target encryption card based on the estimated processing time for each of the M messages, to obtain an estimated moment, wherein M is a positive integer; at the estimated moment, pulling the message processed by the target encryption card to obtain a pulling result.

[0006] Furthermore, the pulling result includes: at the estimated time, the number N of messages actually processed by the target encryption card is pulled, N is a natural number, and at the estimated time, the messages processed by the target encryption card are pulled to obtain the pulling result, and it also includes: when N is equal to M, S historical pulling results are obtained, and based on the S historical pulling results and the pulling result, the estimated processing time of the first specified message is adjusted, wherein the historical pulling results include: before the estimated time, with M as the maximum number of messages to be pulled, the pulling results of the messages actually processed by the target encryption card are pulled, and S is a positive integer; when N is less than M, the estimated processing time of the second specified message is increased.

[0007] Furthermore, based on the S historical pulling results and the pulling result, the estimated processing time of the first designated message is adjusted, including: based on the S historical pulling results, determining an estimated correct number of times, wherein the estimated correct number of times includes: the number of historical pulling results of M messages that can be pulled from the S historical pulling results and that are actually processed by the target encryption card; when the estimated correct number of times is greater than or equal to a preset threshold, if the estimated time is after the time when the M messages are actually processed by the target encryption card, then the estimated processing time of the first designated message is reduced; when the estimated correct number of times is greater than or equal to the preset threshold and the estimated time is equal to the time when the M messages are actually processed by the target encryption card, or when the estimated correct number of times is less than the preset threshold, it is prohibited to adjust the estimated processing time of the first designated message.

[0008] Furthermore, before estimating the moment when the M messages are processed by the target encryption card based on the estimated processing time of each message in the M messages and obtaining the estimated moment, the message processing method also includes: determining a message to be detected; encrypting the message to be detected using a first encryption card to obtain an encrypted message; decrypting the encrypted message using a second encryption card to obtain a first decrypted message; determining the device status of the target encryption card based on the message to be detected and the first decrypted message, wherein the target encryption card is the first encryption card or the second encryption card; and when the device status of the target encryption card is normal, executing the step of obtaining the estimated processing time for the target encryption card to process each of the M messages.

[0009] Furthermore, based on the message to be detected and the first decrypted message, the device status of the target encryption card is determined, including: using a central processing unit to decrypt the encrypted message to obtain a second decrypted message; based on the message to be detected, the first decrypted message and the second decrypted message, the device status of the target encryption card is determined.

[0010] Furthermore, based on the message to be detected, the first decrypted message and the second decrypted message, the device status of the target encryption card is determined, including: judging whether the message contents of the message to be detected, the first decrypted message and the second decrypted message are consistent, and obtaining a judgment result; based on the judgment result, determining the device status of the first encryption card and the device status of the second encryption card, and based on the device status of the first encryption card or the device status of the second encryption card, determining the device status of the target encryption card.

[0011] Furthermore, an estimated processing time for the target encryption card to process each of the M messages is obtained, including: reading the message processing estimated time information, wherein the message processing estimated time information is used to record the estimated processing time of different encryption cards for different messages; based on the message processing estimated time information and the M message information, querying the estimated processing time of the target encryption card for each of the M messages, wherein the M message information includes: the message information of the message to be processed by the target encryption card.

[0012] Furthermore, the message processing estimated time information includes: the estimated processing time, the identifier of the encryption card, the utilization rate of the central processing unit, and the correlation relationship between the length of the message queue. Based on the message processing estimated time information and the M message information, the target encryption card is queried for the estimated processing time of each of the M messages, including: determining the utilization rate of the central processing unit, the length of the target message queue, and the length of each of the M messages at the current moment, wherein the target message queue is used to record the message information of the message to be processed by the target encryption card; based on the utilization rate of the central processing unit, the length of the target message queue, and the length of each of the M messages at the current moment, the estimated processing time of each of the M messages is queried in the message processing estimated time information to obtain the estimated processing time of each of the M messages.

[0013] According to another aspect of an embodiment of the present invention, a message processing device is also provided, including: an acquisition unit, used to acquire an estimated processing time for a target encryption card to process each of M messages; an estimation unit, used to estimate the moment when the M messages are processed by the target encryption card based on the estimated processing time for each of the M messages, to obtain an estimated moment, wherein M is a positive integer; and a pulling unit, used to pull the message processed by the target encryption card at the estimated moment, to obtain a pulling result.

[0014] Furthermore, the pulling result includes: the number N of messages actually processed by the target encryption card pulled at the estimated time, where N is a natural number, and the message processing device also includes: a first processing unit, used to pull the message processed by the target encryption card at the estimated time, and after obtaining the pulling result, when N is equal to M, obtain S historical pulling results, and adjust the estimated processing time of the first specified message based on the S historical pulling results and the pulling result, wherein the historical pulling result includes: the pulling result of pulling the messages actually processed by the target encryption card before the estimated time, with M as the maximum number of messages to be pulled, and S is a positive integer; an increasing unit, used to increase the estimated processing time of the second specified message when N is less than M.

[0015] Further, the first processing unit includes: a first determination subunit, used to determine an estimated correct number of times based on the S historical pulling results, wherein the estimated correct number of times includes: the number of historical pulling results that can pull M messages that are actually processed by the target encryption card among the S historical pulling results; a first processing subunit, used to reduce the estimated processing time of the first designated message when the estimated correct number of times is greater than or equal to a preset threshold and the estimated time is after the time when the M messages are actually processed by the target encryption card; a second processing subunit, used to prohibit adjusting the estimated processing time of the first designated message when the estimated correct number of times is greater than or equal to the preset threshold and the estimated time is equal to the time when the M messages are actually processed by the target encryption card, or when the estimated correct number of times is less than the preset threshold.

[0016] Furthermore, the message processing device also includes: a first determination unit, used to determine the message to be detected before estimating the moment when the M messages are processed by the target encryption card based on the estimated processing time of each message in the M messages and obtaining the estimated moment; an encryption unit, used to encrypt the message to be detected using the first encryption card to obtain an encrypted message; a decryption unit, used to decrypt the encrypted message using the second encryption card to obtain a first decrypted message; a second processing unit, used to determine the device status of the target encryption card based on the message to be detected and the first decrypted message, wherein the target encryption card is the first encryption card or the second encryption card; an execution unit, used to execute the step of estimating the moment when the M messages are processed by the target encryption card based on the estimated processing time of each message in the M messages and obtaining the estimated moment when the device status of the target encryption card is normal.

[0017] Furthermore, the second processing unit includes: a decryption subunit, used to use a central processing unit to decrypt the encrypted message to obtain a second decrypted message; a second determination subunit, used to determine the device status of the target encryption card based on the message to be detected, the first decrypted message and the second decrypted message.

[0018] Furthermore, the second determination subunit includes: a judgment module, used to judge whether the message contents of the message to be detected, the first decrypted message and the second decrypted message are consistent, and obtain a judgment result; a processing module, used to determine the device status of the first encryption card and the device status of the second encryption card based on the judgment result, and determine the device status of the target encryption card based on the device status of the first encryption card or the device status of the second encryption card.

[0019] Furthermore, the acquisition unit includes: a first reading sub-unit, used to read the message processing estimated time information, wherein the message processing estimated time information is used to record the estimated processing time of different encryption cards for different messages; a query sub-unit, used to query the target encryption card for the estimated processing time of each of the M messages based on the message processing estimated time information and M message information, wherein the M message information includes: the message information of the message to be processed by the target encryption card.

[0020] Furthermore, the message processing estimated time information includes: the estimated processing time, the identifier of the encryption card, the utilization rate of the central processing unit and the correlation relationship between the message queue length, and the query subunit is used to:

[0021] Determine the utilization rate of the central processing unit at the current moment, the length of the target message queue, and the length of each message in the M messages, wherein the target message queue is used to record message information of the messages to be processed by the target encryption card;

[0022] Based on the utilization rate of the central processing unit at the current moment, the length of the target message queue, and the length of each of the M messages, the estimated processing time of each of the M messages is queried in the message processing estimated time information to obtain the estimated processing time of each of the M messages.

[0023] According to another aspect of an embodiment of the present invention, there is also provided an electronic device, comprising: a processor; and a memory for storing executable instructions of the processor; wherein the processor is configured to execute any one of the above-mentioned message processing methods by executing the executable instructions.

[0024] According to another aspect of an embodiment of the present invention, a computer-readable storage medium is provided, which stores a computer program, wherein when the computer program runs, the device where the computer-readable storage medium is located is controlled to execute any one of the above-mentioned message processing methods.

[0025] In the present invention, the estimated processing time of each of the M messages processed by the target encryption card is obtained; based on the estimated processing time of each of the M messages, the moment when the M messages are processed by the target encryption card is estimated to obtain the estimated moment, wherein M is a positive integer; at the estimated moment, the message processed by the target encryption card is pulled to obtain the pulling result. This solves the technical problem in the related art that the CPU uses a method of periodically pulling data to pull the processing result of the message to be processed by the encryption card, thereby wasting CPU resources. In the present invention, the moment of pulling the message processed by the encryption card is estimated by the estimated processing time of each message, and the processing result of the message is pulled at the estimated moment, thereby avoiding the situation in the related art where the processing result of the message is periodically pulled by the encryption card, resulting in invalid pulling and wasting of system resources, thereby achieving the technical effect of reducing the system resources required to pull the processing result of the message by the encryption card. BRIEF DESCRIPTION OF THE DRAWINGS

[0026] The drawings described herein are used to provide a further understanding of the present invention and constitute a part of this application. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings:

[0027] Figure 1 is a flow chart of an optional message processing method according to an embodiment of the present invention;

[0028] Figure 2 This is a flow chart of an optional message processing method according to an embodiment of the present invention. Figure 1 ;

[0029] Figure 3 This is a flow chart of an optional message processing method according to an embodiment of the present invention. Figure 2 ;

[0030] Figure 4 is a schematic diagram of an optional message processing device according to an embodiment of the present invention;

[0031] Figure 5 is a schematic diagram of an electronic device according to an embodiment of the present invention. DETAILED DESCRIPTION

[0032] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.

[0033] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0034] It should be noted that the user information (including but not limited to user device information, user personal information, etc.), collected information and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, storage, use, processing, transmission, provision, disclosure and application of the relevant data comply with the relevant laws, regulations and standards of the relevant regions, take necessary confidentiality measures, do not violate public order and good morals, and provide corresponding operation entrances for users to choose to authorize or refuse.

[0035] It should be noted that the embodiments or examples of the present application are not exhaustive, but are only illustrative of some embodiments or examples, and are not intended to be specific limitations on the scope of protection of the present application. In the absence of contradiction, each step in a certain embodiment or example can be implemented as an independent example, and the steps can be combined arbitrarily. For example, the scheme after removing some steps in a certain embodiment or example can also be implemented as an independent example, and the order of the steps in a certain embodiment or example can be arbitrarily exchanged. In addition, the optional methods or optional examples in a certain embodiment or example can be combined arbitrarily; in addition, the various embodiments or examples can be combined arbitrarily, for example, some or all steps of different embodiments or examples can be combined arbitrarily, and a certain embodiment or example can be combined arbitrarily with the optional methods or optional examples of other embodiments or examples.

[0036] Embodiment 1

[0037] According to an embodiment of the present invention, a method embodiment of an optional message processing method is provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0038] Figure 1 is a flowchart of an optional message processing method according to an embodiment of the present invention, such as Figure 1 As shown, the method comprises the following steps:

[0039] Step S101, obtaining the estimated processing time of the target encryption card for processing each of the M messages.

[0040] The target encryption card may include but is not limited to a hardware encryption card used in network security products, and the target encryption card may use an encryption algorithm to process the message. The M messages may include: messages to be processed by the target encryption card, including but not limited to the first M messages of all messages to be processed by the target encryption card.

[0041] The estimated processing time for the target encryption card to process each of the M messages may be obtained by estimating the processing time for the target encryption card to perform encryption or decryption processing on each message.

[0042] In some examples, the estimated processing time of each of the M messages to be processed by the target encryption card can be read from the message estimated processing time table.

[0043] Here, the estimated processing time of each of the M messages by the target encryption card can be obtained from the message processing estimated time information according to the message information of the M messages to be processed by the target encryption card.

[0044] The message processing estimated time information can be used to record different encryption cards, the estimated processing time for different messages under different CPU (central processing unit) utilization rates and different queue lengths. The message processing estimated time information can be recorded in the form of a table. The table recording the message estimated processing time information can be called a message estimated processing time table.

[0045] Before obtaining the estimated processing time of each message among the M messages to be processed by the target encryption card, it can include: determining the target message queue associated with the target encryption card, wherein the target message queue can be used to record the message information of the messages to be processed by the target encryption card, wherein the message information can include: the length of the message; in this embodiment, the message information of M messages can be read from the target message queue to obtain M message information, wherein the M message information can be the message information of the above-mentioned M messages, and the message information of the message can, for example, include the message length and processing time information of the message, and the processing time information can represent the time when the message arrives at the target message queue (that is, the time when the target message queue receives the message).

[0046] In this embodiment, a message processing queue information queue (Queue) may be maintained for each encryption card. The queue may record the length of the message sent to the encryption card for processing (referred to as message length) and processing time information.

[0047] For example, the message to be processed is sent to encryption card N (corresponding to the target encryption card), and the message length and processing time information can be recorded in the message processing message queue Queue associated with encryption card N, that is, recorded in the target message queue, and then M messages can be processed in batches to improve efficiency. Specifically, the message length (that is, message information) of M messages can be obtained from the target message queue.

[0048] Step S102, based on the estimated processing time of each message in the M messages, estimate the time when the M messages are processed by the target encryption card to obtain the estimated time, where M is a positive integer.

[0049] Here, the time when the M messages are processed by the target encryption card is the end time when the M messages are processed by the target encryption card. The target encryption card processes the M messages in sequence according to the order of the M messages to be processed in the message queue.

[0050] For example, based on the estimated processing time of the target encryption card for each of the M messages and the start processing time of the first message processed by the target encryption card among the M messages (the time when the target message queue receives the first message can be used as the start processing time of the first message), the time when all M messages are processed by the target encryption card is estimated.

[0051] Step S103: at the estimated time, pull the message processed by the target encryption card to obtain the pull result.

[0052] The above-mentioned pulling result may include: taking M as the maximum message pulling amount, the messages actually processed by the target encryption card and the number of messages among the M messages pulled from the target encryption card.

[0053] By estimating the time to pull the message processed by the encryption card (ie the estimated time), the situation in the related art of periodically pulling the message processed by the encryption card, resulting in invalid pulling and wasting system resources, is avoided.

[0054] It can be understood that the result of pulling the message from the target encryption card based on the estimated time this time can be used to adjust the estimated processing time of each of the M messages to be processed by the target encryption card to obtain the estimated time for pulling the message from the target encryption card next time.

[0055] Through the above steps, in this embodiment, the estimated processing time of each message is used to estimate the time of pulling the message processed by the encryption card, and the processing result of the message is pulled at the estimated time, avoiding the situation of periodically pulling the processing result of the message by the encryption card in the related art, which has invalid pulling and wastes system resources, thereby achieving the technical effect of reducing the system resources required for pulling the processing result of the message by the encryption card. In addition, the technical problem that the CPU in the related art uses the method of periodically pulling data to pull the processing result of the encryption card on the message to be processed, which wastes CPU resources, is solved.

[0056] Figure 2 This is a flow chart of an optional message processing method according to an embodiment of the present invention. Figure 1 ,like Figure 2 As shown, including:

[0057] (1) The CPU sends the message to be processed to the available encryption card N (corresponding to the target encryption card), and records the message length and processing time information into the corresponding message processing message queue Queue;

[0058] (2) The CPU obtains the estimated duration (corresponding to the estimated processing duration) of each of the M messages through the estimation table (i.e., the message processing estimated duration table), and fetches the M messages from the encryption card based on the estimated duration;

[0059] (3) The CPU obtains N messages from encryption card N;

[0060] (4) The CPU adjusts the estimated duration (corresponding to the estimated processing duration) based on the obtained message results.

[0061] In some embodiments, the pulling result includes: at the estimated time, the number N of messages actually processed by the target encryption card is pulled, where N is a natural number; at the estimated time, the messages processed by the target encryption card are pulled, and after obtaining the pulling result, it also includes: when N is equal to M, S historical pulling results are obtained, and based on the S historical pulling results and the pulling result, the estimated processing time of the first specified message is adjusted, wherein the historical pulling results include: before the estimated time, with M as the maximum number of messages to be pulled, the pulling results of the messages actually processed by the target encryption card are pulled, and S is a positive integer; when N is less than M, the estimated processing time of the second specified message is increased.

[0062] The pull result pulled at the estimated time can represent the number N of messages actually processed by the target encryption card at the estimated time, with M as the maximum pull amount of messages. The above historical pull result can represent the pull result of pulling the messages actually processed by the target encryption card before the estimated time, with M as the maximum pull amount of messages, that is, the pull result of the historical time period before the estimated time.

[0063] Different historical pull results are for different historical estimation moments. Here, the S historical pull results may be the pull results of S consecutive historical pull messages from the target encryption card.

[0064] In some examples, the first designated message may be part or all of the M messages to be processed by the target encryption card, and the second designated message may be part or all of the M messages to be processed by the target encryption card. No specific limitation is made here.

[0065] In other examples, the above-mentioned first designated message and the second designated message may be certain designated messages, the first designated message and the second designated message may be one or more pre-designated messages, or may be messages selected according to preset rules (for example, message length, current CPU utilization, number of messages to be processed by the encryption card, etc. and a pre-defined mapping relationship of a certain message), for example, a message whose length is within the first preset message length range is taken as the first designated message; or, a message whose length is within the second preset message length range is taken as the second designated message, the first designated message and the second designated message may be the same or different, and there is no limitation here.

[0066] In this embodiment, the estimated processing time of the message can also be dynamically adjusted according to the pulling results of the message processed by the encryption card. Specifically, the estimated processing time of the message can be dynamically adjusted according to whether the pulling results of the message meet the expected quantity.

[0067] When N is equal to M, it can be said that the estimated time is exactly the same as the time when the actual processing of M messages is completed. At this time, S historical pulling results can be obtained, and based on the S historical pulling results and the pulling results, it is determined whether to adjust the estimated processing time of the first specified message. When it is determined to adjust the estimated processing time of the first specified message, the estimated processing time of the relevant message (corresponding to the first specified message) can be shortened based on the length of the processed message, the current CPU utilization rate, the number of messages to be processed by the encryption card N (corresponding to the target encryption card), etc.

[0068] When N is less than M, it can mean that the estimated time is before the time when M messages are actually processed, that is, M messages are pulled at the estimated time, and M messages have not been completely processed by the target encryption card. At this time, the estimated processing time of the second specified message can be increased according to the set ratio, based on the length of the processed message, the current CPU utilization, the number of messages to be processed by encryption card N, etc.

[0069] Whether M messages can be completely pulled at the estimated time is determined whether to adjust the estimated processing time of the messages, thereby achieving the purpose of dynamically adjusting the pulling time of the messages processed by the encryption card according to the processing efficiency of the encryption card, avoiding the situation in the related technology where only processed messages can be pulled from the encryption card at a specified time, resulting in invalid pulling, and achieving the technical effect of improving the utilization rate of system resources (for example, CPU utilization).

[0070] For example, the estimated processing time may be adjusted according to the acquisition result (corresponding to the pull result).

[0071] For example, if N is equal to M, and the number of consecutive correct estimates is greater than a threshold value (i.e., in the historical pull results of S historical pulls, each historical pull can pull M messages), it can be determined whether to reduce the associated message estimated duration in the message processing estimated duration table (used to record the estimated processing duration of the message) based on whether the estimated time is the same as the time when the M messages are actually processed;

[0072] For another example, if N is equal to M, but the number of consecutive correct estimates is less than the threshold, no adjustment is made;

[0073] For another example, if N is less than M, then according to the set ratio, based on the processed message length, the current CPU utilization, and the number of messages to be processed by encryption card N, the estimated time of the relevant message (corresponding to the second specified message) in the message processing estimated time table is increased to update the message processing estimated time table.

[0074] Optionally, based on S historical pulling results and the pulling results, the estimated processing time of the first designated message is adjusted, including: based on the S historical pulling results, determining an estimated correct number of times, wherein the estimated correct number of times includes: the number of historical pulling results of M messages that can be pulled from the S historical pulling results and that are actually processed by the target encryption card; when the estimated correct number of times is greater than or equal to a preset threshold, if the estimated time is after the time when the M messages are actually processed by the target encryption card, the estimated processing time of the first designated message is shortened; when the estimated correct number of times is greater than or equal to the preset threshold and the estimated time is equal to the time when the M messages are actually processed by the target encryption card, or when the estimated correct number of times is less than the preset threshold, it is prohibited to adjust the estimated processing time of the first designated message.

[0075] For example, if N is equal to M, and the number of consecutive correct estimates is greater than a preset threshold (that is, in the historical pull results of S historical pulls, each historical pull can pull M messages), it can be determined whether to reduce the associated message estimated time (that is, the estimated processing time) in the message processing estimated time table (used to record the estimated processing time of the message) based on whether the estimated time is the same as the time when the M messages are actually processed.

[0076] Exemplarily, the current duration is equal to the recorded growth duration (ie, the estimated time is the same as the time when the M messages are actually processed and completed), and the estimated processing duration of the first designated message may not be adjusted.

[0077] As another example, if the current duration is greater than the recorded growth duration (i.e., the estimated time is after the time when M messages are actually processed), the associated message estimated time in the message processing estimated time table (used to record the estimated processing time of the message) is reduced according to the set ratio, based on the processed message length, the current CPU utilization, and the number of messages to be processed by encryption card N.

[0078] If N is equal to M, but the number of consecutive correct estimates is less than the threshold, the estimated processing time for the first designated message may not be adjusted.

[0079] When M messages can be completely pulled at the estimated time, it is determined whether to adjust the estimated processing time of the message based on the historical pulling results, thereby achieving the purpose of dynamically adjusting the pulling time of the message processed by the encryption card according to the processing efficiency of the encryption card.

[0080] Optionally, before estimating the moment when the M messages are processed by the target encryption card based on the estimated processing time of each message in the M messages and obtaining the estimated moment, the message processing method also includes: determining a message to be detected; encrypting the message to be detected using a first encryption card to obtain an encrypted message; decrypting the encrypted message using a second encryption card to obtain a first decrypted message; determining a device status of the target encryption card based on the message to be detected and the first decrypted message, wherein the target encryption card is the first encryption card or the second encryption card; when the device status of the target encryption card is normal, executing the step of estimating the moment when the M messages are processed by the target encryption card based on the estimated processing time of each message in the M messages and obtaining the estimated moment.

[0081] The above-mentioned device status may include: normal status and fault status. In this embodiment, a message can be randomly selected, the original content of the message can be recorded, and the message can be marked as a message to be detected. The message to be detected is sent to encryption card 1 (corresponding to the first encryption card) for encryption processing. The CPU can obtain the encrypted message corresponding to the message to be detected from encryption card 1, and use the second encryption card to decrypt the encrypted message to obtain the first decrypted message. According to the message to be detected, the first decrypted message and the CPU, the device status of the first encryption card and the second encryption card is determined. If the first encryption card is the target encryption card, the device status of the target encryption card can be the device status of the first encryption card. If the second encryption card is the target encryption card, the device status of the target encryption card can be the device status of the second encryption card.

[0082] In one example, a device status table (used to record the device status of the encryption card) can be maintained for each encryption card. When it is detected that the encryption card (including the first encryption card and the second encryption card) is in a faulty state, the corresponding encryption card status in the device status table can be modified to a faulty state. When the CPU detects that the encryption card device status in the device status table is a faulty state, the encryption card can no longer be used to process traffic (or process messages).

[0083] The device status of the above-mentioned target encryption card can be read directly from the device status table, and when the device status of the target encryption card is recorded in the device status table as normal, the estimated processing time of each message in the M messages can be used to estimate the time when the M messages are processed by the target encryption card to obtain the estimated time step.

[0084] Figure 3 This is a flow chart of an optional message processing method according to an embodiment of the present invention. Figure 2 , can be applied to encryption card fault detection, such as Figure 3 As shown, including:

[0085] (1) Randomly select a message, record the original content of the message, and mark the message as a message to be detected;

[0086] (2) The message is sent to encryption card 1 for encryption processing;

[0087] (3) The CPU obtains the encrypted message corresponding to the message to be detected from encryption card 1;

[0088] (4) The CPU sends the encrypted message to encryption card 2 (corresponding to the second encryption card) for decryption, and uses the CPU to decrypt the message;

[0089] (5) The CPU obtains decrypted message 1 from encryption card 2, and decrypts it to obtain decrypted message 2;

[0090] (6) Compare the decrypted message 1, the decrypted message 2 and the recorded original message content to obtain the detection result;

[0091] (7) Update the encryption card status, randomly select the next detection time, and continue detection.

[0092] It should be noted that the algorithm used in the fault detection process for the encryption card can be an algorithm supported by the encryption card and the CPU also supports the encryption algorithm, for example, the AES-256 algorithm.

[0093] By detecting the device status of the encryption card, the situation in which the encryption card in a faulty state processes the message and affects the business processing is avoided. When performing device status detection, the message to be detected can be randomly selected, and data of any length and content that meets the requirements can be verified, avoiding the situation in related technologies where only given data can be verified, thereby achieving the technical effect of improving the flexibility of encryption card status detection.

[0094] Optionally, based on the message to be detected and the first decrypted message, the device status of the target encryption card is determined, including: using the second encryption card to decrypt the encrypted message to obtain the first decrypted message; using the central processing unit to decrypt the encrypted message to obtain the second decrypted message; based on the message to be detected, the first decrypted message and the second decrypted message, the device status of the target encryption card is determined.

[0095] In one example, the CPU can send the encrypted message (corresponding to the encrypted message) to encryption card 2 (corresponding to the second encryption card) for decryption, and use the CPU to decrypt the encrypted message (i.e., use the CPU to decrypt the encrypted message), and then the CPU can obtain decrypted message 1 (corresponding to the first decrypted message) from encryption card 2, and at the same time the CPU decrypts to obtain decrypted message 2 (corresponding to the second decrypted message), compare decrypted message 1, decrypted message 2 with the recorded original message content (i.e., the message content of the message to be detected), and obtain the detection result, wherein the detection result may include the device status of the first encryption card and the second encryption card, that is, whether the first encryption card and the second encryption card are in a normal state or in a faulty state.

[0096] In order to avoid sending detection instructions to the encryption card in the related technology and judging the fault status based on the result returned by the encryption card, the encryption card itself needs to support fault detection, which has complex functions and is difficult to implement for random message inspection. In this embodiment, the device status of the first encryption card and the second encryption card are detected through the first encryption card, the second encryption card and the central processing unit, thereby achieving the purpose of using pure software for detection, which is simple to implement and flexible in detection, and does not require the encryption card to implement complex self-detection functions.

[0097] Optionally, based on the message to be detected, the first decrypted message and the second decrypted message, the device status of the target encryption card is determined, including: judging whether the message contents of the message to be detected, the first decrypted message and the second decrypted message are consistent to obtain a judgment result; based on the judgment result, determining the device status of the first encryption card and the device status of the second encryption card, and based on the device status of the first encryption card or the device status of the second encryption card, determining the device status of the target encryption card.

[0098] In this embodiment, it is possible to determine whether the message contents of the to-be-detected message, the first decrypted message and the second decrypted message are consistent, and based on the determination result, determine the device status of the first encryption card and the device status of the second encryption card.

[0099] For example, if the contents of decrypted message 1 (corresponding to the first decrypted message) and decrypted message 2 (corresponding to the second decrypted message) are consistent with the original message (corresponding to the message to be detected), then encryption card 1 (corresponding to the first encryption card) and encryption card 2 (corresponding to the second encryption card) are both normal;

[0100] For another example, if the contents of decrypted message 1 and decrypted message 2 are the same, but inconsistent with the original message contents, then encryption card 1 is faulty and encryption card 2 is normal;

[0101] For another example, if the content of decrypted message 2 is the same as the original message content, and the content of decrypted message 1 is inconsistent with the original message content, then encryption card 1 is normal and encryption card 2 is faulty;

[0102] For another example, if the content of decrypted message 2 is the same as the original message content but inconsistent with the content of decrypted message 1, then encryption card 1 is faulty and encryption card 2 is faulty.

[0103] In this embodiment, the device status of encryption card 1 and encryption card 2 in the device status table can be updated according to the device status of encryption card 1 and encryption card 2 (ie, normal status or fault status).

[0104] If encryption card 1 is the target encryption card, the device status of the target encryption card may be the device status of encryption card 1 ; if encryption card 2 is the target encryption card, the device status of the target encryption card may be the device status of encryption card 2 .

[0105] In this embodiment, the next detection time can also be randomly selected to continuously detect the device status of the encryption card. By strictly comparing the encryption and decryption data, the technical effect of improving the accuracy of the device status detection result of the encryption card is achieved.

[0106] Optionally, before estimating the moment when the M messages are processed by the target encryption card based on the estimated processing time of each message in the M messages and obtaining the estimated moment, it may also include: determining a target message queue associated with the target encryption card, wherein the target message queue can be used to record message information of the messages to be processed by the target encryption card, wherein the message information includes at least: the length of the message, reading the message information of the M messages from the target message queue, and obtaining M message information.

[0107] The M messages may be the first M messages to be processed by the target encryption card, and the message information of the first M messages may be read from the target message queue to obtain the M message information.

[0108] In this embodiment, a message processing queue information queue (Queue) may be maintained for each encryption card, and the queue may record the length of the message sent to the encryption card for processing (referred to as message length) and the encryption processing time.

[0109] For example, the message to be processed is sent to encryption card N (corresponding to the target encryption card), and the message length and processing time information can be recorded in the corresponding message processing message queue Queue, that is, recorded in the target message queue, and then M messages can be processed in batches to improve efficiency. Specifically, the message lengths of M messages can be obtained from the target message queue.

[0110] Optionally, before estimating the moment when the M messages are processed by the target encryption card based on the estimated processing time of each message in the M messages and obtaining the estimated moment, the message processing method also includes: reading the estimated message processing time information, wherein the estimated message processing time information is used to record the estimated processing time of different encryption cards for different messages; based on the estimated message processing time information and the M message information, querying the estimated processing time of each message in the M messages by the target encryption card, wherein the M message information includes: the message information of the message to be processed by the target encryption card.

[0111] The above-mentioned message estimated duration information is recorded through the message processing time estimation table. For example, the CPU can maintain a message processing estimated duration table for each encryption card. The message processing estimated duration table can record the estimated processing time of messages of different lengths under different CPU utilizations and different encryption card queue lengths, thereby providing estimated duration data for CPU scheduling. Table 1 is an example of a message processing estimated duration table.

[0112] Table 1

[0113]

[0114] For example, taking encryption card 1 as the target encryption card, assuming that the current CPU utilization is 15%, the current total number of messages in the message queue of encryption card 1 (ie, the queue length) is 64, and if the message length of a message in the message queue is 128, the estimated processing time of the message is 1us.

[0115] According to the message processing estimated time table, the estimated processing time of each of the M messages by the target encryption card can be queried, achieving the technical effect of accurately obtaining the estimated processing time of the message.

[0116] Optionally, the message processing estimated time information includes: the estimated processing time, the encryption card identifier, the utilization rate of the central processing unit, and the correlation relationship between the message queue length. Based on the message processing estimated time information and the M message information, the target encryption card is queried for the estimated processing time of each of the M messages, including: determining the utilization rate of the central processing unit at the current moment, the length of the target message queue, and the length of each of the M messages; based on the utilization rate of the central processing unit at the current moment, the length of the target message queue, and the length of each of the M messages, in the message processing estimated time information, the estimated processing time of each of the M messages is queried to obtain the estimated processing time of each of the M messages, wherein the target message queue is used to record the message information of the message to be processed by the target encryption card.

[0117] In this embodiment, the utilization rate of the central processing unit and the length of the target message queue at the current moment can be collected, the message length of each message in the target message queue can be read from the target message queue, and then the message processing estimated time information can be found to obtain the estimated processing time of each message in the M messages.

[0118] After obtaining the estimated processing time of each of the M messages, the total estimated processing time of the M messages can be calculated, and then the estimated time is calculated according to the time when the first message among the M messages starts to be processed.

[0119] In one example, the CPU can obtain the message lengths of the first M messages recorded in the message processing message queue Queue (target message queue) and the time T1 when the first message among the first M messages starts to be processed (here, the time when the first message among the first M messages reaches the message processing message queue can be taken as the time T1 when the first message starts to be processed), and based on the obtained M message lengths, the current CPU utilization, and the total number of messages in the queue L, the message processing estimated time table is searched to obtain the estimated processing time T for the first M messages (the total estimated processing time for the M messages), and the CPU attempts to obtain the M processed messages from the encryption card N at time (T1+T) (corresponding to the estimated time).

[0120] The estimated message processing time T is calculated as follows:

[0121]

[0122] Among them, cpu_useage can represent the current CPU utilization, L can represent the total number of messages in encryption card N (target encryption card) (that is, the number of messages still being processed in the encryption card), pak[i] can represent the message length of the i-th message, Table(cpu_useage,L,pak[i]) can represent the estimated processing time of the i-th message (that is, the estimated processing time) obtained from the message processing estimated time table, and after the CPU actually obtains N processed messages from encryption card N, it removes N message information from the message processing message queue Queue.

[0123] The processing time is estimated based on the message length, CPU utilization, and the number of messages to be processed by the encryption card. The messages processed by the encryption card are pulled based on the estimated time. The estimated processing time is dynamically adjusted based on the pulling result. The actual transmitted messages are randomly selected for encryption and decryption comparison, encryption card failures are detected and faulty encryption cards are shielded, so that multiple encryption cards can be efficiently scheduled to improve forwarding performance. At the same time, encryption card failures can be quickly detected and processed, reducing the maintenance workload of encryption cards.

[0124] Embodiment 2

[0125] Embodiment 2 of the present invention provides an optional message processing device, and each implementation unit in the message processing device corresponds to each implementation step in Embodiment 1.

[0126] Figure 4 is a schematic diagram of an optional message processing device according to an embodiment of the present invention, such as Figure 4 As shown, the message processing device includes: an acquisition unit 41, an estimation unit 42 and a pulling unit 43.

[0127] The acquisition unit 41 is used to obtain the estimated processing time of the target encryption card for processing each of the M messages;

[0128] The estimating unit 42 is used to estimate the time when the M messages are processed by the target encryption card according to the estimated processing time of each message in the M messages, and obtain an estimated time, wherein M is a positive integer;

[0129] The pulling unit 43 is used to pull the message processed by the target encryption card at the estimated time to obtain the pulling result.

[0130] In the message processing device provided in the second embodiment of the present invention, the estimated processing time of the target encryption card to process each of the M messages can be obtained by the acquisition unit 41; the estimated time when the M messages are processed by the target encryption card can be estimated by the estimation unit 42 according to the estimated processing time of each of the M messages, where M is a positive integer, and the message processed by the target encryption card is pulled at the estimated time by the pulling unit 43 to obtain the pulling result. Thus, the technical problem that the CPU in the related art uses the method of periodically pulling data to pull the processing result of the message to be processed by the encryption card and wastes CPU resources is solved. In this embodiment, the pulling time of the message processed by the encryption card is estimated by the estimated processing time of each message, and the processing result of the message is pulled at the estimated pulling time, which avoids the situation that the encryption card periodically pulls the processing result of the message in the related art, and there is invalid pulling and waste of system resources, thereby achieving the technical effect of reducing the system resources required for pulling the processing result of the encryption card on the message.

[0131] Optionally, in the message processing device provided in Example 2 of the present invention, the pulling result includes: at the estimated time, the number N of messages actually processed by the target encryption card is pulled, where N is a natural number, and the message processing device also includes: a first processing unit, used to pull the message processed by the target encryption card at the estimated time, and after obtaining the pulling result, when N is equal to M, obtain S historical pulling results, and adjust the estimated processing time of the first specified message based on the S historical pulling results and the pulling result, wherein the historical pulling results include: before the estimated time, with M as the maximum number of messages to be pulled, the pulling result of the messages actually processed by the target encryption card is pulled, and S is a positive integer; an increasing unit, used to increase the estimated processing time of the second specified message when N is less than M.

[0132] Optionally, in the message processing device provided in Example 2 of the present invention, the first processing unit includes: a first determination sub-unit, used to determine an estimated correct number of times based on S historical pulling results, wherein the estimated correct number of times includes: the number of historical pulling results that can pull M messages that are actually processed by the target encryption card among the S historical pulling results; a first processing sub-unit, used to reduce the estimated processing time of the first specified message when the estimated correct number of times is greater than or equal to a preset threshold and the estimated time is after the time when the M messages are actually processed by the target encryption card; a second processing sub-unit, used to prohibit adjustment of the estimated processing time of the first specified message when the estimated correct number of times is greater than or equal to the preset threshold and the estimated time is equal to the time when the M messages are actually processed by the target encryption card, or when the estimated correct number of times is less than the preset threshold.

[0133] Optionally, in the message processing device provided in Embodiment 2 of the present invention, the message processing device also includes: a first determination unit, used to determine the message to be detected before obtaining the estimated time by estimating the time when the M messages are processed by the target encryption card based on the estimated processing time of each message in the M messages; an encryption unit, used to encrypt the message to be detected using the first encryption card to obtain an encrypted message; a decryption unit, used to decrypt the encrypted message using the second encryption card to obtain a first decrypted message; a second processing unit, used to determine the device status of the target encryption card based on the message to be detected and the first decrypted message, wherein the target encryption card is the first encryption card or the second encryption card; an execution unit, used to execute the step of obtaining the estimated processing time for the target encryption card to process each of the M messages when the device status of the target encryption card is normal.

[0134] Optionally, in the message processing device provided in Embodiment 2 of the present invention, the second processing unit includes: a decryption subunit, used to use a central processing unit to decrypt the encrypted message to obtain a second decrypted message; and a second determination subunit, used to determine the device status of the target encryption card based on the message to be detected, the first decrypted message and the second decrypted message.

[0135] Optionally, in the message processing device provided in Embodiment 2 of the present invention, the second determination subunit includes: a judgment module, used to judge whether the message contents of the message to be detected, the first decrypted message, and the second decrypted message are consistent, and obtain a judgment result; a processing module, used to determine the device status of the first encryption card and the device status of the second encryption card based on the judgment result, and determine the device status of the target encryption card based on the device status of the first encryption card or the device status of the second encryption card.

[0136] Optionally, in the message processing device provided in Embodiment 2 of the present invention, the message processing device also includes: a second determination unit, used to estimate the time when the M messages are processed by the target encryption card based on the estimated processing time of each message in the M messages, and before obtaining the estimated time, determine the target message queue associated with the target encryption card, wherein the target message queue is used to record message information of the messages to be processed by the target encryption card, wherein the message information includes at least: the length of the message; a reading unit, used to read the message information of the M messages from the target message queue to obtain M message information.

[0137] Optionally, in the message processing device provided in the second embodiment of the present invention, the acquiring unit includes:

[0138] The reading subunit is used to estimate the time when the M messages are processed by the target encryption card according to the estimated processing time of each message in the M messages, and read the message processing estimated time information before obtaining the estimated time, wherein the message processing estimated time information is used to record the estimated processing time of different encryption cards for different messages;

[0139] The query subunit is used to query the estimated processing time of each of the M messages by the target encryption card based on the message processing estimated time information and M message information, wherein the M message information includes: the message information of the message to be processed by the target encryption card.

[0140] Optionally, in the message processing device provided in the second embodiment of the present invention, the message processing estimated time information includes: an estimated processing time, an identifier of the encryption card, a utilization rate of the central processing unit, and a correlation relationship between the message queue length, and the query subunit is used to:

[0141] Determine the utilization rate of the central processing unit at the current moment, the length of the target message queue, and the length of each message in the M messages, wherein the target message queue is used to record the message information of the message to be processed by the target encryption card;

[0142] Based on the current CPU utilization, the length of the target message queue, and the length of each of the M messages, the estimated processing time of each of the M messages is queried in the message processing estimated time information to obtain the estimated processing time of each of the M messages.

[0143] The above-mentioned message processing device may also include a processor and a memory. The above-mentioned acquisition unit 41, estimation unit 42 and pulling unit 43 are all stored in the memory as program units, and the processor executes the above-mentioned program units stored in the memory to realize corresponding functions.

[0144] The processor includes a kernel, which retrieves the corresponding program unit from the memory. One or more kernels can be set, and the kernel parameters can be adjusted to estimate the estimated processing time of each message, estimate the time of pulling the message processed by the encryption card, and pull the processing result of the message at the estimated time, thereby avoiding the situation in the related art of periodically pulling the processing result of the encryption card on the message, resulting in invalid pulling and wasting system resources, thereby achieving the technical effect of reducing the system resources required for pulling the processing result of the encryption card on the message.

[0145] The above-mentioned memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM, and the memory includes at least one storage chip.

[0146] According to another aspect of an embodiment of the present invention, there is also provided an electronic device, comprising: a processor; and a memory for storing executable instructions of the processor; wherein the processor is configured to execute any one of the above-mentioned message processing methods by executing the executable instructions.

[0147] According to another aspect of an embodiment of the present invention, a computer-readable storage medium is provided, which stores a computer program, wherein when the computer program runs, the device where the computer-readable storage medium is located is controlled to execute any one of the above-mentioned message processing methods.

[0148] Figure 5 is a schematic diagram of an electronic device according to an embodiment of the present invention, such as Figure 5 As shown, an embodiment of the present invention provides an electronic device 50, which includes a processor, a memory, and a program stored in the memory and executable on the processor, and implements any one of the above message processing methods when the processor executes the program.

[0149] The serial numbers of the above embodiments of the present invention are only for description and do not represent the advantages or disadvantages of the embodiments.

[0150] In the above embodiments of the present invention, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.

[0151] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. Among them, the device embodiments described above are only schematic. For example, the division of the units can be a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.

[0152] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple units. Some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.

[0153] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0154] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, magnetic disk or optical disk and other media that can store program codes.

[0155] The above is only a preferred embodiment of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principle of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.

Claims

1. A message processing method, characterized in that: include: Obtain an estimated processing time for the target encryption card to process each of the M messages; According to the estimated processing time of each message in the M messages, estimate the time when the M messages are processed by the target encryption card to obtain an estimated time, where M is a positive integer; At the estimated time, the message processed by the target encryption card is pulled to obtain a pulling result.

2. The message processing method according to claim 1, characterized in that: The pulling result includes: at the estimated time, the number N of messages actually processed by the target encryption card is pulled, where N is a natural number. At the estimated time, after pulling the messages processed by the target encryption card, the pulling result is obtained, and further includes: When N is equal to M, S historical pulling results are obtained, and based on the S historical pulling results and the pulling result, the estimated processing time of the first specified message is adjusted, wherein the historical pulling result includes: before the estimated time, with M as the maximum number of messages to be pulled, the pulling result of the messages actually processed by the target encryption card is pulled, and S is a positive integer; When N is less than M, the estimated processing time of the second designated message is increased.

3. The message processing method according to claim 2, characterized in that: Adjusting the estimated processing time of the first designated message based on the S historical pulling results and the pulling result includes: Based on the S historical pull results, determine the estimated correct number of times, wherein the estimated correct number of times includes: the number of historical pull results of M messages that can be pulled from the S historical pull results and that are actually processed by the target encryption card; When the estimated correct number of times is greater than or equal to the preset threshold, if the estimated time is after the time when the M messages are actually processed by the target encryption card, the estimated processing time of the first designated message is reduced; When the estimated number of correct answers is greater than or equal to the preset threshold and the estimated time is equal to the time when the M messages are actually processed by the target encryption card, or when the estimated number of correct answers is less than the preset threshold, it is prohibited to adjust the estimated processing time of the first designated message.

4. The message processing method according to claim 1, characterized in that: Before estimating the time when the M messages are processed by the target encryption card based on the estimated processing time of each message in the M messages and obtaining the estimated time, the message processing method further includes: Determine the message to be detected; Encrypting the message to be detected by using a first encryption card to obtain an encrypted message; Decrypting the encrypted message using a second encryption card to obtain a first decrypted message; Determine the device status of the target encryption card based on the message to be detected and the first decrypted message, wherein the target encryption card is the first encryption card or the second encryption card; When the device state of the target encryption card is normal, the step of obtaining the estimated processing time for the target encryption card to process each of the M messages is performed.

5. The message processing method according to claim 4, characterized in that: Determining the device state of the target encryption card based on the message to be detected and the first decrypted message includes: Decrypting the encrypted message using a central processing unit to obtain a second decrypted message; The device state of the target encryption card is determined based on the message to be detected, the first decrypted message and the second decrypted message.

6. The message processing method according to claim 5, characterized in that: Determining the device state of the target encryption card based on the message to be detected, the first decrypted message, and the second decrypted message includes: Determine whether the message contents of the message to be detected, the first decrypted message, and the second decrypted message are consistent, and obtain a determination result; Based on the judgment result, the device status of the first encryption card and the device status of the second encryption card are determined, and based on the device status of the first encryption card or the device status of the second encryption card, the device status of the target encryption card is determined.

7. The message processing method according to claim 1, characterized in that: Obtain the estimated processing time of the target encryption card for processing each of the M messages, including: Reading the estimated time information of message processing, wherein the estimated time information of message processing is used to record the estimated processing time of different encryption cards processing different messages; Based on the message processing estimated time information and M message information, the estimated processing time for the target encryption card to process each of the M messages is queried, wherein the M message information includes: message information of the M messages to be processed by the target encryption card.

8. The message processing method according to claim 7, characterized in that: The message processing estimated time information includes: an estimated processing time of the message, an identifier of the encryption card, a utilization rate of the central processing unit, and a correlation relationship between the message queue length. Based on the message processing estimated time information and the M message information, querying the estimated processing time of each of the M messages processed by the target encryption card includes: Determine the utilization rate of the central processing unit at the current moment, the length of the target message queue, and the length of each message in the M messages, wherein the target message queue is used to record the message information of the message to be processed by the target encryption card; Based on the utilization rate of the central processing unit at the current moment, the length of the target message queue, and the length of each of the M messages to be processed by the target encryption card, the estimated processing time for the target encryption card to process each of the M messages is queried in the message processing estimated time information.

9. A message processing device, characterized in that: include: An acquisition unit, used for acquiring an estimated processing time of each of the M messages processed by the target encryption card; An estimating unit, configured to estimate the time when the M messages are processed by the target encryption card according to the estimated processing time of each message in the M messages, to obtain an estimated time; The pulling unit is used to pull the message processed by the target encryption card at the estimated time to obtain a pulling result.

10. An electronic device, characterized in that: It includes one or more processors and a memory, wherein the memory is used to store one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement the message processing method described in any one of claims 1 to 8.