Request processing method and device

By detecting the port request signal in each arbitration cycle and selecting the port with the highest priority to respond, reducing its weight, the problem that high-weight ports in the prior art cannot respond in a timely manner, and timely response and reasonable arbitration of each port are achieved.

CN120234271APending Publication Date: 2025-07-01HANGZHOU HIKMICRO SENSING TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510297415.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-12
Publication Date
2025-07-01

AI Technical Summary

Technical Problem

In the existing port arbitration method, high-weight ingress ports cannot respond in time when requests exist.

Method used

During each arbitration cycle, detect whether there is a request signal on multiple ports, select the target port with the highest priority to respond, and reduce its weight. For ports where no request signal exists, keep their weight unchanged until the next arbitration cycle.

Benefits of technology

It effectively solves the problem that high-weight ports cannot respond in time when requests occur, and avoids the situation where low-priority ports cannot receive responses for a long time, ensuring timely responses of each port.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120234271A_ABST
    Figure CN120234271A_ABST
Patent Text Reader

Abstract

The invention discloses a request processing method and device, relates to the technical field of microelectronics, and is at least used for solving the problem that an electronic device cannot respond to a port in time in a current arbitration mode. The method comprises the following steps: in response to entering a current arbitration period, acquiring whether each port of a plurality of ports of a target circuit has a request signal; for the ports with the request signals, according to the priorities of the ports, determining the port with the highest priority as a target port, reducing the weight of the target port and keeping the weights of the other ports except the target port unchanged, and reducing the priority of the target port under the condition that the weight of the target port is reduced to a threshold value condition; and outputting a target signal to the target circuit, wherein the target signal is used for indicating the target circuit to respond to the request signal of the target port.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of microelectronics technology, and particularly to a request processing method and apparatus. Background Art

[0002] Port arbitration refers to a situation in the data communication process where when data packets from different ports need to be output through the same exit port, there will be competition for the right to use the exit port. In this case, it is necessary to perform arbitration through a certain algorithm to determine which entry port can obtain the right to use the exit port first, that is, the data packet can be sent out through the exit port first.

[0003] In the related art, in each polling cycle, in a way controlled by a pointer, arbitration judgment is performed in the order from high to low according to the weight. In each arbitration process within a polling cycle, the arbitration starts from the position pointed to by the pointer in the previous time. There are the following problems with this arbitration method. If the entry port with the highest bit does not initiate a request during the first arbitration process, the current polling cycle will skip the highest bit, and each subsequent arbitration within this polling cycle will start from the second highest bit. This arbitration method has the problem that when there is a request from the entry port with the highest weight, the electronic device cannot respond in a timely manner. Summary of the Invention

[0004] This application provides a request processing method and apparatus, which are at least used to solve the problem that in the current arbitration method, the electronic device cannot respond to the port in a timely manner.

[0005] To achieve the above technical objectives, this application adopts the following technical solutions:

[0006] In a first aspect, an embodiment of this application provides a request processing method, including: in response to entering the current arbitration cycle, obtaining whether there is a request signal for each port among multiple ports of the target circuit; for the ports with request signals, determining the port with the highest priority as the target port according to the priority of the ports, and reducing the weight of the target port while keeping the weights of the other ports except the target port unchanged, and reducing the priority of the target port when the weight of the target port is reduced to the threshold condition; outputting a target signal to the target circuit, where the target signal is used to instruct the target circuit to respond to the request signal of the target port.

[0007] An embodiment of the present application provides a request processing method. In entering the current arbitration cycle, the method will detect whether there are request signals on multiple ports. Then, from the ports with request signals, it will select the target port with the highest priority for response and reduce the weight of the first port. Additionally, for ports without request signals, it will reduce the weight of the target port and keep the weights of the other ports except the target port unchanged. Finally, it will output a target signal to the target circuit to instruct the target circuit to respond to the request signal of the target port. Through the above method, the request situation of each port will be judged in each arbitration cycle. If a port has no request, its weight will not be cleared to zero, and whether there is a request signal on this port will still be judged in the next arbitration, thus effectively solving the problem that a port with a high weight cannot be responded to in time when a request occurs within a polling cycle. Additionally, reducing the priority according to the weight of the target port can avoid the problem that a port with a low priority cannot be responded to for a long time, ensuring that each port can be responded to in time.

[0008] In a possible implementation, the initial weight configured for each port is used to represent the maximum number of times the port can be responded to while keeping the priority unchanged.

[0009] In a possible implementation, reducing the weight of the target port includes: subtracting 1 from the value indicated by the current weight of the target port.

