Resource access method, chip and device

By dividing the processors in the data processing chip into multi-level processor groups and using the superior control unit to determine the access time of the lower processor groups, the problem of low access efficiency of multi-processor shared resources is solved, and orderly and Efficiency.

CN114896059BActive Publication Date: 2024-11-05GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210451776.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-04-26
Publication Date
2024-11-05
Estimated Expiration
2042-04-26

AI Technical Summary

Technical Problem

In a data processing chip, when multiple processors access shared resources at the same time, the prior art is difficult to effectively improve access efficiency, resulting in low task processing efficiency.

Method used

By dividing the processor into a multi-level processor group, each level processor group includes at least two lower-level processor groups, the upper control unit determines the access time of the next-level processor group based on the access time of the lower-level processor group until Determine the access time of the lowest-level processor group and control the processor to access the shared resources according to the determined time.

Benefits of technology

This method not only ensures the orderly access of resource, but also significantly improves access efficiency. By assigning tasks to multiple levels of control units, flexibly controls the access order of processor groups and processors, and improves the efficiency of using shared resources.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114896059B_ABST
    Figure CN114896059B_ABST
Patent Text Reader

Abstract

The present application discloses a resource access method, chip and device, belonging to the field of computer technology. The method includes: receiving access requests from multiple processors to a first shared resource at the same time through the first control unit of the Nth level, and determining the access duration of the processor group of the Nth level in response to the received multiple access requests; determining the access duration of the N-1th level processor group based on the access duration of the processor group of the Nth level through the first control unit of the Nth level, until the access duration of the processor group of the 1st level is determined; determining the access duration of each processor in the processor group of the 1st level in turn based on the access duration of the processor group of the 1st level through the first control unit of the 1st level, and controlling each processor to access the first shared resource according to the determined access duration. This method not only ensures the orderliness of resource access, but also improves access efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present application relate to the field of computer technology, and in particular to a resource access method, chip, and device. Background Art

[0002] A data processing chip usually includes multiple processors, which can collaboratively perform data processing tasks. In the process of performing the same data processing task, these multiple processors may need to access a shared resource, and the efficiency of these multiple processors accessing the shared resource can greatly affect the task processing efficiency. Therefore, in order to improve the task processing efficiency, it is urgent to provide a method that can improve the access efficiency. Summary of the invention

[0003] The embodiment of the present application provides a resource access method, chip and device, which can improve the access efficiency to shared resources. The technical solution is as follows:

[0004] According to one aspect of an embodiment of the present application, a resource access method is provided, which is executed by a data processing chip, wherein the data processing chip includes a plurality of processors, wherein the plurality of processors are divided into N-level processor groups, wherein the N-th level processor group includes at least two N-1-th level processor groups, and the 1-th level processor group includes at least two of the processors, wherein each processor group corresponds to a first control unit, and N is an integer greater than 1;

[0005] The method comprises:

[0006] receiving access requests of the plurality of processors to the first shared resource at the same time through the first control unit of the Nth level, and determining the access duration of the processor group of the Nth level in response to the received plurality of access requests;

[0007] Determine, by the Nth-level first control unit, the access duration of the N-1th-level processor group based on the access duration of the Nth-level processor group, until the access duration of the 1st-level processor group is determined;

[0008] The first control unit of the first level determines the access duration of each processor in the first level processor group in turn based on the access duration of the first level processor group, and controls each processor to access the first shared resource according to the determined access duration.

[0009] According to another aspect of an embodiment of the present application, a data processing chip is provided, the data processing chip comprising a plurality of processors, the plurality of processors being divided into N-level processor groups, the N-th level processor group comprising at least two N-1-th level processor groups, the 1-th level processor group comprising at least two of the processors, each processor group corresponding to a first control unit, N being an integer greater than 1;

[0010] When the chip is run on a computer device, it is used to implement the resource access method as described in the above aspects.

[0011] According to another aspect of an embodiment of the present application, a computer device is provided, the computer device comprising a data processing chip, the data processing chip comprising a plurality of processors, the plurality of processors being divided into N-level processor groups, the N-th level processor group comprising at least two N-1-th level processor groups, the 1-th level processor group comprising at least two of the processors, each processor group corresponding to a first control unit, N being an integer greater than 1;

[0012] The computer device is used to run the data processing chip to implement the resource access method as described in the above aspects.

[0013] The solution provided in the embodiment of the present application divides multiple processors in a data processing chip into multi-level processor groups, and except for the lowest-level processor group including multiple processors, each of the other processor groups includes at least two lower-level processor groups. Then, when multiple processors request access to shared resources at the same time, the resource access of the multiple processors is controlled in order from upper to lower levels, that is, the upper-level control unit determines the access duration of the processor group of the next level based on the access duration of the corresponding processor group, until the access duration of the processor group of the lowest level is determined, and the control unit corresponding to the processor group of the lowest level determines the access duration of the processor, and controls the processor to access the shared resources according to the determined access duration. This method distributes the task of controlling multiple processors to access shared resources to control units of multiple levels, and the control unit corresponding to the processor group of each level controls the resource access of the lower-level processor group, which not only ensures the orderliness of resource access, but also improves access efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0014] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0015] Figure 1 A schematic diagram of a data processing chip provided by an exemplary embodiment of the present application is shown;

[0016] Figure 2 A schematic diagram of an N-th level processor group provided by an exemplary embodiment of the present application is shown;

[0017] Figure 3 A flow chart of a resource access method provided by an exemplary embodiment of the present application is shown;

[0018] Figure 4 A flowchart of another resource access method provided by an exemplary embodiment of the present application is shown;

