Multi-stream data distribution method and system based on content grading
Technical Field
The application belongs to the technical field of authority management, and particularly relates to a multi-stream data distribution method and system based on content classification.
Background
With the development of internet technology, the mobile internet has come into the lives of people now, and the living habits of people are changed. The access to the internet through a smart phone is popular, people can surf the internet anywhere and anytime, however, the content on the internet is more conveniently browsed.
For example, in a video surveillance system, the content of the surveillance pictures changes in real time. With the change of the screen content, the viewer's request changes. The normal public scene can be completely opened to the ordinary people, but once malignant events such as car accidents, conspiracy, fighting and the like or bloody fishy pictures occur, the minor should be shielded. For another example, some of various online videos, pictures, and contents are not suitable for young people to watch.
In the prior art, generally, a right is set for a user account, and a central management system judges the right of logging in the account and grants a resource which can be used by the user. However, in this technical scheme, the central management system needs to decode the video stream, scramble the video stream according to different user permission levels, and transmit the scrambled video stream. In this case, the performance requirement of the central management system is high, and a single point of failure is likely to occur.
Disclosure of Invention
The application aims to provide a multi-stream data distribution method and system based on content classification, and the problem of centralized authority control in the prior art is solved.
In order to achieve the purpose, the technical scheme of the application is as follows:
a multi-stream data distribution method based on content rating, comprising:
a resource sender generates resource streams corresponding to all authority levels according to preset authority levels, wherein the resource stream corresponding to the lowest authority level in the preset authority levels comprises plaintext content and scrambled content corresponding to the lowest authority level, and the resource streams corresponding to other authority levels comprise respective plaintext content and range information of the plaintext content;
when a resource sender sends resources, the resource sender sends the resource streams corresponding to the authority levels to the multicast addresses associated with the authority levels respectively;
and the resource receiver simultaneously joins the multicast group corresponding to the authority level of the resource receiver and other multicast groups lower than the authority level of the resource receiver according to the authority level of the resource receiver, receives the resource stream from the joined multicast group, decodes the resource stream and merges the video frame content of the same time slice according to the time stamp.
Further, the last bit of the multicast address is associated with the preset permission level.
Further, the content-ranking-based multi-stream data distribution method further includes:
and the resource receiver sends request stop information which carries the authority level value of the resource receiver, and the media proxy switch connected with the resource receiver quits the multicast group corresponding to the authority level of the resource receiver and other multicast groups lower than the authority level of the resource receiver after receiving the request stop information.
Further, the content-ranking-based multi-stream data distribution method further includes:
and the resource receiver sends request stop information which carries the authority level value of the resource receiver, and after the media proxy switch connected with the resource receiver receives the request stop information, the media proxy switch quits the multicast group corresponding to the authority level of the resource receiver and other multicast groups except the lowest authority level lower than the authority level of the resource receiver.
Further, the content-ranking-based multi-stream data distribution method further includes:
and the resource receiver sends request stopping information which carries the authority level value of the resource receiver, and after the media proxy switch connected with the resource receiver receives the request stopping information, if the request of the resource receiver is not received in a preset time period, the multicast group corresponding to the authority level of the resource receiver and other multicast groups with the authority level lower than that of the resource receiver exit.
The present application further provides a multi-stream data distribution system based on content rating, where the multi-stream data distribution system based on content rating includes a resource sender and a resource receiver, where:
a resource sender generates resource streams corresponding to all authority levels according to preset authority levels, wherein the resource stream corresponding to the lowest authority level in the preset authority levels comprises plaintext content and scrambled content corresponding to the lowest authority level, and the resource streams corresponding to other authority levels comprise respective plaintext content and range information of the plaintext content;
when a resource sender sends resources, the resource sender sends the resource streams corresponding to the authority levels to the multicast addresses associated with the authority levels respectively;
and the resource receiver simultaneously joins the multicast group corresponding to the authority level of the resource receiver and other multicast groups lower than the authority level of the resource receiver according to the authority level of the resource receiver, receives the resource stream from the joined multicast group, decodes the resource stream and merges the video frame content of the same time slice according to the time stamp.
Further, the last bit of the multicast address is associated with the preset permission level.
Further, the content-hierarchy-based multi-stream data distribution system further includes a media broker switch connected to the resource receiver, wherein:
and the resource receiver sends request stop information which carries the authority level value of the resource receiver, and the media proxy switch connected with the resource receiver quits the multicast group corresponding to the authority level of the resource receiver and other multicast groups lower than the authority level of the resource receiver after receiving the request stop information.
Further, the content-hierarchy-based multi-stream data distribution system further includes a media broker switch connected to the resource receiver, wherein:
and the resource receiver sends request stop information which carries the authority level value of the resource receiver, and after the media proxy switch connected with the resource receiver receives the request stop information, the media proxy switch quits the multicast group corresponding to the authority level of the resource receiver and other multicast groups except the lowest authority level lower than the authority level of the resource receiver.
Further, the content-hierarchy-based multi-stream data distribution system further includes a media broker switch connected to the resource receiver, wherein:
and the resource receiver sends request stopping information which carries the authority level value of the resource receiver, and after the media proxy switch connected with the resource receiver receives the request stopping information, if the request of the resource receiver is not received in a preset time period, the multicast group corresponding to the authority level of the resource receiver and other multicast groups with the authority level lower than that of the resource receiver exit.
According to the multi-stream data distribution method and system based on content grading, a resource sender (camera) generates resource streams corresponding to all authority levels according to preset authority levels, the resource sender sends the resource streams corresponding to all authority levels to multicast addresses associated with the authority levels when sending resources, and a resource receiver simultaneously joins multicast groups corresponding to the authority levels and other multicast groups lower than the authority levels and receives the resource streams from the joined multicast groups according to the authority levels. According to the method and the device, the edge autonomy is realized, the real-time intervention of a video management server is not needed, the edge autonomy is realized, and the response instantaneity is improved.
Drawings
FIG. 1 is a flow chart of a multi-stream data distribution method based on content rating according to the present invention;
fig. 2 is a schematic diagram of a network structure according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.
In one embodiment, as shown in fig. 1, there is provided a multi-stream data distribution method based on content rating, including:
a resource sender generates resource streams corresponding to all authority levels according to preset authority levels, wherein the resource stream corresponding to the lowest authority level in the preset authority levels comprises plaintext content and scrambled content corresponding to the lowest authority level, and the resource streams corresponding to other authority levels comprise respective plaintext content and range information of the plaintext content;
when a resource sender sends resources, the resource sender sends the resource streams corresponding to the authority levels to the multicast addresses associated with the authority levels respectively;
and the resource receiver simultaneously joins the multicast group corresponding to the authority level of the resource receiver and other multicast groups lower than the authority level of the resource receiver according to the authority level of the resource receiver, receives the resource stream from the joined multicast group, decodes the resource stream and merges the video frame content of the same time slice according to the time stamp.
Taking the video monitoring system shown in fig. 2 as an example, the resource sender may be a front-end device or a media server, and the present application is described by taking a camera in the front-end device as an example; the resource receiver is usually a user client that requests a monitoring live or monitoring video, and the following description will take the client as an example. The client is directly connected with the media proxy switch and is accessed into the video monitoring system network through the routing gateway.
In a video monitoring system, a client requests a video stream of a camera, and the video stream transmission from the camera to the client needs to involve various management servers, various forwarded network devices, and the like, such as a video management server, a media proxy switch connecting the client, and the like. As the connection establishment and forwarding of video streams in the video monitoring system are already mature technologies, the detailed description is omitted in the present application.
According to the method and the device, the resource sender grades the resources according to the preset authority level. Specifically, for example, the authority level of the user is divided into 5 levels, which are respectively the first level to the fifth level, where the first level is the lowest authority level and the fifth level is the highest authority level. The resource content, i.e., the video content, is ranked according to the user authority level, and the authority level of the user will be described below. When the authority level of the user is high, more comprehensive resource content can be checked, and when the authority level of the user is low, only less resource content can be checked, so that the user with the low authority level can be ensured not to check limited content.
The resource sender generates resource streams corresponding to the authority levels, wherein the resource stream corresponding to the lowest authority level in the preset authority levels comprises plaintext content and scrambled content corresponding to the lowest authority level, and the resource streams corresponding to other authority levels comprise respective plaintext content and range information of the plaintext content.
For example, the authority level of the user is divided into 5 levels, which are respectively the first level to the fifth level, and then the plaintext of the resource content corresponding to the first level (for example, a rectangular area a at the center of the image) and the scrambled other resource content (other areas around the rectangular area a) are carried in the first-level video stream (also referred to as elementary stream); carrying resource content plaintext corresponding to the second level in the second-level video stream (for example, a rectangular area b at the center of the image, the range of the rectangular area b being larger than that of the rectangular area a), and range information of the rectangular area b (which can be expressed by coordinates of two vertexes of a diagonal line of the rectangular area b); the third through fifth stages are similar to the second stage and will not be described in detail herein. The method is not limited to a specific division method, and division can be performed according to specific contents of video images, for example, in video monitoring at a garage entrance, the level of an area corresponding to a license plate is lowest, the level of an image of a person at a cab position is highest, the plaintext range in the lowest-level video stream is a license plate area, and the cab area is a scrambling area.
When sending resources, a resource sender sends the resource streams corresponding to the authority levels to multicast addresses associated with the authority levels respectively. That is, each authority level corresponds to a multicast address. In a specific embodiment, the multicast address corresponding to each authority level may be set artificially, and a corresponding association list may be established. When the video camera sends the video stream, 5 levels of video streams are sent at the same time, and the resource stream at the lowest authority level comprises the plaintext content and the scrambled content allowed by the lowest authority level; a high-level resource stream contains only the plaintext content and range information for that level, e.g., the diagonal 2-vertex coordinates of a rectangular region.
Preferably, the last byte of the multicast address is used for associating with the authority level, the first three bytes of the multicast address represent video source information, and the last byte is used for representing the authority level.
For example, the client requests the management server for the video of camera a, and the multicast information of the camera is 238.1.1 (only the first three bytes); the management server tells the corresponding multicast address according to the client account authority, the last byte is the same as the authority value, for example, if the authority is 3, the multicast address is 238.1.1.3; the client sends the multicast address, the media proxy switch connected with the client records the multicast address on the device port connected with the client, simultaneously records the multicast group addresses corresponding to the low authority, namely 238.1.1.1 and 238.1.1.2, and then sends all the joining of the multicast groups to the routing gateway. After receiving each multicast stream, the media agent exchanger forwards the multicast streams to the client; the client decodes the multicast streams respectively and automatically merges the video frame contents of the same time slice according to the time stamp, and because the plaintext contents of the multicast streams corresponding to each authority contain range coordinate information, the plaintext can be superimposed on the scrambling area of the basic stream conveniently; the content of the high-level stream is blank except for the plain text.
According to the multi-stream data distribution method based on content classification, a client connected to a media agent switch in a downstream mode stops on demand and sends information of stopping on demand, namely IGMP leaving messages about a multicast group 238.1.1.3, after the media agent switch receives the leaving messages, forwarding of all multicast group video streams about 238.1.1.1 to 238.1.1.3 is stopped, all multicast group leaving messages about 238.1.1.1 to 238.1.1.3 are sent to a routing gateway, and all multicast groups from 238.1.1.1 to 238.1.1.3 exit.
For the client to exit the multicast group, the application also has some embodiments as follows:
embodiment 1, the method for distributing multi-stream data based on content rating according to the present application, further includes:
and the resource receiver sends request stop information which carries the authority level value of the resource receiver, and the media proxy switch connected with the resource receiver quits the multicast group corresponding to the authority level of the resource receiver and other multicast groups lower than the authority level of the resource receiver after receiving the request stop information.
That is, when the client no longer requests the multicast stream and sends the multicast address 238.1.1.3, the media proxy switch deletes the registered address (238.1.1.1-238.1.1.3), and sends the IGMP leave message of the multicast group address to the routing gateway, and exits all multicast groups 238.1.1.1-238.1.1.3.
Embodiment 2, the method for distributing multi-stream data based on content rating according to the present application further includes: and the resource receiver sends request stop information which carries the authority level value of the resource receiver, and after the media proxy switch connected with the resource receiver receives the request stop information, the media proxy switch quits the multicast group corresponding to the authority level of the resource receiver and other multicast groups except the lowest authority level lower than the authority level of the resource receiver.
In this embodiment, the client sends the leave message, but the media proxy switch only sends the IGMP leave message for the high-level streams 238.1.1.2-238.1.1.3, and the reception of the base stream is retained. Therefore, when a follow-up on-demand exists, the basic stream can immediately respond and forward, the high-level stream requests according to the demand, and the client receives the high-level video stream after a little delay. The advantage of this design is that the client can see the basic information quickly.
Embodiment 3, the method for distributing multi-stream data based on content rating according to the present application further includes: and the resource receiver sends request stopping information which carries the authority level value of the resource receiver, and after the media proxy switch connected with the resource receiver receives the request stopping information, if the request of the resource receiver is not received in a preset time period, the multicast group corresponding to the authority level of the resource receiver and other multicast groups with the authority level lower than that of the resource receiver exit.
When the client no longer requests the multicast stream, the media proxy switch connected to the client sends 238.1.1.3 the multicast address, instead of immediately sending IGMP leave messages for all multicast groups 238.1.1.1 to 238.1.1.3 to the routing gateway, the media proxy switch continues to receive the video stream for a while, for example, for 5 minutes, if no IGMP join message for the client is received within 5 minutes, the media proxy switch sends all multicast group leave messages for 238.1.1.1 to 238.1.1.3 to the routing gateway, so that the client can quickly respond and forward the video stream when requesting again.
Embodiment 4, when the client requests the video stream, the media proxy switch receives the request, proxies the request basic stream, for example 238.1.1.1, and if there is no leaving message of the client after a period of time, for example 1 minute, proxies the high-level video stream, otherwise does not request the high-level video stream. The benefit of this design is that if the customer is simply a fast-browsing on-demand, the approximate information is essentially visible through the elementary stream, thereby greatly reducing network bandwidth pressure.
In an embodiment, the present application further provides a content-ranking-based multi-stream data distribution system, which includes a resource sender and a resource receiver, where:
a resource sender generates resource streams corresponding to all authority levels according to preset authority levels, wherein the resource stream corresponding to the lowest authority level in the preset authority levels comprises plaintext content and scrambled content corresponding to the lowest authority level, and the resource streams corresponding to other authority levels comprise respective plaintext content and range information of the plaintext content;
when a resource sender sends resources, the resource sender sends the resource streams corresponding to the authority levels to the multicast addresses associated with the authority levels respectively;
and the resource receiver simultaneously joins the multicast group corresponding to the authority level of the resource receiver and other multicast groups lower than the authority level of the resource receiver according to the authority level of the resource receiver, receives the resource stream from the joined multicast group, decodes the resource stream and merges the video frame content of the same time slice according to the time stamp.
For specific limitations of the content-hierarchy-based multi-stream data distribution system, reference may be made to the above limitations of the content-hierarchy-based multi-stream data distribution method, which is not described herein again.
In one embodiment, the last bit of the multicast address is associated with the preset permission level.
In another embodiment, the content-ratings-based multi-stream data distribution system further comprises a media broker switch connected to the resource recipient, wherein:
and the resource receiver sends request stop information which carries the authority level value of the resource receiver, and the media proxy switch connected with the resource receiver quits the multicast group corresponding to the authority level of the resource receiver and other multicast groups lower than the authority level of the resource receiver after receiving the request stop information.
In another embodiment, the content-ratings-based multi-stream data distribution system further comprises a media broker switch connected to the resource recipient, wherein:
and the resource receiver sends request stop information which carries the authority level value of the resource receiver, and after the media proxy switch connected with the resource receiver receives the request stop information, the media proxy switch quits the multicast group corresponding to the authority level of the resource receiver and other multicast groups except the lowest authority level lower than the authority level of the resource receiver.
In another embodiment, the content-ratings-based multi-stream data distribution system further comprises a media broker switch connected to the resource recipient, wherein:
and the resource receiver sends request stopping information which carries the authority level value of the resource receiver, and after the media proxy switch connected with the resource receiver receives the request stopping information, if the request of the resource receiver is not received in a preset time period, the multicast group corresponding to the authority level of the resource receiver and other multicast groups with the authority level lower than that of the resource receiver exit.
The above-mentioned embodiments only express several embodiments of the present application, and the description thereof is more specific and detailed, but not construed as limiting the scope of the invention. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the concept of the present application, which falls within the scope of protection of the present application. Therefore, the protection scope of the present patent shall be subject to the appended claims.