Data scheduling method, electronic device, and storage medium

By constructing a scheduling matrix and filtering operations, combined with cache unit management, the problems of contention and transmission blockage caused by concurrent access of multiple modules within the chip were solved, achieving conflict-free concurrent data output and improving the throughput efficiency of the data path.

CN123157633APending Publication Date: 2026-11-24SANECHIPS TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611174018.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-04
Publication Date
2026-11-24

AI Technical Summary

Technical Problem

Concurrent access to multiple modules within the chip causes contention and transmission blockage issues, resulting in low data throughput efficiency.

Method used

By constructing a scheduling matrix and combining filtering operations and caching units, conflict-free concurrent output of multiple data streams can be achieved.

Benefits of technology

It effectively avoids the risk of multiple data streams competing for the same downstream functional module, prevents transmission blockage, and improves the throughput efficiency of the data path.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123157633A_ABST
    Figure CN123157633A_ABST
Patent Text Reader

Abstract

This disclosure provides a data scheduling method, electronic device, and storage medium to solve the contention and transmission blocking problems caused by concurrent access of multiple modules within a chip. The solution includes: reading multiple data items to be scheduled from a cache unit within the chip, and constructing a scheduling matrix with the source end of each data item as the first dimension and the destination end as the second dimension; wherein the source end is an upstream functional module, the destination end is a downstream functional module, and the matrix elements represent the data items to be scheduled that exist between the corresponding source and destination ends. A filtering operation is iteratively performed on the scheduling matrix to obtain a scheduling result set composed of the filtering results of each round; in each round of filtering, a target element is selected from the unfiltered first dimension, its source-destination pairing relationship is included in the scheduling result set, and the destination end is masked to prevent subsequent rounds from selecting that destination end. Based on the scheduling result set, the corresponding data items to be scheduled are read from the cache unit and output to the downstream functional module.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This disclosure relates to the field of chip technology, and in particular to a data scheduling method, electronic device, and storage medium. Background Technology

[0002] A chip integrates multiple functional modules, such as a processor core, memory controller, arithmetic unit, and input / output interfaces. Different modules play different roles in data transmission: the party initiating the data transmission request is called the master, such as the processor core; the party receiving data and responding to the request is called the slave, such as the memory controller. These master and slave devices are connected through a dedicated interconnect structure for unified management of the interaction and transmission of address, data, and control information between the modules.

[0003] When multiple master devices and multiple slave devices are connected to an interconnect structure, two different conflict scenarios arise: one is access contention, where multiple master devices simultaneously initiate data transmission requests to the same slave device, leading to access conflicts on the slave device side; the other is response conflicts, where multiple slave devices return response signals to the same master device at the same time due to differences in response latency, leading to reception conflicts on the master device side. Both of these conflict scenarios inevitably cause arbitration waiting and transmission blockage, severely restricting the throughput efficiency of the chip's internal data path. Summary of the Invention

[0004] This disclosure provides a data scheduling method, an electronic device, and a storage medium to solve the problems of contention and transmission blocking caused by concurrent access from multiple modules within a chip. Accordingly, the technical solution of this disclosure is as follows: In a first aspect, embodiments of this disclosure provide a data scheduling method applied to a chip, including: Multiple data sets to be scheduled are read from the cache unit inside the chip, and a scheduling matrix is ​​constructed with the source end of the data set as the first dimension and the destination end as the second dimension. The source end is an upstream functional module inside the chip, and the destination end is a downstream functional module inside the chip. Elements in the scheduling matrix represent the data sets to be scheduled that exist between the corresponding source and destination ends. The cache unit is used to cache the data sets to be scheduled that are output by the upstream functional module and intended to be sent to the downstream functional module. The scheduling matrix is ​​iteratively filtered to obtain a scheduling result set consisting of elements selected in each round of filtering. The filtering operation includes: selecting a target element from the elements corresponding to the dimension values ​​of the unfiltered first dimension, so that the pairing relationship between the source and destination represented by the target element is included as a scheduling result in the scheduling result set, and applying a mask to the dimension value corresponding to the target element in the second dimension so that subsequent filtering operations prohibit filtering the elements corresponding to the masked dimension values. Based on the scheduling result set, the corresponding data to be scheduled is read from the cache unit and output to the downstream functional module.

[0005] In a second aspect, embodiments of this disclosure provide an electronic device, including a processor; and a memory configured to store computer-executable instructions, which, when executed, cause the processor to perform the method described in the first aspect.

[0006] Thirdly, embodiments of this disclosure provide a computer-readable storage medium for storing computer-executable instructions that, when executed by a processor, implement the method described in the first aspect.

[0007] The disclosed scheme first reads multiple data to be scheduled from an internal cache unit of the chip. This cache unit temporarily stores the data to be scheduled, output by the upstream functional module and intended for the downstream functional module. Then, a scheduling matrix is ​​constructed with the source (i.e., the upstream functional module) of each data to be scheduled as the first dimension and the destination (i.e., the downstream functional module) as the second dimension. Elements in the scheduling matrix represent the data to be scheduled between the corresponding source and destination. This matrix allows for the structured organization of multiple data streams according to their source and destination. Based on this, a filtering operation is iteratively performed on the scheduling matrix to generate a scheduling result set consisting of elements obtained from each round of filtering. Each round of filtering specifically includes: selecting a target element within the range of values ​​in the first dimension that were not filtered; including the source-destination pairing relationship corresponding to this target element in the scheduling result set; and simultaneously masking the corresponding value of the target element in the second dimension to ensure that no element under that dimension value is selected in subsequent rounds. Since the selected destination is masked after each round of filtering, the risk of multiple data streams competing for the same downstream functional module is effectively avoided. Finally, the corresponding data is read from the cache unit based on the scheduling result set and output to the downstream functional module. Through the above methods, conflict-free concurrent output of multiple data streams to different destinations is achieved. At the same time, the upstream data is quickly released by relying on the caching unit, avoiding the upstream functional modules from being suspended for a long time waiting for arbitration. The bottlenecks caused by interconnection structure competition and transmission blockage are eliminated in collaboration from the two levels of data caching and scheduling filtering. Attached Figure Description