[0010] In a possible implementation, when the weight of the target port is reduced to a threshold condition, reducing the priority of the target port includes: when the value indicated by the weight of the target port is reduced to zero, setting the priority of the target port to the lowest and updating the priorities of other ports. That is to say, when the target port has received multiple authorizations and its weight is cleared to zero, it means that the allocated access times have been used up, so its priority is adjusted to the lowest to solve the situation where a high-priority port occupies the request resources for a long time and other low-priority ports cannot be authorized for a long time.

[0011] In a possible implementation, updating the priorities of other ports includes: for ports with a priority higher than the initial priority of the target port, keeping the priority unchanged; for ports with a priority lower than the initial priority of the target port, increasing the priority.

[0012] In a possible implementation, the method further includes: when the weight of the target port is reduced to zero, resetting the weight of the target port. It can be understood that through the above steps, the continuous execution of the method provided by the present application can be ensured.

[0013] In a possible implementation, in response to entering the current arbitration cycle, it is determined whether there is a request signal at each port among multiple ports of a target circuit, including: obtaining a first array from the target circuit, where the first array includes multiple elements, the bit order of each element is used to represent the port identifier of the corresponding port, and the value of the element is used to represent whether there is a request signal at the corresponding port; determining whether there is a request signal at each port according to the bit order and value of each element in the first array.

[0014] In a possible implementation, multiple elements in the first array are arranged according to the priorities of multiple ports, so that the first array can also represent the priorities of each port.

[0015] In a second aspect, the present application provides a request processing device, including: an acquisition module, a determination module, and an output module;

[0016] The acquisition module is configured to, in response to entering the current arbitration cycle, determine whether there is a request signal at each of the multiple ports of the target circuit;

[0017] The determination module is configured to, for a port with a request signal, according to the priority of the port, determine the port with the highest priority as the target port, and reduce the weight of the target port while keeping the weights of the other ports except the target port unchanged, and when the weight of the target port is reduced to a threshold condition, reduce the priority of the target port;

[0018] The output module is configured to output a target signal to the target circuit, where the target signal is used to instruct the target circuit to respond to the request signal of the target port.

[0019] In a possible implementation, the initial weight configured for each port is used to represent the maximum number of times the port is responded to when the priority remains unchanged.

[0020] In a possible implementation, the determination module is specifically configured to subtract 1 from the value indicated by the current weight of the target port.

[0021] In a possible implementation, the determination module is specifically configured to, when the value indicated by the weight of the target port is reduced to zero, set the priority of the target port to the lowest and update the priorities of other ports.

[0022] In a possible implementation, the determination module is specifically configured to keep the priority unchanged for ports with a priority higher than the initial priority of the target port; and increase the priority for ports with a priority lower than the initial priority of the target port.

[0023] In a possible implementation, the determining module is further configured to reset the weight of the target port when the weight of the target port is reduced to zero.

[0024] In a possible implementation, the multiple elements in the first array are arranged according to the priorities of the multiple ports, so that the first array can further represent the priorities of the ports.

[0025] In a third aspect, the present application provides an electronic device, including: one or more processors; one or more memories; wherein, the one or more memories are used to store computer program code, and the computer program code includes computer instructions. When the one or more processors execute the computer instructions, the electronic device executes any one of the request processing methods provided in the first aspect above.

[0026] In a fourth aspect, the present application provides a computer-readable storage medium, which stores computer-executable instructions. When the computer-executable instructions run on a computer, the computer executes any one of the request processing methods provided in the first aspect above.

[0027] In a fifth aspect, the present application provides a computer program product, which includes computer instructions. When the computer instructions run on an electronic device, the electronic device executes the request method as described in the first aspect and any of its possible design manners.

[0028] For the specific descriptions of the second aspect to the fifth aspect and their various implementation manners in the present application, reference may be made to the detailed descriptions in the first aspect and its various implementation manners; and, for the beneficial effects of the second aspect to the fifth aspect and their various implementation manners, reference may be made to the beneficial effect analysis in the first aspect and its various implementation manners, which will not be elaborated here.

[0029] These aspects or other aspects of the present application will be more clearly understood in the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0030] Figure 1 It is a schematic structural diagram of an electronic device to which the request processing method provided in the embodiment of the present application is applied;

[0031] Figure 2 It is a schematic flowchart of a request processing method provided in the embodiment of the present application;

[0032] Figure 3 It is a schematic flowchart of another request processing method provided in the embodiment of the present application;

