Data storage method of network camera

文档序号:142214 发布日期:2021-10-22 浏览:10次 中文

阅读说明:本技术 一种网络摄像机的数据存储方法 (Data storage method of network camera ) 是由 韦凯峰 于 2021-07-16 设计创作,主要内容包括:本发明公开一种网络摄像机的数据存储方法,用于网络摄像机的私有云存储系统,该系统包括与P2P服务器通信的存储设备及网络摄像机,该方法包括:存储设备向P2P服务器上报设备信息,设备信息包括存储设备的UID及存储设备的LAN IP;网络摄像机向P2P服务器获取指定UID对应的存储设备的LAN IP及存储设备的WAN IP;网络摄像机向存储设备的LAN IP发送UDP通信数据包;发送失败时,经P2P服务器转发请求NAT打洞数据包;存储设备及网络摄像机向对方的WAN IP发送UDP打洞信令;接收成功时,网络摄像机向存储设备的WAN IP发送存储数据包,否则,通过P2P服务器进行转发;存储设备存储数据。(The invention discloses a data storage method of a network camera, which is used for a private cloud storage system of the network camera, the system comprises a storage device communicated with a P2P server and the network camera, and the method comprises the following steps: the storage device reports device information to a P2P server, wherein the device information comprises a UID of the storage device and a LAN IP of the storage device; the network camera acquires a LAN IP of a storage device corresponding to the appointed UID and a WAN IP of the storage device from the P2P server; the network camera sends a UDP communication data packet to the LAN IP of the storage device; when the sending fails, forwarding a data packet requesting NAT punching through a P2P server; the storage equipment and the network camera send UDP hole punching signaling to the WAN IP of the opposite side; when the receiving is successful, the network camera sends a storage data packet to a WAN IP of the storage device, otherwise, the storage data packet is forwarded through a P2P server; the storage device stores data.)

1. The data storage method of the network camera is characterized by being applied to a private cloud storage system of the network camera, wherein the private cloud storage system of the network camera comprises a storage device, a P2P server and the network camera, and the storage device and the network camera are communicated through the P2P server, and the data storage method comprises the following steps:

step A, the storage device reports device information to a P2P server, wherein the device information comprises a UID of the storage device and a LAN IP of the storage device;

b, the network camera acquires the LAN IP of the storage device and the WAN IP of the storage device corresponding to the appointed UID from the P2P server;

c, the network camera sends a UDP communication data packet to the obtained LAN IP of the storage device;

step D, when the sending fails, the network camera sends a NAT hole punching request data packet to the storage equipment relay through the P2P server;

e, the storage device sends a UDP (user Datagram protocol) hole punching signaling to the WAN IP of the network camera according to the received NAT hole punching request data packet, and the network camera sends the UDP hole punching signaling to the WAN IP of the storage device;

step F, when the storage device and the network camera both receive corresponding UDP hole punching signaling, the network camera sends a storage data packet to the WAN IP of the storage device; when the storage device and/or the network camera do not receive the corresponding UDP hole punching signaling, the network camera relays and sends a storage data packet to the storage device through the P2P server;

and G, the storage device stores data according to the received storage data packet.

2. The data storage method of a network camera according to claim 1, further comprising, after the step C:

and d, when the transmission is successful, the network camera transmits a storage data packet to the LAN IP of the storage equipment, and the step G is executed.

3. The data storage method of the network camera according to claim 1, further comprising before the step C:

the network camera compresses the acquired shooting data, stores the compressed shooting data into an SD card of the network camera, and generates a storage data packet according to the compressed shooting data.

4. The data storage method of the network camera according to claim 3, wherein the network camera compresses the acquired camera data, stores the compressed camera data in an SD card of the network camera, and generates a storage data packet according to the compressed camera data, wherein a video encoding format of the compressed camera data in the step is H.264 or H.265.

5. The data storage method of the network camera according to claim 3, wherein the storage data packet includes compressed camera data and camera identity information, and the step G specifically is:

the storage equipment acquires corresponding camera identity information according to the received storage data packet, divides a storage area according to the camera identity information, and stores compressed camera shooting data of the storage data packet according to the corresponding storage area.

6. The data storage method of the network camera according to claim 5, wherein the storage device includes a main control chip and a storage hard disk, the main control chip is connected to the storage hard disk, the main control chip communicates with the P2P server, and the step G specifically includes:

the main control chip acquires corresponding camera identity information and compressed camera data according to the received storage data packet, and divides the storage hard disk into a plurality of storage areas according to the camera identity information;

and the main control chip writes the compressed camera shooting data into the storage hard disk according to the corresponding storage area for storage.

Technical Field

The invention relates to the technical field of camera data safety storage, in particular to a data storage method of a network camera.

Background

As more and more people use the network camera for remote monitoring, the security of the network camera becomes more and more important, including how to perform secure storage on data generated by the network camera, the data is mainly video stream data and relates to personal privacy, and many network camera manufacturers on the market store the data in an SD card or a public cloud, wherein the storage capacity is limited due to the use of the SD card, and the SD card is full in a short time to cause the loss of old data; and a lot of data are stored in the public cloud, and cannot be encrypted or are simply encrypted, if a server fails or the data are leaked, personal data can be leaked out, and the safety and privacy of the data cannot be guaranteed.

Disclosure of Invention

The technical problem to be solved by the invention is to provide a data storage method of a network camera to solve the problem of insufficient storage capacity existing when the data of the network camera is stored in an SD card and avoid the problems of data security and privacy existing when the data is stored in a public cloud.

In order to solve the technical problems, the invention aims to realize the following technical scheme: the data storage method of the network camera is applied to a private cloud storage system of the network camera, the private cloud storage system of the network camera comprises a storage device, a P2P server and the network camera, the storage device and the network camera are communicated through the P2P server, and the data storage method comprises the following steps:

step A, the storage device reports device information to a P2P server, wherein the device information comprises a UID of the storage device and a LAN IP of the storage device;

b, the network camera acquires the LAN IP of the storage device and the WAN IP of the storage device corresponding to the appointed UID from the P2P server;

c, the network camera sends a UDP communication data packet to the obtained LAN IP of the storage device;

step D, when the sending fails, the network camera sends a NAT hole punching request data packet to the storage equipment relay through the P2P server;

e, the storage device sends a UDP (user Datagram protocol) hole punching signaling to the WAN IP of the network camera according to the received NAT hole punching request data packet, and the network camera sends the UDP hole punching signaling to the WAN IP of the storage device;

step F, when the storage device and the network camera both receive corresponding UDP hole punching signaling, the network camera sends a storage data packet to the WAN IP of the storage device; when the storage device and/or the network camera do not receive the corresponding UDP hole punching signaling, the network camera relays and sends a storage data packet to the storage device through the P2P server;

and G, the storage device stores data according to the received storage data packet.

The further technical scheme is as follows: and step C is followed by:

and d, when the transmission is successful, the network camera transmits a storage data packet to the LAN IP of the storage equipment, and the step G is executed.

The further technical scheme is as follows: the step C also comprises the following steps:

the network camera compresses the acquired shooting data, stores the compressed shooting data into an SD card of the network camera, and generates a storage data packet according to the compressed shooting data.

The further technical scheme is as follows: the network camera compresses the acquired shooting data, stores the compressed shooting data into an SD card of the network camera, and generates a storage data packet according to the compressed shooting data, wherein the video coding format of the compressed shooting data in the step is H.264 or H.265.

The further technical scheme is as follows: the storage data packet comprises compressed camera data and camera identity information, and the step G specifically comprises the following steps:

the storage equipment acquires corresponding camera identity information according to the received storage data packet, divides a storage area according to the camera identity information, and stores compressed camera shooting data of the storage data packet according to the corresponding storage area.

The further technical scheme is as follows: the storage device comprises a main control chip and a storage hard disk, the main control chip is connected with the storage hard disk, the main control chip is communicated with the P2P server, and the step G specifically comprises the following steps:

the main control chip acquires corresponding camera identity information and compressed camera data according to the received storage data packet, and divides the storage hard disk into a plurality of storage areas according to the camera identity information;

and the main control chip writes the compressed camera shooting data into the storage hard disk according to the corresponding storage area for storage.

The invention has the beneficial technical effects that: the invention relates to a data storage method of a network camera, which is applied to a private cloud storage system of the network camera, wherein a storage device and the network camera are communicated through a P2P server, the storage device reports device information to a P2P server, the network camera acquires a LAN IP of the corresponding storage device and a WAN IP of the storage device according to a specified UID from a P2P server, after the LAN IP of the network camera and the storage device fails to try UDP communication, the network camera requests the storage device to punch a hole by NAT through the P2P server, after the punching succeeds, NAT mode communication is realized, a storage data packet is directly sent to the WAN IP of the storage device to store the data in the storage device, if the hole fails, the P2P server is utilized to carry out relay transmission to realize private cloud storage, the shortage of storage capacity caused by the data storage of the network camera into an SD card is avoided, and the data does not need to be stored in a public cloud, and the data security and privacy are improved.

