Multi-slave-device interruption arbitration method for PCIE bus

By analyzing the number of interrupt requests for multiple devices and assigning weight values, and combining the transmission time and waiting period of the interrupt signal to conduct comprehensive interrupt arbitration, the problems of inaccurate and priority tilt in the prior art are solved, and the intelligence and accuracy of interrupt arbitration are improved.

CN119718974APending Publication Date: 2025-03-28TIANJIN EMBEDTEC
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202411768670.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-04
Publication Date
2025-03-28

AI Technical Summary

Technical Problem

In the prior art, due to the lack of a method that can accurately interrupt arbitrate the interrupt signal of multiple devices at the same time and adjust the priority of the device in real time according to the time required to complete the arbitration, the interrupt signal of the low-priority device may suffer from interrupt loss and priority tilt.

Method used

By obtaining the number of interrupt requests for each device, analyzing the number of interrupt requests, and assigning the device weight value; monitoring the device, establishing a request queue, setting parameter weight value for interrupt requests, and updating it according to the request queue and parameter weight value, outputting the arbitration weight value for interrupt arbitration.

Benefits of technology

Through the initial priority setting of the device's historical interrupt frequency, comprehensive interrupt arbitration is carried out in combination with the interrupt signal transmission time and waiting period, interrupt requests with the highest comprehensive priority are handled, interrupt loss is avoided, and the intelligence and accuracy of interrupt arbitration are improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119718974A_ABST
    Figure CN119718974A_ABST
Patent Text Reader

Abstract

The invention discloses a multi-slave-device interrupt arbitration method for a PCIE (Peripheral Component Interface Express) bus, which relates to the technical field of interrupt arbitration and comprises the following steps of: acquiring an interrupt request number of each device, and endowing a device weight value to the device; establishing a request queue, and setting a parameter weight value for the interrupt request; calculating a parameter weight value of the interrupt request, and outputting an arbitration weight value; calculating and analyzing the interrupt completion period of each device, and updating the device weight value based on a calculation and analysis result; the method is used for solving the problem that in the prior art, a method capable of sending interrupt signals to multiple devices at the same time to carry out accurate interrupt arbitration and adjusting the priorities of the devices in real time according to the time required for completing arbitration is lacked; therefore, the problems of interruption loss and priority inclination of equipment interruption signals which are always in a low priority level are possibly caused.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to the technical field of interrupt arbitration, in particular to a method for interrupt arbitration of multiple slave devices of a PCIE bus. Background Art

[0002] The PCIE bus is a high-speed serial bus standard for connecting expansion cards and other external devices. The PCIE bus is widely used in modern computer systems, including desktops, servers, workstations and other computing devices, and is used to connect various expansion devices such as graphics cards, network cards, storage controllers, sound cards, etc. As a high-performance and high-reliability serial bus standard, the PCIE bus plays a vital role in modern computer systems, providing a high-speed and reliable data transmission channel for connecting various expansion devices.

[0003] Existing improvements for interrupt arbitration usually optimize the implementation method of interrupt arbitration to reduce the complexity of interrupt sending devices sending interrupt signals. For example, in a Chinese patent with invention publication number CN113138949A, an interrupt controller, an interrupt control method, a chip, a computer device and a medium are disclosed. The solution is to reduce the complexity of the process of interrupt sending devices sending interrupt signals by optimizing multiple modules of the interrupt controller; and in the process of interrupt arbitration, the PCIE bus may be connected to multiple devices, and the problem of multiple device interrupts occurring at the same time is often encountered; the traditional interrupt arbitration method usually sets the priority of the device and arbitrates the interrupt signal based on the priority; under this arbitration method, some devices may cause interrupt loss because they are always in low priority and the interrupt signal is not processed in time. In view of this, it is necessary to improve the existing interrupt arbitration method. Summary of the invention

