Search

CN-122027700-A - Multi-queue-based request management method, device, equipment and medium

CN122027700ACN 122027700 ACN122027700 ACN 122027700ACN-122027700-A

Abstract

The application provides a request management method, device, equipment and medium based on multiple queues, and belongs to the technical field of computers. The method comprises the steps of receiving a first fence command from a source end, writing the first fence command into any one of a plurality of queues, distributing a serial number for the first fence command, distributing the same serial number as the first fence command for a front request of the first fence command, wherein the front request is a data access request written into the plurality of queues between the first fence command and a second fence command, the second fence command is a front fence command of the first fence command, and after all data access requests corresponding to the serial numbers in the plurality of queues are processed and cleared from the plurality of queues, sending a completion response of the first fence command to the source end and clearing the first fence command from the queues. Under the multi-queue scene, the execution effectiveness of fence commands is guaranteed, and the request management efficiency is improved.

Inventors

  • LIU YANG
  • GENG JIANBO

Assignees

  • 海光信息技术股份有限公司

Dates

Publication Date
20260512
Application Date
20260213

Claims (13)

  1. 1. A method for managing requests based on multiple queues, the method comprising: Receiving a first fence command from a source end, writing the first fence command into any one of a plurality of queues, wherein the queues are used for storing data access requests which are sent to a destination end and wait for the response of the destination end, and the first fence command indicates that the first fence command is cleared after the data access requests written before the first fence command are processed; Assigning a sequence number to the first fence command and assigning the same sequence number as the first fence command to a pre-request of the first fence command, the pre-request being a data access request written to the plurality of queues between the first fence command and a second fence command, the second fence command being a previous fence command of the first fence command; and after the data access requests corresponding to the serial numbers in the queues are processed and cleared from the queues, sending a completion response of the first fence command to a source end, and clearing the first fence command from the queues.
  2. 2. The multi-queue based request management method of claim 1, wherein the plurality of queues includes a master queue for storing data access requests and fence commands and at least one slave queue for storing data access requests; the writing the first fence command to any of a plurality of queues includes: Writing the first fence command to the master queue of the plurality of queues.
  3. 3. The multi-queue-based request management method according to claim 2, wherein the data access requests in the master queue belong to a first type of requests, the data access requests in the slave queue belong to a second type of requests, and at least one of destination ends and request types corresponding to the first type of requests and the second type of requests are different.
  4. 4. The multi-queue based request management method according to claim 2, wherein said assigning the same sequence number as the first fence command to the pre-request of the first fence command comprises: assigning the same sequence number as the first fence command to the at least one slave queue's head-end request; after the data access requests corresponding to the serial numbers in the queues are processed and cleared from the queues, sending a completion response of the first fence command to a source end, and clearing the first fence command from the queues, wherein the steps comprise: And if the pre-request in the main queue is processed and cleared from the main queue, and the data access request corresponding to the serial number in the at least one slave queue is processed and cleared from the queue, sending a completion response of the first fence command to a source end, and clearing the first fence command from the queue.
  5. 5. The multi-queue based request management method of claim 1, wherein said assigning a sequence number to the first fence command comprises: and configuring the serial number of the first fence command as a first numerical value, wherein the first numerical value is the serial number corresponding to the second fence command and is increased by 1.
  6. 6. The multi-queue based request management method of claim 1, wherein said assigning a sequence number to the first fence command comprises: configuring a serial number of the first fence command as an initial value, wherein the initial value is a default value corresponding to each fence command after being written into a queue; the method further comprises the steps of: Updating sequence numbers of original data access requests in the queues, wherein the original data access requests are data access requests which are written into the queues before the first fence command is written.
  7. 7. The multi-queue based request management method according to claim 1, wherein said assigning the same sequence number as the first fence command to the pre-request of the first fence command comprises: And allocating the same serial number as the first fence command to a target request in the pre-request, wherein the target request is a pre-request with the same channel identification corresponding to the first fence command, and the channel identification indicates a channel applied when a data access request is sent to a destination terminal.
  8. 8. The multi-queue based request management method of claim 1, further comprising: traversing the plurality of queues; a pre-request for the first fence command is determined based on a enqueue timestamp for each data access request and a enqueue timestamp for the first fence command indicating a time of being written to a queue.
  9. 9. A multi-queue based request management apparatus, the apparatus comprising: The writing module is used for receiving a first fence command from a source end, writing the first fence command into any one of a plurality of queues, wherein the queues are used for storing data access requests which are sent to a destination end and wait for the response of the destination end, and the first fence command indicates that the data access requests written before the first fence command are cleared after the processing of the data access requests written before the first fence command is completed; A configuration module, configured to assign a serial number to the first fence command, and assign the same serial number as the first fence command to a pre-request of the first fence command, the pre-request being a data access request written into the plurality of queues between the first fence command and a second fence command, the second fence command being a previous fence command of the first fence command; and the management module is used for sending a completion response of the first fence command to the source end after the data access requests corresponding to the serial numbers in the queues are processed and cleared from the queues, and clearing the first fence command from the queues.
  10. 10. A chip comprising programmable logic circuitry configured to enable the chip to implement the multi-queue based request management method of any one of claims 1 to 8.
  11. 11. An electronic device, characterized in that the electronic device comprises a chip; The programmable logic circuitry in the chip is configured to enable the electronic device to implement the multi-queue based request management method of any one of claims 1 to 8.
  12. 12. A computer readable storage medium storing at least one piece of computer program for performing the multi-queue based request management method according to any one of claims 1 to 8.
  13. 13. A computer program product comprising a computer program which when executed by a processor implements the multi-queue based request management method of any one of claims 1 to 8.

Description

Multi-queue-based request management method, device, equipment and medium Technical Field The present application relates to the field of computer technologies, and in particular, to a method, an apparatus, a device, and a medium for managing requests based on multiple queues. Background In current chip systems, the order of execution of fence command assurance requests is typically relied upon. Whether all the pre-arranged requests are executed is determined by whether the fence command is completed or not, so that the request execution sequence is ensured. Under this mechanism, the fence command and each outstanding request will typically be buffered in a queue. However, with the scale expansion and performance requirement improvement of the chip system, the buffer capacity of a single queue is difficult to meet the actual requirement, so that a multi-queue splitting implementation scheme is generally adopted. After the multiple queues are split, the front-end requests crossing the queues are difficult to accurately identify by the fence command, and the execution effectiveness of the fence command cannot be guaranteed, so that the functional errors of the chip system are caused. Disclosure of Invention The embodiment of the application provides a request management method, device, equipment and medium based on multiple queues, which ensure the execution effectiveness of fence commands and improve the request management efficiency under a multi-queue scene. The technical scheme is as follows: in one aspect, a method for managing requests based on multiple queues is provided, the method comprising: Receiving a first fence command from a source end, writing the first fence command into any one of a plurality of queues, wherein the queues are used for storing data access requests which are sent to a destination end and wait for the response of the destination end, and the first fence command indicates that the first fence command is cleared after the data access requests written before the first fence command are processed; Assigning a sequence number to the first fence command and assigning the same sequence number as the first fence command to a pre-request of the first fence command, the pre-request being a data access request written to the plurality of queues between the first fence command and a second fence command, the second fence command being a previous fence command of the first fence command; and after the data access requests corresponding to the serial numbers in the queues are processed and cleared from the queues, sending a completion response of the first fence command to a source end, and clearing the first fence command from the queues. In some embodiments, the plurality of queues includes a master queue for storing data access requests and fence commands and at least one slave queue for storing data access requests; the writing the first fence command to any of a plurality of queues includes: Writing the first fence command to the master queue of the plurality of queues. In some embodiments, the data access request in the master queue belongs to a first type of request, the data access request in the slave queue belongs to a second type of request, and at least one of the destination end and the request type corresponding to the first type of request and the second type of request are different. In some embodiments, the assigning the same sequence number as the first fence command to the pre-request of the first fence command includes: assigning the same sequence number as the first fence command to the at least one slave queue's head-end request; after the data access requests corresponding to the serial numbers in the queues are processed and cleared from the queues, sending a completion response of the first fence command to a source end, and clearing the first fence command from the queues, wherein the steps comprise: And if the pre-request in the main queue is processed and cleared from the main queue, and the data access request corresponding to the serial number in the at least one slave queue is processed and cleared from the queue, sending a completion response of the first fence command to a source end, and clearing the first fence command from the queue. In some embodiments, the assigning a serial number to the first fence command includes: and configuring the serial number of the first fence command as a first numerical value, wherein the first numerical value is the serial number corresponding to the second fence command and is increased by 1. In some embodiments, the assigning a serial number to the first fence command includes: configuring a serial number of the first fence command as an initial value, wherein the initial value is a default value corresponding to each fence command after being written into a queue; the method further comprises the steps of: Updating sequence numbers of original data access requests in the queues, wherein the original data access requests a