Task processing method and device

By using multiple processing cores in electronic devices to process pending tasks of the BIOS in parallel, the problem of single processing core limiting the startup speed of electronic devices is solved, and a faster startup process is achieved.

CN119088525APending Publication Date: 2024-12-06LENOVO (BEIJING) LTD
View PDF 0 Cites 2 Cited by

Patent Information

Application Number
CN202411217830.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-30
Publication Date
2024-12-06

AI Technical Summary

Technical Problem

Electronic devices in single central processing unit systems are limited in startup phase because the basic input and output system (BIOS) is run by a single processing core.

Method used

The pending tasks of the BIOS are processed in parallel by multiple processing cores, and the pending tasks are performed simultaneously by using the first processing core and the second processing core to complete the startup process of the BIOS.

Benefits of technology

This improves the startup speed of the BIOS, thereby speeding up the startup speed of electronic devices.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119088525A_ABST
    Figure CN119088525A_ABST
Patent Text Reader

Abstract

The embodiment of the invention discloses a task processing method and device, and the method comprises the steps: obtaining a plurality of to-be-processed tasks of a basic input / output system if electronic equipment enters the basic input / output system after the electronic equipment is started; executing a plurality of to-be-processed tasks by utilizing a first processing core and a plurality of second processing cores of a processor of the electronic equipment so as to complete a starting process of the basic input and output system; wherein the first processing core and the second processing core are physical processing cores belonging to the same processor.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of electronic equipment, and in particular to a task processing method and device. Background Art

[0002] For electronic devices with a single central processing unit (CPU) system, such as laptops, desktops, all-in-one computers, etc., the CPU includes multiple processing cores, and the basic input output system (BIOS) is currently run by a single processing core of the CPU during the boot phase, usually a boot start processor (BSP) processing core. This method of running BIOS with a single processing core limits the startup speed of the electronic device. Summary of the invention

[0003] The technical solution of this application is implemented as follows:

[0004] The present application provides a task processing method, the method comprising:

[0005] If the electronic device is turned on and enters a basic input and output system, determining a plurality of tasks to be processed by the basic input and output system;

[0006] The first processing core and multiple second processing cores of the processor of the electronic device are used to execute the multiple tasks to be processed to complete the startup process of the basic input and output system, wherein the first processing core and the second processing core are physical processing cores belonging to the same processor.

[0007] The present application provides a task processing device, including:

[0008] A first determining module is used to determine a plurality of tasks to be processed of the basic input and output system when the electronic device is turned on and enters the basic input and output system;

[0009] The first task processing module is used to utilize the first processing core and multiple second processing cores of the processor of the electronic device to execute the multiple tasks to be processed so as to complete the startup process of the basic input and output system, wherein the first processing core and the second processing core are physical processing cores belonging to the same processor.

[0010] The present application provides a task processing device, including:

[0011] A memory for storing executable task scheduling instructions;

[0012] The processor is used to implement the task processing method provided in the embodiment of the present application when executing the executable task scheduling instruction stored in the memory.

[0013] An embodiment of the present application provides a computer-readable storage medium, in which computer-executable instructions are stored. The computer-executable instructions are configured to execute the steps of the above-mentioned task processing method. BRIEF DESCRIPTION OF THE DRAWINGS

[0014] Figure 1 A flowchart of a task processing method provided in an embodiment of the present application;

[0015] Figure 2 A flowchart of a method for implementing BIOS distributed scheduling provided in an embodiment of the present application;

[0016] Figure 3 A schematic diagram of the operation phase of a distributed scheduling of a BIOS provided in an embodiment of the present application;

[0017] Figure 4 A schematic diagram of BSP core distribution scheduling provided in an embodiment of the present application;

[0018] Figure 5 A schematic diagram of the structure of a task processing device provided in an embodiment of the present application;

[0019] Figure 6 A schematic diagram of the composition structure of a task processing device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0020] The technical solutions in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application.

[0021] In order to make the purpose, technical solutions and advantages of the present application clearer, the present application will be further described below in conjunction with the accompanying drawings. The described embodiments should not be regarded as limiting the present application. All other embodiments obtained by ordinary technicians in the field without making creative work are within the scope of protection of this application.

[0022] In the following description, reference is made to “some embodiments\other embodiments”, which describe a subset of all possible embodiments, but it can be understood that “some embodiments\other embodiments” may be the same subset or different subsets of all possible embodiments and may be combined with each other without conflict.

[0023] In the following description, the terms "first\second\" involved are merely used to distinguish similar objects and do not represent a specific ordering of the objects. It can be understood that "first\second" can be interchanged with a specific order or sequence 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.

[0024] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as those commonly understood by those skilled in the art to which this application belongs. The terms used herein are only for the purpose of describing the embodiments of this application and are not intended to limit this application.

[0025] Based on the problems existing in the related art, the embodiment of the present application provides a task processing method, such as Figure 1 FIG. 1 is a flow chart of a task processing method provided in an embodiment of the present application, and the method includes the following steps:

[0026] S101: After the electronic device is turned on and enters the basic input and output system, a plurality of tasks to be processed of the basic input and output system are obtained.

