CN111881356A - Content recommendation method and device, electronic equipment and storage medium - Google Patents

Content recommendation method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN111881356A
CN111881356A CN202010752419.8A CN202010752419A CN111881356A CN 111881356 A CN111881356 A CN 111881356A CN 202010752419 A CN202010752419 A CN 202010752419A CN 111881356 A CN111881356 A CN 111881356A
Authority
CN
China
Prior art keywords
data
data block
display
identifier
accessed
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202010752419.8A
Other languages
Chinese (zh)
Inventor
强一鹏
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing QIYI Century Science and Technology Co Ltd
Original Assignee
Beijing QIYI Century Science and Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing QIYI Century Science and Technology Co Ltd filed Critical Beijing QIYI Century Science and Technology Co Ltd
Priority to CN202010752419.8A priority Critical patent/CN111881356A/en
Publication of CN111881356A publication Critical patent/CN111881356A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/953Querying, e.g. by the use of web search engines
    • G06F16/9535Search customisation based on user profiles and personalisation
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/957Browsing optimisation, e.g. caching or content distillation
    • G06F16/9574Browsing optimisation, e.g. caching or content distillation of access to content, e.g. by caching

Landscapes

  • Engineering & Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The embodiment of the invention provides a content recommendation method, a content recommendation device, electronic equipment and a storage medium, and relates to the technical field of computers.

Description