[0033] Figure 4 It is a schematic diagram of an arbitration scenario provided in the embodiment of the present application;

[0034] Figure 5 Schematic diagram of another arbitration scenario provided by an embodiment of the present application;

[0035] Figure 6 Flowchart of an arbitration scheme provided by an embodiment of the present application;

[0036] Figure 7 Schematic diagram of the composition of a request processing device provided by an embodiment of the present application;

[0037] Figure 8 Schematic diagram of the composition of an electronic device provided by an embodiment of the present application. Detailed implementation manners

[0038] Next, the technical solutions in the embodiments of the present application will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present application.

[0039] It should be noted that in the embodiments of the present application, words such as "exemplary" or "for example" are used to represent examples, illustrations or explanations. Any embodiment or design solution described as "exemplary" or "for example" in the embodiments of the present application should not be construed as being more preferred or having more advantages than other embodiments or design solutions. Exactly speaking, using words such as "exemplary" or "for example" aims to present relevant concepts in a specific manner. The terms "first" and "second" are only used for descriptive purposes and cannot be understood as indicating or implying relative importance or implicitly specifying the quantity of the indicated technical features. Thus, features defined with "first" and "second" may explicitly or implicitly include one or more of such features. In the description of the present application, unless otherwise specified, the meaning of "plurality" is two or more.

[0040] Next, the technical terms related to the embodiments of the present application will be described.

[0041] 1. Round Robin (RR): In a polling cycle, all ports (requestors, users) are given equal access opportunities.

[0042] 2. Weighted Round Robin (WRR): In a polling cycle, ports with different weights will get different numbers of accesses.

[0043] 3. Weighting: That is, each port has an occupancy ratio, and access opportunities are obtained according to the occupancy ratio.

[0044] 4. Polling cycle: In the polling mechanism, the time period during which all requesters (ports, users) participating in the polling are considered in a certain order.

[0045] 5. Time slice: The time slice refers to the processing time unit allocated to each port. It determines the length of time each port can occupy system resources when being responded.

[0046] As described in the background technology, the related technology uses pointer control to perform weighted polling arbitration. However, this arbitration method has the problem that when there is a request from the highest weighted ingress port, the system cannot respond in time.

[0047] For example, if there are 4 ports a, b, c, and d, and the corresponding weights are 4, 3, 2, and 1 respectively, it means that for port a, a maximum of 4 access opportunities, or opportunities to be responded to / authorized, can be obtained in one polling cycle. For port b, a maximum of 3 access opportunities, or opportunities to be responded to, can be obtained in one polling cycle, and so on. In a polling cycle, if each port initiates a request, the electronic device arbitrates in the order from a to c. The order of ports that respond in sequence in a polling cycle is as follows: a, a, a, a, b, b, b, c, c, d. In this way, in a polling cycle, each port gets the corresponding number of access opportunities according to its corresponding weight.

[0048] However, when the electronic device sets the pointer to point to port a, if port a does not initiate a request in time at the beginning of the polling cycle, the pointer value will be increased by 1, that is, port a will be skipped and pointed to port b to arbitrate the next port. If there is a request for port b, then in this polling cycle, each subsequent arbitration will be arbitrated according to the position pointed to by the last pointer (that is, port b) as the starting detection position, and the order of the ports that respond in sequence is as follows: b, b, b, c, c, d. That is, in this polling cycle, port a did not initiate a request during the first detection, even if the access opportunity of port a has not been used up, the weight will be reset to zero, that is, port a will no longer be considered in this polling cycle, and can only wait for the next polling cycle. In this way, there is a situation where high-weight ports cannot be responded to in time when requests occur.

[0049] In addition, the arbitration method used in the related technology is based on the time slice arbitration method, which pre-allocates the time slice occupied by each port according to the length of data that the port needs to send. However, this requires additional data processing to determine the time slice size, which will have certain requirements for real-time performance.

[0050] In response to this, an embodiment of the present application provides a request processing method. In entering the current arbitration cycle, this method will detect whether there are request signals on multiple ports at the same time, then select the target port with the highest priority from the ports with request signals for response, and reduce the weight of the first port. In addition, for ports without request signals, reduce the weight of the target port and keep the weights of the remaining ports other than the target port unchanged. Finally, output a target signal to the target circuit to instruct the target circuit to respond to the request signal of the target port. In the above manner, the request situation of each port is judged in each arbitration cycle. If a port has no request, its weight will not be cleared to zero, and it is still judged whether there is a request signal on this port during the next arbitration, thus effectively solving the problem that a port with a high weight cannot be timely responded when a request occurs within a polling cycle. In addition, reducing the priority according to the weight of the target port can avoid the problem that a port with a low priority cannot be responded for a long time, ensuring that each port may be timely responded.

[0051] Reference Figure 1 , which shows a schematic structural diagram of an electronic device to which the request processing method provided by the embodiment of the present application is applied. As Figure 1 shown, the electronic device includes a target circuit, and the target circuit includes a port selection module and a weighted round-robin arbitration module.

[0052] Among them, the port selection module is electrically connected to N ports, and is used to select one of the N ports as an output port for response / authorization (that is, preferentially output the data packet transmitted by this port).

[0053] The weighted round-robin arbitration module is electrically connected to N ports and is also electrically connected to the port selection module. It is used to perform round-robin arbitration on the N ports to select an authorized port from the N ports, and send a target signal (ack) to the port selection module. This target signal is used to indicate the authorized port, so that the selection module selects one of the N ports as an output port according to the confirmation information. Exemplarily, the target signal can be represented by a one-hot code or a Gray code.

[0054] Among them, the weighted round-robin arbitration module includes two sub-modules, namely a weight accumulation module and a round-robin arbitration module. The weight accumulation module is responsible for managing the weight corresponding to each port, and is used to realize the reduction and reset of the weight indication value. The round-robin arbitration module, in accordance with a fixed arbitration method, for multiple ports with request information, determines the port with the highest priority as the authorized port based on the priority of each port.

[0055] In some embodiments, the functions of the port selection module and the weighted round-robin arbitration module can be implemented by the same component, such as integrating their functions on the same micro circuit board. They can also be implemented by different components. For example, the function of the port selection module is implemented by one micro circuit board, and the function of the weighted round-robin arbitration module is implemented by another micro circuit board. The two micro circuit boards cooperate with each other to implement the request processing method provided by the embodiments of the present application.

[0056] The implementation manners of the embodiments of the present application will be described in detail below with reference to the accompanying drawings.

[0057] The request processing method provided by the embodiments of the present application can be executed by the target circuit in the above-mentioned electronic device.

[0058] As Figure 2 shown, the embodiments of the present application provide a request processing method, which includes the following steps:

[0059] S201. In response to entering the current arbitration period, obtain whether there is a request signal at each port among multiple ports of the target circuit.

[0060] Among them, an arbitration period refers to the time period required to determine an authorized port from multiple ports and wait for the authorized port to complete the request execution. The multiple ports correspond to different initial priorities, and different ports are configured with their respective weights (the weights of different ports can be the same or different). The weight is used to indicate the maximum number of times a port is continuously responded to within multiple arbitration periods.

[0061] In some embodiments, the initial priorities of each port can be pre-configured. The initial weights of each port can be pre-configured and determined according to the importance level. The higher the importance level of a port, the greater the configured weight, so as to ensure that the port with the highest importance level has the highest authorization probability, and the port with the lowest importance level has the lowest arbitration right probability.

[0062] Exemplarily, there are 4 ports, a, b, c, d, where a has the highest priority and is configured with a weight of 4, followed by b with a weight of 3, c with a weight of 2, and d with a weight of 1. Each port does not initiate requests continuously. After receiving an arbitration response, it waits for a period of time to process before initiating the next request.

[0063] In some embodiments, as Figure 3 shown, the above S201 can be specifically implemented as:

[0064] S2011. Obtain a first array from the target circuit, where the first array includes multiple elements.

[0065] Among them, the bit order of each element is used to represent the port identifier of the corresponding port, and the value of the element is used to represent whether there is a request signal at the corresponding port.

[0066] That is, a value can be initialized to store the port identifiers (port numbers) of multiple ports, wherein one array element (element) in the array corresponds to one port identifier, and the address of the array corresponds to the port number by default.

[0067] In some embodiments, the target circuit can concatenate the request signals of multiple ports into an N-bit combined signal (req_chno), where N is equal to the number of multiple ports. The value of each bit in the combined signal indicates whether the corresponding port has a request signal req_chno[i]=req[A[i]].

[0068] In combination with the above example, a one-dimensional array A can be initialized with a length of 4, where A[0] stores the port number of port a, A[1] stores the port number of port b, and so on.

[0069] S2012. Determine whether there is a request signal at each port according to the bit sequence and value of each element in the first array.