[0027] It should be noted that the electronic device may be any computer with a single CPU system, such as an all-in-one notebook, a desktop computer, a tablet computer, etc. The multiple pending tasks of the basic input and output system may be various tasks in the process of loading the BIOS system during the startup phase of the electronic device.

[0028] In some embodiments, the multiple pending tasks of the basic input and output system may include CPU initialization, memory initialization, hardware check, boot animation display, etc. After entering the BIOS, the multiple pending tasks of the BIOS may be determined, and the BIOS boot process may be completed by running the BIOS or executing the multiple pending tasks of the BIOS.

[0029] In some embodiments, since the program corresponding to the BIOS system is pre-created, the program corresponding to the BIOS system can be divided into modules to obtain multiple tasks to be processed. The program corresponding to the BIOS can be divided into modules according to the type of tasks to be executed, the stage of the tasks to be executed in the BIOS startup process, the functions completed by the tasks to be executed, etc., so as to obtain multiple tasks to be executed.

[0030] In some embodiments, since the tasks to be executed corresponding to the BIOS are pre-divided, after it is determined that the electronic device is turned on and enters the basic input and output system, each task to be executed of the BIOS can be directly obtained.

[0031] S102: Utilize a first processing core and a plurality of second processing cores of a processor of the electronic device to execute a plurality of tasks to be processed, so as to complete a startup process of a basic input and output system.

[0032] It should be noted that the first processing core and the second processing core are physical processing cores belonging to the same processor. For example, the first processing core is a BSP processing core of a CPU, and the second processing core is an application processor (AP) processing core of the CPU. The CPU may include one first processing core and multiple second processing cores.

[0033] In some embodiments, multiple tasks to be executed of the BIOS may be allocated to the first processing core and the second processing core, and the first processing core and the second processing core may be used to simultaneously execute the various tasks to be executed of the BIOS, thereby starting the BIOS.

[0034] In some embodiments, the first processing core can be used for the allocation and scheduling of tasks to be executed on the second processing core. In addition to the tasks to be executed that have dependencies, for example, the start of the current task to be executed depends on the execution result of the previous task to be executed, multiple tasks to be executed that are in the same running stage and are allocated to the first processing core can be executed in parallel, multiple tasks to be executed that are in the same running stage and are allocated to the same second processing core can be executed in parallel, and multiple tasks to be executed that are in the same running stage and are allocated to different second processing cores can also be executed in parallel.

[0035] In some embodiments, each task to be executed can be allocated to the corresponding first processing core or second processing core according to the running stage of each task to be executed during the BIOS startup phase, the type of each task to be executed, and the dependency relationship between each task to be executed.

[0036] In some embodiments, the tasks to be processed corresponding to the first processing core and the tasks to be processed corresponding to each second processing core may be determined based on a pre-established correspondence between the first processing core, the second processing core and each task to be processed.

[0037] In an embodiment of the present application, after the electronic device is turned on and enters the basic input-output system, multiple tasks to be processed of the basic input-output system are obtained; the first processing core and multiple second processing cores of the processor of the electronic device are used to execute the multiple tasks to be processed to complete the startup process of the basic input-output system. In this way, the first processing core and the second processing core of the processor of the electronic device simultaneously process the multiple tasks to be processed of the basic input-output system, rather than only running the multiple tasks to be processed by a single first processing core or a single second processing core, which can speed up the startup speed of the basic input-output system, thereby improving the startup speed of the electronic device.

[0038] In some embodiments of the present application, "using the first processing core and multiple second processing cores of the processor of the electronic device to execute multiple tasks to be processed" in step S102 can be implemented through the following steps S201 to S202, and each step is described below.

[0039] S201, determining a first task to be processed corresponding to a first processing core and a second task to be processed corresponding to each second processing core according to a preset correspondence between each processing core of a processor and each processing task during a startup of a basic input and output system.

[0040] It should be noted that the first task to be processed may be a task to be processed allocated to the first processing core, and the second task to be processed may be a task to be processed allocated to the second processing core. Both the first task to be processed and the second task to be processed may include multiple tasks.

[0041] In some embodiments, the preset correspondence between each processing core of the processor and each processing task during the basic input and output system startup process can be established during the BIOS design or development stage, or after the BIOS is designed, and each processing task corresponding to the BIOS can also be determined during this process. Each processing task in the preset correspondence is the same as the multiple tasks to be processed.

[0042] In some embodiments, the preset correspondence between each processing core of the processor and each processing task during the basic input and output system startup process indicates each execution task corresponding to different processing cores of the processor, and the execution order of each execution task on the same processing core.

[0043] In some embodiments, the preset correspondence between each processing core of the processor and each processing task during the startup process of the basic input and output system can be stored in the form of a preset correspondence table. The preset correspondence table may include identification information of different processing cores and identification information of corresponding processing tasks. The identification information of different processing cores may include the name, symbolic identification, etc. of the processing core, which is used to distinguish the identities of different processing cores; the identification information of the processing task may also be the name, symbolic identification, etc. of the processing task, which is used to identify different processing tasks.