[0008] To more clearly illustrate the technical solutions in the embodiments of this disclosure 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 recorded in the embodiments of this disclosure. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0009] Figure 1 This is a flowchart illustrating the data scheduling method according to an embodiment of the present disclosure; Figure 2 This is a schematic diagram of the scheduling matrix according to an embodiment of the present disclosure; Figure 3 This is a schematic diagram of the pipeline scheduling timing according to an embodiment of the present disclosure; Figure 4 This is a schematic diagram of the cache partition address management structure according to an embodiment of the present disclosure; Figure 5 This is a schematic diagram of the chip structure according to an embodiment of the present disclosure; Figure 6 This is a schematic diagram of the structure of an electronic device according to an embodiment of the present disclosure. Detailed Implementation

[0010] To enable those skilled in the art to better understand the technical solutions in this specification, the technical solutions in the embodiments of this disclosure will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this specification, and not all embodiments. Based on the embodiments in this specification, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of this specification.

[0011] As mentioned earlier, the integrated processor core, memory controller, and other functional modules within the chip are divided into master devices that initiate requests and slave devices that respond to requests, based on their transmission roles. These two devices interact with each other through an interconnect structure to exchange address, data, and control information. However, multi-master, multi-slave architectures are prone to two types of conflicts: one is access contention caused by multiple master devices simultaneously initiating data transmission requests to the same slave device; the other is response conflict caused by multiple slave devices returning response signals to the same master device at the same time due to differences in response latency. Both types of conflicts lead to arbitration waiting and transmission blockage, severely restricting the throughput efficiency of the data path. In view of this, this disclosure provides a data scheduling method to solve the aforementioned problems in the prior art. The technical solutions provided by the various embodiments of this disclosure will be described in detail below with reference to the accompanying drawings.

[0012] This disclosure provides a data scheduling method applicable to various types of chips, such as system-on-a-chip (SoC), artificial intelligence chips, general-purpose computing chips, dedicated computing chips, network processor chips, and communication baseband processing chips. Figure 1 This is a flowchart illustrating the data scheduling method of this embodiment, which specifically includes the following steps: S101: Read multiple data to be scheduled from the cache unit inside the chip, and construct a scheduling matrix for multiple data to be scheduled, with the source end of the data to be scheduled as the first dimension and the destination end as the second dimension; where the source end is the upstream functional module inside the chip and the destination end is the downstream functional module inside the chip; the elements in the scheduling matrix represent the data to be scheduled that exists between the corresponding source end and the destination end; the cache unit is used to cache the data to be scheduled output by the upstream functional module and intended to be sent to the downstream functional module.

[0013] In this embodiment, the chip's internal cache unit first reads multiple data items to be scheduled. These data items refer to data output by upstream functional modules within the chip and intended for transmission to downstream functional modules, such as write request data from the processor core, intermediate calculation results generated by the arithmetic unit, or input data received from external interfaces. Without proper scheduling and management of this data, simultaneous data transmission from multiple upstream functional modules to downstream functional modules can easily lead to contention at the destination, causing transmission congestion. Therefore, in this embodiment, the data is temporarily stored in the cache unit before entering the scheduling process. This cache unit is used to buffer the data items output by upstream functional modules and intended for transmission to downstream functional modules. The function of the cache unit is to quickly receive and temporarily store this data when multiple upstream functional modules initiate data transmission simultaneously, thereby releasing the transmission channels of the upstream functional modules and preventing them from being suspended for extended periods while waiting for arbitration results.

[0014] To improve the write efficiency and resource utilization of the cache unit, the cache unit in this embodiment includes multiple cache partitions. When an upstream functional module needs to write data to the cache unit, it initiates a write request, which carries the data to be scheduled and its corresponding destination information. This embodiment receives write requests from at least one upstream functional module and, based on the priority of the upstream interface corresponding to each write request and the storage occupancy status of each of the multiple cache partitions, selects the target write request that is allowed to perform the write operation from all write requests. The introduction of interface priority is to ensure that each upstream functional module can obtain an equal write opportunity, avoiding some high-priority modules continuously occupying cache resources and causing other modules to be unable to write for a long time; while the consideration of storage occupancy status is to prevent data from being written to a cache partition that is close to full, thereby causing overflow or blocking.

[0015] In the specific implementation, the above-mentioned method for determining the target write request is as follows: For the x-th upstream interface, the interface must meet two conditions simultaneously to be authorized: firstly, the interface itself has a write request; secondly, the number of requests from other interfaces with a priority higher than or equal to the x-th interface among all upstream interfaces with write requests is less than the number of currently free cache partitions. This determination logic checks each upstream interface with a write request in turn, and counts the number of requests with a priority higher than the x-th interface among all upstream interfaces with write requests. If this number is less than the number of currently free cache partitions, the interface is authorized, and its write request is allowed to execute the write operation; otherwise, the interface is not authorized, and its write request is blocked in this round of selection. Through the above determination method, when multiple upstream interfaces initiate write requests simultaneously, appropriate write requests can be selected and authorized based on the priority of each interface and the current free status of the cache partitions. This ensures the write needs of high-priority interfaces while avoiding write failures due to full cache partitions.

[0016] After determining the target write request, a load balancing strategy across multiple cache partitions is used to select the target cache partition for caching the data to be scheduled corresponding to the target write request. Specifically, the cache partition with the lowest current storage usage and load is prioritized as the write target. This load balancing strategy effectively avoids excessive differences in data volume between cache partitions, preventing local cache partitions from becoming too full quickly and blocking write requests from upstream modules. Finally, the data to be scheduled corresponding to the target write request is written to the determined target cache partition. Through this mechanism, both interface fairness and cache resource balance are guaranteed at the stage where data enters the cache unit.

[0017] Furthermore, each cache partition includes a data storage unit, a free address queue, and multiple destination address queues. The data storage unit caches the complete content of the data to be scheduled; the free address queue manages the free storage addresses in the data storage unit, i.e., records the currently writable free locations in the data storage unit; each of the destination address queues corresponds to a destination and stores the storage address in the data storage unit for the data to be scheduled that points to the corresponding destination. When the data to be scheduled corresponding to the target write request needs to be written to the target cache partition, a free storage address is first read from the free address queue of the target cache partition. This address indicates the currently available write location in the data storage unit; then, the data to be scheduled is written to the storage location in the data storage unit of the target cache partition corresponding to the free storage address; simultaneously, the free storage address is written to the destination address queue in the target cache partition corresponding to the destination pointed to by the target write request. In this way, when a piece of data is written to the data storage device, its storage address is recorded in the allocation status of the free address queue and the index record of the destination address queue. This allows the subsequent scheduling module to quickly locate and read the corresponding data based on the storage address recorded in the destination address queue after determining the scheduling result, without having to traverse the entire data storage device to search, thus greatly improving the efficiency of data reading.

[0018] Furthermore, after selecting the target write request from all write requests to allow write operations, this embodiment dynamically adjusts the priority of upstream interfaces to prevent the same upstream interface from occupying cache write resources for an extended period. Specifically, the priority of the upstream interface corresponding to the target write request is lowered, reducing its priority in subsequent write contention and thus allowing other upstream interfaces to write opportunities. Simultaneously, the priority of the upstream interfaces corresponding to other write requests (excluding the target write request) is increased, giving them higher write priority in subsequent contention. Through this dynamic adjustment mechanism, the priority of each upstream interface changes in real time as the write operation is completed, ensuring that all upstream functional modules receive an equal opportunity to write to the cache and preventing some upstream interfaces from being starved due to prolonged lack of authorization.

[0019] The above describes the writing and storage management of the data to be scheduled from the cache side. Building upon this, this embodiment further organizes and structures the multiple data streams to be scheduled stored in the cache unit from the scheduling side. Since the data to be scheduled stored in the cache unit comes from multiple different upstream functional modules and is sent to different downstream functional modules, the cache unit simultaneously contains multiple data streams with different sources and destinations. If each data stream is read out one by one and its destination determined, the scheduling efficiency is low, making it difficult to meet the data transmission requirements in high-concurrency scenarios. Therefore, this embodiment organizes and structures these data streams according to two dimensions: source and destination, thereby transforming the complex many-to-many scheduling problem into a predictable filtering problem. Specifically, a scheduling matrix is ​​constructed using the source of each data stream as the first dimension and the destination as the second dimension; in this embodiment, the first dimension corresponds to the rows of the scheduling matrix, and the second dimension corresponds to the columns of the scheduling matrix. In this system, the source end refers to the upstream functional module that sends the data to be scheduled, such as various storage modules, external interaction interfaces, or front-end processing units; the destination end refers to the downstream functional module to which the data to be scheduled is sent, such as on-chip cache of the computing core, secondary processing units, or back-end data output units. The scheduling matrix is ​​a two-dimensional data structure, with rows corresponding to different source ends and columns corresponding to different destination ends. Each element in the matrix indicates whether there is data to be scheduled between the corresponding source and destination ends. It should be noted that in this embodiment, the first dimension is used as rows and the second dimension as columns, but the row and column assignments of the first and second dimensions can be interchanged. That is, using the first dimension as columns and the second dimension as rows also applies to the technical solutions of this disclosure and falls within the protection scope of this disclosure. Specifically, if there is data to be scheduled between a source and a destination, the element at the corresponding position in the matrix is ​​marked as valid; otherwise, it is marked as invalid. By constructing the above scheduling matrix, disordered and scattered multi-path data to be scheduled can be structurally organized according to their source and destination, providing a data foundation for subsequent conflict-free scheduling. Thus, this embodiment has completed all preprocessing work from data writing to scheduling preparation, laying the data foundation for subsequent iterative filtering operations.

[0020] For example, as shown in the appendix Figure 2 As shown, a scheduling matrix of dimension n×m can be constructed, where the value of m is the same as the total number of source nodes, and the value of n is the same as the total number of destination nodes. Depending on the actual application requirements, the actual values ​​of m and n can be increased or decreased. (Appendix) Figure 2 p0 to p m-1 Corresponding to m source terminals, q0 to q n-1 Corresponding to n destinations, the matrix element T[i][j] indicates that in the i-th source, there is data to be scheduled for the j-th destination, and scheduling selection is supported.

[0021] S102, perform a filtering operation iteratively on the scheduling matrix to obtain a scheduling result set consisting of the elements selected in each round of filtering; the filtering operation includes: selecting a target element from the elements corresponding to the dimension values ​​of the first dimension that have not been filtered, so that the pairing relationship between the source and destination represented by the target element is included in the scheduling result set as one scheduling result, and applying a mask to the dimension value corresponding to the target element in the second dimension so that subsequent filtering operations prohibit filtering the elements corresponding to the masked dimension values.

[0022] After constructing the scheduling matrix, this embodiment iteratively performs a filtering operation on the scheduling matrix to obtain a scheduling result set composed of the elements selected in each round of filtering. The scheduling result set refers to the summary of multiple scheduling results output after multiple rounds of filtering. Each scheduling result corresponds to a pairing relationship between a source and a destination, indicating which source data should be scheduled to which destination. If all valid elements in the scheduling matrix are output indiscriminately, multiple data streams may be sent to the same destination simultaneously, leading to destination contention and transmission conflicts. Therefore, a filtering operation is needed to conditionally select valid elements in the scheduling matrix to ensure that there are no destination conflicts among the final output multiple scheduling results. Specifically, each round of filtering includes: selecting a target element from the elements corresponding to the unfiltered first dimension value; including the source-destination pairing relationship represented by this target element as a scheduling result in the scheduling result set; and masking the dimension value corresponding to this target element in the second dimension so that subsequent filtering operations prohibit filtering elements corresponding to the masked dimension value. By applying a masking mechanism to the selected destination after each round of screening, it is ensured that other data from the same destination will not be selected in subsequent rounds. This ensures that the final multi-path scheduling results correspond to different destinations, fundamentally avoiding the risk of multiple data competing for the same downstream functional module.

[0023] For example, suppose the dimension value of the first row in the scheduling matrix is ​​source A, and the dimension value of the second row is source B; the dimension value of the first column is destination X, and the dimension value of the second column is destination Y, and T[A][X], T[B][X], and T[A][Y] in the matrix are all valid elements. In the first round of filtering, a row is selected from the rows corresponding to the dimension values ​​of the first dimension that were not filtered (i.e., source A or source B). Assuming the first row (source A) is selected, a valid element is selected from that row. If T[A][X] is selected, the pairing relationship from source A to destination X is output as one scheduling result, and destination X is masked. In the second round of filtering, the process returns to the first dimension. It selects from the rows corresponding to the remaining unfiltered dimensions of the first dimension (i.e., source B, since source A was already selected in this round), specifically the second row (source B). A valid element is selected from this row. Since destination X is blocked, the element T[B][X] corresponding to destination X in this row is prohibited from selection. Therefore, only T[B][Y] (if it exists) or other unblocked elements corresponding to destinations in this row can be selected. If T[B][Y] is selected, the pairing relationship from source B to destination Y is output as another scheduling result. These two rounds of filtering output two scheduling results, each originating from a different source and pointing to a different destination, achieving conflict-free concurrent scheduling. Without the blocking mechanism, the two rounds of filtering might simultaneously select T[A][X] and T[B][X] corresponding to the same destination X, causing both data to be sent to destination X, inevitably leading to destination contention and transmission congestion. The blocking mechanism effectively avoids this conflict.

[0024] To improve the efficiency of the filtering operation, each round of filtering in this embodiment is configured to take multiple clock cycles to complete, and a pipelined parallel approach is adopted to eliminate transmission bubbles caused by multi-cycle scheduling. Transmission bubbles are a common concept in pipelined architecture, referring to the phenomenon where subsequent tasks cannot start or the processing link is idle and waiting for clock cycles because the preceding task has not yet completed. In the multi-cycle iterative filtering scenario of this embodiment, if each round of filtering requires multiple clock cycles to output a result, subsequent rounds must wait for the current round to complete before starting, causing the scheduling link to be unable to continuously output, thus generating bubbles. Therefore, this embodiment configures a first-in-first-out (FIFO) buffer with a depth equal to the number of clock cycles required for a single round of filtering; multiple sets of filtering tasks to be executed are written into this buffer, each set of filtering tasks corresponding to one round of filtering operation on the scheduling matrix. Based on this, a pipelined parallel approach is adopted, reading a set of filtering tasks from the buffer clock cycle by clock cycle to execute the corresponding round of filtering operation. Each set of filtering tasks outputs the corresponding scheduling result after multiple clock cycles from the start of execution. In this way, during the execution of the current task, subsequent tasks can enter the scheduling link in sequence, keeping the scheduling link busy at all times, thereby eliminating bubbles and ensuring that there are tasks being executed at every clock tick.

[0025] For example, such as Figure 3As shown, assume that the current FIFO buffer stores 6 sets of filtering tasks to be executed, denoted as filtering tasks A, B, C, D, E, and F, and that a single round of filtering operation requires 5 clock cycles to complete. At clock cycle T0, filtering task A is read from the FIFO buffer and sent to the scheduling link to begin execution. At the subsequent clock cycle T1, filtering task A is still executing in the scheduling link and has not yet completed. At this time, filtering task B is read from the FIFO buffer and sent to the scheduling link, executing in parallel with filtering task A in the scheduling link. Similarly, at clock cycles T2, T3, and T4, filtering tasks C, D, and E are read sequentially and sent to the scheduling link. After a delay of 5 clock cycles, filtering task A outputs its scheduling result at clock cycle T5. At clock cycle T6, filtering task B outputs its scheduling result, and simultaneously, filtering task F is read from the FIFO buffer and sent to the scheduling link to begin execution, ensuring that there is always a filtering task executing in the scheduling link. Subsequently, the scheduling results of screening tasks C, D, E, and F are output sequentially in clock cycles T7, T8, T9, and T10. As can be seen from the above process, starting from clock cycle T5, each clock cycle outputs a scheduling result, and there are no idle waiting clock cycles. Although each screening task requires a delay of 5 clock cycles from start to output, due to the pipelined parallel approach, the screening tasks are executed overlappingly in the scheduling link, achieving an overall throughput of one scheduling result per clock cycle. This effectively eliminates transmission bubbles caused by multi-cycle serial screening and avoids impacting the continuity of data transmission to downstream modules.

[0026] As an alternative to the pipelined scheduling architecture described above, if hardware resources are sufficient, the pipelined scheduling architecture can be abandoned. Instead, an equal number of scheduling modules can be deployed in parallel according to the number of clock ticks required for a single round of screening operations. Multiple sets of screening tasks to be executed are then distributed to multiple scheduling modules for parallel execution. Each scheduling module outputs its corresponding scheduling result after multiple clock ticks. This parallel scheme also achieves one scheduling result per clock tick, eliminating transmission bubbles. Therefore, regardless of whether the pipelined or parallel scheduling architecture is used, this embodiment can hide the delay of multiple clock ticks required for a single round of screening operations within the concurrent execution process, ensuring an overall throughput of one scheduling result per clock tick, guaranteeing the continuity of scheduling result output and the stability of data reception by downstream modules.

[0027] Furthermore, since the order of the first and second dimensions in the scheduling matrix is ​​fixed, this fixed order may cause certain dimension values ​​to always be prioritized during the filtering process, resulting in a hidden priority problem. For example, if the row corresponding to a certain source is always ranked at the top of the matrix, its corresponding data may be prioritized, while sources ranked lower may not get a scheduling opportunity for a long time, leading to unfair scheduling. To eliminate the above-mentioned hidden priority problem, this embodiment rearranges the order of the values ​​of the first dimension in the scheduling matrix and / or rearranges the order of the values ​​of the second dimension before iteratively performing the filtering operation on the scheduling matrix. By rearranging the values, the order in which the dimensions are filtered is changed, so that different sources and different destinations have a relatively equal probability of being selected during the filtering process. This effectively avoids the unfair scheduling problem of a single source or destination being continuously selected in extreme scenarios, ensuring the scheduling fairness between upstream and downstream functional modules.

[0028] In practical implementation, the reordering operation can be performed in several ways. For example, the dimension values ​​can be rearranged in a random order, so that the order of the dimension values ​​changes before each scheduling operation; the dimension values ​​can also be cyclically shifted in a round-robin manner, so that each dimension value obtains a higher position in sequence; or they can be sorted according to the number of times they have been scheduled in the past, adjusting the dimension values ​​with fewer scheduling opportunities to a higher position to compensate for their insufficient scheduling opportunities in the past. To improve the adaptability of the reordering operation, the order of dimensions can also be dynamically determined by combining the current storage occupancy status of each cache partition or the priority status of each upstream interface. For example, when the storage occupancy status of a cache partition is high, the destination dimension value corresponding to that cache partition can be adjusted to a lower position to reduce its probability of being selected, thereby alleviating the load pressure on that partition; conversely, when the storage occupancy status of a cache partition is low, the destination dimension value corresponding to that cache partition can be adjusted to a higher position to prioritize the use of its idle resources. This reordering operation can be performed on only the first dimension, only the second dimension, or both dimensions, depending on the fairness requirements of the actual application scenario. Through these various reordering methods and their combinations, the reordering operation can flexibly adapt to different scheduling scenarios, ensuring fairness while also considering the real-time status of system resources, further enhancing the adaptability and flexibility of the scheduling strategy.

[0029] S103, based on the scheduling result set, reads the corresponding data to be scheduled from the cache unit and outputs it to the downstream functional module.

[0030] After obtaining the scheduling result set, this embodiment reads the corresponding data to be scheduled from the cache unit based on the scheduling result set and outputs it to the downstream functional module. The scheduling result set contains multiple scheduling results, each indicating a pairing relationship between a source and a destination, that is, clarifying "which data should be sent to which destination". However, the scheduling result itself is only a pairing relationship and does not contain the actual content of the data to be scheduled. Therefore, it is also necessary to locate and read the corresponding data from the cache unit according to the pairing relationship and output it to the corresponding downstream functional module to complete the complete data scheduling and distribution process. If the data cannot be quickly located according to the scheduling result during the data reading stage, the efficient filtering results of the scheduling module will not be translated into actual data transmission efficiency improvement.

[0031] As mentioned earlier, each cache partition includes a data storage unit, a free address queue, and a multiplexed destination address queue. During the data writing process to the cache partition, each piece of data to be scheduled is written to the data storage unit, and its storage address is simultaneously recorded in the destination address queue corresponding to the destination that the data points to. Therefore, when data needs to be read based on the scheduling result, it is only necessary to retrieve the storage address from the corresponding destination address queue to directly access the data location in the data storage unit corresponding to that address, without needing to traverse the entire data storage unit for a search, thus significantly improving data read efficiency.

[0032] Specifically, this embodiment first obtains the target scheduling result from the scheduling result set, and then determines the corresponding source cache partition and target destination based on the target scheduling result. As mentioned earlier, each dimension value in the scheduling matrix corresponds to a source or a destination, and the data of these source and destination ends are stored in the corresponding cache partitions. Therefore, each scheduling result can be traced back to the cache partition where its data source is located, i.e., the source cache partition. After determining the source cache partition and the target destination, a destination address queue corresponding to the target destination is determined from the multiple destination address queues of the source cache partition; then, the storage address corresponding to the target scheduling result is read from the determined destination address queue, and based on the read storage address, the corresponding data to be scheduled is read from the data storage of the source cache partition; finally, the read data to be scheduled is output to the target destination, completing the scheduling and distribution of one data path.

[0033] For example, suppose a target scheduling result instructs data from source A to destination X, and the actual content of this data is stored in the data storage of source buffer partition P. Source buffer partition P is configured with multiple destination address queues, each corresponding to a different destination. The destination address queue corresponding to destination X stores the storage addresses of all data destined for destination X. When this data needs to be output, firstly, source buffer partition P and target destination X are determined based on the target scheduling result. Then, the destination address queue corresponding to destination X is determined from the multiple destination address queues in source buffer partition P, and the storage address corresponding to the target scheduling result is read from this queue. Finally, the data to be scheduled is read from the data storage based on this storage address and output to destination X. Through this method, each scheduling result can be quickly located and the corresponding data can be read, achieving a precise mapping from scheduling results to actual data.

[0034] After completing data reading and output, this embodiment also releases the storage address and writes it back to the free address queue of the source cache partition. This is because the data corresponding to the storage address has been read out, and the storage space it occupies is now free and can be reused by subsequent data. By writing the storage address back to the free address queue, the storage address becomes an allocable free storage address again, thereby realizing the recycling of storage resources. Without this release and recycling step, the storage address of the read data will remain occupied and cannot be reallocated, causing the effective storage capacity of the cache partition to gradually decrease. Eventually, all storage space will be occupied by historical data that has already been read, making it impossible to receive new written data, resulting in a waste of cache resources and abnormal system function. The above release and recycling mechanism ensures that the storage space of the cache partition can be continuously recycled, maintaining the sustainable working capability of the cache unit in continuous scheduling scenarios.

[0035] For example, Figure 4 This embodiment illustrates the internal structure of the cache partition and the interaction between its various storage units from the perspective of the overall data writing and reading processes. (See attached diagram.) Figure 4As shown, each cache partition in this embodiment can be divided into three types of storage units: a free address queue, a data storage unit, and a multi-path destination address queue. The free address queue manages the free storage addresses in the data storage unit, recording the currently writable free locations in the data storage unit. The data storage unit caches the complete content of the data to be scheduled. The multi-path destination address queue contains multiple independent queues, each corresponding to a destination, used to store the storage address in the data storage unit for the data to be scheduled pointing to the corresponding destination. The interaction between the three types of storage units is as follows: During data writing, a free storage address is first read from the free address queue of the target cache partition and used as the write location in the data storage unit. The data to be scheduled is written to the storage location in the data storage unit corresponding to this address. After the data writing is completed, this storage address is pushed to the destination address queue corresponding to the destination pointed to by the current data, to record the storage location of the data in the data storage unit. During data reading, a storage address is first read from the destination address queue corresponding to the target destination. Based on this storage address, the corresponding data to be scheduled is read from the data storage. After the data reading is completed, the storage address is released and written back to the free address queue of the source cache partition so that storage space can be reallocated for subsequent data. Through the address flow and interaction between the above three types of storage units, the allocation and recording of storage addresses during data writing and the location and reclamation of storage addresses during data reading are realized, forming a complete closed loop from address allocation to address reclamation, providing a data index foundation for the efficient scheduling of the scheduling module.

[0036] In addition, another embodiment of this disclosure provides a chip. Figure 5 This is a schematic diagram of the chip's structure, including: multiple upstream functional modules, multiple downstream functional modules, a cache unit, and a scheduling unit. The upstream functional modules are coupled to the input of the cache unit to send data to be scheduled. The downstream functional modules are coupled to the output of the cache unit to receive scheduled data from the cache unit. The cache unit is located between the upstream and downstream functional modules to cache the data to be scheduled, output from the upstream functional modules and intended for transmission to the downstream functional modules. The scheduling unit is coupled to the cache unit and is used to execute functions such as... Figure 1 The data scheduling method shown, specifically: The scheduling unit first reads multiple data items to be scheduled from the cache unit, and constructs a scheduling matrix with the source of these data items as the first dimension and the destination as the second dimension. The source refers to upstream functional modules within the chip, such as various storage modules, external interfaces, or front-end processing units; the destination refers to downstream functional modules within the chip, such as on-chip cache of the computing core, secondary processing units, or back-end data output units. Elements in the scheduling matrix indicate whether there is data to be scheduled between the corresponding source and destination.

[0037] Based on this, the scheduling unit iteratively performs a filtering operation on the scheduling matrix to obtain a scheduling result set consisting of the elements selected in each round of filtering. Each round of filtering includes: selecting a target element from the elements corresponding to the dimension values ​​of the unfiltered first dimension; including the pairing relationship between the source and destination represented by this target element as a scheduling result in the scheduling result set; and masking the dimension value corresponding to this target element in the second dimension, so that subsequent filtering operations cannot filter elements corresponding to the masked dimension value. By masking the selected destination after each round of filtering, it ensures that subsequent rounds do not select other data for the same destination, thus guaranteeing that the final multi-path scheduling results correspond to different destinations, fundamentally avoiding the risk of multiple data streams competing for the same downstream functional module.

