CN114785778B - Gateway device and content distribution method - Google Patents
Gateway device and content distribution method Download PDFInfo
- Publication number
- CN114785778B CN114785778B CN202210231223.3A CN202210231223A CN114785778B CN 114785778 B CN114785778 B CN 114785778B CN 202210231223 A CN202210231223 A CN 202210231223A CN 114785778 B CN114785778 B CN 114785778B
- Authority
- CN
- China
- Prior art keywords
- content
- request
- content request
- original
- response
- Prior art date
- Legal status (The legal status 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 status listed.)
- Active
Links
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/10—Protocols in which an application is distributed across nodes in the network
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L12/00—Data switching networks
- H04L12/66—Arrangements for connecting between networks having differing types of switching systems, e.g. gateways
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/10—Protocols in which an application is distributed across nodes in the network
- H04L67/1001—Protocols in which an application is distributed across nodes in the network for accessing one among a plurality of replicated servers
- H04L67/1004—Server selection for load balancing
- H04L67/1014—Server selection for load balancing based on the content of a request
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Information Transfer Between Computers (AREA)
Abstract
The embodiment of the application provides gateway equipment and a content distribution method, and relates to the technical field of content distribution. The gateway device includes: a communicator configured to: receiving an original content request sent by terminal equipment; a controller configured to: judging whether a request matching library comprises a redirected content request corresponding to an original content request or not; a communicator further configured to: when the method comprises the steps of sending a redirection content request corresponding to an original content request to terminal equipment, so that the terminal equipment obtains response content corresponding to the redirection content request from a content distribution network based on the redirection content request corresponding to the original content request; and when the content is not included, acquiring response content corresponding to the original content request from the content server, and sending the response content to the terminal equipment. The embodiment of the application is used for solving the problem that service loss is likely to be caused by content distribution through the CDN.
Description
Technical Field
The embodiment of the application relates to the technical field of content distribution. And more particularly, to a gateway apparatus and a content distribution method.
Background
The content delivery network (Content Delivery Network, CDN) is an intelligent virtual network built on top of existing networks. The CDN relies on the edge servers deployed in various places, and the terminal equipment can obtain the required content nearby through the load balancing, content distribution, scheduling and other functional modules of the center platform, so that the CDN can reduce network congestion and improve the access response speed and hit rate of the terminal equipment.
In the related art, an operation and maintenance person caches specified content to a CDN based on content hotness and the like, configures corresponding content distribution rules in gateway equipment based on content cached by the CDN, and when the gateway equipment receives content request information sent by terminal equipment, judges whether the CDN caches relevant data according to the content distribution rules first, if so, content distribution is performed by the CDN, and if not, content distribution is performed by the CDN. Since the content delivered by the CDN to all users is the same content, and when the operation and maintenance personnel designates the cache content of the CDN, dynamic content such as personalized content of the user and content displayed in a characteristic time period is likely to be designated as the cache content of the CDN, service loss is likely to be caused by content delivery through the CDN.
Disclosure of Invention
The exemplary embodiment of the application provides gateway equipment and a content distribution method, which solve the problem that service loss is likely to be caused by content distribution through CDNs.
The technical scheme provided by the embodiment of the application is as follows:
in a first aspect, an embodiment of the present application provides a gateway device, including:
a communicator configured to: receiving an original content request sent by terminal equipment;
A controller configured to: judging whether a request matching library comprises a redirected content request corresponding to the original content request or not;
the communicator is further configured to: when the request matching library comprises a redirection content request corresponding to the original content request, sending the redirection content request corresponding to the original content request to the terminal equipment, so that the terminal equipment obtains response content corresponding to the redirection content request from a content distribution network based on the redirection content request corresponding to the original content request; and when the request matching library does not comprise the redirected content request corresponding to the original content request, acquiring response content corresponding to the original content request from a content server and sending the response content to the terminal equipment.
In a second aspect, an embodiment of the present application provides a content distribution method, applied to a gateway device, where the method includes:
receiving an original content request sent by terminal equipment;
judging whether a request matching library comprises a redirected content request corresponding to the original content request or not;
if yes, sending a redirection content request corresponding to the original content request to the terminal equipment, so that the terminal equipment obtains response content corresponding to the redirection content request from a content distribution network based on the redirection content request corresponding to the original content request;
If not, obtaining the response content corresponding to the original content request from the content server and sending the response content to the terminal equipment.
In a third aspect, an embodiment of the present application provides an electronic device, including: a memory and a processor, the memory for storing a computer program; the processor is configured to cause the electronic device to implement the content distribution method according to the second aspect or any embodiment of the second aspect when executing the computer program.
In a fourth aspect, embodiments of the present application provide a computer readable storage medium having a computer program stored thereon, which when executed by a computing device, causes the computing device to implement the content distribution method according to the second aspect or any embodiment of the second aspect.
In a fifth aspect, embodiments of the present application provide a computer program product which, when run on a computer, causes the computer to implement the content distribution method of the second aspect or any embodiment of the second aspect.
As can be seen from the above technical solution, in the gateway device and the content distribution method provided by the embodiments of the present application, when the gateway device receives an original content request sent by a terminal device, it is determined whether a request matching library includes a redirect content request corresponding to the original content request, and when the request matching library includes a redirect content request corresponding to the original content request, the gateway device sends the redirect content request corresponding to the original content request to the terminal device, so that the terminal device obtains, from a content distribution network, response content corresponding to the redirect content request based on the redirect content request corresponding to the original content request, and when the request matching library does not include the redirect content request corresponding to the original content request, obtains, from a content server, the response content corresponding to the original content request, and sends the response content to the terminal device. The gateway device and the content distribution method provided by the embodiment of the application determine whether to send response content to the terminal device based on the content distribution network or the content server by judging whether the request matching library comprises the redirection content request corresponding to the original content request, so that the embodiment of the application can realize whether to send the response content to the terminal device based on the content distribution network in the content request granularity.
Drawings
In order to more clearly illustrate the embodiments of the present application or the implementation of the related art, the drawings that are required for the embodiments or the related art description will be briefly described, and it is apparent that the drawings in the following description are some embodiments of the present application and that other drawings may be obtained according to these drawings for a person having ordinary skill in the art.
FIG. 1 illustrates a scene architecture diagram of a content distribution method in some embodiments;
FIG. 2 illustrates a hardware configuration block diagram of a control device in some embodiments;
FIG. 3 illustrates a hardware configuration block diagram of a terminal device in some embodiments;
FIG. 4 illustrates a software configuration diagram in a terminal device in some embodiments;
FIG. 5 illustrates a hardware configuration block diagram of a gateway device in some embodiments;
FIG. 6 illustrates an interactive flow diagram of a content distribution method in some embodiments;
FIG. 7 shows a flow chart of steps of a content distribution method in further embodiments;
FIG. 8 illustrates a scene interface diagram of a content distribution method in other embodiments;
FIG. 9 illustrates an abstract interface diagram of a content distribution method in other embodiments;
FIG. 10 shows a flow chart of steps of a content distribution method in further embodiments;
Fig. 11 shows a flow chart of steps of a content distribution method in further embodiments.
Detailed Description
For the purposes of making the objects and embodiments of the present application more apparent, an exemplary embodiment of the present application will be described in detail below with reference to the accompanying drawings in which exemplary embodiments of the present application are illustrated, it being apparent that the exemplary embodiments described are only some, but not all, of the embodiments of the present application.
It should be noted that the brief description of the terminology in the present application is for the purpose of facilitating understanding of the embodiments described below only and is not intended to limit the embodiments of the present application. Unless otherwise indicated, these terms should be construed in their ordinary and customary meaning.
The terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a product or apparatus that comprises a list of elements is not necessarily limited to all elements explicitly listed, but may include other elements not expressly listed or inherent to such product or apparatus.
Fig. 1 is a schematic view of a scenario architecture of a content distribution method according to an embodiment of the present application. As shown in fig. 1, a scenario architecture provided by an embodiment of the present application includes: control device 100, terminal device 200, intelligent device 300, gateway device 400, content server 500, and CDN600.
The user may operate the terminal device 200 through the smart device 300 or the control apparatus 100 to control the terminal device to transmit a content request to the gateway device 400 and perform content output according to response content corresponding to the content request. The terminal device provided by the embodiment of the application can have various implementation forms, for example, an intelligent sound box, a refrigerator, a television, a washing machine, an air conditioner, an intelligent curtain, a router, a set top box, a mobile phone, a personal computer (Personal Computer, PC) intelligent television, a laser projection device, a display (monitor), an electronic whiteboard (electronic bulletin board), an electronic desktop (electronic table) and the like.
In some embodiments, the control device 100 may be a remote controller, and the communication between the remote controller and the terminal device includes infrared protocol communication or bluetooth protocol communication, and other short-range communication modes, and the terminal device 200 is controlled by a wireless or wired mode. The user may control the terminal device 200 by inputting user instructions through keys on a remote controller, voice input, control panel input, etc.
In some embodiments, the smart device 300 (e.g., mobile terminal, tablet, computer, notebook, etc.) may also be used to control the terminal device 200. For example, the terminal device 200 is controlled using an application running on the smart device.
In some embodiments, the terminal device 200 may also receive the control of the user through touch or gesture, etc., instead of receiving the instruction using the above-described smart device or control device.
In some embodiments, the display device 200 may also perform control in a manner other than the control apparatus 100 and the smart device 300, for example, the voice command control of the user may be directly received through a module configured inside the terminal device 200 device to obtain the voice command, or the voice command control of the user may be received through a voice control device configured outside the terminal device 200 device.
In some embodiments, the gateway device 400 may be in data communication with the content server 500 upon receipt of an original content request sent by the terminal device 200. Gateway device 400 may be permitted to make communication connections through a Local Area Network (LAN), a Wireless Local Area Network (WLAN), and other content servers 500. The content server 500 may provide various content and interactions to the gateway device 400. The content server 500 may be a cluster or a plurality of clusters, and may include one or more types of servers.
In some embodiments, when the gateway device 400 receives the original content request sent by the terminal device 200, it may send a redirect content request corresponding to the original content request to the terminal device 200, and instruct the terminal device 200 to obtain the response content from the CDN600 based on the redirect content request.
Fig. 2 exemplarily shows a block diagram of the configuration of the control apparatus 100 in the embodiment shown in fig. 1. As shown in fig. 2, the control device 100 includes a controller 110, a communication interface 130, a user input/output interface 140, a memory, and a power supply. The control device 100 may receive an input operation instruction of a user, and convert the operation instruction into an instruction recognizable and responsive to the terminal apparatus 200, to perform an interaction between the user and the terminal apparatus 200.
As shown in fig. 3, the terminal apparatus 200 includes at least one of a modem 210, a communicator 220, a detector 230, an external device interface 240, a controller 250, a display 260, an audio output interface 270, a memory, a power supply, and a user interface.
In some embodiments, the controller 250 includes a processor, a video processor, an audio processor, a graphics processor, RAM, ROM, a first interface to an nth interface for input/output.
The display 260 includes a display screen component for presenting a picture, and a driving component for driving an image display, a component for receiving an image signal from the controller output, displaying video content, image content, and a menu manipulation interface, and a user manipulation UI interface.
The display 260 may be a liquid crystal display, an OLED display, a projection device, or a projection screen.
The communicator 220 is a component for communicating with external devices or servers according to various communication protocol types. For example: the communicator may include at least one of a Wifi module, a bluetooth module, a wired ethernet module, or other network communication protocol chip or a near field communication protocol chip, and an infrared receiver. The terminal device 200 may establish transmission and reception of control signals and data signals with the external control device 100 or the server 400 through the communicator 220.
A user interface may be used to receive control signals input by a user via the control device 100 (e.g., an infrared remote control, etc.) or touch or gesture.
The detector 230 is used to collect signals of the external environment or interaction with the outside. For example, detector 230 includes a light receiver, a sensor for capturing the intensity of ambient light; alternatively, the detector 230 includes an image collector such as a camera, which may be used to collect external environmental scenes, user attributes, or user interaction gestures, or alternatively, the detector 230 includes a sound collector such as a microphone, or the like, which is used to receive external sounds.
The external device interface 240 may include, but is not limited to, the following: high Definition Multimedia Interface (HDMI), analog or data high definition component input interface (component), composite video input interface (CVBS), USB input interface (USB), RGB port, or the like. The input/output interface may be a composite input/output interface formed by a plurality of interfaces.
The modem 210 receives broadcast television signals through a wired or wireless reception manner, and demodulates audio and video signals, such as EPG data signals, from a plurality of wireless or wired broadcast television signals.
In some embodiments, the controller 250 and the modem 210 may be located in separate devices, i.e., the modem 210 may also be located in an external device to the main device in which the controller 250 is located, such as an external set-top box or the like.
The controller 250 controls the operation of the display device and responds to the user's operations through various software control programs stored on the memory. The controller 250 controls the overall operation of the display apparatus 200. For example: in response to receiving a user command to select a UI object to be displayed on the display 260, the controller 250 may perform an operation related to the object selected by the user command.
In some embodiments the controller includes at least one of a central processing unit (Central Processing Unit, CPU), video processor, audio processor, graphics processor (Graphics Processing Unit, GPU), RAM Random Access Memory, RAM), ROM (Read-Only Memory, ROM), first to nth interfaces for input/output, a communication Bus (Bus), and the like.
The user may input a user command through a Graphical User Interface (GUI) displayed on the display 260, and the user interface receives the user input command through the Graphical User Interface (GUI). Alternatively, the user may enter a user command by entering a specific sound or gesture, and the user interface recognizes the sound or gesture through the sensor to receive the user input command.
A "user interface" is a media interface for interaction and exchange of information between an application or operating system and a user, which enables conversion between an internal form of information and a user-acceptable form. A commonly used presentation form of the user interface is a graphical user interface (Graphic User Interface, GUI), which refers to a user interface related to computer operations that is displayed in a graphical manner. It may be an interface element such as an icon, a window, a control, etc. displayed in a display screen of the electronic device, where the control may include a visual interface element such as an icon, a button, a menu, a tab, a text box, a dialog box, a status bar, a navigation bar, a Widget, etc.
Referring to fig. 4, in some embodiments, the operating system of the terminal device is divided into four layers, namely, an application (Applications) layer (abbreviated as "application layer"), an application framework (Application Framework) layer (abbreviated as "framework layer"), a An Zhuoyun row (Android run time) and a system library layer (abbreviated as "system runtime layer"), and a kernel layer from top to bottom.
In some embodiments, at least one application program is running in the application program layer, and these application programs may be a Window (Window) program of an operating system, a system setting program, a clock program, or the like; or may be an application developed by a third party developer. In particular implementations, the application packages in the application layer are not limited to the above examples.
The framework layer provides an application programming interface (application programming interface, API) and programming framework for the application. The application framework layer includes a number of predefined functions. The application framework layer corresponds to a processing center that decides to let the applications in the application layer act. Through the API interface, the application program can access the resources in the system and acquire the services of the system in the execution.
As shown in fig. 4, the application framework layer in the embodiment of the present application includes a manager (manager), a Content Provider (Content Provider), and the like, where the manager includes at least one of the following modules: an Activity Manager (Activity Manager) is used to interact with all activities that are running in the system; a Location Manager (Location Manager) is used to provide system services or applications with access to system Location services; a Package Manager (Package Manager) for retrieving various information about applications currently installed on the device; a notification manager (Notification Manager) for controlling the display and clearing of notification messages; a Window Manager (Window Manager) is used to manage icons, windows, toolbars, wallpaper, and desktop components on the user interface.
In some embodiments, the activity manager is used to manage the lifecycle of the individual applications as well as the usual navigation rollback functions, such as controlling the exit, opening, fallback, etc. of the applications. The window manager is used for managing all window programs, such as obtaining the size of the display screen, judging whether a status bar exists or not, locking the screen, intercepting the screen, controlling the change of the display window (for example, reducing the display window to display, dithering display, distorting display, etc.), etc.
In some embodiments, the system runtime layer provides support for the upper layer, the framework layer, and when the framework layer is in use, the android operating system runs the C/C++ libraries contained in the system runtime layer to implement the functions to be implemented by the framework layer.
In some embodiments, the kernel layer is a layer between hardware and software. As shown in fig. 4, the kernel layer contains at least one of the following drivers: audio drive, display drive, bluetooth drive, camera drive, WIFI drive, USB drive, HDMI drive, sensor drive (e.g., fingerprint sensor, temperature sensor, pressure sensor, etc.), and power supply drive, etc.
As shown in fig. 5, the gateway apparatus 400 includes: at least one of modem 410, communicator 420 controller 430, memory, power supply, user interface.
In some embodiments, when gateway device 400 receives an original content request sent by a terminal device through communicator 420, controller 430 judges whether a request matching library includes a redirected content request corresponding to the original content request or not through gateway device 400, and when the request matching library includes the redirected content request corresponding to the original content request, sends the redirected content request corresponding to the original content request to the terminal device through communicator 410, so that the terminal device obtains response content corresponding to the redirected content request from a content distribution network based on the redirected content request corresponding to the original content request; when the request matching library does not include the redirected content request corresponding to the original content request, the response content corresponding to the original content request is acquired from the content server through the communicator 410, and then the acquired response content corresponding to the original content request is forwarded to the terminal device through the communicator 410.
In some embodiments, when the gateway device 400 obtains the response content corresponding to the original content request from the content server through the communicator 410, the gateway device 400 further determines, through the controller 430, whether the response content corresponding to the original content request meets the condition of caching to the CDN (preset condition), and if the response content corresponding to the original content request meets the condition of caching to the CDN, caches the response content corresponding to the original content request to the CDN, generates a redirected content request corresponding to the original content request, and adds the redirected content request corresponding to the original content request to the request matching library, so that when the same or similar content request sent by the terminal device is subsequently received, the redirected content request corresponding to the original content request is sent to the terminal device, so that the terminal device obtains the response content corresponding to the redirected content request from the content distribution network based on the redirected content request corresponding to the original content request.
In some embodiments, the implementation manner of the gateway device 400 to determine, through the communicator 410, whether the response content corresponding to the original content request meets the condition of caching to the CDN may include: recursively acquiring resource files of each level of the response content, and generating a resource file set corresponding to the response content; determining whether each resource file in the resource file set can be cached to the content distribution network according to the attribute of each resource file in the resource file set; if all the resource files in the resource file set can be cached in the content distribution network, determining that the response content meets the preset condition; and if one or more resource files in the resource file set can not be cached in the content distribution network, determining that the response content does not meet the preset condition. That is, whether each resource file in the response content corresponding to the original content request accords with the condition of caching to the CDN is determined, if all the resource files accord with the condition of caching to the CDN, the response content corresponding to the original content request is determined to accord with the condition of caching to the CDN, and if one or more resource files do not accord with the condition of caching to the CDN, the response content corresponding to the original content request is determined to not accord with the condition of caching to the CDN.
In some embodiments, the attributes of the resource file include the business scenario of the resource file. The gateway device 400 determines whether the resource file meets the condition of caching to the CDN, including: determining whether the service scene of each resource file in the resource file set belongs to a preset service scene; if the service scene of the first resource file in the resource file set does not belong to the preset service scene, determining that the first resource file can be cached to the content distribution network; and if the service scene of the second resource file in the resource file set belongs to the preset service scene, determining that the second resource file cannot be cached in the content distribution network. In actual use, service scenes of all resource files can be preconfigured, and service scenes which are unsuitable for buffering to the CDN, such as a user-related service scene, a timing operation service scene, an intelligent recommendation service scene and the like, are configured as preset service scenes, so that uploading of the resource files which are unsuitable for buffering to the CDN, such as the user-related service scene, the timing operation service scene, the intelligent recommendation service scene and the like, to the CDN is avoided.
In some embodiments, the implementation manner of the gateway device 400 to generate the redirected content request corresponding to the original content request includes: after caching response content corresponding to the original content request to the content distribution network, receiving a cache address of the response content corresponding to the original content request sent by the content distribution network; and generating a redirection content request corresponding to the original content request according to the cache address. That is, the cache address of the response content corresponding to the original content request may be used as the redirected content request corresponding to the original content request.
In some embodiments, to avoid excessive data in the request matching library, the redirected content requests in the request matching library are valid, and redirected content requests that exceed the valid are purged from the request matching library. In some embodiments, the manner in which redirected content requests that exceed the validity period are cleared includes: when the redirected content request corresponding to the original content request is added into the request matching library, starting timing; and deleting the redirected content request corresponding to the original content request from the request matching library when the timing duration reaches the preset duration. Because the redirected content request exceeding the validity period is cleared from the request matching library, corresponding response data cached in the CDN is also invalidated, and timely clearing of the invalidation data cached in the CDN can improve the cache utilization rate of the CDN, so that the gateway device further deletes the response content corresponding to the original content request from the cache of the content delivery network after deleting the redirected content request corresponding to the original content request from the request matching library.
In some embodiments, the implementation manner of adding the redirected content request corresponding to the original content request to the request matching library by the gateway device 400 includes: performing generalization processing on request parameters in the original content request to obtain a generalized content request corresponding to the original content request; establishing a corresponding relation between the generalized content request and the redirected content request; and adding the corresponding relation to the request matching library. In response, the gateway device 400 may further perform generalization processing on the request parameters in the original content request before determining whether the request matching library includes the redirected content request corresponding to the original content request. The probability of finding the corresponding redirected content request can be improved by generalizing the request parameters in the original content request, so that the pressure and the calculation cost of the server are reduced.
Fig. 6 is a schematic flow chart illustrating a content distribution method according to an embodiment of the present application, and as shown in fig. 6, the content distribution method according to the embodiment of the present application includes the following steps:
s601, the terminal equipment sends an original content request to the gateway equipment.
Correspondingly, the gateway device receives an original content request sent by the terminal device.
In some embodiments, the implementation of the terminal device sending the original content request to the gateway device may include: the terminal equipment responds to the user operation to determine the user interface to be displayed, and sends an original content request to the gateway equipment according to the display content of the user interface to be displayed. For example: when the user operates to start the operation of the television, the television can determine the home page of the television of the user interface to be displayed, and further display content with the home page sends an original content request to the gateway equipment.
In some embodiments, the original content request may be a user request for interface data.
S602, the gateway equipment judges whether a request matching library comprises a redirected content request corresponding to the original content request.
In some embodiments, the request matching library may store the correspondence between the original content request and the redirected content request in the form of a correspondence table, and determine whether the redirected content request corresponding to the original content request is included in the request matching library by determining whether the original content request is included in the request matching library. For example, when the request matching library stores the correspondence between the original content request and the redirected content request in the form of a correspondence table, the storage content in the request matching library may be as shown in the following table 1:
TABLE 1
In some embodiments, both the original content request and the redirected content request may be uniform resource locators (Uniform Resource Locator, URLs).
In the above step S602, if the gateway device determines that the request matching library includes a redirected content request corresponding to the original content request, the following steps S603 to S606 are performed.
S603, the gateway equipment acquires a redirected content request corresponding to the original content request according to the request matching library.
S604, the gateway equipment sends a redirection content request corresponding to the original content request to the terminal equipment.
Correspondingly, the terminal equipment receives a redirection content request corresponding to the original content request sent by the gateway equipment.
S605, the terminal equipment sends a redirection content request corresponding to the original content request to a content distribution network.
Correspondingly, the content distribution network receives a redirection content request corresponding to the original content request sent by the terminal equipment.
S606, the content distribution network sends response content corresponding to the redirection content request to the terminal equipment.
Correspondingly, the terminal equipment receives response content corresponding to the redirection content request sent by the content distribution network.
In some embodiments, the buffer data of the content distribution network has a validity period, and when the buffer data of the content distribution network exceeds the validity period, the data exceeding the validity period is deleted from the buffer of the content distribution network, so the implementation of the step S606 (the content distribution network sends the response content corresponding to the redirecting content request to the terminal device) may include the following steps a to e:
and a step a of determining whether the response content corresponding to the redirection content request is out of date.
In the step a, if it is determined that the response content corresponding to the redirection content request is not expired, the following steps b and c are executed.
And b, reading response content corresponding to the redirection content request from the cache.
And c, sending response content corresponding to the redirection content request to the terminal equipment.
In the step a, if it is determined that the response content corresponding to the redirection content request has expired, the following steps d and e are executed.
And d, acquiring response content corresponding to the redirected content request from the content server.
And e, sending response content corresponding to the redirection content request to the terminal equipment.
To this end, the terminal device acquires the response content from the content distribution network.
In the above step S602, if the gateway device determines that the request matching library does not include the redirected content request corresponding to the original content request, the following steps S607 to S609 are performed.
S607, the gateway device sends the original content request to the content server.
Correspondingly, the content server receives the original content request sent by the gateway device.
And S608, the content server sends response content corresponding to the original content request to the gateway equipment.
Correspondingly, the gateway equipment receives response content corresponding to the original content request sent by the content server.
S609, the gateway device sends response content corresponding to the original content request to the terminal device.
Correspondingly, the terminal equipment receives response content corresponding to the original content request sent by the gateway equipment.
So far, the terminal device acquires the response content from the content server.
According to the content distribution method provided by the embodiment of the application, when the gateway equipment receives an original content request sent by the terminal equipment, whether a request matching library comprises a redirection content request corresponding to the original content request is judged, when the request matching library comprises the redirection content request corresponding to the original content request, the redirection content request corresponding to the original content request is sent to the terminal equipment, so that the terminal equipment obtains response content corresponding to the redirection content request from a content distribution network based on the redirection content request corresponding to the original content request, and when the request matching library does not comprise the redirection content request corresponding to the original content request, the response content corresponding to the original content request is obtained from a content server and sent to the terminal equipment. The gateway device and the content distribution method provided by the embodiment of the application determine whether to send response content to the terminal device based on the content distribution network or the content server by judging whether the request matching library comprises the redirection content request corresponding to the original content request, so that the embodiment of the application can realize whether to send the response content to the terminal device based on the content distribution network in the content request granularity.
Referring to fig. 7, as an extension and refinement of the embodiment shown in fig. 6, after step S608 (the content server transmits the response content corresponding to the original content request to the gateway device) on the basis of steps S601 to S609 shown in fig. 6, the content distribution method provided by the embodiment of the present application further includes the steps of:
s701, the gateway equipment judges whether the response content meets a preset condition.
That is, the gateway device determines whether the response content acquired from the content server satisfies the condition of caching to the content distribution network.
In some embodiments, the implementation manner of the step S701 (the gateway device determines whether the response content meets the preset condition) includes the following steps i to iii:
and step I, recursively acquiring resource files of each level of the response content, and generating a resource file set corresponding to the response content.
That is, the resource files of each hierarchy of the response content are recursively acquired, and all the acquired resource files are combined into a resource file set corresponding to the response content.
For example, referring to fig. 8, a display interface with a television set as the response content is shown in fig. 8. The response content comprises: [ navigation List ] the navigation List includes: navigation items: [ My ], [ preferably ], [ film xx ], [ VIP ], [ TV show ], [ child ], [ education ], [ K song ], wherein the [ education ] is the focus navigation item in the navigation items. Navigation items [ education ] include: the side bar navigation comprises sub navigation items [ one grade ], two grades ], three grades ], four grades, five grades, six grades and seven grades, wherein the one grade is a focus sub navigation item in the sub navigation items. The recommended resource file of the first grade comprises the following items of medium resource 1, medium resource 2, medium resource 3, medium resource 4, medium resource 5, medium resource 6 and medium resource 7. Abstracting the response content corresponding to the display interface shown in fig. 8, the abstract diagram shown in fig. 9 may be obtained, and further, the resource file data structure of the response content may be obtained as follows:
A resource file of each level of response content corresponding to the display interface shown in fig. 8 is recursively acquired, and a resource file set corresponding to the response content is generated as { [ navigation list }, [ my ], [ recommendation ], [ movie xx ], [ VIP ], [ TV play ], [ juvenile ], [ education ], [ K song ], [ one-year ], [ two-year ], [ three-year ], [ four-year ], [ five-year ], [ six-year ], [ seven-year ], [ medium 1 ], [ medium 2 ], [ medium 3 ], [ medium 4 ], [ medium 5 ], [ medium 6 ], [ medium 7 }.
And step II, determining whether each resource file in the resource file set can be cached in the content distribution network according to the attribute of each resource file in the resource file set.
For example: for [ navigation list ]: determining whether the navigation list is recommended content or fixed content, wherein navigation items [ my ], [ recommended ], [ movie xx ], [ VIP ], [ TV play ], [ juvenile ], [ education ], [ K song ] under the navigation list are time-sharing operation content (content displayed in a designated time period), and if so, the navigation items cannot be cached to a content distribution network, otherwise, the navigation items cannot be cached to the content distribution network.
For another example: for the sub-navigation items of the navigation item [ education ], if each interface request is issued by [ one grade ], two grades ], three grades ], four grades ], five grades, six grades and seven grades, and the sequence is fixed, the [ education ] can be cached to the content distribution network.
In some embodiments, the attributes of any resource file include the business scenario of the resource file. The service scene of the resource file can be preconfigured by operation staff.
When the attribute of the resource file includes the service scenario of the resource file, the implementation manner of the step ii (determining, according to the attribute of each resource file in the resource file set, whether each resource file in the resource file set can be cached in the content distribution network) may include the following steps 1 to 3:
step 1, determining whether the service scene of each resource file in the resource file set belongs to a preset service scene.
The preset service scenario may include: the user related service scenario, the timing operation service scenario, the intelligent recommendation service scenario and the like are not suitable for the service scenario cached to the CDN.
In the above step 1, if the service scenario of the first resource file in the resource file set does not belong to the preset service scenario, the following step 2 is executed, and if the service scenario of the second resource file in the resource file set belongs to the preset service scenario, the following step 3 is executed.
And 2, determining that the first resource file can be cached to the content distribution network.
And step 3, determining that the second resource file cannot be cached in the content distribution network.
The first resource file and the first resource file are any resource file in the resource file set.
And if it is determined in the step ii that all the resource files in the resource file set can be cached in the content distribution network, executing the following step iii.
And III, determining that the response content meets the preset condition.
As described in the above example, when the resource file set is { [ navigation list ], [ my ], [ recommendation ], [ movie xx ], [ VIP ], [ television show ], [ child ], [ education ], [ K song ], [ one-grade ], [ two-grade ], [ three-grade ], [ four-grade ], [ five-grade ], [ six-grade ], [ seven-grade ], [ medium resource 1 ], [ medium resource 2 ], [ medium resource 3 ], [ medium resource 4 ], [ medium resource 5 ], [ medium 6 ], [ medium 7 ] }, each resource file can be cached to the content distribution network, the response content corresponding to the display interface shown in fig. 8 is determined to satisfy the preset condition.
And if the step II is that one or more resource files in the resource file set can not be cached in the content distribution network, executing the following step IV.
And IV, determining that the response content does not meet the preset condition.
That is, as long as any resource file in the resource file set cannot be cached in the content distribution network, it is determined that the response content does not meet the preset condition.
In some embodiments, a data identifier may be added in advance in the resource file, if the resource file may be cached in the content distribution network, a first identifier is added, if the resource file may not be cached in the content distribution network, a second identifier is added, after a resource file set corresponding to the response content is obtained, the data identifiers of the resource files in the resource file set are traversed, if the first identifiers are both the first identifiers, it is determined that the response content meets the preset condition, and if one or more second identifiers are provided, the response content does not meet the preset condition. Illustratively, the first identifier may be 1 and the second identifier may be 0.
In the above step S701, if it is determined that the response content satisfies the preset condition, the following steps S702 to S704 are performed.
S702, the gateway equipment caches the response content to the content distribution network.
In some embodiments, an implementation of the gateway device to cache the response content to the content distribution network may include:
and the gateway equipment sends the response content caching instruction to the content distribution network so as to instruct the content distribution network to cache the response content.
S703, the gateway equipment generates a redirection content request corresponding to the original content request.
In some embodiments, the implementation manner of the gateway device generating the redirected content request corresponding to the original content request may include:
and the gateway equipment receives the cache address of the response content corresponding to the original content request sent by the content distribution network and generates a redirection content request corresponding to the original content request according to the cache address.
S704, the gateway equipment adds the redirected content request corresponding to the original content request into the request matching library.
The above embodiment further judges whether the response content satisfies the condition of caching to the content distribution network after the gateway device obtains the response content corresponding to the original content request from the content server, caches the response content to the content distribution network under the condition that the response content satisfies the preset condition, generates the redirection content request corresponding to the original content request, and adds the redirection content request corresponding to the original content request to the request matching library, so that the above embodiment can send the response content to the terminal device through the content distribution network when the same or similar content request is subsequently received, thereby reducing server pressure and calculation cost.
Referring to fig. 10, as an extension and refinement of the embodiment shown in fig. 7, on the basis of each step shown in fig. 7, the content distribution method provided by the embodiment of the present application further includes the following steps:
s101, when the gateway equipment adds the redirected content request corresponding to the original content request into the request matching library, starting timing.
In some embodiments, the gateway device may start a timer when adding the redirected content request corresponding to the original content request to the request matching library, and time by the timer.
S102, deleting the redirected content request corresponding to the original content request from the request matching library when the timing duration reaches the preset duration.
Because the redirection content request corresponding to the original content request in the request matching library is deleted, when the same or similar original request is subsequently received, the gateway device determines that the redirection content request corresponding to the original content request is not included in the request matching library, and further, the response content corresponding to the redirection content request cannot be obtained from the content distribution network, so that the corresponding response content cached by the content distribution network should also be deleted from the cache of the content distribution network to improve the utilization rate of the cache of the content distribution network, and therefore, after deleting the redirection content request corresponding to the original content request from the request matching library, the content distribution method provided by the embodiment of the application further includes the following step S103.
S103, deleting the response content corresponding to the original content request from the cache of the content distribution network.
According to the embodiment, when the redirection content request corresponding to the original content request is added into the request matching library, timing is started, when the timing time length reaches the preset time length, the redirection content request corresponding to the original content request is deleted from the request matching library, and the response content corresponding to the original content request is deleted from the cache of the content distribution network, so that the invalidation data in the request matching library and the invalidation data cached by the content distribution network can be cleared timely, and the utilization rate of storage resources is improved.
Referring to fig. 11, as an extension and refinement of the embodiment shown in fig. 7, step S704 shown in fig. 7 (the gateway device adds the redirected content request corresponding to the original content request to the request matching library) includes the following steps S111 to S113:
s111, the gateway equipment performs generalization processing on the request parameters in the original content request to obtain a generalized content request corresponding to the original content request.
And S112, the gateway equipment establishes a corresponding relation between the generalized content request and the redirection content request.
S113, the gateway equipment adds the corresponding relation into the request matching library.
Corresponding to the above steps S111 to S113, before step S602, the content distribution method provided by the embodiment of the present application further includes:
s114, the gateway equipment performs generalization processing on the request parameters in the original content request.
The embodiment can generalize the request parameters in the original content request sent by the terminal equipment and generalize the request parameters in the original content request stored in the request matching library, so that the embodiment can improve the probability of the redirection request corresponding to the original content request in the request matching library and reduce the pressure of the server and the calculation cost.
In some embodiments, the present application further provides an electronic device, including: a memory and a processor, the memory for storing a computer program; the processor is configured to cause the electronic device to implement the content distribution method according to any one of the foregoing embodiments when executing the computer program.
In some embodiments, embodiments of the present application provide a computer readable storage medium having a computer program stored thereon, which when executed by a computing device, causes the computing device to implement the content distribution method according to any of the embodiments above.
In some embodiments, embodiments of the present application provide a computer program product which, when run on a computer, causes the computer to implement the content distribution method of the second aspect or any embodiment of the second aspect.
Finally, it should be noted that: the above embodiments are only for illustrating the technical solution of the present application, and not for limiting the same; although the application has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical scheme described in the foregoing embodiments can be modified or some or all of the technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit of the application.
The foregoing description, for purposes of explanation, has been presented in conjunction with specific embodiments. However, the illustrative discussions above are not intended to be exhaustive or to limit the embodiments to the precise forms disclosed above. Many modifications and variations are possible in light of the above teaching. The embodiments were chosen and described in order to best explain the principles and the practical application, to thereby enable others skilled in the art to best utilize the embodiments and various embodiments with various modifications as are suited to the particular use contemplated.
Claims (9)
1. A gateway device, comprising:
a communicator configured to: receiving an original content request sent by terminal equipment;
a controller configured to: judging whether a request matching library comprises a redirected content request corresponding to the original content request or not;
the communicator is further configured to: when the request matching library comprises a redirection content request corresponding to the original content request, sending the redirection content request corresponding to the original content request to the terminal equipment, so that the terminal equipment obtains response content corresponding to the redirection content request from a content distribution network based on the redirection content request corresponding to the original content request; when the request matching library does not comprise the redirected content request corresponding to the original content request, response content corresponding to the original content request is obtained from a content server and sent to the terminal equipment;
the controller is further configured to:
after the communicator obtains the response content corresponding to the original content request from the content server, judging whether the response content meets a preset condition or not;
and under the condition that the response content meets the preset condition, caching the response content to the content distribution network, generating a redirection content request corresponding to the original content request, and adding the redirection content request corresponding to the original content request into the request matching library.
2. The gateway device of claim 1, wherein the controller is configured to:
recursively acquiring resource files of each level of the response content, and generating a resource file set corresponding to the response content;
determining whether each resource file in the resource file set can be cached to the content distribution network according to the attribute of each resource file in the resource file set;
if all the resource files in the resource file set can be cached in the content distribution network, determining that the response content meets the preset condition;
and if one or more resource files in the resource file set can not be cached in the content distribution network, determining that the response content does not meet the preset condition.
3. The gateway device of claim 2, wherein the attribute of any resource file comprises a service scenario of the resource file; the controller is configured to:
determining whether the service scene of each resource file in the resource file set belongs to a preset service scene;
if the service scene of the first resource file in the resource file set does not belong to the preset service scene, determining that the first resource file can be cached to the content distribution network;
And if the service scene of the second resource file in the resource file set belongs to the preset service scene, determining that the second resource file cannot be cached in the content distribution network.
4. The gateway device of claim 1, wherein the controller is configured to:
receiving a cache address of response content corresponding to the original content request sent by the content distribution network;
and generating a redirection content request corresponding to the original content request according to the cache address.
5. The gateway device of claim 1, wherein the controller is further configured to:
when the redirected content request corresponding to the original content request is added into the request matching library, starting timing;
and deleting the redirected content request corresponding to the original content request from the request matching library when the timing duration reaches the preset duration.
6. The gateway device of claim 5, wherein the controller is further configured to:
and deleting response content corresponding to the original content request from the cache of the content distribution network after deleting the redirected content request corresponding to the original content request from the request matching library.
7. The gateway device of claim 1, wherein the controller is configured to:
performing generalization processing on request parameters in the original content request to obtain a generalized content request corresponding to the original content request;
establishing a corresponding relation between the generalized content request and the redirected content request;
and adding the corresponding relation to the request matching library.
8. The gateway device of claim 7, wherein the controller is further configured to:
and before judging whether the request matching library comprises the redirected content request corresponding to the original content request, generalizing the request parameters in the original content request.
9. A content distribution method, applied to a gateway device, the method comprising:
receiving an original content request sent by terminal equipment;
judging whether a request matching library comprises a redirected content request corresponding to the original content request or not;
if yes, sending a redirection content request corresponding to the original content request to the terminal equipment, so that the terminal equipment obtains response content corresponding to the redirection content request from a content distribution network based on the redirection content request corresponding to the original content request;
If not, obtaining response content corresponding to the original content request from a content server and sending the response content to the terminal equipment;
the method further comprises the steps of:
after obtaining response content corresponding to the original content request from the content server, judging whether the response content meets a preset condition;
and under the condition that the response content meets the preset condition, caching the response content to the content distribution network, generating a redirection content request corresponding to the original content request, and adding the redirection content request corresponding to the original content request into the request matching library.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210231223.3A CN114785778B (en) | 2022-03-10 | 2022-03-10 | Gateway device and content distribution method |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210231223.3A CN114785778B (en) | 2022-03-10 | 2022-03-10 | Gateway device and content distribution method |
Publications (2)
Publication Number | Publication Date |
---|---|
CN114785778A CN114785778A (en) | 2022-07-22 |
CN114785778B true CN114785778B (en) | 2023-09-01 |
Family
ID=82423621
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202210231223.3A Active CN114785778B (en) | 2022-03-10 | 2022-03-10 | Gateway device and content distribution method |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN114785778B (en) |
Citations (14)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2010128651A (en) * | 2008-11-26 | 2010-06-10 | Nippon Telegr & Teleph Corp <Ntt> | Content providing system and personalizing method in content providing system |
CN101997822A (en) * | 2009-08-26 | 2011-03-30 | 中国移动通信集团公司 | Streaming media content delivery method, system and equipment |
CN102143204A (en) * | 2010-11-26 | 2011-08-03 | 华为技术有限公司 | Method, device and system for realizing reorientation of hypertext transfer protocol in content delivery network |
CN102890925A (en) * | 2011-03-24 | 2013-01-23 | 柯尼卡美能达商用科技株式会社 | Data manipulation transmission apparatus and data manipulation transmission method |
CN103051976A (en) * | 2013-01-22 | 2013-04-17 | 中兴通讯股份有限公司 | Method, system and equipment for distributing HLS (HyperText Transfer Protocol Living Steaming) content by CDN (Content Distribute Network) |
CN104040939A (en) * | 2011-10-24 | 2014-09-10 | 皇家Kpn公司 | Secure distribution of content |
CN107181779A (en) * | 2016-03-10 | 2017-09-19 | 阿里巴巴集团控股有限公司 | Processing method, the device and system of access request |
CN107249017A (en) * | 2017-05-05 | 2017-10-13 | 中广热点云科技有限公司 | A kind of method and server that HLS contents are obtained by CDN |
CN108769097A (en) * | 2018-03-30 | 2018-11-06 | 中国科学院信息工程研究所 | Support the content distribution network system of network-control |
CN109154943A (en) * | 2016-06-13 | 2019-01-04 | 谷歌有限责任公司 | Conversion based on server of the automatic broadcasting content to click play content |
CN109561057A (en) * | 2017-09-27 | 2019-04-02 | 中兴通讯股份有限公司 | A kind of content distributing network entities business processing method, apparatus and system |
CN109996201A (en) * | 2018-01-02 | 2019-07-09 | 中国移动通信有限公司研究院 | A kind of Network Access Method and the network equipment |
CN110178356A (en) * | 2017-04-26 | 2019-08-27 | 华为技术有限公司 | Method, control plane network element, syndication users veil member, content server and the terminal device of redirection |
CN114070652A (en) * | 2022-01-12 | 2022-02-18 | 北京金山云网络技术有限公司 | CDN resource blocking method and device, electronic equipment and storage medium |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2019111033A1 (en) * | 2017-12-04 | 2019-06-13 | Telefonaktiebolaget Lm Ericsson (Publ) | Automatic provisioning of streaming policies for video streaming control in cdn |
-
2022
- 2022-03-10 CN CN202210231223.3A patent/CN114785778B/en active Active
Patent Citations (14)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2010128651A (en) * | 2008-11-26 | 2010-06-10 | Nippon Telegr & Teleph Corp <Ntt> | Content providing system and personalizing method in content providing system |
CN101997822A (en) * | 2009-08-26 | 2011-03-30 | 中国移动通信集团公司 | Streaming media content delivery method, system and equipment |
CN102143204A (en) * | 2010-11-26 | 2011-08-03 | 华为技术有限公司 | Method, device and system for realizing reorientation of hypertext transfer protocol in content delivery network |
CN102890925A (en) * | 2011-03-24 | 2013-01-23 | 柯尼卡美能达商用科技株式会社 | Data manipulation transmission apparatus and data manipulation transmission method |
CN104040939A (en) * | 2011-10-24 | 2014-09-10 | 皇家Kpn公司 | Secure distribution of content |
CN103051976A (en) * | 2013-01-22 | 2013-04-17 | 中兴通讯股份有限公司 | Method, system and equipment for distributing HLS (HyperText Transfer Protocol Living Steaming) content by CDN (Content Distribute Network) |
CN107181779A (en) * | 2016-03-10 | 2017-09-19 | 阿里巴巴集团控股有限公司 | Processing method, the device and system of access request |
CN109154943A (en) * | 2016-06-13 | 2019-01-04 | 谷歌有限责任公司 | Conversion based on server of the automatic broadcasting content to click play content |
CN110178356A (en) * | 2017-04-26 | 2019-08-27 | 华为技术有限公司 | Method, control plane network element, syndication users veil member, content server and the terminal device of redirection |
CN107249017A (en) * | 2017-05-05 | 2017-10-13 | 中广热点云科技有限公司 | A kind of method and server that HLS contents are obtained by CDN |
CN109561057A (en) * | 2017-09-27 | 2019-04-02 | 中兴通讯股份有限公司 | A kind of content distributing network entities business processing method, apparatus and system |
CN109996201A (en) * | 2018-01-02 | 2019-07-09 | 中国移动通信有限公司研究院 | A kind of Network Access Method and the network equipment |
CN108769097A (en) * | 2018-03-30 | 2018-11-06 | 中国科学院信息工程研究所 | Support the content distribution network system of network-control |
CN114070652A (en) * | 2022-01-12 | 2022-02-18 | 北京金山云网络技术有限公司 | CDN resource blocking method and device, electronic equipment and storage medium |
Non-Patent Citations (1)
Title |
---|
大规模Web服务器漏洞发现与验证技术研究;安潇羽;《中国优秀硕士学位论文全文数据库》;全文 * |
Also Published As
Publication number | Publication date |
---|---|
CN114785778A (en) | 2022-07-22 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US11363452B2 (en) | Systems and methods for real-time remote control of mobile applications | |
US8707321B2 (en) | Resource sharing system and method thereof | |
US11385930B2 (en) | Automatic workflow-based device switching | |
US20130080560A1 (en) | System and Method for Sharing Digital Data on a Presenter Device to a Plurality of Participant Devices | |
CN106416195A (en) | Actionable notifications | |
CN112905210A (en) | Server and gray scale publishing method | |
CN112486921B (en) | File synchronization method, display device and mobile terminal | |
CN112632160A (en) | Intelligent device and intelligent device login method | |
CN115037970B (en) | Control validity detection method and display device | |
CN115278822A (en) | Display apparatus, control apparatus, and broadcast source scanning method | |
WO2024174732A1 (en) | Display device and speech control method | |
CN113569089A (en) | Information processing method, device, server, equipment, system and storage medium | |
CN114785778B (en) | Gateway device and content distribution method | |
CN112507329A (en) | Safety protection method and device | |
CN110083321B (en) | Content display method and device, intelligent screen projection terminal and readable storage medium | |
US12022148B2 (en) | Display apparatus | |
US20240323472A1 (en) | Display apparatus | |
JP2019508828A (en) | Method and apparatus for sending mail while downloading data | |
CN117806687A (en) | Terminal, server and data updating method | |
CN113992963A (en) | Display device and screen projection method | |
CN116033195A (en) | Server and detail page acquisition method | |
CN117806747A (en) | Display device and screen saver jump method of display device | |
CN118827739A (en) | Server, display device and version adaptation method | |
CN117294879A (en) | Service device and display device | |
CN118612734A (en) | Display device and hot spot connection control method |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |