Inspection method, inspection device, electronic device, and computer-readable storage medium
Patent Information
- Application Number
- CN202211321374.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-10-26
- Publication Date
- 2026-10-09
- Estimated Expiration
- 2042-10-26
AI Technical Summary
[0002]在相关技术中,为了提高图像的质量,拍照时会根据拍照算法列表对图像进行处理,而拍照列表算法配置有误容易导致算法执行失败
[0008]The inspection method, inspection device, electronic device, and computer-readable storage medium of this application enhance the robustness of the code by inspecting each algorithm channel and each algorithm unit in the picture-taking algorithm list, thereby avoiding algorithm execution failure.
Smart Images

Figure CN117974539B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of photographic technology, and more specifically, to an inspection method, inspection apparatus, electronic device, and computer-readable storage medium. Background Technology
[0002] In related technologies, in order to improve image quality, the image is processed according to a list of image-taking algorithms when taking a picture. However, if the image-taking algorithm list is misconfigured, it can easily lead to algorithm execution failure. Summary of the Invention
[0003] This application provides an inspection method, an inspection apparatus, an electronic device, and a computer-readable storage medium.
[0004] This application provides an inspection method, which includes: obtaining a list of image-taking algorithms, the list of image-taking algorithms including at least one algorithm channel, each algorithm channel including at least one algorithm unit, and each algorithm unit capable of executing an algorithm; checking whether there are any abnormalities in each algorithm channel and each algorithm unit in the list of image-taking algorithms; and determining that the list of image-taking algorithms can be executed when there are no abnormalities in the algorithm channels and the algorithm units.
[0005] This application provides an inspection device, comprising: an acquisition module, an inspection module, and a determination module. The acquisition module acquires a list of image-taking algorithms, the list including at least one algorithm channel, each algorithm channel including at least one algorithm unit, and each algorithm unit capable of executing one algorithm. The inspection module checks whether each algorithm channel and each algorithm unit in the list exhibits any abnormalities. The determination module determines that the list of image-taking algorithms is executable when no abnormalities are found in the algorithm channels and algorithm units.
[0006] This application provides an electronic device, which includes one or more processors and a memory. The memory stores a computer program, which, when executed by the processor, implements the steps of the inspection method described in any of the above embodiments.
[0007] This application provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of the inspection method described in any of the above embodiments.
[0008] The inspection method, inspection device, electronic device, and computer-readable storage medium of this application enhance the robustness of the code by inspecting each algorithm channel and each algorithm unit in the picture-taking algorithm list, thereby avoiding algorithm execution failure.
[0009] Additional aspects and advantages of embodiments of this application will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of embodiments of this application. Attached Figure Description
[0010] The above and / or additional aspects and advantages of this application will become apparent and readily understood from the description of the embodiments taken in conjunction with the following drawings, wherein:
[0011] Figure 1 This is a flowchart illustrating the inspection method of some embodiments of this application;
[0012] Figure 2 This is a schematic diagram of an inspection device according to certain embodiments of this application;
[0013] Figure 3 This is a schematic diagram of an electronic device according to certain embodiments of this application;
[0014] Figure 4 This is a flowchart illustrating the inspection method of some embodiments of this application;
[0015] Figure 5 This is a flowchart illustrating the inspection method of some embodiments of this application;
[0016] Figure 6 This is a flowchart illustrating the inspection method of some embodiments of this application;
[0017] Figure 7 This is a flowchart illustrating the inspection method of some embodiments of this application;
[0018] Figure 8 This is a flowchart illustrating the inspection method of some embodiments of this application;
[0019] Figure 9 This is a flowchart illustrating the inspection method of some embodiments of this application;
[0020] Figure 10 This is a flowchart illustrating the inspection method of some embodiments of this application;
[0021] Figure 11 This is a flowchart illustrating the inspection method of some embodiments of this application. Detailed Implementation
[0022] The embodiments of this application are described in detail below. Examples of the embodiments are shown in the accompanying drawings. The same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain this application, and should not be construed as limiting this application.
[0023] The following disclosure provides many different implementations or examples of different structures for implementing the embodiments of this application. To simplify the disclosure of the embodiments of this application, the components and arrangements of specific examples are described below. Of course, these are merely examples and are not intended to limit the scope of this application.
[0024] In related technologies, to improve image quality, images are processed according to a list of image-taking algorithms during the photo-taking process. In a single photo-taking workflow, after obtaining the algorithm list, the system allocates threads for execution based on the status of each algorithm pipeline, but lacks a check of the algorithm list itself. According to actual statistics on terminal devices, nearly 50% of bugs are caused by incorrect configuration of the image-taking algorithm list. Problems with algorithm pipelines include: issues when executing dependent algorithm pipelines, such as the dependent algorithm pipeline not being present in already executed algorithm pipelines or incorrect string entries for dependent algorithm pipelines; dependent algorithm pipelines not being included in already executed algorithm pipelines; the existence of algorithm pipelines with the same identifier; and the number of data frames entered in the algorithm pipeline being greater or less than the number actually sent by the application.
[0025] Structurally, each algorithm channel has a complex structure, and each photo capture involves dozens of algorithm channels forming a photo capture algorithm list for execution. Furthermore, these channels are interdependent, and the algorithm units within each channel may also be dependent on each other. This makes the photo capture algorithm list for each photo capture extremely complex, requiring significant effort and a deep understanding of the algorithms to check. Each new project necessitates adapting and adjusting the photo capture algorithm list for new platforms and chips, and each time a new algorithm is added, adaptation and adjustment are also required, consuming substantial manpower and resources. Incorrect configuration of the photo capture algorithm list can easily lead to algorithm execution failure.
[0026] Please see Figure 1 This application provides an inspection method, which includes:
[0027] 01: Obtain the list of photo-taking algorithms. The list of photo-taking algorithms includes at least one algorithm channel, each algorithm channel includes at least one algorithm unit, and each algorithm unit can be used to execute one algorithm.
[0028] 02: Check each algorithm channel and each algorithm unit in the image capture algorithm list for any abnormalities;
[0029] 03: If there are no abnormalities in the algorithm channel and algorithm unit, it is confirmed that the photo-taking algorithm list can be executed.
[0030] Please see Figure 2 This application provides an inspection device 100, which includes an acquisition module 11, an inspection module 12, and a determination module 13.
[0031] The detection method of this application embodiment can be implemented by the inspection device 100 of this application embodiment. Step 01 can be implemented by the acquisition module 11, step 02 by the inspection module 12, and step 03 by the determination module 13. That is, the acquisition module 11 can be used to acquire a list of image-taking algorithms, which includes at least one algorithm channel, each algorithm channel including at least one algorithm unit, and each algorithm unit capable of executing one algorithm. The inspection module 12 can be used to check whether there are any abnormalities in each algorithm channel and each algorithm unit in the image-taking algorithm list. The determination module 13 can be used to determine that the image-taking algorithm list can be executed when there are no abnormalities in the algorithm channels and algorithm units.
[0032] In the inspection method and inspection apparatus 100 of this application, each algorithm channel and each algorithm unit in the image capture algorithm list is inspected to enhance its code robustness and thus avoid algorithm execution failure. Furthermore, by automating the inspection for anomalies, the workload of development can be reduced.
[0033] Please see Figure 3 The inspection device 100 can be applied to the electronic device 1000. The electronic device 1000 may include devices such as smartphones, tablets, smartwatches, and smart bracelets, and is not specifically limited here. The electronic device 1000 in this application is illustrated using a smartphone as an example, and should not be construed as a limitation of this application.
[0034] Step 01: Obtain the image capture algorithm list. The image capture algorithm list includes at least one algorithm channel, and each algorithm channel includes at least one algorithm unit. Each algorithm unit can be used to execute one algorithm. Specifically, the image capture algorithm list is a collection of algorithm channels for a single image capture, consisting of one or more algorithm channels; an algorithm channel is a series of algorithm executions, which may contain one or more algorithm units. One algorithm channel is assigned to one thread for execution; an algorithm unit is an actual execution interface for implementing the algorithm's functionality.
[0035] Step 02 checks for anomalies in each algorithm channel and each algorithm unit in the image capture algorithm list. Specifically, the dependencies of each algorithm channel are checked by simulating the execution of the image capture algorithm list to determine whether there are any anomalies in each algorithm channel and each algorithm unit in the image capture algorithm list.
[0036] In this way, by checking for anomalies in each algorithm channel and each algorithm unit in the image capture algorithm list, and by addressing the anomalies accordingly, the robustness of the algorithm can be improved and algorithm execution failure can be prevented.
[0037] Step 03: If there are no anomalies in the algorithm channels and algorithm units, determine that the image capture algorithm list can be executed. Specifically, if there are no anomalies in each algorithm channel and each algorithm unit in the image capture algorithm list, determine that the image capture algorithm list can be executed by confirming that all algorithm channels have been executed.
[0038] This ensures that the list of photo-taking algorithms is effectively executed, preventing algorithm failures.
[0039] Please see Figure 4 In some implementations, the algorithm channel includes the current algorithm channel. Step 02 (checking for anomalies in each algorithm channel and each algorithm unit in the image capture algorithm list) includes:
[0040] 021: The current algorithm channel is simulated to check for any abnormalities in the current algorithm channel and the algorithm units within it.
[0041] Please see Figure 2 In some implementations, step 021 can be implemented by the inspection module 12. That is, the inspection module 12 can be used to check whether there are any abnormalities in the current algorithm channel and the algorithm units in the current algorithm channel by simulating the execution of the current algorithm channel.
[0042] In this way, by determining whether the current algorithm channel can be executed correctly, it is possible to detect anomalies in the current algorithm channel and anomalies in the algorithm units within the current algorithm channel, and to handle these anomalies to prevent the execution of the image capture algorithm list from failing.
[0043] Specifically, first, it is determined whether the current algorithm channel has any dependencies, and then it is further determined whether the dependencies of the current algorithm channel are satisfied, in order to determine whether the current algorithm channel can be executed correctly.
[0044] Please see Figure 5 Step 03 (when there are no anomalies in the algorithm channel and algorithm unit, determine that the image capture algorithm list can be executed) includes:
[0045] 031: If there are no anomalies in the current algorithm channel and the algorithm units in the current algorithm channel, determine whether there is a next algorithm channel. If there is a next algorithm channel, use the next algorithm channel as the current algorithm channel and simulate the execution of the current algorithm channel.
[0046] 032: When there are no anomalies in all algorithm channels and all algorithm units, it is determined that the image capture algorithm list can be executed.
[0047] Please see Figure 2 In some implementations, steps 031 and 032 can be implemented by the determining module 13. That is, the determining module 13 can be used to determine whether there is a next algorithm channel when there is no abnormality in the current algorithm channel and the algorithm unit in the current algorithm channel. When there is a next algorithm channel, the next algorithm channel is used as the current algorithm channel and the current algorithm channel is simulated and executed. When there is no abnormality in all algorithm channels and all algorithm units, it is determined that the photo-taking algorithm list can be executed.
[0048] Thus, by confirming that there are no anomalies in all algorithm channels and all algorithm units, it can be determined that the image capture algorithm list can be executed correctly.
[0049] Specifically, when it is found that there are no anomalies in the current algorithm channel and the algorithm units in the current algorithm channel, step 031 will determine whether there is a next algorithm channel. If there is no next algorithm channel, it can be determined that the photo-taking algorithm list can be executed correctly. If there is a next algorithm channel, step 031 will use the next algorithm channel as the current algorithm channel and simulate the execution of the current algorithm channel to determine whether the dependencies in the current algorithm channel are satisfied, thereby determining whether there are any anomalies in the current algorithm channel and the algorithm units in the current algorithm channel. This process is iterated until there are no next algorithm channels. At this point, there are no anomalies in all algorithm channels and all algorithm units, and it can be determined that the photo-taking algorithm list can be executed.
[0050] Please see Figure 6 In some implementations, step 021 (checking for anomalies in the current algorithm channel and its algorithm units by simulating execution of the current algorithm channel) includes:
[0051] 0211: When there are no dependency conditions in the current algorithm channel, it is determined that there are no anomalies in the current algorithm channel. Dependency conditions mean that the execution of the current algorithm channel depends on preset conditions.
[0052] 0212: When there are dependency conditions in the current algorithm channel, determine whether the dependency conditions are met;
[0053] 0213: When the dependency condition is met, determine that there are no anomalies in the current algorithm channel;
[0054] 0214: If the dependency condition is not met, determine that there is an anomaly in the current algorithm channel.
[0055] Please see Figure 2 In some implementations, steps 0211, 0212, 0213, and 0214 can be implemented by the inspection module 12. That is, the inspection module 12 can be used to: determine that the current algorithm channel is not abnormal when there is no dependency condition, where the dependency condition means that the execution of the current algorithm channel needs to depend on a preset condition; determine whether the dependency condition is satisfied when there is a dependency condition; determine that the current algorithm channel is not abnormal when the dependency condition is satisfied; and determine that the current algorithm channel is abnormal when the dependency condition is not satisfied.
[0056] Thus, by simulating the execution of the current algorithm channel, we can check whether there are any abnormalities in the dependencies of the current algorithm channel and the conditions of the algorithm units in the current algorithm channel, thereby determining whether the current algorithm channel can be executed normally.
[0057] Specifically, dependency conditions include algorithm dependency conditions and data dependency conditions. The dependency conditions of the current algorithm channel indicate that the execution of the current algorithm channel depends on preset conditions. When dependency conditions exist for the current algorithm channel, step 0212 will determine whether the dependency conditions of the current algorithm channel are met, that is, whether the algorithm dependency and data dependency of the current algorithm channel are met simultaneously. If either is not met, the checking method will throw an exception. When both the algorithm dependency and data dependency of the current algorithm channel are met simultaneously, it can be determined that there are no exceptions for the current algorithm channel.
[0058] Please see Figure 7 In some implementations, the dependency conditions include algorithm dependency conditions and data dependency conditions. Step 0212 (when dependency conditions exist in the current algorithm channel, determine whether the dependency conditions are satisfied) includes:
[0059] 02121: Determine whether the algorithm's dependency conditions are met;
[0060] 02122: When the algorithm dependency conditions are met, determine that there are no anomalies in the current algorithm channel;
[0061] 02123: If the algorithm dependency conditions are not met, determine that there is an anomaly in the current algorithm channel;
[0062] 02124: Determine whether the data dependency conditions are met;
[0063] 02125: When the data dependency condition is met, determine that there are no anomalies in the current algorithm channel;
[0064] 02126: If the data dependency condition is not met, determine that there is an anomaly in the current algorithm channel.
[0065] Please see Figure 2 In some implementations, steps 02121, 02122, 02123, 02124, 02125, and 02126 can be implemented by the inspection module 12. That is, the inspection module 12 can be used to: determine whether the algorithm dependency condition is met; when the algorithm dependency condition is met, determine that the current algorithm channel is not abnormal; when the algorithm dependency condition is not met, determine that the current algorithm channel is abnormal; determine whether the data dependency condition is met; when the data dependency condition is met, determine that the current algorithm channel is not abnormal; when the data dependency condition is not met, determine that the current algorithm channel is abnormal.
[0066] Thus, by determining whether the dependency conditions of the current algorithm channel are met, it is possible to further determine whether the current algorithm channel can be executed correctly.
[0067] Specifically, algorithm dependency conditions include the algorithm channel dependency conditions registered in the algorithm channel and the dependency conditions of the algorithm units to be executed in the algorithm channel. Data dependency conditions include the requirement that the number of data frames registered in the algorithm channel must be less than or equal to the number of data frames requested by the application from the Hardware Abstraction Layer (HAL). Only when both algorithm dependency conditions and data dependency conditions are met can it be determined that there is no anomaly in the current algorithm channel. If one of the algorithm dependency conditions and data dependency conditions is not met, it can be determined that there is an anomaly in the current algorithm channel regardless of whether the other condition is met.
[0068] Please see Figure 8 In some implementations, the algorithm dependency conditions include algorithm channel dependency conditions and algorithm unit dependency conditions. Step 02121 (determining whether the algorithm dependency conditions are satisfied) includes:
[0069] 021211: Determine the algorithm channels that the current algorithm channel needs to depend on as algorithm channel dependency conditions;
[0070] 021212: Based on all algorithm units in the current algorithm channel and all algorithm unit preset dependency information, count all algorithm units that need to be depended on as algorithm unit dependency conditions;
[0071] 021213: Determine whether the required algorithm channels and all required algorithm units have been executed;
[0072] 021214: The algorithm dependency condition is determined to be satisfied when all the required algorithm channels and all required algorithm units have been executed;
[0073] 021215: If the required algorithm channel or all required algorithm units are not executed, it is determined that the algorithm dependency condition is not met.
[0074] Please see Figure 2 In some implementations, steps 021211, 021212, 021213, 021214, and 021215 can be implemented by the checking module 12. That is, the checking module 12 can be used to: determine the algorithm channels that the current algorithm channel needs to depend on as algorithm channel dependency conditions; based on all algorithm units in the current algorithm channel and all algorithm unit preset dependency information, count all algorithm units that need to depend on as algorithm unit dependency conditions; determine whether the algorithm channels that need to depend on and all algorithm units that need to depend on have been executed; when the algorithm channels that need to depend on and all algorithm units that need to depend on have been executed, determine that the algorithm dependency conditions are met; when the algorithm channels that need to depend on or all algorithm units that need to depend on have not been executed, determine that the algorithm dependency conditions are not met.
[0075] Thus, by judging whether the algorithm channel dependency condition and the algorithm unit dependency condition are simultaneously satisfied, it is possible to further determine whether the algorithm dependency condition is satisfied, and then determine the correct execution of the photo-taking algorithm list.
[0076] Specifically, step 02121 reads the algorithm channels and algorithm units that the current algorithm channel depends on. Then, based on the algorithm units to be executed within that algorithm channel, and combined with all algorithm dependency information, it calculates all the theoretically required algorithm dependencies for that algorithm channel. These dependencies are used as the algorithm channel dependency conditions, and it checks whether they have been correctly executed. If all have been correctly executed, the algorithm channel dependency condition is satisfied. If any has not been correctly executed, the algorithm channel dependency condition is not satisfied, and an exception is thrown. When the algorithm channel dependency condition is satisfied, the dependency conditions of the algorithm units are checked to see if they have been correctly executed. If all have been correctly executed, the algorithm unit dependency condition is satisfied. If any has not been correctly executed, the algorithm unit dependency condition is not satisfied, and an exception is thrown. Regardless of where the exception originates, it can be determined that the algorithm dependency is not satisfied; otherwise, it can be determined that the algorithm dependency is satisfied. Each algorithm unit can store its own corresponding algorithm dependency information. Specifically, the data structure of the algorithm unit can be modified to store algorithm dependency information.
[0077] In some implementations, please refer to Figure 5 Step 03 (determining that the image capture algorithm list can be executed when there are no abnormalities in the algorithm channel and algorithm unit) also includes:
[0078] 033: If there are no anomalies in the current algorithm channel and the algorithm units in the current algorithm channel, record the current algorithm channel and the algorithm units in the current algorithm channel into the executed list;
[0079] 034: Determine whether the required algorithm channels and all required algorithm units have been executed.
[0080] Please see Figure 2 In some implementations, steps 033 and 034 can be implemented by the determining module 13. That is, the determining module 13 can be used to record the current algorithm channel and the algorithm units in the current algorithm channel into the executed list when there are no abnormalities in the current algorithm channel and the algorithm units in the current algorithm channel; and determine whether the algorithm channel that needs to be relied upon and all the algorithm units that need to be relied upon have been executed.
[0081] Thus, by confirming that there are no anomalies in all algorithm channels and algorithm units, and that all algorithm channels and all the algorithm units they depend on have been executed, it can be determined that the image capture algorithm list can be executed correctly.
[0082] Specifically, by judging the dependency conditions of the algorithm channels and the algorithm units, any anomalies can be eliminated, and algorithm channels and algorithm units without anomalies can be recorded in the executed list. When all algorithm channels and their algorithm units are in the executed list, it can be determined that the photo-taking algorithm list can be executed correctly.
[0083] Please see Figure 9 Step 034 (determining whether the required algorithm channels and all required algorithm units have been executed) includes:
[0084] 0341: Determine if the required algorithm channel and all required algorithm units exist in the executed list.
[0085] Please see Figure 2 In some implementations, step 0341 can be implemented by the determining module 13. That is, the determining module 13 can be used to determine whether the required algorithm channel and all required algorithm units exist in the executed list.
[0086] Thus, by looking up the table, it was determined that there were no anomalies in the required algorithm channels and all required algorithm units, and that they could be executed correctly. Ultimately, it could be confirmed that the list of image-taking algorithms could be executed correctly.
[0087] Specifically, when performing anomaly checks on the required algorithm channels and all required algorithm units, algorithm channels that meet the dependency conditions and the algorithm units within those channels are added to the executed list. In one embodiment, two objects (vectors) can be pre-created in the executed list to store the executed algorithm channels and the algorithm units within those channels in the two objects respectively.
[0088] Please see Figure 10 In some implementations, step 02124 (determining whether the data dependency condition is satisfied) includes:
[0089] 021241: Obtain the number of data frames required for the current algorithm channel;
[0090] 021242: Determine if the number of data frames is less than or equal to the number of captured frames transmitted by the application;
[0091] 021243: When the number of data frames is less than or equal to the number of frames already captured, the data dependency condition is determined to be satisfied;
[0092] 021244: When the number of data frames is greater than the number of frames already captured, it is determined that the data dependency condition has not been met.
[0093] Please see Figure 2 In some implementations, steps 021241, 021242, 021243, and 021244 can be implemented by the inspection module 12. That is, the inspection module 12 can be used to obtain the number of data frames required by the current algorithm channel; determine whether the number of data frames is less than or equal to the number of captured frames transmitted by the application; when the number of data frames is less than or equal to the number of captured frames, determine that the data dependency condition is met; when the number of data frames is greater than the number of captured frames, determine that the data dependency condition is not met.
[0094] Thus, by determining that the data dependency conditions are met, it can be determined that the dependencies of the current algorithm channel are met, and when all algorithm dependencies are met, it can be determined that the list of image-taking algorithms can be executed correctly.
[0095] Specifically, the data dependency condition includes the data frame number dependency condition, which represents the requirement for the number of input images when an algorithm unit is executed. When the number of data frames is less than or equal to the number of frames already captured, the data dependency condition is determined to be satisfied. When the number of data frames is greater than the number of frames already captured, the data dependency condition is determined to be unsatisfied.
[0096] Please see Figure 1 In some implementations, the inspection method further includes:
[0097] 04: When there is an anomaly in the current algorithm channel or the algorithm unit in the current algorithm channel, the current algorithm channel will be replaced by a backup algorithm channel.
[0098] Please see Figure 2 In some embodiments, the inspection device 100 further includes a replacement module 14. Step 04 can be implemented by the replacement module 14. That is to say, the replacement module 14 can be used to replace the current algorithm channel with a backup algorithm channel when there is an anomaly in the current algorithm channel or the algorithm unit in the current algorithm channel.
[0099] This reduces the time spent simulating the algorithm channel.
[0100] Specifically, when neither the dependency conditions of the current algorithm channel nor the dependency conditions of the algorithm units in the current algorithm channel are met, the current algorithm channel is replaced by a backup algorithm channel.
[0101] Please see Figure 11 In one embodiment, the algorithm channel checking process is as follows: First, obtain the list of image-taking algorithms, copy the obtained algorithm list to a local vector, and then determine whether the size of the local vector is zero. If it is zero, the checking process ends directly. If it is not zero, traverse the local vector and check the state of the algorithm channels within it. For the current algorithm channel with algorithm dependency conditions (e.g., the first algorithm channel), check whether its algorithm dependency conditions are met. If not, throw an exception and the checking process ends. If all conditions are met, then check whether its data dependency is met. If not, throw an exception. If all conditions are met, it means that the algorithm dependency and data dependency of the current algorithm channel are both met, and the checking process ends. The check method records the current algorithm channel and its algorithm units in the executed list, removes the current algorithm channel from the local vector, and then checks the next algorithm channel. During the check, for the current algorithm channel that does not have algorithm dependency conditions, it checks whether its data dependencies are satisfied. If not, an exception is thrown and the check process ends. If all dependencies are satisfied, the check method records the current algorithm channel and its algorithm units in the executed list, removes the current algorithm channel from the local vector, and then checks the next algorithm channel. This process iterates until the size of the local vector is zero, at which point the check process ends, and the photo-taking algorithm list check is complete.
[0102] Please see Figure 3 The inspection method of this application embodiment can be implemented by the electronic device 1000 of this application embodiment. Specifically, the electronic device 1000 includes one or more processors 200 and a memory 300. The memory 300 stores a computer program. When the computer program is executed by the processor 200, the steps of the inspection method of any of the above embodiments are implemented.
[0103] For example, when a computer program is executed by processor 200, the following steps of the checking method are implemented:
[0104] 01: Obtain the list of photo-taking algorithms. The list of photo-taking algorithms includes at least one algorithm channel, each algorithm channel includes at least one algorithm unit, and each algorithm unit can be used to execute one algorithm.
[0105] 02: Check each algorithm channel and each algorithm unit in the image capture algorithm list for any abnormalities;
[0106] 03: If there are no abnormalities in the algorithm channel and algorithm unit, it is confirmed that the photo-taking algorithm list can be executed.
[0107] This application provides a computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the steps of the inspection method described in any of the above embodiments.
[0108] For example, when the program is executed by the processor, the following steps are implemented for checking the method:
[0109] 01: Obtain the list of photo-taking algorithms. The list of photo-taking algorithms includes at least one algorithm channel, each algorithm channel includes at least one algorithm unit, and each algorithm unit can be used to execute one algorithm.
[0110] 02: Check each algorithm channel and each algorithm unit in the image capture algorithm list for any abnormalities;
[0111] 03: If there are no abnormalities in the algorithm channel and algorithm unit, it is confirmed that the photo-taking algorithm list can be executed.
[0112] The inspection method, inspection apparatus, electronic device, and computer-readable storage medium of this application enhance code robustness and prevent algorithm execution failures by inspecting each algorithm channel and each algorithm unit in the image capture algorithm list. Furthermore, automating the inspection process reduces development workload.
[0113] Any process or method described in the flowchart or otherwise herein can be understood as representing a module, segment, or portion of code comprising one or more executable instructions for implementing a particular logical function or process, and the scope of the preferred embodiments of this application includes additional implementations in which functions may be performed not in the order shown or discussed, including substantially simultaneously or in reverse order depending on the function involved, as will be understood by those skilled in the art to which embodiments of this application pertain.
[0114] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as a sequenced list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by, or in conjunction with, an instruction execution system, apparatus, or device (such as a computer-based system, a system including a processing module, or other system that can fetch and execute instructions from, an instruction execution system, apparatus, or device). For the purposes of this specification, "computer-readable medium" can be any means that can contain, store, communicate, propagate, or transmit programs for use by, or in conjunction with, an instruction execution system, apparatus, or device. More specific examples (a non-exhaustive list) of computer-readable media include: an electrical connection having one or more wires (control method), a portable computer disk drive (magnetic device), random access memory (RAM), read-only memory (ROM), erasable and editable read-only memory (EPROM or flash memory), fiber optic device, and portable optical disc read-only memory (CDROM). Alternatively, the computer-readable medium may be paper or other suitable media on which the program can be printed, since the program can be obtained electronically, for example, by optically scanning the paper or other medium, followed by editing, interpreting, or otherwise processing as necessary, and then stored in a computer memory.
[0115] It should be understood that various parts of the embodiments of this application can be implemented using hardware, software, firmware, or a combination thereof. In the above embodiments, multiple steps or methods can be implemented using software or firmware stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, it can be implemented using any one or a combination of the following techniques known in the art: discrete logic circuits having logic gates for implementing logical functions on data signals, application-specific integrated circuits (ASICs) having suitable combinational logic gates, programmable gate arrays (PGAs), field-programmable gate arrays (FPGAs), etc.
[0116] Those skilled in the art will understand that all or part of the steps of the methods in the above embodiments can be implemented by a program instructing related hardware. The program can be stored in a computer-readable storage medium, and when executed, the program includes one or a combination of the steps of the method embodiments.
[0117] Furthermore, the functional units in the various embodiments of this application can be integrated into a processing module, or each unit can exist physically separately, or two or more units can be integrated into a module. The integrated module can be implemented in hardware or as a software functional module. If the integrated module is implemented as a software functional module and sold or used as an independent product, it can also be stored in a computer-readable storage medium.
[0118] The storage media mentioned above can be read-only memory, disk, or optical disk, etc.
[0119] In the description of this specification, references to terms such as "certain embodiments" indicate that a specific feature, structure, or characteristic described in connection with the described embodiment or example is included in at least one embodiment of this application. In this specification, illustrative expressions of the above terms do not necessarily refer to the same embodiment. Furthermore, the specific features, structures, or characteristics described may be combined in any suitable manner in one or more embodiments.
[0120] Although embodiments of this application have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting this application. Those skilled in the art can make changes, modifications, substitutions and variations to the above embodiments within the scope of this application.
Claims
1. An inspection method, characterized in that, The inspection method includes: Obtain a list of image capture algorithms, which includes at least one algorithm channel, each algorithm channel includes at least one algorithm unit, and each algorithm unit can be used to execute an algorithm; the algorithm channel includes the current algorithm channel. Checking whether each algorithm channel and each algorithm unit in the image capture algorithm list has any anomalies includes: determining that the current algorithm channel has no anomalies when the current algorithm channel has no dependency conditions, wherein the dependency conditions indicate that the execution of the current algorithm channel depends on preset conditions; determining whether the dependency conditions are met when the current algorithm channel has dependency conditions; determining that the current algorithm channel has no anomalies when the dependency conditions are met; and determining that the current algorithm channel has anomalies when the dependency conditions are not met. When there are no abnormalities in the algorithm channel and the algorithm unit, it is determined that the list of photo-taking algorithms can be executed.
2. The inspection method according to claim 1, characterized in that, When there are no anomalies in the algorithm channel and the algorithm unit, determining that the image capture algorithm list can be executed includes: If there are no abnormalities in the current algorithm channel and the algorithm units in the current algorithm channel, determine whether there is a next algorithm channel. If there is a next algorithm channel, use the next algorithm channel as the current algorithm channel and simulate the execution of the current algorithm channel. If there are no anomalies in all the algorithm channels and all the algorithm units, it is determined that the list of image-taking algorithms can be executed.
3. The inspection method according to claim 2, characterized in that, One of the algorithm channels will be assigned to one thread for execution.
4. The inspection method according to claim 1, characterized in that, The dependency conditions include algorithm dependency conditions and data dependency conditions; The determination of whether the dependency condition is met includes: Determine whether the algorithm's dependency conditions are met; When the algorithm dependency condition is met, it is determined that there is no anomaly in the current algorithm channel; If the algorithm dependency condition is not met, it is determined that the current algorithm channel is abnormal; Determine whether the data dependency condition is met; When the data dependency condition is met, it is determined that there is no anomaly in the current algorithm channel; If the data dependency condition is not met, it is determined that there is an anomaly in the current algorithm channel.
5. The inspection method according to claim 4, characterized in that, The algorithm dependency conditions include algorithm channel dependency conditions and algorithm unit dependency conditions. Determining whether the algorithm dependency conditions are met includes: Determine the algorithm channels that the current algorithm channel needs to depend on, and use them as the algorithm channel dependency conditions; Based on all algorithm units in the current algorithm channel and all algorithm unit preset dependency information, count all algorithm units that need to be depended upon as the algorithm unit dependency conditions; Determine whether the required algorithm channels and all required algorithm units have been executed; The algorithm dependency condition is determined to be satisfied when all the required algorithm channels and all required algorithm units have been executed. If the required algorithm channel or all required algorithm units are not executed, it is determined that the algorithm dependency condition is not met.
6. The inspection method according to claim 5, characterized in that, When there are no anomalies in the algorithm channel and the algorithm unit, determining that the image capture algorithm list can be executed includes: When there are no abnormalities in the current algorithm channel and the algorithm units in the current algorithm channel, the current algorithm channel and the algorithm units in the current algorithm channel are recorded in the executed list; The determination of whether the required algorithm channel and all required algorithm units have been executed includes: Determine whether the required algorithm channel and all required algorithm units exist in the executed list.
7. The inspection method according to claim 4, characterized in that, The determination of whether the data dependency condition is met includes: Obtain the number of data frames required for the current algorithm channel; Determine whether the number of data frames is less than or equal to the number of captured frames transmitted by the application; When the number of data frames is less than or equal to the number of captured frames, it is determined that the data dependency condition is satisfied; If the number of data frames is greater than the number of frames already captured, it is determined that the data dependency condition has not been met.
8. The inspection method according to claim 2, characterized in that, The inspection method also includes: When there is an anomaly in the current algorithm channel or the algorithm unit in the current algorithm channel, the current algorithm channel is replaced by a backup algorithm channel.
9. An inspection device, characterized in that, The inspection device includes: The acquisition module is used to acquire a list of image-taking algorithms. The list of image-taking algorithms includes at least one algorithm channel, each algorithm channel includes at least one algorithm unit, and each algorithm unit can be used to execute an algorithm; the algorithm channel includes the current algorithm channel. The inspection module is used to check whether there are any anomalies in each algorithm channel and each algorithm unit in the image capture algorithm list, including: determining that the current algorithm channel is not abnormal when there are no dependency conditions, wherein the dependency conditions indicate that the execution of the current algorithm channel depends on preset conditions; determining whether the dependency conditions are met when there are dependency conditions; determining that the current algorithm channel is not abnormal when the dependency conditions are met; and determining that the current algorithm channel is abnormal when the dependency conditions are not met. The determining module is used to determine that the list of photo-taking algorithms can be executed when there are no abnormalities in the algorithm channel and the algorithm unit.
10. An electronic device, characterized in that, The electronic device includes one or more processors and a memory, the memory storing a computer program that, when executed by the processor, implements the steps of the inspection method according to any one of claims 1 to 8.
11. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by a processor, it implements the steps of the inspection method according to any one of claims 1 to 8.
Citation Information
Patent Citations
Code checking method and device, electronic equipment and storage medium
CN112000577A
Data processing method and related equipment
CN114237916A