WO2021115326A1 - 数据处理的方法、装置和电子设备、存储介质和程序产品 - Google Patents

数据处理的方法、装置和电子设备、存储介质和程序产品 Download PDF

Info

Publication number
WO2021115326A1
WO2021115326A1 PCT/CN2020/134921 CN2020134921W WO2021115326A1 WO 2021115326 A1 WO2021115326 A1 WO 2021115326A1 CN 2020134921 W CN2020134921 W CN 2020134921W WO 2021115326 A1 WO2021115326 A1 WO 2021115326A1
Authority
WO
WIPO (PCT)
Prior art keywords
data
data source
arbitration
priority
code
Prior art date
Application number
PCT/CN2020/134921
Other languages
English (en)
French (fr)
Inventor
沈杨书
张旺
Original Assignee
北京灵汐科技有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Priority claimed from CN201911252455.1A external-priority patent/CN113032109A/zh
Priority claimed from CN201911252471.0A external-priority patent/CN113037650B/zh
Application filed by 北京灵汐科技有限公司 filed Critical 北京灵汐科技有限公司
Priority to US17/778,929 priority Critical patent/US11863461B2/en
Publication of WO2021115326A1 publication Critical patent/WO2021115326A1/zh

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/50Queue scheduling
    • H04L47/62Queue scheduling characterised by scheduling criteria
    • H04L47/625Queue scheduling characterised by scheduling criteria for service slots or service orders
    • H04L47/6275Queue scheduling characterised by scheduling criteria for service slots or service orders based on priority
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/50Queue scheduling
    • H04L47/62Queue scheduling characterised by scheduling criteria
    • H04L47/622Queue service order
    • H04L47/6235Variable service order
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L49/00Packet switching elements
    • H04L49/10Packet switching elements characterised by the switching fabric construction
    • H04L49/109Integrated on microchip, e.g. switch-on-chip