[0070] Combined with the above example, if the port a corresponding to the first element in the number A initiates a request, the first bit of the merged signal is 1. If the corresponding port a does not initiate a request, the first bit of the merged signal is 0. For example, among the four ports abcd, there are request signals for ports a and c, but there are no request signals for ports b and d, then the merged signal can be expressed as: req_chno = [1, 0, 1, 0].

[0071] In some embodiments, the plurality of elements in the first array are arranged according to the priorities of the plurality of ports, so that the first array can also indicate the priority of each port.

[0072] That is to say, the priority of a port is associated with the position of the port number in the array. For example, the port corresponding to the highest (leftmost) array element has the highest priority, and the port corresponding to the lowest (rightmost) array element has the lowest priority.

[0073] S202. For ports with request signals, determine the port with the highest priority as the target port according to the priority of the port, reduce the weight of the target port and keep the weights of the remaining ports unchanged, and when the weight of the target port is reduced to a threshold condition, reduce the priority of the target port.

[0074] S203: Output a target signal to a target circuit.

[0075] The target signal is used to instruct the target circuit to respond to the request signal of the target port.

[0076] In the embodiment of the present application, when the target circuit determines which ports have request signals through port detection, a fixed arbitration method can be used to determine the target port from the request signals based on a pre-configured priority, and then authorize the target port (i.e., instruct the target circuit to select the request signal of the target port for processing). In addition, since the target port is authorized during this arbitration cycle, the weight of the target port is reduced.

[0077] In addition, it should be noted that in each arbitration cycle, in the related art, if a port is detected to have no request signal, its weight is reset to zero, and a pointer is set to point to the next port. That is, other arbitration processes performed subsequently in this round of polling cycle will skip the port without the request signal. In the embodiment of the present application, for other ports (including ports without request signals and short-term ports that are not authorized), the weight is kept unchanged. In this way, even if the port is skipped in the current arbitration cycle, at the beginning of the next arbitration cycle, each port will still be detected to have a request signal and an available number of accesses (weight). If the skipped port initiates a request in the next arbitration cycle, it may still be authorized.

[0078] It can be seen that compared with the solution in the related art that a high-priority port does not initiate a request in time and the subsequent arbitration cycle will skip the port, the request processing method provided in the embodiment of the present application can consider the situation of each port in each arbitration cycle to ensure the rationality of the arbitration, thereby effectively avoiding the situation in the related art that a high-priority port cannot receive a timely response.

[0079] In some embodiments, the initial weight configured for each port is used to indicate the maximum number of times the port is responded to while keeping the priority unchanged.

[0080] For example, if the initial weight of a port is 4, the port can obtain 4 responses under a fixed priority in multiple arbitration cycles.

[0081] In some embodiments, reducing the weight of the target port refers to reducing the value indicated by the current weight of the target port by 1.

[0082] For example, in combination with the above example, there are 4 ports, a, b, c, and d, and the priority is that port a has the highest priority, port b has the second highest priority, and port d has the lowest priority. If port a has a request signal, it is determined to be the first port to be authorized, and the weight of port a is reduced, for example, from 4 to 3. If port a does not have a request signal, it is determined whether port b of the second highest priority has a request signal, and so on.

[0083] It should be noted that in the related art, there is a way of using fixed-priority arbitration, that is, strictly following the principle of authorizing the high-priority first and the low-priority later. However, if there are always requests from high-priority ports, it may cause low-priority ports not to be able to get a response for a long time. For this problem, the request processing method of the embodiment of the present application can reduce the priority of the target port when the weight of the target port is reduced to a threshold condition.

[0084] Specifically, when the weight of the target port is reduced to a threshold condition, the step of reducing the priority of the target port can be implemented as follows: when the value indicated by the weight of the target port is reduced to zero, set the priority of the target port to the lowest, and update the priorities of other ports.

[0085] That is to say, when the target port has been authorized multiple times and its weight is cleared to zero, it means that the allocated access times have been used up, so its priority is adjusted to the lowest to solve the situation where a high-priority port occupies the request resources for a long time and other low-priority ports cannot be authorized for a long time. Correspondingly, since the priority of one port among multiple ports has changed, the priorities of other ports also need to be updated.

[0086] Specifically, updating the priorities of other ports includes: for ports with priorities higher than the initial priority of the target port, keep the priorities unchanged; for ports with priorities lower than the initial priority of the target port, increase the priorities.

[0087] Among them, the initial priority mentioned here refers to the priority of the target port before its priority is adjusted to the lowest.

