CPU (Central Processing Unit) multi-thread 3D (Three-Dimensional) graph acceleration method based on embedded chip without 3D GPU (Graphic Processing Unit)

By evaluating the processing weight of 3D graphics processing tasks and the processing capabilities of the CPU core, and determining the multi-threaded processing strategy, the problem of low 3D graphics processing efficiency of CPU without 3D GPU is solved, and efficient graphics acceleration is achieved.

CN119722898AActive Publication Date: 2025-03-28SHENZHEN HONGYU TIANXIANG TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202411837896.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-13
Publication Date
2025-03-28
Estimated Expiration
2044-12-13

AI Technical Summary

Technical Problem

In the absence of a 3D GPU, when the CPU is used for 3D graphics processing, the processing efficiency is slow and cannot meet the needs of efficient graphics processing.

Method used

By obtaining the target task information and CPU core information of the 3D graphics processing task, evaluating the processing weight of the processing task and the processing capabilities of the CPU core, determining a multi-threaded processing strategy, and executing 3D graphics processing tasks through multiple CPU cores.

Benefits of technology

It improves the CPU's 3D graphics processing efficiency and achieves efficient graphics acceleration without 3D GPU.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119722898A_ABST
    Figure CN119722898A_ABST
Patent Text Reader

Abstract

The invention relates to a CPU multi-thread 3D graph acceleration method based on an embedded chip without a 3D GPU, and relates to the technical field of graph processing. The method comprises the following steps: evaluating a 3D graphic processing task through target task information corresponding to the 3D graphic processing task to obtain a processing weight, evaluating a core of a CPU through CPU core information to obtain processing capabilities of a plurality of cores, and determining a multi-thread processing strategy in combination with the processing weight and the processing capabilities of the plurality of cores. And executing a 3D graphic processing task through a plurality of cores based on a multi-thread processing strategy. Due to the fact that the processing weight is information obtained through analysis from the perspective of the 3D graphic processing task and the processing capacity is information obtained through analysis from the perspective of the core information, the reasonable multi-thread processing strategy adaptive to the CPU core can be determined by combining the two kinds of information, and therefore the task processing efficiency can be improved by utilizing the multi-thread processing strategy to conduct task processing, and the processing efficiency of the CPU core can be improved. And the 3D graphic task acceleration of the CPU is realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to a graphics processing technology, and in particular to a method for CPU multi-threaded 3D graphics acceleration based on a non-3D GPU embedded chip. Background Art

[0003] With the development of image processing technology, 3D graphics processing technology has also developed. The processing of 3D graphics includes various processing steps such as rendering, mapping and texture mapping. At present, most 3D image processing scenarios rely on GPU (Graphics Processing Unit) to implement graphics processing. However, in some scenarios, GPU may not be configured, and 3D graphics processing can only be performed by CPU (Central Processing Unit). In this case, if the processing is performed according to the existing processing strategy of the CPU, the efficiency of 3D graphics processing may be slow. Summary of the invention

[0005] The purpose of the present invention is to provide a method for CPU multi-threaded 3D graphics acceleration based on a non-3D GPU embedded chip, so as to realize CPU multi-threaded 3D graphics acceleration based on a non-3D GPU embedded chip and improve the 3D graphics processing efficiency of the CPU.

[0006] In order to achieve the above-mentioned purpose, the present disclosure provides a method for CPU multi-threaded 3D graphics acceleration based on a non-3D GPU embedded chip, comprising: obtaining target task information and CPU core information corresponding to a 3D graphics processing task; evaluating the 3D graphics processing task according to the target task information to obtain first evaluation information, wherein the first evaluation information is used to characterize the processing weight of the 3D graphics processing task; evaluating multiple cores of the CPU according to the CPU core information to obtain second evaluation information, wherein the second evaluation information is used to characterize the processing capabilities of the multiple cores respectively; determining the corresponding multi-threaded processing strategy of the 3D graphics processing task according to the first evaluation information and the second evaluation information; and executing the 3D graphics processing task according to the multi-threaded processing strategy through the multiple cores.

[0007] Optionally, the 3D graphics processing task is evaluated according to the target task information to obtain first evaluation information, including: determining a first processing weight according to the target task information and pre-configured task information, the pre-configured task information being task information that matches the CPU capability; determining a second processing weight according to the target task information and a pre-trained evaluation model, the pre-trained evaluation model being used to output the second processing weight based on the input target task information; and obtaining first evaluation information for characterizing the target processing weight of the 3D graphics processing task according to the first processing weight and the second processing weight.

[0008] Optionally, the method also includes: obtaining a first training data set, the first training data set including multiple first training samples, each first training sample including sample task information and sample processing weight, wherein the sample task information is task information determined from a 3D graphics processing task executed by an external GPU, and the sample processing weight is determined by analyzing actual execution results of the external GPU for the 3D graphics processing task; determining a sample weight corresponding to the first training data set based on the external GPU core information and the CPU core information; and training an evaluation model to be trained based on the first training data set and the sample weight corresponding to the first training data set to obtain the pre-trained evaluation model.

[0009] Optionally, the CPU core information includes: historical load information corresponding to multiple cores respectively, and the multiple cores of the CPU are evaluated according to the CPU core information to obtain second evaluation information, including: evaluating the multiple cores respectively according to the historical load information and pre-configured load information corresponding to the multiple cores to obtain first processing capability evaluation values ​​corresponding to the multiple cores respectively; obtaining external GPU core information, the external GPU core information including real load change information corresponding to the multiple GPU cores when the GPU performs 3D graphics processing; evaluating the multiple cores respectively according to the external GPU core information and the historical load information corresponding to the multiple cores to obtain second processing capability evaluation values ​​corresponding to the multiple cores respectively; determining the second evaluation information according to the first processing capability evaluation value and the second processing capability evaluation value, the second evaluation information including target processing capability evaluation values ​​corresponding to the multiple cores respectively.