Definitions

  • the present disclosure relates to the field of communication technology, and in particular to a data processing method, a data processing device, an electronic device, a computer-readable storage medium, and a computer program product.
  • the network on chip (NOC) is used to realize the communication between the core and the core. Therefore, the performance of the NOC is the key to the performance of the many-core chip; the communication between the core and the core is through the data channel, Through the arbitration of the data channel, the performance of the NOC is improved, that is, the communication efficiency of the NOC is improved.
  • NOC network on chip
  • the embodiments of the present disclosure provide a data processing method, device, and electronic equipment to solve how to efficiently determine the data source for priority transmission among multiple data sources in the prior art, and dynamically adjust the data source.
  • the issue of priority order is a data processing method, device, and electronic equipment to solve how to efficiently determine the data source for priority transmission among multiple data sources in the prior art, and dynamically adjust the data source. The issue of priority order.
  • a data processing method In each processing cycle, the method includes: determining a plurality of candidate data, wherein the candidate data is provided by a corresponding data source; Determine the target data according to the priority of the data source corresponding to each of the multiple candidate data in the current cycle, where the same data source has different priorities in different processing cycles, and the same data source has different priorities in different processing cycles.
  • the priority order numbers satisfy a non-linear relationship.
  • the priority order of the same data source in different processing cycles changes irregularly.
  • the data output to the destination is limited.
  • the data sources are also more random, increasing the balance of the number of data sources arriving at the destination.
  • the determining the target data according to the priority in the current cycle of the data source corresponding to each of the multiple candidate data includes:
  • N is a natural number, and 1 ⁇ N ⁇ M, and M is the total number of arbitration levels in the current processing cycle;
  • the code is generated according to the set coding method
  • All the generated codes are assigned to all data sources in the N-th arbitration according to the set priority order;
  • determining the target data according to the priority of the data source corresponding to each of the multiple candidate data in the current cycle includes:
  • the target code and the priority order corresponding to the target code arbitrate the data source corresponding to each candidate data to determine the target data;
  • the generating code according to the set coding mode according to the number of data sources in the Nth-level arbitration includes:
  • codes are generated in a binary manner, and the number of codes is equal to the number of data sources in the Nth level of arbitration.
  • the multiple data sources in the Nth level of arbitration are divided into multiple data source groups, and each data source group includes at least one data source,
  • all the generated codes are allocated to all data sources in the N-th level of arbitration according to the set priority order, including:
  • the codes corresponding to the data source group are assigned to the data sources of the data source group one by one.
  • the generating the corresponding target code for the data source corresponding to each candidate data according to the code includes:
  • the interchange code is determined as the target code of the data source.
  • the multiple data sources in the Nth level of arbitration are divided into multiple data source groups, and each data source group includes at least one data source,
  • the method further includes the steps of generating codes according to the set encoding mode according to the number of data sources in the Nth level of arbitration and allocating all the generated codes to the Nth level of arbitration according to the set priority order. All the steps of the data source are carried out: the coded bits of the code are exchanged, and the exchange code corresponding to each code is generated;
  • All the generated codes are assigned to all data sources in the N-th level of arbitration according to the set priority order, including:
  • the generating a corresponding target code for the data source corresponding to each candidate data according to the code includes:
  • the interchange code of the data source corresponding to the candidate data is determined as the target code of the data source corresponding to the candidate data.
  • each of the data sources has its own corresponding physical serial number. In the first-level arbitration, every two data sources with adjacent physical serial numbers compete for the right to use a data channel.
  • the priority order numbers of any two data sources with adjacent physical sequence numbers are not adjacent.
  • the target code with the higher priority corresponds to Candidate data is the target data, and the target data is data for obtaining channel use rights;
  • the plurality of candidate data respectively carry an identification code ID, and the ID is used to identify the data source of the candidate data;
  • the one with the highest priority of the data source among the plurality of candidate data is used as the target data.
  • the ID of the target data source in the previous processing cycle is the reference ID of the current processing cycle.
  • the determining the target data in the plurality of candidate data according to the plurality of logical differences includes:
  • the data source corresponding to the largest logical difference value among the plurality of logical difference values is the data source with the highest priority, and the data output by the data source with the highest priority is used as the target data.
  • the reference ID is stored in the status register unit.
  • the value of the reference ID in the first processing cycle is 0.
  • the method of determining the target data according to the priority of the data source corresponding to the multiple candidate data in the current cycle further includes determining the identification code ID and the identification code carried by the multiple candidate data respectively.
  • the method further includes:
  • the target data is transmitted.
  • a candidate data determining unit for determining a plurality of candidate data, wherein the candidate data is provided by a corresponding data source;
  • the target data determining unit is configured to determine target data according to the priorities of the data sources corresponding to each of the multiple candidate data in the current cycle, wherein the same data source has different priorities in different processing cycles, and the same data
  • the priority order numbers of the sources in different processing cycles satisfy a non-linear relationship.
  • an electronic device including: a plurality of processing cores; and a network on a chip configured to interact data and external data among the plurality of processing cores; among them,
  • the network on chip is also configured to be able to execute the method described in the first aspect of the present disclosure; or at least one of the plurality of processing cores is configured to be able to execute the method described in the first aspect of the present disclosure.
  • a computer-readable storage medium on which computer program instructions are stored. A possible method as described.
  • a computer program product is provided.
  • the computer program product runs on a computer, the computer can execute any one of the first aspect or the first aspect. method.
  • the priority order of the same data source in different processing cycles changes irregularly.
  • the data output to the destination is limited.
  • the data sources are also more random, increasing the balance of the number of data sources arriving at the destination.
  • Fig. 1 is a schematic diagram of data transmission provided in the prior art
  • FIG. 2 is another schematic diagram of data transmission provided in the prior art
  • FIG. 3 is a method flowchart of an embodiment of data processing provided by the present disclosure
  • FIG. 4 is a method flowchart of another embodiment of data processing provided by the present disclosure.
  • FIG. 5 is a method flowchart of another embodiment of data processing provided by the present disclosure.
  • FIG. 6 is a method flowchart of still another embodiment of data processing provided by the present disclosure.
  • FIG. 7 is a schematic diagram of modules of an embodiment of the data processing device provided by the present disclosure.
  • FIG. 8 is a schematic diagram of modules of another embodiment of the data processing device provided by the present disclosure.
  • FIG. 9 is a schematic diagram of modules of yet another embodiment of the data processing device provided by the present disclosure.
  • FIG. 10 is a schematic structural diagram of an electronic device provided by an embodiment of the present disclosure.
  • the arbitration scheme of the NOC data channel includes a fixed priority arbitration scheme and a right rotation priority arbitration scheme.
  • the arbitration of the data channel is to determine the priority of the data according to the arbitration, and then Determine the data for obtaining the right to use the data channel.
  • the arbitration scheme usually includes multi-level arbitration.
  • the first-level arbitration all data to be transmitted are arbitrated. The lower the arbitration level, the more data channels are involved.
  • the highest level of arbitration involves only one arbitration channel, and the data passing through the arbitration channel can reach the destination.
  • the arbitration scheme shown in Figure 1 includes three levels of arbitration. The first level of arbitration involves 4 data channels, namely channel 1, channel 2, channel 3, and channel 4; the second level of arbitration involves 2 data channels, respectively It is channel5 and channel6; the third level of arbitration involves 1 data channel, namely channel7.
  • the number of channels involved in each level of arbitration is the same, and the data participating in the next level of arbitration is the data output by the data channel of the upper level and the newly input data.
  • the data channel involved in the first level of arbitration is channel1
  • the data channel involved in the second level of arbitration is channel2
  • the data channel involved in the third level of arbitration is channel3
  • the data channel involved in the fourth level of arbitration is channel4.
  • Case 1 Fixed-priority arbitration scheme.
  • the priority of the data source is fixed. It is suitable for arbitration with a specific priority order, but it cannot achieve dynamic adjustment of the priority.
  • data (data)0 data source namely data (data)0 data source, data1 data source, data2 data source, data3 data source, data4 data source, data5 data source, data6 data source And data7 data source
  • the above 8 data sources are transmitted to the destination after three levels of arbitration. Due to the limited data channel, multiple data needs to compete to use the data channel.
  • data0 and data1 are based on the arbiter of the first level of arbitration (arbiter).
  • ARB1 judges the priority, and competes for the priority use of channel 1; data2 and data3 judge the priority according to the first-level arbitration ARB2, and compete for the priority use of channel2; data4 and data5 are based on the first-level arbitration ARB3 Judge the priority and compete for the priority use of channel3; data6 and data7 determine the priority based on the first-level arbitration ARB4, and compete for the priority use of channel4; the output data of channel1 needs to continue to pass the output data of channel2 through the second-level arbitration ARB5 Judging the priority, competing for the priority use of channel5, that is, the data competing for the priority use of channel5 includes data0, data1, data2, and data3; the output data of channel3 needs to continue with the output data of channel4 to determine the priority through the second-level arbitration ARB6 , Competing for the priority use of channel6, that is, the data competing for the priority use of channel6 includes data4, data5, data6 and data7; the output data of channel5 needs to continue with the output data of channel6 to determine the
  • the priority of the data source corresponding to each data can be set in advance. It is assumed that the priority of the data of the data0 data source set in ARB1 is higher than the priority of the data of the data1 data source. When data and data from the data1 data source are transferred at the same time, the data from the data0 data source gets the priority of channel1, and the priority cannot be changed.
  • the priority of the data of the data0 data source set in ARB1 is higher than the priority of the data of the data1 data source.
  • the data from the data0 data source gets the priority of channel1, and the priority cannot be changed.
  • Case 2 The equal-rights rotation priority arbitration scheme can realize the dynamic adjustment of the priority of the data, but it cannot alleviate the imbalance of the data transmission delay.
  • the data0 data source to data7 data source are encoded according to the encoding sequence shown in Table 1.
  • the encoding length of each data source in Table 1 is 3 bits, and the details are as follows:
  • Table 1 above is the encoding of the data source.
  • the initial priority order of the data source is: data0>data1>data2>data3>data4>data5>data6>data7, that is, the priority order of the corresponding encoding is 000>001>010>011 >100>101>110>111, the equal rights rotation priority arbitration is performed based on the above initial priority order; suppose, taking the third-level arbitration as an example, the data input by ARB7 from channel5 may come from data sources data0, data1, and data2 , Data3, the data input from channel6 may come from data4, data5, data6 and data7. According to the equal-rights polling arbitration scheme, the specific arbitration process is as follows: 1.
  • the first data arbitration suppose data0 competes with data4 for the priority use of channel7 , According to the initial priority order, determine data0 to obtain the right to use priority. Due to the equal rights rotation, the priority of data0 becomes the lowest in the next arbitration, that is, the priority order of the data source is data1>data2>data3>data4>data5>data6 >data7>data0, that is to say, the priority order of the corresponding codes is 001>010>011>100>101>110>111>000; 2.
  • the second data arbitration suppose data1 continues to compete with data4 for the priority use of channel7 In the same way, data1 obtains the priority right to use.
  • the priority of data1 becomes the lowest in the next arbitration, that is, the priority order of the data source is data2>data3>data4>data5>data6>data7>data0> data1, that is to say, the priority order of the corresponding codes is 010>011>100>101>110>111>000>001; 3.
  • the third data arbitration Assuming that data2 continues to compete with data4 for the priority use of channel7, the same Reason, data2 obtains the priority right to use, due to the equal rights rotation, the priority of data2 becomes the lowest in the next arbitration, that is, the priority order of the data source is data3>data4>data5>data6>data7>data0>data1>data2.
  • the priority order of the corresponding codes is 011>100>101>110>111>000>001>010; 4.
  • the fourth data arbitration Assume that data3 continues to compete with data4 for the priority use of channel7. Similarly, data3 Obtain the priority right to use, due to the equal rights rotation, the priority of data3 becomes the lowest in the next arbitration, that is, the priority order of the data source is data4>data5>data6>data7>data0>data1>data2>d ata3, that is to say, the priority order of the corresponding codes is 100>101>110>111>000>001>010>011; 5.
  • the fifth data arbitration Assuming that data0 continues to compete with data4 for the priority use of channel7, the same Reason, data4 obtains the priority right of use. Due to the equal rights rotation, the priority of data4 becomes the lowest in the next arbitration, that is, the priority order of the data source is data5>data6>data7>data0>data1>data2>data3>data4. That is to say, the priority order of the corresponding codes is 101>110>111>000>001>010>011>100; 6.
  • the sixth data arbitration Assuming that data0 continues to compete with data5 for the priority use of channel7, the same goes for data5 Obtain the priority right to use, due to the equal rights rotation, the priority of data5 becomes the lowest in the next arbitration, that is, the priority order of the data source is data6>data7>data0>data1>data2>data3>data4>data5, that is to say, the corresponding The priority order of the encoding is 110>111>000>001>010>011>100>101; 7.
  • the seventh data arbitration Assume that data0 continues to compete with data6 for the priority use of channel7.
  • the priority order of the data source is data7>data0>data1>data2>data3>data4>data5>data6, that is to say the corresponding code
  • the priority order is 111>000>001>010>011>100>101>110; 8.
  • the eighth data arbitration Assume that data0 continues to compete with data7 for the priority use of channel7. Similarly, data7 obtains the priority for use.
  • the priority of data7 becomes the lowest in the next arbitration, that is, the priority order of the data source is data0>data1>data2>data3>data4>data5>data6>data7, that is, the priority order of the corresponding encoding 000>001>010>011>100>101>110>111; from the above scheme, it can be seen that in the process from the first data arbitration to the fourth data arbitration, the output data data4, data5, data6 and data7 of channel6 are Blocking. In the process from the fifth data arbitration to the eighth data arbitration, the output data data0, data1, data2, and data3 of channel5 are blocked, causing an imbalance in the delay of data transmission.
  • the second case may also appear to be an imbalance in the number of data sources arriving at the destination.
  • the data channel may also be referred to as a transmission channel, which is not limited in the embodiment of the present disclosure.
  • the data processing method includes:
  • step S310 a plurality of candidate data is determined, wherein the candidate data is provided by a corresponding data source;
  • step S320 the target data is determined according to the priorities of the data sources corresponding to each of the multiple candidate data in the current cycle, where the same data source has different priorities in different processing cycles, and the same data source is in the current cycle.
  • the priority order numbers in different processing cycles satisfy a non-linear relationship.
  • priority order number refers to the serial number of the data source when the data source is arranged by priority.
  • the priority of the data source is: data0>data1>data2>data3>data4>data5>data6>data7, then the priority order numbers of these 8 data sources are shown in Table 2. :
  • the priority of the data source is: data3>data1>data0>data2>data6>data4>data5>data7, then the priority order numbers of these 8 data sources are shown in Table 3:
  • the priority order of the same data source in different processing cycles changes irregularly.
  • the data output to the destination is limited.
  • the data sources are also more random, increasing the balance of the number of data sources arriving at the destination.
  • the priority order number of the data source data0 is 1, then in the subsequent 4 processing cycles, the priority order number of the data source data0 can be 8, 3, 6, and 5 respectively. It can be seen that 1, 8, 3, 6, and 5 do not satisfy the linear relationship of increasing or decreasing.
  • the data source whose priority order number is one less than the priority order number of the arbitrary data source in different processing cycles is a different data source, and/or, in the corresponding In the two adjacent processing cycles, the data source with the priority order number greater than the priority order number of the arbitrary data source by one is also a different data source.
  • the priority of multiple data sources is data0>data1>data2>data3>data4>data5>data6>data7.
  • the data source with the priority order number 1 smaller than the data4 data source is data3
  • the data source with the priority order number 1 larger than the data4 data source is the data5 data source.
  • the priority of multiple data sources is data3>data1>data0>data2>data6>data4>data5>data7.
  • the data source whose priority order number is one less than the data4 data source is the data6 data source, and the data source whose priority order number is one greater than the data4 data source is data5.
  • the step S320 may include:
  • step S321 the number of data sources in the Nth level of arbitration is determined.
  • each of the data sources has its own corresponding physical serial number, and in the first-level arbitration, every two data sources with adjacent physical serial numbers compete for the right to use a data channel.
  • N is a variable variable and can be taken from any natural number from 1 to M.
  • M is 3.
  • any level of arbitration (that is, the Nth level of arbitration) obtains data from the data sources of two data channels, and the number of data sources participating in the Nth level of arbitration is at least two.
  • the third-level arbitration ARB7 obtains data from the data sources corresponding to channel5 and channel6.
  • the output data from channel5 may be data0, data1, data2, and data3, and the output data from channel6 may be Data4, data5, data6, and data7, that is, the number of data sources for the third-level arbitration is 8.
  • each data source its physical serial number is a serial number that is constant and can be identified.
  • the "0" in data0 is the "physical serial number" of the data0 data source
  • the "1" in data1 is the “physical serial number” of the data1 data source, and so on.
  • the data0 data source and the data1 data source compete for the right to use channel1
  • the data2 data source and the data3 data source compete for the right to use channel2.
  • the data4 data source and the data5 data source compete for the right to use channel3
  • the data6 data source and the data7 data source compete for the right to use channel4.
  • the physical serial number here is only for identifying the data source, not for limiting the priority of the data source.
  • step S322 the code is generated according to the set coding mode according to the number of data sources in the Nth arbitration.
  • the priority order of the encoding is determined according to the encoding.
  • the code is generated in a binary manner according to the number of the data sources, and the number of the codes is equal to the number of the data sources.
  • the specific codes can be 000, 001, 010, 011, 100, 101, 110, and 111, 8 secondary codes; when the data The number of sources is 16, and the 4-bit secondary code can be used.
  • the specific code can be 0000, 0001, 0010, 0011, 0100, 0101, 0110, 0111, 1000, 1001, 1010, 1011, 1100, 1101, 1110 , And 1111;
  • the number of bits in binary encoding increases, which is specifically determined according to actual conditions.
  • step S323 all the generated codes are allocated to all data sources in the N-th level of arbitration according to the set priority order.
  • the priority sequence numbers of any two data sources with adjacent physical sequence numbers are not adjacent.
  • the physical serial number of the data0 data source is adjacent to the physical serial number of the data source data1, but the priority order number of the data0 data source is not adjacent to the priority order number of the data1 data source.
  • the priority order numbers of data sources with adjacent physical sequence numbers are also adjacent, which leads to the same data source in different processing cycles in the priority order number of the same data source in the equal rights rotation priority arbitration scheme.
  • the priority sequence numbers of any two data sources with adjacent physical sequence numbers are not adjacent. It can be realized that in the equal-rights rotation priority arbitration scheme, the priority sequence numbers of the same data source in different processing cycles are displayed. Non-linear changes.
  • Manner 1 Divide the multiple data sources in the N-th level of arbitration into multiple data source groups, each data source group includes at least one data source, wherein the codes are assigned to the data sources in a set order , Including: determining the code corresponding to each data source group according to the coding sequence and the number of data sources of each data source group;
  • the codes corresponding to the data source group are assigned to the data sources of the data source group one by one.
  • the codes are sorted from small to large according to the corresponding value of the code, 000, 001, 010, 011, 100, 101, 110, and 111.
  • the data sources include data0 data source, data1 data source, data2 data source, data3 data source, and data4 data source.
  • Data5 data source, data6 data source and data7 data source, data0, data1, data2, data3 can be output from channel a
  • data4, data5, data6 and data7 can be output from channel b, for example, according to the data source output channel, the above data
  • the sources are divided into two groups, the first group includes data0, data1, data2, and data3, and the second group includes data4, data5, data6, and data7.
  • the corresponding to the first group The codes of can be: 000, 001, 010, 011, and the corresponding codes of the second group can be: 100, 101, 110, 111. Then first assign the codes corresponding to the first group to the first group data0, data1, data2, and data3 one by one, and assign the codes corresponding to the second group to the data source of the second group one by one, and get the following table 4:
  • the codes when the codes are assigned to the data sources in a set order, the codes may also be assigned to the data sources one by one according to the order of the codes.
  • the codes can be assigned to each data source in the first group one by one from small to large.
  • codes are allocated to one group, the remaining codes are assigned to the data sources of the second group one by one from small to large.
  • the present disclosure does not limit the number of data source groups, the number of data sources of each data source group, and the manner in which codes are assigned to data sources in a set order.
  • Manner 2 The coded bits of each code can be exchanged to generate the exchange code corresponding to each code; the code is allocated to all data sources in the Nth level of arbitration according to the set order, including According to the sequence of the encoding, the number of data sources in each data source group, and the interchange code corresponding to each code, the interchange code corresponding to each data source group is determined; the interchange codes corresponding to the data source group are assigned to one by one The data sources of the data source group, and make the priority order numbers of any two data sources with adjacent physical serial numbers not adjacent; the target encoding corresponding to the data source corresponding to each candidate data according to the encoding includes: The interchange code of the data source corresponding to the candidate data is determined as the target code of the data source corresponding to the candidate data.
  • the coded bits of the code are exchanged to generate an exchange code, and 000, 001, 010, 011, 100, 101, 110, and 111 are exchanged symmetrically.
  • Generate interchange codes and get the following table 5:
  • the data sources are divided into two groups.
  • the first group includes data0 data sources, data1 data sources, data2 data sources, and data3 data sources
  • the second group includes data4 data sources and data5.
  • the data source, data6 data source and data7 data source can determine the interchange code corresponding to each data source group according to the encoding sequence, the number of data sources of each data source group, and the interchange code corresponding to each code. For example, it is determined that the interchange codes corresponding to the first group are: 000, 100, 010, and 110.
  • the corresponding interchange codes for the second group are: 001, 101, 011, and 111.
  • the exchange codes corresponding to the first group can be assigned to the first group data0, data1, data2, and data3 one by one, and the exchange codes corresponding to the second group can be assigned to the data sources of the second group one by one, and the following table 6 is obtained:
  • the interchangeable codes corresponding to each code can also be assigned to each data source one by one according to the order of the codes.
  • the interchangeable codes corresponding to the codes are assigned to each data source in the first group one by one.
  • the first group is all allocated with interchange codes, the interchange codes corresponding to the remaining codes are assigned to the data sources of the second group one by one.
  • steps S324 to S326 that must be performed in each processing cycle with reference to FIGS. 4 and 5:
  • step S324 a corresponding target code is generated for the data source corresponding to each candidate data according to the code.
  • multiple candidate data can be arbitrated at one time.
  • the ARB7 can arbitrate the candidate data provided by the data source data0 and the candidate data provided by the data source data7.
  • step S324 may be to exchange the coded bits of the code assigned to the target data source corresponding to the candidate data to generate an exchange code;
  • the exchange code is determined as the target code of the target data source corresponding to the candidate data.
  • 000, 001, 010, 011, 100, 101, 110, and 111 are assigned to the data one by one in the order of data0, data1, data2, data3, data4, data5, data6, and data7
  • the coded bits of the code are exchanged to generate an exchange code, and the following table 7 is obtained:
  • the codes include: 000, 001, 010, 011, 100, 101, 110, and 111
  • the interchange codes obtained by the bit swap also include: 000, 001, 010, 011, 100, 101, 110, and 111.
  • the encoding of some data sources is the same as the interchange encoding, and the encoding of some data sources is different from the interchange encoding.
  • step S324 specifically allocates the generated interchange codes to the data source one by one in order.
  • the interchange codes are as shown in Table 5, and the generated interchange codes are assigned to the data source one by one in order to obtain the same table as in Table 6.
  • step S325 according to the target code and the priority order corresponding to the target code, arbitrate the data source corresponding to each candidate data to determine the target data;
  • step S326 the priority order of all data sources of all levels of arbitration is updated according to the arbitration result.
  • step S326 the priority of the same data source in different processing cycles can be made different, and the priority order numbers of the same data source in different processing cycles satisfy a non-linear relationship.
  • the priority order corresponding to the target code may be determined according to the priority order of the code, or may be determined by itself, for example, determined according to the numerical order corresponding to the target code, the implementation of the present disclosure The example does not limit it.
  • the data source corresponding to the target code is arbitrated, and the data source that obtains the right to use the channel is determined.
  • the priority of the target code of the data source of the channel use right is reduced to the last bit in the priority order of all data sources (that is, the priority order code becomes the largest).
  • the priority order of the data source is determined to be data0>data4>data2 >data6>data1>data5>data3>data7, assuming that the data0 data source and data4 data source are arbitrated, and the data0 data source gets the priority of the data channel. In the next arbitration, the priority of the data0 data source becomes the lowest, after the priority order is updated
  • the order of is data4>data2>data6>data1>data5>data3>data7>data0.
  • each data source is coded in the order generated by the above binary method, the code of the data0 data source is 000, and the code of the data1 data source is 001.
  • the code of data2 data source is 010, the code of data3 data source is 011, the data source of channel5 input ARB7 may be data0 data source, data1 data source, data2 data source or data3 data source, data4 data source code is 100, data5 data
  • the source code is 101, the code of data6 data source is 110, the code of data7 data source is 111, the data source of channel6 input ARB7 may be data4 data source, data5 data source, data6 data source or data7 data source, each data source
  • the codes of the data source are exchanged center-symmetrically, and the interchange codes of each data source are determined as: the code of data0 data source is 000, the code of data1 data source is 100, the code of data2 data source is 010, and the code of data3 data source is 110 ,
  • the code of data4 data source is 001, the code of data5 data source is 101, the code of data6 data source is 011, and the code of data7 data source is 111.
  • the initial priority order is 000>001
  • the first data arbitration (that is, the first processing cycle) is performed for the first time, specifically: assuming that the input data source of channel5 is the data0 data source (that is, the data provided by the data0 data source is the candidate data), and the target code is 000, assuming The input data source of channel6 is the data4 data source (that is, the data provided by the data4 data source is candidate data), and the target code is 001. Since the priority order is 000>001, the priority of the data0 data source is determined to be higher than the priority of the data4 data source Therefore, the data0 data source obtains the right to use channel7.
  • the priority of the data0 data source is reduced to the lowest, and the update priority order is 001>010>011>100>101>110>111> 000;
  • the second data arbitration (that is, the second processing cycle) is carried out, specifically: Assume that the input data source of channel5 is the data1 data source (that is, the data provided by the data1 data source is the candidate data), and the target code is 100 , Assuming that the input data source of channel6 is the data4 data source (that is, the data provided by the data4 data source is the candidate data), the target code is 001, because the priority order is 001>100, the priority of the data4 data source is determined to be higher than the data1 data source Therefore, the data4 data source obtains the right to use channel7.
  • the priority of the data4 data source is reduced to the lowest, and the update priority order is 010>011>100>101>110>111>000>001 ;
  • the third data arbitration (that is, the third processing cycle) is carried out, specifically: assuming that the input data source of channel5 is the data1 data source (that is, the data provided by the data1 data source is the candidate data), and the target code is 100, Assume that the input data source of channel6 is the data5 data source (that is, the data provided by the data5 data source is the candidate data), and the target code is 101.
  • the priority order is 100>101, it is determined that the priority of the data1 data source is higher than that of the data5 data source Priority, so the data1 data source gets the right to use channel7.
  • the priority of the data1 data source is reduced to the lowest, and the update priority order is 010>011>101>110>111>000> 001>100;
  • the fourth data arbitration (that is, the fourth processing cycle) is carried out, specifically: assuming that the input data source of channel5 is the data2 data source (that is, the data provided by the data2 data source is the candidate data), the target code is 010, assuming The input data source of channel6 is the data5 data source (that is, the data provided by the data5 data source is the candidate data), and the target code is 101.
  • the priority order is 101>010, determine the data5 number
  • the priority of the data source is higher than the priority of the data2 data source, so the data5 data source gets the right to use channel7.
  • the priority of the data5 data source is reduced to the lowest, and the update priority order is 010>011>110 >111>000>001>100>101; then perform the fifth data arbitration (that is, the fifth processing cycle), specifically: assuming that the input data source of channel5 is the data2 data source (that is, the data provided by the data2 data source) Is candidate data), the target code is 010, assuming the input data source data6 data source of channel6 (that is, the data provided by the data6 data source is candidate data), the target code is 011, because the priority order 010>011, determine the data2 data source The priority of the data source is higher than the priority of the data6 data source, so the data2 data source obtains the right to use channel7.
  • the priority of the data2 data source is reduced to the lowest, and the update priority order is >011>110>111> 000>001>100>101>010; then the sixth data arbitration (that is, the sixth processing cycle) is carried out, specifically: assuming that the input data source of channel5 is the data3 data source (that is, the data provided by the data3 data source is Candidate data), the target code is 110, assuming that the input data source of channel6 is the data6 data source (that is, the data provided by the data6 data source is the candidate data), and the target code is 011.
  • the priority order is 110>011, determine the data6 data source The priority of the data source is higher than the priority of the data3 data source, so the data6 data source gets the right to use channel7.
  • the priority of the data6 data source is reduced to the lowest, and the update priority order is 110>111>000>001 >100>101>010>011; then the seventh data arbitration (that is, the seventh processing cycle) is performed, specifically: assuming that the input data source of channel5 is the data3 data source (that is, the data provided by the data3 data source is a candidate Data), the target code is 110, assuming that the input data source of channel6 is the data7 data source (that is, the data provided by the data7 data source is candidate data), the target code is 111, because the priority order is 110>111, determine the data3 data source The priority is higher than the priority of the data7 data source, so the data3 data source gets the right to use channel7.
  • the priority of the data3 data source is reduced to the lowest, and the update priority order is 111>000>001>100> 101>010>011>110; then the eighth data arbitration (ie, the eighth processing cycle) is performed, specifically: assuming that the input data source of channel5 is the data0 data source (ie, The data provided by the data0 data source is the candidate data), the target code is 000, assuming that the input data source of channel6 is the data7 data source (that is, the data provided by the data7 data source is the candidate data), the target code is 111, because the priority order is 111 >000, it is determined that the priority of the data7 data source is higher than the priority of the data0 data source, so the data7 data source obtains the right to use channel7.
  • the eighth data arbitration ie, the eighth processing cycle
  • the priority of the data7 data source is reduced to the lowest, and the update priority order is 000>001>100>101>010>011>110>111.
  • the subsequent data arbitration method is the same as that described above, and it will not be repeated without invention.
  • the data output by channel5 and the data output by channel6 alternately obtain the right to use channel7, which solves the problem of unbalanced data transmission delay, and as the number of data sources of channel5 and channel6 increases, the more it can be displayed.
  • the effect of the equalization of the data transmission delay is described.
  • the multiple candidate data respectively carry an identification code (Identity Document, ID), and the ID is used to identify the data source of the candidate data.
  • ID an identification code
  • the first data and the second data respectively, where the first data and the second data respectively carry IDs, here,
  • the ID is used to identify the data source of the first data and the data source of the second data.
  • the received first data comes from the data2 data source shown in Figure 2
  • the second data comes from the data1 data source output by channel1, where the ID value of each data source is in accordance with The ID value of each data is different if it is encoded by the set binary encoding rule.
  • the data source is encoded according to 0 ⁇ n
  • the ID of data0 data source is 000
  • the ID of data1 data source is 001
  • the data source of data2 The ID of the data source is 010
  • the ID of the data3 data source is 011
  • the ID of the data4 data source is 100.
  • the number of bits of the binary code is based on actual conditions, and the embodiment of the present disclosure does not limit it .
  • step S320 may include the following steps S321' to S323', specifically:
  • step S321' the logical difference between the ID carried by the multiple candidate data and the reference ID is determined respectively, wherein the reference ID has different values in different processing cycles.
  • the reference ID is a numerical value having the same base as the ID carried by the data.
  • the ID of each data is encoded according to a binary coding rule, and the reference ID may be a binary numerical value.
  • the logical difference refers to a value determined according to the reference ID and the ID carried in the data according to the subtraction rule of the reference ID corresponding to the base. For example, it can be the value obtained by subtracting the reference ID from the ID carried in the data according to the binary subtraction rule.
  • the reference ID is stored in the status registering unit. Taking two data as an example, the ID carried in the first data and the second data is determined respectively and the channel obtained during the last arbitration The logical difference of the ID of the priority data, where the ID of the data acquiring the channel priority is the reference ID stored in the status register unit.
  • the first data is data from the data2 data source, and the ID is 010
  • the second data is data from the data3 data source, and the ID is 011, which was obtained during the last arbitration
  • the ID of the channel priority data is 011 (reference ID is 011)
  • step S322' the priority of the data source corresponding to the multiple candidate data is determined according to the multiple determined logical differences.
  • the data sources with the same ID have different logical differences in different processing cycles, which means that the data sources with the same ID have different priorities in different processing cycles.
  • the non-linear relationship between the priority order numbers of the same data source in different processing cycles can also be satisfied.
  • step S323' the one with the highest priority of the data source among the plurality of candidate data is used as the target data.
  • the target data is data for obtaining the priority use right of the channel among multiple data.
  • the multiple logical differences are compared; the data source corresponding to the largest logical difference among the multiple logical differences is determined as the data source with the highest priority, and the The data output by the data source with the highest priority is used as the target data.
  • ARB3 compares the logical difference between the ID of the first data and the reference ID of 001, and the logical difference between the ID of the second data and the reference ID of 010, and compares 001 to 010. Therefore, the priority of the second data is higher than that of the first data.
  • the priority of a data, the right to use channel4 is obtained (the priority of the data source of the second data is higher than the priority of the data source of the first data).
  • the magnitudes can be directly compared as described above, or the multiple logical differences can be sorted from small to large or from large to small, and according to The sorting result determines the largest logical difference value, which is not limited in the present disclosure.
  • the target data obtains the use right of the channel and can be transmitted preferentially.
  • the priority of the target data is higher than the priority of other data.
  • the target data in the multiple data can be determined according to the logical difference. Since the logical difference determined by each calculation is different, the determined target data is dynamically changed, and because each level of arbitration The above methods are used to determine the data to be transmitted preferentially, that is, the priority during data transmission is determined, so that the need for data priority adjustment can be met when the amount of data is unevenly distributed.
  • the ID of the target data in the previous processing cycle is the reference ID of the current processing cycle.
  • the ARB3 may save the ID value 011 of the data source data3 of the second data in the state register unit of the ARB3 for the next arbitration of the ARB3 (that is, enter the next processing cycle).
  • the reference ID is determined according to the target data ID that currently obtains the channel use right, and the updated reference ID is used to determine the ID of the target data that obtains the channel use right in the next arbitration (ie, the next processing cycle).
  • the data source of the target data determined in each processing cycle is dynamically changing, so as to realize the dynamic adjustment of the data priority.
  • each level of arbitration is to determine the data to be transmitted preferentially through the above-mentioned method, that is, to determine the priority during data transmission, so that the need for data priority adjustment can be met when the amount of data is unevenly distributed.
  • the first data may be the data source of data0, data1, data2, data3, and data4.
  • Data the second data may also be the data of the data0 data source, data1 data source, data2 data source, data3 data source, and data4 data source.
  • the embodiment of the present disclosure does not limit it, as long as the first data and the second data The data is different.
  • the initial value of the status register unit is 0, that is, in the first processing cycle, the reference ID may be 0.
  • each data source is coded in the above order.
  • the IDs of the data0 and data0 data sources are 000, and the IDs of the data1 and data1 data sources are 001, data2 and
  • the ID of the data2 data source is 010, the ID of the data3 and data3 data sources is 011, the ID of the data source of channel2 input ARB3 may be 000, 001, 010, and the ID of data3 input ARB3 is 011.
  • the status register unit inside ARB3 The initial value is 000.
  • the first data arbitration (that is, the first processing cycle), assuming that channel2 inputs the data with ID 010 and the data provided by data3 data source, the ID of data3 data source is 011, and the logical difference of ID is determined to be 010 -000 ⁇ 011-000, so the data provided by the data3 data source with ID 011 obtains the right to use channel3, and the value of the status register unit in ARB3 is updated to 011; then the second data arbitration (that is, the second Processing cycle), channel2 input data with ID 010, data3 data source with data source ID 011 continues to input data with data source ID 011, since the value of the status register unit in ARB3 is updated to 011, determine the logic of ID The difference is 010-011>011-011, so the data provided by the data source with ID 010 input by channel2 gets the right to use channel3, and the value of the status register unit in ARB3 is updated to 010; then the third data Arbitration (that is, the third processing cycle), suppose the input of channel2 is the data provided by the data source with
  • the data provided by the data source obtains the right to use channel3, and at the same time, update the value of the status register unit in ARB3 to 000;
  • the fourth data arbitration (that is, the fourth processing cycle), assuming that channel2 inputs data provided by the data source with ID 001, and data3 data source provides data with ID 011, due to the status register unit in ARB3
  • the value is updated to 000, and the logical difference of ID is determined to be 001-000 ⁇ 011-000, so the data with ID 011 provided by the data3 data source obtains the right to use channel3, and the value of the status register unit in ARB3 is updated to 011 ;
  • the IDs of the 3 pieces of data are 000, 001, and 010, respectively.
  • the initial value of the reference ID is 000.
  • the logical difference between each ID and the reference ID can be determined separately, for example, the logical difference is 000, 001, and 010, respectively. It can be determined that the maximum logical difference is 010, the data with ID 010 obtains the right to use the transmission channel (current arbitration, the priority of the data with ID 010 is higher than the priority of the other two data), the data with ID 010 is transmitted, Update the value of the reference ID to 010. Continue to receive multiple data.
  • the IDs of the 3 data are 000, 001 and 010, respectively, and determine the logical difference with the reference ID (010).
  • the logical difference is 110, 111, and 000 respectively, and the maximum logical difference is The value is 111, and the data with ID 001 gets the right to use the transmission channel (current arbitration, the priority of the data with ID 001 is higher than the priority of the other two data), the data with ID 001 is transmitted, and the value of ID will be referred to Update to 001.
  • the IDs of the 3 data are 000, 001 and 010, respectively, and determine the logical difference with the reference ID (001).
  • the logical difference is 111, 000, and 001
  • the maximum logical difference is The value is 111
  • the data with ID of 000 obtains the right to use the transmission channel (current arbitration, the priority of the data with ID of 000 is higher than the priority of the other two data)
  • the data with ID of 000 is transmitted, and the value of ID will be referred to Update to 000, and so on, so I won’t repeat it here.
  • the priority of multiple data can be dynamically adjusted, so that multiple data can obtain the right to use the transmission channel in a more balanced manner.
  • the method further includes:
  • step S330 the target data is transmitted.
  • the arbiter may be a component module of the NOC.
  • Fig. 7 is a schematic diagram of a data processing device provided by an embodiment of the present disclosure.
  • the data processing apparatus of this embodiment includes: a candidate data determining unit 710 and a target data determining unit 720.
  • the receiving unit 710 is configured to determine multiple candidate data, where the candidate data is provided by a corresponding data source.
  • the target data determining unit 720 is configured to determine target data according to the priorities of the data sources corresponding to each of the multiple candidate data in the current cycle, where the same data source has different priorities in different processing cycles, and the same data The priority order numbers of the sources in different processing cycles satisfy a non-linear relationship.
  • the device provided by the present disclosure is used to implement the above-mentioned method provided by the present disclosure.
  • the principle and beneficial effects of the method have been described in detail above, and will not be repeated here.
  • the target data determining unit 720 may include a number determining subunit 721, an encoding generating subunit 722, an allocation subunit 723, and a target encoding generating subunit.
  • the number determining subunit 721 is used to determine the number of data sources in the Nth level of arbitration, where N is a natural number, and 1 ⁇ N ⁇ M, and M is the total number of arbitration levels in the current processing cycle.
  • the code generation subunit 722 is configured to generate codes according to the set coding mode according to the number of data sources in the Nth level of arbitration.
  • the allocation subunit 723 is used to allocate all the generated codes to all data sources in the Nth level of arbitration according to the set priority order.
  • the target code generation subunit 724 is configured to generate a corresponding target code for the data source corresponding to each candidate data according to the code.
  • the arbitration subunit 725 is configured to arbitrate the data source corresponding to each candidate data according to the target code and the priority order corresponding to the target code to determine the target data.
  • the order update subunit 726 is used to update the priority order of all data sources of all levels of arbitration according to the arbitration result.
  • the target data determining unit 720 may include a logical difference determining subunit 721', a priority determining subunit 722', and a target data determining subunit. 723'.
  • the logical difference determining subunit 721' is used to determine the logical difference between the ID and the reference ID carried by the multiple candidate data, wherein the reference ID has different values in different processing cycles.
  • the priority determining subunit 722' is used to determine the priority of the data source corresponding to the multiple candidate data according to the multiple determined logical differences.
  • the target data determining subunit 723' is configured to use the one with the highest priority of the data source among the plurality of candidate data as the target data.
  • the device may further include a data transmission unit 730, and the data transmission unit 730 is configured to transmit the target data.
  • Fig. 10 is a schematic structural diagram of an electronic device according to an embodiment of the present disclosure.
  • the electronic device of this embodiment includes a processing core 11-1L and a network on chip 14.
  • the processing cores 11-1L are all connected to the on-chip network 14.
  • the network on chip 14 is used to exchange data between the L processing cores and external data.
  • the electronic device provided in the present disclosure can implement the data processing method provided in the first aspect of the present disclosure.
  • the present disclosure there are no special restrictions on the specific form and specific location of the method.
  • the method may be executed through the network on chip 14 or may be executed through at least one of the multiple processing cores.
  • the method can be implemented by software, or can be implemented by hardware.
  • instructions may be stored in the network-on-chip 14 and the network-on-chip 14 implements the method according to the instructions.
  • corresponding hardware can be configured on the network on chip 14 to implement the method.
  • an instruction may be stored in at least one of the multiple processing cores, and the processing core storing the instruction implements the method according to the instruction.
  • corresponding hardware may be configured in at least one of the multiple processing cores to implement the method.
  • aspects of the embodiments of the present disclosure may be implemented as a system, a method, or a computer program product. Therefore, various aspects of the embodiments of the present disclosure may take the following forms: a complete hardware implementation, a complete software implementation (including firmware, resident software, microcode, etc.), or may be generally referred to as “circuits” and “modules” in this document. "Or “system” is an implementation that combines software and hardware aspects.
  • various aspects of the embodiments of the present disclosure may take the following form: a computer program product implemented in one or more computer-readable media, the computer-readable medium having computer-readable program code implemented thereon.
  • the computer-readable medium may be a computer-readable signal medium or a computer-readable storage medium.
  • the computer-readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any appropriate combination of the foregoing.
  • a computer-readable storage medium may be any tangible medium that can contain or store a program used by an instruction execution system, device, or device, or a program used in conjunction with an instruction execution system, device, or device.
  • the computer-readable signal medium may include a propagated data signal having computer-readable program code implemented therein as in baseband or as part of a carrier wave. Such a propagated signal can take any of a variety of forms, including but not limited to: electromagnetic, optical, or any suitable combination thereof.
  • the computer-readable signal medium may be any of the following computer-readable media: it is not a computer-readable storage medium, and it can communicate and propagate the program used by the instruction execution system, device or device or used in conjunction with the instruction execution system, device or device Or transmission.
  • Any suitable medium including but not limited to wireless, wired, fiber optic cable, RF, etc. or any appropriate combination of the foregoing can be used to transmit the program code implemented on the computer-readable medium.
  • the computer program code used to perform the operations of the various aspects of the embodiments of the present disclosure can be written in any combination of one or more programming languages, the programming languages including: object-oriented programming languages such as Java, Smalltalk, C++, etc.; And conventional process programming languages such as "C" programming language or similar programming languages.
  • the program code can be executed as an independent software package entirely on the user's computer, partly on the user's computer; partly on the user's computer and partly on a remote computer; or entirely on the remote computer or server.
  • the remote computer can be connected to the user's computer through any type of network including a local area network (LAN) or a wide area network (WAN), or can be connected with an external computer (for example, by using the Internet of an Internet service provider) .
  • LAN local area network
  • WAN wide area network
  • an external computer for example, by using the Internet of an Internet service provider
  • These computer program instructions can also be stored in a computer-readable medium that can direct a computer, other programmable data processing equipment, or other devices to operate in a specific manner, so that the generation of instructions stored in the computer-readable medium includes implementation in the flowcharts and / Or block diagram block or the product of the instruction of the function/action specified in the block.
  • Computer program instructions can also be loaded on a computer, other programmable data processing equipment or other devices, so that a series of operable steps are executed on the computer, other programmable equipment or other devices to generate a computer-implemented process, so that the computer Or instructions executed on other programmable devices provide a process for implementing the functions/actions specified in the flowchart and/or block diagrams or blocks.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Bus Control (AREA)

