CN112148529A - Data transmission method and device, camera, computing equipment and storage medium - Google Patents

Data transmission method and device, camera, computing equipment and storage medium Download PDF

Info

Publication number
CN112148529A
CN112148529A CN202011016974.0A CN202011016974A CN112148529A CN 112148529 A CN112148529 A CN 112148529A CN 202011016974 A CN202011016974 A CN 202011016974A CN 112148529 A CN112148529 A CN 112148529A
Authority
CN
China
Prior art keywords
image
camera
transmission
endpoint
usb
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.)
Granted
Application number
CN202011016974.0A
Other languages
Chinese (zh)
Other versions
CN112148529B (en
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.)
Hangzhou Hikrobot Technology Co Ltd
Original Assignee
Hangzhou Hikrobot Technology 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 Hangzhou Hikrobot Technology Co Ltd filed Critical Hangzhou Hikrobot Technology Co Ltd
Priority to CN202011016974.0A priority Critical patent/CN112148529B/en
Publication of CN112148529A publication Critical patent/CN112148529A/en
Application granted granted Critical
Publication of CN112148529B publication Critical patent/CN112148529B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/07Responding to the occurrence of a fault, e.g. fault tolerance
    • G06F11/14Error detection or correction of the data by redundancy in operation
    • G06F11/1402Saving, restoring, recovering or retrying
    • G06F11/1415Saving, restoring, recovering or retrying at system level
    • G06F11/1443Transmit or communication errors
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/38Information transfer, e.g. on bus
    • G06F13/42Bus transfer protocol, e.g. handshake; Synchronisation
    • G06F13/4282Bus transfer protocol, e.g. handshake; Synchronisation on a serial bus, e.g. I2C bus, SPI bus
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N5/00Details of television systems
    • H04N5/76Television signal recording
    • H04N5/765Interface circuits between an apparatus for recording and another apparatus
    • H04N5/77Interface circuits between an apparatus for recording and another apparatus between a recording apparatus and a television camera
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2213/00Indexing scheme relating to interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F2213/0042Universal serial bus [USB]

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Quality & Reliability (AREA)
  • Studio Devices (AREA)

Abstract

The application provides a data transmission method, a data transmission device, a camera, a computing device and a storage medium. The data transmission method of the camera comprises the following steps: determining whether the number of abnormal events within a first predetermined length of time reaches a first time threshold; when the number of times of the abnormal events in the first preset time reaches a first time threshold value, reducing the transmission bandwidth of a USB module of the camera; after the transmission bandwidth of the USB module of the camera is reduced, judging whether the duration time of the abnormal event does not reach a second preset time length; and when the duration time of the non-abnormal event reaches a second preset duration, restoring the transmission bandwidth of the USB module to the original transmission bandwidth.

Description

Data transmission method and device, camera, computing equipment and storage medium
Technical Field
The present application relates to the field of communications technologies, and in particular, to a data transmission method and apparatus, a camera, a computing device, and a storage medium.
Background
In some application scenarios, the camera may transmit images to the upper computer in a USB manner. During the image transmission, the USB link of the camera may be subject to high voltage electrostatic interference. High voltage electrostatic interference can cause confusion in the data transmitted by the camera. The large amount of disordered data can cause abnormal working of the camera and the upper computer. In particular, the camera may have problems such as flow stoppage and jamming.
Therefore, how to improve the anti-interference capability of the camera to high-voltage static electricity is a technical problem to be solved.
Disclosure of Invention
The application provides a data transmission method, a data transmission device, a camera, computing equipment and a storage medium, and the anti-interference capability to high-voltage static electricity can be improved.
According to an aspect of the present application, there is provided a data transmission method of a camera, including:
determining whether the number of abnormal events within a first predetermined length of time reaches a first time threshold;
when the number of times of the abnormal events in the first preset time reaches a first time threshold value, reducing the transmission bandwidth of a USB module of the camera;
after the transmission bandwidth of the USB module of the camera is reduced, judging whether the duration time of the abnormal event does not reach a second preset time length;
and when the duration time of the non-abnormal event reaches a second preset duration, restoring the transmission bandwidth of the USB module to the original transmission bandwidth.
In some embodiments, the reducing the transmission bandwidth of the USB module includes:
determining a reduced transmission bandwidth of the USB module;
determining the image transmission frame rate of the USB module according to the reduced transmission bandwidth;
the restoring the transmission bandwidth of the USB module to the original transmission bandwidth includes:
and determining the image transmission frame rate of the USB module according to the original transmission bandwidth.
In some embodiments, the above method further comprises:
when an image transmission endpoint of the USB module outputs an image to the computing equipment, detecting whether the USB module has image transmission abnormality or not;
when the image transmission abnormality is detected, suspending the image output of the image transmission endpoint;
detecting whether a reset instruction of the computing device to the image transmission endpoint is received;
resetting an image transmission endpoint in response to receiving the reset instruction;
detecting whether an image transmission instruction is received from the computing device;
and when receiving the image transmission instruction, outputting the image by the reset image transmission endpoint.
In some embodiments, the detecting whether an image transmission abnormality occurs includes: detecting whether a USB abnormal event occurs or not, and determining that image transmission abnormality occurs when the USB abnormal event is detected, wherein the USB abnormal event comprises the following steps: the event of restarting the endpoint and the event of actively stopping the batch transmission of the computing equipment; or detecting whether the frequency of the USB abnormal events occurring in the third preset time reaches a second frequency threshold value, and determining that the image transmission is abnormal when the frequency of the USB abnormal events occurring in the third preset time reaches the second frequency threshold value.
In some embodiments, when an image transmission abnormality is detected, the data transmission method further includes: sending a first notification message indicating that an image transmission abnormality occurs to the computing device;
indicating the image sensor to stop flowing out, and resetting the flowing out state of the image sensor;
sending a second notification message to the computing device indicating that the image transfer endpoint is in a paused state.
In some embodiments, the data transmission method further includes: and in response to receiving the reset instruction, emptying a buffer area. The buffer area is used for storing images for the image transmission endpoint to transmit.
According to an aspect of the present application, a data transmission method of a computing device is provided, including:
monitoring whether data abnormality occurs in an image from a camera when the image output by the camera is received;
when data abnormality is monitored, acquiring the state of an image transmission endpoint of a USB module of the camera;
when the state of the image transmission endpoint indicates that the image transmission endpoint is in a pause state, sending a reset instruction indicating that the image transmission endpoint is reset to the camera so that the camera resets the image transmission endpoint;
and sending an image transmission instruction to the camera so as to receive the image output by the camera.
According to an aspect of the present application, there is provided a data transmission device of a camera, comprising:
a detection unit counting the number of abnormal events of the camera, the abnormal events including: USB exception events and USB link recovery events;
the control unit is used for determining whether the number of times of the abnormal events reaches a first time threshold value within a first preset time length; when the number of times of the abnormal events in the first preset time reaches a first time threshold value, reducing the transmission bandwidth of a USB module of the camera; after the transmission bandwidth of the USB module of the camera is reduced, judging whether the duration time of the abnormal event does not reach a second preset time length; and when the duration time of the non-abnormal event reaches a second preset duration, restoring the transmission bandwidth of the USB module to the original transmission bandwidth.
According to an aspect of the present application, there is provided a data transmission apparatus of a computing device, including:
the monitoring unit is used for monitoring whether data abnormality occurs in the image from the camera when the computing equipment receives the image output by the camera;
the control unit is used for acquiring the state of an image transmission endpoint of the USB module of the camera when the data abnormality is monitored;
when the state of the image transmission endpoint indicates that the image transmission endpoint is in a pause state, the control unit sends a reset instruction for resetting the image transmission endpoint to the camera so that the camera can reset the image transmission endpoint of the USB module;
the control unit is further configured to send an image transmission instruction to the camera for the computing device to resume receiving images output by the camera.
According to one aspect of the present application, there is provided a camera comprising:
an image sensor for acquiring image data;
an image processor for processing the image data and outputting a processed image;
a USB module;
a central processing unit;
a memory;
a program stored in the memory and configured to be executed by the central processor, the program comprising instructions for performing a data transmission method according to the present application.
According to one aspect of the present application, there is provided a computing device, comprising:
a memory;
a processor;
a program stored in the memory and configured to be executed by the processor, the program including instructions for performing a data transfer method.
According to an aspect of the present application, there is provided a storage medium storing a program comprising instructions which, when executed by a computing device, cause the computing device to perform a data transmission method according to the present application.
In conclusion, according to the data transmission scheme of the application, whether the camera has serious electrostatic interference or not can be monitored by monitoring the abnormal event of the camera. In this way, the data transmission scheme can reduce transmission bandwidth when severe electrostatic interference (i.e., the number of abnormal events within the first predetermined time period reaches the first time threshold). By reducing the transmission bandwidth, the data transmission scheme can avoid backlog of data to be transmitted, thereby avoiding the camera from being stuck. It should be noted that the camera is prone to data transmission errors when faced with electrostatic interference. If the camera does not adopt a mode of reducing transmission bandwidth in a data transmission scheme, data retransmission is caused due to data transmission errors, backlog of data to be transmitted easily occurs in the camera, and then the camera is jammed. Therefore, by reducing the transmission bandwidth, the data transmission scheme can increase the redundancy of the USB link, thereby preventing the camera from being stuck due to electrostatic interference, i.e. improving the anti-electrostatic interference capability of the camera. In other words, the data transmission scheme can enable the camera to normally transmit images by reducing the transmission bandwidth and increasing the redundancy of the USB link when severe electrostatic interference occurs. In addition, when the number of abnormal events within the first predetermined time period does not reach the first time threshold (i.e., there is no or no serious electrostatic interference), the data transmission scheme does not need to reduce the transmission bandwidth. In addition, when the image transmission of the camera is recovered to be normal (the duration of the non-abnormal event reaches a second preset time), the data transmission scheme can recover the transmission bandwidth to the original transmission bandwidth.
Drawings
FIG. 1 illustrates a schematic diagram of an application scenario in accordance with some embodiments of the present application;
FIG. 2 illustrates a flow chart of a data transmission method 200 of a camera according to some embodiments of the present application;
FIG. 3 illustrates a flow chart of a data transmission method 300 of a camera according to some embodiments of the present application;
FIG. 4 illustrates a flow chart of a data transmission method 400 of a camera according to some embodiments of the present application;
FIG. 5 illustrates a schematic diagram of a data transfer method 500 of a computing device according to some embodiments of the present application;
FIG. 6 illustrates a schematic diagram of a data transfer method 600 of a computing device according to some embodiments of the present application;
FIG. 7 shows a schematic diagram of a camera 120 according to some embodiments of the present application;
FIG. 8 illustrates a schematic diagram of a data transmission apparatus 800 according to some embodiments of the present application;
FIG. 9 illustrates a schematic diagram of a data transmission apparatus 900 according to some embodiments of the present application;
FIG. 10 illustrates a schematic diagram of a computing device according to some embodiments of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is further described in detail below by referring to the accompanying drawings and examples.
In some application scenarios, the camera may communicate with a host computer and output an image. When the camera is interfered by high-voltage static electricity and the like, the camera is easy to have abnormal data transmission and backlog of data to be transmitted, and then enters a blocking state.
FIG. 1 illustrates a schematic diagram of an application scenario in accordance with some embodiments of the present application.
As shown in fig. 1, an application scenario may include a computing device 110 and a camera 120.
The computing device 110 may communicate with the camera 120 via USB means. The camera 120 may be, for example, a civilian camera or an industrial camera. The computing device 110 may be, for example, a personal computer, a programmable logic controller, or the like. The computing device 110, acting as a host computer (which may also be referred to as a host), may receive images output by the camera 120.
Fig. 2 illustrates a flow diagram of a data transmission method 200 of a camera according to some embodiments of the present application. The method 200 may be performed by the camera 120, for example.
As shown in fig. 2, in step S201, the number of abnormal events of the camera is counted. Here, the types of the abnormal event may include, for example: USB exception events and USB link recovery events, etc. The USB exception event may include, for example: events of endpoint restart and events of computing device active stop of bulk transfer. The USB link recovery event is: and the USB module generates notification information which represents that the data link is recovered to be normal.
In step S202, it is determined whether the number of exceptional events within a first predetermined length of time reaches a first time threshold. Wherein the first predetermined time period is, for example, 5 seconds. The first count threshold is, for example, 2 times. Upon determining in step S202 that the number of exceptional events within the first predetermined length of time has not reached the first time threshold, the method 200 continues to step S201.
When it is determined in step S202 that the number of abnormal events within the first predetermined time period reaches the first time threshold, the method 200 may execute step S203 to reduce the transmission bandwidth of the USB module. For example, step S203 may determine a reduced transmission bandwidth of the USB module. The reduced transmission bandwidth is lower than the original transmission bandwidth. Here, the original transmission bandwidth refers to a default transmission bandwidth of the USB module, i.e., an upper limit of a transmission rate of the USB module to the image data. According to the reduced transmission bandwidth, step S203 may determine an image transmission frame rate of the USB module. Here, the image transmission frame rate is proportional to the transmission bandwidth.
In step S204, after the transmission bandwidth of the USB module of the camera is reduced, it is determined whether the duration of the non-abnormal event reaches a second predetermined duration. The second predetermined period of time is for example 6 seconds. Upon determining that the duration of the non-occurrence of the abnormal event does not reach the second predetermined time, the camera 120 continues to maintain the reduced transmission bandwidth.
In step S204, when it is determined that the duration of the non-occurrence of the abnormal event reaches the second predetermined duration, the method 200 may execute step S205, and restore the transmission bandwidth of the USB module to the original transmission bandwidth. The original transmission bandwidth is the normal transmission bandwidth when the camera has no image transmission abnormality. For example, step S205 determines the image transmission frame rate of the USB module according to the original transmission bandwidth.
In summary, the method 200 according to the present application can monitor whether the camera has serious electrostatic interference by monitoring the abnormal event of the camera. In this way, the method 200 is able to reduce the transmission bandwidth when severe electrostatic interference (i.e., the number of abnormal events within the first predetermined time period reaches the first time threshold). By reducing the transmission bandwidth, the method 200 can avoid backlog of data to be transmitted, thereby avoiding a camera from being jammed. It should be noted that the camera is prone to data transmission errors when faced with electrostatic interference. If the camera does not use the method of reducing the transmission bandwidth in the method 200, the camera is prone to backlog of data to be transmitted due to data retransmission caused by data transmission errors, and the camera is stuck. Therefore, by reducing the transmission bandwidth, the method 200 can increase the redundancy of the USB link, thereby preventing the camera from being jammed due to the electrostatic interference, i.e., improving the anti-electrostatic interference capability of the camera. In other words, the method 200 may enable the camera to normally transmit images by reducing the transmission bandwidth and increasing the redundancy of the USB link when severe electrostatic interference occurs. In addition, the method 200 does not need to reduce the transmission bandwidth when the number of abnormal events within the first predetermined time period does not reach the first time threshold (i.e., there is no or no serious electrostatic interference). In addition, when the image transmission of the camera is recovered to be normal (the duration of the non-occurrence of the abnormal event reaches the second predetermined time), the method 200 can recover the transmission bandwidth to the original transmission bandwidth.
In some application scenarios, after entering a stuck state, the camera cannot execute an instruction or automatically reset, and needs to be manually restarted. And the restart can cause the communication between the camera and the upper computer to be disconnected, and image transmission cannot be carried out until the computing equipment reestablishes the communication connection with the camera according to the input of the user.
Therefore, the application also provides a software anti-static interference scheme, and an automatic reset mechanism can be realized when the camera is subjected to high-voltage static interference, so that the camera is prevented from being stuck, and the anti-static interference capability of the camera is further improved. The anti-static interference scheme according to the present application is described below with reference to fig. 3.
Fig. 3 illustrates a flow chart of a data transmission method 300 of a camera according to some embodiments of the present application. The method 300 may be performed by the camera 120, for example.
As shown in fig. 3, in step S301, an image is output to a computing device by an image transmission endpoint of a USB module of a camera. The USB module may also be referred to as a USB chip. The USB module may include a plurality of endpoints, each of which may be considered a separate data transfer channel. The endpoints of the USB module include an image transmission endpoint, an instruction transmission endpoint, and the like. Image transmission endpoints may also be referred to as stream endpoints.
Additionally, during execution of step S301, the method 300 may also execute step S302. In step S302, it is detected whether an image transmission abnormality occurs in the USB module. Here, when the camera is subjected to electrostatic interference, the USB module may have an abnormal image transmission. Step S302 can determine whether the camera is subjected to electrostatic interference by detecting whether an image transmission abnormality occurs.
When no image transmission abnormality is detected in step S302, the method 300 may continue to perform step S301.
Upon detecting an image transmission abnormality at step S302, the method 300 may perform step S303 of pausing image output of the image transmission endpoint.
In step S304, it is detected whether a reset instruction of the image transmission endpoint of the USB module by the computing device is received. Here, the reset instruction may include, for example, an endpoint identification of the image transmission endpoint.
In step S305, in response to receiving the reset instruction, the image transmission endpoint is reset.
In step S306, it is detected whether an image transmission instruction from the computing apparatus is received. Upon receiving the image transmission instruction at step S306, the camera 120 may execute outputting the image by the reset image transmission endpoint, i.e., resume execution of step S301.
In summary, the method 300 according to the present application can avoid the camera from being jammed when the image transmission is abnormal by detecting whether the image transmission is abnormal and suspending the image output when the image transmission is abnormal. On this basis, the method 300 may implement automatic reset of the end point of the camera according to the reset instruction, and resume normal output images. In short, the method 300 can avoid the deadlock problem caused by the electrostatic interference by automatically controlling the pause and the reset of the image output, and further can avoid the trouble of restarting the camera caused by the deadlock state and improve the anti-electrostatic interference capability.
Additionally, the method 300 may avoid computing device data transfer confusion by resetting an image transfer endpoint of a USB module in response to a reset instruction. Specifically, the computing device acquires an image frame from the camera corresponding to the frame number as a function of the frame number. If the camera resets the image transfer endpoint before receiving a reset instruction, various situations of data transfer confusion are likely to occur.
The first case is where the computing device 110 makes an image request according to the old frame number of the image captured before the camera resets the image transfer endpoint, and the camera sends the image according to the new frame number after the image transfer endpoint is reset. The old frame number and the new frame number with the same number correspond to different image frames. As a result, frame number confusion occurs in images acquired by computing devices.
The second case is where the image frame captured by the computing device 110 is missing pixels. For example, computing device 110 has acquired a portion of the pixel points of image frame a captured by camera 120 prior to resetting the image endpoint, and is unable to acquire another portion of the pixel points of image frame a from the camera after the image transmission endpoint is reset.
The third situation is that the image frames collected by the computing device have a screen cut phenomenon. For example, computing device 110 has acquired a portion of the pixel points of image frame B captured by the camera prior to resetting the image endpoint. The frame number of image frame B is 10. After the image transfer endpoint is reset, the image frame C with frame number 10 acquired by the camera 120 is different from the image frame B. The computing device 110 continues to request the pixel of frame number 10 and obtain the pixel of image frame C. On this basis, the image frame with the frame number 10 obtained by the computing device 110 is an image frame formed by splicing partial pixel points of the image frame B and partial pixel points of the image frame C. The display image of the image frame has a screen cutting phenomenon.
In some embodiments, to detect whether an image transmission abnormality occurs, step S302 may detect whether a USB abnormal event occurs. The USB exception event may include, for example: events of endpoint restart and events of computing device active stop of bulk transfer. Here, the USB exception event is generated by the USB module of the camera. The event of restarting the endpoint is: the USB endpoint for transmitting the image waits for the notification information of the restart. The events of the computing device actively stopping the batch transmission are as follows: and when the USB module receives the instruction of stopping the batch transmission of the computing equipment, generating notification information indicating that the batch transmission is stopped. The USB module may notify the camera's application software of the USB exception event. Here, the application software is software that performs the method 300. For example, step S302 may determine that an image transmission abnormality occurs when a USB abnormal event is detected. For another example, step S302 may detect whether the number of USB abnormal events occurring within the third predetermined time period reaches the second time threshold. The third predetermined period of time is, for example, 2 seconds, and the second count threshold is, for example, 3 times. When the number of USB abnormal events occurring within the third predetermined time reaches the second time threshold, step S302 may determine that an image transmission abnormality occurs.
In some embodiments, pausing the image output of the image transmission endpoint in step S303 comprises: pausing the image transfer endpoint fetches images from the buffer and pauses sending images to the computing device. In this way, the image transfer endpoint is in a suspended state, and camera jam caused by image transfer backlog can be avoided for the camera 120.
Fig. 4 illustrates a flow diagram of a data transmission method 400 of a camera according to some embodiments of the present application. The method 400 may be performed by the camera 120, for example.
As shown in fig. 4, in step S401, an image is output to the computing device by the image transfer endpoint of the USB module of the camera.
In step S402, it is detected whether a USB exception event occurs.
When no USB exception event is detected in step S402, the method 400 may continue to perform step S401.
Upon detecting a USB exception event at step S402, the method 400 may perform steps S403, S404, and S405.
In step S403, a first notification message indicating the occurrence of an image transmission abnormality is transmitted to the computing device. In this way, the computing device 110 may determine that data abnormality occurs in the image from the camera according to the first notification message, and then immediately clear the abnormal data that has been received by the computing device 110. Here, step S403 may transmit the first notification message by instructing the transmission endpoint, for example.
In step S404, the image output of the image transmission endpoint of the USB module is suspended (stall).
In step S405, the image sensor is instructed to stop the outflow, and the outflow state of the image sensor is reset. Instructing the image sensor to stop bleeding is: instructing the image sensor to stop acquiring image frames. Resetting the outflow state of the image sensor may include, for example: clearing the image buffer data of the image sensor and resetting the mapping control flag bit.
After the image transmission endpoint is in the paused state, the method 400 may perform step S406 of sending a second notification message to the computing device indicating that the image transmission endpoint is in the paused state. As such, the computing device may send a reset instruction to the camera 120 for the image transfer endpoint in response to the second notification message. In step S407, it is detected whether a reset instruction of the image transmission endpoint of the USB module by the computing device is received.
Upon detecting a reset instruction at step S407, the method 400 may perform step S408, reset the image transfer endpoint of the USB module, and empty the buffer. The buffer area is used for storing images for the image transmission endpoint to transmit.
In step S409, it is detected whether an image transmission instruction from the computing apparatus is received. Upon detecting the image transfer instruction at step S409, the method 400 may execute outputting the image by the image transfer endpoint of the reset USB module, i.e., resume execution of step S401.
In summary, according to the data transmission method 400 of the present application, by sending the first notification message to the computing device, the computing device can determine that the data is abnormal, and immediately clear the abnormal data. In addition, the data transfer method 400 sends a reset instruction after the computing device determines that the image transfer endpoint is in the suspended state by sending a second notification message to the computing device. On the basis, the data transmission method 400 can enable the computing device to send an image transmission instruction for the image newly acquired by the camera after the image transmission endpoint is reset and enable the camera to return the newly acquired image, so that the data transmission confusion of the computing device is avoided.
Fig. 5 illustrates a schematic diagram of a data transfer method 500 of a computing device according to some embodiments of the present application. The method 500 may be performed, for example, by the computing device 110.
As shown in fig. 5, in step S501, an image output by a camera is received.
In step S502, whether data abnormality occurs in an image from a camera is monitored. For example, when the image from the camera is monitored to have a large amount of messy codes in step S502, it is determined that data abnormality occurs. For another example, the computing device 110 may determine that a data anomaly has occurred in response to receiving a first notification message indicating that an image transmission anomaly has occurred.
When the data abnormality is detected in step S502, the method 500 may execute step S503 to acquire the state of the image transmission endpoint of the USB module of the camera. For example, the computing device 110 may receive a second notification message indicating that the image transmission endpoint is in a paused state.
When the endpoint status acquired at step S503 indicates that the image transmission endpoint of the USB module is in the suspend state, the method 500 may perform step S504, and send a reset instruction to the camera to reset the image transmission endpoint of the USB module, so that the camera resets the image transmission endpoint of the USB module.
In step S505, an image transmission instruction is sent to the camera so as to receive an image output by the camera. Here, after the reset instruction is sent, the image transfer endpoint of the camera is reset. Therefore, step S505 may send an image transfer instruction for an image newly captured by the camera after the image transfer endpoint is reset, so as to receive the newly captured image.
In summary, the method 500 according to the embodiment of the present application can monitor whether data transmission with the camera is abnormal, detect the state of the image transmission endpoint of the USB module of the camera, and instruct the camera to perform endpoint reset when the endpoint is in the suspend state. Therefore, the method 500 can automatically detect the transmission state of the data link and cooperate with the reset operation of the camera, thereby avoiding the camera from being stuck, further avoiding the trouble of restarting the camera caused by the stuck state and improving the anti-static interference capability of the camera. Additionally, the method 500 may cause the image transfer endpoint to reset by sending a reset instruction, may be able to send an image transfer instruction for a newly captured image of the camera after the image transfer endpoint is reset, and may receive the newly captured image. In this way, the method 500 can avoid data transmission confusion.
FIG. 6 illustrates a schematic diagram of a data transfer method 600 of a computing device according to some embodiments of the present application. The method 600 may be performed, for example, by the computing device 110.
As shown in fig. 6, in step S601, an image output by the camera is received.
In step S602, whether data abnormality occurs in an image from a camera is monitored. For example, when the image from the camera is monitored to have a large amount of messy codes in step S602, it is determined that data abnormality occurs. For another example, the computing device 110 may determine that a data anomaly has occurred in response to receiving a first notification message indicating that an image transmission anomaly has occurred.
When the data anomaly is detected in step S602, the method 600 may perform steps S603 and S604.
In step S603, an image in which a data abnormality has occurred is deleted. Here, the image of the data abnormality is, for example: the computing device has received a portion, but not the entire, received image frame. In this way, the computing device 110 may instantly clear the image of the anomaly to save storage space.
In step S604, the state of the image transmission endpoint of the USB module of the camera is acquired.
When the endpoint status obtained in step S604 indicates that the image transmission endpoint of the USB module is in the suspend state, the method 600 may perform step S605, sending a reset instruction to the camera to reset the image transmission endpoint of the USB module, so that the camera resets the image transmission endpoint of the USB module.
In step S606, an image transmission instruction is sent to the camera so as to receive an image output by the camera.
In summary, the method 600 according to the embodiment of the present application can monitor whether data transmission with the camera is abnormal, detect the state of the image transmission endpoint of the USB module of the camera, and instruct the camera to perform endpoint reset when the endpoint is in the suspend state. Therefore, the method 600 can automatically detect the transmission state of the data link and cooperate with the reset operation of the camera, thereby avoiding the camera from being stuck, further avoiding the trouble of restarting the camera caused by the stuck state and improving the anti-static interference capability.
Fig. 7 shows a schematic diagram of a camera 120 according to some embodiments of the present application.
As shown in fig. 7, the camera 700 may include: image sensor 701, image processor 702, USB module 703, memory 704, central processing unit 705. The memory 703 may store, among other things, a set of instructions that are executed by the central processor 705. For example, memory 703 may include application 706. The image sensor 701 is used to acquire image data.
The image signal processor 702 is configured to process the image data to output a processed image.
The USB module 703 may include a plurality of endpoints, such as an image transfer endpoint 707 and an instruction transfer endpoint 708. Image transfer endpoint 707 may be used for image transfer. The instruction transfer endpoint 708 may be used for the transfer of instruction messages.
The application 706 may, for example, perform the methods 200, 300, and 400.
Fig. 8 illustrates a schematic diagram of a data transmission apparatus 800 according to some embodiments of the present application. The apparatus 800 may be deployed in a camera 120, for example.
As shown in fig. 8, the apparatus 800 may include: a detection unit 801 and a control unit 802.
The detection unit 801 may count the number of abnormal events of the camera. The exception events include: USB exception events and USB link recovery events.
The control unit 802 may determine whether the number of exceptional events reaches a first time threshold within a first predetermined length of time. When the number of abnormal events within the first predetermined time reaches the first time threshold, the control unit 802 may decrease the transmission bandwidth of the USB module of the camera. After reducing the transmission bandwidth of the USB module of the camera, the control unit 802 may further determine whether the duration of the non-abnormal event reaches a second predetermined duration. When the duration of the non-occurrence of the abnormal event reaches a second predetermined duration, the control unit 802 restores the transmission bandwidth of the USB module to the original transmission bandwidth.
In summary, the data transmission device 800 according to the present application can monitor whether the camera has serious electrostatic interference by monitoring the abnormal event of the camera and monitoring the abnormal event of the camera. In this way, the data transmission apparatus 800 can reduce the transmission bandwidth when the severe electrostatic interference (i.e., the number of abnormal events within the first predetermined time period reaches the first time threshold). By reducing the transmission bandwidth, the data transmission apparatus 800 can avoid backlog of data to be transmitted, thereby avoiding a situation where the camera is stuck. It should be noted that the camera is prone to data transmission errors when faced with electrostatic interference. If the camera does not use the method of reducing the transmission bandwidth in the data transmission device 800, the camera is prone to backlog the data to be transmitted due to data retransmission caused by data transmission errors, and the camera is stuck. Therefore, by reducing the transmission bandwidth, the data transmission device 800 can increase the redundancy of the USB link, thereby preventing the camera from being jammed due to electrostatic interference, i.e., improving the anti-electrostatic interference capability of the camera. In other words, when severe electrostatic interference occurs, the data transmission apparatus 800 increases the USB link redundancy by reducing the transmission bandwidth, so that the camera can normally transmit an image. In addition, when the number of abnormal events within the first predetermined time period does not reach the first time threshold (i.e., there is no or no serious electrostatic interference), the data transmission apparatus 800 does not need to reduce the transmission bandwidth. In addition, when the image transmission of the camera is restored to normal (the duration in which no abnormal event occurs reaches the second predetermined time period), the data transmission apparatus 800 can restore the transmission bandwidth to the original transmission bandwidth.
In some embodiments, the detection unit 801 may also detect whether an image transmission abnormality occurs in the USB module when an image transmission endpoint of the USB module outputs an image to the computing device.
The control unit 802 may also pause image output of the image transmission endpoint when the detection unit detects an image transmission abnormality.
In addition, the detection unit 801 is further configured to detect whether a reset instruction of the image transmission endpoint by the computing device is received.
In response to the detection unit 801 receiving the reset instruction, the control unit 802 may reset the image transmission endpoint.
The detection unit 801 is also configured to detect whether an image transmission instruction is received from the computing apparatus. When the detection unit detects an image transfer instruction, the control unit 802 outputs an image through the reset image transfer endpoint. More specific embodiments of the data transmission device 800 are similar to the methods 200, 300, and 400 and will not be described again here.
In summary, the data transmission apparatus 800 according to the present application can also detect whether an image transmission abnormality occurs, and suspend image output when the image transmission abnormality occurs, so as to avoid a situation that a camera is jammed when the image transmission abnormality occurs. On the basis, the data transmission device 800 can realize automatic reset of the camera according to the reset instruction and restart normal image output. In short, the data transmission apparatus 800 can avoid the problem of the deadlock caused by the electrostatic interference by automatically controlling the suspension and the reset of the image output, and thus can avoid the trouble of restarting the camera caused by the deadlock state and improve the anti-electrostatic interference capability.
Fig. 9 illustrates a schematic diagram of a data transmission apparatus 900 according to some embodiments of the present application. The apparatus 900 may be deployed, for example, in a computing device 110.
As shown in fig. 9, the data transmission apparatus 900 may include: a monitoring unit 901 and a control unit 902.
The monitoring unit 901 monitors whether data abnormality occurs in an image from a camera when the computing device receives the image output by the camera.
The control unit 902, when monitoring that data abnormality occurs, acquires the state of the image transmission endpoint of the camera.
When the state of the image transfer endpoint indicates that the image transfer endpoint is in the suspended state, the control unit 902 sends a reset instruction to reset the image transfer endpoint to the camera so that the camera resets the image transfer endpoint of the USB module. The control unit 902 is also used to send image transmission instructions to the camera for the computing device to receive images output by the camera. More specific embodiments of the data transmission apparatus 900 are similar to the method 500, and are not described in detail herein.
In summary, the data transmission apparatus 900 according to the embodiment of the present application can monitor whether data transmission with the camera is abnormal, detect the state of the image transmission endpoint of the USB module of the camera, and instruct the camera to perform endpoint reset when the endpoint is in the suspend state. Therefore, the data transmission device 900 can automatically detect the transmission state of the data link and cooperate with the reset work of the camera, thereby avoiding the camera from being stuck, further avoiding the trouble that the camera needs to be restarted due to the stuck state and improving the anti-static interference capability. In addition, the data transmission apparatus 900 may cause the image transmission endpoint to be reset by sending a reset instruction, and may be configured to send an image transmission instruction for an image newly captured by the camera after the image transmission endpoint is reset, and receive the newly captured image. In this way, the data transmission apparatus 900 can avoid data transmission confusion.
FIG. 10 illustrates a schematic diagram of a computing device according to some embodiments of the present application. As shown in fig. 10, the computing device includes one or more processors (CPUs) 1002, a communications module 1004, a memory 1006, a user interface 1010, and a communications bus 1008 for interconnecting these components.
The processor 1002 can receive and transmit data via the communication module 1004 to enable network communications and/or local communications.
The user interface 1010 includes one or more output devices 1012 including one or more speakers and/or one or more visual displays. The user interface 1010 also includes one or more input devices 1014. The user interface 1010 may receive, for example, but not limited to, an instruction of a remote controller.
The memory 1006 may be a high-speed random access memory, such as DRAM, SRAM, DDR RAM, or other random access solid state memory devices; or non-volatile memory, such as one or more magnetic disk storage devices, optical disk storage devices, flash memory devices, or other non-volatile solid-state storage devices.
The memory 1006 stores a set of instructions executable by the processor 1002, including:
an operating system 1016 including programs for handling various basic system services and for performing hardware related tasks;
the application 1018 includes various programs for implementing the data transmission method described above. Such a program can implement the processing flow in the above examples, and may include, for example, the data transmission method 500 or 600.
In addition, each of the embodiments of the present application can be realized by a data processing program executed by a data processing apparatus such as a computer. It is clear that the data processing program constitutes the invention. Further, the data processing program, which is generally stored in one storage medium, is executed by directly reading the program out of the storage medium or by installing or copying the program into a storage device (such as a hard disk and/or a memory) of the data processing device. Such a storage medium therefore also constitutes the present invention. The storage medium may use any type of recording means, such as a paper storage medium (e.g., paper tape, etc.), a magnetic storage medium (e.g., a flexible disk, a hard disk, a flash memory, etc.), an optical storage medium (e.g., a CD-ROM, etc.), a magneto-optical storage medium (e.g., an MO, etc.), and the like.
The present application thus also discloses a non-volatile storage medium in which a program is stored. The program comprises instructions which, when executed by a processor, cause a computing device to perform a data transmission method according to the present application.
In addition, the method steps described in this application may be implemented by hardware, for example, logic gates, switches, Application Specific Integrated Circuits (ASICs), programmable logic controllers, embedded microcontrollers, and the like, in addition to data processing programs. Such hardware capable of implementing the methods described herein may also constitute the present application.
The above description is only exemplary of the present application and should not be taken as limiting the present application, as any modification, equivalent replacement, or improvement made within the spirit and principle of the present application should be included in the scope of the present application.

Claims (12)

1. A data transmission method of a camera, comprising:
counting the number of abnormal events of a camera, wherein the abnormal events comprise: USB exception events and USB link recovery events;
determining whether the number of abnormal events within a first predetermined length of time reaches a first time threshold;
when the number of times of the abnormal events in the first preset time reaches a first time threshold value, reducing the transmission bandwidth of a USB module of the camera;
after the transmission bandwidth of the USB module of the camera is reduced, judging whether the duration time of the abnormal event does not reach a second preset time length;
and when the duration time of the non-abnormal event reaches a second preset duration, restoring the transmission bandwidth of the USB module to the original transmission bandwidth.
2. The data transmission method according to claim 1, wherein the reducing the transmission bandwidth of the USB module comprises:
determining a reduced transmission bandwidth of the USB module;
determining the image transmission frame rate of the USB module according to the reduced transmission bandwidth;
the restoring the transmission bandwidth of the USB module to the original transmission bandwidth includes:
and determining the image transmission frame rate of the USB module according to the original transmission bandwidth.
3. The data transmission method of claim 1, further comprising:
when an image transmission endpoint of the USB module outputs an image to a computing device, detecting whether the USB module has image transmission abnormality;
when the image transmission abnormality is detected, suspending the image output of the image transmission endpoint;
detecting whether a reset instruction of the computing equipment to an image transmission endpoint of the USB module is received;
resetting an image transmission endpoint in response to receiving the reset instruction;
detecting whether an image transmission instruction is received from the computing device;
and when receiving the image transmission instruction, outputting the image by the reset image transmission endpoint.
4. The data transmission method according to claim 3, wherein the detecting whether an image transmission abnormality occurs includes:
detecting whether a USB abnormal event occurs or not, and determining that image transmission abnormality occurs when the USB abnormal event is detected, wherein the USB abnormal event comprises the following steps: the event of restarting the endpoint and the event of actively stopping the batch transmission of the computing equipment; or
And detecting whether the frequency of the USB abnormal events occurring in the third preset time reaches a second frequency threshold value, and determining that the image transmission is abnormal when the frequency of the USB abnormal events occurring in the third preset time reaches the second frequency threshold value.
5. The data transmission method according to claim 3, wherein upon detection of an image transmission abnormality, the data transmission method further comprises:
sending a first notification message indicating that an image transmission abnormality occurs to the computing device;
indicating the image sensor to stop flowing out, and resetting the flowing out state of the image sensor;
sending a second notification message to the computing device indicating that the image transfer endpoint is in a paused state.
6. The data transmission method of claim 3, further comprising: in response to receiving the reset instruction, emptying a buffer for storing images for transmission by the image transmission endpoint.
7. A data transmission method of a computing device, comprising:
monitoring whether data abnormality occurs in an image from a camera when the image output by the camera is received;
when data abnormality is monitored, acquiring the state of an image transmission endpoint of a USB module of the camera;
when the state of the image transmission endpoint indicates that the image transmission endpoint is in a pause state, sending a reset instruction indicating that the image transmission endpoint is reset to the camera so that the camera resets the image transmission endpoint;
and sending an image transmission instruction to the camera so as to receive the image output by the camera.
8. A data transmission device of a camera, comprising:
a detection unit counting the number of abnormal events of the camera, the abnormal events including: USB exception events and USB link recovery events;
the control unit is used for determining whether the number of times of the abnormal events reaches a first time threshold value within a first preset time length; when the number of times of the abnormal events in the first preset time reaches a first time threshold value, reducing the transmission bandwidth of a USB module of the camera; after the transmission bandwidth of the USB module of the camera is reduced, judging whether the duration time of the abnormal event does not reach a second preset time length; and when the duration time of the non-abnormal event reaches a second preset duration, restoring the transmission bandwidth of the USB module to the original transmission bandwidth.
9. A data transmission apparatus of a computing device, comprising:
the monitoring unit is used for monitoring whether data abnormality occurs in the image from the camera when the computing equipment receives the image output by the camera;
the control unit is used for acquiring the state of an image transmission endpoint of the camera when the data abnormality is monitored;
when the state of the image transmission endpoint indicates that the image transmission endpoint is in a pause state, the control unit sends a reset instruction for resetting the image transmission endpoint to the camera so that the camera can reset the image transmission endpoint of the USB module;
the control unit is also configured to send an image transmission instruction to the camera for the computing device to receive an image output by the camera.
10. A camera, comprising:
an image sensor for acquiring image data;
an image processor for processing the image data and outputting a processed image;
a USB module;
a central processing unit;
a memory;
a program stored in the memory and configured to be executed by the central processor, the program comprising instructions for performing the data transmission method of any of claims 1-6.
11. A computing device, comprising:
a memory;
a processor;
a program stored in the memory and configured to be executed by the processor, the program comprising instructions for performing the method of claim 7.
12. A storage medium storing a program comprising instructions that, when executed by a processor, cause the processor to perform the method of any one of claims 1-7.
CN202011016974.0A 2020-09-24 2020-09-24 Data transmission method, device, camera, computing device and storage medium Active CN112148529B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011016974.0A CN112148529B (en) 2020-09-24 2020-09-24 Data transmission method, device, camera, computing device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011016974.0A CN112148529B (en) 2020-09-24 2020-09-24 Data transmission method, device, camera, computing device and storage medium

