Disclosure of Invention
Aiming at the defects of the prior art, the invention solves the technical problem of how to realize the storage and the forwarding of mass video data and the efficient management of mass video monitoring service.
In order to solve the technical problems, the technical scheme provided by the invention is a method for publishing and subscribing massive mobile cloud video monitoring services based on a P2P technology, which comprises the following steps:
(1) the IP Camera video monitoring service publishing terminal publishes a video monitoring service, the operation process comprises the steps that the IP Camera collects real-time videos and sends real-time video data to a cloud architecture streaming media service platform to generate advertisements of the video monitoring service, indexes of the advertisements are generated through a shared resource distributed index algorithm, and indexes of the advertisements of the video monitoring service are published to an event proxy server;
preferably, the operational procedure is as follows:
1) and the IP Camera video monitoring service issuing end logs in the cloud architecture streaming media service platform to obtain a Token returned by the streaming media service platform, and the Token is used for verifying the video data uploading authority.
2) And the IP Camera video monitoring service publisher joins the peer-to-peer group created by the event proxy server.
3) The IP Camera video monitoring service issuing end collects original real-time video, and carries out H.264 coding compression on the collected original video data, so that the volume of the video data is reduced to reduce the network bandwidth occupation.
4) The IP Camera video monitoring service issuing end carries out uploading authority verification through the Token obtained by the process 1), and after the verification is passed, the video data after the coding compression is uploaded to the cloud architecture streaming media service platform.
5) The IP Camera video monitoring service issuing end generates a video monitoring service advertisement (XML document) according to the monitoring position, resolution, frame rate, code stream of the video monitoring service, RTSP address of the video monitoring service and other self attributes.
6) The IP Camera video monitoring service publisher generates the index of the advertisement in the flow 5) by a shared resource distributed index algorithm.
7) The IP Camera video monitoring service publishing terminal publishes the video monitoring service advertisement index generated in the flow 6) to the event proxy server.
(2) The cloud architecture streaming media service platform forwards and stores video data, and the operation process comprises the steps that the cloud architecture streaming media service platform receives real-time video data acquired from an IP Camera, stores the video data in a cloud, can respond to a request of a video monitoring service subscription end, and forwards the video monitoring data to the required video monitoring service subscription end;
preferably, the operational procedure is as follows:
1) and the cloud architecture streaming media service platform carries out authority verification on the IP Camera video monitoring service publishing terminal and the video monitoring service subscribing terminal.
2) The cloud architecture streaming media service platform receives the real-time video data from the IP Camera, and stores and forwards the real-time video data.
3) The cloud-architecture streaming media service platform responds to the request of the video monitoring service subscriber and forwards the specified video monitoring data to the required subscriber.
(3) The video monitoring service subscription end subscribes a video monitoring service, the operation flow comprises that the subscription end provides a subscription request to an event proxy server, obtains advertisements of the video monitoring service from a service publishing end according to the video monitoring service advertisements obtained from the event proxy server, analyzes the advertisements to obtain addresses of the video monitoring service, and obtains video monitoring data from a cloud architecture streaming media service platform according to the addresses.
Preferably, the operational procedure is as follows:
1) and the video monitoring service subscriber logs in the streaming media service platform and acquires a Token returned by the streaming media service platform.
2) The video monitoring service subscriber terminal joins the peer-to-peer group constructed by the event proxy server.
3) The video monitoring service subscriber end uses attributes of the video monitoring service such as monitoring position, resolution ratio and the like as search conditions, and provides a subscription request to the event proxy server.
4) And the video monitoring service subscriber receives the video monitoring service advertisement index returned from the event proxy server and acquires the service advertisement from the IP Camera video monitoring service publisher according to the index.
5) The video monitoring service subscriber analyzes the service advertisement obtained in the process 4) to obtain the address of the video monitoring service, the authority verification is carried out through the Token obtained in the process 1), and if the authority verification is passed, video monitoring data are requested to the streaming media service platform according to the video monitoring service address analyzed by the service advertisement. And the video monitoring service address analyzed by the advertisement requests video monitoring data from the streaming media service platform.
(4) The event proxy server manages the video monitoring service, and the operation flow comprises the steps that the event proxy server creates a peer group, waits for the addition of an IP Camera video monitoring service publisher and a video monitoring service subscriber, and constructs a P2P network. Then, the event proxy server stores the video monitoring service advertisement index published by the IP Camera and matches the video monitoring service subscription request provided by the video monitoring service subscriber.
Preferably, the operational procedure is as follows:
1) the event proxy server creates a peer group, waits for an IP Camera video monitoring service publisher and a video monitoring service subscriber to join the peer group, and constructs a P2P network.
2) The event proxy server stores the video surveillance service advertisement index published by the IP Camera video surveillance service publisher.
3) And the event proxy server matches the subscription request provided by the video monitoring service subscriber, and returns the service advertisement index to the subscriber if the video monitoring service advertisement index meeting the subscription request locally exists in the event proxy server. If the event proxy server cannot find the video monitoring service advertisement index meeting the subscription request locally, the subscription request of the subscriber end is forwarded to other event proxy servers in the P2P network, and the subscription request is matched by the other event proxy servers.
By adopting the technical scheme of the invention, the following beneficial effects can be achieved:
1. the method and the system realize the high-efficiency management of the massive video monitoring services, and can dynamically increase the number of event proxy servers along with the increase of the number of the video monitoring services.
2. The streaming media service platform of the cloud architecture realizes storage and forwarding of mass video data.
3. By adopting the mobile cloud computing technology, a user can access the video monitoring service of the cloud terminal through the Android mobile device at any time and any place.
Detailed Description
Fig. 1 shows that a P2P-based massive mobile cloud video monitoring service publishing and subscribing system architecture comprises:
(1) IP Camera video monitoring service distributor: the video monitoring service provider mainly collects, codes and uploads real-time video data and issues an index of the video monitoring service advertisement provided by the provider to the event proxy server.
(2) The video monitoring service subscriber: the video monitoring service subscriber mainly subscribes the video monitoring service advertisement, obtains the service advertisement from an IP Camera video monitoring service publishing terminal through an advertisement index returned by the event proxy server, and requests the video monitoring data from the cloud architecture streaming media service platform according to the address analyzed by the video monitoring service advertisement.
(3) The cloud architecture streaming media service platform comprises: the video monitoring server is a relay of video monitoring server data and is mainly responsible for storing and forwarding massive video data.
(4) The event proxy server: the method is the core of the whole system and is mainly responsible for creating peer-to-peer groups, constructing a P2P network and matching subscription requests of video monitoring service subscribers.
Fig. 2 shows a P2P network architecture constructed by the event broker service, the P2P network adopts a star structure, and all peers (IP Camera video monitoring service publisher and video monitoring service subscriber) in the peer group are connected with the event broker server. And the IP Camera video monitoring service publishing terminal publishes the index of the video monitoring service advertisement to the event proxy server. The video monitoring service subscription end initiates a subscription request to the event proxy server, after the subscription request is replied, the video monitoring service advertisement is obtained according to the connection between the obtained video monitoring service advertisement index and the corresponding publishing end, and the advertisement can be directly obtained between two peer-to-peer points without passing through the event proxy server.
Fig. 3 shows an interaction principle of video surveillance service publishing and subscribing, which is a core part of the system and includes:
video Surveillance Service Producer (Video Surveillance Service Producer): also called as video monitoring service publisher, is responsible for publishing video monitoring service to an event agent, and is a main behavior entity in the publishing and subscribing interactive mode.
Video Surveillance Service Consumer (Video Surveillance Service Consumer): also called video surveillance service subscribers, describe their interests to the event broker. The event broker reliably transmits the matched video surveillance service to the subscribers in an "ad" fashion.
Event (Event): in the publish and subscribe interaction mode, any information transfer and system state change can be referred to as an event, for example, a video monitoring service producer publishes an advertisement of a video monitoring service in a system can be referred to as an event.
Event Broker (Event Broker): which may also be referred to as an Event notification service (Event NotificationService). The event broker associates the video surveillance producer with the video surveillance consumer, and is responsible for storing the video surveillance service (advertisement of the service), performing matching between the video surveillance service and the subscription request, and also being able to deliver non-matching subscription requests to other event brokers. The video monitoring service producer and the video monitoring service consumer do not depend on the event agent in space and time, and absolute connection does not exist between the video monitoring service producer and the video monitoring service consumer.
The producer of the video surveillance service and the consumer of the video surveillance service are associated through an intermediate event broker. A producer of the video monitoring service publishes the video monitoring service owned by the producer to an event agent in a service advertisement mode, and the event agent stores the advertisement of the service in a local cache. The consumer of the video monitoring service provides a subscription request to the event agent, the event agent inquires the video monitoring service advertisement in the local cache, and returns the video monitoring service advertisement according with the request to the consumer of the video monitoring service. If the corresponding advertisement is not found in the event agent local cache, the subscription request is forwarded to other event agents in the P2P network, the request is spread to the whole network until a video monitoring service conforming to the subscription request is found, or a match failure is returned to the consumer.
After obtaining the required video monitoring service advertisement, the consumer of the video monitoring service analyzes the RTSP address of the video monitoring, requests the video stream of the corresponding video monitoring from the streaming media server through the RTSP address, and watches the video monitoring through the operations of RTP decapsulation, decoding and the like after obtaining the video stream.
Fig. 4 shows a process of the present invention, and a method for publishing and subscribing a massive mobile cloud video monitoring service based on a P2P technology includes the following steps:
(1) the IP Camera video monitoring service publishing terminal publishes a video monitoring service, the operation process comprises the steps that the IP Camera collects real-time videos and sends real-time video data to a cloud architecture streaming media service platform to generate advertisements of the video monitoring service, indexes of the advertisements are generated through a shared resource distributed index algorithm, and indexes of the advertisements of the video monitoring service are published to an event proxy server;
preferably, the operational procedure is as follows:
1) and the IP Camera video monitoring service issuing end logs in the cloud architecture streaming media service platform to obtain a Token returned by the streaming media service platform, and the Token is used for verifying the video data uploading authority.
2) And the IP Camera video monitoring service publisher joins the peer-to-peer group created by the event proxy server.
3) The IP Camera video monitoring service issuing end collects original real-time video, and carries out H.264 coding compression on the collected original video data, so that the volume of the video data is reduced to reduce the network bandwidth occupation.
4) The IP Camera video monitoring service issuing end carries out uploading authority verification through the Token obtained by the process 1), and after the verification is passed, the video data after the coding compression is uploaded to the cloud architecture streaming media service platform.
5) The IP Camera video monitoring service issuing end generates a video monitoring service advertisement (XML document) according to the monitoring position, resolution, frame rate, code stream of the video monitoring service, RTSP address of the video monitoring service and other self attributes.
6) The IP Camera video monitoring service publisher generates the index of the advertisement in the flow 5) by a shared resource distributed index algorithm.
7) The IP Camera video monitoring service publishing terminal publishes the video monitoring service advertisement index generated in the flow 6) to the event proxy server.
(2) The cloud architecture streaming media service platform forwards and stores video data, and the operation process comprises the steps that the cloud architecture streaming media service platform receives real-time video data acquired from an IP Camera, stores the video data in a cloud, can respond to a request of a video monitoring service subscription end, and forwards the video monitoring data to the required video monitoring service subscription end;
preferably, the operational procedure is as follows:
1) and the cloud architecture streaming media service platform carries out authority verification on the IP Camera video monitoring service publishing terminal and the video monitoring service subscribing terminal.
2) The cloud architecture streaming media service platform receives the real-time video data from the IP Camera, and stores and forwards the real-time video data.
3) The cloud-architecture streaming media service platform responds to the request of the video monitoring service subscriber and forwards the specified video monitoring data to the required subscriber.
(3) The video monitoring service subscription end subscribes a video monitoring service, the operation flow comprises that the subscription end provides a subscription request to an event proxy server, obtains advertisements of the video monitoring service from a service publishing end according to the video monitoring service advertisements obtained from the event proxy server, analyzes the advertisements to obtain addresses of the video monitoring service, and obtains video monitoring data from a cloud architecture streaming media service platform according to the addresses.
Preferably, the operational procedure is as follows:
1) and the video monitoring service subscriber logs in the streaming media service platform and acquires a Token returned by the streaming media service platform.
2) The video monitoring service subscriber terminal joins the peer-to-peer group constructed by the event proxy server.
3) The video monitoring service subscriber end uses attributes of the video monitoring service such as monitoring position, resolution ratio and the like as search conditions, and provides a subscription request to the event proxy server.
4) And the video monitoring service subscriber receives the video monitoring service advertisement index returned from the event proxy server and acquires the service advertisement from the IP Camera video monitoring service publisher according to the index.
5) The video monitoring service subscriber analyzes the service advertisement obtained in the process 4) to obtain the address of the video monitoring service, the authority verification is carried out through the Token obtained in the process 1), and if the authority verification is passed, video monitoring data are requested to the streaming media service platform according to the video monitoring service address analyzed by the service advertisement. And the video monitoring service address analyzed by the advertisement requests video monitoring data from the streaming media service platform.
(4) The event proxy server manages the video monitoring service, and the operation flow comprises the steps that the event proxy server creates a peer group, waits for the addition of an IP Camera video monitoring service publisher and a video monitoring service subscriber, and constructs a P2P network. Then, the event proxy server stores the video monitoring service advertisement index published by the IP Camera and matches the video monitoring service subscription request provided by the video monitoring service subscriber.
Preferably, the operational procedure is as follows:
1) the event proxy server creates a peer group, waits for an IP Camera video monitoring service publisher and a video monitoring service subscriber to join the peer group, and constructs a P2P network.
2) The event proxy server stores the video surveillance service advertisement index published by the IP Camera video surveillance service publisher.
3) And the event proxy server matches the subscription request provided by the video monitoring service subscriber, and returns the service advertisement index to the subscriber if the video monitoring service advertisement index meeting the subscription request locally exists in the event proxy server. If the event proxy server cannot find the video monitoring service advertisement index meeting the subscription request locally, the subscription request of the subscriber end is forwarded to other event proxy servers in the P2P network, and the subscription request is matched by the other event proxy servers.
By adopting the technical scheme of the invention, the storage and forwarding of the mass video data and the high-efficiency management of the mass video high-efficiency monitoring service are realized.
The technical solutions of the present invention have been described in detail with reference to the accompanying drawings, but the present invention is not limited to the described embodiments. It will be apparent to those skilled in the art that various changes, modifications, substitutions and alterations can be made in these embodiments without departing from the principles and spirit of the invention, and these embodiments are within the scope of the invention.