[0004] The present invention aims to solve at least one of the technical problems in the prior art to a certain extent. By improving the interrupt arbitration method, it is used to solve the problem in the prior art that the interrupt signals of devices that have always been at a low priority may be lost and the priority may be tilted due to the lack of a method that can accurately arbitrate interrupt signals sent by multiple devices at the same time and adjust the priority of the device in real time according to the time required to complete the arbitration.

[0005] To achieve the above object, the present application provides a PCIE bus multi-slave device interrupt arbitration method, comprising the following steps:

[0006] Obtain the number of interrupt requests of each device, calculate and analyze the number of interrupt requests, and assign a device weight value to the device based on the calculation and analysis results;

[0007] Monitor the device, and when the device sends an interrupt request, establish a request queue and set a parameter weight value for the interrupt request; update the parameter weight value based on the request queue;

[0008] Calculate the parameter weight value of the interrupt request and output the arbitration weight value; analyze the arbitration weight value, output the processing request, and update the weight for the request queue;

[0009] Issue a PCIE interrupt based on the processing request, wait for execution, output the interrupt completion cycle based on the execution result, and update the request queue and parameter weight value;

[0010] Calculate and analyze the interruption completion cycle of each device, and update the device weight value based on the calculation and analysis results;

[0011] Furthermore, the number of interrupt requests of each device is obtained, the number of interrupt requests is calculated and analyzed, and a device weight value is assigned to the device based on the calculation and analysis result, including:

[0012] Get the total number of interrupts in the first time and the number of interrupt requests for each device;

[0013] Calculate the ratio of the number of interrupt requests to the total number of interrupts for each device, and mark it as the request ratio;

[0014] Calculate the average and standard deviation of the request ratios, and mark them as ratio mean and ratio standard deviation respectively;

[0015] The interval from the difference between the mean and standard deviation of the proportion to the sum of the mean and standard deviation of the proportion is marked as the constant value request interval;

[0016] A device weight value of the first value is assigned to a device whose request ratio is on the left side of the normal request interval; a device weight value of the second value is assigned to a device whose request ratio is in the normal request interval; and a device weight value of the third value is assigned to a device whose request ratio is on the right side of the normal request interval;

[0017] The first value is greater than the second value and greater than the third value.

[0018] Furthermore, the device is monitored, and when the device sends an interrupt request, a request queue is established, and a parameter weight value is set for the interrupt request; updating the parameter weight value based on the request queue includes:

[0019] When any device issues an interrupt request, the device weight value of the device is obtained;

[0020] Set the device weight value, the time weight value with an initial value of 0, and the cycle weight value for the interrupt request;

[0021] Performing a time weight update process, the time weight update process comprising:

[0022] Add the interrupt requests to the request queue in the order of issuance time, and number the interrupt requests in the request queue in descending order;

[0023] Set the time weight value of each interrupt request to the same value as the number.

[0024] Further, calculating the parameter weight value of the interrupt request and outputting the arbitration weight value; analyzing the arbitration weight value, outputting the processing request, and updating the weight for the request queue include:

[0025] Calculate the parameter weight value of each interrupt request using a weight calculation formula and output an arbitration weight value; the parameter weight value includes a device weight value, a time weight value and a cycle weight value;

[0026] The weight calculation formula is configured as: ZH=SH+TH+NH; wherein ZH is the arbitration weight value, SH is the device weight value, TH is the time weight value, and NH is the period weight value;

[0027] The interrupt request corresponding to the largest arbitration weight value is marked as a processing request, and the cycle weight values ​​of all interrupt requests in the request queue, except the processing request, are increased by one.

[0028] Further, issuing a PCIE interrupt based on the processing request, waiting for execution, outputting an interrupt completion cycle based on the execution result, and updating the request queue and the parameter weight value include:

[0029] Issue a PCIE interrupt to process the request and wait for the host computer to execute the interrupt handler;

[0030] When the host computer completes the interrupt processing program, it outputs the cycle weight value of the processing request and marks it as the interrupt completion cycle;

[0031] Delete the processing request from the request queue;

[0032] The time weight update process is performed again.