Publications (2)

Publication Number Publication Date
CN112148529A true CN112148529A (en) 2020-12-29
CN112148529B CN112148529B (en) 2024-06-21

Family

ID=73896776

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011016974.0A Active CN112148529B (en) 2020-09-24 2020-09-24 Data transmission method, device, camera, computing device and storage medium

Country Status (1)

Country Link
CN (1) CN112148529B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113780753A (en) * 2021-08-20 2021-12-10 深圳市广和通无线股份有限公司 Data processing method, data processing device, computer equipment and storage medium
WO2023123794A1 (en) * 2021-12-28 2023-07-06 深圳市紫光同创电子有限公司 Data phase recovery method, system, device, and storage medium for burst code stream

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101582852A (en) * 2009-06-10 2009-11-18 中兴通讯股份有限公司 Method and system for network congestion management
CN104821995A (en) * 2015-05-27 2015-08-05 广东欧珀移动通信有限公司 Data transmission management method and device thereof
CN108093444A (en) * 2018-02-23 2018-05-29 广东欧珀移动通信有限公司 Wireless network transmissions method of rate control, device, terminal device and storage medium
CN110175144A (en) * 2019-05-14 2019-08-27 惠州Tcl移动通信有限公司 USB data transmission control method and relevant device
CN110543442A (en) * 2018-05-29 2019-12-06 杭州海康机器人技术有限公司 Data transmission cut-off recovery method, device and system
CN110825682A (en) * 2019-11-05 2020-02-21 维沃移动通信有限公司 USB control method and electronic equipment
CN111309532A (en) * 2020-02-05 2020-06-19 浪潮电子信息产业股份有限公司 PCIE equipment abnormity detection method, system, electronic equipment and storage medium
CN111629122A (en) * 2020-04-24 2020-09-04 广州视源电子科技股份有限公司 Video data abnormity recovery method and device, storage medium and camera

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101582852A (en) * 2009-06-10 2009-11-18 中兴通讯股份有限公司 Method and system for network congestion management
CN104821995A (en) * 2015-05-27 2015-08-05 广东欧珀移动通信有限公司 Data transmission management method and device thereof
CN108093444A (en) * 2018-02-23 2018-05-29 广东欧珀移动通信有限公司 Wireless network transmissions method of rate control, device, terminal device and storage medium
CN110543442A (en) * 2018-05-29 2019-12-06 杭州海康机器人技术有限公司 Data transmission cut-off recovery method, device and system
CN110175144A (en) * 2019-05-14 2019-08-27 惠州Tcl移动通信有限公司 USB data transmission control method and relevant device
CN110825682A (en) * 2019-11-05 2020-02-21 维沃移动通信有限公司 USB control method and electronic equipment
CN111309532A (en) * 2020-02-05 2020-06-19 浪潮电子信息产业股份有限公司 PCIE equipment abnormity detection method, system, electronic equipment and storage medium
CN111629122A (en) * 2020-04-24 2020-09-04 广州视源电子科技股份有限公司 Video data abnormity recovery method and device, storage medium and camera

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113780753A (en) * 2021-08-20 2021-12-10 深圳市广和通无线股份有限公司 Data processing method, data processing device, computer equipment and storage medium
WO2023123794A1 (en) * 2021-12-28 2023-07-06 深圳市紫光同创电子有限公司 Data phase recovery method, system, device, and storage medium for burst code stream

Also Published As

Publication number Publication date
CN112148529B (en) 2024-06-21

Similar Documents

Publication Publication Date Title
CN112148529B (en) Data transmission method, device, camera, computing device and storage medium
EP2829986B1 (en) Computer system, access method and apparatus for peripheral component interconnect express endpoint devices
US8713366B2 (en) Restarting event and alert analysis after a shutdown in a distributed processing system
US9875165B2 (en) Communication bus with baseboard management controller
CN111078453B (en) Method, device, computer equipment and storage medium for automatically fusing and recovering micro-service
US20130097620A1 (en) Administering incident pools for event and alert analysis
EP2733611A1 (en) Internal fault handling method, device and system for virtual machine
JP2007109238A (en) System and method for logging recoverable error
US20140122421A1 (en) Information processing apparatus, information processing method and computer-readable storage medium
US7953016B2 (en) Method and system for telecommunication apparatus fast fault notification
CN110851294B (en) Method and device for remedying program running crash
CN101221518B (en) Method, device and system for preventing timing device overflow of hardware watchdog
US20080298263A1 (en) Terminal Apparatus, Terminal Apparatus Control Method, Network System, Network System Control Method, Program and Recording Medium
JP2016076072A (en) Fault notification apparatus, fault notification method, and fault notification program
CN113542001B (en) OSD (on-screen display) fault heartbeat detection method, device, equipment and storage medium
CN115658356A (en) Watchdog feeding method and system in Linux system
JP5262418B2 (en) Task scheduling apparatus and task scheduling method
US5448721A (en) Duplicated communications processing system and communications system including the duplicated communications processing system
US11196912B2 (en) Recording control apparatus, recording control method, and program
JPS6242242A (en) Supervisory unit for cpu abnormality
US20230297380A1 (en) Communication control apparatus and communication method
CN115858229A (en) Watchdog management method, watchdog and computer readable storage medium
KR100491658B1 (en) Error data elimination device and its method in parallel communication system
JP2000013469A (en) Device and method for recovering communication equipment
JP2005223828A (en) Communication system and communication recovery method

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
CB02 Change of applicant information
CB02 Change of applicant information

Address after: 310051 room 304, B / F, building 2, 399 Danfeng Road, Binjiang District, Hangzhou City, Zhejiang Province

Applicant after: Hangzhou Hikvision Robot Co.,Ltd.

Address before: 310051 room 304, B / F, building 2, 399 Danfeng Road, Binjiang District, Hangzhou City, Zhejiang Province

Applicant before: HANGZHOU HIKROBOT TECHNOLOGY Co.,Ltd.

GR01 Patent grant
GR01 Patent grant