Machine vision task processing method and device, equipment and storage medium

By setting a preset time in machine vision task processing and sending task results in time, the problem of fluctuations in processing speed cannot meet the beat, realizing the timeliness of task result output and the stability of beat.

CN119785188AActive Publication Date: 2025-04-08HANGZHOU HIKROBOT TECH CO LTD
View PDF 10 Cites 0 Cited by

Patent Information

Application Number
CN202510279584.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-10
Publication Date
2025-04-08
Estimated Expiration
2045-03-10

AI Technical Summary

Technical Problem

In machine vision task scenarios, due to factors such as system scheduling and CPU load, the processing speed of the previous task fluctuates, which easily leads to the problem of not being able to meet the beat.

Method used

By setting the interval time of the preset time is less than or equal to the preset beat, and sending the task result when the execution time of the first task reaches the preset time, decoupling of the task processing process and result output logic is achieved.

Benefits of technology

Regardless of whether the first task is executed or not, the task results can be output at the preset time to ensure that subsequent tasks are executed normally according to the preset beat, and avoid fluctuations in processing speed affecting the output timing of the result.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119785188A_ABST
    Figure CN119785188A_ABST
Patent Text Reader

Abstract

The invention discloses a machine vision task processing method and device, equipment and a storage medium, relates to the technical field of machine vision, and is at least used for outputting a machine vision task processing result in time and avoiding the problem that the rhythm cannot be met easily due to the fact that the processing speed fluctuates in the task processing process. The method comprises the following steps: processing at least two machine vision tasks according to a preset beat, wherein the at least two machine vision tasks comprise a first task and a second task which are executed in sequence; wherein the task result of the first task is sent in response to the fact that the execution duration of the first task reaches the preset duration; the preset duration is less than or equal to the interval duration of the preset beat.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of machine vision technology, and in particular to a machine vision task processing method, device, equipment and storage medium. Background Art

[0002] Vision software refers to software that processes images or videos, such as recognition and classification. In a beat task scenario consisting of at least two tasks, the subsequent task may need to refer to the task results of the previous task.

[0003] However, affected by factors such as system scheduling and central processing unit (CPU) load, the processing speed of the previous task often fluctuates, which can easily lead to the problem of not being able to meet the beat. Summary of the invention

[0004] The embodiments of the present application provide a machine vision task processing method, apparatus, device and storage medium for timely outputting machine vision task processing results to avoid the problem of failure to meet the beat due to fluctuations in processing speed during the previous task processing.

[0005] To achieve the above objectives, the present application provides the following technical solutions: In a first aspect, a method for processing a machine vision task is provided, comprising: processing at least two machine vision tasks according to a preset beat, wherein the at least two machine vision tasks include a first task and a second task that are executed successively. In response to the execution time of the first task reaching a preset time, a task result of the first task is sent. The preset time is less than or equal to the interval time of the preset beat.

[0006] In this technical solution, in order to avoid the problem that the execution time of the first task executed first exceeds the interval time of the preset beat due to the time fluctuation in the processing process, the preset time is set to be less than or equal to the interval time of the preset beat, and the task result of the first task is sent when the execution time of the first task reaches the preset time. In this way, regardless of whether the first task is completed when the execution time reaches the preset time, the task result can be sent, thereby ensuring that the second task executed later can be executed normally according to the preset beat.

[0007] Based on this, the present application can achieve the decoupling of the task processing process and the result output logic, that is, the execution of the machine vision task and the output of the task result are not bound, and the task result output action is performed regardless of whether the machine vision task is completed. The execution result can also be output in time when the machine vision task is not completed, so that the timing of the result feedback is not affected by the time-consuming fluctuations in the processing process, so as to better meet the needs of the beat task scenario. Therefore, the present application can be used to output the machine vision task processing results in a timely manner, avoiding the problem that the processing speed fluctuations in the previous task processing process can easily lead to the failure to meet the beat.

[0008] In a possible embodiment, the method further includes displaying a configuration interface through a display. The configuration interface includes configuration items. In response to a configuration operation of a user on a configuration item, the configuration item is configured to obtain a configuration file. The configuration item is used to indicate a condition for obtaining a task result and a method for obtaining the task result when the condition is met.

[0009] In a possible embodiment, the configuration items include at least one of the following: a first configuration item, used to indicate a method for obtaining a conditional judgment result. The conditional judgment result is a judgment result for a condition, and the conditional judgment result is used to indicate whether a specified result exists, or whether an execution result exists for the first task. A second configuration item, used to indicate a method for obtaining the first result when an execution result exists. A third configuration item, used to indicate a method for obtaining the second result when no execution result exists. A fourth configuration item, used to indicate an object that triggers the second task, executes the second task, and / or receives the task result of the first task. A fifth configuration item, used to indicate the value of a preset duration.

[0010] In a possible embodiment, the task result of the first task includes a processing result corresponding to a target stage of the first image processing process, and the second task is executed depending on the processing result corresponding to the target stage.

[0011] In a possible embodiment, before sending the task result of the first task, the method further includes: acquiring the task result of the first task according to a condition for acquiring the task result in a configuration file and a method for acquiring the task result when the condition is met.

[0012] In a possible embodiment, according to the conditions for obtaining the task results in the configuration file, and the method for obtaining the task results when the conditions are met, obtaining the task result of the first task includes: obtaining the conditional judgment result according to the method for obtaining the conditional judgment result. In response to the conditional judgment result being a specified result, determining the specified result as the task result. In response to the conditional judgment result being that there is an execution result, according to the first result obtaining method configured for the execution result, obtaining the final result corresponding to the execution result, and generating the task result with the final result and / or the conditional judgment result. In response to the conditional judgment result being that there is no execution result, obtaining the corresponding final result according to the second result obtaining method configured for the non-existence of the execution result.

[0013] In a possible embodiment, in response to the execution time of the first task reaching a preset time, sending the task result of the first task includes: if the scheduled sending function is turned on, in response to the execution time of the first task reaching a preset time, sending the task result of the first task.

[0014] In a possible embodiment, when the preset duration is less than the interval duration of the preset beat, sending the task result of the first task includes: determining the trigger duration of the first task. The trigger duration is the duration between the trigger moment of the first task and the current moment. When the trigger duration is equal to the interval duration, sending the task result of the first task.

[0015] In a second aspect, a machine vision task processing device is provided, comprising: a processing unit. The processing unit is used to process at least two machine vision tasks according to a preset beat, and the at least two machine vision tasks include a first task and a second task that are executed successively. In response to the execution time of the first task reaching a preset time, a task result of the first task is sent. The preset time is less than or equal to the interval time of the preset beat.

[0016] In a possible embodiment, the device further includes: a display unit; the display unit is used to display a configuration interface through a display. The configuration interface includes configuration items. The processing unit is further used to configure the configuration items in response to the user's configuration operation on the configuration items to obtain a configuration file. The configuration items are used to indicate the conditions for obtaining the task results and the method for obtaining the task results when the conditions are met.

[0017] In a possible embodiment, the configuration items include at least one of the following: a first configuration item, used to indicate a method for obtaining a conditional judgment result. The conditional judgment result is a judgment result for a condition, and the conditional judgment result is used to indicate whether a specified result exists, or whether an execution result exists for the first task. A second configuration item, used to indicate a method for obtaining the first result when an execution result exists. A third configuration item, used to indicate a method for obtaining the second result when no execution result exists. A fourth configuration item, used to indicate an object that triggers the second task, executes the second task, and / or receives the task result of the first task. A fifth configuration item, used to indicate the value of a preset duration.

[0018] In a possible embodiment, the task result of the first task includes a processing result corresponding to a target stage of the first image processing process, and the second task is executed depending on the processing result corresponding to the target stage.

[0019] In a possible embodiment, the processing unit is specifically configured to obtain the task result of the first task according to the condition for obtaining the task result in the configuration file and the method for obtaining the task result when the condition is met.

[0020] In a possible embodiment, the processing unit is specifically configured to: obtain the conditional judgment result according to the acquisition method configured for the conditional judgment result. In response to the conditional judgment result being a specified result, determine the specified result as the task result. In response to the conditional judgment result being that there is an execution result, obtain the final result corresponding to the execution result according to the first result acquisition method configured for the execution result, and generate the task result with the final result and / or the conditional judgment result. In response to the conditional judgment result being that there is no execution result, obtain the corresponding final result according to the second result acquisition method configured for the absence of the execution result.

[0021] In a possible embodiment, the processing unit is specifically configured to: if the scheduled sending function is turned on, in response to the execution time of the first task reaching a preset time, send the task result of the first task.

[0022] In a possible embodiment, the processing unit is specifically configured to: determine a trigger duration of the first task. The trigger duration is the duration between the trigger time of the first task and the current time. When the trigger duration is equal to the interval duration, send the task result of the first task.

[0023] In a third aspect, a computer device is provided, comprising: a processor and a memory. The processor is connected to the memory, the memory is used to store computer-executable instructions, and the processor executes the computer-executable instructions stored in the memory, thereby implementing any one of the methods provided in the first aspect.

[0024] In a fourth aspect, a readable storage medium is provided, comprising computer execution instructions, which, when executed on a computer device, causes the computer device to execute any one of the methods provided in the first aspect.

[0025] In a fifth aspect, a computer program product is provided, comprising computer execution instructions, which, when executed on a computer device, cause the computer device to execute any one of the methods provided in the first aspect.

[0026] The technical effects brought about by any implementation method in the second to fifth aspects can refer to the technical effects brought about by the corresponding implementation method in the first aspect, and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS

[0027] Figure 1 A schematic diagram of a machine vision task processing scenario provided in an embodiment of the present application; Figure 2 A schematic diagram of another machine vision task processing scenario provided in an embodiment of the present application; Figure 3 A schematic diagram of the structure of a computer device provided in an embodiment of the present application; Figure 4 A flowchart of a method for processing a machine vision task provided in an embodiment of the present application; Figure 5 A flowchart of another method for processing a machine vision task provided in an embodiment of the present application; Figure 6 A flowchart of another method for processing a machine vision task provided in an embodiment of the present application; Figure 7 A schematic diagram of a configuration interface provided in an embodiment of the present application; Figure 8 A schematic diagram of another configuration interface provided in an embodiment of the present application; Fig. 9 A flowchart of another method for processing a machine vision task provided in an embodiment of the present application; Fig.10 A schematic diagram of the structure of a machine vision task processing device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0028] In the description of this application, unless otherwise specified, " / " means "or", for example, A / B can mean A or B. "And / or" in this article is merely a description of the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B can mean: A exists alone, A and B exist at the same time, and B exists alone. In addition, "at least one" means one or more, and "plurality" means two or more. The words "first", "second", etc. do not limit the quantity and execution order, and the words "first", "second", etc. do not limit them to be different.

[0029] It should be noted that, in this application, words such as "exemplary" or "for example" are used to indicate examples, illustrations or descriptions. Any embodiment or design described as "exemplary" or "for example" in this application should not be interpreted as being more preferred or more advantageous than other embodiments or designs. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a specific way.

[0030] First of all, in order to facilitate the understanding of this application, the relevant technologies involved in this application are described.

[0031] Visual results refer to the feedback results that users want to get from the visual software for a single image input into the visual software. Visual software is an application used to perform processing such as recognition or classification on images. The image input into the visual software can be an image captured when the camera is triggered, or an image generated by other means. The feedback results output by the visual software can be recognition passed, recognition failed, or other image detection data. Whether the recognition is passed can be used to indicate whether the information in the image has passed verification. Image detection data can be vehicle license plate information, barcode information, etc. detected from the image.

[0032] Subscription refers to associating the input value of a module with the output value of its predecessor module so that the latest output value of the predecessor module is used as the input value of this module.

[0033] Secondly, the application scenarios involved in this application are briefly introduced.

