[go: up one dir, main page]

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

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

Info

Publication number
CN112148529B
CN112148529B CN202011016974.0A CN202011016974A CN112148529B CN 112148529 B CN112148529 B CN 112148529B CN 202011016974 A CN202011016974 A CN 202011016974A CN 112148529 B CN112148529 B CN 112148529B
Authority
CN
China
Prior art keywords
image
transmission
camera
usb module
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.)
Active
Application number
CN202011016974.0A
Other languages
Chinese (zh)
Other versions
CN112148529A (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 Co Ltd
Original Assignee
Hangzhou Hikrobot 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 Co Ltd filed Critical Hangzhou Hikrobot 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

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 reaches a first time threshold value within a first preset time period; when the number of times of the abnormal events reaches a first time threshold value within a first preset time length, reducing the transmission bandwidth of the 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 of the abnormal event does not occur reaches a second preset time, recovering the transmission bandwidth of the USB module to the original transmission bandwidth.

Description

Data transmission method, device, camera, computing device and storage medium
Technical Field
The present application relates to the field of communications technologies, and in particular, to a data transmission method, apparatus, camera, computing device, and storage medium.
Background
In some application scenarios, the camera may transmit images to the host computer via USB. During the transmission of the image, the USB link of the camera may be subject to high voltage electrostatic interference. High voltage electrostatic interference can cause the camera to transmit data in disorder. The large amount of data is disordered, which can cause abnormal operation of the camera and the upper computer. In particular, the camera may be stopped and jammed.
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, a computing device and a storage medium, which can improve the anti-interference capability on high-voltage static electricity.
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 reaches a first time threshold value within a first preset time period;
when the number of times of the abnormal events reaches a first time threshold value within a first preset time length, reducing the transmission bandwidth of the 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 of the abnormal event does not occur reaches a second preset time, recovering 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 an 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:
detecting whether the USB module has abnormal image transmission or not when an image transmission endpoint of the USB module outputs an image to the computing device;
suspending image output of the image transmission endpoint when an image transmission abnormality is detected;
detecting whether a reset instruction of the computing device to the image transmission endpoint is received or not;
resetting the image transmission endpoint in response to receiving the reset instruction;
Detecting whether an image transmission instruction from the computing device is received;
upon receiving the image transmission instruction, an image is output 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, and determining that an image transmission abnormality occurs when the USB abnormal event is detected, wherein the USB abnormal event comprises: an event of restarting an endpoint and an event of actively stopping batch transmission by the computing device; or detecting whether the number of the USB abnormal events occurring in the third preset time period reaches a second number threshold, and determining that the image transmission is abnormal when the number of the USB abnormal events occurring in the third preset time period reaches the second number threshold.
In some embodiments, when an image transmission abnormality is detected, the data transmission method further includes: transmitting a first notification message to the computing device indicating the occurrence of an image transmission anomaly;
indicating the image sensor to stop outflow, and resetting the outflow state of the image sensor;
A second notification message is sent to the computing device indicating that the image transmission endpoint is in a suspended state.
In some embodiments, the data transmission method further includes: and in response to receiving the reset instruction, emptying the buffer area. The buffer is used for storing images for transmission by the image transmission endpoint.
According to one aspect of the application, a method for data transmission of a computing device is improved, comprising:
monitoring whether the image from the camera is abnormal in data or not when the image output by the camera is received;
When the occurrence of 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 for resetting the image transmission endpoint to the camera so that the camera resets the image transmission endpoint;
an image transmission instruction is sent to the camera so as to receive the image output by the camera.
According to one aspect of the present application, there is provided a data transmission apparatus for a camera, comprising:
A detection unit that counts the number of abnormal events of the camera, the abnormal events including: USB abnormal events and USB link recovery events;
A control unit that determines whether the number of times of the abnormal event reaches a first time threshold value within a first predetermined time period; when the number of times of the abnormal events reaches a first time threshold value within a first preset time length, reducing the transmission bandwidth of the 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 duration time; and when the duration of the abnormal event does not occur reaches a second preset time, recovering the transmission bandwidth of the USB module to the original transmission bandwidth.
According to one aspect of the present application, there is provided a data transmission apparatus for a computing device, comprising:
A monitoring unit that monitors whether an image from a camera is abnormal in data or not when a computing device 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 occurrence of 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 resets the image transmission endpoint of the USB module;
the control unit is also configured to send an image transfer 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 processing unit, the program comprising instructions for performing the data transmission method according to the application.
According to one aspect of the present application, a computing device is improved, 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 a data transmission method.
According to one aspect of the present application, a storage medium is improved, storing a program comprising instructions that, when executed by a computing device, cause the computing device to perform a data transmission method according to the present application.
In summary, according to the data transmission scheme of the present application, by monitoring the abnormal event of the camera, whether the camera has serious electrostatic interference can be monitored. In this way, the data transmission scheme can reduce the transmission bandwidth when there is severe electrostatic interference (i.e., the number of abnormal events reaches a first threshold value within a first predetermined period of time). By reducing the transmission bandwidth, the data transmission scheme can avoid backlog of data to be transmitted, thereby avoiding the situation that a camera is blocked. It should be noted that, when facing the electrostatic interference, the camera is prone to data transmission errors. If the camera does not adopt the mode of reducing the transmission bandwidth in the data transmission scheme, data retransmission is caused by data transmission errors, so that backlog of data to be transmitted is easy to occur to the camera, and further the camera is blocked. Therefore, by reducing the transmission bandwidth, the data transmission scheme can increase the redundancy of the USB link, thereby preventing the camera from being blocked caused by electrostatic interference, i.e. improving the anti-electrostatic interference capability of the camera. In other words, when serious electrostatic interference occurs, the data transmission scheme increases the redundancy of the USB link by reducing the transmission bandwidth, so that the camera can normally transmit images. In addition, the data transmission scheme does not need to reduce the transmission bandwidth when the number of abnormal events does not reach the first time threshold (i.e., there is no electrostatic interference or electrostatic interference is not severe) within the first predetermined period of time. In addition, the data transmission scheme of the present application can restore the transmission bandwidth to the original transmission bandwidth 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).
Drawings
FIG. 1 illustrates a schematic diagram of an application scenario according to some embodiments of the application;
FIG. 2 illustrates a flow chart of a method 200 of data transmission for a camera according to some embodiments of the application;
FIG. 3 illustrates a flow chart of a method 300 of data transmission for a camera according to some embodiments of the application;
FIG. 4 illustrates a flow chart of a method 400 of data transmission for a camera according to some embodiments of the application;
FIG. 5 illustrates a schematic diagram of a data transmission method 500 of a computing device, according to some embodiments of the application;
FIG. 6 illustrates a schematic diagram of a data transmission method 600 of a computing device, according to some embodiments of the application;
FIG. 7 illustrates a schematic diagram of a camera 120 according to some embodiments of the application;
fig. 8 shows a schematic diagram of a data transmission device 800 according to some embodiments of the application;
fig. 9 shows a schematic diagram of a data transmission device 900 according to some embodiments of the application;
FIG. 10 illustrates a schematic diagram of a computing device according to some embodiments of the application.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application will be 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 being interfered by high-voltage static electricity and the like, the camera is easy to generate abnormal data transmission and backlog of data to be transmitted, and then enters a clamping state.
Fig. 1 illustrates a schematic diagram of an application scenario according to some embodiments of the 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. The camera 120 may be, for example, a residential 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, which may also be referred to as a host computer, may receive images output by the camera 120.
Fig. 2 illustrates a flow chart of a method 200 of data transmission for a camera according to some embodiments of the application. The method 200 may be performed, for example, by the camera 120.
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 abnormal events and USB link recovery events, etc. Among these, USB exception events may include, for example: events of endpoint restart and events of computing device proactively stopping bulk transmissions. The USB link recovery event is: and the notification information which is generated by the USB module and indicates that the data link is recovered to be normal.
In step S202, it is determined whether the number of abnormal events reaches a first time count threshold within a first predetermined period of time. Wherein the first predetermined time period is, for example, 5 seconds. The first time threshold is, for example, 2 times. When step S202 determines that the number of times of the abnormal event does not reach the first time count threshold within the first predetermined time period, the method 200 continues to step S201.
When step S202 determines that the number of abnormal events 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 the 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, that is, an upper limit of a transmission rate of the image data by the USB module. Based on 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 reducing the transmission bandwidth of the USB module of the camera, it is determined whether the duration of the non-occurrence of the abnormal event reaches the second predetermined duration. The second predetermined time period is, for example, 6 seconds. Upon determining that the duration of the non-occurrence of the abnormal event has not reached the second predetermined length of time, the camera 120 continues to maintain the reduced transmission bandwidth.
When it is determined in step S204 that the duration of the non-occurrence of the abnormal event reaches the second predetermined time period, the method 200 may perform step S205 to 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 does not have abnormal image transmission. 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 serious electrostatic interference occurs in the camera by monitoring the abnormal event of the camera. In this way, the method 200 can reduce the transmission bandwidth when there is severe electrostatic interference (i.e., the number of abnormal events reaches a first threshold number within a first predetermined period of time). By reducing the transmission bandwidth, the method 200 can avoid backlog of data to be transmitted, thereby avoiding the situation that the camera is stuck. It should be noted that, when facing the electrostatic interference, the camera is prone to data transmission errors. If the camera does not adopt the method of reducing the transmission bandwidth in the method 200, the data is retransmitted due to the data transmission error, so that the camera is prone to backlog of the data to be transmitted, and thus the camera is jammed. Therefore, the method 200 can increase the redundancy of the USB link by reducing the transmission bandwidth, thereby preventing the camera from being stuck due to the electrostatic interference, i.e. improving the anti-electrostatic interference capability of the camera. In other words, the method 200 may allow the camera to transmit images normally by reducing the transmission bandwidth and increasing the USB link redundancy in the event of severe electrostatic interference. In addition, the method 200 does not require a reduction in transmission bandwidth when the number of abnormal events does not reach the first time threshold (i.e., there is no or less severe electrostatic interference) within the first predetermined period of time. In addition, the method 200 can restore the transmission bandwidth to the original transmission bandwidth when the image transmission of the camera is restored to normal (the duration in which the abnormal event does not occur reaches the second predetermined time period).
In some application scenarios, after entering a stuck state, the camera cannot execute an instruction, cannot be reset automatically, and needs to be restarted manually. The restart may cause the communication between the camera and the upper computer to be disconnected, and the image transmission cannot be performed until the computing device reestablishes the communication connection with the camera according to the user input.
Therefore, the application also provides a software antistatic interference scheme which can realize an automatic resetting mechanism when the camera is subjected to high-voltage static interference, thereby preventing the camera from being blocked and further improving the antistatic interference capability of the camera. 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 method 300 of data transmission for a camera according to some embodiments of the application. The method 300 may be performed, for example, by the camera 120.
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 transmission channel. The endpoints of the USB module comprise endpoints such as an image transmission endpoint and an instruction transmission endpoint. The image transmission endpoint may also be referred to as a stream endpoint.
In addition, during the 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 subject 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 with step S301.
Upon detecting an image transmission abnormality at step S302, the method 300 may execute step S303 to suspend image output of the image transmission endpoint.
In step S304, it is detected whether a reset instruction of the computing device to the image transmission endpoint of the USB module 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 device is received. Upon receiving the image transmission instruction at step S306, the camera 120 may execute outputting of 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 situation that the camera is jammed when the image transmission is abnormal by detecting whether the image transmission is abnormal or not 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 restart normal output of the image. In short, the method 300 can avoid the problem of jamming caused by electrostatic interference by automatically controlling suspension and reset of image output, thereby avoiding the trouble of restarting the camera caused by the jamming state and improving the anti-electrostatic interference capability.
In addition, method 300 may avoid computing device data transfer confusion by resetting the image transfer endpoint of the USB module in response to a reset instruction. Specifically, the computing device acquires image frames corresponding to the frame numbers from the camera by the frame numbers. If the camera resets the image transmission endpoint before receiving the reset instruction, various data transmission confusion situations easily occur.
In the first case, computing device 110 makes an image request at the old frame number of the image acquired before the camera resets the image transmission endpoint, and the camera sends the image at the new frame number after the image transmission endpoint is reset. The old frame numbers with the same numbers correspond to different image frames with the new frame numbers. Thus, images acquired by the computing device appear to be confused by frame numbers.
In the second case, the image frames acquired by computing device 110 exhibit pixel dropout. For example, computing device 110 has acquired a portion of pixels of image frame a that camera 120 acquired before resetting the image endpoint, and has failed to acquire another portion of pixels of image frame a from the camera after the image transmission endpoint is reset.
In a third case, the image frames acquired by the computing device are cut off. For example, computing device 110 has acquired a portion of the pixels of image frame B that the camera acquired prior to resetting the image endpoint. The frame number of image frame B is 10. After the image transmission end point is reset, the image frame C with the frame number 10 acquired by the camera 120 is different from the image frame B. Computing device 110 continues to request pixels of frame number 10, while pixels of image frame C are acquired. Based on this, the image frame of the frame number 10 obtained by the computing device 110 is an image frame formed by stitching a part of pixels of the image frame B and a part of pixels of the image frame C. The display picture of the image frame is cut off.
In some embodiments, in order to detect whether an image transmission abnormality occurs, step S302 may detect whether a USB abnormality event occurs. Among these, USB exception events may include, for example: events of endpoint restart and events of computing device proactively stopping bulk transmissions. Here, the USB abnormal event is generated by the USB module of the camera. The events of the endpoint restart are: the USB endpoint for transmitting the image waits for notification information of the restart. The events of the computing device actively stopping batch transmission are: and after the USB module receives the instruction for stopping batch transmission of the computing equipment, generating notification information for indicating stopping batch transmission. The USB module may notify the application software of the camera of the USB abnormal 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 period of time reaches the second number threshold. The third predetermined time period is, for example, 2 seconds and the second time threshold is, for example, 3 times. When the number of USB abnormal events occurring within the third predetermined period reaches the second number threshold, step S302 may determine that an image transmission abnormality occurs.
In some embodiments, suspending the image output of the image transmission endpoint in step S303 includes: suspending the image transmission endpoint from fetching the image from the buffer and suspending sending the image to the computing device. In this way, the image transmission endpoint is in a suspended state, so that the camera 120 can be prevented from being blocked due to image transmission backlog.
Fig. 4 illustrates a flow chart of a method 400 of data transmission for a camera according to some embodiments of the application. The method 400 may be performed, for example, by the camera 120.
As shown in fig. 4, in step S401, an image is output to a computing device by an image transmission endpoint of a USB module of a camera.
In step S402, it is detected whether a USB abnormal event occurs.
When no USB abnormal event is detected in step S402, the method 400 may continue to step S401.
Upon detection of a USB abnormal 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, according to the first notification message, that the image from the camera is abnormal in data, and thus immediately clear the abnormal data that the computing device 110 has received. Here, step S403 may transmit the first notification message by, for example, instructing the transmission endpoint.
In step S404, the image output of the image transmission endpoint of the (stall) USB module is suspended.
In step S405, the image sensor is instructed to stop the outflow, and the outflow state of the image sensor is reset. Instruct the image sensor to stop the outflow as: the image sensor is instructed to stop capturing image frames. Resetting the outflow state of the image sensor may include, for example: and (3) clearing the image cache data of the image sensor and resetting the image control flag bit.
After the image transmission endpoint is in the suspended state, the method 400 may execute in step S406 to send a second notification message to the computing device indicating that the image transmission endpoint is in the suspended state. In this way, the computing device may send a reset instruction to the image transmission endpoint to the camera 120 in response to the second notification message. In step S407, it is detected whether a reset instruction of the computing device to the image transmission endpoint of the USB module is received.
Upon detecting the reset instruction in step S407, the method 400 may perform step S408 to reset the image transmission endpoint of the USB module and empty the buffer. The buffer is used for storing images for transmission by the image transmission endpoint.
In step S409, it is detected whether an image transmission instruction from the computing device is received. Upon detecting the image transmission instruction at step S409, the method 400 may execute outputting of an image by the image transmission 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 transmission method 400 transmits a reset instruction after the computing device determines that the image transmission endpoint is in the suspended state by transmitting a second notification message to the computing device. Based on this, 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 the camera returns the image newly acquired, so as to avoid confusion of data transmission of the computing device.
Fig. 5 illustrates a schematic diagram of a data transmission method 500 of a computing device, according to some embodiments of the application. Method 500 may be performed, for example, by computing device 110.
As shown in fig. 5, in step S501, an image output by a camera is received.
In step S502, it is monitored whether or not an image from the camera has a data abnormality. For example, when step S502 monitors that a large number of messy codes appear in the image from the camera, it is determined that a data abnormality occurs. For another example, computing device 110 may determine that a data anomaly occurred in response to receiving a first notification message indicating that an image transmission anomaly occurred.
When it is monitored in step S502 that a data anomaly has occurred, the method 500 may execute step S503 to acquire a state of an image transmission endpoint of the USB module of the camera. For example, computing device 110 may receive a second notification message indicating that the image transmission endpoint is in a suspended state.
When the endpoint state acquired in 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 for resetting the image transmission endpoint of the USB module to the camera, so that the camera resets the image transmission endpoint of the USB module.
In step S505, an image transmission instruction is transmitted to the camera so as to receive an image output by the camera. Here, after the reset instruction is sent, the image transmission end point of the camera is reset. Thus, step S505 may send an image transmission instruction for an image newly acquired by the camera after the image transmission endpoint is reset, so as to receive the newly acquired image.
In summary, the method 500 according to the embodiment of the application can monitor whether the 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 a suspended state. Therefore, the method 500 can automatically detect the transmission state of the data link and cooperate with the resetting operation of the camera, so as to avoid the situation that the camera is jammed, further avoid the trouble that the camera needs to be restarted caused by the jammed state, and improve the antistatic interference capability of the camera. In addition, the method 500 may enable the image transmission endpoint to be reset by sending a reset instruction, and may send the image transmission instruction for the image newly collected by the camera after the image transmission endpoint is reset, and receive the newly collected image. In this way, the method 500 can avoid confusion in data transmission.
Fig. 6 illustrates a schematic diagram of a data transmission method 600 of a computing device according to some embodiments of the application. Method 600 may be performed, for example, by computing device 110.
As shown in fig. 6, in step S601, an image output by a camera is received.
In step S602, it is monitored whether or not an image from the camera has a data abnormality. For example, when step S602 monitors that a large number of messy codes appear in the image from the camera, it is determined that a data abnormality has occurred. For another example, computing device 110 may determine that a data anomaly occurred in response to receiving a first notification message indicating that an image transmission anomaly occurred.
Upon detecting the occurrence of a data anomaly at step S602, the method 600 may perform steps S603 and S604.
In step S603, an image in which a data abnormality occurs is deleted. Here, the image of the data anomaly is, for example: the computing device has received a partial, but not fully received, image frame. In this way, computing device 110 may instantly clear the images of the anomaly in order to save storage space.
In step S604, the status of the image transmission endpoint of the USB module of the camera is acquired.
When the endpoint state acquired 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, 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 S606, an image transmission instruction is transmitted to the camera so as to receive an image output by the camera.
In summary, the method 600 according to the embodiment of the application can monitor whether the 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 resetting operation of the camera, so as to avoid the situation that the camera is jammed, further avoid the trouble that the camera needs to be restarted caused by the jammed state, and improve the anti-static interference capability.
Fig. 7 shows a schematic diagram of a camera 120 according to some embodiments of the application.
As shown in fig. 7, the camera 700 may include: an image sensor 701, an image processor 702, a USB module 703, a memory 704, and a central processor 705. The memory 703 may store a set of instructions for execution by the central processor 705, among other things. For example, the memory 703 may include an application 706. The image sensor 701 is used to acquire image data.
The image signal processor 702 is configured to process image data to output a processed image.
USB module 703 may include multiple endpoints, such as image transfer endpoint 707 and instruction transfer endpoint 708. Image transmission endpoint 707 may be used for image transmission. The instruction transfer endpoint 708 may be used for transfer of instruction messages.
Application 706 may perform methods 200, 300, and 400, for example.
Fig. 8 illustrates a schematic diagram of a data transmission apparatus 800 according to some embodiments of the application. The apparatus 800 may be deployed in the camera 120, for example.
As shown in fig. 8, an 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 abnormal event includes: USB exception events and USB link recovery events.
The control unit 802 may determine whether the number of abnormal events reaches a first time threshold within a first predetermined time period. The control unit 802 may reduce the transmission bandwidth of the USB module of the camera when the number of abnormal events reaches the first time threshold within the first predetermined time period. 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-occurrence of the abnormal event reaches the second predetermined duration. When the duration of the non-occurrence of the abnormal event reaches the second predetermined time, 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. In this way, the data transmission apparatus 800 can reduce the transmission bandwidth when the serious electrostatic interference (i.e., the number of abnormal events reaches the first time threshold value within the first predetermined period of time). By reducing the transmission bandwidth, the data transmission device 800 can avoid backlog of data to be transmitted, thereby avoiding the situation that the camera is stuck. It should be noted that, when facing the electrostatic interference, the camera is prone to data transmission errors. If the camera does not adopt the mode of reducing the transmission bandwidth in the data transmission device 800, the data is retransmitted due to the data transmission error, so that the backlog of the data to be transmitted is easy to occur in the camera, and the camera is blocked. Therefore, the data transmission device 800 can increase the redundancy of the USB link by reducing the transmission bandwidth, thereby preventing the camera from being stuck due to the electrostatic interference, i.e., improving the anti-electrostatic interference capability of the camera. In other words, the data transmission device 800 increases the redundancy of the USB link by reducing the transmission bandwidth when serious electrostatic interference occurs, so that the camera can normally transmit images. In addition, the data transmission device 800 does not need to reduce the transmission bandwidth when the number of abnormal events does not reach the first time threshold (i.e., there is no electrostatic interference or electrostatic interference is not severe) within the first predetermined period of time. In addition, the data transmission apparatus 800 can restore the transmission bandwidth to the original transmission bandwidth when the image transmission of the camera is restored to normal (the duration in which the abnormal event does not occur reaches the second predetermined period).
In some embodiments, the detection unit 801 may also detect whether an image transmission abnormality occurs in the USB module when the image transmission endpoint of the USB module outputs an image to the computing device.
The control unit 802 may also suspend image output of the image transmission end point 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 computing device to the image transmission endpoint 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 from a computing device is received. When the detection unit detects an image transmission instruction, the control unit 802 outputs an image through the reset image transmission 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.
In summary, the data transmission device 800 according to the present application can also prevent the camera from being jammed when the image transmission is abnormal by detecting whether the image transmission is abnormal or not and suspending the image output when the image transmission is abnormal. On this basis, the data transmission device 800 can realize automatic resetting of the camera according to the reset instruction, and restart normal output of the image. In short, the data transmission device 800 can avoid the problem of jamming caused by electrostatic interference by automatically controlling suspension and reset of image output, thereby avoiding the trouble of restarting the camera caused by the jamming state and improving the anti-electrostatic interference capability.
Fig. 9 illustrates a schematic diagram of a data transmission apparatus 900 according to some embodiments of the application. Apparatus 900 may be deployed in computing device 110, for example.
As shown in fig. 9, the data transmission apparatus 900 may include: a monitoring unit 901 and a control unit 902.
A monitoring unit 901, when the computing device receives an image output by a camera, monitors whether the image from the camera has a data abnormality.
And a control unit 902 for acquiring the state of the image transmission endpoint of the camera when the occurrence of data abnormality is detected.
When the state of the image transmission endpoint indicates that the image transmission endpoint is in a suspended state, the control unit 902 transmits a reset instruction to reset the image transmission endpoint to the camera so that the camera resets the image transmission endpoint of the USB module. The control unit 902 is also used to send image transfer 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 will not be described in detail herein.
In summary, the data transmission device 900 according to the embodiment of the application can monitor whether the data transmission with the camera is abnormal, and 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 resetting operation of the camera, so as to avoid the situation that the camera is jammed, further avoid the trouble that the camera needs to be restarted caused by the jammed state, and improve the anti-static interference capability. In addition, the data transmission device 900 may enable the image transmission endpoint to be reset by sending a reset instruction, and may send the image transmission instruction for the image newly collected by the camera after the image transmission endpoint is reset, and receive the image newly collected. In this way, the data transmission device 900 can avoid confusion of data transmission.
FIG. 10 illustrates a schematic diagram of a computing device according to some embodiments of the application. As shown in fig. 10, the computing device includes one or more processors (CPUs) 1002, a communication module 1004, a memory 1006, a user interface 1010, and a communication bus 1008 for interconnecting these components.
The processor 1002 may receive and transmit data via the communication module 1004 to enable network communication and/or local communication.
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 an instruction of a remote controller, for example, but is not limited thereto.
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;
Application 1018 includes various programs for implementing the data transmission method described above. Such a program can implement the process flows in the examples described above, and may include the data transmission method 500 or 600, for example.
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. Obviously, the data processing program constitutes the application. In addition, a data processing program typically 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 apparatus. Therefore, such a storage medium also constitutes the present application. The storage medium may use any type of recording means, such as paper storage medium (e.g., paper tape, etc.), magnetic storage medium (e.g., floppy disk, hard disk, flash memory, etc.), optical storage medium (e.g., CD-ROM, etc.), magneto-optical storage medium (e.g., MO, etc.), etc.
The present application also discloses a nonvolatile 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 application.
In addition, the method steps of the present application may be implemented by hardware, such as logic gates, switches, application Specific Integrated Circuits (ASIC), programmable logic controllers, embedded microcontrollers, etc., in addition to data processing programs. Such hardware capable of carrying out the methods of the application may therefore also constitute the application.
The foregoing description of the preferred embodiments of the application is not intended to be limiting, but rather is to cover all modifications, equivalents, alternatives, and improvements that fall within the spirit and scope of the application.