[0088] For example, for the four ports a, b, c, and d, the priorities from left to right are from high to low. If the weight of b is cleared to zero, the priority of b is adjusted to the lowest. The priority of a is higher than the initial priority of b, so it remains unchanged. The priorities of c and d are lower than the initial priority of b, so they increase, and the increased priorities still maintain the order of c > d. Therefore, after adjustment, the priorities of each port from largest to smallest are: a, c, d, b.

[0089] In some embodiments, when the weight of the target port is reduced to zero, reset the weight of the target port. The reset here means setting the weight of the target port to the weight of the initial configuration. For example, if the initial configured weight of port a is 4, then when the weight of port a becomes 0, reset its weight to 4. Through the above steps, the continuous execution of the request processing method provided by the present application can be ensured.

[0090] For example, Figure 4A schematic diagram of an arbitration scenario provided by an embodiment of the present application. Taking four ports a, b, c, and d with weights of 4, 3, 2, and 1 respectively as an example. The upper part of the figure shows whether there are request signals at the four ports a, b, c, and d in each arbitration cycle. Figure 3 Taking the case where there are request signals (with a value of 1) at each port in each arbitration cycle as an example. The lower part shows the arbitration response determined in each arbitration cycle (i.e., the port number of the authorized output).

[0091] In the first arbitration, a gets the response (remaining weight 3); in the second arbitration, a gets the response (remaining weight 2); in the third arbitration, a gets the response (remaining weight 1); in the fourth arbitration, a gets the response (remaining weight 0, weight updated to 4, priority becomes the lowest); in the fifth arbitration, b gets the response (remaining weight 2); in the sixth arbitration, b gets the response (remaining weight 1); in the seventh arbitration, b gets the response (remaining weight 0, weight updated to 3, priority becomes the lowest); in the eighth arbitration, c gets the response (remaining weight 1); in the ninth arbitration, c gets the response (remaining weight 0, weight updated to 2, priority becomes the lowest); in the tenth arbitration, d gets the response (remaining weight 0, weight updated to 1, priority becomes the lowest).

[0092] That is to say, within a polling cycle, ten arbitrations are carried out, and the authorized port numbers are aaaabbbccd in sequence.

[0093] For another example, Figure 5 A schematic diagram of another arbitration scenario provided by an embodiment of the present application. Taking four ports a, b, c, and d with weights of 4, 3, 2, and 1 respectively as an example. The upper part of the figure shows whether there are request signals at the four ports a, b, c, and d in each arbitration cycle. A corresponding bit taking 0 indicates that there is no request signal at the port, and a corresponding bit taking 1 indicates that there is a request signal at the corresponding port. The lower part shows the arbitration response determined in each arbitration cycle (i.e., the port number of the authorized output).

[0094] The first arbitration request is bcd, and b gets the response (remaining weight 2); the second arbitration request is abcd, and a gets the response (remaining weight 3); the third arbitration request is bcd, and b gets the response (remaining weight 1); the fourth arbitration request is abcd, and a gets the response (remaining weight 2); the fifth arbitration request is bcd, and b gets the response (remaining weight 0, weight updated to 3, priority becomes the lowest); the sixth arbitration request is abcd, and a gets the response (remaining weight 1); the seventh arbitration request is bcd, and c gets the response (remaining weight 1); the eighth arbitration request is abcd, and a gets the response (remaining weight 0, weight updated to 4, priority becomes the lowest); the ninth arbitration request is bcd, and c gets the response (remaining weight 0, weight updated to 2, priority becomes the lowest); the tenth arbitration request is abcd, and d gets the response (remaining weight 0, weight updated to 1, priority becomes the lowest); at this time, the cumulative weight values of all ports are 0, and the polling cycle ends.

[0095] Through the above arbitration scheme, regardless of the request method, the finally achieved arbitration probability strictly follows the configured weight information. Figure 4 and Figure 5 The arbitration probabilities of the request methods are shown in Table 1.

[0096] Table 1

[0097] Port a b c d Probability 4 / 10 3 / 10 2 / 10 1 / 10

[0098] Figure 6 It is a flowchart of an arbitration scheme provided by an embodiment of the present application. As Figure 6 shown, first, 1. Configure the weights of each port according to the priorities of each port. 2. Initialize a one-dimensional array (the array elements are port numbers, and the address of the array defaults to the port number). 3. Receive the request signals of multiple ports. 4. Use a multi-bit combined signal to represent the requests of each port in the array. 5. Perform fixed-priority arbitration on the combined signal to obtain a one-hot code. 6. Convert the one-hot code into a binary number to obtain the address of the array element that gets authorized. 7. Output the array element corresponding to this address to obtain the arbitration result (indicating the authorized port). 8. Port authorization. After step 7, it also includes process 9. Subtract 1 from the weight corresponding to the arbitration result. 10. Determine whether the weight is 0. If so, move the corresponding element to the 0th position (the lowest priority position) of the array, and return to step 4 for looping. If not, return to step 4 for looping.