Drawings

In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.

Fig. 1 is a schematic flowchart of a data storage method of a network camera according to an embodiment of the present invention;

fig. 2 is a schematic specific flowchart of a data storage method of a network camera according to an embodiment of the present invention.

Detailed Description

The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, not all, embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.

It will be understood that the terms "comprises" and/or "comprising," when used in this specification and the appended claims, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof.

It is also to be understood that the terminology used in the description of the invention herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention. As used in the specification of the present invention and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise.

It should be further understood that the term "and/or" as used in this specification and the appended claims refers to and includes any and all possible combinations of one or more of the associated listed items.

Referring to fig. 1, fig. 1 is a schematic flow chart of a data storage method of a network camera according to an embodiment of the present invention, where the data storage method of the network camera is applied to a private cloud storage system of the network camera, the private cloud storage system of the network camera includes a storage device, a P2P server and the network camera, the storage device and the network camera communicate with each other through the P2P server, and the data storage method includes the following steps:

step S110, the storage device reports device information to the P2P server, wherein the device information comprises the UID of the storage device and the LAN IP of the storage device.

When the storage device communicates with the P2P server, the P2P server already knows the WAN IP (Wide Area Network Internet Protocol) of the storage device and the port corresponding to the WAN IP, and does not need to report the WAN IP and the port corresponding to the WAN IP of the storage device is already disclosed in the private cloud storage system. The device information includes a User Identification (UID) of the storage device, a Local Area Network (LAN) IP (Local Area Internet Protocol), and a port corresponding to the LAN IP.

And step S120, the network camera acquires the LAN IP of the storage device and the WAN IP of the storage device corresponding to the specified UID from the P2P server.

When the network camera is communicated with the P2P server, the P2P server already knows the WAN IP of the network camera and the port corresponding to the WAN IP, and the WAN IP of the network camera and the port corresponding to the WAN IP are disclosed in the private cloud storage system without reporting. The storage device has a unique UID, the network camera does not have the UID, but the network camera can designate the storage device for storing the data of the network camera through the corresponding UID input by the user, the network camera acquires the device information of the storage device corresponding to the designated UID from the P2P server so as to designate the storage device, and the LAN IP of the storage device, the port corresponding to the LAN IP, the WAN IP of the storage device and the port corresponding to the WAN IP are acquired.

And step S130, the network camera sends a UDP communication data packet to the obtained LAN IP of the storage device. The UDP (User Datagram Protocol) communication packet is a communication packet transmitted through the UDP, and the UDP communication packet is sent to the LAN IP of the storage device to determine whether the network camera and the storage device are in the local area network mode, so as to know whether the network camera can directly transmit information to the LAN IP of the storage device and a port corresponding to the LAN IP, so as to transmit data for storage in the future.

And step S140, when the transmission fails, the network camera relays and transmits a data packet requesting NAT hole punching to the storage device through the P2P server. If the transmission fails, the network camera and the storage device are not in the local area network mode, and the network camera cannot directly transmit information to the LAN IP of the storage device and the port corresponding to the LAN IP. The Network camera sends a packet requesting NAT (Network Address Translation) punching to the P2P server to request the storage device to permit punching and allow information transmission so that the Network camera can directly transmit data to the storage device, and the P2P server forwards the packet requesting NAT punching to the storage device.

And S150, the storage equipment sends a UDP (user Datagram protocol) hole punching signaling to the WAN IP of the network camera according to the received NAT hole punching request data packet, and the network camera sends the UDP hole punching signaling to the WAN IP of the storage equipment. The network camera sends the UDP hole punching signaling to the WAN IP of the storage device so as to punch holes mutually.

Step S160, when the storage device and the network camera both receive the corresponding UDP hole punching signaling, the network camera sends a storage data packet to the WAN IP of the storage device; when the storage device and/or the network camera do not receive the corresponding UDP hole-punching signaling, the network camera relays and sends the storage data packet to the storage device through the P2P server.

And the network camera sends a storage data packet to the WAN IP of the storage device and a port corresponding to the WAN IP so as to transmit the storage data packet of the network camera to the storage device. If one or both of the network cameras do not receive the corresponding UDP hole-punching signaling, the network camera and the WAN IP of the storage device cannot realize bidirectional UDP connection, the NAT mode cannot be realized, relay communication needs to be carried out through a P2P server, the network camera sends a storage data packet to a P2P server, and the P2P server forwards the received storage data packet to the storage device.

And step S170, the storage device stores data according to the received storage data packet.

The invention relates to a data storage method of a network camera, which is applied to a private cloud storage system of the network camera, wherein a storage device and the network camera are communicated through a P2P server, the storage device reports device information to a P2P server, the network camera acquires a LAN IP of the corresponding storage device and a WAN IP of the storage device according to an appointed UID from the P2P server, after the LAN IP of the network camera and the storage device fails to try UDP communication, the network camera requests the storage device to punch a hole by NAT through the P2P server, after the punching succeeds, NAT mode communication is realized, the network camera directly sends a storage data packet to the WAN IP of the storage device to store the data in the storage device, if the hole punching fails, the P2P server is utilized to carry out relay transmission, private cloud storage is realized, and insufficient storage capacity caused by storing the data of the network camera into an SD card is avoided, data do not need to be stored in a public cloud, and data security and privacy are improved.

Referring to fig. 2, fig. 2 is a schematic flowchart illustrating a data storage method of a network camera according to an embodiment of the present invention, where the following step S141 is added to the data storage method of the network camera according to the embodiment of the present invention.

And step S141, when the network camera successfully sends the UDP communication data packet to the obtained LAN IP of the storage device, the network camera sends the storage data packet to the LAN IP of the storage device, and step S170 is executed. If the transmission is successful, the network camera and the storage device are in a local area network mode, and the network camera can directly transmit information to the LAN IP of the storage device and the port corresponding to the LAN IP. And the network camera sends a storage data packet to the LAN IP of the storage device and a port corresponding to the LAN IP for data storage.

Of course, in some embodiments, the step S130 may further include:

the network camera compresses the acquired shooting data, stores the compressed shooting data into an SD card of the network camera, and generates a storage data packet according to the compressed shooting data.

The network camera comprises a machine body and an SD card installed in the machine body, compressed camera data can be temporarily stored in the SD card, and after the storage data packet is successfully sent out, the compressed camera data corresponding to the storage data packet is deleted, so that the capacity of the SD card is sufficient, and the situation that the compressed camera data which is not stored is covered or mistakenly deleted is avoided. Preferably, the video coding format of the compressed camera data is h.264 or h.265, and is stored in an SD card.

Specifically, the storage data packet includes compressed image data and camera identity information, and step S170 specifically is:

the storage equipment acquires corresponding camera identity information according to the received storage data packet, divides a storage area according to the camera identity information, and stores compressed camera shooting data of the storage data packet according to the corresponding storage area.

Specifically, the storage device includes a main control chip and a storage hard disk, the main control chip is connected to the storage hard disk, the main control chip communicates with the P2P server, and the step S170 specifically includes:

the main control chip acquires corresponding camera identity information and compressed camera data according to the received storage data packet, and divides the storage hard disk into a plurality of storage areas according to the camera identity information;

and the main control chip writes the compressed camera shooting data into the storage hard disk according to the corresponding storage area for storage.

In summary, the data storage method of the network camera of the present invention is applied to a private cloud storage system of the network camera, the storage device and the network camera communicate through a P2P server, the storage device reports device information to a P2P server, the network camera obtains a LAN IP of the corresponding storage device and a WAN IP of the storage device according to a specified UID from a P2P server, after the LAN IP of the network camera and the storage device fails to attempt UDP communication, the network camera requests the storage device to punch a hole by NAT through the P2P server, after the hole punching succeeds, NAT mode communication is implemented, a storage data packet is directly sent to the WAN IP of the storage device to store data in the storage device, if the hole punching fails, the P2P server is used for relay transmission to implement private cloud storage, thereby avoiding insufficient storage capacity caused by the data storage of the network camera into an SD card, data do not need to be stored in a public cloud, and data security and privacy are improved.

While the invention has been described with reference to specific embodiments, the invention is not limited thereto, and various equivalent modifications and substitutions can be easily made by those skilled in the art within the technical scope of the invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.

9页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:基于可配置订阅链的异构数据资源调度系统及方法

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!

技术分类