Method, device, camera equipment and medium for adjusting IO trigger signal
By counting and adjusting the frequency of the IO trigger signal in real time in the camera equipment operating system, the problem of difficult to ensure the accuracy of the IO trigger signal on the industrial production assembly line is solved, efficient and accurate image acquisition is achieved, and the overall efficiency of the production assembly line is improved.
Patent Information
- Application Number
- CN202411900867.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-23
- Publication Date
- 2025-04-01
- Estimated Expiration
- 2044-12-23
AI Technical Summary
On the high-speed industrial production assembly line, the time interval of the IO trigger signal is short and requires accurate. It is difficult for the prior art to monitor and adjust the IO trigger signal in real time, resulting in leaky triggers or multiple triggers, affecting the flexibility and adaptability of the production assembly line.
By counting the number of IO trigger signals and system startup time in real time in the operating system of the camera device, the difference between the actual interval and the preset interval is calculated, and the frequency of the IO trigger signal is adjusted to ensure the accurate triggering of the signal.
Real-time monitoring and adjustment of IO trigger signals in industrial production assembly line scenarios are realized, so that the camera can accurately capture product images, timely discover production problems, reduce downtime, and improve the production efficiency of the assembly line.
Smart Images

Figure CN119383319B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology and provides a method, device, camera equipment and medium for adjusting an IO trigger signal. Background Art
[0002] In the industrial production process, cameras are widely used in quality inspection, production monitoring and other fields. In order to accurately capture the image at a certain moment in the production process, IO triggering is usually used to control the camera's exposure and image capture.
[0003] IO triggering refers to triggering the camera to expose and capture images through input / output signals. This method can ensure image acquisition at a specific time point. However, on high-speed industrial production lines, the time interval of IO trigger signals is very short and requires precision. Under high-frequency triggering, missed triggering or multiple triggering may occur. Existing technologies make it difficult to monitor and adjust IO trigger signals in real time, affecting the flexibility and adaptability of industrial production lines. Summary of the invention
[0004] The present application provides an IO trigger signal adjustment method, device, camera equipment and medium, which are used to solve the problem of how to monitor and adjust the IO trigger signal in real time in an industrial production line scenario.
[0005] In a first aspect, a method for adjusting an IO trigger signal is provided, the method being applied to an operating system of a camera device, the operating system storing statistical files of multiple trigger devices, the camera device further comprising a camera; the method comprising:
[0006] Receiving an IO trigger signal generated by any trigger device among the multiple trigger devices, and obtaining the first system startup time at the current moment; wherein the IO trigger signal is used to generate a trigger instruction; the trigger instruction is used to control the camera to shoot products on the industrial production line;
[0007] Obtain the latest number of signals written in the statistical file of any trigger device and the second system startup time; wherein the number of signals is the number of IO trigger signals generated by any trigger device that have been received; the second system startup time is the system startup time when the IO trigger signal generated by any trigger device was last received;
[0008] Add 1 to the signal number to obtain a new signal number, and write the new signal number and the first system startup time into a statistical file of any trigger device;
[0009] According to the actual interval between the first system startup time and the second system startup time, the frequency of any trigger device generating the IO trigger signal is adjusted.
[0010] Optionally, adjusting the frequency of generating the IO trigger signal by any trigger device according to an actual interval between the first system startup time and the second system startup time includes:
[0011] Determine an actual interval between the first system startup time and the second system startup time;
[0012] According to the difference between the actual interval and the preset interval, the frequency of the IO trigger signal generated by any trigger device is adjusted; the preset interval is the time interval preset by any trigger device for generating two IO trigger signals.
[0013] Optionally, adjusting the frequency of generating the IO trigger signal by any trigger device according to the difference between the actual interval and the preset interval includes:
[0014] If the difference between the actual interval and the preset interval is not equal to zero, then according to the absolute value of the difference, any one of the trigger devices is adjusted so that the frequency of the IO trigger signal generated by any one of the trigger devices is the preset frequency corresponding to the preset interval; the preset frequency is to generate an IO trigger signal every preset interval.
[0015] Optionally, a plurality of products are placed at equal intervals on the industrial production line; if the difference between the actual interval and the preset interval is not equal to zero, before adjusting any trigger device according to the absolute value of the difference, the method further includes:
[0016] The ratio between the distance between two adjacent products on the industrial production line and the running speed of the industrial production line is determined as the preset interval.
[0017] Optionally, any one of the trigger devices is integrated into the camera device; and adjusting any one of the trigger devices includes:
[0018] Through the API interface exposed by any trigger device, any trigger device is adjusted.
[0019] Optionally, after receiving an IO trigger signal from any trigger device among the multiple trigger devices, the method further includes:
[0020] Sending the trigger instruction to the camera;
[0021] Obtaining the number of trigger instructions received by the camera;
[0022] If the number of instructions is less than the number of new signals, it is determined that a connection failure occurs between the operating system and the camera.
[0023] Optionally, the operating system stores device files of multiple trigger devices; after receiving an IO trigger signal of any trigger device among the multiple trigger devices, the method further includes:
[0024] Generate a signal event including an event type, and write the signal event into a device file of any trigger device;
[0025] The method of obtaining the latest written signal number and the second system startup time in the statistical file of any trigger device includes:
[0026] When it is detected that the device file of any trigger device contains an event type and the value of the event type is a preset value, the number of signals most recently written in the statistical file of any trigger device and the second system startup time are obtained; the preset value is used to represent the receipt of the IO trigger signal.
[0027] In a second aspect, a device for adjusting an IO trigger signal is provided, wherein the device is arranged in an operating system of a camera device, wherein the operating system stores statistical files of a plurality of trigger devices, and the camera device further comprises a camera; the device comprises:
[0028] An acquisition module is used to receive an IO trigger signal generated by any trigger device among the multiple trigger devices, and acquire the first system startup time at the current moment; acquire the number of signals and the second system startup time that are most recently written in the statistical file of any trigger device; wherein the IO trigger signal is used to generate a trigger instruction; the trigger instruction is used to control the camera to shoot products on the industrial production line; the number of signals is the number of IO trigger signals generated by any trigger device that have been received; the second system startup time is the system startup time when the IO trigger signal generated by any trigger device was last received;
[0029] A writing module, used for adding 1 to the signal quantity to obtain a new signal quantity, and writing the new signal quantity and the first system startup time into a statistical file of any trigger device;
[0030] The adjustment module is used to adjust the frequency of any trigger device generating the IO trigger signal according to the actual interval between the first system startup time and the second system startup time.
[0031] In a third aspect, the present application provides a camera device, comprising a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the method for adjusting the IO trigger signal described in the first aspect.
[0032] In a fourth aspect, the present application provides a computer-readable storage medium having a computer program stored thereon, and a processor executes the computer program to implement the IO trigger signal adjustment method described in the first aspect.
[0033] Compared with the prior art, the present invention has the following beneficial effects:
[0034] The present application provides an IO trigger signal adjustment method, which is applied to an operating system of a camera device, wherein the operating system stores statistical files of multiple trigger devices, and the camera device also includes a camera; the method includes: receiving an IO trigger signal generated by any trigger device among the multiple trigger devices, and obtaining a first system startup time at the current moment; wherein the IO trigger signal is used to generate a trigger instruction; the trigger instruction is used to control the camera to shoot products on an industrial production assembly line; obtaining the latest written signal number and the second system startup time in the statistical file of any trigger device; wherein the signal number is the number of IO trigger signals generated by any trigger device that have been received; the second system startup time is the system startup time of the last time the IO trigger signal generated by any trigger device was received; adding 1 to the signal number to obtain a new signal number, and writing the new signal number and the first system startup time into the statistical file of any trigger device; and adjusting the frequency of the IO trigger signal generated by any trigger device according to the actual interval between the first system startup time and the second system startup time.
[0035] In the present application, the camera device can count in real time the number of IO trigger signals generated by each trigger device and the system startup time for each reception of the IO trigger signal generated by each trigger device, and adjust the frequency of the IO trigger signal generated by the trigger device according to the actual interval between the two system startup times of receiving the IO trigger signals generated by the same trigger device, that is, the time interval between two IO trigger signals generated by the same trigger device, thereby realizing real-time monitoring and adjustment of the IO trigger signal in the industrial production line scenario, enabling the camera to accurately capture product images on the industrial production line, promptly discover problems in the production process, reduce downtime, and thus improve the overall production efficiency of the assembly line. BRIEF DESCRIPTION OF THE DRAWINGS
[0036] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the related technologies, the drawings required for use in the embodiments or the related technical descriptions are briefly introduced below. Obviously, the drawings described below are only the embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on the provided drawings without paying any creative work.
[0037] Figure 1 A schematic diagram of the camera device structure of the hardware operating environment involved in the embodiment of the present application;
[0038] Figure 2 A flow chart of a method for adjusting an IO trigger signal provided in an embodiment of the present application;
[0039] Figure 3 A schematic diagram of a front-end web interface provided in an embodiment of the present application;
[0040] Figure 4 A schematic diagram of the structure of an operating system provided in an embodiment of the present application;
[0041] Figure 5 A schematic diagram of the structure of an IO trigger signal adjustment device provided in an embodiment of the present application.
[0042] Markings in the figure: 101 - processor, 102 - communication bus, 103 - network interface, 104 - user interface, 105 - memory. DETAILED DESCRIPTION
[0043] In order to make the purpose, technical scheme and advantages of the present application clearer, the technical scheme in the embodiment of the present application will be clearly and completely described below in conjunction with the drawings in the embodiment of the present application. Obviously, the described embodiment is only a part of the embodiment of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the field without making creative work are within the scope of protection of the present application. In the absence of conflict, the embodiments in the present application and the features in the embodiments can be combined with each other arbitrarily. In addition, although the logical order is shown in the flow chart, in some cases, the steps shown or described can be performed in an order different from that here.
[0044] In order to solve the problem of how to monitor and adjust the IO trigger signal in real time in the industrial production line scene, the embodiment of the present application provides an IO trigger signal adjustment method, which can be applied to the operating system of the camera device. Figure 1 , which is a schematic diagram of the camera device structure of the hardware operating environment involved in the embodiment of the present application.
[0045] like Figure 1As shown, the camera device may include: a processor 101, such as a central processing unit (CPU), a communication bus 102, a user interface 104, a network interface 103, and a memory 105. Among them, the communication bus 102 is used to realize the connection and communication between these components. The user interface 104 may include a display screen (Display), an input unit such as a keyboard (Keyboard), and the user interface 104 may include a standard wired interface and a wireless interface. The network interface 103 may include a standard wired interface and a wireless interface (such as a wireless fidelity (WIreless-FIdelity, WI-FI) interface). The memory 105 may be a high-speed random access memory (Random Access Memory, RAM) memory, or a stable non-volatile memory (Non-Volatile Memory, NVM), such as a disk memory. The memory 105 may optionally also be a storage device independent of the aforementioned processor 101.
[0046] Those skilled in the art will understand that Figure 1 The structure shown in the figure does not constitute a limitation on the camera device, and may include more or less components than shown in the figure, or combine certain components, or arrange the components differently.
[0047] like Figure 1 As shown, the memory 105 as a storage medium may include an operating system, a network communication module, a user interface module, and an adjustment device for an IO trigger signal.
[0048] exist Figure 1 In the camera device shown, the network interface 103 is mainly used for data communication with the network server; the user interface 104 is mainly used for data interaction with the user; the processor 101 and the memory 105 in the camera device of the present invention can be set in the camera device, and the camera device calls the IO trigger signal adjustment device stored in the memory 105 through the processor 101, and executes the IO trigger signal adjustment method provided in the embodiment of the present application.
[0049] based on Figure 1 The camera device shown below Figure 2 A method for adjusting an IO trigger signal is introduced as shown.
[0050] S201: Receive an IO trigger signal generated by any trigger device among multiple trigger devices, and obtain a first system startup time at a current moment.
[0051] The trigger device refers to a device that generates an IO trigger signal. The trigger device can be an internal device integrated in the camera device, such as a sensor, or an external device connected to a computer device, such as a mouse. The camera device is connected to a camera facing an industrial production line. The industrial production line is a manufacturing method that divides the production process of a product into several continuous processes and collaborates through a series of devices to improve production efficiency and product consistency. The IO trigger signal is used to generate a trigger instruction, which is used to control the camera to shoot the products on the industrial production line. The trigger instruction can include shooting-related parameters, such as shutter speed, exposure time, etc.
[0052] In the specific implementation process, the device drivers corresponding to multiple trigger devices are registered in the kernel of the operating system so that each trigger device has a corresponding device driver in the operating system. When any trigger device generates an IO trigger signal, the device driver corresponding to any trigger device in the operating system will capture this IO trigger signal and immediately obtain the first system startup time at the current moment. A high-precision timer is introduced in the operating system of the camera device. The time can be accurate to microseconds. From the time the camera device is powered on, the high-precision timer starts timing and increases from zero. The system startup time refers to the time recorded by the high-precision timer. The first system startup time is the system startup time corresponding to the IO trigger signal received this time.
[0053] In a possible embodiment, the operating system stores device files of multiple trigger devices. After receiving an IO trigger signal generated by any trigger device, the operating system generates a signal event including an event type and writes the signal event into the device file of any trigger device.
[0054] In the specific implementation process, the device files of multiple trigger devices are initialized in the operating system. For example, in the Linux operating system, the device files are usually located in the / dev / input / directory, such as / dev / input / event1. When the device driver corresponding to any trigger device captures the IO trigger signal generated by any trigger device, a signal event is generated and the signal event is written to the device file of any trigger device. The kernel of the operating system will pass this signal event to the corresponding input subsystem, and the input subsystem will process this signal event and pass it to the application in the user space. In the user space, the application can obtain the signal event for further processing by reading the corresponding device file (such as / dev / input / event1).
[0055] S202: Obtain the number of signals most recently written into the statistical file of any trigger device and the second system startup time.
[0056] The operating system stores statistics files for multiple trigger devices. The record format of each statistics file is <count> <time>, count indicates the number of IO trigger signals generated by each trigger device that have been received, and time indicates the system startup time each time an IO trigger signal generated by each trigger device is received.
[0057] In a specific implementation process, when it is detected that the device file of any trigger device contains an event type, and the value of the event type is a preset value, the number of signals and the second system startup time that are most recently written in the statistical file of any trigger device are obtained. The preset value is used to represent the receipt of an IO trigger signal, and the preset value is, for example, 0. The number of signals is the number of IO trigger signals generated by any trigger device that have been received, and the second system startup time is the system startup time when the IO trigger signal generated by any trigger device was last received.
[0058] S203 , adding 1 to the signal number to obtain a new signal number, and writing the new signal number and the first system startup time into a statistical file of any trigger device.
[0059] In an embodiment of the present application, after obtaining the latest number of signals written in the statistical file of any trigger device and the second system startup time, the operating system will update the statistical file of any trigger device in real time and write the new number of signals and the first system startup time into the statistical file.
[0060] S204: According to the actual interval between the first system startup time and the second system startup time, adjust the frequency of any trigger device generating the IO trigger signal.
[0061] In a possible embodiment, the actual interval between the first system startup time and the second system startup time is determined; and according to the difference between the actual interval and the preset interval, the frequency of any trigger device generating the IO trigger signal is adjusted.
[0062] In a specific implementation process, the operating system can calculate the actual interval between the first system startup time and the second system startup time, the actual interval is equivalent to the time interval between the two IO trigger signals actually generated by any trigger device, and the preset interval is the time interval between the two IO trigger signals preset by any trigger device. If the difference between the actual interval and the preset interval is equal to zero, it means that the time beat of the IO trigger signal actually generated by any trigger device is accurate, and the frequency of the IO trigger signal generated by any trigger device is not adjusted.
[0063] For example: the first system startup time time1 = 57501.280516, the second system startup time time2 = 57501.480507, the actual interval cost = 57501.480507-57501.280516 = 0.199991s, nearly 200ms.
[0064] In a possible embodiment, adjusting the frequency of any trigger device generating an IO trigger signal according to the difference between the actual interval and the preset interval includes:
[0065] If the difference between the actual interval and the preset interval is not equal to zero, then any trigger device is adjusted according to the absolute value of the difference so that the frequency of any trigger device generating an IO trigger signal is the preset frequency corresponding to the preset interval; the preset frequency is to generate an IO trigger signal every preset interval.
[0066] In the specific implementation process, if the difference between the actual interval and the preset interval is not equal to zero, it means that the time beat of the actual IO trigger signal generated by the trigger device is inaccurate, so the frequency of the IO trigger signal generated by any trigger device is adjusted. If the difference is less than zero, the frequency of the IO trigger signal generated by any trigger device is increased according to the absolute value of the difference. If the difference is greater than zero, the frequency of the IO trigger signal generated by any trigger device is decreased according to the absolute value of the difference, so that the frequency of the IO trigger signal generated by any trigger device is equal to the preset frequency corresponding to the preset interval.
[0067] For example, if the actual interval is 90ms, the preset interval is 100ms, and 90ms<100ms, the frequency of generating the IO trigger signal is increased so that the frequency of generating the IO trigger signal is 100ms / signal. Alternatively, if the actual interval is 110ms, the preset interval is 100ms, and 110ms>100ms, the frequency of generating the IO trigger signal is decreased so that the frequency of generating the IO trigger signal is 100ms / signal.
[0068] In the embodiment of the present application, the error between the actual generation frequency of the IO trigger signal and the preset frequency can be determined according to the difference between the actual interval and the preset interval, so that the generation frequency of the IO trigger signal can be adjusted to the preset frequency more quickly and accurately.
[0069] In a possible embodiment, a plurality of products are placed at equal intervals on an industrial production line; if the difference between the actual interval and the preset interval is not equal to zero, before adjusting any trigger device according to the absolute value of the difference so that the frequency of any trigger device generating an IO trigger signal is a preset frequency corresponding to the preset interval, the method further includes:
[0070] The ratio between the distance between two adjacent products on the industrial production line and the running speed of the industrial production line is determined as the preset interval.
[0071] In a specific implementation process, the products placed on the industrial production line are, for example, plastic bags. The distance between two adjacent products is divided by the running speed of the industrial production line to obtain the time for the industrial production line to transport the two adjacent products, and the time is set as the preset interval.
[0072] In an embodiment of the present application, the time it takes for an industrial production line to transport two adjacent products is set equal to a preset interval, and the frequency of generating the IO trigger signal is subsequently adjusted to a preset frequency corresponding to the preset interval. This ensures that the time interval between the generation of two IO trigger signals is equal to the time it takes for the industrial production line to transport two adjacent products. In this way, each time the camera receives a trigger instruction generated by an IO trigger signal, there is a product facing the camera lens at the same time, so that the camera can accurately and clearly capture each product on the industrial production line.
[0073] There are two specific ways to adjust any trigger device, which are introduced below.
[0074] In the first method, the operating system can calculate the actual interval between the startup time of the first system and the startup time of the second system, and send the new signal quantity and the actual interval to the front-end web interface through WebSocket. WebSocket is a network communication protocol that provides a full-duplex communication channel, enabling real-time, two-way data transmission between the client and the server.
[0075] Please refer to Figure 3 , is a schematic diagram of a front-end web interface provided by an embodiment of the present application. The administrator can view the actual interval displayed on the front-end web interface, manually adjust the corresponding trigger device, and increase or decrease the frequency of generating the IO trigger signal.
[0076] The second way is that the trigger device is integrated into the operating system. The operating system can adjust any trigger device through the API interface exposed by any trigger device to increase or decrease the frequency of generating IO trigger signals.
[0077] In the embodiment of the present application, the trigger device is directly integrated into the operating system, which can reduce external dependencies and enhance the stability of the system. The operating system exposes an API interface, allowing the signal frequency of the trigger device to be adjusted directly through code, which can achieve more efficient automatic adjustment and reduce the need for human intervention.
[0078] In a possible embodiment, after receiving an IO trigger signal from any trigger device among the multiple trigger devices, the method further includes:
[0079] Send a trigger command to the camera; obtain the instruction number of the trigger command received by the camera; if the instruction number is less than the new signal number, it is determined that the connection between the operating system and the camera is faulty.
[0080] In the specific implementation process, after the camera receives the trigger instruction, it executes shooting. The camera device is facing the industrial production line. After the camera completes shooting, the product image on the industrial production line can be obtained. The product image can be stored, processed or transmitted to subsequent processing links, such as quality inspection, image recognition, etc. The camera can count the number of instructions of the received trigger instruction, and send the counting result to the front-end web interface for display, and the operating system obtains the number of instructions from the front-end web interface. Alternatively, the camera counts the number of product images taken and sends the counting result to the front-end web interface for display. The operating system obtains the number of product images from the front-end web interface and uses the number of product images as the number of instructions.
[0081] Furthermore, the operating system compares the number of instructions with the new number of signals. If the number of instructions is less than the new number of signals, it means that the camera has not received the trigger instruction. The fault information is then pushed to the front-end web interface for display, alerting the management personnel that the communication connection between the operating system of the camera device and the camera has failed, causing the camera to be unable to receive the trigger instruction sent by the operating system.
[0082] Please refer to Figure 4 , is a schematic diagram of the structure of the operating system provided in the embodiment of the present application. The operating system includes a kernel space and a user space. The kernel space is provided with a device real-time signal processing module and a high-precision timing module, and the user space is provided with a detection module, an interval calculation module, and a feedback module. The user space also stores A device files, B device files, A statistics files, and B statistics files.
[0083] The device real-time signal processing module is used to receive the IO trigger signal through IO signal channel 1 or IO signal channel 2, perform signal processing, generate trigger instructions, trigger the high-precision timing module to count and update time, generate signal events and write to the corresponding device files.
[0084] The high-precision timing module is used to obtain the system startup time through the kernel and update the content of the statistics file.
[0085] The detection module is used to detect in real time whether the content of the device file is updated. When it is detected that any device file contains the event type EV_SYN and the corresponding value is 0, it indicates that a new IO trigger signal has been generated, and the interval calculation module is notified.
[0086] The interval calculation module is used to record the contents count1 and time1 in the statistical file upon startup. After receiving the notification from the detection module, it obtains the contents count2 and time2 in the corresponding statistical file, calculates the actual interval cost=time2–time1, and notifies the feedback module.
[0087] The feedback module is used to send the latest signal quantity and actual interval to the front-end web interface through WebSocket after receiving the notification from the interval calculation module. The front-end web interface refreshes the signal quantity and actual interval in real time. When the trigger device is integrated into the operating system, the feedback module can also adjust the frequency of the IP trigger signal generated by the trigger device according to the actual interval through the exposed API interface.
[0088] In summary, the operating system uses a high-precision timing module to accurately measure the time interval of the IO trigger signal to improve the accuracy of time perception. The real-time signal processing module quickly detects and responds to the IO trigger signal to reduce system processing delays and ensure that the camera is exposed at the right time. A monitoring and feedback mechanism is established to monitor the system startup time of the IO trigger signal in real time, and feed the information back to the system to dynamically adjust the generation frequency of the IO trigger signal to ensure the efficient operation of the system. Through the collaborative work of various modules of the operating system, real-time detection and adjustment of the IO trigger signal are achieved.
[0089] Based on the same inventive concept, Figure 5 As shown, the embodiment of the present application also provides an IO trigger signal adjustment device, which is set in the operating system of the camera device, the operating system stores statistical files of multiple trigger devices, and the camera device also includes a camera; the device includes:
[0090] An acquisition module is used to receive an IO trigger signal generated by any trigger device among multiple trigger devices, and obtain the first system startup time at the current moment; obtain the number of signals and the second system startup time that are most recently written in the statistical file of any trigger device; wherein the IO trigger signal is used to generate a trigger instruction; the trigger instruction is used to control the camera to shoot the products on the industrial production line; the number of signals is the number of IO trigger signals generated by any trigger device that have been received; the second system startup time is the system startup time when the IO trigger signal generated by any trigger device was last received;
[0091] A writing module, used for adding 1 to the signal number to obtain a new signal number, and writing the new signal number and the first system startup time into a statistical file of any trigger device;
[0092] The adjustment module is used to adjust the frequency of any trigger device generating an IO trigger signal according to the actual interval between the first system startup time and the second system startup time.
[0093] In addition, in one embodiment, the present application also provides a camera device, which includes a processor, a memory, and a computer program stored in the memory, and the computer program implements the aforementioned IO trigger signal adjustment method when executed by the processor.
[0094] In addition, in one embodiment, the present application also provides a computer storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the aforementioned IO trigger signal adjustment method is implemented.
[0095] In some embodiments, the computer readable storage medium may be a memory such as FRAM, ROM, PROM, EPROM, EEPROM, flash memory, magnetic surface memory, optical disk, or CD-ROM; or various devices including one or any combination of the above memories. The computer may be various computing devices including intelligent terminals and servers.
[0096] In some embodiments, executable instructions may be in the form of a program, software, software module, script or code, written in any form of programming language (including compiled or interpreted languages, or declarative or procedural languages), and may be deployed in any form, including as a stand-alone program or as a module, component, subroutine or other unit suitable for use in a computing environment.
[0097] As an example, executable instructions may, but need not, correspond to a file in a file system, may be stored as part of a file storing other programs or data, such as in one or more scripts in a HyperText Markup Language (HTML) document, in a single file dedicated to the program in question, or in multiple coordinated files (e.g., files storing one or more modules, subroutines, or code portions).
[0098] By way of example, executable instructions may be deployed to be executed on one computing device, or on multiple computing devices located at one site, or on multiple computing devices distributed across multiple sites and interconnected by a communication network.
[0099] It should be noted that, in this article, the term "includes", "comprising" or any other variation thereof is intended to cover non-exclusive inclusion, so that a process, method, article or system including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or system. In the absence of further restrictions, an element defined by the sentence "comprising a ..." does not exclude the existence of other identical elements in the process, method, article or system including the element.
[0100] The serial numbers of the above-mentioned embodiments of the present application are for description only and do not indicate the advantages or disadvantages of the embodiments.
[0101] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as a read-only memory / random access memory, a disk, or an optical disk), and includes several instructions for the camera device to execute the methods described in each embodiment of the present application. The above are only preferred embodiments of the present application, and do not limit the patent scope of the present application. Any equivalent structure or equivalent process transformation made using the contents of the present application specification and drawings, or directly or indirectly used in other related technical fields, are also included in the patent protection scope of the present application.< / time> < / count>
Claims
1. A method for adjusting an IO trigger signal, characterized in that: The method is applied to an operating system of a camera device, the operating system stores statistical files of multiple triggering devices, and the camera device also includes a camera; the method includes: An IO trigger signal generated by any trigger device among the multiple trigger devices is received to obtain the first system startup time at the current moment; wherein the IO trigger signal is used to generate a trigger instruction; the trigger instruction is used to control the camera to shoot products on the industrial production line; multiple products are placed on the industrial production line at equal intervals; Obtain the latest number of signals written in the statistical file of any trigger device and the second system startup time; wherein the number of signals is the number of IO trigger signals generated by any trigger device that have been received; the second system startup time is the system startup time when the IO trigger signal generated by any trigger device was last received; Add 1 to the signal number to obtain a new signal number, and write the new signal number and the first system startup time into a statistical file of any trigger device; Determine an actual interval between the first system startup time and the second system startup time; According to the difference between the actual interval and the preset interval, the frequency of the IO trigger signal generated by any trigger device is adjusted; the preset interval is the time interval for generating two IO trigger signals preset by any trigger device, and the preset interval is the ratio between the spacing between two adjacent products on the industrial production line and the running speed of the industrial production line.
2. The method for adjusting the IO trigger signal according to claim 1, characterized in that: The step of adjusting the frequency of generating the IO trigger signal by any trigger device according to the difference between the actual interval and the preset interval includes: If the difference between the actual interval and the preset interval is not equal to zero, then according to the absolute value of the difference, adjust any one of the trigger devices so that the frequency of the IO trigger signal generated by any one of the trigger devices is the preset frequency corresponding to the preset interval; the preset frequency is to generate an IO trigger signal every preset interval.
3. The method for adjusting the IO trigger signal according to claim 2, characterized in that: Any of the trigger devices is integrated into the camera device; and adjusting any of the trigger devices comprises: Through the API interface exposed by any trigger device, any trigger device is adjusted.
4. The method for adjusting the IO trigger signal according to claim 1, characterized in that: After receiving an IO trigger signal from any trigger device among the multiple trigger devices, the method further includes: Sending the trigger instruction to the camera; Obtaining the number of trigger instructions received by the camera; If the number of instructions is less than the number of new signals, it is determined that a connection failure occurs between the operating system and the camera.
5. The method for adjusting the IO trigger signal according to claim 1, characterized in that: The operating system stores device files of multiple trigger devices; After receiving an IO trigger signal from any trigger device among the multiple trigger devices, the method further includes: Generate a signal event including an event type, and write the signal event into a device file of any trigger device; The method of obtaining the latest written signal number and the second system startup time in the statistical file of any trigger device includes: When it is detected that the device file of any trigger device contains an event type and the value of the event type is a preset value, the number of signals most recently written in the statistical file of any trigger device and the second system startup time are obtained; the preset value is used to represent the receipt of the IO trigger signal.
6. A device for adjusting an IO trigger signal, characterized in that: The device is arranged in an operating system of a camera device, the operating system stores statistical files of a plurality of triggering devices, and the camera device further comprises a camera; the device comprises: An acquisition module is used to receive an IO trigger signal generated by any trigger device among the multiple trigger devices, and acquire the first system startup time at the current moment; acquire the number of signals and the second system startup time that are most recently written in the statistical file of any trigger device; wherein the IO trigger signal is used to generate a trigger instruction; the trigger instruction is used to control the camera to shoot products on an industrial production assembly line; a plurality of products are placed at equal intervals on the industrial production assembly line; the number of signals is the number of IO trigger signals generated by any trigger device that have been received; the second system startup time is the system startup time when the IO trigger signal generated by any trigger device was last received; A writing module, used for adding 1 to the signal quantity to obtain a new signal quantity, and writing the new signal quantity and the first system startup time into a statistical file of any trigger device; The adjustment module is used to determine the actual interval between the startup time of the first system and the startup time of the second system; according to the difference between the actual interval and the preset interval, adjust the frequency of the IO trigger signal generated by any trigger device; the preset interval is the time interval for generating two IO trigger signals preset by any trigger device, and the preset interval is the ratio between the spacing between two adjacent products on the industrial production line and the running speed of the industrial production line.
7. A camera device, characterized in that: The camera device comprises a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the method for adjusting the IO trigger signal according to any one of claims 1 to 5.
8. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a computer program, and the processor executes the computer program to implement the method for adjusting the IO trigger signal according to any one of claims 1 to 5.
Citation Information
Patent Citations
Systems and methods for monitoring on-line webs using line scan cameras
CN102656445A
Imaging control method and system for wide-view-field high-resolution microscope camera array
CN110012232A