[0099] The technical solution of the embodiment of the present application at least brings the following beneficial effects: The embodiment of the present application provides a request processing method. In entering the current arbitration cycle, this method will detect whether there are request signals on multiple ports at the same time, and then select the target port with the highest priority from the ports with request signals for response, and reduce the weight of the first port. In addition, for the ports without request signals, reduce the weight of the target port and keep the weights of the remaining ports other than the target port unchanged. Finally, output a target signal to the target circuit to instruct the target circuit to respond to the request signal of the target port. Through the above method, the request situation of each port will be judged in each arbitration cycle. If a port has no request, its weight will not be cleared, and whether there is a request signal on this port will still be judged during the next arbitration, thus effectively solving the problem that a port with a high weight cannot be responded to in time when a request appears within a polling cycle. In addition, reducing the priority according to the weight of the target port can avoid the problem that a port with a low priority cannot be responded to for a long time, and ensure that each port can be responded to in time.

[0100] The above mainly introduces the solution provided by the embodiment of the present application from the perspective of the method. To implement the above functions, it includes the corresponding hardware structure and / or software module for executing each function. Those skilled in the art should easily realize that, combining the units and algorithm steps of each example described in the embodiments disclosed herein, the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a certain function is executed in the way of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered to exceed the scope of the present application.

[0101] As Figure 7 shown, the embodiment of the present application also provides a request processing device for the request processing method shown in the above method embodiment. The request processing device 700 includes: an acquisition module 701, a determination module 702, and an output module 703.

[0102] The acquisition module 701 is used to acquire whether there is a request signal on each port among multiple ports of the target circuit in response to entering the current arbitration cycle;

[0103] The determination module 702 is used to, for the ports with request signals, determine the port with the highest priority as the target port according to the priority of the ports, and reduce the weight of the target port and keep the weights of the remaining ports other than the target port unchanged, and when the weight of the target port is reduced to the threshold condition, reduce the priority of the target port;

[0104] The output module 703 is configured to output a target signal to a target circuit, and the target signal is used to instruct the target circuit to respond to a request signal of a target port.

[0105] In some embodiments, the initial weight configured for each port is used to represent the maximum number of times the port can be responded to while maintaining the priority unchanged.

[0106] In some embodiments, the determining module 702 is specifically configured to subtract 1 from the value indicated by the current weight of the target port.

[0107] In some embodiments, the determining module 702 is specifically configured to, when the value indicated by the weight of the target port is reduced to zero, set the priority of the target port to the lowest and update the priorities of other ports.

[0108] In some embodiments, the determining module 702 is specifically configured to keep the priority unchanged for ports with a priority higher than the initial priority of the target port, and increase the priority for ports with a priority lower than the initial priority of the target port.

[0109] In some embodiments, the determining module 702 is further configured to reset the weight of the target port when the weight of the target port is reduced to zero.

[0110] In some embodiments, the multiple elements in the first array are arranged according to the priorities of multiple ports, so that the first array can also represent the priorities of each port.

[0111] Another embodiment of the present application further provides an electronic device, as Figure 8 shown, the electronic device 800 includes a memory 801 and a processor 802; the memory 801 and the processor 802 are coupled; the memory 801 is used to store computer program code, and the computer program code includes computer instructions. Wherein, when the processor 802 executes the computer instructions, the electronic device 800 is caused to execute each step performed by the electronic device in the method flow shown in the above method embodiments.

[0112] In actual implementation, the obtaining module 701, the determining module 702, and the output module 703 can be Figure 8 implemented by the processor 802 shown in calling the computer program code in the memory 801. The specific execution process can refer to the description in the above access control method section, and will not be elaborated here.

[0113] Another embodiment of the present application further provides a computer-readable storage medium, in which computer instructions are stored. When the computer instructions run on an electronic device, the electronic device is caused to execute each step performed by the electronic device in the method flow shown in the above method embodiments.

[0114] In another embodiment of the present application, a computer program product is further provided. The computer program product includes computer instructions. When the computer instructions run on an electronic device, the electronic device is caused to execute each step performed by the electronic device in the method flow shown in the above method embodiment.