[0033] Further, calculating and analyzing the interruption completion cycle of each device, and updating the device weight value based on the calculation and analysis result includes:

[0034] Calculate the average of the interrupt completion cycle of each device, marked as the average waiting cycle;

[0035] Sort the average waiting periods to obtain a period sequence;

[0036] Calculate the median of the periodic series, labeled as period median;

[0037] Devices with a value greater than or equal to the median of the cycle are marked as devices to be weighted, and devices with a value less than the median of the cycle are marked as devices to be downgraded.

[0038] Furthermore, calculating and analyzing the interruption completion period of each device, and updating the device weight value based on the calculation and analysis result also includes:

[0039] The device weight value of the device to be weighted is judged, and if the device weight value is the second value, the device weight value is increased by one; if the device weight value is not the second value, no processing is performed;

[0040] Furthermore, calculating and analyzing the interruption completion period of each device, and updating the device weight value based on the calculation and analysis result also includes:

[0041] The device weight value of the device to be demoted is judged. If the device weight value is not the third value, the device weight value is reduced by one; if the device weight value is the third value, no processing is performed.

[0042] Beneficial effects of the present invention: The present invention obtains the number of interrupt requests in the history of each device, analyzes the number of interrupt requests, and assigns a device weight value to the device; then monitors the device, sets a parameter weight value for the interrupt request, calculates the parameter weight value, and outputs an arbitration weight value for interrupt arbitration; the advantage is that the initial priority is set by the interrupt frequency in the history of the device, and then the interrupt signal is comprehensively interrupted and arbitrated in combination with the sending time of the interrupt signal and the waiting period of the interrupt signal, so that the interrupt request with the highest comprehensive priority can be processed, and a certain device is prevented from having to wait for a long time, which may cause the interrupt to be lost, thereby improving the intelligence and accuracy of the interrupt arbitration;

[0043] The present invention also calculates and analyzes the interrupt completion cycle of each device by outputting the interrupt completion cycle, and finally updates the device weight value; the advantage of this is that for devices that require a long wait, the priority of the device can be improved by updating the device weight value, avoiding the device from having to wait for a long time, thereby ensuring that each device has the opportunity to have its interrupt request processed in a timely manner, further improving the intelligence of interrupt arbitration. BRIEF DESCRIPTION OF THE DRAWINGS

[0044] Figure 1 is a flow chart of the steps of the method of the present invention;

[0045] Figure 2 This is a block diagram of the internal design of the interrupt arbitration of the present invention. DETAILED DESCRIPTION

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

[0047] Example 1, please refer to Figure 1 as well as Figure 2 As shown, the present application provides a method for interrupt arbitration of multiple slave devices of a PCIE bus, comprising the following steps:

[0048] Step S1, obtaining the number of interrupt requests of each device, calculating and analyzing the number of interrupt requests, and assigning a device weight value to the device based on the calculation and analysis results; Step S1 also includes the following sub-steps:

[0049] Step S101, obtaining the total number of interruptions within a first period of time and the number of interruption requests of each device;

[0050] Step S102, calculating the ratio of the number of interrupt requests of each device to the total number of interrupts, and marking it as request ratio;

[0051] Step S103, calculating the average value and standard deviation of the request proportion, which are marked as proportion mean and proportion standard deviation respectively;

[0052] Step S104, marking the interval from the difference between the mean value of the proportion and the standard deviation of the proportion to the sum of the mean value of the proportion and the standard deviation of the proportion as a constant value request interval;

[0053] Step S105, assigning a first numerical device weight value to a device whose request ratio is on the left side of the normal request interval; assigning a second numerical device weight value to a device whose request ratio is in the normal request interval; assigning a third numerical device weight value to a device whose request ratio is on the right side of the normal request interval; wherein the first numerical value is greater than the second numerical value and greater than the third numerical value;

[0054] In a specific implementation, the first time may be set to 1 hour when the device is in operation, the first value may be set to 3, the second value may be set to 2, and the third value may be set to 1;