[0038] Finally, based on the scheduling result set, the scheduling unit reads the corresponding data to be scheduled from the cache unit and outputs it to the corresponding downstream functional modules, thus completing the data scheduling and distribution process.

[0039] Figure 6 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this disclosure. Please refer to it. Figure 6 At the hardware level, the electronic device includes a processor, and in an exemplary embodiment, also includes an internal bus, a network interface, and memory. The memory may include RAM, such as high-speed random-access memory (RAM), or non-volatile memory, such as at least one disk drive. Of course, the electronic device may also include other hardware required for its functions.

[0040] The processor, network interface, and memory can be interconnected via an internal bus, which can be an ISA (Industry Standard Architecture) bus, a PCI (Peripheral Component Interconnect) bus, or an EISA (Extended Industry Standard Architecture) bus, etc. This bus can be divided into address bus, data bus, control bus, etc. For ease of representation, Figure 6 The symbol is represented by a single double-headed arrow, but this does not mean that there is only one bus or one type of bus.

[0041] A memory is used to store computer programs. Specifically, the computer program may include program code, which includes computer operation instructions. The memory may include main memory and non-volatile memory, and provides the computer program to the processor. The processor reads the corresponding computer program from the non-volatile memory into main memory and then runs it. Correspondingly, the processor executes the program stored in the memory, specifically for performing the following operations: Multiple data sets to be scheduled are read from the cache unit inside the chip, and a scheduling matrix is ​​constructed with the source end of the data set as the first dimension and the destination end as the second dimension. The source end is an upstream functional module inside the chip, and the destination end is a downstream functional module inside the chip. Elements in the scheduling matrix represent the data sets to be scheduled that exist between the corresponding source and destination ends. The cache unit is used to cache the data sets to be scheduled that are output by the upstream functional module and intended to be sent to the downstream functional module. The scheduling matrix is ​​iteratively filtered to obtain a scheduling result set consisting of elements selected in each round of filtering. The filtering operation includes: selecting a target element from the elements corresponding to the dimension values ​​of the unfiltered first dimension, so that the pairing relationship between the source and destination represented by the target element is included as a scheduling result in the scheduling result set, and applying a mask to the dimension value corresponding to the target element in the second dimension so that subsequent filtering operations prohibit filtering the elements corresponding to the masked dimension values. Based on the scheduling result set, the corresponding data to be scheduled is read from the cache unit and output to the downstream functional module.

[0042] The above is as described in this instruction manual. Figure 1The data scheduling method disclosed in the illustrated embodiments can be applied to a processor and implemented by the processor. The processor may be an integrated circuit chip with signal processing capabilities. During implementation, each step of the above method can be completed by integrated logic circuits in the processor's hardware or by instructions in software form. The processor can be a general-purpose processor, including a Central Processing Unit (CPU), a Network Processor (NP), etc.; it can also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field-Programmable Gate Array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this disclosure. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the method provided in the embodiments of this disclosure can be directly manifested as execution by a hardware decoding processor, or execution by a combination of hardware and software modules in the decoding processor. The software module can reside in a mature storage medium in the field, such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, or registers. This storage medium is located in memory, and the processor reads information from the memory and, in conjunction with its hardware, completes the steps of the above method.

[0043] Of course, in addition to software implementation, the electronic device described in this specification does not exclude other implementation methods, such as logic devices or a combination of hardware and software. In other words, the execution subject of the following processing flow is not limited to each logic unit, but can also be hardware or logic devices.

[0044] Furthermore, embodiments of this disclosure also provide a computer-readable storage medium storing one or more computer programs, the one or more computer programs including instructions. These instructions, when executed by a portable electronic device including multiple applications, enable the portable electronic device to perform... Figure 1 The steps in the method shown include: Multiple data sets to be scheduled are read from the cache unit inside the chip, and a scheduling matrix is ​​constructed with the source end of the data set as the first dimension and the destination end as the second dimension. The source end is the upstream functional module inside the chip, and the destination end is the downstream functional module inside the chip. The elements in the scheduling matrix represent the data sets to be scheduled that exist between the corresponding source end and destination end. The cache unit is used to cache the data sets to be scheduled that are output by the upstream functional module and are intended to be sent to the downstream functional module.

[0045] The scheduling matrix is ​​iteratively filtered to obtain a scheduling result set consisting of elements selected in each round of filtering. The filtering operation includes: selecting a target element from the elements corresponding to the dimension values ​​of the first dimension that have not been filtered, so that the pairing relationship between the source and destination represented by the target element is included as a scheduling result in the scheduling result set, and applying a mask to the dimension value corresponding to the target element in the second dimension so that subsequent filtering operations prohibit filtering the elements corresponding to the masked dimension values.

[0046] Based on the scheduling result set, the corresponding data to be scheduled is read from the cache unit and output to the downstream functional module.

[0047] The foregoing has described specific embodiments of this specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recited in the claims may be performed in a different order than that shown in the embodiments and may still achieve the desired result. Furthermore, the processes depicted in the drawings do not necessarily require the specific or sequential order shown to achieve the desired result. In some embodiments, multitasking and parallel processing are possible or may be advantageous.