[0044] In some embodiments, after the electronic device is powered on and enters the BIOS, the current task to be executed after the BIOS is started can be matched with the processing tasks stored in the preset correspondence table. For example, the name of the current task to be executed is compared with the names of each processing task stored in the preset correspondence table to determine the reference processing task that is the same as the current task to be executed, and the processing core corresponding to the reference processing task in the preset correspondence table is determined as the processing core corresponding to the current task to be executed. The current task to be executed can be any one of multiple tasks to be processed. This method can determine the first task to be processed corresponding to the first processing core, as well as each second processing core and the corresponding second task to be executed.

[0045] S202: Use the first processing core to process the first task to be processed, and use each second processing core to process the corresponding second task to be processed.

[0046] In some embodiments, after determining the first task to be processed corresponding to the first processing core and the second task to be processed corresponding to each second core, the first task to be processed can be assigned to the first processing core and the first task to be processed can be run through the first processing core; and the second task to be processed can be assigned to the second processing core and the corresponding second task to be processed can be run through the second processing core.

[0047] It is understandable that, according to the preset correspondence between each processing core of the processor and each processing task in the basic input and output system startup process, the first task to be processed corresponding to the first processing core and the second task to be processed corresponding to each second processing core can be quickly determined. Further, by using the first processing core to process the first task to be processed and the second processing core to process the second task to be processed, parallel processing of tasks to be processed can be achieved, thereby improving the speed of BIOS startup.

[0048] In some embodiments of the present application, a method for creating a preset correspondence between each processing core of a processor and each processing task during the startup of a basic input / output system may be implemented through the following steps S301 to S302, and each step is described below.

[0049] S301, allocating a corresponding target processing core to each processing task according to at least one of the running stage of each processing task during the basic input and output system startup process, the type of the task to be processed, and the dependency relationship between each processing task.

[0050] It should be noted that the running phases of the processing tasks in the basic input and output system startup process may include the security verification (Security Phase, SEC) phase, the EFI pre-initialization (Pre-EFI Initialization, PEI) phase, the driver execution environment (Driver Execution Environment, DXE) phase, the boot device selection (Boot Device Selection, BDS) phase, etc. The types of tasks to be processed may include embedded controller (Embedded Controller, EC) or EC chip communication tasks, initialization tasks of devices based on integrated circuit bus (Inter-Integrated Circuit, I2C) and serial peripheral interface (Serial Peripheral Interface, SPI) communication, initialization tasks of devices related to the CPU transmitted through the BUS bus, output display tasks of boot animations, and processing tasks with dependencies, etc.

[0051] In some embodiments, the pending tasks with dependency relationships may be two or more tasks that are executed in sequence, and the latter pending task depends on the processing of the previous pending task, for example, the execution start condition of the current pending task is the execution result of the previous pending task. For example, if the current pending task is hard disk initialization (an initialization task for devices related to the CPU that are transmitted via the BUS bus), then the pending task may depend on the hard disk inspection result in the EC chip communication task. If the hard disk inspection result determines that the hard disk is normal and undamaged, the hard disk initialization task can be started.

[0052] In some embodiments, different processing tasks can be allocated to corresponding target processing cores according to the operating stages of the processing tasks during the startup of the basic input and output system. For example, processing tasks in the PEI stage and the DXE stage are allocated to the second processing core, and processing tasks in other operating stages except the PEI stage and the DXE stage are allocated to the first core.

[0053] In some embodiments, the tasks to be executed in the PEI stage include the initialization of the CPU and memory, and the tasks to be executed in the DXE stage include: initialization of devices with slow data transmission, such as cameras and keyboards; initialization of devices with fast data transmission, such as USB, hard disk, network card, WIFI and other devices; display of boot animation; processing tasks with dependencies, etc.

[0054] In some embodiments, each processing task can be divided into multiple categories according to the number of processing cores of the processor, and the number of the categories is the same as the total number of processing cores of the processor. For example, if it is determined that the processor has 6 cores, the multiple processing tasks can be divided into 5 categories, and each type of processing task corresponds to one processing core. The number of processing cores of the processor and the category of the processing task are merely exemplary, and this application does not limit this.

[0055] In some embodiments, a reference processing core can be separately allocated for tasks with dependent relationships, and the initiation of each processing task in the reference processing core depends on the execution of other processing tasks. The other processing tasks can be tasks allocated to the reference processing core or tasks allocated to other processing cores.

[0056] In some embodiments, the processing tasks assigned to the first processing core and the processing tasks assigned to the second processing core are determined based on the running stage of the processing tasks during the basic input and output system startup process, and further based on the types of processing tasks and dependent processing tasks, the processing tasks assigned to the first processing core and the processing tasks assigned to the second processing core are reallocated, thereby finally determining the target processing core corresponding to each processing task.

[0057] S302: Establish a preset corresponding relationship based on each processing task and the corresponding target processing core.

[0058] In some embodiments, after each processing task and the corresponding target processing core are determined, a correspondence between each processing task and the corresponding target processing core may be created.

[0059] It can be understood that, according to the running stage of each processing task during the basic input and output system startup process, the type of task to be processed, and at least one of the dependencies between the processing tasks, a corresponding target processing core is allocated to each processing task to achieve refined allocation of processing tasks, so that in the subsequent startup process of the electronic device, the efficiency of allocation and scheduling of tasks to be processed can be improved based on the preset correspondence between each processing task and the target processing core, thereby improving the processing speed of the tasks to be processed.