[0055] Take 5 slave devices as an example: if the 5 devices send 10, 16, 17, 20, and 27 interrupt signals respectively within 1 hour, the calculated mean ratio is 18, the standard deviation ratio is 6.2, and the constant request interval is [11.8, 24.2]; at this time, the device that sends 10 interrupt signals is assigned a device weight value of 3, the device that sends 16, 17, and 20 interrupt signals is assigned a device weight value of 2, and the device that sends 27 interrupt signals is assigned a device weight value of 1; the advantage of this setting is that devices with frequent interrupt requests will frequently send interrupt requests, which will cause devices with infrequent interrupt requests to wait for multiple interrupt requests sent by other devices before sending interrupt requests before they can make priority judgments with interrupt requests sent simultaneously by other devices, resulting in priority skew, so different device weight values ​​are set for devices.

[0056] Step S2, monitoring the device, when the device sends an interrupt request, establishing a request queue, and setting a parameter weight value for the interrupt request; updating the parameter weight value based on the request queue; Step S2 also includes the following sub-steps:

[0057] Step S201, when any device issues an interrupt request, obtain the device weight value of the device;

[0058] Step S202, setting a device weight value, a time weight value with an initial value of 0, and a period weight value for the interrupt request;

[0059] Step S203, performing time weight update processing; Step S203 also includes the following sub-steps:

[0060] Step S2031, adding the interrupt requests to the request queue in the order of issuance time, and numbering the interrupt requests in the request queue in a descending manner;

[0061] Step S2032, setting the time weight value of each interrupt request to the same value as the number;

[0062] In specific implementation, the time weight value represents the weight of the waiting time of the interrupt request. The larger the time weight value, the longer the waiting time of the interrupt request, and the more timely processing is required. In particular, interrupt requests with the same issuance time are numbered the same in the request queue. The purpose of this is that for devices with different device weight values, the system can randomly select a device for processing to avoid priority skew. By randomly selecting devices, it can be ensured that each device has the opportunity to be processed in a timely manner.

[0063] The purpose of setting the periodic weight value is that, under the influence of the device weight value, the interrupt request with a longer waiting time has a greater probability of being processed faster than the interrupt request with a higher device weight value; for example, at 12:00, the devices with device weight values ​​of 1 and 2 send interrupt requests at the same time, and the interrupt request of the device with device weight value of 2 is processed first; at 12:01, the interrupt request is processed, and at this time, another device with device weight value of 2 sends an interrupt request. After the time weight is updated, the device weight value of the interrupt request sent at 12:00 is 1, the time weight value is 2, and the period weight value is 1, and the calculated arbitration weight value is 4; while the device weight value of the interrupt request sent at 12:01 is 2, the time weight value is 1, and the period weight value is 0, and the calculated arbitration weight value is 3, so that the interrupt request sent at 12:00 is processed first.

[0064] Step S3, calculating the parameter weight value of the interrupt request and outputting the arbitration weight value; analyzing the arbitration weight value, outputting the processing request, and updating the weight for the request queue; Step S3 also includes the following sub-steps:

[0065] Step S301, using a weight calculation formula to calculate the parameter weight value of each interrupt request, and outputting an arbitration weight value; the parameter weight value includes a device weight value, a time weight value, and a cycle weight value;

[0066] The weight calculation formula is configured as: ZH = SH + TH + NH; where ZH is the arbitration weight value, SH is the device weight value, TH is the time weight value, and NH is the period weight value;

[0067] Step S302: Mark the interrupt request corresponding to the largest arbitration weight value as a processing request, and increase the period weight values ​​of all interrupt requests in the request queue except the processing request by one.

[0068] Step S4, issuing a PCIE interrupt based on the processing request, waiting for execution, outputting an interrupt completion cycle based on the execution result, and updating the request queue and parameter weight value; Step S4 also includes the following sub-steps:

[0069] Step S401, issuing a PCIE interrupt to process the request, waiting for the host computer to execute the interrupt processing program;

