Content pushing method, apparatus and electronic device
By using a tiered caching mechanism and user attribute matching, the problems of resource waste and high query pressure in existing technologies are solved, achieving real-time and accurate content push and reducing database load.
Patent Information
- Application Number
- CN202210104596.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-01-28
- Publication Date
- 2026-02-24
- Estimated Expiration
- 2042-01-28
AI Technical Summary
Existing content push technologies suffer from resource waste during off-peak periods and difficulty in ensuring real-time performance and database query pressure during peak periods, as well as low cache hit rates or high refresh frequencies.
A tiered caching mechanism is adopted, which reduces the query pressure on the database by using tiered caching to retrieve content separately during queries, and achieves precise push by matching the target user's attributes with the article distribution criteria.
During peak business periods, it effectively reduced the query pressure on the database, improved the real-time performance and accuracy of push notifications, reduced resource allocation requirements, and achieved coverage of a wide user base with relatively low resource investment.
Smart Images

Figure CN116561469B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of data push technology, specifically to content push methods, devices, and electronic devices. Background Technology
[0002] In the process of digital customer operations, it is necessary to push content to different user groups. How to accurately and quickly deliver targeted content, creating a personalized experience for each individual? Based on this, to cope with the massive influx of traffic during peak business periods, content push services typically employ the following three solutions:
[0003] (1) Prepare IT system resources according to the peak access volume limit of the business;
[0004] (2) Dynamically scale up and down resources based on changes in business access volume or the load pressure on system CPU and memory;
[0005] (3) Introduce caching services to reduce the query pressure on the database.
[0006] However, Option 1 suffers from low resource utilization, resulting in idle and wasted resources during off-peak periods. Option 2 faces challenges in ensuring real-time dynamic scaling, as the time from triggering scaling to resource readiness is unpredictable. Even if resource readiness can be guaranteed very quickly, it typically scales stateless web servers, making real-time scaling of backend storage systems like databases difficult. Option 3, with its typical caching service, suffers from low cache hit rates and limited speedup if the matching conditions are complex and the cache primary key is overly precise. Conversely, simpler matching conditions generally lead to excessively high cache refresh and eviction frequencies, resulting in higher pressure on the origin database. Summary of the Invention
[0007] In view of this, embodiments of the present invention provide a content push method, apparatus, and electronic device to solve the content push problem.
[0008] According to a first aspect, embodiments of the present invention provide a content push method, including:
[0009] Obtain the target user's query object, which includes sub-product identifiers, column identifiers, region identifiers, and pagination information under the target product;
[0010] The query is performed in the article cache based on the query object;
[0011] When the identifier of the target article is found, the target article is extracted from the article content cache based on the identifier and pushed to the target user.
[0012] The content push method provided in this embodiment of the invention sets up a hierarchical caching mechanism. During a query, the corresponding content is searched through the hierarchical cache to continue the query in the next level cache. That is, after the content is retrieved from the database, it is loaded into the cache. Subsequent query requests directly obtain the results from the cache without querying the database again for complex logical calculations. This effectively reduces the query pressure on the database during peak business periods, thereby reducing the configuration requirements of database resources.
[0013] In conjunction with the first aspect, in the first embodiment of the first aspect, the step of retrieving the target article's identifier from the article content cache based on the target article's identifier and pushing it to the target user when the identifier of the target article is found includes:
[0014] Obtain the attributes of the target user;
[0015] Based on the distribution restrictions of the target article and the attributes of the target user, the target article is filtered to determine the article content to be pushed to the target user;
[0016] The identified article content will be pushed to the target users.
[0017] The content push method provided in this embodiment of the invention matches the attributes of the target user with the distribution constraints of the article to achieve precise push.
[0018] In conjunction with the first embodiment of the first aspect, in the second embodiment of the first aspect, the attributes of the target user include at least one of the target user's level, points, or growth value; the distribution restriction conditions include at least one of the level restriction, points restriction, or growth value restriction corresponding to the target article; and the step of matching the distribution restriction conditions of the target article with the attributes of the target user to filter the target article and determine the article content to be pushed to the target user includes:
[0019] Match the attributes of the target users with the distribution constraints of each target article;
[0020] The target articles are filtered based on the matching results to determine the article content to be pushed to the target user.
[0021] In conjunction with the first aspect, in the third embodiment of the first aspect, the step of retrieving the target article from the article content cache based on the target article's identifier when it is found, and then pushing it to the target user, further includes:
[0022] Based on the sub-product identifier under the target product, the column identifier, and the region identifier, the number of articles cached is determined and pushed to the target user.
[0023] The content push method provided in this embodiment of the invention uses an article quantity cache to store the target number of articles. Since articles are usually displayed in pages, and only a portion of them are displayed each time, the target number of articles is pushed to the target user so that the target user can know in a timely manner.
[0024] In conjunction with the first aspect, in the fourth embodiment of the first aspect, the method further includes:
[0025] If the identifier of the target article is not found, the target article is determined by querying the target database based on the query object.
[0026] Update the article cache, the article content cache, and the article count cache based on the target article;
[0027] Set the cache expiration time of the target article in the article content cache to a preset value;
[0028] Add the keywords of the target article in the article content cache to the product cache.
[0029] The content push method provided in this embodiment of the invention sets a cache validity period for articles in the article cache. Because it achieves a more precise column article cache data eviction mechanism, users can receive updated content in a relatively real-time manner when events such as new articles being launched, taken offline, or expired are triggered.
[0030] In conjunction with the fourth embodiment of the first aspect, in the fifth embodiment of the first aspect, the method further includes:
[0031] Check whether the online validity period of each article in the article content cache has exceeded the corresponding cache validity period;
[0032] When an article's online validity period exceeds the corresponding cache validity period, the content corresponding to that article is deleted from the cache. The cache includes the article cache, the article content cache, the article quantity cache, and the product cache.
[0033] The content push method provided in this embodiment of the invention deletes the corresponding articles when the online validity period reaches the cache validity period, thereby solving the cache consumption problem.
[0034] In conjunction with the first aspect, or any one of the first to fifth embodiments, in the sixth embodiment, the method further includes:
[0035] Obtain the attribute content of the article to be refreshed, including the target category, product identifier, sub-product identifier, and region identifier;
[0036] Based on the target category to which the article to be refreshed belongs, query the category path corresponding to the target category;
[0037] Based on the product identifier of the article to be refreshed, the corresponding cache item is retrieved from the product cache;
[0038] The cached items are parsed to determine the sub-product identifier, column identifier, and region identifier corresponding to each item in the cached items;
[0039] Match each corresponding sub-product identifier, column identifier, and region identifier with the sub-product identifier, region identifier, and column path of the article to be refreshed;
[0040] Based on the matching results, the corresponding content in the cache is deleted to refresh the cache, which includes the article cache, the article content cache, the article quantity cache, and the product cache.
[0041] The content push method provided in this embodiment of the invention can achieve accurate refresh and reduce the refresh rate when there is a need for refresh, such as when an article is taken offline or expires. This is achieved by matching the cached item to which the article to be refreshed belongs with the information of the article itself.
[0042] According to a second aspect, embodiments of the present invention also provide a content push device, comprising:
[0043] The acquisition module is used to acquire the query object of the target user. The query object includes the sub-product identifier, column identifier, region identifier and pagination information under the target product.
[0044] The query module is used to perform queries in the article cache based on the query object;
[0045] The push module is used to extract the target article from the article content cache based on the target article's identifier when the target article is found, and then push it to the target user.
[0046] According to a third aspect, embodiments of the present invention provide an electronic device, including: a memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the computer instructions to perform the content push method described in the first aspect or any embodiment of the first aspect.
[0047] According to a fourth aspect, embodiments of the present invention provide a computer-readable storage medium storing computer instructions for causing the computer to execute the content push method described in the first aspect or any embodiment of the first aspect.
[0048] It should be noted that the beneficial effects of the content push device, electronic device and computer-readable storage medium provided in the embodiments of the present invention can be found in the description of the corresponding beneficial effects of the content push method above, and will not be repeated here. Attached Figure Description
[0049] To more clearly illustrate the specific embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the specific embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0050] Figure 1 This is a flowchart of a content push method according to an embodiment of the present invention;
[0051] Figure 2 This is a flowchart of a content push method according to an embodiment of the present invention;
[0052] Figure 3 This is a flowchart of a content push method according to an embodiment of the present invention;
[0053] Figure 4 This is a schematic diagram of the cache structure according to an embodiment of the present invention;
[0054] Figure 5 This is a structural block diagram of a memory push device according to an embodiment of the present invention;
[0055] Figure 6 This is a schematic diagram of the hardware structure of the electronic device provided in an embodiment of the present invention. Detailed Implementation
[0056] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0057] The electronic device described in this embodiment of the invention can be a server, a computer, etc., and is not limited thereto. When a user opens and uses the product on the terminal, a content push service is triggered. The content push service matches the user's source IP address and user profile attributes with the article distribution rules, and returns the matched articles to the terminal to be presented to the user.
[0058] For ease of description below, the terms used in the embodiments of the present invention are explained as follows:
[0059] User: The main recipient of pushed articles. Related attributes that affect a user's receipt of pushed content include: the product they use, the version of the product, the user's region, the user's level, points, tags, etc.
[0060] Sections: The organizational structure of the articles is designed similarly to a multi-level folder, with articles placed under each section.
[0061] Articles: Content pushed to users, in various forms such as images, sub-text, and videos; including courseware tutorials, case studies, policies and regulations, surveys, and event notices.
[0062] Specifically, the relationships between them are shown in the table below:
[0063]
[0064]
[0065] As mentioned above, the user triggers the query service when opening and using the product, which in turn triggers the electronic device to push the query results to the user. Articles are stored in the electronic device using a multi-level caching system. For example, the first-level cache stores the article's identifier, the second-level cache stores the article's content, the third-level cache stores the total number of articles, and so on. When pushing content, the electronic device uses the user's query object to query the cache level by level and pushes the query results to the user.
[0066] According to an embodiment of the present invention, a content push method embodiment is provided. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Furthermore, although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than that shown here.
[0067] This embodiment provides a content push method that can be used on electronic devices, such as servers and computers. Figure 1 This is a flowchart of a content push method according to an embodiment of the present invention, such as... Figure 1 As shown, the process includes the following steps:
[0068] S11, obtain the query object of the target user.
[0069] The query objects include sub-product identifiers, column identifiers, region identifiers, and pagination information under the target product.
[0070] As mentioned above, a product PID includes at least one sub-product spid, a category can contain at least one article, pagination information includes the page count and page index, and the region is the user's selected location. When using the product, the system can directly read the user's query, or provide an interactive interface for the user to input the corresponding query, etc. There are no restrictions on the specific method by which the electronic device obtains the target user's query; it can be set according to actual needs.
[0071] S12, perform a query in the article cache based on the query object.
[0072] As mentioned above, electronic devices employ multi-level caching, including but not limited to article caching and article content caching. Electronic devices use query objects to perform matching queries within the article cache to determine the identifier of the target article.
[0073] Specifically, articles are stored in the cache using key-value pairs. Each key corresponds to a value, where the key is the query condition for that article cache, and the value is the query result corresponding to the key. Electronic devices use the query object to search the article cache. When a result is found, the identifier of the target article is obtained; when no result is found, other operations can be performed. These other operations could be prompting the user that no matching recommended content was found, or querying the backend storage, which in this case is a database, etc.
[0074] It should be noted that the number of target articles retrieved can be one, two, or more; there is no specific limit to the exact number. The identifiers of the retrieved target articles can be represented as an array of identifiers, a queue of identifiers, etc. Each element in the identifier array or identifier queue is an identifier of the target article.
[0075] S13, when the identifier of the target article is found, the target article is extracted from the article content cache based on the identifier of the target article and pushed to the target user.
[0076] When an electronic device detects the identifier of a target article, it uses that identifier to search its article content cache and retrieve the target article. The device can either directly push the target article to the target user or filter it before sending it. For example, it can use the target user's points or growth value to recommend content tailored to their individual circumstances. Recommending complex articles to a newcomer will not be effective. Therefore, filtering the retrieved articles based on the user's specific needs allows for more precise content delivery.
[0077] The specifics of this step will be described in detail below.
[0078] The content push method provided in this embodiment uses a hierarchical caching mechanism to search for corresponding content in the next level of cache during a query. That is, after the content is retrieved from the database, it is loaded into the cache, and subsequent query requests can directly obtain the results from the cache without querying the database again for complex logical calculations. This effectively reduces the query pressure on the database during peak business periods, thereby reducing the configuration requirements of database resources.
[0079] This embodiment provides a content push method that can be used on electronic devices, such as servers and computers. Figure 2 This is a flowchart of a content push method according to an embodiment of the present invention, such as... Figure 2 As shown, the process includes the following steps:
[0080] S21, Obtain the query object of the target user.
[0081] The query objects include sub-product identifiers, column identifiers, region identifiers, and pagination information under the target product.
[0082] Please see details Figure 1 S11 of the illustrated embodiment will not be described again here.
[0083] S22, perform a query in the article cache based on the query object.
[0084] Please see details Figure 1 S12 of the illustrated embodiment will not be described again here.
[0085] S23, when the identifier of the target article is found, the target article is extracted from the article content cache based on the identifier of the target article and pushed to the target user.
[0086] Specifically, S23 above includes:
[0087] S231, when the identifier of the target article is found, obtain the attributes of the target user.
[0088] The attributes of a target user include, but are not limited to, level, points, etc., which represent the characteristics of that target user. For example, electronic devices can obtain the target user's attributes from the user's login account, and so on.
[0089] S232, Based on the distribution constraints of the target article and the attributes of the target user, the target article is filtered to determine the article content to be pushed to the target user.
[0090] In the article content caching, each article has corresponding distribution restrictions. For example, article A corresponds to user level a1; article B corresponds to user level b1; and article C corresponds to user level c1.
[0091] Of course, the distribution restrictions are not limited to the one condition mentioned above; there can be two or more conditions, and so on. For example, article D corresponds to a user level of d1 and an points score between 10 and 20. Specific distribution restrictions are set according to actual needs, and no restrictions are imposed here.
[0092] In some optional embodiments of this example, the target user's attributes include at least one of the target user's level, points, or growth value, and the distribution restriction conditions include at least one of the level restriction, points restriction, or growth value restriction corresponding to the target article. Based on this, S232 above may include:
[0093] (1) Match the attributes of the target users with the distribution restrictions of each target article.
[0094] (2) Filter the target articles based on the matching results to determine the article content to be pushed to the target users.
[0095] Electronic devices match the target user's attributes with the distribution criteria of each target article, deleting unsuitable articles to filter the target content. Finally, the filtered article content is pushed to the user.
[0096] S233: Push the determined article content to the target users.
[0097] As an optional implementation of this embodiment, S23 may further include: querying the article quantity cache based on the sub-product identifier, column identifier and region identifier under the target product, determining the number of target articles, and pushing them to the target user.
[0098] The system also includes an article count cache. Electronic devices use the sub-product identifier, category identifier, and region identifier of the target product in the query object to search the article count cache and determine the number of target articles. Specifically, as mentioned above, the user-provided attribute object includes the page size (pageCount) and the page index. Although the user may only want to view the content of a specific page, to ensure comprehensive display, the counts of all articles matching the criteria are pushed to the target user, allowing them to switch between views according to their needs.
[0099] The target number of articles is stored using an article count cache. Since articles are usually displayed in pages, and only a portion of them are shown each time, the target number of articles is pushed to the target users so that they can be informed in a timely manner.
[0100] S24. If the identifier of the target article is not found, perform a query in the target database based on the query object to determine the target article.
[0101] If the target article's identifier is not found in the cache, it indicates that the article may be a newly published article or an article that has been previously taken offline, etc. The electronic device then needs to query the target database to determine the target article. Once the target article is found in the target database, its corresponding content is loaded into the cache.
[0102] S25 updates the article cache, article content cache, and article quantity cache based on the target article.
[0103] The electronic device will update the article cache, article content cache, and article quantity cache with the relevant content of the target article retrieved from the target database. For example, based on the requirements of key-value pairs in each level of cache, it will form the corresponding key-value pairs of the target article in each level of cache and update the corresponding cache.
[0104] S26, Set the cache expiration time of the target article in the article content cache to a preset value.
[0105] For target articles loaded into the cache, electronic devices set a cache expiration time in the article content cache. This cache expiration time is related to the article display order. Normally, the most recently published articles will be displayed at the top. Of course, there are also articles that are required to be displayed at the top by business needs. Thus, when a document that was originally displayed on the homepage is pushed to the second page, third page, and so on by other newly published articles after a period of time, the content on the later pages has a very low cache hit rate. To save cache consumption, a cache expiration time is designed.
[0106] The cache validity period can be set to 1 hour, 2 hours, etc. The specific preset value can be set according to actual needs, and no restrictions are imposed on it here.
[0107] S27, add the keywords of the target article in the article content cache to the product cache.
[0108] The electronic device then adds the key of the target article in the article content cache to the product cache to record the cache under each product.
[0109] The content push method provided in this embodiment matches the target user's attributes with the article's distribution criteria to achieve precise push notifications. By setting a cache expiration period for articles in the article cache, and by implementing a relatively accurate article cache data eviction mechanism, users can receive updated content in relatively real-time when events such as new articles being added, removed, or expired are triggered.
[0110] As an optional implementation of this embodiment, the method may further include:
[0111] (1) Check whether the online validity period of each article in the article content cache exceeds the corresponding cache validity period.
[0112] (2) When there are articles whose online validity period has exceeded the corresponding cache validity period, the content corresponding to the article will be deleted from the cache to refresh the cache. The cache includes article cache, article content cache, article quantity cache and product cache.
[0113] The content corresponding to an article refers to the key-value pairs associated with that article in the article cache, article content cache, article quantity cache, and product cache. The specific handling of cache refresh will be described in detail below. The timing of cache refresh includes, but is not limited to, when the online validity period exceeds the corresponding cache validity period and when the article is taken offline, etc.
[0114] When the online validity period reaches the cache validity period, the corresponding article is deleted, thereby resolving cache consumption.
[0115] This embodiment provides a content push method that can be used on electronic devices, such as servers and computers. Figure 1 as well as Figure 2 The illustrated embodiment describes the process from the perspective of a target user initiating a query, detailing the article query and push notification. This embodiment, however, describes the process from the perspective of cache refresh. Of course, article updates can occur before, after, or simultaneously with the article query and push notification; there is no specific processing order. Figure 3 This is a flowchart of a content push method according to an embodiment of the present invention, such as... Figure 3 As shown, the process includes the following steps:
[0116] S31, retrieve the attribute content of the article to be refreshed.
[0117] The attribute content includes the target category, product identifier, sub-product identifier, and region identifier.
[0118] The determination of the article to be refreshed corresponds to the refresh timing. As mentioned above, the cache can be refreshed when the article expires or becomes offline. Correspondingly, the article to be refreshed is an expired or offline article.
[0119] S32, query the category path corresponding to the target category based on the target category to which the article to be refreshed belongs.
[0120] Electronic devices use the target category of the article to be refreshed to recursively find the set of path categories from the target category to the root category, and obtain the corresponding category path, which can also be understood as category identification.
[0121] S33, based on the product identifier of the article to be refreshed, the corresponding cache item is found in the product cache.
[0122] The electronic device finds the corresponding cache item in the product cache based on the product identifier (PID) of the article to be refreshed. The cache item is a list structure.
[0123] S34, parse the cached items to determine the sub-product identifier, column identifier, and region identifier corresponding to each item in the cached items.
[0124] The electronic device iterates through the list, parsing three parameters for each item: the sub-product identifier (spid), the category identifier (category), and the region identifier (region).
[0125] S35 matches the corresponding sub-product identifier, column identifier, and region identifier of each item with the sub-product identifier, region identifier, and column path of the article to be refreshed.
[0126] The electronic device matches the parsed result in S34 with the spid, region, and category path set of the article to be refreshed. If the match is successful, the corresponding cache item is found in the cache and cleared.
[0127] S36, based on the matching result, delete the corresponding content in the cache to refresh the cache.
[0128] The caching includes article caching, article content caching, article quantity caching, and product caching.
[0129] Electronic devices use the matching results to delete corresponding content in various caches. Specifically, they delete the key-value pair corresponding to the article in the article cache, delete the article in the article content cache, update the article count in the article count cache, and delete the corresponding key-value pair in the product cache.
[0130] The content push method provided in this embodiment achieves accurate refresh and reduces the refresh rate when there is an update requirement by matching the cached item to which the article belongs with the information of the article itself.
[0131] As a specific application example of this embodiment, Figure 4 The architecture of a four-level cache is shown. Combined with... Figure 4 This will be described from two perspectives: querying and refreshing. Specifically, such as... Figure 4 As shown, the four-level cache includes product cache (Catch A), article cache (Catch B), article count cache (Catch C), and article content cache (Catch D).
[0132] The first-level cache, A, caches all article lists under the product using a list structure.
[0133] The key is encoded as: ops:{pid}_article_key_list, where {pid} is the product identifier.
[0134] The value is encoded as: ops-article-list:{spid}_{category}_{region}_{page}_{count}, where {spid} is the sub-product identifier under the product, {category} is the category identifier, {region} is the region identifier, {page} is the pagination page index, and {count} is the page size.
[0135] The second-level cache (B) caches the article identifiers contained in the sub-article list using a list structure.
[0136] The key is encoded as: ops-article-list:{spid}_{category}_{region}_{page}_{count}, where {spid} is the sub-product identifier, {category} is the category identifier, {region} is the region identifier, {page} is the pagination index, and {count} is the page size.
[0137] The value is encoded as: an array of article identifiers.
[0138] The third-level cache C caches the number of articles using a string structure.
[0139] The key encoding is: ops-article-count:{spid}_{category}_{region}, where {spid} is the sub-product identifier under the product, {category} is the category identifier, and {region} is the region identifier.
[0140] The value is encoded as: the number of articles under this category.
[0141] The fourth level of cache, D, caches the actual content of the article using a string structure.
[0142] The key is encoded as: ops-article-content:{article.id}, where {article.id} is the article identifier.
[0143] The value is encoded as: the content of the article.
[0144] like Figure 4 As shown, the methods for content delivery include:
[0145] (1) Before searching for pushed content, the user constructs a query object;
[0146] (2) After receiving the Query object, the cache service searches in Cache B based on the spid sub-product, category, region, pageIndex page number, and pageCount page size carried in the Query.
[0147] (3) If Cache B is cached, retrieve the cached article identifier article.id, find the article content in Cache D based on article.id, match and filter it in memory with the current user's attributes according to the article's distribution restriction condition scope, and finally find the article content to be pushed to the user;
[0148] (4) Then retrieve the total number of all visible content in the current section from Cache C;
[0149] (5) If Cache B is not hit in step 2, retrieve the articles under the corresponding category from the backend storage, update Cache B, Cache C, and Cache D in sequence according to the article list content, set the cache validity time of Cache D to 1 hour, and finally add the key of Cache B to Cache A.
[0150] If operators add, remove, modify, or delete an article, they need to refresh the cached data. Additionally, articles have an expiration period; if this period expires, the article needs to be automatically removed from the cache. Figure 4 Let's take an example to illustrate the cache refresh process.
[0151] (1) Based on the column to which the article belongs, recursively find the set of columns along the path from the current column to the root column;
[0152] (2) Based on the product identifier (PID) of the article operated by the operator, find the corresponding cache item in Cache A;
[0153] (3) The cached items are in a list structure. The structure of the items in the list is ops-article-list:{spid}_{category}_{region}_{page}_{count}. Traverse the list and parse the three parameters of each item: spid (sub-product identifier), category (category), and region (region).
[0154] (4) Successfully match with the article's spid, region, and category path set. If the match is successful, find the corresponding cache item in Cache B and clear it.
[0155] (5) At the same time, the above three parameters find the cached items in Cache C and clear the total cache of the article list.
[0156] The content push method provided in this embodiment effectively reduces the query pressure on the database during peak business periods, thereby lowering the configuration requirements for database resources. The real-time performance of article pushes is significantly improved. Due to a more precise article cache data eviction mechanism, users can receive updated content in relatively real-time when events such as new articles being added, removed, or expired are triggered. With lower resource investment, content push services can cover users nationwide and can be extended to overseas users.
[0157] This embodiment also provides a content push device for implementing the above embodiments and preferred embodiments; details already described will not be repeated. As used below, the term "module" can refer to a combination of software and / or hardware that performs a predetermined function. Although the device described in the following embodiments is preferably implemented in software, hardware implementation, or a combination of software and hardware, is also possible and contemplated.
[0158] This embodiment provides a content push device, such as... Figure 5 As shown, it includes:
[0159] The acquisition module 41 is used to acquire the query object of the target user. The query object includes the sub-product identifier, column identifier, region identifier and pagination information under the target product.
[0160] Query module 42 is used to perform a query in the article cache based on the query object;
[0161] The push module 43 is used to extract the target article from the article content cache based on the target article's identifier when the identifier of the target article is found, and then push it to the target user.
[0162] In this embodiment, the content push device is presented in the form of a functional unit. Here, a unit refers to an ASIC circuit, a processor and memory that execute one or more software or fixed programs, and / or other devices that can provide the above functions.
[0163] Further functional descriptions of the above modules are the same as those in the corresponding embodiments described above, and will not be repeated here.
[0164] This invention also provides an electronic device having the above-described features. Figure 5 The content push device shown.
[0165] Please see Figure 6 , Figure 6 This is a schematic diagram of the structure of an electronic device provided in an optional embodiment of the present invention, such as... Figure 6 As shown, the electronic device may include: at least one processor 51, such as a CPU (Central Processing Unit), at least one communication interface 53, memory 54, and at least one communication bus 52. The communication bus 52 is used to enable communication between these components. The communication interface 53 may include a display screen or a keyboard; optionally, the communication interface 53 may also include a standard wired interface or a wireless interface. The memory 54 may be high-speed RAM (Random Access Memory) or non-volatile memory, such as at least one disk storage device. Optionally, the memory 54 may also be at least one storage device located remotely from the aforementioned processor 51. The processor 51 may be combined with... Figure 5 The described apparatus has an application program stored in memory 54, and the processor 51 calls the program code stored in memory 54 to perform any of the above method steps.
[0166] The communication bus 52 can be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus, etc. The communication bus 52 can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 6 The bus is represented by a single thick line, but this does not mean that there is only one bus or one type of bus.
[0167] The memory 54 may include volatile memory, such as random-access memory (RAM); the memory may also include non-volatile memory, such as flash memory, hard disk drive (HDD) or solid-state drive (SSD); the memory 54 may also include a combination of the above types of memory.
[0168] The processor 51 can be a central processing unit (CPU), a network processor (NP), or a combination of CPU and NP.
[0169] The processor 51 may further include a hardware chip. This hardware chip may be an application-specific integrated circuit (ASIC), a programmable logic device (PLD), or a combination thereof. The PLD may be a complex programmable logic device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL), or any combination thereof.
[0170] Optionally, the memory 54 is also used to store program instructions. The processor 51 can invoke the program instructions to implement the content push method as shown in any embodiment of this application.
[0171] This invention also provides a non-transitory computer storage medium storing computer-executable instructions that can execute the content push method in any of the above method embodiments. The storage medium can be a magnetic disk, optical disk, read-only memory (ROM), random access memory (RAM), flash memory, hard disk drive (HDD), or solid-state drive (SSD), etc.; the storage medium may also include combinations of the above types of memory.
[0172] Although embodiments of the invention have been described in conjunction with the accompanying drawings, those skilled in the art can make various modifications and variations without departing from the spirit and scope of the invention, and such modifications and variations all fall within the scope defined by the appended claims.
Claims
1. A content push method, characterized in that, include: Obtain the target user's query object, which includes sub-product identifiers, column identifiers, region identifiers, and pagination information under the target product; The query is performed in the article cache based on the query object; When the identifier of the target article is found, the target article is extracted from the article content cache based on the identifier and pushed to the target user; Determine whether the online validity period of each article in the article content cache has exceeded the corresponding cache validity period; When an article's online validity period exceeds its corresponding cache validity period, the content corresponding to that article is deleted from the cache to refresh the cache. The cache includes article cache, article content cache, article quantity cache, and product cache.
2. The method according to claim 1, characterized in that, When the identifier of a target article is found, the target article is extracted from the article content cache based on the identifier and pushed to the target user, including: Obtain the attributes of the target user; Based on the distribution restrictions of the target article and the attributes of the target user, the target article is filtered to determine the article content to be pushed to the target user; The identified article content will be pushed to the target users.
3. The method according to claim 2, characterized in that, The target user's attributes include at least one of the target user's level, points, or growth value. The distribution restrictions include at least one of the level restrictions, points restrictions, or growth value restrictions corresponding to the target article. Matching the target article's distribution restrictions with the target user's attributes to filter the target article and determine the article content to be pushed to the target user includes: Match the attributes of the target users with the distribution constraints of each target article; The target articles are filtered based on the matching results to determine the article content to be pushed to the target user.
4. The method according to claim 1, characterized in that, The step of retrieving the identifier of a target article, extracting the target article from the article content cache based on the identifier, and pushing it to the target user, further includes: Based on the sub-product identifier under the target product, the column identifier, and the region identifier, the number of articles cached is determined and pushed to the target user.
5. The method according to claim 1, characterized in that, The method further includes: If the identifier of the target article is not found, the target article is determined by querying the target database based on the query object. Update the article cache, the article content cache, and the article count cache based on the target article; Set the cache expiration time of the target article in the article content cache to a preset value; Add the keywords of the target article in the article content cache to the product cache.
6. The method according to any one of claims 1-5, characterized in that, The method further includes: Obtain the attribute content of the article to be refreshed, including the target category, product identifier, sub-product identifier, and region identifier; Based on the target category to which the article to be refreshed belongs, query the category path corresponding to the target category; Based on the product identifier of the article to be refreshed, the corresponding cache item is retrieved from the product cache; The cached items are parsed to determine the sub-product identifier, column identifier, and region identifier corresponding to each item in the cached items; Match each corresponding sub-product identifier, column identifier, and region identifier with the sub-product identifier, region identifier, and column path of the article to be refreshed; Based on the matching results, the corresponding content in the cache is deleted to refresh the cache, which includes the article cache, the article content cache, the article quantity cache, and the product cache.
7. A content push device, characterized in that, include: The acquisition module is used to acquire the query object of the target user. The query object includes the sub-product identifier, column identifier, region identifier and pagination information under the target product. The query module is used to perform queries in the article cache based on the query object; The push module is used to retrieve the target article from the article content cache based on the target article's identifier when the identifier of the target article is found, and then push it to the target user. The content push device is also used for: Determine whether the online validity period of each article in the article content cache has exceeded the corresponding cache validity period; When an article's online validity period exceeds its corresponding cache validity period, the content corresponding to that article is deleted from the cache to refresh the cache. The cache includes article cache, article content cache, article quantity cache, and product cache.
8. An electronic device, characterized in that, include: A memory and a processor are interconnected, the memory stores computer instructions, and the processor executes the content push method according to any one of claims 1-6 by executing the computer instructions.
9. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions for causing the computer to execute the content push method according to any one of claims 1-6.
Citation Information
Patent Citations
Data inquiry method and data inquiry system
CN104516920A
Online article communication platform
CN109903177A