[0060] In some embodiments of the present application, after "if the electronic device is turned on and enters the basic input and output system, obtain multiple pending tasks of the basic input and output system", that is, step S101, the following step S301 can also be executed, which is described below.

[0061] S301: If a first specific task to be processed is in a target running phase during the startup of a basic input / output system, the first specific task to be processed is allocated to a corresponding second processing core using a first processing core.

[0062] It should be noted that the first specific task to be processed is any one of the multiple tasks to be processed, and the target operation stage can be any one of the PEI stage and the DXE stage.

[0063] In some embodiments, if it is determined that the first specific pending task is in the PEI stage or the DXE stage during the BIOS startup process, the first specific pending task can be assigned to the corresponding second processing core through the first processing core, that is, the first processing core can schedule the pending task in the PEI stage or the DXE stage.

[0064] It can be understood that, when the first specific task to be processed is a task to be executed in the target operating stage, the first specific task to be processed can be allocated to the corresponding second processing core through the first processing core, so as to realize the scheduling of the task to be executed in the target operating stage, so as to complete the processing of the task to be processed in the PEI stage or the DXE stage through the second processing core.

[0065] In some embodiments of the present application, "using the first processing core to allocate the first specific task to be processed to the corresponding second processing core" in step S301 can be implemented by the following step S401A or step S401B, and step S401A and step S402B are described respectively below.

[0066] S401A: If the first specific to-be-processed task is a to-be-processed task without a dependency relationship, the first processing core allocates the first specific to-be-processed task to a corresponding target second processing core according to the type of the first specific to-be-processed task.

[0067] In some embodiments, if it is determined that the specific processing task belongs to a pending task without dependency, that is, the execution of the first specific pending task does not depend on the execution status, execution results, etc. of other pending tasks, the first processing core can determine the target second processing core corresponding to the type of the first specific pending task from the preset correspondence between the processing task and the processing core, and assign the first specific pending task to the target second core. In addition, the target second processing core only processes pending tasks of the same type as the first specific pending task.

[0068] In some embodiments, pending tasks that do not have dependencies may include EC chip communication tasks, such as checking keys, hot keys, keyboard connections, various buttons, whether a battery exists, and whether the battery power is sufficient, all of which can be done through EC. There are also some settings that need to be obtained by EC, and the setting information for cold start and hot start also needs to be obtained by EC. These pending tasks are all pending tasks that do not have dependencies, and these pending tasks can be assigned to the target second processing core corresponding to the EC chip communication tasks.

[0069] S402B: If the first specific to-be-processed task is a to-be-processed task with a dependency relationship, the first processing core allocates the first specific to-be-processed task to the reference second processing core.

[0070] In some embodiments, the initialization task of the device based on I2C and SPI communication may be dependent on the EC chip communication task, the initialization task of the device related to the CPU and transmitted via the BUS bus may be dependent on the EC chip communication task, the output display task of the boot animation may be dependent on the EC chip communication task, and the initialization task of the device related to the CPU and transmitted via the BUS bus may be dependent on the output display task of the boot animation.

[0071] In some embodiments, if it is determined that the execution start of the first specific task to be processed depends on the execution status, execution results, etc. of other tasks to be processed, the first processing core can assign the first specific task to be processed to a reference second processing core. The reference second processing core can be any one of multiple second cores, and the reference second core only processes tasks to be processed that have dependencies.

[0072] For example, if the first specific task to be processed is a boot animation display, the execution of this task needs to return a device status through I2C. Only after it is determined that the device has been initialized according to the status of the device can the boot animation display be executed. The first specific task to be processed can be assigned to the reference second core, and the first specific task to be processed can be started only after the initialization task of the device based on I2C communication is completed.

[0073] It can be understood that, depending on whether the first specific pending task belongs to a pending task with a dependency relationship, the corresponding target second processing core is assigned to it according to the type of the first specific pending task, or the pending task with a dependency relationship is assigned to the reference second processing core, so that the pending tasks without a dependency relationship can be executed independently, and the pending tasks with a dependency relationship can be started based on the execution status, execution results, etc. of the pending tasks with a dependency relationship, thereby realizing the reasonable allocation of each pending task on the second processing core and improving the processing efficiency of the pending tasks.

[0074] In some embodiments of the present application, after "if the electronic device is turned on and enters the basic input and output system, obtain multiple pending tasks of the basic input and output system", that is, step S101, the following steps S501 to S502 can also be executed, and each step is described below.

[0075] S501: Determine the processing capability of each second processing core.

[0076] In some embodiments, the processing capability of the second processing core may include the number of threads of the second processing core, the number of tasks that can be executed simultaneously, etc.

[0077] In some embodiments, the processing capability of the second processing core is determined in the processor design or development stage, and the information of the processing capability of the second processing core can be stored in a preset storage area of ​​the electronic device, so that the processing capability of the second processing core can be directly obtained in the BIOS startup stage. In implementation, the processing capability corresponding to each second processing core can be obtained through the first processing core, or the processing capability of the second processing core can be obtained through other modules of the electronic device.

[0078] S502: Determine a target second processing core corresponding to the reference task to be processed according to the processing capability.