[0070] Step S402, when the host computer completes the interrupt processing program, it outputs the cycle weight value of the processing request and marks it as the interrupt completion cycle;

[0071] Step S403, deleting the processing request from the request queue, and executing the time weight update process again.

[0072] Step S5, calculating and analyzing the interruption completion cycle of each device, and updating the device weight value based on the calculation and analysis results; Step S5 also includes the following sub-steps:

[0073] Step S501, calculating the average value of the interrupt completion cycle of each device, and marking it as the average waiting cycle;

[0074] Step S502, sorting the average waiting periods to obtain a period sequence;

[0075] Step S503, calculating the median of the periodic sequence, marked as the periodic median;

[0076] Step S504, marking the devices with a value greater than or equal to the median value of the cycle as devices to be weighted, and marking the devices with a value less than the median value of the cycle as devices to be downgraded;

[0077] Step S505, judging the device weight value of the device to be weighted, if the device weight value is the second value, adding one to the device weight value; if the device weight value is not the second value, no processing is performed;

[0078] It should be noted that the device to be weighted corresponds to the device that needs to wait for a long time in interrupt arbitration. This may be due to the long waiting time caused by setting a lower device weight value at the beginning. Therefore, the device with a device weight value of 2 in the device to be weighted is prioritized, that is, it is increased by one to 3, thereby reducing the waiting time required for the device in interrupt arbitration; on the other hand, when a device with a device weight value of 1 needs to wait for a long time, it is usually because the device frequently sends interrupt requests, resulting in a long request waiting time. Therefore, when the device weight value of the device to be weighted is 1, the priority is not increased; on the other hand, since the maximum device priority is 3, on this basis, if the device only causes a long waiting time when there are too many interrupt requests, it is not appropriate to increase the priority at this time;

[0079] Step S506, judging the device weight value of the device to be demoted, if the device weight value is not the third value, reducing the device weight value by one; if the device weight value is the third value, no processing is performed;

[0080] It should be noted that the devices to be demoted correspond to the devices that are given priority in interrupt arbitration. Due to the setting of the device weight value, usually only the devices with the highest device priority will be marked as devices to be demoted, so only the devices with the highest device weight value will be demoted.

[0081] Through the description of the above implementation methods, the embodiments of the present invention can be provided as methods, systems or computer program products. Based on such an understanding, the above technical solutions can be essentially or partly contributed to the prior art in the form of software products, which can be stored in a computer-readable storage medium, such as ROM / RAM, a magnetic disk, an optical disk, etc., and include several instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.

[0082] In the embodiments provided in the present application, it should be understood that the disclosed system or method can be implemented in other ways. The embodiments described above are merely schematic. For example, the division of modules or units is only a logical function division. There may be other division methods in actual implementation. For example, multiple modules or units 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 communication interfaces, and the indirect coupling or communication connection of systems, modules and units can be electrical, mechanical or other forms.

[0083] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application.

Claims

1. A method for interrupt arbitration of multiple slave devices of a PCIE bus, characterized in that: The steps include: Obtain the number of interrupt requests of each device, calculate and analyze the number of interrupt requests, and assign a device weight value to the device based on the calculation and analysis results; Monitor the device, when the device sends an interrupt request, establish a request queue, and set parameter weight values ​​for the interrupt request; Update parameter weight values ​​based on request queues; Calculate the parameter weight value of the interrupt request and output the arbitration weight value; Analyze the arbitration weight value, output the processing request, and update the weight for the request queue; Issue a PCIE interrupt based on the processing request, wait for execution, output the interrupt completion cycle based on the execution result, and update the request queue and parameter weight value; The interrupt completion cycle of each device is calculated and analyzed, and the device weight value is updated based on the calculation and analysis results.

