Task processing method, processor, device, storage medium and program product
By grouping business subsystem instances in a multi-core processor and setting a target scheduling processor, the performance bottleneck problem of task allocation and processing in the multi-core processor is solved, and efficient and flexible task processing and resource utilization are achieved to meet the needs of different application scenarios.
Patent Information
- Application Number
- PCT/CN2025/082330
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2024-03-26
- Filing Date
- 2025-03-13
- Publication Date
- 2025-10-02
AI Technical Summary
In multi-core processors, how to effectively allocate and process tasks becomes an important issue. In particular, in multi-core processors, existing technologies find it difficult to avoid performance bottlenecks caused by scheduling processors and to flexibly adjust them according to task characteristics and system load conditions.
By grouping the business subsystem instances in the multi-core processor and setting a target scheduling processor for each subsystem group, the business subsystem instances and target scheduling processors in the subsystem group are used to process the task queue, avoiding the performance bottleneck caused by a single scheduling processor in the traditional solution, and making flexible adjustments based on task characteristics and system load conditions.
It avoids performance bottlenecks in multi-core processors, improves task processing efficiency and scheduling flexibility, adapts to various application scenarios and needs, and improves processor resource utilization and data security.
Smart Images

Figure CN2025082330_02102025_PF_FP_ABST
Abstract
Description
Task processing method, processor, device, storage medium and program product
[0001] CROSS-REFERENCE TO RELATED APPLICATIONS
[0002] The embodiments of this application are based on the Chinese patent application with application number 202410354975.8, application date March 26, 2024, and application name “Task processing method, processor, device, storage medium and program product”, and claim the priority of the Chinese patent application. The entire content of the Chinese patent application is hereby introduced into this application as a reference. Technical Field
[0003] The present application relates to, but is not limited to, the field of computer technology, and in particular to a task processing method, processor, device, storage medium, and program product. Background Art
[0004] With the continuous advancement of computer technology, multi-core processors have become the mainstream architecture for today's computer systems. Multi-core processors contain multiple cores, each capable of independently executing tasks, enabling the processor to handle multiple tasks in parallel. However, how to efficiently distribute and process tasks within a multi-core processor has become a significant challenge. Summary of the Invention
[0005] In view of this, embodiments of the present application provide at least one task processing method, processor, device, storage medium, and program product.
[0006] The technical solution of the embodiment of the present application is implemented as follows:
[0007] On the one hand, an embodiment of the present application provides a task processing method, which is applied to a processor including multiple cores, wherein the cores include a scheduling processor and a business subsystem instance; the method includes: grouping the business subsystem instances corresponding to the target business type in at least one of the cores to obtain at least one subsystem grouping corresponding to the target business type; determining the target scheduling processor corresponding to the subsystem group in the scheduling processor in at least one of the cores; and processing the task queue of the target business type using the business subsystem instance and the corresponding target scheduling processor in the subsystem group.
[0008] In some embodiments, grouping the business subsystem instances corresponding to the target business type in at least one of the cores to obtain at least one subsystem grouping corresponding to the target business type includes: obtaining the grouping requirements corresponding to the target business type; and grouping the business subsystem instances corresponding to the target business type in at least one of the cores based on the grouping requirements corresponding to the target business type to obtain at least one subsystem grouping corresponding to the target business type.
[0009] In some embodiments, the grouping requirement includes at least one of the following: a group quantity requirement and a quantity requirement of business subsystem instances within a subsystem group; wherein, in a virtualization scenario, the grouping quantity requirement is the number of users in the virtualization scenario, and the quantity requirement is determined based on the performance requirements of the users; in a multi-program scenario, the grouping quantity requirement is the number of applications in the multi-program scenario, and the quantity requirement is determined based on the performance requirements of the applications.
[0010] In some embodiments, determining the target scheduling processor corresponding to the subsystem group in the scheduling processor in at least one of the cores includes: determining each scheduling processor corresponding to each business subsystem instance of the subsystem group in the scheduling processor in at least one of the cores; and determining the target scheduling processor corresponding to the subsystem group in each of the scheduling processors.
[0011] In some embodiments, determining the target scheduling processor corresponding to the subsystem group in each scheduling processor includes: obtaining load information of each scheduling processor; the load information is at least used to characterize the scheduling status of the scheduling processor for business subsystem instances of non-target business types; based on the load information, determining the target scheduling processor in each scheduling processor.
[0012] In some embodiments, the use of the business subsystem instance and the corresponding target scheduling processor in the subsystem group to process the task queue of the target business type includes: responding to the task issuance event of the target business type, obtaining at least one task in the task queue through the target scheduling processor, and distributing the at least one task to at least one business subsystem instance in the subsystem group; processing the distributed task through at least one business subsystem instance in the subsystem group.
[0013] In some embodiments, the use of the business subsystem instance in the subsystem group and the corresponding target scheduling processor to process the task of the target business type includes: in response to the task issuance event of the target business type, obtaining the task information of the task through the target scheduling processor, and sending the task information of the task to the business subsystem instance in the subsystem group; determining the subtask information corresponding to the business subsystem instance based on the task information of the task through the business subsystem instance in the subsystem group; obtaining and processing the distributed subtasks based on the corresponding subtask information through the business subsystem instance in the subsystem group.
[0014] In some embodiments, the method further includes: in response to a system event generated by a business subsystem instance in the subsystem group, reporting the system event to a target scheduling processor corresponding to the subsystem group through the business subsystem instance; wherein the system event includes at least one of the following: a task completion event, a task and scheduling processor interaction event, a multi-core task synchronization event, and a subsystem abnormality event.
[0015] In some embodiments, the processor further includes a host processor; the responding to a system event generated by a business subsystem instance in the subsystem group, reporting the system event to a target scheduling processor corresponding to the subsystem group via the business subsystem instance, includes: responding to a first task completion event generated by a business subsystem instance in the subsystem group, reporting the first task completion event to the target scheduling processor corresponding to the subsystem group via the business subsystem instance; the first task completion event is generated when the business subsystem instance completes processing of a distributed subtask;
[0016] The method also includes: in response to the target scheduling processor corresponding to the subsystem group receiving a first task completion event reported by the business subsystem instance distributed within the subsystem group, reporting a second task completion event to the host processor in the processor through the target scheduling processor; the second task completion event is used to indicate that the task of the target business type has been completed.
[0017] In some embodiments, the processor also includes a public subsystem, which is used to provide public resources for the business subsystem instance; the method also includes: in response to a public event corresponding to the public subsystem, the processor also includes a host processor; the public event is sent to the public event processing unit through the public subsystem, and the public event is processed by the public event processing unit.
[0018] In some embodiments, sending the common event to the common event processing unit through the common subsystem and processing the common event through the common event processing unit include at least one of the following: when the common event processing unit is a target scheduling processor, reporting the common event to all target scheduling processors of the processor through the common subsystem; when the target scheduling processor determines that the common event is related to itself, processing the common event through the target scheduling processor; or, when the common event processing unit is a target scheduling processor, reporting the common event to the main scheduling processor through the common subsystem; the main scheduling processor is the scheduling processor of the main core among the multiple cores; determining, through the main scheduling processor, the to-be-sent scheduling processor corresponding to the common event among the target scheduling processors corresponding to each of the subsystem groups; sending the common event to the to-be-sent scheduling processor through the main scheduling processor, and processing the common event through the to-be-sent scheduling processor; or, when the common event processing unit is a host processor, reporting the common event to the host processor through the common subsystem; processing the common event through the host processor.
[0019] In some embodiments, the business subsystem instance is configured with an information register; the method further includes: in response to determining the target scheduling processor corresponding to the subsystem grouping, storing the grouping information of the subsystem grouping corresponding to the business subsystem instance through the information register; the grouping information is used to determine the core corresponding to each of the business subsystem instances in the subsystem grouping and the core corresponding to the target scheduling processor of the subsystem group.
[0020] In some embodiments, the information register includes a mask register; the storing of the grouping information of the subsystem group corresponding to the business subsystem instance through the information register includes: storing the core mask corresponding to the subsystem group through the mask register; wherein, the core mask includes a sub-mask corresponding to each core in the processor, and when the business subsystem instance corresponding to the core belongs to the subsystem group, the sub-mask corresponding to the core is set to a first value; when the business subsystem instance corresponding to the core does not belong to the subsystem group, the sub-mask corresponding to the core is set to a second value; the core masks stored in the mask registers of the business subsystem instances in the same subsystem group are the same, and the core masks stored in the mask registers of the business subsystem instances in different subsystem groups are mutually exclusive.
[0021] In some embodiments, the information register includes a number register; storing the grouping information of the subsystem group corresponding to the business subsystem instance through the information register includes: storing the identifier of the core corresponding to the target scheduling processor of the subsystem group through the number register.
[0022] On the other hand, an embodiment of the present application provides a processor, which includes multiple cores, and the cores include a host processor, a business subsystem instance and a scheduling processor, wherein: the host processor is configured to group the business subsystem instances corresponding to the target business type in at least one of the cores to obtain at least one subsystem grouping corresponding to the target business type; in the scheduling processor in at least one of the cores, the target scheduling processor corresponding to the subsystem group is determined; the business subsystem instances in the subsystem group and the target scheduling processor corresponding to the subsystem group are configured to process the task queue of the target business type.
[0023] On the other hand, an embodiment of the present application provides a computer device, including a memory and a processor, wherein the memory stores a computer program that can be run on the processor, and when the processor executes the program, it implements some or all of the steps in the above method.
[0024] On the other hand, an embodiment of the present application provides a computer-readable storage medium having a computer program stored thereon, which implements some or all of the steps in the above method when executed by a processor.
[0025] On the other hand, an embodiment of the present application provides a computer program product, including a computer program or instructions, which, when executed by a processor, implements some or all of the steps in the above method.
[0026] In an embodiment of the present application, in a processor including multiple cores, for business subsystem instances of a target business type, the present application groups the business subsystem instances corresponding to the target business type in the processor from the dimension of the business subsystem instances, and at the same time, sets a corresponding target scheduling processor for the subsystem grouping obtained after grouping. In this way, compared with the traditional solution of using one scheduling processor to handle task scheduling of all business subsystem instances, the performance bottleneck problem caused by the scheduling processor can be avoided; at the same time, since the business subsystem instances corresponding to the target business type in the processor are grouped from the dimension of the business subsystem instances, compared with the traditional solution of grouping from the core level, the subsystem grouping can be flexibly adjusted according to different task characteristics and system load conditions, and thus can adapt to various application scenarios and needs.
[0027] It should be understood that the above general description and the following detailed description are merely exemplary and explanatory, and do not limit the technical solutions of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0028] The drawings herein are incorporated into and constitute a part of the specification. These drawings illustrate embodiments consistent with the present application and, together with the specification, are used to illustrate the technical solutions of the present application.
[0029] FIG1 is a schematic diagram of a first implementation flow of a task processing method provided in an embodiment of the present application;
[0030] FIG2 is a second schematic diagram of an implementation flow of a task processing method provided in an embodiment of the present application;
[0031] FIG3 is a third schematic diagram of an implementation flow of a task processing method provided in an embodiment of the present application;
[0032] FIG4 is a fourth schematic diagram of an implementation flow of a task processing method provided in an embodiment of the present application;
[0033] FIG5 is a fifth schematic diagram of an implementation flow of a task processing method provided in an embodiment of the present application;
[0034] FIG6A is a sixth schematic diagram of an implementation flow of a task processing method provided in an embodiment of the present application;
[0035] FIG6B is a schematic diagram of a process flow for processing a task completion event provided by an embodiment of the present application;
[0036] FIG7 is a seventh schematic diagram of an implementation flow of a task processing method provided in an embodiment of the present application;
[0037] FIG8 is a first schematic diagram of a process flow for processing a public event provided in an embodiment of the present application;
[0038] FIG9 is a second schematic diagram of a process flow for processing a public event provided in an embodiment of the present application;
[0039] FIG10 is a flowchart illustrating an implementation of a task processing method according to an embodiment of the present application;
[0040] FIG11 is a schematic diagram of the composition structure of a processor provided in an embodiment of the present application;
[0041] FIG12 is a first schematic diagram of the corresponding relationship between a business subsystem instance and a scheduling processor provided in an embodiment of the present application;
[0042] FIG13 is a second schematic diagram of the corresponding relationship between a business subsystem instance and a scheduling processor provided in an embodiment of the present application;
[0043] FIG14 is a third schematic diagram of the corresponding relationship between a business subsystem instance and a scheduling processor provided in an embodiment of the present application;
[0044] FIG15 is a schematic diagram of a hardware entity of a computer device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0045] In order to make the purpose, technical solutions and advantages of this application clearer, the technical solutions of this application are further elaborated in detail below with reference to the accompanying drawings and embodiments. The described embodiments should not be regarded as limiting this application. All other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.
[0046] In the following description, references to "some embodiments" describe a subset of all possible embodiments. However, it is understood that "some embodiments" may be the same subset or different subsets of all possible embodiments, and may be combined with each other without conflict. The terms "first / second / third" are merely used to distinguish similar objects and do not represent a specific ordering of the objects. It is understood that the specific order or sequence of "first / second / third" may be interchanged where permitted, so that the embodiments of the present application described herein can be implemented in an order other than that illustrated or described herein.
[0047] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by those skilled in the art to which this application pertains. The terms used herein are for the purpose of describing this application only and are not intended to limit this application.
[0048] An embodiment of the present application provides a task processing method that can be executed by a processor of a computer device. The computer device may be a server, a laptop, a tablet computer, a desktop computer, a smart TV, a set-top box, a mobile device (e.g., a mobile phone, a portable video player, a personal digital assistant, a dedicated messaging device, a portable gaming device), or other device with data processing capabilities. In an embodiment of the present application, the task processing method is applied to a processor comprising multiple cores, the core comprising a scheduling processor and a business subsystem instance.
[0049] FIG1 is a schematic diagram of a first implementation flow of a task processing method provided in an embodiment of the present application. As shown in FIG1 , the method includes the following steps S101 to S103:
[0050] Step S101: Group business subsystem instances corresponding to a target business type in at least one of the cores to obtain at least one subsystem group corresponding to the target business type.
[0051] In an embodiment of the present application, the processor includes multiple cores, and the multiple cores include business subsystem instances of the same category. For a category of business subsystem instances, considering that the business subsystem instance can exist in each core or only in one core, in the process of grouping the business subsystem instances of the category, at least one core (where a business subsystem instance of the category exists) is determined among the multiple cores. Accordingly, in step S101, the business subsystem instances of the same category in at least one core are grouped to obtain at least one subsystem group corresponding to the category, and the subsystem group includes at least one business subsystem instance. It can be understood that the embodiment of the present application groups the business subsystem instances of the same type in the processor from the dimension of the type of the business subsystem instance to obtain at least one subsystem group corresponding to the type. For the convenience of explaining the embodiment of the present application, the target business type will be used as an example to illustrate the present application below, which is not a limitation to the embodiment of the present application.
[0052] In some embodiments, each of the multiple cores of the processor includes a business subsystem instance of the target business type; in other embodiments, each of the multiple cores of the processor includes at least one business subsystem instance of the target business type; in still other embodiments, among the multiple cores of the processor, there may be a core that does not include a business subsystem instance of the target business type. In other words, the business subsystem instances of the target business type in the processor may be distributed across all cores or across some cores; at the same time, there may be only one business subsystem instance of the target business type in a core, or there may be multiple business subsystem instances, and this application does not limit this.
[0053] In some embodiments, during the grouping process, all business subsystem instances of the target business type in the processor may be grouped to obtain at least one subsystem group corresponding to the target business type; or some business subsystem instances of the target business type in the processor may be grouped to obtain at least one subsystem group corresponding to the target business type. For example, for the target business type, if the processor includes 8 business subsystem instances, all 8 business subsystem instances may be grouped, or some (e.g., 5) business subsystem instances may be grouped.
[0054] Step S102: Determine a target scheduling processor corresponding to the subsystem group in at least one scheduling processor in the core.
[0055] Among them, each core includes a scheduling processor. After grouping to obtain at least one subsystem group, a target scheduling processor needs to be determined for each subsystem group; the target scheduling processor is used to process the target business type tasks with the business subsystem instance within the subsystem group.
[0056] In some embodiments, for a subsystem group, the target scheduling processor corresponding to the subsystem group is the scheduling processor of any core in the processor. For example, taking the current processor including 8 cores, each core including a scheduling processor and a business subsystem instance of a target business type, if the business subsystem instances of cores 1 to 3 are regarded as the first subsystem group, and the business subsystem instances of cores 4 to 8 are regarded as the second subsystem group, then the target scheduling processors of both the first and second subsystem groups can be the scheduling processor of any core among the 8 cores.
[0057] In other embodiments, the target scheduling processor corresponding to the subsystem group is the scheduling processor of the core to which each business subsystem instance within the subsystem group belongs. Based on the above example, if the business subsystem instances of cores 1 to 3 are used as the first subsystem group, and the business subsystem instances of cores 4 to 8 are used as the second subsystem group, then the target scheduling processor for the first subsystem group is the scheduling processor of any one of the cores 1 to 3; and the target scheduling processor for the second subsystem group is the scheduling processor of any one of the cores 4 to 8.
[0058] Step S103: Utilize the business subsystem instance in the subsystem group and the corresponding target scheduling processor to process the task queue of the target business type.
[0059] In some embodiments, in the process of processing the task queue of the target business type through subsystem grouping, the target scheduling processor can be used to distribute the task queue of the target business type to each business subsystem instance within the subsystem group, and then process the distributed task queue through each business subsystem instance within the subsystem group to complete the task queue of the target business type.
[0060] In an embodiment of the present application, in a processor including multiple cores, for business subsystem instances of a target business type, the present application groups the business subsystem instances corresponding to the target business type in the processor from the dimension of the business subsystem instances, and at the same time, sets a corresponding target scheduling processor for the subsystem grouping obtained after grouping. In this way, compared with the traditional solution of using one scheduling processor to handle task scheduling of all business subsystem instances, the performance bottleneck problem caused by the scheduling processor can be avoided; at the same time, since the business subsystem instances corresponding to the target business type in the processor are grouped from the dimension of the business subsystem instances, compared with the traditional solution of grouping from the core level, the subsystem grouping can be flexibly adjusted according to different task characteristics and system load conditions, and thus can adapt to various application scenarios and needs.
[0061] Figure 2 is a second schematic diagram of a task processing method according to an embodiment of the present application. Based on Figure 1 , step S101 in Figure 1 can be updated to steps S201 to S202 , which will be described in conjunction with the steps shown in Figure 2 .
[0062] Step S201: Acquire the grouping requirements corresponding to the target service type.
[0063] In embodiments of the present application, different grouping requirements are preset for different types of business subsystem instances within the core. For example, if the core includes a first type of business subsystem instance and a second type of business subsystem instance, a first grouping requirement can be set for the first type, and a second grouping requirement can be set for the second type. In this way, different grouping strategies can be adopted for different types of business subsystem instances.
[0064] In some embodiments, the grouping requirements include at least one of the following: a grouping quantity requirement and a service subsystem instance quantity requirement within a subsystem group. The grouping quantity requirement includes a maximum subsystem grouping quantity and a minimum subsystem grouping quantity; and the service subsystem instance quantity requirement within a subsystem group includes a maximum subsystem instance quantity corresponding to the subsystem grouping and a minimum subsystem instance quantity corresponding to the subsystem grouping.
[0065] Among them, in a virtualization scenario, the group quantity requirement is the number of users in the virtualization scenario, and the quantity requirement is determined based on the performance requirements of the users; in a multi-program scenario, the group quantity requirement is the number of applications in the multi-program scenario, and the quantity requirement is determined based on the performance requirements of the applications.
[0066] In some implementation scenarios, the processor can be deployed in a virtualization scenario, that is, different subsystem groups are virtualized into an independent processing system and allocated to different users. In this scenario, the number corresponding to the subsystem grouping can be the number of users in the virtualization scenario; the number of business subsystem instances corresponding to the subsystem grouping can be determined based on the performance requirements of the corresponding users. In other implementation scenarios, the processor can be used to execute multiple applications. In this scenario, the number corresponding to the subsystem grouping can be the number of applications; the number of business subsystem instances corresponding to the subsystem grouping can be determined based on the performance requirements of the corresponding applications.
[0067] Step S202: Grouping business subsystem instances corresponding to the target business type in at least one of the cores based on a grouping requirement corresponding to the target business type to obtain at least one subsystem group corresponding to the target business type.
[0068] Here, the at least one subsystem group obtained is used to process the tasks corresponding to the target business type. It is understandable that the tasks processed by different business subsystem instances do not overlap.
[0069] In an embodiment of the present application, by obtaining the grouping requirements corresponding to the target business type, different grouping strategies can be adopted for different types of business subsystem instances, thereby improving the flexibility and adaptability of the subsystem grouping strategy; in virtualization scenarios and scenarios where multiple applications are executed, the number of subsystem groups and the number of business subsystem instances corresponding to the subsystem groups are determined based on the number of users and the performance requirements of the applications, which can better meet the performance requirements in different scenarios; at the same time, different subsystem groups are virtualized into an independent processing system and assigned to different users or to execute different applications, thereby improving the utilization of processor resources, ensuring data independence between different users / applications, and improving data security.
[0070] Figure 3 is a third flow chart of a task processing method according to an embodiment of the present application. Based on Figure 1 , step S102 in Figure 1 can be updated to steps S301 and S302 , which will be described in conjunction with the steps shown in Figure 3 .
[0071] Step S301: In a scheduling processor in at least one of the cores, determine each scheduling processor corresponding to each of the business subsystem instances of the subsystem group.
[0072] In an embodiment of the present application, in order to improve the scheduling effect of the scheduling processor on each business subsystem instance within the subsystem group and shorten the information transmission path, in the process of selecting the target scheduling processor corresponding to the subsystem group, the selection range can be first narrowed from all scheduling processors within the processor to the scheduling processor corresponding to each business subsystem instance of the subsystem group.
[0073] Step S302: Determine, in each of the scheduling processors, a target scheduling processor corresponding to the subsystem group.
[0074] In some embodiments, based on a random algorithm, a scheduling processor may be randomly selected from the scheduling processors corresponding to each of the business subsystem instances in the subsystem group as the target scheduling processor corresponding to the subsystem group.
[0075] In this embodiment of the present application, compared to a solution that selects a scheduling processor from another core as the target scheduling processor, the above solution can reduce the impact of information transmission between at least one business subsystem instance and the target scheduling processor on bus bandwidth. Furthermore, by determining the target scheduling processor from the scheduling processors corresponding to each business subsystem instance in the subsystem group, load imbalance and performance degradation caused by fixed selection of a single scheduling processor are avoided, thereby improving the fairness and efficiency of scheduling processing.
[0076] In some embodiments, the above-mentioned determination of the target scheduling processor corresponding to the subsystem group in each scheduling processor can be achieved through steps S3021 and S3022.
[0077] Step S3021: Obtain load information of each scheduling processor.
[0078] The load information is at least used to characterize the scheduling status of the scheduling processor for the service subsystem instance of the non-target service type.
[0079] In an embodiment of the present application, the processor may include multiple types of business subsystem instances, that is, in addition to the business subsystem instance of the target business type, it may also include at least one business subsystem instance of a non-target business type. Therefore, for the business subsystem instance of the non-target business type, it will be divided into at least one subsystem grouping, the same as the business subsystem instance of the target business type, and the target scheduling processor corresponding to each subsystem instance of the non-target business type will be determined. It can be understood that the scheduling processor within a core can simultaneously undertake the scheduling tasks of different types of subsystem groups (business subsystem instances).
[0080] In some embodiments, the load information may include the number of scheduling tasks for the subsystem group for which the scheduling processor is responsible.
[0081] Step S3022: Based on the load information, determine the target scheduling processor in each scheduling processor.
[0082] In some embodiments, the load information of the scheduling processors corresponding to each of the business subsystem instances can be compared, and among the scheduling processors corresponding to each of the business subsystem instances in the subsystem group, the scheduling processor with the smallest load is determined as the target scheduling processor corresponding to the subsystem group. For example, in the case where the subsystem group includes a first business subsystem instance, a second business subsystem instance, and a third business subsystem instance, if the scheduling processor corresponding to the first business subsystem instance is responsible for the scheduling tasks of three subsystem groups of non-target business types, the scheduling processor corresponding to the second business subsystem instance is responsible for the scheduling tasks of one subsystem group of non-target business types, and the scheduling processor corresponding to the third business subsystem instance is responsible for the scheduling tasks of two subsystem groups of non-target business types, then the scheduling processor corresponding to the second business subsystem instance is determined as the target scheduling processor corresponding to the subsystem group.
[0083] In an embodiment of the present application, by obtaining the load information of the scheduling processor corresponding to each of the business subsystem instances, the task volume of each scheduling processor can be understood, thereby providing a basis for the subsequent determination of the target scheduling processor, and improving the accuracy and efficiency of the scheduling processing; at the same time, by comparing the load information of the scheduling processor corresponding to each of the business subsystem instances, among the scheduling processors corresponding to each of the business subsystem instances in the subsystem group, the scheduling processor with the smallest load is determined as the target scheduling processor corresponding to the subsystem group, so that the target scheduling processor has a lower load, thereby better meeting the scheduling requirements of the subsystem group.
[0084] Figure 4 is a fourth flowchart of a task processing method according to an embodiment of the present application. Based on Figure 1 , S103 in Figure 1 can be updated to steps S401 to S402 , which will be described in conjunction with the steps shown in Figure 4 .
[0085] Step S401: In response to a task issuing event of the target business type, obtaining at least one task in the task queue through the target scheduling processor, and distributing the at least one task to at least one business subsystem instance in the subsystem group.
[0086] Here, the task delivery event indicates that the target scheduling processor needs to deliver the corresponding task queue to the business subsystem instance within the subsystem group.
[0087] In the embodiment of the present application, the target scheduling processor obtains at least one task corresponding to the task queue, determines the mapping relationship between the at least one task and at least one business subsystem instance within the subsystem group, and then sends the task corresponding to each business subsystem instance to each business subsystem instance. It should be noted that the tasks assigned to different business subsystem instances do not overlap.
[0088] In some embodiments, the above-mentioned at least one task can be stored in the system memory, the target scheduling processor can obtain the address information corresponding to each task, and after determining the mapping relationship between at least one task and the business subsystem instance within the subsystem group, the task address of the task corresponding to the business subsystem instance can be sent to the business subsystem instance.
[0089] Step S402: Process the distributed task through at least one business subsystem instance in the subsystem group.
[0090] In some embodiments, at least one business subsystem instance receives the task addresses of each task sent by the target scheduling processor corresponding to the subsystem group, and obtains the corresponding task from the system memory based on the task address of each task, and then processes it.
[0091] In an embodiment of the present application, the distribution of tasks of each business subsystem instance is completed through the target scheduling processor corresponding to the subsystem group. Since the task distribution is processed by a target scheduling processor, this can avoid the situation where the same task is distributed to different business subsystem instances to a certain extent, and thus can improve the overall collaboration ability between the various business subsystem instances, thereby improving the task processing efficiency.
[0092] Figure 5 is a fifth flow chart of a task processing method according to an embodiment of the present application. Based on Figure 1 , step S103 in Figure 1 can be updated to steps S501 to S503 , which will be described in conjunction with the steps shown in Figure 5 .
[0093] Step S501: In response to a task issuing event of the target business type, the target scheduling processor obtains task information of the task and sends the task information of the task to the business subsystem instance in the subsystem group.
[0094] Here, the task dispatch event indicates that the target scheduling processor needs to dispatch the corresponding task to the business subsystem instance within the subsystem group. In an embodiment of the present application, the target scheduling processor obtains the task information corresponding to the task, and the task information may include at least one of the following: the queue address of the task queue corresponding to the task, the task addresses of each subtask in the task, the number of subtasks in the task, etc. The above-mentioned task information is used to instruct each business subsystem instance within the subsystem group to determine the subtasks that need to be processed based on the task information, that is, the task information is used by each business subsystem instance to complete the negotiation process of subtask distribution.
[0095] Step S502: Determine subtask information corresponding to the business subsystem instance based on the task information of the task through the business subsystem instance in the subsystem group.
[0096] In an embodiment of the present application, after a subsystem group is generated, each business subsystem instance in the subsystem group is configured with the grouping information of the subsystem group. The grouping information includes the number of business subsystem instances in the subsystem group and the order of the business subsystem instances within the current subsystem group. For example, if the graphics subsystem instances in cores 1 to 4 are divided into one subsystem group, the graphics subsystem instance in core 1 may store "the subsystem group includes graphics subsystem instances of 4 cores, and it is located at the first of the graphics subsystem instances of these 4 cores"; the graphics subsystem instance in core 2 may store "the subsystem group includes graphics subsystem instances of 4 cores, and it is located at the second of the graphics subsystem instances of these 4 cores"; and so on. In this way, the business subsystem instance can determine the subtask information corresponding to the business subsystem instance based on the stored grouping information of the subsystem group and the task information of the task.
[0097] In some embodiments, the task information may include a queue address of a task queue, wherein the task queue includes the at least one subtask; accordingly, the subtask information may be the position of the subtask corresponding to the business subsystem instance in the task queue. In this way, the business subsystem instance can determine the position of the subtask corresponding to the business subsystem instance in the task queue based on the position of each subtask in the task queue and the ranking of the business subsystem instance within the current subsystem group.
[0098] For example, taking the subsystem group including 3 business subsystem instances as an example, assuming that there are 10 subtasks in the task queue, the first business subsystem instance can obtain subtasks sorted as 3n+1 from the task queue (the 1st, 4th, 7th, and 10th), the second business subsystem instance can obtain subtasks sorted as 3n+2 from the task queue (the 2nd, 5th, and 8th), and the third business subsystem instance can obtain subtasks sorted as 3n+3 from the task queue (the 3rd, 6th, and 9th), where n is an integer greater than or equal to 0.
[0099] Step S503: Obtain and process the distributed subtasks based on the corresponding subtask information through the business subsystem instance in the subsystem group.
[0100] In an embodiment of the present application, the business subsystem instance can obtain the subtask corresponding to the business subsystem instance from the task queue stored in the system memory based on the position of the corresponding subtask in the task queue, and then realize the task distribution of at least one subtask to the business subsystem instance within the subsystem group through negotiation between the business subsystem instances.
[0101] In an embodiment of the present application, task information is passed to each business subsystem instance within the subsystem group through the target scheduling processor corresponding to the subsystem group, and the distribution of subtasks is achieved through a negotiation mechanism between each business subsystem instance. Since the subtask distribution does not need to be processed by the scheduling processor, this can save the computing resources of the scheduling processor to a certain extent, and thus can improve the overall task scheduling efficiency and task processing efficiency.
[0102] Figure 6A is a sixth schematic diagram of a task processing method according to an embodiment of the present application. Based on Figure 1 , the method further includes step S601 , which will be described in conjunction with the steps shown in Figure 6A .
[0103] Step S601: In response to a system event generated by a business subsystem instance in the subsystem group, the business subsystem instance reports the system event to a target scheduling processor corresponding to the subsystem group.
[0104] The system events include at least one of the following: task completion events, task and scheduling processor interaction events, multi-core task synchronization events, and subsystem abnormal events. In the embodiment of the present application, for any business subsystem instance within a subsystem group, the system events generated by the business subsystem instance can be reported through the target scheduling processor corresponding to the subsystem group.
[0105] In some embodiments, when the business subsystem instance and the target scheduling processor are in the same core, the system events generated by the business subsystem instance can be directly reported to the target scheduling processor; when the business subsystem instance and the target scheduling processor are in different cores, the system events generated by the business subsystem instance can be passed to the target scheduling processor through the configuration bus.
[0106] In some embodiments, the processor also includes a host processor; the above-mentioned system event generated in response to the business subsystem instance in the subsystem group can be implemented through step S6011, and the system event is reported to the target scheduling processor corresponding to the subsystem group through the business subsystem instance.
[0107] Step S6011: In response to the first task completion event generated by the business subsystem instance in the subsystem group, the first task completion event is reported to the target scheduling processor corresponding to the subsystem group through the business subsystem instance; the first task completion event is generated by the business subsystem instance after processing the distributed subtask.
[0108] In some embodiments, when the subsystem group of the target business type obtains a task of the target business type that needs to be processed, it divides at least one subtask of the task of the target business type and distributes it to the business subsystem instance. When the business subsystem instance completes processing the distributed subtask, it generates a first task completion event and reports the first task completion event to the corresponding target scheduling processor.
[0109] Accordingly, the target scheduling processor within the subsystem group is used to monitor and receive the first task completion event reported by each business subsystem instance, so as to determine whether at least one subtask divided and distributed this time has been completed.
[0110] In some embodiments, the method may further include: in response to the target scheduling processor corresponding to the subsystem group receiving a first task completion event reported by the business subsystem instance distributed within the subsystem group, reporting a second task completion event to the host processor in the processor through the target scheduling processor; the second task completion event is used to characterize that the task of the target business type has been completed.
[0111] For example, please refer to FIG6B , which illustrates a schematic diagram of a task completion event processing flow. A processor includes cores 1 through 4, each of which includes a graphics subsystem instance, a compute subsystem instance, and a video subsystem instance. For the four graphics subsystem instances in the processor, the graphics subsystem instances of cores 1 and 2 can be grouped into a first graphics subsystem instance group, with the corresponding target scheduling processor being the scheduling processor of core 1. The graphics subsystem instances of cores 3 and 4 can be grouped into a second graphics subsystem instance group, with the corresponding target scheduling processor being the scheduling processor of core 3. For the first graphics subsystem instance group, the implementation of the above scheme includes: the graphics subsystem instance of core 1 receives and processes a subtask within a task, generating a first task completion event upon completion of the processing, as shown in data flow 61 in FIG6B . The graphics subsystem instance of core 1 reports the first task completion event to the scheduling processor of core 1. Upon receiving the first task completion event reported by the graphics subsystem instance of core 1, the scheduling processor of core 1 determines that the graphics subsystem instance of core 1 has completed the assigned subtask. Similarly, the graphics subsystem instance of core 2 can also receive and process subtasks within a task. Upon completion of the processing, a first task completion event is generated, as shown in data flow 62 in FIG6B . The graphics subsystem instance of core 2 reports the first task completion event to the scheduling processor of core 1 via the configuration bus. Based on all received first task completion events, the scheduling processor of core 1 determines whether all subtasks have been completed. If all subtasks have been completed (i.e., first task completion events reported by the graphics subsystem instances of cores 1 and 2 have been received), as shown in data flow 63 in FIG6B , the scheduling processor of core 1 reports a second task completion event to the host processor in the processor, indicating that the task of the target business type has been processed.
[0112] In this embodiment of the present application, by having the target scheduling processor report the second task completion event to the host processor, parallel processing of target business type tasks can be achieved, improving task completion efficiency and system throughput. At the same time, the host processor can obtain the completion status of the target business type tasks in a timely manner to facilitate subsequent processing and decision-making.
[0113] Figure 7 is a seventh flow chart of an implementation process of a task processing method provided by an embodiment of the present application. Based on Figure 1 , the processor further includes a public subsystem that provides public resources for the business subsystem instance; the method may further include step S701, which will be described in conjunction with the steps shown in Figure 7 .
[0114] Step S701: In response to a common event corresponding to the common subsystem, the processor further includes a host processor; the common subsystem sends the common event to a common event processing unit, and the common event processing unit determines to process the common event.
[0115] It is understood that the common subsystem provides common resources for all business subsystem instances in the processor. In some embodiments, the common resources can be at least one of the following resources: storage resources (e.g., memory, disk, database), network resources (e.g., network interface, router, etc.). Accordingly, the common subsystem can be a storage subsystem, a network subsystem, etc.; the common events are events generated by the processor in the process of using the above common resources, wherein the common events corresponding to the common subsystem can be at least one of the following: memory access events, disk read and write events, network connection events, network data transmission events, etc.
[0116] Since the common subsystem provides common resources for all business subsystem instances in the processor, when the common subsystem generates the above-mentioned common event in the common subsystem, the common subsystem cannot determine which business subsystem instance the common event is related to. Therefore, it is necessary to report the common event to the common event processing unit, and the common event processing unit will process the common event.
[0117] In some embodiments, the above-mentioned public event processing unit may be a target scheduling processor. Accordingly, step S7011 may be used to implement the above-mentioned sending of the public event to the public event processing unit through the public subsystem and processing of the public event through the public event processing unit.
[0118] Step S7011: When the common event processing unit is a target scheduling processor, the common event is reported to all target scheduling processors of the processor through the common subsystem; when the target scheduling processor determines that the common event is related to itself, the common event is processed by the target scheduling processor.
[0119] In which, the common subsystem is set in the processor. Considering that the processor includes business subsystem instances corresponding to different types, and at the same time, different types of business subsystem instances are also divided into at least one subsystem set of corresponding types, all target schedulers in the processor include not only the target schedulers of all subsystem sets corresponding to the target business type, but also the target schedulers of all subsystem sets corresponding to non-target business types.
[0120] Since the common subsystem provides common resources for all business subsystem instances in the processor, when the common subsystem generates the above-mentioned common event in the common subsystem, the common subsystem cannot determine which business subsystem instance the common event is related to, so the common event needs to be reported to all target scheduling processors in the processor.
[0121] In some embodiments, the target scheduling processor may obtain event attributes of the public event and determine whether the public event is related to itself based on the event attributes. The event attributes may include at least one of the following: event type, resource information corresponding to the event, and process identifier corresponding to the event.
[0122] In some embodiments, for any subsystem group, the target dispatch processor corresponding to that subsystem group stores system information corresponding to all service subsystem instances within that subsystem group. Therefore, upon receiving a public event reported by a public subsystem, the system can determine whether the public event is related to any service subsystem instance within that subsystem group based on the stored system information corresponding to all service subsystem instances within that subsystem group.
[0123] In the above embodiment, when the target scheduling processor determines that the public event is related to any business subsystem instance in the subsystem group, the public event is processed by the target scheduling processor. For example, when the public event only needs to be fed back upstream, the target scheduling processor can directly report the public event to the host processor; when the public event needs to be processed by the corresponding business subsystem instance, the target scheduling processor can forward the public event to the corresponding business subsystem instance. Of course, when the target scheduling processor determines that the public event is not related to all business subsystem instances in the subsystem group, the public event is discarded.
[0124] For example, please refer to FIG8 , which shows a first schematic diagram of a common event processing flow. A processor includes cores 1 to 4, each of which includes a graphics subsystem instance, a computing subsystem instance, and a video subsystem instance. For the four graphics subsystem instances in the processor, the graphics subsystem instances of cores 1 and 2 can be divided into a first graphics subsystem instance group, with the corresponding target scheduling processor being the scheduling processor of core 1; the graphics subsystem instances of cores 3 and 4 can be divided into a second graphics subsystem instance group, with the corresponding target scheduling processor being the scheduling processor of core 3; based on the above subsystem grouping method, the computing subsystem instances and the video subsystem instances can also be grouped to determine the target scheduling processors corresponding to the computing subsystem instances (the scheduling processor of core 2 and the scheduling processor of core 4) and the target scheduling processor corresponding to the video subsystem instance (the scheduling processor of core 3). Therefore, each core in the processor has a target scheduling processor, which responds to the public event corresponding to the public subsystem and reports the public event to all target scheduling processors of the processor through the public subsystem. That is, as shown in data flow 81 in Figure 8, the public subsystem needs to report the public event to the scheduling processor corresponding to each core. When the scheduling processor of core 1 determines that the public event is related to itself, the public event is processed by the scheduling processor of core 1. For example, when the public event needs to be processed by the corresponding business subsystem instance (the graphics subsystem instance of core 2), as shown in data flow 82, the scheduling processor of core 1 forwards the public event to the graphics subsystem instance of core 2; when the public event only needs to be fed back upstream, as shown in data flow 83, the scheduling processor of core 1 can directly report the public event to the host processor.
[0125] In an embodiment of the present application, by sending a public event notification to all target scheduling processors of the processor, it can be ensured that the public event can be reported to the corresponding target scheduling processor for processing; the target scheduling processor determines whether the public event is related to itself and processes the public event. In this way, each business subsystem instance can process public events related to itself, thereby improving the efficiency and reliability of the processor.
[0126] In some embodiments, the above-mentioned public event processing unit may be a target scheduling processor. Accordingly, step S7012 may be used to implement the above-mentioned sending of the public event to the public event processing unit through the public subsystem and processing of the public event through the public event processing unit.
[0127] Step S7012: When the common event processing unit is a target scheduling processor, the common event is reported to the main scheduling processor through the common subsystem; the main scheduling processor is the scheduling processor of the main core among the multiple cores; through the main scheduling processor, the to-be-sent scheduling processor corresponding to the common event is determined in the target scheduling processors corresponding to each of the subsystem groups; the common event is sent to the to-be-sent scheduling processor through the main scheduling processor, and the common event is processed by the to-be-sent scheduling processor.
[0128] In some embodiments, the master core is any one of the multiple cores; after the processor is powered on, the master core can be determined from the multiple cores. Accordingly, the scheduling processor in the master core is the master scheduling processor in the processor.
[0129] In an embodiment of the present application, the common subsystem is provided within the processor, providing common resources for all service subsystem instances within the processor; the host processor is used to run the driver. Because the common subsystem provides common resources for all service subsystem instances within the processor, if the common subsystem generates a common event, the common subsystem cannot determine which service subsystem instance the common event is associated with, and therefore needs to report the common event to the main scheduling processor.
[0130] In some embodiments, the main scheduling processor can store system information corresponding to all business subsystem instances in the processor. Therefore, after receiving the public event reported by the public subsystem, the main scheduling processor can obtain the event attributes of the public event, and can determine the business subsystem instance related to the public event based on the system information corresponding to all stored business subsystem instances, and then use the business subsystem instance related to the public event as the scheduling processor to be sent.
[0131] In some embodiments, when the scheduling processor to be sent is the same as the main scheduling processor, the common event can be directly processed by the main scheduling processor; when the scheduling processor to be sent is different from the main scheduling processor, the main scheduling processor sends the common event to the scheduling processor to be sent through the configuration bus, and processes the common event through the scheduling processor to be sent.
[0132] In an embodiment of the present application, all common events are scheduled by the main scheduling processor of the main core of the processor. In this way, the impact of common events on other cores in the processor can be reduced. That is, the scheduling processors of other cores can focus on their own task scheduling for various types of business subsystem instances, thereby ensuring task scheduling efficiency and improving task processing efficiency as a whole.
[0133] In some embodiments, the above-mentioned public event processing unit may be a host processor. Accordingly, step S7013 may be used to implement the above-mentioned sending of the public event to the public event processing unit through the public subsystem and processing of the public event through the public event processing unit.
[0134] Step S7013: When the common event processing unit is a host processor, the common event is reported to the host processor through the common subsystem; and the common event is processed by the host processor.
[0135] In an embodiment of the present application, the common subsystem is provided in the processor and provides common resources for all business subsystem instances in the processor; the host processor is used to run the driver. Because the common subsystem provides common resources for all business subsystem instances in the processor, when the common subsystem generates the above-mentioned common event, the common subsystem cannot determine which business subsystem instance the common event is related to, and therefore needs to report the common event to the host processor.
[0136] In some embodiments, the event attributes of the common event can be obtained through a driver running in the host processor, and the processing component corresponding to the common event can be determined based on the event attributes, that is, it is determined which processing component in the processor needs to process the common event. The processing component includes but is not limited to the host processor, the scheduling processor and the business subsystem instance.
[0137] Among them, when the driver program running in the host processor determines that the processing component corresponding to the common event is the host processor, the common event is directly processed by the host processor; when the driver program running in the host processor determines that the processing component corresponding to the common event is the scheduling processor, the host processor can determine the scheduling processor to be sent corresponding to the common event in the target scheduling processor corresponding to each subsystem group, and send the common event to the scheduling processor to be sent through the host processor, and process the common event through the scheduling processor to be sent; when the driver program running in the host processor determines that the processing component corresponding to the common event is a business subsystem instance, the host processor can determine the scheduling processor to be sent corresponding to the common event in the target scheduling processor corresponding to each subsystem group, and send the common event to the scheduling processor to be sent through the host processor, and send the common event to the target business subsystem instance through the scheduling processor to be sent, and use the target business subsystem instance to process the common event.
[0138] For example, please refer to FIG9 , which shows a second schematic diagram of a common event processing flow. As shown in data flow 91 in FIG9 , when a common subsystem generates the common event, the common event can be directly reported to the host processor through the common subsystem; the host processor determines the dispatching processor to be sent corresponding to the common event in the target dispatching processor corresponding to each subsystem group through the running driver, for example, determining the dispatching processor in core 1 as the dispatching processor to be sent corresponding to the common event, as shown in data flow 92 in FIG9 , and the host processor can send the common event to the dispatching processor in core 1; when the common event is processed by the graphics service subsystem instance in core 2, as shown in data flow 93 in FIG9 , the dispatching processor in core 1 transmits the common event to the graphics service subsystem instance in core 2 via the configuration bus for processing.
[0139] In an embodiment of the present application, when a public event is generated by a public subsystem, it is sent to a host processor, and the processing component corresponding to the public event is determined by a driver in the host processor. In this way, compared with the solution of determining how to handle public events through each scheduling processor of the processor, the computing pressure of the scheduling processor of each core of the processor can be reduced. Accordingly, each scheduling processor in the processor can devote more processing resources to the task scheduling process, thereby improving the task scheduling efficiency and task processing efficiency.
[0140] Figure 10 is a flowchart eight of a task processing method according to an embodiment of the present application. Based on Figure 1 , the business subsystem instance is configured with an information register; the method may further include S1001 , which will be described in conjunction with the steps shown in Figure 10 .
[0141] Step S1001 : In response to determining the target scheduling processor corresponding to the subsystem group, storing the grouping information of the subsystem group corresponding to the service subsystem instance through the information register.
[0142] The grouping information is used to determine the core corresponding to each of the service subsystem instances in the subsystem group and the core corresponding to the target scheduling processor of the subsystem group.
[0143] In some embodiments, the service subsystem instance is configured with an information register. Every time the group information changes, the information stored in the information register is updated based on the current group information.
[0144] In some embodiments, the information register includes a mask register, and storing the grouping information of the subsystem group corresponding to the business subsystem instance through the information register includes: storing the core mask corresponding to the subsystem group through the mask register.
[0145] The core mask includes a sub-mask corresponding to each core in the processor. When the service subsystem instance corresponding to the core belongs to the subsystem group, the sub-mask corresponding to the core is set to a first value; when the service subsystem instance corresponding to the core does not belong to the subsystem group, the sub-mask corresponding to the core is set to a second value. For example, the first value can be set to 0 and the second value can be set to 1, or the first value can be set to F and the second value can be set to T. This application does not limit this.
[0146] In some embodiments, the core mask includes N bits, where N is the number of cores in the processor; and a sub-mask for each bit sequence in the core mask is used to characterize whether the core corresponding to the bit sequence has a business subsystem instance of the subsystem group.
[0147] The core masks stored in the mask registers of the service subsystem instances in the same subsystem group are the same, and the core masks stored in the mask registers of the service subsystem instances in different subsystem groups are mutually exclusive.
[0148] For example, refer to the two graphics subsystem instance groupings obtained for the graphics subsystem instance in FIG8 . A processor includes cores 1 through 4, each of which includes a graphics subsystem instance, a compute subsystem instance, and a video subsystem instance. For the four graphics subsystem instances in the processor, the graphics subsystem instances of cores 1 and 2 can be grouped into a first graphics subsystem instance group, with the corresponding target scheduling processor being the scheduling processor of core 1. The graphics subsystem instances of cores 3 and 4 can be grouped into a second graphics subsystem instance group, with the corresponding target scheduling processor being the scheduling processor of core 3. In this case, the mask registers of the graphics subsystem instances of cores 1 and 2 store a core mask of "1100," while the mask registers of the graphics subsystem instances of cores 3 and 4 store a core mask of "0011." It can be seen that the core masks stored in the mask registers of the business subsystem instances within the same subsystem group are the same, that is, the core masks stored in the mask registers of the graphics subsystem instances of core 1 and core 2 are the same, and the core masks stored in the mask registers of the graphics subsystem instances of core 3 and core 4 are the same; at the same time, the core masks stored in the mask registers of the business subsystem instances in different subsystem groups are mutually exclusive, that is, the core masks stored in the mask registers of the graphics subsystem instances of core 1 and core 2 are mutually exclusive with the core masks stored in the mask registers of the graphics subsystem instances of core 3 and core 4.
[0149] In an embodiment of the present application, a mask register is set in the business subsystem instance, and the sub-masks of each core stored in the mask register are used to determine whether the business subsystem instance corresponding to the core belongs to the subsystem group. In this way, when the grouping information of the business subsystem instance changes, the business subsystem instance determines other business subsystem instances belonging to the same subsystem group in the processor and the core positions thereof, which can facilitate the negotiation process of task distribution among the business subsystem instances in the subsystem group.
[0150] In some embodiments, the information register includes a number register; storing the grouping information of the subsystem group corresponding to the business subsystem instance through the information register includes: storing the identifier of the core corresponding to the target scheduling processor of the subsystem group through the number register.
[0151] In some embodiments, the identifier stored in the number register is the identifier of the core corresponding to the target scheduling processor of the subsystem grouping. For example, based on the two graphics subsystem instance groupings obtained for the graphics subsystem instance in FIG8 , the identifier of the core corresponding to the target scheduling processor stored in the number registers of the graphics subsystem instances of cores 1 and 2 is "1," and the identifier of the core corresponding to the target scheduling processor stored in the number registers of the graphics subsystem instances of cores 3 and 4 is "3."
[0152] In an embodiment of the present application, a numbering register is set in the business subsystem instance, and the identifier of the core corresponding to the target scheduling processor of the subsystem group is stored through the numbering register. In this way, when the grouping information of the business subsystem instance changes, the business subsystem instance can still determine the target scheduling processor of the latest subsystem group based on the numbering register, so as to obtain the corresponding subtask through the target scheduling register, as well as subsequent event reporting and other communication processes.
[0153] Based on the foregoing embodiments, an embodiment of the present application provides a task processing device, which includes the various units included and the various modules included in each unit, and can be implemented by a processor in a computer device; of course, it can also be implemented by a specific logic circuit; in the implementation process, the processor can be a central processing unit (CPU), a microprocessor (MPU), a digital signal processor (DSP) or a field programmable gate array (FPGA), etc.
[0154] FIG11 is a schematic diagram of the composition structure of a processor provided in an embodiment of the present application. As shown in FIG11 , the processor 1100 includes: multiple cores and a host processor 1130; the core includes a business subsystem instance and a scheduling processor, wherein:
[0155] The host processor 1130 is configured to group the service subsystem instances corresponding to the target service type in at least one of the cores to obtain at least one subsystem group 1120 corresponding to the target service type; and determine, in a scheduling processor in at least one of the cores, a target scheduling processor 1121 corresponding to the subsystem group.
[0156] The service subsystem instance 1122 in the subsystem group 1120 and the target scheduling processor 1121 corresponding to the subsystem group 1120 are configured to process the task queue of the target service type.
[0157] It should be noted that the subsystem grouping 1120 divided in FIG. 11 is for the purpose of illustrative description of the task processing method provided in the embodiment of the present application, and is not intended to limit the grouping method.
[0158] In some embodiments, the host processor 1130 is configured to obtain the grouping requirements corresponding to the target business type; group the business subsystem instances corresponding to the target business type in at least one of the cores based on the grouping requirements corresponding to the target business type, and obtain at least one subsystem group 1120 corresponding to the target business type.
[0159] In some embodiments, the grouping requirement includes at least one of the following: a group quantity requirement and a quantity requirement of business subsystem instances within a subsystem group; wherein, in a virtualization scenario, the grouping quantity requirement is the number of users in the virtualization scenario, and the quantity requirement is determined based on the performance requirements of the users; in a multi-program scenario, the grouping quantity requirement is the number of applications in the multi-program scenario, and the quantity requirement is determined based on the performance requirements of the applications.
[0160] In some embodiments, the host processor 1130 is configured to determine, in the scheduling processors in at least one of the cores, each scheduling processor corresponding to each of the business subsystem instances 1122 of the subsystem group 1120; and in each of the scheduling processors, determine the target scheduling processor 1121 corresponding to the subsystem group 1120.
[0161] In some embodiments, the host processor 1130 is configured to obtain load information of each scheduling processor; the load information is at least used to characterize the scheduling status of the scheduling processor for the business subsystem instance 1122 of the non-target business type; based on the load information, the target scheduling processor 1121 is determined in each scheduling processor.
[0162] In some embodiments, the target scheduling processor 1121 is configured to obtain at least one task in the task queue in response to a task dispatch event of the target business type, and distribute the at least one task to at least one business subsystem instance 1122 in the subsystem group 1120; at least one business subsystem instance 1122 in the subsystem group 1120 is configured to process the distributed tasks.
[0163] In some embodiments, the target scheduling processor 1121 is configured to respond to a task dispatching event of the target business type, obtain task information of the task, and send the task information of the task to the business subsystem instance 1122 in the subsystem group 1120; the business subsystem instance 1122 in the subsystem group 1120 is configured to determine the subtask information corresponding to the business subsystem instance 1122 based on the task information of the task; and obtain and process the distributed subtasks based on the corresponding subtask information.
[0164] In some embodiments, the business subsystem instance 1122 is configured to respond to a system event generated by the business subsystem instance 1122 in the subsystem group 1120, and report the system event to the target scheduling processor 1121 corresponding to the subsystem group 1120; wherein, the system event includes at least one of the following: task completion event, task and scheduling processor interaction event, multi-core task synchronization event, subsystem abnormal event.
[0165] In some embodiments, the business subsystem instance 1122 is configured to report a first task completion event to the target scheduling processor 1121 corresponding to the subsystem group 1120 in response to a first task completion event generated by the business subsystem instance 1122 in the subsystem group 1120; the first task completion event is generated when the business subsystem instance 1122 completes the processing of the distributed subtask; the target scheduling processor 1121 is configured to report a second task completion event to the host processor 1130 in the processor in response to the target scheduling processor 1121 corresponding to the subsystem group 1120 receiving the first task completion event reported by the business subsystem instance 1122 distributed in the subsystem group 1120; the second task completion event is used to characterize that the task of the target business type has been processed.
[0166] In some embodiments, the processor also includes a public subsystem, which is used to provide public resources for the business subsystem instance 1122; the public subsystem is configured to respond to a public event corresponding to the public subsystem and send the public event to a public event processing unit; the public event processing unit is configured to process the public event.
[0167] In some embodiments, the processor further includes a host processor; when the common event processing unit is a target scheduling processor, the common subsystem is configured to report the common event to all target scheduling processors of the processor; when the target scheduling processor determines that the common event is related to itself, the target scheduling processor is configured to process the common event; or, when the common event processing unit is a target scheduling processor, the common subsystem is configured to report the common event to a main scheduling processor; the main scheduling processor is the scheduling processor of the main core among the multiple cores; the main scheduling processor is configured to determine the to-be-sent scheduling processor corresponding to the common event among the target scheduling processors corresponding to each of the subsystem groups; the main scheduling processor is configured to send the common event to the to-be-sent scheduling processor, and the to-be-sent scheduling processor is configured to process the common event; or, when the common event processing unit is a host processor, the common subsystem is configured to report the common event to the host processor; the host processor is configured to process the common event.
[0168] In some embodiments, the business subsystem instance 1122 is configured with an information register; the information register is configured to store the grouping information of the subsystem group 1120 corresponding to the business subsystem instance 1122 in response to determining the target scheduling processor 1121 corresponding to the subsystem group; the grouping information is used to determine the core corresponding to each of the business subsystem instances 1122 in the subsystem group 1120 and the core corresponding to the target scheduling processor 1121 of the subsystem group 1120.
[0169] In some embodiments, the information register includes a mask register; the mask register is configured to store the core mask corresponding to the subsystem group 1120; wherein the core mask includes a sub-mask corresponding to each core in the processor, and when the business subsystem instance 1122 corresponding to the core belongs to the subsystem group 1120, the sub-mask corresponding to the core is set to a first value; when the business subsystem instance 1122 corresponding to the core does not belong to the subsystem group 1120, the sub-mask corresponding to the core is set to a second value; the core masks stored in the mask registers of the business subsystem instances in the same subsystem group are the same, and the core masks stored in the mask registers of the business subsystem instances in different subsystem groups are mutually exclusive.
[0170] In some embodiments, the information register includes a number register; the number register is configured to store an identifier of a core corresponding to the target scheduling processor 1121 of the subsystem group 1120 .
[0171] Of course, the task processing method provided in the embodiments of the present application can be embodied in different forms in actual implementation scenarios.
[0172] In some embodiments, a single scheduling processor is responsible for each business subsystem instance. For example, if the business subsystem instances include two types, business subsystem instance A and business subsystem instance B, a first scheduling processor can be responsible for task scheduling for business subsystem instance A, while a second scheduling processor can be responsible for task scheduling for business subsystem instance B. Referring to Figure 12 , business subsystem instances A 1221 through A 1223 correspond to first scheduling processor 1211 , while business subsystem instances B 1231 through B 1233 correspond to second scheduling processor 1212 .
[0173] In some embodiments, a business subsystem instance is managed by at least two scheduling processors, that is, by different scheduling processors. For example, when the business subsystem instances include two types of business subsystem instances, business subsystem instance A and business subsystem instance B, business subsystem instance A can be divided into at least two groups, business subsystem instance B can be divided into at least two groups, and business subsystem instances in different groups are managed by different scheduling processors. Please refer to Figure 13, in which business subsystem instance A1221 and business subsystem instance A1222 both correspond to the first scheduling processor 1211; business subsystem instance A1223 and business subsystem instance A1224 correspond to the second scheduling processor 1212. Business subsystem instance B1231 and business subsystem instance B1232 both correspond to the third scheduling processor 1213; business subsystem instance B1233 and business subsystem instance B1234 correspond to the fourth scheduling processor 1214.
[0174] In other embodiments, the above two methods can be combined in one processor, as shown in Figure 14, wherein business subsystem instance A1221 and business subsystem instance A1222 both correspond to the first scheduling processor 1211; business subsystem instance A1223 corresponds to the second scheduling processor 1212; business subsystem instance B1231 to business subsystem instance B1233 all correspond to the third scheduling processor 1213.
[0175] An embodiment of the present application provides a computer device, including a memory and a processor, wherein the memory stores a computer program that can be run on the processor, and when the processor executes the program, some or all of the steps in the above method are implemented.
[0176] The present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements some or all of the steps in the above method. The computer-readable storage medium may be transient or non-transient.
[0177] An embodiment of the present application provides a computer program, including computer-readable code. When the computer-readable code is run in a computer device, a processor in the computer device executes some or all of the steps for implementing the above method.
[0178] An embodiment of the present application provides a computer program product, which includes a non-transitory computer-readable storage medium storing a computer program, and when the computer program is read and executed by a computer, implements some or all of the steps in the above method. The computer program product can be implemented specifically by hardware, software, or a combination thereof. In some embodiments, the computer program product is embodied as a computer storage medium. In other embodiments, the computer program product is embodied as a software product, such as a software development kit (SDK), etc.
[0179] It should be noted that the descriptions of the various embodiments above tend to emphasize the differences between the various embodiments, and their similarities or similarities can be referenced to each other. The descriptions of the above device, storage medium, computer program, and computer program product embodiments are similar to the descriptions of the above method embodiments and have similar beneficial effects as the method embodiments. For technical details not disclosed in the embodiments of the device, storage medium, computer program, and computer program product of this application, please refer to the description of the method embodiments of this application for understanding.
[0180] Figure 15 is a schematic diagram of the hardware entity of a computer device provided in an embodiment of the present application. As shown in Figure 15, the hardware entity of the computer device 1500 includes: a processor 1501 and a memory 1502, wherein the memory 1502 stores a computer program that can be run on the processor 1501, and when the processor 1501 executes the program, the steps in the method of any of the above embodiments are implemented.
[0181] Memory 1502 stores computer programs that can be run on the processor. Memory 1502 is configured to store instructions and applications executable by processor 1501. Memory 1502 can also cache data to be processed or processed by processor 1501 and various modules in computer device 1500 (e.g., image data, audio data, voice communication data, and video communication data). This can be implemented using flash memory (FLASH) or random access memory (RAM). When processor 1501 executes the program, it implements the steps of any of the task processing methods described above. Processor 1501 generally controls the overall operation of computer device 1500.
[0182] An embodiment of the present application provides a computer storage medium, which stores one or more programs. The one or more programs can be executed by one or more processors to implement the steps of the task processing method of any of the above embodiments.
[0183] It should be noted that the description of the above storage medium and device embodiments is similar to the description of the above method embodiments and has similar beneficial effects as the method embodiments. For technical details not disclosed in the storage medium and device embodiments of this application, please refer to the description of the method embodiments of this application for understanding.
[0184] The processor may be at least one of an application-specific integrated circuit (ASIC), a digital signal processor (DSP), a digital signal processing device (DSPD), a programmable logic device (PLD), a field programmable gate array (FPGA), a central processing unit (CPU), a controller, a microcontroller, and a microprocessor. It is understood that the electronic device that implements the functions of the processor may also be other electronic devices, which are not specifically limited in the embodiments of the present application.
[0185] The above-mentioned computer storage medium / memory can be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), a magnetic random access memory (FRAM), a flash memory (Flash Memory), a magnetic surface memory, an optical disc, or a compact disc read-only memory (CD-ROM); it can also be various terminals including one or any combination of the above-mentioned memories, such as mobile phones, computers, tablet devices, personal digital assistants, etc.
[0186] It should be understood that "one embodiment" or "an embodiment" mentioned throughout the specification means that the specific features, structures or characteristics related to the embodiment are included in at least one embodiment of the present application. Therefore, "in one embodiment" or "in an embodiment" appearing throughout the specification does not necessarily refer to the same embodiment. In addition, these specific features, structures or characteristics can be combined in one or more embodiments in any suitable manner. It should be understood that in the various embodiments of the present application, the size of the serial numbers of the above-mentioned steps / processes does not mean the order of execution, and the execution order of each step / process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application. The above-mentioned serial numbers of the embodiments of the present application are for description only and do not represent the advantages and disadvantages of the embodiments.
[0187] It should be noted that, as used herein, the terms "comprise," "include," or any other variations thereof are intended to encompass non-exclusive inclusion, such that a process, method, article, or device comprising a series of elements includes not only those elements but also other elements not explicitly listed, or includes elements inherent to such process, method, article, or device. Without further limitation, an element defined by the phrase "comprises a..." does not preclude the presence of other identical elements in the process, method, article, or device comprising that element. In the several embodiments provided herein, it should be understood that the disclosed devices and methods may be implemented in other ways. The device embodiments described above are merely illustrative. For example, the division of the units described is merely a logical functional division. In actual implementation, other divisions may be employed, such as combining multiple units or components, integrating them into another system, or omitting or disabling certain features. Furthermore, the coupling, direct coupling, or communication connection between the components shown or discussed may be through interfaces, while the indirect coupling or communication connection between devices or units may be electrical, mechanical, or other forms.
[0188] The units described above as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units; they may be located in one place or distributed across multiple network units; some or all of the units may be selected according to actual needs to achieve the purpose of the scheme of this embodiment.
[0189] In addition, the functional units in the embodiments of the present application can all be integrated into one processing unit, or each unit can be a separate unit, or two or more units can be integrated into one unit; the above-mentioned integrated units can be implemented in the form of hardware or in the form of hardware plus software functional units. It can be understood by those skilled in the art that all or part of the steps of the above-mentioned method embodiments can be completed by hardware related to program instructions, and the above-mentioned program can be stored in a computer-readable storage medium. When the program is executed, it executes the steps of the above-mentioned method embodiments; and the above-mentioned storage medium includes various media that can store program codes, such as mobile storage devices, read-only memories (ROMs), magnetic disks or optical disks.
[0190] Alternatively, if the above-mentioned integrated unit of the present application is implemented in the form of a software function module and sold or used as an independent product, it can also be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the relevant technology, can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes a number of instructions for enabling a computer device (which can be a personal computer, server, or network device, etc.) to execute all or part of the methods described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as mobile storage devices, ROMs, magnetic disks, or optical disks.
[0191] The above is only an implementation method of the present application, but the scope of protection of the present application is not limited thereto. Any technician familiar with this technical field can easily think of changes or replacements within the technical scope disclosed in this application, which should be covered by the scope of protection of the present application. Industrial Applicability
[0192] The embodiments of the present application disclose a task processing method, processor, device, storage medium and program product, wherein the method includes: grouping business subsystem instances corresponding to a target business type in at least one core to obtain at least one subsystem group corresponding to the target business type; determining a target scheduling processor corresponding to the subsystem group in a scheduling processor in at least one core; and processing a task queue of the target business type using the business subsystem instances in the subsystem group and the corresponding target scheduling processor. Compared with the traditional solution of using one scheduling processor to handle task scheduling for all business subsystem instances, this method can avoid performance bottlenecks caused by the scheduling processor.
Claims
1. A task processing method, applied to a processor comprising multiple cores, wherein the cores include a scheduling processor and a service subsystem instance; the method comprising: Grouping business subsystem instances corresponding to a target business type in at least one of the cores to obtain at least one subsystem group corresponding to the target business type; Determining, among the scheduling processors in at least one of the cores, a target scheduling processor corresponding to the subsystem group; The task queue of the target business type is processed using the business subsystem instance and the corresponding target scheduling processor in the subsystem group.
2. The method according to claim 1, wherein The grouping of the business subsystem instances corresponding to the target business type in at least one of the cores to obtain at least one subsystem group corresponding to the target business type includes: Obtaining the grouping requirements corresponding to the target service type; Based on the grouping requirement corresponding to the target business type, the business subsystem instances corresponding to the target business type in at least one of the cores are grouped to obtain at least one subsystem group corresponding to the target business type.
3. The method according to claim 2, wherein: The grouping requirements include at least one of the following: a requirement on the number of groups and a requirement on the number of service subsystem instances within a subsystem group; Among them, in a virtualization scenario, the group quantity requirement is the number of users in the virtualization scenario, and the quantity requirement is determined based on the performance requirements of the users; in a multi-program scenario, the group quantity requirement is the number of applications in the multi-program scenario, and the quantity requirement is determined based on the performance requirements of the applications.
4. The method according to claim 1, wherein Determining, in the scheduling processor in at least one of the cores, a target scheduling processor corresponding to the subsystem group, includes: Determine, in a scheduling processor in at least one of the cores, each scheduling processor corresponding to each of the business subsystem instances of the subsystem group; In each of the scheduling processors, a target scheduling processor corresponding to the subsystem group is determined.
5. The method according to claim 4, wherein Determining, in each of the scheduling processors, a target scheduling processor corresponding to the subsystem group includes: Obtaining load information of each scheduling processor; the load information is at least used to characterize the scheduling status of the scheduling processor for the service subsystem instance of the non-target service type; Based on the load information, the target scheduling processor is determined in each scheduling processor.
6. The method according to claim 1, wherein The processing of the task queue of the target business type by using the business subsystem instance and the corresponding target scheduling processor in the subsystem group includes: In response to a task issuing event of the target business type, obtaining at least one task in the task queue through the target scheduling processor, and distributing the at least one task to at least one business subsystem instance in the subsystem group; The distributed tasks are processed by at least one business subsystem instance in the subsystem group.
7. The method according to claim 1, wherein The processing of the target business type task by using the business subsystem instance and the corresponding target scheduling processor in the subsystem group includes: In response to the task issuing event of the target business type, obtaining task information of the task through the target scheduling processor, and sending the task information of the task to the business subsystem instance in the subsystem group; Determining, through the business subsystem instance in the subsystem group and based on the task information of the task, subtask information corresponding to the business subsystem instance; The distributed subtasks are acquired and processed based on the corresponding subtask information through the business subsystem instances in the subsystem group.
8. The method according to claim 1, wherein The method further comprises: In response to a system event generated by a business subsystem instance in the subsystem group, reporting the system event to a target scheduling processor corresponding to the subsystem group through the business subsystem instance; The system event includes at least one of the following: a task completion event, a task and scheduling processor interaction event, a multi-core task synchronization event, and a subsystem abnormality event.
9. The method according to claim 7, wherein: The processor also includes a host processor; The responding to the system event generated by the business subsystem instance in the subsystem group, reporting the system event to the target scheduling processor corresponding to the subsystem group through the business subsystem instance, includes: In response to a first task completion event generated by a business subsystem instance in the subsystem group, reporting the first task completion event to a target scheduling processor corresponding to the subsystem group through the business subsystem instance; the first task completion event is generated by the business subsystem instance after processing the distributed subtask; The method further comprises: In response to the target scheduling processor corresponding to the subsystem group receiving a first task completion event reported by the business subsystem instance distributed within the subsystem group, a second task completion event is reported to the host processor in the processor through the target scheduling processor; the second task completion event is used to indicate that the task of the target business type has been completed.
10. The method according to claim 1, wherein The processor further includes a public subsystem, wherein the public subsystem is configured to provide public resources for the business subsystem instance; and the method further includes: In response to a common event corresponding to the common subsystem, the common event is sent to a common event processing unit through the common subsystem, and the common event is processed by the common event processing unit.
11. The method according to claim 10, wherein: The processor further includes a host processor; sending the common event to the common event processing unit through the common subsystem, and processing the common event through the common event processing unit, comprises: In the case where the common event processing unit is a target scheduling processor, reporting the common event to all target scheduling processors of the processor through the common subsystem; in the case where the target scheduling processor determines that the common event is related to itself, processing the common event through the target scheduling processor; or In the case where the common event processing unit is a target scheduling processor, the common event is reported to the main scheduling processor through the common subsystem; the main scheduling processor is the scheduling processor of the main core among the multiple cores; the scheduling processor to be sent corresponding to the common event is determined through the main scheduling processor in the target scheduling processors corresponding to each subsystem group; the common event is sent to the scheduling processor to be sent through the main scheduling processor, and the common event is processed by the scheduling processor to be sent; or In the case where the common event processing unit is a host processor, the common event is reported to the host processor via the common subsystem; and the common event is processed by the host processor.
12. The method according to any one of claims 1 to 11, wherein: The business subsystem instance is configured with an information register; the method further includes: In response to determining the target scheduling processor corresponding to the subsystem grouping, the grouping information of the subsystem grouping corresponding to the business subsystem instance is stored through the information register; the grouping information is used to determine the core corresponding to each of the business subsystem instances in the subsystem grouping and the core corresponding to the target scheduling processor of the subsystem group.
13. The method according to claim 12, wherein: The information register includes a mask register; the storing of the grouping information of the subsystem group corresponding to the service subsystem instance through the information register includes: Storing the core mask corresponding to the subsystem grouping through the mask register; Among them, the core mask includes a sub-mask corresponding to each core in the processor. When the business subsystem instance corresponding to the core belongs to the subsystem group, the sub-mask corresponding to the core is set to a first value; when the business subsystem instance corresponding to the core does not belong to the subsystem group, the sub-mask corresponding to the core is set to a second value; the core masks stored in the mask registers of the business subsystem instances in the same subsystem group are the same, and the core masks stored in the mask registers of the business subsystem instances in different subsystem groups are mutually exclusive.
14. The method according to claim 12, wherein: The information register includes a number register; the storing of the grouping information of the subsystem group corresponding to the business subsystem instance through the information register includes: The identifier of the core corresponding to the target scheduling processor of the subsystem group is stored in the number register.
15. A processor comprising a plurality of cores, wherein the cores include a host processor, a service subsystem instance, and a scheduling processor, wherein: The host processor is configured to group the service subsystem instances corresponding to the target service type in at least one of the cores to obtain at least one subsystem group corresponding to the target service type; Determining, among the scheduling processors in at least one of the cores, a target scheduling processor corresponding to the subsystem group; The service subsystem instances in the subsystem group and the target scheduling processor corresponding to the subsystem group are configured to process the task queue of the target service type.
16. A computer device comprising a memory and a processor, wherein the memory stores a computer program executable on the processor, and the processor implements the steps of the method according to any one of claims 1 to 14 when executing the program.
17. A computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 14 are implemented.
18. A computer program product comprising a computer program or instructions, wherein when the computer program or instructions are executed by a processor, the steps of the method according to any one of claims 1 to 14 are implemented.
Citation Information
Patent Citations
Task scheduling method, device and system
CN105808328A
Task scheduling method and device, equipment, storage medium and computer program product
CN113742068A
Task scheduling method and device, electronic equipment and storage medium
CN116263697A
Application Load and Type Adaptive Manycore Processor Architecture
US20140223446A1
Resource scheduling method, apparatus and device
WO2023226437A1