WO2017097181A1 - Data pushing method and apparatus - Google Patents

Data pushing method and apparatus Download PDF

Info

Publication number
WO2017097181A1
WO2017097181A1 PCT/CN2016/108684 CN2016108684W WO2017097181A1 WO 2017097181 A1 WO2017097181 A1 WO 2017097181A1 CN 2016108684 W CN2016108684 W CN 2016108684W WO 2017097181 A1 WO2017097181 A1 WO 2017097181A1
Authority
WO
WIPO (PCT)
Prior art keywords
epg server
service
service request
data
service data
Prior art date
Application number
PCT/CN2016/108684
Other languages
French (fr)
Chinese (zh)
Inventor
张涛
Original Assignee
中兴通讯股份有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 中兴通讯股份有限公司 filed Critical 中兴通讯股份有限公司
Publication of WO2017097181A1 publication Critical patent/WO2017097181A1/en

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/55Push-based network services
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L65/00Network arrangements, protocols or services for supporting real-time applications in data packet communication
    • H04L65/40Support for services or applications
    • H04L65/4061Push-to services, e.g. push-to-talk or push-to-video
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/02Protocols based on web technology, e.g. hypertext transfer protocol [HTTP]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/20Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
    • H04N21/23Processing of content or additional data; Elementary server operations; Server middleware

Definitions

  • This document relates to the field of IPTV technology, and in particular, to a data push method and apparatus.
  • a single EPG (Electronic Program Guide) server stores a full amount of WEB content, usually storing a picture 40G, a third-party template file 20G, and A lot of other files, etc. If an IPTV cluster needs to add a new EPG server, the administrator needs to manually synchronize the full amount of WEB content. The operation is very cumbersome. Moreover, these full-scale WEB content also needs to be incrementally synchronized and fully synchronized every day, and consume a large number of I of the IPTV cluster. /O resources, affecting the performance of the IPTV cluster. In the related art, there is a problem that the IPTV cluster has low performance.
  • the main object of the present invention is to provide a data pushing method and apparatus, which aim to improve the working performance of an IPTV cluster.
  • an embodiment of the present invention provides a data pushing method, where the data pushing method is applied to an IPTV cluster, the IPTV cluster includes a primary EPG server and a plurality of secondary EPG servers, and the data pushing method includes:
  • the slave EPG server acquires and stores the service data pointed by the service request based on the primary EPG server, and redirects the service request to the primary An EPG server, configured to: send, by the primary EPG server, the service data pointed to by the received service request to the IPTV terminal;
  • the EPG server sends the stored service data pointed by the service request to the IPTV terminal.
  • the service data includes a first type of service data and a second type of service data.
  • the method further includes:
  • the method further includes:
  • the service data pointed to by the service request is the second type of service data
  • the service data pointed to by the service request is obtained by the primary EPG server
  • the service data acquired by the EPG server is loaded to the slave Running in the Servlet container of the EPG server, and returning the result of the operation as the service data pointed by the service request to the IPTV terminal.
  • the method before the step of sending, by the EPG server, the stored service data that is sent by the service request to the IPTV terminal, the method further includes:
  • the EPG server When the service data pointed by the service request is currently stored, the EPG server performs a verification operation on the stored service data pointed by the service request;
  • the method further includes:
  • the slave EPG server updates the stored service data pointed by the stored service request based on the primary EPG server, and redirects the service request to the primary EPG server.
  • the method before the step of determining, by the EPG server, whether the received service data pointed by the service request is currently stored, the method further includes:
  • the step of determining from the EPG server whether the received service data pointed by the service request is currently stored is performed.
  • the method further includes:
  • the slave EPG server Upon receiving the indication information returned by the primary EPG server according to the acquisition request, the slave EPG server acquires the session data from the EPG server corresponding to the indication information.
  • an embodiment of the present invention further provides a data pushing apparatus, where the data pushing apparatus is applied to an IPTV cluster, where the IPTV cluster includes a primary EPG server and a plurality of secondary EPG servers, and the data pushing apparatus include:
  • the first judging module is configured to determine, when the EPG server receives the service request sent by the IPTV terminal, whether the EPG server currently stores the service data pointed by the service request;
  • a processing module configured to acquire and store the service data pointed by the service request based on the primary EPG server when the EPG server does not currently store the service data pointed by the service request, and The service request is redirected to the primary EPG server, so that the primary EPG server pushes the received service data pointed by the service request to the IPTV terminal;
  • the sending module is configured to send the stored service data pointed by the service request to the IPTV terminal when the EPG server currently stores the service data pointed by the service request.
  • the service data includes a first type of service data and a second type of service data
  • the data pushing device further includes a second determining module, configured to determine whether the service data pointed by the service request is a first type of service. data
  • the processing module is further configured to redirect the service request to the primary EPG server when the service data pointed by the service request is the first type of service data;
  • the sending module is further configured to: when the service data pointed by the service request is the second type of service data, and the processing module obtains the service data when the service data pointed by the service request is obtained by the primary EPG server The data is loaded into the servlet container where it is located from the EPG server, and the result of the operation is returned to the IPTV terminal as the service data pointed to by the service request.
  • the sending module is further configured to: when the EPG server currently stores the service data pointed by the service request, perform verification operation on the stored service data pointed by the service request; and when the verification is passed Transmitting the stored service data pointed by the service request to the IPTV terminal;
  • the data pushing device further includes an updating module configured to update the stored service data pointed by the service request based on the primary EPG server when the verification fails, and redirect the service request to the primary EPG server.
  • the data pushing device further includes a session module, configured to acquire session data of the IPTV terminal stored by the EPG server when the service request sent by the IPTV terminal is received from the EPG server; And verifying the validity of the obtained session data;
  • a session module configured to acquire session data of the IPTV terminal stored by the EPG server when the service request sent by the IPTV terminal is received from the EPG server; And verifying the validity of the obtained session data;
  • the first determining module is further configured to determine, when the verification passes, whether the service data pointed to by the received service request is currently stored by the EPG server.
  • the session module is further configured to: when the session data is not acquired, send an acquisition request to the primary EPG server; and when receiving the indication information returned by the primary EPG server according to the acquisition request And acquiring the session data from the EPG server corresponding to the indication information.
  • the data pushing method and device separates the full amount of WEB content (service data) into each slave EPG server in the IPTV cluster including the main EPG server and the EPG server, and each slave EPG server is based on the stored WEB.
  • the content and the received service request of the IPTV terminal provide services and update the stored WEB content as needed.
  • the embodiment of the present invention avoids the waste of IPTV cluster I/O resources caused by synchronizing the full amount of WEB content, and can achieve the purpose of improving the working performance of the IPTV cluster.
  • FIG. 1 is a diagram showing an example of a topology structure of an IPTV cluster to which a data push method is applied according to an embodiment of the present invention
  • FIG. 2 is a schematic flowchart of a first embodiment of a data pushing method according to an embodiment of the present invention
  • FIG. 3 is a schematic diagram of functional modules of a first embodiment of a data pushing apparatus according to an embodiment of the present invention.
  • the present invention provides a data push method, and the data push method is applied to an IPTV cluster.
  • the IPTV cluster includes a main EPG server and a plurality of slave EPG servers.
  • the data pushing method includes:
  • Step S10 when receiving the service request sent by the IPTV terminal, determining, by the EPG server, whether the received service data pointed by the service request is currently stored;
  • the content of the ordinary WEB server is stored locally, but for the EPG server, the situation is very special, because the WEB content is very large, mainly the picture and third-party templates (such as JSP files, etc.), and With the expansion of business, 4K is extremely clear, and various value-added services are booming. This part of the content will also grow exponentially, which will cause the EPG server to be overwhelmed in content synchronization.
  • WEB content is large, the content that is actually accessed in each EPG server in the live network environment is a very small part. Therefore, it is a great waste of I/O resources to place all WEB content locally on the EPG server. , affect the performance of the IPTV cluster.
  • the main purpose of this embodiment is to separate the WEB content of the EPG server.
  • the present embodiment provides a distributed IPTV cluster architecture as shown in FIG. 1 , as shown in FIG. 1 , compared with related technologies.
  • This embodiment introduces two types of WEB containers, namely, a primary EPG server and a secondary EPG server, wherein all WEB content is placed on the primary EPG server, and the primary EPG server is responsible for distributing the user's WEB request for load balancing; the secondary EPG server responsible for intercepting and processing the user's WEB request, the slave EPG server downloads the corresponding WEB content from the main EPG server to the local WEB container when processing the user's WEB request.
  • the on-demand downloading method from the EPG server can ensure that only a small amount of content is contained in the WEB container local to the EPG server, and there is no need to care about the synchronization of the WEB content, and the WEB downloaded to the WEB container. The content is reusable and does not need to be downloaded again if it already exists locally.
  • the primary EPG server can automatically sense the working status of the EPG server in the cluster (such as monitoring through heartbeat packets). When a certain EPG server is abnormal, the primary EPG server can remove the EPG server from the cluster. The request is no longer distributed from the EPG server. When the station returns from the EPG server status, the main EPG server can add it to the cluster to provide services.
  • the primary EPG server can automatically sense the newly added slave EPG server, which enables the cluster to be smoothly expanded without reconfiguration or restart, to meet higher and higher performance requirements.
  • the users of the IPTV cluster That is, the IPTV terminal, the IPTV terminal may include at least one of a mobile terminal such as a computer, a set top box, a smart TV, or a smart phone.
  • the IP_Hash algorithm is used to combine the load status of each EPG server to perform weighting, and the slave IPTV terminal is allocated a lightly loaded slave EPG server in real time.
  • the primary EPG server virtualizes each EPG server in the cluster into n nodes and evenly distributes them on the hash ring; and when receiving the original service request sent by the IPTV terminal, calculates a hash value according to the configured parameters.
  • the IPTV terminal After receiving the slave EPG server information sent by the primary EPG server, the IPTV terminal repackages the original service request into a new service request and sends the message to the slave EPG server, and the subsequent other services. Requests are also sent to the assigned slave EPG server.
  • the slave EPG server determines whether the service data (ie, WEB content) pointed to by the received service request is currently stored, according to the judgment result.
  • the corresponding operation is performed, for example, when the service data pointed by the service request is stored, the stored service data pointed by the service request may be directly sent to the IPTV terminal.
  • Step S20 When the service data pointed by the service request is not currently stored, the slave EPG server acquires and stores the service data pointed by the service request based on the primary EPG server, and redirects the service request to The primary EPG server, for the primary EPG server to push the service data pointed to by the received service request to the IPTV terminal;
  • the EPG server when the service data pointed by the service request is not currently stored, the EPG server adds the service data pointed by the service request to the download queue, and the service that the service request points to by the download queue Data is downloaded from the primary EPG server to the local. And adding, by the EPG server, the service data pointed by the service request to the download queue, and redirecting the received service request to the primary EPG server, where the primary EPG server pushes and receives the received data to the IPTV terminal.
  • the business data pointed to by the service request It can be understood by those skilled in the art that, in this embodiment, the slave EPG server and the IPTV terminal can simultaneously obtain the service data pointed by the service request, and the IPTV terminal can obtain the acquired service data. Presented to the user. In addition, when the service data pointed by the service request is requested again, the service data pointed by the service request can be directly obtained from the local.
  • step S30 when the service data pointed by the service request is currently stored, the EPG server sends the stored service data pointed by the service request to the IPTV terminal.
  • the purpose of storing the service data from the EPG server is to directly provide the service with the stored service data when receiving the service request for the stored service data again. Therefore, in this embodiment, when the service data pointed by the service request is currently stored, The service data pointed to by the stored service request is directly sent from the EPG server to the IPTV terminal, and the IPTV terminal presents the service data pointed by the service request to the user.
  • the embodiment also introduces a redundancy mechanism.
  • the IPTV cluster proposed in this embodiment further includes a backup EPG server, which is used as a hot backup of the primary EPG server. For example, when the primary EPG server is abnormal, the primary EPG server and the standby EPG server are switched, and the standby EPG server takes over the primary EPG server.
  • the primary EPG server also periodically synchronizes the local WEB content.
  • the IPTV cluster proposed in this embodiment further includes an FTP server, and the primary EPG server is based on the FTP.
  • the server performs synchronization of the local WEB content.
  • the main EPG server acquires a new picture file from the FTP server and stores it locally.
  • the primary EPG server also sends a content synchronization notification to each slave EPG server in the cluster, and notifies each slave EPG server to perform content synchronization with the primary EPG server; After the content synchronization notification sent by the primary EPG server, the locally stored WEB content is verified to update, add, and/or delete the local WEB content.
  • the data pushing method proposed in this embodiment separates the full amount of WEB content (service data) into each slave EPG server in the IPTV cluster including the primary EPG server and the slave EPG server, and each slave EPG server is based on the stored WEB content and receiving.
  • the IPTV terminal's service request provides services and updates the stored WEB content as needed.
  • the embodiment of the present invention avoids the waste of IPTV cluster I/O resources caused by synchronizing the full amount of WEB content, and can achieve the purpose of improving the working performance of the IPTV cluster.
  • the service data includes a first type of service data and a second type of service data.
  • the method may further include:
  • the method further includes:
  • the service data acquired from the EPG server is loaded into the servlet container of the EPG server, and the result of the operation is returned to the IPTV terminal as the service data pointed by the service request.
  • resources can be referenced as static or dynamic resources, which is used by The StaticResource tag extension or the DynamicResource tag extension is done.
  • the static resource refers to a resource that can be directly fed back to the user when requested by the user;
  • the dynamic resource refers to when the user requests, the dynamic resource is run according to different users to feed back different results.
  • it when receiving the service request of the IPTV terminal, it is also required to determine the operation to be performed according to the StaticResource mark extension or the DynamicResource mark extension carried in the received service request.
  • the IPTV terminal requests the static resource that is not currently stored (the first type of service data).
  • the service data pointed to by the service request is added to the download queue from the EPG server, and the service data pointed by the service request is downloaded from the primary EPG server to the local by the download queue. .
  • the business data pointed to by the service request is added to the download queue from the EPG server, and the service data pointed by the service request is downloaded from the primary EPG server to the local by the download queue.
  • the IPTV terminal When the service data pointed to by the service request is not currently stored, and the service request carries the DynamicResource tag extension, the IPTV terminal requests that the dynamic resource that is not currently stored (the second type of service data) needs to be consumed. The processing resource is running. At this time, the service data pointed by the service request is added to the download queue from the EPG server, and the service data pointed by the service request is downloaded from the main EPG server to the local by the download queue.
  • the slave EPG server After downloading the service data pointed by the service request from the primary EPG server to the local area, the slave EPG server loads the downloaded service data into the servlet container of the EPG server, and uses the running result as The service data pointed to by the service request is returned to the IPTV terminal to avoid unnecessary occupation of the processing resources of the primary EPG server, thereby improving the working performance of the IPTV cluster.
  • the IPTV terminal When the service data pointed by the service request is currently stored, and the service request carries the StaticResource mark extension, the IPTV terminal requests the currently stored static resource (the first type of service data), and does not need to be processed.
  • the resource operation directly sends the stored service data pointed to by the service request to the IPTV terminal, where the IPTV terminal presents the service data pointed by the service request to the user.
  • the IPTV terminal When the service data pointed to by the service request is currently stored, and the service request carries the DynamicResource tag extension, the IPTV terminal requests the currently stored dynamic resource (the first type of service data), and needs to consume the processing resource. Running, at this time, the EPG server loads the stored service data pointed by the service request into the Servlet container of the EPG server, and returns the running result as the service data pointed by the service request to the office. Said IPTV terminal.
  • the main EPG server when the content is synchronized with the FTP server, the main EPG server needs to pre-compile the acquired dynamic resources and obtain the pre-compilation when acquiring the dynamic resources from the FTP server. Compiling the object, for example, after the main EPG server obtains the JSP file from the FTP server, pre-compiling the obtained JSP file into a class file storage for the slave EPG server when needed Get and load the run.
  • the method may further include:
  • the EPG server When the service data pointed by the service request is currently stored, the EPG server performs a verification operation on the stored service data pointed by the service request;
  • step S30 is performed
  • the method further includes:
  • the slave EPG server updates the stored service data pointed by the stored service request based on the primary EPG server, and redirects the service request to the primary EPG server.
  • the service data separated from the EPG server may be related to the primary EPG server.
  • the stored original service data is different.
  • the slave EPG server needs to perform verification operations on the service data before providing the service.
  • the EPG server when the service data pointed by the service request is currently stored, the EPG server performs a verification operation on the service data pointed by the stored service request, for example, the CRC check (Cyclic Redundancy Check) is used in this embodiment. , Cyclic Redundancy Check) verifies the integrity of the stored service data pointed to by the service request.
  • the service data pointed to by the stored service request is directly sent from the EPG server to the IPTV terminal, where the service is sent by the IPTV terminal, when the stored service data pointed to by the service request is verified.
  • the service data pointed to by the request is presented to the user; when the stored service data verification pointed by the service request fails, the EPG server adds the service data pointed by the service request to the download queue, and the service is sent by the download queue.
  • the service data pointed to by the request is downloaded from the main EPG server to the locality, and replaces the service data pointed to by the locally stored service request. And adding, by the EPG server, the service data pointed by the service request to the download queue, and redirecting the received service request to the primary EPG server, where the primary EPG server pushes and receives the received data to the IPTV terminal.
  • the business data pointed to by the service request is downloaded from the main EPG server to the locality, and replaces the service data pointed to by the locally stored service request. And adding, by the EPG server, the service data pointed by the service request to the download queue, and redirecting the received service request to the primary EPG server, where the primary EPG server pushes and receives the received data to the IPTV terminal.
  • a fourth embodiment of the data pushing method of the embodiment of the present invention is provided.
  • the method may further include:
  • step S10 is performed.
  • this embodiment further provides a distributed session.
  • the solution to improve the scalability of the IPTV cluster Specifically, the primary EPG server records metadata information of the maintenance session, including version information, session location, copy information, and recovery, re-allocation, and invalidation of time-out session information when exiting from the EPG server;
  • the slave EPG server is configured to obtain, from the primary EPG server, session information of the IPTV terminal when there is a service request of the new IPTV terminal, if the location information of the session is taken out from the corresponding slave EPG server (including the The session data of the IPTV terminal is read from the EPG server or the other, and if not, the main EPG server is notified to update the session information after newly creating the session object.
  • a session object is created. If the IPTV terminal is assigned to the slave EPG server B next time, the EPG server B can acquire the session created from the APG server A node according to the session ID. Object.
  • the embodiment uses the user ID corresponding to the IPTV terminal (assigned when the user registers) as the session ID, so that the sessionID does not need to be delivered from the EPG server.
  • the embodiment also provides a session copy function, that is, the session data is stored in multiple copies. Specifically, after the session object is created persistently, the data is simultaneously copied from the EPG server to other slave EPG servers. Alternatively, the number of copies is set to an odd number, for example, the number of copies is set to three in this embodiment.
  • the EPG server can recover the erroneous data by copying the complete copy, so that the copy of the data is restored to the expected set number to ensure high reliability of the data.
  • the stored session data of the IPTV terminal is obtained from the EPG server.
  • the validating the validity of the obtained session data from the EPG server comprises: verifying the session Whether the data is complete, verify whether the session data is in error, etc.
  • the EPG server determines whether the service data pointed by the received service request is currently stored to determine how to provide the service for the IPTV terminal.
  • the slave EPG server Upon receiving the indication information returned by the primary EPG server according to the acquisition request, the slave EPG server acquires the session data from the EPG server corresponding to the indication information.
  • the slave EPG server cannot obtain the session data of the corresponding IPTV terminal locally.
  • the EPG server sends an acquisition request to the primary EPG server, so that the primary EPG server can provide information according to the received acquisition request and the stored session metadata information.
  • the session location information (instruction information) of the corresponding session data is fed back from the EPG server.
  • the slave EPG server Upon receiving the session location information returned by the primary EPG server according to the acquisition request, the slave EPG server obtains from the EPG server corresponding to the session location information. Take the session data. After the session data is obtained, the foregoing data pushing process is started.
  • the foregoing data pushing process is started.
  • the primary EPG server since the primary EPG server also performs a failure process on the timeout session, when the slave EPG server sends an acquisition request to the primary EPG server to request session data, the primary EPG server may have timed out due to the corresponding session data. No indication is returned.
  • the slave EPG server creates the session data of the IPTV terminal when the indication information returned by the primary EPG server is not received, and notifies the primary EPG server to update the session metadata information after the completion of the creation.
  • the embodiment of the present invention further provides a data pushing device, where the data pushing device is applied to an IPTV cluster.
  • the IPTV cluster includes a primary EPG server and a plurality of secondary EPG servers.
  • the data pushing device comprises:
  • the first judging module 10 is configured to determine, when the EPG server receives the service request sent by the IPTV terminal, whether the EPG server currently stores the service data pointed by the service request;
  • the content of the ordinary WEB server is stored locally, but for the EPG server, the situation is very special, because the WEB content is very large, mainly the picture and third-party templates (such as JSP files, etc.), and With the expansion of business, 4K is extremely clear, and various value-added services are booming. This part of the content will also grow exponentially, which will cause the EPG server to be overwhelmed in content synchronization.
  • WEB content is large, the content that is actually accessed in each EPG server in the live network environment is a very small part. Therefore, it is a great waste of I/O resources to place all WEB content locally on the EPG server. , affect the performance of the IPTV cluster.
  • the main purpose of this embodiment is to separate the WEB content of the EPG server.
  • the present embodiment provides a distributed IPTV cluster architecture as shown in FIG. 1 , as shown in FIG. 1 , compared with related technologies.
  • This embodiment introduces two types of WEB containers, namely, a primary EPG server and a secondary EPG server, wherein all WEB content is placed on the primary EPG server, and the primary EPG server is responsible for distributing the user's WEB request for load balancing; the secondary EPG server responsible for intercepting and processing the user's WEB request, the slave EPG server downloads the corresponding WEB content from the main EPG server to the local WEB container when processing the user's WEB request.
  • the on-demand downloading method from the EPG server can ensure that only a small amount of content is contained in the WEB container local to the EPG server, and there is no need to care about the synchronization of the WEB content, and the WEB downloaded to the WEB container. The content is reusable and does not need to be downloaded again if it already exists locally.
  • the primary EPG server can automatically sense the working status of the EPG server in the cluster (such as monitoring through heartbeat packets). When a certain EPG server is abnormal, the primary EPG server can remove the EPG server from the cluster. The request is no longer distributed from the EPG server. When the station returns from the EPG server status, the main EPG server can add it to the cluster to provide services.
  • the primary EPG server can automatically sense the newly added slave EPG server, which can make the cluster not reconfigured. Smoothly expand or restart, and respond to higher and higher performance requirements.
  • the IPTV terminal is an IPTV terminal, and the IPTV terminal may include at least one of a mobile terminal such as a computer, a set top box, a smart TV, or a smart phone.
  • the IP_Hash algorithm is used to combine the load status of each EPG server to perform weighting, and the slave IPTV terminal is allocated a lightly loaded slave EPG server in real time.
  • the primary EPG server virtualizes each EPG server in the cluster into n nodes and evenly distributes them on the hash ring; and when receiving the original service request sent by the IPTV terminal, calculates a hash value according to the configured parameters.
  • the IPTV terminal After receiving the slave EPG server information sent by the primary EPG server, the IPTV terminal repackages the original service request into a new service request and sends the message to the slave EPG server, and the subsequent other services. Requests are also sent to the assigned slave EPG server.
  • the first determining module 10 when the EPG server receives the service request sent by the IPTV terminal based on the information from the EPG server, determines whether the service request from the EPG server is currently stored and received.
  • the service data ie, the WEB content
  • the service data pointed by the service request is stored, the stored service data pointed by the service request may be directly sent to the IPTV terminal.
  • the processing module 20 is configured to acquire and store the service data pointed by the service request based on the primary EPG server when the EPG server does not currently store the service data pointed by the service request, and the service request Redirecting to the primary EPG server, for the primary EPG server to push the received service data pointed to by the service request to the IPTV terminal;
  • the processing module 20 when the service data pointed by the service request is not currently stored in the EPG server, the processing module 20 adds the service data pointed by the service request to the download queue of the EPG server, and is downloaded by the EPG server.
  • the queue downloads the service data pointed to by the service request from the primary EPG server to the slave EPG service.
  • the processing module 20 adds the service data pointed by the service request to the download queue, and redirects the received service request to the primary EPG server, and the primary EPG server pushes and receives the received data to the IPTV terminal.
  • the business data pointed to by the service request is not currently stored in the EPG server, the processing module 20 adds the service data pointed by the service request to the download queue of the EPG server, and is downloaded by the EPG server.
  • the queue downloads the service data pointed to by the service request from the primary EPG server to the slave EPG service.
  • the processing module 20 adds the service data pointed by the service request to the download queue, and redirects the received service request to the primary E
  • the slave EPG server and the IPTV terminal can simultaneously obtain the service data pointed by the service request, and the IPTV terminal can obtain the acquired service data. Presented to the user.
  • the service data pointed by the service request can be directly obtained from the EPG server where it is located.
  • the sending module 30 is configured to send the stored service data pointed by the service request to the IPTV terminal when the EPG server currently stores the service data pointed by the service request.
  • the purpose of storing the service data from the EPG server is to directly provide the service with the stored service data when receiving the service request for the stored service data again. Therefore, in this embodiment, when the EMG server currently stores the service data pointed by the service request, the sending module 30 directly sends the service data pointed to by the service request stored by the EPG server to the service data.
  • the IPTV terminal presents, by the IPTV terminal, the service data pointed by the service request to the user.
  • the embodiment also introduces a redundancy mechanism.
  • the IPTV cluster proposed in this embodiment further includes a backup EPG server, which is used as a hot backup of the primary EPG server. For example, when the primary EPG server is abnormal, the primary EPG server and the standby EPG server are switched, and the standby EPG server takes over the primary EPG server.
  • the primary EPG server also periodically synchronizes the local WEB content.
  • the IPTV cluster proposed in this embodiment further includes an FTP server, and the primary EPG server is based on the FTP.
  • the server performs synchronization of the local WEB content.
  • the main EPG server acquires a new picture file from the FTP server and stores it locally.
  • the primary EPG server also sends a content synchronization notification to each slave EPG server in the cluster, and notifies each slave EPG server to perform content synchronization with the primary EPG server; After the content synchronization notification sent by the primary EPG server, the locally stored WEB content is verified to update, add, and/or delete the local WEB content.
  • the data pushing apparatus proposed in this embodiment separates the full amount of WEB content (service data) into each slave EPG server in the IPTV cluster including the primary EPG server and the slave EPG server, and each slave EPG server is based on the stored WEB content and receives.
  • the IPTV terminal's service request provides services and updates the stored WEB content as needed.
  • the embodiment of the present invention avoids the waste of IPTV cluster I/O resources caused by synchronizing the full amount of WEB content, and can achieve the purpose of improving the working performance of the IPTV cluster.
  • the service data includes a first type of service data and a second type of service data.
  • the data pushing device further includes a second determining module, configured to determine whether the service data pointed by the service request is the first type of service data;
  • the processing module 20 is further configured to redirect the service request to the primary EPG server when the service data pointed by the service request is the first type of service data;
  • the sending module 30 is further configured to: when the service data pointed to by the service request is the second type of service data, and the processing module 20 obtains the service data pointed by the service request by the primary EPG server, The business data is loaded into the servlet container it is running from the EPG server and will run the result The service data pointed to by the service request is returned to the IPTV terminal.
  • resources can be referenced as static resources or dynamic resources, which is done by using the StaticResource markup extension or the DynamicResource markup extension.
  • the static resource refers to a resource that can be directly fed back to the user when requested by the user;
  • the dynamic resource refers to when the user requests, the dynamic resource is run according to different users to feed back different results.
  • it when receiving the service request of the IPTV terminal, it is also required to determine the operation to be performed according to the StaticResource mark extension or the DynamicResource mark extension carried in the received service request.
  • the IPTV terminal requests that the EPG server is not currently stored.
  • the static resource (the first type of service data) does not need to consume the processing resource to run.
  • the processing module 20 adds the service data pointed by the service request to the download queue of the EPG server, and the download queue The service data pointed to by the service request is downloaded from the primary EPG server to the local EPG server where it is located. While the service data pointed to by the service request is added to the EPG server download queue, the processing module 20 redirects the received service request to the primary EPG server, and the primary EPG server The IPTV terminal pushes the received service data pointed by the service request.
  • the IPTV terminal When the service data pointed to by the service request is not currently stored in the EPG server, and the service request carries the DynamicResource mark extension, the IPTV terminal requests that the dynamic resource that is not currently stored by the EPG server is requested. The second type of service data needs to consume the processing resource.
  • the processing module 20 adds the service data pointed by the service request to the download queue of the slave EPG server, and the service queue points the download request by the download queue.
  • the business data is downloaded from the primary EPG server to where it is located from the EPG server.
  • the sending module 30 After downloading the service data pointed by the service request from the primary EPG server to the local location of the slave EPG server, the sending module 30 loads the downloaded service data into the servlet container of the slave EPG server, and Returning the result of the operation as the service data pointed by the service request to the IPTV terminal, so as to avoid unnecessary occupation of the processing resources of the primary EPG server, thereby improving the working performance of the IPTV cluster.
  • the IPTV terminal When the service data pointed by the service request is currently stored in the EPG server, and the service request carries the StaticResource tag extension, the IPTV terminal requests that the static resource currently stored by the EPG server is located. a type of service data, which does not need to consume the processing resource, and the sending module 30 directly sends the service data pointed to by the service request stored by the EPG server to the IPTV terminal, where the IPTV terminal will The business data pointed to by the business request is presented to the user.
  • the IPTV terminal When the service data pointed by the service request is currently stored in the EPG server, and the service request carries the DynamicResource tag extension, the IPTV terminal requests that the dynamic resource currently stored by the EPG server is located. a type of service data, which needs to consume processing resources, and the sending module 30 loads the service data pointed to by the service request stored by the EPG server to the Running from the servlet container of the EPG server, and returning the result of the operation as the service data pointed to by the service request to the IPTV terminal.
  • the main EPG server when the content is synchronized with the FTP server, the main EPG server needs to pre-compile the acquired dynamic resources and obtain the pre-compilation when acquiring the dynamic resources from the FTP server. Compiling the object, for example, after obtaining the JSP file from the FTP server, the main EPG server pre-compiles the obtained JSP file into a class file storage for the slave EPG server to acquire and load and run when needed.
  • the sending module 30 is further configured to be currently stored when the EPG server is located from the EPG server. And when the service data pointed to by the service request is performed, performing verification operation on the stored service data pointed by the service request; and transmitting, when the verification is passed, the stored service data pointed by the service request to the IPTV terminal;
  • the data pushing device further includes an updating module, configured to update the stored service data pointed by the service request based on the primary EPG server when the verification fails, and redirect the service request to the primary EPG server.
  • the service data separated from the EPG server may be related to the primary EPG server.
  • the original business data stored is different.
  • the business data needs to be verified before the service is provided.
  • the sending module 30 when the EPG server currently stores the service data pointed by the service request, the sending module 30 performs a verification operation on the service data that the service request is stored from the EPG server, for example, In the embodiment, the sending module 30 uses a CRC check (Cyclic Redundancy Check) to verify the integrity of the stored service data pointed to by the service request.
  • the sending module 30 directly sends the service data pointed to by the service request stored by the EPG server to the IPTV terminal, where the IPTV is directly transmitted by the stored service data.
  • the terminal presents the service data pointed by the service request to the user; when the stored service data verification pointed by the service request fails, the update module adds the service data pointed by the service request to the download queue of the EPG server Downloading, by the download queue, the service data pointed by the service request from the primary EPG server to the local EPG server, and after completing the download, the update module stores the service locally stored by the EPG server.
  • the service data pointed to by the request is replaced with the service data pointed to by the service request newly downloaded by the download queue.
  • the update module redirects the received service request to the primary EPG server by adding the service data pointed by the service request to the download queue of the slave EPG server, and the primary EPG server is The IPTV terminal pushes the service data pointed to by the service request received.
  • the data pushing apparatus may further include a session module, where Receiving the service request sent by the IPTV terminal from the EPG server, acquiring the session data of the IPTV terminal stored by the EPG server; and verifying the validity of the obtained session data;
  • the first determining module 10 is further configured to determine, when the verification passes, whether the service data pointed to by the received service request is currently stored by the EPG server.
  • the embodiment further provides a distributed session solution to improve the scalability of the IPTV cluster.
  • the primary EPG server records metadata information of the maintenance session, including version information, session location, copy information, and recovery, re-allocation, and invalidation of time-out session information when exiting from the EPG server;
  • the slave EPG server is configured to obtain, from the primary EPG server, session information of the IPTV terminal when there is a service request of the new IPTV terminal, and if yes, retrieve the location information of the session from the corresponding slave EPG server (including The local end or other from the EPG server reads the session data of the IPTV terminal.
  • the new EPG server is notified to update the session information after the session object is newly created. For example, when receiving a service request from the EPG server A to the IPTV terminal, a session object is created. If the IPTV terminal is assigned to the slave EPG server B next time, the EPG server B can acquire the session created from the APG server A node according to the session ID. Object.
  • the embodiment uses the user ID corresponding to the IPTV terminal (assigned when the user registers) as the session ID, so that the sessionID does not need to be delivered from the EPG server.
  • the embodiment also provides a session copy function, that is, the session data is stored in multiple copies. Specifically, after the session object is created persistently, the data is simultaneously copied from the EPG server to other slave EPG servers. Alternatively, the number of copies is set to an odd number, for example, the number of copies is set to three in this embodiment.
  • the EPG server can recover the erroneous data by copying the complete copy, so that the copy of the data is restored to the expected set number to ensure high reliability of the data.
  • the session module when the session module receives the service request sent by the IPTV terminal based on the information from the EPG server, the session module acquires session data of the IPTV terminal stored by the EPG server. After obtaining the session data of the IPTV terminal, verifying the validity of the acquired session data, where verifying the validity of the obtained session data includes: verifying whether the session data is complete, and verifying Whether the session data is in error or the like.
  • the first judging module 10 determines whether the EPG server currently stores the service data pointed by the received service request to determine how to provide the service for the IPTV terminal. For example, it will not be described here.
  • the session module is further configured to: when the session data is not acquired, Sending an acquisition request to the primary EPG server; and, upon receiving the indication information returned by the primary EPG server according to the acquisition request, acquiring the session data from the EPG server corresponding to the indication information.
  • the session module when the session data is corrupted or the session data is created by other EPG servers, the session module will not be able to locally obtain the session data of the corresponding IPTV terminal from the EPG server.
  • the session module when the session data is not obtained, the session module sends an acquisition request to the primary EPG server, so that the primary EPG server sends the acquisition request and the stored session metadata information to the primary EPG server.
  • the session location information (instruction information) of the corresponding session data is fed back from the EPG server.
  • the session module acquires the session data from the EPG server corresponding to the session location information based on the session location information returned by the primary EPG server according to the acquisition request.
  • the foregoing data pushing process is started, and details are not described herein again.
  • the primary EPG server since the primary EPG server also performs a failure process on the timed session, when the session module sends an acquisition request to the primary EPG server to request session data, the primary EPG server may have timed out due to the corresponding session data. No indication is returned. In this embodiment, when the session module does not receive the indication information returned by the primary EPG server, the session module creates the session data of the IPTV terminal, and notifies the primary EPG server to update the session metadata information after the creation is completed, specifically Referring to the foregoing description, details are not described herein again.
  • the foregoing embodiment method can be implemented by means of software plus a necessary general hardware platform, and of course, can also be through hardware, but in many cases, the former is better.
  • Implementation Based on such understanding, the technical solution of the embodiments of the present invention may be embodied in the form of a software product in essence or in the form of a software product stored in a storage medium (such as ROM/RAM, magnetic).
  • the disc, the optical disc includes a plurality of instructions for causing a terminal device (which may be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to perform the method described in various embodiments of the present invention.
  • the above first determining module, processing module, sending module and the like may comprise hardware components, software modules or a combination of hardware and software.
  • the same unit may be implemented by the same hardware/software or by a combination of different hardware/software.
  • the above modules or units may all be located in the same hardware structure, for example, in the same processor; or, the above modules are respectively located in a plurality of hardware structures, and may interact through a communication connection.
  • the invention is applicable to the field of IPTV technology, and is used to avoid the waste of IPTV cluster I/O resources caused by synchronous full amount of WEB content, and can achieve the purpose of improving the working performance of the IPTV cluster.

Landscapes

  • Engineering & Computer Science (AREA)
  • Signal Processing (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Multimedia (AREA)
  • Two-Way Televisions, Distribution Of Moving Picture Or The Like (AREA)
  • Information Transfer Between Computers (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

Disclosed is a data pushing method. The data pushing method comprises: when receiving a service request sent by an IPTV terminal, a secondary EPG server determines whether service data to which the received service request is directed is stored currently; when the service data to which the service request is directed is not stored currently, the secondary EPG server acquires and stores, on the basis of a primary EPG server, the service data to which the service request is directed, and redirects the service request to the primary EPG server, so that the primary EPG server pushes, to the IPTV terminal, the service data to which the received service request is directed; when the service data to which the service request is directed is stored currently, the secondary EPG server sends, to the IPTV terminal, the stored service data to which the service request is directed. Also disclosed is a data pushing apparatus. The present invention can improve the working performance of an IPTV cluster.

Description

数据推送方法及装置Data pushing method and device 技术领域Technical field
本文涉及IPTV技术领域,尤其涉及一种数据推送方法及装置。This document relates to the field of IPTV technology, and in particular, to a data push method and apparatus.
背景技术Background technique
在涉及IPTV(Internet Protocol Television,交互式网络电视)集群的相关技术中,单个EPG(Electronic Program Guide,电子节目指南)服务器存放全量的WEB内容,通常存放有图片40G,第三方模板文件20G,以及大量其它文件等。如果IPTV集群需要新增加一台EPG服务器,则需要管理员手工同步全量的WEB内容,操作十分烦琐,而且,这些全量的WEB内容还需要每天进行增量同步、全量同步,消耗IPTV集群的大量I/O资源,影响IPTV集群的工作性能。相关技术中,存在IPTV集群工作性能较低的问题。In a related technology involving an IPTV (Internet Protocol Television) cluster, a single EPG (Electronic Program Guide) server stores a full amount of WEB content, usually storing a picture 40G, a third-party template file 20G, and A lot of other files, etc. If an IPTV cluster needs to add a new EPG server, the administrator needs to manually synchronize the full amount of WEB content. The operation is very cumbersome. Moreover, these full-scale WEB content also needs to be incrementally synchronized and fully synchronized every day, and consume a large number of I of the IPTV cluster. /O resources, affecting the performance of the IPTV cluster. In the related art, there is a problem that the IPTV cluster has low performance.
发明内容Summary of the invention
本发明的主要目的在于提供一种数据推送方法及装置,旨在提高IPTV集群的工作性能。The main object of the present invention is to provide a data pushing method and apparatus, which aim to improve the working performance of an IPTV cluster.
为实现上述目的,本发明实施例提供一种数据推送方法,所述数据推送方法应用于IPTV集群,所述IPTV集群包括主EPG服务器和多个从EPG服务器,所述数据推送方法包括:To achieve the above object, an embodiment of the present invention provides a data pushing method, where the data pushing method is applied to an IPTV cluster, the IPTV cluster includes a primary EPG server and a plurality of secondary EPG servers, and the data pushing method includes:
在接收到IPTV终端发送的业务请求时,所述从EPG服务器判断当前是否存储有接收的所述业务请求指向的业务数据;When receiving the service request sent by the IPTV terminal, the determining, by the EPG server, whether the received service data pointed by the received service request is currently stored;
在当前未存储有所述业务请求指向的业务数据时,所述从EPG服务器基于所述主EPG服务器获取并存储所述业务请求指向的业务数据,并将所述业务请求重定向至所述主EPG服务器,以供所述主EPG服务器向所述IPTV终端推送接收的所述业务请求所指向的业务数据;When the service data pointed by the service request is not currently stored, the slave EPG server acquires and stores the service data pointed by the service request based on the primary EPG server, and redirects the service request to the primary An EPG server, configured to: send, by the primary EPG server, the service data pointed to by the received service request to the IPTV terminal;
在当前存储有所述业务请求指向的业务数据时,所述从EPG服务器将存储的所述业务请求指向的业务数据发送至所述IPTV终端。When the service data pointed by the service request is currently stored, the EPG server sends the stored service data pointed by the service request to the IPTV terminal.
可选地,所述业务数据包括第一类业务数据和第二类业务数据,所述将所述业务请求重定向至所述主EPG服务器的步骤之前,还包括:Optionally, the service data includes a first type of service data and a second type of service data. Before the step of redirecting the service request to the primary EPG server, the method further includes:
所述从EPG服务器判断所述业务请求指向的业务数据是否为第一类业务数据;Determining, by the EPG server, whether the service data pointed by the service request is the first type of service data;
在所述业务请求指向的业务数据为第一类业务数据时,执行所述将所述业务请求重定向至所述主EPG服务器的步骤;And when the service data pointed to by the service request is the first type of service data, performing the step of redirecting the service request to the primary EPG server;
所述从EPG服务器判断所述业务请求指向的业务数据是否为第一类业务数据的步骤之后,还包括: After the step of determining, by the EPG server, whether the service data pointed to by the service request is the first type of service data, the method further includes:
在所述业务请求指向的业务数据为第二类业务数据,且基于所述主EPG服务器获取到所述业务请求指向的业务数据时,所述从EPG服务器将获取的业务数据加载至所述从EPG服务器的Servlet容器中运行,并将运行的结果作为所述业务请求指向的业务数据返回至所述IPTV终端。When the service data pointed to by the service request is the second type of service data, and the service data pointed to by the service request is obtained by the primary EPG server, the service data acquired by the EPG server is loaded to the slave Running in the Servlet container of the EPG server, and returning the result of the operation as the service data pointed by the service request to the IPTV terminal.
可选地,所述从EPG服务器将存储的所述业务请求指向的业务数据发送至所述IPTV终端的步骤之前,还包括:Optionally, before the step of sending, by the EPG server, the stored service data that is sent by the service request to the IPTV terminal, the method further includes:
在当前存储有所述业务请求指向的业务数据时,所述从EPG服务器对存储的所述业务请求指向的业务数据进行验证操作;When the service data pointed by the service request is currently stored, the EPG server performs a verification operation on the stored service data pointed by the service request;
在验证通过时,执行所述从EPG服务器将存储的所述业务请求指向的业务数据发送至所述IPTV终端的步骤;And performing, when the verification is passed, the step of transmitting, by the EPG server, the service data pointed by the stored service request to the IPTV terminal;
所述从EPG服务器对存储的所述业务请求指向的业务数据进行验证操作的步骤之后,还包括:After the step of performing the verification operation on the service data pointed by the stored service request from the EPG server, the method further includes:
在验证失败时,所述从EPG服务器基于所述主EPG服务器更新存储的所述业务请求指向的业务数据,并将所述业务请求重定向至所述主EPG服务器。When the verification fails, the slave EPG server updates the stored service data pointed by the stored service request based on the primary EPG server, and redirects the service request to the primary EPG server.
可选地,所述从EPG服务器判断当前是否存储有接收的所述业务请求指向的业务数据的步骤之前,还包括:Optionally, before the step of determining, by the EPG server, whether the received service data pointed by the service request is currently stored, the method further includes:
在接收到所述IPTV终端发送的业务请求时,所述从EPG服务器获取存储的所述IPTV终端的session数据;Receiving the stored session data of the IPTV terminal from the EPG server when receiving the service request sent by the IPTV terminal;
所述从EPG服务器对获取的所述session数据的有效性进行验证;Verifying, by the EPG server, the validity of the obtained session data;
在验证通过时,执行所述从EPG服务器判断当前是否存储有接收的所述业务请求指向的业务数据的步骤。When the verification is passed, the step of determining from the EPG server whether the received service data pointed by the service request is currently stored is performed.
可选地,所述从EPG服务器获取存储的所述IPTV终端的session数据的步骤之后,还包括:Optionally, after the step of obtaining the stored session data of the IPTV terminal from the EPG server, the method further includes:
在未获取到所述session数据时,所述从EPG服务器发送获取请求至所述主EPG服务器;When the session data is not obtained, the sending an acquisition request from the EPG server to the primary EPG server;
在接收到所述主EPG服务器根据所述获取请求返回的指示信息时,所述从EPG服务器基于所述指示信息对应的从EPG服务器获取所述session数据。Upon receiving the indication information returned by the primary EPG server according to the acquisition request, the slave EPG server acquires the session data from the EPG server corresponding to the indication information.
此外,为实现上述目的,本发明实施例还提供了一种数据推送装置,所述数据推送装置应用于IPTV集群,所述IPTV集群包括主EPG服务器和多个从EPG服务器,所述数据推送装置包括:In addition, in order to achieve the above object, an embodiment of the present invention further provides a data pushing apparatus, where the data pushing apparatus is applied to an IPTV cluster, where the IPTV cluster includes a primary EPG server and a plurality of secondary EPG servers, and the data pushing apparatus include:
第一判断模块,设置为当其所在从EPG服务器接收到IPTV终端发送的业务请求时,判断其所在从EPG服务器当前是否存储有所述业务请求指向的业务数据;The first judging module is configured to determine, when the EPG server receives the service request sent by the IPTV terminal, whether the EPG server currently stores the service data pointed by the service request;
处理模块,设置为当其所在从EPG服务器当前未存储有所述业务请求指向的业务数据时,基于所述主EPG服务器获取并存储所述业务请求指向的业务数据,并将 所述业务请求重定向至所述主EPG服务器,以供所述主EPG服务器向所述IPTV终端推送接收的所述业务请求所指向的业务数据;a processing module, configured to acquire and store the service data pointed by the service request based on the primary EPG server when the EPG server does not currently store the service data pointed by the service request, and The service request is redirected to the primary EPG server, so that the primary EPG server pushes the received service data pointed by the service request to the IPTV terminal;
发送模块,设置为当其所在从EPG服务器当前存储有所述业务请求指向的业务数据时,将存储的所述业务请求指向的业务数据发送至所述IPTV终端。The sending module is configured to send the stored service data pointed by the service request to the IPTV terminal when the EPG server currently stores the service data pointed by the service request.
可选地,所述业务数据包括第一类业务数据和第二类业务数据,所述数据推送装置还包括第二判断模块,设置为判断所述业务请求指向的业务数据是否为第一类业务数据;Optionally, the service data includes a first type of service data and a second type of service data, and the data pushing device further includes a second determining module, configured to determine whether the service data pointed by the service request is a first type of service. data;
所述处理模块还设置为在所述业务请求指向的业务数据为第一类业务数据时,将所述业务请求重定向至所述主EPG服务器;The processing module is further configured to redirect the service request to the primary EPG server when the service data pointed by the service request is the first type of service data;
所述发送模块还设置为在所述业务请求指向的业务数据为第二类业务数据,且所述处理模块基于所述主EPG服务器获取到所述业务请求指向的业务数据时,将获取的业务数据加载至其所在从EPG服务器的Servlet容器中运行,并将运行的结果作为所述业务请求指向的业务数据返回至所述IPTV终端。The sending module is further configured to: when the service data pointed by the service request is the second type of service data, and the processing module obtains the service data when the service data pointed by the service request is obtained by the primary EPG server The data is loaded into the servlet container where it is located from the EPG server, and the result of the operation is returned to the IPTV terminal as the service data pointed to by the service request.
可选地,所述发送模块还设置为当其所在从EPG服务器当前存储有所述业务请求指向的业务数据时,对存储的所述业务请求指向的业务数据进行验证操作;以及在验证通过时,将存储的所述业务请求指向的业务数据发送至所述IPTV终端;Optionally, the sending module is further configured to: when the EPG server currently stores the service data pointed by the service request, perform verification operation on the stored service data pointed by the service request; and when the verification is passed Transmitting the stored service data pointed by the service request to the IPTV terminal;
所述数据推送装置还包括更新模块,设置为在验证失败时,基于所述主EPG服务器更新存储的所述业务请求指向的业务数据,并将所述业务请求重定向至所述主EPG服务器。The data pushing device further includes an updating module configured to update the stored service data pointed by the service request based on the primary EPG server when the verification fails, and redirect the service request to the primary EPG server.
可选地,所述数据推送装置还包括会话模块,设置为当其所在从EPG服务器接收到所述IPTV终端发送的业务请求时,获取其所在从EPG服务器存储的所述IPTV终端的session数据;以及对获取的所述session数据的有效性进行验证;Optionally, the data pushing device further includes a session module, configured to acquire session data of the IPTV terminal stored by the EPG server when the service request sent by the IPTV terminal is received from the EPG server; And verifying the validity of the obtained session data;
所述第一判断模块还设置为在验证通过时,判断其所在从EPG服务器当前是否存储有接收的所述业务请求指向的业务数据。The first determining module is further configured to determine, when the verification passes, whether the service data pointed to by the received service request is currently stored by the EPG server.
可选地,所述会话模块还设置为在未获取到所述session数据时,发送获取请求至所述主EPG服务器;以及在接收到所述主EPG服务器根据所述获取请求返回的指示信息时,基于所述指示信息对应的从EPG服务器获取所述session数据。Optionally, the session module is further configured to: when the session data is not acquired, send an acquisition request to the primary EPG server; and when receiving the indication information returned by the primary EPG server according to the acquisition request And acquiring the session data from the EPG server corresponding to the indication information.
本发明实施例提出的数据推送方法及装置,在包括主EPG服务器和从EPG服务器的IPTV集群中,将全量的WEB内容(业务数据)分离到各从EPG服务器,各从EPG服务器基于存储的WEB内容以及接收的IPTV终端的业务请求提供服务,并按需更新存储的WEB内容。相较于相关技术,本发明实施例避免了由同步全量WEB内容导致的IPTV集群I/O资源浪费,能够达到提高IPTV集群工作性能的目的。The data pushing method and device according to the embodiment of the present invention separates the full amount of WEB content (service data) into each slave EPG server in the IPTV cluster including the main EPG server and the EPG server, and each slave EPG server is based on the stored WEB. The content and the received service request of the IPTV terminal provide services and update the stored WEB content as needed. Compared with the related art, the embodiment of the present invention avoids the waste of IPTV cluster I/O resources caused by synchronizing the full amount of WEB content, and can achieve the purpose of improving the working performance of the IPTV cluster.
附图说明 DRAWINGS
图1为本发明实施例的数据推送方法应用的IPTV集群的拓扑结构示例图;1 is a diagram showing an example of a topology structure of an IPTV cluster to which a data push method is applied according to an embodiment of the present invention;
图2为本发明实施例的数据推送方法第一实施例的流程示意图;2 is a schematic flowchart of a first embodiment of a data pushing method according to an embodiment of the present invention;
图3为本发明实施例的数据推送装置第一实施例的功能模块示意图。FIG. 3 is a schematic diagram of functional modules of a first embodiment of a data pushing apparatus according to an embodiment of the present invention.
本发明目的的实现、功能特点及优点将结合实施例,参照附图做进一步说明。The implementation, functional features, and advantages of the present invention will be further described in conjunction with the embodiments.
具体实施方式detailed description
应当理解,此处所描述的具体实施例仅仅用以解释本发明,并不用于限定本发明。It is understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
本发明提供一种数据推送方法,所述数据推送方法应用于IPTV集群,参照图1,所述IPTV集群包括主EPG服务器和多个从EPG服务器,参照图2,在本发明数据推送方法的第一实施例中,所述数据推送方法包括:The present invention provides a data push method, and the data push method is applied to an IPTV cluster. Referring to FIG. 1, the IPTV cluster includes a main EPG server and a plurality of slave EPG servers. Referring to FIG. 2, in the data push method of the present invention. In an embodiment, the data pushing method includes:
步骤S10,在接收到IPTV终端发送的业务请求时,所述从EPG服务器判断当前是否存储有接收的所述业务请求指向的业务数据;Step S10, when receiving the service request sent by the IPTV terminal, determining, by the EPG server, whether the received service data pointed by the service request is currently stored;
众所周知的,普通的WEB服务器中内容是存放在本地的,但对于EPG服务器来说,情况十分特殊,由于WEB内容体量非常大,主要是图片和第三方模板(如JSP文件等),而且随着业务扩展,4K极清上线,各种增值业务的蓬勃发展,这部分内容也会成倍增长,会导致EPG服务器在内容同步方面不堪重负。WEB内容虽说体量大,但是在现网环境中每个EPG服务器中真正被访问到的内容却是占极少的一部分,所以WEB内容全部放在EPG服务器本地是I/O资源的极大浪费,影响IPTV集群的工作性能。As is well known, the content of the ordinary WEB server is stored locally, but for the EPG server, the situation is very special, because the WEB content is very large, mainly the picture and third-party templates (such as JSP files, etc.), and With the expansion of business, 4K is extremely clear, and various value-added services are booming. This part of the content will also grow exponentially, which will cause the EPG server to be overwhelmed in content synchronization. Although WEB content is large, the content that is actually accessed in each EPG server in the live network environment is a very small part. Therefore, it is a great waste of I/O resources to place all WEB content locally on the EPG server. , affect the performance of the IPTV cluster.
基于前述缺陷,本实施例的主旨在于将EPG服务器的WEB内容进行分离,为此,本实施例提出如图1所示的分布式IPTV集群架构,如图1所示,相较于相关技术,本实施例引入了主EPG服务器和从EPG服务器两种WEB容器,其中,全部WEB内容放在主EPG服务器上,所述主EPG服务器负责分发用户的WEB请求,进行负载均衡;所述从EPG服务器负责拦截并处理用户的WEB请求,所述从EPG服务器在处理用户的WEB请求时从主EPG服务器下载相应的WEB内容至本地的WEB容器中。本领域技术人员可以理解的是,从EPG服务器这种按需下载的方式可以保证从EPG服务器本地的WEB容器内只有少量的内容,且不用关心WEB内容的同步,而且下载到WEB容器中的WEB内容是可以复用的,如果本地已经存在则不需要再次下载。此外,主EPG服务器可以自动感知集群中从EPG服务器的工作状态(如通过心跳报文进行监测),当某台从EPG服务器状态异常时,主EPG服务器可把此从EPG服务器从集群中剔除,不再向此从EPG服务器分发请求,当此台从EPG服务器状态恢复正常时,主EPG服务器又可以把它加入到集群中提供服务。此外,主EPG服务器还可以自动感知集群新加入的从EPG服务器,可以使集群在不重新配置或重启的情况下平滑扩容,应对越来越高的性能要求。需要说明的是,IPTV集群的用户 即IPTV终端,IPTV终端可以包括计算机、机顶盒、智能电视或者智能手机等移动终端中的至少一种。Based on the foregoing deficiencies, the main purpose of this embodiment is to separate the WEB content of the EPG server. To this end, the present embodiment provides a distributed IPTV cluster architecture as shown in FIG. 1 , as shown in FIG. 1 , compared with related technologies. This embodiment introduces two types of WEB containers, namely, a primary EPG server and a secondary EPG server, wherein all WEB content is placed on the primary EPG server, and the primary EPG server is responsible for distributing the user's WEB request for load balancing; the secondary EPG server Responsible for intercepting and processing the user's WEB request, the slave EPG server downloads the corresponding WEB content from the main EPG server to the local WEB container when processing the user's WEB request. Those skilled in the art can understand that the on-demand downloading method from the EPG server can ensure that only a small amount of content is contained in the WEB container local to the EPG server, and there is no need to care about the synchronization of the WEB content, and the WEB downloaded to the WEB container. The content is reusable and does not need to be downloaded again if it already exists locally. In addition, the primary EPG server can automatically sense the working status of the EPG server in the cluster (such as monitoring through heartbeat packets). When a certain EPG server is abnormal, the primary EPG server can remove the EPG server from the cluster. The request is no longer distributed from the EPG server. When the station returns from the EPG server status, the main EPG server can add it to the cluster to provide services. In addition, the primary EPG server can automatically sense the newly added slave EPG server, which enables the cluster to be smoothly expanded without reconfiguration or restart, to meet higher and higher performance requirements. It should be noted that the users of the IPTV cluster That is, the IPTV terminal, the IPTV terminal may include at least one of a mobile terminal such as a computer, a set top box, a smart TV, or a smart phone.
本实施例中,所述主EPG服务器在为IPTV终端分配提供服务的从EPG服务器时,采用IP_Hash算法结合各从EPG服务器的负载状态进行加权,实时为IPTV终端分配负载较轻的从EPG服务器。具体的,所述主EPG服务器将集群中各从EPG服务器虚拟成n个节点,均匀分布到hash环上;并在接收到IPTV终端发送的原始业务请求时,根据配置的参数计算出一个hash值,在前述hash环上查找计算的hash值附近的虚拟节点,然后根据附近的虚拟节点的负载状态进行加权,确定负载较轻的虚拟节点,将所述负载较轻的虚拟节点对应的从EPG服务器信息发送至所述IPTV终端,由该虚拟节点对应的从EPG服务器为所述IPTV终端提供服务。需要说明的是,所述IPTV终端在接收到所述主EPG服务器发送的从EPG服务器信息之后,将原始业务请求重新打包为新的业务请求发送至所述从EPG服务器,而且,后续的其它业务请求也均发送至分配的从EPG服务器。In this embodiment, when the primary EPG server allocates the EPG server that provides the service to the IPTV terminal, the IP_Hash algorithm is used to combine the load status of each EPG server to perform weighting, and the slave IPTV terminal is allocated a lightly loaded slave EPG server in real time. Specifically, the primary EPG server virtualizes each EPG server in the cluster into n nodes and evenly distributes them on the hash ring; and when receiving the original service request sent by the IPTV terminal, calculates a hash value according to the configured parameters. Finding the virtual node in the vicinity of the calculated hash value on the hash ring, and then weighting according to the load state of the nearby virtual node to determine the virtual node with light load, and the slave EPG server corresponding to the lighter virtual node The information is sent to the IPTV terminal, and the IPTV terminal is served by the EPG server corresponding to the virtual node. It should be noted that, after receiving the slave EPG server information sent by the primary EPG server, the IPTV terminal repackages the original service request into a new service request and sends the message to the slave EPG server, and the subsequent other services. Requests are also sent to the assigned slave EPG server.
所述从EPG服务器在接收到所述IPTV终端基于所述从EPG服务器信息发送的业务请求时,判断当前是否存储有接收的所述业务请求指向的业务数据(即WEB内容),以根据判断结果执行相应的操作,例如,在存储有所述业务请求指向的业务数据时,可直接将存储的所述业务请求指向的业务数据发送至所述IPTV终端。When receiving the service request sent by the IPTV terminal based on the information from the EPG server, the slave EPG server determines whether the service data (ie, WEB content) pointed to by the received service request is currently stored, according to the judgment result. The corresponding operation is performed, for example, when the service data pointed by the service request is stored, the stored service data pointed by the service request may be directly sent to the IPTV terminal.
步骤S20,在当前未存储有所述业务请求指向的业务数据时,所述从EPG服务器基于所述主EPG服务器获取并存储所述业务请求指向的业务数据,并将所述业务请求重定向至所述主EPG服务器,以供所述主EPG服务器向所述IPTV终端推送接收的所述业务请求所指向的业务数据;Step S20: When the service data pointed by the service request is not currently stored, the slave EPG server acquires and stores the service data pointed by the service request based on the primary EPG server, and redirects the service request to The primary EPG server, for the primary EPG server to push the service data pointed to by the received service request to the IPTV terminal;
本实施例中,在当前未存储有所述业务请求指向的业务数据时,所述从EPG服务器将所述业务请求指向的业务数据加入到下载队列,由下载队列将所述业务请求指向的业务数据从所述主EPG服务器下载到本地。所述从EPG服务器将所述业务请求指向的业务数据加入到下载队列同时,将接收的所述业务请求重定向至所述主EPG服务器,由所述主EPG服务器向所述IPTV终端推送接收的所述业务请求所指向的业务数据。本领域技术人员可以理解的是,在本实施例中,所述从EPG服务器和所述IPTV终端可以同时获取到所述业务请求指向的业务数据,所述IPTV终端即可将获取到的业务数据呈现给用户。此外,当所述业务请求指向的业务数据再次被请求时,所述业务请求指向的业务数据即可直接从本地获取。In this embodiment, when the service data pointed by the service request is not currently stored, the EPG server adds the service data pointed by the service request to the download queue, and the service that the service request points to by the download queue Data is downloaded from the primary EPG server to the local. And adding, by the EPG server, the service data pointed by the service request to the download queue, and redirecting the received service request to the primary EPG server, where the primary EPG server pushes and receives the received data to the IPTV terminal. The business data pointed to by the service request. It can be understood by those skilled in the art that, in this embodiment, the slave EPG server and the IPTV terminal can simultaneously obtain the service data pointed by the service request, and the IPTV terminal can obtain the acquired service data. Presented to the user. In addition, when the service data pointed by the service request is requested again, the service data pointed by the service request can be directly obtained from the local.
步骤S30,在当前存储有所述业务请求指向的业务数据时,所述从EPG服务器将存储的所述业务请求指向的业务数据发送至所述IPTV终端。In step S30, when the service data pointed by the service request is currently stored, the EPG server sends the stored service data pointed by the service request to the IPTV terminal.
基于前述描述,本领域技术人员可以理解的是,所述从EPG服务器存储业务数据的目的在于再次接收到指向存储的业务数据的业务请求时,直接用存储的所述业务数据提供服务。因此,本实施例中,在当前存储有所述业务请求指向的业务数据时, 所述从EPG服务器直接将存储的所述业务请求指向的业务数据发送至所述IPTV终端,由IPTV终端将所述业务请求指向的业务数据呈现给用户。Based on the foregoing description, those skilled in the art can understand that the purpose of storing the service data from the EPG server is to directly provide the service with the stored service data when receiving the service request for the stored service data again. Therefore, in this embodiment, when the service data pointed by the service request is currently stored, The service data pointed to by the stored service request is directly sent from the EPG server to the IPTV terminal, and the IPTV terminal presents the service data pointed by the service request to the user.
此外,由于主EPG服务器在IPTV集群中担当“首脑”作用,若主EPG服务器工作异常,整个IPTV集群将无法正常提供对外服务。因此,为提升IPTV集群的稳定性,本实施例还引入了冗余机制。具体的,如图1所示,本实施例提出的IPTV集群还包括备EPG服务器,用作所述主EPG服务器的热备份。例如,所述主EPG服务器工作异常时,进行主EPG服务器和备EPG服务器的切换,由所述备EPG服务器接管所述主EPG服务器。In addition, because the primary EPG server plays the role of “heads” in the IPTV cluster, if the primary EPG server works abnormally, the entire IPTV cluster will not be able to provide external services normally. Therefore, in order to improve the stability of the IPTV cluster, the embodiment also introduces a redundancy mechanism. Specifically, as shown in FIG. 1 , the IPTV cluster proposed in this embodiment further includes a backup EPG server, which is used as a hot backup of the primary EPG server. For example, when the primary EPG server is abnormal, the primary EPG server and the standby EPG server are switched, and the standby EPG server takes over the primary EPG server.
进一步的,在本实施例中,所述主EPG服务器还定时进行本地WEB内容的同步,如图1所示,本实施例提出的IPTV集群还包括FTP服务器,所述主EPG服务器基于所述FTP服务器进行本地WEB内容的同步,例如,所述主EPG服务器从所述FTP服务器获取到新的图片文件存储在本地。需要说明的是,所述主EPG服务器在完成同步之后,还下发内容同步通知至集群中各从EPG服务器,通知各从EPG服务器与所述主EPG服务器进行内容同步;从EPG服务器在接收到所述主EPG服务器下发的内容同步通知之后,校验本地存储的WEB内容,以进行本地WEB内容的更新、新增和/或删除。Further, in this embodiment, the primary EPG server also periodically synchronizes the local WEB content. As shown in FIG. 1 , the IPTV cluster proposed in this embodiment further includes an FTP server, and the primary EPG server is based on the FTP. The server performs synchronization of the local WEB content. For example, the main EPG server acquires a new picture file from the FTP server and stores it locally. It should be noted that after the synchronization is completed, the primary EPG server also sends a content synchronization notification to each slave EPG server in the cluster, and notifies each slave EPG server to perform content synchronization with the primary EPG server; After the content synchronization notification sent by the primary EPG server, the locally stored WEB content is verified to update, add, and/or delete the local WEB content.
本实施例提出的数据推送方法,在包括主EPG服务器和从EPG服务器的IPTV集群中,将全量的WEB内容(业务数据)分离到各从EPG服务器,各从EPG服务器基于存储的WEB内容以及接收的IPTV终端的业务请求提供服务,并按需更新存储的WEB内容。相较于相关技术,本发明实施例避免了由同步全量WEB内容导致的IPTV集群I/O资源浪费,能够达到提高IPTV集群工作性能的目的。The data pushing method proposed in this embodiment separates the full amount of WEB content (service data) into each slave EPG server in the IPTV cluster including the primary EPG server and the slave EPG server, and each slave EPG server is based on the stored WEB content and receiving. The IPTV terminal's service request provides services and updates the stored WEB content as needed. Compared with the related art, the embodiment of the present invention avoids the waste of IPTV cluster I/O resources caused by synchronizing the full amount of WEB content, and can achieve the purpose of improving the working performance of the IPTV cluster.
进一步的,可基于上述第一实施例,提出本发明实施例的数据推送方法的第二实施例,在本实施例中,所述业务数据包括第一类业务数据和第二类业务数据,所述步骤S20中所述将所述业务请求重定向至所述主EPG服务器之前,还可包括:Further, based on the foregoing first embodiment, a second embodiment of the data pushing method in the embodiment of the present invention is provided. In this embodiment, the service data includes a first type of service data and a second type of service data. Before the redirecting the service request to the primary EPG server in the step S20, the method may further include:
所述从EPG服务器判断所述业务请求指向的业务数据是否为第一类业务数据;Determining, by the EPG server, whether the service data pointed by the service request is the first type of service data;
在所述业务请求指向的业务数据为第一类业务数据时,执行所述将所述业务请求重定向至所述主EPG服务器的步骤;And when the service data pointed to by the service request is the first type of service data, performing the step of redirecting the service request to the primary EPG server;
所述从EPG服务器判断所述业务请求指向的业务数据是否为第一类业务数据的步骤之后,还包括:After the step of determining, by the EPG server, whether the service data pointed to by the service request is the first type of service data, the method further includes:
在所述业务请求指向的业务数据为第二类业务数据时,且基于所述主EPG服务器获取到所述业务请求指向的业务数据时,When the service data pointed to by the service request is the second type of service data, and based on the service data pointed to by the service request by the primary EPG server,
所述从EPG服务器将获取的业务数据加载至所述从EPG服务器的Servlet容器中运行,并将运行的结果作为所述业务请求指向的业务数据返回至所述IPTV终端。The service data acquired from the EPG server is loaded into the servlet container of the EPG server, and the result of the operation is returned to the IPTV terminal as the service data pointed by the service request.
需要说明的是,资源可以作为静态资源或动态资源进行引用,这是通过使用 StaticResource标记扩展或DynamicResource标记扩展完成的。其中,静态资源是指在被用户请求时可直接反馈至用户的资源;动态资源是指在被用户请求时,根据不同的用户运行动态资源以反馈不同的结果。本实施例中,在接收到IPTV终端的业务请求时,还需要根据接收的业务请求携带的StaticResource标记扩展或DynamicResource标记扩展确定需要进行的操作。It should be noted that resources can be referenced as static or dynamic resources, which is used by The StaticResource tag extension or the DynamicResource tag extension is done. The static resource refers to a resource that can be directly fed back to the user when requested by the user; the dynamic resource refers to when the user requests, the dynamic resource is run according to different users to feed back different results. In this embodiment, when receiving the service request of the IPTV terminal, it is also required to determine the operation to be performed according to the StaticResource mark extension or the DynamicResource mark extension carried in the received service request.
具体的,在当前未存储有所述业务请求指向的业务数据,且所述业务请求携带有StaticResource标记扩展时,说明所述IPTV终端请求的是当前未存储的静态资源(第一类业务数据),不需要消耗处理资源运行,此时所述从EPG服务器将所述业务请求指向的业务数据加入到下载队列,由下载队列将所述业务请求指向的业务数据从所述主EPG服务器下载到本地。所述从EPG服务器将所述业务请求指向的业务数据加入到下载队列同时,将接收的所述业务请求重定向至所述主EPG服务器,由所述主EPG服务器向所述IPTV终端推送接收的所述业务请求所指向的业务数据。Specifically, when the service data pointed by the service request is not currently stored, and the service request carries the StaticResource mark extension, the IPTV terminal requests the static resource that is not currently stored (the first type of service data). The service data pointed to by the service request is added to the download queue from the EPG server, and the service data pointed by the service request is downloaded from the primary EPG server to the local by the download queue. . And adding, by the EPG server, the service data pointed by the service request to the download queue, and redirecting the received service request to the primary EPG server, where the primary EPG server pushes and receives the received data to the IPTV terminal. The business data pointed to by the service request.
在当前未存储有所述业务请求指向的业务数据,且所述业务请求携带有DynamicResource标记扩展时,说明所述IPTV终端请求的是当前未存储的动态资源(第二类业务数据),需要消耗处理资源运行,此时所述从EPG服务器将所述业务请求指向的业务数据加入到下载队列,由下载队列将所述业务请求指向的业务数据从所述主EPG服务器下载到本地。在将所述业务请求指向的业务数据从所述主EPG服务器下载到本地之后,所述从EPG服务器将下载的业务数据加载至所述从EPG服务器的Servlet容器中运行,并将运行的结果作为所述业务请求指向的业务数据返回至所述IPTV终端,以避免造成对主EPG服务器处理资源的不必要占用,从而提升IPTV集群的工作性能。When the service data pointed to by the service request is not currently stored, and the service request carries the DynamicResource tag extension, the IPTV terminal requests that the dynamic resource that is not currently stored (the second type of service data) needs to be consumed. The processing resource is running. At this time, the service data pointed by the service request is added to the download queue from the EPG server, and the service data pointed by the service request is downloaded from the main EPG server to the local by the download queue. After downloading the service data pointed by the service request from the primary EPG server to the local area, the slave EPG server loads the downloaded service data into the servlet container of the EPG server, and uses the running result as The service data pointed to by the service request is returned to the IPTV terminal to avoid unnecessary occupation of the processing resources of the primary EPG server, thereby improving the working performance of the IPTV cluster.
在当前存储有所述业务请求指向的业务数据,且所述业务请求携带有StaticResource标记扩展时,说明所述IPTV终端请求的是当前存储的静态资源(第一类业务数据),不需要消耗处理资源运行,直接将存储的所述业务请求指向的业务数据发送至所述IPTV终端,供所述IPTV终端将所述业务请求指向的业务数据呈现给用户。When the service data pointed by the service request is currently stored, and the service request carries the StaticResource mark extension, the IPTV terminal requests the currently stored static resource (the first type of service data), and does not need to be processed. The resource operation directly sends the stored service data pointed to by the service request to the IPTV terminal, where the IPTV terminal presents the service data pointed by the service request to the user.
在当前存储有所述业务请求指向的业务数据,且所述业务请求携带有DynamicResource标记扩展时,说明所述IPTV终端请求的是当前存储的动态资源(第一类业务数据),需要消耗处理资源运行,此时所述从EPG服务器将存储的所述业务请求指向的业务数据加载至所述从EPG服务器的Servlet容器中运行,并将运行的结果作为所述业务请求指向的业务数据返回至所述IPTV终端。When the service data pointed to by the service request is currently stored, and the service request carries the DynamicResource tag extension, the IPTV terminal requests the currently stored dynamic resource (the first type of service data), and needs to consume the processing resource. Running, at this time, the EPG server loads the stored service data pointed by the service request into the Servlet container of the EPG server, and returns the running result as the service data pointed by the service request to the office. Said IPTV terminal.
进一步的,在本实施例中,所述主EPG服务器在与所述FTP服务器进行内容同步时,在从所述FTP服务器获取到动态资源时,需要将获取的动态资源进行预编译,并存储预编译对象,例如,所述主EPG服务器在从所述FTP服务器获取到JSP文件之后,将获取的JSP文件预编译成class文件存储,以供所述从EPG服务器在需要时 获取并加载运行。Further, in this embodiment, when the content is synchronized with the FTP server, the main EPG server needs to pre-compile the acquired dynamic resources and obtain the pre-compilation when acquiring the dynamic resources from the FTP server. Compiling the object, for example, after the main EPG server obtains the JSP file from the FTP server, pre-compiling the obtained JSP file into a class file storage for the slave EPG server when needed Get and load the run.
进一步的,基于上述第一实施例,提出本发明数据推送方法的第三实施例,在本实施例中,所述步骤S30之前,还可包括:Further, based on the foregoing first embodiment, a third embodiment of the data pushing method of the present invention is proposed. In this embodiment, before the step S30, the method may further include:
在当前存储有所述业务请求指向的业务数据时,所述从EPG服务器对存储的所述业务请求指向的业务数据进行验证操作;When the service data pointed by the service request is currently stored, the EPG server performs a verification operation on the stored service data pointed by the service request;
在验证通过时,执行所述步骤S30;When the verification is passed, the step S30 is performed;
所述从EPG服务器对存储的所述业务请求指向的业务数据进行验证操作的步骤之后,还包括:After the step of performing the verification operation on the service data pointed by the stored service request from the EPG server, the method further includes:
在验证失败时,所述从EPG服务器基于所述主EPG服务器更新存储的所述业务请求指向的业务数据,并将所述业务请求重定向至所述主EPG服务器。When the verification fails, the slave EPG server updates the stored service data pointed by the stored service request based on the primary EPG server, and redirects the service request to the primary EPG server.
众所周知的,数据在网络传输过程中,存在数据包丢失和数据包无序等问题,因此,本实施例在进行内容分离时,所述从EPG服务器分离存储的业务数据可能与所述主EPG服务器存储的原始业务数据不同,为确保能够正常为用户提供服务,所述从EPG服务器在提供服务之前还需要对业务数据进行验证操作。As is well known, in the network transmission process, there are problems such as data packet loss and data packet disorder. Therefore, in the embodiment, when the content separation is performed, the service data separated from the EPG server may be related to the primary EPG server. The stored original service data is different. To ensure that the user can be served normally, the slave EPG server needs to perform verification operations on the service data before providing the service.
具体的,在当前存储有所述业务请求指向的业务数据时,所述从EPG服务器对存储的所述业务请求指向的业务数据进行验证操作,例如,本实施例采用CRC校验(Cyclic Redundancy Check,循环冗余校验)对存储的所述业务请求指向的业务数据的完整性进行验证。其中,在存储的所述业务请求指向的业务数据验证通过时,所述从EPG服务器直接将存储的所述业务请求指向的业务数据发送至所述IPTV终端,由所述IPTV终端将所述业务请求指向的业务数据呈现给用户;在存储的所述业务请求指向的业务数据验证失败时,所述从EPG服务器将所述业务请求指向的业务数据加入到下载队列,由下载队列将所述业务请求指向的业务数据从所述主EPG服务器下载到本地,并替换本地已存储的所述业务请求指向的业务数据。所述从EPG服务器将所述业务请求指向的业务数据加入到下载队列同时,将接收的所述业务请求重定向至所述主EPG服务器,由所述主EPG服务器向所述IPTV终端推送接收的所述业务请求所指向的业务数据。Specifically, when the service data pointed by the service request is currently stored, the EPG server performs a verification operation on the service data pointed by the stored service request, for example, the CRC check (Cyclic Redundancy Check) is used in this embodiment. , Cyclic Redundancy Check) verifies the integrity of the stored service data pointed to by the service request. The service data pointed to by the stored service request is directly sent from the EPG server to the IPTV terminal, where the service is sent by the IPTV terminal, when the stored service data pointed to by the service request is verified. The service data pointed to by the request is presented to the user; when the stored service data verification pointed by the service request fails, the EPG server adds the service data pointed by the service request to the download queue, and the service is sent by the download queue. The service data pointed to by the request is downloaded from the main EPG server to the locality, and replaces the service data pointed to by the locally stored service request. And adding, by the EPG server, the service data pointed by the service request to the download queue, and redirecting the received service request to the primary EPG server, where the primary EPG server pushes and receives the received data to the IPTV terminal. The business data pointed to by the service request.
进一步的,基于前述任一实施例,提出本发明实施例数据推送方法的第四实施例,在本实施例中,所述步骤S10之前,还可包括:Further, based on any of the foregoing embodiments, a fourth embodiment of the data pushing method of the embodiment of the present invention is provided. In this embodiment, before the step S10, the method may further include:
在接收到所述IPTV终端发送的业务请求时,所述从EPG服务器获取存储的所述IPTV终端的session数据;Receiving the stored session data of the IPTV terminal from the EPG server when receiving the service request sent by the IPTV terminal;
所述从EPG服务器对获取的所述session数据的有效性进行验证;Verifying, by the EPG server, the validity of the obtained session data;
在验证通过时,执行所述步骤S10。When the verification is passed, the step S10 is performed.
需要说明的是,在第一实施例的基础上,本实施例进一步提出一种分布式session 的方案,以提升IPTV集群的可伸缩性。具体的,所述主EPG服务器记录记录维护session的元数据信息,包括版本信息、session位置、副本信息,以及从EPG服务器退出时session信息恢复、重新分配、对超时的session信息做失效处理等;所述从EPG服务器用于在有新的IPTV终端的业务请求时,从所述主EPG服务器获取是否存在此IPTV终端的session信息,如果有取出session的位置信息从相应的从EPG服务器(包括本端或其它从EPG服务器)中读出IPTV终端的session数据,如果没有则新创建session对象后通知主EPG服务器更新session信息。例如,当从EPG服务器A接受到IPTV终端的业务请求时创建一个session对象,若此IPTV终端下一次被分配到从EPG服务器B,从EPG服务器B可以根据sessionID获取从EPG服务器A节点创建的session对象。可选地,本实施例使用IPTV终端对应的用户ID(在用户注册时分配)作为sessionID,这样sessionID就不需要在从EPG服务器中进行传递。It should be noted that, based on the first embodiment, this embodiment further provides a distributed session. The solution to improve the scalability of the IPTV cluster. Specifically, the primary EPG server records metadata information of the maintenance session, including version information, session location, copy information, and recovery, re-allocation, and invalidation of time-out session information when exiting from the EPG server; The slave EPG server is configured to obtain, from the primary EPG server, session information of the IPTV terminal when there is a service request of the new IPTV terminal, if the location information of the session is taken out from the corresponding slave EPG server (including the The session data of the IPTV terminal is read from the EPG server or the other, and if not, the main EPG server is notified to update the session information after newly creating the session object. For example, when receiving a service request from the EPG server A to the IPTV terminal, a session object is created. If the IPTV terminal is assigned to the slave EPG server B next time, the EPG server B can acquire the session created from the APG server A node according to the session ID. Object. Optionally, the embodiment uses the user ID corresponding to the IPTV terminal (assigned when the user registers) as the session ID, so that the sessionID does not need to be delivered from the EPG server.
此外,为防止数据损毁或从EPG服务器故障导致session丢失的问题,本实施例还提供session副本功能,即session数据存放多份。具体的,在session对象创建持久化后,从EPG服务器同时复制数据到其他从EPG服务器上。可选地,将副本数设置为奇数,例如本实施例将副本数设置为3个。当本地的session数据出错时,从EPG服务器可以通过复制完整的副本来治愈那些出错的数据,使得数据的副本恢复到预期设定的数量来保证数据的高可靠性。In addition, in order to prevent the data from being damaged or the session is lost due to the failure of the EPG server, the embodiment also provides a session copy function, that is, the session data is stored in multiple copies. Specifically, after the session object is created persistently, the data is simultaneously copied from the EPG server to other slave EPG servers. Alternatively, the number of copies is set to an odd number, for example, the number of copies is set to three in this embodiment. When the local session data is in error, the EPG server can recover the erroneous data by copying the complete copy, so that the copy of the data is restored to the expected set number to ensure high reliability of the data.
本实施例中,在接收到所述IPTV终端基于所述从EPG服务器信息发送的业务请求时,所述从EPG服务器获取存储的所述IPTV终端的session数据。在获取到所述IPTV终端的session数据之后,所述从EPG服务器对获取的所述session数据的有效性进行验证,其中,对获取的所述session数据的有效性进行验证包括:验证所述session数据是否完整,验证所述session数据是否出错等。在验证通过时,所述从EPG服务器判断当前是否存储有接收的所述业务请求指向的业务数据,以确定如何为所述IPTV终端提供服务,具体可参照前述实施例,此处不再赘述。In this embodiment, when receiving the service request sent by the IPTV terminal based on the information from the EPG server, the stored session data of the IPTV terminal is obtained from the EPG server. After obtaining the session data of the IPTV terminal, the validating the validity of the obtained session data from the EPG server, wherein verifying the validity of the obtained session data comprises: verifying the session Whether the data is complete, verify whether the session data is in error, etc. When the verification is passed, the EPG server determines whether the service data pointed by the received service request is currently stored to determine how to provide the service for the IPTV terminal. For details, refer to the foregoing embodiment, and details are not described herein again.
进一步的,在本实施例中,在未获取到所述session数据时,所述从EPG服务器发送获取请求至所述主EPG服务器;Further, in this embodiment, when the session data is not acquired, the sending an acquisition request from the EPG server to the primary EPG server;
在接收到所述主EPG服务器根据所述获取请求返回的指示信息时,所述从EPG服务器基于所述指示信息对应的从EPG服务器获取所述session数据。Upon receiving the indication information returned by the primary EPG server according to the acquisition request, the slave EPG server acquires the session data from the EPG server corresponding to the indication information.
基于前述描述,本领域技术人员可以理解的是,当session数据损毁或者session数据由其他从EPG服务器创建时,所述从EPG服务器将无法从本地获取到相应IPTV终端的session数据。本实施例中,在未获取到所述session数据时,所述从EPG服务器发送获取请求至所述主EPG服务器,以供主EPG服务器根据接收的获取请求以及存储的session元数据信息,向所述从EPG服务器反馈相应session数据的session位置信息(指示信息)。在接收到所述主EPG服务器根据所述获取请求返回的session位置信息时,所述从EPG服务器基于所述session位置信息对应的从EPG服务器获 取所述session数据。在获取到所述session数据之后,开始前述数据推送流程,具体可参照前述实施例,此处不再赘述。Based on the foregoing description, those skilled in the art can understand that when the session data is corrupted or the session data is created by other EPG servers, the slave EPG server cannot obtain the session data of the corresponding IPTV terminal locally. In this embodiment, when the session data is not obtained, the EPG server sends an acquisition request to the primary EPG server, so that the primary EPG server can provide information according to the received acquisition request and the stored session metadata information. The session location information (instruction information) of the corresponding session data is fed back from the EPG server. Upon receiving the session location information returned by the primary EPG server according to the acquisition request, the slave EPG server obtains from the EPG server corresponding to the session location information. Take the session data. After the session data is obtained, the foregoing data pushing process is started. For details, refer to the foregoing embodiment, and details are not described herein again.
进一步的,由于所述主EPG服务器还对超时的session做失效处理,所述从EPG服务器向所述主EPG服务器发送获取请求以请求session数据时,所述主EPG服务器可能由于相应session数据已超时而无指示信息返回。本实施例中,所述从EPG服务器在未接收到所述主EPG服务器返回的指示信息时,创建所述IPTV终端的session数据,并在完成创建后通知主EPG服务器更新session元数据信息,具体可参照前述描述,此处不再赘述。Further, since the primary EPG server also performs a failure process on the timeout session, when the slave EPG server sends an acquisition request to the primary EPG server to request session data, the primary EPG server may have timed out due to the corresponding session data. No indication is returned. In this embodiment, the slave EPG server creates the session data of the IPTV terminal when the indication information returned by the primary EPG server is not received, and notifies the primary EPG server to update the session metadata information after the completion of the creation. Reference may be made to the foregoing description, and details are not described herein again.
本发明实施例还提供一种数据推送装置,所述数据推送装置应用于IPTV集群,参照图1,所述IPTV集群包括主EPG服务器和多个从EPG服务器,参照图3,在本发明实施例的数据推送装置的第一实施例中,所述数据推送装置包括:The embodiment of the present invention further provides a data pushing device, where the data pushing device is applied to an IPTV cluster. Referring to FIG. 1, the IPTV cluster includes a primary EPG server and a plurality of secondary EPG servers. Referring to FIG. 3, in the embodiment of the present invention, In a first embodiment of the data pushing device, the data pushing device comprises:
第一判断模块10,用于当其所在从EPG服务器接收到IPTV终端发送的业务请求时,判断其所在从EPG服务器当前是否存储有所述业务请求指向的业务数据;The first judging module 10 is configured to determine, when the EPG server receives the service request sent by the IPTV terminal, whether the EPG server currently stores the service data pointed by the service request;
众所周知的,普通的WEB服务器中内容是存放在本地的,但对于EPG服务器来说,情况十分特殊,由于WEB内容体量非常大,主要是图片和第三方模板(如JSP文件等),而且随着业务扩展,4K极清上线,各种增值业务的蓬勃发展,这部分内容也会成倍增长,会导致EPG服务器在内容同步方面不堪重负。WEB内容虽说体量大,但是在现网环境中每个EPG服务器中真正被访问到的内容却是占极少的一部分,所以WEB内容全部放在EPG服务器本地是I/O资源的极大浪费,影响IPTV集群的工作性能。As is well known, the content of the ordinary WEB server is stored locally, but for the EPG server, the situation is very special, because the WEB content is very large, mainly the picture and third-party templates (such as JSP files, etc.), and With the expansion of business, 4K is extremely clear, and various value-added services are booming. This part of the content will also grow exponentially, which will cause the EPG server to be overwhelmed in content synchronization. Although WEB content is large, the content that is actually accessed in each EPG server in the live network environment is a very small part. Therefore, it is a great waste of I/O resources to place all WEB content locally on the EPG server. , affect the performance of the IPTV cluster.
基于前述缺陷,本实施例的主旨在于将EPG服务器的WEB内容进行分离,为此,本实施例提出如图1所示的分布式IPTV集群架构,如图1所示,相较于相关技术,本实施例引入了主EPG服务器和从EPG服务器两种WEB容器,其中,全部WEB内容放在主EPG服务器上,所述主EPG服务器负责分发用户的WEB请求,进行负载均衡;所述从EPG服务器负责拦截并处理用户的WEB请求,所述从EPG服务器在处理用户的WEB请求时从主EPG服务器下载相应的WEB内容至本地的WEB容器中。本领域技术人员可以理解的是,从EPG服务器这种按需下载的方式可以保证从EPG服务器本地的WEB容器内只有少量的内容,且不用关心WEB内容的同步,而且下载到WEB容器中的WEB内容是可以复用的,如果本地已经存在则不需要再次下载。此外,主EPG服务器可以自动感知集群中从EPG服务器的工作状态(如通过心跳报文进行监测),当某台从EPG服务器状态异常时,主EPG服务器可把此从EPG服务器从集群中剔除,不再向此从EPG服务器分发请求,当此台从EPG服务器状态恢复正常时,主EPG服务器又可以把它加入到集群中提供服务。此外,主EPG服务器还可以自动感知集群新加入的从EPG服务器,可以使集群在不重新配置 或重启的情况下平滑扩容,应对越来越高的性能要求。需要说明的是,IPTV集群的用户即IPTV终端,IPTV终端可以包括计算机、机顶盒、智能电视或者智能手机等移动终端中的至少一种。Based on the foregoing deficiencies, the main purpose of this embodiment is to separate the WEB content of the EPG server. To this end, the present embodiment provides a distributed IPTV cluster architecture as shown in FIG. 1 , as shown in FIG. 1 , compared with related technologies. This embodiment introduces two types of WEB containers, namely, a primary EPG server and a secondary EPG server, wherein all WEB content is placed on the primary EPG server, and the primary EPG server is responsible for distributing the user's WEB request for load balancing; the secondary EPG server Responsible for intercepting and processing the user's WEB request, the slave EPG server downloads the corresponding WEB content from the main EPG server to the local WEB container when processing the user's WEB request. Those skilled in the art can understand that the on-demand downloading method from the EPG server can ensure that only a small amount of content is contained in the WEB container local to the EPG server, and there is no need to care about the synchronization of the WEB content, and the WEB downloaded to the WEB container. The content is reusable and does not need to be downloaded again if it already exists locally. In addition, the primary EPG server can automatically sense the working status of the EPG server in the cluster (such as monitoring through heartbeat packets). When a certain EPG server is abnormal, the primary EPG server can remove the EPG server from the cluster. The request is no longer distributed from the EPG server. When the station returns from the EPG server status, the main EPG server can add it to the cluster to provide services. In addition, the primary EPG server can automatically sense the newly added slave EPG server, which can make the cluster not reconfigured. Smoothly expand or restart, and respond to higher and higher performance requirements. It should be noted that the IPTV terminal is an IPTV terminal, and the IPTV terminal may include at least one of a mobile terminal such as a computer, a set top box, a smart TV, or a smart phone.
本实施例中,所述主EPG服务器在为IPTV终端分配提供服务的从EPG服务器时,采用IP_Hash算法结合各从EPG服务器的负载状态进行加权,实时为IPTV终端分配负载较轻的从EPG服务器。具体的,所述主EPG服务器将集群中各从EPG服务器虚拟成n个节点,均匀分布到hash环上;并在接收到IPTV终端发送的原始业务请求时,根据配置的参数计算出一个hash值,在前述hash环上查找计算的hash值附近的虚拟节点,然后根据附近的虚拟节点的负载状态进行加权,确定负载较轻的虚拟节点,将所述负载较轻的虚拟节点对应的从EPG服务器信息发送至所述IPTV终端,由该虚拟节点对应的从EPG服务器为所述IPTV终端提供服务。需要说明的是,所述IPTV终端在接收到所述主EPG服务器发送的从EPG服务器信息之后,将原始业务请求重新打包为新的业务请求发送至所述从EPG服务器,而且,后续的其它业务请求也均发送至分配的从EPG服务器。In this embodiment, when the primary EPG server allocates the EPG server that provides the service to the IPTV terminal, the IP_Hash algorithm is used to combine the load status of each EPG server to perform weighting, and the slave IPTV terminal is allocated a lightly loaded slave EPG server in real time. Specifically, the primary EPG server virtualizes each EPG server in the cluster into n nodes and evenly distributes them on the hash ring; and when receiving the original service request sent by the IPTV terminal, calculates a hash value according to the configured parameters. Finding the virtual node in the vicinity of the calculated hash value on the hash ring, and then weighting according to the load state of the nearby virtual node to determine the virtual node with light load, and the slave EPG server corresponding to the lighter virtual node The information is sent to the IPTV terminal, and the IPTV terminal is served by the EPG server corresponding to the virtual node. It should be noted that, after receiving the slave EPG server information sent by the primary EPG server, the IPTV terminal repackages the original service request into a new service request and sends the message to the slave EPG server, and the subsequent other services. Requests are also sent to the assigned slave EPG server.
所述第一判断模块10当其所在从EPG服务器在接收到所述IPTV终端基于所述从EPG服务器信息发送的业务请求时,判断其所在从EPG服务器当前是否存储有接收的所述业务请求指向的业务数据(即WEB内容),以根据判断结果执行相应的操作,例如,在存储有所述业务请求指向的业务数据时,可直接将存储的所述业务请求指向的业务数据发送至所述IPTV终端。The first determining module 10, when the EPG server receives the service request sent by the IPTV terminal based on the information from the EPG server, determines whether the service request from the EPG server is currently stored and received. The service data (ie, the WEB content) is configured to perform a corresponding operation according to the judgment result. For example, when the service data pointed by the service request is stored, the stored service data pointed by the service request may be directly sent to the IPTV terminal.
处理模块20,用于当其所在从EPG服务器当前未存储有所述业务请求指向的业务数据时,基于所述主EPG服务器获取并存储所述业务请求指向的业务数据,并将所述业务请求重定向至所述主EPG服务器,以供所述主EPG服务器向所述IPTV终端推送接收的所述业务请求所指向的业务数据;The processing module 20 is configured to acquire and store the service data pointed by the service request based on the primary EPG server when the EPG server does not currently store the service data pointed by the service request, and the service request Redirecting to the primary EPG server, for the primary EPG server to push the received service data pointed to by the service request to the IPTV terminal;
本实施例中,在其所在从EPG服务器当前未存储有所述业务请求指向的业务数据时,处理模块20将所述业务请求指向的业务数据加入到其所在从EPG服务器的下载队列,由下载队列将所述业务请求指向的业务数据从所述主EPG服务器下载到从EPG服务。所述处理模块20将所述业务请求指向的业务数据加入到下载队列同时,将接收的所述业务请求重定向至所述主EPG服务器,由所述主EPG服务器向所述IPTV终端推送接收的所述业务请求所指向的业务数据。本领域技术人员可以理解的是,在本实施例中,所述从EPG服务器和所述IPTV终端可以同时获取到所述业务请求指向的业务数据,所述IPTV终端即可将获取到的业务数据呈现给用户。此外,当所述业务请求指向的业务数据再次被请求时,所述业务请求指向的业务数据即可直接从其所在从EPG服务器本地获取。In this embodiment, when the service data pointed by the service request is not currently stored in the EPG server, the processing module 20 adds the service data pointed by the service request to the download queue of the EPG server, and is downloaded by the EPG server. The queue downloads the service data pointed to by the service request from the primary EPG server to the slave EPG service. The processing module 20 adds the service data pointed by the service request to the download queue, and redirects the received service request to the primary EPG server, and the primary EPG server pushes and receives the received data to the IPTV terminal. The business data pointed to by the service request. It can be understood by those skilled in the art that, in this embodiment, the slave EPG server and the IPTV terminal can simultaneously obtain the service data pointed by the service request, and the IPTV terminal can obtain the acquired service data. Presented to the user. In addition, when the service data pointed by the service request is requested again, the service data pointed by the service request can be directly obtained from the EPG server where it is located.
发送模块30,用于当其所在从EPG服务器当前存储有所述业务请求指向的业务数据时,将存储的所述业务请求指向的业务数据发送至所述IPTV终端。 The sending module 30 is configured to send the stored service data pointed by the service request to the IPTV terminal when the EPG server currently stores the service data pointed by the service request.
基于前述描述,本领域技术人员可以理解的是,所述从EPG服务器存储业务数据的目的在于再次接收到指向存储的业务数据的业务请求时,直接用存储的所述业务数据提供服务。因此,本实施例中,所述发送模块30当其所在从EPG服务器当前存储有所述业务请求指向的业务数据时,直接将其所在从EPG服务器存储的所述业务请求指向的业务数据发送至所述IPTV终端,由IPTV终端将所述业务请求指向的业务数据呈现给用户。Based on the foregoing description, those skilled in the art can understand that the purpose of storing the service data from the EPG server is to directly provide the service with the stored service data when receiving the service request for the stored service data again. Therefore, in this embodiment, when the EMG server currently stores the service data pointed by the service request, the sending module 30 directly sends the service data pointed to by the service request stored by the EPG server to the service data. The IPTV terminal presents, by the IPTV terminal, the service data pointed by the service request to the user.
此外,由于主EPG服务器在IPTV集群中担当“首脑”作用,若主EPG服务器工作异常,整个IPTV集群将无法正常提供对外服务。因此,为提升IPTV集群的稳定性,本实施例还引入了冗余机制。具体的,如图1所示,本实施例提出的IPTV集群还包括备EPG服务器,用作所述主EPG服务器的热备份。例如,所述主EPG服务器工作异常时,进行主EPG服务器和备EPG服务器的切换,由所述备EPG服务器接管所述主EPG服务器。In addition, because the primary EPG server plays the role of “heads” in the IPTV cluster, if the primary EPG server works abnormally, the entire IPTV cluster will not be able to provide external services normally. Therefore, in order to improve the stability of the IPTV cluster, the embodiment also introduces a redundancy mechanism. Specifically, as shown in FIG. 1 , the IPTV cluster proposed in this embodiment further includes a backup EPG server, which is used as a hot backup of the primary EPG server. For example, when the primary EPG server is abnormal, the primary EPG server and the standby EPG server are switched, and the standby EPG server takes over the primary EPG server.
进一步的,在本实施例中,所述主EPG服务器还定时进行本地WEB内容的同步,如图1所示,本实施例提出的IPTV集群还包括FTP服务器,所述主EPG服务器基于所述FTP服务器进行本地WEB内容的同步,例如,所述主EPG服务器从所述FTP服务器获取到新的图片文件存储在本地。需要说明的是,所述主EPG服务器在完成同步之后,还下发内容同步通知至集群中各从EPG服务器,通知各从EPG服务器与所述主EPG服务器进行内容同步;从EPG服务器在接收到所述主EPG服务器下发的内容同步通知之后,校验本地存储的WEB内容,以进行本地WEB内容的更新、新增和/或删除。Further, in this embodiment, the primary EPG server also periodically synchronizes the local WEB content. As shown in FIG. 1 , the IPTV cluster proposed in this embodiment further includes an FTP server, and the primary EPG server is based on the FTP. The server performs synchronization of the local WEB content. For example, the main EPG server acquires a new picture file from the FTP server and stores it locally. It should be noted that after the synchronization is completed, the primary EPG server also sends a content synchronization notification to each slave EPG server in the cluster, and notifies each slave EPG server to perform content synchronization with the primary EPG server; After the content synchronization notification sent by the primary EPG server, the locally stored WEB content is verified to update, add, and/or delete the local WEB content.
本实施例提出的数据推送装置,在包括主EPG服务器和从EPG服务器的IPTV集群中,将全量的WEB内容(业务数据)分离到各从EPG服务器,各从EPG服务器基于存储的WEB内容以及接收的IPTV终端的业务请求提供服务,并按需更新存储的WEB内容。相较于相关技术,本发明实施例避免了由同步全量WEB内容导致的IPTV集群I/O资源浪费,能够达到提高IPTV集群工作性能的目的。The data pushing apparatus proposed in this embodiment separates the full amount of WEB content (service data) into each slave EPG server in the IPTV cluster including the primary EPG server and the slave EPG server, and each slave EPG server is based on the stored WEB content and receives. The IPTV terminal's service request provides services and updates the stored WEB content as needed. Compared with the related art, the embodiment of the present invention avoids the waste of IPTV cluster I/O resources caused by synchronizing the full amount of WEB content, and can achieve the purpose of improving the working performance of the IPTV cluster.
进一步的,基于上述的装置的第一实施例,提出本发明实施例数据推送装置的第二实施例,在本实施例中,所述业务数据包括第一类业务数据和第二类业务数据,所述数据推送装置还包括第二判断模块,用于判断所述业务请求指向的业务数据是否为第一类业务数据;Further, based on the first embodiment of the foregoing apparatus, a second embodiment of the data pushing apparatus of the embodiment of the present invention is provided. In this embodiment, the service data includes a first type of service data and a second type of service data. The data pushing device further includes a second determining module, configured to determine whether the service data pointed by the service request is the first type of service data;
所述处理模块20还用于在所述业务请求指向的业务数据为第一类业务数据时,将所述业务请求重定向至所述主EPG服务器;The processing module 20 is further configured to redirect the service request to the primary EPG server when the service data pointed by the service request is the first type of service data;
所述发送模块30还用于在所述业务请求指向的业务数据为第二类业务数据,且所述处理模块20基于所述主EPG服务器获取到所述业务请求指向的业务数据时,将获取的业务数据加载至其所在从EPG服务器的Servlet容器中运行,并将运行的结果 作为所述业务请求指向的业务数据返回至所述IPTV终端。The sending module 30 is further configured to: when the service data pointed to by the service request is the second type of service data, and the processing module 20 obtains the service data pointed by the service request by the primary EPG server, The business data is loaded into the servlet container it is running from the EPG server and will run the result The service data pointed to by the service request is returned to the IPTV terminal.
需要说明的是,资源可以作为静态资源或动态资源进行引用,这是通过使用StaticResource标记扩展或DynamicResource标记扩展完成的。其中,静态资源是指在被用户请求时可直接反馈至用户的资源;动态资源是指在被用户请求时,根据不同的用户运行动态资源以反馈不同的结果。本实施例中,在接收到IPTV终端的业务请求时,还需要根据接收的业务请求携带的StaticResource标记扩展或DynamicResource标记扩展确定需要进行的操作。It should be noted that resources can be referenced as static resources or dynamic resources, which is done by using the StaticResource markup extension or the DynamicResource markup extension. The static resource refers to a resource that can be directly fed back to the user when requested by the user; the dynamic resource refers to when the user requests, the dynamic resource is run according to different users to feed back different results. In this embodiment, when receiving the service request of the IPTV terminal, it is also required to determine the operation to be performed according to the StaticResource mark extension or the DynamicResource mark extension carried in the received service request.
具体的,在其所在从EPG服务器当前未存储有所述业务请求指向的业务数据,且所述业务请求携带有StaticResource标记扩展时,说明所述IPTV终端请求的是其所在从EPG服务器当前未存储的静态资源(第一类业务数据),不需要消耗处理资源运行,此时所述处理模块20将所述业务请求指向的业务数据加入到其所在从EPG服务器的下载队列,由下载队列将所述业务请求指向的业务数据从所述主EPG服务器下载到其所在从EPG服务器本地。在将所述业务请求指向的业务数据加入到其所在从EPG服务器下载队列的同时,所述处理模块20将接收的所述业务请求重定向至所述主EPG服务器,由所述主EPG服务器向所述IPTV终端推送接收的所述业务请求所指向的业务数据。Specifically, when the service data pointed by the service request is not currently stored in the EPG server, and the service request carries the StaticResource mark extension, the IPTV terminal requests that the EPG server is not currently stored. The static resource (the first type of service data) does not need to consume the processing resource to run. At this time, the processing module 20 adds the service data pointed by the service request to the download queue of the EPG server, and the download queue The service data pointed to by the service request is downloaded from the primary EPG server to the local EPG server where it is located. While the service data pointed to by the service request is added to the EPG server download queue, the processing module 20 redirects the received service request to the primary EPG server, and the primary EPG server The IPTV terminal pushes the received service data pointed by the service request.
在其所在从EPG服务器当前未存储有所述业务请求指向的业务数据,且所述业务请求携带有DynamicResource标记扩展时,说明所述IPTV终端请求的是其所在从EPG服务器当前未存储的动态资源(第二类业务数据),需要消耗处理资源运行,此时所述处理模块20将所述业务请求指向的业务数据加入到其所在从EPG服务器的下载队列,由下载队列将所述业务请求指向的业务数据从所述主EPG服务器下载到其所在从EPG服务器本地。在将所述业务请求指向的业务数据从所述主EPG服务器下载到其所在从EPG服务器本地之后,所述发送模块30将下载的业务数据加载至所述从EPG服务器的Servlet容器中运行,并将运行的结果作为所述业务请求指向的业务数据返回至所述IPTV终端,以避免造成对主EPG服务器处理资源的不必要占用,从而提升IPTV集群的工作性能。When the service data pointed to by the service request is not currently stored in the EPG server, and the service request carries the DynamicResource mark extension, the IPTV terminal requests that the dynamic resource that is not currently stored by the EPG server is requested. The second type of service data needs to consume the processing resource. At this time, the processing module 20 adds the service data pointed by the service request to the download queue of the slave EPG server, and the service queue points the download request by the download queue. The business data is downloaded from the primary EPG server to where it is located from the EPG server. After downloading the service data pointed by the service request from the primary EPG server to the local location of the slave EPG server, the sending module 30 loads the downloaded service data into the servlet container of the slave EPG server, and Returning the result of the operation as the service data pointed by the service request to the IPTV terminal, so as to avoid unnecessary occupation of the processing resources of the primary EPG server, thereby improving the working performance of the IPTV cluster.
在其所在从EPG服务器当前存储有所述业务请求指向的业务数据,且所述业务请求携带有StaticResource标记扩展时,说明所述IPTV终端请求的是其所在从EPG服务器当前存储的静态资源(第一类业务数据),不需要消耗处理资源运行,所述发送模块30直接将其所在从EPG服务器存储的所述业务请求指向的业务数据发送至所述IPTV终端,供所述IPTV终端将所述业务请求指向的业务数据呈现给用户。When the service data pointed by the service request is currently stored in the EPG server, and the service request carries the StaticResource tag extension, the IPTV terminal requests that the static resource currently stored by the EPG server is located. a type of service data, which does not need to consume the processing resource, and the sending module 30 directly sends the service data pointed to by the service request stored by the EPG server to the IPTV terminal, where the IPTV terminal will The business data pointed to by the business request is presented to the user.
在其所在从EPG服务器当前存储有所述业务请求指向的业务数据,且所述业务请求携带有DynamicResource标记扩展时,说明所述IPTV终端请求的是其所在从EPG服务器当前存储的动态资源(第一类业务数据),需要消耗处理资源运行,此时所述发送模块30将其所在从EPG服务器存储的所述业务请求指向的业务数据加载至所述 从EPG服务器的Servlet容器中运行,并将运行的结果作为所述业务请求指向的业务数据返回至所述IPTV终端。When the service data pointed by the service request is currently stored in the EPG server, and the service request carries the DynamicResource tag extension, the IPTV terminal requests that the dynamic resource currently stored by the EPG server is located. a type of service data, which needs to consume processing resources, and the sending module 30 loads the service data pointed to by the service request stored by the EPG server to the Running from the servlet container of the EPG server, and returning the result of the operation as the service data pointed to by the service request to the IPTV terminal.
进一步的,在本实施例中,所述主EPG服务器在与所述FTP服务器进行内容同步时,在从所述FTP服务器获取到动态资源时,需要将获取的动态资源进行预编译,并存储预编译对象,例如,所述主EPG服务器在从所述FTP服务器获取到JSP文件之后,将获取的JSP文件预编译成class文件存储,以供所述从EPG服务器在需要时获取并加载运行。Further, in this embodiment, when the content is synchronized with the FTP server, the main EPG server needs to pre-compile the acquired dynamic resources and obtain the pre-compilation when acquiring the dynamic resources from the FTP server. Compiling the object, for example, after obtaining the JSP file from the FTP server, the main EPG server pre-compiles the obtained JSP file into a class file storage for the slave EPG server to acquire and load and run when needed.
进一步的,基于上述的装置的第一实施例,提出本发明实施例的数据推送装置的第三实施例,在本实施例中,所述发送模块30还可用于当其所在从EPG服务器当前存储有所述业务请求指向的业务数据时,对存储的所述业务请求指向的业务数据进行验证操作;以及在验证通过时,将存储的所述业务请求指向的业务数据发送至所述IPTV终端;Further, based on the first embodiment of the foregoing apparatus, a third embodiment of the data pushing apparatus according to the embodiment of the present invention is provided. In this embodiment, the sending module 30 is further configured to be currently stored when the EPG server is located from the EPG server. And when the service data pointed to by the service request is performed, performing verification operation on the stored service data pointed by the service request; and transmitting, when the verification is passed, the stored service data pointed by the service request to the IPTV terminal;
所述数据推送装置还包括更新模块,用于在验证失败时,基于所述主EPG服务器更新存储的所述业务请求指向的业务数据,并将所述业务请求重定向至所述主EPG服务器。The data pushing device further includes an updating module, configured to update the stored service data pointed by the service request based on the primary EPG server when the verification fails, and redirect the service request to the primary EPG server.
众所周知的,数据在网络传输过程中,存在数据包丢失和数据包无序等问题,因此,本实施例在进行内容分离时,所述从EPG服务器分离存储的业务数据可能与所述主EPG服务器存储的原始业务数据不同,为确保能够正常为用户提供服务,在提供服务之前还需要对业务数据进行验证操作。As is well known, in the network transmission process, there are problems such as data packet loss and data packet disorder. Therefore, in the embodiment, when the content separation is performed, the service data separated from the EPG server may be related to the primary EPG server. The original business data stored is different. In order to ensure that the service can be provided to the user normally, the business data needs to be verified before the service is provided.
具体的,在其所在从EPG服务器当前存储有所述业务请求指向的业务数据时,所述发送模块30对其所在从EPG服务器存储的所述业务请求指向的业务数据进行验证操作,例如,本实施例所述发送模块30采用CRC校验(Cyclic Redundancy Check,循环冗余校验)对存储的所述业务请求指向的业务数据的完整性进行验证。其中,在存储的所述业务请求指向的业务数据验证通过时,所述发送模块30直接将其所在从EPG服务器存储的所述业务请求指向的业务数据发送至所述IPTV终端,由所述IPTV终端将所述业务请求指向的业务数据呈现给用户;在存储的所述业务请求指向的业务数据验证失败时,更新模块将所述业务请求指向的业务数据加入到其所在从EPG服务器的下载队列,由下载队列将所述业务请求指向的业务数据从所述主EPG服务器下载到其所在从EPG服务器本地,在完成下载之后,所述更新模块将其所在从EPG服务器本地已存储的所述业务请求指向的业务数据替换为下载队列新下载的所述业务请求指向的业务数据。所述更新模块在将所述业务请求指向的业务数据加入到其所在从EPG服务器的下载队列同时,将接收的所述业务请求重定向至所述主EPG服务器,由所述主EPG服务器向所述IPTV终端推送接收的所述业务请求所指向的业务数据。 Specifically, when the EPG server currently stores the service data pointed by the service request, the sending module 30 performs a verification operation on the service data that the service request is stored from the EPG server, for example, In the embodiment, the sending module 30 uses a CRC check (Cyclic Redundancy Check) to verify the integrity of the stored service data pointed to by the service request. The sending module 30 directly sends the service data pointed to by the service request stored by the EPG server to the IPTV terminal, where the IPTV is directly transmitted by the stored service data. The terminal presents the service data pointed by the service request to the user; when the stored service data verification pointed by the service request fails, the update module adds the service data pointed by the service request to the download queue of the EPG server Downloading, by the download queue, the service data pointed by the service request from the primary EPG server to the local EPG server, and after completing the download, the update module stores the service locally stored by the EPG server. The service data pointed to by the request is replaced with the service data pointed to by the service request newly downloaded by the download queue. The update module redirects the received service request to the primary EPG server by adding the service data pointed by the service request to the download queue of the slave EPG server, and the primary EPG server is The IPTV terminal pushes the service data pointed to by the service request received.
进一步的,基于前述的装置的任一实施例,提出本发明实施例的数据推送装置的第四实施例,在本实施例中,所述数据推送装置还可包括会话模块,用于当其所在从EPG服务器接收到所述IPTV终端发送的业务请求时,获取其所在从EPG服务器存储的所述IPTV终端的session数据;以及对获取的所述session数据的有效性进行验证;Further, based on any of the foregoing embodiments, a fourth embodiment of the data pushing apparatus of the embodiment of the present invention is provided. In this embodiment, the data pushing apparatus may further include a session module, where Receiving the service request sent by the IPTV terminal from the EPG server, acquiring the session data of the IPTV terminal stored by the EPG server; and verifying the validity of the obtained session data;
所述第一判断模块10还用于在验证通过时,判断其所在从EPG服务器当前是否存储有接收的所述业务请求指向的业务数据。The first determining module 10 is further configured to determine, when the verification passes, whether the service data pointed to by the received service request is currently stored by the EPG server.
需要说明的是,在第一实施例的基础上,本实施例进一步提出一种分布式session的方案,以提升IPTV集群的可伸缩性。具体的,所述主EPG服务器记录记录维护session的元数据信息,包括版本信息、session位置、副本信息,以及从EPG服务器退出时session信息恢复、重新分配、对超时的session信息做失效处理等;所述从EPG服务器用于在有新的IPTV终端的业务请求时,从所述主EPG服务器获取是否存在此IPTV终端的session信息,如果有则取出session的位置信息从相应的从EPG服务器(包括本端或其它从EPG服务器)中读出IPTV终端的session数据,如果没有则新创建session对象后通知主EPG服务器更新session信息。例如,当从EPG服务器A接受到IPTV终端的业务请求时创建一个session对象,若此IPTV终端下一次被分配到从EPG服务器B,从EPG服务器B可以根据sessionID获取从EPG服务器A节点创建的session对象。可选地,本实施例使用IPTV终端对应的用户ID(在用户注册时分配)作为sessionID,这样sessionID就不需要在从EPG服务器中进行传递。It should be noted that, based on the first embodiment, the embodiment further provides a distributed session solution to improve the scalability of the IPTV cluster. Specifically, the primary EPG server records metadata information of the maintenance session, including version information, session location, copy information, and recovery, re-allocation, and invalidation of time-out session information when exiting from the EPG server; The slave EPG server is configured to obtain, from the primary EPG server, session information of the IPTV terminal when there is a service request of the new IPTV terminal, and if yes, retrieve the location information of the session from the corresponding slave EPG server (including The local end or other from the EPG server reads the session data of the IPTV terminal. If not, the new EPG server is notified to update the session information after the session object is newly created. For example, when receiving a service request from the EPG server A to the IPTV terminal, a session object is created. If the IPTV terminal is assigned to the slave EPG server B next time, the EPG server B can acquire the session created from the APG server A node according to the session ID. Object. Optionally, the embodiment uses the user ID corresponding to the IPTV terminal (assigned when the user registers) as the session ID, so that the sessionID does not need to be delivered from the EPG server.
此外,为防止数据损毁或从EPG服务器故障导致session丢失的问题,本实施例还提供session副本功能,即session数据存放多份。具体的,在session对象创建持久化后,从EPG服务器同时复制数据到其他从EPG服务器上。可选地,将副本数设置为奇数,例如本实施例将副本数设置为3个。当本地的session数据出错时,从EPG服务器可以通过复制完整的副本来治愈那些出错的数据,使得数据的副本恢复到预期设定的数量来保证数据的高可靠性。In addition, in order to prevent the data from being damaged or the session is lost due to the failure of the EPG server, the embodiment also provides a session copy function, that is, the session data is stored in multiple copies. Specifically, after the session object is created persistently, the data is simultaneously copied from the EPG server to other slave EPG servers. Alternatively, the number of copies is set to an odd number, for example, the number of copies is set to three in this embodiment. When the local session data is in error, the EPG server can recover the erroneous data by copying the complete copy, so that the copy of the data is restored to the expected set number to ensure high reliability of the data.
本实施例中,会话模块当其所在从EPG服务器接收到所述IPTV终端基于所述从EPG服务器信息发送的业务请求时,获取其所在从EPG服务器存储的所述IPTV终端的session数据。在获取到所述IPTV终端的session数据之后,对获取的所述session数据的有效性进行验证,其中,对获取的所述session数据的有效性进行验证包括:验证所述session数据是否完整,验证所述session数据是否出错等。在验证通过时,由所述第一判断模块10判断其所在从EPG服务器当前是否存储有接收的所述业务请求指向的业务数据,以确定如何为所述IPTV终端提供服务,具体可参照前述实施例,此处不再赘述。In this embodiment, when the session module receives the service request sent by the IPTV terminal based on the information from the EPG server, the session module acquires session data of the IPTV terminal stored by the EPG server. After obtaining the session data of the IPTV terminal, verifying the validity of the acquired session data, where verifying the validity of the obtained session data includes: verifying whether the session data is complete, and verifying Whether the session data is in error or the like. When the verification is passed, the first judging module 10 determines whether the EPG server currently stores the service data pointed by the received service request to determine how to provide the service for the IPTV terminal. For example, it will not be described here.
进一步的,在本实施例中,所述会话模块还用于在未获取到所述session数据时, 发送获取请求至所述主EPG服务器;以及在接收到所述主EPG服务器根据所述获取请求返回的指示信息时,基于所述指示信息对应的从EPG服务器获取所述session数据。Further, in this embodiment, the session module is further configured to: when the session data is not acquired, Sending an acquisition request to the primary EPG server; and, upon receiving the indication information returned by the primary EPG server according to the acquisition request, acquiring the session data from the EPG server corresponding to the indication information.
基于前述描述,本领域技术人员可以理解的是,当session数据损毁或者session数据由其他从EPG服务器创建时,所述会话模块将无法从其所在从EPG服务器本地获取到相应IPTV终端的session数据。本实施例中,在未获取到所述session数据时,所述会话模块发送获取请求至所述主EPG服务器,以供主EPG服务器根据接收的获取请求以及存储的session元数据信息,向所述从EPG服务器反馈相应session数据的session位置信息(指示信息)。在基于其所在从EPG服务器接收到所述主EPG服务器根据所述获取请求返回的session位置信息时,所述会话模块基于所述session位置信息对应的从EPG服务器获取所述session数据。在获取到所述session数据之后,开始前述数据推送流程,此处不再赘述。Based on the foregoing description, those skilled in the art can understand that when the session data is corrupted or the session data is created by other EPG servers, the session module will not be able to locally obtain the session data of the corresponding IPTV terminal from the EPG server. In this embodiment, when the session data is not obtained, the session module sends an acquisition request to the primary EPG server, so that the primary EPG server sends the acquisition request and the stored session metadata information to the primary EPG server. The session location information (instruction information) of the corresponding session data is fed back from the EPG server. The session module acquires the session data from the EPG server corresponding to the session location information based on the session location information returned by the primary EPG server according to the acquisition request. After the session data is obtained, the foregoing data pushing process is started, and details are not described herein again.
进一步的,由于所述主EPG服务器还对超时的session做失效处理,所述会话模块向所述主EPG服务器发送获取请求以请求session数据时,所述主EPG服务器可能由于相应session数据已超时而无指示信息返回。本实施例中,所述会话模块在未接收到所述主EPG服务器返回的指示信息时,创建所述IPTV终端的session数据,并在完成创建后通知主EPG服务器更新session元数据信息,具体可参照前述描述,此处不再赘述。Further, since the primary EPG server also performs a failure process on the timed session, when the session module sends an acquisition request to the primary EPG server to request session data, the primary EPG server may have timed out due to the corresponding session data. No indication is returned. In this embodiment, when the session module does not receive the indication information returned by the primary EPG server, the session module creates the session data of the IPTV terminal, and notifies the primary EPG server to update the session metadata information after the creation is completed, specifically Referring to the foregoing description, details are not described herein again.
以上仅为本发明的可选实施例,并非因此限制本发明的专利范围,凡是利用本发明说明书及附图内容所作的等效结构或等效流程变换,或直接或间接运用在其他相关的技术领域,均同理包括在本发明的专利保护范围内。The above is only an alternative embodiment of the present invention, and thus does not limit the scope of the invention, and the equivalent structure or equivalent process transformation made by using the specification and the drawings of the present invention, or directly or indirectly applied to other related technologies. The fields are all included in the scope of patent protection of the present invention.
通过以上的实施例的描述,本领域的技术人员可以清楚地了解到上述实施例方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。基于这样的理解,本发明实施例的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质(如ROM/RAM、磁碟、光盘)中,包括若干指令用以使得一台终端设备(可以是手机,计算机,服务器,空调器,或者网络设备等)执行本发明各个实施例所述的方法。Through the description of the above embodiments, those skilled in the art can clearly understand that the foregoing embodiment method can be implemented by means of software plus a necessary general hardware platform, and of course, can also be through hardware, but in many cases, the former is better. Implementation. Based on such understanding, the technical solution of the embodiments of the present invention may be embodied in the form of a software product in essence or in the form of a software product stored in a storage medium (such as ROM/RAM, magnetic). The disc, the optical disc, includes a plurality of instructions for causing a terminal device (which may be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to perform the method described in various embodiments of the present invention.
上述第一判断模块、处理模块、发送模块等模块可包括硬件组件、软件模块或硬件与软件的结合。同一单元可能由同一硬件/软件实现,也可能由不同硬件/软件结合实现。上述模块或单元可均位于同一硬件结构,例如同一处理器中;或者,上述模块分别位于多个硬件结构中,可通过通信连接进行交互。The above first determining module, processing module, sending module and the like may comprise hardware components, software modules or a combination of hardware and software. The same unit may be implemented by the same hardware/software or by a combination of different hardware/software. The above modules or units may all be located in the same hardware structure, for example, in the same processor; or, the above modules are respectively located in a plurality of hardware structures, and may interact through a communication connection.
工业实用性 Industrial applicability
本发明适用于IPTV技术领域,用以避免由同步全量WEB内容导致的IPTV集群I/O资源浪费,能够达到提高IPTV集群工作性能的目的。 The invention is applicable to the field of IPTV technology, and is used to avoid the waste of IPTV cluster I/O resources caused by synchronous full amount of WEB content, and can achieve the purpose of improving the working performance of the IPTV cluster.

Claims (10)

  1. 一种数据推送方法,所述数据推送方法应用于IPTV集群,所述IPTV集群包括主EPG服务器和多个从EPG服务器,所述数据推送方法包括:A data push method, the data push method is applied to an IPTV cluster, the IPTV cluster includes a main EPG server and a plurality of slave EPG servers, and the data push method includes:
    在接收到IPTV终端发送的业务请求时,所述从EPG服务器判断当前是否存储有接收的所述业务请求指向的业务数据;When receiving the service request sent by the IPTV terminal, the determining, by the EPG server, whether the received service data pointed by the received service request is currently stored;
    在当前未存储有所述业务请求指向的业务数据时,所述从EPG服务器基于所述主EPG服务器获取并存储所述业务请求指向的业务数据,并将所述业务请求重定向至所述主EPG服务器,以供所述主EPG服务器向所述IPTV终端推送接收的所述业务请求所指向的业务数据;When the service data pointed by the service request is not currently stored, the slave EPG server acquires and stores the service data pointed by the service request based on the primary EPG server, and redirects the service request to the primary An EPG server, configured to: send, by the primary EPG server, the service data pointed to by the received service request to the IPTV terminal;
    在当前存储有所述业务请求指向的业务数据时,所述从EPG服务器将存储的所述业务请求指向的业务数据发送至所述IPTV终端。When the service data pointed by the service request is currently stored, the EPG server sends the stored service data pointed by the service request to the IPTV terminal.
  2. 如权利要求1所述的数据推送方法,其中,所述业务数据包括第一类业务数据和第二类业务数据,所述将所述业务请求重定向至所述主EPG服务器的步骤之前,还包括:The data push method of claim 1, wherein the service data comprises a first type of service data and a second type of service data, and before the step of redirecting the service request to the primary EPG server, include:
    所述从EPG服务器判断所述业务请求指向的业务数据是否为第一类业务数据;Determining, by the EPG server, whether the service data pointed by the service request is the first type of service data;
    在所述业务请求指向的业务数据为第一类业务数据时,执行所述将所述业务请求重定向至所述主EPG服务器的步骤;And when the service data pointed to by the service request is the first type of service data, performing the step of redirecting the service request to the primary EPG server;
    所述从EPG服务器判断所述业务请求指向的业务数据是否为第一类业务数据的步骤之后,还包括:After the step of determining, by the EPG server, whether the service data pointed to by the service request is the first type of service data, the method further includes:
    在所述业务请求指向的业务数据为第二类业务数据,且基于所述主EPG服务器获取到所述业务请求指向的业务数据时,所述从EPG服务器将获取的业务数据加载至所述从EPG服务器的Servlet容器中运行,并将运行的结果作为所述业务请求指向的业务数据返回至所述IPTV终端。When the service data pointed to by the service request is the second type of service data, and the service data pointed to by the service request is obtained by the primary EPG server, the service data acquired by the EPG server is loaded to the slave Running in the Servlet container of the EPG server, and returning the result of the operation as the service data pointed by the service request to the IPTV terminal.
  3. 如权利要求1所述的数据推送方法,其中,所述从EPG服务器将存储的所述业务请求指向的业务数据发送至所述IPTV终端的步骤之前,还包括:The data pushing method of claim 1, wherein the step of transmitting, by the EPG server, the stored service data of the service request to the IPTV terminal, the method further comprises:
    在当前存储有所述业务请求指向的业务数据时,所述从EPG服务器对存储的所述业务请求指向的业务数据进行验证操作;When the service data pointed by the service request is currently stored, the EPG server performs a verification operation on the stored service data pointed by the service request;
    在验证通过时,执行所述从EPG服务器将存储的所述业务请求指向的业务数据发送至所述IPTV终端的步骤;And performing, when the verification is passed, the step of transmitting, by the EPG server, the service data pointed by the stored service request to the IPTV terminal;
    所述从EPG服务器对存储的所述业务请求指向的业务数据进行验证操作的步骤之后,还包括:After the step of performing the verification operation on the service data pointed by the stored service request from the EPG server, the method further includes:
    在验证失败时,所述从EPG服务器基于所述主EPG服务器更新存储的所述业务请求指向的业务数据,并将所述业务请求重定向至所述主EPG服务器。 When the verification fails, the slave EPG server updates the stored service data pointed by the stored service request based on the primary EPG server, and redirects the service request to the primary EPG server.
  4. 如权利要求1-3任一项所述的数据推送方法,其中,所述从EPG服务器判断当前是否存储有接收的所述业务请求指向的业务数据的步骤之前,还包括:The data pushing method according to any one of claims 1 to 3, wherein before the step of determining, by the EPG server, whether the received service data pointed by the service request is currently stored, the method further includes:
    在接收到所述IPTV终端发送的业务请求时,所述从EPG服务器获取存储的所述IPTV终端的session数据;Receiving the stored session data of the IPTV terminal from the EPG server when receiving the service request sent by the IPTV terminal;
    所述从EPG服务器对获取的所述session数据的有效性进行验证;Verifying, by the EPG server, the validity of the obtained session data;
    在验证通过时,执行所述从EPG服务器判断当前是否存储有接收的所述业务请求指向的业务数据的步骤。When the verification is passed, the step of determining from the EPG server whether the received service data pointed by the service request is currently stored is performed.
  5. 如权利要求4所述的数据推送方法,其中,所述从EPG服务器获取存储的所述IPTV终端的session数据的步骤之后,还包括:The data pushing method of claim 4, wherein the step of obtaining the stored session data of the IPTV terminal from the EPG server further comprises:
    在未获取到所述session数据时,所述从EPG服务器发送获取请求至所述主EPG服务器;When the session data is not obtained, the sending an acquisition request from the EPG server to the primary EPG server;
    在接收到所述主EPG服务器根据所述获取请求返回的指示信息时,所述从EPG服务器基于所述指示信息对应的从EPG服务器获取所述session数据。Upon receiving the indication information returned by the primary EPG server according to the acquisition request, the slave EPG server acquires the session data from the EPG server corresponding to the indication information.
  6. 一种数据推送装置,所述数据推送装置应用于IPTV集群,所述IPTV集群包括主EPG服务器和多个从EPG服务器,所述数据推送装置包括:A data push device, the data push device is applied to an IPTV cluster, the IPTV cluster includes a main EPG server and a plurality of slave EPG servers, and the data push device includes:
    第一判断模块,设置为当其所在从EPG服务器接收到IPTV终端发送的业务请求时,判断其所在从EPG服务器当前是否存储有所述业务请求指向的业务数据;The first judging module is configured to determine, when the EPG server receives the service request sent by the IPTV terminal, whether the EPG server currently stores the service data pointed by the service request;
    处理模块,设置为当其所在从EPG服务器当前未存储有所述业务请求指向的业务数据时,基于所述主EPG服务器获取并存储所述业务请求指向的业务数据,并将所述业务请求重定向至所述主EPG服务器,以供所述主EPG服务器向所述IPTV终端推送接收的所述业务请求所指向的业务数据;a processing module, configured to acquire and store the service data pointed by the service request based on the primary EPG server when the service data pointed by the service request is not currently stored by the EPG server, and the service request is heavy Directing to the primary EPG server, for the primary EPG server to push the received service data pointed to by the service request to the IPTV terminal;
    发送模块,设置为当其所在从EPG服务器当前存储有所述业务请求指向的业务数据时,将存储的所述业务请求指向的业务数据发送至所述IPTV终端。The sending module is configured to send the stored service data pointed by the service request to the IPTV terminal when the EPG server currently stores the service data pointed by the service request.
  7. 如权利要求6所述的数据推送装置,其中,所述业务数据包括第一类业务数据和第二类业务数据,所述数据推送装置还包括第二判断模块,设置为判断所述业务请求指向的业务数据是否为第一类业务数据;The data pushing device of claim 6, wherein the service data comprises a first type of service data and a second type of service data, the data pushing device further comprising a second determining module configured to determine that the service request is directed Whether the business data is the first type of business data;
    所述处理模块还设置为在所述业务请求指向的业务数据为第一类业务数据时,将所述业务请求重定向至所述主EPG服务器;The processing module is further configured to redirect the service request to the primary EPG server when the service data pointed by the service request is the first type of service data;
    所述发送模块还设置为在所述业务请求指向的业务数据为第二类业务数据,且所述处理模块基于所述主EPG服务器获取到所述业务请求指向的业务数据时,将获取的业务数据加载至其所在从EPG服务器的Servlet容器中运行,并将运行的结果作 为所述业务请求指向的业务数据返回至所述IPTV终端。The sending module is further configured to: when the service data pointed by the service request is the second type of service data, and the processing module obtains the service data when the service data pointed by the service request is obtained by the primary EPG server The data is loaded into the servlet container where it is located from the EPG server, and the result of the run is made The service data pointed to by the service request is returned to the IPTV terminal.
  8. 如权利要求6所述的数据推送装置,其中,所述发送模块还设置为当其所在从EPG服务器当前存储有所述业务请求指向的业务数据时,对存储的所述业务请求指向的业务数据进行验证操作;以及在验证通过时,将存储的所述业务请求指向的业务数据发送至所述IPTV终端;The data pushing apparatus according to claim 6, wherein said transmitting module is further configured to: when the EPG server currently stores the service data pointed by said service request, the service data pointed to by said stored service request Performing a verification operation; and transmitting, when the verification is passed, the stored service data pointed by the service request to the IPTV terminal;
    所述数据推送装置还包括更新模块,设置为在验证失败时,基于所述主EPG服务器更新存储的所述业务请求指向的业务数据,并将所述业务请求重定向至所述主EPG服务器。The data pushing device further includes an updating module configured to update the stored service data pointed by the service request based on the primary EPG server when the verification fails, and redirect the service request to the primary EPG server.
  9. 如权利要求6-8任一项所述的数据推送装置,其中,所述数据推送装置还包括会话模块,设置为当其所在从EPG服务器接收到所述IPTV终端发送的业务请求时,获取其所在从EPG服务器存储的所述IPTV终端的session数据;以及对获取的所述session数据的有效性进行验证;The data pushing apparatus according to any one of claims 6 to 8, wherein the data pushing apparatus further comprises a session module configured to acquire a service request sent by the IPTV terminal when it is located from the EPG server. a session data of the IPTV terminal stored from the EPG server; and verifying validity of the obtained session data;
    所述第一判断模块还设置为在验证通过时,判断其所在从EPG服务器当前是否存储有接收的所述业务请求指向的业务数据。The first determining module is further configured to determine, when the verification passes, whether the service data pointed to by the received service request is currently stored by the EPG server.
  10. 如权利要求9所述的数据推送装置,其中,所述会话模块还设置为在未获取到所述session数据时,发送获取请求至所述主EPG服务器;以及在接收到所述主EPG服务器根据所述获取请求返回的指示信息时,基于所述指示信息对应的从EPG服务器获取所述session数据。 The data pushing apparatus according to claim 9, wherein said session module is further configured to: when the session data is not acquired, send an acquisition request to said primary EPG server; and upon receiving said primary EPG server according to When the indication information returned by the request is acquired, the session data is acquired from the EPG server corresponding to the indication information.
PCT/CN2016/108684 2015-12-07 2016-12-06 Data pushing method and apparatus WO2017097181A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201510894438.3 2015-12-07
CN201510894438.3A CN106850724B (en) 2015-12-07 2015-12-07 Data pushing method and device

Publications (1)

Publication Number Publication Date
WO2017097181A1 true WO2017097181A1 (en) 2017-06-15

Family

ID=59013750

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2016/108684 WO2017097181A1 (en) 2015-12-07 2016-12-06 Data pushing method and apparatus

Country Status (2)

Country Link
CN (1) CN106850724B (en)
WO (1) WO2017097181A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114024982A (en) * 2021-11-03 2022-02-08 南京炫佳网络科技有限公司 Information transmission method, service server, terminal device, system and storage medium

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108667509B (en) * 2018-03-22 2020-04-14 新华三技术有限公司 Cluster joining method and device and cluster equipment
CN108848144B (en) * 2018-05-31 2021-03-30 中国联合网络通信集团有限公司 Method and device for accessing nodes in block chain and block chain link point
CN109639506A (en) * 2019-01-08 2019-04-16 北京文香信息技术有限公司 A kind of master-slave control method, device, storage medium and server
CN112202725B (en) * 2020-09-10 2023-04-07 中国联合网络通信集团有限公司 Service verification method and device

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1929494A (en) * 2006-10-11 2007-03-14 中兴通讯股份有限公司 Distributed electronic program guidance system
CN102685552A (en) * 2012-05-08 2012-09-19 华为技术有限公司 Error pattern generator (EPG) content metadata management method, server and system
CN104469420A (en) * 2013-09-25 2015-03-25 中兴通讯股份有限公司 Service emergency method, device and system for interactive personality TV (IPTV)

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN100596174C (en) * 2006-01-20 2010-03-24 华为技术有限公司 Method for setting interface of electronic card
US7774808B2 (en) * 2006-08-01 2010-08-10 Att Knowledge Ventures, L.P. Method and apparatus for distributing geographically restricted video data in an internet protocol television (IPTV) system

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1929494A (en) * 2006-10-11 2007-03-14 中兴通讯股份有限公司 Distributed electronic program guidance system
CN102685552A (en) * 2012-05-08 2012-09-19 华为技术有限公司 Error pattern generator (EPG) content metadata management method, server and system
CN104469420A (en) * 2013-09-25 2015-03-25 中兴通讯股份有限公司 Service emergency method, device and system for interactive personality TV (IPTV)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114024982A (en) * 2021-11-03 2022-02-08 南京炫佳网络科技有限公司 Information transmission method, service server, terminal device, system and storage medium
CN114024982B (en) * 2021-11-03 2024-02-23 南京炫佳网络科技有限公司 Information transmission method, service server, terminal device, system and storage medium

Also Published As

Publication number Publication date
CN106850724A (en) 2017-06-13
CN106850724B (en) 2020-03-27

Similar Documents

Publication Publication Date Title
US11349949B2 (en) Method of using path signatures to facilitate the recovery from network link failures
WO2017097181A1 (en) Data pushing method and apparatus
US11740975B2 (en) System and method for managing blockchain nodes
US20180373517A1 (en) Systems, methods, and apparatuses for docker image downloading
EP3490224B1 (en) Data synchronization method and system
CN107861686B (en) File storage method, server and computer readable storage medium
US10922303B1 (en) Early detection of corrupt data partition exports
US9311377B2 (en) Method and apparatus for performing server handoff in a name-based content distribution system
JP2017118575A (en) Load distribution in data networks
WO2014094468A1 (en) System, method and browser client for enabling browser data synchronization
US11741075B2 (en) Methods and system of tracking transactions for distributed ledger
CN104252397A (en) Realizing method for supporting automatic backup of cloud platform user file
CN107872492B (en) Method and device for supporting multi-user editing of data object at server
US20220046113A1 (en) Distributed state recovery in a system having dynamic reconfiguration of participating nodes
CN114095739B (en) Video live broadcast system
US20240054054A1 (en) Data Backup Method and System, and Related Device
US20210344741A1 (en) A method and device for feeding back a resource file
US10313469B2 (en) Method, apparatus and system for processing user generated content
CN111125001A (en) Snap copy method, electronic device, and computer program product
CN104618450A (en) Wireless Local Area Networks (WLAN) Web caching system and method
JP2006164075A (en) Application system and synchronizing method of distributed data
WO2022085013A1 (en) System and method to resync flow rules
JP2019021022A (en) Load distribution device, load distribution method, and load distribution program

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 16872372

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 16872372

Country of ref document: EP

Kind code of ref document: A1