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

By setting a preset time for outputting task results in machine vision tasks, the problem of processing speed fluctuations caused by system scheduling and CPU load is solved, ensuring timely output of task results, meeting the fixed cycle time requirement, and enabling the smooth execution of subsequent tasks.

CN119785188BActive Publication Date: 2026-02-13HANGZHOU HIKROBOT TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

In machine vision tasks, factors such as system scheduling and CPU load can cause fluctuations in the processing speed of preceding tasks, making it difficult to meet the requirements of a fixed cycle time and affecting the execution of subsequent tasks.

Method used

By setting a preset duration less than or equal to a preset beat interval, the task result is output as soon as the first task execution reaches the preset duration, regardless of whether the task is completed, thus achieving timely output of the task result and decoupling the task execution and result output logic.

Benefits of technology

This ensures that the timing of result output in machine vision tasks is not affected by fluctuations in processing time, meets the requirement of a fixed cycle time, and ensures that subsequent tasks are executed on time.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119785188B_ABST
    Figure CN119785188B_ABST
Patent Text Reader

Abstract

The application discloses a machine vision task processing method and device, equipment and a storage medium, and relates to the technical field of machine vision, and is used for at least timely outputting a machine vision task processing result, and avoiding the problem that processing speed fluctuation in a previous task processing process easily leads to the problem that a beat cannot be met. 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 executed in sequence; wherein, in response to the fact that the execution time length of the first task reaches a preset time length, a task result of the first task is sent; and the preset time length is less than or equal to the interval time length 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 technical field of machine vision, and particularly relates to a machine vision task processing method and device, equipment and a storage medium. BACKGROUND

[0002] Visual software refers to software for identifying, classifying and processing images or videos. In a beat task scenario composed of at least two tasks, a later task may need to refer to a task result of an earlier task.

[0003] However, under the influence of system scheduling, central processing unit (CPU) load and other factors, the processing speed of the earlier task often fluctuates, which easily leads to a problem of failing to meet the beat. SUMMARY

[0004] Embodiments of the present application provide a machine vision task processing method, device, equipment and storage medium, which are used to output a machine vision task processing result in time and avoid a problem of failing to meet a beat caused by fluctuation of processing speed in the process of processing an earlier task.

[0005] To achieve the above object, embodiments of the present application provide the following technical solutions.

[0006] In a first aspect, a machine vision task processing method is provided, comprising: processing at least two machine vision tasks according to a preset beat, the at least two machine vision tasks comprising a first task and a second task executed in sequence. Wherein, in response to an execution time length of the first task reaching a preset time length, a task result of the first task is sent. The preset time length is less than or less than or equal to an interval time length of the preset beat.

[0007] In the technical solution, to avoid a problem of the execution time length of the first task executed in sequence exceeding the interval time length of the preset beat caused by fluctuation of time consumption in the process of processing, the preset time length is set to be less than or less than or equal to the interval time length of the preset beat, and the task result of the first task is sent when the execution time length of the first task reaches the preset time length. In this way, the task result can be sent regardless of whether the first task is completed in the case of the execution time length reaching the preset time length, so that the second task executed in sequence can be normally executed according to the preset beat.

[0008] Based on this, the application can realize 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 be output in time in the case where the machine vision task is not completed, the effect that the result feedback timing is not affected by the time consumption fluctuation in the processing process is realized, and the demand of the beat task scene is better met. Therefore, the application can be used to output the machine vision task processing result in time, and the problem that the processing speed fluctuation in the previous task processing process easily leads to the failure to meet the beat is avoided.

[0009] In a possible embodiment, the method further includes displaying a configuration interface through the display. The configuration interface includes a configuration item. In response to a configuration operation of the user on the 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 manner of obtaining the task result when the condition is met.

[0010] In a possible embodiment, the configuration item includes at least one of the following: a first configuration item used to indicate a manner of obtaining a condition judgment result. The condition judgment result is a judgment result of the condition, and the condition judgment result is used to indicate whether the specified result exists or whether the first task has an execution result. A second configuration item used to indicate a first result obtaining manner when the execution result exists. A third configuration item used to indicate a second result obtaining manner when the execution result does not exist. A fourth configuration item used to indicate an object of triggering the second task, executing the second task, and / or receiving the task result of the first task. A fifth configuration item used to indicate a value of a preset time length.

[0011] 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. The second task is executed in dependence on the processing result corresponding to the target stage.

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

[0013] In a possible embodiment, the task result of the first task is acquired according to a condition for acquiring the task result in the configuration file and an acquisition manner of the task result when the condition is met, and the condition judgment result is acquired according to the acquisition manner configured for the condition judgment result. The specified result is determined as the task result in response to the condition judgment result being the specified result. The final result corresponding to the execution result is acquired according to the first result acquisition manner configured for the execution result, and the final result and / or the condition judgment result are used to generate the task result in response to the condition judgment result being the execution result. The final result corresponding to the non-execution result is acquired according to the second result acquisition manner configured for the non-execution result in response to the condition judgment result being the non-execution result.

[0014] In a possible embodiment, the task result of the first task is sent in response to the execution duration of the first task reaching the preset duration, and the task result of the first task is sent in response to the execution duration of the first task reaching the preset duration if the timing sending function is in the open state.

[0015] In a possible embodiment, the task result of the first task is sent in a case where the preset duration is less than the interval duration of the preset beat, and the trigger duration of the first task is determined. The trigger duration is the duration between the trigger time of the first task and the current time. The task result of the first task is sent in a case where the trigger duration is equal to the interval duration.

