A method for generating server and home page cache data in different versions
By designing cache service modules and processing modules in the server, generating and cache homepage cache data with different terminal version numbers, the problem of long interface response time in the existing technology is solved, and faster response and better user experience is achieved.
Patent Information
- Application Number
- CN202210405358.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-04-18
- Publication Date
- 2025-02-21
- Estimated Expiration
- 2042-04-18
AI Technical Summary
When processing homepage data requests for different terminal versions, the existing technology needs to filter the entire homepage data, resulting in an increase in interface response time and affecting the user experience.
Design a server, including a cache service module, a database and a processing module, and use the cache index to quickly respond to the terminal by monitoring the changes in the entire home page data. request.
By generating and cacheing home page cache data with different terminal version numbers in advance, the server filtering and filtering process when receiving home page data requests is reduced, significantly reducing interface response time and improving user experience.
Smart Images

Figure CN114722046B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of home page data cache generation, and in particular to a server and a method for generating versioned home page cache data. Background Art
[0002] With the continuous upgrading of smart display devices and the development of their services, in order to meet the needs of users, the server provides a variety of different types of media data and is constantly updated.
[0003] In the related art, in response to requests for home page data of different terminal versions, the server mainly generates full home page data, which includes all types of media data. When receiving a request for home page data, the server selects supported media data from the full home page data according to the terminal version, filters out media data that is not supported by the current terminal version, and then accelerates the filtered home page data using CDN (Content Delivery Network) before sending it to the terminal. However, each time a request for home page data is received, the server needs to filter the full home page data according to the terminal version, which increases the interface response time and affects the user experience. Summary of the invention
[0004] The present application provides a method for generating versioned data of a server and home page cache, which can be used to solve the technical problem of long response time after the server receives a request for home page data.
[0005] In a first aspect, the present application provides a server, including a cache service module, a database and a processing module.
[0006] The database is configured to store full homepage data, a terminal version list, and a media asset type list corresponding to each terminal version number in the terminal version list.
[0007] The processing module is configured to:
[0008] Monitor the full home page data; when the full home page data changes, obtain from the database a list of media asset types corresponding to each terminal version number in the terminal version list; filter the changed full home page data according to the media asset type list to obtain the home page cache data corresponding to the terminal version number, and store the home page cache data in the cache service module, wherein the home page cache data has a cache index, and the cache index is obtained according to the terminal version number and a preset rule.
[0009] Receive a request for home page data from a smart device terminal, respond to the request for home page data from the smart device terminal, determine a cache index corresponding to the terminal version number carried in the request based on the terminal version number carried in the request and preset rules; obtain home page cache data corresponding to the terminal version number carried in the request from the cache service module based on the cache index corresponding to the terminal version number carried in the request.
[0010] In combination with the first aspect, in one implementable manner, when the full homepage data changes, the processing module is further configured to:
[0011] Generate full guaranteed minimum data, and store the full guaranteed minimum data in the cache service module, wherein the full guaranteed minimum data is assembled based on the changed full homepage data.
[0012] In combination with the first aspect, in one implementable method, after the full home page data changes, the home page cache data is obtained and the home page cache data is stored in the cache service module, and the processing module is also configured to: record the result information corresponding to the home page cache data generated according to the terminal version number into the home page task table.
[0013] In combination with the first aspect, in one implementable manner, after the full home page data changes, the home page cache data is not obtained, and the processing module is further configured to: record the exception information and the cause of the exception to the home page task table.
[0014] In combination with the first aspect, in an implementable manner, when the home page cache data corresponding to the terminal version number carried by the request is not obtained from the cache service module according to the cache index, the processing module is also configured to: obtain a low version number of the smart device terminal, wherein the low version number is one level lower than the current version number; obtain the cache index corresponding to the low version number according to the low version number and the preset rules; and obtain the home page cache data corresponding to the terminal version number carried by the request from the cache service module according to the cache index corresponding to the low version number.
[0015] In combination with the first aspect, in an implementable manner, when the terminal version number carried by the request cannot obtain the corresponding home page cache data from the cache service module, the processing module is also configured to: obtain the full guaranteed minimum data from the cache service module; filter the full guaranteed minimum data according to the media asset type list corresponding to the terminal version number carried by the request to obtain the home page cache data corresponding to the terminal version number.
[0016] In combination with the first aspect, in an implementable manner, the processing module includes a background service module, and the background service module is configured to:
[0017] Monitor the full amount of home page data; when the full amount of home page data changes, obtain from the database a list of media resource types corresponding to each terminal version number in the terminal version list, wherein the terminal version list includes the terminal version numbers of all the home page cache data to be generated; filter the changed full amount of home page data according to the media resource type list to obtain the home page cache data corresponding to the terminal version number, and store the home page cache data in the cache service module, wherein the home page cache data has a cache index, and the cache index is obtained according to the terminal version number and a preset rule.
[0018] In combination with the first aspect, in an implementable manner, the processing module includes a data delivery service module, and the data delivery service module is configured to:
[0019] Receive a request for home page data from a smart device terminal, respond to the request for home page data from the smart device terminal, determine a cache index corresponding to the terminal version number carried in the request based on the terminal version number carried in the request and preset rules; obtain home page cache data corresponding to the terminal version number carried in the request from the cache service module based on the cache index corresponding to the terminal version number carried in the request.
[0020] As can be seen from the above technical solutions, the first aspect of the present application provides a server, including a cache service module, a database and a processing module. The database is configured to store full home page data, a terminal version list, and a media type list corresponding to each terminal version number in the terminal version list. The processing module is configured to: monitor the full home page data; when the full home page data changes, obtain the media type list corresponding to each terminal version number in the terminal version list from the database; filter the changed full home page data according to the media type list to obtain the home page cache data corresponding to the terminal version number, and store the home page cache data in the cache service module; in response to the request for home page data of the smart device terminal, determine the cache index corresponding to the terminal version number carried by the request according to the terminal version number carried by the request and the preset rules; obtain the home page cache data corresponding to the terminal version number carried by the request from the cache service module according to the cache index corresponding to the terminal version number carried by the request. The server of the present application realizes that different smart device terminals generate different home page cache data, which is convenient for sending the home page cache data corresponding to the terminal version number when receiving the home page data request of the smart device terminal, thereby reducing the interface response time.
[0021] In a second aspect, the present application provides a method for generating home page cache data in different versions, the method comprising the following steps:
[0022] Monitor the full amount of home page data;
[0023] When the full homepage data changes, a list of media resource types corresponding to each terminal version number in the terminal version list is obtained from the database;
[0024] Filter the changed full home page data according to the media asset type list to obtain home page cache data corresponding to the terminal version number, and store the home page cache data in a cache service module, wherein the home page cache data has a cache index, and the cache index is obtained according to the terminal version number and a preset rule;
[0025] Receive a request for home page data of a smart device terminal, and determine a cache index corresponding to the terminal version number carried in the request according to the terminal version number carried in the request and a preset rule;
[0026] The home page cache data corresponding to the terminal version number carried in the request is obtained from the cache service module according to the cache index corresponding to the terminal version number carried in the request.
[0027] In combination with the second aspect, in one implementable manner, when the full homepage data changes, the method further includes: generating full guaranteed data, and storing the full guaranteed data in a cache service module, wherein the full guaranteed data is assembled based on the changed full homepage data.
[0028] It can be seen from the above technical scheme that the second aspect of the present application provides a method for generating home page cache data in different versions, including monitoring the full amount of home page data; when the full amount of home page data changes, obtaining a list of media types corresponding to each terminal version number in the terminal version list from the database; filtering the changed full amount of home page data according to the media type list to obtain the home page cache data corresponding to the terminal version number, and storing the home page cache data in a cache service module, wherein the home page cache data has a cache index, which is obtained according to the terminal version number and preset rules; receiving a request for home page data from a smart device terminal, determining the cache index corresponding to the terminal version number carried by the request according to the terminal version number carried by the request and preset rules; obtaining the home page cache data corresponding to the terminal version number carried by the request from the cache service module according to the cache index corresponding to the terminal version number carried by the request. The method for generating home page cache data in different versions of the present application realizes the generation of different home page cache data according to different smart device terminals, and when a request for home page data from a smart device terminal is received, the corresponding home page cache data is sent to the smart device terminal to reduce the interface response time. BRIEF DESCRIPTION OF THE DRAWINGS
[0029] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[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 A schematic diagram of an operation scenario between a smart device terminal and a server according to an embodiment of the present application;
[0032] Figure 2 A schematic diagram of the structure of a server in an embodiment of the present application;
[0033] Figure 3 This is another structural diagram of a server in an embodiment of the present application;
[0034] Figure 4 A flowchart of database data establishment for the method for generating home page cache data in different versions in an embodiment of the present application;
[0035] Figure 5 A flowchart of home page cache data generation in a method for generating home page cache data in different versions in an embodiment of the present application;
[0036] Figure 6 This is a flowchart of generating full guaranteed data for the method for generating home page cache data in different versions in an embodiment of the present application;
[0037] Figure 7 This is a flowchart of a method for generating home page cache data in different versions in response to a home page data request from a smart device terminal in an embodiment of the present application. DETAILED DESCRIPTION
[0038] In order to make the purpose, technical solutions and advantages of the exemplary embodiments of the present application clearer, the technical solutions in the exemplary embodiments 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, not all of the embodiments.
[0039] Based on the exemplary embodiments shown in this application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application. In addition, although the disclosure in this application is introduced according to one or several exemplary examples, it should be understood that each aspect of these disclosures can also constitute a complete technical solution separately.
[0040] It should be understood that the terms "first", "second", "third", etc. in the specification and claims of this application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the terms used in this way can be interchangeable under appropriate circumstances, for example, they can be implemented according to an order other than those given in the diagrams or descriptions of the embodiments of this application.
[0041] In addition, the terms "include" and "have" 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 those components expressly listed but may include other components not expressly listed or inherent to such products or devices.
[0042] There are many different types of media data in the business system, which are sent to smart device terminals for display. With the continuous iteration of the system, new media assets are constantly added and old media assets are taken offline. However, low-version terminals do not support the newly added media data. If the newly added media data is sent to low-version smart device terminals, display anomalies may occur or even abnormal exit of the smart device terminal may occur, affecting the user experience.
[0043] The above problems can be solved when the terminal version is upgraded to the latest version. However, the upgrade of the terminal version depends on user operations and is uncertain, resulting in a situation where multiple page data coexist for a period of time.
[0044] In response to requests for home page data from different terminal versions, the server mainly generates full home page data, which includes all types of media data. When receiving a request for home page data, the server selects supported media data from the full home page data according to the terminal version, filters out media data that is not supported by the current terminal version, and then accelerates the filtered home page data using CDN (Content Delivery Network) before sending it to the smart device terminal. However, each time a request for home page data is received, the server needs to filter the full home page data according to the terminal version, which increases the interface response time and affects the user experience.
[0045] In order to reduce the interface response time when requesting home page data, such as Figure 1As shown, it is a schematic diagram of the operation scenario between the server 1 and the smart device terminal 2 in the embodiment. After receiving the home page data request from the smart device terminal 2, the home page cache data is sent out in different versions through the server 1.
[0046] In some embodiments, the smart device terminal 2 (such as a mobile terminal, tablet computer, computer, laptop computer, etc.) communicates data with the server 1 and can be connected through a local area network (LAN), a wireless local area network (WLAN) and other networks. The server 1 can be a cluster or multiple clusters and can include one or more types of servers.
[0047] The present application provides a server according to some embodiments of the present application, such as Figure 2 As shown, the server 1 includes a processing module 10 , a cache service module 13 and a database 14 .
[0048] The database 14 is configured to store a terminal version list for which homepage cache data needs to be generated, the terminal version list including terminal version numbers; and a media asset type list corresponding to each terminal version number, the type of which is less than or equal to the type of the full homepage data.
[0049] In some embodiments, the terminal version list may also include a version number interval, where the version number interval includes multiple version numbers, for example, the version number interval is V10.1-V10.6, and the version numbers involved in the same version number interval may correspond to the same home page cache data.
[0050] The server may further include an operation service module, which is configured to determine a terminal version number for which home page cache data needs to be generated; determine a corresponding media asset type list based on the terminal version number for which home page cache data needs to be generated; determine the full amount of home page data, and changes to the full amount of home page data, wherein the changes include the addition of new media assets, the offline of old media assets, etc.
[0051] The database 14 is also configured to store full homepage data, and when full homepage data changes, the corresponding full homepage data in the database is updated. The full homepage data changes are caused by the operation service module, including the addition of new media resources, the offline of old media resources, etc.
[0052] The processing module 10 is configured to monitor the full amount of home page data; when the full amount of home page data changes, it triggers the task of generating the home page cache data in different versions in the cache service module. The task includes: obtaining the full amount of home page data, the terminal version list and the corresponding media type list in the database; traversing each terminal version number in the terminal version list, and obtaining the corresponding media type list according to the terminal version number; filtering the full amount of home page data according to the media type list to obtain the home page cache data corresponding to the terminal version number, the home page cache data having a cache index, and the cache index is obtained according to the terminal version number and preset rules; storing the home page cache data in the cache service module. Receive a request for home page data from a smart device terminal, respond to the request for home page data from the smart device terminal, determine the cache index corresponding to the terminal version number carried by the request according to the terminal version number carried by the request and the preset rules; query the cache service module according to the cache index corresponding to the terminal version number carried by the request, and obtain the home page cache data corresponding to the terminal version number carried by the request.
[0053] In some embodiments, the result information of obtaining the home page cache data according to the terminal version number can also be recorded in the home page task table; if the task execution is abnormal, that is, the home page cache data corresponding to the terminal version number is not obtained, the abnormal information and the cause of the abnormality are recorded in the home page task table, and the home page task table is recorded in the database.
[0054] When the full amount of home page data changes, it also triggers the generation of full amount of guaranteed data in the cache service module, and the full amount of guaranteed data is assembled based on the full amount of home page data.
[0055] In some embodiments, the changed full homepage data is obtained from the database and assembled into full guaranteed data in a string format or JSON (JavaScript Object Notation) format, and the full guaranteed data is stored in the cache service module.
[0056] In some embodiments, the terminal version number carried in the request needs to be verified, and when the verification is passed, a cache index is constructed according to the terminal version carried in the request and preset rules. The request may include other relevant parameters besides the terminal version number.
[0057] When the home page cache data corresponding to the terminal version number carried by the request is not obtained from the cache service module according to the cache index, the processing module is configured to: obtain a low version number of the smart device terminal, where the low version number is one level lower than the current version number; obtain the cache index corresponding to the low version number according to the low version number and the preset rules; and obtain the home page cache data corresponding to the terminal version number carried by the request from the cache service module according to the cache index corresponding to the low version number.
[0058] When the minimum version number of the smart device terminal cannot obtain the corresponding home page cache data, the processing module is configured to obtain the full minimum guaranteed data; filter the full minimum guaranteed data according to the media resource type list corresponding to the terminal version number carried by the request to obtain the home page cache data corresponding to the terminal version number.
[0059] In some embodiments, when the home page cache data corresponding to the terminal version number carried by the request is not obtained from the cache service module according to the cache index, the processing module is configured to: obtain full guaranteed data; filter the full guaranteed data according to the media asset type list corresponding to the terminal version number carried by the request to obtain the home page cache data corresponding to the terminal version number.
[0060] As can be seen from the above scheme, the present application provides a server, including a cache service module, a database and a processing module. The database is configured to store full home page data, a terminal version list, and a media type list corresponding to each terminal version number in the terminal version list. The processing module is configured to: monitor the full home page data; when the full home page data changes, obtain the media type list corresponding to each terminal version number in the terminal version list from the database; filter the changed full home page data according to the media type list to obtain the home page cache data corresponding to the terminal version number, and store the home page cache data in the cache service module; in response to the request for home page data of the smart device terminal, determine the cache index corresponding to the terminal version number carried by the request according to the terminal version number carried by the request and the preset rules; obtain the home page cache data corresponding to the terminal version number carried by the request from the cache service module according to the cache index corresponding to the terminal version number carried by the request. The server of the present application realizes that different smart device terminals generate different home page cache data, which is convenient for sending the home page cache data corresponding to the terminal version number when receiving the home page data request of the smart device terminal, thereby reducing the interface response time.
[0061] The present application provides a server according to some embodiments of the present application, such as Figure 3As shown, the server 1 includes a processing module 10 , a cache service module 13 and a database 14 ; the processing module 10 includes a data sending service module 11 and a background service module 12 .
[0062] The database 14 is configured to store a terminal version list for which home page cache data needs to be generated, the terminal version list including terminal version numbers; and a media asset type list corresponding to each terminal version number, the type of which is less than or equal to the type of the full home page data.
[0063] In some embodiments, the terminal version list may also include a version number interval, where the version number interval includes multiple version numbers, for example, the version number interval is V10.1-V10.6, and the version numbers involved in the same version number interval may correspond to the same home page cache data.
[0064] The server may further include an operation service module, which is configured to determine a terminal version number for which home page cache data needs to be generated; determine a corresponding media asset type list based on the terminal version number for which home page cache data needs to be generated; determine the full amount of home page data, and changes to the full amount of home page data, wherein the changes include the addition of new media assets, the offline of old media assets, etc.
[0065] The database 14 is also configured to store full homepage data, and when full homepage data changes, the corresponding full homepage data in the database is updated. The full homepage data changes are caused by the operation service module, including the addition of new media resources, the offline of old media resources, etc.
[0066] The background service module 12 is configured to monitor the full home page data, and when the full home page data changes, it triggers the task of generating home page cache data by version in the cache service module. The task includes: obtaining the full home page data, the terminal version list and the corresponding media asset type list in the database; traversing each terminal version number in the terminal version list, and obtaining the corresponding media asset type list according to the terminal version number; filtering the full home page data according to the media asset type list to obtain the home page cache data corresponding to the terminal version number, the home page cache data has a cache index, and the cache index is obtained according to the terminal version number and preset rules; storing the home page cache data in the cache service module.
[0067] In some embodiments, the result information of obtaining the home page cache data according to the terminal version number can also be recorded in the home page task table; if the task execution is abnormal, that is, the home page cache data corresponding to the terminal version number is not obtained, the abnormal information and the cause of the abnormality are recorded in the home page task table, and the home page task table is recorded in the database.
[0068] When the full amount of home page data changes, it also triggers the generation of full amount of guaranteed data in the cache service module, and the full amount of guaranteed data is assembled based on the full amount of home page data.
[0069] In some embodiments, the changed full homepage data is obtained from the database, assembled into full guaranteed data in a string format, or a JSON format, and the full guaranteed data is stored in the cache service module.
[0070] The operation service module data sending service module 12 is configured to receive a request for home page data of a smart device terminal, and in response to the request for home page data of the smart device terminal, determine a cache index corresponding to the terminal version number carried by the request according to the terminal version number carried by the request and preset rules; query the cache service module according to the cache index corresponding to the terminal version number carried by the request to obtain the home page cache data corresponding to the terminal version number carried by the request.
[0071] In some embodiments, the terminal version number needs to be verified, and when the verification is passed, a cache index is formed according to the terminal version and preset rules. The request may include other relevant parameters besides the terminal version number.
[0072] When the home page cache data corresponding to the terminal version number carried by the request is not obtained from the cache service module according to the cache index, the data sending service module is configured to: obtain a low version number of the smart device terminal, where the low version number is one level lower than the current version number; obtain the cache index corresponding to the low version number according to the low version number and the preset rules; and obtain the home page cache data corresponding to the terminal version number carried by the request from the cache service module according to the cache index corresponding to the low version number.
[0073] When the minimum version number of the smart device terminal cannot obtain the corresponding home page cache data, the data sending service module is configured to obtain the full minimum guaranteed data; the full minimum guaranteed data is filtered according to the media resource type list corresponding to the terminal version number carried by the request to obtain the home page cache data corresponding to the terminal version number.
[0074] In some embodiments, when the home page cache data corresponding to the terminal version number carried by the request is not obtained from the cache service module according to the cache index, the data sending service module is configured to obtain the full guaranteed data from the cache service module; and filter the full guaranteed data according to the media asset type list corresponding to the terminal version number carried by the request to obtain the home page cache data corresponding to the terminal version number.
[0075] As can be seen from the above technical solutions, the present application provides a server, which includes a data delivery service module, a background service module, a cache service module and a database. The background service module is configured to: monitor the full home page data; when the full home page data changes, obtain the media type list corresponding to each terminal version number in the terminal version list from the database; filter the changed full home page data according to the media type list, obtain the home page cache data corresponding to the terminal version number, and store the home page cache data in the cache service module. The data delivery service module is configured to receive a request for home page data from a smart device terminal, respond to the request for home page data from the smart device terminal, determine the cache index corresponding to the terminal version number carried by the request according to the terminal version number carried by the request and a preset rule; obtain the home page cache data corresponding to the terminal version number carried by the request from the cache service module according to the cache index corresponding to the terminal version number carried by the request. The present application realizes the generation of different home page cache data according to different smart device terminals, and when receiving a home page data request from a smart device terminal, the corresponding home page cache data is delivered to the smart device terminal, thereby reducing the interface response time.
[0076] Some embodiments of the present application provide a method for generating versions of home page cache data.
[0077] like Figure 4 As shown, the operation service module confirms the full home page data, the terminal version list, and the media resource type list corresponding to each terminal version number in the terminal version list according to the operation of the operator, and stores them in the database. The method for generating home page cache data by version includes the following steps:
[0078] S110, determining the terminal version number for which home page cache data needs to be generated.
[0079] The terminal version number is the terminal version number for which home page cache data needs to be generated; it may also be a terminal version range, that is, multiple version numbers may support the same media asset type.
[0080] S111. Store the terminal version number in the terminal version list of the database.
[0081] By saving the version numbers of all terminals that need to generate home page cache data, a terminal version list is obtained.
[0082] In some embodiments, the terminal version number to be saved may be verified by the background service module, and the terminal version number is stored in the terminal version list after the verification passes.
[0083] S112: Determine a list of media asset types corresponding to the terminal version number.
[0084] Determine a media asset type list corresponding to each terminal version number in the terminal version list, wherein the types of the media asset type list are less than or equal to the types of the full homepage data. The media asset type list may be stored in the form of a media asset type code.
[0085] S113: Store the media asset type list in a database.
[0086] The media asset type list is based on the corresponding terminal version numbers of the terminal version list.
[0087] S114. Edit the entire home page data.
[0088] With the development of business systems, there are different types of media data. The full homepage data includes all types of media data. Therefore, with the development of the system, new media will be added and old media will be offline, causing the full homepage data to change. This application implements fast feedback on homepage data requests based on the homepage cache data corresponding to different terminal version numbers after the full homepage data is changed.
[0089] S115. Store all home page data in the database.
[0090] Every time the full homepage data changes, the changed full homepage data will be stored in the database.
[0091] like Figure 5 As shown, the background service module in the server monitors the changes of the full home page data in real time, generates home page cache data corresponding to different terminal version numbers according to the changes of the full home page data, and stores them in the cache service module, so as to respond to the request of the home page data of the smart device terminal. The method for generating home page cache data by version also includes the following steps:
[0092] S120. Monitor changes in all home page data.
[0093] When the full home page data changes, the changed full home page data is obtained in the database through step S121.
[0094] S122. Query the terminal version list.
[0095] Get the terminal version list in the database, traverse the queried terminal version list, and perform the following operations on each terminal version number:
[0096] S123: Query a list of media asset types corresponding to the terminal version number.
[0097] S124, filtering the full amount of home page data according to the media resource type list. S125, obtaining the home page cache data corresponding to the terminal version number.
[0098] Filter the full amount of home page data, filter out the media assets whose media asset types are not in the media asset type list, and generate home page cache data consisting of media assets of the types supported by the terminal. The home page cache data has a cache index, and the cache index key is generated according to the corresponding terminal version number and preset rules. S126. Store the home page cache data in the cache service module through the cache index. The home page cache data corresponding to each terminal version number can be queried through the cache index.
[0099] S127, record the result information to the home page task table of the database.
[0100] After receiving the home page cache data, the cache service module will generate result information, that is, generate the corresponding home page cache data according to the terminal version number, and record the result information in the home page task table in the database. When the background service module cannot obtain the home page cache data corresponding to the terminal version number, or when the cache service module does not receive the home page cache data and other abnormal situations, it will generate exception information, and record the exception information and the cause of the exception in the home page task table in the database.
[0101] like Figure 6 As shown, when the full home page data changes, the method for generating home page cache data in different versions also includes the following steps:
[0102] S128. Generate full guaranteed data.
[0103] The changed full homepage data is obtained from the database, and the full guaranteed data is assembled based on the changed full homepage data. S129: The full guaranteed data is stored in the cache service module.
[0104] By generating full guaranteed data, when responding to a smart device terminal's home page data request and failing to obtain home page cache data from the cache service module, the home page cache data of the corresponding smart device terminal can be obtained through the full guaranteed data, thereby improving overall stability and reliability.
[0105] like Figure 7 As shown, after the data delivery service module receives a request for home page data from a smart device terminal, the method for generating home page cache data in different versions includes the following steps: S131, determining a cache index corresponding to the terminal version number according to the terminal version number carried in the request and a preset rule.
[0106] The cache index determined by the data delivery service module is the same as the cache index determined by the background service module. The same cache index is determined in the same way, which facilitates obtaining the homepage cache data corresponding to the terminal version number carried in the request from the cache service module.
[0107] S132: Query the cache service module according to the cache index.
[0108] When the corresponding home page cache data is found, the home page cache data is sent to the smart device terminal. When the corresponding home page cache data is not found according to the cache index, the query is cyclically performed through the following steps:
[0109] S133. Obtain a lower version number that is one level lower than the current version number.
[0110] Each time through the loop, a lower version number than the current version number is determined for subsequent query operations until the corresponding homepage cache data is found for output to the smart device terminal. In the first loop, the terminal version number carried in the request is used as the current version number.
[0111] S134. Determine a cache index corresponding to the low version number according to the low version number and a preset rule.
[0112] S135. Query the cache service module according to the cache index.
[0113] If the above loop still fails to find the home page cache data, obtain the home page cache data through the following steps:
[0114] S136, obtaining the full amount of guaranteed data. Obtain the full amount of guaranteed data from the cache service module.
[0115] S137. Filter the full guaranteed data according to the media asset type list and assemble the home page cache data.
[0116] The full guaranteed data is filtered according to the media resource type list corresponding to the terminal version number carried in the request, and the home page cache data is assembled.
[0117] It can be seen from the above technical scheme that the present application provides a method for generating home page cache data in different versions, including monitoring the full amount of home page data; when the full amount of home page data changes, obtaining a list of media types corresponding to each terminal version number in the terminal version list from the database; filtering the changed full amount of home page data according to the media type list to obtain the home page cache data corresponding to the terminal version number, and storing the home page cache data in the cache service module, wherein the home page cache data has a cache index, and the cache index is obtained according to the terminal version number and preset rules; receiving a request for home page data from a smart device terminal, determining the cache index corresponding to the terminal version number carried by the request according to the terminal version number carried by the request and the preset rules; obtaining the home page cache data corresponding to the terminal version number carried by the request from the cache service module according to the cache index corresponding to the terminal version number carried by the request. The method for generating home page cache data in different versions of the present application realizes the generation of different home page cache data according to different smart device terminals. When receiving a request for home page data from a smart device terminal, the corresponding home page cache data is sent to the smart device terminal to reduce the interface response time. At the same time, each smart device terminal generates an independent home page cache file for easy CDN distribution.
[0118] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or replace some or all of the technical features therein with equivalents. However, these modifications or replacements do not cause the essence of the corresponding technical solutions to deviate from the scope of the technical solutions of the embodiments of the present application.
[0119] For the convenience of explanation, the above description has been made in conjunction with specific embodiments. However, the above exemplary discussion is not intended to be exhaustive or limit the embodiments to the specific forms disclosed above. Based on the above teachings, various modifications and variations can be obtained. The selection and description of the above embodiments are to better explain the principles and practical applications, so that those skilled in the art can better use the embodiments and various different variations of the embodiments suitable for specific use considerations.
Claims
1. A server, characterized in that: include: A cache service module, configured to store full guaranteed data when full home page data changes, wherein the full guaranteed data includes home page cache data corresponding to terminal version numbers of different levels; A database is configured to store the full homepage data, a terminal version list, and a media asset type list corresponding to each terminal version number in the terminal version list; A processing module, wherein the processing module is configured to: Monitor the full amount of home page data; When the full homepage data changes, a media resource type list corresponding to each terminal version number in the terminal version list is obtained from the database; Filter the changed full home page data according to the media asset type list to obtain home page cache data corresponding to the terminal version number, and store the home page cache data in the cache service module; wherein the home page cache data has a cache index, and the cache index is obtained according to the terminal version number and a preset rule, and different levels of terminal version numbers correspond to different cache indexes; Receiving a request for home page data from a smart device terminal, and in response to the request for home page data from the smart device terminal, determining a first cache index corresponding to the first version number carried in the request according to a first version number carried in the request and a preset rule; Querying the home page cache data corresponding to the first version number from the cache service module according to the first cache index; When the first cache index finds the home page cache data corresponding to the first version number from the cache service module, the home page cache data corresponding to the first version number is sent to the smart device terminal; When the first cache index fails to find the homepage cache data corresponding to the first version number from the cache service module, obtaining a second version number of the smart device terminal, the second version number being one level lower than the first version number; Obtaining a second cache index corresponding to the second version number according to the second lowest version number and the preset rule; Obtaining home page cache data corresponding to the second version number from the cache service module according to the second cache index; When the second cache index finds the home page cache data corresponding to the second version number from the cache service module, the home page cache data corresponding to the second version number is sent to the smart device terminal; When the second cache index fails to find the home page cache data corresponding to the terminal version number carried in the request from the cache service module, it continues to obtain the third version number of the smart terminal device until the corresponding home page cache data is obtained; the third version number is one level lower than the second version number.
2. The server according to claim 1, characterized in that: When the full homepage data changes, the processing module is further configured to: Generate full guaranteed minimum data, and store the full guaranteed minimum data in the cache service module, wherein the full guaranteed minimum data is assembled based on the changed full homepage data.
3. The server according to claim 1, characterized in that: After the full home page data changes, the home page cache data is obtained and stored in the cache service module. The processing module is further configured to: Record the result information of generating the corresponding home page cache data according to the terminal version number into the home page task table in the database.
4. The server according to claim 1, characterized in that: After the full home page data is changed, the home page cache data is not obtained, and the processing module is further configured to: The abnormal information and the cause of the abnormality are recorded in the home page task table of the database.
5. The server according to claim 2, characterized in that: When the first version number carried in the request cannot obtain corresponding homepage cache data from the cache service module, the processing module is configured to: Obtain the full guaranteed data from the cache service module; The full guaranteed data is filtered according to the media asset type list corresponding to the first version number carried in the request to obtain the homepage cache data corresponding to the terminal version number.
6. The server according to any one of claims 1 to 5, characterized in that: The processing module includes a background service module, and the background service module is configured to: Monitor the full amount of home page data; When the full homepage data changes, a media resource type list corresponding to each terminal version number in the terminal version list is obtained from the database, wherein the terminal version list includes terminal version numbers of all the homepage cache data to be generated; The changed full home page data is filtered according to the media asset type list to obtain the home page cache data corresponding to the terminal version number, and the home page cache data is stored in the cache service module, wherein the home page cache data has a cache index, and the cache index is obtained according to the terminal version number and preset rules.
7. The server according to any one of claims 1 to 5, characterized in that: The processing module includes a data delivery service module, and the data delivery service module is configured as follows: Receiving a request for home page data from a smart device terminal, and in response to the request for home page data from the smart device terminal, determining a cache index corresponding to a terminal version number carried in the request according to a first version number carried in the request and a preset rule; The home page cache data corresponding to the terminal version number carried in the request is obtained from the cache service module according to the cache index corresponding to the first version number carried in the request.
8. A method for generating home page cache data in different versions, characterized in that: include: Monitor the full amount of home page data; When the full homepage data changes, a list of media asset types corresponding to each terminal version number in the terminal version list is obtained from the database, and the full guaranteed data is stored in the cache service module, wherein the full guaranteed data includes homepage cache data corresponding to terminal version numbers of different levels; Filter the changed full homepage data according to the media asset type list to obtain homepage cache data corresponding to the terminal version number, and store the homepage cache data in a cache service module, wherein the homepage cache data has a cache index, which is obtained according to the terminal version number and a preset rule, and different levels of terminal version numbers correspond to different cache indexes; Receive a request for home page data from a smart device terminal, and determine a first cache index corresponding to the first version number carried in the request according to a first version number carried in the request and a preset rule; Obtaining home page cache data corresponding to the first version number from the cache service module according to the first cache index corresponding to the first version number; When the first cache index finds the home page cache data corresponding to the first version number from the cache service module, the home page cache data corresponding to the first version number is sent to the smart device terminal; When the cache index fails to obtain the homepage cache data corresponding to the first version number from the cache service module, obtaining the second version number of the smart device terminal, the second version number being one level lower than the first version number; Obtaining a second cache index corresponding to the second version number according to the second lowest version number and the preset rule; Obtaining home page cache data corresponding to the second version number from the cache service module according to the second cache index; When the second cache index finds the home page cache data corresponding to the second version number from the cache service module, the home page cache data corresponding to the second version number is sent to the smart device terminal; When the second cache index fails to find the home page cache data corresponding to the terminal version number carried in the request from the cache service module, it continues to obtain the third version number of the smart terminal device until the home page cache data corresponding to the lower version number is obtained; the third version number is one level lower than the second version number, and the level of the lower version number is lower than the level of the first version number.
9. The method for generating home page cache data in different versions according to claim 8, characterized in that: When the full homepage data changes, the method further includes: Generate full guaranteed data and store the full guaranteed data in a cache service module.
Citation Information
Patent Citations
Cache updating method, server and system and storage medium
CN111563102A
Server and method for loading home page data based on Redis
CN113448649A