Abstract

本公开提供了一种数据处理的方法、装置及电子设备,用于解决如何高效的在多个数据源中确定优先传输的数据源,并动态调整数据的优先级顺序的问题。在各个处理周期内,所述方法包括:确定多个候选数据,其中,所述候选数据由相应的数据源提供;根据所述多个候选数据所各自对应的数据源在当前周期中的优先级,确定目标数据,其中,同一数据源在不同处理周期中的优先级不同,且同一数据源在不同处理周期中的优先级次序号之间满足非线性关系。

Description

数据处理的方法、装置和电子设备、存储介质和程序产品 技术领域
本公开涉及通信技术领域,尤其涉及一种数据处理的方法、一种数据处理的装置、一种电子设备、一种计算机可读存储介质和一种计算机程序产品。
背景技术
随着人工智能技术的发展,用户对芯片处理能力的要求越来越高,由于单核芯片的处理能力有限,因此众核芯片的使用越来越广泛。在众核芯片设计中,使用片上网络(Networks on Chip,NOC)实现核与核之间的通信,因此,NOC的性能是众核芯片性能的关键;核与核之间通过数据通道进行通信,通过数据通道的仲裁提高NOC的性能,即提高NOC的通信效率。
因此,在实现多级仲裁时,如何高效的在多个数据源中确定优先传输的数据源,并动态调整数据的优先级顺序是目前需要解决的问题。
发明内容
有鉴于此,本公开实施例提供了一种数据处理的方法、装置及电子设备,用于解决现有技术中如何高效的在多个数据源中确定优先传输的数据源,并动态调整数据的优先级顺序的问题。
根据本公开实施例的第一个方面,提供了一种数据处理的方法,在各个处理周期内,所述方法包括:确定多个候选数据,其中,所述候选数据由相应的数据源提供;根据所述多个候选数据所各自对应的数据源在当前周期中的优先级,确定目标数据,其中,同一数据源在不同处理周期中的优先级不同,且同一数据源在不同处理周期中的优先级次序号之间满足非线性关系。
通过本公开实施例所提供的数据处理方法,使得不同处理周期中同一数据源的优先级次序变化不规律,这样,在依次进行的多个处理周期中,有限输出至目的地的数据所来自的数据源也更加随机,增加了到达目的地的数据源数量的均衡性。
由于不同处理周期中同一数据源的优先级次序变化不规律,那么,在不同周期中各通道传输的数据的来源也是不断变化的,从而使得数据传输时的延时更加均衡。
在一个实施例中,在一个处理周期中,所述根据所述多个候选数据所各自对应的数据源在当前周期中的优先级,确定目标数据,包括:
确定第N级仲裁时的数据源个数,其中,N为自然数,且1≤N≤M,M为当前处理周期中的仲裁总级数;
根据第N级仲裁时的数据源个数按照设定编码方式生成编码;
将生成的所有编码按照设定优先级顺序分配给第N级仲裁时的所有数据源;
在每个处理周期中,所述根据所述多个候选数据所各自对应的数据源在当前周期中的优先级,确定目标数据,均包括:
根据所述编码为各个候选数据对应的数据源生成对应的目标编码;
根据所述目标编码以及所述目标编码对应的优先级顺序,仲裁各个候选数据对应的数据源,以确定所述目标数据;
根据仲裁结果更新各级仲裁所有数据源的优先级顺序。
在一个实施例中,所述根据第N级仲裁时的数据源个数按照设定编码方式生成编码,包括:
根据第N级仲裁时的数据源个数按照二进制方式生成编码,所述编码的个数等于第N级仲裁时的数据源的个数。
在一个实施例中,第N级仲裁时的多个数据源被划分为多个数据源组,各数据源组包括至少一个数据源,
其中,所述将生成的所有编码按照设定优先级顺序分配给第N级仲裁时的所有数据源,包括:
根据所述编码的顺序和各数据源组的数据源个数,确定各数据源组对应的编码;
将所述数据源组对应的编码逐一分配给所述数据源组的数据源。
在一个实施例中,所述根据所述编码为各个候选数据对应的数据源生成对应的所述目标编码,包括:
将所述候选数据对应的数据源分配到的所述编码的编码位进行对位 互换,生成互换编码;
将所述互换编码确定为所述数据源的所述目标编码。
在一个实施例中,第N级仲裁时的多个数据源被划分为多个数据源组,各数据源组包括至少一个数据源,
所述方法还包括在所述根据第N级仲裁时的数据源个数按照设定编码方式生成编码的步骤与所述将生成的所有编码按照设定优先级顺序分配给第N级仲裁时的所有数据源的步骤之间进行的:将所述编码的编码位进行对位互换,生成各编码对应的互换编码;
所述将生成的所有编码按照设定优先级顺序分配给第N级仲裁时的所有数据源,包括:
根据所述编码的顺序、各数据源组的数据源个数以及各编码对应的互换编码,确定各数据源组对应的互换编码;
将所述数据源组对应的互换编码逐一分配给所述数据源组的数据源;
所述根据所述编码为各个候选数据对应的数据源生成对应的目标编码包括:
将所述候选数据对应的数据源的互换编码确定为所述候选数据对应的数据源的目标编码。
在一个实施例中,每个所述数据源均具有各自对应的物理序号,在第一级仲裁时,每两个物理序号相邻的数据源竞争一条数据通道的使用权,
在将生成的所有编码按照设定优先级顺序分配给第N级仲裁时的所有数据源的步骤中,任意两个物理序号相邻的数据源的优先级次序号不相邻。
在一个实施例中,在根据所述目标编码以及所述目标编码对应的优先级顺序,仲裁各个候选数据对应的数据源,以确定所述目标数据的步骤中,优先级高的目标编码对应的候选数据为所述目标数据,所述目标数据为获得通道使用权的数据;
所述根据仲裁结果更新各级仲裁所有数据源的优先级顺序,包括:
将所述目标数据的数据源的目标编码的优先级降低为所有数据源的优先级顺序中的最后一位。
在一个实施例中,所述多个候选数据分别携带标识码ID,所述ID用于标识所述候选数据的数据源;
所述根据所述多个候选数据所各自对应的数据源在当前周期中的优先级,确定目标数据,包括:
分别确定所述多个候选数据携带的ID与参考ID的逻辑差值,其中,所述参考ID在不同处理周期中具有不同的值;
根据确定的多个逻辑差值确定所述多个候选数据对应的数据源的优先级;
将所述多个候选数据中数据源的优先级最高的一者作为所述目标数据。
在一个实施例中,从第二个处理周期开始,上一个处理周期中的目标数据源的ID为当前处理周期的参考ID。
在一个实施例中,所述根据所述多个逻辑差值确定所述多个候选数据中的目标数据,包括:
将所述多个逻辑差值进行比较;
确定所述多个逻辑差值中最大的逻辑差值对应的数据源为优先级最高的数据源,并将所述优先级最高的数据源输出的数据作为所述目标数据。
在一个实施例中,所述参考ID存储在状态寄存单元中。
在一个实施例中,第一个处理周期中的参考ID的值为0。
在一个实施例中,所述根据所述多个候选数据所各自对应的数据源在当前周期中的优先级,确定目标数据,还包括在分别确定所述多个候选数据携带的标识码ID与参考ID的逻辑差值的步骤之前进行的:
设定所述多个候选数据的ID。
在一个实施例中,所述方法还包括:
传输所述目标数据。
根据本公开实施例的第二个方面,提供了候选数据确定单元,用于确定多个候选数据,其中,所述候选数据由相应的数据源提供;
目标数据确定单元,用于根据所述多个候选数据所各自对应的数据源在当前周期中的优先级,确定目标数据,其中,同一数据源在不同处 理周期中的优先级不同,且同一数据源在不同处理周期中的优先级次序号之间满足非线性关系。
根据本公开实施例的第三个方面,提供了一种电子设备,所述电子设备包括:多个处理核;以及片上网络,被配置为交互所述多个处理核间的数据和外部数据;其中,
所述片上网络还被配置为能够执行本公开第一个方面所述的方法;或者所述多个处理核中的至少一个被配置为能够执行本公开第一个方面所述的方法。
根据本公开实施例的第四个方面,提供了一种计算机可读存储介质,其上存储计算机程序指令,所述计算机程序指令在被处理器执行时实现如第一方面或第一方面任一种可能所述的方法。
根据本公开实施例的第五个方面,提供了一种计算机程序产品,所述计算机程序产品在计算机上运行时,使得所述计算机执行如第一方面或第一方面任一种可能所述的方法。
通过本公开实施例所提供的数据处理方法,使得不同处理周期中同一数据源的优先级次序变化不规律,这样,在依次进行的多个处理周期中,有限输出至目的地的数据所来自的数据源也更加随机,增加了到达目的地的数据源数量的均衡性。
由于不同处理周期中同一数据源的优先级次序变化不规律,那么,在不同周期中,各通道传输的数据的来源也是不断变化的,从而使得数据传输时的延时更加均衡。
附图说明
通过以下参照附图对本公开实施例的描述,本公开的上述以及其它目的、特征和优点将更为清楚,在附图中:
图1是现有技术中提供的一种数据传输示意图;
图2是现有技术中提供的另一种数据传输示意图;
图3是本公开提供的数据处理的一种实施方式的方法流程图;
图4是本公开提供的数据处理的另一种实施方式的方法流程图;
图5是本公开提供的数据处理的又一种实施方式的方法流程图;
图6是本公开提供的数据处理的还一种实施方式的方法流程图;
图7是本公开所提供的数据处理的装置一种实施方式的模块示意图;
图8是本公开所提供的数据处理的装置另一种实施方式的模块示意图;
图9是本公开所提供的数据处理的装置又一种实施方式的模块示意图;
图10是本公开一实施例提供的一种电子设备结构示意图。
具体实施方式
以下基于实施例对本公开进行描述,但是本公开并不仅仅限于这些实施例。在下文对本公开的细节描述中,详尽描述了一些特定的细节部分。对本领域技术人员来说没有这些细节部分的描述也可以完全理解本公开。为了避免混淆本公开的实质,公知的方法、过程、流程、元件和电路并没有详细叙述。
此外,本领域普通技术人员应当理解,在此提供的附图都是为了说明的目的,并且附图不一定是按比例绘制的。
除非上下文明确要求,否则在说明书的“包括”、“包含”等类似词语应当解释为包含的含义而不是排他或穷举的含义;也就是说,是“包括但不限于”的含义。
在本公开的描述中,需要理解的是,术语“第一”、“第二”等仅用于描述目的,而不能理解为指示或暗示相对重要性。此外,在本公开的描述中,除非另有说明,“多个”的含义是两个或两个以上。
通常情况下,在现有技术中NOC数据通道的仲裁方案,包括固定优先级仲裁方案和平权轮转优先级仲裁方案两种情况,所述数据通道的仲裁也就是根据仲裁确定数据的优先级,进而确定获得数据通道使用权的数据。
仲裁方案通常包括多级仲裁,作为一种实施方式,在第一级仲裁时,对所有待传输的数据进行仲裁。仲裁的级别越低、所涉及的数据通道数量越多,最高一级仲裁仅涉及一个仲裁通道,通过该仲裁通道的数据能够到达目的地。如图1中所示的仲裁方案包括三级仲裁,第一级仲裁涉及4个数据通道,分别为通道(channel)1、channel2、channel3、以及channel4;第二级仲裁涉及2个数据通道,分别为channel5以及channel6;第三级仲裁涉及1个数据通道,即channel7。
作为另一种实施方式,每级仲裁涉及的通道数量相同,并且,参与下一级仲裁的数据为上一级数据通道输出的数据、以及新输入的数据。如图2所示,第一级仲裁涉及的数据通道为channel1,第二级仲裁涉及的数据通道为channel2,第三级仲裁涉及的数据通道为channel3,第四级仲裁涉及的数据通道为channel4。
无论是采用图1中的仲裁方案还是采用图2中的仲裁方案,都存在上述固定优先级仲裁方案和平权轮转优先级仲裁方案两种情况。
情况一、固定优先级仲裁方案,数据源的优先级固定,适用于具有特定优先级顺序的仲裁,但是无法实现优先级的动态调整。举例说明,具体如图1所示,假设包括8个数据源,分别为数据(data)0数据源、data1数据源、data2数据源、data3数据源、data4数据源、data5数据源、data6数据源和data7数据源,上述8个数据源通过三个级别仲裁后传输至目的地,由于数据通道有限,多个数据需要竞争使用数据通道,例如,data0和data1根据第一级仲裁的仲裁器(arbiter,ARB)1判断优先级,竞争通道(channel)1的优先使用权;data2和data3根据第一级仲裁的ARB2判断优先级,竞争channel2的优先使用权;data4和data5根据第一级仲裁的ARB3判断优先级,竞争channel3的优先使用权;data6和data7根据第一级仲裁的ARB4判断优先级,竞争channel4的优先使用权;channel1的输出数据需要继续与channel2的输出数据通过第二级仲裁的ARB5判断优先级,竞争channel5的优先使用权,即竞争channel5的优先使用权的数据包括data0、data1、data2和data3;channel3的输出数据需要继续与channel4的输出数据通过第二级仲裁的ARB6判断优先级,竞争channel6的优先使用权,即竞争channel6的优先使用权的数据包括data4、data5、data6和data7;channel5的输出数据需要继续与channel6的输出数据通过第三级仲裁的ARB7判断优先级,竞争channel7的优先使用权,即竞争channel7的优先使用权的数据包括data0、data1、data2、data3、data4、data5、data6和data7;依次类推,本公开实施例对其不在赘述,直到数据传输至目的地。通过固定优先级仲裁方案可以预先设置每个数据所对应的数据源的优先级,假设在ARB1中设置data0数据源的数据的优先级高于data1数据源的数据的优先级,当data0数据源的数据和data1数据源的数据同时传入时,data0数据源的数据获取channel1的优先使用权,优先级无法更改。
下面结合图2介绍上述情况一,如上文中所述,由于数据通道有限,多个数据需要竞争使用数据通道,例如,data0和data1根据ARB1判断优先级,竞争channel1的优先使用权;channel1的输出数据需要继续与 data2根据ARB2进行仲裁,竞争channel2的优先使用权,channel2的输出数据需要和data3根据ARB3进行仲裁,竞争channel3的优先使用权,依次类推,本公开实施例对其不再赘述,直到数据传输至目的地。通过固定优先级仲裁方案可以预先设置每个数据所对应的数据源的优先级,假设在ARB1中设置data0数据源的数据的优先级高于data1数据源的数据的优先级,当data0数据源的数据和data1数据源的数据同时传入时,data0数据源的数据获取channel1的优先使用权,优先级无法更改。
情况二、平权轮转优先级仲裁方案,能够实现数据的优先级的动态调整,但是无法缓解数据传输延时的不均衡。举例说明,根据图1可知,将data0数据源至data7数据源按照如表1所示的编码顺序进行编码,表1中每个数据源的编码的长度为3比特,具体如下:
表1
数据源 编码
data0 000
data1 001
data2 010
data3 011
data4 100
data5 101
data6 110
data7 111
上述表1为数据源的编码,数据源的初始优先级顺序为,data0>data1>data2>data3>data4>data5>data6>data7,即对应的编码的优先级顺序为000>001>010>011>100>101>110>111,以上述初始优先级顺序为基础进行平权轮转优先级仲裁;假设,以第三级仲裁为例,ARB7从channel5输入的数据可能来源于数据源data0、data1、data2、data3,从channel6输入的数据可能来源于data4、data5、data6和data7,按照平权轮询仲裁方案,具体的仲裁过程如下:1、第一次数据仲裁:假设data0与data4竞争channel7的优先使用权,根据初始优先级顺序,确定data0获取优先使用权,由于平权轮转,因此下一次仲裁时data0的优先级变为最低,即数据源的优先级顺序为data1>data2>data3>data4>data5>data6>data7>data0,也就是说对应的编码的优先级顺序为001>010>011>100>101>110>111>000;2、第二次数据仲裁:假设data1继续与data4竞争channel7的优先使用权,同理,data1获取优先使用权,由于平权轮转,因此下一次仲裁时data1的优先级变为最低,即数据源 的优先级顺序为data2>data3>data4>data5>data6>data7>data0>data1,也就是说对应的编码的优先级顺序为010>011>100>101>110>111>000>001;3、第三次数据仲裁:假设data2继续与data4竞争channel7的优先使用权,同理,data2获取优先使用权,由于平权轮转,因此下一次仲裁时data2的优先级变为最低,即数据源的优先级顺序为data3>data4>data5>data6>data7>data0>data1>data2,也就是说对应的编码的优先级顺序为011>100>101>110>111>000>001>010;4、第四次数据仲裁:假设data3继续与data4竞争channel7的优先使用权,同理,data3获取优先使用权,由于平权轮转,因此下一次仲裁时data3的优先级变为最低,即数据源的优先级顺序为data4>data5>data6>data7>data0>data1>data2>data3,也就是说对应的编码的优先级顺序为100>101>110>111>000>001>010>011;5、第五次数据仲裁:假设data0继续与data4竞争channel7的优先使用权,同理,data4获取优先使用权,由于平权轮转,因此下一次仲裁时data4的优先级变为最低,即数据源的优先级顺序为data5>data6>data7>data0>data1>data2>data3>data4,也就是说对应的编码的优先级顺序为101>110>111>000>001>010>011>100;6、第六次数据仲裁:假设data0继续与data5竞争channel7的优先使用权,同理,data5获取优先使用权,由于平权轮转,因此下一次仲裁时data5的优先级变为最低,即数据源的优先级顺序为data6>data7>data0>data1>data2>data3>data4>data5,也就是说对应的编码的优先级顺序为110>111>000>001>010>011>100>101;7、第七次数据仲裁:假设data0继续与data6竞争channel7的优先使用权,同理,data6获取优先使用权,由于平权轮转,因此下一次仲裁时data5的优先级变为最低,即数据源的优先级顺序为data7>data0>data1>data2>data3>data4>data5>data6,也就是说对应的编码的优先级顺序为111>000>001>010>011>100>101>110;8、第八次数据仲裁:假设data0继续与data7竞争channel7的优先使用权,同理,data7获取优先使用权,由于平权轮转,因此下一次仲裁时data7的优先级变为最低,即数据源的优先级顺序为data0>data1>data2>data3>data4>data5>data6>data7,也就是说对应的编码的优先级顺序为000>001>010>011>100>101>110>111;由上述方案可知,在第一次数据仲裁至第四次数据仲裁的过程中,channel6的输出数据data4、data5、data6和data7被阻塞,在第五次数据仲裁至第八次数据仲裁的过程中,channel5的输出数据data0、data1、data2和data3被阻塞,造成了数据传输时的延时不均衡。
除了造成数据传输时的延时不均衡之外,第二种情况还可能会出现到达目的地的数据源数量的不均衡。
如图2所示,在将数据传输至目的地时,data0和data1竞争channel1使用权,此次竞争中与data0竞争的数据比例是1:1,data2和channel1输出的数据竞争channel2的使用权,此次竞争中与data2竞争的数据的比例是2:1,data3与channle2输出的数据竞争channel3的使用权,此次竞争中,与data3竞争数据的比例是3:1,data4与channel3输出的数据竞争channel4的使用权,此次竞争中,与data4竞争的数据的比例是4:1。由此可知,在最后一次竞争中,data4到达目的地的比例比其他数据到达目的地的比例大,这就造成了到达目的地的数据源数量不均衡。由于数据源数量的不均衡性,影响了仲裁方案的均衡性,无法满足对优先级调整的需求。
本公开实施例中,所述数据通道也可以称为传输通道,本公开实施例对其不做限定。
经本公开的发明人研究发现,在平权轮转优先级仲裁方案中造成数据传输时的延时不均衡、以及数据源数量不均衡的根本原因在于:
虽然同一数据源在不同次的仲裁中的优先级次序不同,但其优先级次序号呈线性变化(例如,随着仲裁次数的增加,某一数据源的优先级次序也逐渐增加,或者逐渐减小),这种线性变化过于规律,必然会导致经过多次仲裁受延时不均、以及到达目的地的数据源数量的不均衡。
有鉴于此作为本公开的一个方面,提供一种数据处理方法,从第二个处理周期开始,如图3所示,所述数据处理方法包括:
在步骤S310中,确定多个候选数据,其中,所述候选数据由相应的数据源提供;
在步骤S320中,根据所述多个候选数据所各自对应的数据源在当前周期中的优先级,确定目标数据,其中,同一数据源在不同处理周期中的优先级不同,且同一数据源在不同处理周期中的优先级次序号之间满足非线性关系。
需要解释的是,此处的“优先级次序号”是指,将数据源按优先级进行排列时,数据源的序号。
例如,在第一个处理周期中,数据源的优先级为:data0>data1>data2>data3>data4>data5>data6>data7,那么,这8个数据源的优先级次序号如表2所示:
表2
数据源 次序号
data0 1
data1 2
data2 3
data3 4
data4 5
data5 6
data6 7
data7 8
在例如,在另一处理周期中,数据源的优先级为:data3>data1>data0>data2>data6>data4>data5>data7,那么这8个数据源的优先级次序号如表3所示:
表3
数据源 次序号
data0 3
data1 2
data2 4
data3 1
data4 6
data5 7
data6 5
data7 8
通过本公开实施例所提供的数据处理方法,使得不同处理周期中同一数据源的优先级次序变化不规律,这样,在依次进行的多个处理周期中,有限输出至目的地的数据所来自的数据源也更加随机,增加了到达目的地的数据源数量的均衡性。
由于不同处理周期中同一数据源的优先级次序变化不规律,那么,在不同周期中,各通道传输的数据的来源也是不断变化的,从而使得数据传输时的延时更加均衡。
下面通过举例的方式来解释“同一数据源在不同处理周期中的优先级次序号之间满足非线性关系”。
假设在第一个处理周期中,数据源data0的优先级次序号为1,那么,在后续的4个处理周期中,数据源data0的优先级次序号可以分别为8、3、6、5。可以看出,1、8、3、6、5并不满足递增或递减的线性关系。
作为一种可选实施方式,对于任意数据源而言,在不同处理周期中优先级次序号比该任意数据源的优先级次序号小1的数据源为不同数据源,和/或,在相邻两个处理周期中,优先级次序号比该任意数据源的优先级次序号大1的数据源也为不同数据源。下面以举例的方式对上述规则进行就说明。
在第一个处理周期中,多个数据源的优先级为data0>data1>data2>data3>data4>data5>data6>data7。对于data4数据源而言,优先级次序号比data4数据源小1的数据源为data3,优先级次序号比data4数据源大1的数据源为data5数据源。
在第二个处理周期中,多个数据源的优先级为data3>data1>data0>data2>data6>data4>data5>data7。对于data4数据源而言,优先级次序号比data4数据源小1的数据源为data6数据源,优先级次序号比data4数据源大1的数据源为data5。
在上文中介绍了图1和图2两种数据传输方式,下面分别介绍当按照图1中的数据传输方式进行数据传输时如何实现本公开所提供的数据处理的方法、以及按照图2中的数据传输方式进行数据传输时,如何实现本公开所提供的数据处理的方法。
基于图1中所提供的仲裁方案,如图4所示,在一个处理周期中(该处理周期可以是第一个处理周期,也可以是其他处理周期),本公开所提供的数据处理的方法的步骤S320可以包括:
在步骤S321中,确定第N级仲裁时的数据源个数。
可选地,每个所述数据源均具有各自对应的物理序号,在第一级仲裁时,每两个物理序号相邻的数据源竞争一条数据通道的使用权。
N为可变量,可以取自1至M中的任意自然数。在图1中所示的实施方式中,M为3。
在一种可能的实现方式中,任一级仲裁(即,第N级仲裁)从两个数据通道的数据源获取数据,参与第N级仲裁数据源的个数至少为2个。
举例说明,如图1所示,第三级仲裁的ARB7从channel5和channel6对应的数据源获取数据,其中,从channel5的输出数据可能为data0、data1、data2和data3,从channel6的输出数据可能为data4、data5、data6和data7,即第三级仲裁的数据源个数为8。
此处,对于每一个数据源而言,其物理序号是不变的、可以对其进 行标识的序号。作为一种可选实施方式,data0中的“0”即为data0数据源的“物理序号”,data1中的“1”即为data1数据源的“物理序号”,依次类推。
需要指出的是,在图1中所示的数据传输方式中,在第一级仲裁中,data0数据源和data1数据源竞争channel1的使用权,data2数据源和data3数据源竞争channel2的使用权,data4数据源和data5数据源竞争channel3的使用权,data6数据源和data7数据源竞争channel4的使用权。此处物理序号仅仅是为了对数据源进行标识,而非对数据源的优先级进行限定。
在步骤S322中,根据第N级仲裁时的数据源个数按照设定编码方式生成编码。
在一种可能的实现方式中,根据所述编码确定出所述编码的优先级顺序。
在一种可能的实现方式中,根据所述数据源个数按照二进制方式生成编码,所述编码的个数等于所述数据源的个数。
举例说明,由于数据源个数为8,可以采用3比特的二级制编码,具体编码可以为000、001、010、011、100、101、110以及111,8个二级制编码;当数据源的个数为16,可以采用4比特的二级制编码,具体编码可以为0000、0001、0010、0011、0100、0101、0110、0111、1000、1001、1010、1011、1100、1101、1110、以及1111;本公开实施例中,随着数据源的增加,二进制编码时比特位数增加,具体根据实际情况确定。
在步骤S323中,将生成的所有编码按照设定优先级顺序分配给第N级仲裁时的所有数据源。
可选地,任意两个物理序号相邻的数据源的优先级次序号不相邻。
例如,data0数据源的物理序号与数据源data1的物理序号相邻,但是data0数据源的优先级次序号与data1数据源的优先级次序号不相邻。
在上文中所述的相关技术中,物理序号相邻的数据源优先级次序号也相邻,这导致了在平权轮转优先级仲裁方案中,同一数据源在不同处理周期的优先级次序号呈线性变化。在本公开实施例中,任意两个物理序号相邻的数据源的优先级次序号不相邻,可以实现在平权轮转优先级仲裁方案中,同一数据源在不同处理周期的优先级次序号呈非线性变化。
本公开实施例中,将所述编码按照设定顺序分配给所述数据源时,可以包括两种方式:
方式一、将第N级仲裁时的多个数据源划分为多个数据源组,各数据源组包括至少一个数据源,其中,所述将所述编码按照设定顺序分配给所述数据源,包括:根据所述编码的顺序和各数据源组的数据源个数,确定各数据源组对应的编码;
将所述数据源组对应的编码逐一分配给所述数据源组的数据源。
例如,编码按照编码对应数值从小到大排序,000、001、010、011、100、101、110以及111,数据源包括data0数据源、data1数据源、data2数据源、data3数据源、data4数据源、data5数据源、data6数据源和data7数据源,data0、data1、data2、data3可从通道a输出,data4、data5、data6和data7可从通道b输出,例如,根据数据源输出的通道,上述数据源分为两组,第一组包括data0、data1、data2和data3,第二组包括data4、data5、data6和data7,按照编码的顺序以及各数据源组的数据源个数,确定第一组对应的编码可以为:000、001、010、011,第二组对应的编码可以为:100、101、110、111。然后先将第一组对应的编码逐一分配送第一组data0、data1、data2和data3,第二组对应的编码逐一分配给第二组的数据源,得到如下表4:
表4
Figure PCTCN2020134921-appb-000001
应理解,在将所述编码按照设定顺序分配给所述数据源时,还可以按照编码的顺序,将编码逐一分配给各数据源。当第N级仲裁时包括多个数据源组时,例如,包括2个数据源组时,可以按照编码的顺序,例如,将编码从小到大逐一分配给第一组的各数据源,当第一组均分配有编码时,将剩余编码从小到大逐一分配给第二组的各数据源。本公开对数据源组的数量、各数据源组的数据源数量、将编码按照设定顺序分配给数据源的方式均不做限制。
方式二、可以将各个所述编码的编码位进行对位互换,生成各编码 对应的互换编码;所述将所述编码按照设定顺序分配给第N级仲裁时的所有数据源,包括根据所述编码的顺序、各数据源组的数据源个数以及各编码对应的互换编码,确定各数据源组对应的互换编码;将所述数据源组对应的互换编码逐一分配给所述数据源组的数据源,并使得任意两个物理序号相邻的数据源的优先级次序号不相邻;所述根据所述编码为各个候选数据对应的数据源对应的目标编码包括:将所述候选数据对应的数据源的互换编码确定为所述候选数据对应的数据源的目标编码。
在一种可能的实现方式中,将所述编码的编码位进行对位互换,生成互换编码,将000、001、010、011、100、101、110以及111,进制中心对称互换,生成互换编码,得到如下表5:
表5
Figure PCTCN2020134921-appb-000002
在一种可能的实现方式中,如前所述,数据源分为两组,第一组包括data0数据源、data1数据源、data2数据源和data3数据源,第二组包括data4数据源、data5数据源、data6数据源和data7数据源,可以根据编码的顺序、各数据源组的数据源个数以及各编码对应的互换编码,确定各数据源组对应的互换编码。例如,确定第一组对应的互换编码为:000、100、010以及110。第二组对应的互换编码为:001、101、011以及111。可以将第一组对应的互换编码逐一分配送第一组data0、data1、data2和data3,可以将第二组对应的互换编码逐一分配给第二组的数据源,得到如下表6:
表6
Figure PCTCN2020134921-appb-000003
其中,在将各个所述编码按照设定顺序分配给各个所述数据源时,还可以按照编码的顺序,将各编码对应的互换编码逐一分配给各数据源。 当包括多个数据源组时,例如,2个数据源组,还可以按照编码的顺序,例如,将编码从小到大,将与编码对应的互换编码逐一分配给第一组的各数据源,当第一组均分配有互换编码时,将剩余编码对应的互换编码逐一分配给第二组的各数据源。
介绍完可以仅在上述一个处理周期中执行的步骤之后,下面参照图4和图5介绍在每个处理周期中都要进行的步骤S324至步骤S326:
在步骤S324中,根据所述编码为各个候选数据对应的数据源生成对应的目标编码。
对于仲裁器而言,一次可以对多个候选数据进行仲裁。例如,在图1中所示的实施方式中,ARB7可以对数据源data0提供的候选数据和数据源data7提供的候选数据进行仲裁。
本公开实施例中,对应步骤S323中的方式一,步骤S324可以为将所述候选数据对应的目标数据源分配到的编码的编码位进行对位互换,生成互换编码;将所述互换编码确定为所述候选数据对应的目标数据源的所述目标编码。
在一种可能的实现方式中,将000、001、010、011、100、101、110以及111,按照data0、data1、data2、data3、data4、data5、data6和data7的顺序逐一分配给所述数据源后,将所述编码的编码位进行互换,生成互换编码,得到如下表7:
表7
Figure PCTCN2020134921-appb-000004
如表7可知,编码包括:000、001、010、011、100、101、110以及111,对位互换得到的互换编码同样包括:000、001、010、011、100、101、110以及111,部分数据源的编码与互换编码相同,部分数据源的编码与互换编码不同。
对应步骤S323中的方式二,步骤S324具体为将生成互换编码按照 顺序逐一分配给所述数据源。
在一种可能的实现方式中,所述互换编码如表5所示,将生成的互换编码按照顺序逐一分配给所述数据源,得到如表6相同的表格。
在步骤S325中,根据所述目标编码以及所述目标编码对应的优先级顺序,仲裁各个候选数据对应的数据源,以确定所述目标数据;
在步骤S326中,根据仲裁结果更新各级仲裁所有数据源的优先级顺序。
在步骤S326结束后,可以使得同一数据源在不同处理周期中的优先级不同,且同一数据源在不同处理周期中的优先级次序号之间满足非线性关系。
在一种可能的实现方式中,所述目标编码对应的优先级顺序可以是根据编码的优先级顺序确定,也可以是根据自身确定,例如,根据目标编码对应的数值排序确定的,本公开实施例对其不做限定。
在一种可能的实现方式中,根据所述目标编码以及所述目标编码对应的优先级顺序,仲裁所述目标编码对应的所述数据源,确定获得通道使用权的所述数据源,将获得通道使用权的所述数据源的目标编码的优先级降低为所有数据源的优先级顺序中的最后一位(即,优先级次序码变为最大)。
举例说明,假设初始设置的优先级顺序为000>001>010>011>100>101>110>111,根据上表6或表7所示,确定数据源的优先级顺序为data0>data4>data2>data6>data1>data5>data3>data7,假设,data0数据源与data4数据源进行仲裁,data0数据源获得数据通道优先权,在下一次仲裁data0数据源的优先级变为最低,优先级顺序更新后的排序为data4>data2>data6>data1>data5>data3>data7>data0。以此类推,本公开实施例对其不再赘述。
下面通过具体实施例描述数据传输过程,以图1中的ARB7仲裁channel7为例,各个数据源按上述二进制方式生成的顺序编码为,data0数据源的编码为000,data1数据源的编码为001,data2数据源的编码为010,data3数据源的编码为011,channel5输入ARB7的数据源可能为data0数据源、data1数据源、data2数据源或data3数据源,data4数据源 的编码为100,data5数据源的编码为101,data6数据源的编码为110,data7数据源的编码为111,channel6输入ARB7的数据源可能为data4数据源、data5数据源、data6数据源或data7数据源,将各数据源的编码进行中心对称互换,确定各数据源的互换编码分别为:data0数据源的编码为000,data1数据源的编码为100,data2数据源的编码为010,data3数据源的编码为110,data4数据源的编码为001,data5数据源的编码为101,data6数据源的编码为011,data7数据源的编码为111,初始设置的优先级顺序为000>001>010>011>100>101>110>111。
首次进行第一次数据仲裁(即,第一个处理周期),具体为:假设channel5的输入数据源为data0数据源(即,data0数据源提供的数据为候选数据),目标编码为000,假设channel6的输入数据源为data4数据源(即,data4数据源提供的数据为候选数据),目标编码为001,由于优先级顺序000>001,确定data0数据源的优先级高于data4数据源的优先级,因此data0数据源获得channel7的使用权,相应地,在下一次处理周期中,data0数据源的优先级降为最低,更新优先级顺序为001>010>011>100>101>110>111>000;然后进行第二次数据仲裁(即,第二个处理周期),具体为:假设channel5的输入数据源为data1数据源(即,data1数据源提供的数据为候选数据),目标编码为100,假设channel6的输入数据源为data4数据源(即,data4数据源提供的数据为候选数据),目标编码为001,由于优先级顺序001>100,确定data4数据源的优先级高于data1数据源的优先级,因此data4数据源获得channel7的使用权,在下一个处理周期中,data4数据源的优先级降为最低,更新优先级顺序为010>011>100>101>110>111>000>001;继而进行第三次数据仲裁(即,第三个处理周期),具体为:假设channel5的输入数据源为data1数据源(即,data1数据源提供的数据为候选数据),目标编码为100,假设channel6的输入数据源为data5数据源(即,data5数据源提供的数据为候选数据),目标编码为101,由于优先级顺序100>101,确定data1数据源的优先级高于data5数据源的优先级,因此data1数据源获得channel7的使用权,在下一个处理周期中,data1数据源的优先级降为最低,更新优先级顺序为010>011>101>110>111>000> 001>100;继而进行第四次数据仲裁(即,第四个处理周期),具体为:假设channel5的输入数据源为data2数据源(即,data2数据源提供的数据为候选数据),目标编码为010,假设channel6的输入数据源为data5数据源(即,data5数据源提供的数据为候选数据),目标编码为101,由于优先级顺序101>010,确定data5数据源的优先级高于data2数据源的优先级,因此data5数据源获得channel7的使用权,在下一个处理周期中,data5数据源的优先级降为最低,更新优先级顺序为010>011>110>111>000>001>100>101;继而进行第五次数据仲裁(即,第五个处理周期),具体为:假设channel5的输入数据源为data2数据源(即,data2数据源提供的数据为候选数据),目标编码为010,假设channel6的输入数据源data6数据源(即,data6数据源提供的数据为候选数据),目标编码为011,由于优先级顺序010>011,确定data2数据源的优先级高于data6数据源的优先级,因此data2数据源获得channel7的使用权,在下一个处理周期中,data2数据源的优先级降为最低,更新优先级顺序为>011>110>111>000>001>100>101>010;继而进行第六次数据仲裁(即,第六个处理周期),具体为:假设channel5的输入数据源为data3数据源(即,data3数据源提供的数据为候选数据),目标编码为110,假设channel6的输入数据源为data6数据源(即,data6数据源提供的数据为候选数据),目标编码为011,由于优先级顺序110>011,确定data6数据源的优先级高于data3数据源的优先级,因此data6数据源获得channel7的使用权,在下一个处理周期中,data6数据源的优先级降为最低,更新优先级顺序为110>111>000>001>100>101>010>011;继而进行第七次数据仲裁(即,第七个处理周期),具体为:假设channel5的输入数据源为data3数据源(即,data3数据源提供的数据为候选数据),目标编码为110,假设channel6的输入数据源为data7数据源(即,data7数据源提供的数据为候选数据),目标编码为111,由于优先级顺序110>111,确定data3数据源的优先级高于data7数据源的优先级,因此data3数据源获得channel7的使用权,在下一个处理周期中,data3数据源的优先级降为最低,更新优先级顺序为111>000>001>100>101>010>011>110;继而进行第八次数据仲裁(即,第 八个处理周期),具体为:假设channel5的输入数据源为data0数据源(即,data0数据源提供的数据为候选数据),目标编码为000,假设channel6的输入数据源为data7数据源(即,data7数据源提供的数据为候选数据),目标编码为111,由于优先级顺序111>000,确定data7数据源的优先级高于data0数据源的优先级,因此data7数据源获得channel7的使用权,在下一个处理周期中,data7数据源的优先级降为最低,更新优先级顺序为000>001>100>101>010>011>110>111。本公开实施例中,之后的数据仲裁方式与上述相同,不发明对其不再赘述。
通过上述方案,channel5输出的数据和channel6输出的数据交替获得channel7的使用权,解决了数据传输延时的不均衡问题,并且,随着channel5和channel6的数据源数量的增加,越能显示出所述数据传输延时的均衡性的效果。
下面介绍基于图2中的架构,本公开所提供的数据传输方法的具体实施方式。具体地,所述多个候选数据分别携带标识码(Identity Document,ID),所述ID用于标识所述候选数据的数据源。
在一种可能的实现方式中,假设以接收到2个候选数据为例,分别为第一数据与第二数据,其中,所述第一数据与所述第二数据分别携带ID,此处,所述ID用于标识所述第一数据的数据源与所述第二数据的数据源。
在一种可能的实现方式中,假设接收到的第一数据来源如图2所示的data2数据源,第二数据来源于channel1输出的data1数据源,其中,每个数据源的ID值是按照设定的二进制编码规则编码的,每个数据的ID值是不同的,例如,按照0~n对数据源进行编码,data0数据源的ID为000,data1数据源的ID为001,data2数据源的ID为010,data3数据源的ID为011,data4数据源的ID为100,在一种可能的实现方式中,二进制编码的比特位位数根据实际情况,本公开实施例对其不做限定。
在本公开实施例中,如图6所示,步骤S320可以包括如下步骤S321’至步骤S323’,具体地:
在步骤S321’中,分别确定多个候选数据携带的ID与参考ID的逻辑差值,其中,在所述参考ID在不同处理周期中具有不同的值。
其中,参考ID是与数据携带的ID具有相同进制的数值,例如,按照二进制编码规则编码各数据的ID,参考ID可以是一个二进制数值。逻辑差值是指根据参考ID以及数据携带的ID,按照参考ID对应进制的减法运算规则确定的数值,例如,可以是按照二进制减法运算规则,数据携带的ID减去参考ID得到的数值。
在一种可能的实现方式中,所述参考ID存储在状态寄存单元中,以两个数据为例,分别确定所述第一数据与所述第二数据携带的ID与上一次仲裁时获取通道优先使用权的数据的ID的逻辑差值,其中,获取通道优先使用权的数据的ID即存储在状态寄存单元中的参考ID。
举例说明,假设,采用二进制编码,第一数据为来自于data2数据源的数据,携带的ID为010,第二数据为来自于data3数据源的数据,携带的ID为011,上一次仲裁时获取通道优先使用权的数据的ID为011(参考ID为011),第一数据携带的ID与参考ID的逻辑差值为010-011=111,第二数据携带的ID与参考ID的逻辑差值为011-011=000,其中,所述逻辑差值为两个二进制数相减时得到的数值,按照二进制数的减法规则进行计算。
由于所述参考ID在不同处理周期中具有不同的值,因此,同一ID的数据源在不同处理周期中对应的逻辑差值并不相同。
在步骤S322’中,根据确定的多个逻辑差值确定所述多个候选数据对应的数据源的优先级。
如上所述,同一ID的数据源在不同处理周期中对应的逻辑差值并不相同,这就意味着同一ID的数据源在不同处理周期中的优先级不同。随着参考ID的变化,同一数据源在不同处理周期中的优先级次序号之间也能够满足非线性关系。
在步骤S323’中,将所述多个候选数据中数据源的优先级最高的一者作为所述目标数据。
在一种可能的实现方式中,所述目标数据即在多个数据中获取通道优先使用权的数据。
在一种可能的实现方式中,将所述多个逻辑差值进行比较;确定所述多个逻辑差值中最大的逻辑差值对应的数据源作为优先级最高的数据 源,并将所述优先级最高的数据源输出的数据作为所述目标数据。
举例说明,ARB3将第一数据的ID与参考ID的逻辑差值001,第二数据的ID与参考ID的逻辑差值010,进行比较001小于010,因此,第二数据的优先级高于第一数据的优先级,获取了channel4的使用权(第二数据的数据源的优先级高于第一数据的数据源的优先级)。其中,在确定多个逻辑差值中最大的逻辑差值过程中,可以是如前文所述直接比较大小,也可以将多个逻辑差值按照从小到大或者从大到小进行排序,并根据排序结果确定最大的逻辑差值,本公开对此不做限制。
在一种可能的实现方式中,所述目标数据获得通道的使用权,可以优先传输。目标数据的优先级高于其他数据的优先级。
本公开实施例中,可以根据逻辑差值确定多个数据中的目标数据,由于每次计算确定的逻辑差值是不同的,因此确定出的目标数据是动态变化的,并且由于每一级仲裁都是通过上述方法确定优先传输的数据,即确定数据传输时的优先级,进而在数据数量不均衡分布时可以满足对数据优先级调整的需求。
在一种可能的实施例中,从第二个处理周期开始,上一个处理周期中的目标数据的ID为当前处理周期的参考ID。
举例说明,ARB3可以将所述第二数据的数据源data3的ID值011保存在ARB3的状态寄存单元中,用于ARB3的下一次仲裁(即,进入下一个处理周期)。
这样,根据当前获得通道使用权的目标数据ID确定参考ID,更新后的参考ID用于确定下一次仲裁(即,下一个处理周期)获得通道使用权的目标数据的ID,每次仲裁(即,每个处理周期)确定出的目标数据的数据源是动态变化的,从而实现对数据优先级的动态调整。并且由于每一级仲裁都是通过上述方法确定优先传输的数据,即确定数据传输时的优先级,进而在数据数量不均衡分布时可以满足对数据优先级调整的需求。
在一种可能的实现方式中,所述多个候选数据为2个候选数据时,所述第一数据可以为上述data0数据源、data1数据源、data2数据源、data3数据源和data4数据源的数据,所述第二数据也可以为述data0数据源、 data1数据源、data2数据源、data3数据源和data4数据源的数据,本公开实施例对其不做限定,只要第一数据与第二数据不同即可。
在一种可能的实施例中,所述状态寄存单元的初始值为0,即,第一个处理周期中,参考ID可以为0。
下面通过实施例描述数据传输过程,以图2中的ARB3仲裁channel3为例,各个数据源按上述顺序编码,data0以及data0数据源的ID为000,data1以及data1数据源的ID为001,data2以及data2数据源的ID为010,data3以及data3数据源的ID为011,channel2输入ARB3的数据源的ID可能为000,001,010,data3输入ARB3的ID为011,假设ARB3内部的状态寄存单元的初始值为000。进行第一次数据仲裁(即,第一个处理周期),假设channel2输入的是ID为010的数据以及data3数据源提供的数据,data3数据源的ID为011,确定ID的逻辑差值为010-000<011-000,因此ID为011的data3数据源提供的数据获得channel3的使用权,将ARB3内的状态寄存单元的值更新为011;然后进行第二次数据仲裁(即,第二个处理周期),channel2输入的是ID为010的数据,数据源ID为011的data3数据源继续输入数据源ID为011的数据,由于ARB3内的状态寄存单元的值更新为011,确定ID的逻辑差值为010-011>011-011,因此channel2输入的ID为010的数据源提供的数据获得channel3的使用权,同时将ARB3内的状态寄存单元的值更新为010;继而进行第三次数据仲裁(即,第三个处理周期),假设channel2输入的是ID为000的数据源提供的数据,data3数据源提供的是ID为011的数据,由于ARB3内的状态寄存单元的值更新为010,确定ID的逻辑差值为000-010>011-010,因此channel2输入的ID为000数据源提供的数据获得channel3通道的使用权,同时将ARB3内的状态寄存单元的值更新为000;进行第四次数据仲裁(即,第四个处理周期),假设channel2输入的是ID为001的数据源提供的数据,data3数据源提供的是ID为011的数据,由于ARB3内的状态寄存单元的值更新为000,确定ID的逻辑差值为001-000<011-000,因此data3数据源提供的ID为011的数据获得channel3的使用权,同时将ARB3内的状态寄存单元的值更新为011;以此类推,本公开实施例对其不再赘述。
在一些可选的实施例中,当仲裁器接收到3个数据时,例如,3个数据的ID分别为000、001和010。参考ID的初始值为000。可以分别确定各ID与参考ID的逻辑差值,例如,逻辑差值分别为000、001和010。可以确定最大逻辑差值为010,ID为010的数据获得传输通道的使用权(当前仲裁,ID为010的数据的优先级高于其他两个数据的优先级),传输ID为010的数据,将参考ID的数值更新为010。继续接收多个数据,例如,3个数据的ID分别为000、001和010,分别确定与参考ID(010)的逻辑差值,例如,逻辑差值分别为110、111和000,最大逻辑差值为111,ID为001的数据获得传输通道的使用权(当前仲裁,ID为001的数据的优先级高于其他两个数据的优先级),传输ID为001的数据,将参考ID的数值更新为001。继续接收多个数据,例如,3个数据的ID分别为000、001和010,分别确定与参考ID(001)的逻辑差值,例如,逻辑差值分别为111、000和001,最大逻辑差值为111,ID为000的数据获得传输通道的使用权(当前仲裁,ID为000的数据的优先级高于其他两个数据的优先级),传输ID为000的数据,将参考ID的数值更新为000,以此类推,在此不再赘述。
这样,能够实现对多个数据的优先级动态调整,使得多个数据能够较均衡地获取传输通道的使用权。
在确定了目标数据后,所述方法还包括:
在步骤S330中,传输所述目标数据。
本公开实施例中,所述仲裁器可以为NOC的组成模块。
图7是本公开实施例提供的一种数据处理的装置示意图。如图7所示,本实施例的数据处理的装置包括:候选数据确定单元710、目标数据确定单元720。
所述接收单元710用于确定多个候选数据,其中,所述候选数据由相应的数据源提供。
目标数据确定单元720用于根据所述多个候选数据所各自对应的数据源在当前周期中的优先级,确定目标数据,其中,同一数据源在不同处理周期中的优先级不同,且同一数据源在不同处理周期中的优先级次序号之间满足非线性关系。
本公开所提供的装置用于执行本公开所提供的上述方法,上文中已经对所述方法的原理以及有益效果进行了详细的描述,这里不再赘述。
为了执行图1中所示的仲裁方案,可选地,如图8所示,目标数据确定单元720可以包括个数确定子单元721、编码生成子单元722、分配子单元723、目标编码生成子单元724、仲裁子单元725、以及顺序更新子单元726。
个数确定子单元721用于确定第N级仲裁时的数据源个数,其中,N为自然数,且1≤N≤M,M为当前处理周期中的仲裁总级数。
编码生成子单元722用于根据第N级仲裁时的数据源个数按照设定编码方式生成编码。
分配子单元723用于将生成的所有编码按照设定优先级顺序分配给第N级仲裁时的所有数据源。
目标编码生成子单元724用于根据所述编码为各个候选数据对应的数据源生成对应的目标编码。
仲裁子单元725用于根据所述目标编码以及所述目标编码对应的优先级顺序,仲裁各个候选数据对应的数据源,以确定所述目标数据。
顺序更新子单元726用于根据仲裁结果更新各级仲裁所有数据源的优先级顺序。
为了执行图2中所公开的仲裁方案,可选地,如图9所示,目标数据确定单元720可以包括逻辑差值确定子单元721’、优先级确定子单元722’、目标数据确定子单元723’。
逻辑差值确定子单元721’用于分别确定所述多个候选数据携带的ID与参考ID的逻辑差值,其中,所述参考ID在不同处理周期中具有不同的值。
优先级确定子单元722’用于根据确定的多个逻辑差值确定所述多个候选数据对应的数据源的优先级。
目标数据确定子单元723’用于将所述多个候选数据中数据源的优先级最高的一者作为所述目标数据。
可选地,所述装置还可以包括数据传输单元730,该数据传输单元730用于传输所述目标数据。
图10是本公开实施例的电子设备的结构示意图。如图10所示,本实施例的电子设备包括处理核11-1L以及片上网络14。处理核11-1L均与片上网络14连接。片上网络14用于交互所述L个处理核间的数据和外部数据。
本公开所提供的电子设备可以实现本公开第一个方面所提供的数据处理的方法。但是,在本公开中,对实现所述方法的具体形式、以及具体位置均不做特殊的限定。
例如,可以通过片上网络14执行所述方法,也可以通过所述多个处理核中的至少一个来执行所述方法。
可以通过软件的方式来实现所述方法,也可以通过硬件的方式来实现所述方法。
在通过软件的方式来实现所述方法时,可以在片上网络14中存储指令,片上网络14根据所述指令实现所述方法。在通过硬件的方式来实现所述方法时,可以在片上网络14上配置相应的硬件,以实现所述方法。
当然,在通过软件的方式来实现所述方法时,可以在多个处理核中的至少一者中存储指令,存储有所述指令的处理核根据所述指令实现所述方法。在通过硬件的方式来实现所述方法时,可以在多个处理核中的至少一者中配置相应的硬件,以实现所述方法。
如本领域技术人员将意识到的,本公开实施例的各个方面可以被实现为系统、方法或计算机程序产品。因此,本公开实施例的各个方面可以采取如下形式:完全硬件实施方式、完全软件实施方式(包括固件、常驻软件、微代码等)或者在本文中通常可以都称为“电路”、“模块”或“系统”的将软件方面与硬件方面相结合的实施方式。此外,本公开实施例的各个方面可以采取如下形式:在一个或多个计算机可读介质中实现的计算机程序产品,计算机可读介质具有在其上实现的计算机可读程序代码。
可以利用一个或多个计算机可读介质的任意组合。计算机可读介质可以是计算机可读信号介质或计算机可读存储介质。计算机可读存储介质可以是如(但不限于)电子的、磁的、光学的、电磁的、红外的或半导体系统、设备或装置,或者前述的任意适当的组合。计算机可读存储介质的更具体的示例(非穷尽列举)将包括以下各项:具有一根或多根电线 的电气连接、便携式计算机软盘、硬盘、随机存取存储器(RAM)、只读存储器(ROM)、可擦除可编程只读存储器(EPROM或闪速存储器)、光纤、便携式光盘只读存储器(CD-ROM)、光存储装置、磁存储装置或前述的任意适当的组合。在本公开实施例的上下文中,计算机可读存储介质可以为能够包含或存储由指令执行系统、设备或装置使用的程序或结合指令执行系统、设备或装置使用的程序的任意有形介质。
计算机可读信号介质可以包括传播的数据信号,所述传播的数据信号具有在其中如在基带中或作为载波的一部分实现的计算机可读程序代码。这样的传播的信号可以采用多种形式中的任何形式,包括但不限于:电磁的、光学的或其任何适当的组合。计算机可读信号介质可以是以下任意计算机可读介质:不是计算机可读存储介质,并且可以对由指令执行系统、设备或装置使用的或结合指令执行系统、设备或装置使用的程序进行通信、传播或传输。
可以使用包括但不限于无线、有线、光纤电缆、RF等或前述的任意适当组合的任意合适的介质来传送实现在计算机可读介质上的程序代码。
用于执行针对本公开实施例各方面的操作的计算机程序代码可以以一种或多种编程语言的任意组合来编写,所述编程语言包括:面向对象的编程语言如Java、Smalltalk、C++等;以及常规过程编程语言如“C”编程语言或类似的编程语言。程序代码可以作为独立软件包完全地在用户计算机上、部分地在用户计算机上执行;部分地在用户计算机上且部分地在远程计算机上执行;或者完全地在远程计算机或服务器上执行。在后一种情况下,可以将远程计算机通过包括局域网(LAN)或广域网(WAN)的任意类型的网络连接至用户计算机,或者可以与外部计算机进行连接(例如通过使用因特网服务供应商的因特网)。
上述根据本公开实施例的方法、设备(系统)和计算机程序产品的流程图图例和/或框图描述了本公开实施例的各个方面。将要理解的是,流程图图例和/或框图的每个块以及流程图图例和/或框图中的块的组合可以由计算机程序指令来实现。这些计算机程序指令可以被提供至通用计算机、专用计算机或其它可编程数据处理设备的处理器,以产生机器,使得(经由计算机或其它可编程数据处理设备的处理器执行的)指令创建 用于实现流程图和/或框图块或块中指定的功能/动作的装置。
还可以将这些计算机程序指令存储在可以指导计算机、其它可编程数据处理设备或其它装置以特定方式运行的计算机可读介质中,使得在计算机可读介质中存储的指令产生包括实现在流程图和/或框图块或块中指定的功能/动作的指令的制品。
计算机程序指令还可以被加载至计算机、其它可编程数据处理设备或其它装置上,以使在计算机、其它可编程设备或其它装置上执行一系列可操作步骤来产生计算机实现的过程,使得在计算机或其它可编程设备上执行的指令提供用于实现在流程图和/或框图块或块中指定的功能/动作的过程。
以上所述仅为本公开的优选实施例,并不用于限制本公开,对于本领域技术人员而言,本公开可以有各种改动和变化。凡在本公开的精神和原理之内所作的任何修改、等同替换、改进等,均应包含在本公开的保护范围之内。