[0079] In some embodiments, hardware resources may include memory occupancy, etc. The reference to-be-processed task is a to-be-processed task whose hardware resource demand is greater than the preset hardware resource amount, that is, running the reference to-be-processed task may occupy more hardware resources. In this case, the second processing core with the strongest processing capability may be determined as the target second processing core corresponding to the reference to-be-processed task. The preset hardware resource amount may be an arbitrarily set hardware resource amount, for example, it may be set to 50%, 60%, etc. of the total hardware resource amount of the processor.

[0080] For example, if the boot animation display task requires a large amount of hardware resources, the second processing core with the strongest processing capability among the second processing cores may be determined first, and then the boot animation display task may be allocated to the second processing core.

[0081] It can be understood that, according to the processing capabilities of each second processing core, the reference tasks to be processed that require larger hardware resources are allocated to the second processing core with the largest or strongest processing capabilities, so that the second processing core can have good performance in processing the reference tasks to be processed and improve the processing efficiency of the reference tasks to be processed.

[0082] In some embodiments of the present application, after "if the electronic device is turned on and enters the basic input and output system, obtain multiple pending tasks of the basic input and output system", i.e., step S101, the following step S601 may also be executed. The following is an explanation of this step.

[0083] S601: If the second specific task to be processed is in the first running stage during the basic input and output system startup process, allocate the second specific task to be processed to the first processing core.

[0084] In some embodiments, the first operation stage may be any other operation stage in the BIOS startup process except the PEI stage and the DXE stage, such as the SEC stage, the BDS stage, etc. The tasks to be processed corresponding to the first operation stage include receiving and processing system startup and restart signals, initializing console devices, loading device drivers, loading and executing startup items according to system settings, etc.

[0085] In some embodiments, the second specific pending task is any one of a plurality of pending tasks, and the second specific pending task is the same as or different from the first specific pending task. If it is determined that the second specific pending task is in the first operation stage during the BIOS startup process, the first core can process the pending task in the first operation stage by allocating the second specific pending task to the first processing core.

[0086] It can be understood that by allocating the second specific task to be processed in the first operating stage to the first processing core, the allocation of the second specific task to be processed is achieved, so that the processing of the task to be executed in the first operating stage is completed by the first processing core.

[0087] In some embodiments of the present application, the first processing core is used to process the first task to be processed, and the second processing core is used to process the corresponding second task to be processed, that is, the above-mentioned step S202 can be implemented by the following steps S2021 to S2023, and each step is described separately below.

[0088] S2021. Load the first task to be processed into the running queue corresponding to the first processing core, and load the second task to be processed into the running queue corresponding to the second processing core.

[0089] In some embodiments, each first task to be processed can be loaded into the running queue corresponding to the first processing core in sequence according to the execution sequence of each first task to be processed; each second task to be processed can be loaded into the running queue corresponding to the second processing core in sequence according to the execution sequence of each second task to be processed. The execution sequence of each first task to be processed and the execution sequence of each second task to be processed can be determined by the sequence of each running stage during the BIOS startup process, and the execution sequence between each first task to be processed or second task to be processed that has no dependency relationship in the same running stage can be determined arbitrarily.

[0090] S2022: Determine the queue status of the tasks to be processed in the running queues corresponding to the first processing core and the second processing core respectively.

[0091] In some embodiments, the queue status of the pending tasks in the running queue may include the number of pending tasks (first pending tasks or second pending tasks) in the current running queue, whether the running queue is full, whether the running queue is empty, etc.

[0092] S2023. Reallocate the first to-be-processed tasks and the second to-be-processed tasks in each running queue according to the queuing status, so as to achieve load balancing between the first processing core and the second processing core.

[0093] In some embodiments, the number of first tasks to be processed corresponding to the first processing core and the number of second tasks to be processed corresponding to each second processing core can be determined based on the queuing status of the running queue. The first tasks to be processed in the running queue corresponding to the first processing core and the second tasks to be processed in the running queue corresponding to the second processing core can be further reallocated to achieve load balancing between the first processing core and the second processing core.

[0094] In some embodiments, if the queuing status indicates that the tasks to be executed (the first tasks to be executed or the second tasks to be executed) in the current running queue are full, and there are fewer tasks to be executed in other running queues, for example, the running queue only includes one or two tasks to be processed, then some of the tasks to be executed in the current running queue can be loaded into other running queues with fewer tasks to be processed.

[0095] In some embodiments, after the first pending task and the second pending task are reallocated, the run queue corresponding to the first processing core may include the second pending task, the run queue corresponding to the second processing core may include the first pending task, the run queue corresponding to the second processing core may only include the second pending task, and the run queue corresponding to the first processing core may only include the first pending task. The run queue corresponding to a second processing core may include pending tasks of multiple task types, or may only include pending tasks of one task type.

[0096] It can be understood that by reallocating the first pending tasks and the second pending tasks according to the queuing status of the pending tasks in the running queues corresponding to the first processing core and each second processing core, load balancing can be achieved, the processing efficiency of multiple pending tasks can be improved, and the speed of BIOS startup can be accelerated.

[0097] In some embodiments of the present application, the first pending task and the second pending task in each running queue are reallocated according to the queuing status, that is, the above-mentioned step S2023 can be implemented by the following step S701, which is explained below.

[0098] S701: If it is determined according to the queuing state that there is an empty running queue, the first to-be-processed task and / or the second to-be-processed task in other non-empty running queues are loaded into the empty running queue.

[0099] In some embodiments, if it is determined based on the queuing status that there is an empty run queue, it means that the current pending tasks in the run queue have been processed, and the pending tasks in other non-empty run queues can be loaded into the empty run queue for storage, wherein the empty run queue may be the run queue corresponding to the first processing core, or it may be the run queue corresponding to the second processing core, and the empty run queue includes one or more.

[0100] In some embodiments, the non-empty run queue may be the run queue corresponding to the first processing core or the run queue corresponding to the second processing core, and the pending task loaded into the empty run queue may be the first pending task or the second pending task.

[0101] It can be understood that by loading the pending tasks in the non-empty run queue into the empty run queue, corresponding pending tasks can be present in the run queue corresponding to each processing core, thereby achieving balanced distribution of tasks and improving the processing efficiency of each pending task of the BIOS.

[0102] In an embodiment of the present application, after the electronic device is turned on and enters the basic input-output system, multiple tasks to be processed of the basic input-output system are obtained; the first processing core and multiple second processing cores of the processor of the electronic device are used to execute the multiple tasks to be processed to complete the startup process of the basic input-output system. In this way, the first processing core and the second processing core of the processor of the electronic device simultaneously process the multiple tasks to be processed of the basic input-output system, rather than only running the multiple tasks to be processed by a single first processing core or a single second processing core, which can speed up the startup speed of the basic input-output system, thereby improving the startup speed of the electronic device.

[0103] Next, the implementation process of the application embodiment in the actual application scenario is introduced.

[0104] like Figure 2 As shown, it is a flowchart of a method for implementing BIOS distributed scheduling provided by the present application. The method can be implemented through the following steps S801 to S804, and each step is described separately below.

[0105] S801. After the electronic device is powered on and enters BIOS, the number of AP cores (equivalent to the "second processing cores" in other embodiments) is detected.

[0106] In some embodiments, the number of AP cores of the processor may be predetermined, and the AP core of the processor may include one or more. After the electronic device is powered on and enters the BIOS, it may detect whether the status of each AP core is normal, and determine the number of available AP cores.

[0107] S802. Create an EC core, an I2C module core, a display core, a bus driver core, and a dependent waiting core according to the number of AP cores.

[0108] In some embodiments, after determining that each AP core to be processed is detected, if the processor includes 5 AP cores, an EC core, an I2C module core, a display core, a bus driver core, and a dependency waiting core may be created. The EC core may be used to process tasks related to communication with the EC chip; the I2C module core may process initialization of slow devices or devices such as I2C and SPI; the display core may process tasks such as loading the Graphics Output Protocol (GOP) driver and displaying the startup logo; the bus driver core processes bus initialization tasks related to the CPU; and the dependency waiting core is responsible for accommodating and processing tasks with dependencies.

[0109] S803, using the BSP core to schedule various tasks of the BIOS system to the EC core, the I2C module core, the display core, the bus driver core and the dependency waiting core.

[0110] In some embodiments, according to the definition of BIOS UEFI, such as Figure 3 As shown, the distributed scheduling of BIOS starts from the SEC stage to the BDS stage, and is completed by the DXE dispatcher. The DXE dispatcher is defined as the core dispatcher, and the core dispatcher is the scheduler of the BSP core.

[0111] In some embodiments, Figure 4 As shown in the figure, the dispatcher of the BSP core dispatches the tasks of the other five microkernels to run on the AP core of the CPU in turn according to the type and progress of the module, and tracks the completion progress.

[0112] S804: Each AP core and BSP core processes its corresponding task to complete the startup of BIOS.

[0113] In some embodiments, in addition to task scheduling, the BSP core can also process tasks in the SEC stage and the BDS stage. After the BSP core schedules tasks to the EC core, the I2C module core, the display core, the bus driver core, and the dependent waiting core, each AP core can process the tasks in its own queue.

[0114] In some embodiments, the dispatcher of the BSP core queues the modules with dependencies into the dependency waiting core and runs them one at a time; the dispatcher of the BSP core can add and delete the running queue of the CPU core according to the actual load.

[0115] It can be understood that the BIOS distributed scheduling implementation method provided in the present application distributes various tasks started by the BIOS to various AP cores and BSP cores for processing, thereby speeding up the startup speed of the BIOS, thereby increasing the boot speed of electronic devices and enhancing the user experience.

[0116] The present application also provides a task processing device, wherein a first electronic device includes a display screen for displaying content, Figure 5 A schematic diagram of the structure of a task processing device provided in an embodiment of the present application is shown in FIG. Figure 5 As shown, the task processing device 900 includes:

[0117] A first acquisition module 901 is used to acquire a plurality of pending tasks of the basic input and output system after the electronic device is turned on and enters the basic input and output system;

[0118] The first task processing module 902 is used to utilize the first processing core and multiple second processing cores of the processor of the electronic device to execute the multiple tasks to be processed to complete the startup process of the basic input and output system, wherein the first processing core and the second processing core are physical processing cores belonging to the same processor.

[0119] In some embodiments, the first task processing module 902 includes:

[0120] A first determining submodule, configured to determine, according to a preset correspondence between each processing core of the processor and each processing task in the process of starting the basic input and output system, a first task to be processed corresponding to the first processing core and a second task to be processed corresponding to each second processing core; each processing task in the preset correspondence is the same as the plurality of tasks to be processed;

[0121] The first task processing submodule is used to process the first task to be processed by using the first processing core, and to process the corresponding second task to be processed by using each of the second processing cores.

[0122] In some embodiments, the task processing device 900 further includes:

[0123] A first task allocation module, configured to allocate a corresponding target processing core to each processing task according to at least one of the running stage of each processing task during the startup of the basic input and output system, the type of the task to be processed, and the dependency relationship between the processing tasks;

[0124] The first creation module is used to establish the preset corresponding relationship based on the various processing tasks and the corresponding target processing cores.

[0125] In some embodiments, the task processing device 900 further includes:

[0126] The second task allocation module is used to allocate the first specific task to be processed to the corresponding second processing core using the first processing core if the first specific task to be processed is in the target operation stage during the startup of the basic input and output system; the first specific task to be processed is any one of the multiple tasks to be processed.

[0127] In some embodiments, the second task assignment module includes:

[0128] A first task allocation submodule is configured to allocate the first specific to-be-processed task to a corresponding target second processing core according to the type of the first specific to-be-processed task if the first specific to-be-processed task is a to-be-processed task without a dependency relationship; the target second processing core only processes the to-be-processed task of the same type as the first specific to-be-processed task;

[0129] The second task allocation submodule is used for, if the first specific to-be-processed task belongs to the to-be-processed tasks with dependency, for the first processing core to allocate the first specific to-be-processed task to the reference second processing core.

[0130] In some embodiments, the task processing device 900 further includes:

[0131] A first determining module, used to determine the processing capability of each of the second processing cores;

[0132] The second determination module is used to determine the target second processing core corresponding to the reference task to be processed according to the processing capability; the reference task to be processed is a task to be processed whose hardware resource requirement is greater than a preset hardware resource amount.

[0133] In some embodiments, the task processing device 900 further includes:

[0134] A third task allocation module is used to allocate a second specific task to be processed to the first processing core if the second specific task to be processed is in the first running stage during the startup of the basic input and output system; the second specific task to be processed is any one of the multiple tasks to be processed.

[0135] In some embodiments, the first task processing submodule includes:

[0136] a first task loading unit, configured to load the first to-be-processed task into a run queue corresponding to the first processing core, and to load the second to-be-processed task into a run queue corresponding to the second processing core;

[0137] A first determining unit, configured to determine the queue status of the tasks to be processed in the run queues corresponding to the first processing core and the second processing core respectively;

[0138] The first task allocation unit is used to reallocate the first to-be-processed tasks and the second to-be-processed tasks in each of the running queues according to the queuing status, so as to achieve load balancing of the first processing core and the second processing core.

[0139] In some embodiments, the first task allocation unit is further configured to load the first to-be-processed task and / or the second to-be-processed task in other non-empty run queues into the empty run queue if it is determined according to the queuing state that there is an empty run queue.

[0140] It should be noted that the description of the task processing device of the embodiment of the present application is similar to the description of the above method embodiment, and has similar beneficial effects as the method embodiment, so it will not be repeated. For technical details not disclosed in the embodiment of the device, please refer to the description of the method embodiment of the present application for understanding.

[0141] It should be noted that in the embodiment of the present application, if the above-mentioned task processing method 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 such an understanding, the technical solution of the embodiment of the present application can be essentially or the part that contributes to the relevant solution can be embodied in the form of a software product, which is stored in a storage medium, including a number of instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the methods of each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a U disk, a mobile hard disk, a read-only memory (ROM), a disk or an optical disk. In this way, the embodiment of the present application is not limited to any specific combination of hardware and software.

[0142] Accordingly, an embodiment of the present application provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the task processing method provided in the above embodiment is implemented.

[0143] The embodiment of the present application also provides a task processing device. Figure 6 A schematic diagram of the composition structure of a task processing device provided in an embodiment of the present application is shown in FIG. Figure 6 As shown, the task processing device 10 includes: a memory 11, a processor 12, a communication interface 13 and a communication bus 14. The memory 11 is used to store executable task scheduling instructions; the processor 12 is used to execute the executable task scheduling instructions stored in the memory to implement the task processing method provided in the above embodiment.

[0144] The description of the above task processing device and storage medium 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 task processing device and storage medium embodiments of this application, please refer to the description of the method embodiments of this application for understanding.

[0145] It should be noted that, in this article, the term "comprises" or any other variant thereof is intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, an element defined by the sentence "comprises at least one ..." does not exclude the existence of other identical elements in the process, method, article or device including the element.

[0146] In the several embodiments provided in the present application, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are only schematic. For example, the division of units is only a logical function division. There may be other division methods in actual implementation, such as: multiple units or components can be combined, or can be integrated into another system, or some features can be ignored or not executed. In addition, the coupling, direct coupling, or communication connection between the components shown or discussed can be through some interfaces, and the indirect coupling or communication connection of devices or units can be electrical, mechanical or other forms.

[0147] 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 on multiple network units; some or all of the units may be selected according to actual needs to achieve the purpose of the present embodiment.

[0148] In addition, all functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may be a separate unit, or two or more units may be integrated into one unit; the above-mentioned integrated units may be implemented in the form of hardware or in the form of hardware plus software functional units.

[0149] A person of ordinary skill in the art can understand that: all or part of the steps of implementing the above-mentioned method embodiment can be completed by hardware related to program instructions, and the aforementioned program can be stored in a computer-readable storage medium. When the program is executed, it executes the steps of the above-mentioned method embodiment; and the aforementioned storage medium includes: various media that can store program codes, such as mobile storage devices, ROM, disks or optical disks.

[0150] 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 embodiment of the present application can essentially or in other words, the part that contributes to the prior art can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for a product to execute all or part of the methods of 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.

[0151] The above are only implementation methods of the present application, but the protection scope of the present application is not limited thereto. Any technical object familiar with the technical field can be easily thought of within the technical scope disclosed in the present application. Changes or substitutions should be included in the protection scope of the present application. Therefore, the protection scope of the present application shall be based on the protection scope of the claims.

Claims

1. A task processing method, comprising: If the electronic device is turned on and enters the basic input and output system, a plurality of tasks to be processed of the basic input and output system are obtained; The first processing core and multiple second processing cores of the processor of the electronic device are used to execute the multiple tasks to be processed to complete the startup process of the basic input and output system, wherein the first processing core and the second processing core are physical processing cores belonging to the same processor.

2. The method according to claim 1, wherein the step of using a first processing core and a plurality of second processing cores of a processor of the electronic device to execute the plurality of tasks to be processed comprises: Determine, according to a preset correspondence between each processing core of the processor and each processing task during the startup of the basic input and output system, a first task to be processed corresponding to the first processing core and a second task to be processed corresponding to each second processing core; each processing task in the preset correspondence is the same as the plurality of tasks to be processed; The first processing core is used to process the first task to be processed, and each of the second processing cores is used to process a corresponding second task to be processed.

3. According to the method of claim 2, the method for creating the preset corresponding relationship comprises: Allocate a corresponding target processing core to each processing task according to at least one of the running stage of each processing task during the startup of the basic input and output system, the type of the task to be processed, and the dependency relationship between the processing tasks; The preset corresponding relationship is established based on each processing task and the corresponding target processing core.

4. The method according to claim 2, further comprising: If the first specific task to be processed is in the target operation stage during the basic input and output system startup process, the first specific task to be processed is allocated to the corresponding second processing core using the first processing core; the first specific task to be processed is any one of the multiple tasks to be processed.

5. The method according to claim 4, wherein using the first processing core to allocate the first specific task to be processed to the corresponding second processing core comprises: If the first specific to-be-processed task is a to-be-processed task without a dependency relationship, the first processing core allocates the first specific to-be-processed task to a corresponding target second processing core according to the type of the first specific to-be-processed task; The target second processing core only processes the to-be-processed tasks of the same type as the first specific to-be-processed tasks; If the first specific to-be-processed task is a to-be-processed task with a dependency relationship, the first processing core allocates the first specific to-be-processed task to the reference second processing core.

6. The method according to claim 2, further comprising: determining a processing capability of each of the second processing cores; Determining, according to the processing capability, a target second processing core corresponding to the reference task to be processed; The reference to-be-processed task is a to-be-processed task whose hardware resource requirement is greater than a preset hardware resource amount.

7. The method according to claim 2, further comprising: If the second specific task to be processed is in the first running stage during the startup of the basic input and output system, assigning the second specific task to be processed to the first processing core; The second specific task to be processed is any one of the multiple tasks to be processed.

8. The method according to claim 2, wherein the processing of the first to-be-processed task by the first processing core and the processing of the corresponding second to-be-processed task by the second processing core comprises: Loading the first task to be processed into a run queue corresponding to the first processing core, and loading the second task to be processed into a run queue corresponding to the second processing core; Determine the queue status of the tasks to be processed in the run queues corresponding to the first processing core and the second processing core respectively; According to the queuing status, the first to-be-processed tasks and the second to-be-processed tasks in the respective running queues are reallocated to achieve load balancing of the first processing core and the second processing core.

9. The method according to claim 8, wherein the reallocating the first to-be-processed tasks and the second to-be-processed tasks in the respective running queues according to the queuing status comprises: If it is determined according to the queuing state that there is an empty run queue, the first to-be-processed task and / or the second to-be-processed task in other non-empty run queues are loaded into the empty run queue.

10. A task processing device, comprising: A first acquisition module is used to acquire a plurality of pending tasks of the basic input and output system after the electronic device is turned on and enters the basic input and output system; The first task processing module is used to utilize the first processing core and multiple second processing cores of the processor of the electronic device to execute the multiple tasks to be processed so as to complete the startup process of the basic input and output system, wherein the first processing core and the second processing core are physical processing cores belonging to the same processor.

Citation Information

Cited By

  • Processing method, device and equipment for starting task of multi-core system and storage medium

    CN120596169A

  • Method, device and equipment for starting task of multi-core system and storage medium

    CN120596169B