A queue message processing method, device, hard disk, medium and product

By configuring thresholds and priorities for message queues and dynamically adjusting processing priorities, the problem of untimely processing of message queues in the prior art is solved, and more efficient message processing and bandwidth utilization are achieved.

CN119201502BActive Publication Date: 2025-04-25INSPUR SUZHOU INTELLIGENT TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202411721933.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-11-28
Publication Date
2025-04-25
Estimated Expiration
2044-11-28

AI Technical Summary

Technical Problem

The prior art cannot dynamically process the message queue according to the real-time situation of the scenario, resulting in the inability to issue request messages in a timely manner and the back-end bandwidth capabilities cannot be fully utilized.

Method used

Configure the queue message number threshold and the message processing number threshold for each message queue. Determine the processing priority based on the relationship between the message number and the threshold and the queue priority, and perform message processing in turn, and control the number of messages processed each time not exceeding the threshold.

Benefits of technology

It realizes dynamically adjusting the processing priority of message queues according to real-time conditions, issuing request messages in a timely manner, making full use of back-end bandwidth, and improving system response speed and message processing efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119201502B_ABST
    Figure CN119201502B_ABST
Patent Text Reader

Abstract

The present invention discloses a queue message processing method, equipment, hard disk, medium and product, which relates to the field of message scheduling technology, including: configuring corresponding queue message quantity threshold and message processing quantity threshold for each message queue; different message queues correspond to different queue priorities; based on the size relationship between the number of messages in the message queue and the corresponding queue message quantity threshold, and in combination with the queue priority, determine the processing priority of each message queue; process messages for each message queue in turn according to the processing priority, and control the number of messages processed this time not to be greater than the corresponding message processing quantity threshold each time any message queue is processed. In this way, the present application can redetermine the processing priority according to the actual situation of the message queue in combination with the queue priority and the queue message quantity threshold; it can avoid occupying resources for a long time, and improve the overall response speed and message processing efficiency of the system.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of message scheduling, and in particular to a queue message processing method, device, hard disk, medium and product. Background Art

[0002] The current SSD (Solid State Disk) mainly includes FTL (Flash Translation Layer) and Nand (Not AND) flash memory (a non-volatile flash chip based on Flash storage technology, which uses multiple parallel NAND gate circuits to store and read data). Among them, FTL (Flash Translation Layer) is a translation layer between NAND flash chip and basic file system, responsible for managing and optimizing the read and write operations of NAND flash. Through functions such as address mapping, garbage collection, wear leveling and bad block management, the read and write performance of NAND flash is optimized and its service life is extended. Therefore, the message types between FTL and NAND are diverse, and different arbitration processing is required in different occasions. At present, the Round-Robin principle is commonly used to process various types of messages, which is mainly reflected in a cyclic scheduling strategy. The core idea of ​​this strategy is to ensure the stability and efficient operation of the system by fairly allocating resources or opportunities to execute tasks. It is also widely used in other fields, including computer systems, network traffic management, process scheduling, etc. The above method can make more reasonable request allocation according to the configuration and load capacity of the message queue, but it still cannot be adjusted dynamically according to the real-time situation of the scene. In some scenes, the request message cannot be sent in time, that is, the backend bandwidth capacity cannot be fully utilized.

[0003] It can be seen that how to process the message queue according to the real-time situation and perform reasonable request allocation is a problem that technical personnel in this field need to solve. Summary of the invention

[0004] The purpose of the embodiments of the present invention is to provide a queue message processing method, device, hard disk, medium and product, which can solve the problem that the request message cannot be sent in time according to the real-time status of the scene dynamically.

[0005] To solve the above technical problems, in a first aspect, an embodiment of the present invention provides a queue message processing method, comprising:

[0006] Configure corresponding queue message quantity threshold and message processing quantity threshold for each message queue; different message queues correspond to different queue priorities;

[0007] Determine the processing priority of each message queue based on the relationship between the number of messages in the message queue and the corresponding queue message number threshold, and in combination with the queue priority;

[0008] Messages are processed in sequence for each of the message queues according to the processing priority, and each time messages are processed for any message queue, the number of messages processed this time is controlled not to be greater than the corresponding message processing number threshold.

[0009] Optionally, configuring a corresponding queue message quantity threshold and a message processing quantity threshold for each message queue includes:

[0010] Based on the queue priority of each message queue, respectively configure a queue message quantity threshold and a message processing quantity threshold corresponding to the queue priority for each message queue;

[0011] The message queues with different queue priorities are used to store to-be-processed messages corresponding to different types of tasks sent by the upper-layer system.

[0012] Optionally, there is an inverse correlation between the queue priority and the queue message quantity threshold, and there is a positive correlation between the queue priority and the message processing quantity threshold.

[0013] Optionally, determining the processing priority of each of the message queues includes:

[0014] Determining a current message queue from among the message queues according to the descending order of the queue priorities;

[0015] Determine a size relationship between the number of messages in the current message queue and the corresponding queue message number threshold, and determine a processing priority of the current message queue based on the size relationship and the queue priority of the current message queue;

[0016] The next message queue in each of the message queues is determined as the current message queue, and the process proceeds to the step of determining the size relationship between the number of messages in the current message queue and the corresponding threshold of the number of messages in the queue, until all of the message queues have been traversed.

[0017] Optionally, determining the processing priority of the current message queue based on the size relationship and the queue priority of the current message queue includes:

[0018] If the number of messages in the current message queue is greater than the corresponding queue message number threshold, it is determined that the processing priority of the current message queue is higher than the processing priority of the next message queue.

[0019] Optionally, determining the processing priority of the current message queue based on the size relationship and the queue priority of the current message queue includes:

[0020] If the number of messages in the previous message queue is not greater than the corresponding queue message number threshold, and the number of messages in the current message queue is greater than the corresponding queue message number threshold, it is determined that the processing priority of the current message queue is higher than the processing priority of the previous message queue.

[0021] Optionally, the performing message processing on each of the message queues in sequence according to the processing priority includes:

[0022] In the process of determining the processing priority of the current message queue based on the size relationship and the queue priority of the current message queue, if it is determined that the processing priority of the current message queue is greater than the processing priority of the next message queue, the current message queue is processed;

[0023] After the current message processing of the current message queue is completed, jump to the step of determining the next message queue in each message queue as the current message queue.

[0024] Optionally, the processing of the message on the current message queue includes:

[0025] Get the current pending message from the current message queue based on the first-in-first-out principle;

[0026] Process the current pending messages and count the number of messages that have been processed in real time;

[0027] If the number of messages processed this time is less than the message processing number threshold corresponding to the current message queue, the next message to be processed is obtained from the current message queue as the new current message to be processed, and the process jumps to the step of processing the current message to be processed until the preset loop end condition is met.

[0028] Optionally, the preset cycle end condition is that the number of messages processed this time is consistent with the message processing number threshold corresponding to the current message queue, or the number of messages in the current message queue has become zero.

[0029] Optionally, the processing of the current message to be processed includes:

[0030] Parse the current pending message and convert the corresponding parsed information into the pending command corresponding to the current pending message;

[0031] The command to be executed is sent to a preset command execution body, and the status information returned by the preset command execution body indicating that the command has been executed is forwarded to an upper-layer system to complete the processing process for the current message to be processed.

[0032] Optionally, sending the to-be-executed command to a preset command execution body includes:

[0033] Sending the to-be-executed command to a preset command queue in a preset command execution body for storage, so that the preset command execution body acquires and executes the to-be-executed command from the preset command queue based on a preset command acquisition rule;

[0034] The preset command acquisition rule is a rule for acquiring the to-be-executed commands from the preset command queue in ascending order of command execution time.

[0035] Optionally, sending the to-be-executed command to a preset command queue in a preset command execution body for storage includes:

[0036] According to the command type of the command to be executed, the command to be executed is sent to a preset command queue corresponding to the command type of the command to be executed in a preset command execution body for storage.

[0037] In a second aspect, the present application provides an electronic device, including:

[0038] Memory for storing computer programs;

[0039] A processor is used to execute the computer program to implement the steps of the queue message processing method as described above.

[0040] In a third aspect, the present application provides a solid state drive, comprising:

[0041] A flash translation layer, used for creating corresponding message queues based on different queue priorities; wherein the message queue is a queue for storing read and write messages to be processed;

[0042] The flash channel controller is used to implement the steps of the queue message processing method as described above by executing a computer program to complete the message processing of each of the message queues.

[0043] Optionally, the solid state hard disk further includes:

[0044] The flash memory is used to obtain and execute the to-be-executed read and write commands generated by the flash channel controller when processing the to-be-processed read and write messages, so as to complete the corresponding flash memory read and write operations.

[0045] In a fourth aspect, the present application provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the steps of the queue message processing method as described above are implemented.

[0046] In a fifth aspect, the present application provides a computer program product, including a computer program / instruction, which implements the steps of the above-mentioned queue message processing method when executed by a processor.

[0047] It can be seen from the above technical scheme that the present application first configures the corresponding queue message quantity threshold and message processing quantity threshold for each message queue; wherein different message queues correspond to different queue priorities; then, based on the size relationship between the number of messages in the message queue and the corresponding queue message quantity threshold, and in combination with the queue priority, the processing priority of each message queue is determined; then, according to the processing priority, each message queue is processed in turn, and each time a message is processed for any message queue, the number of messages processed this time is controlled not to be greater than the corresponding message processing quantity threshold. In this way, the present application introduces a queue message quantity threshold and a message processing quantity threshold on the basis of setting the priority of the message queue; in combination with the priority and the size relationship between the number of messages in each message queue and the queue message quantity threshold, the processing priority can be re-determined according to the actual situation of each message queue; in this way, a certain number of messages can be processed in time according to the pressure situation of each message queue and the message processing quantity threshold, so as to avoid the message queue occupying resources for a long time, and improve the overall response speed and message processing efficiency of the system. BRIEF DESCRIPTION OF THE DRAWINGS

[0048] In order to more clearly illustrate the embodiments of the present invention, the following briefly introduces the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0049] Figure 1 A flow chart of a queue message processing method disclosed in this application;

[0050] Figure 2 A flowchart of a specific queue message processing method disclosed in this application;

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

[0052] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions 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 are within the scope of protection of the present invention.

[0053] The terms "including" and "having" in the specification of the present invention and the above-mentioned drawings, as well as any variations thereof, are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device including a series of steps or units is not limited to the listed steps or units, but may include steps or units that are not listed.

[0054] In order to enable those skilled in the art to better understand the solution of the present invention, the present invention is further described in detail below in conjunction with the accompanying drawings and specific implementation methods.

[0055] like Figure 1 As shown, the embodiment of the present application discloses a queue message processing method, including:

[0056] Step S11: respectively configure a corresponding queue message quantity threshold and a message processing quantity threshold for each message queue; wherein different message queues correspond to different queue priorities.

[0057] In the embodiment of the present application, different message queues are used to store messages that have been issued but not yet executed, and each message queue corresponds to a different queue priority; and the present application can configure a corresponding queue message quantity threshold and message processing quantity threshold for each message queue. Among them, the queue message quantity threshold is used to limit the number of messages stored in a single message queue; the message processing quantity threshold is used to limit the number of messages that can be processed in a single round when processing messages in a single message queue.

[0058] In a specific embodiment, configuring a corresponding queue message quantity threshold and message processing quantity threshold for each message queue may include: based on the queue priority of each message queue, configuring a queue message quantity threshold and a message processing quantity threshold corresponding to the queue priority for each message queue; wherein the message queues with different queue priorities are used to store pending messages corresponding to different types of tasks sent by the upper system. Specifically, the queue message quantity threshold and message processing quantity threshold assigned to message queues with different queue priorities are different; in other words, due to the different queue priorities, the queue message quantity threshold and message processing quantity threshold of each message queue also differ; the specific setting can be based on actual conditions.

[0059] In another specific embodiment, the queue priority is inversely correlated with the queue message quantity threshold, and the queue priority is positively correlated with the message processing quantity threshold. It can be understood that in order to maintain the processing priority represented by the original queue priority of each message queue as much as possible, the queue message quantity threshold of the message queue can be set to be inversely correlated with its queue priority, that is, the higher the queue priority of the message queue, the smaller the corresponding queue message quantity threshold can be set relatively to avoid the situation of hoarding of messages in the high queue priority; accordingly, the lower the queue priority of the message queue, the higher the corresponding queue message quantity threshold can be set relatively; that is, messages in the low priority queue can wait more time than messages in the high priority queue. Further, the queue priority of each message queue should be positively correlated with its corresponding message processing quantity threshold, that is, the message processing quantity threshold corresponding to the high priority queue should be larger than the message processing quantity threshold corresponding to the low priority queue. It should be pointed out that the message processing quantity threshold of each message queue represents the number of messages that can be processed at a single time, which can be understood as the resources that can be occupied by a single message processing; in other words, the low-priority queue should try to avoid occupying resources for a long time when processing messages to reduce the waiting time of messages in the high-priority queue; it can be understood that for the single message processing time of each message queue, the high-priority queue should usually occupy more message processing time than the low-priority queue; that is, the high-priority queue should process more messages at a single time, and the low-priority queue should process fewer messages at a single time.

