How to obtain the server and details page
By setting encryption values for media supplies and generating a detailed page address containing the encryption values, the problem of untimely update of the details page is solved, and timely update of the details page data and improve the user experience is achieved.
Patent Information
- Application Number
- CN202111240295.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-10-25
- Publication Date
- 2025-02-25
- Estimated Expiration
- 2041-10-25
AI Technical Summary
In the prior art, the inadequate update of the details page will affect the user experience, especially when the media content is updated in a variety of updates, the inadequate update of the CDN server will cause the user to see the old details page.
By setting an encryption value for each media, the encryption value is generated by encrypting all the details page data corresponding to the media identifier, and generating a detailed page address containing the encryption value, the media identifier and the page number identification. The CDN server stores the details page data based on this address. When the user accesses, if the cache data is not updated, return to the server of the display device to obtain the updated details page data.
It realizes timely update of the details page data, avoiding the old data stored in the CDN server being returned to the user, improving the user experience, and reducing the use of server storage resources.
Smart Images

Figure CN116033195B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of server technology, and in particular to a method for obtaining a server and a detail page. Background Art
[0002] Nowadays, the homepage of some smart TVs will display media resources recommended for users to watch. When users click on a media resource, they can enter the details page of the media resource, where they can watch the media resource introduction, select an episode to watch, and so on. For media resources that have been fully updated, the details page usually does not change, but for some media resources that are continuously updated, the content of the details page will change before and after the update, and the number of user visits will also increase dramatically.
[0003] In the related art, in order to reduce the pressure on the server caused by the sharp increase in the number of visits, one solution is to use a third-party CDN server to process the access requests for some detail pages. The third-party server can cache the data of the detail pages, and directly feed back the cached detail page data to the display device after receiving the user's access request. However, the third-party CDN server can only feed back the latest detail page data to the display device after its own detail page data is updated. If the update is not timely, the user will see that the detail page has not been updated, which affects the user experience. Summary of the invention
[0004] In order to solve the technical problem of untimely update of detail pages, this application provides a server and a method for obtaining detail pages.
[0005] In a first aspect, the present application provides a server, which is configured to:
[0006] Receive a detail page request from a display device, wherein the detail page request is provided with a media asset identifier and a page number identifier of the detail page;
[0007] In response to the detail page request, generating a detail page address including an encrypted value, the media asset identifier and a page number identifier, wherein the encrypted value is generated by encrypting data of all detail pages corresponding to the media asset identifier;
[0008] The detail page address is fed back to the display device, so that the display device requests the detail page data corresponding to the detail page identifier from the content distribution network server, and generates the detail page corresponding to the detail page identifier according to the detail page data.
[0009] In some embodiments, the encrypted value includes an MD5 value, and generating a detail page address including the encrypted value, the media asset identifier, and the page number identifier includes:
[0010] Extracting the media asset identifier from the detail page request;
[0011] Obtaining the MD5 value corresponding to the media asset identifier;
[0012] The storage path root directory of the content distribution network server for storing the detail page data of all media assets, the media asset identifier, the page code identifier and the MD5 value are spliced into the detail page address of the detail page data corresponding to the detail page request on the content detail page request.
[0013] In some embodiments, obtaining the MD5 value corresponding to the media asset identifier includes:
[0014] Obtain the MD5 value corresponding to the media asset identifier from the redis server;
[0015] If the MD5 value is not obtained, obtaining a distributed lock corresponding to the media asset identifier, wherein the distributed lock corresponds to the media asset identifier in a one-to-one manner;
[0016] The detail page data of all detail pages corresponding to the distributed lock are obtained from the MySQL server, and the MD5 value of the media asset identifier is generated according to the detail page data of all detail pages.
[0017] In some embodiments, generating the MD5 value of the media asset identifier according to the detail page data of all detail pages includes:
[0018] The data of each detail page is encrypted using the MD5 encryption algorithm to obtain the MD5 value corresponding to each detail page;
[0019] The MD5 values corresponding to all detail pages are combined to obtain the MD5 value corresponding to the media asset identifier.
[0020] In some embodiments, the server is further configured to:
[0021] After being spliced into the details page address, the data and MD5 values of all the details pages corresponding to the media asset identifier are stored in the redis server.
[0022] In some embodiments, the server is further configured to:
[0023] When the data of one detail page of a target media asset changes, the data and encrypted values of all detail pages of the target media asset before the update are deleted, wherein the target media asset is any media asset with a detail page.
[0024] In a second aspect, the present application provides a method for obtaining a details page, the method comprising:
[0025] Receive a detail page request from a display device, wherein the detail page request is provided with a media asset identifier and a page number identifier of the detail page;
[0026] In response to the detail page request, generating a detail page address including an encrypted value, the media asset identifier and a page number identifier, wherein the encrypted value is generated by encrypting data of all detail pages corresponding to the media asset identifier;
[0027] The detail page address is fed back to the display device, so that the display device requests the detail page data corresponding to the detail page identifier from the content distribution network server, and generates the detail page corresponding to the detail page identifier according to the detail page data.
[0028] The beneficial effects of the server and the method for obtaining the details page provided by this application include:
[0029] The embodiment of the present application sets an encryption value for each media asset. The encryption value is generated by encrypting the data of all detail pages corresponding to the media asset identifier, so that when the data on the detail page changes, the encryption value will change accordingly. The detail page data is stored in the CDN server according to the detail page address containing the media asset identifier, page number identifier and encryption value. There is no need to generate CDN files, thus avoiding the problem of CDN files occupying a large amount of storage resources. If the detail page address sent by the user when accessing the CDN server contains the latest encryption value, the CDN server can return the source to the server of the display device based on the data of the detail page address that is not cached, thereby obtaining the updated detail page data of the display device server, thus avoiding the problem of returning the old detail page data stored in the CDN server to the display device, resulting in the detail page being updated untimely on the display device, thereby improving the user experience. BRIEF DESCRIPTION OF THE DRAWINGS
[0030] In order to more clearly illustrate the technical solution of the present application, the drawings required for use in the embodiments are briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without any creative work.
[0031] Figure 1 An operation scenario between a display device and a control device according to some embodiments is shown;
[0032] Figure 2 shows a hardware configuration block diagram of a control device 100 according to some embodiments;
[0033] Figure 3 shows a hardware configuration block diagram of a display device 200 according to some embodiments;
[0034] Figure 4 shows a software configuration diagram in a display device 200 according to some embodiments;
[0035] Figure 5 exemplarily shows a schematic diagram of a media resource recommendation page according to some embodiments;
[0036] Figure 6 exemplarily shows an interface diagram of a detail page according to some embodiments;
[0037] Figure 7 exemplarily shows an interface diagram of a detail page according to some embodiments;
[0038] Figure 8 exemplarily shows an interface diagram of a detail page according to some embodiments;
[0039] Fig. 9 A schematic diagram of a method for obtaining a details page according to some embodiments is exemplarily shown in FIG.
[0040] Fig.10 A schematic diagram of the system architecture of a detail page implementation solution according to some embodiments is exemplarily shown in FIG.
[0041] Fig.11 A schematic diagram of a method for obtaining a details page according to some embodiments is exemplarily shown in FIG.
[0042] Fig.12 A schematic diagram showing a flow chart of a method for calculating an MD5 value according to some embodiments;
[0043] Fig.13 A schematic diagram of a process of processing a back-to-origin request to a CDN server according to some embodiments is shown;
[0044] Fig.14 exemplarily shows a schematic diagram of updating the details page of a CDN server according to some embodiments;
[0045] Fig.15 The timing diagram of the method for obtaining the details page according to some embodiments is exemplified in FIG. DETAILED DESCRIPTION
[0046] In order to make the purpose and implementation method of the present application clearer, the exemplary implementation method of the present application will be clearly and completely described below in conjunction with the drawings in the exemplary embodiments of the present application. Obviously, the described exemplary embodiments are only part of the embodiments of the present application, rather than all the embodiments.
[0047] It should be noted that the brief description of terms in this application is only for the convenience of understanding the embodiments described below, and is not intended to limit the embodiments of this application. Unless otherwise specified, these terms should be understood according to their common and usual meanings.
[0048] The terms "first", "second", "third", etc. in the specification and claims of this application and the above drawings are used to distinguish similar or similar objects or entities, and do not necessarily mean to limit a specific order or sequence, unless otherwise noted. It should be understood that the terms used in this way can be interchangeable under appropriate circumstances.
[0049] The terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover but not exclude inclusion, for example, a product or device comprising a list of components is not necessarily limited to all the components expressly listed but may include other components not expressly listed or inherent to such product or device.
[0050] The display device provided in the embodiments of the present application may have various implementation forms, for example, it may be a television, a smart television, a laser projection device, a monitor, an electronic bulletin board, an electronic table, etc. Figure 1 and Figure 2 This is a specific implementation of the display device of the present application.
[0051] Figure 1 FIG. 1 is a schematic diagram of an operation scenario between a display device and a control device according to an embodiment. Figure 1 As shown, the user can operate the display device 200 through the smart device 300 or the control apparatus 100 .
[0052] In some embodiments, the control device 100 may be a remote controller, and the communication between the remote controller and the display device includes infrared protocol communication or Bluetooth protocol communication, and other short-range communication methods, and the display device 200 is controlled wirelessly or wired. The user may control the display device 200 by inputting user commands through buttons on the remote controller, voice input, control panel input, etc.
[0053] In some embodiments, a smart device 300 (such as a mobile terminal, a tablet computer, a computer, a laptop computer, etc.) may also be used to control the display device 200. For example, the display device 200 is controlled using an application running on the smart device.
[0054] In some embodiments, the display device may not use the above-mentioned smart device or control device to receive instructions, but may receive user control through touch or gestures.
[0055] In some embodiments, the display device 200 can also be controlled in a manner other than the control device 100 and the smart device 300. For example, the user's voice command control can be directly received through a module for obtaining voice commands configured inside the display device 200, or the user's voice command control can be received through a voice control device set outside the display device 200.
[0056] In some embodiments, the display device 200 also communicates data with the server 400. The display device 200 may be allowed to communicate via a local area network (LAN), a wireless local area network (WLAN), and other networks. The server 400 may provide various content and interactions to the display device 200. The server 400 may be one cluster or multiple clusters, and may include one or more types of servers.
[0057] Figure 2 Schematically shows a block diagram of a configuration of the control device 100 according to an exemplary embodiment. Figure 2 As shown, 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 can receive input operation instructions from the user, and convert the operation instructions into instructions that the display device 200 can recognize and respond to, playing the role of an interactive intermediary between the user and the display device 200.
[0058] like Figure 3 The display device 200 includes at least one of a tuner and demodulator 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.
[0059] In some embodiments, the controller includes a processor, a video processor, an audio processor, a graphics processor, a RAM, a ROM, and a first interface to an nth interface for input / output.
[0060] The display 260 includes a display screen component for presenting images, and a driving component for driving image display, which is used to receive image signals output from the controller, and display video content, image content, and menu control interface components and user control UI interface.
[0061] The display 260 may be a liquid crystal display, an OLED display, or a projection display, and may also be a projection device and a projection screen.
[0062] The communicator 220 is a component for communicating with an external device or server 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, and other network communication protocol chips or near field communication protocol chips, and an infrared receiver. The display device 200 can establish transmission and reception of control signals and data signals with the external control device 100 or the server 400 through the communicator 220.
[0063] The user interface can be used to receive control signals from the control device 100 (such as an infrared remote controller, etc.).
[0064] The detector 230 is used to collect signals from the external environment or the external interaction. For example, the detector 230 includes a light receiver, a sensor for collecting the intensity of ambient light; or, the detector 230 includes an image collector, such as a camera, which can be used to collect external environment scenes, user attributes or user interaction gestures; or, the detector 230 includes a sound collector, such as a microphone, etc., for receiving external sounds.
[0065] The external device interface 240 may include, but is not limited to, any one or more of the following: a high-definition multimedia interface (HDMI), an analog or digital high-definition component input interface (component), a composite video input interface (CVBS), a USB input interface (USB), an RGB port, etc. It may also be a composite input / output interface formed by the above multiple interfaces.
[0066] The tuner-demodulator 210 receives broadcast television signals via wired or wireless reception, and demodulates audio and video signals, such as EPG data signals, from a plurality of wireless or wired broadcast television signals.
[0067] In some embodiments, the controller 250 and the tuner-demodulator 210 may be located in different separate devices, that is, the tuner-demodulator 210 may also be located in an external device of the main device where the controller 250 is located, such as an external set-top box.
[0068] The controller 250 controls the operation of the display device and responds to user operations through various software control programs stored in the memory. The controller 250 controls the overall operation of the display device 200. For example, in response to receiving a user command for selecting a UI object to be displayed on the display 260, the controller 250 can perform operations related to the object selected by the user command.
[0069] In some embodiments, the controller includes a central processing unit (CPU), a video processor, an audio processor, a graphics processing unit (GPU), RAM Random Access Memory (RAM), ROM (Read-Only Memory, ROM), a first interface to an nth interface for input / output, a communication bus (Bus), etc.
[0070] The user may input a user command through a graphical user interface (GUI) displayed on the display 260, and the user input interface receives the user input command through the graphical user interface (GUI). Alternatively, the user may input a user command through a specific sound or gesture, and the user input interface recognizes the sound or gesture through a sensor to receive the user input command.
[0071] "User interface" is the medium interface for interaction and information exchange between applications or operating systems and users. It realizes the conversion between the internal form of information and the form acceptable to users. The commonly used form of user interface is the Graphical User Interface (GUI), which refers to the user interface related to computer operation displayed in a graphical way. It can be an interface element such as an icon, window, control, etc. displayed on the display screen of an electronic device, where the control can include icons, buttons, menus, tabs, text boxes, dialog boxes, status bars, navigation bars, widgets, etc.
[0072] See also Figure 4 In some embodiments, the system is divided into four layers, from top to bottom, namely, the application layer (Applications) layer (referred to as "application layer"), the application framework layer (Application Framework) layer (referred to as "framework layer"), the Android runtime (Android runtime) and system library layer (referred to as "system runtime library layer"), and the kernel layer.
[0073] In some embodiments, at least one application is running in the application layer, and these applications can be window programs, system settings programs, clock programs, etc. provided by the operating system, or applications developed by third-party developers. In specific implementations, the application packages in the application layer are not limited to the above examples.
[0074] The framework layer provides application programming interfaces (APIs) and programming frameworks for applications. The application framework layer includes some predefined functions. The application framework layer is equivalent to a processing center that determines the actions that applications in the application layer take. Through the API interface, applications can access system resources and obtain system services during execution.
[0075] like Figure 4 As shown, in the embodiment of the present application, the application framework layer includes managers, content providers, etc., wherein the manager includes at least one of the following modules: an activity manager (ActivityManager) is used to interact with all activities 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) is used to retrieve various information related to the application package currently installed on the device; a notification manager (NotificationManager) is used to control the display and clearing of notification messages; a window manager (Window Manager) is used to manage icons, windows, toolbars, wallpapers, and desktop components on the user interface.
[0076] In some embodiments, the activity manager is used to manage the life cycle of each application and the common navigation back function, such as controlling the exit, opening, and back of the application. The window manager is used to manage all window programs, such as obtaining the display screen size, determining whether there is a status bar, locking the screen, capturing the screen, and controlling the display window changes (for example, reducing the display window, shaking the display, distorting the display, etc.).
[0077] In some embodiments, the system runtime layer provides support for the upper layer, namely the framework layer. When the framework layer is used, the Android operating system will run the C / C++ library contained in the system runtime layer to implement the functions to be implemented by the framework layer.
[0078] In some embodiments, the kernel layer is a layer between hardware and software. Figure 4 As shown, the kernel layer includes at least one of the following drivers: audio driver, display driver, Bluetooth driver, camera driver, WIFI driver, USB driver, HDMI driver, sensor driver (such as fingerprint sensor, temperature sensor, pressure sensor, etc.), and power driver, etc.
[0079] In some embodiments, after the display device is started, the interface of the preset video-on-demand program can be directly entered. The interface of the video-on-demand program can be as follows: Figure 5 As shown in , it at least includes a navigation bar and a content display area located below the navigation bar, and the content displayed in the content display area changes with the change of the selected control in the navigation bar. The program in the application layer can be integrated into the video-on-demand program and displayed through a control in the navigation bar, or it can be further displayed after the application control in the navigation bar is selected.
[0080] In some embodiments, after the display device is started, it can directly enter the display interface of the signal source selected last time, or the signal source selection interface, where the signal source can be a preset video on demand program, or at least one of an HDMI interface and a live TV interface, etc. After the user selects different signal sources, the display can display the content obtained from different signal sources. The application in can.
[0081] In some embodiments, the interface of the video-on-demand program may be as follows: Figure 5 As shown in , it includes multiple media asset controls. Figure 5 The media asset controls in are as follows: "Media asset 1" control, "Media asset 2" control, "Media asset 3" control, "Media asset 4" control, "Media asset 5" control, and "Media asset 6" control.
[0082] In some embodiments, after a user clicks a media asset control, the user can enter the details page of the media asset corresponding to the media asset control. Figure 5 Click the "Media 1" control to enter Figure 6 The details page shown.
[0083] In some embodiments, a media asset may correspond to multiple detail pages, and these multiple detail pages can be used to display different information of the media asset. For example, one detail page displays some episodes of the media asset, and another detail page displays other episodes of the media asset; for another example, one detail page displays all episodes of the media asset, and another detail page displays media assets of the same type as the media asset.
[0084] It should be noted that the interface data of the details page includes content data and UI (User Interface) data, wherein UI data refers to the coordinate position and size of various controls, pictures and other graphics as well as text displayed on the details page, and content data refers to the contents of various controls, pictures and other graphics as well as text displayed on the details page.
[0085] See also Figure 6 The content data displayed on a details page of media asset 1 includes the playback window control, multiple episode controls and episode range control of media asset 1. There are 10 episode controls, corresponding to episode 1 and episode 10 respectively, and two episode range controls, corresponding to episodes 1-episode 10, and episodes 11-episode 18 respectively. Figure 6The interface shown is a detail page corresponding to episodes 1 to 10. At this time, the main film of the episode is updated to episode 8, and the superscript "Preview" is set above the episode controls corresponding to episodes 9 and 10, indicating that episodes 9 and 10 currently only have trailers and no main films. Figure 6 In the playback window, the video stream of the main film of episode 1 is played.
[0086] See also Figure 7 , another details page for media asset 1. This details page displays the playback window controls, multiple episode controls, and episode range controls of media asset 1. There are 8 episode controls, corresponding to episode 11 and episode 18 respectively, and there are two episode range controls, corresponding to episode 1-episode 10, and episode 11-episode 18 respectively. Figure 7 The interface shown is a detail page corresponding to episodes 11 to 18. At this time, a superscript "Preview" is set above the episode controls of episodes 11 to 18, indicating that episodes 11 to 18 currently only have trailers and no feature films. Figure 7 In the playback window, the video stream of episode 11 is played. Figure 7 In the video, the playback window control plays the video stream of the trailer for episode 11.
[0087] When the episode of media resource 1 is updated, the interface of the details page can be seen in Figure 8 ,like Figure 8 As shown, the details page displays the playback window control, multiple episode controls and episode range control of media asset 1, wherein the superscript "new" is set above the episode controls corresponding to episodes 9 and 10, indicating that the main films of episodes 9 and 10 are recently updated, prompting the user to watch these two episodes.
[0088] In some embodiments, the number of page views of some popular media assets may reach hundreds of millions per day. Some media assets may also include multiple media asset detail pages. For example, media asset 1 may have Figure 6 and Figure 7 These two detail pages put a lot of bandwidth pressure on the server. Especially when the media asset is updated, the number of visits to the media asset will increase rapidly, and users need to see the updated detail page interface in real time. For example, if the update time of media asset 1 is 8 pm every day, then before 8 pm on a certain day, the user will see Figure 6 The interface shown in the figure, at 8 o'clock in the evening, the user needs to see Figure 8 The interface shown in the figure places high real-time requirements on the server.
[0089] In order to reduce the pressure on the server, the server of the display device builds a file server for storing the content data of the detail page, and stores the content data of the detail page of some popular media assets in the CDN (Content Delivery Network) file in the file server. After receiving the access request of the popular media asset, it can communicate with a third-party server such as a CDN server, and transfer the received access traffic of some detail pages to the CDN server for processing. The CDN server caches the content data of the detail page through some nodes. If the content data of a media asset requested by the user, such as media asset 1, is not cached successfully, the CDN file of media asset 1 can be obtained by returning to the file server, and then the content data of the detail page of media asset 1 requested by the user can be extracted from the CDN file and returned to the display device. It can be seen that sharing the access traffic through the CDN server can reduce the pressure on the server of the display device and improve the response speed of the detail page.
[0090] However, the above method for obtaining the details page has some problems: since CDN files are large, the server of the display device still needs a lot of storage space to store the CDN files of popular media assets, and the file server only stores the CDN files of popular media assets. The processing of access requests for other media assets still puts a lot of pressure on the server of the display device. In addition, when the CDN server stores a cache of the details page in the node, the update of the cache depends on receiving the notification from the server of the display device. If the cache of the details page is not updated in time, the details page obtained by the display device will not be updated. For example, the display device should display Figure 8 The interface shown, but what is actually displayed is Figure 6 The interface shown will bring a bad user experience to users.
[0091] To solve the above technical problems, an embodiment of the present application provides a method for storing a details page and a method for obtaining a details page. By changing the storage method and the acquisition method of the details page, the response speed and update timeliness of the details page are improved.
[0092] It should be noted that, since the interface data of the details page includes UI data and content data, and the acquisition and display of UI data is a mechanism implementation not involved in this application, the storage method of the details page and the acquisition method of the details page provided in the embodiment of this application refer to the processing method of the content data of the details page. After the display device acquires the content data of the details page, the content data and UI data can be integrated into the interface data of the details page, and then the corresponding information of the interface data can be displayed. Figure 6 or Figure 7 or Figure 8 The details page shown.
[0093] In some embodiments, the CDN server is a server controlled by the display device, and the CDN server can cache the content data of the details page provided by the redis server of the display device. Exemplarily, the storage path of the content data of the details page is: xxxxx / detail / {mediaid}_{pagenum}, wherein the storage path can be a storage path based on the http protocol, that is, the storage path can also include an http prefix in front of xxxxx, which will not be mentioned below. xxxxx / detail / is the root directory of the content data of the details page, xxxxx can be hismarttv.com, {mediaid} is the media asset identifier, and pagenum is the page number identifier.
[0094] In some embodiments, after receiving a user operation to enter a detail page, the display device obtains a media asset identifier and a page number identifier corresponding to the user operation, and generates a detail page request including the media asset identifier and the page number identifier.
[0095] The user operation of entering the details page may be an operation of the user clicking a media asset control from some pages such as a media asset recommendation page, a media asset details page, etc. The media asset identifier may be obtained from the interface data of the media asset control. The page number identifier may be obtained by querying the historical viewing record corresponding to the user identifier of the media asset identifier. If there is a historical viewing record, the page number identifier is determined according to the episode where the historical viewing record is located. If there is no historical viewing record, the page number identifier is determined as page number 1. Alternatively, the page number identifier 1 may be determined as page number 1 by default.
[0096] The user operation of entering the details page may also be an operation of switching the details page by clicking a preset control on the details page of a media asset. Exemplarily, the preset control may include an episode range control. The media asset identifier and the page number identifier may be obtained from the interface data of the preset control.
[0097] In some embodiments, the method for the server of the display device to process the above-mentioned detail page request can be found in Fig. 9 , including the following steps:
[0098] Step S101: receiving a detail page request from a display device, wherein the detail page request is provided with a media asset identifier and a page number identifier of the detail page.
[0099] In some embodiments, after receiving the detail page request, the server extracts the media asset identifier and the page number identifier from the detail page request.
[0100] In some embodiments, the detail page request sent by the display device may not include a page number identifier. After receiving the detail page request, the server assumes that the display device requests content data of the first page of detail page, or determines the page number of the detail page by querying the user's viewing record of the media asset.
[0101] Step S102: in response to the detail page request, generating a detail page address including an encrypted value, the media asset identifier and a page number identifier.
[0102] In some embodiments, the encrypted value is an MD5 value. After receiving the detail page request, the server queries the MD5 value corresponding to the media asset identifier. If the content data of a detail page corresponding to the media asset identifier changes, the MD5 value will be different.
[0103] In some embodiments, the server may concatenate the details page address in the order of the storage path root directory of the content data of the details page on the CDN server, the media asset identifier, the page number identifier, and the MD5 value.
[0104] Step S103: Feedback the details page address to the display device, so that the display device requests the content distribution network server for the details page data corresponding to the details page identifier, and generates the details page corresponding to the details page identifier according to the details page data.
[0105] In some embodiments, after obtaining the details page address, the server feeds back the details page address to the display device, so that the display device requests the details page data corresponding to the details page identifier from the CDN server, and generates the details page corresponding to the details page identifier based on the details page data.
[0106] according to Fig. 9 The method shown, in order to generate a detail page on a display device, requires the display device to interact with a server on the display device side, and the server on the display device side to interact with a CDN server.
[0107] See also Fig.10 , is a schematic diagram of the system architecture of a detail page implementation solution according to some embodiments.
[0108] Fig.10 In the figure, the servers on the display device side include nginx server, API (Application Programming Interface) server, mysql server and redis server.
[0109] In some embodiments, the nginx server is used to provide load balancing services, and can transfer data sent by the display device to the API server, and forward data sent by the API server to the display device. The API server can be provided with a terminal interface and a back-to-source interface, wherein the terminal interface is used to receive data from the display device and forward data fed back to the display device to the nginx server, and the back-to-source interface is used by the CDN server to back-source the content data of the detail page in the redis server.
[0110] The MySQL server can be used to store the latest content data of each detail page, and the Redis server can be used to cache the content data and MD5 value of the detail page, where the MD5 value is generated by the API server. If the content data of a detail page corresponding to a media asset identifier in the MySQL server is updated, the MySQL server can generate an update log corresponding to the media asset identifier.
[0111] The API server can be set up with a process that monitors the MySQL log. If the process monitors the update log of the details page, it can delete the MD5 value corresponding to the media asset identifier in the redis server and the content data of the details page, and then generate a new MD5 value based on the content data of the details page corresponding to the media asset identifier in the MySQL server, and cache the new MD5 value and the new content data of the details page in the redis server. Due to network fluctuations and other reasons, the MD5 value and the content data of the details page may sometimes fail to be cached.
[0112] In some embodiments, the display device sends a detail page request to an nginx server, and the nginx server forwards the detail page request to an API server for processing.
[0113] In some embodiments, the API server receives a detail page request sent by the nginx server through a terminal interface. After receiving the detail page request, the media asset identifier and the page number identifier of the detail page are extracted from the detail page request. Then the MD5 value is queried based on the media asset identifier. If it can be queried, the jump address of the CDN server is generated, that is, the detail page address indicated in the above embodiment, and the jump address is returned to the display device through the terminal interface and the nginx server in turn. If it cannot be queried, the mysql server is accessed to obtain the content data of the detail page and an MD5 value is generated based on the content data of the detail page.
[0114] In some embodiments, after receiving the jump address of the CDN server, the display device accesses the jump address of the CDN server according to the jump address.
[0115] In some embodiments, after receiving the access request for the jump address from the display device, the CDN server can query whether it has the jump address. If it has the jump address, it will feedback the content data of the details page corresponding to the jump address to the display device. If it does not have the jump address, it will request the content data of the details page from the redis server through the API server's back-source interface.
[0116] It can be seen that the API server improves the probability of the redis server storing the latest MD5 value and detail page data through the monitoring mechanism. The data interaction with the display device is processed through the terminal interface, and the data interaction with the CDN server is processed through the back-to-source interface.
[0117] See also Fig.11 The method for the API server to generate the details page address includes the following steps:
[0118] Step S201: receiving a detail page request.
[0119] Step S202: Determine whether there is an MD5 value corresponding to the media asset identifier in the redis server.
[0120] Step S203: If it exists, generate the details page address in the CDN server.
[0121] Step S204: Return the details page address to the terminal interface.
[0122] Step S205: If it does not exist, determine whether the "mysql access" distributed lock can be obtained.
[0123] In some embodiments, each media asset identifier corresponds to a "mysql access" distributed lock. The "mysql access" distributed lock can reduce the concurrency pressure of the mysql server.
[0124] Step S206: If available, obtain all detail page data from the MySQL server.
[0125] In some embodiments, the details page data can be queried in the MySQL server through the "MySQL access" distributed lock, and all the details page data of the media asset identifier corresponding to the "MySQL access" distributed lock, that is, the content data of all the details pages, can be found.
[0126] Step S207: concatenate all detail page data and generate an MD5 value.
[0127] In some embodiments, after obtaining the content data of all detail pages, the API server may splice the content data of all detail pages into one file.
[0128] In some embodiments, after acquiring the content data of all detail pages, the API server generates an MD5 value corresponding to the media asset identifier.
[0129] See also Fig.12, if the number of detail pages corresponding to a media asset identifier is n, and n is greater than or equal to 1, the API server can use the MD5 message digest algorithm to calculate the MD5 of page 1 based on the data of page 1 of the detail page, calculate the MD5 of page 2 based on the data of page 2 of the detail page, and ..., calculate the MD5 of page n based on the data of page n of the detail page. Finally, the MD5 of page 1, page 2, ..., and page n are merged to obtain the MD5 of the detail page, that is, the MD5 value of the media asset identifier.
[0130] Step S208: Write the MD5 value and details page data into the redis server.
[0131] Step S209: Generate the details page address in the CDN server.
[0132] Step S210: Return a message indicating that the acquisition of the details page has failed to be sent to the terminal interface.
[0133] See also Fig.13 After the CDN server sends a back-to-origin request to the back-to-origin interface of the API server, the API server can respond in the following steps:
[0134] Step S301: receiving a back-to-origin request from a CDN server.
[0135] In some embodiments, the API server receives a back-to-source request sent by the CDN server through back-to-source, wherein the back-to-source request includes a media asset identifier.
[0136] Step S302: Determine whether the required details page data can be obtained in the redis server.
[0137] In some embodiments, after receiving the return-to-source request, the API server queries the redis server for the detail page data corresponding to the media asset identifier in the return-to-source request.
[0138] Step S303: If the access key cannot be obtained, obtain the "mysql access" distributed lock.
[0139] Step S304: If the "mysql access" distributed lock can be obtained, the details page data is obtained from the mysql server.
[0140] Step S305: splicing detail page data.
[0141] Step S306: Write the details page data into the redis server.
[0142] Step S307: Return the details page data to the CDN server through the back-to-source interface.
[0143] In some embodiments, the detail page data returned by the API server to the CDN server may be the detail page data of all detail pages identified by the media asset, so that the CDN server can store these detail page data one by one, so that the next time the user visits another detail page, the CDN server can quickly return the detail page data.
[0144] In some embodiments, the details page data returned by the next CDN server of the API server may be the details page data of the details page requested by the current user, so that the CDN server can quickly return the details page data to the display device to ensure the response speed of this details page request.
[0145] Step S308: If the "mysql access" distributed lock is not obtained, a response code 500 is returned to the CDN server through the back-to-source interface.
[0146] In some embodiments, if the API server fails to obtain the "mysql access" distributed lock in step S303, it returns a response code 500 to the CDN server through the back-to-source interface. After receiving the response code, the CDN server may send a message to the display device indicating that the details page failed to be obtained.
[0147] In some embodiments, after the display device receives a message indicating that the details page has failed to be obtained, it may display a message such as poor network. After the user sees the message, he or she may enter the details page again later to allow the CDN server to re-obtain the content data of the details page.
[0148] It can be seen that when the CDN server does not cache the content data of the details page corresponding to the latest MD5 value, it goes back to the source through the API server's back-to-source interface to obtain the content data of the details page instead of the CDN file. Therefore, the display device's server does not need to generate CDN files, which can avoid the display device's server generating a large number of CDN files and occupying storage resources. All media resource access can be processed by the CDN server. By taking advantage of the large number of CDN server nodes, a large number of detail page access requests can be quickly processed in a short time, with a high level of concurrency.
[0149] In addition to improving the concurrency level, the embodiment of the present application can also solve the problem of delayed update of detail page data of CDN server nodes. Fig.14, after the display device requests the data of a detail page from the API server, the data returned by the API server is a jump to a URL: xxxxx / detail / {mediaid}_{pagenum}_{md5}. After the display device receives the URL, it accesses the URL on the CDN server. If the CDN server accessed by the display device is CDN node 1, after CDN node 1 receives the access request for the URL, it immediately returns to the API server based on the fact that the URL is a new URL that has not been cached. After receiving the return request, the API server returns the detail page data, that is, the data of the URL, to CDN node 1. After receiving the detail page data, CDN node 1 returns the detail page data to the display device, so that the display device displays the detail page.
[0150] It can be seen that since the jump address of the CDN server generated by the API server contains the MD5 value, and the MD5 value is generated based on the content data of the details page, the MD5 value will inevitably change if the content data of the details page changes. Therefore, the CDN server can immediately return to the source based on its own cache that does not include the MD5 value to obtain the latest details page data, avoiding the problem of returning old details page data to the display device so that the display device displays an unupdated details page, solving the problem of CDN update delays, and improving user experience.
[0151] Since the back-to-source interface is used for back-to-source, the back-to-source request will be recorded in the nginx server. When you need to view the historical data of a certain video, filter out the historical back-to-source requests of the media asset from the nginx server and sort them by time to get the historical back-to-source records of the detail page. Since the back-to-source data is cached in the node of the CDN server, the historical data of the detail page can be viewed directly, which is convenient for locating online problems.
[0152] To further describe the method for obtaining the details page provided in the embodiment of the present application, Fig.15 A timing diagram of a method for obtaining a detail page is shown.
[0153] Fig.15 In the display device, the servers include nginx server, API server, redis server and mysql server, where these servers can be single servers or server clusters. CDN servers are usually clustered, including multiple CDN nodes. Fig.15 The CDN server in the description may refer to a CDN node, such as CDN node 1.
[0154] Exemplarily, the detail page request sent by the display device is a detail page request for the first detail page of media asset 1. For example, a user clicks a control of media asset 1 to generate the detail page request.
[0155] After the detail page request reaches the API server, the server obtains the MD5 value corresponding to the media asset identifier in the detail page request. The media asset identifier is represented by mediaID. The media asset identifier of media asset 1 can be called mediaID1. If it is obtained, a URL containing the MD5 value is generated. The format of the URL is: xxxxx / detail / {mediaid}_{pagenum}_{md5}. Among them, the URL is a URL based on the http protocol, xxxxx / detail / is the root directory used by the CDN server to store detail page data, and pagenum is the page number identifier.
[0156] For example, mediaid=1029864545, pagenum=1. The following describes two scenarios in which the data of the detail page cached in the CDN server does not need to be updated and needs to be updated. Fig.15 In the figure, the dotted steps represent some steps of the second scenario.
[0157] The first scenario is as follows:
[0158] If the data of all detail pages of media asset 1 stored in the MySQL server is not updated, the data of all detail pages of media asset 1 cached in the CDN server is the same as the data of all detail pages stored in the MySQL server and does not need to be updated.
[0159] If MD5=F6BFE5DA599732878EE039C83993F233, the URL is: xxxxx / detail / 1029864545_1_F6BFE5DA599732878EE039C83993F233.
[0160] The second scenario is as follows:
[0161] If the data of one of the detail pages of media asset 1 stored in the MySQL server is updated, when the user issues an access request, the data of the detail page cached in the CDN server of media asset 1 may not have been updated, so the detail page data in the CDN server needs to be updated.
[0162] At this time, the MD5 of the updated media asset 1 is: MD5=39C285DA59978E8396BFE73E093F233F, and the URL is: xxxxx / detail / 1029864545_1_39C285DA59978E8396BFE73E093F233F. It can be seen that the URL is inconsistent with the URL of the media asset 1 before the data on the detail page is updated.
[0163] Regardless of the scenario, after generating the URL, the API server can return the URL to the display device, and the display device accesses the URL of the CDN server.
[0164] In the first scenario, after receiving the access request for the URL, the CDN server can directly obtain the detail page data corresponding to the URL based on its own cache of detail page data corresponding to the URL, that is, the content data of the first detail page of media asset 1.
[0165] In the second scenario, after receiving the access request for the URL, the CDN server can return to the API server to obtain the detail page data corresponding to the URL because it does not cache the detail page data corresponding to the URL.
[0166] After obtaining the detail page data corresponding to the URL requested by the display device, the CDN server can return the detail page data corresponding to the URL to the display device.
[0167] After receiving the details page data, the display device can integrate the details page data with the UI data of the details page to generate and display the details page interface.
[0168] As can be seen from the above embodiments, the embodiments of the present application set an encryption value for each media asset, and the encryption value is generated by encrypting the data of all detail pages corresponding to the media asset identifier, so that when the data of the detail page changes, the encryption value will change accordingly. In the CDN server, the detail page data is stored according to the detail page address containing the media asset identifier, page number identifier and encryption value, and there is no need to generate CDN files, thereby avoiding the problem of CDN files occupying a large amount of storage resources. If the details page address sent by the user when accessing the CDN server contains the latest encryption value, the CDN server can return the source to the server of the display device based on the data of the details page address that is not cached, thereby obtaining the updated details page data of the display device server, avoiding the problem of returning the old details page data stored in the CDN server to the display device, resulting in the details page being updated untimely on the display device, thereby improving the user experience.
[0169] Since the above embodiments are all described by citing and combining with other embodiments, different embodiments have the same parts, and the same and similar parts between the embodiments in this specification can be referred to each other. No further detailed description is given here.
[0170] It should be noted that, in this specification, relational terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a circuit structure, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such circuit structure, article or device. In the absence of further restrictions, an element defined by the sentence "comprises a ..." does not exclude the existence of other identical elements in the circuit structure, article or device including the element.
[0171] Those skilled in the art will readily appreciate other embodiments of the present application after considering the specification and practicing the disclosure of the invention herein. The present application is intended to cover any modification, use or adaptation of the present invention, which follows the general principles of the present application and includes common knowledge or customary techniques in the art that are not disclosed in the present application. The specification and examples are to be considered as exemplary only, and the true scope and spirit of the present application are indicated by the content of the claims.
[0172] The above implementation modes of the present application do not constitute a limitation on the protection scope of the present application.
Claims
1. A server, characterized in that: The server is configured to: Receive a detail page request from a display device, wherein the detail page request is provided with a media asset identifier and a page number identifier of the detail page; In response to the detail page request, generating a detail page address including an encrypted value, the media asset identifier and a page number identifier, wherein the encrypted value is generated by encrypting data of all detail pages corresponding to the media asset identifier; The details page address is fed back to the display device so that the display device sends an access request for the details page address to the content distribution network server. The content distribution network server is configured to query the details page address in response to the access request. If the details page address cannot be found, the server obtains the details page data of the details page address, and feeds back the details page data to the display device, so that the display device generates a details page corresponding to the details page identifier based on the details page data.
2. The server according to claim 1, characterized in that: The encrypted value includes an MD5 value, and generating a detail page address including the encrypted value, the media asset identifier and the page number identifier includes: Extracting the media asset identifier from the detail page request; Obtain the MD5 value corresponding to the media asset identifier; The storage path root directory of the content distribution network server for storing the detail page data of all media assets, the media asset identifier, the page code identifier and the MD5 value are spliced into the detail page address of the detail page data corresponding to the detail page request on the detail page request.
3. The server according to claim 2, characterized in that: Obtaining the MD5 value corresponding to the media asset identifier includes: Obtain the MD5 value corresponding to the media asset identifier from the redis server; If the MD5 value is not obtained, obtaining a distributed lock corresponding to the media asset identifier, wherein the distributed lock corresponds to the media asset identifier in a one-to-one manner; The detail page data of all detail pages corresponding to the distributed lock are obtained from the MySQL server, and the MD5 value of the media asset identifier is generated according to the detail page data of all detail pages.
4. The server according to claim 3, characterized in that: Generate the MD5 value of the media asset identifier according to the detail page data of all detail pages, including: The data of each detail page is encrypted using the MD5 message digest algorithm to obtain the MD5 value corresponding to each detail page; The MD5 values corresponding to all detail pages are combined to obtain the MD5 value corresponding to the media asset identifier.
5. The server according to claim 2, characterized in that: The server is also configured to: After being spliced into the details page address, the data and MD5 values of all the details pages corresponding to the media asset identifier are stored in the redis server.
6. The server according to claim 1, characterized in that: The server is also configured to: When the data of one detail page of a target media asset changes, the data and encrypted values of all detail pages of the target media asset before the update are deleted, wherein the target media asset is any media asset with a detail page.
7. The server according to claim 1, characterized in that: The content distribution network server is configured to obtain the detail page data of the detail page address from the server, including: The content distribution network server sends a return-to-source request to the server, wherein the return-to-source request is provided with the media asset identifier; The server is also configured to: Receiving a back-to-origin request from the content distribution network server; In response to the return-to-source request, searching for data of all detail pages corresponding to the media asset identifier, wherein the data of all detail pages includes the detail page data of the detail page address; Feedback the data of all detail pages to the content distribution network server.
8. A method for obtaining a detail page, used in a server, characterized in that: include: Receive a detail page request from a display device, wherein the detail page request is provided with a media asset identifier and a page number identifier of the detail page; In response to the detail page request, generating a detail page address including an encrypted value, the media asset identifier and a page number identifier, wherein the encrypted value is generated by encrypting data of all detail pages corresponding to the media asset identifier; The details page address is fed back to the display device so that the display device sends an access request for the details page address to the content distribution network server. The content distribution network server is configured to query the details page address in response to the access request. If the details page address cannot be found, the server obtains the details page data of the details page address, and feeds back the details page data to the display device, so that the display device generates a details page corresponding to the details page identifier based on the details page data.
9. The method for obtaining a detail page according to claim 8, characterized in that: The encrypted value includes an MD5 value, and generating a detail page address including the encrypted value, the media asset identifier and the page number identifier includes: Extracting the media asset identifier from the detail page request; Obtaining the MD5 value corresponding to the media asset identifier; The storage path root directory of the content distribution network server for storing the detail page data of all media assets, the media asset identifier, the page code identifier and the MD5 value are spliced into the detail page address of the detail page data corresponding to the detail page request on the detail page request.
10. The method for obtaining a detail page according to claim 9, characterized in that: Obtaining the MD5 value corresponding to the media asset identifier includes: Obtain the MD5 value corresponding to the media asset identifier from the redis server; If the MD5 value is not obtained, obtaining a distributed lock corresponding to the media asset identifier, wherein the distributed lock corresponds to the media asset identifier in a one-to-one manner; The detail page data of all detail pages corresponding to the distributed lock are obtained from the MySQL server, and the MD5 value of the media asset identifier is generated according to the detail page data of all detail pages.
Citation Information
Patent Citations
Transfer method and system for electronic document
CN105955946A
Page display method and device
CN108038169A