[0016] In a second aspect, a machine vision task processing apparatus is provided, including a processing unit. The processing unit is configured to process at least two machine vision tasks according to a preset beat, the at least two machine vision tasks including a first task and a second task executed in sequence. The task result of the first task is sent in response to the execution duration of the first task reaching a preset duration. The preset duration is less than or less than or equal to an interval duration of the preset beat.

[0017] In a possible embodiment, the apparatus further includes a display unit configured to display a configuration interface through a display. The configuration interface includes a configuration item. The processing unit is further configured to configure the configuration item in response to a configuration operation of a user on the configuration item, to obtain a configuration file. The configuration item is used to indicate a condition for acquiring a task result and an acquisition manner of the task result when the condition is met.

[0018] In a possible embodiment, the configuration item includes at least one of the following: a first configuration item used to indicate an acquisition manner of a condition judgment result. The condition judgment result is a judgment result of a condition, and the condition judgment result is used to indicate whether a specified result exists or whether an execution result of the first task exists. A second configuration item used to indicate a first result acquisition manner when the execution result exists. A third configuration item used to indicate a second result acquisition manner 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. A fifth configuration item used to indicate a value of a preset time length.

[0019] 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. The second task depends on the processing result corresponding to the target stage for execution.

[0020] In a possible embodiment, the processing unit is specifically configured to: acquire the task result of the first task according to a condition for acquiring the task result in the configuration file and an acquisition manner of the task result when the condition is met.

[0021] In a possible embodiment, the processing unit is specifically configured to: acquire the condition judgment result according to the acquisition manner configured for the condition judgment result, determine the specified result as the task result in response to the condition judgment result being the specified result, acquire a final result corresponding to the execution result according to the first result acquisition manner configured for the execution result in response to the condition judgment result being the execution result, and generate the task result from the final result and / or the condition judgment result, and acquire the final result corresponding to the execution result according to the second result acquisition manner configured for the execution result in response to the condition judgment result being the execution result.

[0022] In a possible embodiment, the processing unit is specifically configured to: if the timing sending function is in an open state, send the task result of the first task in response to an execution time length of the first task reaching a preset time length.

[0023] In a possible embodiment, the processing unit is specifically configured to: determine a trigger time length of the first task. The trigger time length is a time length between a trigger time of the first task and a current time. In a case where the trigger time length is equal to the interval time length, the task result of the first task is sent.

[0024] In a third aspect, a computer device is provided, including a processor and a memory. The processor is connected with the memory, the memory is used to store computer execution instructions, and the processor executes the computer execution instructions stored in the memory, so as to implement any one of the methods provided in the first aspect.

[0025] In a fourth aspect, a readable storage medium is provided, including computer-executable instructions, which, when executed on a computer device, cause the computer device to perform any of the methods provided in the first aspect.

[0026] In a fifth aspect, a computer program product is provided, including computer-executable instructions, which, when executed on a computer device, cause the computer device to perform any of the methods provided in the first aspect.

[0027] The technical effects brought by any of the implementation manners of the second aspect to the fifth aspect can refer to the technical effects brought by the corresponding implementation manners in the first aspect, which will not be repeated here. BRIEF DESCRIPTION OF DRAWINGS

[0028] Figure 1 A schematic diagram of a machine vision task processing scenario provided by an embodiment of the present application;

[0029] Figure 2 A schematic diagram of another machine vision task processing scenario provided by an embodiment of the present application;

[0030] Figure 3 A structural schematic diagram of a computer device provided by an embodiment of the present application;

[0031] Figure 4 A flowchart of a machine vision task processing method provided by an embodiment of the present application;

[0032] Figure 5 A flowchart of another machine vision task processing method provided by an embodiment of the present application;

[0033] Figure 6 A flowchart of another machine vision task processing method provided by an embodiment of the present application;

[0034] Figure 7 A schematic diagram of a configuration interface provided by an embodiment of the present application;

[0035] Figure 8 A schematic diagram of another configuration interface provided by an embodiment of the present application;

[0036] Figure 9 A flowchart of another machine vision task processing method provided by an embodiment of the present application;

[0037] Figure 10 A structural schematic diagram of a machine vision task processing apparatus provided by an embodiment of the present application. DETAILED DESCRIPTION

[0038] In the description of the present application, unless otherwise specified, " / " means "or", for example, A / B can mean A or B. "And / or" herein is only a description of the relationship between the associated objects, which means that there can be three relationships, for example, A and / or B, which can mean that A exists alone, A and B exist together, and B exists alone. In addition, "at least one" means one or more, and "multiple" means two or more. "First", "second", and the like do not limit the quantity and execution order, and "first", "second", and the like do not necessarily mean different.

[0039] It should be noted that in this application, the words "exemplary" or "for example" are used to mean an example, illustration, or description. Any embodiment or design solution described as "exemplary" or "for example" in this application should not be interpreted as more preferred or more advantageous than other embodiments or design solutions. Rather, the use of "exemplary" or "for example" is intended to present the relevant concept in a specific manner.

[0040] First, in order to facilitate understanding of the present application, the related technologies involved in the present application will now be described.

[0041] The visual result refers to the feedback result of the visual software output that the user hopes to obtain for a single input image of the visual software. The visual software is an application program for identifying or classifying images and the like. The image input to the visual software can be an image captured when the camera is triggered, or an image generated by other means. The feedback result of the visual software output can be identification pass or identification fail, or other image detection data, etc. Identification pass or fail can be used to indicate whether the information in the image passes verification. Image detection data can be vehicle license plate information, barcode information, etc. detected from the image.

[0042] Subscription refers to associating the input value of a module with the output value of the previous module to take the latest output value of the previous module as the input value of the one module.

[0043] Secondly, the application scenarios involved in the present application will be briefly introduced.

[0044] In the scenario where the visual software executes tasks at a fixed tempo, when the host computer executes a task at a tempo, the task after the previous task may need to refer to the task result of the previous task, and the visual software is required to output the image processing result corresponding to the task in time so as to execute the next task at a tempo.

[0045] However, under the influence of system scheduling, CPU load and other factors, the processing speed of the previous task often fluctuates, which easily leads to the problem that the task execution tempo cannot be met.

[0046] In one possible example, such as Figure 1 The diagram shown is a schematic representation of a machine vision task processing scenario provided in an embodiment of this application. A workpiece placed on a conveyor belt can move with the conveyor belt to the processing area of ​​station 1, and then move from the processing area of ​​station 1 to the processing area of ​​station 2. Furthermore, 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.

[0047] After the workpiece arrives at the processing area of ​​workstation 1, the camera device at workstation 1 captures image information including the workpiece and sends it to the computer. The vision software on the computer then performs recognition or detection based on the captured image information. In this case, the vision software needs to output the processing results before the workpiece arrives at the processing area of ​​workstation 2, so that workstation 2 can perform the corresponding processing.

[0048] Another possible example, such as Figure 2 The diagram illustrates another machine vision task processing scenario provided in this application embodiment. Users can set up timed triggers for the vision software in a computer device and configure the software to output processing results (i.e., output IO signals) through input / output (IO) ports. In this case, if the vision software fails to output the processing results through the IO port before the next trigger, the IO signals corresponding to the two triggers may overlap, making them indistinguishable.

[0049] For example, Figure 2 If the I / O signal corresponding to the first trigger in the process is output before the start time of the second trigger, then the I / O signal can be distinguished as the processing result of the first trigger. For example, Figure 2 The IO signal corresponding to the second trigger was not completed before the start time of the second trigger. The processing speed of the third trigger was faster, and the IO signals corresponding to the second and third triggers overlapped into one IO signal. It was impossible to distinguish whether the 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 the triggers and the outputs.

[0050] Next, a brief introduction will be given to the implementation environment (implementation architecture) involved in this application.

[0051] This application provides a machine vision task processing method that can be applied to computer equipment. The computer equipment can have image recognition or detection processing functions and can provide image processing results within a specified time, thereby providing a service of providing timed feedback of image processing results.

[0052] The embodiments of the present application do not make any limitation on the specific form of the computer device. For example, the computer device can be specifically a terminal device for providing a service of image processing result with timing feedback, or a network device for providing a service of image processing result with timing feedback. The terminal device can be referred to as a terminal, user equipment (UE), terminal device, mobile device, user terminal, user agent or user apparatus, etc. The terminal device can be specifically a mobile phone, tablet computer, notebook computer, ultra-mobile personal computer (UMPC), netbook, personal digital assistant (PDA), etc. The network device can be specifically a server, etc. The server can be one physical or logical server, or two or more physical or logical servers sharing different responsibilities, cooperating with each other to implement the functions of the server.

[0053] In hardware implementation, the above computer device can be implemented through a computer device as shown in Figure 3 The computer device as shown in Figure 3 provides a structural schematic diagram of a computer device 10 according to an embodiment of the present application. The computer device 10 can be used to implement the functions of the above computer device.

[0054] Figure 3 The computer device 10 can 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 can be connected through the bus 104.

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

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

[0057] ​The memory 102 can be a read-only memory (ROM) or other type of static storage device that can store static information and instructions, a random access memory (RAM) or other type of dynamic storage device that can store information and instructions, an electrically erasable programmable read-only memory (EEPROM), a magnetic 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 that can be accessed by a computer, but is not limited thereto.

[0058] In a possible implementation, the memory 102 can exist independently of the processor 101. The memory 102 can be connected to the processor 101 through the bus 104, and used to store data, instructions or program code. When the processor 101 invokes and executes the instructions or program code stored in the memory 102, the machine vision task processing method provided in the embodiments of the present application can be implemented.

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

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

[0061] The bus 104 can be an industry standard architecture (ISA) bus, a peripheral component interconnect (PCI) bus, an extended industry standard architecture (EISA) bus, etc. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 3 In the drawings, only one thick line is used to represent the bus, but it does not mean that there is only one bus or only one type of bus.

[0062] It should be noted that Figure 3 The structure shown in the drawings does not constitute a limitation on the computer device 10, except Figure 3In addition to the illustrated components, computer device 10 can include more or fewer components than shown, or a different arrangement of the components, or combinations of components.

[0063] For the convenience of understanding, the machine vision task processing method provided in the present application is specifically introduced below in combination with the drawings.

[0064] As shown in Figure 4 , a flowchart of a machine vision task processing method provided by an embodiment of the present application. The method comprises S401.

[0065] S401: processing at least two machine vision tasks according to a preset beat.

[0066] The preset beat is a task execution beat according to a fixed interval length, which can also be called a preset period or other names, without limitation.

[0067] The at least two machine vision tasks include a first task and a second task executed in sequence. The machine vision task can be a task of identifying, classifying or information extracting, etc. on an image. One machine vision task can be used to execute multiple stages of an image processing process. The image can be an image of an actual scene captured by a camera, or a virtual image generated by artificial intelligence or an image editor, etc. For example, the image of the actual scene captured by the camera can be an image of a workpiece as shown in Figure 1 , or an image of a vehicle on a traffic road, etc.

[0068] Optionally, the first task and the second task can be two machine vision tasks that are not related to each other, or two machine vision tasks that have a dependency relationship. In the case that the first task and the second task are not related to each other, the first task and the second task can be tasks of executing the same processing process on different images. In the case that the first task and the second task have a dependency relationship, the second task can 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 can include the processing result corresponding to the target stage of the first image processing process, so as to execute the second task. The target stage can be any stage of the multiple stages executed by the first task, without limitation.

[0069] Exemplarily, as shown in Figure 5 , the image processing process can include multiple stages of obtaining an image source, connected component analysis based on binary large object (Blob) analysis, contour matching, position correction, circle finding, combination module and line circle measurement. The first task can be used to execute the multiple stages. The target stage can be the circle finding stage, or the line circle measurement stage, or other stages.

[0070] It should be noted that in the process of processing at least two machine vision tasks according to the preset rhythm, the computer device needs to output the task result of one machine vision task within a preset time length after starting to execute the machine vision task. The preset time length can be less than or equal to the interval length of the preset rhythm. In this way, the computer device can output the task result of the one machine vision task before the next machine vision task triggers execution, so that each machine vision task is executed according to the preset rhythm to meet business requirements.

[0071] For example, for a first task and a second task executed in sequence, in combination with Figure 1 , it is assumed that the first task is used to execute the processing process of the image captured by the camera device corresponding to the processing area of the first station. In this case, the fixed time interval of the preset rhythm can be the transmission time required for the workpiece to move from the processing area of the first station to the processing area of the second station along the conveying belt. The preset time length can be less than or less than or equal to the transmission time. For example, in combination with Figure 2 , it is assumed that the first task is used to execute the processing process of the image triggered for the first time. In this case, the fixed time interval of the preset rhythm can be the interval time between the start time of the first trigger and the start time of the second trigger. The preset time length can be less than or less than or equal to the interval time.

[0072] 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 has actually executed the preset time length, 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, avoiding 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 length.

[0073] Alternatively, when the computer device starts to execute the first task, a timer can be started to count down the preset time length. In this way, when the timer countdown ends, the computer device can determine that the first task has actually executed the preset time length.

[0074] Alternatively, when the computer device starts to execute the first task, a timer can be started to count down the preset time length. In this way, when the timer countdown ends, the computer device can determine that the first task has actually executed the preset time length.

[0075] In a possible manner, the first task does not have the task result in a case that the first task is not completed within the preset time length. In a case that the first task is completed within the preset time length, the task result of the first task includes the first type result or the second type result. For example, the first task can be used to identify whether a vehicle exists in an image. The first type result can be that the vehicle exists in the image, and the second type result can be that the vehicle does not exist in the image. For another example, the first task can be used to detect a vehicle license plate in an image. 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 the vehicle license plate does not exist in the image.

[0076] Based on this, the computer device can preset the obtaining manner of the final result in a case that the first task does not have the task result, the first task has the first type result, and the first task has the second type result, respectively. The computer device can obtain the results according to the preset obtaining manner in response to the execution time length of the first task reaching the preset time length, and further use the obtained results as the task result of the first task. It should be understood that, for one task, the computer device does not obtain multiple results when obtaining the results according to the preset obtaining manner, but obtains the result actually existing for the one task.

[0077] In this way, the computer device can output the task result of the first task at the preset time length regardless of whether the first task is completed, meets the requirement of executing the task according to the preset rhythm, and achieves the effect that the result feedback time is not affected by the time consumption fluctuation in the task processing process, to better meet the requirement of more machine vision task processing scenarios. Therefore, the present application can be used to output the task processing result in time, and avoid the problem that the time consumption fluctuation in the processing process easily affects the result output time.

[0078] In a possible embodiment, the triggering manner of the machine vision task can be a timing trigger or an event trigger. If the triggering manner of the machine vision task is the timing trigger, the timing time length can be the interval time length of the preset rhythm.

[0079] If the triggering manner of the machine vision task is the event trigger, the event can be that the computer device sends the task result of the previous machine vision task. 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 time length is equal to the interval time length of the preset rhythm, the computer device can send the task result of the first task in response to the execution time length of the first task reaching the preset time length, and trigger the execution of the second task according to the preset rhythm.

[0080] If the preset time length is less than the interval time length of the preset rhythm, the computer device needs to wait until the execution time length of the first task reaches the interval time length of the preset rhythm, and then send the task result of the first task, so as to trigger the execution of the second task according to the preset rhythm. That is, in the case where the preset time length is less than the interval time length of the preset rhythm, when the computer device sends the task result of the first task, the trigger time length of the first task can be determined. The trigger time length is the time length between the trigger time of the first task and the current time. If the trigger time length of the first task is less than the interval time length of the preset rhythm, the computer device can continue to wait. If the trigger time length of the first task is equal to the interval time length of the preset rhythm, 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 rhythm.

[0081] In a possible embodiment, in order to make the computer device output the task result when the execution time length of the task reaches the preset time length, the execution logic of the computer device can be configured as a timing sending function, and the timing sending function supports editing of the on-off state. In this case, in the process of S401 performed by the computer device, it can be judged whether the timing sending function is turned on. If the timing sending function is in the on state, the computer device can send the task result of the first task in response to the execution time length of the first task reaching the preset time length. If the timing sending function is in the off state, the computer device does not perform the process of sending the task result of the first task in response to the execution time length of the first task reaching the preset time length in the process of S401.

[0082] In an embodiment, the computer device can be configured with a display, and various result acquisition modes and preset time lengths can be configured through a configuration interface. As shown in FIG. 13, it is a flowchart of another machine vision task processing method provided by an embodiment of the present application. Figure 6 Figure 6 The machine vision task processing method shown includes S501-S502.

[0083] S501: Display a configuration interface through the display.

[0084] The configuration interface includes a configuration item. The configuration item can be used to indicate the condition for acquiring the task result, and the acquisition mode of the task result when the condition is met.

[0085] Optionally, the configuration item can include at least one of the following: a first configuration item for indicating the acquisition mode of the condition judgment result, a second configuration item for indicating the first result acquisition mode when there is an execution result, a third configuration item for indicating the second result acquisition mode when there is no execution result, a fourth configuration item for indicating the object that triggers the second task, executes the second task and / or receives the task result of the first task, and a fifth configuration item for indicating the value of the preset time length.

[0086] ​The condition judgment result is a judgment result of a condition indicating an acquisition task result. The condition judgment result is used to indicate whether a specified result exists or whether a first task has an execution result.

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

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

[0089] The user can perform a configuration operation on each configuration item in the configuration interface through a keyboard or a mouse and the like. In response to the configuration operation of the user, the computer device can generate configuration information of each configuration item, configure the configuration item, and obtain a configuration file.

[0090] In an embodiment, the computer device can obtain a task result of the first task based on the configuration file before sending the task result of the first task. In this case, the machine vision task processing method provided in the embodiments of the present application further includes S601.

[0091] S601: The task result of the first task is obtained according to a condition for obtaining a task result in the configuration file and an acquisition manner of the task result when the condition is met.

[0092] The computer device can perform condition 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 an acquisition manner corresponding to a condition judgment result.

[0093] In an optional implementation, when the computer device performs S601, that is, obtains the task result of the first task according to the condition for obtaining the task result in the configuration file and the acquisition manner of the task result when the condition is met, S6011-S6014 can be included.

[0094] S6011: The condition judgment result is obtained according to an acquisition manner configured for the condition judgment result.

[0095] S6012: In response to the condition judgment result being a specified result, the specified result is determined as the task result.

[0096] If the value obtained based on the obtaining manner configured for the condition judgment result is a constant, the condition judgment result is a fixed value, which can be used to indicate that the specified result exists. In this case, the computer device determines the specified result as the task result and sends it in response to the condition judgment result being the specified result during the process of executing at least two machine vision tasks according to the preset rhythm. For example, in the case of heartbeat communication between the computer device and other devices, the specified result can be a heartbeat packet.

[0097] S6013: In response to the condition judgment result being the execution result exists, the computer device obtains the final result corresponding to the execution result according to the first result obtaining manner configured for the execution result, and generates the task result based on the final result and / or the condition judgment result.

[0098] If the value obtained based on the obtaining manner configured for the condition judgment result is a subscription value of the execution state of the first task, the condition judgment result is a variable value indicating whether the execution state of the first task is completed or not completed, which can be used to indicate whether the first task has an execution result. If the condition judgment result is the execution result exists, the computer device can obtain the final result corresponding to the execution result according to the first result obtaining manner configured for the execution result in response to the condition judgment result being the execution result exists, and generate the task result based on the final result and / or the condition judgment result.

[0099] Further, considering that the first task has an execution result, the execution result can be different first result or second result. For example, the first task can be used to identify whether a vehicle exists in an image. The first result can be that a vehicle exists in the image, and the second result can be that a vehicle does not exist in the image. For another example, the first task can be used to detect a vehicle license plate in an image. The first result can be a vehicle license plate in the image, and the second result can be a value indicating that a vehicle license plate does not exist in the image. In this case, the first result obtaining manner can include a first obtaining manner corresponding to the first result and a second obtaining manner corresponding to the second result, so as to determine different task results corresponding to different execution results.

[0100] S6014: In response to the condition judgment result being the execution result does not exist, the computer device obtains the corresponding final result according to the second result obtaining manner configured for the execution result does not exist.

[0101] If the condition judgment result is the execution result does not exist, it can indicate that the first task is currently still not 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 the corresponding final result according to the second result obtaining manner configured for the execution result does not exist and send it.

[0102] Optionally, the computer device can obtain a constant value based on the second result obtaining manner. The constant value can be used to indicate that the first task does not exist an execution result.

[0103] Alternatively, the computer device can obtain a result value of an intermediate step of the first task based on the second result obtaining manner. For example, in combination with the task processing process shown in Figure 5 , if the first task does not obtain the execution result of the line circle measurement before reaching the preset time length when executing the task processing process, the second result obtaining manner can indicate to obtain a result value of an intermediate step such as contour matching or circle finding, and send the result value as the final result of the first task, so that the task execution beat is not affected.

[0104] For example, as shown in Figure 7 , a configuration interface provided by an embodiment of the present application is shown. Among them, the editing box corresponding to the condition judgment can be used to edit the obtaining manner of the condition judgment result, corresponding to the first configuration item. The editing boxes corresponding to the first result sending and the second result sending can be used to edit the obtaining manner of different types of results when the task exists an execution result, which can be regarded as two sub-configuration items of the second configuration item. The editing box corresponding to the timeout sending can be used to edit the second result obtaining manner when there is no execution result, corresponding to the third configuration item. The editing box corresponding to the sending object can be used to edit the object triggering the second task, executing the second task and / or receiving the task result of the first task, corresponding to the fourth configuration item. The editing box corresponding to the time interval can be used to edit the value of the preset time length, corresponding to the fifth configuration item.

[0105] In the scene of transmitting the task result in a communication manner, as shown in Figure 7 , in combination with the machine vision task processing scene shown in Figure 1 and the task processing process shown in Figure 5 , the user can perform a configuration operation for each configuration item in the configuration interface, indicating that the time interval is 100 milliseconds, and indicating that the sending object is a transmission control protocol (TCP) client, and indicating that the condition judgment item is "line circle measurement, execution state", and indicating that the first result sending item is "line circle measurement, straight line angle", and 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 state" and "line circle measurement, straight line angle" are subscription values. "Line circle measurement, execution state" is used to indicate the storage location of the value corresponding to the execution state 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 execution but does not obtain the straight line angle. "Preset result" is used to indicate that the task is not completed execution.

[0106] Thus, the preset time length is 100 milliseconds. The computer device can obtain the execution state corresponding to the line-circle measurement stage in the case that 100 milliseconds is reached. If the execution state 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 state corresponding to the line-circle measurement stage is complete execution, the computer device determines that there is an execution result. Further, if the execution result is an expected value, the computer device determines to obtain a first result (i.e., determines 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 a non-expected value, the computer device determines to obtain a second result (i.e., determines to be false), and obtains "NG" according to the second result sending item for sending.

[0107] In combination with the above Figure 7 , as shown in Figure 8 , another configuration interface provided by the embodiment of the present application is shown. In the scene that the task result is transmitted in the pin mode, in combination with the machine vision task processing scene shown in Figure 2 and the task processing process shown in Figure 5 , the user can perform the configuration operation for each configuration item in the configuration interface, indicate that the time interval is 100 milliseconds, and indicate that the sending object item is the vision processor, and indicate that the condition judgment item is "line-circle measurement, execution state", and indicate that the first result sending item is IO1, and indicate that the second result sending item is IO2, and indicate that the timeout sending item is IO3.

[0108] Thus, the preset time length is 100 milliseconds. The computer device can obtain the execution state corresponding to the line-circle measurement stage in the case that 100 milliseconds is reached. If the execution state 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 state corresponding to the line-circle measurement stage is complete execution, the computer device determines that there is an execution result. Further, if the execution result is an expected value, the computer device determines to obtain a first result (i.e., determines 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 a non-expected value, the computer device determines to obtain a second result (i.e., determines to be false), and obtains "NG" according to the second result sending item for sending.

[0109] Exemplarily, as shown in Figure 9 , a flowchart of another machine vision task processing method provided by the embodiment of the present application is shown. Figure 9The thread execution flow method for realizing the timing sending in the task processing process is shown, including: S701-S722. Wherein, S701-S709 is the flow execution thread, S710-S711 is the timing thread, and S712-S722 is the working thread. Wherein, S707-S709 is the optional execution step. For example, in the case that the trigger mode of the machine vision task is event trigger, and the event is the task result of the previous machine vision task, the computer device can execute S707-S709, so as to trigger the execution of the second task according to the preset rhythm.

[0110] S701: Start execution.

[0111] S702: Whether to enable timing sending.

[0112] S703: Set timing.

[0113] S704: Execute task.

[0114] S705: Whether to enable timing sending.

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

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

[0117] S708: Determine the trigger duration.

[0118] S709: Send the final result.

[0119] S710: Start timing.

[0120] S711: Timing is completed.

[0121] S712: Whether the execution is completed.

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

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

[0124] S715: Output the first result.

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

[0126] S717: Output the second result.

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

[0128] S719: Output the preset result.

[0129] S720: Output error value.

[0130] S721: Output is completed.

[0131] S722: sending flow communication completion information.

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

[0133] In the above flow, after the flow execution thread of the computer device starts to execute the task processing process, it can be determined whether to enable the timing sending. If the timing sending is enabled, the flow 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 the timing sending is not enabled, the flow execution thread of the computer device can directly execute the task. Then, after the flow execution thread of the computer device executes the task, it can be verified whether the timing sending is enabled. If the timing sending is enabled, the flow execution thread of the computer device can wait until the timing sending is completed to determine the end of execution. If the timing sending is not enabled, the flow execution thread of the computer device can directly determine the end of execution.

[0134] 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 re-determine 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, i.e., the task result of the first task, so as to trigger the execution of the second task according to the preset beat.

[0135] In the case where the timing thread of the computer device completes timing, the working thread of the computer device can determine whether the first task is executed. If the first task is executed, 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 the output completion, and send the flow communication completion information to the flow execution thread.

[0136] 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 the output completion, and send the flow communication completion information to the flow execution thread.

[0137] If the first task is not executed completely, 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 an error value as the task result of the first task. And the working thread of the computer device determines that the output is completed, and sends the process communication completion information to the process execution thread.

[0138] Based on this, the present application can support the timing sending of image processing results, realize the decoupling of image processing logic and result output logic, make the result feedback time not affected by the time consumption fluctuation in the processing process, and better meet the needs of more machine vision task processing scenes.

[0139] The above mainly introduces the scheme of the embodiments of the present application from the perspective of the method. It can be understood that the computer device includes at least one of the corresponding hardware structure and software module for implementing each function. Those skilled in the art should easily realize that the units and algorithm steps of each example described in combination with the embodiments disclosed in the present application can be realized in the form of hardware or a combination of hardware and computer software. Whether a certain function is implemented in hardware or computer software driven hardware depends on the specific application and design constraints of the technical solution. Professional technicians can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of the present application.

[0140] The embodiments of the present application can divide the computer device into functional units according to the above method examples. 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 integrated unit can be realized in the form of hardware or software functional unit. It should be noted that the division of units in the embodiments of the present application is illustrative, and is only a logical function division. Actual implementation can have another division method.

[0141] An example of the computer device is shown in the following. Figure 10 A structural schematic diagram of a machine vision task processing apparatus is shown. The machine vision task processing apparatus 20 can be used to execute the method involved in the above embodiments. The machine vision task processing apparatus 20 includes a processing unit 801.

[0142] The processing unit 801 is configured to process at least two machine vision tasks according to a preset beat, the at least two machine vision tasks including a first task and a second task executed in sequence. In response to a duration of execution of the first task reaching a preset duration, a task result of the first task is sent. The preset duration is less than or equal to an interval duration of the preset beat.

[0143] In a possible implementation, the apparatus further includes a display unit 802, and the display unit 802 is configured to display a configuration interface through a display. The configuration interface includes a configuration item. The processing unit 801 is further configured to, in response to a configuration operation of the user on the configuration item, configure the configuration item to obtain a configuration file. The configuration item is used to indicate a condition for obtaining a task result, and an obtaining manner of the task result when the condition is met.

[0144] In a possible implementation, the configuration item includes at least one of the following: a first configuration item used to indicate an obtaining manner of a condition judgment result. The condition judgment result is a judgment result of the condition, and the condition judgment result is used to indicate whether a specified result exists or whether an execution result of the first task exists. A second configuration item used to indicate a first result obtaining manner when the execution result exists. A third configuration item used to indicate a second result obtaining manner when the execution result does not exist. A fourth configuration item used to indicate an object triggering the second task, executing the second task, and / or receiving the task result of the first task. A fifth configuration item used to indicate a value of the preset duration.

[0145] In a possible implementation, the task result of the first task includes a processing result corresponding to a target stage of a first image processing process. The second task is executed in dependence on the processing result corresponding to the target stage.

[0146] In a possible implementation, 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 and the obtaining manner of the task result when the condition is met in the configuration file.

[0147] In a possible implementation, the processing unit 801 is specifically configured to: obtain the condition judgment result according to the obtaining manner configured for the condition judgment result. In response to the condition judgment result being the specified result, the specified result is determined as the task result. In response to the condition judgment result being the execution result, a final result corresponding to the execution result is obtained according to the first result obtaining manner configured for the execution result, and the final result and / or the condition judgment result are generated to obtain the task result. In response to the condition judgment result being the non-execution result, a corresponding final result is obtained according to the second result obtaining manner configured for the non-execution result.

[0148] In one possible embodiment, the processing unit 801 is specifically configured to: if the timed sending function is enabled, then in response to the execution time of the first task reaching a preset time, send the task result of the first task.

[0149] In one possible embodiment, the processing unit 801 is specifically configured to: determine the trigger duration of the first task. The trigger duration is the time interval between the trigger time of the first task and the current time. If the trigger duration equals the interval duration, the task result of the first task is sent.

[0150] For a detailed description of the above-mentioned optional methods, please refer to the foregoing method embodiments, which will not be repeated here. Furthermore, the explanation of any of the computer devices provided above and the description of their beneficial effects can be found in the corresponding method embodiments described above, and will not be repeated here.

[0151] As an example, combined Figure 3 The processing unit 801 and display unit 802 in the machine vision task processing device 20 may have some or all of their functions through [the following]. Figure 3 Processor 101 in the middle executes Figure 3 The program code is implemented in memory 102.

[0152] This application also provides a computer-readable storage medium storing a computer program that, when run on a computer, causes the computer to perform the methods executed by any of the computer devices described above.

[0153] For explanations of the relevant content and descriptions of the beneficial effects in any of the computer-readable storage media provided above, please refer to the corresponding embodiments described above, which will not be repeated here.

[0154] The embodiments of the present application further provide a computer program product containing instructions, which, when executed on a computer, cause the computer to perform any of the above-mentioned 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 embodiments 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 devices. The computer instructions can be stored in a computer-readable storage medium or transferred from one computer-readable storage medium to another computer-readable storage medium, for example, the computer instructions can be transferred from one website, computer, server or data center to another website, computer, server or data center through wired (for example, coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (for example, infrared, wireless, microwave, etc.) mode. The computer-readable storage medium can be any available medium that can be accessed by a computer or include one or more data storage devices such as servers, data centers, etc. that can be integrated with the medium. The available medium can be a magnetic medium (for example, a floppy disk, a hard disk, a magnetic tape), an optical medium (for example, a DVD), etc.

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

[0156] In the above embodiments, all or part can be implemented by software, hardware, firmware or any combination thereof. When implemented by software, all or part can be implemented 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, all or part of the processes or functions according to the embodiments of the present application are generated. The computer can be a general purpose computer, a special purpose computer, a computer network, or other programmable devices. 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 one website site, computer, server or data center to another website site, computer, server or data center through wired (for example, coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (for example, infrared, wireless, microwave, etc.) mode. The computer readable storage medium can be any available medium that can be accessed by a computer or data storage device such as one or more servers, data centers, etc. integrated with one or more media. The available media can be magnetic media (for example, floppy disk, hard disk, magnetic tape), optical media (for example, DVD) and the like.

[0157] Although the present application is described herein in conjunction with various embodiments, it is understood that other variations of the disclosed embodiments can be understood and effected by those skilled in the art in practicing the claimed application, from an inspection of the drawings, the disclosure, and the appended claims. In the claims, the word "comprising" does not exclude other components or steps, and the indefinite articles "a" or "an" do not exclude a plurality. A single processor or other unit can fulfill the functions of several items recited in the claims. The mere fact that certain measures are recited in mutually different dependent claims does not indicate that a combination of these measures cannot be used to advantage.

[0158] Although the present application is described herein in conjunction with specific features and embodiments thereof, it is understood that modifications and combinations can be made thereto within the spirit and scope of the application. Accordingly, the description and drawings are to be regarded as illustrative in nature and are not to be taken as limiting the scope of the application as defined only by the appended claims. Obviously, many modifications and variations of this application are possible in light of the above teachings. It is, therefore, to be understood that within the scope of the appended claims and their equivalents, the application can be practiced otherwise than as specifically described.

Claims

1. A method of processing a machine vision task, the method comprising: The method comprises: processing at least two machine vision tasks according to a preset beat, the at least two machine vision tasks comprising a first task and a second task executed in sequence; wherein, in response to the execution time length of the first task reaching a preset time length, a task result of the first task is sent; the preset time length is less than or equal to the interval time length of the preset beat; the task result of the first task comprises a processing result corresponding to a target stage of a first image processing process; the second task is executed in dependence on the processing result corresponding to the target stage; the target stage is any stage of a plurality of stages executed by the first task.

2. The method of claim 1, wherein, The method further comprises: displaying a configuration interface through a display; the configuration interface comprises a configuration item; in response to a configuration operation of a user on the configuration item, configuring the configuration item to obtain a configuration file; wherein the configuration item is used to indicate a condition for obtaining the task result, and an obtaining manner of the task result when the condition is met.

3. The method of claim 2, wherein, The configuration item comprises at least one of: a first configuration item used to indicate an obtaining manner of a condition judgment result; the condition judgment result is a judgment result of the condition, and the condition judgment result is used to indicate whether there is a specified result or whether there is an execution result of the first task; a second configuration item used to indicate a first result obtaining manner when the execution result exists; a third configuration item used to indicate a second result obtaining manner when the execution result does not exist; a fourth configuration item used to indicate an object triggering the second task, executing the second task and / or receiving the task result of the first task; a fifth configuration item used to indicate a value of a preset time length.

4. The method according to claim 2 or 3, characterized in that, Before the task result of the first task is sent, the method further comprises: obtaining the task result of the first task according to the condition for obtaining the task result in the configuration file and the obtaining manner of the task result when the condition is met.

5. The method of claim 4, wherein, 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 obtaining manner of the task result when the condition is met comprises: obtaining a condition judgment result according to the obtaining manner configured for the condition judgment result; in response to the condition judgment result being a specified result, determining the specified result as the task result; in response to the condition judgment result being an execution result, obtaining a final result corresponding to the execution result according to the first result obtaining manner configured for the execution result, and generating the task result from the final result and / or the condition judgment result; in response to the condition judgment result being no execution result, obtaining a corresponding final result according to the second result obtaining manner configured for the no execution result.

6. The method of claim 1, wherein, The sending of the task result of the first task in response to the execution time length of the first task reaching a preset time length comprises: if a timing sending function is in an open state, then in response to the execution time length of the first task reaching a preset time length, the task result of the first task is sent.

7. The method of claim 1, wherein, In the case where the preset time length is less than the interval time length of the preset beat, the sending of the task result of the first task comprises: determine a trigger duration of the first task; the trigger duration is a duration between a trigger time of the first task and a current time; in a case where the trigger duration is equal to the interval duration, send a task result of the first task.

8. A machine vision task processing apparatus characterized by comprising: comprising: a processing unit; the processing unit is configured to process at least two machine vision tasks according to a preset beat, the at least two machine vision tasks comprising a first task and a second task executed in sequence; wherein, in response to an execution duration of the first task reaching a preset duration, a task result of the first task is sent; the preset duration is less than or equal to an interval duration of the preset beat; the task result of the first task comprises a processing result corresponding to a target stage of a first image processing process; the second task is executed in dependence on the processing result corresponding to the target stage; the target stage is any stage of a plurality of stages executed by the first task.

9. A computer device, comprising: comprising: a processor; the processor is connected with a memory, the memory is used for storing computer execution instructions, the processor executes the computer execution instructions stored in the memory, so that the computer equipment realizes the method in any one of claims 1-7.

10. A readable storage medium, characterized by, a computer instruction for storing, when the computer instruction runs on a computer equipment, so that the computer equipment executes the method in any one of claims 1-7.

Citation Information

Patent Citations

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

    CN111813518A

  • Method, server and computer program for providing task automation service using robotic process automation portal

    KR102411816B1