Content recommendation method and device, electronic equipment and storage medium
Technical Field
The present invention relates to the field of computer technologies, and in particular, to a content recommendation method and apparatus, an electronic device, and a storage medium.
Background
With the development of computer technology, multimedia is more and more widely applied, and the data volume is also increased sharply. In order to facilitate a user to quickly acquire desired data from massive data, many websites and applications will generally recommend content to the user on a card display page. The card display page generally includes a plurality of display bits, each display bit can display a data block, and the data block is constructed according to display contents such as a picture, a title, a play button, a click event, and the like of data to be displayed.
In the prior art, data are changed in real time, data cannot be cached due to large data change, and insufficient space is not available due to large data volume, so that when corresponding data blocks are recommended to each user for data with more user demands, the content construction data blocks need to be displayed according to pictures, titles, play buttons, click events and the like of the data, and the same data block is repeatedly constructed in such a way, so that great resource waste is caused.
Disclosure of Invention
Embodiments of the present invention provide a content recommendation method, an apparatus, an electronic device, and a storage medium, so as to solve the problem of resource waste in the prior art and improve the utilization rate of resources. The specific technical scheme is as follows:
in a first aspect of the present invention, there is provided a content recommendation method, including:
acquiring a data identifier of data to be recommended;
based on the data identification, searching a data block corresponding to the locally cached data identification; the local cache is provided with a corresponding relation between a data identifier and a data block, the local cached data block is a data block with the number of accessed times in the accessed data block being a preset number, and the data block is constructed according to display information of data;
and recommending the data block to a display position of a card display page for display.
Optionally, before the step of searching for the data block corresponding to the locally cached data identifier based on the data identifier, the method further includes:
acquiring the accessed times of each accessed data block and constructing a data identifier of data utilized by each accessed data block;
according to the accessed times, caching the data blocks with the preset number in the front according to the sequence of the accessed times from top to bottom, and caching the corresponding relation between each data block and the data identifier of the data used for constructing the data block.
Optionally, the caching a correspondence between each data block and a data identifier of data used for constructing the data block includes:
and caching the data blocks and the data identifications of the data used for constructing the data blocks in a preset cache database in a key value pair mode.
Optionally, the caching the data blocks located in the previous preset number according to the accessed times and the sequence of the accessed times from top to bottom includes:
according to the accessed times, sequencing the data blocks according to the sequence of the accessed times from top to bottom;
and caching the data blocks with the preset number.
Optionally, under the condition that the corresponding relationship between the data identifier and the data block is cached locally, if the data block corresponding to the data identifier is not found; the method further comprises the following steps:
acquiring display information of the data to be recommended according to the data identification;
constructing a data block of the data to be recommended according to the display information;
recommending the data blocks to display positions of the card display page for display, and caching the data blocks.
Optionally, in a case that the correspondence between the data identifier and the data block is not cached locally, the method further includes:
acquiring display information of the data to be recommended according to the data identification;
constructing a data block of the data to be recommended according to the display information;
and recommending the data block to a display position of the card display page for display.
Optionally, the data is a video, and the data block includes: video title, video display picture, operation button.
In a second aspect of the present invention, there is also provided a content recommendation apparatus, including:
the first acquisition module is used for acquiring a data identifier of data to be recommended;
the searching module is used for searching a data block corresponding to the locally cached data identifier based on the data identifier; the local cache is provided with a corresponding relation between a data identifier and a data block, the local cached data block is a data block with the number of accessed times in the accessed data block being a preset number, and the data block is constructed according to display information of data;
and the display module is used for recommending the data block to a display position of a card display page for display.
Optionally, the apparatus further comprises:
the second acquisition module is used for acquiring the accessed times of each accessed data block and constructing a data identifier of data utilized by each accessed data block;
and the cache module is used for caching the data blocks with the preset number according to the accessed times and the sequence of the accessed times from top to bottom, and caching the corresponding relation between each data block and the data identifier of the data used for constructing the data block.
Optionally, the cache module is specifically configured to:
and caching the data blocks and the data identifications of the data used for constructing the data blocks in a preset cache database in a key value pair mode.
Optionally, the cache module is specifically configured to:
according to the accessed times, sequencing the data blocks according to the sequence of the accessed times from top to bottom;
and caching the data blocks with the preset number.
Optionally, under the condition that the corresponding relationship between the data identifier and the data block is cached locally, if the data block corresponding to the data identifier is not found; the device further comprises:
the third acquisition module is used for acquiring the display information of the data to be recommended according to the data identification;
the first construction module is used for constructing the data block of the data to be recommended according to the display information;
and the first processing module is used for recommending the data block to a display position of the card display page for display and caching the data block.
Optionally, in a case that the correspondence between the data identifier and the data block is not cached locally, the apparatus further includes:
the fourth acquisition module is used for acquiring the display information of the data to be recommended according to the data identification;
the second construction module is used for constructing the data block of the data to be recommended according to the display information;
and the second processing module is used for recommending the data block to a display position of the card display page for display.
Optionally, the data is a video, and the data block includes: video title, video display picture, operation button.
In another aspect of the present invention, there is also provided an electronic device, including a processor, a communication interface, a memory and a communication bus, where the processor, the communication interface, and the memory complete communication with each other through the communication bus;
a memory for storing a computer program;
a processor configured to implement the content recommendation method according to any one of the first aspect described above when executing a program stored in a memory.
In yet another aspect of the present invention, there is also provided a computer-readable storage medium having stored therein instructions, which, when run on a computer, cause the computer to execute the content recommendation method according to any one of the first aspect above.
In yet another aspect of the present invention, there is also provided a computer program product containing instructions which, when run on a computer, cause the computer to perform the content recommendation method according to any one of the first aspect above.
According to the content recommendation method, device, electronic equipment and storage medium provided by the embodiment of the invention, the data blocks with preset number of accessed times are cached locally according to the accessed times of each data block, the corresponding relation between the data identification and the data block is cached locally, the data block corresponding to the locally cached data identification is searched based on the data identification of the data to be recommended, and then the data block is recommended to the display position of the card display page for displaying, so that the data block can be directly obtained locally aiming at the data with large access times without repeatedly constructing the data block of the data, the problem of resource waste in the prior art is solved, and the utilization rate of the resource is improved. Of course, not all of the above advantages need be achieved in the practice of any one product or method of the present application.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present application, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
Fig. 1 is a schematic diagram of a content recommendation method according to an embodiment of the present application;
FIG. 2a is a first schematic view of a card display page according to an embodiment of the present application;
FIG. 2b is a second schematic view of a card display page according to an embodiment of the present application;
FIG. 3 is a flowchart of a content recommendation method according to an embodiment of the present application;
FIG. 4 is a first schematic diagram of a content recommendation device according to an embodiment of the present application;
FIG. 5 is a second schematic diagram of a content recommendation device according to an embodiment of the present application;
FIG. 6 is a third schematic diagram of a content recommendation device according to an embodiment of the present application;
fig. 7 is a fourth schematic diagram of a content recommendation device according to an embodiment of the present application;
fig. 8 is a schematic diagram of an electronic device according to an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
In order to solve the problem of resource waste in the prior art and improve the utilization rate of resources, the application discloses a content recommendation method, which comprises the following steps:
acquiring a data identifier of data to be recommended;
based on the data identification, searching a data block corresponding to the locally cached data identification; the local cache is provided with a corresponding relation between a data identifier and a data block, the local cached data block is a data block with the number of accessed times in the accessed data block being a preset number, and the data block is constructed according to display information of data;
and recommending the data block to a display position of the card display page for display.
According to the access times of each data block, caching the data blocks with the access times in the preset number in the front in the local area, caching the corresponding relation between the data identification and the data block in the local area, searching the data block corresponding to the locally cached data identification based on the data identification of the data to be recommended, and recommending the data block to the display position of the card display page for displaying, so that the data block can be directly obtained from the local area for the data with the access times, the data block of the data is not required to be repeatedly constructed, the problem of resource waste in the prior art is solved, and the utilization rate of resources is improved.
An embodiment of the present application provides a content recommendation method, and referring to fig. 1, fig. 1 is a schematic diagram of the content recommendation method according to the embodiment of the present application, including:
and step 110, acquiring a data identifier of the data to be recommended.
The content recommendation method according to the embodiment of the present application may be implemented by an electronic device, and specifically, the electronic device may be any server capable of providing a content recommendation service, for example, a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, and the like.
In a card display page application scenario, a card display page includes multiple display bits, a data block of data is displayed in the display bits, the data block is constructed according to display information of the data, and fig. 2a is a first schematic diagram of the card display page according to the embodiment of the present application.
For example, the presentation information of the data includes: picture, data title, play button, etc., data blocks of the data may be constructed based on the picture, data title, play button, etc. The data may be any multimedia data, for example, the data may be video, audio, pictures, etc. Specifically, the data to be recommended is preset, and may include data to be recommended by the server and data obtained according to the preference of the user, where the processing method of the data obtained according to the preference of the user may refer to a processing method in the prior art/related art, and details are not described here. The data identifier of the data to be recommended may include an identifier of the data to be recommended, and may also include information such as an identifier of the data to be recommended and a corresponding display bit identifier, where the identifier may be a name, a code, and the like.
In one possible implementation, the data is a video, and the data block includes: video title, video display picture, operation button.
For example, data to be recommended is videos, a certain video website needs to recommend videos to users on a home page, a card display page includes 3 display positions, which are display position 1, display position 2, and display position 3, respectively, data to be recommended is video a, video B, and video C, data blocks of the video a are displayed on the display position 1, data blocks of the video B are displayed on the display position 2, and data blocks of the video C are displayed on the display position 3, and then data identifiers of the videos to be recommended can be represented as video a1, video B2, and video C3, respectively.
Step 120, based on the data identifier, searching a data block corresponding to the locally cached data identifier; the local cache is provided with a corresponding relation between the data identification and the data blocks, the local cached data blocks are data blocks with preset numbers of accessed times in the accessed data blocks, and the data blocks are constructed according to display information of data.
After the display information of the data is obtained, a data block of the data can be constructed according to the display information of the data; specifically, the display information of the data includes a picture, a data title, and a play button, and a preset template can be obtained, where the preset template includes the picture, the data title, and the position information of the play button, and the picture, the data title, the picture placed in the preset template corresponding to the play button, the data title, and the data block corresponding to the play button are obtained, and the data block configuring the data and the data identifier of the data have a one-to-one correspondence relationship. When the generated data block is displayed at the display position of the card display page, a user can access the data block. The server can obtain the accessed times of each accessed data block and the data identifier of the data used for constructing each accessed data block, then according to the accessed times of each data block, the server obtains the data blocks with the accessed times being in the previous preset number according to the sequence of the accessed times from top to bottom, caches the data blocks with the accessed times being in the previous preset number to the local part of the server, and caches the corresponding relation between each data block and the data identifier of the data used for constructing the data block. The local cache is any device which can provide a cache function at the server side, and caches the corresponding relation between the data identifier and the data block at the server local.
For example, the server counts the access times of the data blocks of each video every 24 hours, caches the data block with the access time of the first 100 to the local, and caches the corresponding relationship between the data block of the first 100 and the corresponding data identifier of the data block of the first 100. For example, if the data identifiers of the videos to be recommended are video a1, video B2 and video C3, matching the data identifiers of the videos to be recommended with the data identifiers of the local cache, when the matching is successful, indicating that the data identifiers of the videos to be recommended are cached locally, and then acquiring the data blocks of the videos to be recommended according to the corresponding relationship between the data identifiers of the local cache and the data blocks. Therefore, the data block can be directly obtained from the local according to the data identification of the data to be recommended, the data block of the data is not required to be repeatedly constructed, the problem of resource waste in the prior art is solved, and the utilization rate of resources is improved. One data block is repeatedly used, the recommendation efficiency of recommending to a display position of a card display page for displaying can be improved, the response time is shortened, and in addition, under the condition that the data block of data is not required to be repeatedly constructed, if the data block is invalid, the number of the invalid data blocks to be cleared can be reduced when the invalid data blocks are cleared, so that the clearing cost of the invalid data blocks is reduced.
And step 130, recommending the data blocks to a display position of a card display page for display.
And after the data block is obtained, recommending the data block to a display position of the card display page for display. Therefore, the time for repeated construction can be reduced, the time for recommending the data blocks to the display positions of the card display page for display is shortened, and the efficiency is improved.
According to the access times of each data block, caching the data blocks with the access times in the preset number in the front in the local area, caching the corresponding relation between the data identification and the data block in the local area, searching the data block corresponding to the locally cached data identification based on the data identification of the data to be recommended, and recommending the data block to the display position of the card display page for displaying, so that the data block can be directly obtained from the local area for the data with the access times, the data block of the data is not required to be repeatedly constructed, the problem of resource waste in the prior art is solved, and the utilization rate of resources is improved.
In a possible implementation manner, before the step of searching for a data block corresponding to the locally cached data identifier based on the data identifier, the method further includes:
acquiring the accessed times of each accessed data block and constructing a data identifier of data utilized by each accessed data block;
according to the accessed times, caching the data blocks with preset number in the front according to the sequence of the accessed times from top to bottom, and caching the corresponding relation between each data block and the data identifier of the data used for constructing the data block.
Before the step of searching the data block corresponding to the locally cached data identifier based on the data identifier, acquiring the accessed times of each accessed data block and the data identifier of the data used for constructing each accessed data block, caching the data blocks with the preset number according to the accessed times of each data block and the sequence of the accessed times from top to bottom, and caching the corresponding relation between each data block and the data identifier of the data used for constructing the data block.
Specifically, according to the sequence of the number of accessed times from top to bottom, the data blocks in the previous preset number are obtained, then the data blocks in the previous preset number are cached to the local, and the corresponding relation between each data block and the data identifier of the data used for constructing the data block is cached, that is, the data blocks in the previous preset number are obtained first, and then the obtained data blocks in the previous preset number are cached after the data blocks in the previous preset number are obtained. Furthermore, sequentially acquiring data blocks with the preset number from top to bottom according to the sequence of the accessed times, wherein each time one data block is acquired, the acquired data block is cached locally, and the corresponding relation between each data block and the data identifier of the data used for constructing the data block is cached. Therefore, the data blocks can be directly acquired from the local for the data with a large number of access times without repeatedly constructing the data blocks of the data, so that the problem of resource waste in the prior art is solved, and the utilization rate of resources is improved.
In a possible implementation manner, before the step of searching for a data block corresponding to the locally cached data identifier based on the data identifier, the method further includes:
acquiring the accessed times of each accessed data block and constructing a data identifier of data utilized by each accessed data block every preset time period;
according to the accessed times, caching the data blocks with preset number in the front according to the sequence of the accessed times from top to bottom, and caching the corresponding relation between each data block and the data identifier of the data used for constructing the data block.
In order to ensure the effectiveness of the local cache, the number of times of access of each accessed data block and the data identifier of the data used for constructing each accessed data block may be obtained at intervals of a preset time period, the data blocks in the previous preset number are cached according to each number of times of access and the sequence of the number of times of access from top to bottom, and the corresponding relationship between each data block and the data identifier of the data used for constructing the data block is cached. The preset time period can be set according to actual needs.
For example, every 2 days. In addition, the accessed data blocks are data blocks in a preset time period, for example, every 2 days, the accessed times of the accessed data blocks in the last 3 days and the data identifier of the data used for constructing each accessed data block are acquired, according to each accessed time, the data blocks in the previous preset number are cached in the order of the accessed times from top to bottom, and the corresponding relation between each data block and the data identifier of the data used for constructing the data block is cached. Or, every 2 days, the historical accessed times of the accessed data blocks and the data identifications of the data used for constructing the accessed data blocks, or every 2 days, the accessed times of the data blocks and the data identifications of the data used for constructing the accessed data blocks in the next 2 days are acquired. The preset time period and the preset time period can be flexibly set according to actual needs.
In a possible implementation, the cached data block and the correspondence between the data identifier and the data block correspond to a cache timestamp, and the method further includes:
and clearing the cached data block and the corresponding relation between the data identification and the data block according to the cache time stamp of the data block and the cache time stamp of the corresponding relation between the data identification and the data block. For example, in the current time period, after the data block and the corresponding relationship between the data identifier and the data block are cached, according to the cache timestamp of the data block and the cache timestamp of the corresponding relationship between the data identifier and the data block, the data block cached in the previous time period and the corresponding relationship between the data identifier and the data block are cleared, so that the memory space can be regularly updated, the situation that the cache cannot be performed due to insufficient space is avoided, the cache content capacity is ensured not to be too large, and the memory resource is saved.
In a possible embodiment, the caching a correspondence between each data block and a data identifier of data used for constructing the data block includes:
and caching the data blocks and the data identifications of the data used for constructing the data blocks in a preset cache database in a key value pair mode.
The preset cache database may be a Redis database, and the data identifier of the data used for constructing the data block is used as a key (key word), and the data block is used as a value and exists in the Redis database. For example, the data is a video, the video ID and the corresponding display bit identifier are combined to be a key, and a data block constructed according to the video title, the video display picture and the operation button is stored in the Redis database as a value. And by storing in a key value pair mode, the corresponding data block can be quickly searched by constructing the data identifier of the data utilized by the data block.
In one possible embodiment, the data identifier of the data includes a card identifier and an identifier of the data, and the method further includes:
and (4) combining the card identification and the data identification to be a key, and caching the data block to be a value in a Redis database.
Referring to fig. 2b, fig. 2b is a second schematic view of a card display page according to an embodiment of the present application. In practical applications, different pages have different corresponding card types, or different card types at different positions on the same page, for example, when a certain video is newly shown, a card of a video website recommending information of the video on a first page is different from cards of other pages recommending videos. That is, the data block structure may be different for data blocks of the same data at different presentation bits.
And acquiring the card identification, the data identification and the data block for constructing the data block, combining the card identification and the data identification as a key, and caching the data block as a value in a Redis database. For example, if the data is a video and the card types are 2, that is, the card identifiers are C1 and C2, respectively, after acquiring the data blocks with the preset number of previous accessed times in the accessed data blocks, combining the video ID and the card identifier as a key, and caching the data blocks as values in a Redis database.
In one possible embodiment, the method further comprises:
acquiring data blocks with the previous preset number of accessed times in the accessed data blocks;
caching the data identification in a first cache database, combining the card identification and the data identification to be a key, caching the data block as a value in a Redis database, searching whether the identification of the data to be recommended exists in the first cache database after acquiring the data identification of the data to be recommended, and acquiring the data block from the Redis database according to the data identification and the card identification if the identification of the data to be recommended exists and the identification of the data to be recommended exists, wherein the number of times of accessing the data block of the data to be recommended is a preset number. The identification of the cached data in the first cache database can visually check which data access times are in the preset number.
In a possible implementation manner, the caching the data blocks located in the first preset number according to each of the accessed times and in the order of the accessed times from top to bottom includes:
according to the accessed times, sequencing the data blocks according to the sequence of the accessed times from top to bottom;
and caching the data blocks with the preset number.
For example, after obtaining each of the accessed times, sorting the data blocks according to the order of the accessed times from top to bottom, and then caching the data block located at the top 100. The data blocks are sorted according to the sequence of the accessed times from top to bottom, so that the data blocks in the preset number can be conveniently determined.
In a possible implementation manner, based on the data identifier, a data block corresponding to the locally cached data identifier is searched; the method comprises the following steps: and matching the data identification with the data identification of the local cache, and if the matching is successful, indicating that the local cache has the corresponding relationship between the data identification and the data block, searching the data block corresponding to the locally cached data identification based on the data identification. And if the matching is unsuccessful, indicating the corresponding relation between the local uncached data identifier and the data block. The method for matching the data identifier with the locally cached data identifier may refer to a matching method in the prior art/related art, and is not described herein again.
In a possible implementation manner, under the condition that the corresponding relationship between the data identifier and the data block is cached locally, if the data block corresponding to the data identifier is not found; the method further comprises the following steps:
acquiring display information of the data to be recommended according to the data identification;
constructing a data block of the data to be recommended according to the display information;
and recommending the data blocks to the display positions of the card display page for display, and caching the data blocks.
After the data block is cached locally, the data block may be damaged or deleted, so that the data block corresponding to the data identifier is not found in the case that the corresponding relationship between the data identifier and the data block is cached locally. Under the condition that the corresponding relation between the data identification and the data block is cached locally, if the data block corresponding to the data identification is not found, the display information of the data to be recommended is obtained according to the data identification, then the data block of the data to be recommended is constructed according to the display information, the data block is recommended to the display position of the card display page for display, and the data block is cached.
In a possible implementation manner, in a case that the correspondence between the data identifier and the data block is not cached locally, the method further includes:
acquiring display information of the data to be recommended according to the data identification;
constructing a data block of the data to be recommended according to the display information;
and recommending the data blocks to the display positions of the card display page for display.
Under the condition that the corresponding relation between the data identification and the data block is not cached locally, if the number of times of accessing the data block of the data to be recommended is not within the preset number, the data block of the data to be recommended needs to be constructed, specifically, the display information of the data to be recommended is obtained according to the data identification, the data block of the data to be recommended is constructed according to the display information, and finally the data block is recommended to the display position of the card display page for display, so that the display of the data to be recommended is realized.
Referring to fig. 3, fig. 3 is a flowchart of a content recommendation method according to an embodiment of the present application, where a user request may be a request in any form, for example, a user opens a certain website page, or logs in a website, that is, a recommendation request instruction is sent on behalf of the user to obtain the user request, a data identifier of data to be recommended to the user is obtained according to the user request, the data identifier is matched with a locally cached data identifier, and whether to locally cache the data identifier of the data to be recommended is searched; and if the data identification of the data to be recommended is not cached locally, constructing a data block, and recommending the constructed data block to a display position of the card display page for display. If the data identification of the data to be recommended is cached locally, checking whether a data block corresponding to the data identification can be acquired from the cache or not, and if so, recommending the acquired data block to a display position of a card display page for display; and if not, constructing the data block, caching the constructed data block to the local, and recommending the constructed data block to a display position of the card display page for display.
According to the access times of each data block, caching the data blocks with the access times in the preset number in the front in the local area, caching the corresponding relation between the data identification and the data block in the local area, searching the data block corresponding to the locally cached data identification based on the data identification of the data to be recommended, and recommending the data block to the display position of the card display page for displaying, so that the data block can be directly obtained from the local area for the data with the access times, the data block of the data is not required to be repeatedly constructed, the problem of resource waste in the prior art is solved, and the utilization rate of resources is improved.
An apparatus is further provided in the embodiment of the present application, referring to fig. 4, where fig. 4 is a first schematic diagram of a content recommendation apparatus in the embodiment of the present application, where the apparatus includes:
the first acquisition module 201 is configured to acquire a data identifier of data to be recommended;
the searching module 202 is configured to search, based on the data identifier, a data block corresponding to the locally cached data identifier; the local cache is provided with a corresponding relation between a data identifier and a data block, the local cached data block is a data block with the number of accessed times in the accessed data block being a preset number, and the data block is constructed according to display information of data;
the display module 203 is configured to recommend the data block to a display position of the card display page for display.
Referring to fig. 5, fig. 5 is a second schematic diagram of a content recommendation device according to an embodiment of the present application, and in a possible implementation manner, the device further includes:
a second acquisition module 204, configured to acquire the number of times each accessed data block has been accessed and construct a data identifier of data utilized by each accessed data block;
the cache module 205 is configured to cache, according to each accessed frequency, data blocks located in a preset number in a sequence from top to bottom of the accessed frequency, and cache a corresponding relationship between each data block and a data identifier of data used for constructing the data block.
In a possible implementation manner, the caching module 205 is specifically configured to:
and caching the data blocks and the data identifications of the data used for constructing the data blocks in a preset cache database in a key value pair mode.
In a possible implementation manner, the caching module 205 is specifically configured to:
according to the accessed times, sequencing the data blocks according to the sequence of the accessed times from top to bottom;
and caching the data blocks with the preset number.
Referring to fig. 6, fig. 6 is a third schematic view of a content recommendation apparatus according to an embodiment of the present application, and in a possible implementation manner, if a data block corresponding to a data identifier is not found in a case that a correspondence between the data identifier and the data block is locally cached; the device still includes:
the third acquisition module 206 is configured to acquire display information of the data to be recommended according to the data identifier;
the first construction module 207 is used for constructing a data block of the data to be recommended according to the display information;
the first processing module 208 is configured to recommend the data block to a display bit of the card display page for display, and cache the data block.
Referring to fig. 7, fig. 7 is a fourth schematic diagram of a content recommendation apparatus according to an embodiment of the present application, and in a possible implementation manner, in a case that there is no correspondence between a cache data identifier and a data block locally, the apparatus further includes:
the fourth acquisition module 209 is configured to acquire display information of the data to be recommended according to the data identifier;
the second constructing module 210 is configured to construct a data block of data to be recommended according to the presentation information;
the second processing module 211 is configured to recommend the data block to a display position of the card display page for display.
In one possible implementation, the data is video, and the data block includes: video title, video display picture, operation button.
With regard to the apparatus in the above-described embodiment, the specific manner in which each module performs the operation has been described in detail in the embodiment related to the method, and will not be elaborated here.
An embodiment of the present invention further provides an electronic device, as shown in fig. 8, fig. 8 is a schematic diagram of an electronic device according to an embodiment of the present application, and includes a processor 601, a communication interface 602, a memory 603, and a communication bus 604, where the processor 601, the communication interface 602, and the memory 603 complete mutual communication through the communication bus 604,
a memory 603 for storing a computer program;
the processor 601 is configured to implement the following steps when executing the program stored in the memory 603:
acquiring a data identifier of data to be recommended;
based on the data identification, searching a data block corresponding to the locally cached data identification; the local cache is provided with a corresponding relation between a data identifier and a data block, the local cached data block is a data block with the number of accessed times in the accessed data block being a preset number, and the data block is constructed according to display information of data;
and recommending the data blocks to a display position of a card display page for display.
Optionally, the processor 601 is configured to implement any of the content recommendation methods described above when executing the program stored in the memory 603.
The communication bus mentioned in the above terminal may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The communication bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown, but this does not mean that there is only one bus or one type of bus.
The communication interface is used for communication between the terminal and other equipment.
The Memory may include a Random Access Memory (RAM) or a non-volatile Memory (non-volatile Memory), such as at least one disk Memory. Optionally, the memory may also be at least one memory device located remotely from the processor.
The Processor may be a general-purpose Processor, and includes a Central Processing Unit (CPU), a Network Processor (NP), and the like; the device can also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other Programmable logic device, a discrete Gate or transistor logic device, or a discrete hardware component.
In still another embodiment of the present invention, a computer-readable storage medium is further provided, which stores instructions that, when executed on a computer, cause the computer to execute any of the above-mentioned content recommendation methods in the above-mentioned embodiments.
In yet another embodiment of the present invention, there is also provided a computer program product containing instructions which, when run on a computer, cause the computer to perform any of the above-described content recommendation methods in the above-described embodiments.
In the above embodiments, the implementation may be wholly or partially realized by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. The procedures or functions described above in accordance with the embodiments of the invention may be generated, in whole or in part, when the computer program instructions described above are loaded and executed on a computer. The computer may be a general purpose computer, a special purpose computer, a network of computers, or other programmable device. The computer instructions may be stored in a computer readable storage medium or transmitted from one computer readable storage medium to another computer readable storage medium, for example, the computer instructions may be transmitted from one website, computer, server 110, or data center to another website, computer, server 110, or data center via wired (e.g., coaxial cable, fiber optic, Digital Subscriber Line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device, such as a server 110, a data center, etc., that includes one or more of the available media. The usable medium may be a magnetic medium (e.g., floppy Disk, hard Disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., Solid State Disk (SSD)), among others.
It is noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the same element.
All the embodiments in the present specification are described in a related manner, and the same and similar parts among the embodiments may be referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, for the apparatus, the electronic device, the storage medium, and the computer program product embodiment containing the instructions, since they are substantially similar to the method embodiment, the description is relatively simple, and for the relevant points, reference may be made to the partial description of the method embodiment.
The above description is only for the preferred embodiment of the present invention, and is not intended to limit the scope of the present invention. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention shall fall within the protection scope of the present invention.

Claims (10)

1. A method for recommending content, the method comprising:
acquiring a data identifier of data to be recommended;
based on the data identification, searching a data block corresponding to the locally cached data identification; the local cache is provided with a corresponding relation between a data identifier and a data block, the local cached data block is a data block with the number of accessed times in the accessed data block being a preset number, and the data block is constructed according to display information of data;
and recommending the data block to a display position of a card display page for display.
2. The method of claim 1, wherein prior to the step of searching for a data block corresponding to the locally cached data identifier based on the data identifier, the method further comprises:
acquiring the accessed times of each accessed data block and constructing a data identifier of data utilized by each accessed data block;
according to the accessed times, caching the data blocks with the preset number in the front according to the sequence of the accessed times from top to bottom, and caching the corresponding relation between each data block and the data identifier of the data used for constructing the data block.
3. The method of claim 2, wherein caching the correspondence between each data block and the data identifier of the data used to construct the data block comprises:
and caching the data blocks and the data identifications of the data used for constructing the data blocks in a preset cache database in a key value pair mode.
4. The method of claim 2, wherein caching a preset number of data blocks in a top order according to the respective accessed times comprises:
according to the accessed times, sequencing the data blocks according to the sequence of the accessed times from top to bottom;
and caching the data blocks with the preset number.
5. The method according to claim 1, wherein if the data block corresponding to the data identifier is not found in the case that the correspondence between the data identifier and the data block is cached locally; the method further comprises the following steps:
acquiring display information of the data to be recommended according to the data identification;
constructing a data block of the data to be recommended according to the display information;
recommending the data blocks to display positions of the card display page for display, and caching the data blocks.
6. The method of claim 1, wherein in the case that the data identifier and data block correspondence is not cached locally, the method further comprises:
acquiring display information of the data to be recommended according to the data identification;
constructing a data block of the data to be recommended according to the display information;
and recommending the data block to a display position of the card display page for display.
7. The method of any of claims 1-5, wherein the data is video, and wherein the data block comprises: video title, video display picture, operation button.
8. A content recommendation apparatus, characterized in that the apparatus comprises:
the first acquisition module is used for acquiring a data identifier of data to be recommended;
the searching module is used for searching a data block corresponding to the locally cached data identifier based on the data identifier; the local cache is provided with a corresponding relation between a data identifier and a data block, the local cached data block is a data block with the number of accessed times in the accessed data block being a preset number, and the data block is constructed according to display information of data;
and the display module is used for recommending the data block to a display position of a card display page for display.
9. An electronic device is characterized by comprising a processor, a communication interface, a memory and a communication bus, wherein the processor and the communication interface are used for realizing mutual communication by the memory through the communication bus;
a memory for storing a computer program;
a processor for implementing the method steps of any of claims 1 to 7 when executing a program stored in the memory.
10. A computer-readable storage medium, characterized in that a computer program is stored in the computer-readable storage medium, which computer program, when being executed by a processor, carries out the method steps of any one of claims 1 to 7.
CN202010752419.8A 2020-07-30 2020-07-30 Content recommendation method and device, electronic equipment and storage medium Pending CN111881356A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010752419.8A CN111881356A (en) 2020-07-30 2020-07-30 Content recommendation method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010752419.8A CN111881356A (en) 2020-07-30 2020-07-30 Content recommendation method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN111881356A true CN111881356A (en) 2020-11-03

Family

ID=73205735

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010752419.8A Pending CN111881356A (en) 2020-07-30 2020-07-30 Content recommendation method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN111881356A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114338803A (en) * 2021-12-01 2022-04-12 北京达佳互联信息技术有限公司 Resource acquisition method, device, equipment and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103177005A (en) * 2011-12-21 2013-06-26 深圳市腾讯计算机系统有限公司 Processing method and system of data access
CN108228873A (en) * 2018-01-17 2018-06-29 腾讯科技(深圳)有限公司 Object recommendation, publication content delivery method, device, storage medium and equipment
CN108959514A (en) * 2018-06-27 2018-12-07 中国建设银行股份有限公司 A kind of data processing method and device
CN109597915A (en) * 2018-09-18 2019-04-09 北京微播视界科技有限公司 Access request treating method and apparatus

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103177005A (en) * 2011-12-21 2013-06-26 深圳市腾讯计算机系统有限公司 Processing method and system of data access
CN108228873A (en) * 2018-01-17 2018-06-29 腾讯科技(深圳)有限公司 Object recommendation, publication content delivery method, device, storage medium and equipment
CN108959514A (en) * 2018-06-27 2018-12-07 中国建设银行股份有限公司 A kind of data processing method and device
CN109597915A (en) * 2018-09-18 2019-04-09 北京微播视界科技有限公司 Access request treating method and apparatus

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114338803A (en) * 2021-12-01 2022-04-12 北京达佳互联信息技术有限公司 Resource acquisition method, device, equipment and storage medium

Similar Documents

Publication Publication Date Title
CN108495185B (en) Video title generation method and device
CN103368992A (en) Message push method and device
CN111198976B (en) Cloud asset association analysis system, method, electronic equipment and medium
CN104077294A (en) Information recommendation method, information recommendation device and information resource recommendation system
US11423096B2 (en) Method and apparatus for outputting information
CN108154024A (en) A kind of data retrieval method, device and electronic equipment
CN112559913B (en) Data processing method, device, computing equipment and readable storage medium
CN108062401B (en) Application recommendation method and device and storage medium
CN116680278B (en) Data processing method, device, electronic equipment and storage medium
CN111881356A (en) Content recommendation method and device, electronic equipment and storage medium
CN112437148A (en) Service request processing method and device, service server and system
CN112788090A (en) Network resource transmission method, device and system
CN111367606A (en) Application page display method, device, terminal and medium
CN116208579A (en) Information pushing method, device, equipment and storage medium
CN112818190B (en) Content sharing method, device, electronic equipment and storage medium
CN111641690B (en) Session message processing method and device and electronic equipment
CN114611039A (en) Asynchronous loading rule analysis method and device, storage medium and electronic equipment
CN115146148A (en) Method and device for recommending content data
CN110674386B (en) Resource recommendation method, device and storage medium
CN105989011A (en) Service search system and method
CN112416401B (en) Data updating method, device and equipment
CN115514806B (en) Perception discovery method and system for discrete service cluster
CN114253951B (en) Data processing method, system and second server
CN110377857B (en) Display information processing method and device, electronic equipment and storage medium
CN107729446B (en) Map telephone discrimination method, apparatus, server and medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination