Information recommendation method, device and equipment

By adopting a multi-level caching mechanism in the information recommendation system, using distributed cache and server local cache to store recommendation results and configuration information respectively, the problem of high concurrency information request speed and low efficiency in the existing technology is solved, and the system performance and Improved stability.

CN113360808BActive Publication Date: 2025-02-25AGRICULTURAL BANK OF CHINA
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202110742712.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-06-30
Publication Date
2025-02-25
Estimated Expiration
2041-06-30

AI Technical Summary

Technical Problem

The existing cache design method cannot meet the speed and efficiency requirements of information requests under high concurrency situations, resulting in poor system performance and stability.

Method used

A multi-level caching mechanism is adopted, including distributed cache as the first level cache and server local cache as the second level cache, which are used to store recommended results and configuration information respectively. When a client request is received, the recommended result is first queried from the distributed cache, and if it does not exist, the configuration information is obtained from the server local cache to determine the recommended result.

Benefits of technology

Through the multi-level caching mechanism, the speed and efficiency of information query are improved, the performance and stability of the system are improved, and the information request needs in high concurrency situations can be met.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113360808B_ABST
    Figure CN113360808B_ABST
Patent Text Reader

Abstract

The embodiment of the present invention provides an information recommendation method, device and equipment, which is applied to an information recommendation system, and the method includes: receiving request information sent by a client for obtaining recommendation results, and judging whether there are pre-stored recommendation results corresponding to the request information in a first-level cache; the first-level cache is a distributed cache; if there are no recommendation results, judging whether there are configuration information in a second-level cache; the second-level cache is a server local cache, and the configuration information is a high-frequency trading common parameter; if there are configuration information in the second-level cache, obtaining the configuration information, and determining the recommendation results according to preset recommendation rules, request information and configuration information, and returning the determined recommendation results to the client for display. The above method combines the two caches, solves the defects of using each cache separately, and improves the speed and efficiency of information query, as well as the performance and stability of the system.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The embodiments of the present invention relate to the field of data processing technology, and in particular to an information recommendation method, device and equipment. Background Art

[0002] During the construction of the intelligent mobile banking project, it is necessary to develop and maintain the advertising recommendation module.

[0003] As mobile banking grows, the transaction volume of the advertising recommendation module grows rapidly. As the transaction volume increases, the number of advertising requests that the background intelligent recommendation module needs to process also increases. If the daily active users of mobile banking are 8 million, when users open the mobile banking, they will request to return 20 related advertisements such as the opening page, the home page, and the second floor when they pull down. The background intelligent recommendation module needs to support at least 480 million accurate advertising recommendations at peak times, and considering the need for complex logical recommendation processing such as label matching and model matching, in order to improve the response speed, it is necessary to use caching technology to cache the recommendation results. However, the existing caching method usually uses a distributed cache to store the corresponding data. In this implementation, a large amount of data in the database can be stored in different machines to cope with a large number of requests. Alternatively, only the local cache method is used to store the corresponding data. The local cache has high requirements for memory space, and when only the local cache is used, when the service is restarted, the cache content is lost, and all requests will access the database, causing greater pressure on the database.

[0004] Existing cache design methods cannot meet the requirements for speed and efficiency of information requests in high-concurrency situations, and the system performance and stability are poor. Summary of the invention

[0005] The embodiments of the present invention provide an information recommendation method, device and equipment to solve the problems of low speed and efficiency of information request under high concurrency and poor system performance and stability in existing cache design methods.

[0006] In a first aspect, an embodiment of the present invention provides an information recommendation method, the method being applied to an information recommendation system, the information recommendation system comprising a multi-level cache divided into levels; the method comprising:

[0007] Receive request information sent by the client for obtaining recommendation results;

[0008] Determine whether there is a pre-stored recommendation result corresponding to the request information in the first-level cache; the first-level cache is a distributed cache, and the distributed cache pre-stores the recommendation result;

[0009] If the recommendation result does not exist, determine whether there is configuration information in the second-level cache; the second-level cache is a server local cache, and the configuration information is a high-frequency trading public parameter;

[0010] If the configuration information exists in the second-level cache, the configuration information is obtained, and a recommendation result is determined according to the preset recommendation rule, the request information and the configuration information, and the determined recommendation result is returned to the client for display.

[0011] Optionally, the method further includes:

[0012] Receiving a first recommendation result sent by the client, where the first recommendation result is obtained from a local cache of the client according to the request information;

[0013] When the first recommendation result is inconsistent with the recommendation result, obtaining a corresponding advertisement image according to the URL information in the recommendation result;

[0014] Accordingly, the determined recommendation results are returned to the client for display, including:

[0015] The advertisement text in the recommendation result and the obtained advertisement image are returned to the client for display.

[0016] Optionally, obtaining a corresponding advertisement image according to the URL information in the recommendation result includes:

[0017] Determine in sequence whether there is an advertisement image corresponding to the URL information in the first-level image cache or the second-level image cache; the first-level image cache is a CDN server deployed in various places, and the second-level image cache is an nginx server;

[0018] If it exists, directly obtain the advertisement image from the first-level image cache or the second-level image cache;

[0019] If it does not exist, the advertisement image is obtained from the image management server.

[0020] Optionally, the method further includes:

[0021] If the configuration information does not exist in the second-level cache, obtaining the configuration information from the database;

[0022] The configuration information is stored in the second-level cache.

[0023] Optionally, after determining the recommendation result according to the preset recommendation rule and the configuration information, the method further includes:

[0024] The recommendation result is stored in the first level cache.

[0025] Optionally, the cache duration of the advertisement image in the first-level image cache is shorter than the cache duration of the advertisement image in the second-level image cache; the cache duration of the recommendation result in the first-level cache is shorter than the cache duration of the configuration information in the second-level cache.

[0026] In a second aspect, an embodiment of the present invention provides an information recommendation device, the device is applied to an information recommendation system, the information recommendation system includes a multi-level cache divided according to levels; the device includes:

[0027] A receiving module, used to receive request information sent by a client for obtaining recommendation results;

[0028] A determination module, used to determine whether there is a pre-stored recommendation result corresponding to the request information in the first-level cache; the first-level cache is a distributed cache, and the distributed cache pre-stores the recommendation result;

[0029] The judging module is further used to judge whether there is configuration information in the second-level cache when the recommendation result does not exist;

[0030] The determination module is used to obtain the configuration information when there is configuration information in the second-level cache, and determine the recommendation result according to the preset recommendation rules, request information and configuration information, and return the determined recommendation result to the client for display; the second-level cache is the server local cache, and the configuration information is the high-frequency trading public parameters.

[0031] In a third aspect, an embodiment of the present invention provides an electronic device, including: at least one processor and a memory;

[0032] The memory stores computer-executable instructions;

[0033] The at least one processor executes the computer-executable instructions stored in the memory, so that the at least one processor performs the method described in any one of the first aspects.

[0034] In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer-executable instructions. When a processor executes the computer-executable instructions, the method described in any one of the first aspects is implemented.

[0035] In a fifth aspect, an embodiment of the present invention provides a computer program product, including a computer program, which, when executed by a processor, implements the method as described in any one of the first aspects.

[0036] The information recommendation method, device and equipment provided by the embodiments of the present invention are applied to an information recommendation system, wherein the information recommendation system includes a multi-level cache divided into levels; the method includes: receiving request information sent by a client for obtaining recommendation results; judging whether there is a pre-stored recommendation result corresponding to the request information in the first-level cache; the first-level cache is a distributed cache, and the recommendation result is pre-stored in the distributed cache; if the recommendation result does not exist, judging whether there is configuration information in the second-level cache; if the configuration information exists in the second-level cache, obtaining the configuration information, and determining the recommendation result according to the preset recommendation rule, request information and configuration information, and returning the determined recommendation result to the client for display; the second-level cache is a server local cache, and the configuration information is a high-frequency trading public parameter. By adopting a multi-level cache mechanism to store different data, the speed and efficiency of information query are improved, and the performance and stability of the system are improved. BRIEF DESCRIPTION OF THE DRAWINGS

[0037] In order to more clearly illustrate the embodiments of the present invention 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 invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.

[0038] Figure 1 A schematic diagram of an application scenario provided by an embodiment of the present invention;

[0039] Figure 2 A flowchart of an information recommendation method provided by an embodiment of the present invention;

[0040] Figure 3 A schematic diagram of a flow chart of another information recommendation method provided by an embodiment of the present invention;

[0041] Figure 4 A schematic diagram of a method for obtaining an advertisement image provided by an embodiment of the present invention;

[0042] Figure 5 A schematic diagram of information recommendation provided by an embodiment of the present invention;

[0043] Figure 6 A schematic diagram of the structure of an information recommendation device provided by an embodiment of the present invention;

[0044] Figure 7 A schematic diagram of the hardware structure of an electronic device provided by an embodiment of the present invention. DETAILED DESCRIPTION

[0045] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0046] The terms "first", "second", "third", "fourth", etc. (if any) in the specification and claims of the present invention 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 data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can, for example, be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0047] Figure 1 A schematic diagram of an application scenario provided by an embodiment of the present invention, such as Figure 1 As shown, when the user opens the client (mobile banking), or switches from the client homepage to other modules (such as financial management module, life module), the client will send a request message, and the request message is used to obtain information recommendation results, such as product recommendation results or advertising recommendation results. The information recommendation system will obtain the recommendation results from the first-level cache according to the request information. When there are recommendation results, the recommendation results are directly returned to the client for display. When there are no recommendation results, the configuration information is obtained from the second-level cache, and the recommendation results are obtained according to the configuration information, and returned to the client.

[0048] Currently, data caching is mainly performed by simply using distributed cache or local cache. Distributed cache means that there are multiple servers, and the cached information can be stored on multiple servers. However, public parameters are stored on one server. When all services need to obtain public parameters, the server storing the public parameters will be under great pressure, that is, there is a hot key problem. Local cache means storing the cached content in the local process, which has high requirements for memory space, and when the program is upgraded, the local cached content will be lost. This will result in the database being accessed to obtain the recommended results when the mobile banking is opened for the first time, causing the database to be under great pressure.

[0049] Based on the above cache solution, the cache selection is not carried out according to the business scenario and transaction volume information, and the selection and architecture design of the cache framework are too simple, which fails to give full play to the advantages of the cache. Based on the above requirements for the speed and efficiency of information requests, the embodiment of the present invention combines the distributed cache and the server local cache, sets the distributed cache as the first-level cache, and uses it to store accurate recommendation results for different customers, sets the server local cache as the second-level cache, and uses it to store configuration information. When the client's request information is received, the recommendation result is first obtained from the first-level cache. When there is a recommendation result, the recommendation result is sent to the client. When there is no recommendation result, the configuration information is obtained from the second-level cache, and the recommendation result is obtained based on the configuration information, and the recommendation result is sent to the client. By storing different content in the distributed cache and the server local cache, and hierarchically accessing the distributed cache and the server local cache, the problems existing when using the distributed cache and the server local cache alone are effectively solved, and the requirements for the speed and efficiency of information requests in high concurrency situations can be met, and the performance and stability of the system can be improved.

[0050] The technical solution of the present invention is described in detail with specific embodiments below. The following specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described in detail in some embodiments.

[0051] Figure 2 An information recommendation method provided by an embodiment of the present invention, such as Figure 2 As shown, the method of this embodiment is applied to an electronic device, wherein the electronic device is provided with an information recommendation device, and the method is applied to an information recommendation system, wherein the information recommendation system includes a multi-level cache divided according to levels, and the method includes:

[0052] Step S201: Receive request information sent by a client for obtaining recommendation results.

[0053] When a user opens the mobile banking app, or when a user switches from one page of the mobile banking app to another, the information recommendation system needs to push advertising information or product recommendation information to the mobile banking client. When a user opens the mobile banking app, the client will send a request message to the information recommendation system. The request message includes the customer number information and the requested location information.

[0054] Step S202: determine whether there is a pre-stored recommendation result corresponding to the request information in the first-level cache; the first-level cache is a distributed cache, and the distributed cache has pre-stored recommendation results.

[0055] After receiving the request information, first determine whether there is a recommendation result in the first-level cache, where the recommendation result needs to correspond to the request location information and the customer number information. For example, if the request information is to obtain the product recommendation results of user A in each position on the mobile banking homepage, it is necessary to find the server that stores the recommendation results of user A and query from the server whether there is a recommendation result corresponding to the request location.

[0056] Among them, the first-level cache is a distributed cache, such as redis distributed cache. The content stored in the distributed cache is the recommendation results, in which different recommendation results are set for different customers, and the recommendation results are stored in different servers according to the customer number. For example, advertisements or products are matched to customers based on their preferences, age or browsing history. And the recommendation results of all customers are stored on multiple servers. For example, when the transaction request volume is 300 million and the number of servers is 10, the 300 million recommendation results can be evenly distributed on ten servers, and each node stores 30 million recommendation results.

[0057] Step S203: If the recommendation result does not exist, determine whether there is configuration information in the second-level cache, the second-level cache is the server local cache, and the configuration information is the high-frequency trading public parameters.

[0058] When the recommendation result does not exist in the first-level cache, it is necessary to obtain the configuration information from the second-level cache, wherein the second-level cache is a local cache, such as an ehcache local cache. Local cache refers to a server local cache, that is, the configuration information is stored locally on the server. For example, when there are multiple servers, it is necessary to store the configuration information in each server. Specifically, when the recommendation result is requested for the first time, it is necessary to obtain the configuration information from the database and store the configuration information locally on each server.

[0059] When storing configuration information, the configuration information is stored as a collection object as a two-dimensional entity. The object name can be converted into a string by hashcode, thereby converting the two-dimensional entity into a one-dimensional entity and caching the collection object.

[0060] In addition, configuration information is a common parameter for high-frequency transactions. When recommending advertisements or products to customers in real time, it is necessary to make recommendations based on configuration information. For example, placement information and switch configuration information. Placement information refers to the location where advertisements or products are placed; switch configuration information is used to downgrade services under preset circumstances. Since the configuration information stores less content, it can be well supported without applying for too much memory.

[0061] Step S204: If the configuration information exists in the second-level cache, the configuration information is obtained, and a recommendation result is determined according to a preset recommendation rule, request information and configuration information, and the determined recommendation result is returned to the client for display.

[0062] When the configuration information exists in the second-level cache, the configuration information can be obtained, and the recommendation result can be obtained based on the configuration information. The present application does not limit the specific method for obtaining the recommendation result.

[0063] By using server local cache to store configuration information on multiple servers, the pressure on a single server can be reduced.

[0064] The embodiment of the present invention stores different information by setting a first-level cache and a second-level cache, stores recommendation results by a distributed cache, and stores configuration information by a server local cache. When there is a client request, it is possible to first query whether there is a recommendation result from the distributed cache, thereby solving the problem that the local cache has high memory requirements and causes great pressure on the server during the initial request. By storing configuration information by the server local cache, the customer's recommendation results can be obtained in real time, avoiding the hot key problem of the distributed cache, reducing the request pressure on the database, and by reasonably setting up multi-level caches, the speed and efficiency of information requests can be greatly improved, thereby improving the performance and stability of the system.

[0065] Figure 3 A flowchart of another information recommendation method provided by an embodiment of the present invention, the method comprising:

[0066] Step S301: Receive a first recommendation result sent by a client, where the first recommendation result is obtained from a local cache of the client according to the request information.

[0067] In this embodiment, a local cache is also provided on the client. Among them, the local cache of the client is when the user opens the mobile banking for the first time, the client receives the request information sent by the user, and will obtain the recommendation results corresponding to the customer and the position information from the information recommendation system, and can display and cache the recommendation results. After closing the client, if the homepage of the mobile banking is opened again, it can be determined whether there is a corresponding recommendation result in the client. If there is a recommendation result, the local recommendation result of the client is determined as the first recommendation result, and the first recommendation result is obtained and displayed.

[0068] Among them, the cache duration of the client's local recommendation results is permanent. When an exception occurs in the client's local cache, the first recommendation result will not be obtained, and the recommendation result needs to be obtained from the first-level cache.

[0069] Step S302: When the first recommendation result is inconsistent with the recommendation result, the corresponding advertisement image is obtained according to the URL information in the recommendation result.

[0070] After obtaining and displaying the first recommendation result, the recommendation result is also obtained from the information recommendation system, and it is necessary to determine whether the first recommendation result is consistent with the recommendation result. The recommendation result includes the URL information of the advertisement text and the advertisement image. When it is determined that the first recommendation result is consistent with the recommendation result, there is no need to obtain the advertisement image from the recommendation result again; when it is determined that the first recommendation result is inconsistent with the recommendation result, it is necessary to obtain the corresponding advertisement image from the recommendation result.

[0071] Among them, when judging whether the first recommendation result is consistent with the recommended result, it is possible to judge whether only the advertisement text is consistent, and it can be judged based on the obtained json string representing the recommended result. The json string is text data in a specified format, and the judgment is made by judging whether the json string corresponding to the first recommendation result and the json string corresponding to the recommended result are consistent.

[0072] Step S303: Return the advertisement text in the recommendation result and the acquired advertisement image to the client for display.

[0073] After the advertisement image is obtained, the advertisement text in the recommendation result and the obtained advertisement image may be returned to the client.

[0074] By setting up a local cache on the client, the client does not need to request the information recommendation system every time to obtain the image content in the recommendation results, thereby reducing a certain amount of recommendation requests.

[0075] The following is a detailed description of the process of obtaining the advertisement images in the recommendation results.

[0076] Optionally, obtaining a corresponding advertisement image according to the URL information in the recommendation result includes:

[0077] It is determined in turn whether there is an advertisement image corresponding to the URL information in the first-level image cache or the second-level image cache; the first-level image cache is a CDN server deployed in various places, and the second-level image cache is an nginx server.

[0078] Among them, the first-level image cache is CDN cache, and the implementation of CDN cache depends on CDN servers deployed in various places. For example, CDN servers can be deployed in various provinces. When a user in the province obtains an advertisement image from the database, the advertisement image will be saved on the CDN server in the province. When another user in the province needs to obtain the advertisement image, it will first determine whether the advertisement image exists on the CDN server. If so, the advertisement image will be directly returned to the client.

[0079] Different images are identified by different URL information when they are saved, and the CDN server that is closest to the user and contains the advertising image corresponding to the URL information is determined by parsing the URL information.

[0080] When the advertisement image does not exist in the first-level image cache, the second-level image cache can be accessed to determine whether the advertisement image exists. The second-level image cache is an nginx server, which is deployed at the bank end and stores different advertisement images through different storage paths.

[0081] If it exists, the advertisement image is directly obtained from the first-level image cache or the second-level image cache.

[0082] Among them, when the first-level image cache contains an image corresponding to the URL information, it indicates a hit and is displayed directly on the client; if the image corresponding to the URL information does not exist, it indicates a miss, and the advertising image is requested from the second-level image cache. If the second-level image cache contains an image corresponding to the URL, it indicates a hit and is displayed directly on the client.

[0083] If it does not exist, the advertisement image is obtained from the image management server.

[0084] When the first-level image cache and the second-level image cache do not have the image corresponding to the URL information, the advertisement image can be obtained from the image management server and stored in the CDN server and the nginx server. The image management server is the server where the database storing the images is located, such as ufile.

[0085] like Figure 4 As shown, when the mobile banking client sends a request message, the local DNS first resolves the request message and gives the final domain name resolution right to the CDN DNS. The CDN DNS determines the IP address of the CDN cache server from which the user obtains the image based on the resolved user's IP address and URL information, and the user then sends a request to the CDN server.

[0086] When the corresponding image does not exist in the CDN server, it is necessary to send the domain name resolution authority to the source site DNS through the local DNS. The source site DNS resolves the request information to obtain the URL information, and obtains the image corresponding to the URL information from the nginx server. Among them, when the corresponding image does not exist in nginx, it is necessary to obtain the corresponding image from the source site image server (that is, the image management server). The image here refers to the advertising image corresponding to the recommendation result.

[0087] Setting up a CDN server can alleviate the pressure on the export bandwidth of the information recommendation system; in addition, since the CDN server is closer to the user, it can also speed up the response speed of the client's advertising images. Setting up a secondary image cache server can alleviate the pressure on the database.

[0088] After setting up the CDN server, the access traffic to the database dropped significantly, and the peak bandwidth also dropped. Similarly, the CDN broadband peak increased, effectively alleviating the bandwidth pressure within the bank.

[0089] Furthermore, since the content obtained is a picture, it is necessary to consider the traffic consumption when obtaining the picture. Since the secondary picture cache of the CDN server and nginx server is used, the size and dimension of the picture need to be limited to reduce bandwidth consumption.

[0090] Optionally, the method further includes:

[0091] If the configuration information does not exist in the second-level cache, the configuration information is obtained from the database; and the configuration information is stored in the second-level cache.

[0092] Among them, when the configuration information does not exist in the second-level cache (server local cache), it is necessary to obtain the configuration information from the database and store the obtained configuration information in the second-level cache so that when the configuration information is requested from the second-level cache next time, there is no need to obtain the configuration information from the database.

[0093] Optionally, after determining the recommendation result according to the preset recommendation rule and the configuration information, the method further includes:

[0094] The recommendation result is stored in the first level cache.

[0095] Among them, when there is no recommendation result corresponding to the request information in the first-level cache, the configuration information can be obtained, and the recommendation result can be determined based on the configuration information, and the obtained recommendation result can be stored in the first-level cache, so that when the recommendation result is requested from the first-level cache next time, there is no need to obtain the configuration information from the second-level cache or the database, and there is no need to obtain the recommendation result based on the configuration information.

[0096] Optionally, the cache duration of the advertisement image in the first-level image cache is shorter than the cache duration of the advertisement image in the second-level image cache; the cache duration of the recommendation result in the first-level cache is shorter than the cache duration of the configuration information in the second-level cache.

[0097] Different cache durations are set for different caches, where the cache duration of images in the first-level image cache is shorter than that in the second-level image cache. For example, the cache duration of images in the CDN server is five minutes, and the cache duration of images in the nginx server is seven days. By setting the cache duration of the first-level images shorter than that of the second-level images, it is possible to obtain images from the second-level image cache when an exception occurs in the first-level image cache or the image cache fails, thereby reducing requests to the database.

[0098] Similarly, the cache duration of the recommended results in the first-level cache is shorter than the cache duration of the configuration information in the second-level cache. For example, the storage duration of the recommended results in the distributed cache is 15 minutes, and the storage duration of the configuration information in the server local cache is 20 minutes. By setting the cache duration of the recommended results in the first-level cache to be shorter than the cache duration of the configuration information in the second-level cache, it is possible to obtain the configuration information from the second-level cache when the recommended results in the first-level cache become invalid due to an exception or the storage duration reaches the preset duration, thereby reducing requests to the database.

[0099] Figure 5 A schematic diagram of information recommendation provided in an embodiment of the present invention is a process of obtaining recommendation results from a distributed cache and a server local cache. Specifically, the recommendation results include URL information of the advertisement text and the advertisement image. After obtaining the recommendation results, the advertisement text can be directly obtained, and the advertisement image needs to be obtained according to the URL information. Specifically, when the user opens the mobile banking, a request is sent to obtain the advertisement recommendation information, and it is determined whether there is a recommendation result in the redis cache. When there is a recommendation result, the redis cache result is returned. When there is no recommendation result in the redis cache, it is determined whether there is configuration information in ehcache. If there is configuration information, it is matched according to the recommendation result and the configuration information. If there is no configuration information, the database is requested to obtain the configuration information. After obtaining the configuration information, the configuration information is placed in ehcache, and matched according to the recommendation result and the configuration information, and the recommendation result is placed in redis. After obtaining the recommendation results, you also need to obtain the advertising images in the redis cache results, that is, determine whether there are advertising images in the CDN cache. If so, return the cached images. If not, determine whether there are advertising images in the nginx cache. If so, return the cached images. If not, request ufile to obtain the images. Finally, send the obtained recommendation results to the mobile bank for display.

[0100] In addition, before performing the above processing, it will first determine whether there is a recommendation result in the client's local cache. If so, it will be returned to the client first. At the same time, the recommendation result will be obtained from the information recommendation system to determine whether the two recommendation results obtained are consistent. If they are consistent, the picture in the client's local cache will be displayed in the mobile banking; if they are inconsistent or there is no recommendation result in the client's local cache, the picture will be obtained through the CDN cache and / or nginx cache.

[0101] This application is based on the requirement of huge image traffic. In order to reduce the pressure of the background request system, the pressure of the background system is reduced by setting up CDN servers and nginx servers. Although nginx image cache reduces the pressure of the background system by caching images on the local hard disk, due to the large hard disk space and high cost performance, it will not cause a significant increase in costs. By setting up a CDN server, the use of the network by the bank's information recommendation system can be reduced. In addition, due to the large number of requests or transactions, a three-level cache is set up to store the recommendation results, such as storing the recommendation results and images through the client local cache, storing the recommendation result information related to the customer through the distributed cache, and setting the key through the customer number to avoid the problem of hot key; storing configuration information through the server local cache can avoid the problem of hot key caused by the distributed cache. By setting a two-level cache for advertising images and a three-level cache for advertising texts, a set of billion-level advertising recommendation architecture is formed. The advertising recommendation architecture can support an average of 700 million advertising recommendations per day, and the average request response time is about 50 milliseconds.

[0102] Figure 6 A schematic diagram of the structure of an information recommendation device provided in an embodiment of the present invention, wherein the device is applied to an information recommendation system, wherein the information recommendation system includes a multi-level cache divided according to levels; the device includes:

[0103] The receiving module 601 is used to receive the request information sent by the client for obtaining the recommendation result;

[0104] The judgment module 602 is used to judge whether there is a recommendation result corresponding to the request information pre-stored in the first-level cache; the first-level cache is a distributed cache, and the distributed cache pre-stores the recommendation result;

[0105] The judgment module 602 is further used to judge whether there is configuration information in the second-level cache when there is no recommendation result; the second-level cache is the server local cache, and the configuration information is the high-frequency trading public parameters;

[0106] The determination module 603 is used to obtain the configuration information when there is configuration information in the second-level cache, and determine the recommendation result according to the preset recommendation rule, request information and configuration information, and return the determined recommendation result to the client for display.

[0107] Optionally, the receiving module 601 is further configured to receive a first recommendation result sent by the client, where the first recommendation result is obtained from a local cache of the client according to the request information;

[0108] The judgment module 602 is further used for: when the first recommendation result is inconsistent with the recommendation result, obtaining the corresponding advertisement picture according to the URL information in the recommendation result;

[0109] Correspondingly, the determining module 603 is specifically used to return the advertisement text in the recommendation result and the acquired advertisement image to the client for display.

[0110] Optionally, the determining module 602 is specifically configured to:

[0111] Determine in sequence whether there is an advertisement image corresponding to the URL information in the first-level image cache or the second-level image cache; the first-level image cache is a CDN server deployed in various places, and the second-level image cache is an nginx server;

[0112] If it exists, directly obtain the advertisement image from the first-level image cache or the second-level image cache;

[0113] If it does not exist, the advertisement image is obtained from the image management server.

[0114] Optionally, the determination module 603 is further used to: if the configuration information does not exist in the second-level cache, obtain the configuration information from a database; and store the configuration information in the second-level cache.

[0115] Optionally, after determining the recommendation result according to the preset recommendation rule and the configuration information, the determination module 603 is further configured to:

[0116] The recommendation result is stored in the first level cache.

[0117] Optionally, the cache duration of the advertisement image in the first-level image cache is shorter than the cache duration of the advertisement image in the second-level image cache; the cache duration of the recommendation result in the first-level cache is shorter than the cache duration of the configuration information in the second-level cache.

[0118] The information recommendation device provided by the embodiment of the present invention can achieve the above Figure 2-Figure 5 The information recommendation method of the illustrated embodiment has similar implementation principles and technical effects, which will not be described in detail here.

[0119] Figure 7 The hardware structure diagram of an electronic device provided by an embodiment of the present invention is shown in FIG. Figure 7 As shown, the electronic device 70 provided in this embodiment includes: at least one processor 701 and a memory 702. The processor 701 and the memory 702 are connected via a bus 703.

[0120] In a specific implementation process, at least one processor 701 executes the computer-executable instructions stored in the memory 702, so that at least one processor 701 executes the information recommendation method in the above method embodiment.

[0121] The specific implementation process of the processor 701 can be found in the above method embodiment, and its implementation principle and technical effect are similar, so this embodiment will not be repeated here.

[0122] In the above Figure 7 In the illustrated embodiment, it should be understood that the processor may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), etc. A general-purpose processor may be a microprocessor or any conventional processor. The steps of the method disclosed in the invention may be directly implemented as being executed by a hardware processor, or may be executed by a combination of hardware and software modules in the processor.

[0123] The memory may include a high-speed RAM memory, and may also include a non-volatile storage NVM, such as at least one disk storage.

[0124] The bus may be an Industry Standard Architecture (ISA) bus, a Peripheral Component Interconnect (PCI) bus, or an Extended Industry Standard Architecture (EISA) bus, etc. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, the bus in the drawings of the present application is not limited to only one bus or one type of bus.

[0125] An embodiment of the present invention further provides a computer-readable storage medium, in which computer-executable instructions are stored. When a processor executes the computer-executable instructions, the information recommendation method of the above method embodiment is implemented.

[0126] The computer-readable storage medium mentioned above can be implemented by any type of volatile or non-volatile storage device or a combination thereof, such as static random access memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk or optical disk. The readable storage medium can be any available medium that can be accessed by a general or special-purpose computer.

[0127] An exemplary readable storage medium is coupled to a processor so that the processor can read information from the readable storage medium and write information to the readable storage medium. Of course, the readable storage medium can also be a component of the processor. The processor and the readable storage medium can be located in an application specific integrated circuit (Application Specific Integrated Circuits, referred to as: ASIC). Of course, the processor and the readable storage medium can also exist in the device as discrete components.

[0128] Those skilled in the art can understand that all or part of the steps of implementing the above-mentioned method embodiments can be completed by hardware related to program instructions. The aforementioned program can be stored in a computer-readable storage medium. When the program is executed, the steps of the above-mentioned method embodiments are executed; and the aforementioned storage medium includes: ROM, RAM, disk or optical disk and other media that can store program codes.

[0129] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit it. Although the present invention 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 invention.

Claims

1. An information recommendation method, characterized in that: The method is applied to an information recommendation system, wherein the information recommendation system includes a multi-level cache divided according to levels; the method includes: Receive request information sent by the client for obtaining recommendation results; Determine whether there is a pre-stored recommendation result corresponding to the request information in the first-level cache; the first-level cache is a distributed cache, and the distributed cache pre-stores multiple recommendation results for multiple users; If the recommendation result does not exist, determine whether there is configuration information in the second-level cache; the second-level cache is a local cache of multiple servers, and the configuration information is a common parameter of high-frequency trading; If the configuration information exists in the second-level cache, the configuration information is obtained, and a recommendation result is determined according to the preset recommendation rule, the request information and the configuration information, and the determined recommendation result is returned to the client for display; the recommendation result includes the URL information of the advertisement text and the advertisement image; The method further comprises: Receiving a first recommendation result sent by the client, where the first recommendation result is obtained from a local cache of the client according to the request information; Determine whether the json string corresponding to the first recommendation result is consistent with the json string corresponding to the recommendation result; when the first recommendation result is inconsistent with the recommendation result, obtain the corresponding advertisement image according to the URL information in the recommendation result; Accordingly, the determined recommendation results are returned to the client for display, including: Returning the advertisement text and the obtained advertisement image in the recommendation result to the client for display; Obtaining a corresponding advertisement image according to the URL information in the recommendation result includes: Based on the IP address and URL information in the request information, determine the IP address of the CDN server from which the user obtains the image, send a request to the CDN server, and determine in turn whether there is an advertisement image corresponding to the URL information in the first-level image cache or the second-level image cache; the first-level image cache is a CDN server deployed in various places, and the second-level image cache is an nginx server; the nginx server is deployed at the local bank end and stores different advertisement images through different storage paths; If it exists, directly obtain the advertisement image from the first-level image cache or the second-level image cache; If it does not exist, the advertisement image is obtained from the image management server.

2. The method according to claim 1, characterized in that The method further comprises: If the configuration information does not exist in the second-level cache, obtaining the configuration information from the database; The configuration information is stored in the second-level cache.

3. The method according to claim 1, characterized in that After determining the recommendation result according to the preset recommendation rule and the configuration information, the method further includes: The recommendation result is stored in the first level cache.

4. The method according to claim 1, characterized in that: The cache duration of the advertisement image in the first-level image cache is shorter than the cache duration of the advertisement image in the second-level image cache; the cache duration of the recommendation result in the first-level cache is shorter than the cache duration of the configuration information in the second-level cache.

5. An information recommendation device, characterized in that: The device is applied to an information recommendation system, wherein the information recommendation system includes a multi-level cache divided according to levels; the device includes: A receiving module, used to receive request information sent by a client for obtaining recommendation results; A determination module, used to determine whether there is a pre-stored recommendation result corresponding to the request information in the first-level cache; the first-level cache is a distributed cache, and the distributed cache pre-stores a plurality of recommendation results for a plurality of users; The judgment module is further used to judge whether there is configuration information in the second-level cache when the recommendation result does not exist; the second-level cache is a local cache of multiple servers, and the configuration information is a common parameter of high-frequency trading; A determination module, when configuration information exists in the second-level cache, is used to obtain the configuration information, determine a recommendation result according to a preset recommendation rule, request information and configuration information, and return the determined recommendation result to the client for display; the recommendation result includes URL information of the advertisement text and advertisement image; The receiving module is further configured to receive a first recommendation result sent by the client, where the first recommendation result is obtained from a local cache of the client according to the request information; Determine whether the json string corresponding to the first recommendation result is consistent with the json string corresponding to the recommendation result. When the first recommendation result is inconsistent with the recommendation result, determine the IP address of the CDN server from which the user obtains the image based on the IP address and URL information in the request information, send a request to the CDN server, and determine in turn whether there is an advertisement image corresponding to the URL information in the first-level image cache or the second-level image cache; the first-level image cache is a CDN server deployed in various places, and the second-level image cache is an nginx server; the nginx server is deployed at the local bank end and stores different advertisement images through different storage paths; if it exists, directly obtain the advertisement image from the first-level image cache or the second-level image cache; if it does not exist, obtain the advertisement image from the image management server; The advertisement text in the recommendation result and the obtained advertisement image are returned to the client for display.

6. An electronic device, characterized in that: include: at least one processor and memory; The memory stores computer-executable instructions; The at least one processor executes the computer-executable instructions stored in the memory, so that the at least one processor performs the method according to any one of claims 1 to 4.

7. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, and when a processor executes the computer-executable instructions, the method according to any one of claims 1 to 4 is implemented.

8. A computer program product, characterized in that The method comprises a computer program, wherein when the computer program is executed by a processor, the method according to any one of claims 1 to 4 is implemented.

Citation Information

Patent Citations

  • Aviation product recommendation system and aviation product recommendation method based on cloud service

    CN105654341A