Industrial camera, program loading method for industrial camera, and data transmission method
By employing a dual control unit design in industrial cameras, the program is stored in the same storage unit and loaded in parallel, solving the problem of low transmission efficiency in traditional industrial cameras and achieving efficient data transmission and cost reduction.
Patent Information
- Application Number
- CN202411758604.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-02
- Publication Date
- 2025-11-04
- Estimated Expiration
- 2044-12-02
AI Technical Summary
Traditional industrial cameras have low data transmission efficiency, which cannot meet the demand for high-bandwidth transmission of high-frame-rate images. Furthermore, existing technologies have high costs, a large number of pins, and complex maintenance after adding interfaces.
The industrial camera design employs a dual-control unit, which stores the programs of the two control units in the same program storage unit through a single switching unit. The switching unit controls program loading, enabling parallel data transmission and reducing the number of program storage units and pin connections.
It achieves high-speed parallel data transmission, reduces costs and maintenance complexity, and avoids the problem of inconsistent program versions.
Smart Images

Figure CN119621186B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of machine vision, in particular to an industrial camera, a program loading method and a data transmission method of the industrial camera. BACKGROUND
[0002] Industrial cameras are widely used in the field of machine vision, and the image data collected by the industrial cameras usually needs to be transmitted to other devices through the data transmission interface of the industrial cameras to perform image analysis. The traditional industrial camera has only one data transmission interface (hereinafter referred to as interface), and the transmission rate is slow when transmitting data, resulting in low data transmission efficiency of the industrial camera. When the user needs high bandwidth transmission of high frame rate images, the single-interface industrial camera cannot be used normally. SUMMARY
[0003] The purpose of the embodiments of the present application is to provide an industrial camera, a program loading method and a data transmission method of the industrial camera to improve the efficiency of data transmission of the industrial camera. The specific technical solutions are as follows:
[0004] The first aspect of the embodiments of the present application provides an industrial camera, which comprises a first control unit and a second control unit, a program storage unit and a switch unit; the switch unit is signal connected with the first control unit, the second control unit and the program storage unit respectively;
[0005] The program storage unit stores programs required by each control unit when loading;
[0006] The first control unit is configured to control the second control unit to be in a non-loading state, control the switch unit to make the first control unit conductive with the program storage unit, read a first program required by the first control unit from the program storage unit and load the first program; after completing the loading of the first program, control the second control unit to be in a loading state;
[0007] The second control unit is configured to obtain a second program required by the second control unit and load the second program;
[0008] The first control unit is further configured to realize data transmission by using the loaded first program;
[0009] The second control unit is further configured to realize data transmission in parallel with the first control unit by using the loaded second program.
[0010] In a possible implementation, the industrial camera further comprises a field programmable logic gate array, and the program storage unit further comprises a third program required by the field programmable logic gate array;
[0011] The first control unit is further configured to control the field programmable logic gate array to be in a non-loading state before reading the first program required by the first control unit from the program storage unit; and control the field programmable logic gate array to be in a loading state after the loading of the first program is completed.
[0012] The field programmable logic gate array is configured to acquire the third program and load.
[0013] In a possible implementation, the first control unit is further configured to control the switch unit to enable the second control unit to be connected with the program storage unit after the loading of the first program is completed; and the second control unit is specifically configured to read the second program required by the second control unit from the program storage unit and load.
[0014] Alternatively,
[0015] The first control unit is further configured to read the second program from the program storage unit and send the second program to the second control unit; and the second control unit is specifically configured to receive the second program sent by the first control unit and load.
[0016] In a possible implementation, a first pin is arranged on the first control unit, and a second pin is arranged on the second control unit.
[0017] The first control unit is specifically configured to determine itself as a master device after identifying that the first pin is pulled low.
[0018] The second control unit is specifically configured to determine itself as a slave device after identifying that the second pin is pulled high.
[0019] The first control unit is specifically configured to, in response to to-be-sent data, determine first to-be-sent data required to be sent by the first control unit according to a data amount of the to-be-sent data; drive the first control unit to transmit the first to-be-sent data, and drive the second control unit to transmit second to-be-sent data; and the sum of the data amount of the first to-be-sent data and the data amount of the second to-be-sent data is equal to the data amount of the to-be-sent data.
[0020] In a possible implementation, the first program is the same as the second program.
[0021] In a possible implementation, the industrial camera further includes at least one third control unit, and the third control unit is signal-connected with the switch unit.
[0022] The first control unit is further configured to control the third control unit to be in a non-loading state before reading the first program required by the first control unit from the program storage unit; and control the third control unit to be in a loading state and control the switch unit to enable the third control unit to be connected with the program storage unit after the second control unit finishes loading the second program.
[0023] The third control unit is configured to read the fourth program required by the third control unit from the program storage unit and load the fourth program.
[0024] The third control unit is further configured to implement data transmission with the first control unit and the second control unit in parallel by using the loaded fourth program.
[0025] In a possible implementation, the first control unit is further configured to read the third program from the program storage unit and send the third program to the field programmable logic array; or control the switch unit to enable the first control unit to be connected with the program storage unit and read the third program from the program storage unit and send the third program to the field programmable logic array after the second control unit finishes loading the second program.
[0026] In a possible implementation, the first control unit is specifically configured to control the field programmable logic array to be in a loading state after the second control unit finishes loading the second program.
[0027] The second control unit is further configured to read the third program from the program storage unit and send the third program to the field programmable logic array.
[0028] In a possible implementation, the first control unit is further configured to drive the second control unit to read the third program from the program storage unit and send the third program to the field programmable logic array.
[0029] The first control unit is specifically configured to control the second control unit to be in a loading state after the third control unit finishes loading the third program.
[0030] The second control unit is further configured to read the third program from the program storage unit and send the third program to the field programmable logic array under the driving of the first control unit.
[0031] In a possible implementation, the first control unit is further configured to control the switch unit to enable the field programmable logic array to be connected with the program storage unit after the first control unit finishes loading the first program or after the second control unit finishes loading the second program.
[0032] The field programmable logic gate array is specifically configured to read the third program from the program storage unit and load.
[0033] In a possible implementation, the first control unit is specifically configured to control the circuit unit to be in the loading state by pulling up a reset pin of the circuit unit, wherein the circuit unit includes the second control unit, the third control unit, or the field programmable logic gate array.
[0034] The first control unit is specifically configured to control the circuit unit to be in the non-loading state by pulling down the reset pin of the circuit unit.
[0035] A second aspect of the embodiment of the application provides a program loading method of an industrial camera, the industrial camera including a first control unit and a second control unit, a program storage unit, and a switch unit; the switch unit is in signal connection with the first control unit, the second control unit, and the program storage unit respectively.
[0036] The method includes:
[0037] The first control unit controls the second control unit to be in a non-loading state, controls the switch unit to enable the first control unit and the program storage unit, reads a first program required by the first control unit from the program storage unit and loads the first program, and controls the second control unit to be in a loading state after the loading of the first program is completed.
[0038] The second control unit acquires a second program required by the second control unit and loads the second program.
[0039] A third aspect of the embodiment of the application provides a data transmission method, applied to an industrial camera, the industrial camera including a first control unit and a second control unit, a program storage unit, and a switch unit; the switch unit is in signal connection with the first control unit, the second control unit, and the program storage unit respectively.
[0040] The method includes:
[0041] The first control unit controls the second control unit to be in a non-loading state, controls the switch unit to enable the first control unit and the program storage unit, reads a first program required by the first control unit from the program storage unit and loads the first program, and controls the second control unit to be in a loading state after the loading of the first program is completed.
[0042] The second control unit acquires a second program required by the second control unit and loads the second program.
[0043] The first control unit and the second control unit perform data transmission in parallel using the loaded first program and the loaded second program.
[0044] In a possible implementation, the industrial camera further comprises an image acquisition component and a field programmable logic gate array, the industrial camera being connected to a target device; the image acquisition component is configured to acquire a raw image and send the raw image to the field programmable logic gate array; the field programmable logic gate array is configured to process the raw image to obtain a target image and send the target image to the first control unit and the second control unit.
[0045] The first control unit and the second control unit perform data transmission in parallel using the loaded first program and the loaded second program, comprising:
[0046] The first control unit and the second control unit perform data transmission in parallel using the loaded first program and the loaded second program, comprising:
[0047] A fourth aspect of the embodiment of the present application provides a program loading device of an industrial camera, the industrial camera comprising a first control unit and a second control unit, a program storage unit, and a switch unit; the switch unit is in signal connection with the first control unit, the second control unit, and the program storage unit respectively;
[0048] The device comprises a first control module and a second control module;
[0049] The first control module is configured to drive the first control unit to control the second control unit to be in a non-loading state, control the switch unit to enable the first control unit and the program storage unit, read a first program required by the first control unit from the program storage unit, and load the first program; after the loading of the first program is completed, control the second control unit to be in a loading state.
[0050] The second control module is configured to drive the second control unit to acquire a second program required by the second control unit and load the second program.
[0051] A fifth aspect of the embodiment of the present application provides a data transmission device, applied to an industrial camera, the industrial camera comprising a first control unit and a second control unit, a program storage unit, and a switch unit; the switch unit is in signal connection with the first control unit, the second control unit, and the program storage unit respectively;
[0052] The device comprises a first control module and a second control module;
[0053] The first control module is configured to drive the first control unit to control the second control unit to be in a non-loading state, control the switch unit to enable the first control unit and the program storage unit, read a first program required by the first control unit from the program storage unit, and load the first program; and after the loading of the first program is completed, control the second control unit to be in a loading state.
[0054] The second control module is configured to drive the second control unit to acquire a second program required by the second control unit and load the second program.
[0055] The first control module is further configured to drive the first control unit to implement data transmission by using the loaded first program.
[0056] The second control module is further configured to drive the second control unit to implement data transmission in parallel with the first control unit by using the loaded second program.
[0057] Embodiments of the present application have the following beneficial effects:
[0058] The industrial camera, the program loading method and the data transmission method provided by the embodiments of the present application, before loading the first program, the first control unit controls the second control unit to be in a non-loading state, and controls the switch unit to make the first control unit and the program storage unit conductive, reads the first program required by the first control unit from the program storage unit, and after loading, controls the second control unit to be in a loading state, and the second control unit obtains the second program required by the second control unit and loads it, after the first program and the second program are loaded, the first control unit and the second control unit use the loaded programs to realize parallel data transmission. Compared with the prior art in which each control unit obtains the required program from different program storage units, in the present application, the first program required by the first control unit and the second program required by the second control unit are stored in the same program storage unit, which reduces the number of program storage units and the cost of the industrial camera. Compared with the prior art in which each control unit is connected to different program storage units, in the present application, the first control unit is connected to the program storage unit through the switch unit, and only by controlling the switch unit can the first control unit and the second control unit obtain the required program, which reduces the number of pins required to establish a connection, and after the first control unit and the second control unit are loaded, they can use the loaded first program and second program to realize parallel data transmission, thereby achieving the effect of high-speed data transmission with a small number of pins. On the other hand, in the present application, there is only one program storage unit, and subsequent encryption, upgrading or maintenance of the program storage unit in the industrial camera is relatively simple, and there is no need to encrypt, upgrade or maintain multiple program storage units. Moreover, since the multiple program storage units do not need to be upgraded in the present application, there is no situation that the program versions of multiple control units are not uniform due to the upgrading of the program in part of the program storage units.
[0059] Of course, implementing any product or method of the present application does not necessarily require all the advantages described above. BRIEF DESCRIPTION OF DRAWINGS
[0060] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the drawings needed to be used in the embodiments or the prior art description will be briefly introduced below. Obviously, the drawings in the following description are only some embodiments of the present application, and other embodiments can also be obtained by those skilled in the art based on these drawings.
[0061] Figure 1 Structure diagram of the industrial camera;
[0062] Figure 2A first structural schematic diagram of an industrial camera provided by an embodiment of the present application is shown in FIG. 1.
[0063] Figure 3 A first structural schematic diagram of an industrial camera provided by an embodiment of the present application is shown in FIG. 1. Figure 2 A first structural schematic diagram of an industrial camera provided by an embodiment of the present application is shown in FIG. 1.
[0064] Figure 4a A first structural schematic diagram of an industrial camera provided by an embodiment of the present application is shown in FIG. 1. Figure 3 A first structural schematic diagram of an industrial camera provided by an embodiment of the present application is shown in FIG. 1.
[0065] Figure 4b A first structural schematic diagram of an industrial camera provided by an embodiment of the present application is shown in FIG. 1. Figure 3 A first structural schematic diagram of an industrial camera provided by an embodiment of the present application is shown in FIG. 1.
[0066] Figure 5a A first structural schematic diagram of an industrial camera provided by an embodiment of the present application is shown in FIG. 1. Figure 5b A first structural schematic diagram of an industrial camera provided by an embodiment of the present application is shown in FIG. 1.
[0067] Figure 6 A first structural schematic diagram of an industrial camera provided by an embodiment of the present application is shown in FIG. 1. A first structural schematic diagram of an industrial camera provided by an embodiment of the present application is shown in FIG. 1.
[0068] A first structural schematic diagram of an industrial camera provided by an embodiment of the present application is shown in FIG. 1. Figure 7 A first structural schematic diagram of an industrial camera provided by an embodiment of the present application is shown in FIG. 1.
[0069] Figure 8 A first structural schematic diagram of an industrial camera provided by an embodiment of the present application is shown in FIG. 1. Figure 7 A first structural schematic diagram of an industrial camera provided by an embodiment of the present application is shown in FIG. 1.
[0070] Figure 9a A first structural schematic diagram of an industrial camera provided by an embodiment of the present application is shown in FIG. 1. Figure 7 A first structural schematic diagram of an industrial camera provided by an embodiment of the present application is shown in FIG. 1.
[0071] Figure 9b A first structural schematic diagram of an industrial camera provided by an embodiment of the present application is shown in FIG. 1. Figure 7 A first structural schematic diagram of an industrial camera provided by an embodiment of the present application is shown in FIG. 1.
[0072] Figure 9c A first structural schematic diagram of an industrial camera provided by an embodiment of the present application is shown in FIG. 1. Figure 7 A first structural schematic diagram of an industrial camera provided by an embodiment of the present application is shown in FIG. 1.
[0073] Figure 10a A first structural schematic diagram of an industrial camera provided by an embodiment of the present application is shown in FIG. 1. Figure 10b A first structural schematic diagram of an industrial camera provided by an embodiment of the present application is shown in FIG. 1. Figure 10c A first structural schematic diagram of an industrial camera provided by an embodiment of the present application is shown in FIG. 1. A first structural schematic diagram of an industrial camera provided by an embodiment of the present application is shown in FIG. 1.
[0074] A first structural schematic diagram of an industrial camera provided by an embodiment of the present application is shown in FIG. 1. Figure 11 A first structural schematic diagram of an industrial camera provided by an embodiment of the present application is shown in FIG. 1. A first structural schematic diagram of an industrial camera provided by an embodiment of the present application is shown in FIG. 1.
[0075] A first structural schematic diagram of an industrial camera provided by an embodiment of the present application is shown in FIG. 1. Figure 12 A first structural schematic diagram of an industrial camera provided by an embodiment of the present application is shown in FIG. 1. Figure 11The illustrated embodiment provides an interactive diagram of the industrial camera during loading.
[0076] Figure 13a A schematic diagram of a fifth structure of an industrial camera provided in an embodiment of this application;
[0077] Figure 13b A sixth structural schematic diagram of an industrial camera provided in an embodiment of this application;
[0078] Figure 14 A seventh structural schematic diagram of an industrial camera provided in an embodiment of this application;
[0079] Figure 15 for Figure 11 The illustrated embodiment provides another interactive diagram of the industrial camera during loading.
[0080] Figure 16a and Figure 16b A third structural diagram of the industrial camera loading process provided in the application embodiment;
[0081] Figure 17a and Figure 17b A fourth structural diagram of the industrial camera loading process provided in the application embodiment;
[0082] Figure 18a , Figure 18b , Figure 18c A fifth structural diagram illustrating the industrial camera loading process provided in the application embodiment;
[0083] Figure 19 This is a structural example diagram of an industrial camera provided in an embodiment of this application;
[0084] Figure 20 Example diagram of data transmission between an industrial camera and a target device provided in an embodiment of this application;
[0085] Figure 21 This is a schematic diagram of the eighth structure of an industrial camera provided in an embodiment of this application. Detailed Implementation
[0086] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art based on this application are within the scope of protection of this application.
[0087] To more clearly explain the multi-control unit device and multi-control unit loading method provided in this application, the following will explain some terms that appear in this document:
[0088] FPGA (Field-Programmable Gate Array, field programmable gate array): used for undertaking high-speed interface data transceiving and switching, video image signal processing, wireless signal channel coding and decoding and the like.
[0089] MCU (Micro Control Unit, micro control unit, also called control unit): refers to integrating CPU (Central Processing Unit, central processing unit), memory, timing counter and input / output interface of a computer on a silicon chip to form a small and perfect microcomputer system.
[0090] CLK (Serial Clock, clock line interface): used for synchronizing the operation of each module; CS (chip select interface): used for individually selecting or enabling control of each device connected to the bus; DI (Serial Data Input, data input port): used for receiving signals from external devices or modules; DO (Serial Data Output, data output port): used for sending instructions or data to other devices or modules; MISO (Master Input Slave Output, master data input slave data output): used for transmitting data of a slave device to a master device; MOSI (Master Output Slave I Input, master data output slave data input): used for transmitting data of a master device to a slave device; GPIO (General Purpose Input / Output, general purpose input / output port): used for realizing the interaction between the control unit and other devices, and can be configured as an input mode or an output mode.
[0091] Industrial cameras widely used in the field of machine vision and automation are high-performance image acquisition devices realized by using data interface technology. However, the traditional industrial camera has only one data interface, and the transmission rate is limited when transmitting files. For example, when the traditional data interface is a USB interface, the transmission rate of the industrial camera is only 3 Gbp / s at most. When users demand high-bandwidth transmission of high-frame-rate images, the single-interface industrial camera cannot be used normally. In related technologies, the problem of low transmission rate can be solved by selecting a CML (CameraLink, a communication protocol) camera, a CXP camera (a high-speed camera using CoaXPress transmission protocol, CoaXPress is a high-speed point-to-point serial transmission protocol), or a gigabit port camera, an optical port camera and the like. However, the above cameras usually need a camera plus a capture card integrated solution, which has high cost, and many users' sites cannot add capture cards, so the problem of low transmission rate of the industrial camera cannot be solved.
[0092] In order to improve the transmission rate of the industrial camera, the industrial camera with double interfaces is selected in the related art. In the related art, the industrial camera with double interfaces adopts two flash memories to store the programs required by the control units of two data interfaces for loading. When the industrial camera is powered on, each control unit needs to obtain the required program from different flash memories for loading. As shown in Figure 1 The control unit 1 (MCU1) and the control unit 2 (MCU2) are connected with the flash memory 3 (Flash1) and the flash memory 4 (Flash2) respectively, the general pin 11 (MCU1_GPIO0 pin) of the MCU1 is connected with the reset pin 51 (FPGA_RST) of the field programmable logic gate array 5 (FPGA), when the industrial camera is powered on, the MCU2 and the FPGA perform the reset operation at the same time; the pin 52 (FPGA_Done pin) of the FPGA is also connected with the pin 12 (MCU1_GPIO1 pin) of the MCU1, the FPGA_Done is the loading completion signal of the FPGA, which is used to ensure that the MCU1 can monitor the configuration state of the FPGA; in order to ensure the transmission of the synchronous data, the pin 33 (CLK pin) of the Flash1 is connected with the pin 16 (MCU1_CLK pin) of the MCU1 and the pin 54 (FPGA_CONFIG_CLK pin) of the FPGA respectively, the pin 42 (CLK pin) of the Flash2 is connected with the pin 23 (MCU2_CLK pin) of the MCU2. The pin 17 (MCU1_GPIO3 pin) of the MCU1 is connected with a resistor 19, the pin 26 (MCU2_GPIO3 pin) of the MCU2 is connected with a resistor 27, the master control unit and the slave control unit are identified by the pull-up state and the pull-down state of the resistor 19 and the resistor 27.
[0093] After the industrial camera is powered on, MCU1 is connected with the pins 31 (DO pin), 32 (DI pin), 33 (CLK pin) and 34 (CS pin) of Flash1 through the pin 13 (MISO pin), the pin 14 (MOSI pin), the pin 15 (CLK pin) and the pin 16 (CS pin), reads the program required by MCU1 to be loaded from Flash1 and loads, FPGA reads the degree required by FPGA to be loaded from Flash1 through the pin 53 (FPGA_CONFIG_DATAO pin) and loads, after the loading is completed, sends a loading completion signal to the pin 12 (MCU1_GPIO1 pin) of MCU1 through the pin 52 (FPGA_Done pin), the pin 18 (MCU1_GPIO4 pin) of MCU1 sends a signal to the pin 21 (MCU2_RST) of MCU2, MCU2 is in a loading state, MCU2 is connected with the pins 41 (CS pin), 42 (CLK pin), 44 (DO pin) and 43 (DI pin) of Flash2 through the pin 22 (CS pin), the pin 23 (CLK pin), the pin 25 (MISO pin) and the pin 24 (MOSI pin), reads the program required by MCU2 to be loaded from Flash2 and loads. It can be seen that when there are multiple control units in the industrial camera in the related art, the programs required by the control units to be loaded are actually stored in multiple flash memories respectively.
[0094] However, as shown in Figure 1 When two or more flash memories are used to store the programs required by the control units to be loaded respectively, the control units are usually connected with the flash memories respectively, and the control units read the programs required by the control units to be loaded from different flash memories respectively. In this case, the more the number of control units is, the more the number of flash memories is, resulting in a high cost of the industrial camera. In addition, each control unit is connected with one flash memory, and a large number of pins are occupied when the connection between the control units and the flash memories is established. In addition, in this case, when the flash memories need to be encrypted, upgraded or maintained subsequently, each flash memory needs to be encrypted, upgraded or maintained respectively, and the operation is relatively cumbersome. In addition, if the programs required by the control units to be loaded are the same, when the programs need to be upgraded, the programs need to be upgraded in each flash memory respectively, which not only increases the time cost of the staff, but also may cause the program versions of the control units to be inconsistent due to the fact that the programs in part of the flash memories are upgraded while the programs in another part of the flash memories are not upgraded.
[0095] In order to solve the above technical problems, as shown in Figure 2As shown, the embodiment of the present application provides an industrial camera, the industrial camera comprising a first control unit 100 and a second control unit 200, a program storage unit 300, and a switch unit 400, the switch unit 400 being signal-connected with the first control unit 100, the second control unit 200, and the program storage unit 300 respectively; the program storage unit 300 storing programs required by each control unit to be loaded; the first control unit 100 being configured to control the second control unit 200 to be in a non-loading state, control the switch unit 400 to make the first control unit 100 conductive with the program storage unit 300, read a first program required by the first control unit 100 to be loaded from the program storage unit 300 and load the first program; after the loading of the first program is completed, control the second control unit 200 to be in a loading state; the second control unit 200 being configured to acquire a second program required by the second control unit 200 to be loaded; the first control unit 100 being further configured to realize data transmission by using the loaded first program; and the second control unit 200 being further configured to realize data transmission in parallel with the first control unit 100 by using the loaded second program.
[0096] By the industrial camera provided by the embodiment of the present application, compared with the prior art in which each control unit acquires programs required to be loaded from different program storage units, the first program required by the first control unit to be loaded and the second program required by the second control unit to be loaded are stored in the same program storage unit in the present application, which on the one hand reduces the number of program storage units and reduces the cost of the industrial camera; and compared with the prior art in which each control unit is connected with different program storage units, in the present application, the first control unit is connected with the program storage unit through the switch unit, and only by controlling the switch unit, the first control unit and the second control unit can acquire programs required to be loaded, which reduces the number of pins required to establish a connection, and after the first control unit and the second control unit are loaded, data transmission can be realized in parallel by using the loaded first program and the second program, thereby achieving the effect of high-speed data transmission by using a small number of pins; on the other hand, there is only one program storage unit in the present application, and subsequent encryption, upgrading or maintenance of the program storage unit in the industrial camera is relatively simple, and there is no need to encrypt, upgrade or maintain multiple program storage units respectively. And since the multiple program storage units do not need to be upgraded in the present application, there is no situation that the program versions of multiple control units are not uniform due to the upgrading of the programs in part of the program storage units without the upgrading of the programs in another part of the program storage units.
[0097] The control unit in the present application can be a single-chip microcomputer, a system on chip, or other components with control functions, and the embodiments of the present application do not make any limitation thereon. In addition, the program storage unit in the present application can be a flash memory, a random access memory, a read-only memory, or other memories with storage functions, and the embodiments of the present application do not make any limitation thereon.
[0098] In order to more clearly understand the industrial camera of the present application, the following will be described in conjunction with the accompanying drawings. It can be understood that the number of control units in the industrial camera provided by the present application can be 2 or an integer greater than 2. For example, the number of control units can be 3, and the programs required by each control unit can be the same or different, which is all possible. In addition, the programs required by the control units other than the first control unit can be actively read from the program storage unit, or can be sent to the other control units after being read from the program storage unit by the first control unit.
[0099] It can be understood that the programs required by each control unit can be the same or different. If the programs required by each control unit are different, the program storage unit is partitioned, and the programs required by each control unit are stored in different partitions; if the programs required by each control unit are the same, the program storage unit does not need to be partitioned, and the programs required by the control unit are directly stored in the program storage unit. The same programs required by each control unit can reduce the workload of the developers in development and testing, reduce the development cost, and when the program needs to be updated, only the program in the program storage unit needs to be updated, without the need for individual programming of each control unit, simplifying the upgrading and maintenance process.
[0100] The following will take an industrial camera with two control units as an example to describe the industrial camera and its program loading method and data transmission method:
[0101] In one possible embodiment, the second control unit 200 reads the second program from the program storage unit 300. In this embodiment, the structure of the industrial camera is as shown in Figure 2 , and the interaction diagram of the industrial camera during loading is as shown in Figure 3 . In this case, the industrial camera includes the first control unit 100 and the second control unit 200, the program storage unit 300, and the switch unit 400, the first control unit 100 accesses the switch unit 400 through the access point 1 on the switch unit 400, the second control unit 200 accesses the switch unit through the access point 2, and the program storage unit accesses the switch unit 400 through the access point 3. As Figure 4aAs shown, when the first control unit 100 is connected with the program storage unit 300, the access point 1 and the access point 3 of the switch unit 400 are connected; as shown in Figure 4b As shown, when the second control unit 200 is connected with the program storage unit 300, the access point 2 and the access point 3 of the switch unit are connected. For the convenience of description, the state of the switch unit 400 when the access point 1 and the access point 3 are connected is referred to as the first state, and the state of the switch unit 400 when the access point 2 and the access point 3 are connected is referred to as the second state.
[0102] After the industrial camera is powered on, the first control unit 100 controls the switch unit 400 so that the first control unit 100 and the program storage unit are connected (corresponding to the first state in Figure 3 The first state switching signal is sent in the middle, and the switch unit is in the first state. In order to avoid the situation that multiple control units simultaneously access the program storage unit 300 and cause data reading errors, the first control unit 100 also controls the second control unit to be in the non-loading state. Then, the first control unit 100 reads the first program required by the first control unit 100 when loading from the program storage unit 300 through the switch unit 400 (corresponding to reading the first program in Figure 3 The first program is returned, and the first control unit 100 loads the first program. After the first control unit 100 loads the first program, the first control unit 100 controls the switch unit 400 so that the second control unit 200 and the program storage unit 300 are connected (corresponding to the second state in Figure 3 The second state switching signal is sent, and the switch unit is in the second state). Then the first control unit 100 controls the second control unit to be in the loading state, and sends the first loading signal to the second control unit 200. The second control unit 200 reads the second program required by the second control unit 200 when loading from the program storage unit 300 through the switch unit 400 in response to the first loading signal (corresponding to returning the second program in Figure 3 The second program is returned), and loads the second program. Finally, the first control unit 100 and the second control unit 200 implement data transmission in parallel using the loaded programs.
[0103] The second control unit 200 cannot read the program from the program storage unit 300 when in the non-loading state, and can read the program from the program storage unit 300 when in the loading state. The first control unit can make the second control unit 200 in the loading state by pulling up the reset pin of the second control unit 200, and make the second control unit 200 in the non-loading state by pulling down the reset pin of the second control unit 200. It can be understood that the process of the control unit or the FPGA reading the required program in the embodiments of the present application is indicated as "reading the Xth program and returning the Xth program" in the figure. "X" represents the type of the program required by the control unit or the FPGA to load, which will not be described below. The first control unit 100 controls the second control unit 200 to be in the loading state / non-loading state, or the FPGA in the loading state / non-loading state below, which is realized by pulling up / pulling down the reset pin, which will not be described below.
[0104] By pulling up the reset pin of the circuit unit (i.e. FPGA, second control unit, third control unit, etc.) to make the circuit unit in the loading state, or by pulling down the reset pin of the circuit unit (i.e. FPGA, second control unit, third control unit, etc.) to make the circuit unit in the non-loading state, the problem of industrial camera system crash caused by simultaneous loading of multiple control units can be avoided.
[0105] In a possible implementation, the switch unit 400 initially connects access point 1 and access point 3 to be conductive. Therefore, after the industrial camera is powered on, the first control unit 100 does not need to send the first state switching signal to the switch unit 400. In the following, the switch unit 400 initially connects access point 1 and access point 3 to be conductive, which will not be described below.
[0106] In the above embodiments, the access point 1 of the switch unit 400 can be used to realize the conduction between the program storage unit 300 and the first control unit 100 with the access point 3, or can be used to switch the conduction state of the switch unit 400 under the control of the first control unit 100. For example, when the access point 2 and the access point 3 of the switch unit 400 are currently conductive, the first control unit 100 can control the access point 1 and the access point 3 of the switch unit 400 to be conductive through the access point 1. For another example, when the access point 1 and the access point 3 of the switch unit 400 are currently conductive, the first control unit 100 can control the access point 2 and the access point 3 of the switch unit 400 to be conductive through the access point 1. In the embodiments of the present application, the access point used to realize the conduction between the program storage unit 300 and the first control unit 100 with the access point 3 is the same as the access point used to switch the conduction state of the switch unit 400 under the control of the first control unit 100.
[0107] In another possible implementation, the first control unit 100 reads the second program from the program storage unit 300 and sends it to the second control unit 200. As shown in Figure 5a and Figure 5b Fig. 1 shows a first structure diagram of an industrial camera loading program provided by an embodiment of the present application. After the industrial camera is powered on, the first control unit 100 controls the switch unit 400 to make the access point 1 and the access point 3 of the switch unit 400 conductive, so as to make the first control unit 100 and the program storage unit 300 conductive. Then the first control unit reads the first program required for loading the first control unit 100 from the program storage unit 300 through the switch unit 400, and loads the first program.
[0108] After the first control unit 100 finishes loading the first program, the second program required for loading the second control unit 200 is read from the program storage unit 300, and the access point 1 and the access point 2 of the switch unit 400 are controlled to be conductive, so as to make the second control unit 200 and the first control unit 100 conductive, as shown in Figure 5b Then the first control unit 100 sends the read second program to the second control unit 200, and the second control unit 200 loads the second program. Finally, the first control unit 100 and the second control unit 200 realize data transmission in parallel by using the loaded programs.
[0109] As can be seen from the above embodiment, the access point 1 on the switch unit 400 can be used not only for controlling the switching of the switch state, but also for accessing the first control unit 100, which reduces the number of wirings and the number of related hardware in the industrial camera, and reduces the cost of the industrial camera, but correspondingly, there may be a problem of reduced stability and reliability of the switch unit.
[0110] In order to improve the stability and reliability of the switch unit 400, in another possible embodiment, the access point for controlling the switching of the state of the switch unit on the switch unit 400 and the access point for accessing the first control unit can be different.
[0111] The industrial camera in the case where the access point for controlling the switching of the state of the switch unit on the switch unit and the access point for accessing the first control unit are different will be described below with the second control unit 200 reading the second program from the program storage unit 300 as an example. As shown in Figure 6 , Figure 6 Fig. 2 shows a second structure diagram of an industrial camera provided by an embodiment of the present application. The industrial camera comprises a first control unit 100 and a second control unit 200, a program storage unit 300, and a switch unit 400. The access point 4 on the switch unit 400 is used for switching the conductive state of the switch unit 400 under the control of the first control unit 100, which is referred to as a state switching access point in the following description for convenience. As shown inFigure 6 As shown, the first control unit 100 is connected to the switch unit 400 via state switching access points 4 and 1, the second control unit 200 is connected to the switch unit 400 via access point 2, and the program storage unit 300 is connected to the switch unit 400 via access point 3. In this embodiment, after the industrial camera is powered on, the process of the first control unit 100 and the second control unit 200 reading and loading the program from the program storage unit 300 and transmitting data is exactly the same as the process in the previous embodiment, and will not be described again here.
[0112] Understandably, the more control units there are, the faster the data transmission efficiency. Similar to the industrial camera with two control units mentioned above, in an industrial camera with three or more control units, when other control units besides the first control unit acquire the required program, they can either read it directly from the program storage unit, or the first control unit can read it from the program storage unit and send it to the other control units.
[0113] The following example illustrates an industrial camera with three control units, along with its program loading and data transmission methods, using the second control unit 200 reading the second program from the program storage unit 300 as an example.
[0114] In one possible embodiment, the structure of the industrial camera is as follows: Figure 7 As shown, the interaction diagram during industrial camera loading is as follows: Figure 8 As shown. In this case, as Figure 7 As shown, the industrial camera includes a first control unit 100, a second control unit 200, a third control unit 500, a program storage unit 300, and a switching unit 400. The first control unit 100 is connected to the switching unit 400 via access point 1, the second control unit 200 is connected to the switching unit via access point 2, the program storage unit is connected to the switching unit 400 via access point 3, and the third control unit 500 is connected to the switching unit 400 via access point 5. The state of the switching unit 400 when access point 5 and access point 3 are connected is called the third state. Figure 9a As shown, when the first control unit 100 is connected to the program storage unit 300, access point 1 and access point 3 on the switching unit 400 are connected; as Figure 9b As shown, when the second control unit 200 and the program storage unit 300 are connected, access point 2 and access point 3 on the switching unit are connected; as Figure 9c As shown, when the third control unit 500 and the program storage unit 300 are connected, the access point 3 and access point 5 on the switch unit are connected.
[0115] After the industrial camera is powered on, the first control unit 100 controls the switching unit 400 to enable the second control unit 200 and the program storage unit to conduct (corresponding to...). Figure 8 The first control unit 100 sends a first state switching signal, and the switching unit is in the first state. To avoid data read errors caused by multiple control units accessing the program storage unit 300 simultaneously, the first control unit 100 also controls the second control unit to be in a non-loaded state. Then, the first control unit 100 reads the first program required for loading (corresponding to the first program) from the program storage unit 300 through the switching unit 400. Figure 8 The first control unit 100 reads the first program, returns to the first program, and loads the first program. After the first control unit 100 finishes loading the first program, the control switch unit 400 enables the second control unit 200 and the program storage unit 300 to conduct (corresponding to...). Figure 8 The first control unit 100 sends a second state switching signal, and the switching unit is in the second state; then, the first control unit 100 controls the second control unit to be in the loading state and sends a loading signal to the second control unit 200. In response to the first loading signal, the second control unit 200 reads the second program required for loading from the program storage unit 300 through the switching unit 400 (corresponding to the second program). Figure 8 (Return to the second program), and load the second program.
[0116] After loading is complete, the second control unit 200 sends a loading completion signal to the first control unit 100. The first control unit 100 then controls the switching unit 400 to enable the third control unit 500 and the program storage unit 300 to conduct (corresponding to...). Figure 8 The first control unit 100 sends a third state switching signal, and the switching unit is in the third state. Then, the first control unit 100 controls the third control unit 500 to be in the loading state and sends a loading signal to the third control unit 500. In response to the loading signal, the third control unit 500 reads the fourth program (corresponding to the fourth program) required by the third control unit 500 from the program storage unit 300 through the switching unit 400. Figure 8 The process then returns to the fourth program and loads it. Finally, the first control unit 100, the second control unit 200, and the third control unit 500 use the loaded program to perform data transmission in parallel.
[0117] The following describes an industrial camera with three control units, along with its program loading and data transmission methods, using the example of the first control unit 100 reading the program from the program storage unit 300 and sending the required program to other control units.
[0118] like Figure 10a , Figure 10b , Figure 10cFig. 10 shows a second structure diagram of the industrial camera loading procedure provided by the embodiment of the present application. After the industrial camera is powered on, the first control unit 100 controls the switch unit 400 to make the access point 1 and the access point 3 of the switch unit 400 conductive, so as to make the first control unit 100 and the program storage unit 300 conductive, as shown in Fig. 10. Then the first control unit reads the first program required for loading the first control unit 100 from the program storage unit 300 through the switch unit 400, and loads the first program.
[0119] After the first control unit 100 loads the first program, the second program required for loading the second control unit 200 is read from the program storage unit 300, and the access point 1 and the access point 2 of the switch unit 400 are controlled to be conductive, so as to make the second control unit 200 and the first control unit 100 conductive, as shown in Fig. 11. Figure 10b Then the first control unit 100 sends the read second program to the second control unit 200, and the second control unit 200 loads the second program.
[0120] After the first control unit 100 sends the second program to the second control unit 200, the fourth program required for loading the third control unit 500 is read from the program storage unit, and the access point 1 and the access point 5 of the switch unit 400 are controlled to be conductive, so as to make the first control unit 100 and the third control unit 500 conductive, as shown in Fig. 12. Figure 10c Then the first control unit 100 sends the read fourth program to the third control unit 500, and the third control unit 500 loads the third program. Finally, the first control unit 100 and the second control unit 200 and the third control unit 500 realize data transmission in parallel by using the loaded programs.
[0121] By the embodiment of the present application, three control units are used to realize data transmission in parallel, compared with two control units realizing data transmission in parallel, the speed of data transmission of the industrial camera is further improved, and the demand of high-speed data transmission is met.
[0122] For the industrial camera with more than three control units, the structure, the program loading method and the data transmission method of the industrial camera are similar to those of the industrial camera with three control units and the program loading method and the data transmission method of the industrial camera in the above embodiment, which will not be described here.
[0123] In order to meet the real-time requirement of the industrial camera, the FPGA is usually further included in the industrial camera. Before the MCU processes and transmits the data, the FPGA is used to realize the coding and decoding of the wireless signal channel, the processing of the video image signal, or the transceiving and exchanging of the high-speed interface data. For example, the image processing device in the medical equipment field or the surgical robot can use the FPGA to perform high-speed image processing. The combination of the FPGA and the control unit in the wireless communication and network device in the communication field can be used to process the high-speed data stream. The FPGA is used to process the camera image in the industrial camera in the field of machine vision and automation. Therefore, in a possible implementation, the third program required by the FPGA is further stored in the program storage unit 300. After the industrial camera is powered on, the FPGA needs to acquire and load the third program required by the FPGA, so that the FPGA can process the data.
[0124] According to the embodiment of the present application, the FPGA has the high-speed parallel processing capability, can complete a large number of computing tasks in a short time, and thus can process the image collected by the industrial camera in real time, thereby ensuring the real-time performance of the image processing of the industrial camera.
[0125] The industrial camera with two control units is taken as an example to describe the industrial camera including the FPGA, and the program loading method and the data transmission method of the industrial camera.
[0126] In a possible implementation, the multi-control unit device includes a first control unit, a second control unit, a program storage unit, an FPGA, and a switch unit. The loading sequence of the second control unit and the FPGA can be set according to the user requirement. In the embodiment of the present application, the loading sequence of the second control unit and the FPGA is not limited. For example, in order to ensure that the industrial camera can timely perform data transmission, the first control unit can be loaded first, then the second control unit is loaded, and finally the FPGA is loaded. In order to ensure that the industrial camera can timely process the image collected by the industrial camera, the first control unit can be loaded first, then the FPGA is loaded, and finally the second control unit is loaded.
[0127] Based on the above, the second control unit loading the required program can be directly read by the second control unit from the program storage unit, or can be read by the first control unit from the program storage unit and sent to the second control unit. Similarly, the FPGA loading the required third program can be directly read by the FPGA from the program storage unit, or can be read by the first control unit from the program storage unit and sent to the FPGA. Since the program required by the FPGA is different from the program required by the control unit, a partition is set in the program storage unit for storing the third program required by the FPGA. Similarly, if the programs required by the control units are different, the program storage unit needs to be partitioned to obtain multiple partitions, and the programs required by the control units are stored in different partitions, and the partition for storing the program required by the control unit is different from the partition for storing the program required by the FPGA; if the programs required by the control units are the same, only the first partition for storing the program required by the FPGA is needed, and the program required by the control unit is directly stored in the area of the program storage unit except the first partition.
[0128] Based on this, according to the difference of the loading sequence of the FPGA and the second control unit, the difference of the execution subject of the program required by the FPGA, and the difference of the acquisition mode of the program required by the second control unit and the FPGA, there are eight cases as follows.
[0129] Case one: the first control unit is loaded first, then the second control unit, and finally the FPGA, the program required by the second control unit is directly read by the second control unit from the program storage unit, and the program required by the FPGA is sent by the first control unit to the FPGA;
[0130] In a possible embodiment, the structure of the industrial camera is as shown in Figure 11 The interaction diagram of the industrial camera when loading is as shown in Figure 12 Since the program required by the FPGA is sent by the first control unit 100 to the field programmable logic gate array 600, the FPGA accesses the switch unit 400 through the access point 1.
[0131] In this embodiment, after the industrial camera is powered on, the first control unit 100 controls the switch unit 400 to make the first control unit 100 and the program storage unit conductive (corresponding to Figure 12The first control unit 100 sends a first state switching signal to the switch unit 400, and the switch unit is in the first state. The first control unit 100 sends a reset signal to the second control unit 200 and the field programmable logic gate array 600, respectively. The second control unit and the field programmable logic gate array 600 keep the non-loading state in response to the reset signal (corresponding to the aforementioned control of the second control unit in the non-loading state and the control of the FPGA in the non-loading state). Then the first control unit reads the first program required for the first control unit 100 to load from the program storage unit 300 through the switch unit 400 in the first state, and loads the first program (corresponding to the return of the first program in the aforementioned Figure 12 The structure of the industrial camera is shown in FIG. 4B. The access point 1 of the switch unit 400 is connected to the access point 3. Figure 13a
[0132] After the first control unit 100 loads the first program, the first control unit 100 controls the switch unit 400 to make the second control unit 200 and the program storage unit 300 conductive (corresponding to the sending of the second state switching signal in the aforementioned Figure 12 The structure of the industrial camera is shown in FIG. 4B. The access point 1 of the switch unit 400 is connected to the access point 3. Figure 12 Figure 13b
[0133] After the second control unit 200 loads the second program, the second control unit 200 sends a loading completion signal to the first control unit 100. The first control unit 100 controls the switch unit 400 to make the first control unit 100 and the program storage unit 300 conductive in response to the loading completion signal (corresponding to the sending of the first state switching signal in the aforementioned Figure 12 The structure of the industrial camera is shown in FIG. 4B. The access point 1 of the switch unit 400 is connected to the access point 3. Figure 13a Figure 12
[0134] After the control units and the FPGA are loaded, when the industrial camera collects image data, the FPGA processes the image data by using the loaded third program to obtain processed image data, and the first control unit 100 and the second control unit 200 transmit the processed image data in parallel by using the loaded programs.
[0135] According to the embodiment, the first control unit is loaded first, and then the second control unit is loaded, so that the control units can be loaded in time for data transmission.
[0136] Case two: the first control unit is loaded first, and then the second control unit is loaded, and finally the FPGA is loaded. The program required for loading the second control unit is read directly from the program storage unit by the second control power supply, and the program required for loading the FPGA is sent by the second control unit to the FPGA.
[0137] In a possible embodiment, the structure of the industrial camera is as shown in Figure 14 Since the program required for loading the FPGA is sent by the second control unit 200 to the field programmable logic gate array 600, the FPGA accesses the switch unit 400 through the access point 2.
[0138] In this embodiment, after the industrial camera is powered on, the first control unit 100 controls the switch unit 400 to make the first control unit 100 and the program storage unit conductive, the first control unit 100 sends a reset signal to the second control unit 200 and the field programmable logic gate array 600 respectively, and the second control unit and the FPGA remain in a non-loading state in response to the reset signal. Then the first control unit reads the first program required for loading the first control unit 100 from the program storage unit 300 through the switch unit 400, and loads the first program.
[0139] After the first control unit 100 loads the first program, the switch unit 400 is controlled to make the second control unit 200 and the program storage unit 300 conductive, and then the first control unit 100 controls the second control unit 200 to be in a loading state, and sends a loading signal to the second control unit 200. The second control unit 200 reads the second program required for loading the second control unit 200 from the program storage unit 300 through the switch unit 400 and loads the second program in response to the loading signal.
[0140] After the second control unit 200 is loaded, the second control unit 200 reads the third program required for loading the FPGA from the program storage unit 300 and sends the third program to the FPGA, and the FPGA receives the third program and loads the third program.
[0141] After the control units and the FPGA are loaded, when the industrial camera collects image data, the FPGA processes the image data by using the loaded third program to obtain processed image data, and the first control unit 100 and the second control unit 200 transmit the processed image data in parallel by using the loaded programs.
[0142] By using the embodiment of the application, the first control unit is loaded first after the loading is completed, so that the data transmission can be performed in time after the control units are loaded.
[0143] Case three: the first control unit is loaded first, then the FPGA is loaded, and finally the second control unit is loaded. The program required for loading the second control unit is directly read from the program storage unit by the second control power supply, and the program required for loading the FPGA is sent to the FPGA by the first control unit.
[0144] In a possible embodiment, the structure of the industrial camera is as shown in Figure 11 The interaction diagram of the industrial camera during loading is as shown in Figure 15 Since the program required for loading the FPGA is sent to the FPGA by the first control unit, the field programmable logic gate array 600 accesses the switch unit 400 through the access point 1.
[0145] In this embodiment, after the industrial camera is powered on, the first control unit 100 controls the switch unit 400 to make the first control unit 100 and the program storage unit conductive (corresponding to sending the first state switching signal in Figure 15 , and the switch unit is in the first state), and the first control unit 100 sends a reset signal to the second control unit 200 and the field programmable logic gate array 600 respectively, and the second control unit and the FPGA remain in the non-loading state in response to the reset signal (corresponding to controlling the second control unit to be in the non-loading state and controlling the FPGA to be in the non-loading state as described above). Then the first control unit reads the first program required for loading the first control unit 100 from the program storage unit 300 through the switch unit 400, and loads the first program (corresponding to reading the first program in Figure 15 , and returning the first program).
[0146] After the first control unit 100 loads the first program, the third program required for loading the FPGA is read from the program storage unit 300 and sent to the FPGA (corresponding to sending the reading signal in Figure 15 , and returning the third program), and the FPGA receives the third program and loads it.
[0147] FPGA loading is completed to send a first control unit 100 loading complete signal, the first control unit 100 response and the control switch unit 400 to make the second control unit 200 and program storage unit 300 on (corresponding Figure 15 The second state switching signal is sent in the middle, the switch unit is in the second state), then the first control unit 100 control second control unit 200 in loading state, and send a loading signal to the second control unit 200, the second control unit 200 response to the loading signal by switch unit 400 from the program storage unit 300 to read the second control unit 200 loading required second program (corresponding Figure 15 The second program in the return is loaded.
[0148] In each control unit and FPGA loading is completed, when the industrial camera collects image data, FPGA using the loaded third program to process the image data, get the processed image data, the first control unit 100 and the second control unit 200 using the loaded program in parallel to the processed image data transmission.
[0149] In this embodiment, the first control unit 100 is in the field programmable logic gate array 600 loading is completed, the control switch unit 400 to make the second control unit 200 and program storage unit 300 on, but because the second control unit 200 and FPGA is independent unit, in the field programmable logic gate array 600 loading third program in the process, the second control unit is actually also can read the second program from the program storage unit 300 and load.
[0150] Based on this, in another possible embodiment, the first control unit by switch unit 400 from the program storage unit 300 to read the first control unit 100 loading required first program, and load the first program.
[0151] The first control unit 100 loading first program is completed, read from the program storage unit 300 and send FPGA FPGA loading required third program, and the first control unit 100 control switch unit 400 to make the second control unit 200 and program storage unit 300 on, and control the second control unit 200 in loading state, then the second control unit 200 by switch unit 400 from the program storage unit 300 to read the second control unit 200 loading required second program and load.
[0152] After the second control unit 200 loads the second program and the FPGA loads the third program, when the industrial camera collects image data, the FPGA processes the image data by using the loaded third program to obtain processed image data, and the first control unit 100 and the second control unit 200 transmit the processed image data by using the loaded programs in parallel.
[0153] By using the embodiment of the application, after the first control unit is loaded, the FPGA is controlled to be loaded, so that the FPGA can process the image collected by the industrial camera in time.
[0154] Case four: After the first control unit is loaded, the FPGA is loaded, and finally the second control unit is loaded. The program required for loading of the second control unit is read directly from the program storage unit by the second control power supply, and the program required for loading of the FPGA is sent by the second control unit to the FPGA.
[0155] In a possible embodiment, a structural schematic diagram in the process of loading of the industrial camera is as shown in Figure 16a and Figure 16b Since the program required for loading of the FPGA is sent by the second control unit to the FPGA, the field programmable logic gate array 600 accesses the switch unit 400 through the access point 2.
[0156] In this embodiment, after the industrial camera is powered on, the first control unit 100 controls the access point 1 and the access point 4 of the switch unit 400 to be turned on, so that the first control unit 100 and the program storage unit 300 are turned on, as shown in Figure 16a The first control unit 100 sends a reset signal to the second control unit 200 and the field programmable logic gate array 600 respectively, and the second control unit and the FPGA keep a non-loading state in response to the reset signal (corresponding to the aforementioned control of the second control unit being in the non-loading state and the control of the FPGA being in the non-loading state). Then the first control unit 100 reads the first program required for loading of the first control unit 100 from the program storage unit 300 through the switch unit 400, and loads the first program.
[0157] After the first control unit 100 loads the first program, the first control unit 100 sends a reading signal to the second control unit 200, and controls the access point 3 and the access point 2 of the switch unit 400 to be turned on, so that the second control unit 200 and the program storage unit 300 are turned on, as shown in Figure 16b; the second control unit 200 reads and sends the third program required by the FPGA to load from the program storage unit 300 via the switch unit 400 in response to the reading signal, and sends a loading completion signal to the first control unit 100 after the FPGA loading is completed, and the first control unit 100 controls the second control unit 200 to be in a loading state in response to the loading completion signal. The second control unit 200 reads the second program required by the second control unit 200 to load from the program storage unit 300 via the switch unit 400.
[0158] After the industrial camera collects image data, the FPGA processes the image data using the loaded third program to obtain processed image data, and the first control unit 100 and the second control unit 200 use the loaded programs to transmit the processed image data in parallel.
[0159] By using the embodiment of the present application, the second control unit is loaded first after the first control unit is loaded, so that the data transmission can be performed in time after the control unit is loaded.
[0160] In order to facilitate description, only the connection relationship and loading sequence among the first control unit, the second control unit, the switch unit, the program storage unit and the FPGA will be described below, and the signaling interaction process will not be described.
[0161] Case five: the first control unit is loaded, then the second control unit is loaded, and finally the FPGA is loaded, and the programs required by the second control unit to load and the programs required by the FPGA to load are sent by the first control unit;
[0162] In this embodiment, as shown in Figure 17a and Figure 17b The fourth structure in the process of loading the program of the industrial camera provided by the application embodiment is shown. After the industrial camera is powered on, the first control unit 100 controls the switch unit 400 to make the access point 1 and the access point 3 of the switch unit 400 conductive, so as to make the first control unit 100 and the program storage unit 300 conductive. Then the first control unit reads the first program required by the first control unit 100 to load from the program storage unit 300 via the switch unit 400, and loads the first program.
[0163] After the first control unit 100 loads the first program, the second program required by the second control unit 200 to load is read from the program storage unit 300, and the access point 1 and the access point 2 of the switch unit 400 are controlled to be conductive, so as to make the second control unit 200 and the first control unit 100 conductive, as shown in Figure 17b Then the first control unit 100 sends the read second program to the second control unit 200, and the second control unit 200 loads the second program.
[0164] After the first control unit 100 sends the second program to the second control unit 200, the access point 1 and the access point 3 of the switch unit 400 are turned on, as shown in Figure 17a , so that the first control unit 100 and the program storage unit 300 are turned on, the third program required by the field programmable logic gate array 600 is read from the program storage unit 300, and then the first control unit 100 sends the read third program to the field programmable logic gate array 600, and the field programmable logic gate array 600 loads the third program.
[0165] After the industrial camera collects image data, the FPGA processes the image data by using the loaded third program to obtain processed image data, and the first control unit 100 and the second control unit 200 transmit the processed image data in parallel by using the loaded programs.
[0166] Case six: the first control unit is loaded, then the second control unit is loaded, and finally the FPGA is loaded. The programs required by the second control unit and the programs required by the FPGA are directly read from the program storage unit by the second control unit and the FPGA.
[0167] In this embodiment, as shown in Figure 18a , Figure 18b , Figure 18c The fifth structure schematic diagram in the process of loading the program of the industrial camera is shown in the application embodiment, after the industrial camera is powered on, the first control unit 100 controls the switch unit 400 to make the access point 1 and the access point 3 of the switch unit 400 conductive, so that the first control unit 100 and the program storage unit 300 are turned on. Then the first control unit reads the first program required by the first control unit 100 from the program storage unit 300 through the switch unit 400, and loads the first program.
[0168] After the first control unit 100 loads the first program, the access point 3 and the access point 2 of the switch unit 400 are turned on to make the second control unit 200 and the program storage unit 300 conductive, as shown in Figure 18b ; then the second control unit 200 reads the second program from the program storage unit 300 and loads it.
[0169] After the second control unit 200 loads the second program, the first control unit 100 controls the access point 3 and the access point 6 of the switch unit 400 to be turned on, so that the field programmable logic gate array 600 and the first control unit 100 are turned on, as shown in Figure 18c , the field programmable logic gate array 600 reads the third program from the program storage unit 300 and loads it.
[0170] After the industrial camera collects the image data, the FPGA processes the image data using the loaded third program to obtain processed image data, and the first control unit 100 and the second control unit 200 transmit the processed image data in parallel using the loaded programs.
[0171] Case seven: the first control unit is loaded first, then the FPGA is loaded, and finally the second control unit is loaded; the program required for loading the second control unit and the program required for loading the FPGA are read directly by the second control unit and the FPGA from the program storage unit;
[0172] In this embodiment, as shown in Figure 18a , after the industrial camera is powered on, the first control unit 100 controls the switching unit 400 to make the access point 1 and the access point 3 of the switching unit 400 conductive, so that the first control unit 100 and the program storage unit 300 are conductive. Then the first control unit reads the first program required for loading the first control unit 100 from the program storage unit 300 through the switching unit 400, and loads the first program.
[0173] After the first control unit 100 completes loading the first program, the first control unit 100 controls the switching unit 400 to make the access point 3 and the access point 6 conductive, so that the field programmable logic gate array 600 and the first control unit 100 are conductive, as shown in Figure 18c , the field programmable logic gate array 600 reads the third program from the program storage unit 300 and loads it.
[0174] After the field programmable logic gate array 600 completes loading the third program, the first control unit 100 controls the switching unit 400 to make the access point 3 and the access point 2 conductive, so that the second control unit 200 and the program storage unit 300 are conductive, as shown in Figure 18b ; then the second control unit 200 reads the second program from the program storage unit 300 and loads it.
[0175] After the industrial camera collects the image data, the FPGA processes the image data using the loaded third program to obtain processed image data, and the first control unit 100 and the second control unit 200 transmit the processed image data in parallel using the loaded programs.
[0176] Case eight: the first control unit is loaded first, then the FPGA is loaded, and finally the second control unit is loaded; the program required for loading the second control unit and the program required for loading the FPGA are sent by the first control unit;
[0177] In this embodiment, as shown in Figure 17aAs shown, after the industrial camera is powered on, the first control unit 100 controls the switch unit 400 to make the access point 1 and the access point 3 of the switch unit 400 conductive, so as to make the first control unit 100 and the program storage unit 300 conductive. Then the first control unit reads the first program required for the first control unit 100 to load from the program storage unit 300 through the switch unit 400, and loads the first program.
[0178] After the first control unit 100 completes the loading of the first program, the third program required for the field programmable logic gate array 600 to load is read from the program storage unit 300, and then the first control unit 100 sends the read third program to the field programmable logic gate array 600, and the field programmable logic gate array 600 loads the third program.
[0179] After the first control unit 100 sends the third program to the field programmable logic gate array 600, the access point 1 and the access point 2 of the switch unit 400 are controlled to be conductive, so as to make the second control unit 200 and the first control unit 100 conductive, as shown in Figure 17b Then the first control unit 100 sends the read second program to the second control unit 200, and the second control unit 200 loads the second program.
[0180] After the industrial camera collects image data, the FPGA processes the image data by using the loaded third program to obtain processed image data, and the first control unit 100 and the second control unit 200 transmit the processed image data in parallel by using the loaded programs.
[0181] Based on the above embodiment, if the FPGA directly reads the program required for loading from the program storage unit without being transferred through the control unit, potential communication delay is reduced, and if the first control unit or the second control unit reads the program required for loading from the program storage unit to send to the FPGA, the FPGA does not need to be additionally provided with an interface and a reading circuit of the program storage unit, so that the hardware cost of the industrial camera can be reduced. In addition, if the second control unit directly reads the program required for loading from the program storage unit, the communication delay caused by the forwarding of the first control unit is reduced, and the first control unit sends the program required for the second control unit to load to the second control unit, so that the centralized control and management of the entire industrial camera by the first control unit can be realized.
[0182] It can be understood that in the above embodiment, the connection and communication between each control unit and the FPGA, the switch unit, and the program storage unit are actually realized through pins (i.e., pins). For example, the first control unit controls the second control unit to be in the loading state by pulling up the reset pin of the second control unit, and controls the FPGA to be in the non-loading state by pulling down the reset pin of the FPGA.
[0183] Since the industrial camera provided by the embodiment of the present application comprises at least two control units, when data transmission is performed, the data can be realized by the control units together. During the data transmission, the data transmission can be performed by one of the control units using the loaded program, or the data transmission can be performed by the control units together using the loaded programs. It can be understood that the control unit that can perform data transmission alone is the master control unit, i.e., the master device in the following, and the control unit that cannot perform data transmission alone is the slave control unit, i.e., the slave device in the following.
[0184] In order to facilitate the control unit to identify whether it is a master control unit or a slave control unit, in a possible embodiment, a pin can be arranged on each control unit, and the control unit can determine whether it is a master control unit or a slave control unit by identifying the pulled-up or pulled-down state of the pin of the control unit.
[0185] When data transmission is needed, the master control unit responds to the to-be-sent data, and determines first to-be-sent data to be sent by the master control unit and second to-be-sent data to be sent by the slave control unit according to the data amount of the to-be-sent data. The data amount of the first to-be-sent data to be sent by the master control unit is equal to the data amount of the second to-be-sent data to be sent by the slave control unit. The slave control unit cannot perform data transmission alone, so when the master control unit and the slave control unit perform data transmission in parallel, the master control unit actually drives itself to send the first to-be-sent data and drives the slave control unit to send the second to-be-sent data.
[0186] For example, it is assumed that there are four control units in the industrial camera, the first control unit is identified as a master device by being pulled down on the pin of the first control unit, and the second control unit, the third control unit, and the fourth control unit are identified as slave devices by being pulled up on the pins of the second control unit, the third control unit, and the fourth control unit. After the control units load the required programs, if data transmission is needed, the first control unit can perform data transmission independently, or the first control unit can drive at least one of the second control unit, the third control unit, and the fourth control unit to perform data transmission in parallel with the first control unit.
[0187] It is understandable that if the amount of data to be transmitted is small or the bandwidth requirement is low, the main control device can be used to transmit the data. If the amount of data to be transmitted is large or the bandwidth requirement is high, a combination of a main control unit and a slave control unit can be used to achieve data transmission. For example, assuming there are two control units in an industrial camera, and the amount of data to be transmitted is 4 Gb, the main control unit can send 4 Gb and the slave control unit can send 0 Gb; the main control unit can send 3 Gb and the slave control unit can send 1 Gb; the main control unit can send 2 Gb and the slave control unit can send 2 Gb; or other allocation methods can be used. Specifically, the main control unit adaptively allocates the data based on the performance of the main control unit and the slave control unit, and this application does not limit this.
[0188] In the embodiments of this application, after the first control unit identifies itself as the master device and the second control unit identifies itself as the slave device, the first control unit and the second control unit can perform data transmission in parallel through master-slave cooperation, thereby improving the efficiency of data transmission.
[0189] like Figure 19 The diagram shown is an example of the structure of an industrial camera provided in this embodiment of the application. The industrial camera provided in this embodiment includes a program storage unit 30 (Flash), two control units (first control unit 10 (MCU1) and second control unit 20 (MCU2)), a field-programmable gate array 50 (FPGA), and four load switches (switch 41, switch 42, switch 43, and switch 44). After the device is powered on, MCU1 pulls the FPGA's reset pin 501 (FPGA_RST) low through the general-purpose input / output interface 101 (MCU1_GPIO0), and pulls the MCU2's reset pin 205 (MCU2_RST) low through the general-purpose input / output interface 109 (MCU1_GPIO3), preventing MCU2 and FPGA from loading.
[0190] Then MCU1 general input output interface 103 (MCU1_GPIO2) pulls down the state switching access point 1 of load switch 41, load switch 42, load switch 43, load switch 44, realizes the communication of access point 2 and access point 4 of the above load switch, since the pin 301 (DO pin) of Flash, pin 302 (DI pin), pin 303 (CLK pin), pin 304 (CS pin) are connected with the access point 4 of load switch respectively, the access point 2 of load switch is connected with the pin 104 (MCU1_MISO) of MCU1, pin 105 (MCU1_MOSI), pin 106 (MCU1_CLK), pin 107 (MCU1_CS) respectively, at this time, the signal of Flash can communicate with MCU1, MCU1 can read the program required by MCU1 loading from Flash through load switch, and load. At this time, the pull-down state of resistance 120 connected by pin 109 (MCU1_GPIO3) can identify that MCU1 is the master control unit.
[0191] After MCU1 loading is completed, the reset of FPGA is released by MCU1, the pin 503 (FPGA_CONFIG_DATAO) of FPGA is connected with the access point 2 signal of switch 41, MCU1 can send the reading signal to Flash through switch 41 by pin 104 (MCU1_MISO), the program required by FPGA loading is sent to FPGA by Flash reading, and loaded by FPGA. After FPGA loading is completed, FPGA pulls up pin 502 (FPGA_Done), indicates the loading completion signal, and sends the loading completion signal to general input output port 102 (MCU1_GPIO1) of MCU1.
[0192] Finally, MCU1 realizes the communication of access point 4 and access point 3 by controlling the state switching access point of load switch, since the pin 201 (MCU2_CS) of MCU2, pin 202 (MCU2_CLK), pin 203 (MCU2_MOSI), pin 204 (MCU2_MISO) are connected with the access point 3 of each switch respectively, at this time, the signal of Flash can communicate with MCU2, MCU1 pulls up the reset pin MCU2_RST of MCU2 by pin 108 (MCU1_GPIO4), and releases MCU2. MCU2 reads the program required by MCU2 loading from program storage unit 30 through load switch, and loads. After MCU2 loading is completed, the pull-up state of resistance 207 connected by pin 206 (MCU2_GPIO3) can identify that MCU2 is the slave control unit.
[0193] From Figure 19It can be known that the number of load switches is 4, which are respectively connected with the pin 303 (CLK), the pin 304 (CS), the pin 301 (DO) and the pin 302 (DI) of the Flash. The CLK pin of the Flash 1 is connected with the pin 106 (MCU1 CLK) of the MCU 1, the pin 202 (MCU2 CLK) of the MCU 2 and the pin 504 (FPGA_CONFIG_CLK) of the FPGA through the load switches. There are state switching access points (corresponding to the access point 1 in Figure 19 , the first control unit access point (corresponding to the access point 2 in Figure 19 , the second control unit access point (corresponding to the access point 3 in Figure 19 and the program storage unit access point (corresponding to the access point 4 in Figure 19 ) on each load switch. It can be understood that when the number of control units increases, the number of access points on each switch unit also increases. For example, if there are three control units in the device, at least one third control unit access point should be included on each switch unit, and if there are four control units in the device, at least two control unit access points should be included on each switch unit.
[0194] In addition, the industrial camera can usually collect and process image data in real time, and therefore, in a possible embodiment, the industrial camera further includes an image collection module, as shown in Figure 20 FIG. 1 is a schematic diagram of an industrial camera and a target device transmitting data according to an embodiment of the present application. The industrial camera 110 transmits data to other devices 220 through the interface connected data line 330. The structure of the industrial camera 110 is as shown in Figure 21As shown, it comprises an image acquisition module 1101, a field programmable logic gate array 1102, a first control unit 1105, a second control unit 1106, a switch unit 1104 and a program storage unit 1103. After the industrial camera is powered on, the switch unit 1104 is initially in a first state, the first control unit 1105 controls the second control unit 1106 to be in a non-loading state, and reads the first program required for the first control unit 1105 to load from the program storage unit 1103 through the switch unit 1104. After the first control unit 1105 is loaded, it controls the switch unit 1104 to be in a second state, and controls the second control unit 1106 to be in a loading state. The second control unit 1106 reads and loads the second program from the program storage unit 1103 through the switch unit 1104, and after the second control unit 1106 is loaded, the first control unit 1105 controls the switch unit 1104 to be in the first state, and reads the third program required for the field programmable logic gate array 1102 to load from the program storage unit 1103 and sends it to the field programmable logic gate array 1102. The field programmable logic gate array 1102 receives the third program and loads it. After each control unit and the field programmable logic gate array 1102 are loaded, the field programmable logic gate array 1102 receives the raw image sent by the image acquisition module 1101, processes the raw image and sends it to the first control unit 1105 and the second control unit 1106. The first control unit 1105 and the second control unit 1106 transmit the processed image data through the data transmission interface 1107 and the data transmission interface 1108 in a master-slave mode, thereby realizing bandwidth increase.
[0195] It can be understood that in the process of realizing the data transmission of the industrial camera, the loading sequence of the FPGA and the second control unit, and the acquisition method of the program required for the FPGA to load can be any one of the foregoing embodiments, and the embodiments of the present application do not limit this.
[0196] Based on the foregoing embodiments, the first aspect of the present application provides an industrial camera, which comprises a first control unit and a second control unit, a program storage unit and a switch unit; the switch unit is signal-connected with the first control unit, the second control unit and the program storage unit respectively;
[0197] The program storage unit stores the programs required for the control units to load;
[0198] The first control unit is used to control the second control unit to be in a non-loading state, and control the switch unit to make the first control unit conductive with the program storage unit, read the first program required for the first control unit to load from the program storage unit and load; after the loading of the first program is completed, control the second control unit to be in a loading state;
[0199] The second control unit is configured to acquire and load a second program required by the second control unit;
[0200] The first control unit is further configured to implement data transmission by using the loaded first program.
[0201] The second control unit is further configured to implement data transmission in parallel with the first control unit by using the loaded second program.
[0202] Compared with the prior art in which each control unit acquires and loads a program required by the control unit from different program storage units, the first program required by the first control unit and the second program required by the second control unit are stored in the same program storage unit in the present application, which reduces the number of program storage units and the cost of the industrial camera. Compared with the prior art in which each control unit is connected with different program storage units, the first control unit is connected with the program storage unit through the switch unit in the present application, so that the first control unit and the second control unit can acquire and load the required programs by controlling the switch unit, which reduces the number of pins required for establishing a connection. After the first control unit and the second control unit are loaded, the first program and the second program can be used to implement data transmission in parallel, thereby achieving the effect of high-speed data transmission by using a small number of pins. On the other hand, there is only one program storage unit in the present application, and subsequent encryption, upgrading or maintenance of the program storage unit in the industrial camera is relatively simple, and multiple program storage units do not need to be encrypted, upgraded or maintained respectively. Moreover, since the multiple program storage units do not need to be upgraded in the present application, the situation that the program versions of the multiple control units are not uniform due to the upgrading of the programs in part of the program storage units without the upgrading of the programs in another part of the program storage units does not exist.
[0203] In a possible implementation, the industrial camera further comprises a field programmable logic gate array, and the program storage unit further comprises a third program required by the field programmable logic gate array;
[0204] The first control unit is further configured to control the field programmable logic gate array to be in a non-loading state before reading the first program required by the first control unit from the program storage unit; and control the field programmable logic gate array to be in a loading state after completing the loading of the first program.
[0205] The field programmable logic gate array is configured to acquire and load the third program.
[0206] In a possible implementation, the first control unit is further configured to, after the loading of the first program is completed, control the switch unit to enable the second control unit to be connected with the program storage unit; and the second control unit is specifically configured to read the second program required for loading the second control unit from the program storage unit and load the second program.
[0207] Or,
[0208] The first control unit is further configured to read the second program from the program storage unit and send the second program to the second control unit; and the second control unit is specifically configured to receive the second program sent by the first control unit and load the second program.
[0209] In a possible implementation, the first control unit is provided with a first pin, and the second control unit is provided with a second pin.
[0210] The first control unit is specifically configured to determine itself as the master device after identifying that the first pin is pulled low.
[0211] The second control unit is specifically configured to determine itself as the slave device after identifying that the second pin is pulled high.
[0212] The first control unit is specifically configured to, in response to the to-be-sent data, determine the first to-be-sent data required to be sent by the first control unit according to a data amount of the to-be-sent data; drive the first control unit to transmit the first to-be-sent data, and drive the second control unit to transmit the second to-be-sent data; and the sum of the data amount of the first to-be-sent data and the data amount of the second to-be-sent data is equal to the data amount of the to-be-sent data.
[0213] In a possible implementation, the first program is the same as the second program.
[0214] In a possible implementation, the industrial camera further includes at least one third control unit, and the third control unit is in signal connection with the switch unit.
[0215] The first control unit is further configured to, before reading the first program required for loading the first control unit from the program storage unit, control the third control unit to be in a non-loading state; and after the loading of the second program by the second control unit is completed, control the third control unit to be in a loading state, and control the switch unit to enable the third control unit to be connected with the program storage unit.
[0216] The third control unit is configured to read a fourth program required for loading the third control unit from the program storage unit and load the fourth program.
[0217] The third control unit is further configured to implement data transmission in parallel with the first control unit and the second control unit by using the loaded fourth program.
[0218] In a possible implementation, the first control unit is further configured to read the third program from the program storage unit and send the third program to the field programmable logic array; or, after the second program is loaded, control the switch unit to enable the first control unit and the program storage unit, and read the third program from the program storage unit and send the third program to the field programmable logic array.
[0219] In a possible implementation, the first control unit is specifically configured to, after the second program is loaded, control the field programmable logic array to be in a loading state.
[0220] The second control unit is further configured to read the third program from the program storage unit and send the third program to the field programmable logic array.
[0221] In a possible implementation, the first control unit is further configured to drive the second control unit to read the third program from the program storage unit and send the third program to the field programmable logic array.
[0222] The first control unit is specifically configured to, after the third program is loaded, control the second control unit to be in a loading state.
[0223] The second control unit is further configured to read the third program from the program storage unit and send the third program to the field programmable logic array under the driving of the first control unit.
[0224] In a possible implementation, the first control unit is further configured to, after the loading of the first program is completed, or after the second program is loaded, control the switch unit to enable the field programmable logic array and the program storage unit.
[0225] The field programmable logic array is specifically configured to read the third program from the program storage unit and load the third program.
[0226] In a possible implementation, the first control unit is specifically configured to control the circuit unit to be in a loading state by pulling up a reset pin of the circuit unit, where the circuit unit includes the second control unit, the third control unit, or the field programmable logic array.
[0227] The first control unit is specifically configured to control the circuit unit to be in a non-loading state by pulling down a reset pin of the circuit unit.
[0228] In a second aspect of the present application, a program loading method of an industrial camera is provided, the industrial camera including a first control unit and a second control unit, a program storage unit, and a switch unit; the switch unit is in signal connection with the first control unit, the second control unit, and the program storage unit, respectively.
[0229] The method includes:
[0230] The first control unit controls the second control unit to be in a non-loading state, controls the switch unit to enable the first control unit and the program storage unit, reads a first program required by the first control unit from the program storage unit and loads the first program; after the loading of the first program is completed, the second control unit is controlled to be in a loading state.
[0231] The second control unit acquires a second program required by the second control unit and loads the second program.
[0232] Compared with the prior art in which each control unit acquires a required program from a different program storage unit, the first program required by the first control unit and the second program required by the second control unit are stored in the same program storage unit in the method for loading a program of an industrial camera provided by the embodiment of the present application, which reduces the number of program storage units and reduces the cost of the industrial camera. Compared with the prior art in which each control unit is connected with a different program storage unit, the first control unit is connected with the program storage unit through the switch unit in the present application, and the first control unit and the second control unit can acquire the required programs by controlling the switch unit, which reduces the number of pins required to establish a connection. On the other hand, there is only one program storage unit in the present application, and subsequent encryption, upgrading or maintenance of the program storage unit in the industrial camera is relatively simple, and multiple program storage units do not need to be encrypted, upgraded or maintained respectively. Moreover, since the multiple program storage units do not need to be upgraded in the present application, the situation that the program versions of the multiple control units are not uniform due to the upgrading of the programs in part of the program storage units without the upgrading of the programs in another part of the program storage units does not exist.
[0233] In a third aspect of the present application, a data transmission method is provided, which is applied to an industrial camera, and the industrial camera comprises a first control unit and a second control unit, a program storage unit and a switch unit; the switch unit is signal connected with the first control unit, the second control unit and the program storage unit respectively.
[0234] The method comprises:
[0235] The first control unit controls the second control unit to be in a non-loading state, controls the switch unit to enable the first control unit and the program storage unit, reads a first program required by the first control unit from the program storage unit and loads the first program; after the loading of the first program is completed, the second control unit is controlled to be in a loading state.
[0236] The second control unit acquires a second program required by the second control unit and loads the second program.
[0237] The first control unit and the second control unit perform data transmission in parallel by using the loaded first program and the second program.
[0238] In a possible implementation, the industrial camera further comprises an image acquisition component and a field programmable logic gate array, the industrial camera being connected with the target device; the image acquisition component is configured to acquire a raw image and send the raw image to the field programmable logic gate array; the field programmable logic gate array is configured to process the raw image to obtain a target image and send the target image to the first control unit and the second control unit.
[0239] The first control unit and the second control unit perform data transmission in parallel by using the loaded first program and the second program, including:
[0240] The first control unit and the second control unit transmit the target image to the target device in parallel by using the loaded first program and the second program.
[0241] Compared with the prior art in which each control unit acquires and loads the required program from different program storage units, in the present application, the first program required by the first control unit and the second program required by the second control unit are stored in the same program storage unit, which on the one hand reduces the number of program storage units and reduces the cost of the industrial camera; and compared with the prior art in which each control unit is connected with different program storage units, in the present application, the first control unit is connected with the program storage unit through the switch unit, and only by controlling the switch unit can the first control unit and the second control unit acquire and load the required program, which reduces the number of pins required to establish a connection, and after the first control unit and the second control unit are loaded, data transmission can be realized in parallel by using the loaded first program and the second program, thereby achieving the effect of high-speed data transmission with a small number of pins; on the other hand, there is only one program storage unit in the present application, and subsequent encryption, upgrading or maintenance of the program storage unit in the industrial camera is relatively simple. Moreover, since the multiple program storage units do not need to be upgraded in the present application, there is no situation that the program versions of the multiple control units are not uniform due to the upgrading of the program in part of the program storage units without the upgrading of the program in another part of the program storage units.
[0242] In a possible implementation, the industrial camera further comprises an image acquisition component and a field programmable logic gate array, the industrial camera being connected with the target device; the image acquisition component is configured to acquire a raw image and send the raw image to the field programmable logic gate array; the field programmable logic gate array is configured to process the raw image to obtain a target image and send the target image to the first control unit and the second control unit.
[0243] The first control unit and the second control unit perform data transmission in parallel by using the loaded first program and the second program, including:
[0244] The first control unit and the second control unit transmit the target image to the target device in parallel using the loaded first program and the second program.
[0245] The method provided in the embodiments of the present application can enable the first control unit and the second control unit to transmit data to the target device in parallel, thereby improving the efficiency of data transmission.
[0246] In a fourth aspect of the present application, a program loading device of an industrial camera is provided, the industrial camera comprising a first control unit and a second control unit, a program storage unit, and a switch unit; the switch unit is in signal connection with the first control unit, the second control unit, and the program storage unit respectively;
[0247] The device comprises a first control module and a second control module;
[0248] The first control module is configured to drive the first control unit to control the second control unit to be in a non-loading state, control the switch unit to enable the first control unit and the program storage unit, read the first program required by the first control unit from the program storage unit, and load the first program; after the loading of the first program is completed, control the second control unit to be in a loading state.
[0249] The second control module is configured to drive the second control unit to obtain the second program required by the second control unit and load the second program.
[0250] Compared with the prior art in which each control unit obtains the required program from different program storage units, the first program required by the first control unit and the second program required by the second control unit are stored in the same program storage unit in the present application, which reduces the number of program storage units and the cost of the industrial camera on the one hand; compared with the prior art in which each control unit is connected with different program storage units, the first control unit is connected with the program storage unit through the switch unit in the present application, so that the first control unit and the second control unit can obtain the required program by controlling the switch unit, thereby reducing the number of pins required for establishing the connection; on the other hand, there is only one program storage unit in the present application, and subsequent encryption, upgrading, or maintenance of the program storage unit in the industrial camera is relatively simple and does not need to be performed on multiple program storage units. Moreover, since the multiple program storage units do not need to be upgraded in the present application, the situation that the program versions of multiple control units are not uniform due to the upgrading of the programs in part of the program storage units without the upgrading of the programs in another part of the program storage units does not exist.
[0251] In a fifth aspect of the present application, a data transmission device is provided, which is applied to an industrial camera, the industrial camera comprising a first control unit and a second control unit, a program storage unit, and a switch unit; the switch unit is signal connected with the first control unit, the second control unit, and the program storage unit respectively;
[0252] The device comprises a first control module and a second control module;
[0253] The first control module is configured to drive the first control unit to control the second control unit to be in a non-loading state, control the switch unit to make the first control unit conduct with the program storage unit, read a first program required by the first control unit from the program storage unit and load the first program, and after the loading of the first program is completed, control the second control unit to be in a loading state.
[0254] The second control module is configured to drive the second control unit to acquire a second program required by the second control unit and load the second program.
[0255] The first control module is further configured to drive the first control unit to realize data transmission by using the loaded first program.
[0256] The second control module is further configured to drive the second control unit to perform data transmission in parallel with the first control unit by using the loaded second program.
[0257] Compared with the prior art in which each control unit respectively acquires and loads the required program from different program storage units, in the present application, the first program required by the first control unit and the second program required by the second control unit are stored in the same program storage unit, which on the one hand reduces the number of program storage units and lowers the cost of the industrial camera; and compared with the prior art in which each control unit is connected with different program storage units, in the present application, the first control unit is connected with the program storage unit through the switch unit, and only by controlling the switch unit can the first control unit and the second control unit acquire and load the required program, which reduces the number of pins required for establishing the connection, and after the first control unit and the second control unit are loaded, the first program and the second program can be used to realize parallel data transmission, thereby achieving the effect of high-speed data transmission by using a small number of pins; on the other hand, in the present application, there is only one program storage unit, and subsequent encryption, upgrading or maintenance of the program storage unit in the industrial camera is relatively simple. Moreover, since the present application does not need to upgrade multiple program storage units, there is no situation that the program versions of multiple control units are not uniform due to the upgrading of the program in part of the program storage units without the upgrading of the program in another part of the program storage units.
[0258] In yet another embodiment provided in the present application, a computer program product containing instructions is also provided, which, when running on a computer, causes the computer to execute the program loading method and the data transmission method of any of the industrial cameras in the above embodiments.
[0259] In the embodiments described above, all or some of the steps can be implemented by hardware, software, firmware or any combination thereof. When implemented in software, all or some of the steps can be implemented in the form of a computer program product. The computer program product includes one or more computer instructions. When loaded and executed by a computer, the computer program instructions cause the computer to perform all or some of the steps as described in the embodiments. The computer can be a general purpose computer, a special purpose computer, a computer network, or other programmable apparatuses. The computer instructions can be stored in a computer readable storage medium or transmitted from one computer readable storage medium to another computer readable storage medium, for example, the computer instructions can be transmitted from a website, a computer, a server or a data center to another website, computer, server or data center through a wired (for example, coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (for example, infrared, wireless, microwave, etc.) manner. The computer readable storage medium can be any available medium that can be accessed by a computer or a data storage device such as a server, data center, etc. integrated with one or more available media. The available media can be a magnetic medium (for example, floppy disk, hard disk, magnetic tape), an optical medium (for example, DVD), or a solid state disk (SSD), etc.
[0260] It should be noted that the relative terms such as first and second, etc. are used herein only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "contain" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements not only includes those elements, but also includes other elements not explicitly listed or inherent to such process, method, article or device. Without more limitations, the element defined by the statement "including a" does not exclude the presence of additional identical elements in the process, method, article or device including the element.
[0261] Each of the embodiments in the specification is described in a related manner, and the same or similar parts between each of the embodiments can be referred to each other. Each of the embodiments focuses on the difference from other embodiments.
[0262] The above only describes the preferred embodiments of the present application, and is not intended to limit the protection scope of the present application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application is included in the protection scope of the present application.
Claims
1. An industrial camera, characterized in that, The industrial camera includes a first control unit, a second control unit, a program storage unit, and a switch unit; the switch unit is signal-connected to the first control unit, the second control unit, and the program storage unit, respectively. The program storage unit stores the programs required by each control unit when it is loaded. The first control unit is configured to: control the second control unit to be in a non-loaded state; control the switching unit to enable the first control unit to be connected to the program storage unit; read the first program required for loading the first control unit from the program storage unit and load it; and after the first program is loaded, control the second control unit to be in a loading state. The second control unit is used to acquire and load the second program required for loading. The first control unit is also used to implement data transmission using the loaded first program; The second control unit is also used to perform data transmission in parallel with the first control unit using the loaded second program.
2. The industrial camera according to claim 1, characterized in that, The industrial camera also includes a field-programmable gate array (FPGA), and the program storage unit also includes a third program required by the FPGA for loading. The first control unit is further configured to: control the field-programmable gate array to be in an unloaded state before reading the first program required by the first control unit from the program storage unit; and control the field-programmable gate array to be in a loaded state after the first program is loaded. The field-programmable gate array is used to acquire and load the third program.
3. The industrial camera according to claim 1, characterized in that, The first control unit is further configured to, after loading the first program, control the switching unit to enable the second control unit to conduct with the program storage unit; the second control unit is specifically configured to read the second program required by the second control unit from the program storage unit and load it. or, The first control unit is further configured to read from the program storage unit and send the second program to the second control unit; the second control unit is specifically configured to receive the second program sent by the first control unit and load it.
4. The industrial camera according to claim 1, characterized in that, The first control unit is provided with a first pin, and the second control unit is provided with a second pin; The first control unit is specifically used to determine itself as a master device after detecting that the first pin has been pulled low; The second control unit is specifically used to determine itself as a slave device after recognizing that the second pin has been pulled high; The first control unit is specifically configured to, in response to the data to be sent, determine a first data to be sent by the first control unit based on the data volume of the data to be sent; drive the first control unit to transmit the first data to be sent, and drive the second control unit to transmit the second data to be sent; wherein the sum of the data volume of the first data to be sent and the data volume of the second data to be sent is equal to the data volume of the data to be sent.
5. The industrial camera according to claim 1, characterized in that, The first procedure is the same as the second procedure.
6. The industrial camera according to claim 1, characterized in that, The industrial camera also includes at least one third control unit, which is signal-connected to the switching unit. The first control unit is further configured to: control the third control unit to be in a non-loading state before reading the first program required by the first control unit from the program storage unit; control the third control unit to be in a loading state after the second control unit has loaded the second program, and control the switching unit to enable the third control unit to be connected to the program storage unit; The third control unit is used to read and load the fourth program required by the third control unit from the program storage unit. The third control unit is also used to perform data transmission in parallel with the first control unit and the second control unit using the loaded fourth program.
7. The industrial camera according to claim 2, characterized in that, The first control unit is further configured to read from the program storage unit and send the third program to the field-programmable gate array; or, after the second program is loaded, control the switching unit to enable the first control unit to be connected to the program storage unit, and read from the program storage unit and send the third program to the field-programmable gate array.
8. The industrial camera according to claim 2, characterized in that, The first control unit is specifically used to control the field-programmable gate array to be in a loading state after the second program is loaded; The second control unit is further configured to read from the program storage unit and send the third program to the field-programmable gate array.
9. The industrial camera according to claim 2, characterized in that, The first control unit is further configured to drive the second control unit to read from the program storage unit and send the third program to the field-programmable gate array; The first control unit is specifically used to control the second control unit to be in a loading state after the third program is loaded; The second control unit is further configured to, under the drive of the first control unit, read from the program storage unit and send the third program to the field-programmable gate array.
10. The industrial camera according to claim 2, characterized in that, The first control unit is further configured to, after the first program is loaded, or after the second program is loaded, control the switching unit to enable the field-programmable gate array to be connected to the program storage unit. The field-programmable gate array is specifically used to read and load the third program from the program storage unit.
11. The industrial camera according to any one of claims 1 to 10, characterized in that, The first control unit is specifically used to control the circuit unit to be in a loaded state by: pulling up the reset pin of the circuit unit, wherein the circuit unit includes a second control unit, a third control unit, or a field-programmable gate array; The first control unit is specifically used to control the circuit unit to be in an unloaded state by: pulling down the reset pin of the circuit unit.
12. A method for loading a program for an industrial camera, characterized in that, The industrial camera is the industrial camera as described in any one of claims 1-11; The method includes: The first control unit controls the second control unit to be in a non-loaded state, controls the switching unit to enable the first control unit to be connected to the program storage unit, reads the first program required for loading from the program storage unit and loads it; after the first program is loaded, the second control unit is controlled to be in a loading state. The second control unit acquires and loads the second program required for loading.
13. A data transmission method, characterized in that, This invention is applied to industrial cameras, which include a first control unit, a second control unit, a program storage unit, and a switching unit; the switching unit is signal-connected to the first control unit, the second control unit, and the program storage unit, respectively. The method includes: The first control unit controls the second control unit to be in a non-loaded state, controls the switching unit to enable the first control unit to be connected to the program storage unit, reads the first program required for loading from the program storage unit and loads it; after the first program is loaded, the second control unit is controlled to be in a loading state. The second control unit acquires and loads the second program required for loading. The first control unit and the second control unit perform data transmission in parallel using the loaded first program and second program.
14. The method according to claim 13, characterized in that, The industrial camera further includes an image acquisition component and a field-programmable gate array (FPGA). The industrial camera is connected to the target device. The image acquisition component is used to acquire a raw image and send the raw image to the FPGA. The FPGA is used to process the raw image to obtain a target image and send the target image to the first control unit and the second control unit. The first control unit and the second control unit perform data transmission in parallel using the loaded first program and second program, including: The first control unit and the second control unit use the loaded first program and second program in parallel to transmit the target image to the target device.
15. A program loading device for an industrial camera, characterized in that, The industrial camera is the industrial camera as described in any one of claims 1-11; The device includes a first control module and a second control module; The first control module is used to drive the first control unit to control the second control unit to be in a non-loaded state, control the switching unit to enable the first control unit to be connected to the program storage unit, read the first program required for loading from the program storage unit and load it; after the first program is loaded, control the second control unit to be in a loading state. The second control module is used to drive the second control unit to obtain and load the second program required by the second control unit.
16. A data transmission device, characterized in that, This invention is applied to industrial cameras, which include a first control unit, a second control unit, a program storage unit, and a switching unit; the switching unit is signal-connected to the first control unit, the second control unit, and the program storage unit, respectively. The device includes: a first control module and a second control module; The first control module is used to drive the first control unit to control the second control unit to be in a non-loaded state, control the switching unit to enable the first control unit to be connected to the program storage unit, read the first program required for loading from the program storage unit and load it; after the first program is loaded, control the second control unit to be in a loading state. The second control module is used to drive the second control unit to obtain and load the second program required for loading the second control unit; The first control module is also used to drive the first control unit to perform data transmission using the loaded first program; The second control module is also used to drive the second control unit to perform data transmission in parallel with the first control unit using the loaded second program.
Citation Information
Patent Citations
Safe starting method and device and terminal
CN108229132A