[0034] In a scenario where the visual software executes tasks at a fixed beat, when the host computer executes a task in one beat, the subsequent task may need to refer to the task result of the previous task, requiring the visual software to output the image processing result corresponding to the task in a timely manner to facilitate the execution of the next beat task.

[0035] However, under the influence of factors such as system scheduling and CPU load, the processing speed of the previous task often fluctuates, which can easily lead to the problem of not being able to meet the task execution rhythm.

[0036] In one possible example, Figure 1 As shown, it is a schematic diagram of a machine vision task processing scenario provided by an embodiment of the present application. The workpiece placed on the conveyor belt can move with the conveyor belt to the processing area of ​​station 1, and move from the processing area of ​​station 1 to the processing area of ​​station 2. In addition, the conveyor belt can move at a fixed conveying speed. That is, the time required for the workpiece to move from the processing area of ​​station 1 to the processing area of ​​station 2 is fixed.

[0037] After the workpiece arrives at the processing area of ​​station 1, the camera device corresponding to station 1 can capture image information including the workpiece and send it to the computer device. Then, the visual software configured on the computer device can perform processing such as recognition or detection based on the captured image information. In this case, the visual software needs to output the processing results before the workpiece arrives at the processing area of ​​station 2, so that station 2 can perform corresponding processing.

[0038] In another possible example, Figure 2 As shown, it is a schematic diagram of another machine vision task processing scenario provided by an embodiment of the present application. The user can set a timed triggering of the visual software in the computer device, and set the visual software to output the processing result (i.e., output IO signal) through the input output (IO) port. In this case, if the visual software does not output the processing result through the IO port before the next trigger, the IO signals corresponding to the two triggers may overlap and become indistinguishable.

[0039] For example, Figure 2 If the IO signal corresponding to the first trigger in the output is completed before the start time of the second trigger, the IO signal can be distinguished as the processing result corresponding to the first trigger. Figure 2 The IO signal corresponding to the second trigger in the example was not output before the start time of the second trigger, while the processing speed of the third trigger was faster. As a result, the IO signals corresponding to the second and third triggers overlapped into one IO signal. It was impossible to distinguish whether the one IO signal was the processing result of the second trigger or the processing result of the third trigger. As a result, three triggers occurred but only two outputs were generated, making it difficult to confirm the correspondence between triggers and outputs.

[0040] Next, the implementation environment (implementation architecture) involved in this application is briefly introduced.

[0041] The embodiment of the present application provides a method for processing machine vision tasks, which can be applied to computer devices. The computer devices can have processing functions such as image recognition or detection, and can feedback image processing results within a specified time, so as to provide a service for timely feedback of image processing results.

[0042] The embodiments of the present application do not impose any restrictions on the specific form of the computer device. For example, the computer device may be a terminal device for providing a service for providing timed feedback of image processing results, or a network device for providing a service for providing timed feedback of image processing results. Among them, the terminal device may be referred to as: terminal, user equipment (UE), terminal device, mobile device, user terminal, user agent or user device, etc. The terminal device may be a mobile phone, tablet computer, laptop computer, ultra-mobile personal computer (UMPC), netbook, personal digital assistant (PDA), etc. The network device may be a server, etc. Among them, the server may be a physical or logical server, or there may be two or more physical or logical servers that share different responsibilities and cooperate with each other to realize the various functions of the server.

[0043] In terms of hardware implementation, the above-mentioned computer device can be implemented as follows: Figure 3 The computer device shown is implemented as shown. Figure 3 FIG. 1 is a schematic diagram of the structure of a computer device 10 provided in an embodiment of the present application. The computer device 10 can be used to implement the functions of the above-mentioned computer devices.

[0044] Figure 3 The computer device 10 shown may include: a processor 101 , a memory 102 , a communication interface 103 , and a bus 104 . The processor 101 , the memory 102 , and the communication interface 103 may be connected via the bus 104 .

[0045] The processor 101 is the control center of the computer device 10, and may be a general-purpose central processing unit (CPU) or other general-purpose processors, etc. The general-purpose processor may be a microprocessor or any conventional processor, etc.

[0046] As an example, the processor 101 may include one or more CPUs, such as Figure 3 CPU 0 and CPU 1 are shown in .

[0047] The memory 102 may be a read-only memory (ROM) or other types of static storage devices that can store static information and instructions, a random access memory (RAM) or other types of dynamic storage devices that can store information and instructions, an electrically erasable programmable read-only memory (EEPROM), a disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited thereto.

[0048] In one possible implementation, the memory 102 may exist independently of the processor 101. The memory 102 may be connected to the processor 101 via a bus 104 and used to store data, instructions, or program codes. When the processor 101 calls and executes the instructions or program codes stored in the memory 102, the machine vision task processing method provided in the embodiment of the present application can be implemented.

[0049] In another possible implementation, the memory 102 may also be integrated with the processor 101 .

[0050] The communication interface 103 is used for connecting the computer device 10 to other devices through a communication network, which may be Ethernet, a radio access network (RAN), a wireless local area network (WLAN), etc. The communication interface 103 may include a receiving unit for receiving data and a sending unit for sending data.

[0051] The bus 104 may be an industry standard architecture (ISA) bus, a peripheral component interconnect (PCI) bus, or an extended industry standard architecture (EISA) bus. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 3 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.

[0052] It should be pointed out that Figure 3 The structure shown in the figure does not constitute a limitation on the computer device 10, except Figure 3In addition to the components shown, computer device 10 may include more or fewer components than shown, or combine certain components, or arrange components differently.

[0053] For ease of understanding, the machine vision task processing method provided in this application is specifically introduced below with reference to the accompanying drawings.

[0054] like Figure 4 FIG. 4 is a flow chart of a method for processing a machine vision task provided by an embodiment of the present application. The method includes: S401.

[0055] S401: Process at least two machine vision tasks according to a preset rhythm.

[0056] The preset beat is a task execution beat with a fixed interval duration, and may also be called a preset cycle or other names without limitation.

[0057] The at least two machine vision tasks include a first task and a second task that are performed successively. The machine vision task may be a task of processing, such as recognizing, classifying, or extracting information from an image. A machine vision task may be used to perform multiple stages of an image processing process. The image may be an image of an actual scene captured by a camera, or a virtual image generated by artificial intelligence or an image editor. For example, the image of an actual scene captured by a camera may be Figure 1 The image of the workpiece shown may also be an image of a vehicle on a traffic road, etc.

[0058] Optionally, the first task and the second task may be two unrelated machine vision tasks, or two machine vision tasks with a dependency relationship. When the first task and the second task are unrelated, the first task and the second task may be tasks that perform the same processing on different images. When the first task and the second task are dependent, the second task may be executed depending on the processing result corresponding to the target stage in the first task. In this case, the task result of the first task may include the processing result corresponding to the target stage of the first image processing process, so as to facilitate the execution of the second task. The target stage may be any stage of the multiple stages executed by the first task, without limitation.

[0059] For example, Figure 5 As shown, the image processing process may include multiple stages of acquiring image source, connected domain analysis based on binary large object (Blob) analysis, contour matching, position correction, circle search, combination module and line circle measurement. The first task may be used to execute the multiple stages. The target stage may be a circle search stage, a line circle measurement stage, or other stages.

[0060] It should be noted that, in the process of processing at least two machine vision tasks according to a preset beat, each time a machine vision task is executed, it is necessary to output the task result of the machine vision task within a preset duration. The preset duration may be less than or equal to the interval duration of the preset beat. In this way, the computer device can output the task result of the machine vision task before the next machine vision task is triggered to execute, so that each machine vision task is executed according to the preset beat to meet business needs.

[0061] For example, for the first task and the second task that are executed successively, Figure 1 , assuming that the first task is used to execute the processing of the image captured by the camera device corresponding to the processing area of ​​station 1. In this case, the fixed time interval of the preset beat can be the transmission time required for the workpiece to move from the processing area of ​​station 1 to the processing area of ​​station 2 along the conveyor belt. The preset time can be less than or equal to the transmission time. For another example, combined with Figure 2 , assuming that the first task is used to execute the processing of the image corresponding to the first trigger. In this case, the fixed time interval of the preset beat can be the interval between the start time of the first trigger and the start time of the second trigger. The preset time can be less than or equal to the interval time.

[0062] Based on this, if the computer device triggers the execution of the first task, the actual execution time of the first task can be determined during the execution of the first task. If it is determined that the first task is actually executed for a preset time, it can be indicated that the execution result corresponding to the first task needs to be output at this time to ensure that the first task can output the execution result within the allowed execution time to avoid affecting subsequent processing. In this case, the computer device can send the task result of the first task in response to the execution time of the first task reaching the preset time.

[0063] Optionally, when the computer device starts to execute the first task, a timer for counting down a preset duration may be started. Thus, when the timer counts down, the computer device may determine that the first task has actually been executed for the preset duration.

[0064] Alternatively, when the computer device starts to execute the first task, it may start a timer to start timing. In this way, when the timer reaches a preset duration, the computer device may determine that the first task has actually been executed for the preset duration.

[0065] In one possible manner, considering that the first task is not completed within a preset time period, there is no task result for the first task. And, considering that the first task is completed within a preset time period, the task result of the first task includes a first type result or a second type result. For example, the first task can be used to identify whether there is a vehicle in an image. Then the first type result can be that there is a vehicle in the image, and the second type result can be that there is no vehicle in the image. For another example, the first task can be used to detect a vehicle license plate in an image. Then the first type result can be the vehicle license plate in the image, and the second type result can be a value used to indicate that there is no vehicle license plate in the image.

[0066] Based on this, the computer device can preset the methods for obtaining the final result when there is no task result for the first task, when there is a first type of result for the first task, and when there is a second type of result for the first task. In response to the execution time of the first task reaching the preset time, the computer device can obtain the results respectively according to the preset methods, and further use the obtained results as the task result of the first task. It should be understood that for a task, when the computer device obtains the results respectively according to the preset methods, it will not obtain multiple results, but will obtain the actual result of the task.

[0067] In this way, regardless of whether the first task is completed, the computer device can output the task result of the first task within the preset time, meeting the need to execute tasks according to the preset rhythm, and achieving the effect that the timing of result feedback is not affected by the time fluctuation during task processing, so as to better meet the needs of more machine vision task processing scenarios. Therefore, this application can be used to output task processing results in a timely manner, avoiding the problem that the time fluctuation during the processing process easily affects the timing of result output.

[0068] In a possible embodiment, the triggering mode of the machine vision task may be a timing trigger or an event trigger. If the triggering mode of the machine vision task is a timing trigger, the timing duration may be the interval duration of a preset beat.

[0069] If the triggering mode of the machine vision task is event triggering, the event can be the task result of the previous machine vision task sent by the computer device. For example, the second task can be triggered by the event that the computer device sends the task result of the first task. In this case, if the preset duration is equal to the interval duration of the preset beat, the computer device can send the task result of the first task in response to the execution duration of the first task reaching the preset duration, and the second task can be triggered to execute according to the preset beat.

[0070] If the preset duration is less than the interval duration of the preset beat, the computer device needs to wait for the execution duration of the first task to reach the interval duration of the preset beat, and then send the task result of the first task, so as to trigger the execution of the second task according to the preset beat. That is, when the preset duration is less than the interval duration of the preset beat, the computer device can determine the trigger duration of the first task when sending the task result of the first task. Among them, the trigger duration is the duration between the trigger moment of the first task and the current moment. If the trigger duration of the first task is less than the interval duration of the preset beat, the computer device can continue to wait. If the trigger duration of the first task is equal to the interval duration of the preset beat, the computer device can send the task result of the first task, so as to trigger the execution of the second task according to the preset beat.

[0071] In a possible embodiment, the execution logic for the computer device to output the task result when the task execution time reaches a preset time can be configured as a timed sending function, and the timed sending function supports the editing of the switch state. In this case, during the process of the computer device executing S401, it can be determined whether the timed sending function is turned on. If the timed sending function is turned on, the computer device can send the task result of the first task in response to the execution time of the first task reaching the preset time. If the timed sending function is turned off, during the process of the computer device executing S401, the task result of the first task is not sent in response to the execution time of the first task reaching the preset time.

[0072] In one embodiment, the computer device may be configured with a display, and support configuration of various result acquisition methods and preset durations through a configuration interface. Figure 6 , which is a flow chart of another machine vision task processing method provided in an embodiment of the present application. Figure 6 The machine vision task processing method shown includes: S501-S502.

[0073] S501: Displaying a configuration interface via a display.

[0074] The configuration interface includes configuration items, which can be used to indicate the conditions for obtaining task results and the method for obtaining task results when the conditions are met.

[0075] Optionally, the configuration items may include at least one of the following: a first configuration item for indicating a method for obtaining a conditional judgment result, a second configuration item for indicating a method for obtaining the first result when there is an execution result, a third configuration item for indicating a method for obtaining the second result when there is no execution result, a fourth configuration item for indicating an object for triggering a second task, executing the second task and / or receiving a task result of the first task, and a fifth configuration item for indicating a value of a preset duration.

[0076] The conditional judgment result is a judgment result for the condition indicating the acquisition of the task result. The conditional judgment result is used to indicate whether a specified result exists, or whether the first task has an execution result.

[0077] The specified result is a fixed result configured for the machine vision task and can be regarded as a constant. If a specified result exists, the computer device sends the specified result when sending the task result of any machine vision task. If there is no specified result, the computer device can obtain the corresponding final result as the task result of the first task based on the judgment result of whether there is an execution result of the first task.

[0078] S502: In response to the user's configuration operation on the configuration item, the configuration item is configured to obtain a configuration file.

[0079] The user can perform configuration operations for each configuration item in the configuration interface through input modules such as a keyboard or a mouse. In response to the user's configuration operations, the computer device can generate configuration information for each configuration item, configure the configuration item, and obtain a configuration file.

[0080] In one embodiment, before the computer device sends the task result of the first task, it can obtain the task result of the first task based on the configuration file. In this case, the machine vision task processing method provided by the embodiment of the present application further includes: S601.

[0081] S601: Obtain the task result of the first task according to the condition for obtaining the task result in the configuration file and the method for obtaining the task result when the condition is met.

[0082] The computer device may perform conditional judgment according to the configuration information of each configuration item in the configuration file, and obtain the task result of the first task based on the obtaining method corresponding to the conditional judgment result.

[0083] In an optional implementation, when the computer device executes S601, that is, according to the conditions for obtaining the task results in the configuration file and the method for obtaining the task results when the conditions are met, obtaining the task result of the first task may include: S6011-S6014.

[0084] S6011: Acquire the conditional judgment result according to the acquisition method configured for the conditional judgment result.

[0085] S6012: In response to the conditional judgment result being a designated result, determining the designated result as the task result.

[0086] If the value obtained based on the acquisition method configured for the conditional judgment result is a constant, the conditional judgment result is a fixed value that can be used to indicate the existence of a specified result. In this case, in the process of the computer device executing at least two machine vision tasks according to a preset beat, for each machine vision task, in response to the conditional judgment result being the specified result, the specified result is determined as the task result and sent. For example, in the case of heartbeat communication between the computer device and other devices, the specified result can be a heartbeat packet.

[0087] S6013: In response to the conditional judgment result indicating that an execution result exists, obtain a final result corresponding to the execution result according to the first result acquisition method configured for the execution result, and generate a task result using the final result and / or the conditional judgment result.

[0088] If the value obtained based on the acquisition method configured for the conditional judgment result is a subscription value of the execution state of the first task, then the conditional judgment result is a variable value indicating that the execution state of the first task is completed or incomplete, which can be used to indicate whether there is an execution result for the first task. If the conditional judgment result is that there is an execution result, the computer device can, in response to the conditional judgment result being that there is an execution result, obtain the final result corresponding to the execution result according to the first result acquisition method configured for the execution result, and generate a task result with the final result and / or the conditional judgment result.

[0089] Further, considering that there is an execution result of the first task, the execution result may be a different first result or second result. For example, the first task can be used to identify whether there is a vehicle in the image. Then the first result may be that there is a vehicle in the image, and the second result may be that there is no vehicle in the image. For another example, the first task can be used to detect a vehicle license plate in an image. Then the first result may be the vehicle license plate in the image, and the second result may be a value indicating that there is no vehicle license plate in the image. In this case, the first result acquisition method may include a first acquisition method corresponding to the first result, and a second acquisition method corresponding to the second result, so as to determine different task results corresponding to different execution results.

[0090] S6014: In response to the conditional judgment result being that there is no execution result, the corresponding final result is obtained according to the second result acquisition method configured for the absence of the execution result.

[0091] If the conditional judgment result is that there is no execution result, it can indicate that the first task has not yet been completed. In this case, in order to avoid affecting the execution of other machine vision tasks and ensure that the task execution rhythm is not affected, the computer device can obtain and send the corresponding final result according to the second result acquisition method configured for the non-existence of the execution result.

[0092] Optionally, the computer device may obtain a constant value based on the second result obtaining method. The constant value may be used to indicate that there is no execution result of the first task.

[0093] Alternatively, the computer device can obtain the result value of the intermediate step of the first task based on the second result acquisition method. Figure 5 In the task processing process shown in , if the first task does not obtain the execution result of the line circle measurement within the preset time when executing the task processing process, the second result acquisition method can instruct to obtain the result value of the intermediate steps such as contour matching or circle search, and send it as the final result of the first task, so that the task execution rhythm is not affected.

[0094] For example, Figure 7 As shown, it is a schematic diagram of a configuration interface provided by an embodiment of the present application. Among them, the edit box corresponding to the conditional judgment can be used to edit the method for obtaining the conditional judgment result, corresponding to the first configuration item. The edit boxes corresponding to the first result sending and the second result sending can be used to edit the method for obtaining different types of results when the task has an execution result, respectively, which can be regarded as two sub-configuration items of the second configuration item. The edit box corresponding to the timeout sending can be used to edit the method for obtaining the second result when there is no execution result, corresponding to the third configuration item. The edit box corresponding to the sending object can be used to edit the object that triggers the second task, executes the second task and / or receives the task result of the first task, corresponding to the fourth configuration item. The edit box corresponding to the time interval can be used to edit the value of the preset duration, corresponding to the fifth configuration item.

[0095] In scenarios where task results are transmitted via communication, such as Figure 7 As shown, combined Figure 1 The machine vision task processing scenario shown in Figure 5 In the task processing process shown in , the user can perform configuration operations for each configuration item in the configuration interface, indicating that the time interval is 100 milliseconds, indicating that the sending object is the transmission control protocol (TCP) client, indicating that the condition judgment item is "line circle measurement, execution status", indicating that the first result sending item is "line circle measurement, straight line angle", indicating that the second result sending item is "NG", and indicating that the timeout sending item is "preset result". Among them, "line circle measurement, execution status" and "line circle measurement, straight line angle" are subscription values. "Line circle measurement, execution status" is used to indicate the storage location of the value corresponding to the execution status of the line circle measurement. The storage location of the value of the straight line angle obtained by the line circle measurement. "NG" and "preset result" can be regarded as constants. "NG" is used to indicate that the task is completed but the straight line angle is not obtained. "Preset result" is used to indicate that the task is not completed.

[0096] In this way, the preset duration is 100 milliseconds. The computer device can obtain the execution status corresponding to the line-circle measurement stage when 100 milliseconds are reached. If the execution status corresponding to the line-circle measurement stage is incomplete execution, the computer device determines that there is no execution result, and obtains the timeout sending item "preset result" for sending. If the execution status corresponding to the line-circle measurement stage is completed execution, the computer device determines that there is an execution result. Further, if the execution result is an expected value, the computer device determines that the first result is obtained (that is, it is determined to be true), and obtains the straight line angle according to the first result sending item, and sends the obtained straight line angle as the task result of the first task. If the execution result is an unexpected value, the computer device determines that the second result is obtained (that is, it is determined to be false), and obtains "NG" according to the second result sending item for sending.

[0097] Combined with the above Figure 7 Examples in Figure 8 As shown, it is a schematic diagram of another configuration interface provided by an embodiment of the present application. In the scenario where the task result is transmitted in a pin manner, combined with Figure 2 The machine vision task processing scenario shown in Figure 5 In the task processing process shown in , the user can perform configuration operations for each configuration item in the configuration interface, indicating that the time interval is 100 milliseconds, and indicating that the sending object item is the visual processor, and indicating that the condition judgment item is "line circle measurement, execution status", and indicating that the first result sending item is IO1, and indicating that the second result sending item is IO2, and indicating that the timeout sending item is IO3.

[0098] In this way, the preset duration is 100 milliseconds. The computer device can obtain the execution status corresponding to the line circle measurement stage when 100 milliseconds are reached. If the execution status corresponding to the line circle measurement stage is incomplete execution, the computer device determines that there is no execution result, and obtains the level signal at the timeout sending item IO3 for sending. If the execution status corresponding to the line circle measurement stage is completed execution, the computer device determines that there is an execution result. Further, if the execution result is an expected value, the computer device determines that the first result is obtained (that is, it is determined to be true), and obtains the level signal at the first result sending item IO1 as the task result of the first task for sending. If the execution result is an unexpected value, the computer device determines that the second result is obtained (that is, it is determined to be false), and obtains the level signal at the second result sending item IO2 for sending.

[0099] For example, Fig. 9 , which is a flow chart of another machine vision task processing method provided in an embodiment of the present application. Fig. 9The present invention shows a thread execution process method for realizing timed sending during task processing, including: S701-S722. Among them, S701-S709 are process execution threads, S710-S711 are timing threads, and S712-S722 are working threads. Among them, S707-S709 are optional execution steps. For example, when the triggering mode of the machine vision task is event triggering, and the event is the task result of the previous machine vision task, the computer device can execute S707-S709 so that the second task can be triggered according to the preset beat.

[0100] S701: Start execution.

[0101] S702: Whether to enable scheduled sending.

[0102] S703: Set the timing.

[0103] S704: Execute the task.

[0104] S705: Whether to enable scheduled sending.

[0105] S706: Wait for sending to be completed.

[0106] S707: Determine whether the trigger duration is equal to the interval duration.

[0107] S708: Determine the trigger duration.

[0108] S709: Send the final result.

[0109] S710: Start timing.

[0110] S711: Timing completed.

[0111] S712: Whether the execution is completed.

[0112] S713: Whether the execution result is the first result.

[0113] S714: Whether the first result is obtained.

[0114] S715: Output the first result.

[0115] S716: Whether the second result is obtained.

[0116] S717: Output the second result.

[0117] S718: Whether the preset result is obtained.

[0118] S719: Output the preset result.

[0119] S720: Output an error value.

[0120] S721: Output completed.

[0121] S722: Send process communication completion information.

[0122] It should be understood that the above step numbers are not used to limit the execution order of the steps.

[0123] In the above process, after the process execution thread of the computer device starts to execute the task processing process, it can determine whether to enable scheduled sending. If scheduled sending is enabled, the process execution thread of the computer device can set the timing and execute the task. At the same time, the timing thread of the computer device can start timing. If scheduled sending is not enabled, the process execution thread of the computer device can directly execute the task. Then, after the process execution thread of the computer device completes the task, it can verify whether scheduled sending is enabled. If scheduled sending is enabled, the process execution thread of the computer device can wait for the completion of scheduled sending and determine the end of execution. If scheduled sending is not enabled, the process execution thread of the computer device can directly determine the end of execution.

[0124] Or further, if the execution of the machine vision task is triggered by the task result of the previous machine vision task, the computer device needs to execute S707-S709. In this case, the computer device can determine whether the trigger duration is equal to the interval duration. The trigger duration is the trigger duration of the first task. The interval duration is the interval duration of the preset beat. If the trigger duration of the first task does not reach the interval duration of the preset beat, the computer device can redetermine the trigger duration and continue to wait. If the trigger duration of the first task is equal to the interval duration of the preset beat, the computer device can send the final result, that is, send the task result of the first task, so as to trigger the execution of the second task according to the preset beat.

[0125] When the timing thread of the computer device is completed, the working thread of the computer device can determine whether the first task is completed. If the first task is completed, the working thread of the computer device can determine whether the execution result is the first result. If the execution result is the first result, the working thread of the computer device can obtain the first result and further determine whether the first result is obtained. If the first result is obtained, the working thread of the computer device can output the first result as the task result of the first task, determine that the output is completed, and send process communication completion information to the process execution thread.

[0126] If the execution result is not the first result, the execution result is the second result. The working thread of the computer device can obtain the second result and further determine whether the second result is obtained. If the second result is obtained, the working thread of the computer device can output the second result as the task result of the first task, determine that the output is completed, and send process communication completion information to the process execution thread.

[0127] If the first task is not completed, or the first result is not obtained, or the second result is not obtained, the working thread of the computer device can obtain a preset result and further determine whether the preset result is obtained. If the preset result is obtained, the working thread of the computer device can output the preset result as the task result of the first task. If the preset result is not obtained, the working thread of the computer device can output the task result of the first task with an error value. In addition, the working thread of the computer device determines that the output is completed, and sends process communication completion information to the process execution thread.

[0128] Based on this, the present application can support the timed sending of image processing results, realize the decoupling of image processing logic and result output logic, so that the timing of result feedback is not affected by time fluctuations in the processing process, so as to better meet the needs of more machine vision task processing scenarios.

[0129] The above mainly introduces the scheme of the embodiment of the present application from the perspective of the method. It is understandable that in order to realize the above functions, the computer device includes at least one of the hardware structure and software modules corresponding to the execution of each function. It should be easily appreciated by those skilled in the art that, in combination with the units and algorithm steps of each example described in the embodiments disclosed herein, the present application can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in the form of hardware or computer software driving hardware depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present application.

[0130] The embodiment of the present application can divide the computer device into functional units according to the above method example. For example, each functional unit can be divided according to each function, or two or more functions can be integrated into one processing unit. The above integrated unit can be implemented in the form of hardware or in the form of software functional units. It should be noted that the division of units in the embodiment of the present application is schematic and is only a logical function division. There may be other division methods in actual implementation.

[0131] For example, Fig.10 The structure diagram of a machine vision task processing device is shown. The machine vision task processing device 20 can be used to execute the method involved in the above embodiment. The machine vision task processing device 20 includes: a processing unit 801.

[0132] The processing unit 801 is used to process at least two machine vision tasks according to a preset beat, wherein the at least two machine vision tasks include a first task and a second task that are executed successively. In response to the execution time of the first task reaching a preset time, the task result of the first task is sent. The preset time is less than or equal to the interval time of the preset beat.

[0133] In a possible embodiment, the device further includes: a display unit 802; the display unit 802 is used to display a configuration interface through a display. The configuration interface includes configuration items. The processing unit 801 is also used to configure the configuration items in response to the user's configuration operation on the configuration items to obtain a configuration file. The configuration items are used to indicate the conditions for obtaining the task results and the method for obtaining the task results when the conditions are met.

[0134] In a possible embodiment, the configuration items include at least one of the following: a first configuration item, used to indicate a method for obtaining a conditional judgment result. The conditional judgment result is a judgment result for a condition, and the conditional judgment result is used to indicate whether a specified result exists, or whether an execution result exists for the first task. A second configuration item, used to indicate a method for obtaining the first result when an execution result exists. A third configuration item, used to indicate a method for obtaining the second result when no execution result exists. A fourth configuration item, used to indicate an object that triggers the second task, executes the second task, and / or receives the task result of the first task. A fifth configuration item, used to indicate the value of a preset duration.

[0135] In a possible embodiment, the task result of the first task includes a processing result corresponding to a target stage of the first image processing process, and the second task is executed depending on the processing result corresponding to the target stage.

[0136] In a possible embodiment, the processing unit 801 is specifically configured to obtain the task result of the first task according to the condition for obtaining the task result in the configuration file and the method for obtaining the task result when the condition is met.

[0137] In a possible embodiment, the processing unit 801 is specifically configured to: obtain the conditional judgment result according to the acquisition method configured for the conditional judgment result. In response to the conditional judgment result being a specified result, the specified result is determined as the task result. In response to the conditional judgment result being that there is an execution result, according to the first result acquisition method configured for the execution result, a final result corresponding to the execution result is obtained, and the final result and / or the conditional judgment result are used to generate a task result. In response to the conditional judgment result being that there is no execution result, according to the second result acquisition method configured for the absence of the execution result, the corresponding final result is obtained.

[0138] In a possible embodiment, the processing unit 801 is specifically configured to: if the scheduled sending function is turned on, in response to the execution time of the first task reaching a preset time, send the task result of the first task.

[0139] In a possible embodiment, the processing unit 801 is specifically configured to: determine a trigger duration of the first task. The trigger duration is the duration between the trigger time of the first task and the current time. When the trigger duration is equal to the interval duration, send the task result of the first task.

[0140] For the specific description of the above optional manner, please refer to the above method embodiment, which will not be repeated here. In addition, the explanation of any of the above computer devices and the description of the beneficial effects can refer to the above corresponding method embodiment, which will not be repeated here.

[0141] As an example, combining Figure 3 , part or all of the functions of the processing unit 801 and the display unit 802 in the machine vision task processing device 20 can be Figure 3 Processor 101 in the Figure 3 The program code in the memory 102 is implemented.

[0142] An embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed on a computer, the computer is enabled to execute any of the methods executed by the computer devices provided above.

[0143] For the explanation of the relevant contents and description of the beneficial effects of any of the above-mentioned computer-readable storage media, reference may be made to the above-mentioned corresponding embodiments, which will not be repeated here.

[0144] The embodiment of the present application also provides a computer program product including instructions, when the instructions are run on a computer, the computer executes any one of the methods in the above embodiments. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on the computer, the process or function according to the embodiment of the present application is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions may be transmitted from one website site, computer, server or data center to another website site, computer, server or data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium may be any available medium that can be accessed by the computer or a data storage device such as a server or data center that includes one or more servers that can be integrated with the medium. The available medium may be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), etc.

[0145] It should be noted that the above-mentioned devices for storing computer instructions or computer programs provided in the embodiments of the present application, such as but not limited to the above-mentioned memories, computer-readable storage media, etc., are all non-transitory.

[0146] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using a software program, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function according to the embodiment of the present application is generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions can be transmitted from a website site, a computer, a server or a data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (digital subscriber line, DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, server or data center. The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server, a data center, etc. that contains one or more servers that can be integrated with the medium. The available medium can be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), etc.

[0147] Although the present application is described herein in conjunction with various embodiments, in the process of implementing the claimed application, those skilled in the art may understand and implement other changes to the disclosed embodiments by viewing the drawings, the disclosure, and the appended claims. In the claims, the word "comprising" does not exclude other components or steps, and "one" or "an" does not exclude multiple situations. A single processor or other unit may implement several functions listed in a claim. Certain measures are recorded in different dependent claims, but this does not mean that these measures cannot be combined to produce good results.

[0148] Although the present application has been described in conjunction with specific features and embodiments thereof, it is obvious that various modifications and combinations may be made thereto without departing from the spirit and scope of the present application. Accordingly, this specification and the drawings are merely exemplary illustrations of the present application as defined by the appended claims, and are deemed to have covered any and all modifications, variations, combinations or equivalents within the scope of the present application. Obviously, those skilled in the art may make various modifications and variations to the present application without departing from the spirit and scope of the present application. Thus, if these modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is also intended to include these modifications and variations.

Claims

1. A machine vision task processing method, characterized in that: include: Processing at least two machine vision tasks according to a preset beat, wherein the at least two machine vision tasks include a first task and a second task that are executed successively; In which, in response to the execution time of the first task reaching a preset time, the task result of the first task is sent; the preset time is less than or equal to the interval time of the preset beat.

2. The method according to claim 1, characterized in that Also includes: Displaying a configuration interface via a display; the configuration interface includes configuration items; In response to the user's configuration operation on the configuration item, the configuration item is configured to obtain a configuration file; wherein the configuration item is used to indicate a condition for obtaining the task result and a method for obtaining the task result when the condition is met.

3. The method according to claim 2, characterized in that The configuration items include at least one of the following: A first configuration item is used to indicate a method for obtaining a conditional judgment result; the conditional judgment result is a judgment result for the condition, and the conditional judgment result is used to indicate whether a specified result exists, or whether the first task has an execution result; A second configuration item is used to indicate a first result acquisition method when the execution result exists; A third configuration item is used to indicate a second result acquisition method when the execution result does not exist; A fourth configuration item, used to indicate an object that triggers the second task, executes the second task, and / or receives a task result of the first task; The fifth configuration item is used to indicate the value of the preset duration.

4. The method according to claim 1, characterized in that: The task result of the first task includes the processing result corresponding to the target stage of the first image processing process; the second task is executed depending on the processing result corresponding to the target stage.

5. The method according to claim 2 or 3, characterized in that: Before sending the task result of the first task, the method further includes: The task result of the first task is obtained according to the condition for obtaining the task result in the configuration file and the method for obtaining the task result when the condition is met.

6. The method according to claim 5, characterized in that The obtaining of the task result of the first task according to the condition for obtaining the task result in the configuration file and the method for obtaining the task result when the condition is met includes: Obtain the conditional judgment result according to the acquisition method configured for the conditional judgment result; In response to the conditional judgment result being a specified result, determining the specified result as the task result; In response to the conditional judgment result being that an execution result exists, obtaining a final result corresponding to the execution result according to a first result acquisition method configured for the execution result, and generating the task result with the final result and / or the conditional judgment result; In response to the conditional judgment result being that there is no execution result, the corresponding final result is obtained according to the second result acquisition method configured for the absence of the execution result.

7. The method according to claim 1, characterized in that In response to the execution time of the first task reaching a preset time, sending the task result of the first task includes: If the scheduled sending function is turned on, in response to the execution time of the first task reaching a preset time, the task result of the first task is sent.

8. The method according to claim 1, characterized in that In a case where the preset duration is less than the preset beat interval duration, the sending of the task result of the first task includes: Determine the triggering duration of the first task; the triggering duration is the duration between the triggering moment of the first task and the current moment; When the trigger duration is equal to the interval duration, the task result of the first task is sent.

9. A machine vision task processing device, characterized in that: include: Processing unit; The processing unit is used to process at least two machine vision tasks according to a preset beat, and the at least two machine vision tasks include a first task and a second task that are executed successively; In which, in response to the execution time of the first task reaching a preset time, the task result of the first task is sent; the preset time is less than or equal to the interval time of the preset beat.

10. A computer device, characterized in that: include: processor; The processor is connected to a memory, the memory is used to store computer-executable instructions, and the processor executes the computer-executable instructions stored in the memory, so that the computer device implements the method according to any one of claims 1 to 8.

11. A readable storage medium, characterized in that: Used to store computer instructions, when the computer instructions are executed on a computer device, the computer device is caused to execute the method according to any one of claims 1 to 8.

Citation Information

Patent Citations

  • Method and apparatus for data transfer to the cyclic tasks in a distributed real-time system at the correct time

    AT514444A2

  • Robot early warning method and device, computer equipment and storage medium

    CN111813518A

  • Task scheduling method on SoC, electronic equipment and machine readable storage medium

    CN116560814A

  • Task allocation method and task allocation apparatus

    CN1967488A

  • Information processing apparatus, execution time correction method, and execution time correction program

    JP2017126146A