[0060] Step S12: Based on the relationship between the number of messages in the message queue and the corresponding queue message number threshold, and in combination with the queue priority, determine the processing priority of each message queue.

[0061] In an embodiment of the present application, through the above steps, a single message queue corresponds to a queue priority, a queue message quantity threshold and a processed message quantity threshold respectively; then, the processing priority of each message queue can be determined based on the size relationship between the real-time number of messages in the message queue and the corresponding queue message quantity threshold and the queue priority corresponding to the message queue; it can be understood that it is a common idea to only consider the original queue priority of each message queue to determine the corresponding processing priority. Here, on the basis of the queue priority, the size relationship between the number of messages in the message queue and the corresponding queue message quantity threshold is referred to. In this way, the processing order of each message queue can be adjusted according to the number of messages to re-evaluate the processing priority of each message queue.

[0062] In a specific embodiment, determining the processing priority of each of the message queues may include: determining the current message queue from each of the message queues according to the descending order of the queue priorities; determining the size relationship between the number of messages in the current message queue and the corresponding queue message number threshold, and determining the processing priority of the current message queue based on the size relationship and the queue priority of the current message queue; determining the next message queue in each of the message queues as the current message queue, and jumping to the step of determining the size relationship between the number of messages in the current message queue and the corresponding queue message number threshold, until all of the message queues have been traversed. Specifically, in the process of determining the processing priority of each message queue, the processing priority of each message queue is first determined in descending order of the queue priority; that is, the current message queue is determined according to the queue priority; then the size relationship between the number of messages in the current message queue and the corresponding queue message number threshold is determined, and the processing priority of the current message queue can be determined in combination with the queue priority of the current message queue; further, after determining the processing priority of a message queue, the next message queue can be traversed, and the next message queue can be determined as the new current message queue, and jump to the step of determining the size relationship between the number of messages in the current message queue and the corresponding queue message number threshold; according to the above steps of determining the processing priority of the message queue, each message queue can be traversed in turn until all the message queues are traversed and the processing priority of each message queue is determined.

[0063] In another specific embodiment, the determination of the processing priority of the current message queue based on the size relationship and the queue priority of the current message queue may include: if the number of messages in the current message queue is greater than the corresponding queue message number threshold, then determining that the processing priority of the current message queue is higher than the processing priority of the next message queue. Specifically, if the number of messages in the current message queue is greater than its corresponding queue message number threshold, it means that there are too many messages in the current message queue and some messages need to be processed in time, then it can be determined that the processing priority of the current message queue is higher than the processing priority of the next message queue; it can be understood that, in descending order of queue priority, the queue priority of the current message queue is greater than the queue priority of the next message queue, and the number of messages in the current message queue is greater than the corresponding queue message number threshold, then it is necessary to process some messages in the current message queue before processing the messages in the next message queue to reduce the number of messages to below the corresponding queue message number threshold.

[0064] In another specific embodiment, the processing priority of the current message queue is determined based on the size relationship and the queue priority of the current message queue, which may include: if the number of messages in the previous message queue is not greater than the corresponding queue message number threshold, and the number of messages in the current message queue is greater than the corresponding queue message number threshold, then the processing priority of the current message queue is determined to be higher than the processing priority of the previous message queue. Specifically, in descending order of queue priority, the queue priority of the previous message queue is higher than the current message queue. If the number of messages in the previous message queue is not greater than the corresponding queue message number threshold, and the number of messages in the current message queue is greater than the corresponding queue message number threshold, then it can be determined that the processing priority of the current message queue is higher than the processing priority of the previous message queue; it can be understood that if the number of messages in a single message queue is greater than the corresponding queue message number threshold, it means that the message queue needs to process some messages in time. At this time, the processing priority of the message queue can be adjusted, and before processing the messages in the previous message queue, some messages in the current message queue are processed to reduce the number of messages to below the corresponding queue message number threshold.

