Data receiving module interrupt aggregation method, electronic equipment and storage medium
By using an interrupt aggregation method in the data receiving module, and combining polling and preset timers, the problem of frequent CPU occupancy in data receiving is solved, thereby improving the video analysis capabilities and data processing efficiency of the recording equipment.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-31
- Publication Date
- 2026-04-07
AI Technical Summary
The CPU of electronic devices frequently consumes processing time when receiving data, resulting in reduced data processing time and affecting data processing efficiency. This is especially true in video recording equipment, where the number of video channels may need to be reduced to ensure sufficient analysis time.
The interrupt aggregation method of the data receiving module is adopted. The data in the buffer of the data receiving module is read by polling. The load is judged according to the data volume threshold. The soft interrupt is disabled and a preset timer is started. The soft interrupt is periodically enabled to avoid frequent CPU occupation.
It ensures efficient data reception under high load, releases CPU resources under low load, reduces CPU usage, and improves data processing capabilities, especially enhancing video analysis capabilities in recording devices.
Smart Images

Figure CN121807499A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computer technology, and in particular to a data receiving module interrupt aggregation method, electronic device, and storage medium. Background Technology
[0002] Some electronic devices receive and process data periodically. However, since the processing power of the CPU (Central Processing Unit) in electronic devices is limited, if the CPU spends too much time receiving data, the actual time available for data processing will be reduced. Taking a video recording device as an example, it receives and processes videos periodically, such as performing intelligent analysis. If the recording device spends too much time receiving video, the time available for intelligent analysis will be reduced. In this case, to ensure sufficient analysis time, it may even be necessary to reduce the number of video channels processed simultaneously by the recording device.
[0003] Therefore, how to avoid excessively occupying the CPU to receive data, thereby reserving more time for the CPU to process data, has become an urgent technical problem to be solved. Summary of the Invention
[0004] The purpose of this application is to provide a data receiving module interrupt aggregation method, an electronic device, and a storage medium to avoid excessively occupying the CPU for data reception, thereby reserving more time for the CPU to process data. The specific technical solution is as follows:
[0005] A first aspect of this application provides a data receiving module interruption aggregation method, the method comprising:
[0006] In response to enabling soft interrupts, the control processor continuously reads data from the buffer corresponding to the data receiving module in a polling manner until the amount of data read in the most recent poll is less than a preset data amount threshold, and then the soft interrupts are disabled.
[0007] Start a preset timer, and enable a soft interrupt after the preset timer expires.
[0008] In one possible implementation, the method further includes:
[0009] The prediction determines whether the amount of data received in the buffer corresponding to the data receiving module within the preset timer duration is greater than a preset upper limit threshold, wherein the preset upper limit threshold is not greater than the amount of data that the buffer can hold;
[0010] If so, enable hardware interrupt; and / or,
[0011] If not, then execute the steps of starting the preset timer and enabling the soft interrupt after the preset timer expires.
[0012] In one possible implementation, whether the amount of data received in the buffer corresponding to the data receiving module within the predicted preset timer duration exceeds a preset upper limit threshold includes:
[0013] Get the amount of data read in a polling manner during the first time interval from the last soft interrupt being enabled to being disabled.
[0014] Based on the amount of data read in a polling manner within the first time period, the total amount of data received in the buffer corresponding to the data receiving module within the time period is estimated.
[0015] If the total data volume is greater than the preset upper limit threshold, then it is predicted that the data volume received in the buffer corresponding to the data receiving module within the time period is greater than the preset upper limit threshold; if the total data volume is not greater than the preset upper limit threshold, then it is predicted that the data volume received in the buffer corresponding to the data receiving module within the time period is not greater than the preset upper limit threshold.
[0016] In one possible implementation, the data volume is represented by the number of data packets, and the total data volume received in the buffer corresponding to the data receiving module within the timing duration is calculated using the following formula:
[0017] ;
[0018] in, The total number of data packets received in the buffer corresponding to the data receiving module within the specified timing period. This represents the number of data packets read in the most recent polling session. The number of polling iterations to read i data packets. This is a preset threshold for the number of data packets.
[0019] In one possible implementation, whether the amount of data received in the buffer corresponding to the data receiving module within the predicted preset timer duration exceeds a preset upper limit threshold includes:
[0020] The amount of data read in a polling manner during the period from the activation to the deactivation of the most recent preset number of soft interrupts is statistically analyzed to obtain statistical values.
[0021] Based on the statistical values, the total amount of data received in the buffer corresponding to the data receiving module within the time period is estimated.
[0022] If the total data volume is greater than the preset upper limit threshold, then it is predicted that the amount of data received in the buffer corresponding to the data receiving module within the predicted timing period is greater than the preset upper limit threshold; and / or,
[0023] If the total data volume is not greater than the preset upper limit threshold, then the data volume received in the buffer corresponding to the data receiving module within the predicted timing period is not greater than the preset upper limit threshold.
[0024] In one possible implementation, the data volume is represented by the number of data packets, and the timing duration is determined according to the following methods:
[0025] Obtain the total number of data packets that the buffer corresponding to the data receiving module can hold, the peak traffic of the data receiving module in historical time periods, and the statistical values of the packet length of the data packets;
[0026] Based on the peak traffic and the statistical values, calculate the average number of data packets received per unit time.
[0027] The duration for which the buffer is full is determined based on the total number of data packets that the buffer can hold and the average number of data packets received per unit time, and is used as the timing duration of the preset timer.
[0028] In one possible implementation, the data receiving module is a network interface card (NIC), and the total number of data packets that the buffer can hold is determined according to the following methods:
[0029] Obtain the number of queues of the network interface card (NIC) and the number of sub-queues of the single queue reception description of the NIC;
[0030] The total number of data packets that the buffer can hold is calculated using the following formula:
[0031] M = Q × (N - Th);
[0032] Where M is the total number of data packets that the buffer can hold, Q is the number of queues of the network card, N is the number of sub-queues of the network card, and Th is the preset data packet number threshold.
[0033] This application also provides an electronic device, including:
[0034] Memory, used to store computer programs;
[0035] When the processor executes a program stored in memory, it implements any of the above-described interrupt aggregation methods for the data receiving module.
[0036] This application also provides a computer program product containing instructions that, when run on a computer, cause the computer to execute any of the data receiving module interruption aggregation methods described above.
[0037] Beneficial effects of the embodiments in this application:
[0038] This application provides a data receiving module interrupt aggregation method, electronic device, and storage medium. When soft interrupts are enabled, data is continuously read from the corresponding buffer of the data receiving module through polling. If the amount of data read in the most recent poll is not less than a preset data volume threshold, it indicates that a large amount of data has been received in the buffer, and polling prioritizes data receiving efficiency. If the amount of data read in the most recent poll is less than the preset data volume threshold, it indicates that a small amount of data has been received in the buffer. In this case, soft interrupts are disabled, polling stops, and the processor is prevented from continuously occupying the buffer when there is no data or a small amount of data. After disabling soft interrupts, a preset timer is started. Before the timer expires, the processor will not be interrupted by receiving tasks and can focus on processing the read data or other tasks. After the timer expires, soft interrupts are re-enabled, and the polling mode is entered again to read data. This periodic triggering method prioritizes receiving efficiency under high load and releases processor resources under low load. Compared to continuous polling or frequent interrupts, it reduces the number of times the processor is frequently occupied for receiving data, reserving more time for the processor to process data.
[0039] Of course, implementing any product or method of this application does not necessarily require achieving all of the advantages described above at the same time. Attached Figure Description
[0040] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other embodiments can be obtained based on these drawings.
[0041] Figure 1 This is a first schematic diagram of the data receiving module interruption aggregation method provided in the embodiments of this application;
[0042] Figure 2 This is an example diagram of NAPI state transitions in related technologies;
[0043] Figure 3 This is a second schematic diagram of the data receiving module interruption aggregation method provided in the embodiments of this application;
[0044] Figure 4 This is a third schematic diagram of the data receiving module interruption aggregation method provided in the embodiments of this application;
[0045] Figure 5 This is a fourth schematic diagram of the data receiving module interruption aggregation method provided in the embodiments of this application;
[0046] Figure 6 A flowchart for determining the timing duration of a preset timer is provided in an embodiment of this application;
[0047] Figure 7 A schematic diagram illustrating the determination of a preset timer provided in an embodiment of this application;
[0048] Figure 8 Example diagram of NAPI+ timer state transition provided in the embodiments of this application;
[0049] Figure 9 A flowchart of the network card interrupt aggregation method provided in the embodiments of this application;
[0050] Figure 10 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0051] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art based on this application are within the scope of protection of this application.
[0052] First, let's explain the technical terms used in this application:
[0053] NAPI: New Application Programming Interface, is a mechanism in Linux (an operating system kernel) for efficiently processing network packets.
[0054] Interrupts are mechanisms in computer systems for handling specific events. When the processor needs to intervene in a specific event, the system suspends the current program and executes the handler corresponding to the specific event. After processing, the original program resumes execution. Interrupts are classified into hardware interrupts (hard interrupts in this article) and software interrupts (soft interrupts in this article) based on their triggering method. The implementation methods of hardware and software interrupts in this article can adopt the same implementation methods as conventional hardware and software interrupts.
[0055] Polling: A synchronous processing method in which the CPU actively and periodically queries each device to see if it needs service. If it does, the CPU provides service and then queries the next device after the service is completed.
[0056] Timer: A mechanism or object in the software field that allows a program to execute pre-defined code (such as a callback function) or trigger an event at a specific point in the future or after a specific time interval.
[0057] Budget: In the NAPI mechanism, it refers to the maximum number of data packets that can be read and processed from the buffer corresponding to the data receiving module (such as the network card) during a single soft interrupt handling.
[0058] A first aspect of this application provides a data receiving module interruption aggregation method, see [link to relevant documentation]. Figure 1 , Figure 1 This is a first schematic diagram of a data receiving module interruption aggregation method provided in an embodiment of this application. The method includes the following steps:
[0059] Step S101: In response to enabling the soft interrupt, the processor is controlled to continuously read data from the buffer corresponding to the data receiving module in a polling manner until the amount of data read in the most recent poll is less than the preset data amount threshold, and then the soft interrupt is disabled.
[0060] Step S103: Start the preset timer and enable the soft interrupt after the preset timer expires.
[0061] In this embodiment, with soft interrupts enabled, data is continuously read from the buffer corresponding to the data receiving module via polling. If the amount of data read in the most recent poll is not less than a preset data threshold, it indicates that a large amount of data has been received in the buffer, and polling prioritizes data receiving efficiency. If the amount of data read in the most recent poll is less than the preset data threshold, it indicates that a small amount of data has been received in the buffer. In this case, soft interrupts are disabled, polling stops, and the processor is prevented from continuously occupying the buffer when there is no data or a small amount of data. After disabling soft interrupts, a preset timer is started. Before the timer expires, the processor will not be interrupted by the receiving task and can focus on processing the read data or other tasks. After the timer expires, soft interrupts are re-enabled, and the processor re-enters polling mode to read data. This periodic triggering method prioritizes receiving efficiency under high load and releases processor resources under low load. Compared to continuous polling or frequent interrupts, this reduces the number of times the processor is frequently occupied for receiving data, reserving more time for the processor to process data.
[0062] Although related technologies have already adopted a network interface card (NIC) interrupt aggregation method to reduce the number of interrupts enabled, thereby reducing CPU consumption, such as... Figure 2 The diagram shown is an example of NAPI state transitions in related technologies, which is triggered by a hard interrupt when data is received (i.e., Figure 2(Packet reception, triggered by a hardware interrupt) switches to software interrupt. When data continues to arrive, it remains in software interrupt mode by ensuring the number of packets processed is greater than or equal to the budget. When the data arrival rate slows down, it exits software interrupt mode by ensuring the number of packets processed is less than the budget and switches back to hardware interrupt mode. This makes the packet accumulation during software interrupt processing more likely to be greater than or equal to the budget, raising the threshold for enabling hardware interrupts. This allows a single interrupt switch to cover multiple original switching cycles, reducing the number of hardware interrupts and allowing software interrupts to receive more packets at once, thus significantly reducing CPU consumption.
[0063] However, the applicant discovered a problem with the above mechanism: under sudden high traffic surges, hardware interrupts may still be frequently triggered, leading to frequent CPU switching and thus still causing excessive CPU consumption. Furthermore, the existing network card interrupt aggregation method is prone to causing network card buffer overflows under sudden high traffic surges.
[0064] Taking the data receiving module as a network interface card (NIC) as an example, the interrupt aggregation method for the data receiving module provided in this application determines the load trend by checking whether the amount of data read in the most recent poll is less than a preset data amount threshold. Based on this load trend, it initiates switching between soft interrupts and timer modes, which can adapt to traffic changes and avoid frequent hard interrupt triggering due to sudden high traffic. Furthermore, it enables hard interrupts in advance when high load is predicted to prevent buffer overflow.
[0065] Taking a video recorder as an example, with the data receiving module being the network card and the processor being the CPU, the interrupt method for the data receiving module provided in this application allows the CPU to read video data from the network card's buffer in a polling manner when the video recorder receives a large amount of video data. If the amount of data read most recently is not less than a preset data volume threshold, it indicates that the frequency or amount of video data received in the buffer is high, and there is still a lot of video data in the buffer. In this case, the video data in the buffer should still be read in polling mode under soft interrupt mode. If the amount of data read most recently is less than the preset data volume threshold, it indicates that the frequency and amount of video data received in the buffer are low, and the CPU should not continue to be occupied to read video data. In this case, the soft interrupt is disabled, a preset timer is started, and the soft interrupt is started again after the preset timer expires. By using this method, the time occupied by the CPU of the video recorder to read data can be reduced, freeing up the CPU's computing resources and allowing the CPU more time to process video analysis. Even if the number of channels remains unchanged or increases, each channel's video can get more sufficient analysis time. Furthermore, the applicant's actual tests show that the solution can greatly improve the video analysis capabilities of the recording equipment, or in other words, greatly increase the number of video streams that the recording equipment can analyze simultaneously.
[0066] The following explains steps S101 and S103:
[0067] In step S101 above, the data receiving module is any hardware unit or the lowest-level software driver interface in the computer system responsible for receiving raw data from an external network, such as a network interface card (NIC) or a data acquisition card. The buffer corresponding to the data receiving module is a memory area configured for the data receiving module, used to cache the data received by the data receiving module. For ease of understanding, the following description uses a NIC as the data receiving module and the NIC's buffer as the data receiving module as an example to illustrate the interrupt aggregation method for the data receiving module provided in this application. When the data receiving module is a hardware unit or software driver interface other than a NIC, the process of the interrupt aggregation method is similar to the following description; only the NIC needs to be replaced with the corresponding hardware unit or software driver interface, which will not be elaborated upon further here.
[0068] After soft interrupts are enabled, the processor enters polling mode, continuously reading data packets from the network card's buffer. To prevent soft interrupts from consuming too much CPU time, the amount of data read from the network card's buffer during each poll is limited; that is, the amount of data read during each poll is less than or equal to a preset data volume threshold. This preset data volume threshold controls the maximum amount of data read during each poll. The specific value of the preset data volume threshold is set based on experience and requirements, and this embodiment does not limit it.
[0069] Understandably, if the amount of data read in the most recent poll is less than a preset data threshold, and the preset timer cannot be started, a hardware interrupt is activated to prevent data from being discarded due to insufficient processing time. The preset timer not being able to be started could mean either a malfunction in the preset timer or that the preset timer is not configured.
[0070] In one possible implementation, the specific metric used to measure the data volume can be selected based on actual needs. For example, the data volume can be represented by the size of the data, and correspondingly, the preset data volume threshold can also be represented by the size of the data. Alternatively, the data volume can also be represented by the number of data packets, in which case the preset data volume threshold can be represented by a preset data packet number threshold. The number of data packets read in each poll is less than or equal to the preset data packet number threshold, which controls the maximum number of data packets read in each poll. The specific value of the preset data packet number threshold is set based on experience and needs, and this application embodiment does not limit it. In one possible implementation, when the data receiving module is a network card, the preset data packet number threshold can also be a budget.
[0071] It is understandable that when the amount of data (or the number of data packets) in the buffer is sufficient, that is, when the amount of data in the buffer is greater than the preset data amount threshold (or the number of data packets is greater than the preset data packet number threshold), the amount of data read from the buffer in each poll is usually equal to the preset data amount threshold (or the number of data packets read from the buffer in each poll is usually equal to the preset data packet number threshold).
[0072] If the amount of data read from the buffer in the most recent polling is less than a preset data volume threshold (or the number of data packets read is less than a preset data packet count threshold), it indicates that the data (or data packets) in the buffer has been cleared. Soft interrupts are then disabled so that the processor no longer reads data packets from the network card's buffer in a polling manner. For example, assuming the network card's buffer contains 100 data packets and the preset data packet count threshold is 30 (meaning 30 data packets are read from the buffer in each polling), then the first to third polls each read 30 data packets from the buffer. In the fourth poll, only 10 data packets remain, which is less than the preset threshold. Therefore, soft interrupts are disabled, and the processor no longer reads data packets from the buffer in a polling mode. A preset timer is then started. When the preset timer expires, the soft interrupt is enabled again, and the processor is once again controlled to read data packets from the network card's buffer in a polling mode.
[0073] In step S103, the expiration of the preset timer means the end of the preset timer's duration. The duration of the preset timer can be preset or determined based on the traffic and the capacity of the buffer. The process of determining the duration is detailed below and will not be repeated here.
[0074] It is understandable that if a sudden surge in traffic occurs during the period from the start to the end of the preset timer, it may cause the buffer corresponding to the data processing module to overflow. Therefore, in one possible implementation, it can be determined whether the buffer will overflow during the preset timer's timing period by predicting whether the increase in data in the buffer during the preset timer's timing period is greater than the buffer's capacity. Here, the increase in data in the buffer during the preset timer's timing period refers to the amount of data received in the buffer during the preset timer's timing period.
[0075] See Figure 3 , Figure 3 This is a second schematic diagram of the data receiving module interruption aggregation method provided in the embodiments of this application. The method includes the following steps:
[0076] Step S101: In response to enabling the soft interrupt, the processor is controlled to continuously read data from the buffer corresponding to the data receiving module in a polling manner until the amount of data read in the most recent poll is less than the preset data amount threshold, and then the soft interrupt is disabled.
[0077] Step S102: Predict whether the amount of data received in the buffer corresponding to the data receiving module within the preset timer duration is greater than the preset upper limit threshold.
[0078] Among them, the preset upper limit threshold is no greater than the amount of data that the cache can hold;
[0079] If it is not greater than, then proceed to step S103; if it is greater than, then proceed to step S104.
[0080] Step S103: Start a preset timer, and enable a software interrupt after the preset timer expires;
[0081] Step S104: Enable hardware interrupt.
[0082] Steps S101 and S103 are described above and will not be repeated here.
[0083] In step S103 above, the preset upper limit threshold is the amount of data that the cache can hold. The preset upper limit threshold can be determined based on the cache capacity, or it can be a value less than the cache capacity set based on the cache capacity and experience. These are all possible, and this embodiment does not limit the specific values. For example, assuming the cache can hold 100GB of data, the preset upper limit threshold can be 100GB, 80GB, or any other integer less than 100.
[0084] When the data volume is expressed as the number of data packets, the preset upper limit threshold can also be the number of data packets that the buffer can hold. In this case, the preset upper limit threshold is set based on the average size of the data packets and the capacity of the buffer. For example, assuming the average size of the data packets is 20M and the buffer can hold 1000 data packets, the preset upper limit threshold can be 1000, 800, or any other integer less than 1000.
[0085] The amount of data received in the buffer corresponding to the data receiving module within the preset timer duration can be predicted based on the current traffic volume. The amount of data received in the buffer corresponding to the data receiving module within the preset timer duration is positively correlated with the current traffic volume. In another possible implementation, the amount of data received in the buffer corresponding to the data receiving module within the preset timer duration can also be predicted based on historical data, such as the amount of data received in the buffer within the most recent preset time period, or it can be predicted based on other methods. This application embodiment does not limit this.
[0086] If the amount of data received in the network card's buffer exceeds the preset upper limit threshold within the time limit, it is assumed that a large amount of data is expected to arrive within the time limit. If not processed in time, the buffer may overflow. Therefore, a hardware interrupt is enabled so that the network card can immediately notify the processor that data has arrived, allowing the processor to respond and process quickly.
[0087] If the amount of data received in the network card's buffer within the time limit is not greater than the preset upper limit threshold, it is considered that the amount of data expected to arrive within the time limit is small and the buffer will not overflow. It can wait for a period of time before processing. At this time, the timer is started. When the timer expires, the soft interrupt is started again, and the processor is controlled to read the data packets in the network card's buffer in a polling mode.
[0088] For example, suppose the network card's buffer 1 can hold 500GB of data, the preset data volume threshold is 64GB, the timing duration is 50 microseconds, and the preset upper limit threshold is 400GB. The network card driver enables hardware interrupts during initialization and triggers a hardware interrupt upon receiving a data packet. The CPU responds to the interrupt by disabling the network card's hardware interrupts and scheduling software interrupts. After the software interrupts are enabled, data packets are read from the network card's buffer in a polling manner. If 64GB of data is read in the first poll, it indicates that there is a high probability that data still exists in the buffer, so a second poll is performed. If 64GB of data is read in the second poll, it indicates that there is a high probability that data still exists in the buffer, so a third poll is performed. If 50GB of data is read in the third poll, it is assumed that there is no remaining data in the buffer; otherwise, the number of data packets read in the third poll should also be 64GB. At this point, the software interrupts are disabled, and the driver predicts how much data the network card's buffer will reach within 50 microseconds from this moment.
[0089] If it is predicted that the network card's buffer will reach 450G of data within 50 microseconds, a hardware interrupt is enabled; if it is predicted that the network card's buffer will reach 150G of data packets within 50 microseconds, a timer is started, and after the timer has counted for 50 microseconds, a software interrupt is enabled to reread the data packets in the network card's buffer in a polling manner.
[0090] In this embodiment of the application, the increment of data packets in the buffer is predicted within the timer's duration. Since the preset upper limit threshold is not greater than the amount of data that the buffer can hold, if the increment of data packets in the buffer is greater than the preset upper limit threshold within the timer's duration, it means that the data received in the buffer will overflow after the timer expires. To avoid buffer overflow, a hardware interrupt needs to be enabled. If the increment of data packets in the buffer is not greater than the preset upper limit threshold within the timer's duration, it means that the data received in the buffer is less than the buffer's storage space after the timer expires. To avoid frequently enabling hardware interrupts, a software interrupt is still enabled after the timer expires, and data packets are continued to be read using a polling method. This can reduce unnecessary hardware interrupts and reduce CPU consumption.
[0091] In one possible implementation, the increment of data packets in the network card's buffer during the timing duration can also be predicted based on the amount of data read during the period from when the soft interrupt was last enabled to when it was disabled. Specifically, such as... Figure 4 As shown, Figure 4 This is a third schematic diagram of the data receiving module interruption aggregation method provided in the embodiments of this application. The method includes the following steps:
[0092] Step S101: In response to enabling the soft interrupt, the processor is controlled to continuously read data from the buffer corresponding to the data receiving module in a polling manner until the amount of data read in the most recent poll is less than the preset data amount threshold, and then the soft interrupt is disabled.
[0093] Step S1021: Obtain the amount of data read in a polling manner during the first time period from the last soft interrupt being enabled to being disabled.
[0094] Step S1022: Based on the amount of data read in a polling manner within the first time period, estimate the total amount of data received in the buffer corresponding to the data receiving module within the first time period.
[0095] If the total amount of data is not greater than the preset upper limit threshold, it can be considered that the amount of data received in the buffer corresponding to the data receiving module within the predicted timing period is not greater than the preset upper limit threshold, and then step S103 is executed; if the total amount of data is greater than the preset upper limit threshold, it can be considered that the amount of data received in the buffer corresponding to the data receiving module within the predicted timing period is greater than the preset upper limit threshold, and then step S104 is executed.
[0096] Step S103: Start a preset timer, and enable a software interrupt after the preset timer expires;
[0097] Step S104: Enable hardware interrupt.
[0098] Steps S101, S103, and S104 are described above. Steps S1021 to S1022 are a specific implementation of step S102.
[0099] In step 1021, the first duration from the most recent soft interrupt being enabled to being disabled refers to the duration between the moment the soft interrupt was enabled and the moment the soft interrupt was disabled in step S101. The amount of data read in a polling manner within the first duration from the most recent soft interrupt being enabled to being disabled is obtained by summing the amount of data read in a polling manner within the first duration.
[0100] In step S1022, based on the amount of data read in a polling manner within the first time period, the total amount of data received in the buffer corresponding to the data receiving module within the time period is estimated. This can be achieved by first calculating the average rate at which data arrives in the buffer based on the amount of data read in a polling manner within the first time period, and then calculating the total amount of data received in the buffer corresponding to the data receiving module within the time period based on this rate. Alternatively, the total amount of data received in the buffer corresponding to the data receiving module within the time period can be predicted using a machine learning model. Other prediction methods can also be used, but this embodiment does not limit the specific methods used.
[0101] If the total amount of data within the time limit is greater than the preset upper limit threshold, it is considered that the increase in data in the buffer corresponding to the data receiving module within the time limit is greater than the preset upper limit threshold, and a hard interrupt is enabled; if the total amount of data is not greater than the preset upper limit threshold, it is considered that the increase in data in the buffer corresponding to the data receiving module within the time limit is not greater than the preset upper limit threshold, and a timer is started, and a soft interrupt is enabled after the timer expires.
[0102] By using the embodiments of this application, the total amount of data received in the buffer corresponding to the data receiving module within the time period is predicted by the amount of data read in a polling manner during the first time period from the most recent soft interrupt to its shutdown, which can avoid buffer overflow caused by sudden traffic.
[0103] In another possible implementation, the increase in data packets in the network card's buffer during the timing period can also be predicted based on the statistical value of the data volume read during the most recent periods of enabling and disabling soft interrupts. Specifically, such as... Figure 5 As shown, Figure 5 This is a fourth schematic diagram of the data receiving module interruption aggregation method provided in the embodiments of this application. The method includes the following steps:
[0104] Step S101: In response to enabling the soft interrupt, the processor is controlled to continuously read data from the buffer corresponding to the data receiving module in a polling manner until the amount of data read in the most recent poll is less than the preset data amount threshold, and then the soft interrupt is disabled.
[0105] Step S1023: Statistically analyze the amount of data read in a polling manner during the period from the activation to the deactivation of the most recent preset number of soft interrupts, and obtain statistical values;
[0106] Step S1024: Based on the statistical values, estimate the total amount of data received in the buffer corresponding to the data receiving module within the estimated time period;
[0107] If the total amount of data is not greater than the preset upper limit threshold, it can be considered that the amount of data received in the buffer corresponding to the data receiving module within the predicted timing period is not greater than the preset upper limit threshold, and then step S103 is executed; if the total amount of data is greater than the preset upper limit threshold, it can be considered that the amount of data received in the buffer corresponding to the data receiving module within the predicted timing period is greater than the preset upper limit threshold, and then step S104 is executed.
[0108] Step S103: Start a preset timer, and enable a software interrupt after the preset timer expires;
[0109] Step S104: Enable hardware interrupt.
[0110] Steps S101, S103, and S104 are described above. Steps S1023 to S1024 are another specific implementation of step S102.
[0111] In step S1023, the statistical value can be the average, maximum, or median of the data volume read in a polling manner during the period from the activation to the deactivation of the most recent preset number of soft interrupts, or it can be other statistical values. This application embodiment does not limit this. The preset number is set according to needs and experience, and this application embodiment does not limit this.
[0112] In step S1024, based on the statistical value, the total amount of data received in the buffer corresponding to the data receiving module within the estimated time period is estimated. The statistical value can be used as input to the machine learning model to predict the total amount of data received in the buffer corresponding to the data receiving module within the estimated time period; other prediction methods can also be used, and this application embodiment does not limit this.
[0113] By using the embodiments of this application, the total amount of data received in the buffer corresponding to the data receiving module within the time period can be predicted based on the amount of data read in a polling manner during the period from the start to the end of a preset number of soft interrupts, thus avoiding buffer overflow caused by sudden traffic.
[0114] When the data volume is expressed as the number of data packets, the total data volume received in the buffer corresponding to the data receiving module is the total number of data packets received in the buffer corresponding to the data receiving module. In order to quickly predict the total data volume received in the buffer corresponding to the data receiving module within the timing period, in one possible implementation, the total data volume received in the buffer corresponding to the data receiving module within the timing period can also be predicted by the following formula:
[0115] ;
[0116] in, This refers to the total number of data packets received in the buffer corresponding to the data receiving module within the timing period. This represents the number of data packets read in the most recent polling session. The number of polling iterations to read i data packets. This is a preset threshold for the number of data packets.
[0117] As can be seen from the above, the duration of the preset timer in this application can be determined based on the traffic and the capacity of the buffer. The following will explain the process of determining the duration of the preset timer when the data volume is expressed as the number of data packets:
[0118] See Figure 6 , Figure 6 The flowchart for determining the timing duration of a preset timer provided in this application embodiment includes the following steps:
[0119] Step S401: Obtain the total number of data packets that can be held in the buffer corresponding to the data receiving module, the peak traffic of the data receiving module in the historical period, and the statistical values of the packet length of the data packets;
[0120] Step S402: Calculate the average number of data packets received per unit time based on peak traffic and statistical values;
[0121] Step S403: Determine the duration for which the buffer is full based on the total number of data packets that can be held in the buffer and the average number of data packets received per unit time, and use this duration as the timing duration of the preset timer.
[0122] In step S401, the total number of data packets that the buffer corresponding to the data receiving module can hold can be preset or calculated based on the buffer capacity and the average size of historically received data packets.
[0123] When the data receiving module is a network card, in order to make the total number of data packets that can be held in the buffer more accurate, the total number of data packets that can be held in the buffer can also be calculated based on the number of queues of the network card and the number of sub-queues of the network card's single queue reception description. See below for the specific calculation process.
[0124] Peak traffic refers to the maximum data transmission rate observed on the network interface or link of the current device within a historical period. The statistical value of the packet length can refer to the average packet length of the received packets, the minimum packet length of the received packets, or other statistical values; this application embodiment does not limit this.
[0125] In step S402, the average number of data packets received per unit time is calculated based on the peak traffic and statistical values. This can be done by calculating the ratio of peak traffic to statistical values. For example, if the peak traffic is B Mbit / s and the statistical value of the data packet length is L Byte, then the average number of data packets received per unit time is: B×1000000 / L / 8.
[0126] Furthermore, in step S403, the duration for which the buffer is full can be calculated based on the total number of data packets that the buffer can hold and the average number of data packets received per unit time. Specifically, the calculation is performed based on the ratio of the total number of data packets that the buffer can hold to the average number of data packets received per unit time. For example, assuming the total number of data packets that the buffer can hold is P, then the duration for which the buffer is full is T = P / (B × 1000000 / L / 8) seconds.
[0127] In this embodiment of the application, the duration for which the buffer is full is determined based on the statistical values of the total number of data packets that can be accommodated, peak traffic, and packet length of the data packets. This duration is used as the timing duration of the timer. The timing duration of the timer can be dynamically adjusted in combination with real-time traffic peaks to avoid the problem of buffer overflow caused by sudden traffic surges when the timing duration is fixed.
[0128] To quickly calculate the timing duration and improve the response rate, in one possible implementation, the total number of data packets that the buffer can hold is determined according to the following methods:
[0129] Step 1: Obtain the number of queues for the network interface card (NIC) and the number of sub-queues for receiving data in a single queue of the NIC;
[0130] The number of queues in a network interface card (NIC) refers to the number of hardware components supported by the NIC, such as the number of receive queues and the number of transmit queues. The number of sub-descriptors in a single receive queue refers to the number of descriptors in a receive queue, i.e., the number of data packets that the queue can buffer.
[0131] Step 2: Calculate the total number of data packets that the buffer can hold using the following formula:
[0132] M = Q × (N - Th);
[0133] Where M is the total number of data packets that can be held in the buffer, Q is the number of queues of the network card, N is the number of sub-queues of the network card, and Th is the preset data packet number threshold.
[0134] It is understandable that in this application, it is only necessary to accurately estimate whether the total number of data packets received within the time limit is greater than a preset upper limit threshold to determine whether to enable the hardware interrupt or the timer, without needing to accurately predict the precise value of the total number of data packets received within the time limit. In one possible implementation, given that the number of sub-queues received by the network card, the number of queues of the network card, the timer duration, and the preset budget are known, the minimum value of m can be estimated according to the following formula, that is, the minimum value of m that satisfies the following inequality, hereinafter referred to as timer_min:
[0135]
[0136] If the number of data packets read in the last poll in step S101 is smaller than the estimated minimum value of m, it is assumed that the total number of data packets received in the network card's buffer within the time limit will exceed the preset upper limit threshold, and a hard interrupt should be enabled to prevent buffer overflow; otherwise, it is assumed that the total number of data packets received in the network card's buffer within the time limit will not exceed the preset upper limit threshold, and a timer should be started until the timer expires and the next round of polling begins, in order to avoid triggering a hard interrupt.
[0137] Combination Figure 7 As shown, Figure 7 This diagram illustrates the determination of a preset timer according to an embodiment of the present application, including timer timing calculation, timer hardware binding, hardware timer interrupt triggering, and timer software processing. During the timer timing calculation, the total number of data packets that the network interface card (NIC) buffer can hold is first calculated based on the number of NIC queues, the number of receive descriptors per NIC queue, and the preset budget. Then, the average number of packets per unit time is calculated based on peak traffic and average packet length. Finally, the time it takes for the buffer to be full, i.e., the timer duration, is calculated based on the total number of data packets the buffer can hold and the average number of packets per unit time.
[0138] During the timer hardware binding process, the timer setting module selects a hardware timer that meets the preset conditions for binding based on the timing duration calculated above.
[0139] Once the hardware timer has finished counting, i.e., the countdown timer expires, a CPU software interrupt is triggered. In software, the network card interrupt aggregation process for the timer is executed via an interrupt handler.
[0140] In other words, the network card interrupt aggregation method provided in this application does not simply switch between hardware interrupts and software interrupts, but rather... Figure 8 As shown, with hardware interrupts enabled, a software interrupt is triggered upon receiving a data packet (i.e., the hardware interrupt is triggered upon receiving a packet in the diagram). In software interrupt mode, if the data packet being processed (i.e., the data packet read in this poll, which is also the number of packets processed in the diagram) is less than the budget, the system switches from software interrupt mode to timer mode. If the data packet being processed is less than timer_min, the system switches from timer mode to hardware interrupt mode. If the data packet being processed is greater than or equal to the budget, software interrupt is still used. If the data packet being processed is between timer_min and the budget, the system switches to timer mode. In timer mode, the system switches back to software interrupt mode when the timer expires.
[0141] This allows for selective switching between timer mode and hard interrupt mode based on the number of packets received. In timer mode, packets received over a period of time are processed sequentially, thereby reducing the number of network card hard interrupts, improving CPU performance, and reducing CPU consumption.
[0142] To more clearly illustrate the interrupt aggregation method of the data receiving module in this application, the following explanation uses a network interface card (NIC) as an example and is illustrated with a flowchart:
[0143] See Figure 9 , Figure 9 The flowchart of the network card interrupt aggregation method provided in this application embodiment is as follows:
[0144] S1, enable the network card's hardware interrupt during initialization;
[0145] S2, a hard interrupt is triggered when a data packet arrives at the network card;
[0146] S3, the CPU responds to the hardware interrupt, executes the interrupt handler function registered by the driver, and disables the hardware interrupt of the network card;
[0147] S4, add the current device's napi_struct (the core data structure of the NAPI mechanism) to the current CPU's poll_list (polling queue) to enable soft interrupts;
[0148] S5, the Linux kernel executes a network receive soft interrupt after the hard interrupt ends (i.e., soft interrupt is enabled).
[0149] S6, a soft interrupt calls the polling function to read multiple data packets at once from the RX ring buffer (receive ring buffer) of the network card (i.e., continuously read data packets from the network card's buffer in a polling mode) and send them to the protocol stack;
[0150] S71, if the data packet read this time is greater than or equal to the budget, keep the soft interrupt enabled;
[0151] S72, if the number of data packets read this time is less than the budget, and the user has not configured the timer method to receive packets, then enable the network card hardware interrupt;
[0152] S73, if the data packet read this time is less than timer_min, enable the network card hardware interrupt;
[0153] S74, if the data packet read this time is between timer_min and the budget, start the timer to restart the timing;
[0154] S8. After the timer expires, the soft interrupt is rescheduled so that the CPU can perform the next packet reception process, which is the same as step S6 above.
[0155] S5~S6 correspond to the aforementioned step S101, and S73~S8 correspond to the aforementioned steps S102~S104.
[0156] Corresponding to the first aspect mentioned above, a second aspect of the embodiments of this application provides a data receiving module interruption aggregation device, the device comprising:
[0157] The read control module is used to control the processor to continuously read data from the buffer corresponding to the data receiving module in a polling manner in response to enabling a soft interrupt, until the amount of data read in the most recent poll is less than a preset data amount threshold, and then disable the soft interrupt;
[0158] The timing module is used to start a preset timer and enable a soft interrupt after the preset timer expires.
[0159] In one possible implementation, the device further includes:
[0160] The prediction module is used to predict whether the amount of data received in the buffer corresponding to the data receiving module within the timing duration of the preset timer is greater than a preset upper limit threshold, wherein the preset upper limit threshold is not greater than the amount of data that the buffer can hold;
[0161] If so, enable hardware interrupt; and / or,
[0162] If not, then execute the steps of starting the preset timer and enabling the soft interrupt after the preset timer expires.
[0163] In one possible implementation, the prediction module predicts whether the amount of data received in the buffer corresponding to the data receiving module within the preset timer duration exceeds a preset upper limit threshold, including:
[0164] Get the amount of data read in a polling manner during the first time interval from the last soft interrupt being enabled to being disabled.
[0165] Based on the amount of data read in a polling manner within the first time period, the total amount of data received in the buffer corresponding to the data receiving module within the time period is estimated.
[0166] If the total data volume is greater than the preset upper limit threshold, then it is predicted that the data volume received in the buffer corresponding to the data receiving module within the time period is greater than the preset upper limit threshold; if the total data volume is not greater than the preset upper limit threshold, then it is predicted that the data volume received in the buffer corresponding to the data receiving module within the time period is not greater than the preset upper limit threshold.
[0167] In one possible implementation, the data volume is represented by the number of data packets, and the total data volume received in the buffer corresponding to the data receiving module within the timing duration is calculated using the following formula:
[0168] ;
[0169] in, The total number of data packets received in the buffer corresponding to the data receiving module within the specified timing period. This represents the number of data packets read in the most recent polling session. The number of polling iterations to read i data packets. This is a preset threshold for the number of data packets.
[0170] In one possible implementation, the prediction module predicts whether the amount of data received in the buffer corresponding to the data receiving module within the preset timer duration exceeds a preset upper limit threshold, including:
[0171] The amount of data read in a polling manner during the period from the activation to the deactivation of the most recent preset number of soft interrupts is statistically analyzed to obtain statistical values.
[0172] Based on the statistical values, the total amount of data received in the buffer corresponding to the data receiving module within the time period is estimated.
[0173] If the total data volume is greater than the preset upper limit threshold, then it is predicted that the amount of data received in the buffer corresponding to the data receiving module within the predicted timing period is greater than the preset upper limit threshold; and / or,
[0174] If the total data volume is not greater than the preset upper limit threshold, then the data volume received in the buffer corresponding to the data receiving module within the predicted timing period is not greater than the preset upper limit threshold.
[0175] In one possible implementation, the data volume is represented by the number of data packets, and the timing duration is determined according to the following methods:
[0176] Obtain the total number of data packets that the buffer corresponding to the data receiving module can hold, the peak traffic of the data receiving module in historical time periods, and the statistical values of the packet length of the data packets;
[0177] Based on the peak traffic and the statistical values, calculate the average number of data packets received per unit time.
[0178] The duration for which the buffer is full is determined based on the total number of data packets that the buffer can hold and the average number of data packets received per unit time, and is used as the timing duration of the preset timer.
[0179] In one possible implementation, the data receiving module is a network interface card (NIC), and the total number of data packets that the buffer can hold is determined according to the following methods:
[0180] Obtain the number of queues of the network interface card (NIC) and the number of sub-queues of the single queue reception description of the NIC;
[0181] The total number of data packets that the buffer can hold is calculated using the following formula:
[0182] M = Q × (N - Th);
[0183] Where M is the total number of data packets that the buffer can hold, Q is the number of queues of the network card, N is the number of sub-queues of the network card, and Th is the preset data packet number threshold.
[0184] This application also provides an electronic device, such as... Figure 10 As shown, it includes:
[0185] Memory 1001 is used to store computer programs;
[0186] When processor 1002 executes a program stored in memory 1001, it performs the following steps:
[0187] In response to enabling soft interrupts, the control processor continuously reads data from the buffer corresponding to the data receiving module in a polling manner until the amount of data read in the most recent poll is less than a preset data amount threshold, and then the soft interrupts are disabled.
[0188] Start a preset timer, and enable a soft interrupt after the preset timer expires.
[0189] Furthermore, the aforementioned electronic device may also include a communication bus and / or a communication interface, with the processor 1002, the communication interface, and the memory 1001 communicating with each other via the communication bus.
[0190] The communication bus mentioned in the above electronic devices can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. This communication bus can be divided into address bus, data bus, control bus, etc. For ease of illustration, only one thick line is used to represent it in the diagram, but this does not mean that there is only one bus or one type of bus.
[0191] The communication interface is used for communication between the aforementioned electronic devices and other devices.
[0192] The memory may include random access memory (RAM) or non-volatile memory (NVM), such as at least one disk storage device. Optionally, the memory may also be at least one storage device located remotely from the aforementioned processor.
[0193] The processors mentioned above can be general-purpose processors, including central processing units (CPUs), network processors (NPs), etc.; they can also be digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.
[0194] In another embodiment provided in this application, a computer-readable storage medium is also provided, which stores a computer program that, when executed by a processor, implements the steps of any of the above-described data receiving module interruption aggregation methods.
[0195] In another embodiment provided in this application, a computer program product containing instructions is also provided, which, when run on a computer, causes the computer to execute any of the data receiving modules interrupt aggregation methods described in the above embodiments.
[0196] In the above embodiments, implementation can be achieved, in whole or in part, through software, hardware, firmware, or any combination thereof. When implemented in software, it can be implemented, in whole or in part, as a computer program product. A computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the flow or function according to the embodiments of this application is generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that integrates one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a solid-state disk (SSD), etc.
[0197] It should be noted that, in this document, relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes the element.
[0198] The various embodiments in this specification are described in a related manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, the apparatus embodiments are basically similar to the method embodiments, so the description is relatively simple; relevant parts can be referred to the descriptions of the method embodiments.
[0199] The above are merely preferred embodiments of this application and are not intended to limit the scope of protection of this application. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application are included within the scope of protection of this application.
Claims
1. A method for aggregating interruptions in a data receiving module, characterized in that, The method includes: In response to enabling soft interrupts, the control processor continuously reads data from the buffer corresponding to the data receiving module in a polling manner until the amount of data read in the most recent poll is less than a preset data amount threshold, and then the soft interrupts are disabled. Start a preset timer, and enable a soft interrupt after the preset timer expires.
2. The method according to claim 1, characterized in that, The method further includes: The prediction determines whether the amount of data received in the buffer corresponding to the data receiving module within the preset timer duration is greater than a preset upper limit threshold, wherein the preset upper limit threshold is not greater than the amount of data that the buffer can hold; If so, enable hardware interrupt; and / or, If not, then execute the steps of starting the preset timer and enabling the soft interrupt after the preset timer expires.
3. The method according to claim 2, characterized in that, Whether the amount of data received in the buffer corresponding to the data receiving module within the predicted preset timer duration exceeds a preset upper limit threshold includes: Get the amount of data read in a polling manner during the first time interval from the last soft interrupt being enabled to being disabled. Based on the amount of data read in a polling manner within the first time period, the total amount of data received in the buffer corresponding to the data receiving module within the time period is estimated. If the total data volume is greater than the preset upper limit threshold, then it is predicted that the data volume received in the buffer corresponding to the data receiving module within the timed duration is greater than the preset upper limit threshold; if the total data volume is not greater than the preset upper limit threshold, then it is predicted that the data volume received in the buffer corresponding to the data receiving module within the timed duration is not greater than the preset upper limit threshold.
4. The method according to claim 3, characterized in that, The data volume is represented by the number of data packets, and the total data volume received in the buffer corresponding to the data receiving module within the timing period is calculated using the following formula: ; in, The total number of data packets received in the buffer corresponding to the data receiving module within the specified timing period. This represents the number of data packets read in the most recent polling session. The number of polling iterations to read i data packets. This is a preset threshold for the number of data packets.
5. The method according to claim 2, characterized in that, Whether the amount of data received in the buffer corresponding to the data receiving module within the predicted preset timer duration exceeds a preset upper limit threshold includes: The amount of data read in a polling manner during the period from the activation to the deactivation of the most recent preset number of soft interrupts is statistically analyzed to obtain statistical values. Based on the statistical values, the total amount of data received in the buffer corresponding to the data receiving module within the time period is estimated. If the total data volume is greater than the preset upper limit threshold, then it is predicted that the amount of data received in the buffer corresponding to the data receiving module within the predicted timing period is greater than the preset upper limit threshold; and / or, If the total amount of data is not greater than the preset upper limit threshold, then the amount of data received in the buffer corresponding to the data receiving module within the predicted timing period is not greater than the preset upper limit threshold.
6. The method according to any one of claims 2-5, characterized in that, The data volume is represented by the number of data packets, and the timing duration is determined according to the following methods, including: Obtain the total number of data packets that the buffer corresponding to the data receiving module can hold, the peak traffic of the data receiving module in historical time periods, and the statistical values of the packet length of the data packets; Based on the peak traffic and the statistical values, calculate the average number of data packets received per unit time. The duration for which the buffer is full is determined based on the total number of data packets that the buffer can hold and the average number of data packets received per unit time, and is used as the timing duration of the preset timer.
7. The method according to claim 6, characterized in that, The data receiving module is a network interface card (NIC), and the total number of data packets that the buffer can hold is determined according to the following methods: Obtain the number of queues of the network interface card (NIC) and the number of sub-queues of the single queue reception description of the NIC; The total number of data packets that the buffer can hold is calculated using the following formula: M = Q × (N - Th); Where M is the total number of data packets that the buffer can hold, Q is the number of queues of the network card, N is the number of sub-queues of the network card, and Th is a preset data packet number threshold.
8. The method according to any one of claims 1-7, characterized in that, The method further includes: If the amount of data read in the most recent poll is less than a preset data threshold, and the preset timer cannot be started, then a hard interrupt is enabled.
9. An electronic device, characterized in that, include: Memory, used to store computer programs; A processor, when executing a program stored in memory, implements the method described in any one of claims 1-8.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the method described in any one of claims 1-8.