Claims (19)

  1. 一种数据处理的方法,在各处理周期内,所述方法包括:
    确定多个候选数据,其中,所述候选数据由相应的数据源提供;
    根据所述多个候选数据所各自对应的数据源在当前周期中的优先级,确定目标数据,其中,同一数据源在不同处理周期中的优先级不同,且同一数据源在不同处理周期中的优先级次序号之间满足非线性关系。
  2. 根据权利要求1所述的方法,其中,
    在一个处理周期中,所述根据所述多个候选数据所各自对应的数据源在当前周期中的优先级,确定目标数据,包括:
    确定第N级仲裁时的数据源个数,其中,N为自然数,且1≤N≤M,M为当前处理周期中的仲裁总级数;
    根据第N级仲裁时的数据源个数按照设定编码方式生成编码;
    将生成的所有编码按照设定优先级顺序分配给第N级仲裁时的所有数据源;
    在每个处理周期中,所述根据所述多个候选数据所各自对应的数据源在当前周期中的优先级,确定目标数据,均包括:
    根据所述编码为各个候选数据对应的数据源生成对应的目标编码;
    根据所述目标编码以及所述目标编码对应的优先级顺序,仲裁各个候选数据对应的数据源,以确定所述目标数据;
    根据仲裁结果更新各级仲裁所有数据源的优先级顺序。
  3. 根据权利要求2所述的方法,其中,所述根据第N级仲裁时的数据源个数按照设定编码方式生成编码,包括:
    根据第N级仲裁时的数据源个数按照二进制方式生成编码,所述编码的个数等于第N级仲裁时的数据源的个数。
  4. 根据权利要求3所述的方法,其中,第N级仲裁时的多个数据源被划分为多个数据源组,各数据源组包括至少一个数据源,
    其中,所述将生成的所有编码按照设定优先级顺序分配给第N级仲裁时的所有数据源,包括:
    根据所述编码的顺序和各数据源组的数据源个数,确定各数据源组对应的编码;
    将所述数据源组对应的编码逐一分配给所述数据源组的数据源。
  5. 根据权利要求4所述的方法,其中,所述根据所述编码为各个候选数据对应的数据源生成对应的所述目标编码,包括:
    将所述候选数据对应的数据源分配到的所述编码的编码位进行对位互换,生成互换编码;
    将所述互换编码确定为所述数据源的所述目标编码。
  6. 根据权利要求2所述的方法,其中,第N级仲裁时的多个数据源被划分为多个数据源组,各数据源组包括至少一个数据源,
    所述方法还包括在所述根据第N级仲裁时的数据源个数按照设定编码方式生成编码的步骤与所述将生成的所有编码按照设定优先级顺序分配给第N级仲裁时的所有数据源的步骤之间进行的:将所述编码的编码位进行对位互换,生成各编码对应的互换编码;
    所述将生成的所有编码按照设定优先级顺序分配给第N级仲裁时的所有数据源,包括:
    根据所述编码的顺序、各数据源组的数据源个数以及各编码对应的互换编码,确定各数据源组对应的互换编码;
    将所述数据源组对应的互换编码逐一分配给所述数据源组的数据源;
    所述根据所述编码为各个候选数据对应的数据源生成对应的目标编码包括:
    将所述候选数据对应的数据源的互换编码确定为所述候选数据对应的数据源的目标编码。
  7. 根据权利要求2-6中任意一项所述的方法,其中,每个所述数据源均具有各自对应的物理序号,在第一级仲裁时,每两个物理序号相邻 的数据源竞争一条数据通道的使用权,
    在将生成的所有编码按照设定优先级顺序分配给第N级仲裁时的所有数据源的步骤中,任意两个物理序号相邻的数据源的优先级次序号不相邻。
  8. 根据权利要求2-6中任意一项所述的方法,其中,在根据所述目标编码以及所述目标编码对应的优先级顺序,仲裁各个候选数据对应的数据源,以确定所述目标数据的步骤中,优先级高的目标编码对应的候选数据为所述目标数据,所述目标数据为获得通道使用权的数据;
    所述根据仲裁结果更新各级仲裁所有数据源的优先级顺序,包括:
    将所述目标数据的数据源的目标编码的优先级降低为所有数据源的优先级顺序中的最后一位。
  9. 根据权利要求1所述的方法,其中,所述多个候选数据分别携带标识码ID,所述ID用于标识所述候选数据的数据源;
    所述根据所述多个候选数据所各自对应的数据源在当前周期中的优先级,确定目标数据,包括:
    分别确定所述多个候选数据携带的ID与参考ID的逻辑差值,其中,所述参考ID在不同处理周期中具有不同的值;
    根据确定的多个逻辑差值确定所述多个候选数据对应的数据源的优先级;
    将所述多个候选数据中数据源的优先级最高的一者作为所述目标数据。
  10. 根据权利要求9所述的方法,其中,从第二个处理周期开始,上一个处理周期中的目标数据源的ID为当前处理周期的参考ID。
  11. 根据权利要求9所述的方法,其中,所述根据所述多个逻辑差值确定所述多个候选数据中的目标数据,包括:
    将所述多个逻辑差值进行比较;
    确定所述多个逻辑差值中最大的逻辑差值对应的数据源为优先级最高的数据源,并将所述优先级最高的数据源输出的数据作为所述目标数据。
  12. 如权利要求9-11中任意一项所述的方法,其中,所述参考ID存储在状态寄存单元中。
  13. 根据权利要求9-11中任意一项所述的方法,其中,第一个处理周期中的参考ID的值为0。
  14. 根据权利要求9-11中任意一项所述的方法,其中,所述根据所述多个候选数据所各自对应的数据源在当前周期中的优先级,确定目标数据,还包括在分别确定所述多个候选数据携带的标识码ID与参考ID的逻辑差值的步骤之前进行的:
    设定所述多个候选数据的ID。
  15. 根据权利要求1-6、9-11中任意一项所述的方法,其中,所述方法还包括:
    传输所述目标数据。
  16. 一种数据处理的装置,包括:
    候选数据确定单元,用于确定多个候选数据,其中,所述候选数据由相应的数据源提供;
    目标数据确定单元,用于根据所述多个候选数据所各自对应的数据源在当前周期中的优先级,确定目标数据,其中,同一数据源在不同处理周期中的优先级不同,且同一数据源在不同处理周期中的优先级次序号之间满足非线性关系。
  17. 一种电子设备,所述电子设备包括:
    多个处理核;以及
    片上网络,被配置为交互所述多个处理核间的数据和外部数据的通信结构;其中,
    所述片上网络还被配置为能够执行权利要求1-15中任意一项所述的方法;和/或
    所述多个处理核中的至少一个被配置为能够执行根据权利要求1-15中任一项所述的方法。
  18. 一种计算机可读存储介质,其上存储计算机程序指令,所述计算机程序指令在被处理器执行时实现根据权利要求1-15中任一项所述的方法。
  19. 一种计算机程序产品,所述计算机程序产品在计算机上运行时,使得所述计算机执行根据权利要求1-15中任一项所述的方法。
PCT/CN2020/134921 2019-12-09 2020-12-09 数据处理的方法、装置和电子设备、存储介质和程序产品 WO2021115326A1 (zh)

Priority Applications (1)

Application Number Priority Date Filing Date Title
US17/778,929 US11863461B2 (en) 2019-12-09 2020-12-09 Data processing method, data processing apparatus, electronic device, storage medium, and program product

Applications Claiming Priority (4)

Application Number Priority Date Filing Date Title
CN201911252455.1 2019-12-09
CN201911252471.0 2019-12-09
CN201911252455.1A CN113032109A (zh) 2019-12-09 2019-12-09 一种数据处理的方法、装置和电子设备
CN201911252471.0A CN113037650B (zh) 2019-12-09 2019-12-09 一种数据处理的方法、装置和电子设备

Publications (1)

Publication Number Publication Date
WO2021115326A1 true WO2021115326A1 (zh) 2021-06-17

Family

ID=76329597

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/134921 WO2021115326A1 (zh) 2019-12-09 2020-12-09 数据处理的方法、装置和电子设备、存储介质和程序产品

Country Status (2)

Country Link
US (1) US11863461B2 (zh)
WO (1) WO2021115326A1 (zh)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090260013A1 (en) * 2008-04-14 2009-10-15 International Business Machines Corporation Computer Processors With Plural, Pipelined Hardware Threads Of Execution
US20090323532A1 (en) * 2008-06-27 2009-12-31 Realtek Semiconductor Corp. Network system with quality of service management and associated management method
CN104156264A (zh) * 2014-08-01 2014-11-19 西北工业大学 一种基于多gpu的基带信号处理任务并行实时调度方法
CN108199985A (zh) * 2017-12-29 2018-06-22 中国人民解放军国防科技大学 GPGPU中基于全局节点信息的NoC仲裁方法
CN109873771A (zh) * 2019-01-21 2019-06-11 佛山市顺德区中山大学研究院 一种片上网络系统及其通信方法
CN109995679A (zh) * 2019-04-08 2019-07-09 上海海洋大学 基于任务驱动的芯片级多异构通讯核的NoC系统

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR20210054935A (ko) * 2019-11-06 2021-05-14 삼성전자주식회사 무선 통신 시스템에서 효율적인 핸드오버를 위한 프로토콜 계층 장치의 동작 방법 및 장치
WO2021087990A1 (zh) * 2019-11-08 2021-05-14 深圳市欢太科技有限公司 标签更新方法、装置、电子设备及存储介质

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090260013A1 (en) * 2008-04-14 2009-10-15 International Business Machines Corporation Computer Processors With Plural, Pipelined Hardware Threads Of Execution
US20090323532A1 (en) * 2008-06-27 2009-12-31 Realtek Semiconductor Corp. Network system with quality of service management and associated management method
CN104156264A (zh) * 2014-08-01 2014-11-19 西北工业大学 一种基于多gpu的基带信号处理任务并行实时调度方法
CN108199985A (zh) * 2017-12-29 2018-06-22 中国人民解放军国防科技大学 GPGPU中基于全局节点信息的NoC仲裁方法
CN109873771A (zh) * 2019-01-21 2019-06-11 佛山市顺德区中山大学研究院 一种片上网络系统及其通信方法
CN109995679A (zh) * 2019-04-08 2019-07-09 上海海洋大学 基于任务驱动的芯片级多异构通讯核的NoC系统