[0065] Step S13: Process messages in each message queue in turn according to the processing priority, and each time when processing messages in any message queue, control the number of messages processed this time to be no greater than the corresponding message processing number threshold.

[0066] In an embodiment of the present application, the above steps can be used to determine the processing priority of each message queue in combination with the queue priority of each message queue and the relationship between the number of messages in each message queue and its corresponding queue message number threshold; the processing priority here is obtained based on the combination of the queue priority and the number of messages, and then the messages in each message queue can be processed in turn according to the processing priority; it should be pointed out that when processing messages in a single message queue, it is necessary to control the number of messages processed in one message processing according to the message processing number threshold corresponding to the message queue; when processing a single message once, the number of messages processed should not be greater than the corresponding message processing number threshold.

[0067] In a specific embodiment, the message processing of each message queue in turn according to the processing priority may include: in the process of determining the processing priority of the current message queue based on the size relationship and the queue priority of the current message queue, if it has been determined that the processing priority of the current message queue is greater than the processing priority of the next message queue, the current message queue is processed; after the current message processing of the current message queue is completed, jump to the step of determining the next message queue in each message queue as the current message queue. Specifically, in the process of determining the processing priority, that is, according to the size relationship between the number of messages in the current message queue and the corresponding queue message number threshold and the queue priority of the current message queue, if it has been determined that the processing priority of the current message queue is greater than the processing priority of the next message queue, the current message queue can be processed immediately, and after the current message processing is completed, the processing priority of the next message queue is determined.

[0068] Accordingly, in a specific embodiment, after determining the processing priorities of all message queues, message processing can be performed on each message queue according to the obtained processing priority; that is, the processing order of each message queue is readjusted in combination with the queue priority of each message queue and the size relationship between the number of messages in each message queue and its corresponding queue message number threshold to obtain the corresponding processing priority of each message queue, and then the messages are processed in sequence according to the processing priority of each message queue.

[0069] In another specific embodiment, the message processing of the current message queue may include: obtaining the current pending message from the current message queue based on the first-in-first-out principle; processing the current pending message, and counting the number of messages that have been processed in real time; if the number of messages that have been processed is less than the message processing number threshold corresponding to the current message queue, obtaining the next pending message from the current message queue as the new current pending message, and jumping to the step of processing the current pending message until the preset loop end condition is met. Specifically, in the process of the current message queue performing the message processing, a single current pending message can be obtained from the current message queue based on the first-in-first-out principle, and the current pending message can be processed, and the number of messages that have been processed in the current message queue during the message processing can be counted; if the number of messages that have been processed is less than the message processing number threshold corresponding to the current message queue, the messages to be processed can continue to be obtained from the current message queue, and the relationship between the number of messages that have been processed and the corresponding message processing number threshold can be determined, and the messages in the current message queue are processed in a loop until the preset loop end condition is met. Furthermore, in a specific embodiment, the preset cycle end condition may be that the number of messages processed this time is consistent with the message processing number threshold corresponding to the current message queue, or the number of messages in the current message queue has become zero. It is understandable that during the message processing process of the current message queue, when the number of messages processed is equal to the corresponding message processing number threshold, the message processing process of the current message queue can be ended; and if the number of messages processed is still less than the corresponding message processing number threshold when the messages in the current message queue are processed, the message processing process of the current message queue can also be ended. Then, the messages in the next message queue are processed according to the processing priority of each message queue.

[0070] In another specific embodiment, the processing of the current message to be processed may include: parsing the current message to be processed, and converting the corresponding parsed information into a command to be executed corresponding to the current message to be processed; sending the command to be executed to a preset command executor, and forwarding the status information returned by the preset command executor indicating that the command has been executed to the upper system, so as to complete the processing process for the current message to be processed. Specifically, in the process of processing the message, it is necessary to parse the current message to be processed, convert the parsed information into a command to be executed corresponding to the current message to be processed, and then send the converted commands to be executed to the preset command executor, so that the command executor returns the status information indicating that the command has been executed after executing the relevant commands to be executed; then the obtained status information can be forwarded to the upper system, indicating that the message processing process of the current message to be processed is completed.

