CN111371964A - Information transmission method and device - Google Patents

Information transmission method and device Download PDF

Info

Publication number
CN111371964A
CN111371964A CN202010184321.7A CN202010184321A CN111371964A CN 111371964 A CN111371964 A CN 111371964A CN 202010184321 A CN202010184321 A CN 202010184321A CN 111371964 A CN111371964 A CN 111371964A
Authority
CN
China
Prior art keywords
packet
image
image data
information
control command
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202010184321.7A
Other languages
Chinese (zh)
Inventor
何志华
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangdong Bozhilin Robot Co Ltd
Original Assignee
Guangdong Bozhilin Robot Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guangdong Bozhilin Robot Co Ltd filed Critical Guangdong Bozhilin Robot Co Ltd
Priority to CN202010184321.7A priority Critical patent/CN111371964A/en
Publication of CN111371964A publication Critical patent/CN111371964A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N1/00Scanning, transmission or reproduction of documents or the like, e.g. facsimile transmission; Details thereof
    • H04N1/32Circuits or arrangements for control or supervision between transmitter and receiver or between image input and image output device, e.g. between a still-image camera and its memory or between a still-image camera and a printer device
    • H04N1/32358Circuits or arrangements for control or supervision between transmitter and receiver or between image input and image output device, e.g. between a still-image camera and its memory or between a still-image camera and a printer device using picture signal storage, e.g. at transmitter
    • H04N1/32363Circuits or arrangements for control or supervision between transmitter and receiver or between image input and image output device, e.g. between a still-image camera and its memory or between a still-image camera and a printer device using picture signal storage, e.g. at transmitter at the transmitter or at the receiver
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/14Session management
    • H04L67/143Termination or inactivation of sessions, e.g. event-controlled end of session
    • H04L67/145Termination or inactivation of sessions, e.g. event-controlled end of session avoiding end of session, e.g. keep-alive, heartbeats, resumption message or wake-up for inactive or interrupted session
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/06Notations for structuring of protocol data, e.g. abstract syntax notation one [ASN.1]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/22Parsing or analysis of headers
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/26Special purpose or proprietary protocols or architectures
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N23/00Cameras or camera modules comprising electronic image sensors; Control thereof
    • H04N23/60Control of cameras or camera modules
    • H04N23/66Remote control of cameras or camera parts, e.g. by remote control devices
    • H04N23/661Transmitting camera control signals through networks, e.g. control via the Internet

Landscapes

  • Engineering & Computer Science (AREA)
  • Signal Processing (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Computer Security & Cryptography (AREA)
  • Multimedia (AREA)
  • Computing Systems (AREA)
  • Health & Medical Sciences (AREA)
  • Cardiology (AREA)
  • General Health & Medical Sciences (AREA)
  • Communication Control (AREA)

Abstract

The application provides an information transmission method and an information transmission device, wherein the method applied to an image acquisition equipment end comprises the following steps: generating an image data packet according to data of a target image to be transmitted, wherein the image data packet comprises a first packet header and a data segment, the first packet header carries preset information of the image data packet, the data segment carries image data of the target image, and the length of the data segment is determined by the width of the target image; and sending the image data packet to an upper computer. The information transmission method can automatically change the size of the transmission packet according to the image size, so that the image is transmitted in a whole line and a whole line, the transmission efficiency is optimized, and in addition, the transmission bandwidth can be greatly utilized due to the fact that invalid data are not transmitted.

Description

Information transmission method and device
Technical Field
The present application relates to the field of communications technologies, and in particular, to an information transmission method and apparatus.
Background
In the field of industrial cameras, a common image transmission protocol is defined by the international Automatic Imaging Association (AIA), the defined image transmission protocol is very complex, and is difficult to master by domestic industrial camera developers, so that at present, many domestic companies directly purchase a protocol code module (i.e., an IP core) written and designed abroad.
Meanwhile, in some existing image transmission protocols, the size of the transmitted data packet is generally specified in advance, and the length of the transmitted data packet is generally fixed. When an image is transmitted, image data is transmitted line by line in sequence, but a certain processing time interval exists between lines, and if the length of an image data segment of 1000 bytes is predefined and image data of one line only has 900 bytes, then the image data of 100 bytes of the next line is continuously filled, or 100 invalid bytes are continuously filled. For the first mode, after the image data of the first row is saved, the image data of the next row needs to be waited, and the transmission is performed after a complete data packet is filled, so that the time waste is caused, and the transmission efficiency is reduced; with the second approach, there is 100 bytes of invalid information, which results in a waste of transmission bandwidth.
Disclosure of Invention
An object of the embodiments of the present application is to provide an information transmission method and apparatus, which can greatly utilize transmission bandwidth and improve transmission efficiency, thereby improving technical problems in the prior art.
In a first aspect, an embodiment of the present application provides an information transmission method, which is applied to an image acquisition device, and the method includes: generating an image data packet according to data of a target image to be transmitted, wherein the image data packet comprises a first packet header and a data segment, the first packet header carries preset information of the image data packet, the data segment carries image data of the target image, and the length of the data segment is determined by the width of the target image; and sending the image data packet to an upper computer.
In the technical scheme, each image data packet only carries one line of image data, and the length of the data section is determined by the width of the image to be transmitted. The transmission mode can automatically change the size of a transmission packet according to the image size and transmit the image in a whole line, on one hand, the image data of the next line does not need to wait, the time interval between the lines can be fully utilized, the transmission efficiency is optimized, and on the other hand, the transmission bandwidth can be greatly utilized because extra invalid bytes do not need to be transmitted.
In one possible embodiment, the method further comprises: receiving a control command packet sent by an upper computer, wherein the control command packet comprises a second packet header and a command segment, the second packet header carries preset information of the control command packet, and the command segment carries information of one or more control commands; and analyzing the control command packet and executing all control commands in the control command packet.
The upper computer can complete the control of the shooting parameters (such as exposure, brightness, aperture and the like) and other functions of the image acquisition equipment by sending a control command packet to the image acquisition equipment. After receiving the control command packet, the image acquisition equipment analyzes the control command packet according to a structure specified by a protocol to obtain one or more control commands in the control command packet, and then executes all the control commands in the control command packet.
In one possible embodiment, the method further comprises: judging whether a heartbeat packet sent by an upper computer needs to be responded currently; if yes, generating a response packet responding to the heartbeat packet, and sending the response packet to the upper computer in preference to the image data packet.
In the technical scheme, the response packet has higher priority than the image data packet, and the reason for this is that the transmission of the image information can be waited, and if the heartbeat packet of the upper computer is not responded in time, the upper computer probably considers that the image acquisition device is lost or has errors, so the response packet needs to be uploaded preferentially. The effectiveness of connection is ensured between the image acquisition equipment and the upper computer through the heartbeat mechanism, and the stability of communication is ensured.
In one possible embodiment, before generating the image data packet from the data of the target image to be transmitted, the method further comprises: and configuring working information of the image acquisition equipment in a working register of the image acquisition equipment, wherein the working information comprises an MAC address of the image acquisition equipment, an IP address of an upper computer and packet sending interval time.
Before the image acquisition equipment is communicated with an upper computer, related working registers in the equipment need to be configured firstly, so that the protocol module can work normally, and the number of the related working registers to be configured is less than 10, so that the protocol module is very simple to use.
In a possible implementation manner, the information carried in the first packet header includes: image data packet flag, packet type, packet size, number of packets of one frame, frame ID sequence number, packet ID sequence number in one frame, image width information, image height information, image format information, and protocol version information.
In a possible implementation manner, the information carried in the second packet header includes: control command packet flag, packet type, and number of control commands.
In a possible implementation manner, the information carried by the heartbeat packet sent by the upper computer includes: a heartbeat packet mark, a packet type and an IP address of an upper computer; the information carried by the response packet includes: the method comprises the steps of responding to a packet mark, a packet type, an IP address of image acquisition equipment, an MAC address of the image acquisition equipment, firmware version information of the image acquisition equipment and software version information of the image acquisition equipment.
In a second aspect, an embodiment of the present application provides an information transmission method, which is applied to an upper computer, and the method includes: receiving an image data packet sent by image acquisition equipment, wherein the image data packet comprises a first packet head and a data segment, the first packet head carries preset information of the image data packet, the data segment carries image data of a transmitted target image, and the length of the data segment is determined by the width of the target image; and analyzing the image data packet, and obtaining a target image according to the image data packet.
In one possible embodiment, the method further comprises: generating a control command packet, wherein the control command packet comprises a second packet header and a command segment, the second packet header carries preset information of the control command packet, and the command segment carries information of one or more control commands; and sending the control command packet to image acquisition equipment.
In one possible embodiment, the method further comprises: judging whether a heartbeat packet needs to be issued to the image acquisition equipment at present; if yes, generating a heartbeat packet, giving priority to the heartbeat packet over the control command packet, sending the heartbeat packet to the image acquisition equipment, and waiting for a response packet responded by the image acquisition equipment.
In the technical scheme, the priority of the heartbeat packet is higher than that of the control command packet, so that the connection effectiveness of the heartbeat packet and the image acquisition equipment is ensured.
In a possible implementation manner, the information carried in the first packet header includes: image data packet flag, packet type, packet size, number of packets of one frame, frame ID sequence number, packet ID sequence number in one frame, image width information, image height information, image format information, and protocol version information.
In a possible implementation manner, the information carried in the second packet header includes: control command packet flag, packet type, and number of control commands.
In a possible implementation, the information carried by the heartbeat packet includes: a heartbeat packet mark, a packet type and an IP address of an upper computer; the information carried by the response packet includes: the method comprises the steps of responding to a packet mark, a packet type, an IP address of image acquisition equipment, an MAC address of the image acquisition equipment, firmware version information of the image acquisition equipment and software version information of the image acquisition equipment.
In a third aspect, an embodiment of the present application provides an information transmission apparatus configured in an image capturing device, where the apparatus includes: the image data packet generating module is used for generating an image data packet according to data of a target image to be transmitted, wherein the image data packet comprises a first packet head and a data section, the first packet head carries preset information of the image data packet, the data section carries image data of the target image, and the length of the data section is determined by the width of the target image; and the image data packet sending module is used for sending the image data packet to an upper computer.
In a fourth aspect, an embodiment of the present application provides an information transmission device configured on an upper computer, the device including: the image data packet receiving module is used for receiving an image data packet sent by image acquisition equipment, wherein the image data packet comprises a first packet head and a data segment, the first packet head carries preset information of the image data packet, the data segment carries image data of a transmitted target image, and the length of the data segment is determined by the width of the target image; and the image data packet analyzing module is used for analyzing the image data packet and obtaining a target image according to the image data packet.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are required to be used in the embodiments of the present application will be briefly described below, it should be understood that the following drawings only illustrate some embodiments of the present application and therefore should not be considered as limiting the scope, and that those skilled in the art can also obtain other related drawings based on the drawings without inventive efforts.
Fig. 1 is a block diagram of a structure flow of a BDR Vision protocol inside an industrial camera according to an embodiment of the present disclosure;
fig. 2 is a flowchart of an information transmission method according to an embodiment of the present application;
fig. 3 is a flowchart of an information transmission method according to an embodiment of the present application;
fig. 4 is a flowchart of an information transmission method according to an embodiment of the present application;
fig. 5 is a flowchart of an uplink state in the BDR Vision protocol according to an embodiment of the present disclosure;
fig. 6 is a flowchart of a work flow of a downlink state in the BDR Vision protocol according to an embodiment of the present application;
fig. 7 is a schematic diagram of an information transmission apparatus according to an embodiment of the present application;
fig. 8 is a further schematic diagram of an information transmission apparatus according to an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be described below with reference to the drawings in the embodiments of the present application.
The embodiment of the application provides a simple and easy-to-use image transmission protocol, which can be used for information transmission between image acquisition equipment and an upper computer, wherein the transmitted information can comprise images shot by the image acquisition equipment, control commands of the upper computer and the like. Meanwhile, the embodiment of the application provides an information transmission method between the image acquisition equipment and the upper computer based on the image transmission protocol. In this application, the upper computer may be a notebook computer, a desktop computer, a processing server, and the like, and the image capturing device may be a device capable of capturing images, including but not limited to a video camera, an industrial camera, a scanner, other devices with a photographing function, and the like.
The BDR Vision protocol comprises three working modes of a transmission mode, a control mode and a heartbeat package mode. Wherein, the transmission mode is as follows: the transmitted data is image data and is transmitted to the upper computer by the camera; the control mode is as follows: the transmitted data is a control command sent to the camera by the upper computer and is transmitted to the camera by the upper computer; the heartbeat packet mode is: the transmitted data is a heartbeat packet sent to the camera by the upper computer, meanwhile, the camera replies a response packet after receiving the heartbeat packet, the transmission direction is that the heartbeat packet is transmitted to the camera by the upper computer firstly, and then the response packet is transmitted to the upper computer by the camera.
The flow diagram of the structure of the BDR Vision protocol inside an industrial camera is shown in figure 1. In fig. 1, the BDRVision protocol module includes a heartbeat packet module, a control module and a transmission module, wherein the transmission module is responsible for implementing a transmission mode, that is, packing image data into packets to obtain image data packets, and then transmitting the image data packets to an upper computer through an ethernet MAC; the control module is responsible for realizing a control mode, namely receiving and analyzing a control command packet sent by the upper computer, and then transmitting the control command carried in the control command packet to an MCU (microprogrammed control Unit) kernel of the camera for processing; the heartbeat package module is responsible for realizing a heartbeat package mode, namely receiving a heartbeat package sent by the upper computer firstly and then replying a response package to the upper computer. The data cache is a memory space for caching image data inside the camera; the MCU kernel is a central processing unit inside the camera; MAC is a MAC control layer responsible for ethernet transport protocols. The camera and the upper computer can be connected through an RJ45 interface and a network cable, and the BDR Vision protocol can be realized based on a gigabit Ethernet.
Fig. 2 shows a flowchart of the information transmission method provided by the present embodiment. The process of sending image data packets to the upper computer by the camera is described in fig. 2. The information transmission method comprises the following steps:
step 110: the camera generates an image data packet according to the image data of the target image to be transmitted and a predefined packet structure, and sends the image data packet to the upper computer.
At the camera end, a transmission module in the BDR Vision protocol is responsible for packaging image data in the camera according to data structure definition specified by the protocol, and then transmitting the image data package to the upper computer. The image data packet comprises a packet header and a data segment, the packet header carries preset information of the image data packet, and the data segment carries image data of a target image, wherein the length of the data segment is determined by the width of the target image.
In a specific embodiment, the information carried by the packet header in the image data packet includes: image data packet flag, packet type, packet size, number of packets of one frame, frame ID sequence number, packet ID sequence number in one frame, image width information, image height information, image format information, and protocol version information. In some embodiments, the information carried by the packet header may include, but is not limited to, the above information, for example, some other functions may be added to the packet header according to the actual service scenario; in other embodiments, the information carried in the packet header may include only the information listed above.
It should be noted that one image is composed of image data of one line and one line, and in this embodiment, each image data packet only carries one line of image data in the image. The length of the data section can be determined by the width of the image to be transmitted, for example, in pixels, and if the width of one image is 1024, the data size of the transmitted data section is 1024 bytes. Compared with the prior art, on one hand, the transmission mode can fully utilize the processing time interval between lines and optimize the transmission efficiency without waiting for the image data of the next line, and on the other hand, the transmission mode can greatly utilize the transmission bandwidth because extra invalid bytes are not required to be transmitted.
One specific definition of the structure of the image data packet can be found in the following table one. As can be seen from table one, only 24 bytes of information are defined in the packet header, and the rest are all image data, so the structure of the whole image data packet is very simple, and compared with the prior art, a single transmission of the image data packet with the same size can carry more image data.
Figure BDA0002412354830000071
Figure BDA0002412354830000081
Watch 1
Step 120: and the upper computer receives the image data packet, analyzes the image data packet and obtains a target image according to the image data packet.
One image data packet sent by the camera carries one line of image data of a target image, the upper computer receives a plurality of image data packets corresponding to the target image, analyzes each image data packet respectively, and obtains a complete target image according to a plurality of lines of image data in the plurality of image data packets.
Further, fig. 3 shows another flowchart of the information transmission method provided in this embodiment. In fig. 3, a process in which the host computer sends a control command packet to the camera is described. The information transmission method further comprises the following steps:
step 210: and the upper computer generates a control command packet according to a predefined packet structure and sends the control command packet to the camera.
At the upper computer end, firstly, the control command packet is packaged according to a specified control command packet structure, and then the control command packet is transmitted to the camera direction. The control command packet comprises a packet header and a command segment, wherein the packet header carries preset information of the control command packet, and the command segment carries information of one or more control commands. The upper computer can complete the control of the shooting parameters (such as exposure, brightness, aperture and the like) and other functions of the camera by sending a control command packet to the camera, and the other functions can be, for example, a plurality of image algorithms related to image processing are arranged in the camera, and the upper computer instructs the camera to perform operation of one or more algorithms or close operation of one or more algorithms through the control command.
In a specific embodiment, the information carried in the header of the control command packet includes: control command packet flag, packet type, and number of control commands. One specific definition of the control command packet structure can be found in the following table two:
Figure BDA0002412354830000091
watch two
It should be noted that the information carried by the header may include, but is not limited to, the above listed information, for example, after the protocol version is upgraded, some new functions may be added as appropriate. In a corresponding embodiment, as shown in table two, the packet structure may define a length of 24 bytes in the packet header, where the first 4 bytes carry the control command packet flag, the packet type and the number of control commands, and the bytes 5 to 24 serve as spare locations, so that after the BDR Vision protocol is upgraded from the 1.0 version to the 2.0 version, without making a large change, some new information is added at the locations of the originally reserved bytes 5 to 24, thereby very simply implementing the upgrade of the protocol version. In addition, in other embodiments, the information carried in the header may include only the above listed information, i.e., no spare bytes and other information are included, that is, the header has only 4 bytes in total, so that the structure of the entire control command packet becomes simpler.
The command segment carries information of one or more control commands, the information of each control command comprises a control command, an address and command data, each control command comprises 4 bytes, namely the information of one control command comprises 8 bytes, the length of the command segment is determined by the number of the control commands initiated by the upper computer, and if the number of the control commands is 10, the data size of the command segment in the control command packet is 8 bytes by 10 bytes.
Step 220: the camera receives the control command packet sent by the upper computer, analyzes the control command packet and executes all the control commands in the control command packet.
At the camera end, a control module in the BDR Vision protocol is responsible for analyzing control command packets sent by an upper computer, and the control command packets are all defined according to a structure specified by the protocol, so the control module analyzes according to the structure specified by the protocol to obtain one or more control commands in the control command packets, then determines specific operations to be executed according to the address of each control command, and finally executes all the control commands in the control command packets.
Further, fig. 4 shows another flowchart of the information transmission method provided in this embodiment. Fig. 4 illustrates a working process of the heartbeat packet mode, and referring to fig. 4, the information transmission method further includes the following steps:
step 310: the upper computer judges whether a heartbeat packet needs to be sent to the camera at present; and if necessary, generating a heartbeat packet, sending the heartbeat packet to the camera in preference to the control command packet, and waiting for a response packet responded by the camera.
The upper computer needs to send a heartbeat packet at a preset time interval, for example, 2 seconds. The upper computer judges whether a heartbeat packet needs to be sent to the camera at present, if so, a heartbeat sub-mode in the heartbeat packet mode is entered, the heartbeat packet is prepared, and then, one heartbeat packet is sent out. In a specific embodiment, the information carried by the heartbeat packet includes: a heartbeat packet mark, a packet type and an IP address of an upper computer. One specific definition of the heartbeat packet structure can be found in table three below:
Figure BDA0002412354830000111
watch III
The BDR Vision protocol defines that the whole heartbeat packet has 48 bytes in total, wherein the first 6 bytes carry a heartbeat packet mark, a packet type and an IP address of an upper computer respectively, and the bytes 7-48 are used as standby positions so as to modify the heartbeat packet structure in the future. It should be noted that, in some embodiments, the information carried in the heartbeat packet may only include a heartbeat packet flag, a packet type, and an IP address of an upper computer, that is, there are only 6 bytes in total, that is, the heartbeat packet can be implemented only by the size of 6 bytes, which is very simple; in other embodiments, more information than table three may be carried in the heartbeat packet.
Step 320: the camera judges whether a heartbeat packet sent by an upper computer needs to be responded currently; and if necessary, generating a response packet responding to the heartbeat packet, and sending the response packet to the upper computer in priority to the image data packet.
At the camera end, a heartbeat packet module in the BDR Vision protocol is responsible for receiving a heartbeat packet sent by the upper computer and then replying a response packet to the upper computer. After receiving the heartbeat packet sent by the upper computer, the camera needs to reply a response packet to the upper computer in time. The camera judges whether the heartbeat package of the upper computer needs to be responded currently, if so, the camera enters a response sub-mode of the heartbeat package mode, prepares a response package and transmits the response package. The information carried by the response packet includes: a reply packet flag, a packet type, an IP address of the camera, a MAC address of the camera, firmware version information of the camera, and software version information of the camera. One specific definition of the structure of the response packet can be found in table four below:
Figure BDA0002412354830000112
Figure BDA0002412354830000121
watch four
The BDR Vision protocol defines that the whole response packet has 48 bytes, wherein the first 20 bytes carry a response packet mark, a packet type, a camera IP address, a camera MAC address, a camera firmware version number and a camera software version number respectively, and the bytes 21-48 can be used as standby positions so as to modify the structure of the response packet later. It should be noted that, in some embodiments, the information carried in the response packet may include only information in the first 20 bytes, that is, the response packet has only 20 bytes in total, which is quite simple; in yet other embodiments, the response packet may also carry more information than table four.
The effectiveness of connection is ensured between the camera and the upper computer through the heartbeat mechanism, and the stability of communication is ensured.
Next, starting from the overall protocol framework, the workflow of the entire BDR Vision protocol is described as follows:
step one, a BDR Vision protocol waits to run;
secondly, configuring a relevant working register;
before the BDR Vision protocol module works, an internal working register needs to be configured firstly, so that the protocol module can work normally. For example, the protocol modules are informed by configuration information how to operate, when to operate, etc. Therefore, before the camera communicates with the upper computer, the following operations are further included at the camera end: and configuring work information of the camera in a work register of the camera, wherein the configured work information comprises the MAC address of the camera, the IP address of the upper computer and the packet sending interval time. In one embodiment, the configuration information of these working registers may be referred to as the following table five:
Figure BDA0002412354830000131
watch five
The offset address refers to the offset address of the BDR Vision protocol module in the camera.
And step three, entering an uplink state and a downlink state simultaneously.
The uplink state is that the camera end uploads data to the upper computer end; the downlink state is that data is downloaded from the upper computer end to the camera end.
The working flow of the uplink state is shown in fig. 5, and it includes the response sub-mode in the transmission mode and the heartbeat packet mode. In the process of information transmission, all data packets are transmitted through network cables, and a plurality of data packets may contend for the same communication channel, so that the priority of the mode is set as follows: the priority of the heartbeat packet mode is higher than that of the transmission mode, namely, the response packet in the heartbeat packet mode is uploaded preferentially. The reason for this is that the transmission of the image information can be waited, and if the heartbeat packet of the upper computer is not responded in time, the upper computer probably considers that the camera is lost or has an error, so the heartbeat packet and the response packet have the highest priority.
As shown in fig. 5, the workflow of the uplink state includes the following steps:
step 410: judging whether a heartbeat packet needs to be responded currently; if so, go to step 420, if not, go to step 440.
Step 420: enter the response sub-mode in the heartbeat packet mode, prepare a response packet, and then jump to step 430.
Step 430: an acknowledgement packet is transmitted.
Step 440: entering a transmission mode, judging whether the data cache has a line of image data, if so, jumping to step 450, and if not, jumping to step 410.
In the transfer mode, transfer is performed according to the amount of image data for one line of an image, i.e., image data for one line at a time.
Step 450: and forming an image data packet by a line of image data according to a specified packet structure, and transmitting the image data packet.
The working flow of the downlink state is shown in fig. 6, and it includes a heartbeat sub-mode of the control mode and the heartbeat packet mode. The heartbeat sub-mode is operated once every preset time interval (such as every 2 seconds), namely, a heartbeat packet is issued every 2 seconds. Likewise, the priority of the mode is set: the priority of the heartbeat packet mode is higher than that of the control mode, and the reason for setting the priority is the same as that of the uplink state.
As shown in fig. 6, the work flow of the downlink state includes the following steps:
step 510: judging whether a heartbeat packet needs to be sent currently; if so, go to step 520, if not, go to step 540.
Step 520: enter the heartbeat sub-mode of the heartbeat packet mode, prepare the heartbeat packet, and then jump to step 530.
Step 530: a heartbeat packet is transmitted down.
Step 540: entering a control mode, determining whether a control command needs to be sent to the camera, and if so, jumping to step 550.
Step 550: preparing a control command packet and transmitting the control command packet.
In summary, the embodiments of the present application provide a simple and easy-to-use image transmission protocol, that is, the BDRVision protocol and the information transmission method based on the BDR Vision protocol, the protocol greatly simplifies the information transmission process, and the protocol has a simple working mode, and includes only a transmission mode, a control mode, and a heartbeat packet mode, and it can automatically change the size of the transmission packet according to the image size, and optimize the transmission efficiency. Furthermore, the total number of the related working registers required to be configured by the protocol is less than 10, the protocol is very simple to use, and common industrial camera developers can easily master the protocol, so that the development cost and the development time of domestic industrial camera developers can be saved. In addition, the data packet structure of the BDR Vision protocol is simple, the packet header occupies a small number of bytes, and the rest bytes are all data, so that the transmission bandwidth is greatly utilized, and the transmission efficiency is improved.
Based on the same inventive concept, an embodiment of the present application further provides an information transmission apparatus configured in an image capturing device, please refer to fig. 7, where the apparatus includes:
an image data packet generating module 610, configured to generate an image data packet according to data of a target image to be transmitted, where the image data packet includes a first packet header and a data segment, the first packet header carries preset information of the image data packet, the data segment carries image data of the target image, and a length of the data segment is determined by a width of the target image;
and the image data packet sending module 620 is used for sending the image data packet to an upper computer.
Optionally, the apparatus further comprises:
a control command packet receiving module, configured to receive a control command packet sent by an upper computer, where the control command packet includes a second packet header and a command segment, the second packet header carries preset information of the control command packet, and the command segment carries information of one or more control commands;
and the control command packet analysis module is used for analyzing the control command packet and executing all the control commands in the control command packet.
Optionally, the apparatus further comprises:
the heartbeat packet response judging module is used for judging whether the heartbeat packet sent by the upper computer needs to be responded currently;
and the response packet generation module is used for generating a response packet responding to the heartbeat packet when the heartbeat packet sent by the upper computer needs to be responded, and sending the response packet to the upper computer in priority to the image data packet.
Optionally, the apparatus further comprises: the configuration module is used for configuring the working information of the image acquisition equipment in a working register of the image acquisition equipment, wherein the working information comprises the MAC address of the image acquisition equipment, the IP address of an upper computer and the packet sending interval time.
An embodiment of the present application further provides an information transmission device, configured on an upper computer, please refer to fig. 8, where the information transmission device includes:
an image data packet receiving module 710, configured to receive an image data packet sent by an image acquisition device, where the image data packet includes a first packet header and a data segment, the first packet header carries preset information of the image data packet, the data segment carries image data of a transmitted target image, and a length of the data segment is determined by a width of the target image;
and the image data packet analyzing module 720 is configured to analyze the image data packet and obtain a target image according to the image data packet.
Optionally, the apparatus further comprises:
a control command packet generating module, configured to generate a control command packet, where the control command packet includes a second packet header and a command segment, the second packet header carries preset information of the control command packet, and the command segment carries information of one or more control commands;
and the control command packet sending module is used for sending the control command packet to the image acquisition equipment.
Optionally, the apparatus further comprises:
the heartbeat packet issuing judgment module is used for judging whether the heartbeat packet needs to be issued to the image acquisition equipment at present;
and the heartbeat packet generating module is used for generating a heartbeat packet when the heartbeat packet needs to be issued to the image acquisition equipment, sending the heartbeat packet to the image acquisition equipment in preference to the control command packet, and waiting for a response packet responded by the image acquisition equipment.
The basic principle and the technical effects of the information transmission apparatus provided above are the same as those of the previous method embodiment, and for the sake of brief description, corresponding contents in the method embodiment may be referred to where not mentioned in this embodiment, and are not described herein again.
An embodiment of the present application further provides a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the computer program executes an information transmission method executed by the image acquisition device in the foregoing method embodiment or an information transmission method executed by an upper computer.
An embodiment of the present application further provides an electronic device, including: a processor, a memory and a bus, wherein the memory stores machine-readable instructions executable by the processor, the processor and the memory communicate with each other through the bus when the electronic device runs, and the machine-readable instructions are executed by the processor to execute the information transmission method in the method embodiment.
The electronic device may be an image capturing device, such as an industrial camera, and when the electronic device is running, the machine readable instructions are executed to perform the information transmission method performed by the image capturing device in the aforementioned method embodiments. The electronic device may also be a host computer, and when the electronic device runs, the machine readable instructions are executed to execute the information transmission method executed by the host computer in the foregoing method embodiment.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other ways. The above-described embodiments of the apparatus are merely illustrative, and for example, the division of the units is only one logical division, and there may be other divisions when actually implemented, and for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection of devices or units through some communication interfaces, and may be in an electrical, mechanical or other form.
In addition, units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
Furthermore, the functional modules in the embodiments of the present application may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part.
It should be noted that the functions, if implemented in the form of software functional modules and sold or used as independent products, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present application or portions thereof that substantially contribute to the prior art may be embodied in the form of a software product stored in a storage medium and including instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present application. And the aforementioned storage medium includes: various media capable of storing program codes, such as a usb disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.
In this document, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions.
The above description is only an example of the present application and is not intended to limit the scope of the present application, and various modifications and changes may be made by those skilled in the art. Any modification, equivalent replacement, improvement and the like made within the spirit and principle of the present application shall be included in the protection scope of the present application.

Claims (10)

1. An information transmission method is applied to an image acquisition device, and comprises the following steps:
generating an image data packet according to data of a target image to be transmitted, wherein the image data packet comprises a first packet header and a data segment, the first packet header carries preset information of the image data packet, the data segment carries image data of the target image, and the length of the data segment is determined by the width of the target image;
and sending the image data packet to an upper computer.
2. The method of claim 1, further comprising:
receiving a control command packet sent by an upper computer, wherein the control command packet comprises a second packet header and a command segment, the second packet header carries preset information of the control command packet, and the command segment carries information of one or more control commands;
and analyzing the control command packet and executing all control commands in the control command packet.
3. The method of claim 2, further comprising:
judging whether a heartbeat packet sent by an upper computer needs to be responded currently;
if yes, generating a response packet responding to the heartbeat packet, and sending the response packet to the upper computer in preference to the image data packet.
4. The method of claim 1, wherein prior to generating an image data package from data of a target image to be transmitted, the method further comprises:
and configuring working information of the image acquisition equipment in a working register of the image acquisition equipment, wherein the working information comprises an MAC address of the image acquisition equipment, an IP address of an upper computer and packet sending interval time.
5. An information transmission method is applied to an upper computer, and the method comprises the following steps:
receiving an image data packet sent by image acquisition equipment, wherein the image data packet comprises a first packet head and a data segment, the first packet head carries preset information of the image data packet, the data segment carries image data of a transmitted target image, and the length of the data segment is determined by the width of the target image;
and analyzing the image data packet, and obtaining a target image according to the image data packet.
6. The method of claim 5, further comprising:
generating a control command packet, wherein the control command packet comprises a second packet header and a command segment, the second packet header carries preset information of the control command packet, and the command segment carries information of one or more control commands;
and sending the control command packet to image acquisition equipment.
7. The method of claim 6, further comprising:
judging whether a heartbeat packet needs to be issued to the image acquisition equipment at present;
if yes, generating a heartbeat packet, giving priority to the heartbeat packet over the control command packet, sending the heartbeat packet to the image acquisition equipment, and waiting for a response packet responded by the image acquisition equipment.
8. The method according to claim 3 or 7, wherein the information carried in the first packet header comprises: an image data packet flag, a packet type, a packet size, the number of packets of one frame, a frame ID serial number, a packet ID serial number in one frame, image width information, image height information, image format information, and protocol version information; and/or the presence of a gas in the gas,
the information carried in the second packet header includes: control command packet flag, packet type and number of control commands; and/or the presence of a gas in the gas,
the information carried by the heartbeat packet includes: a heartbeat packet mark, a packet type and an IP address of an upper computer; the information carried by the response packet includes: the method comprises the steps of responding to a packet mark, a packet type, an IP address of image acquisition equipment, an MAC address of the image acquisition equipment, firmware version information of the image acquisition equipment and software version information of the image acquisition equipment.
9. An information transmission apparatus, provided in an image capturing device, the apparatus comprising:
the image data packet generating module is used for generating an image data packet according to data of a target image to be transmitted, wherein the image data packet comprises a first packet head and a data section, the first packet head carries preset information of the image data packet, the data section carries image data of the target image, and the length of the data section is determined by the width of the target image;
and the image data packet sending module is used for sending the image data packet to an upper computer.
10. An information transmission device, characterized in that, configured in an upper computer, the device comprises:
the image data packet receiving module is used for receiving an image data packet sent by image acquisition equipment, wherein the image data packet comprises a first packet head and a data segment, the first packet head carries preset information of the image data packet, the data segment carries image data of a transmitted target image, and the length of the data segment is determined by the width of the target image;
and the image data packet analyzing module is used for analyzing the image data packet and obtaining a target image according to the image data packet.
CN202010184321.7A 2020-03-16 2020-03-16 Information transmission method and device Pending CN111371964A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010184321.7A CN111371964A (en) 2020-03-16 2020-03-16 Information transmission method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010184321.7A CN111371964A (en) 2020-03-16 2020-03-16 Information transmission method and device

Publications (1)

Publication Number Publication Date
CN111371964A true CN111371964A (en) 2020-07-03

Family

ID=71206823

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010184321.7A Pending CN111371964A (en) 2020-03-16 2020-03-16 Information transmission method and device

Country Status (1)

Country Link
CN (1) CN111371964A (en)

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH06253056A (en) * 1993-02-26 1994-09-09 Funai Techno Syst Kk Terminal equipment
CN101272497A (en) * 2008-05-07 2008-09-24 北京数码视讯科技股份有限公司 Video encoding method
CN103210640A (en) * 2010-09-15 2013-07-17 英特尔公司 Reformatting data to decrease bandwidth between a video encoder and a buffer
CN103248884A (en) * 2012-02-14 2013-08-14 华为技术有限公司 System, base station and method for controlling video rate
CN108833932A (en) * 2018-07-19 2018-11-16 湖南君瀚信息技术有限公司 A kind of method and system for realizing the ultralow delay encoding and decoding of HD video and transmission
CN110012363A (en) * 2019-04-18 2019-07-12 浙江工业大学 A kind of video chat system based on Session Initiation Protocol
CN110119263A (en) * 2019-05-09 2019-08-13 深圳吉迪思电子科技有限公司 The method and device of image is shown in a kind of display array
CN110545161A (en) * 2019-08-13 2019-12-06 河北远东通信系统工程有限公司 multimedia data real-time transmission method with redundancy
CN110875911A (en) * 2018-09-03 2020-03-10 厦门奇力微电子有限公司 Communication protocol and communication method for supporting automatic identification of single data packet data bit number

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH06253056A (en) * 1993-02-26 1994-09-09 Funai Techno Syst Kk Terminal equipment
CN101272497A (en) * 2008-05-07 2008-09-24 北京数码视讯科技股份有限公司 Video encoding method
CN103210640A (en) * 2010-09-15 2013-07-17 英特尔公司 Reformatting data to decrease bandwidth between a video encoder and a buffer
CN103248884A (en) * 2012-02-14 2013-08-14 华为技术有限公司 System, base station and method for controlling video rate
CN108833932A (en) * 2018-07-19 2018-11-16 湖南君瀚信息技术有限公司 A kind of method and system for realizing the ultralow delay encoding and decoding of HD video and transmission
CN110875911A (en) * 2018-09-03 2020-03-10 厦门奇力微电子有限公司 Communication protocol and communication method for supporting automatic identification of single data packet data bit number
CN110012363A (en) * 2019-04-18 2019-07-12 浙江工业大学 A kind of video chat system based on Session Initiation Protocol
CN110119263A (en) * 2019-05-09 2019-08-13 深圳吉迪思电子科技有限公司 The method and device of image is shown in a kind of display array
CN110545161A (en) * 2019-08-13 2019-12-06 河北远东通信系统工程有限公司 multimedia data real-time transmission method with redundancy

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
SYVGE: ""使用socket传输图像"", 《HTTPS:https://BLOG.CSDN.NET/WEIXIN_38907330/ARTICLE/DETAILS/81510746》 *
彭秀莲: "基于行结构的图像编码", 《中国优秀博硕士学位论文全文数据库(博士)》 *

Similar Documents

Publication Publication Date Title
US9594536B2 (en) Method and apparatus for electronic device communication
US6954806B2 (en) Data transfer apparatus and method
CN112039722B (en) MQTT protocol simulation method and simulation equipment
CN113628304B (en) Image processing method, image processing device, electronic equipment and storage medium
US7502134B2 (en) Network system and network interface card
EP2755363A1 (en) Data-fast-distribution method and device
CN105190530A (en) Transmitting hardware-rendered graphical data
US6584103B1 (en) Packet communication apparatus provided with manager means for managing packet labels
CN112698942B (en) Artificial intelligence service system, master control device and slave control device
JP6665190B2 (en) Network sharing implementation method and apparatus
CN112291523A (en) Image data receiving system and method of chip mounter
CN109417507A (en) The message of section retards accesses
CN111371964A (en) Information transmission method and device
US7716683B2 (en) Distributed graphics processing apparatus and method
CN100493018C (en) Communication method via bus interface of network and and system thereof
KR20200143881A (en) Controller commnication device and method thereof
JP5729938B2 (en) COMMUNICATION DEVICE AND ITS CONTROL METHOD
CN117294400A (en) Data transmission method and device and electronic equipment
JP2007125851A (en) Printing control device, imaging method and storage medium
CN115550606A (en) Image acquisition system and method based on network protocol
KR20080051046A (en) Hardware device and method for sending the network protocol packet
CN101410788A (en) Method and system for printing full images using device
CN101140507A (en) Data readback method and apparatus
US12124709B2 (en) Computing system and associated method
US20100095339A1 (en) Method and apparatus for designing a communication mechanism between embedded cable modem and embedded set-top box

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20200703