[0010] Optionally, the multiple cores are evaluated respectively according to the external GPU core information and the historical load information corresponding to the multiple cores to obtain second processing capability evaluation values ​​corresponding to the multiple cores, including: determining first load prediction information according to the historical load information corresponding to the multiple cores and a pre-trained prediction model, the first load prediction information including the predicted loads corresponding to the multiple cores; determining second load prediction information according to the external GPU core information and the pre-trained prediction model, the second load prediction information including the predicted loads corresponding to the multiple GPU cores; determining second processing capability evaluation values ​​corresponding to the multiple cores according to the first load prediction information and the second load prediction information.

[0011] Optionally, the method also includes: obtaining a second training data set, the second training data set includes multiple second samples and multiple third samples, each of the second samples includes sample load information of multiple cores when performing 3D graphics processing tasks, and each of the third samples includes sample load information of multiple cores when performing non-3D graphics processing tasks; determining the load change rates corresponding to the multiple second samples, and determining the load change rates corresponding to the multiple third samples; determining a first sub-sample from the multiple second samples and a second sub-sample from the multiple third samples according to the load change rates corresponding to the multiple second samples and the load change rates corresponding to the multiple third samples; training the prediction model to be trained according to the first sub-sample and the second sub-sample to obtain the pre-trained prediction model.

[0012] Optionally, determining the corresponding multi-threaded processing strategy of the 3D graphics processing task based on the first evaluation information and the second evaluation information includes: dividing the 3D graphics processing task into multiple sub-processing tasks based on the first evaluation information; determining subtask information corresponding to the multiple sub-processing tasks respectively; determining cores corresponding to the multiple sub-processing tasks respectively based on the second evaluation information and the subtask information corresponding to the multiple sub-processing tasks respectively; determining load adjustment strategies corresponding to the multiple cores based on the first evaluation information and the second evaluation information; determining the multi-threaded processing strategy based on the multiple sub-processing tasks, the cores corresponding to the multiple sub-processing tasks respectively, and the load adjustment strategies corresponding to the multiple cores.

[0013] Optionally, determining the load adjustment strategies corresponding to the multiple cores based on the first evaluation information and the second evaluation information includes: judging whether the respective processing capabilities of the multiple cores match the processing weights of the 3D graphics processing tasks based on the first evaluation information and the second evaluation information; if the respective processing capabilities of the multiple cores match the processing weights of the 3D graphics processing tasks, determining that the load adjustment strategies corresponding to the multiple cores are the first adjustment strategies, in which the loads corresponding to the multiple cores are adjusted after every preset period; if the respective processing capabilities of the multiple cores do not match the processing weights of the 3D graphics processing tasks, determining that the load adjustment strategies corresponding to the multiple cores are the second adjustment strategies, in which the loads corresponding to the multiple cores are adjusted each time a preset number of sub-processing tasks are detected to be completed.

[0014] Optionally, executing the 3D graphics processing task through the multiple cores according to the multi-threaded processing strategy includes: allocating the multiple sub-processing tasks to the cores corresponding to the multiple sub-processing tasks respectively; executing corresponding sub-processing tasks through the cores corresponding to the multiple sub-processing tasks respectively; and during task execution, adjusting the load corresponding to at least some of the multiple cores according to the load adjustment strategies corresponding to the multiple cores.

[0015] Optionally, the 3D graphics processing task is a 3D graphics rendering task, and the method further includes: in response to detecting that the 3D graphics processing task is completed within a preset time length, obtaining 3D graphics rendering information, and adding first identification information to the rendered 3D graphics according to the 3D graphics rendering information, wherein the first identification information is used to characterize the rendering quality of the 3D graphics; in response to not detecting that the 3D graphics processing task is completed within the preset time length, obtaining 3D image rendering progress, and adding second identification information to the rendered 3D graphics according to the 3D graphics rendering progress, wherein the second identification information is used to characterize the rendering progress of the 3D graphics.

[0016] Through the above technical solution, the 3D graphics processing task is evaluated through the target task information corresponding to the 3D graphics processing task to obtain the processing weight. The CPU core information is used to evaluate the CPU core to obtain the processing capabilities of multiple cores. The multi-threaded processing strategy is determined by combining the processing weight and the processing capabilities of multiple cores, and then the 3D graphics processing task is executed by multiple cores based on the multi-threaded processing strategy. Since the processing weight is information analyzed from the perspective of the 3D graphics processing task, and the processing capability is information analyzed from the perspective of the core information, by combining the two types of information, a more reasonable and suitable multi-threaded processing strategy for the CPU core can be determined. Therefore, by using the multi-threaded processing strategy for task processing, the task processing efficiency can be improved and the CPU's 3D graphics task acceleration can be achieved. Therefore, this technical solution can achieve CPU multi-threaded 3D graphics acceleration based on a non-3D GPU embedded chip, and improve the CPU's 3D graphics processing efficiency.

[0017] Other features and advantages of the present disclosure will be described in detail in the following detailed description. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] The accompanying drawings are used to provide a further understanding of the present disclosure and constitute a part of the specification. Together with the following specific embodiments, they are used to explain the present disclosure but do not constitute a limitation of the present disclosure. In the accompanying drawings: Figure 1 The diagram is a schematic diagram showing CPU multithreading according to an exemplary embodiment.

[0020] Figure 2 The present invention is a flowchart of a method for CPU multi-threaded 3D graphics acceleration based on a non-3D GPU embedded chip according to an exemplary embodiment.

[0021] Figure 3 It is an operation block diagram of a CPU according to an exemplary embodiment.

[0022] Figure 4 The figure is a schematic diagram of a 3D rendering result according to an exemplary embodiment.

[0023] Figure 5 The invention is a block diagram showing a device for CPU multi-threaded 3D graphics acceleration based on a non-3D GPU embedded chip according to an exemplary embodiment.

[0024] Figure 6 It is a block diagram of an electronic device according to an exemplary embodiment. DETAILED DESCRIPTION

[0026] The specific implementation of the present disclosure is described in detail below in conjunction with the accompanying drawings. It should be understood that the specific implementation described herein is only used to illustrate and explain the present disclosure, and is not used to limit the present disclosure.

[0027] It should be noted that all actions of acquiring signals, information or data in the present disclosure are carried out in compliance with the relevant data protection laws and policies of the country where the device is located and with the authorization given by the owner of the corresponding device.

[0028] With the development of image processing technology, 3D graphics processing technology has also developed. The processing of 3D graphics includes various processing steps such as rendering, mapping and texture mapping. At present, most 3D image processing scenarios rely on GPU (Graphics Processing Unit) to implement graphics processing. However, in some scenarios, GPU may not be configured, and 3D graphics processing can only be performed by CPU (Central Processing Unit). In this case, if the processing is performed according to the existing processing strategy of the CPU, the efficiency of 3D graphics processing may be slow.

[0029] Both the CPU and GPU have multi-threading capabilities, and can execute tasks separately through multiple cores, thereby realizing multi-threaded operation of tasks.

[0030] In terms of graphics processing, the multi-threading capability of GPU is stronger than that of CPU. However, the multi-threading efficiency can be improved by properly allocating tasks among CPU multi-cores.

[0031] Therefore, the embodiment of the present disclosure provides a technical solution, which evaluates the 3D graphics processing task through the target task information corresponding to the 3D graphics processing task to obtain the processing weight, evaluates the CPU core through the CPU core information to obtain the processing capabilities of multiple cores, and determines the multi-threaded processing strategy by combining the processing weight and the processing capabilities of multiple cores, and then executes the 3D graphics processing task through multiple cores based on the multi-threaded processing strategy.

[0032] Since the processing weight is the information obtained from the analysis of the 3D graphics processing task, and the processing capacity is the information obtained from the analysis of the core information, by combining the two types of information, a more reasonable multi-threaded processing strategy that is suitable for the CPU core can be determined. Therefore, by using the multi-threaded processing strategy for task processing, the task processing efficiency can be improved and the 3D graphics task acceleration of the CPU can be realized. Therefore, this technical solution can realize the CPU multi-threaded 3D graphics acceleration based on the non-3D GPU embedded chip and improve the 3D graphics processing efficiency of the CPU.

[0033] It can be understood that the application scenario of this solution is an embedded chip without a 3D GPU. The embedded chip includes a CPU, and 3D graphics processing is implemented through the CPU.

[0034] Regarding 3D graphics processing, it may involve various processing methods such as rendering, texture mapping and mapping. Accordingly, a 3D graphics processing task may involve one or more of these processing methods.

[0035] Figure 1 is a schematic diagram of a CPU multithreading according to an exemplary embodiment. Figure 1 As shown, the CPU is divided into multiple cores, and these multiple cores can execute different threads respectively. Therefore, by assigning tasks to different cores, multiple cores can execute these tasks in a multi-threaded manner.

[0036] It can be understood that, in addition to being applied to CPU graphics acceleration, this technical solution can also be applied to other scenarios involving non-CPU hardware without a GPU, and the non-CPU hardware also has multi-threading capabilities.

[0037] Figure 2 The present invention is a flowchart of a method for CPU multi-threaded 3D graphics acceleration based on a non-3D GPU embedded chip according to an exemplary embodiment. The method comprises the following steps: Step S21, obtaining target task information and CPU core information corresponding to the 3D graphics processing task.

[0038] Step S22: Evaluate the 3D graphics processing task according to the target task information to obtain first evaluation information, where the first evaluation information is used to characterize the processing weight of the 3D graphics processing task.

[0039] Step S23, evaluating multiple cores of the CPU according to the CPU core information to obtain second evaluation information, where the second evaluation information is used to characterize the processing capabilities of the multiple cores respectively.

[0040] Step S24: determining a corresponding multi-thread processing strategy for the 3D graphics processing task according to the first evaluation information and the second evaluation information.

[0041] Step S25, executing the 3D graphics processing task through multiple cores according to the multi-thread processing strategy.

[0042] In step S21, the 3D graphics processing task may be a 3D graphics processing task to be currently executed, which may be a rendering task, a mapping task, a texture mapping task, etc., which is not limited here.

[0043] The target task information can be determined by analyzing the 3D graphics processing task. The target task information may include: task type, task complexity, task data volume, etc.

[0044] Regarding the task type, it can be rendering, mapping, texture mapping, etc. In the task, a task type identifier can be carried, and the task type can be determined through the task type identifier.

[0045] Task complexity can represent the complexity and difficulty of a task. The more complex the task, the higher the difficulty of the task. The complexity of the task can be determined through the common task analysis techniques in this field.

[0046] The task data volume may be the number of maps, the number of rendering elements, the number of texture maps, etc., which are not limited here. The task data volume may be determined by statistically analyzing the data involved in the task, or by other analytical methods, which are not limited here.

[0047] The CPU core information may be information about multiple cores of the CPU, and the information may be preset information or information determined by actual operating conditions of the multiple cores.

[0048] For example, the CPU core information may include: the maximum tolerable load of the core, the data cache capacity of the core, the processing efficiency of the core, etc., which are not limited here.

[0049] Furthermore, in step S22, the 3D graphics processing task is first evaluated according to the target information to obtain first evaluation information representing the processing weight.

[0050] Regarding the processing weight, the situation of the 3D graphics processing task can be characterized from different dimensions, such as: task importance, task difficulty (complexity) and task fault tolerance.

[0051] As an optional implementation, step S22 includes: determining a first processing weight based on target task information and pre-configured task information, the pre-configured task information being task information that matches CPU capabilities; determining a second processing weight based on the target task information and a pre-trained evaluation model, the pre-trained evaluation model being used to output a second processing weight based on input target task information; and obtaining first evaluation information of a target processing weight for characterizing a 3D graphics processing task based on the first processing weight and the second processing weight.

[0052] In this implementation, task information matching the CPU capability may be preconfigured in the CPU, and the first processing weight may be determined by comparing the target task information with the preconfigured task information.

[0053] In some embodiments, the greater the difference between the target task information and the pre-configured task information, the higher the first processing weight.

[0054] The gap between the target task information and the pre-configured task information may be the result of integrating the gaps of each information. For example, for different target task information, corresponding task information is pre-configured respectively, and the gaps of various information can be determined by comparing them respectively, and finally integrated to obtain the final gap.

[0055] The first processing weight can only evaluate the task from the perspective of CPU capability, and the task needs to be evaluated from other perspectives.

[0056] Therefore, the pre-trained evaluation information can also be used to determine the second processing weight according to the target task information.

[0057] The pre-trained evaluation model may be an evaluation model trained based on relevant data of the GPU, thereby enabling the CPU to be as close to the GPU as possible.

[0058] Therefore, as an optional implementation, the training of the evaluation model includes: obtaining a first training data set, the first training data set includes multiple first training samples, each first training sample includes sample task information and sample processing weight, wherein the sample task information is task information determined from a 3D graphics processing task executed by an external GPU, and the sample processing weight is determined by analyzing the actual execution results of the external GPU for the 3D graphics processing task; determining the sample weight corresponding to the first training data set according to the external GPU core information and the CPU core information; and training the evaluation model to be trained according to the first training data set and the sample weight corresponding to the first training data set to obtain a pre-trained evaluation model.

[0059] In this implementation, the 3D graphics processing tasks executed by the external GPU can be analyzed to extract sample task information, and the sample task information can be labeled with sample processing weights. The sample processing weights can be labeled manually or in other labeling methods, which are not limited here.

[0060] Regarding the external GPU, it may be a GPU other than the current chip, but the relevant data can be obtained.

[0061] In this way, the model is pre-trained and integrated into the current CPU for task evaluation on the current CPU.

[0062] Furthermore, the samples in the first training data set are samples in the GPU scene, and there is a certain gap between GPU and CPU. Therefore, the external GPU core information can also be obtained and compared with the CPU core information. The greater the core information gap, the lower the sample weight.

[0063] In some embodiments, the core information of the same type is compared, and multiple types of core information may be compared separately, and then the comparison results of the multiple types of core information are integrated to obtain the final core information gap.

[0064] Furthermore, the first training data set and the sample weights corresponding to the first training data set can be used to train the evaluation model to be trained to obtain a pre-trained evaluation model.

[0065] In this way, we can take into account both GPU data and the gap between GPU and CPU, thus improving the model accuracy. In addition, there may be fewer scenarios where graphics processing is performed by CPU at present, so this method can reduce the difficulty of obtaining training data.

[0066] In step S23, multiple cores of the CPU are evaluated according to the CPU core information to obtain second evaluation information representing the processing capabilities of the multiple cores.

[0067] In some embodiments, the CPU core information includes: historical load information corresponding to multiple cores respectively, and the information can be used to implement CPU core evaluation.

[0068] As an optional implementation, step S23 includes: evaluating the multiple cores respectively according to historical load information and pre-configured load information corresponding to the multiple cores, and obtaining first processing capability evaluation values ​​corresponding to the multiple cores; obtaining external GPU core information, the external GPU core information including real load change information corresponding to the multiple GPU cores when the GPU performs 3D graphics processing; evaluating the multiple cores respectively according to the external GPU core information and the historical load information corresponding to the multiple cores, and obtaining second processing capability evaluation values ​​corresponding to the multiple cores; determining second evaluation information based on the first processing capability evaluation value and the second processing capability evaluation value, the second evaluation information including target processing capability evaluation values ​​corresponding to the multiple cores.

[0069] In this implementation, multiple cores are first evaluated using pre-configured load information. The pre-configured load information may be load information corresponding to a better load condition, which may involve load conditions of multiple cores, such as load distribution, load change rate, etc.

[0070] Furthermore, by analyzing the historical load information corresponding to the multiple cores respectively, load information of the same type as the pre-configured load information is obtained, and then a comparison is performed, and the first processing capacity evaluation value is determined according to the comparison result.

[0071] In some embodiments, the larger the gap, the lower the first processing capability assessment value.

[0072] In some embodiments, the external GPU core information may include real load change information corresponding to multiple GPU cores when the GPU performs 3D graphics processing. The real load change information may characterize the core load condition of the external GPU.

[0073] In some embodiments, multiple cores are evaluated respectively based on external GPU core information and historical load information corresponding to the multiple cores to obtain second processing capability evaluation values ​​corresponding to the multiple cores, which may include: determining first load prediction information based on historical load information corresponding to the multiple cores and a pre-trained prediction model, the first load prediction information including predicted loads corresponding to the multiple cores; determining second load prediction information based on the external GPU core information and the pre-trained prediction model, the second load prediction information including predicted loads corresponding to the multiple GPU cores; determining second processing capability evaluation values ​​corresponding to the multiple cores based on the first load prediction information and the second load prediction information.

[0074] In this embodiment, the future load information is predicted by combining the pre-trained prediction model with the corresponding load information.

[0075] In some embodiments, the first load prediction information is compared with the second load prediction information, and the larger the difference is, the lower the second processing capacity evaluation value is.

[0076] In the above embodiments, the gap between various information may be a gap in value or a gap represented by similarity. For details, reference may be made to mature data processing technologies in the art, which will not be described in detail here.

[0077] The pre-trained prediction model may be an unsupervised model based on time series, whose training samples are changing load information. By training the model with changing load information, the model may have the ability to predict load information.

[0078] In addition, the aforementioned evaluation model is a supervised model, which can be a large model, or other implementable neural network model.

[0079] As an optional implementation, training of the prediction model includes: obtaining a second training data set, the second training data set including multiple second samples and multiple third samples, each second sample including sample load information of multiple cores when performing 3D graphics processing tasks, and each third sample including sample load information of multiple cores when performing non-3D graphics processing tasks; determining load change rates corresponding to the multiple second samples, and determining load change rates corresponding to the multiple third samples; determining a first sub-sample from the multiple second samples, and determining a second sub-sample from the multiple third samples according to the load change rates corresponding to the multiple second samples and the load change rates corresponding to the multiple third samples; training the prediction model to be trained according to the first sub-sample and the second sub-sample to obtain a pre-trained prediction model.

[0080] In this implementation, two types of sample load information may be collected when the multiple cores execute 3D graphics processing tasks and non-3D graphics processing tasks.

[0081] The load change rate is analyzed by using these two types of sample load information. The load change rate can be determined by analyzing and calculating the loads corresponding to multiple time points, and specific reference can be made to mature technologies in the art, which characterize the load change.

[0082] Further, determining a first sub-sample from the multiple second samples and determining a second sub-sample from the multiple third samples based on the load change rates respectively corresponding to the multiple second samples and the load change rates respectively corresponding to the multiple third samples may include: taking samples with a load change rate higher than a threshold as the first sub-sample, and taking samples with a load change rate lower than the threshold as the second sub-sample.

[0083] The threshold value may be set according to different application scenarios, for example, it may be 50%.

[0084] Alternatively, determining a first sub-sample from a plurality of second samples and determining a second sub-sample from a plurality of third samples according to the load change rates respectively corresponding to the plurality of second samples and the load change rates respectively corresponding to the plurality of third samples may include: comparing the difference between the load change rates of each second sample and each third sample, taking the second sample and the third sample having the smaller difference in load change rate as the first sub-sample, and taking the second sample and the third sample having the larger difference in load change rate as the second sub-sample.

[0085] Regarding the judgment of the load change rate difference, a range can be set. For example, if the load change rate difference is within 10%, it is considered to be a small difference, otherwise, it is considered to be a large difference.

[0086] Furthermore, a first sub-sample and a second sub-sample may be obtained. These two samples may be regarded as comparison samples and are difference samples based on the load change rate.

[0087] Furthermore, the first sub-sample and the second sub-sample may be used to perform cross-comparison training on the prediction model to be trained, so as to improve the generalization ability of the model.

[0088] Through this implementation, the load information capability of the prediction model can be made stronger, thereby obtaining more accurate first load prediction information and second load prediction information.

[0089] Furthermore, in step S24, a corresponding multi-thread processing strategy of the 3D graphics processing task is determined according to the first evaluation information and the second evaluation information.

[0090] In some embodiments, the multithreading strategy may represent a task allocation method and a load adjustment strategy.

[0091] Therefore, as an optional implementation, step S24 includes: dividing the 3D graphics processing task into multiple sub-processing tasks according to the first evaluation information; determining the sub-task information corresponding to the multiple sub-processing tasks; determining the cores corresponding to the multiple sub-processing tasks according to the second evaluation information and the sub-task information corresponding to the multiple sub-processing tasks; determining the load adjustment strategy corresponding to the multiple cores according to the first evaluation information and the second evaluation information; determining the multi-threaded processing strategy according to the multiple sub-processing tasks, the cores corresponding to the multiple sub-processing tasks, and the load adjustment strategy corresponding to the multiple cores.

[0092] In this implementation, the 3D graphics processing task may be divided into a plurality of sub-processing tasks based on the first evaluation information.

[0093] In some embodiments, the first evaluation information can determine the number of multiple sub-processing tasks and the amount of data of each sub-processing task. For example, the higher the processing weight, the greater the number of multiple sub-processing tasks, and the smaller the amount of data of each sub-processing task. Furthermore, graphics rendering tasks, texture mapping tasks, and mapping tasks, etc. can be divided into multi-threaded sub-processing tasks. Regarding the specific division method of tasks, reference can be made to mature technologies in the field. For example, a division method based on arrays, vectors, sequences, etc. can be adopted to implement task division according to corresponding rules.

[0094] In some embodiments, the subtask information corresponding to the plurality of sub-processing tasks may be: task complexity (difficulty) and task importance. The determination method of the subtask information may refer to the determination method of the target task information, except that it is for each subtask.

[0095] Furthermore, the cores corresponding to the multiple sub-processing tasks may be determined according to the second evaluation information and the sub-task information corresponding to the multiple sub-processing tasks.

[0096] In some embodiments, the stronger the processing capability of the core is, the higher the task difficulty and task importance in the corresponding subtask information are.

[0097] Therefore, task information adapted to various processing capabilities may be pre-configured, and cores corresponding to a plurality of sub-processing tasks may be determined based on the pre-configured information.

[0098] Regarding the load adjustment strategy, it can be used to adjust the load during task execution.

[0099] In some embodiments, based on the first evaluation information and the second evaluation information, a load adjustment strategy corresponding to the multiple cores is determined, including: based on the first evaluation information and the second evaluation information, judging whether the respective processing capabilities of the multiple cores match the processing weight of the 3D graphics processing task; if the respective processing capabilities of the multiple cores match the processing weight of the 3D graphics processing task, determining that the load adjustment strategy corresponding to the multiple cores is a first adjustment strategy, in which the loads corresponding to the multiple cores are adjusted after each preset period; if the respective processing capabilities of the multiple cores do not match the processing weight of the 3D graphics processing task, determining that the load adjustment strategy corresponding to the multiple cores is a second adjustment strategy, in which the loads corresponding to the multiple cores are adjusted each time a preset number of sub-processing is detected to be completed.

[0100] In this embodiment, the highest processing capability and the lowest processing capability among the processing capabilities of the multiple cores can be determined. If any of the processing capabilities matches the processing weight of the 3D graphics processing task, the processing capabilities of the multiple cores are deemed to match the processing weight of the 3D graphics processing task.

[0101] In some embodiments, processing capabilities adapted to different processing weights may be pre-configured, and a match determination may be made based on the pre-configured information.

[0102] In some embodiments, in the case of matching, the frequency of load adjustment can be reduced, so load adjustment can be performed according to a preset period, wherein the preset period can be set according to different application scenarios and is not limited here.

[0103] In some embodiments, in the case of mismatch, a higher load adjustment frequency needs to be ensured to avoid CPU overload. Therefore, when a preset number of sub-processing tasks are detected to be completed, the loads corresponding to the multiple cores can be adjusted.

[0104] The preset number may be determined according to the number of cores. For example, if the number of cores is 10, the preset number may be a value between 1 and 3.

[0105] It can be understood that the load adjustment needs to be performed every time when it is detected that a preset number of sub-processing tasks are completed, rather than just once.

[0106] Further, in step S25, executing the 3D graphics processing task through multiple cores according to the multi-threaded processing strategy may include: allocating multiple sub-processing tasks to the cores corresponding to the multiple sub-processing tasks; executing the corresponding sub-processing tasks through the cores corresponding to the multiple sub-processing tasks; during the task execution process, adjusting the load corresponding to at least some of the multiple cores according to the load adjustment strategy corresponding to the multiple cores.

[0107] In this implementation, the sub-processing tasks are divided accordingly and then executed by each core. In addition, during the task execution process, the load corresponding to at least some of the multiple cores can be adjusted according to the load adjustment strategy corresponding to the multiple cores.

[0108] In some embodiments, the load adjustment strategy is only used to determine the load adjustment timing. Specific load adjustment methods may include, for example, load splitting, load transfer, and load redistribution.

[0109] Figure 3 is an operation block diagram of a CPU according to an exemplary embodiment. Figure 3 As shown, when receiving a 3D graphics processing task, a multi-thread processing strategy is first formulated. Then, tasks are allocated according to the multi-thread processing strategy. Next, in the process of executing tasks by multiple cores and multiple threads, load adjustment is required in corresponding situations.

[0110] Furthermore, in different scenarios, after executing the 3D graphics processing task, corresponding feedback can be provided according to the specific execution situation.

[0111] As an example, in a 3D rendering scenario, the 3D graphics processing task is a 3D graphics rendering task, and the method may further include: in response to detecting that the 3D graphics processing task is completed within a preset time length, obtaining 3D graphics rendering information, and adding first identification information to the rendered 3D graphics according to the 3D graphics rendering information, the first identification information being used to characterize the rendering quality of the 3D graphics; in response to not detecting that the 3D graphics processing task is completed within the preset time length, obtaining the 3D image rendering progress, and adding second identification information to the rendered 3D graphics according to the 3D graphics rendering progress, the second identification information being used to characterize the rendering progress of the 3D graphics.

[0112] In this implementation, the completion of the 3D graphics processing task can be understood as each core completing the corresponding sub-processing task.

[0113] In some embodiments, the preset duration may be an estimated task execution duration, and no specific value is limited herein.

[0114] In some embodiments, the 3D graphics rendering information may be information related to the rendering quality of the 3D graphics, such as the frame rate and smoothness of the 3D graphics, and the rendered 3D graphics may be directly detected and determined.

[0115] Furthermore, based on the rendering information, first identification information may be added to indicate the rendering quality. The first identification information may be a quality level, such as level A, level B, etc. The higher the level, the better the quality.

[0116] In some embodiments, the 3D graphics rendering progress may be the completion progress of the sub-processing tasks, for example, there are 100 sub-processing tasks in total, and 80 are currently completed, then the progress is 80%. Furthermore, the rendering progress may be represented by the second identification information.

[0117] Figure 4 is a schematic diagram of a 3D rendering result according to an exemplary embodiment. Figure 4 As shown in the figure, in this rendering scene, there are two types of 3D graphics that need to be rendered, corresponding to different 3D graphics processing tasks. For the first type of graphics, the rendering has been completed, so the rendering level is displayed. For the second type of image, the rendering has not been completed, so the rendering progress is displayed.

[0118] The displayed first identification information and second identification information may be in a variety of optional implementations, which are not limited here.

[0119] Through the technical solution of the embodiment of the present disclosure, the 3D graphics processing task is evaluated through the target task information corresponding to the 3D graphics processing task to obtain the processing weight, and the CPU core is evaluated through the CPU core information to obtain the processing capabilities of multiple cores. The multi-threaded processing strategy is determined by combining the processing weight and the processing capabilities of multiple cores, and then the 3D graphics processing task is executed by multiple cores based on the multi-threaded processing strategy. Since the processing weight is the information analyzed from the perspective of the 3D graphics processing task, and the processing capability is the information analyzed from the perspective of the core information, by combining the two types of information, a more reasonable and suitable multi-threaded processing strategy for the CPU core can be determined. Therefore, by using the multi-threaded processing strategy for task processing, the task processing efficiency can be improved, and the CPU's 3D graphics task acceleration can be achieved. Therefore, this technical solution can achieve CPU multi-threaded 3D graphics acceleration based on a non-3D GPU embedded chip, and improve the CPU's 3D graphics processing efficiency.

[0120] Figure 5 is a block diagram of a device for CPU multi-threaded 3D graphics acceleration based on a non-3D GPU embedded chip according to an exemplary embodiment, such as Figure 4 As shown, the device comprises: The acquisition module 501 is used to acquire target task information and CPU core information corresponding to the 3D graphics processing task.

[0121] The evaluation module 502 is used to evaluate the 3D graphics processing task according to the target task information to obtain first evaluation information, wherein the first evaluation information is used to characterize the processing weight of the 3D graphics processing task; and to evaluate the multiple cores of the CPU according to the CPU core information to obtain second evaluation information, wherein the second evaluation information is used to characterize the processing capabilities of the multiple cores respectively.

[0122] The processing module 503 is used to determine the corresponding multi-thread processing strategy of the 3D graphics processing task according to the first evaluation information and the second evaluation information; and execute the 3D graphics processing task according to the multi-thread processing strategy through the multiple cores.

[0123] Regarding the device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.

[0124] Figure 6 FIG. 6 is a block diagram of an electronic device 600 according to an exemplary embodiment. Figure 6 As shown, the electronic device 600 may include: a processor 601 , a memory 602 . The electronic device 600 may also include one or more of a multimedia component 603 , an input / output (I / O) interface 604 , and a communication component 605 .

[0125] The processor 601 is used to control the overall operation of the electronic device 600 to complete all or part of the steps in the method for CPU multi-threaded 3D graphics acceleration based on a non-3D GPU embedded chip. The memory 602 is used to store various types of data to support the operation of the electronic device 600, and these data may include, for example, instructions for any application or method used to operate on the electronic device 600, and application-related data, such as contact data, sent and received messages, pictures, audio, video, etc. The memory 602 can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (Static Random Access Memory, referred to as SRAM), electrically erasable programmable read-only memory (Electrically Erasable Programmable Read-Only Memory, referred to as EEPROM), erasable programmable read-only memory (Erasable Programmable Read-Only Memory, referred to as EPROM), programmable read-only memory (Programmable Read-Only Memory, referred to as PROM), read-only memory (Read-Only Memory, referred to as ROM), magnetic memory, flash memory, magnetic disk or optical disk. The multimedia component 603 may include a screen and an audio component. The screen may be, for example, a touch screen, and the audio component is used to output and / or input audio signals. For example, the audio component may include a microphone, which is used to receive external audio signals. The received audio signal may be further stored in the memory 602 or sent through the communication component 605. The audio component also includes at least one speaker for outputting audio signals. The I / O interface 604 provides an interface between the processor 601 and other interface modules, and the above-mentioned other interface modules may be keyboards, mice, buttons, etc. These buttons may be virtual buttons or physical buttons. The communication component 605 is used for wired or wireless communication between the electronic device 600 and other devices. Wireless communication, such as Wi-Fi, Bluetooth, Near Field Communication (NFC), 2G, 3G, 4G, NB-IOT, eMTC, or other 5G, etc., or a combination of one or more of them, is not limited here. Therefore, the corresponding communication component 605 may include: Wi-Fi module, Bluetooth module, NFC module, etc.

[0126] In an exemplary embodiment, the electronic device 600 can be implemented by one or more application specific integrated circuits (ASIC), digital signal processors (DSP), digital signal processing devices (DSPD), programmable logic devices (PLD), field programmable gate arrays (FPGA), controllers, microcontrollers, microprocessors or other electronic components to execute the above-mentioned method of CPU multi-threaded 3D graphics acceleration based on a non-3D GPU embedded chip.

[0127] In another exemplary embodiment, a computer-readable storage medium including program instructions is also provided, and when the program instructions are executed by a processor, the steps of the method for CPU multi-threaded 3D graphics acceleration based on a non-3D GPU embedded chip are implemented. For example, the computer-readable storage medium may be the memory 602 including the program instructions, and the program instructions may be executed by a processor 601 of an electronic device 600 to complete the method for CPU multi-threaded 3D graphics acceleration based on a non-3D GPU embedded chip.

[0128] The preferred embodiments of the present disclosure are described in detail above in conjunction with the accompanying drawings; however, the present disclosure is not limited to the specific details in the above embodiments. Within the technical concept of the present disclosure, a variety of simple modifications can be made to the technical solution of the present disclosure, and these simple modifications all fall within the protection scope of the present disclosure.

[0129] It should also be noted that the various specific technical features described in the above specific embodiments can be combined in any suitable manner without contradiction. In order to avoid unnecessary repetition, the present disclosure will not further describe various possible combinations.

[0130] In addition, various embodiments of the present disclosure may be arbitrarily combined, and as long as they do not violate the concept of the present disclosure, they should also be regarded as the contents disclosed by the present disclosure.

Claims

1. A method for CPU multi-threaded 3D graphics acceleration based on a non-3D GPU embedded chip, characterized in that: include: Get the target task information and CPU core information corresponding to the 3D graphics processing task; According to the target task information, the 3D graphics processing task is evaluated to obtain first evaluation information, where the first evaluation information is used to characterize a processing weight of the 3D graphics processing task; According to the CPU core information, multiple cores of the CPU are evaluated to obtain second evaluation information, where the second evaluation information is used to characterize the processing capabilities of the multiple cores respectively; Determining a corresponding multi-thread processing strategy for the 3D graphics processing task according to the first evaluation information and the second evaluation information; The 3D graphics processing task is executed by the multiple cores according to the multi-thread processing strategy.

2. The method according to claim 1, characterized in that The step of evaluating the 3D graphics processing task according to the target task information to obtain first evaluation information includes: Determining a first processing weight according to the target task information and pre-configured task information, wherein the pre-configured task information is task information that matches the CPU capability; Determining a second processing weight according to the target task information and a pre-trained evaluation model, wherein the pre-trained evaluation model is used to output the second processing weight according to the input target task information; First evaluation information for characterizing a target processing weight of the 3D graphics processing task is obtained according to the first processing weight and the second processing weight.

3. The method according to claim 2, characterized in that The method further comprises: Acquire a first training data set, wherein the first training data set includes a plurality of first training samples, each of the first training samples includes sample task information and a sample processing weight, wherein the sample task information is task information determined from a 3D graphics processing task executed by an external GPU, and the sample processing weight is determined by analyzing a real execution result of the external GPU for the 3D graphics processing task; Determining a sample weight corresponding to the first training data set according to the external GPU core information and the CPU core information; The evaluation model to be trained is trained according to the first training data set and the sample weights corresponding to the first training data set to obtain the pre-trained evaluation model.

4. The method according to claim 1, characterized in that: The CPU core information includes: historical load information corresponding to the multiple cores respectively, and the multiple cores of the CPU are evaluated according to the CPU core information to obtain second evaluation information, including: According to the historical load information and pre-configured load information respectively corresponding to the multiple cores, the multiple cores are evaluated respectively to obtain first processing capacity evaluation values ​​respectively corresponding to the multiple cores; Acquire external GPU core information, where the external GPU core information includes real load change information corresponding to multiple GPU cores when the GPU performs 3D graphics processing; According to the external GPU core information and the historical load information corresponding to the multiple cores, the multiple cores are evaluated respectively to obtain second processing capacity evaluation values ​​corresponding to the multiple cores respectively; The second evaluation information is determined according to the first processing capability evaluation value and the second processing capability evaluation value, wherein the second evaluation information includes target processing capability evaluation values ​​corresponding to the plurality of cores respectively.

5. The method according to claim 4, characterized in that The step of evaluating the multiple cores respectively according to the external GPU core information and the historical load information respectively corresponding to the multiple cores to obtain the second processing capability evaluation values ​​respectively corresponding to the multiple cores includes: Determine first load prediction information according to historical load information respectively corresponding to the multiple cores and a pre-trained prediction model, wherein the first load prediction information includes predicted loads respectively corresponding to the multiple cores; Determine second load prediction information according to the external GPU core information and the pre-trained prediction model, wherein the second load prediction information includes predicted loads corresponding to the multiple GPU cores respectively; Determine second processing capability evaluation values ​​corresponding to the plurality of cores respectively according to the first load prediction information and the second load prediction information.

6. The method according to claim 5, characterized in that The method further comprises: Acquire a second training data set, wherein the second training data set includes a plurality of second samples and a plurality of third samples, each of the second samples includes sample load information of a plurality of cores when performing a 3D graphics processing task, and each of the third samples includes sample load information of a plurality of cores when performing a non-3D graphics processing task; Determine the load change rates corresponding to the plurality of second samples respectively, and determine the load change rates corresponding to the plurality of third samples respectively; Determine a first subsample from the plurality of second samples and a second subsample from the plurality of third samples according to the load change rates respectively corresponding to the plurality of second samples and the load change rates respectively corresponding to the plurality of third samples; The prediction model to be trained is trained according to the first sub-sample and the second sub-sample to obtain the pre-trained prediction model.

7. The method according to claim 1, characterized in that The determining, according to the first evaluation information and the second evaluation information, a corresponding multi-thread processing strategy for the 3D graphics processing task includes: dividing the 3D graphics processing task into a plurality of sub-processing tasks according to the first evaluation information; Determine subtask information corresponding to each of the plurality of sub-processing tasks; Determining the cores corresponding to the plurality of sub-processing tasks respectively according to the second evaluation information and the sub-task information corresponding to the plurality of sub-processing tasks respectively; Determining load adjustment strategies corresponding to the multiple cores according to the first evaluation information and the second evaluation information; The multithread processing strategy is determined according to the multiple sub-processing tasks, the cores corresponding to the multiple sub-processing tasks respectively, and the load adjustment strategies corresponding to the multiple cores.

8. The method according to claim 7, characterized in that The determining, according to the first evaluation information and the second evaluation information, load adjustment strategies corresponding to the multiple cores includes: determining, according to the first evaluation information and the second evaluation information, whether the processing capabilities of the plurality of cores respectively match the processing weight of the 3D graphics processing task; If the processing capabilities of the multiple cores match the processing weights of the 3D graphics processing tasks, determine that the load adjustment strategies corresponding to the multiple cores are the first adjustment strategies, in which the loads corresponding to the multiple cores are adjusted every preset period; If the respective processing capabilities of the multiple cores do not match the processing weights of the 3D graphics processing tasks, the load adjustment strategies corresponding to the multiple cores are determined to be the second adjustment strategy. In the second adjustment strategy, each time a preset number of sub-processing tasks are detected to be completed, the loads corresponding to the multiple cores are adjusted.

9. The method according to claim 7, characterized in that: The executing the 3D graphics processing task by the multiple cores according to the multi-thread processing strategy includes: Allocating the plurality of sub-processing tasks to cores corresponding to the plurality of sub-processing tasks respectively; Executing corresponding sub-processing tasks through cores corresponding to the multiple sub-processing tasks respectively; During the task execution process, the loads corresponding to at least some of the multiple cores are adjusted according to the load adjustment strategies corresponding to the multiple cores.

10. The method according to claim 1, characterized in that The 3D graphics processing task is a 3D graphics rendering task, and the method further includes: In response to detecting that the 3D graphics processing task is completed within a preset time, acquiring 3D graphics rendering information, and adding first identification information to the rendered 3D graphics according to the 3D graphics rendering information, wherein the first identification information is used to characterize the rendering quality of the 3D graphics; In response to not detecting that the 3D graphics processing task is completed within a preset time, obtaining a 3D image rendering progress, and adding second identification information to the rendered 3D graphics according to the 3D graphics rendering progress, wherein the second identification information is used to characterize the rendering progress of the 3D graphics.

Citation Information

Patent Citations

  • Multithread realization method for rasterization stage in graphic rendering

    CN102736947A