[0071] Furthermore, the sending of the pending commands to the preset command execution body may include: sending the pending commands to the preset command queue in the preset command execution body for storage, so that the preset command execution body obtains and executes the pending commands from the preset command queue based on the preset command acquisition rule; wherein the preset command acquisition rule is a rule for obtaining the pending commands from the preset command queue in the order of command execution time from small to large. Specifically, the process of sending the pending commands to the preset command execution body is to send each pending command to each preset command queue in the preset command execution body respectively, and the preset command execution body obtains and executes each pending command from the corresponding preset command queue in turn based on the preset command acquisition rule; it should be pointed out that the command execution body obtains the relevant pending commands from each preset command queue in turn according to the order of the command execution time of each pending command from small to large; in this way, the number of commands in the command queue can be digested as soon as possible, the throughput can be improved, and the message waiting time can be minimized.

[0072] Correspondingly, the sending of the to-be-executed command to a preset command queue in a preset command execution body for storage may include: according to the command type of the to-be-executed command, sending the to-be-executed command to a preset command queue in a preset command execution body corresponding to the command type of the to-be-executed command for storage. Specifically, the command types of the commands to be executed are also different, and in a specific embodiment, they may be address command types or operation command types, etc. Here, according to the different command types, the commands to be executed may be sent to the command queues in the preset command execution body that match the command types for storage.

[0073] It can be seen that, on the basis of setting the priority of the message queue, the present application introduces a queue message quantity threshold and a message processing quantity threshold; in combination with the priority level and the relationship between the number of messages in each message queue and the queue message quantity threshold, the processing priority can be re-determined according to the actual situation of each message queue; in this way, a certain number of messages can be processed in time according to the pressure situation of each message queue and the message processing quantity threshold, so as to avoid the message queue occupying resources for a long time; and when executing commands, those commands with a shorter estimated execution time can be given priority for execution according to the order of command execution time from small to large, so as to reduce the number of commands in the command queue as soon as possible and improve the throughput; in this way, the average waiting time for message processing can be minimized, and the overall response speed and message processing efficiency of the system can be improved.

[0074] like Figure 2As shown, the embodiment of the present application discloses a queue message processing method, which is applied to a flash channel controller (Flash Channel Control, FCC) in a solid-state drive, and combines a flash translation layer (FTL) and a flash memory (Nand) to implement the processing of pending read and write messages and the corresponding command execution process, which may specifically include:

[0075] In the embodiment of the present application, high and low priorities can be defined during the initialization phase of the FTL device. Space is applied for each priority and a corresponding ready queue is created to store messages that have been issued but not yet executed by the FCC. Accordingly, the FCC device initialization can define queue message queue thresholds and corresponding message processing quantity thresholds for message queues of different priorities. The FTL receives tasks from the upper system and completes task parsing. According to the task type, the parsed messages are sent to each message queue of different queue priorities.

[0076] Accordingly, FCC performs polling processing on each message queue, traverses each message queue, starts from the message queue with the highest queue priority, monitors the number of messages in each message queue, and adjusts the priority of each message queue according to the relationship between the number of messages and the corresponding queue message number threshold to determine the processing priority of each message queue. In each message queue, the relevant messages are processed in a first-in-first-out or other appropriate order. If the high-priority message queue is empty, the next lower-priority message queue is processed. It should be pointed out that in the process of polling each message queue, it is first determined whether the number of messages in the current message queue is greater than the corresponding queue message number threshold. If so, multiple messages can be directly processed continuously according to the message processing number threshold corresponding to the current message queue; if the number of messages in the current message queue is not greater than the corresponding queue message number threshold, the next message queue with a lower queue priority can be polled. After FCC polls each message queue and completes the corresponding message processing process, it can restart a new round of polling and continue to monitor the number of messages in each message queue; or after polling each message queue, it can directly jump to the step of processing messages for the message queue with the highest queue priority and continue the polling process of the message queue.

[0077] Furthermore, when processing the messages in the current message queue, the FCC obtains the pending messages from the current message queue, and parses and converts them into corresponding pending commands; and can select to send the relevant pending commands to the corresponding command queue (LUN, functional unit) according to the command type, so that the Nand can obtain and execute the relevant pending commands from the LUN. While the FCC waits for the Nand command to be executed, it can return the status information representing the completion of the command execution to the upper system to respond to the task issued by the upper system.

[0078] It can be seen that in order to improve the concurrency of the system, this application introduces a queue message number threshold and a message processing number threshold for each priority queue, adjusts the communication processing process between FTL and FCC, and adjusts the processing priority of each message queue in combination with the queue priority, the queue message number threshold of the message queue, and the message processing number of the message queue; specifically, the message queue is judged whether the pressure is too high according to the number of messages to be processed in each message queue to determine the processing priority of the message queue. When the message load of a message queue exceeds a certain threshold, the queue with a heavier load is processed first, and dynamic processing is performed according to the number of real-time messages in the message queue to ensure stable operation of the system. After optimization, when a low-priority command is blocked, multiple low-priority messages can be processed continuously to prevent the subsequent high-priority message processing from being continuously interrupted. In this way, the LUN concurrency can be further improved, Nand resources can be used more effectively, and the performance of the bus and each LUN can be more efficiently and fully utilized. Especially when the read-write mixed concurrency is high, the read-write bandwidth can be significantly improved, and the response speed and throughput of the system can be improved.

[0079] Furthermore, the present application also discloses an electronic device. Figure 3 It is a structural diagram of an electronic device according to an exemplary embodiment, and the content in the figure cannot be regarded as any limitation on the scope of use of this application. The electronic device may specifically include: at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input and output interface 25 and a communication bus 26. Among them, the memory 22 is used to store a computer program, and the computer program is loaded and executed by the processor 21 to implement the relevant steps in the queue message processing method disclosed in any of the aforementioned embodiments. In addition, the electronic device in this embodiment may specifically be an electronic computer.

[0080] In this embodiment, the power supply 23 is used to provide working voltage for each hardware device on the electronic device; the communication interface 24 can create a data transmission channel between the electronic device 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.

[0081] 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.

[0082] The operating system 221 is used to manage and control various hardware devices on the electronic device and the computer program 222, which can be Windows Server, Netware, Unix, Linux, etc. In addition to including a computer program that can be used to complete the queue message processing method performed by the electronic device 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.

[0083] Furthermore, the present application also discloses a solid-state hard drive, which may include: a flash memory conversion layer, used to create corresponding message queues based on different queue priorities; wherein the message queue is a queue for storing read and write messages to be processed; and a flash memory channel controller, used to implement the steps of the above-mentioned queue message processing method by executing a computer program to complete message processing for each of the message queues.

[0084] In a specific embodiment, the solid state drive may further include: a flash memory for acquiring and executing the read and write commands to be executed generated by the flash channel controller when processing the read and write messages to be processed, so as to complete the corresponding flash read and write operations.

[0085] Furthermore, the present application also discloses a computer-readable storage medium for storing a computer program; wherein the computer program, when executed by a processor, implements the queue message processing method disclosed above. For the specific steps of the method, reference may be made to the corresponding contents disclosed in the above embodiments, and no further description will be given here.

[0086] Furthermore, the present application also discloses a computer program product, including a computer program / instruction, which implements the steps of the queue message processing method disclosed above when executed by a processor.

[0087] 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.

[0088] 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.

[0089] 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.

[0090] 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.

[0091] 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 queue message processing method, characterized in that: include: Configure corresponding queue message quantity thresholds and message processing quantity thresholds for each message queue; different message queues correspond to different queue priorities, and different queue priorities correspond to messages of different task types; Determine the processing priority of each message queue based on the relationship between the number of messages in the message queue and the corresponding queue message number threshold, and in combination with the queue priority; Processing messages in each of the message queues in turn according to the processing priority, and controlling the number of messages processed this time not to be greater than the corresponding message processing number threshold each time a message is processed in any message queue; Wherein, determining the processing priority of each of the message queues includes: Determining a current message queue from among the message queues according to the descending order of the queue priorities; Determine a size relationship between the number of messages in the current message queue and the corresponding queue message number threshold, and determine a processing priority of the current message queue based on the size relationship and the queue priority of the current message queue; Determine the next message queue in each of the message queues as the current message queue, and jump to the step of determining the magnitude relationship between the number of messages in the current message queue and the corresponding threshold of the number of messages in the queue, until all the message queues have been traversed; Wherein, determining the processing priority of the current message queue based on the size relationship and the queue priority of the current message queue includes: If the number of messages in the current message queue is greater than the corresponding queue message number threshold, it is determined that the processing priority of the current message queue is higher than the processing priority of the next message queue.

