Detailed Description
In order to provide an implementation scheme for monitoring the validity of an advertisement data stream, the embodiment of the present invention provides an advertisement data stream sending method, a related server and a system. And the embodiments and features of the embodiments in the present application may be combined with each other without conflict.
An embodiment of the present invention provides a method for sending an advertisement data stream, where an execution subject of the method is a packaging server, and as shown in fig. 1, the method may specifically include the following steps:
s101, generating an advertisement data stream based on the original advertisement file.
And S102, transmitting the original advertisement file and the advertisement data stream.
The specific implementation of step S101 is prior art, and the packaging server may package the original advertisement file based on DSM-OC protocol, and generate an OC (Object Carousel) data stream, that is, the advertisement data stream. The generated OC data stream can bear various types of data such as texts, pictures, audios, videos and the like, and is suitable for serving as a broadcasting mode of advertisement information with various forms.
Correspondingly, an embodiment of the present invention further provides an advertisement data stream sending method, where an execution subject of the method may be a newly added monitoring server, as shown in fig. 2, and the method specifically includes the following steps:
s201, analyzing the advertisement data stream sent by the packaging server to obtain the specified advertisement file.
S202, comparing whether the content of the specified advertisement file is the same as that of the original advertisement file sent by the packaging server, and determining whether to send the advertisement data stream to the client according to the comparison result.
The monitoring server receives an original advertisement file and an advertisement data stream sent by the packaging server, determines whether the advertisement data stream is legal according to whether the content of a specified advertisement file obtained by analyzing the advertisement data stream is the same as that of the original advertisement file, and further determines whether the advertisement data stream is sent to a client.
The specific implementation of parsing the advertisement data stream in step S201 is the prior art, and the same as the specific implementation of parsing the advertisement data stream by a client such as an existing network set top box, specifically may include: analyzing PSI Information (Program Specific Information) in the advertisement data stream, and judging the data type of the advertisement data stream; when the data type of the advertisement data stream is an OC data stream, parsing DII Information (download instruction Information) in the advertisement data stream to obtain a data module of the advertisement data stream; and analyzing a DDB (Distributed Database) in the data module, wherein the extracted advertisement file is the specified advertisement file.
Specifically, when the PSI information in the advertisement data stream is analyzed and the data type of the advertisement data stream is determined, if the data type of the advertisement data stream is not OC data, the specified advertisement file cannot be extracted, and the client finally cannot receive the advertisement data stream with the advertisement file for parsing and playing.
Further, in step S202, comparing whether the content of the specified advertisement file is the same as the content of the original advertisement file sent by the packaging server, since any type of advertisement file is stored in a binary form, it can be determined whether the content is the same for any type of advertisement file by comparing binary data.
Preferably, in the step S202, comparing whether the content of the specified advertisement file is the same as the content of the original advertisement file sent by the packaging server may specifically include:
when the appointed advertisement file is a text file, determining whether the contents of the original advertisement file and the appointed advertisement file are the same according to whether the binary data of the appointed advertisement file and the binary data of the original advertisement file are the same;
when the specified advertisement file is a picture file or an audio/video file, determining whether the contents of the original advertisement file and the specified advertisement file are the same according to whether the MD5 values (Message Digest Algorithm 5, fifth version) of the specified advertisement file and the original advertisement file are the same; due to the fact that the data volume of the picture file and the audio and video file is large, the method for monitoring the MD5 value can be used for rapidly comparing the file content, and therefore the problem that the binary data comparison efficiency is low is solved.
In actual implementation, before comparison, the specified advertisement file can be matched with the original advertisement file through the file name, and then the specified advertisement file is divided into a text file, a picture file, an audio-video file and the like according to the file type.
Further, in step S202, determining whether to send the advertisement data stream to the client according to the comparison result may specifically include: when the content of the specified advertisement file is the same as that of the original advertisement file sent by the packaging server, the advertisement data stream is legal, and the advertisement data stream is determined to be sent to a client; when the contents of the specified advertisement file are different from the contents of the original advertisement file sent by the packaging server, the advertisement data stream is illegal and possibly tampered, and the advertisement data stream is determined not to be sent to the client.
The method, the related server and the system provided by the embodiments of the present invention are described in detail with reference to the accompanying drawings.
Fig. 3 is a detailed flowchart of a method for transmitting an advertisement data stream according to an embodiment of the present invention, which specifically includes the following steps:
s301, the packaging server generates an advertisement data stream based on the original advertisement file.
The packaging server can package original advertisement files of various data types such as text, pictures, audio and video, etc. into OC data stream, that is, the above advertisement data stream.
S302, the packaging server sends the original advertisement file and the advertisement data stream to the monitoring server.
S303, the monitoring server analyzes the advertisement data stream sent by the packaging server to obtain the specified advertisement file.
In practical implementation, a delay unit, an analysis unit and a comparison unit can be arranged in the monitoring server, wherein the delay unit receives the advertisement data stream sent by the packaging server and performs buffering delay; the analysis unit receives the advertisement data stream sent by the packaging server, and analyzes the advertisement data stream to obtain the advertisement file, namely the specified advertisement file.
S304, the monitoring server compares and judges whether the contents of the specified advertisement file and the original advertisement file sent by the packaging server are the same.
When the monitoring server determines that the content of the specified advertisement file is the same as the content of the original advertisement file sent by the packaging server, the step S305 is entered; when the monitoring server determines that the contents of the specified advertisement file and the original advertisement file sent by the packaging server are not the same, the flow proceeds to step S306.
In practical implementation, the specified advertisement file obtained by analyzing the advertisement data stream by the analyzing unit can be sent to the comparing unit, and the comparing unit receives the specified advertisement file and the original advertisement file sent by the packaging server for content comparison.
Specifically, the specified advertisement file can be matched with the original advertisement file through the file name, then the specified advertisement file is divided into a text file, a picture file, an audio-video file and the like according to the file type, and different methods are adopted for comparison according to different file types.
For example, after matching between the specified advertisement file and the original advertisement file is completed, whether the specified advertisement file is a text file is judged, if so, binary data of the matched original advertisement file and the specified advertisement file are checked and compared, and the content of the original advertisement file and the specified advertisement file is compared; if the advertisement file is not a text file, continuously judging whether the specified advertisement file is a picture file, if so, calculating and comparing MD5 values of the matched original advertisement file and the specified advertisement file, and finishing comparison of the contents of the original advertisement file and the specified advertisement file; if the advertisement file is not the picture file, whether the specified advertisement file is the audio and video file is continuously judged, if the specified advertisement file is the audio and video file, the MD5 values of the matched original advertisement file and the specified advertisement file are calculated and compared, and the comparison of the contents of the original advertisement file and the specified advertisement file is completed.
S305, the monitoring server sends the advertisement data stream to the client, and the process proceeds to step 307.
In practical implementation, when it is determined that the specified advertisement file is the same as the original advertisement file content sent by the packaging server, the comparison unit sends an instruction to the delay unit to send the advertisement data stream to the client, and the delay unit sends the advertisement data stream to the client.
S306, the monitoring server does not send the advertisement data stream to the client, and the process is ended.
In practical implementation, when the comparison unit determines that the contents of the specified advertisement file are different from the contents of the original advertisement file sent by the packaging server, the comparison unit sends an instruction of not sending the advertisement data stream to the client to the delay unit, and the delay unit does not send the advertisement data stream to the client.
S307, the client analyzes the advertisement data stream sent by the monitoring server to obtain an advertisement file to play.
In practical implementation, the client receives the advertisement data stream sent by the delay unit, and analyzes the advertisement data stream to obtain a corresponding advertisement file for playing.
Based on the same inventive concept, according to the advertisement data stream sending method provided by the above embodiment of the present invention, correspondingly, the embodiment of the present invention further provides a packaging server, a monitoring server and a system.
An embodiment of the present invention provides a packaging server, a schematic structural diagram of which is shown in fig. 4, and specifically includes the following units:
a generating unit 401, configured to generate an advertisement data stream based on an original advertisement file;
a sending unit 402, configured to send the original advertisement file and the advertisement data stream.
An embodiment of the present invention provides a monitoring server, a schematic structural diagram of which is shown in fig. 5, and specifically includes the following units:
the parsing unit 501 is configured to parse the advertisement data stream sent by the packaging server to obtain an appointed advertisement file;
a comparing unit 502, configured to compare whether the content of the specified advertisement file is the same as the content of the original advertisement file sent by the packaging server, and determine whether to send the advertisement data stream to the client according to a comparison result.
Further, the comparing unit 502 may be specifically configured to, when the specified advertisement file is a text file, determine whether the contents of the original advertisement file and the specified advertisement file are the same according to whether binary data of the specified advertisement file and the original advertisement file are the same; when the appointed advertisement file is a picture file, determining whether the contents of the original advertisement file and the appointed advertisement file are the same according to whether the MD5 values of the appointed advertisement file and the original advertisement file are the same; and when the specified advertisement file is an audio-video file, determining whether the contents of the original advertisement file and the specified advertisement file are the same according to whether the MD5 values of the specified advertisement file and the original advertisement file are the same.
Further, the comparing unit 502 may be further configured to determine to send the advertisement data stream to the client when the content of the specified advertisement file is the same as the content of the original advertisement file sent by the packaging server; and when the content of the specified advertisement file is different from the content of the original advertisement file sent by the packaging server, determining not to send the advertisement data stream to the client.
In practical implementation, the monitoring server may include, as shown in fig. 6, a delay unit 503, in addition to the parsing unit 501 and the comparing unit 502, where the delay unit receives the advertisement data stream sent by the packaging server to perform buffering delay; when the comparison unit 502 determines to send the advertisement data stream to the client, the comparison unit 502 instructs the delay unit to send the cached advertisement data stream to the client; when the comparison unit 502 determines not to send the advertisement data stream to the client, the comparison unit 502 instructs the delay unit not to send the cached advertisement data stream to the client.
An advertisement system provided in an embodiment of the present invention is shown in fig. 7, and includes a packaging server 701, a monitoring server 702, and a client 703, where:
a packaging server 701, configured to generate an advertisement data stream according to an original advertisement file; sending the original advertisement file and the advertisement data stream to the monitoring server 702;
the monitoring server 702 is configured to parse the advertisement data stream sent by the packaging server 701 to obtain an appointed advertisement file; comparing whether the content of the specified advertisement file is the same as that of the original advertisement file sent by the packaging server 701, and determining whether to send the advertisement data stream to the client 703 according to the comparison result;
the client 703 is configured to parse the advertisement data stream sent by the monitoring server 702 to obtain an advertisement file for playing.
In summary, in the solution provided in the embodiment of the present invention, the packaging server sends the original advertisement file and the advertisement data stream obtained by packaging the original advertisement file to the monitoring server; and after receiving the advertisement data stream, the monitoring server analyzes the advertisement data stream to obtain an appointed advertisement file, compares the appointed advertisement file with the content of the received original advertisement file, and can determine whether the advertisement data stream is legal according to the comparison result so as to determine whether the advertisement data stream is sent to the client. The method for sending the advertisement data stream realizes monitoring of the legality of the advertisement data stream, and can avoid risks in the aspect of information security prevention.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
While preferred embodiments of the present invention have been described, additional variations and modifications in those embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. Therefore, it is intended that the appended claims be interpreted as including preferred embodiments and all such alterations and modifications as fall within the scope of the invention.
It will be apparent to those skilled in the art that various modifications and variations can be made in the embodiments of the present invention without departing from the spirit or scope of the embodiments of the invention. Thus, if such modifications and variations of the embodiments of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to encompass such modifications and variations.