Claims (9)

1. A method for transmitting data to a camera, comprising:
Counting the number of abnormal events of the camera, wherein the abnormal events comprise: USB abnormal events and USB link recovery events;
determining whether the number of abnormal events reaches a first time threshold value within a first preset time period;
when the number of times of the abnormal events reaches a first time threshold value within a first preset time length, reducing the transmission bandwidth of the 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;
When the duration of the abnormal event does not reach a second preset time, recovering the transmission bandwidth of the USB module to the original transmission bandwidth;
The reducing the transmission bandwidth of the USB module includes:
Determining a reduced transmission bandwidth of the USB module;
determining an 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.
2. The data transmission method of claim 1, further comprising:
Detecting whether the USB module has abnormal image transmission or not when an image transmission endpoint of the USB module outputs an image to the computing equipment;
suspending image output of the image transmission endpoint when an image transmission abnormality is detected;
Detecting whether a reset instruction of the computing device to an image transmission endpoint of the USB module is received or not;
resetting the image transmission endpoint in response to receiving the reset instruction;
Detecting whether an image transmission instruction from the computing device is received;
upon receiving the image transmission instruction, an image is output by the reset image transmission endpoint.
3. The data transmission method according to claim 2, wherein the detecting whether an image transmission abnormality occurs comprises:
detecting whether a USB abnormal event occurs, and determining that an image transmission abnormality occurs when the USB abnormal event is detected, wherein the USB abnormal event comprises: an event of restarting an endpoint and an event of actively stopping batch transmission by the computing device; or alternatively
Detecting whether the number of the USB abnormal events occurring in the third preset time length reaches a second number threshold, and determining that the image transmission is abnormal when the number of the USB abnormal events occurring in the third preset time length reaches the second number threshold.
4. The data transmission method according to claim 2, wherein when an image transmission abnormality is detected, the data transmission method further comprises:
Transmitting a first notification message to the computing device indicating the occurrence of an image transmission anomaly;
indicating the image sensor to stop outflow, and resetting the outflow state of the image sensor;
A second notification message is sent to the computing device indicating that the image transmission endpoint is in a suspended state.
5. The data transmission method of claim 2, further comprising: and in response to receiving the reset instruction, emptying a buffer area, wherein the buffer area is used for storing the image for the image transmission endpoint to transmit.
6. A data transmission device of a camera, comprising:
A detection unit that counts the number of abnormal events of the camera, the abnormal events including: USB abnormal events and USB link recovery events;
A control unit that determines whether the number of times of the abnormal event reaches a first time threshold value within a first predetermined time period; when the number of times of the abnormal events reaches a first time threshold value within a first preset time length, reducing the transmission bandwidth of the 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 duration time; when the duration of the abnormal event does not reach a second preset time, recovering the transmission bandwidth of the USB module to the original transmission bandwidth;
the control unit reduces a transmission bandwidth of a USB module of the camera, including:
Determining a reduced transmission bandwidth of the USB module;
determining an image transmission frame rate of the USB module according to the reduced transmission bandwidth;
the control unit restores the transmission bandwidth of the USB module to the original transmission bandwidth, including:
and determining the image transmission frame rate of the USB module according to the original transmission bandwidth.
7. 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 one of claims 1-5.
8. 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 5.
9. A storage medium storing a program comprising instructions which, when executed by a processor, cause the processor to perform the method of any one of claims 1-5.
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 CN112148529A (en) 2020-12-29
CN112148529B true 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)