2. The queue message processing method according to claim 1, characterized in that: The configuration of a corresponding queue message quantity threshold and a message processing quantity threshold for each message queue includes: Based on the queue priority of each message queue, respectively configure a queue message quantity threshold and a message processing quantity threshold corresponding to the queue priority for each message queue; The message queues with different queue priorities are used to store to-be-processed messages corresponding to different types of tasks sent by the upper-layer system.

3. The queue message processing method according to claim 2, characterized in that: There is an inverse correlation between the queue priority and the queue message quantity threshold, and there is a positive correlation between the queue priority and the message processing quantity threshold.

4. The queue message processing method according to claim 1, characterized in that: The determining the processing priority of the current message queue based on the size relationship and the queue priority of the current message queue includes: If the number of messages in the previous message queue is not greater than the corresponding queue message number threshold, and the number of messages in the current message queue is greater than the corresponding queue message number threshold, it is determined that the processing priority of the current message queue is higher than the processing priority of the previous message queue.

5. The queue message processing method according to claim 1, characterized in that: The processing of messages in each message queue in sequence according to the processing priority includes: In the process of determining the processing priority of the current message queue based on the size relationship and the queue priority of the current message queue, if it is determined that the processing priority of the current message queue is greater than the processing priority of the next message queue, the current message queue is processed; After the current message processing of the current message queue is completed, jump to the step of determining the next message queue in each message queue as the current message queue.

6. The queue message processing method according to claim 5, characterized in that: The message processing on the current message queue includes: Get the current pending message from the current message queue based on the first-in-first-out principle; Process the current pending messages and count the number of messages that have been processed in real time; If the number of messages processed this time is less than the message processing number threshold corresponding to the current message queue, the next message to be processed is obtained from the current message queue as the new current message to be processed, and the process jumps to the step of processing the current message to be processed until the preset loop end condition is met.

7. The queue message processing method according to claim 6, characterized in that: The preset cycle end condition is that the number of messages processed this time is consistent with the message processing number threshold corresponding to the current message queue, or the number of messages in the current message queue has become zero.

8. The queue message processing method according to claim 6, characterized in that: The processing of the current pending message includes: Parse the current pending message and convert the corresponding parsed information into the pending command corresponding to the current pending message; The command to be executed is sent to a preset command execution body, and the status information returned by the preset command execution body indicating that the command has been executed is forwarded to an upper-layer system to complete the processing process for the current message to be processed.

9. The queue message processing method according to claim 8, characterized in that: The step of sending the to-be-executed command to a preset command execution body includes: Sending the to-be-executed command to a preset command queue in a preset command execution body for storage, so that the preset command execution body can obtain and execute the to-be-executed command from the preset command queue based on a preset command acquisition rule; The preset command acquisition rule is a rule for acquiring the to-be-executed commands from the preset command queue in ascending order of command execution time.

10. The queue message processing method according to claim 9, characterized in that: The sending of the to-be-executed command to a preset command queue in a preset command execution body for storage includes: According to the command type of the command to be executed, the command to be executed is sent to a preset command queue corresponding to the command type of the command to be executed in a preset command execution body for storage.

11. An electronic device, characterized in that: include: Memory for storing computer programs; A processor, configured to execute the computer program to implement the steps of the queue message processing method according to any one of claims 1 to 10.

12. A solid state hard disk, characterized in that: include: A flash translation layer, used for creating corresponding message queues based on different queue priorities; wherein the message queue is a queue for storing read and write messages to be processed; A flash channel controller, used to implement the steps of the queue message processing method as described in any one of claims 1 to 10 by executing a computer program to complete message processing on each of the message queues.

13. The solid state drive according to claim 12, wherein: Also includes: The flash memory is used to obtain and execute the to-be-executed read and write commands generated by the flash channel controller when processing the to-be-processed read and write messages, so as to complete the corresponding flash memory read and write operations.

14. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the queue message processing method according to any one of claims 1 to 10 are implemented.

15. A computer program product comprising a computer program / instructions, characterized in that When the computer program / instruction is executed by a processor, the steps of the queue message processing method according to any one of claims 1 to 10 are implemented.

Citation Information

Patent Citations

  • Message processing method, device and equipment

    CN111404838A