A Rate Control Method for Data Transmission, an Electronic Device, and a Storage Medium

Through the N-level sliding window mechanism and sliding window configuration of different lengths, the transmission rate of data requests is controlled, which solves the problem of blockage caused by uneven data requests in the on-chip bus connection, and realizes the matching of data requests and return rates.

CN120123273BActive Publication Date: 2025-07-25METAX INTEGRATED CIRCUITS (SHANGHAI) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510608858.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-05-13
Publication Date
2025-07-25
Estimated Expiration
2045-05-13

AI Technical Summary

Technical Problem

Between the on-chip bus connection request module and the storage system, due to the interface bandwidth limitation, the transmission rate of data requests is uneven, resulting in data blockage.

Method used

The N-level sliding window mechanism is adopted to obtain the actual rate q allowed in each clock cycle according to the user's preset rate control ratio r, and configure the maximum constraint threshold th through sliding windows of different lengths, control the data request granularity of each sliding window, and send data requests evenly by superimposing multi-level sliding windows.

Benefits of technology

It realizes uniform transmission of data requests, solves the problem of data congestion caused by excessive granularity of a single sliding window, ensures that the data request matches the return rate, and avoids data blockage.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120123273B_ABST
    Figure CN120123273B_ABST
Patent Text Reader

Abstract

The present invention relates to the field of chip design, and particularly to a method for controlling the data sending rate, an electronic device, and a storage medium. It obtains an N-level sliding window, and according to the rate regulation ratio r preset by the user, obtains the actual rate q allowed within each clock cycle desired by the user, converts q into a binary number; and sequentially allocates the preset bits of the binary number to each level of the sliding window in win to obtain the maximum constraint threshold th of the data length; obtains the data request to be sent by the request module in the kth clock cycle and the data length to be retrieved by the request; before the data request to be sent is issued, sequentially checks the cumulative data length requested by each level of the sliding window in win in the previous k-1 clock cycles to determine whether each level of the sliding window meets the sending condition. If it meets the condition, the data request to be sent is issued from the current level of the sliding window. Otherwise, it checks the next level of the sliding window, solving the problem of data congestion.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of chip design, and particularly to a method for controlling the rate of data transmission, an electronic device, and a storage medium. Background Art

[0002] The on-chip bus connects multiple request modules (clients). When a client sends a data request (request) to access memory, usually for performance considerations, it tends to send out all data requests as soon as possible. The client sends a data request in each clock cycle, and each data request carries the length of the data to be fetched. Due to the limitation of the interface bandwidth, the data to be fetched for each data request may take multiple clock cycles to return. For example, when the interface width is 256 bit and the length of the data to be fetched for the current data request is 256 byte, the 256 byte of data needs 8 clock cycles to be completely returned. That is, for the data request sent by the client in one clock cycle, the data return of its data request requires 8 clock cycles, which is a situation of data over-issuing. Suppose the client continuously sends 200 data requests. Even if the data can be returned immediately, it takes 1600 clock cycles for the data to be completely returned. At this time, other requests cannot be effectively processed, resulting in data congestion. Similarly, for write requests, if the client continuously sends a large number of data requests for writing data, when the rate of the sent write requests exceeds the processing capacity of the storage system and the storage system cannot process all the received write requests in time, a data congestion phenomenon will occur. Therefore, there is an urgent need for a control method that can reduce data congestion. Summary of the Invention

[0003] In view of the above technical problems, the technical solution adopted by the present invention is: A method for controlling the rate of data transmission, the method includes the following steps:

[0004] Obtain an N-level sliding window win = {win1, win2, …, win i-1 , win i , …, win N}, where win i-1 is the (i - 1)-th level sliding window, win i is the i-th level sliding window, and the value range of i is from 1 to N, and N is greater than or equal to 2; wherein, the window length of win i is greater than the window length of win i-1 .

[0005] Obtain the actual rate q allowed in each clock cycle expected by the user according to the rate regulation ratio r preset by the user, and convert the q into a binary number.

[0006] Assign the preset bits of the binary number to each level of the sliding window in the win in sequence, and obtain the maximum constraint threshold th of the data length according to the preset bits assigned to each level of the sliding window.

[0007] The acquisition request module obtains a data request to be sent in the k-th clock cycle, and the data request includes the length len of the data to be retrieved.