Families Citing this family (2)

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

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
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 transmission rate control method and device, terminal equipment and storage medium
CN110543442A (en) * 2018-05-29 2019-12-06 杭州海康机器人技术有限公司 Data transmission cut-off recovery method, device and system

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101582852B (en) * 2009-06-10 2012-04-11 中兴通讯股份有限公司 Method and system for network congestion management
CN110175144B (en) * 2019-05-14 2024-01-19 惠州Tcl移动通信有限公司 USB data transmission control method and related equipment
CN110825682B (en) * 2019-11-05 2022-08-02 维沃移动通信有限公司 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
CN111629122B (en) * 2020-04-24 2022-09-30 广州视源电子科技股份有限公司 Video data abnormity recovery method, storage medium and camera

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
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 transmission rate control method and device, terminal equipment and storage medium
CN110543442A (en) * 2018-05-29 2019-12-06 杭州海康机器人技术有限公司 Data transmission cut-off recovery method, device and system

Also Published As

Publication number Publication date
CN112148529A (en) 2020-12-29

Similar Documents

Publication Publication Date Title
CN112148529B (en) Data transmission method, device, camera, computing device and storage medium
CN111078453B (en) Method, device, computer equipment and storage medium for automatically fusing and recovering micro-service
EP2829986B1 (en) Computer system, access method and apparatus for peripheral component interconnect express endpoint devices
US9875165B2 (en) Communication bus with baseboard management controller
JP2007109238A (en) System and method for logging recoverable error
TW201444356A (en) Dynamatic video storing method and internet security monitoring device
US7953016B2 (en) Method and system for telecommunication apparatus fast fault notification
US7830811B2 (en) Terminal apparatus, terminal apparatus control method, network system, network system control method, program and recording medium
CN110912985A (en) Network link scheduling method and related equipment
US20070073911A1 (en) Data processing system, data processing apparatus and handling method
JP2016076072A (en) Fault notification apparatus, fault notification method, and fault notification program
JPH06175887A (en) Fault monitoring / notification method
CN115658356A (en) Watchdog feeding method and system in Linux system
JPH11331399A (en) Remote centralized control system
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
US12131158B2 (en) Communication control apparatus and communication method
JP2000013469A (en) Device and method for recovering communication equipment
JP6784939B2 (en) Network equipment
JPS58129860A (en) Restart processing system
CN107291585A (en) Disaster recovery method and device, server
CN116436763A (en) Fault processing method of network card link and computing equipment
JP2005223828A (en) Communication system and communication recovery method
JPH0767133B2 (en) Accumulation broadcasting device

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

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.

CB02 Change of applicant information
GR01 Patent grant
GR01 Patent grant