Also Published As

Publication number Publication date
US11863461B2 (en) 2024-01-02
US20220417169A1 (en) 2022-12-29

Similar Documents

Publication Publication Date Title
US10332008B2 (en) Parallel decision tree processor architecture
US11042412B2 (en) Memory allocation method and server
US9495161B2 (en) QoS based dynamic execution engine selection
US20150262062A1 (en) Decision tree threshold coding
WO2021115052A1 (zh) 一种异构芯片的任务处理方法、任务处理装置及电子设备
TW200525432A (en) Methods and apparatus to process cache allocation requests based on priority
WO2015043528A1 (zh) 并行多线程报文处理的方法和装置
WO2022111453A1 (zh) 任务处理方法及装置、任务分配方法、电子设备、介质
CN106790332B (zh) 一种资源调度方法、系统及主节点
CN113238848A (zh) 一种任务调度方法、装置、计算机设备和存储介质
JP2016167726A (ja) 演算処理装置,情報処理装置,及び情報処理装置の制御方法
US20150262063A1 (en) Decision tree processors
WO2019144775A1 (zh) 一种基于tdma系统的资源调度方法及系统
CN109710406A (zh) 数据分配及其模型训练方法、装置、及计算集群
CN112083957A (zh) 带宽控制设备、多线程控制器系统及访存带宽控制方法
US9916182B2 (en) Method and apparatus for allocating stream processing unit
WO2021115326A1 (zh) 数据处理的方法、装置和电子设备、存储介质和程序产品
CN104778088B (zh) 一种基于减少进程间通信开销的并行i/o优化方法与系统
US8533377B2 (en) System and method for allocating transaction ID in a system with a plurality of processing modules
CN113032109A (zh) 一种数据处理的方法、装置和电子设备
WO2023070925A1 (zh) 区块链交易池的分片方法、系统、存储介质和计算机系统
WO2021180127A1 (zh) 网络设备的扩容方法和相关装置
CN113037650B (zh) 一种数据处理的方法、装置和电子设备
JP6041324B2 (ja) 可変長アービトレーション
US9894670B1 (en) Implementing adaptive resource allocation for network devices

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 20899393

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 20899393

Country of ref document: EP

Kind code of ref document: A1