Disclosure of Invention
The embodiment of the invention provides a method, a system and a network server for acquiring video streams and transmitting page data, which are used for solving the technical problem of delay increase caused by response speed reduction when the server faces a high-concurrency scene.
In a first aspect of the present invention, a method for acquiring video stream data is provided, including:
the method comprises the steps that a virtual set top box client sends a video stream request to a virtual set top box server, wherein the video stream request is used for requesting to obtain video stream data;
after receiving the video stream request, the virtual set-top box server sends a page request for requesting to obtain page data to a network server; the page data corresponds to the video stream data;
the network server acquires the page data, adds M pieces of path information in the page data, and sends the page data added with the M pieces of path information to the virtual set-top box server; each path information corresponds to one data, each path information indicates a storage path of the corresponding data in the network server, N data corresponding to N path information are static data, and the network server stores the static data in a static data synchronization database; m is a positive integer, and N is a positive integer less than or equal to M;
and the virtual set-top box server processes the page data to obtain the video stream data and sends the video stream data to the virtual set-top box client.
With reference to the first aspect, in a first possible implementation manner of the first aspect, before the obtaining, by the network server, the page data and adding M pieces of path information to the page data, the method further includes:
the network server determines that there is a new data addition;
the network server judges whether the added data is static data;
if yes, the network server stores the added data into the static data synchronization database, and sends the added data and path information of the added data in the network server to the virtual set-top box server;
the virtual set-top box server receives the added data sent by the network server and path information of the added data in the network server;
and the virtual set-top box server stores the added data into a static database of the virtual set-top box server.
With reference to the first possible implementation manner of the first aspect, in a second possible implementation manner of the first aspect, the determining, by the network server, whether the added data is static data includes:
and the network server judges whether the added data is static data according to the data type of the added data.
With reference to the first aspect or the first possible implementation manner or the second possible implementation manner of the first aspect, in a third possible implementation manner of the first aspect, before the obtaining, at the web server, the page data and adding M pieces of path information to the page data, the method further includes:
the network server determines that data is deleted;
the network server judges whether the deleted data is static data;
if yes, the network server searches and deletes the deleted data in the static data synchronous database according to the path information of the deleted data, and sends the path information of the deleted data in the network server to the virtual set-top box server;
the virtual set-top box server receives path information of the deleted data in the network server, wherein the path information is sent by the network server;
the virtual set-top box server searches the deleted data in a static database of the virtual set-top box server according to the path information of the deleted data in the network server;
and if the deleted data exists in the static database, the virtual set-top box server deletes the deleted data in the static database.
With reference to the first aspect or the first possible implementation manner, the second possible implementation manner, or the third possible implementation manner of the first aspect, in a fourth possible implementation manner of the first aspect, the processing, by the virtual set top box server, the page data to obtain the video stream data includes:
the virtual set-top box server respectively determines whether M data corresponding to the M path information are dynamic data or static data according to the M path information;
the virtual set-top box server determines that N data corresponding to the N path information are static data;
the virtual set top box server acquires N static data corresponding to the N path information according to the N path information;
and the virtual set-top box server processes the page data according to the N static data to obtain the video stream data.
With reference to the fourth possible implementation manner of the first aspect, in a fifth possible implementation manner of the first aspect, the obtaining, by the virtual set top box server, N static data corresponding to the N path information according to the N path information includes:
the virtual set-top box server inquires ith static data corresponding to ith path information in a static database of the virtual set-top box server;
if the ith static data is found in the static database, the virtual set top box server acquires the ith static data;
if the ith static data is not found in the static database, the virtual set top box server requests the network server to acquire the ith static data; i are each an integer from 1 to N.
In a second aspect of the present invention, a page data transmission method is provided, including:
the method comprises the steps that a network server receives a page request sent by a virtual set top box server, wherein the page request is used for requesting to obtain page data;
the network server acquires the page data and adds M pieces of path information in the page data; each path information corresponds to one data, each path information indicates a storage path of the corresponding data in the network server, N data corresponding to N path information are static data, and the network server stores the static data in a static data synchronization database; m is a positive integer, and N is a positive integer less than or equal to M;
and the network server sends the page data added with the M pieces of path information to the virtual set-top box server.
With reference to the second aspect, in a first possible implementation manner of the second aspect, the method further includes:
the network server determines that there is a new data addition;
the network server judges whether the added data is static data;
and if so, the network server stores the added data into the static data synchronization database, and sends the added data and the path information of the added data in the network server to the virtual set-top box server.
With reference to the first possible implementation manner of the second aspect, in a second possible implementation manner of the second aspect, the determining, by the network server, whether the added data is static data includes:
and the network server judges whether the added data is static data according to the data type of the added data.
With reference to the second aspect or the first possible implementation manner or the second possible implementation manner of the second aspect, in a third possible implementation manner of the second aspect, the method further includes:
the network server determines that data is deleted;
the network server judges whether the deleted data is static data;
if yes, the network server searches and deletes the deleted data in the static data synchronous database according to the path information of the deleted data, and sends the path information of the deleted data in the network server to the virtual set-top box server.
The third aspect of the invention provides a video stream data acquisition system, which comprises a virtual set top box client, a virtual set top box server and a network server, wherein the virtual set top box client is connected with the virtual set top box server, and the virtual set top box server is connected with the network server;
the virtual set-top box client is used for sending a video stream request to the virtual set-top box server, wherein the video stream request is used for requesting to obtain video stream data;
the virtual set-top box server is used for sending a page request for requesting to obtain page data to the network server after receiving the video stream request; the page data corresponds to the video stream data;
the network server is used for acquiring the page data, adding M pieces of path information into the page data, and sending the page data added with the M pieces of path information to the virtual set-top box server; each path information corresponds to one data, each path information indicates a storage path of the corresponding data in the network server, N data corresponding to N path information are static data, and the network server stores the static data in a static data synchronization database; m is a positive integer, and N is a positive integer less than or equal to M;
the virtual set-top box server is further configured to process the page data to obtain the video stream data, and send the video stream data to the virtual set-top box client.
With reference to the third aspect, in a first possible implementation manner of the third aspect,
the network server is further configured to:
determining that new data is added before M path information is added to the page data after the page data is obtained;
judging whether the added data is static data;
if yes, storing the added data into the static data synchronization database, and sending the added data and path information of the added data in the network server to the virtual set-top box server;
the virtual set-top box server is further configured to:
receiving the added data sent by the network server and path information of the added data in the network server;
and storing the added data into a static database of the virtual set-top box server.
With reference to the first possible implementation manner of the third aspect, in a second possible implementation manner of the third aspect, the network server is further configured to determine whether the added data is static data, specifically: and judging whether the added data is static data according to the data type of the added data.
With reference to the third aspect or the first possible implementation manner or the second possible implementation manner of the third aspect, in a third possible implementation manner of the third aspect,
the network server is further configured to:
determining that data is deleted before M pieces of path information are added to the page data after the page data are obtained;
judging whether the deleted data is static data;
if yes, searching and deleting the deleted data in the static data synchronous database according to the path information of the deleted data, and sending the path information of the deleted data in the network server to the virtual set-top box server;
the virtual set-top box server is further configured to:
receiving path information of the deleted data in the network server, which is sent by the network server;
searching the deleted data in a static database of the virtual set-top box server according to the path information of the deleted data in the network server;
and if the deleted data exists in the static database, deleting the deleted data in the static database.
With reference to the third aspect or the first possible implementation manner, the second possible implementation manner, or the third possible implementation manner of the third aspect, in a fourth possible implementation manner of the third aspect, the virtual set top box server is further configured to process the page data to obtain the video stream data, and specifically:
respectively determining whether M data corresponding to the M path information are dynamic data or static data according to the M path information;
determining that N data corresponding to the N pieces of path information are static data;
acquiring N static data corresponding to the N path information according to the N path information;
and processing the page data according to the N static data to obtain the video stream data.
With reference to the fourth possible implementation manner of the third aspect, in a fifth possible implementation manner of the third aspect, the virtual set-top box server is further configured to obtain, according to the N path information, N static data corresponding to the N path information, specifically:
the virtual set-top box server inquires ith static data corresponding to ith path information in a static database of the virtual set-top box server;
if the ith static data is found in the static database, the virtual set top box server acquires the ith static data;
if the ith static data is not found in the static database, the virtual set top box server requests the network server to acquire the ith static data; i are each an integer from 1 to N.
In a fourth aspect of the present invention, there is provided a network server comprising:
the receiving module is used for receiving a page request sent by the virtual set-top box server, wherein the page request is used for requesting to obtain page data;
the acquisition module is used for acquiring the page data and adding M pieces of path information into the page data; each path information corresponds to one data, each path information indicates a storage path of the corresponding data in the network server, N data corresponding to N path information are static data, and the network server stores the static data in a static data synchronization database; m is a positive integer, and N is a positive integer less than or equal to M;
and the sending module is used for sending the page data added with the M pieces of path information to the virtual set top box server.
With reference to the fourth aspect, in a first possible implementation manner of the fourth aspect, the network server further includes:
a determining module for determining that there is a new data addition;
the judging module is used for judging whether the added data is static data;
the operation module is used for storing the added data into the static data synchronous database if the added data is in the same state as the static data synchronous database;
the sending module is further configured to: and sending the added data and the path information of the added data in the network server to the virtual set-top box server.
With reference to the first possible implementation manner of the fourth aspect, in a second possible implementation manner of the fourth aspect, the determining module is specifically configured to:
and judging whether the added data is static data according to the data type of the added data.
With reference to the fourth aspect or the first possible implementation manner or the second possible implementation manner of the fourth aspect, in a third possible implementation manner of the fourth aspect, the network server further includes:
a determining module for determining that data is deleted;
the judging module is used for judging whether the deleted data is static data;
if yes, searching and deleting the deleted data in the static data synchronous database according to the path information of the deleted data;
the sending module is further configured to: and sending the path information of the deleted data in the network server to the virtual set-top box server.
In a fifth aspect of the present invention, there is provided a network server comprising a memory, a processor, a receiver, and a transmitter connected to the same bus; wherein,
the memory to store instructions;
the receiver is used for receiving a page request sent by the virtual set-top box server, wherein the page request is used for requesting to obtain page data;
the processor is configured to execute the instruction, acquire the page data, and add M pieces of path information to the page data; each path information corresponds to one data, each path information indicates a storage path of the corresponding data in the network server, N data corresponding to N path information are static data, and the network server stores the static data in a static data synchronization database; m is a positive integer, and N is a positive integer less than or equal to M;
the transmitter is configured to transmit the page data to which the M pieces of path information are added to the virtual set-top box server.
With reference to the fifth aspect, in a first possible implementation manner of the fifth aspect, the processor is further configured to: executing the instruction and determining that new data is added; judging whether the added data is static data; if yes, storing the added data into the static data synchronization database through the transmitter, and transmitting the added data and path information of the added data in the network server to the virtual set-top box server through the transmitter.
With reference to the first possible implementation manner of the fifth aspect, in a second possible implementation manner of the fifth aspect, the processor is further configured to determine whether the added data is static data, specifically:
and judging whether the added data is static data according to the data type of the added data.
With reference to the fifth aspect or the first possible implementation manner or the second possible implementation manner of the fifth aspect, in a third possible implementation manner of the fifth aspect, the processor is further configured to: executing the instruction, and determining that data is deleted; judging whether the deleted data is static data; if yes, searching and deleting the deleted data in the static data synchronous database according to the path information of the deleted data, and sending the path information of the deleted data in the network server to the virtual set-top box server through the sender.
In the embodiment of the invention, when the network server sends the page data to the virtual set-top box server, the path information corresponding to the static data in the page data is added into the page data, and when the network server stores the data, the static data is stored in a position different from the dynamic data, for example, the static data can be stored in a special database (namely, the static data synchronous database), so that the virtual set-top box server can know whether the data is the dynamic data or the static data according to the path information of the data, the distinguishing speed is high, and the response speed is also improved. And the virtual set-top box server can obtain the static data according to the corresponding path information, for example, the virtual set-top box server has a static database in which the static data is stored, and the virtual set-top box server can directly obtain the static data locally, so that operations such as rendering and the like can be performed on the page data according to the obtained static data, and the processing speed is improved.
And when the network server processes high concurrency requests, the virtual set top box server can directly acquire static data from the local without requesting the network server for acquisition, so that the load of the network server is reduced, the processing speed of the network server is increased, the delay is reduced as much as possible, and the user experience is improved.
The embodiment of the invention provides a method for improving the response speed aiming at a user request under the scene with a virtual set-top box server, and no better solution for improving the response speed aiming at the scene exists in the prior art.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, 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, but 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.
Additionally, the terms "system" and "network" are often used interchangeably herein. The term "and/or" herein is merely an association describing an associated object, meaning that three relationships may exist, e.g., a and/or B, may mean: a exists alone, A and B exist simultaneously, and B exists alone. In addition, the character "/" herein generally indicates that the former and latter related objects are in an "or" relationship, unless otherwise specified.
The embodiments of the present invention will be described in further detail with reference to the drawings attached hereto.
First, a system architecture according to an embodiment of the present invention will be described.
Fig. 1 is a typical architecture diagram of a virtual set-top box service system, i.e., a video stream data acquisition system in the embodiment of the present invention. The system comprises a virtual set-top box client 101, a virtual set-top box server102 and a network server103, wherein the virtual set-top box client 101 is connected with the virtual set-top box server102 in a wired or wireless mode, and the virtual set-top box server102 is connected with the network server103 in a wired or wireless mode.
Referring to fig. 2, the system is further connected to an IPTV (Internet protocol television) server 104 and/or an Internet application server 105 through a web server 103.
The virtual Set-Top Box client 101, i.e. a Set Top Box (STB), accesses the virtual Set-Top Box server102 through a network (i.e. a cloud structure in fig. 1), for example, and may send a request to the virtual Set-Top Box server102 to obtain services such as live television programs or on-demand television programs from the virtual Set-Top Box server 102.
The virtual Set-Top Box server102, i.e. the virtual Set-Top Box server, may receive a request sent by a user through the virtual Set-Top Box client 101, and after receiving the request, the virtual Set-Top Box server102 may send a request to the web server103 to request data such as browsing and viewing of a television program. For example, the virtual set-top box server102 may request page data from the web server103 via HTTP (Hypertext transfer protocol).
Among them, the virtual set-top box Server102 shown in fig. 2 has a plurality of CloudTV servers 1021 (cloud tv servers), where each CloudTV Server1021 corresponds to one virtual set-top box client 101. However, not all the virtual set-top-box clients 101 are shown in fig. 1 and 2, and only one virtual set-top-box client 101 is taken as an example.
In addition, in fig. 2, the virtual set-top box server102 further includes a static resource management unit 1022 and a static database 1023, where the static database 1023 is used to store static data, and the static resource management unit 1022 is used to receive static data sent by the network server103 and store the received static data in the static database 1023.
The web server103, i.e. the UI server, is connected to the IPTV server 104 and/or the internet application server 105 (fig. 1, for example, the web server103 is connected to both the IPTV server 104 and the internet application server 105), and is configured to request corresponding data from the IPTV server 104 or the internet application server 105 after receiving the request from the virtual set-top box server 102.
Among them, the Web Server103 shown in fig. 2 has a Web Server (internet Server) 1031 therein, and the Web Server1031 is a functional module in the Web Server103 that completes interaction with the virtual set-top box Server102, the IPTV Server 104, and the internet application Server 105. Specifically, the virtual set-top box Server102 requests the Web Server103 to obtain the page data, and may be that the CloudTV Server1021 requests the Web Server1031 to obtain the page data through HTTP.
In addition, the network server103 further includes a static resource synchronization unit 1032 and a static data synchronization database 1033, where the static data synchronization database 1033 is configured to store static data, and the static resource synchronization unit 1032 is configured to receive and store the static data in the static data synchronization database 1033, and is configured to send a static resource addition message or a static resource deletion message to the static resource management unit 1022. For example, the static resource synchronization unit 1032 may communicate with the static resource management unit 1022 through a TCP (transmission control Protocol), a UDP (User Datagram Protocol), or the like.
The IPTV server 104 may also be referred to as an EPG (Electronic Program Guide) server for short.
An internet application server 105, OTT (Over The Top, providing various application services to users through The internet).
Method embodiments in embodiments of the invention are described next.
Referring to fig. 3, an embodiment of the present invention provides a method for acquiring video stream data, and a main flow of the method is described as follows.
Step 301: the virtual set-top box client 101 sends a video stream request to the virtual set-top box server102, where the video stream request is used to request to obtain video stream data.
Generally, a family may have one or more set top boxes, that is, the virtual set top box client 101, and a user may operate the virtual set top box client 101 to obtain a television program, and of course, the user may directly operate the virtual set top box client 101, or may operate the virtual set top box client 101 through an external input device such as a remote controller, and the invention is not limited.
After the user operates the virtual set-top box client 101, the virtual set-top box client 101 may generate a corresponding request for the operation of the user, which is referred to as the video stream request in the embodiment of the present invention, the video stream request is used to request to obtain video stream data required by the user, and the virtual set-top box client 101 may send the video stream request to the virtual set-top box server 102.
Step 302: after receiving the video stream request, the virtual set-top box server sends a page request for requesting to obtain page data to a network server; the page data corresponds to the video stream data.
Generally, all the page data obtained by the virtual set-top box server102 from the network server103 is page data, and the video stream data required by the virtual set-top box client 101 is obtained only after the obtained page data is rendered, image coded and the like by the virtual set-top box server102, so that the virtual set-top box server102 requests the network server for the page data, and the video stream data can be obtained according to the page data, so that the page data corresponds to the video stream data.
Step 303: the network server103 acquires the page data, adds M pieces of path information to the page data, and sends the page data added with the M pieces of path information to the virtual set-top box server 102; each path information corresponds to one data, each path information indicates a storage path of the corresponding data in the network server103, N data corresponding to N path information are static data, and the network server103 stores the static data in a static data synchronization database; m is a positive integer, and N is a positive integer less than or equal to M.
In the embodiment of the present invention, the dynamic data may refer to data that needs to be executed, for example, a page script such as jsp (Java server pages), php (Hypertext Preprocessor), and the static data generally refers to data that does not need to be executed, for example, data such as pictures, html (Hypertext markup Language), js (JavaScript, and the like.
As can be seen from fig. 1, after the virtual set-top box server102 sends the page request to the web server103, the web server103 will continue to send a request to the IPTV server 104 or the internet application server 105 to request to obtain the page data required by the virtual set-top box server 102.
After the web server103 obtains the page data, the page data may be analyzed to determine which data in the page data needs to be obtained depending on other resources. For example, the page data includes some links, and it needs to rely on other dynamic resources to obtain the content corresponding to the links, and for example, the page data includes some pictures, and it needs to obtain the pictures from the static data synchronization database 1033 in the web server 103. After determining the data that needs to be obtained depending on other resources, the web server103 adds path information corresponding to the data to the page data. Wherein, for the static data, the path information in the page data is the storage path of the corresponding static data in the network server 103.
It should be noted that, in the embodiment of the present invention, the network server103 maintains a static data synchronization database 1033 dedicated for storing static data, and a static resource synchronization unit 1032 for managing the static database 1023.
In addition, in the embodiment of the present invention, the static database 1023 and the static resource management unit 1022 for managing the static database 1023 may be maintained in the virtual set-top box server 102.
There may be multiple CloudTV servers 1021 in the virtual set-top box Server102, each CloudTV Server1021 corresponding to one virtual set-top box client 101, so each CloudTV Server1021 may have static data that needs to be stored. In the embodiment of the present invention, there may be only one static database 1023 in the virtual set-top-box Server102, and the static database 1023 may be used by all CloudTV servers 1021 in the virtual set-top-box Server 102.
Optionally, in this embodiment of the present invention, before the obtaining, at the network server103, the page data and adding M pieces of path information in the page data, the method further includes:
the network server103 determines that there is a new data addition;
the web server103 judges whether the added data is static data;
if yes, the network server103 stores the added data in the static data synchronization database 1033, and sends the added data and the path information of the added data in the network server103 to the virtual set-top box server 102;
the virtual set-top box server102 receives the added data sent by the network server103 and the path information of the added data in the network server 103;
the virtual set-top box server102 saves the added data to the static database 1023 of the virtual set-top box server 102.
Optionally, in this embodiment of the present invention, the determining, by the network server103, whether the added data is static data includes: the web server103 judges whether the added data is static data according to the data type of the added data.
In this embodiment of the present invention, each time the network server103 obtains one piece of data, it may determine whether the data is dynamic data or static data, and generally may determine according to a data type of the data, for example, may determine according to a suffix name of the data, and one determination criterion may be: and judging whether the added data is executable page language data or not, if so, determining that the added data is dynamic data, and if not, determining that the added data is static data. If it is determined that the added data is static data, the added data is stored in a corresponding directory in the network server103, in this embodiment of the present invention, for example, the static data may be stored in the static data synchronization database 1033, for example, a storage path of the static data synchronization database 1033 is as follows:
uiserver/static/
then, the network server103 may send a static resource increasing message to the static resource synchronizing unit 1032 in the network server103, and the static resource synchronizing unit 1032 may send the static resource increasing message to the virtual set-top box server102, and may also send the added data and path information of the added data in the network server103 to the virtual set-top box server102, specifically, the static resource synchronizing unit 1032 may send these information to the static resource managing unit 1022.
The network server103 may send the static resource addition message, the added data, and the path information of the added data in the network server103 to the virtual set-top box server102, respectively, or the network server103 may add the added data and the path information of the added data in the network server103 to the static resource addition message and send the static resource addition message to the virtual set-top box server 102.
After receiving the added data and the path information of the added data in the network server103, the static resource management unit 1022 stores the added data in the static database 1023, and may set index information according to the path information of the added data in the virtual set-top box server102, where the index information also indicates the path of the added data in the virtual set-top box server 102.
Optionally, in this embodiment of the present invention, before the obtaining, at the network server103, the page data and adding M pieces of path information in the page data, the method further includes:
the network server103 determines that data is deleted;
the web server103 judges whether the deleted data is static data;
if yes, the network server103 searches and deletes the deleted data in the static data synchronization database 1033 according to the path information of the deleted data, and sends the path information of the deleted data in the network server103 to the virtual set-top box server 102;
the virtual set-top box server103 receives path information of the deleted data in the network server103, which is sent by the network server 103;
the virtual set-top box server102 searches the deleted data in a static database 1023 of the virtual set-top box server102 according to the path information of the deleted data in the network server 103;
if the static database 1023 has the deleted data, the virtual set-top box server deletes the deleted data in the static database 1023.
Optionally, in this embodiment of the present invention, the determining, by the network server103, whether the deleted data is static data includes: the web server103 judges whether the deleted data is static data according to the data type of the deleted data.
In the embodiment of the present invention, each time the network server103 deletes one piece of data, it may determine whether the data is dynamic data or static data, and generally may determine according to the data type of the data, for example, may determine according to a suffix name of the data, and one determination criterion still may be: and judging whether the deleted data is executable page language data or not, if so, determining that the deleted data is dynamic data, and if not, determining that the deleted data is static data. If the deleted data is determined to be static data, the deleted data may be searched in the static data synchronization database 1033 according to the path information corresponding to the deleted data, and if the deleted data is searched in the static data synchronization database 1033, the deleted data is deleted in the static data synchronization database 1033.
Then, the network server103 sends a static resource deletion message to the static resource synchronization unit 1032, and the static resource synchronization unit 1032 sends the static resource deletion message and the path information of the deleted data in the network server103 to the static resource management unit 1022 in the virtual set-top box server 102.
The static resource management unit 1022 searches the static database 1023 for the deleted data according to the path information of the deleted data in the network server103, and if the deleted data is found in the static database 1023, deletes the deleted data in the static database 1023 and also deletes the index information corresponding to the deleted data, that is, the path information corresponding to the deleted data.
Therefore, no matter static data is added or deleted in the network server103, the network server103 and the virtual set-top box server102 can automatically realize data synchronization, the number of times that the virtual set-top box server102 requests to obtain the static data in the network server103 is reduced as much as possible, the response time for user operation is saved as much as possible, the response speed of the system is improved, the system delay is reduced, and the user experience is improved.
Step 304: the virtual set-top box server102 processes the page data to obtain the video stream data, and sends the video stream data to the virtual set-top box client 101.
Optionally, in this embodiment of the present invention, the processing, by the virtual set-top box server102, the page data to obtain the video stream data includes:
the virtual set-top box server102 determines whether the M data corresponding to the M path information are dynamic data or static data respectively according to the M path information;
the virtual set-top box server102 determines that N data corresponding to the N path information therein are static data;
the virtual set-top box server102 acquires N static data corresponding to the N path information according to the N path information;
and the virtual set-top box server102 processes the page data according to the N static data to obtain the video stream data.
Optionally, in this embodiment of the present invention, the obtaining, by the virtual set-top box server102 according to the N pieces of path information, N pieces of static data corresponding to the N pieces of path information includes:
the virtual set-top box server102 inquires the ith static data corresponding to the ith path information in the static database 1023 of the virtual set-top box server 102;
if the ith static data is found in the static database 1023, the virtual set-top box server102 acquires the ith static data;
if the ith static data is not found in the static database 1023, the virtual set-top box server102 requests the network server103 to acquire the ith static data; i are each an integer from 1 to N.
In the embodiment of the present invention, after obtaining the page data, the virtual set-top box server102 may analyze the page data to obtain the M pieces of path information therein. Since the network server103 stores the dynamic data and the static data separately, the virtual set-top box server102 may know, for example, the path of the static data stored in the network server103 in advance, and then the virtual set-top box server102 may know which data is the static data according to the M path information.
If N < M, data corresponding to M-N path information in the M path information is also dynamic data, and for the dynamic data, a processing mode of the virtual set-top box server102 is the same as that in the prior art, which is not described much here, and the embodiment of the present invention mainly focuses on processing static data.
The virtual set-top box server102 may obtain the N static data respectively corresponding to the N path information after obtaining the N path information.
As described above, the static database 1023 is maintained in the virtual set-top box server102, and in general, the static data stored in the static database 1023 is synchronized from the static data synchronization database 1033 of the network server103, so that each static data stored in the static database 1023 can have two corresponding path information, namely, the path information of the static data in the virtual set-top box server102 (i.e., the path information of the static data in the static database 1023) and the path information of the static data in the network server103 (i.e., the path information of the static data in the static data synchronization database 1033).
Each of the N pieces of path information included in the page data refers to path information of corresponding static data in the web server 103. Then, after obtaining the N path information, for example, for the ith path information, the virtual set-top box server102 may look up in the static database 1023 according to the ith path information to see whether the ith static data corresponding to the ith path information exists, if so, the ith static data also corresponds to a path information, and this path information is the path information of the ith static data in the virtual set-top box server 102.
That is, when the virtual set-top box server102 searches the static database 1023 for static data, the static data can be searched in three ways: the method comprises the steps of firstly, searching through static data; in the second mode, the path information of the static data in the virtual set-top box server102 is searched; and thirdly, searching the path information in the network server103 through the static data.
In this embodiment of the present invention, for the ith path information, if the virtual set-top box server102 does not find the corresponding ith static data in the static database 1023, it indicates that the network server103 does not synchronize the ith static data to the virtual set-top box server102, and the virtual set-top box server102 may request the network server103 to obtain the ith static data.
After the N static data are obtained, the virtual set-top box server102 may render a page image of the page data according to the N static data, perform video streaming coding on the finally rendered image data, send the video stream data obtained after the video coding to the virtual set-top box client 101, and the virtual set-top box client 101 decodes the obtained video stream data and displays the video stream data on a television or other equipment of a user, thereby completing the process of obtaining the video stream data.
Referring to fig. 4, based on the same inventive concept, an embodiment of the present invention provides a page data transmission method, where the main process of the method is described as follows:
step 401: the network server103 receives a page request sent by the virtual set-top box server102, wherein the page request is used for requesting to obtain page data;
step 402: the network server103 acquires the page data, and adds M pieces of path information in the page data; each path information corresponds to one data, each path information indicates a storage path of the corresponding data in the network server103, N data corresponding to N path information are static data, and the network server103 stores the static data in the static data synchronization database 1033; m is a positive integer, and N is a positive integer less than or equal to M;
step 403: the web server103 sends the page data to which the M pieces of path information are added to the virtual set-top box server 102.
Optionally, in the embodiment of the present invention, the method may further include:
the network server103 determines that there is a new data addition;
the web server103 judges whether the added data is static data;
if yes, the network server103 stores the added data in the static data synchronization database 1033, and sends the added data and the path information of the added data in the network server103 to the virtual set-top box server 102.
Optionally, in this embodiment of the present invention, the network server103 determines whether the added data is static data, specifically:
the web server103 judges whether the added data is static data according to the data type of the added data.
Optionally, in the embodiment of the present invention, the method may further include:
the network server103 determines that data is deleted;
the web server103 judges whether the deleted data is static data;
if yes, the network server103 searches and deletes the deleted data in the static data synchronization database 1033 according to the path information of the deleted data, and sends the path information of the deleted data in the network server103 to the virtual set-top box server 102.
The steps of the embodiment in fig. 4 have been described in detail in the embodiment in fig. 3, and are not repeated here.
With continued reference to fig. 1 and fig. 2, an embodiment of the present invention provides the video stream data acquisition system, where the system may include a virtual set-top box client 101, a virtual set-top box server102, and a network server103, where the virtual set-top box client 101 is connected to the virtual set-top box server102, and the virtual set-top box server102 is connected to the network server 103.
A virtual set-top box client 101, configured to send a video stream request to the virtual set-top box server102, where the video stream request is used to request to obtain video stream data;
the virtual set-top box server102 is configured to send a page request for requesting to obtain page data to the network server103 after receiving the video stream request; the page data corresponds to the video stream data;
the network server103 is configured to acquire the page data, add M pieces of path information to the page data, and send the page data to which the M pieces of path information are added to the virtual set-top box server 102; each path information corresponds to one data, each path information indicates a storage path of the corresponding data in the network server103, N data corresponding to N path information are static data, and the network server103 stores the static data in the static data synchronization database 1033; m is a positive integer, and N is a positive integer less than or equal to M;
the virtual set-top box server102 is further configured to process the page data, obtain the video stream data, and send the video stream data to the virtual set-top box client 101.
Optionally, in the embodiment of the present invention,
the web server103 is further configured to:
determining that new data is added before M path information is added to the page data after the page data is obtained;
judging whether the added data is static data;
if yes, storing the added data into a static data synchronization database 1033, and sending the added data and path information of the added data in the network server103 to the virtual set-top box server 102;
the virtual set-top box server102 is further configured to:
receiving the added data sent by the network server103 and path information of the added data in the network server 103;
the added data is saved to the static database of the virtual set-top server 102.
Optionally, in this embodiment of the present invention, the network server103 is further configured to determine whether the added data is static data, specifically: and judging whether the added data is static data according to the data type of the added data.
Optionally, in the embodiment of the present invention,
the web server103 is further configured to:
determining that data is deleted before M pieces of path information are added to the page data after the page data are obtained;
judging whether the deleted data is static data;
if yes, according to the path information of the deleted data, searching and deleting the deleted data in the static data synchronization database 1033, and sending the path information of the deleted data in the network server103 to the virtual set-top box server 102;
the virtual set-top box server102 is further configured to:
receiving path information of the deleted data in the network server103, which is sent by the network server 103;
searching the deleted data in a static database 1023 of the virtual set-top box server102 according to the path information of the deleted data in the network server 103;
if the deleted data exists in the static database 1023, the deleted data is deleted in the static database 1023.
Optionally, in this embodiment of the present invention, the virtual set-top box server102 is further configured to process the page data to obtain the video stream data, specifically:
respectively determining whether M data corresponding to the M path information are dynamic data or static data according to the M path information;
determining that N data corresponding to the N pieces of path information are static data;
acquiring N static data corresponding to the N path information according to the N path information;
and processing the page data according to the N static data to obtain the video stream data.
Optionally, in this embodiment of the present invention, the virtual set-top box server102 is further configured to obtain, according to the N pieces of path information, N pieces of static data corresponding to the N pieces of path information, specifically:
the virtual set-top box server102 queries the ith static data corresponding to the ith path information in the static database 1023 of the virtual set-top box server;
if the ith static data is found in the static database 1023, the virtual set-top box server102 acquires the ith static data;
if the ith static data is not found in the static database 1023, the virtual set-top box server102 requests the network server103 to acquire the ith static data; i are each an integer from 1 to N.
Referring to fig. 5, based on the same inventive concept, an embodiment of the present invention provides a network server103, where the network server103 may include a receiving module 501, an obtaining module 502, and a sending module 503.
A receiving module 501, configured to receive a page request sent by the virtual set-top box server102, where the page request is used to request to obtain page data;
an obtaining module 502, configured to obtain the page data, and add M pieces of path information to the page data; each path information corresponds to one data, each path information indicates a storage path of the corresponding data in the network server103, N data corresponding to N path information are static data, and the network server stores the static data in the static data synchronization database 1033; m is a positive integer, and N is a positive integer less than or equal to M;
a sending module 503, configured to send the page data to which the M pieces of path information are added to the virtual set-top box server 102.
Optionally, in this embodiment of the present invention, the network server103 further includes:
a determining module for determining that there is a new data addition;
the judging module is used for judging whether the added data is static data;
an operation module, configured to store the added data in static data synchronization database 1033 if yes;
the sending module 503 is further configured to: and sending the added data and the path information of the added data in the network server103 to the virtual set-top box server 102.
Optionally, in the embodiment of the present invention, the determining module is specifically configured to:
and judging whether the added data is static data according to the data type of the added data.
Optionally, in this embodiment of the present invention, the network server103 further includes:
the determining module is used for determining that data is deleted;
the judging module is used for judging whether the deleted data is static data;
if yes, searching and deleting the deleted data in a static data synchronous database 1033 according to the path information of the deleted data;
the sending module 503 is further configured to: and sending the path information of the deleted data in the network server103 to the virtual set-top box server 102.
Referring to fig. 6, based on the same inventive concept, an embodiment of the present invention provides a web server103, and the web server103 may include a memory 601, a processor 602, a receiver 603, and a transmitter 604 connected to the same bus 600.
A memory 601 for storing instructions required for the processor 602 to perform tasks;
a receiver 603, configured to receive a page request sent by the virtual set-top box server102, where the page request is used to request to obtain page data;
a processor 602, configured to execute the instruction stored in the memory 601, obtain the page data, and add M pieces of path information in the page data; each path information corresponds to one data, each path information indicates a storage path of the corresponding data in the network server103, N data corresponding to N path information are static data, and the network server103 stores the static data in the static data synchronization database 1033; m is a positive integer, and N is a positive integer less than or equal to M;
a transmitter 604, configured to transmit the page data to which the M pieces of path information are added to the virtual set-top box server 102.
Optionally, in this embodiment of the present invention, the processor 602 is further configured to: executing the instruction and determining that new data is added; judging whether the added data is static data; if so, the added data is stored in the static data synchronization database 1033 through the transmitter 604, and the added data and the path information of the added data in the web server103 are transmitted to the virtual set-top box server102 through the transmitter 604.
Optionally, in this embodiment of the present invention, the processor 602 is further configured to determine whether the added data is static data, specifically:
and judging whether the added data is static data according to the data type of the added data.
Optionally, in this embodiment of the present invention, the processor 602 is further configured to: executing the instruction, and determining that data is deleted; judging whether the deleted data is static data; if yes, according to the path information of the deleted data, the deleted data is searched and deleted in the static data synchronization database 1033, and the path information of the deleted data in the network server103 is sent to the virtual set-top box server102 through the sender 604.
In the embodiment of the present invention, when the network server103 sends the page data to the virtual set-top box server102, the path information corresponding to the static data in the page data is added to the page data, and when the network server103 stores the data, the static data is stored in a location different from the dynamic data, for example, the static data may be stored in a special database (i.e., the static data synchronization database 1033), so that the virtual set-top box server102 can know whether the data is the dynamic data or the static data according to the path information of the data, the identification speed is fast, and the response speed is also improved. Moreover, the virtual set-top box server102 can obtain the static data according to the corresponding path information, for example, the virtual set-top box server102 has a static database 1023 in which the static data is stored, so that the virtual set-top box server102 can directly obtain the static data locally, and the operations such as rendering the page data according to the obtained static data can be performed quickly, thereby improving the processing speed.
Moreover, when the network server103 processes a high-concurrency request, the virtual set-top box server102 may directly obtain static data from the local without requesting to obtain the static data from the network server103, so that the load of the network server103 is reduced, the processing speed of the network server103 is increased, the delay is reduced as much as possible, and the user experience is improved.
The embodiment of the invention provides a method for improving the response speed aiming at the user request under the scene with the virtual set-top box server102, and no better solution for improving the response speed aiming at the scene exists in the prior art.
It will be clear to those skilled in the art that, for convenience and simplicity of description, the foregoing division of the functional units is merely used as an example, and in practical applications, the above function distribution may be performed by different functional units according to needs, that is, the internal structure of the device is divided into different functional units to perform all or part of the above described functions. For the specific working processes of the system, the apparatus and the unit described above, reference may be made to the corresponding processes in the foregoing method embodiments, and details are not described here again.
In the several embodiments provided in the present application, it should be understood that the disclosed system, apparatus and method may be implemented in other manners. For example, the above-described apparatus embodiments are merely illustrative, and for example, the described units or division of units is only one type of division of logical functions, and there may be other divisions when actually implemented, for example, a plurality of units or components may be combined or may be integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present application may be substantially implemented or contributed by the prior art, or all or part of the technical solution may be embodied in a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, a network device, or the like) or a processor (processor) to execute all or part of the steps of the method according to the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
The above embodiments are only used to describe the technical solutions of the present application in detail, but the above embodiments are only used to help understanding the method and the core idea of the present invention, and should not be construed as limiting the present invention. Those skilled in the art should also appreciate that they can easily conceive of various changes and substitutions within the technical scope of the present disclosure.