[0019] Figure 5 A flowchart of another resource access method provided by an exemplary embodiment of the present application is shown;

[0020] Figure 6 A schematic diagram of a processor provided by an exemplary embodiment of the present application is shown. DETAILED DESCRIPTION

[0021] In order to make the objectives, technical solutions and advantages of the present application clearer, the implementation methods of the present application will be further described in detail below with reference to the accompanying drawings.

[0022] In this article, "at least one" means one or more, and "plurality" means two or more. "And / or" describes the association relationship of the associated objects, indicating that three relationships can exist. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. The character " / " generally indicates that the associated objects are in an "or" relationship.

[0023] It should be noted that the information (including but not limited to user device information, user personal information, etc.), data (including but not limited to data used for analysis, stored data, displayed data, etc.) and signals involved in this application are all authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant laws, regulations and standards of relevant countries and regions.

[0024] Figure 1 Schematic diagram of a data processing chip provided in an embodiment of the present application. Figure 1 , the data processing chip includes a plurality of processors 101 ( Figure 1 In this example, 12 processors are used as an example), and multiple processors are divided into N-level processor groups ( Figure 1 The Nth level processor group includes at least two N-1th level processor groups ( Figure 1 In the example, the second-level processor group 102 includes four first-level processor groups 103), and the first-level processor group 103 includes at least two processors 101 ( Figure 1In the example, each first-level processor group 103 includes four processors 101, each processor group corresponds to a first control unit, wherein N is an integer greater than 1. When the data processing chip is running on a computer device, the resource access method provided in the embodiment of the present application can be implemented. It should be noted that the number of lower-level processor groups included in different processor groups is the same or different, and the number of processors 101 included in different first-level processor groups 103 is the same or different, and the embodiment of the present application does not limit this.

[0025] Figure 2 Schematic diagram of an N-level processor group provided in an embodiment of the present application. Figure 2 , the Nth level processor group 201 includes at least two N-1th level processor groups 202 ( Figure 2 In the example, the N-th level processor group 201 includes four N-1-th level processor groups 202, and the N-th level first control unit 203 corresponding to the N-th level processor group 201 is used to control the access to the shared resources by the at least two N-1-th level processor groups 202. It should be noted that the 1-th level processor group in the embodiment of the present application also has a corresponding 1-th level first control unit, which is used to control the access to the shared resources by multiple processors in the 1-th level processor group.

[0026] Figure 3 A flowchart of a resource access method provided by an exemplary embodiment of the present application is shown, which is executed by a data processing chip, the data processing chip includes multiple processors, the multiple processors are divided into N-level processor groups, the N-level processor group includes at least two N-1-level processor groups, the 1-level processor group includes at least two processors, each processor group corresponds to a first control unit, and N is an integer greater than 1. Figure 3 , the method comprising:

[0027] 301. The data processing chip receives access requests to a first shared resource from multiple processors at the same time through an N-th level first control unit, and determines access duration of the N-th level processor group in response to the received multiple access requests.

[0028] The data processing chip can perform any data processing task, such as image processing tasks, audio processing tasks, etc. In the process of multiple processors in the data processing chip collaboratively performing the same data processing task, if multiple processors need to access the first shared resource, each processor will send an access request to the first shared resource. If the data processing chip receives access requests to the first shared resource from multiple processors at the same time through the Nth-level first control unit, the data processing chip will respond to the received multiple access requests and determine the access duration of the Nth-level processor group.

[0029] The data processing chip is any type of data processing chip, for example, a baseband chip, an image processing chip, an audio processing chip, etc. of a computer device. The processor included in the data processing chip is any type of processor, for example, a CPU (Central Processing Unit), an MCU (Microcontroller Unit), a DSP (Digital Signal Processor), a hardware accelerator, etc.

[0030] The N-th level first control unit corresponds to the N-th level processor group, and is used to control the access of the N-1-th level processor group included in the N-th level processor group to the first shared resource. The N-th level processor group can be regarded as the data processing chip itself, which includes at least two lower-level processor groups, and each lower-level processor also includes at least two lower-level processor groups, until the lowest-level processor group, i.e., the first-level processor group, includes at least two processors. Therefore, all processors in the data processing chip are indirectly included in the N-th level processor group. The access duration of the N-th level processor group refers to the access duration of the N-th level processor group to the first shared resource, and the access duration is the sum of the access durations of all the N-1-th level processor groups included in the N-th level processor group to the first shared resource.

[0031] The first shared resource is any resource outside the processor, such as a memory, an external device, etc., wherein the external device includes a display, a keyboard, a mouse, etc.

[0032] 302. The data processing chip determines the access duration of the N-1th level processor group based on the access duration of the Nth level processor group through the Nth level first control unit, until the access duration of the 1st level processor group is determined.

[0033] The data processing chip determines the access duration of the N-1th level processor group based on the access duration of the N-1th level processor group through the N-th level first control unit, so that the access of the N-1th level processor group to the first shared resource can be controlled based on the access duration of the N-1th level processor group through the N-th level first control unit.

[0034] Optionally, the data processing chip determines the access duration of each N-1th level processor group in the Nth level processor group based on the access duration of the corresponding Nth level processor group through the Nth level first control unit.

[0035] Taking the example of multiple processors in a data processing chip being divided into three levels of processor groups, the data processing chip determines the access time of the second-level processor group based on the access time of the third-level processor group through the third-level first control unit, and then determines the access time of the first-level processor group based on the access time of the second-level processor group through the second-level first control unit.

[0036] One point that needs to be explained is that, except for the Nth level processor group, the number of processor groups at each level is multiple. Since each processor group corresponds to a first control unit, the number of first control units at each level is multiple except for the Nth level first control unit. In the embodiment of the present application, except for the first control unit at the first level, the first control unit at any level is used to control the access of multiple lower-level processor groups in the corresponding processor group to the first shared resource. For example, except for the first control unit at the first level, the first control unit at any level is used to determine the access duration of multiple lower-level processor groups in the corresponding processor group.

[0037] 303. The data processing chip determines the access duration of each processor in the first-level processor group in sequence based on the access duration of the first-level processor group through the first-level first control unit, and controls each processor to access the first shared resource according to the determined access duration.

[0038] Among them, the data processing chip determines the access time of the first-ranked processor based on the access time of the corresponding first-level processor group through the first-level first control unit, controls the processor to access the first shared resource according to the determined access time, and then determines the access time of the second-ranked processor, controls the processor to access the first shared resource according to the determined access time, until each processor is controlled to access the first shared resource according to the determined access time.

[0039] The solution provided in the embodiment of the present application divides multiple processors in a data processing chip into multi-level processor groups, and except for the lowest-level processor group including multiple processors, each of the other processor groups includes at least two lower-level processor groups. Then, when multiple processors request access to shared resources at the same time, the resource access of the multiple processors is controlled in order from upper to lower levels, that is, the upper-level control unit determines the access duration of the processor group of the next level based on the access duration of the corresponding processor group, until the access duration of the processor group of the lowest level is determined, and the control unit corresponding to the processor group of the lowest level determines the access duration of the processor, and controls the processor to access the shared resources according to the determined access duration. This method distributes the task of controlling multiple processors to access shared resources to control units of multiple levels, and the control unit corresponding to the processor group of each level controls the resource access of the lower-level processor group, which not only ensures the orderliness of resource access, but also improves access efficiency.

[0040] Figure 4 A flowchart of a resource access method provided by an exemplary embodiment of the present application is shown. Figure 4 , executed by a data processing chip, the data processing chip includes a plurality of processors, the plurality of processors are divided into N-level processor groups, the N-th level processor group includes at least two N-1-th level processor groups, the 1-th level processor group includes at least two processors, each processor group corresponds to a first control unit, and N is an integer greater than 1. The method includes:

[0041] 401. The data processing chip sends access requests to the first-level first control units corresponding to the first-level processor group to which it belongs through multiple processors.

[0042] When multiple processors in a data processing chip need to access the first shared resource, the data processing chip sends access requests to the first-level first control unit corresponding to the first-level processor group through multiple processors, and the access requests are used to request access to the first shared resource.

[0043] 402. The data processing chip sends an access request to the first control unit of the second level through the first control unit of the first level, until the data processing chip sends an access request to the first control unit of the Nth level through the first control unit of the N-1th level.

[0044] Optionally, the data processing chip determines the second-level processor group to which the corresponding first-level processor group belongs through the first-level control unit of the first level, and sends an access request to the second-level first control unit corresponding to the second-level processor group. Then, the data processing chip determines the third-level processor group to which the corresponding second-level processor group belongs through the second-level first control unit, and sends an access request to the third-level first control unit corresponding to the third-level processor group, and so on, until the N-th-1-th-level first control unit determines the N-th-level processor group to which the corresponding N-1-th-level processor group belongs, and sends an access request to the N-th-level first control unit corresponding to the N-th-level processor group.

[0045] In an embodiment of the present application, access requests of multiple processors are transmitted to the first control unit of the highest level through the first control unit of each level in order from lower level to upper level, thereby ensuring the orderliness of access of multiple processors to shared resources, thereby improving the access efficiency to shared resources.

[0046] 403. The data processing chip receives access requests to the first shared resource from multiple processors at the same time through the Nth-level first control unit, and determines the access duration of the Nth-level processor group in response to the received multiple access requests.

[0047] Optionally, the data processing chip receives access requests sent by multiple N-1th level first control units at the same time through the Nth level first control unit, and determines the access duration of the Nth level processor group in response to the received multiple access requests.

[0048] Optionally, the Nth-level first control unit stores the access duration of the Nth-level processor group, and accordingly, the Nth-level first control unit directly obtains the stored access duration of the Nth-level processor group.

[0049] 404. The data processing chip multiplies the access time of the Nth level processor group by the access weight of the included N-1th level processor group through the Nth level first control unit to obtain the access time of the N-1th level processor group, until the access time of the 1st level processor group is obtained.

[0050] Among them, taking the case that multiple processors in the data processing chip are divided into 5-level processor groups, the data processing chip multiplies the access time of the 5th-level processor group by the access weight of the included 4th-level processor group through the 5th-level first control unit to obtain the access time of the 4th-level processor group, and then multiplies the access time of the 4th-level processor group by the access weight of the included 3rd-level processor group through the 4th-level first control unit to obtain the access time of the 3rd-level processor group, and so on, until the access time of the 1st-level processor group is obtained. It should be noted that the access weights of different processor groups are the same or different, and the embodiments of the present application do not limit this.

[0051] Optionally, the first control unit stores the access weight of each lower-level processor group included in the corresponding processor group. For example, the N-th first control unit stores the access weight of each N-1-th level processor group included in the corresponding N-th level processor group. Accordingly, the first control unit can directly obtain the stored access weight of each lower-level processor group, multiply the access duration of the corresponding processor group by the access weight of each lower-level processor group, and obtain the access duration of each lower-level processor group.

[0052] In an embodiment of the present application, the data processing chip multiplies the access time of the corresponding processor group by the access weight of each lower-level processor group through the first control unit to obtain the access time of each lower-level processor group. The access time of each lower-level processor group can be flexibly controlled through the access weight of each lower-level processor group, thereby improving the flexibility of accessing shared resources.

[0053] The above describes how the first control unit corresponding to the processor group calculates the access duration of each lower-level processor group. The following describes how to control the access of each lower-level processor group in sequence for multiple lower-level processor groups. In a possible implementation, the following steps are included: the data processing chip determines the access duration of the N-1th level processor group with the highest priority included based on the access duration of the N-1th level processor group through the N-th level first control unit, and sends the determined access duration to the N-1th level first control unit corresponding to the N-1th level processor group. The data processing chip receives the access completion notification sent by the N-1th level first control unit through the N-1th level first control unit, and in response to the access completion notification, determines the access duration of the next N-1th level processor group with a priority after the N-1th level processor group based on the access duration of the N-1th level processor group, and sends the determined access duration to the N-1th level first control unit corresponding to the next N-1th level processor group, until the access completion notification sent by the first control unit corresponding to the N-1th level processor group with the lowest priority is received. The access completion notification sent by any first control unit indicates that the processor group corresponding to the first control unit has completed the access to the first shared resource.

[0054] Optionally, after the data processing chip determines the access duration of any N-1th level processor group through the N-1th level first control unit, it sends the determined access duration to the N-1th level first control unit corresponding to the N-1th level processor group, and enables the access rights of the N-1th level processor group. Upon receiving the access completion notification from the first control unit corresponding to the N-1th level processor group, the data processing chip closes the access rights of the N-1th level processor group.

[0055] The above takes the N-level first control unit corresponding to the N-level processor group as an example to illustrate the method of controlling multiple lower-level processor groups to access resources. It should be noted that the first control unit corresponding to each processor group controls the access process of the lower-level processor group in a similar manner. The difference is that, except for the highest-level N-level first control unit, when other first control units receive the access completion notification of the first control unit corresponding to the lower-level processor group with the lowest priority, they send an access completion notification to the upper-level first control unit. In addition, except for the highest-level N-level first control unit and the lowest-level 1st-level first control unit, each first control unit receives the access duration sent by the upper-level first control unit, and in response to the access duration, determines the access duration of the lower-level processor group with the highest priority. Among them, the upper-level first control unit of the first control unit refers to the first control unit corresponding to the upper-level processor group to which the processor group corresponding to the first control unit belongs.

[0056] Optionally, the first control unit corresponding to each processor group stores access priorities of multiple subordinate processor groups. For example, the first control unit corresponding to each processor group stores identifiers of multiple subordinate processor groups, and the identifiers of these multiple subordinate processor groups are sorted in order of access priority.

[0057] In an embodiment of the present application, the first control unit corresponding to the processor group first determines the access duration of the subordinate processor group with a higher priority according to the priorities of the multiple subordinate processor groups, and controls the subordinate processor group to access the shared resources according to the access duration by sending the access duration to the first control unit corresponding to the subordinate processor group. When receiving the access completion notification sent by the first control unit corresponding to the subordinate processor group with a higher priority, the next processor group with a lower priority is controlled to access the shared resources in a similar manner until the subordinate processor group with the lowest priority is controlled to complete the access to the shared resources. This method ensures the orderliness of access and can greatly improve access efficiency. And it can flexibly control the order in which multiple processor groups access shared resources through the priorities of multiple processor groups, thereby improving the flexibility of accessing shared resources.

[0058] 405. The data processing chip multiplies the access time of the first-level processor group by the access weight of the processor with the highest priority included therein through the first-level first control unit to obtain the access time of the processor, and controls the processor to access the first shared resource according to the access time.

[0059] Optionally, after the data processing chip obtains the access duration of the processor through the first-level first control unit, the data processing chip sends the access duration to the processor. The processor accesses the first shared resource according to the access duration, and sends an access completion notification to the first-level first control unit after the access is completed. The data processing chip receives the access completion notification through the first-level first control unit, and executes the following step 306 in response to the access completion notification.

[0060] 406. The data processing chip multiplies the access time of the first-level processor group by the access weight of the next processor whose priority is after the processor through the first-level first control unit to obtain the access time of the next processor, and controls the next processor to access the first shared resource according to the access time, until the processor with the lowest priority in the first-level processor group is controlled to access the first shared resource according to the determined access time.

[0061] Optionally, after the data processing chip obtains the access duration of the next processor through the first-level first control unit, the data processing chip sends the access duration to the next processor. The next processor accesses the first shared resource according to the access duration, and sends an access completion notification to the first-level first control unit after the access is completed. The data processing chip receives the access completion notification through the first-level first control unit until it receives the access completion notification sent by the processor with the lowest priority.

[0062] Optionally, after determining the access duration of any processor through the first-level first control unit, the data processing chip sends the determined access duration to the processor and enables the access rights of the processor. Upon receiving the access completion notification from the processor, the data processing chip closes the access rights of the processor.

[0063] Optionally, the first-level control unit corresponding to each first-level processor group stores the access priorities of multiple processors in the first-level processor group. For example, the first-level control unit corresponding to each first-level processor group stores the identifiers of multiple processors in the first-level processor group, and the identifiers of the multiple processors are sorted in order of access priority.

[0064] Optionally, the access weights of the processor groups and the access weights of the processors are matched with the task type of the data processing task currently executed by the data processing chip. The following describes a method for obtaining the access weights of the processor groups and the access weights of the processors, including the following steps:

[0065] 1. The terminal obtains multiple historical access data of the data processing chip, each of which includes the access duration of each processor in the data processing chip to the first shared resource when the data processing chip historically processes a data processing task of a target type. The terminal is a terminal configured with the data processing chip or other terminal connected to the data processing chip, which is not limited in the embodiment of the present application.

[0066] 2. The terminal determines an average access duration of each processor to the first shared resource based on multiple historical access data.

[0067] For any processor, each historical access data contains a historical access duration of the processor, and the terminal determines an average access duration of multiple historical access durations of the processor.

[0068] 3. The terminal determines the ratio of the average access time of each processor to the average access time of the first-level processor group to which it belongs, and determines the ratio corresponding to each processor as the access weight of each processor. The average access time of the first-level processor group to which each processor belongs is the sum of the average access times of multiple processors in the first-level processor group.

[0069] 4. The terminal determines the ratio of the average access time of each first-level processor group to the average access time of the second-level processor group to which it belongs, and determines the ratio corresponding to each first-level processor group as the access weight of each first-level processor group, and so on, until the access weight of each N-1-th level processor group is obtained. Among them, the average access time of the second-level processor group to which each first-level processor group belongs is the sum of the average access times of multiple first-level processor groups in the second-level processor group.

[0070] 5. The terminal sends the access weight of each processor group, the access weight of each processor, and the average access time of the N-th level processor group to the data processing chip. The data processing chip stores the access weight of each processor in the first-level first control unit corresponding to the first-level processor group to which it belongs, and stores the access weight of each first-level processor group in the second-level first control unit corresponding to the second-level processor group to which it belongs, and so on, until the access weight of each N-1-th level processor group is stored in the N-th level first control unit corresponding to the N-th level processor group to which it belongs. In addition, the data processing chip also stores the average access time of the N-th level processor group in the N-th level first control unit.

[0071] After the above steps, the data processing chip completes the storage of data related to the access to the first shared resource. When processing data processing tasks belonging to the target type, the data processing chip can control the access of each processor to the first shared resource based on the stored access duration and weight. The access weights of multiple N-1-level processor groups stored by the N-level first control unit are shown in Table 1.

[0072] Table 1

[0073] The N-1th level processor cluster in the Nth level processor cluster Access weight N-1th level processor group 1 Weight 1 N-1th level processor group 2 Weight 2 N-1th level processor group 3 Weight 3 N-1th level processor group 4 Weight 4 …… ……

[0074] From the above access weight acquisition process, it can be seen that the access weights of processor groups at all levels satisfy the following relationship:

[0075]

[0076] ...

[0078]

[0079] Wherein, W represents the access weight, N represents the level of the processor group, M represents the number of processor groups at the same level, and M is an integer greater than 1. represents the access weight of the Mth level 1 processor group, represents the access weight of the M-1th level 1 processor group, Indicates the access weight of the first level 1 processor group, represents the access weight of the Mth second-level processor group, represents the access weight of the M-1th level 2 processor group, Indicates the access weight of the first second-level processor group, represents the access weight of the Mth level N-1 processor group, represents the access weight of the M-1th level N-1 processor group, Indicates the access weight of the 1st N-1th level processor group.

[0080] In an embodiment of the present application, since the access weights of the above-mentioned processor groups and the access weights of each processor are matched with the target type of data processing tasks, when executing data processing tasks belonging to the target type based on the data processing chip, a more reasonable access time can be allocated to each processor. Then, by controlling each processor to access shared resources within a reasonable access time, the access efficiency of multiple processors in the task processing chip to shared resources can be improved.

[0081] One point that needs to be explained is that the data processing chip can receive a data update instruction, and in response to the data update instruction, update the data stored in the first control unit. In a possible implementation, the first control unit of level I stores the access weight of the processor group of level I-1, where I is an integer greater than 1 and less than or equal to N. Accordingly, the data processing chip receives a weight update instruction through the first control unit of level I, and the weight update instruction carries the updated access weight of the processor group of level I-1; then the data processing chip responds to the weight update instruction through the first control unit of level I to update the access weight of the processor group of level I-1 stored in the first control unit of level I.

[0082] Optionally, the data processing chip receives the weight update instruction through the N-th level first control unit, sends the weight update instruction to the N-1-th level first control unit, receives the weight update instruction through the N-1-th level first control unit, and then sends the weight update instruction to the secondary first control unit, until the I-th level first control unit receives the weight update instruction.

[0083] In the embodiment of the present application, since the access duration of each processor group is equal to the product of the access duration of the upper-level processor group and the access weight of the processor group, by adjusting the access weight of the processor group, the access duration of the processing group to the shared resources can be adjusted, thereby improving the flexibility of each processing group's access to the shared resources.

[0084] Optionally, the first control unit of the first level stores the access weights of the processors included in the first level processor group. Accordingly, the data processing chip receives a weight update instruction through the first control unit of the first level, and the weight update instruction carries the updated access weights of the processors included in the first level processor group. Then the data processing chip responds to the weight update instruction through the first control unit of the first level to update the access weights of the stored processors. Among them, the implementation method of the data processing chip receiving the weight update instruction through the first control unit of the first level is the same as the implementation method of receiving the weight update instruction through the first control unit of the first level, and will not be repeated here. Since the access duration of each processor is equal to the product of the access duration of the processor group to which it belongs and the access weight of the processor, therefore, by adjusting the access weight of the processor, the access duration of the processor to the shared resource can be adjusted, thereby improving the flexibility of each processor in accessing the shared resource.

[0085] Optionally, the data processing chip can also update the access duration of the Nth-level processor group stored in the Nth-level first control unit. That is, the data processing chip receives a duration update instruction through the Nth-level first control unit, and the duration update instruction carries the updated access duration of the Nth-level processor group. Then, the data processing chip responds to the duration update instruction through the Nth-level first control unit to update the stored access duration of the Nth-level processor group. Since the access duration of each level of processing group and the access duration of each processor in the data processing chip are related to the access duration of the Nth-level processor group, by adjusting the access duration of the Nth-level processor group, the access duration of each processor group and each processor to the shared resources can be indirectly adjusted, thereby improving the flexibility of access to the shared resources.

[0086] Optionally, the above-mentioned data update instructions, such as weight update instructions and duration update instructions, are sent to the data processing chip by a terminal configured with the data processing chip. Taking the weight update instruction as an example, the terminal displays a data update interface, which includes the access weights of each processor group and the access weights of each processor. In response to the modification operation of any access weight in the data update interface, the terminal generates a corresponding access weight update instruction, and then sends the access weight update instruction to the data processing chip.

[0087] The solution provided in the embodiment of the present application divides multiple processors in a data processing chip into multi-level processor groups, and except for the lowest-level processor group including multiple processors, each of the other processor groups includes at least two lower-level processor groups. Then, when multiple processors request access to shared resources at the same time, the resource access of the multiple processors is controlled in order from upper to lower levels, that is, the upper-level control unit determines the access duration of the processor group of the next level based on the access duration of the corresponding processor group, until the access duration of the processor group of the lowest level is determined, and the control unit corresponding to the processor group of the lowest level determines the access duration of the processor, and controls the processor to access the shared resources according to the determined access duration. This method distributes the task of controlling multiple processors to access shared resources to control units of multiple levels, and the control unit corresponding to the processor group of each level controls the resource access of the lower-level processor group, which not only ensures the orderliness of resource access, but also improves access efficiency.

[0088] Furthermore, the access requests of multiple processors are transmitted to the first control unit at the highest level through the first control unit at each level in order from the lower level to the upper level, thereby ensuring the orderliness of the access of multiple processors to shared resources and improving the access efficiency to shared resources.

[0089] In addition, the data processing chip multiplies the access time of the corresponding processor group by the access weight of each lower-level processor group through the first control unit to obtain the access time of each lower-level processor group. The access time of each lower-level processor group can be flexibly controlled through the access weight of each lower-level processor group, thereby improving the flexibility of accessing shared resources.

[0090] Furthermore, the first control unit corresponding to the processor group first determines the access duration of the lower-level processor group with a higher priority according to the priorities of the multiple lower-level processor groups, and controls the lower-level processor group to access the shared resources according to the access duration by sending the access duration to the first control unit corresponding to the lower-level processor group. When receiving the access completion notification sent by the first control unit corresponding to the lower-level processor group with a higher priority, the next processor group with a lower priority is controlled to access the shared resources in a similar manner until the lower-level processor group with the lowest priority is controlled to complete the access to the shared resources. This method ensures the orderliness of access and can greatly improve access efficiency. Furthermore, the order in which multiple processor groups access shared resources can be flexibly controlled through the priorities of multiple processor groups, thereby improving the flexibility of accessing shared resources.

[0091] Above Figure 3 and Figure 4 The illustrated embodiment describes a method for controlling multiple processors to access a shared resource outside the processor, as follows: Figure 5The illustrated embodiment describes a method of controlling multiple processing units within a processor to access shared resources within the processor.

[0092] Figure 5 A flowchart of a resource access method provided by an exemplary embodiment of the present application is shown, which is executed by a data processing chip, wherein each processor in the data processing chip includes multiple processing units and a second control unit. Figure 5 , the method comprising:

[0093] 501. The data processing chip receives access requests to a second shared resource from multiple processing units in a processor at the same time through a second control unit, and determines the access duration of the processor to the second shared resource in response to the received multiple access requests.

[0094] The processing unit is any type of processing unit, for example, a scalar arithmetic logic unit, a vector arithmetic logic unit, etc. The processing unit can also be referred to as a FU (Function Unit).

[0095] When multiple processing units in the data processing chip need to access the second shared resource, they respectively send access requests to the second control unit. If the second control unit receives access requests to the second shared resource from multiple processing units at the same time, then in response to the received multiple access requests, the processor determines the access duration of the second shared resource. The second shared resource is a shared resource inside the processor, such as a register, and the embodiment of the present application does not limit this.

[0096] 502. The data processing chip determines, through the second control unit, the access duration of each processing unit to the second shared resource in turn based on the access duration of the processor to the second shared resource, and controls each processing unit to access the second shared resource according to the determined access duration.

[0097] In a possible implementation, the data processing chip, through the second control unit, multiplies the processor's access duration to the second shared resource by the access weight of the processing unit with the highest priority, obtains the access duration of the processing unit, and controls the processing unit to access the second shared resource according to the access duration; then the data processing chip, through the second control unit, multiplies the processor's access duration to the second shared resource by the access weight of the next processing unit whose priority is after the processing unit, obtains the access duration of the next processing unit, and controls the next processing unit to access the second shared resource according to the access duration, until the processing unit with the lowest priority is controlled to access the second shared resource according to the determined access duration. The above method can not only control the access duration of multiple processing units to the second shared resource, but also flexibly control the order in which multiple processing units access the second shared resource through the priorities of multiple processing units, thereby improving the flexibility of accessing shared resources.

[0098] It should be noted that the access weights of different processors may be the same or different, and the embodiments of the present application do not impose any restrictions on this.

[0099] Figure 6 is a schematic diagram of a processor provided in an embodiment of the present application. Figure 6 , the processor includes a second control unit and at least two processing units ( Figure 6 (4 processing units are taken as an example). The processor controls the access of multiple processing units to the second shared resource through the internal second control unit.

[0100] Optionally, the access weight of each processing unit is matched with the task type of the data processing task currently executed by the data processing chip. The following describes a method for obtaining the access weight of each processing unit, including the following steps:

[0101] 1. The terminal obtains multiple historical access data of the data processing chip, each of which includes the access duration of each processing unit in each processor in the data processing chip to the second shared resource when the data processing chip historically processes a data processing task of a target type. The terminal is a terminal configured with the data processing chip or other terminals connected to the data processing chip, which is not limited in the embodiments of the present application.

[0102] 2. The terminal determines an average access duration of each processing unit to the second shared resource based on multiple historical access data.

[0103] For any processing unit, each historical access data contains a historical access duration of the processing unit, and the terminal determines an average access duration of multiple historical access durations of the processing unit.

[0104] 3. The terminal determines the ratio of the average access time of each processing unit to the average access time of the processor to which it belongs, and determines the ratio corresponding to each processing unit as the access weight of each processing unit. The average access time of the processor to which each processing unit belongs is the sum of the average access times of multiple processing units in the processor.

[0105] 4. The terminal sends the average access time of each processor to the second shared resource and the access weights of the multiple processing units in each processor to the second shared resource to the data processing chip, and the data processing chip stores the average access time of each processor to the second shared resource and the access weights of the multiple processing units in each processor to the second shared resource in the second control unit in each processor, respectively.

[0106] After the above steps, the data processing chip completes the storage of data related to the access to the second shared resource. When processing data processing tasks belonging to the target type, the data processing chip can control the access of each processing unit in the processor to the second shared resource based on the stored access duration and weight. The access weights of multiple processing units stored by the second control unit in any processor are shown in Table 2.

[0107] Table 2

[0108] processor Access weight Processing unit 1 Weight 1 Processing unit 2 Weight 2 Processing unit 3 Weight 3 Processing unit 4 Weight 4 …… ……

[0109] From the above access weight acquisition process, it can be seen that the access weight of each processor unit in the processor satisfies the following relationship:

[0110] P X +P X-1 +…+P1=100%

[0111] Wherein, P represents the weight, X represents the number of processing units, and X is an integer greater than 1. X represents the access weight of the Xth processing unit, P X-1 represents the access weight of the X-1th processing unit, and P1 represents the access weight of the 1st processing unit.

[0112] One point that needs to be explained is that, in the embodiment of the present application, since multiple secondary processor groups share a first control unit, the first control unit uniformly controls the access of the multiple secondary processor groups to the first shared resource, and multiple processing units share a second control unit, the second control unit uniformly controls the access of the multiple processing units to the second shared resource, the number of control units and the number of data read and write ports in the data processing chip can be reduced, thereby reducing the chip area and reducing the dynamic consumption generated by the data processing chip accessing shared resources.

[0113] The embodiments of the present application can greatly improve the efficiency of using shared resources. For example, taking the communication chip in any device as an example, after the device is started, according to the length of time that different processors in the communication chip need to use the shared resources, the access duration of the communication chip to the shared resources, the access weights of different processor groups, and the access weights of different processors are configured. When a specific data processing task is performed based on the communication chip, the access of each processor to the shared resources is controlled according to the configured access duration and access weight, so as to achieve the maximum efficiency of using the shared resources.

[0114] In an embodiment of the present application, when multiple processing units request access to the second shared resource, the second control unit determines the access duration of each processing unit to the second shared resource in turn based on the access duration of the processor to the second shared resource, and controls each processing unit to access the second shared resource according to the determined access duration, thereby ensuring the orderliness of the access of multiple processing units to the shared resource, thereby improving the access efficiency of multiple processing units to the shared resource.

[0115] In the embodiment of the present application, the data processing chip, through the second control unit, first multiplies the access duration of the processor to the second shared resource by the access weight of the processing unit with a higher priority according to the priority of multiple lower-level processor groups, obtains the access duration of the processing unit, controls the processing unit to access the second shared resource according to the access duration, and then controls the next processing unit with a lower priority to access the shared resource in a similar manner, until the processing unit with the lowest priority is controlled to access the second shared resource according to the determined access duration. This method can not only control the access duration of multiple processing units to the second shared resource, but also flexibly control the order in which multiple processing units access the second shared resource through the priorities of multiple processing units, thereby improving the flexibility of accessing shared resources.

[0116] The present application also provides a data processing chip, which includes multiple processors, and the multiple processors are divided into N-level processor groups. The N-th level processor group includes at least two N-1-th level processor groups, and the 1st level processor group includes at least two processors. Each processor group corresponds to a first control unit, and N is an integer greater than 1; when the chip runs on a computer device, it is used to implement the resource access method in the above embodiment.

[0117] The present application also provides a computer device, which includes a data processing chip, the data processing chip includes multiple processors, the multiple processors are divided into N-level processor groups, the N-th level processor group includes at least two N-1-th level processor groups, the 1st level processor group includes at least two processors, each processor group corresponds to a first control unit, and N is an integer greater than 1; the computer device is used to run the data processing chip to implement the resource access method in the above embodiment.

[0118] The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.

[0119] Those skilled in the art can understand that all or part of the steps in the resource access method of the above embodiment can be completed by hardware, or by a program to instruct the relevant hardware to complete, and the program can be stored in a computer-readable storage medium, and the above-mentioned storage medium can be a read-only memory, a disk or an optical disk, etc. The above description is only an optional embodiment of the present application and is not intended to limit the present application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.

Claims

1. A resource access method, characterized in that: The method is executed by a data processing chip, wherein the data processing chip includes a plurality of processors, wherein the plurality of processors are divided into N-level processor groups, wherein the N-th level processor group includes at least two N-1-th level processor groups, and the 1-th level processor group includes at least two of the processors, wherein each processor group corresponds to a first control unit, and N is an integer greater than 1; The method comprises: receiving access requests of the plurality of processors to the first shared resource at the same time through the first control unit of the Nth level, and determining the access duration of the processor group of the Nth level in response to the received plurality of access requests; Determine, by the Nth-first control unit, the access duration of the N-1th-level processor group based on the access duration of the Nth-level processor group, until the access duration of the 1st-level processor group is determined; The first control unit of the first level determines the access duration of each processor in the first level processor group in turn based on the access duration of the first level processor group, and controls each processor to access the first shared resource according to the determined access duration.

2. The method according to claim 1, characterized in that Before receiving, at the same time, access requests from the plurality of processors to the first shared resource through the Nth-level first control unit, the method further includes: Sending the access request to the first-level first control unit corresponding to the first-level processor group through the multiple processors; The access request is sent to the second-level first control unit through the first-level first control unit, until the access request is sent to the N-level first control unit through the N-1-th-level first control unit.

3. The method according to claim 1, characterized in that: The step of determining the access duration of the N-1th level processor group based on the access duration of the Nth level processor group by the Nth level first control unit until the access duration of the 1st level processor group is determined includes: Through the Nth level first control unit, the access duration of the Nth level processor group is multiplied by the access weight of the included N-1th level processor group to obtain the access duration of the N-1th level processor group, until the access duration of the 1st level processor group is obtained.

4. The method according to claim 1, characterized in that: The step of determining the access duration of the N-1th level processor group based on the access duration of the Nth level processor group by the Nth level first control unit until the access duration of the 1st level processor group is determined includes: Determine, by the Nth-first control unit, the access duration of the N-1th-level processor group with the highest priority based on the access duration of the Nth-level processor group, and send the determined access duration to the N-1th-level first control unit corresponding to the N-1th-level processor group; Receiving, by the N-th level first control unit, an access completion notification sent by the N-1-th level first control unit, in response to the access completion notification, determining, based on the access duration of the N-th level processor group, an access duration of a next N-1-th level processor group whose priority is after the N-1-th level processor group, and sending the determined access duration to the N-1-th level first control unit corresponding to the next N-1-th level processor group, until receiving an access completion notification sent by the first control unit corresponding to the N-1-th level processor group with the lowest priority; The access completion notification sent by any first control unit indicates that the processor group corresponding to the first control unit has completed access to the first shared resource.

5. The method according to claim 1, characterized in that The first-level first control unit sequentially determines the access duration of each processor in the first-level processor group based on the access duration of the first-level processor group, and controls each processor to access the first shared resource according to the determined access duration, including: By means of the first-level first control unit, the access duration of the first-level processor group is multiplied by the access weight of the processor with the highest priority included therein to obtain the access duration of the processor, and the processor is controlled to access the first shared resource according to the access duration; Through the first-level first control unit, the access duration of the first-level processor group is multiplied by the access weight of the next processor whose priority is after the processor to obtain the access duration of the next processor, and the next processor is controlled to access the first shared resource according to the access duration, until the processor with the lowest priority in the first-level processor group is controlled to access the first shared resource according to the determined access time.

6. The method according to any one of claims 1 to 5, characterized in that: The processor includes a plurality of processing units and a second control unit; the method further includes: receiving, by the second control unit, access requests from the multiple processing units to the second shared resource at the same time, and determining, in response to the received multiple access requests, a duration of access of the processor to the second shared resource; Through the second control unit, based on the access duration of the processor to the second shared resource, the access duration of each processing unit to the second shared resource is determined in turn, and each processing unit is controlled to access the second shared resource according to the determined access duration.

7. The method according to claim 6, characterized in that The method of sequentially determining, by the second control unit, the access duration of each processing unit to the second shared resource based on the access duration of the processor to the second shared resource, and controlling each processing unit to access the second shared resource according to the determined access duration includes: By means of the second control unit, multiplying the access duration of the processor to the second shared resource by the access weight of the processing unit with the highest priority to obtain the access duration of the processing unit, and controlling the processing unit to access the second shared resource according to the access duration; Through the second control unit, the processor's access duration to the second shared resource is multiplied by the access weight of the next processing unit whose priority is after the processing unit to obtain the access duration of the next processing unit, and the next processing unit is controlled to access the second shared resource according to the access duration until the processing unit with the lowest priority is controlled to access the second shared resource according to the determined access duration.

8. The method according to claim 3, characterized in that The first control unit of level I stores the access weight of the processor group of level I-1, where I is an integer greater than 1 and less than or equal to N; the method further includes: Receiving, by the first control unit of the first level, a weight update instruction, wherein the weight update instruction carries the updated access weight of the processor group of the first level I-1; The access weight of the I-1th level processor group stored in the I-1th level first control unit is updated in response to the weight update instruction through the I-th level first control unit.

9. A data processing chip, characterized in that: The data processing chip includes a plurality of processors, the plurality of processors are divided into N-level processor groups, the N-th level processor group includes at least two N-1-th level processor groups, the 1-th level processor group includes at least two of the processors, each processor group corresponds to a first control unit, and N is an integer greater than 1; When the chip is run on a computer device, it is used to implement the resource access method according to any one of claims 1 to 8.

10. A computer device, characterized in that: The computer device includes a data processing chip, the data processing chip includes a plurality of processors, the plurality of processors are divided into N-level processor groups, the N-th level processor group includes at least two N-1-th level processor groups, the 1-th level processor group includes at least two of the processors, each processor group corresponds to a first control unit, and N is an integer greater than 1; The computer device is used to run the data processing chip to implement the resource access method according to any one of claims 1 to 8.