[0115] In the above embodiment, it can be implemented in whole or in part by software, hardware, firmware, or any combination thereof. When implemented using a software program, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer execution instructions are loaded and executed on a computer, the processes or functions according to the embodiments of the present application are generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center by wire (such as coaxial cable, optical fiber, digital subscriber line (DSL)) or wirelessly (such as infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium accessible by a computer or a data storage device such as a server or data center that includes one or more integrated media. The available medium can be a magnetic medium (such as a floppy disk, hard disk, magnetic tape), an optical medium (such as a DVD), etc.

[0116] The above is only the specific implementation manner of the present application. Those skilled in the art of the present technology can think of changes or substitutions according to the specific implementation manner provided by the present application, and all should be covered within the protection scope of the present application.

Claims

1. A request processing method, characterized in that: The method comprises: In response to entering the current arbitration cycle, obtaining whether a request signal exists at each of the plurality of ports of the target circuit; For the ports having request signals, according to the priorities of the ports, determining the port with the highest priority as the target port, reducing the weight of the target port and keeping the weights of the remaining ports other than the target port unchanged, and reducing the priority of the target port when the weight of the target port is reduced to a threshold condition; A target signal is output to the target circuit, wherein the target signal is used to instruct the target circuit to respond to the request signal of the target port.

2. The request processing method according to claim 1, characterized in that: The initial weight configured for each of the ports is used to indicate the maximum number of times the port can be responded to while keeping the priority unchanged.

3. The request processing method according to claim 1, characterized in that: The step of reducing the weight of the target port comprises: The value of the current weight indicator of the target port is reduced by 1.

4. The request processing method according to claim 1, characterized in that: When the weight of the target port is reduced to a threshold condition, reducing the priority of the target port includes: When the value indicated by the weight of the target port decreases to zero, the priority of the target port is set to the lowest, and the priorities of other ports are updated.

5. The request processing method according to claim 4, characterized in that: The updating of the priorities of other ports includes: For a port having a priority higher than the initial priority of the target port, keeping the priority unchanged; For ports with a priority lower than the initial priority of the target port, the priority is increased.

6. The request processing method according to claim 4, characterized in that: The method further comprises: In case the weight of the target port decreases to zero, the weight of the target port is reset.

7. The request processing method according to claim 1, characterized in that: In response to entering the current arbitration cycle, obtaining whether a request signal exists at each of the multiple ports of the target circuit includes: Acquire a first array from the target circuit, the first array comprising a plurality of elements, the bit sequence of each element being used to indicate a port identifier of a corresponding port, and the value of the element being used to indicate whether a request signal exists at the corresponding port; Determine whether a request signal exists at each of the ports according to the bit sequence and value of each element in the first array.

8. The request processing method according to claim 7, characterized in that: The multiple elements in the first array are arranged according to the priorities of the multiple ports, so that the first array can also represent the priority of each port.

9. A request processing device, characterized in that: It includes an acquisition module, a determination module and an output module; The acquisition module is used to obtain, in response to entering the current arbitration cycle, whether a request signal exists at each of the multiple ports of the target circuit; The determination module is used to, for the port having the request signal, determine the port with the highest priority as the target port according to the priority of the port, reduce the weight of the target port and keep the weights of the remaining ports other than the target port unchanged, and reduce the priority of the target port when the weight of the target port is reduced to a threshold condition; The output module is used to output a target signal to the target circuit, where the target signal is used to instruct the target circuit to respond to the request signal of the target port.

10. The device according to claim 9, characterized in that The initial weight configured for each port is used to indicate the maximum number of times the port is responded to while keeping the priority unchanged; The determination module is specifically configured to reduce the value of the current weight indication of the target port by 1; The determination module is specifically configured to, when the value of the weight indication of the target port decreases to zero, set the priority of the target port to the lowest and update the priorities of other ports; The determination module is specifically configured to keep the priority of a port having a higher priority than the initial priority of the target port unchanged; and increase the priority of a port having a lower priority than the initial priority of the target port; The determining module is further configured to reset the weight of the target port when the weight of the target port decreases to zero; The acquisition module is specifically used to acquire a first array from the target circuit, the first array comprising a plurality of elements, the bit sequence of each element being used to indicate a port identifier of a corresponding port, and the value of the element being used to indicate whether a request signal exists at the corresponding port; and determining whether a request signal exists at each port according to the bit sequence and value of each element in the first array; The multiple elements in the first array are arranged according to the priorities of the multiple ports, so that the first array can also represent the priority of each port.