Target object processing method, device and electronic device

By running multiple preset processing algorithms in parallel, the problem of long processing time-consuming caused by serial operation of multiple algorithms in the prior art is solved, and efficient processing of target objects is achieved.

CN114968564BActive Publication Date: 2025-02-07GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202210533507.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-05-13
Publication Date
2025-02-07
Estimated Expiration
2042-05-13

AI Technical Summary

Technical Problem

When the prior art uses different algorithm combinations to perform calculation processing on objects to be processed, there is still room for improvement in processing efficiency, especially when multiple algorithms are run in serial, resulting in a long overall processing time.

Method used

A target object processing method is proposed. By responding to the start trigger condition, the first and second preset processing algorithms are selected from multiple preset processing algorithms, and these algorithms are run in parallel; after the first preset processing algorithm is completed, the first preset processing algorithm is selected. The three preset processing algorithms perform calculation and processing on the data generated by the first preset processing algorithm.

Benefits of technology

By running multiple preset processing algorithms in parallel, the overall processing time of the target object is shortened and processing efficiency is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114968564B_ABST
    Figure CN114968564B_ABST
Patent Text Reader

Abstract

The embodiments of the present application disclose a method, device and electronic device for processing a target object. The method includes: in response to receiving a start trigger condition for the current processing process of the target object, selecting a first preset processing algorithm and a second preset processing algorithm from multiple preset processing algorithms; running the selected first preset processing algorithm and the second preset processing algorithm in parallel; in response to receiving an end trigger condition for the first preset processing algorithm for the current processing process of the target object, selecting a third preset processing algorithm from multiple preset processing algorithms, running the selected third preset processing algorithm, wherein the third preset processing algorithm performs calculation processing on the data generated by the first preset processing algorithm. Thus, the above method reduces the time consumption of the corresponding processing of the target object and improves the processing efficiency of the target object.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and more specifically, to a target object processing method, device and electronic device. Background Art

[0002] With the advancement of technology, electronic devices have increasingly powerful computing and storage capabilities, and can support complex calculations for objects to be processed. For example, electronic devices need to use a combination of different algorithms to perform computational processing on objects to be processed, such as images or texts, to obtain the desired improvement, such as improving the imaging quality of objects to be processed, such as images or texts, and identifying and extracting objects to be processed, such as images or texts. When electronic devices use a combination of different algorithms to perform computational processing on objects to be processed, such as images or texts, there is still room for improvement in processing efficiency. Summary of the invention

[0003] In view of the above problems, the present application proposes a target object processing method, device and electronic device to improve the above problems.

[0004] In a first aspect, the present application provides a target object processing method, which is applied to an electronic device, and the method comprises: in response to receiving a start trigger condition for a current processing process of the target object, selecting a first preset processing algorithm and a second preset processing algorithm from a plurality of preset processing algorithms; running the selected first preset processing algorithm and the second preset processing algorithm in parallel; in response to receiving an end trigger condition for the first preset processing algorithm for the current processing process of the target object, selecting a third preset processing algorithm from a plurality of preset processing algorithms, and running the selected third preset processing algorithm, wherein the third preset processing algorithm performs calculations on the data generated by the first preset processing algorithm.

[0005] In the second aspect, the present application provides a target object processing method, which is applied to a server, and the method includes: in response to receiving a start trigger condition for a current processing process of the target object, selecting a first preset processing algorithm and a second preset processing algorithm from multiple preset processing algorithms; running the selected first preset processing algorithm and the second preset processing algorithm in parallel; in response to receiving an end trigger condition for the first preset processing algorithm for the current processing process of the target object, selecting a third preset processing algorithm from multiple preset processing algorithms, and running the selected third preset processing algorithm, wherein the third preset processing algorithm performs calculations on the data generated by the first preset processing algorithm.

[0006] In a third aspect, the present application provides a target object processing device that runs on an electronic device, the device comprising: an algorithm determination unit, for selecting a first preset processing algorithm and a second preset processing algorithm from a plurality of preset processing algorithms in response to receiving a start trigger condition for a current processing process of the target object; an algorithm execution unit, for running the selected first preset processing algorithm and the second preset processing algorithm in parallel; the algorithm determination unit is also used to select a third preset processing algorithm from a plurality of preset processing algorithms in response to receiving an end trigger condition for the first preset processing algorithm for the current processing process of the target object, the algorithm execution unit is also used to run the selected third preset processing algorithm, wherein the third preset processing algorithm performs calculations on data generated by the first preset processing algorithm.

[0007] In a fourth aspect, the present application provides an electronic device comprising one or more processors and a memory; one or more programs are stored in the memory and configured to be executed by the one or more processors, and the one or more programs are configured to execute the above-mentioned method.

[0008] In a fifth aspect, the present application provides a computer-readable storage medium, in which program code is stored, wherein the above method is executed when the program code is run.

[0009] The present application provides a method, device and electronic device for processing a target object. In response to receiving a start trigger condition for the current processing process of the target object, a first preset processing algorithm and a second preset processing algorithm are selected from multiple preset processing algorithms, and the selected first preset processing algorithm and the second preset processing algorithm are run in parallel. Then, in response to receiving an end trigger condition for the first preset processing algorithm for the current processing process of the target object, a third preset processing algorithm is selected from multiple preset processing algorithms, and the selected third preset processing algorithm is run. Thus, in the above manner, in the process of processing the target object, the first preset processing algorithm and the second preset processing algorithm among the multiple preset processing algorithms corresponding to the target object can be run in parallel, which is conducive to shortening the overall processing time of the target object. BRIEF DESCRIPTION OF THE DRAWINGS

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

[0011] Figure 1A schematic diagram showing an application scenario of the target object processing method proposed in this application is shown;

[0012] Figure 2 Another application scenario schematic diagram of the target object processing method proposed in this application is shown;

[0013] Figure 3 A flow chart of a target object processing method proposed in an embodiment of the present application is shown;

[0014] Figure 4 A schematic diagram showing the interdependence relationship of multiple algorithms corresponding to a target object proposed in an embodiment of the present application;

[0015] Figure 5 A schematic diagram showing the time consumption of running the object processing method proposed in the embodiment of the present application;

[0016] Figure 6 A flow chart showing a target object processing method proposed in another embodiment of the present application is shown;

[0017] Figure 7 A schematic diagram showing that a sub-algorithm proposed in an embodiment of the present application can rely on multiple previous algorithms;

[0018] Figure 8 A flowchart of a target object processing method proposed in another embodiment of the present application is shown;

[0019] Fig. 9 A schematic diagram showing a processing device supported by the algorithm in an embodiment of the present application is shown;

[0020] Fig.10 A structural block diagram of a target object processing device proposed in an embodiment of the present application is shown;

[0021] Fig.11 A structural block diagram of an electronic device proposed in this application is shown;

[0022] Fig.12 It is a storage unit of an embodiment of the present application for storing or carrying program codes for implementing the target object processing method according to an embodiment of the present application. DETAILED DESCRIPTION

[0023] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.

[0024] During operation, electronic devices can obtain a variety of objects. For example, text-type objects can be obtained, and image-type objects can also be obtained. In some cases, electronic devices will process the obtained objects through algorithms, and then perform subsequent operations on the processed objects. For example, when an electronic device is taking pictures, the images directly collected by the camera can be processed by multiple algorithms, and then the images processed by multiple algorithms can be displayed to the user and stored.

[0025] However, the inventors found in their research that in the process of processing objects through multiple algorithms, there is still a problem of efficiency that needs to be improved. For example, in the relevant processing process, when the object to be processed needs to be processed by multiple algorithms, the object to be processed is usually processed in a serial manner through multiple algorithms. The inventors of this application found in their research that among the multiple algorithms corresponding to the object to be processed, some sub-algorithms (for example, an algorithm can be composed of multiple sub-algorithms) included in the algorithm that is run later can actually be run earlier.

[0026] Therefore, the inventor proposed a target object processing method, device and electronic device in the present application, so that through the target object processing method, during the processing of the target object, the first preset processing algorithm and the second preset processing algorithm among the multiple preset processing algorithms corresponding to the target object can run in parallel, thereby helping to shorten the overall processing time of the target object.

[0027] The following first introduces the application scenarios involved in the embodiments of the present application.

[0028] In the embodiment of the present application, the target object processing method provided can be executed by an electronic device. In this way, all steps in the target object processing method provided by the embodiment of the present application can be executed by the electronic device. For example, Figure 1 As shown, in the case where all steps in the target object processing method provided in the embodiment of the present application can be executed by an electronic device, all steps can be executed by the processor of the electronic device 100.

[0029] Furthermore, the target object processing method provided in the embodiment of the present application can also be executed by a server. Correspondingly, in this mode of execution by the server, the server can start executing the steps in the target object processing method provided in the embodiment of the present application in response to the object processing instruction. Among them, the trigger instruction can be sent by the electronic device used by the user, or it can be triggered locally by the server in response to some automation events.

[0030] In addition, the target object processing method provided in the embodiment of the present application can also be executed by the electronic device and the server in collaboration. In this way, some steps of the target object processing method provided in the embodiment of the present application are executed by the electronic device, while other steps are executed by the server. For example, Figure 2 As shown, the electronic device 100 can execute the target object processing method including: in response to the completion of execution of the algorithm corresponding to the previous processing process, determining the algorithm corresponding to the current processing process from multiple algorithms corresponding to the target object based on the algorithm corresponding to the previous processing process, and then transmitting the algorithm corresponding to the current processing process to the server 200, and then the server 200 executes the thread configured to the algorithm corresponding to the current processing process, runs the algorithm corresponding to the current processing process, so as to process the processing result data generated by the previous processing process, and if the algorithm corresponding to the current processing process is completed, the execution completion message is returned to the electronic device 100.

[0031] It should be noted that in this method of collaborative execution by the electronic device and the server, the steps respectively executed by the electronic device and the server are not limited to the methods introduced in the above examples. In actual applications, the steps respectively executed by the electronic device and the server can be dynamically adjusted according to actual conditions.

[0032] It should be noted that the electronic device 100 is Figure 1 and Figure 2 In addition to the smart phone shown in , it can also be a tablet computer, a smart watch, an intelligent voice assistant and other devices. Server 200 can be an independent physical server, or it can be a server cluster or a distributed system composed of multiple physical servers. In the case where the target object processing method provided in the embodiment of the present application is executed by a server cluster or a distributed system composed of multiple physical servers, different steps in the target object processing method can be executed by different physical servers respectively, or can be executed in a distributed manner by a server built based on a distributed system.

[0033] In order to facilitate a better understanding of the embodiments of the present application, some concepts involved in the embodiments of the present application are first explained below.

[0034] Data that the algorithm depends on: The data that the algorithm depends on represents the data that the algorithm needs during its operation. The required data can be understood as the data that is input into the algorithm during its operation.

[0035] Algorithm splitting: In the embodiment of the present application, algorithm splitting can be understood as splitting an algorithm into multiple sub-algorithms. Among them, the split algorithm can be composed of multiple algorithms, wherein the multiple algorithms can be understood as sub-algorithms of the split algorithm. Exemplarily, algorithm D is composed of algorithm D1, algorithm D2 and algorithm D3, then algorithm D1, algorithm D2 and algorithm D3 can all be used as sub-algorithms of algorithm D.

[0036] The embodiments of the present application will be described below with reference to the accompanying drawings.

[0037] See also Figure 3 The present application provides a target object processing method, which is applied to an electronic device, and the method includes:

[0038] S110: In response to receiving a start trigger condition for a current processing process of a target object, selecting a first preset processing algorithm and a second preset processing algorithm from a plurality of preset processing algorithms.

[0039] There may be multiple situations for the start trigger condition. Optionally, if the current processing process is the first processing process, the start trigger condition may be obtaining the target object. Optionally, if the current processing process is not the first processing process (for example, the second processing process or a subsequent processing process), the start trigger condition may include the completion of the execution of the preset processing algorithm in the previous processing process, or may include obtaining the data output by the previous processing process. Correspondingly, the first preset processing algorithm and the second preset processing algorithm selected from multiple preset processing algorithms may be algorithms for running in the current processing process.

[0040] In the embodiment of the present application, the electronic device processes the target object using a combination of different algorithms to obtain the desired improvement. The target object may include multiple types, for example, the target object may be text or an image (picture or video). The specific type of the target object may be determined according to the scenario to which the target object processing method is applied.

[0041] In one way, the target object processing method provided by the embodiment of the present application can be applied to the image acquisition scene. In this case, the target object can include the image acquired by the camera of the electronic device (it can also be an image stored in the electronic device or an image received from the server side, which is not limited here). Correspondingly, the electronic device can respond to the camera to acquire the image and start to process the image multiple times based on multiple preset processing algorithms corresponding to the image. In one way, the target object processing method provided by the embodiment of the present application can be applied to the text recognition scene. For example, after the electronic device acquires the voice content through the microphone and converts the voice content into the corresponding text, in order to determine the semantics to be expressed by the text, the text can be processed by the algorithm multiple times. In this case, the target object in the embodiment of the present application can be understood as the text to be semantically understood. Correspondingly, the electronic device can respond to the text converted from the voice content and start to process the text multiple times based on multiple preset processing algorithms corresponding to the text. In other embodiments, the text content extracted after recognition in the image can also be used as the target object.

[0042] In addition, it should be noted that the target object may be an object that has not been processed, such as a picture collected by a camera of an electronic device. Furthermore, the target object may also be an object that has been processed by a specified algorithm, and the specified algorithm is different from the multiple preset processing algorithms corresponding to the target object.

[0043] In the embodiment of the present application, multiple preset processing algorithms are algorithms for processing the target object. It should be noted that the multiple preset processing algorithms for processing the target object can be understood as being used to directly process the target object and to process the intermediate processing result data obtained by the target object being processed by a preset processing algorithm. Exemplarily, the multiple preset processing algorithms corresponding to the target object X include algorithm A, algorithm B1, algorithm B2 and algorithm C. Among them, algorithm A is used to directly process the target object X, algorithm B1 is used to process the intermediate result data obtained by the algorithm A processing the target object, and algorithm B2 is also used to process the intermediate result data obtained by the algorithm A processing the target object, wherein the intermediate result data output after the algorithm B1 is run is object X1, and the intermediate result data output after the algorithm B2 is run is data X2, and algorithm C can process the object X1 based on data X2 to obtain the final object. From this example, it can be seen that among the multiple preset processing algorithms corresponding to the target object, some preset processing algorithms directly process the target object, while some preset processing algorithms process the intermediate data in the processing process.

[0044] In an embodiment of the present application, the multiple preset processing algorithms corresponding to the target object can be obtained by splitting the multiple initial processing algorithms corresponding to the target object. Among them, the execution order of the multiple initial processing algorithms corresponding to the target object is serial execution. Then in the process of executing multiple initial processing algorithms, there will be no situation where multiple initial processing algorithms are executed in parallel. For example, the multiple initial processing algorithms corresponding to the target object include initial processing algorithm A, initial processing algorithm B and initial processing algorithm C. Among them, initial processing algorithm A can be executed first, and initial processing algorithm B can be executed after initial processing algorithm A is completed, and initial processing algorithm C can be executed after initial processing algorithm B is completed. Based on this example, it can be seen that when multiple initial processing algorithms are executed in series, the overall processing time of the target object is equal to the sum of the time consumed by each processing algorithm, and there is still room for improvement in algorithm processing efficiency.

[0045] Among them, the initial processing algorithm as a whole may be composed of multiple sub-algorithms. For example, during the operation of the initial processing algorithm B, the initial processing algorithm B will process the input data in two steps, and the two steps here can correspond to a sub-algorithm respectively. That is, one sub-algorithm B1 is used to execute the first step, and the other sub-algorithm B2 is used to execute the other step. The inventors found in the study that, among the multiple initial processing algorithms corresponding to the target object, some sub-algorithms in the initial processing algorithms that are executed later can actually be executed earlier, without being limited to the execution sequence of the initial processing algorithm to which they belong. It should be noted that, as a way, it is possible to determine whether an algorithm starts to run based on the data that the algorithm depends on, wherein the data that the algorithm depends on can be understood as the data processed during the operation of the algorithm, or it can be data that needs to be input into the algorithm.

[0046] Exemplarily, in the initial processing algorithm A, initial processing algorithm B and initial processing algorithm C corresponding to the target object, the initial processing algorithm B includes sub-algorithm B1 and sub-algorithm B2, wherein sub-algorithm B1 is used to directly process the data output by the initial processing algorithm A, and sub-algorithm B2 is used to extract information from the data output by the initial processing algorithm A. However, the information to be extracted by sub-algorithm B2 during operation can actually be directly extracted from the target object, that is, the data on which the operation of sub-algorithm B2 depends can actually be the target object, and then sub-algorithm B2 can actually run in parallel with the initial processing algorithm A.

[0047] Splitting the multiple initial processing algorithms corresponding to the target object can be understood as splitting each initial processing algorithm separately. Furthermore, some initial processing algorithms may not be split. In this case, for each initial processing algorithm corresponding to the target object, it can be detected whether it can be split based on the data it depends on. For the initial processing algorithms that can be split, they can be split based on the data that the algorithms depend on, and then the splitting of the multiple initial processing algorithms is completed to obtain multiple preset processing algorithms in the actual process of processing the target object. Among them, splitting the multiple initial processing algorithms corresponding to the target object based on the dependent data can be understood as splitting each initial processing algorithm based on the data that each sub-algorithm includes in each initial processing algorithm. Correspondingly, detecting whether the initial processing algorithm can be split based on the dependent data can be understood as determining whether the sub-algorithm included in the initial processing algorithm can be split into an independent algorithm based on the data that the sub-algorithm depends on.

[0048] For example, if the multiple initial processing algorithms corresponding to the target object are initial processing algorithm A, initial processing algorithm B and initial processing algorithm C, after respectively detecting the initial processing algorithm A, initial processing algorithm B and initial processing algorithm C based on the data on which the algorithms depend, it is determined that the initial processing algorithm B can be split into sub-algorithm B1 and sub-algorithm B2, then after splitting the multiple initial processing algorithms corresponding to the target object, the obtained multiple preset processing algorithms corresponding to the target object include the initial processing algorithm A, sub-algorithm B1, sub-algorithm B2 and initial processing algorithm C.

[0049] The execution order of each of the multiple preset processing algorithms corresponding to the obtained target object can be determined based on the algorithms on which they depend. The algorithm that the algorithm running later depends on can be understood as the algorithm that generates the data that the algorithm running later depends on. Therefore, in the embodiment of the present application, when an algorithm is completed, it can further trigger the operation of the algorithm that depends on the completed execution.

[0050] It should be noted that in the embodiment of the present application, multiple initial processing algorithms corresponding to the target object can be split in advance by other devices other than the electronic device to obtain multiple preset processing algorithms corresponding to the target object. Alternatively, after the electronic device obtains multiple initial processing algorithms corresponding to the target object before processing the target object, the electronic device can locally split the multiple initial processing algorithms corresponding to the target object to obtain multiple preset processing algorithms corresponding to the target object.

[0051] S120: Running the selected first preset processing algorithm and the second preset processing algorithm in parallel.

[0052] Among them, in the embodiment of the present application, the parallel operation of the selected first preset processing algorithm and the second preset processing algorithm can be understood as the synchronous triggering to start running the first preset processing algorithm and the second preset processing algorithm, so that the running time of the first preset processing algorithm and the second preset processing algorithm can overlap, thereby shortening the time consumed in the target object processing process.

[0053] S130: In response to receiving an end trigger condition of a first preset processing algorithm for a current processing process of a target object, a third preset processing algorithm is selected from a plurality of preset processing algorithms, and the selected third preset processing algorithm is run, wherein the third preset processing algorithm performs calculations on data generated by the first preset processing algorithm.

[0054] The selected third preset processing algorithm depends on the data generated by the first preset processing algorithm. Therefore, after the first preset processing algorithm is completed, the algorithm determined in the post-processing process is the third preset processing algorithm. The second preset processing algorithm and the third preset processing algorithm can be two algorithms split from the same algorithm. For example, if the second preset processing algorithm and the aforementioned first preset processing algorithm depend on the same data, then the second preset processing algorithm can be run in parallel with the first preset processing algorithm in advance.

[0055] Next, pass Figure 4 and Figure 5 The effect of the target object processing method involved in the embodiment of the present application is described below. Figure 4 As shown, the target object is an image, for example, Figure 4 The a frame image shown in . The a frame image can be processed in parallel by algorithm A, algorithm D and algorithm C1. Among them, algorithm A is used to process the a frame image to obtain the b frame result image, and algorithm C1 and algorithm D can be understood as being used to process any one of the a frame images. After being processed by algorithm A, the b frame result image can be obtained, and then algorithm B can continue to process the b frame result image and the c frame image (an image collected synchronously with the a frame image but in a different format) to obtain an image with the effect of superimposed algorithm B. The image with the effect of superimposed algorithm B will be processed by algorithm C2. In the process of processing the image with the effect of superimposed algorithm B, algorithm C2 will also combine the extracted information i2 output by algorithm C1, so as to be based on Figure 4 The directions indicated by the arrows are processed in sequence to obtain Figure 4 The image shown in the figure superimposed with all the above effects is the final processing result. Figure 4 In the case shown, if the current processing process is to process a frame of image, then the preset processing algorithm selected from the plurality of preset processing algorithms may be algorithm D, algorithm A, and algorithm C1.

[0056] Furthermore, Figure 4 The specific content of the algorithm shown in is not specifically limited in the embodiments of the present application. For example, the algorithm A can be an image noise reduction algorithm, the algorithm C1 can be an image foreground acquisition algorithm, and the algorithm D can be an image background acquisition algorithm.

[0057] It should be noted that in Figure 4 In the algorithm shown, Algorithm C1, Algorithm C2 and Algorithm C3 originally belong to Algorithm C (i.e., Algorithm C1, Algorithm C2 and Algorithm C3 together constitute Algorithm C), and the original execution order of Algorithm C is after Algorithm B. In the embodiment of the present invention, Algorithm C1 can actually be directly executed on Figure 4 Therefore, the execution order of algorithm C1 can be advanced and run in parallel with algorithm A and algorithm D, thereby shortening the overall processing time.

[0058] like Figure 5 As shown, if the multiple initial processing algorithms corresponding to the target object include algorithm A, algorithm B, algorithm C and algorithm D. Among them, algorithm D may include algorithm D1, algorithm D2 and algorithm D3. In which, based on the data on which algorithm D1, algorithm D2 and algorithm D3 depend, it is determined that algorithm D2 can be separated. The overall processing time comparison of the target object can be as follows Figure 5 As shown. Among them, when multiple initial processing algorithms are all executed in series, the overall time consumption is T3-T1, and the multiple preset processing algorithms obtained after the initial processing algorithm is split in the manner provided in the embodiment of the present application include algorithm A, algorithm B, algorithm C, algorithm D1, algorithm D2 and algorithm D3, because algorithm D2 (which can be understood as the second preset processing algorithm) split from algorithm D can be executed in parallel with algorithm A (which can be understood as the first preset processing algorithm), which means that the running time consumption of algorithm D2 and algorithm A overlaps, so the overall processing time consumption is T2-T1. Obviously, T2-T1 is less than T3-T1.

[0059] It should be noted that if the algorithm corresponding to the current processing process (for example, the first preset processing algorithm and the second preset processing algorithm) is executed, the post-processing process corresponding to the algorithm corresponding to the current processing process is entered until multiple algorithms are executed. Among them, after the algorithm corresponding to the current processing process is executed, the algorithm that runs after the algorithm corresponding to the current processing process can be run. It should be noted that if there are multiple algorithms corresponding to the current processing process, if an algorithm is executed in the current processing process, the post-processing process corresponding to the completed algorithm can be entered. Exemplarily, the multiple algorithms corresponding to the target object include algorithm A, algorithm B1, algorithm B2 and algorithm C. If the algorithm determined by the current processing process is algorithm B1 (that is, there is only one algorithm in the current processing process), wherein algorithm C depends on algorithm B1. After the algorithm B1 determined by the current processing process is executed, the post-processing process corresponding to algorithm B1 can be entered, that is, algorithm C that depends on algorithm B1 can be started. If the algorithms determined by the current processing process are Algorithm B1 and Algorithm B2 (that is, there are multiple algorithms in the current processing process), then when Algorithm B1 is executed, it can enter the post-processing process corresponding to Algorithm B1. Correspondingly, when Algorithm B2 is executed, it can enter the post-processing process corresponding to Algorithm B2.

[0060] The present embodiment provides a method for processing a target object. In response to receiving a start trigger condition for the current processing process of the target object, a first preset processing algorithm and a second preset processing algorithm are selected from a plurality of preset processing algorithms, and the selected first preset processing algorithm and the second preset processing algorithm are run in parallel. Then, in response to receiving an end trigger condition for the first preset processing algorithm for the current processing process of the target object, a third preset processing algorithm is selected from a plurality of preset processing algorithms, and the selected third preset processing algorithm is run. Thus, in the above manner, in the processing process of the target object, the first preset processing algorithm and the second preset processing algorithm among the plurality of preset processing algorithms corresponding to the target object can be run in parallel, which is conducive to shortening the overall processing time of the target object.

[0061] See also Figure 6 The present application provides a target object processing method, which is applied to an electronic device, and the method includes:

[0062] S210: In response to receiving a start trigger condition for a current processing process of a target object, selecting a first preset processing algorithm and a second preset processing algorithm from a plurality of preset processing algorithms.

[0063] S220: Running the selected first preset processing algorithm and the second preset processing algorithm in parallel.

[0064] As a method, running the selected first preset processing algorithm and the second preset processing algorithm in parallel includes: configuring corresponding threads for the selected first preset processing algorithm and the second preset processing algorithm respectively, and running the first preset processing algorithm and the second preset processing algorithm in parallel through the threads corresponding to the first preset processing algorithm and the second preset processing algorithm respectively.

[0065] It should be noted that, as can be seen from the above content, the multiple preset processing algorithms corresponding to the target object determine their respective running orders based on algorithm dependency, so there may be multiple algorithms running later that depend on the same algorithm running previously. Therefore, there may be multiple algorithms corresponding to the determined current processing process. Therefore, by configuring corresponding threads for the algorithms running in the current processing process, the algorithms determined in the current processing process can be run in parallel. As a method, when determining the algorithm corresponding to the current processing process, the number of algorithms corresponding to the current processing process can be determined simultaneously. If there are multiple algorithms corresponding to the current processing process, the corresponding threads are configured for the multiple preset processing algorithms corresponding to the current processing process, and the corresponding algorithms are run based on the threads corresponding to the multiple preset processing algorithms to process the processing result data generated in the previous processing process respectively. For example, the aforementioned first preset processing algorithm and the second preset processing algorithm are configured with corresponding threads respectively.

[0066] It should be noted that the more threads running in parallel, the higher the load generated by the electronic device in real time. In some cases, there may be many applications running simultaneously on the electronic device. In this case, if the corresponding threads are still configured for the multiple preset processing algorithms in the current processing process, the load of the electronic device may be further increased, causing the electronic device to freeze. As an improvement, if there are multiple algorithms corresponding to the current processing process, the occupancy degree of the processing device in the electronic device can be obtained. If the occupancy degree of the processing device is lower than the occupancy threshold, the corresponding threads are configured for the multiple preset processing algorithms corresponding to the current processing process. In this way, the electronic device can determine the load of the electronic device according to the occupancy degree of the processing device, and then determine whether to configure the corresponding threads for the multiple preset processing algorithms determined by the current processing process according to the load situation, thereby improving the flexibility in the object processing process and reducing the probability of freezing of the electronic device.

[0067] In the process of obtaining the occupancy degree of the processing device, the processing device for obtaining the occupancy degree may be the processing device corresponding to the algorithm determined by the current processing process. The processing device corresponding to the algorithm may be understood as the processing device that runs the algorithm. For example, if algorithm A is configured to be run by the GPU (Graphics Processing Unit) of the electronic device, then the processing device corresponding to algorithm A is the GPU. The occupancy degree of the processing device may be the utilization rate of the processing device.

[0068] Correspondingly, if there are multiple algorithms corresponding to the current processing process and the occupancy of the processing device is not lower than the occupancy threshold, the number of algorithm threads configured to run the algorithm corresponding to the current processing process is less than the number of algorithms corresponding to the current processing process, so as to reduce the number of algorithms running in parallel. In the case where the number of algorithm threads used to run the algorithm corresponding to the current processing process is less than the number of algorithms corresponding to the current processing process, the specific execution order can be determined based on the algorithm priority of each of the multiple preset processing algorithms corresponding to the current processing process. After determining the execution order of the multiple preset processing algorithms corresponding to the current processing process, it can be run based on the execution order and the configured threads. Exemplarily, the determined algorithms corresponding to the current processing process can be algorithm B1, algorithm B2 and algorithm C, and it is determined that the occupancy of the processing device is not lower than the occupancy threshold, then the number of threads configured for the current processing process can be two, and further, the execution order determined by algorithm B1, algorithm B2 and algorithm C can be to execute algorithm B1 first, then execute algorithm B2 and then execute algorithm C. In this case, algorithm B1 and algorithm B2 can be executed in parallel by the two configured threads first, and when one of the algorithms in algorithm B1 and algorithm B2 is completed, the idle thread will execute algorithm C. When it is determined that the occupancy level of the processing device is not lower than the occupancy threshold, the number of threads of the current processing process may be configured according to the algorithm priority, and threads are preferentially configured for algorithms with high priority.

[0069] Among them, as shown in the above content, if there are multiple algorithms corresponding to the current processing process and the occupancy level of the processing device is not lower than the occupancy threshold, the number of threads configured for the algorithm of the current processing process will be less than the number of algorithms corresponding to the current processing process. In this case, the electronic device can also determine the number of threads configured for the current processing process according to multiple methods.

[0070] As a method, the electronic device can directly determine the number of configured threads according to the number of algorithms in the current processing process. Optionally, the number of algorithms in the current processing process minus a preset value can be used to obtain the number of configured threads. For example, the preset value can be 1.

[0071] As another way, the electronic device can determine the number of configured threads with reference to at least one parameter of the number of applications running on the electronic device and the current remaining power. In this way, if the number of configured threads is determined based on the number of applications running, a corresponding relationship between the number of applications and the number of configured threads can be established, and then the number of configured threads can be determined based on the corresponding relationship between the number of applications and the configured threads. If the number of configured threads is determined based on the current remaining power, a corresponding relationship between the current remaining power and the number of configured threads can be established, and then the number of configured threads can be determined based on the corresponding relationship between the current remaining power and the configured threads. If the number of configured threads is determined based on the number of applications running on the electronic device and the current remaining power, the number of threads corresponding to the number of applications running on the electronic device and the current remaining power can be established.

[0072] S230: In response to receiving an end trigger condition of a first preset processing algorithm for a current processing procedure of the target object, obtaining an algorithm dependency.

[0073] The algorithm dependency relationship represents the algorithms that each of the multiple preset processing algorithms corresponding to the target object depends on, and each preset processing algorithm is executed after the preset processing algorithm it depends on.

[0074] It should be noted that the multiple preset processing algorithms corresponding to each type of target object are different, so the algorithm dependencies corresponding to each type of target object are also different. As a method, the electronic device can pre-store the algorithm dependencies corresponding to each type of object in the electronic device, so that after determining the target object, the algorithm dependencies pre-stored locally can be directly read.

[0075] Furthermore, it should be noted that in the embodiment of the present application, in the process of splitting the initial processing algorithm, the algorithm is split based on the data on which the algorithm depends. The data on which some sub-algorithms depend can be obtained from multiple previous stages. Therefore, there may be multiple algorithms on which the split algorithm depends, which may result in multiple algorithm dependencies.

[0076] For example, Figure 7As shown, algorithm D can be divided into algorithm D1, algorithm D2 and algorithm D3. Among them, for algorithm D1, it can be executed after algorithm A or after algorithm B. In this case, the determined algorithm dependency relationship can be that algorithm B depends on algorithm A, algorithm D1 depends on algorithm A, algorithm C depends on algorithm B, and algorithm D2 and algorithm D3 depend on algorithm C. Furthermore, the determined algorithm dependency relationship can also be that algorithm B depends on algorithm A, algorithm D1 depends on algorithm B, algorithm C depends on algorithm B, and algorithm D2 and algorithm D3 depend on algorithm C. For these two algorithm dependencies, it can be found that when algorithm D1 depends on algorithm A, algorithm D1 and algorithm B (which also depends on algorithm A) will start running synchronously, and when algorithm D1 depends on algorithm B, algorithm D1 will start running synchronously with algorithm C (which also depends on algorithm B). It is understandable that the more algorithms run in parallel, the higher the real-time load of the electronic device. In the two algorithm dependencies shown above, if algorithm D1 and algorithm B are processed in parallel, there will be a higher load during the time when algorithm D1 and algorithm B run in parallel. If algorithm D1 and algorithm C are processed in parallel, there will be a higher load during the time when algorithm D1 and algorithm C run in parallel. In other words, the load changes corresponding to multiple preset processing algorithm dependencies corresponding to the same object are different. The load change corresponding to the algorithm dependency can be understood as the different magnitudes of the load added to the electronic device changing over time during the process of running multiple preset processing algorithms for the target object according to the algorithm dependency.

[0077] Then, if there are multiple preset processing algorithm dependencies corresponding to the target object, and the load changes corresponding to each of them are different, the electronic device can select the algorithm dependency that best matches the current load of the electronic device from the multiple preset processing algorithm dependencies corresponding to the target object, so that the load increased by processing the target object can be staggered with the load increased by running other applications in the electronic device, so as to reduce the instantaneous load of the electronic device, thereby reducing the probability of the electronic device being stuck. For example, taking a photo scene as an example, in some cases, the user will configure the electronic device to synchronously display the image sharing interface after performing the photo operation. In this case, the electronic device will trigger the display of the image sharing interface while controlling the camera to take a photo. Therefore, the load at the beginning of the image acquisition will be relatively larger (after triggering the display of the image sharing interface, because the image sharing interface has been drawn and displayed on the screen, the load of the electronic device will be relatively reduced). Then the electronic device can select the algorithm dependency with a low load increase at the beginning from the multiple preset processing algorithm dependencies corresponding to the image (the image captured by the camera).

[0078] S240: Selecting a third preset processing algorithm from a plurality of preset processing algorithms by acquiring an algorithm dependency relationship, and running the selected third preset processing algorithm, wherein the third preset processing algorithm performs calculation processing on the data generated by the first preset processing algorithm.

[0079] Exemplarily, the multiple preset processing algorithms corresponding to the target object include algorithm A, algorithm B1, and algorithm C. Then the algorithm dependency relationship corresponding to the target object may be: algorithm B1 depends on algorithm A, algorithm B2 depends on algorithm A, and algorithm C depends on algorithm B1. In this case, if the first preset processing algorithm corresponding to the current processing process is algorithm A, then based on the algorithm dependency relationship, the determined third preset processing algorithm may include algorithm B1.

[0080] It should be noted that, when a logic processing thread is established in the electronic device, the operation of the preset processing algorithm and the selection of the preset processing algorithm can be executed by different threads, thereby reducing the operation pressure of a single thread. The operation of the optional preset processing algorithm can be executed by the main thread, and after the main thread completes the operation of the preset processing algorithm for the current processing process, the main thread can call the logic processing thread to select the preset processing algorithm corresponding to the post-processing process.

[0081] As a mode, in response to receiving the end trigger condition of the first preset processing algorithm for the current processing process of the target object, the algorithm dependency is obtained, including: in response to receiving the end trigger condition of the first preset processing algorithm for the current processing process of the target object, triggering the logic processing thread to obtain the algorithm dependency. In this mode, selecting a third preset processing algorithm from multiple preset processing algorithms by obtaining the algorithm dependency includes: obtaining a third preset processing algorithm obtained by the logic processing thread through the algorithm dependency.

[0082] The present embodiment provides a method for processing a target object, so that in the process of processing the target object, the first preset processing algorithm and the second preset processing algorithm among the multiple preset processing algorithms corresponding to the target object can be run in parallel through the above-mentioned method, which is conducive to shortening the overall processing time of the target object. In addition, in the present embodiment, the electronic device can also store an algorithm dependency relationship. When the algorithm dependency relationship represents the dependency relationship of multiple preset processing algorithms corresponding to the target object, the algorithm corresponding to each processing process (for example, the third preset processing algorithm) can be directly determined through the algorithm dependency relationship, which improves the convenience of obtaining the algorithm corresponding to the current processing process. Furthermore, in the embodiment, a logical processing thread is also configured to determine the algorithm corresponding to the current processing process according to the algorithm dependency relationship, so that the operation of the algorithm and the selection of the algorithm can be executed by different threads.

[0083] See also Figure 8 The present application provides a target object processing method, which is applied to an electronic device, and the method includes:

[0084] S310: In response to receiving a start trigger condition for a current processing process of a target object, selecting a first preset processing algorithm and a second preset processing algorithm from a plurality of preset processing algorithms.

[0085] S320: Running the selected first preset processing algorithm and the second preset processing algorithm in parallel.

[0086] S330: In response to receiving an end trigger condition of a first preset processing algorithm for a current processing process of a target object, a third preset processing algorithm is selected from a plurality of preset processing algorithms; if the third preset processing algorithm supports running in a plurality of processing devices, a target processing device is determined from the plurality of processing devices based on respective loads of the plurality of processing devices.

[0087] It should be noted that, when an electronic device includes multiple processing devices, the functions of the multiple processing devices may be different, which will cause different real-time loads of different processing devices. If the instantaneous load of a processing device exceeds the critical load of the processing device or is in a high load state for a period of time, the processing device may have a working error, which will cause the tasks performed by the processing device to fail to run normally.

[0088] In the embodiments of the present application, there may be multiple ways to determine the target processing device.

[0089] As a method, a target processing device is determined from multiple processing devices based on the loads of each of the multiple processing devices, including: if the third preset processing algorithm supports running in multiple processing devices, obtaining the current loads of each of the multiple processing devices; and using the processing device with the smallest corresponding current load as the target processing device.

[0090] Therefore, by using the processing device with the smallest current load among multiple processing devices supported by the algorithm corresponding to the current processing process as the processing device that finally runs the algorithm corresponding to the current processing process, the processing device with the smallest current load can be used to run the algorithm, so that the algorithm corresponding to the current processing process can be processed more efficiently and the utilization rate of the processing devices of the electronic device can also be improved.

[0091] For example, Fig. 9 As shown in FIG. , it is a schematic diagram of the processing devices supported by each of the multiple algorithms corresponding to the target object. Fig. 9As shown, multiple algorithms corresponding to a frame image (a target object) are given as examples, as well as the algorithms on which each of the multiple algorithms depends and the processing devices supported. Among them, the a frame image can be understood as a multi-frame image obtained by the camerahal layer of the electronic device. For example, when a user is taking a photo through an electronic device, multiple frames of images will be continuously captured in response to the user touching the photo control, and the continuously captured multiple frames of images will be reported by the camerahal layer of the electronic device for processing by algorithm A, and the processing device supported by algorithm A is the CPU. Then the CPU of the electronic device will run algorithm A to process the a frame image, and then output the b frame result image.

[0092] After obtaining the b-frame result image, the b-frame result image will be input into algorithm B together with the c-frame image (also a multi-frame image reported by the camerahal layer of the electronic device) and processed by algorithm B. Among them, the processing period supported by algorithm B includes CPU and DSP. In this case, the electronic device can select the one with smaller load from the CPU and DSP to run algorithm B. After algorithm B is fully run, 1 frame of image will be output, and this 1 frame of image is an image with the effect of algorithm B superimposed.

[0093] Among them, algorithm C1 is an algorithm for processing one frame of image in a frame, and the processing devices supported by algorithm C1 include CPU and DSP. In this case, the electronic device can control the processing device with a smaller load in CPU and DSP to run algorithm C1 to process one frame of image in a frame. Correspondingly, algorithm D is also an algorithm for processing one frame of image in a frame, and the processing devices supported by algorithm D include CPU and DSP. In this case, the electronic device can control the processing device with a smaller load in CPU and DSP to run algorithm D to process one frame of image in a frame.

[0094] After Algorithm C1 and Algorithm B are executed, Algorithm C2 will be triggered to run. Among them, the processing devices supported by Algorithm C2 include CPU and NPU. In this case, the electronic device can control the processing devices with smaller loads in CPU and NPU to run Algorithm C2. After Algorithm D and Algorithm B are executed, Algorithm E1 will be triggered to run. Among them, the processing devices supported by Algorithm E1 include CPU and GPU. In this case, the electronic device can control the processing devices with smaller loads in CPU and GPU to run Algorithm E1.

[0095] After the execution of Algorithm E1 and Algorithm C2 is completed, Algorithm C3 will be triggered to run. The processing device supported by Algorithm C3 includes a CPU. In this case, the electronic device can control the CPU to run Algorithm C3. Figure 4It can be seen that the output of algorithm C3 is a fused image. After algorithm C3 is executed, it will trigger the execution of algorithm E2. Similarly, when the processing devices supported by algorithm E2 include CPU and GPU, the electronic device can control the processing devices with smaller load in CPU and GPU to run algorithm E2. After algorithm E2 is completed, the final output image can be obtained.

[0096] For example, if the algorithm corresponding to the determined current processing process is algorithm C1, wherein the processing devices supported by algorithm C1 include CPU and DSP (Digital Signal Processor). In this case, the electronic device can obtain the load of each CPU and DSP before running algorithm C1. If the load of the CPU is less than the load of the DSP, it will be determined to run the algorithm C1 through the CPU. If the load of the CPU is higher than the load of the DSP, it will be determined to run the algorithm C1 through the DSP.

[0097] As another method, a target processing device is determined from a plurality of processing devices based on the loads of the plurality of processing devices, including: if the third preset processing algorithm supports running in a plurality of processing devices, reading a pre-stored estimated load of the plurality of processing devices within a future specified time period, the estimated load being determined based on the current load of the processing device and the application program currently running on the electronic device; and taking the processing device with the smallest corresponding estimated load as the target processing device.

[0098] It should be noted that in an embodiment of the present application, the electronic device can store the real-time load of each of the included processing devices through a pre-configured file. In this case, if it is necessary to obtain the real-time load of a certain processing device, the real-time load of the processing device can be directly read from the file without having to detect the processing device in real time to obtain the corresponding load, thereby improving the speed of obtaining the real-time load.

[0099] S340: Control the target processing device to run a third preset processing algorithm, wherein the third preset processing algorithm performs calculation processing on the data generated by the first preset processing algorithm.

[0100] The present embodiment provides a method for processing a target object, so that in the process of processing the target object, the first preset processing algorithm and the second preset processing algorithm among the multiple preset processing algorithms corresponding to the target object can be run in parallel through the above-mentioned method, so as to help shorten the overall processing time of the target object. Moreover, in the present embodiment, after determining the algorithm corresponding to the current processing process, when the algorithm supports running in multiple processing devices, it can be flexibly determined in which specific processing device to run according to the load of the supported processing device, so as to help select a more suitable processing device for the current processing through the corresponding algorithm, so as to improve the overall speed of the target object processing.

[0101] See also Fig.10 The present application provides a target object processing device 400, which runs on an electronic device. The device 400 includes:

[0102] The algorithm determination unit 410 is used to select a first preset processing algorithm and a second preset processing algorithm from a plurality of preset processing algorithms in response to receiving a start trigger condition for the current processing process of the target object. The algorithm execution unit 420 is used to run the selected first preset processing algorithm and the second preset processing algorithm in parallel.

[0103] The algorithm determination unit 410 is further configured to select a third preset processing algorithm from a plurality of preset processing algorithms in response to receiving an end trigger condition of the first preset processing algorithm for the current processing process of the target object. The algorithm execution unit 420 is further configured to run the selected third preset processing algorithm, wherein the third preset processing algorithm performs calculation processing on the data generated by the first preset processing algorithm.

[0104] The algorithm execution unit 420 is specifically used to determine the target processing device from the multiple processing devices based on the loads of the multiple processing devices if the third preset processing algorithm supports running in multiple processing devices; and control the target processing device to run the third preset processing algorithm. Optionally, the algorithm execution unit 420 is specifically used to obtain the current loads of the multiple processing devices if the third preset processing algorithm supports running in multiple processing devices; and use the corresponding processing device with the smallest current load as the target processing device. Optionally, the algorithm execution unit 420 is specifically used to read the pre-stored estimated loads of the multiple processing devices within a specified future time length if the third preset processing algorithm supports running in multiple processing devices, the estimated loads being determined based on the current loads of the processing devices and the applications currently running on the electronic device; and use the corresponding processing device with the smallest estimated load as the target processing device.

[0105] As a method, the algorithm determination unit 410 is specifically used to obtain the algorithm dependency in response to receiving the end trigger condition of the first preset processing algorithm for the current processing process of the target object; and select a third preset processing algorithm from multiple preset processing algorithms by obtaining the algorithm dependency. Optionally, the algorithm determination unit 410 is specifically used to trigger the logic processing thread to obtain the algorithm dependency in response to receiving the end trigger condition of the first preset processing algorithm for the current processing process of the target object. Correspondingly, it is also specifically used to obtain a third preset processing algorithm obtained by the logic processing thread through the algorithm dependency.

[0106] As a method, the algorithm execution unit 420 is specifically used to configure corresponding threads for the selected first preset processing algorithm and the second preset processing algorithm respectively; the first preset processing algorithm and the second preset processing algorithm are run in parallel through the threads corresponding to the first preset processing algorithm and the second preset processing algorithm respectively. Optionally, the algorithm execution unit 420 is specifically used to obtain the occupancy level of the processing device in the electronic device; if the occupancy level of the processing device is lower than the occupancy threshold, the corresponding threads are respectively configured for the selected first preset processing algorithm and the second preset processing algorithm.

[0107] As a method, the algorithm determination unit 410 is also used to start processing the image multiple times based on multiple algorithms corresponding to the image in response to the camera capturing the image.

[0108] The present embodiment provides a target object processing device, so that in the process of processing the target object, the first preset processing algorithm and the second preset processing algorithm among multiple preset processing algorithms corresponding to the target object can run in parallel through the above-mentioned method, which is beneficial to shorten the overall processing time of the target object.

[0109] The following will be combined Fig.10 An electronic device provided by the present application is described.

[0110] See also Fig.10 Based on the above target object processing method and device, the embodiment of the present application also provides another electronic device 100 that can execute the above terminal control method. The electronic device 100 includes one or more (only one is shown in the figure) processors 102, a memory 104, a network module 106 and an image acquisition device 108 that are coupled to each other. Among them, the memory 104 stores a program that can execute the content of the above embodiment, and the processor 102 can execute the program stored in the memory 104.

[0111] Among them, the processor 102 may include one or more processing cores. The processor 102 uses various interfaces and lines to connect various parts of the entire electronic device 100, and executes various functions and processes data of the electronic device 100 by running or executing instructions, programs, code sets or instruction sets stored in the memory 104, and calling data stored in the memory 104. Optionally, the processor 102 can be implemented in at least one hardware form of digital signal processing (Digital Signal Processing, DSP), field programmable gate array (Field-Programmable Gate Array, FPGA), and programmable logic array (Programmable Logic Array, PLA). The processor 102 can integrate one or a combination of a central processing unit (Central Processing Unit, CPU), a graphics processing unit (Graphics Processing Unit, GPU) and a modem. Among them, the CPU mainly processes the operating system, user interface and application programs; the GPU is responsible for rendering and drawing display content; and the modem is used to process wireless communications. It can be understood that the above-mentioned modem may not be integrated into the processor 102, but may be implemented separately through a communication chip.

[0112] The memory 104 may include a random access memory (RAM) or a read-only memory (ROM). The memory 104 may be used to store instructions, programs, codes, code sets or instruction sets. The memory 104 may include a program storage area and a data storage area, wherein the program storage area may store instructions for implementing an operating system, instructions for implementing at least one function (such as a touch function, a sound playback function, an image playback function, etc.), instructions for implementing the following various method embodiments, etc. The data storage area may also store data (such as a phone book, audio and video data, chat record data) created by the terminal 100 during use.

[0113] The network module 106 is used to receive and send electromagnetic waves, realize the mutual conversion of electromagnetic waves and electric signals, thereby communicate with a communication network or other equipment, for example, communicate with an audio playback device. The wireless module 106 may include various existing circuit elements for performing these functions, for example, an antenna, a radio frequency transceiver, a digital signal processor, an encryption / decryption chip, a user identity module (SIM) card, a memory, etc. The wireless module 106 may communicate with various networks such as the Internet, an intranet, a wireless network, or communicate with other equipment via a wireless network. The above-mentioned wireless network may include a cellular telephone network, a wireless local area network, or a metropolitan area network.

[0114] Furthermore, the image acquisition device 108 can be used to acquire images. Optionally, the image acquisition device 108 can include a color image acquisition device and a depth image acquisition device.

[0115] Please refer to Fig.11 , which shows a structural block diagram of a computer-readable storage medium provided in an embodiment of the present application. The computer-readable medium 800 stores program codes, which can be called by a processor to execute the method described in the above method embodiment.

[0116] The computer readable storage medium 800 may be an electronic memory such as a flash memory, an EEPROM (electrically erasable programmable read-only memory), an EPROM, a hard disk, or a ROM. Optionally, the computer readable storage medium 800 includes a non-transitory computer-readable storage medium. The computer readable storage medium 800 has storage space for program code 810 that performs any method step in the above method. These program codes can be read from or written to one or more computer program products. The program code 810 can be compressed, for example, in an appropriate form.

[0117] In summary, the target object processing method, device and electronic device provided by the present application can split multiple initial processing algorithms corresponding to the target object based on the data on which the algorithms depend to obtain multiple algorithms corresponding to the target object. In the process of processing the target object, the algorithm corresponding to the previous processing process can be determined from multiple algorithms based on the algorithm corresponding to the previous processing process in response to the completion of the execution of the algorithm corresponding to the previous processing process. The algorithm corresponding to the current processing process is run through the thread configured to the algorithm corresponding to the current processing process to process the processing result data generated by the previous processing process. Thus, in the process of processing the target object, the first preset processing algorithm and the second preset processing algorithm among the multiple preset processing algorithms corresponding to the target object can be run in parallel, which is conducive to shortening the overall processing time of the target object.

[0118] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present application.

Claims

1. A target object processing method, characterized in that: Applied to electronic equipment, the method comprises: In response to receiving a start trigger condition for a current processing process of a target object, a first preset processing algorithm and a second preset processing algorithm are selected from a plurality of preset processing algorithms, wherein if the current processing process is a first processing process, the start trigger condition includes acquiring the target object, and if the current processing process is not a first processing process, the start trigger condition includes the completion of execution of a preset processing algorithm in a previous processing process, wherein the first preset processing algorithm and the second preset processing algorithm rely on the same data; Running the selected first preset processing algorithm and second preset processing algorithm in parallel; In response to receiving an end trigger condition of a first preset processing algorithm for a current processing process of a target object, a third preset processing algorithm is selected from a plurality of preset processing algorithms, and the selected third preset processing algorithm is run, wherein the third preset processing algorithm performs calculations on the data generated by the first preset processing algorithm.

2. The method according to claim 1, characterized in that The running of the selected third preset processing algorithm comprises: If the third preset processing algorithm supports running in a plurality of processing devices, determining a target processing device from the plurality of processing devices based on the loads of the plurality of processing devices respectively; The target processing device is controlled to execute the third preset processing algorithm.

3. The method according to claim 2, characterized in that The determining a target processing device from the plurality of processing devices based on the respective loads of the plurality of processing devices comprises: If the third preset processing algorithm supports running in multiple processing devices, obtaining the current load of each of the multiple processing devices; The corresponding processing device with the smallest current load is used as the target processing device.

4. The method according to claim 2, characterized in that: The determining a target processing device from the plurality of processing devices based on the respective loads of the plurality of processing devices comprises: If the third preset processing algorithm supports running in multiple processing devices, reading pre-stored estimated loads of multiple processing devices within a specified future time period, wherein the estimated loads are determined based on current loads of the processing devices and applications currently running on the electronic device; The processing device with the smallest corresponding estimated load is used as the target processing device.

5. The method according to claim 1, characterized in that The step of selecting a third preset processing algorithm from a plurality of preset processing algorithms in response to receiving an end trigger condition of the first preset processing algorithm for the current processing process of the target object comprises: In response to receiving an end trigger condition of a first preset processing algorithm for a current processing process of the target object, acquiring an algorithm dependency relationship; A third preset processing algorithm is selected from a plurality of preset processing algorithms by obtaining the algorithm dependency relationship.

6. The method according to claim 5, characterized in that The step of obtaining the algorithm dependency in response to receiving an end trigger condition of a first preset processing algorithm for a current processing process of the target object includes: In response to receiving an end trigger condition of a first preset processing algorithm for a current processing process of a target object, triggering a logic processing thread to obtain an algorithm dependency; The step of selecting a third preset processing algorithm from a plurality of preset processing algorithms by acquiring the algorithm dependency relationship comprises: A third preset processing algorithm is obtained by the logic processing thread through the algorithm dependency relationship.

7. The method according to claim 1, characterized in that The parallel operation of the selected first preset processing algorithm and the second preset processing algorithm comprises: respectively configuring corresponding threads for the selected first preset processing algorithm and the second preset processing algorithm; The first preset processing algorithm and the second preset processing algorithm are executed in parallel through threads corresponding to the first preset processing algorithm and the second preset processing algorithm respectively.

8. The method according to claim 7, characterized in that The configuring corresponding threads respectively for the selected first preset processing algorithm and the second preset processing algorithm comprises: Obtaining the occupancy level of a processing device in an electronic device; If the occupancy level of the processing device is lower than the occupancy threshold, corresponding threads are respectively configured for the selected first preset processing algorithm and second preset processing algorithm.

9. The method according to any one of claims 1 to 8, characterized in that: The target object is an image captured by a camera, and in response to receiving a start trigger condition for a current processing process of the target object, before selecting a first preset processing algorithm and a second preset processing algorithm from a plurality of preset processing algorithms, the method further includes: In response to the camera capturing an image, the image is processed multiple times based on multiple algorithms corresponding to the image.

10. A target object processing method, characterized in that: Applied to a server, the method comprises: In response to receiving a start trigger condition for a current processing process of a target object, a first preset processing algorithm and a second preset processing algorithm are selected from a plurality of preset processing algorithms, wherein if the current processing process is a first processing process, the start trigger condition includes acquiring the target object, and if the current processing process is not a first processing process, the start trigger condition includes the completion of execution of a preset processing algorithm in a previous processing process, wherein the first preset processing algorithm and the second preset processing algorithm rely on the same data; Running the selected first preset processing algorithm and second preset processing algorithm in parallel; In response to receiving an end trigger condition of a first preset processing algorithm for a current processing process of a target object, a third preset processing algorithm is selected from a plurality of preset processing algorithms, and the selected third preset processing algorithm is run, wherein the third preset processing algorithm performs calculations on the data generated by the first preset processing algorithm.

11. A target object processing device, characterized in that: Running on an electronic device, the device comprises: an algorithm determination unit, configured to select a first preset processing algorithm and a second preset processing algorithm from a plurality of preset processing algorithms in response to receiving a start trigger condition for a current processing process of a target object, wherein if the current processing process is a first processing process, the start trigger condition includes acquiring the target object, and if the current processing process is not a first processing process, the start trigger condition includes the completion of execution of a preset processing algorithm in a previous processing process, wherein the first preset processing algorithm and the second preset processing algorithm rely on the same data; An algorithm execution unit, configured to execute the selected first preset processing algorithm and second preset processing algorithm in parallel; The algorithm determination unit is further used to select a third preset processing algorithm from multiple preset processing algorithms in response to receiving an end trigger condition of the first preset processing algorithm for the current processing process of the target object, and the algorithm execution unit is further used to run the selected third preset processing algorithm, wherein the third preset processing algorithm performs calculations on the data generated by the first preset processing algorithm.

12. An electronic device, characterized in that: including one or more processors and memory; One or more programs are stored in the memory and configured to be executed by the one or more processors, and the one or more programs are configured to execute the method according to any one of claims 1 to 9.

13. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores program code, wherein when the program code is run, the method according to any one of claims 1 to 9 is executed.

Citation Information

Patent Citations

  • Method and device for determining execution sequence, storage medium and electronic device

    CN111737075A

  • Algorithm scheduling method and system

    CN111988429A