2. A PCIE bus multi-slave device interrupt arbitration method according to claim 1, characterized in that: Obtain the number of interrupt requests for each device, calculate and analyze the number of interrupt requests, and assign device weight values ​​to the devices based on the calculation and analysis results, including: Get the total number of interrupts in the first time and the number of interrupt requests for each device; Calculate the ratio of the number of interrupt requests to the total number of interrupts for each device, and mark it as the request ratio; Calculate the average and standard deviation of the request ratios, and mark them as ratio mean and ratio standard deviation respectively; The interval from the difference between the mean and standard deviation of the proportion to the sum of the mean and standard deviation of the proportion is marked as the constant value request interval; A device weight value of the first value is assigned to a device whose request ratio is on the left side of the normal request interval; a device weight value of the second value is assigned to a device whose request ratio is in the normal request interval; and a device weight value of the third value is assigned to a device whose request ratio is on the right side of the normal request interval; The first value is greater than the second value and greater than the third value.

3. A PCIE bus multi-slave device interrupt arbitration method according to claim 2, characterized in that: Monitor the device, when the device sends an interrupt request, establish a request queue, and set parameter weight values ​​for the interrupt request; Updating parameter weight values ​​based on request queues includes: When any device issues an interrupt request, the device weight value of the device is obtained; Set the device weight value, the time weight value with an initial value of 0, and the cycle weight value for the interrupt request; Performing a time weight update process, the time weight update process comprising: Add the interrupt requests to the request queue in the order of issuance time, and number the interrupt requests in the request queue in descending order; Set the time weight value of each interrupt request to the same value as the number.

4. A PCIE bus multi-slave device interrupt arbitration method according to claim 3, characterized in that: Calculate the parameter weight value of the interrupt request and output the arbitration weight value; Analyzing the arbitration weight value, outputting the processing request, and updating the weight for the request queue include: Calculate the parameter weight value of each interrupt request using a weight calculation formula and output an arbitration weight value; the parameter weight value includes a device weight value, a time weight value and a cycle weight value; The weight calculation formula is configured as: ZH=SH+TH+NH; wherein ZH is the arbitration weight value, SH is the device weight value, TH is the time weight value, and NH is the period weight value; The interrupt request corresponding to the largest arbitration weight value is marked as a processing request, and the cycle weight values ​​of all interrupt requests in the request queue, except the processing request, are increased by one.

5. A PCIE bus multi-slave device interrupt arbitration method according to claim 4, characterized in that: Issue a PCIE interrupt based on the processing request, wait for execution, output the interrupt completion cycle based on the execution result, and update the request queue and parameter weight value including: Issue a PCIE interrupt to process the request and wait for the host computer to execute the interrupt handler; When the host computer completes the interrupt processing program, it outputs the cycle weight value of the processing request and marks it as the interrupt completion cycle; Delete the processing request from the request queue; The time weight update process is performed again.

6. A PCIE bus multi-slave device interrupt arbitration method according to claim 5, characterized in that: The interruption completion cycle of each device is calculated and analyzed, and the device weight value is updated based on the calculation and analysis results, including: Calculate the average of the interrupt completion cycle of each device, marked as the average waiting cycle; Sort the average waiting periods to obtain a period sequence; Calculate the median of the periodic series, labeled as period median; Devices with a value greater than or equal to the median of the cycle are marked as devices to be weighted, and devices with a value less than the median of the cycle are marked as devices to be downgraded.

7. A PCIE bus multi-slave device interrupt arbitration method according to claim 6, characterized in that: Calculating and analyzing the interruption completion cycle of each device, and updating the device weight value based on the calculation and analysis results also include: The device weight value of the device to be weighted is judged. If the device weight value is the second value, the device weight value is increased by one; if the device weight value is not the second value, no processing is performed.

8. The method for interrupt arbitration of multiple slave devices of a PCIE bus according to claim 7, characterized in that: Calculating and analyzing the interruption completion cycle of each device, and updating the device weight value based on the calculation and analysis results also include: The device weight value of the device to be demoted is judged. If the device weight value is not the third value, the device weight value is reduced by one; if the device weight value is the third value, no processing is performed.

Citation Information

Patent Citations

  • Interrupt controller, interrupt control method, chip, computer device and medium

    CN113138949A