[0048] The above are merely embodiments of this specification and are not intended to limit the scope of this specification. Various modifications and variations can be made to this specification by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this specification should be included within the scope of the claims of this specification. Furthermore, all other embodiments obtained by those skilled in the art without inventive effort should fall within the protection scope of this document.

Claims

1. A data scheduling method applied to a chip, characterized in that, include: Multiple data sets to be scheduled are read from the cache unit inside the chip, and a scheduling matrix is ​​constructed with the source end of the data set as the first dimension and the destination end as the second dimension. The source end is an upstream functional module inside the chip, and the destination end is a downstream functional module inside the chip. Elements in the scheduling matrix represent the data sets to be scheduled that exist between the corresponding source and destination ends. The cache unit is used to cache the data sets to be scheduled that are output by the upstream functional module and intended to be sent to the downstream functional module. The scheduling matrix is ​​iteratively filtered to obtain a scheduling result set consisting of elements selected in each round of filtering. The filtering operation includes: selecting a target element from the elements corresponding to the dimension values ​​of the unfiltered first dimension, so that the pairing relationship between the source and destination represented by the target element is included as a scheduling result in the scheduling result set, and applying a mask to the dimension value corresponding to the target element in the second dimension so that subsequent filtering operations prohibit filtering the elements corresponding to the masked dimension values. Based on the scheduling result set, the corresponding data to be scheduled is read from the cache unit and output to the downstream functional module.

2. The method according to claim 1, characterized in that, The cache unit comprises multiple cache partitions; before reading multiple data items to be scheduled from the cache unit inside the chip, the method further includes: Receive write requests from at least one of the upstream functional modules; Based on the priority of the upstream interface corresponding to each write request and the storage occupancy status of each of the multiple cache partitions, target write requests that are allowed to perform write operations are selected from all the write requests. Based on the load balancing strategy of the multiple cache partitions, a target cache partition for caching the scheduled data corresponding to the target write request is determined from the multiple cache partitions; Write the data to be scheduled corresponding to the target write request into the target cache partition.

3. The method according to claim 2, characterized in that, After filtering out the target write requests from all the write requests to allow the write operation, the method further includes: The priority of the upstream interface corresponding to the target write request is downgraded; And / or, Priority is increased for the upstream interfaces corresponding to the write requests other than the target write request.

4. The method according to claim 2, characterized in that, Each of the cache partitions includes a data storage, a free address queue, and a multi-path destination address queue; wherein, the data storage is used to cache data to be scheduled; the free address queue is used to manage the free storage addresses of the data storage; each of the multi-path destination address queues corresponds to a destination and is used to store the storage address of the data to be scheduled in the data storage that points to the corresponding destination. The step of writing the scheduled data corresponding to the target write request into the target cache partition includes: Read a free storage address from the free address queue of the target cache partition; Write the data to be scheduled corresponding to the target write request into the storage location corresponding to the free storage address in the data storage of the target cache partition, and write the free storage address into the destination address queue in the target cache partition corresponding to the destination pointed to by the target write request.

5. The method according to claim 2, characterized in that, Each of the cache partitions includes a data storage, a free address queue, and a multi-path destination address queue; wherein, the data storage is used to cache data to be scheduled; the free address queue is used to manage the free storage addresses of the data storage; each of the multi-path destination address queues corresponds to a destination and is used to store the storage address of the data to be scheduled in the data storage that points to the corresponding destination. The step of reading the corresponding data to be scheduled from the cache unit and outputting it to the downstream functional module based on the scheduling result set includes: Obtain the target scheduling result from the scheduling result set, and determine the corresponding source cache partition and target destination based on the target scheduling result; From the multiple destination address queues of the source cache partition, determine one destination address queue corresponding to the target destination; Read the storage address corresponding to the target scheduling result from the determined destination address queue, and read the corresponding data to be scheduled from the data storage of the source cache partition based on the read storage address; The read data to be scheduled is output to the target destination, and the storage address is released and written back to the free address queue of the source cache partition.

6. The method according to any one of claims 1 to 5, characterized in that, Each round of the filtering operation is configured to take multiple clock ticks to complete; The iterative filtering operation on the scheduling matrix includes: Configure a first-in-first-out (FIFO) buffer, the depth of which is equal to the number of clock ticks required for a single round of filtering operations; Multiple sets of filtering tasks to be executed are written into the first-in-first-out buffer; wherein each set of filtering tasks corresponds to one round of filtering operation on the scheduling matrix; A pipelined parallel approach is adopted, and a set of filtering tasks is read from the first-in-first-out buffer every clock cycle to perform a corresponding round of filtering operations; wherein, each set of filtering tasks outputs the corresponding scheduling result after a number of clock cycles from the start of execution.

7. The method according to any one of claims 1 to 5, characterized in that, Before performing the filtering operation iteratively on the scheduling matrix, the method further includes: The order of the values ​​of each dimension in the first dimension of the scheduling matrix is ​​rearranged; And / or, The order of the values ​​of the second dimension in the scheduling matrix is ​​rearranged.

8. The method according to any one of claims 1 to 5, characterized in that, The types of chips include at least one of system-on-a-chip (SoC), artificial intelligence chip, general-purpose computing chip, dedicated computing chip, network processor chip, and communication baseband processing chip.

9. An electronic device, comprising a processor; and a memory configured to store computer-executable instructions, which, when executed, cause the processor to perform the method as claimed in any one of claims 1-8.

10. A computer-readable storage medium for storing computer-executable instructions that, when executed by a processor, implement the method as claimed in any one of claims 1-8.