[0008] Before the data request to be sent is issued, sequentially check the cumulative data length requested by each level of the sliding window in the win in the previous k - 1 clock cycles to determine whether each level of the sliding window meets the sending condition. If it meets the condition, the data request to be sent is issued from the current level of the sliding window, and the cumulative data length of the current level of the sliding window is updated to the cumulative data length requested in the previous k clock cycles; otherwise, the data request is not sent, and the next level of the sliding window is checked; wherein, the sending condition for the i-th level of the sliding window is: the cumulative data length cnt i,k-1 is less than the maximum constraint threshold th of the current level of the sliding window i , and the difference between th i and cnt i is greater than or equal to the len.

[0009] In addition, the present invention also provides a non-transitory computer-readable storage medium, in which at least one instruction or at least one program segment is stored, and the at least one instruction or the at least one program segment is loaded and executed by a processor to implement the above method.

[0010] In addition, the present invention also provides an electronic device, including a processor and the above non-transitory computer-readable storage medium.

[0011] The present invention has at least the following beneficial effects:

[0012] The present invention provides a rate control method for data transmission, an electronic device and a storage medium, which control the granularity of sending requests for each level of the sliding window by configuring the maximum constraint thresholds of sliding windows with different lengths. The lower the length of the sliding window, the smaller the control granularity. The sending rate of data requests is controlled by the superposition of sliding windows with different lengths, making the sending of data requests more uniform, and solving the problem of data congestion caused by the overly large granularity of a single sliding window resulting in uneven data transmission. Description of the Drawings

[0013] To more clearly illustrate the technical solutions in the embodiments of the present invention, the following will briefly introduce the accompanying drawings required in the description of the embodiments. Obviously, the accompanying drawings in the following description are only some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other accompanying drawings can be obtained based on these drawings.

[0014] Figure 1 It is a flowchart of a rate control method for data transmission provided by an embodiment of the present invention. Specific embodiments

[0015] The following will clearly and completely describe the technical solutions in the embodiments of the present invention with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, rather than all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts belong to the scope of protection of the present invention.

[0016] Unless otherwise defined, all technical and scientific terms used in the embodiments of the present invention have the same meaning as commonly understood by those of ordinary skill in the art.

[0017] Please refer to Figure 1 , which shows a flowchart of a rate control method for data transmission. The method includes the following steps:

[0018] S100, obtain the N-level sliding window win = {win1, win2, …, win i-1 , win i , …, win N}, win i-1 is the (i - 1)-th level sliding window, win i is the i-th level sliding window, and the value range of i is from 1 to N, where N is greater than or equal to 2; among them, the window length of win i is greater than the window length of win i-1 .

[0019] In one embodiment, the value of N is 2, 3, 4, 5, 6, etc. The larger the value of N, the higher the accuracy of rate control that the N-level sliding window can achieve.

[0020] Among them, the window length of the sliding window is a preset data length.

[0021] In one embodiment, when the interface width of the request module is with, and the data length requested by each data request is size, the length ext of the sliding window satisfies: , and ext > size, where M is a multiple of the interface width. When data is returned, one interface-width of data is returned in one clock cycle (cycle), so the amount of data for one interface width is also referred to as one piece of data.

[0022] As an example, when the interface width of the request module is 256 bit, and the data length size = 256 byte requested by each data request, if the length of the sliding window , that is, the length of the sliding window , ext is 4 times that of size. The 256 byte of data requested by each data request is 8 pieces of data, and it takes 8 clock cycles to return. The maximum amount of data requested by the data requests that can be issued within the length of a sliding window is the data with ext as , and it takes 32 clock cycles to return.

[0023] In one embodiment, the window length of win i is a power-of-2 multiple of the window length of win i-1 . In one embodiment, the window length of win i is 4 times or 8 times the window length of win i-1 . Other multiple relationships of power-of-2 multiples also fall within the protection scope of the invention.

[0024] In one embodiment, N = 4, the window length of win2 is 4 times that of win1, the window length of win3 is 8 times that of win2, and the window length of win4 is 8 times that of win3. The smaller the multiple relationship between the windows with smaller numbers in the sliding window win is configured, the higher the accuracy of the control rate. The smaller the window length of win1, the more uniform the rate control. The more levels of the sliding window, the better the uniformity of sending data requests for each level of the sliding window.

[0025] S200, obtain the actual rate q allowed within each clock cycle that the user expects according to the rate regulation ratio r preset by the user, and convert the q into a binary number.

[0026] Among them, the rate regulation ratio r is the data sending rate that the user expects.

[0027] Among them, the rate allowed within each clock cycle is represented by an n-bit binary number, and the actual rate q is the value expected by the user.

[0028] In one embodiment, the relationship between r and q satisfies: r = q / f, where 1 / f is the accuracy of the rate accounting for the full speed ratio. That is, 1 / f indicates how fine-grained the actual rate q can approach the full speed. Among them, f is the maximum value of the n-bit binary number.

[0029] As an example, when the value of f is 1024 and r = 0.780273, the value of q is obtained as 799 according to the relationship between r, f, and q, and the binary number corresponding to 799 is 1100011111.

[0030] S300, sequentially allocate the preset bits of the binary number to each level of the sliding window in the win, and obtain the maximum constraint threshold th of the data length according to the preset bits allocated to each level of the sliding window.

[0031] Among them, the method of allocating the preset bits to each level of the sliding window in the win can be to sequentially allocate them to each level of the sliding window in the win according to the arrangement order of the preset bits in the binary number, and the method of allocating them according to other preset allocation rules also falls within the protection scope of the present invention.

[0032] In one embodiment, the step of sequentially allocating the preset bits to each level of the sliding window in the win according to the arrangement order of the preset bits in the binary number is: sequentially allocate the preset bits in the binary number from the high bit to the low bit to each level of the sliding window in the win, or sequentially allocate the preset bits in the binary number from the low bit to the high bit to each level of the sliding window in the win.

[0033] In one embodiment, the win i-1 The length of the allocated preset bits is less than or equal to the length of the preset bits of the win i For example, the win includes 4 levels of sliding windows. The length of the preset bits allocated to win1 is 2, that is, two binary digits; the length of the preset bits allocated to win2 is equal to that of win1; the length of the preset bits allocated to win3 is 3, that is, three binary digits, which is greater than win2; the length of the preset bits allocated to win4 is equal to that of win3. Another example is that the win includes 5 levels of sliding windows, and the lengths of the binary numbers allocated to win1 to win5 are all equal.

[0034] In one embodiment, when the preset bits in the binary number are sequentially allocated to each level of the sliding window in the win from the high bit to the low bit, the win i-1 The length of the allocated preset bits is less than or equal to the length of the preset bits of the win i At this time, the data to be sent can be distributed more evenly. When the preset bits in the binary number are sequentially allocated to each level of the sliding window in the win from the low bit to the high bit, the win i-1 The length of the allocated preset bits is greater than or equal to the length of the preset bits of the win i At this time, the data to be sent can also be distributed more evenly.

[0035] In one embodiment, the steps for obtaining the value of th for each level of sliding window include: supplementing Q zeros at the lower bits of the preset bits allocated for the current level of sliding window to obtain new preset bits, where the value of the new preset bits is the number of pens of the request data, and multiplying the number of pens of the request data by the data length of each pen of data to obtain th; where Q satisfies: Q = log2W1 - T1, where W1 is the window length of win1 and T1 is the length of the preset bits allocated for win1. Here, the value of Q depends on the number of bits of the preset bits and the length of the smallest sliding window, and the maximum constraint threshold th of each level of sliding window is less than the window length of the current level of sliding window, so as to achieve the purpose of constraining the maximum number of pens sent in each sliding window through the preset bits. As an example, when the length of the smallest sliding window is 32 pens of data and the preset bits of this smallest sliding window are two bits, the maximum value of the preset bits of this smallest sliding window is 11, and the value of the corresponding preset quantity at this time is 3. After supplementing three zeros, the value of the new preset bits is 24. That is, under the constraint of the rate constraint ratio preset by the user, a maximum of 24 pens of data are allowed to be sent in the smallest sliding window. It should be noted that the value of the preset quantity cannot be taken as 4. When the value of the preset quantity is taken as 4, 48 pens of data are obtained, which is greater than the length of the smallest sliding window. Another example, if the length of the smallest sliding window is 16 pens of data and the preset bits of this smallest sliding window are two bits, the maximum value of the preset bits of this smallest sliding window is 11, and the value of the corresponding preset quantity at this time is 2. After supplementing two zeros, the value of the new preset bits is 12. That is, under the constraint of the rate constraint ratio preset by the user, a maximum of 12 pens of data are allowed to be sent in the smallest sliding window, achieving the purpose of constraint.

[0036] As an example, taking the arrangement order of the preset bits from the high bit to the low bit in the binary number and allocating them to each level of sliding window in win in turn, and the data length of each data request is 8 pens of data, the length ext of win1 is 32 pens of data, the length of win2 is 4 times that of win1, the length of win3 is 8 times that of win2, the length of win4 is 8 times that of win3, and N = 4 as an example, allocating the binary number 1100011111 to win = {win1, win2, win3, win4} in turn, and allocating "11" to win1, allocating "00" to win2, allocating "011" to win3, and allocating "111" to win4; then after supplementing three zeros to the "11" allocated to win1, it becomes "11000", and its value is 24. Therefore, its maximum constraint threshold The data length of each pen of data; the maximum constraint threshold th2 of win2 is 0; the maximum constraint threshold of win3 The data length of each pen of data; the maximum constraint threshold of win4 The data length of each pen of data.

[0037] S400. The request acquisition module obtains the data request to be sent in the k-th clock cycle. The data request includes the length len of the data to be retrieved.

[0038] Among them, the request module is the module that sends the data request.

[0039] In one implementation, the request module is also called a client and is a hardware module or component connected to the bus. Other types of modules that send data requests also fall within the protection scope of the present invention.

[0040] S500. Before the data request to be sent is issued, sequentially check the cumulative data length requested by each level of the sliding window in win in the previous k - 1 clock cycles to determine whether each level of the sliding window meets the sending condition. If it meets the condition, the data request to be sent is sent from the current level of the sliding window, and the cumulative data length of the current level of the sliding window is updated to the cumulative data length requested in the previous k clock cycles; otherwise, the data request is not sent, and the next level of the sliding window is checked. Among them, the sending condition for the i-th level of the sliding window is: the cumulative data length cnt i,k-1 requested by the i-th level of the sliding window in the previous k - 1 clock cycles is less than the maximum constraint threshold th of the current level of the sliding window i , and the difference between th i and cnt i is greater than or equal to the len.

[0041] Among them, when the data request to be sent is sent from the i-th level of the sliding window, the cumulative data length cnt i,k requested by the i-th level of the sliding window in the previous k clock cycles satisfies: cnt i,k = cnt i,k-1 + len.

[0042] Among them, checking the cumulative data length requested by each level of the sliding window in the previous k - 1 clock cycles means: within the time length of the previous k - 1 clock cycles, the cumulative data length that has been sent within the length of the current level of the sliding window.

[0043] Among them, by superimposing multiple levels of sliding windows with different lengths to determine whether to send the data request to be sent. Each level of sliding window checks whether it meets the sending conditions from different granularities. The lower the length of the sliding window, the smaller the granularity of the check, thereby ensuring the uniformity of the sending of the requested data under the lengths of the sliding windows at different levels. It controls the sending rate of subsequent data requests by counting the cumulative data length sent within the sliding window with the corresponding window length through the sliding window. For read requests, it can make the sending rate of the data request match the data return rate, solving the technical problem of data congestion caused by the fact that the speed of the data requested by the data request is much greater than the data return speed; for write requests, it prevents data from piling up on the path and avoids affecting the transmission of other data, solving the technical problem of data congestion.

[0044] In summary, the present invention provides a method for controlling the data sending rate. It controls the granularity of each level of sliding window to send requests by configuring the maximum constraint threshold of sliding windows with different lengths. The lower the length of the sliding window, the smaller the control granularity. By superimposing sliding windows with different lengths, it controls the sending rate of data requests, making the sending of data requests more uniform, and solving the problem of data congestion caused by the overly large granularity of a single sliding window resulting in uneven data sending.

[0045] An embodiment of the present invention also provides a non-transitory computer-readable storage medium, which can be set in an electronic device to store at least one instruction or at least one segment of a program related to a method for implementing a method in the method embodiment. The at least one instruction or the at least one segment of the program is loaded and executed by the processor to implement the method provided in the above embodiment.

[0046] An embodiment of the present invention also provides an electronic device, including a processor and the aforementioned non-transitory computer-readable storage medium.

[0047] An embodiment of the present invention also provides a computer program product, which includes program code. When the program product runs on an electronic device, the program code is used to cause the electronic device to execute the steps in the method according to various exemplary embodiments of the present invention described above in this specification.

[0048] Those skilled in the art can clearly understand that for the convenience and simplicity of description, only the above-mentioned division of each functional unit and module is used as an example. In actual applications, the above functions can be allocated to different functional units and modules according to needs, that is, the internal structure of the device is divided into different functional units or modules to complete all or part of the functions described above.

[0049] Although some specific embodiments of the present invention have been described in detail by way of examples, those skilled in the art should understand that the above examples are for illustrative purposes only and not for limiting the scope of the present invention. Those skilled in the art should also understand that various modifications can be made to the embodiments without departing from the scope and spirit of the present invention. The scope of the present invention disclosed is defined by the appended claims.

Claims

1. A rate control method for data transmission, characterized in that The method includes the following steps: Obtain the N-level sliding window win = {win1, win2, …, win i-1 , win i , …, win N}, where win i-1 is the (i - 1)-th level sliding window, and win i is the i-th level sliding window, and the value range of i is from 1 to N, where N is greater than or equal to 2; among them, the window length of win i is greater than the window length of win i-1 . Obtain the actual rate q allowed within each clock cycle desired by the user according to the rate regulation ratio r preset by the user, and convert the q into a binary number; wherein, the rate regulation ratio r is the data transmission rate desired by the user. Sequentially assign the preset bits of the binary number to each stage of the sliding window in the win, and obtain the maximum constraint threshold th of the data length according to the preset bits assigned to each stage of the sliding window. Obtain the data request to be sent by the request module in the k-th clock cycle, and the data request includes the data length len to be read or written. Before the data request to be sent is issued, sequentially check the cumulative data lengths requested by each level of sliding window in win in the previous k - 1 clock cycles to determine whether each level of sliding window meets the sending condition. If it meets the condition, the data request to be sent is issued from the sliding window of the current level, and the cumulative data length of the sliding window of the current level is updated to the cumulative data length requested in the previous k clock cycles; otherwise, the data request is not sent, and the next level of sliding window is checked; where the sending condition for the i-th level of sliding window is: the cumulative data length cnt i,k-1 is less than the maximum constraint threshold th of the sliding window of the current level i , and the difference between th i and cnt i is greater than or equal to the len.

2. The method according to claim 1, wherein The relationship between r and q satisfies: r = q / f, where 1 / f is the accuracy of the rate ratio to the full speed.

3. The method according to claim 1, wherein The step of sequentially assigning the preset bits in the binary number to each stage of the sliding window in the win is: assign the preset bits in the binary number in the order from high to low to each stage of the sliding window in the win, or assign the preset bits in the binary number in the order from low to high to each stage of the sliding window in the win.

4. The method according to claim 3, wherein The said win i-1 The length of the allocated preset bit is less than or equal to the length of the preset bit of win i of the preset bit.

5. The method according to claim 1, wherein When the preset bits are sequentially assigned to each level of the sliding window in win in the order from the high bit to the low bit in the binary number, the win i-1 The length of the assigned preset bits is less than or equal to the length of the preset bits of win i When the preset bits are sequentially assigned to each level of the sliding window in win in the order from the low bit to the high bit in the binary number, the win i-1 The length of the assigned preset bits is greater than or equal to the length of the preset bits of win i The length of the preset bits.

6. The method according to claim 5, characterized in that, The step of obtaining the value of th for each stage of the sliding window includes: supplement Q zeros at the low position of the preset bits assigned to the current stage of the sliding window to obtain new preset bits, the value of the new preset bits is the number of pens of the requested data, and multiply the number of pens of the requested data by the data length of each pen to obtain the th; where Q satisfies: Q = log2W1 - T1, where W1 is the window length of win1 and T1 is the length of the preset bits assigned to win1.

7. The method according to claim 1, wherein The window of i win has a length that is a power of 2 times the window length of i-1 win.

8. The method according to claim 1, characterized in that, When the interface width of the request module is with and the data length requested by each data request is size, the length ext of the sliding window satisfies: ext = with * M, and ext > size, where M is a multiple of the interface width.

9. A non-transitory computer-readable storage medium storing at least one instruction or at least one program segment, characterized in that, The at least one instruction or the at least one program is loaded and executed by a processor to implement the method according to any one of claims 1-8.

10. An electronic device, characterized in that, It includes a processor and the non-transitory computer-readable storage medium described in claim 9.

Citation Information

Patent Citations

  • Routing method and system for on-chip bus

    CN112486871A

  • Traffic control method and device, electronic equipment and readable storage medium

    CN117376257A