CN110647685B - Information recommendation method, device and equipment - Google Patents

Information recommendation method, device and equipment Download PDF

Info

Publication number
CN110647685B
CN110647685B CN201910896892.0A CN201910896892A CN110647685B CN 110647685 B CN110647685 B CN 110647685B CN 201910896892 A CN201910896892 A CN 201910896892A CN 110647685 B CN110647685 B CN 110647685B
Authority
CN
China
Prior art keywords
data
storage area
storage
preset
address
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.)
Active
Application number
CN201910896892.0A
Other languages
Chinese (zh)
Other versions
CN110647685A (en
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.)
Advanced New Technologies Co Ltd
Advantageous New Technologies Co Ltd
Original Assignee
Advanced New Technologies 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 Advanced New Technologies Co Ltd filed Critical Advanced New Technologies Co Ltd
Priority to CN201910896892.0A priority Critical patent/CN110647685B/en
Publication of CN110647685A publication Critical patent/CN110647685A/en
Application granted granted Critical
Publication of CN110647685B publication Critical patent/CN110647685B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

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

Abstract

The embodiment of the specification discloses an information recommendation method, device and equipment. The scheme comprises the following steps: acquiring a first information recommendation request sent by a terminal; reading first data from the first storage area according to the first information recommendation request to obtain a first data set; judging whether the total quantity of data in the first data set meets a preset threshold value or not to obtain a first judging result; when the first judgment result shows that the total quantity of the data in the first data set does not meet the preset threshold value, reading second data from the second storage area according to the first information recommendation request to obtain a second data set; obtaining a third data set according to the first data set and the second data set; the total number of data in the third data set meets a preset threshold; and recommending information to the terminal according to the data in the third data set.

Description

Information recommendation method, device and equipment
Technical Field
The present disclosure relates to the field of computer technologies, and in particular, to an information recommendation method, apparatus, and device.
Background
In recent years, with the development and popularization of internet information technology, people can acquire information latest every day through the internet. The system or server may recommend or recommend some information to the user, such as: the screened content is recommended from a large amount of content using various recommendation techniques using a communication network such as the internet. With the development of media-type services (e.g., online news application, friend-making software, mobile-on-demand services, web novel reading services, etc.), the variety of media content (e.g., audio, video, news, information, web novel, etc.) is increasing, and how to recommend up-to-date and high-quality related content to users has become an important issue in the multimedia field.
In the prior art, in order to recommend the latest and high-quality information to a user, a system usually calculates a data set offline, sorts the data according to the time of data generation (from new to old), forms a recommendation list, and places the recommendation list on a line to recommend according to the sorting; when new data appears, the new data is inserted into the position next to the current recommended position, and the priority recommendation of the newly added data is ensured. However, in the practical application value, since the online recommendation list is shared by a plurality of users, when new data is inserted into the next position of the current recommendation data, the priority order of the original recommendation list is destroyed, and the accuracy of the recommendation result is affected when the circular recommendation is performed according to the list again.
Disclosure of Invention
In view of this, the embodiments of the present application provide an information recommendation method, apparatus, and device, which are used to recommend the latest information preferentially, and do not destroy the priority order of the original data, so as to ensure the accuracy of the information recommendation result.
In order to solve the above technical problems, the embodiments of the present specification are implemented as follows:
the information recommendation method provided in the embodiment of the present specification includes:
acquiring a first information recommendation request sent by a terminal;
Reading first data from a first storage area according to the first information recommendation request to obtain a first data set, wherein the first storage area is a preset area for storing data with generation time later than a preset moment;
judging whether the total quantity of data in the first data set meets a preset threshold value or not to obtain a first judging result;
when the first judgment result indicates that the total quantity of the data in the first data set does not meet the preset threshold value, reading second data from a second storage area according to the first information recommendation request to obtain a second data set; the second storage area is a preset area for storing data with generation time earlier than the preset time; the second storage area is different from the first storage area;
obtaining a third data set according to the first data set and the second data set; the total number of data in the third data set meets the preset threshold;
and recommending information to the terminal according to the data in the third data set.
An information recommendation device provided in an embodiment of the present disclosure includes:
the information recommendation request acquisition module is used for acquiring a first information recommendation request sent by the terminal;
The first data reading module is used for reading first data from a first storage area according to the first information recommendation request to obtain a first data set, and the first storage area is a preset area for storing data with generation time later than a preset time;
the judging module is used for judging whether the total quantity of the data in the first data set meets a preset threshold value or not to obtain a first judging result;
the second data reading module is used for reading second data from a second storage area according to the first information recommendation request to obtain a second data set when the first judgment result indicates that the total quantity of data in the first data set does not meet the preset threshold value; the second storage area is a preset area for storing data with generation time earlier than the preset time; the second storage area is different from the first storage area;
the third data set determining module is used for obtaining a third data set according to the first data set and the second data set; the total number of data in the third data set meets the preset threshold;
and the information recommending module is used for recommending information to the terminal according to the data in the third data set.
An information recommendation device provided in an embodiment of the present specification includes:
at least one processor; the method comprises the steps of,
a memory communicatively coupled to the at least one processor; wherein, the liquid crystal display device comprises a liquid crystal display device,
the memory stores instructions executable by the at least one processor to enable the at least one processor to:
acquiring a first information recommendation request sent by a terminal;
reading first data from a first storage area according to the first information recommendation request to obtain a first data set, wherein the first storage area is a preset area for storing data with generation time later than a preset moment;
judging whether the total quantity of data in the first data set meets a preset threshold value or not to obtain a first judging result;
when the first judgment result indicates that the total quantity of the data in the first data set does not meet the preset threshold value, reading second data from a second storage area according to the first information recommendation request to obtain a second data set; the second storage area is a preset area for storing data with generation time earlier than the preset time; the second storage area is different from the first storage area;
Obtaining a third data set according to the first data set and the second data set; the total number of data in the third data set meets the preset threshold;
and recommending information to the terminal according to the data in the third data set.
Embodiments of the present disclosure provide a computer readable medium having computer readable instructions stored thereon, the computer readable instructions being executable by a processor to implement an information recommendation method.
The above-mentioned at least one technical scheme that this description embodiment adopted can reach following beneficial effect: acquiring a first information recommendation request sent by a terminal; reading first data with generation time later than preset time from a first storage area according to a first information recommendation request to obtain a first data set, and reading second data with generation time earlier than the preset time from a second storage area according to the first information recommendation request when the total number of data in the first data set does not meet a preset threshold value to obtain a second data set; according to the first data set and the second data set, a third data set with the total data quantity meeting a preset threshold value is obtained, information recommendation is carried out on the terminal according to the data in the third data set, and under the condition that the first data with stronger timeliness is preferentially recommended when the information recommendation is carried out on the user terminal, the priority order of the original second data is not damaged, the recommendation results of other users are not influenced, and the accuracy of the information recommendation results is ensured.
Drawings
The accompanying drawings, which are included to provide a further understanding of the application and are incorporated in and constitute a part of this application, illustrate embodiments of the application and together with the description serve to explain the application and do not constitute an undue limitation to the application. In the drawings:
FIG. 1 is a schematic diagram of a data structure storage mode used in an information recommendation method in the prior art;
fig. 2 is a schematic view of a scenario of information recommendation according to an embodiment of the present invention;
fig. 3 is a flow chart of an information recommendation method according to an embodiment of the present disclosure;
fig. 4 is a schematic diagram of a first data reading method corresponding to an information recommendation method according to an embodiment of the present disclosure;
fig. 5 is a schematic diagram of a method for circularly reading data according to an information recommendation method provided in an embodiment of the present disclosure;
fig. 6 is a schematic diagram of a method for reading data corresponding to an information recommendation method according to an embodiment of the present disclosure;
fig. 7 is a schematic diagram of a storage manner of first data and second data corresponding to an information recommendation method according to an embodiment of the present disclosure;
FIG. 8 is a schematic diagram of an information recommendation device corresponding to FIG. 3 according to an embodiment of the present disclosure;
Fig. 9 is a schematic structural view of an information recommendation apparatus corresponding to fig. 3 according to an embodiment of the present disclosure.
Detailed Description
For the purposes, technical solutions and advantages of the present application, the technical solutions of the present application will be clearly and completely described below with reference to specific embodiments of the present application and corresponding drawings. It will be apparent that the described embodiments are only some, but not all, of the embodiments of the present application. All other embodiments, which can be made by one of ordinary skill in the art without undue burden from the present disclosure, are within the scope of the present disclosure.
The following describes in detail the technical solutions provided by the embodiments of the present application with reference to the accompanying drawings.
With the development of the internet, information recommendation or recommendation scenes using the internet are becoming more common, for example: web content recommendations, video recommendations, news recommendations, etc. When information recommendation is performed, the system usually calculates a data set offline, scores the data in the calculated data set according to a scoring rule to obtain a priority order, and then places the ordered data set on line to recommend the ordered data set to an end user according to the priority order. In practical application, however, in addition to the offline calculated data, some new data can be generated during online information recommendation or recommendation, and when the recommendation is performed, a user hopes to see content with faster timeliness and higher quality; so new premium content should be pushed preferentially if found; without new content, the data in the ordered dataset may be recommended according to the popularity of the content or other scoring.
In the prior art, in order to meet the above requirements, the recommendation is made in the manner shown in fig. 1:
fig. 1 is a schematic diagram of a data structure storage manner used in the information recommendation method in the prior art, as shown in fig. 1, a new element or data (data 11) is directly inserted into the next reading (data 2) to realize the preferential display of the new element or data. However, to save storage space, a plurality of users may share a recommendation list, and based on this premise, inserting a new element into a position next to a current position in the prior art may cause that when information is recommended to another user, the recommendation sequence is disturbed, that is, the sequence of original data and a scoring ordering system are damaged by the newly added element, and when the content is recommended to another user in a recycling manner, data priority errors are caused, for example: when the user a reads the second position, the newly added element is inserted into the next position (third position) read by the user a, as shown in fig. 1, the data 11 is the newly added element or the newly added data, and when the information is recommended to the user B, the order of the recommendation list is disordered when the information is recommended to the user B, and the order is as follows: 1- > 2- > 11- > 3- > 4- > 5, affects the recommendation result for the B-user. In addition, when the unordered list is used for recommendation for a plurality of times, the recommended number of times of the newly added element data 11 is obviously higher than that of other newly added element data which are not inserted into the list, so that the subsequent evaluation result of the priority of the data 11 is abnormal.
In order to solve the drawbacks of the prior art, the present solution provides the following embodiments:
fig. 2 is a schematic view of an information recommendation scenario provided by an embodiment of the present invention, as shown in fig. 2, a server 201 receives an information recommendation request sent by a terminal 202, the server 201 determines information with recommendation from online according to the information recommendation request, recommends data to be recommended to the terminal 202, and displays corresponding information on a screen interface of the terminal 202 for a user to watch. After receiving the request sent by the terminal 202, the server 201 fetches the data to be recommended from the line, which is what needs to be elaborated on the present scheme.
Fig. 3 is a flowchart of an information recommendation method according to an embodiment of the present disclosure. From a program perspective, the execution subject of the flow may be a server.
As shown in fig. 3, the process may include the steps of:
step 301: and acquiring a first information recommendation request sent by the terminal.
In this embodiment of the present application, the server may be a server capable of providing a data service, including but not limited to: web servers, data center servers, etc. The servers can adopt an independent working mode (only one server provides live data service) or a clustered working mode.
A Terminal (Terminal) is also called a Terminal device, and may refer to a device located at the outermost periphery of a network in a computer network, and is mainly used for inputting user information and outputting a processing result. The terminal may be a mobile phone, a tablet computer, an intelligent television, a computer and other terminals with data display functions used by a user, and in some practical application scenarios, the terminal may also be a large-scale display device (such as a device with a large-scale display screen in a living broadcast hall), which is not limited in this application.
The information recommendation request may be a message sent by the terminal for requesting information recommendation, and the server may receive the information recommendation request sent by the terminal, so as to recommend information to the terminal. For example: text content recommendation requests, video recommendation requests, web page recommendation requests, product recommendation requests, and the like.
Step 302: and reading first data from a first storage area according to the first information recommendation request to obtain a first data set, wherein the first storage area is a preset area for storing data with generation time later than a preset time.
Dividing the storage space into a first storage area and a second storage area according to preset time.
When the data generated in the specified time range is stored, the data can be stored in two different storage areas according to time, the first storage area can refer to an area for storing the data with the generation time later than the preset time, and the data stored in the first storage area can be understood as the newly-added data in the specified time. When new data is generated in the system, each piece of data has corresponding generation time, and the generation time of each piece of new data is recorded. In the above example, the preset time is 12:00, and the data later than 12:00 are: data 1 (13:00), data 2 (13:30), data 3 (14:00), data 4 (15:00), and the four data are stored as first data in the first storage area. The first data may be data having a generation time later than a preset time, where it is to be noted that the generation time of the first data is later than the preset time, and data having a generation time of the first data later than the preset time and satisfying a preset condition may be defined, for example: the first data may represent data having a click rate higher than a preset threshold value generated at a time later than a preset time. Here, the present solution is not limited thereto;
the first storage area may or may not store data: when there is no data whose generation time is later than the preset time, there may be no data in the first storage area.
The second storage area may refer to an area for storing data with generation time earlier than a preset time, the second data in the second storage area may be offline calculated data, and the storage sequence of the second data in the storage area may be stored according to a ranking obtained after statistical processing according to a preset scoring system.
The preset time may refer to a generation time of one data having the latest generation time of the data stored in the second storage area calculated offline. Such as: a, B, C and D four data exist in the second storage area, and the generation time is respectively: a (12:00), B (13:00), C (14:00) and D (15:00), wherein the preset time can be 15:00, and data which is generated in a set period (for example, one period a day) and has a time later than 15:00 is stored in the first storage area as first data. In this scheme, the preset time may generally represent a generation time corresponding to the last data stored in the second storage area. In the foregoing example, the last data in the second storage area is D, and the corresponding data generation time is 15:00, where the preset time may be 15:00.
Therefore, after the server acquires the first information recommendation request sent by the terminal, first data with generation time later than the preset time is read from the first storage area.
Step 303: and judging whether the total quantity of the data in the first data set meets a preset threshold value or not, and obtaining a first judging result.
In the recommended scene, a service parameter of how many pieces of data are refreshed/pulled down each time is provided; fetch complete if full. At this time, the service parameter of the data refreshed or pulled each time may be a preset threshold, for example: the service parameter of the data refreshed or pulled each time is 5, and the preset threshold value can be considered to be 5.
After the first data is read from the first data set, it needs to be determined whether the total number of the first data in the first data set meets a preset threshold, where the preset threshold may be a preset amount of information recommended to the terminal each time, for example: 5 pieces of information are recommended to the terminal in each time in advance, the preset threshold value can be 5, and the information corresponding to the 5 pieces of data is recommended to the terminal when the 5 pieces of data are read.
Step 304: when the first judgment result indicates that the total quantity of the data in the first data set does not meet the preset threshold value, reading second data from a second storage area according to the first information recommendation request to obtain a second data set; the second storage area is a preset area for storing data with generation time earlier than the preset time; the second storage area is different from the first storage area.
When the total number of the first data in the first data set does not meet the preset threshold (for example, the preset recommended number is 5 each time, and the total number of the first data acquired at this time is 3), the data needs to be continuously read, at this time, the data set before the preset time can be read from the data set before the preset time, the data set before the preset time is stored in the second storage area, the data in the second storage area has a sorting order, and the sorting basis can be sorting according to time, sorting according to clicking/browsing heat, scoring according to a preset scoring rule, and sorting according to the score size, where the sorting basis in the second storage area is not limited by the scheme.
In this scheme, two different storage areas are used to store data in different time periods, the data before the preset time may be called old data, may be stored in the second storage area, and the data after the preset time may be called new data, may be stored in the first storage area. A storage area is understood to be a storage area/storage space for storing data, such as: databases, tables, etc. The first storage area and the second storage area may belong to the same database or may belong to different databases, but the first storage area and the second storage area belong to different two storage areas.
Step 305: obtaining a third data set according to the first data set and the second data set; the total number of data in the third data set meets the preset threshold.
And putting the data with the set quantity read from the first data set and the second data set into a third data set. Such as: the data read from the first data set is { data 1, data 2, data 3}, the data read from the second data set is { data 4, data 5, data 6, data 7, data 8}, and the data in the third data set may be { data 1, data 2, data 3, data 4, data 5}, assuming that the preset threshold is 5.
Step 306: and recommending information to the terminal according to the data in the third data set.
And displaying the information corresponding to the read data on the terminal for sending the information recommendation request.
The method in fig. 1 includes the steps of obtaining a first information recommendation request sent by a terminal; reading first data with generation time later than preset time from a first storage area according to a first information recommendation request to obtain a first data set, and reading second data with generation time earlier than the preset time from a second storage area according to the first information recommendation request when the total number of data in the first data set does not meet a preset threshold value to obtain a second data set; according to the first data set and the second data set, a third data set with the total data quantity meeting a preset threshold value is obtained, information recommendation is carried out on the terminal according to the data in the third data set, and under the condition that the first data with stronger timeliness is preferentially recommended when the information recommendation is carried out on the user terminal, the priority order of the original second data is not damaged, the recommendation results of other users are not influenced, and the accuracy of the information recommendation results is ensured.
Based on the method of fig. 3, the present description examples also provide some specific implementations of the method, as described below.
In practical application, after the first information recommendation request sent by the terminal is obtained, the method can further comprise the steps of;
judging whether first data with generation time later than a preset time exists in a first storage area according to the first information recommendation request;
if the second data does not exist, the second data is directly fetched from the second storage area, and a second data set is obtained;
if so, the first data is fetched from the first storage area according to the first reading sequence, and a first data set is obtained.
After the first judgment result is obtained, the method may further include:
and when the first judging result indicates that the total quantity of the data in the first data set meets the preset threshold, recommending information to the terminal according to the data in the first data set.
In practical applications, if the amount of new data is sufficiently large, the amount of new data may be enough to meet the preset threshold, and at this time, old data need not be fetched, for example: the total data amount in the first data set is 10, the preset threshold is 5, at this time, five pieces of data can be directly taken out of the first data set in sequence, and information recommendation can be carried out on the terminal. Here, it should be noted that, when the total amount of data in the first data set is greater than the preset threshold, the order of reading the data may be set according to the actual situation.
In the process of specifically fetching data, the reading the first data from the first storage area according to the first information recommendation request may specifically include:
determining a first storage address in the first storage area for storing initial data;
sequentially reading first data stored in each storage address in the first storage area from the first storage address according to a preset first reading sequence; when the first data in the first storage area are stored, the first data are stored according to a preset first storage sequence, and the first storage sequence is the same as the first reading sequence.
A plurality of storage locations/addresses may be set in the storage area, and for convenience of storage, the storage locations in the storage space may be numbered with hexadecimal byte addresses of the storage locations, for example: the address numbers can range from 0000 to FFFF, with sequence.
In the fetch, first, a first storage address for storing initial data in the first storage area needs to be determined, and the first storage location is taken as a start location for reading data. The preset first read order may represent a first storage order of the first data. The preset first storage sequence may be used as a storage sequence according to the sequence of the data generation time, for example: the first data is: data 1 (generation time is 8:00), data 2 (generation time is 9:00), data 3 (generation time is 10:00), and data 4 (generation time is 11:00), wherein the data 1 with the earliest generation time is stored at a starting position, then the data 2-4 are sequentially stored according to a time sequence, and the storage sequence of the first data can be expressed as: if the reading order is the same as the storage order, the reading order at the time of access is also data 1, data 2, data 3, and data 4. The reading order in the fetch may be different from the order of storage, and may be set according to actual needs, and is not limited herein.
When the first data is specifically read, the sequentially reading the first data stored in each storage address in the first storage area according to a preset first reading sequence may specifically include:
creating a first cursor, the first cursor pointing to the first storage address;
determining address numbers corresponding to all storage addresses in the first storage area;
and moving the first cursor to sequentially read the first data stored in each storage address in the first storage area according to the address numbers corresponding to the storage addresses in the first storage area.
A cursor may be considered a representation bit on a queue or dataset to represent where data has been read, and may also be understood as a pointer. The first cursor may be defined as a cursor for fetching new data.
Each memory address in the memory area may be provided with a corresponding address label, such as: numbering is performed in hexadecimal or in decimal order.
After the first data (new data) is fetched from the first storage area, when the new data quantity does not meet the recommended or recommended preset threshold value, the second data (old data) may be continuously fetched from the second storage area, and when the second data is fetched, the fetching of the second data from the second storage area according to the first information recommendation request may specifically include:
Determining a second storage address in the second storage area for storing initial data;
sequentially reading second data stored in each storage address in the second storage area according to a preset second reading sequence from the second storage address; and when the second data in the second storage area are stored, storing the second data according to a preset second storage sequence, wherein the second storage sequence is the same as the second reading sequence.
More specifically, the sequentially reading the second data stored in each storage address in the second storage area according to a preset second reading sequence may specifically include:
creating a second cursor, the second cursor pointing to the second storage address;
determining address numbers corresponding to all storage addresses in the second storage area;
and moving the second cursor to sequentially read second data stored in each storage address in the second storage area according to the address numbers corresponding to the storage addresses in the second storage area.
It should be noted that the second cursor may be defined as a cursor for fetching the second data. When the data stored in each storage address in the storage area is sequentially read according to a preset reading sequence, the reading can be performed according to an ascending sequence of the address numbers, or can be performed according to a descending sequence of the address numbers, and the reading rule can be set according to actual conditions, so that the scheme is not limited.
In order that the method of extracting the first data and the second data may be better understood, a supplementary explanation may be made in connection with fig. 4:
fig. 4 is a schematic diagram of a first data reading method corresponding to the information recommendation method according to the embodiment of the present disclosure. As shown in fig. 4, the new data/first data is new_1 … … new_n, the old data/second data is old_1, old_2, old_3, old_4 … …, wherein the first data is stored in the first area 401, the second data is stored in the second area 402, two cursors are created when the specific access is performed, the first cursor new and the second cursor old, and the data 1 (new_1) is stored at the first storage address of the first storage area where the initial data is stored. And moving the first cursor to sequentially read the first data stored in each storage address in the first storage area according to the address numbers corresponding to the storage addresses in the first storage area. As shown in fig. 4, the new cursor is fetched in the opposite direction as the old cursor. When the new data is fetched, the new cursor/pointer is moved upwards to fetch the new data according to the address number, the new cursor/pointer is moved to the uppermost side until the new pointer is moved to the uppermost side, namely, the first data is completely fetched, if the number of the new cursor/pointer does not meet the preset threshold value after the first data is fetched, the old cursor is moved downwards and the new cursor/pointer is fetched according to the address number.
Through the method steps, the first data and the second data are stored in different storage areas, the first data are read preferentially when the data are fetched, and then the second data are read according to the priority order, so that under the condition that the first data with stronger timeliness are recommended preferentially when the information recommendation is performed on the user terminal, the original scoring system or the ordering order of the second data is not damaged, and the recommendation results of other users are not influenced.
In an actual application scene, the server can receive information recommendation requests of different users, and can also receive multiple requests sent by the same terminal. Such as: when viewing a video, the user a may refresh and repeatedly click on a recommendation button or pull down the video, and each refresh, click on a related button or pull down may be considered to be a request for information recommendation again, so after information recommendation is performed on the terminal according to the data in the third data set, the method may further include:
acquiring a second information recommendation request sent by the terminal;
determining a first address number corresponding to the last data in the first number of data;
Taking the first address number as a reference, and according to the second information recommendation request, moving the second cursor to sequentially read data, the quantity of which meets the preset threshold value, from the next storage position of the storage position corresponding to the first address number according to a preset reading sequence;
recommending the data with the quantity meeting the preset threshold value to the terminal.
When the server receives the information recommendation request again, the position of the data read by the server last time needs to be determined, and then the data is continuously read from the position last time to be recommended, so that the situation that the content just seen by the user is recommended to the user again can be avoided.
Such as: when the server receives the first information recommendation request, the data sequentially selected from the online database are { data 1, data 2, data 3, data 4 and data 5}, the address number corresponding to the last piece of data (data 5) is determined to be address 5, and when the server receives the second information recommendation request, the server moves a second cursor from the address number 5 corresponding to the data 5 to serve as a reference, and the second cursor sequentially reads the data { data 6, data 7, data 8, data 9 and data 10} with the number meeting the preset threshold value from the address 6 of the next storage position corresponding to the first address number (address 5) according to the preset reading sequence.
Further, the moving the second cursor sequentially reads the data meeting the preset threshold bar from the second address information, which may specifically include:
moving the second cursor to sequentially read a second number of pieces of data from the second storage area until the last stored data in the second storage area is read;
judging whether the second number of pieces of data meets the preset threshold value or not to obtain a second judging result;
when the second judgment result indicates that the second number of pieces of data meets the preset threshold, information recommendation is conducted on the terminal according to the second number of pieces of data;
and when the second judgment result indicates that the second number of pieces of data does not meet the preset threshold, continuing to move the second cursor to sequentially read a third number of pieces of data from the first storage area according to a preset third reading sequence, recommending information to the terminal according to the third number of pieces of data and the second number of pieces of data, wherein the sum of the total number of data of the third number of pieces of data and the total number of data of the second number of pieces of data is equal to the preset threshold, and the third reading sequence is opposite to the first reading sequence.
In an actual recommendation or recommendation scenario, when the system is just on line or in a cold start state, because the content stored in the on-line database is less in times, after the data stored in the on-line database is completely recommended to the user, a white screen cannot appear because no data can cause no content to be displayed on the user terminal, and at this time, a cyclic recommendation method can be adopted, and the specific mode can be as follows: moving the second cursor to sequentially read the second number of pieces of data from the second storage area until the last stored data in the second storage area is read, judging whether the fetched data meets a recommended preset threshold value at this time, if yes, directly recommending, and if not, continuing to fetch the data, wherein for convenience of understanding, the method can be described with reference to fig. 5 and 6:
fig. 5 is a schematic diagram of a method for circularly reading data according to an information recommendation method according to an embodiment of the present disclosure. As shown in fig. 5, the first cursor new has moved to the uppermost side, the data in the first area may be considered to be completely fetched, the second cursor has moved to the lowermost side, the data in the second area may be considered to be completely read, at this time, if the total amount of the read data still does not meet the preset threshold, a loop recommendation method may be adopted, the first cursor new and the second cursor old may be reset to the uppermost position of the queue, and the old cursor may be moved downward to fetch according to the address number. For example: because the system is just on line, the data stored in the on-line database is less, the data stored in the first storage area is data 1, data 2, the data 3 and data 4 are stored in the second storage area, when the first cursor is moved to finish taking data 1 and data 2 (the order of taking data 1 is first taking data 1 and then taking data 2), the second cursor is moved to finish taking data 3 and data 4 (the order of taking data 3 is first taking data 3 and then taking data 4), the preset threshold 6 of information recommendation still cannot be met, at this moment, the second cursor is required to be moved to sequentially read data 2 and data 1 from the first storage area, the preset threshold is met, and at this moment, the order of reading data from the first storage area when the number of circulation is taken is opposite to the order of taking data from the first storage area corresponding to the first information recommendation request. However, as an extensible embodiment, the order of fetches may remain consistent throughout, whether or not the fetches are cycled.
Fig. 6 is a schematic diagram of a method for reading data corresponding to an information recommendation method according to an embodiment of the present disclosure. As shown in fig. 6, the data extraction may be performed as follows:
step 601: when an instruction is acquired, ordering the data according to time and placing the ordered data in an online database;
step 602: placing the created first cursor new and second cursor old at the forefront of a data queue in a database;
step 603: when new added elements or data exist, the new added elements are placed at the uppermost of a data queue in a database;
step 604: when data is fetched, the first cursor is moved to fetch upwards, the second cursor is moved to fetch downwards, and whether the first cursor is positioned at the head of a data queue in the database is judged;
step 605: if the first cursor is positioned at the head of the data queue in the database, the first cursor can be considered to have completely fetched new data, and at the moment, the second cursor is moved to fetch old data downwards, and whether the second cursor is positioned at the tail of the data queue is judged;
step 606: when the second cursor is positioned at the tail part of the data queue, the second cursor is proved to finish taking all old data, and the first cursor and the second cursor are positioned at the forefront of the queue for circularly taking the number;
Step 607: if the second cursor is not positioned at the tail part of the data queue, continuing to move the second cursor to fetch the number;
step 608: judging whether the fetching is completed or not;
step 609: if the fetch is completed, ending the fetch;
step 610: if the fetch is not completed, continuing to adopt the second cursor fetch;
step 611: if the first cursor is not positioned at the head of the data queue in the database, moving the first cursor to fetch upwards;
step 612: judging whether the fetching is completed or not;
step 613: if the fetch is completed, ending the fetch;
step 614: if the fetch is not complete, the fetch is continued.
The above examples are only one possible manner in the practical application scenario in the embodiments of the present application, and do not limit the present application.
By the method, when the recommended preset threshold is still not met after the first data and the second data in the online database are taken, the phenomenon of white screen of the user terminal is avoided by adopting a cyclic taking and cyclic recommending method.
In an actual application scenario, the first data is read from the first storage area to obtain a first data set, the second data is read from the second storage area to obtain a second data set, but the number of the finally recommended data only needs to meet a preset threshold, so that a preset number of data is taken out from the first data set and the second data set to form a third data set, and the obtaining of the third data set according to the first data set and the second data set specifically may include:
Placing all data in the first data set into a third data set;
and reading a first number of pieces of data from the second data set, putting the first number of pieces of data into the third data set, wherein the sum of the first number of pieces of data and the total number of data in the first data set is equal to the preset threshold value, and the total number of data in the second data set is greater than or equal to the first number of pieces.
Such as: the first data set is { data 1, data 2}, the second data set is { data 3, data 4, data 5, data 6, data 7}, and the preset threshold value of the recommended information quantity is 3, then all data in the first data set are put into the third data set, then the first data (data 3) is read from the second data set, the third data set is { data 1, data 2, data 3}, and information corresponding to the three data is recommended to the terminal for display.
It should be noted that, the method for obtaining the recommended information may also adopt the following implementation modes:
determining a preset threshold value of information to be recommended;
taking all data out of the first storage area, and putting the data into a data set to be recommended;
and then the first number of pieces of data are fetched from the second storage area, wherein the sum of the first number of pieces of data and the total data in the data set to be recommended is equal to the preset threshold value.
By the method, the first data is read preferentially when the data is read, and the second data is read after the first data is read, so that timeliness of recommending information to the terminal is guaranteed.
In an actual application, before the reading of the first data from the first storage area according to the first information recommendation request, the method may further include:
determining address numbers corresponding to all storage addresses in the first storage area and the second storage area;
sequentially storing first data with the generation time later than the preset time on a corresponding storage address in the first storage area according to the sequence of the generation time and the address number;
and storing the second data with the generation time earlier than the preset time to the corresponding storage address in the second storage area according to the preset ordering sequence and the address number.
Further, the storing the data with the generation time later than the preset time to the corresponding storage address in the first storage area according to the sequence of the generation time and the address number may specifically include:
determining a first storage address in the first storage area for storing initial data;
And sequentially storing the first data to the corresponding storage addresses in the first storage area according to the sequence of the generation time, wherein one address number storage address in the first storage area corresponds to one piece of first data, and the data with the earliest generation time in the first data is stored in the first storage address.
In order to better understand the manner in which the first data and the second data are stored, the method of fig. 6 may be described in detail:
fig. 7 is a schematic diagram of a storage manner of first data and second data corresponding to an information recommendation method according to an embodiment of the present disclosure. As shown in fig. 7, when new data exists, the new data is stored in the header of the old data set, the new data/the first data is new_1 … … new_n, the old data/the second data is old_1, old_2, old_3, old_4 … …, the first storage area and the second storage area may belong to the same database, and when numbering is performed, the numbering may be performed sequentially from the first storage area according to a preset numbering rule (for example, numbering according to hexadecimal). When the data is stored specifically, the first data is stored in the first area, the second data is stored in the second area, and the first area is different from the second area, so that the priority order of the old data is not destroyed after the newly added data is inserted into the on-line database.
Specifically, according to the generation time of the first data, the acquired data are sequentially stored in the first storage area according to the sequence from the early to the late of the generation time, and when in storage, the first piece of data can be correspondingly stored in the first storage address starting to be stored in the first storage area, and the data generation time and the number of the storage position are correspondingly stored. The storage sequence may be opposite to the number sequence, or may be the same as the number sequence, and the number corresponding to the first storage address that starts to be stored in the first storage area may be new_1 in fig. 6, or may be new_n, for example: data 1 is stored in a first memory location in the first memory area at early and late times, and data 2-4 is stored in a corresponding location in the first memory area in a manner that the address number in the first memory area is decremented. Such as: the address number of the storage location in the first storage area is address 1 … … address n, and at this time, data 1 is stored at address n and data n is stored at address 1. The data 2-n may also be stored in the first memory area at corresponding locations in the first memory area in an incremental manner with respect to the address number in the first memory area. Such as: the address number of the storage location in the first storage area is address 1 … … address n, and at this time, data 1 is stored at address 1 and data n is stored at address n.
The storing the second data with the generation time earlier than the preset time to the corresponding storage address in the second storage area according to the preset ordering sequence and the address number in sequence may specifically include:
determining a second storage address in the second storage area for storing initial data;
determining a priority order of the second data;
and sequentially storing the second data to the corresponding storage addresses in the second storage area according to the priority order, wherein the storage address of one address number in the second storage area corresponds to one piece of second data, the data with the highest priority in the second data is stored to the second storage address, and the second storage address is adjacent to the first storage address.
Sequencing the second data according to a preset scoring system to obtain a priority order corresponding to the updated data;
and sequentially storing the update data into the second storage area according to the priority order corresponding to the update data.
With the above example, each storage location in the second storage area also has a corresponding address number, and when storing the second data, the ordered data is sequentially stored in the second storage area, for example: the storage locations in the second storage area are numbered address 1, address 2, address 3, address 4, address 5, address 6, data old_1 is stored at address 1, data old_2 is stored at address 2, data old_3 is stored at address 3, and data old_4 is stored at address 4.
When the data is stored specifically, the ordered data is stored according to a certain storage rule, and the data may be sequentially stored in a continuous storage position or may be stored in a discontinuous storage position, for example: in the above example, data old_1 may be stored at address 1, data old_2 may be stored at address 3, data old_3 may be stored at address 5, and data old_4 may be stored at address 7.
In addition, there is another embodiment in which the first data is stored: the storage may be performed based on a real storage location in the second storage area, and the specific method may include:
address numbering is carried out on storage positions in the storage space;
dividing the numbered storage space into a first storage area and a second storage area;
determining an address number corresponding to a starting storage position in the second storage area;
and taking the address number corresponding to the initial storage position as a reference, and sequentially storing the first data to the front of the address number corresponding to the initial storage position according to the time sequence.
Such as: the storage space is divided into two storage areas, wherein the storage position numbers in the storage space are sequentially address 1, address 2, address 3 and … … address n, the storage position address in the first storage area is address 1-address 100, and the storage position address in the second storage area is address 101-address n. In the specific storage, the address number corresponding to the initial storage position in the second storage area is determined to be address 101, and assuming that the first data is data 1-10, data 1 can be stored to address 100, data 2 can be stored to address 99, and data 10 can be stored to address 91 before data 1-10 is stored to address 101 based on address 101. It should be emphasized that the first data still only need to be stored in the first storage area according to a certain storage rule when being stored.
In a practical application scenario, the internet generates a lot of information content every day, so that the data in the second storage area needs to be updated periodically, and can also be updated conditionally, for example: the content is set to be updated every day in the early morning at a ratio of 00:00, or the content is updated according to the click rate heat, and the content is updated when the heat of certain information reaches a preset threshold value. Specifically, after the information recommendation is performed on the terminal according to the data in the third data set, the method may further include:
determining a first generation time of each second data in the second storage area;
determining the duration of the earliest time in the first generation time from the current moment;
and updating the data in the second storage area when the duration satisfies the data updating period.
The updating the data in the second storage area may specifically include:
acquiring update data generated in a time period corresponding to the second generation time; the start time in the second generation time is later than the generation time of the second data;
sorting the update data according to a preset scoring system to obtain the sorted update data;
Reading a preset number of update data which are ranked in front from the ranked update data;
and sequentially storing the update data into the second storage area according to the priority order corresponding to the preset number of update data.
When updating, determining the duration of the earliest time in the first generation time from the current moment by taking the time corresponding to the earliest generation time in the first data as a basis; when the duration meets the data updating period, acquiring the updating data generated in the time period corresponding to the second generation time; sorting the update data according to a preset scoring system to obtain the sorted update data; reading a preset number of update data which are ranked in front from the ranked update data; and sequentially storing the update data into the second storage area according to the priority order corresponding to the preset number of update data.
Such as: among the generation times of the first data, the earliest generation time is: 00:01, the duration from the current time is 24 hours, and the updating condition is met, at this time, the data generated after the next day 00:01 can be acquired, and the data are ordered according to the time sequence, the grading high and low and the like, and then the data are stored in the second storage area.
By the method, the data in the second storage area is updated according to the data generation time, so that the timeliness of the data in the second storage area can be ensured to be stronger, and the recommending effect is more timely and accurate.
Based on the same thought, the embodiment of the specification also provides a device corresponding to the method. Fig. 8 is a schematic structural diagram of an information recommendation device corresponding to fig. 3 according to an embodiment of the present disclosure. As shown in fig. 8, the apparatus may include:
an information recommendation request acquiring module 801, configured to acquire a first information recommendation request sent by a terminal;
a first data reading module 802, configured to read first data from a first storage area according to the first information recommendation request, to obtain a first data set, where the first storage area is a preset area for storing data with a generation time later than a preset time;
a determining module 803, configured to determine whether the total number of data in the first data set meets a preset threshold, to obtain a first determination result;
a second data reading module 804, configured to read second data from a second storage area according to the first information recommendation request when the first determination result indicates that the total number of data in the first data set does not meet the preset threshold, so as to obtain a second data set; the second storage area is a preset area for storing data with generation time earlier than the preset time; the second storage area is different from the first storage area;
A third data set determining module 805, configured to obtain a third data set according to the first data set and the second data set; the total number of data in the third data set meets the preset threshold;
and the information recommending module 806 is configured to recommend information to the terminal according to the data in the third data set.
Optionally, the device may further be configured to:
and when the first judging result indicates that the total quantity of the data in the first data set meets the preset threshold, recommending information to the terminal according to the data in the first data set.
Optionally, the first data reading module 802 may specifically include:
a first storage address determination unit configured to determine a first storage address for storing initial data in the first storage area;
a first data reading unit, configured to sequentially read, from the first storage address, first data stored in each storage address in the first storage area according to a first reading sequence set in advance; when the first data in the first storage area are stored, the first data are stored according to a preset first storage sequence, and the first storage sequence is the same as the first reading sequence.
Optionally, the first data reading unit may specifically be configured to:
creating a first cursor, the first cursor pointing to the first storage address;
determining address numbers corresponding to all storage addresses in the first storage area;
and moving the first cursor to sequentially read the first data stored in each storage address in the first storage area according to the address numbers corresponding to the storage addresses in the first storage area.
Optionally, the third data set determining module 805 may specifically be configured to:
placing all data in the first data set into a third data set;
and reading a first number of pieces of data from the second data set, putting the first number of pieces of data into the third data set, wherein the sum of the first number of pieces of data and the total number of data in the first data set is equal to the preset threshold value, and the total number of data in the second data set is greater than or equal to the first number of pieces.
Optionally, the second data reading module 804 may specifically include:
a second storage address determination unit configured to determine a second storage address for storing initial data in the second storage area;
A second data reading unit, configured to sequentially read, from the second storage addresses, second data stored in each storage address in the second storage area according to a second reading order set in advance; and when the second data in the second storage area are stored, storing the second data according to a preset second storage sequence, wherein the second storage sequence is the same as the second reading sequence.
Optionally, the second data reading unit may specifically be configured to:
creating a second cursor, the second cursor pointing to the second storage address;
determining address numbers corresponding to all storage addresses in the second storage area;
and moving the second cursor to sequentially read second data stored in each storage address in the second storage area according to the address numbers corresponding to the storage addresses in the second storage area.
Optionally, the apparatus may further include:
determining address numbers corresponding to all storage addresses in the first storage area and the second storage area;
sequentially storing first data with the generation time later than the preset time on a corresponding storage address in the first storage area according to the sequence of the generation time and the address number;
And storing the second data with the generation time earlier than the preset time to the corresponding storage address in the second storage area according to the preset ordering sequence and the address number.
Optionally, the device may be specifically configured to:
determining a first storage address in the first storage area for storing initial data;
and sequentially storing the first data to the corresponding storage addresses in the first storage area according to the sequence of the generation time, wherein one address number storage address in the first storage area corresponds to one piece of first data, and the data with the earliest generation time in the first data is stored in the first storage address.
Optionally, the device is specifically configured to:
determining a second storage address in the second storage area for storing initial data;
determining a priority order of the second data;
and sequentially storing the second data to the corresponding storage addresses in the second storage area according to the priority order, wherein the storage address of one address number in the second storage area corresponds to one piece of second data, the data with the highest priority in the second data is stored to the second storage address, and the second storage address is adjacent to the first storage address.
Optionally, the apparatus may further include:
a first generation time determining module configured to determine a first generation time of each second data in the second storage area;
the duration determining module is used for determining the duration of the earliest time in the first generation time from the current moment;
and the updating module is used for updating the data in the second storage area when the duration meets the data updating period.
Optionally, the updating module may specifically include:
the updating data acquisition unit is used for acquiring the updating data generated in the time period corresponding to the second generation time; the start time in the second generation time is later than the generation time of the second data;
the sorting unit is used for sorting the update data according to a preset scoring system to obtain the sorted update data;
the updating data determining unit is used for reading a preset number of updating data which are ranked in front from the ranked updating data;
and the updating unit is used for sequentially storing the update data into the second storage area according to the priority order corresponding to the preset number of update data.
Optionally, the apparatus may further include:
the second information recommendation request acquisition module is used for acquiring a second information recommendation request sent by the terminal;
a first address number determining module, configured to determine a first address number corresponding to a last data in the first number of data;
the data reading module is used for taking the first address number as a reference, moving the second cursor according to the second information recommendation request, and sequentially reading data, the number of which meets the preset threshold value, from the next storage position of the storage positions corresponding to the first address number according to a preset reading sequence;
recommending the data with the quantity meeting the preset threshold value to the terminal.
Optionally, the data reading module may be specifically configured to:
moving the second cursor to sequentially read a second number of pieces of data from the second storage area until the last stored data in the second storage area is read;
judging whether the second number of pieces of data meets the preset threshold value or not to obtain a second judging result;
when the second judgment result indicates that the second number of pieces of data meets the preset threshold, information recommendation is conducted on the terminal according to the second number of pieces of data;
And when the second judgment result indicates that the second number of pieces of data does not meet the preset threshold, continuing to move the second cursor to sequentially read a third number of pieces of data from the first storage area according to a preset third reading sequence, recommending information to the terminal according to the third number of pieces of data and the second number of pieces of data, wherein the sum of the total number of data of the third number of pieces of data and the total number of data of the second number of pieces of data is equal to the preset threshold, and the third reading sequence is opposite to the first reading sequence.
Based on the same thought, the embodiment of the specification also provides equipment corresponding to the method.
Fig. 9 is a schematic structural view of an information recommendation apparatus corresponding to fig. 3 according to an embodiment of the present disclosure. As shown in fig. 9, the apparatus 900 may include:
at least one processor 910; the method comprises the steps of,
a memory 930 communicatively coupled to the at least one processor; wherein, the liquid crystal display device comprises a liquid crystal display device,
the memory 930 stores instructions 920 executable by the at least one processor 910 to enable the at least one processor 910 to:
acquiring a first information recommendation request sent by a terminal;
Reading first data from a first storage area according to the first information recommendation request to obtain a first data set, wherein the first storage area is a preset area for storing data with generation time later than a preset moment;
judging whether the total quantity of data in the first data set meets a preset threshold value or not to obtain a first judging result;
when the first judgment result indicates that the total quantity of the data in the first data set does not meet the preset threshold value, reading second data from a second storage area according to the first information recommendation request to obtain a second data set; the second storage area is a preset area for storing data with generation time earlier than the preset time; the second storage area is different from the first storage area;
obtaining a third data set according to the first data set and the second data set; the total number of data in the third data set meets the preset threshold;
and recommending information to the terminal according to the data in the third data set.
In the 90 s of the 20 th century, improvements to one technology could clearly be distinguished as improvements in hardware (e.g., improvements to circuit structures such as diodes, transistors, switches, etc.) or software (improvements to the process flow). However, with the development of technology, many improvements of the current method flows can be regarded as direct improvements of hardware circuit structures. Designers almost always obtain corresponding hardware circuit structures by programming improved method flows into hardware circuits. Therefore, an improvement of a method flow cannot be said to be realized by a hardware entity module. For example, a programmable logic device (Programmable Logic Device, PLD) (e.g., field programmable gate array (Field Programmable Gate Array, FPGA)) is an integrated circuit whose logic function is determined by the programming of the device by a user. A designer programs to "integrate" a digital system onto a PLD without requiring the chip manufacturer to design and fabricate application-specific integrated circuit chips. Moreover, nowadays, instead of manually manufacturing integrated circuit chips, such programming is mostly implemented by using "logic compiler" software, which is similar to the software compiler used in program development and writing, and the original code before the compiling is also written in a specific programming language, which is called hardware description language (Hardware Description Language, HDL), but not just one of the hdds, but a plurality of kinds, such as ABEL (Advanced Boolean Expression Language), AHDL (Altera Hardware Description Language), confluence, CUPL (Cornell University Programming Language), HDCal, JHDL (Java Hardware Description Language), lava, lola, myHDL, PALASM, RHDL (Ruby Hardware Description Language), etc., VHDL (Very-High-Speed Integrated Circuit Hardware Description Language) and Verilog are currently most commonly used. It will also be apparent to those skilled in the art that a hardware circuit implementing the logic method flow can be readily obtained by merely slightly programming the method flow into an integrated circuit using several of the hardware description languages described above.
The controller may be implemented in any suitable manner, for example, the controller may take the form of, for example, a microprocessor or processor and a computer readable medium storing computer readable program code (e.g., software or firmware) executable by the (micro) processor, logic gates, switches, application specific integrated circuits (Application Specific Integrated Circuit, ASIC), programmable logic controllers, and embedded microcontrollers, examples of which include, but are not limited to, the following microcontrollers: ARC 625D, atmel AT91SAM, microchip PIC18F26K20, and Silicone Labs C8051F320, the memory controller may also be implemented as part of the control logic of the memory. Those skilled in the art will also appreciate that, in addition to implementing the controller in a pure computer readable program code, it is well possible to implement the same functionality by logically programming the method steps such that the controller is in the form of logic gates, switches, application specific integrated circuits, programmable logic controllers, embedded microcontrollers, etc. Such a controller may thus be regarded as a kind of hardware component, and means for performing various functions included therein may also be regarded as structures within the hardware component. Or even means for achieving the various functions may be regarded as either software modules implementing the methods or structures within hardware components.
The system, apparatus, module or unit set forth in the above embodiments may be implemented in particular by a computer chip or entity, or by a product having a certain function. One typical implementation is a computer. In particular, the computer may be, for example, a personal computer, a laptop computer, a cellular telephone, a camera phone, a smart phone, a personal digital assistant, a media player, a navigation device, an email device, a game console, a tablet computer, a wearable device, or a combination of any of these devices.
For convenience of description, the above devices are described as being functionally divided into various units, respectively. Of course, the functions of each element may be implemented in one or more software and/or hardware elements when implemented in the present application.
It will be appreciated by those skilled in the art that embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
In one typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include volatile memory in a computer-readable medium, random Access Memory (RAM) and/or nonvolatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). Memory is an example of computer-readable media.
Computer readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of storage media for a computer include, but are not limited to, phase change memory (PRAM), static Random Access Memory (SRAM), dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), read Only Memory (ROM), electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium, which can be used to store information that can be accessed by a computing device. Computer-readable media, as defined herein, does not include transitory computer-readable media (transmission media), such as modulated data signals and carrier waves.
It should also be noted that 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 one … …" does not exclude the presence of other like elements in a process, method, article or apparatus that comprises the element.
The application may be described in the general context of computer-executable instructions, such as program modules, being executed by a computer. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform particular tasks or implement particular abstract data types. The application may also be practiced in distributed computing environments where tasks are performed by remote processing devices that are linked through a communications network. In a distributed computing environment, program modules may be located in both local and remote computer storage media including memory storage devices.
In this specification, each embodiment is described in a progressive manner, and identical and similar parts of each embodiment are all referred to each other, and each embodiment mainly describes differences from other embodiments. In particular, for system embodiments, since they are substantially similar to method embodiments, the description is relatively simple, as relevant to see a section of the description of method embodiments.
The foregoing is merely exemplary of the present application and is not intended to limit the present application. Various modifications and changes may be made to the present application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc. which are within the spirit and principles of the present application are intended to be included within the scope of the claims of the present application.

Claims (17)

1. An information recommendation method, comprising:
acquiring a first information recommendation request sent by a terminal;
reading first data from a first storage area according to the first information recommendation request to obtain a first data set, wherein the first storage area is a preset area for storing data with generation time later than a preset moment; the first data are generated into new data with time later than the preset time;
Judging whether the total quantity of data in the first data set meets a preset threshold value or not to obtain a first judging result;
when the first judgment result indicates that the total quantity of the data in the first data set does not meet the preset threshold value, reading second data from a second storage area according to the first information recommendation request to obtain a second data set; the second storage area is a preset area for storing data with generation time earlier than the preset time; the second storage area is different from the first storage area;
obtaining a third data set according to the first data set and the second data set; the total number of data in the third data set meets the preset threshold;
and recommending information to the terminal according to the data in the third data set.
2. The method of claim 1, further comprising, after the obtaining the first determination result:
and when the first judging result indicates that the total quantity of the data in the first data set meets the preset threshold, recommending information to the terminal according to the data in the first data set.
3. The method of claim 1, wherein the reading the first data from the first storage area according to the first information recommendation request specifically includes:
determining a first storage address in the first storage area for storing initial data;
sequentially reading first data stored in each storage address in the first storage area from the first storage address according to a preset first reading sequence; when the first data in the first storage area are stored, the first data are stored according to a preset first storage sequence, and the first storage sequence is the same as the first reading sequence.
4. The method as claimed in claim 3, wherein the sequentially reading the first data stored in each storage address in the first storage area according to a preset first reading sequence, specifically includes:
creating a first cursor, the first cursor pointing to the first storage address;
determining address numbers corresponding to all storage addresses in the first storage area;
and moving the first cursor to sequentially read the first data stored in each storage address in the first storage area according to the address numbers corresponding to the storage addresses in the first storage area.
5. The method of claim 1, wherein the obtaining a third data set according to the first data set and the second data set specifically includes:
placing all data in the first data set into a third data set;
and reading a first number of pieces of data from the second data set, putting the first number of pieces of data into the third data set, wherein the sum of the first number of pieces of data and the total number of data in the first data set is equal to the preset threshold value, and the total number of data in the second data set is greater than or equal to the first number of pieces.
6. The method of claim 1, wherein the reading the second data from the second storage area according to the first information recommendation request specifically includes:
determining a second storage address in the second storage area for storing initial data;
sequentially reading second data stored in each storage address in the second storage area according to a preset second reading sequence from the second storage address; and when the second data in the second storage area are stored, storing the second data according to a preset second storage sequence, wherein the second storage sequence is the same as the second reading sequence.
7. The method as claimed in claim 6, wherein the sequentially reading the second data stored in each storage address in the second storage area according to a second preset reading sequence, specifically includes:
creating a second cursor, the second cursor pointing to the second storage address;
determining address numbers corresponding to all storage addresses in the second storage area;
and moving the second cursor to sequentially read second data stored in each storage address in the second storage area according to the address numbers corresponding to the storage addresses in the second storage area.
8. The method of claim 1, further comprising, prior to the requesting the first data from the first storage area based on the first information recommendation:
determining address numbers corresponding to all storage addresses in the first storage area and the second storage area;
sequentially storing first data with the generation time later than the preset time on a corresponding storage address in the first storage area according to the sequence of the generation time and the address number;
and storing the second data with the generation time earlier than the preset time to the corresponding storage address in the second storage area according to the preset ordering sequence and the address number.
9. The method of claim 8, wherein the storing the data with the generation time later than the preset time in the corresponding storage addresses in the first storage area according to the sequence of the generation time and the address number comprises:
determining a first storage address in the first storage area for storing initial data;
and sequentially storing the first data to the corresponding storage addresses in the first storage area according to the sequence of the generation time, wherein one address number storage address in the first storage area corresponds to one piece of first data, and the data with the earliest generation time in the first data is stored in the first storage address.
10. The method of claim 8, wherein the sequentially storing the second data generated at a time earlier than the preset time to the corresponding storage addresses in the second storage area according to the preset sorting order and the address numbers specifically includes:
determining a second storage address in the second storage area for storing initial data;
determining a priority order of the second data;
and sequentially storing the second data to the corresponding storage addresses in the second storage area according to the priority order, wherein the storage address of one address number in the second storage area corresponds to one piece of second data, the data with the highest priority in the second data is stored to the second storage address, and the second storage address is adjacent to the first storage address.
11. The method of claim 1, further comprising, after the information recommendation is performed on the terminal according to the data in the third data set:
determining a first generation time of each second data in the second storage area;
determining the duration of the earliest time in the first generation time from the current moment;
and updating the data in the second storage area when the duration satisfies the data updating period.
12. The method of claim 11, wherein the updating the data in the second storage area specifically includes:
acquiring update data generated in a time period corresponding to the second generation time; the start time in the second generation time is later than the generation time of the second data;
sorting the update data according to a preset scoring system to obtain the sorted update data;
reading a preset number of update data which are ranked in front from the ranked update data;
and sequentially storing the update data into the second storage area according to the priority order corresponding to the preset number of update data.
13. The method of claim 7, further comprising, after the information recommendation is performed on the terminal according to the data in the third data set:
Acquiring a second information recommendation request sent by the terminal;
determining a first address number corresponding to the last data in the first number of data; the sum of the first number of pieces of data and the total number of all data in the first data set is equal to the preset threshold value, and the total number of data in the second data set is greater than or equal to the first number of pieces;
taking the first address number as a reference, and according to the second information recommendation request, moving the second cursor to sequentially read data, the quantity of which meets the preset threshold value, from the next storage position of the storage position corresponding to the first address number according to a preset reading sequence;
recommending the data with the quantity meeting the preset threshold value to the terminal.
14. The method of claim 13, wherein the moving the second cursor sequentially reads, from a next storage location of the storage locations corresponding to the first address number, data whose number meets the preset threshold according to a preset reading order, specifically includes:
moving the second cursor to sequentially read a second number of pieces of data from the second storage area until the last stored data in the second storage area is read;
Judging whether the second number of pieces of data meets the preset threshold value or not to obtain a second judging result;
when the second judgment result indicates that the second number of pieces of data meets the preset threshold, information recommendation is conducted on the terminal according to the second number of pieces of data;
when the second judgment result indicates that the second number of pieces of data does not meet the preset threshold, continuing to move the second cursor to sequentially read a third number of pieces of data from the first storage area according to a preset third reading sequence, recommending information to the terminal according to the third number of pieces of data and the second number of pieces of data, wherein the sum of the total number of data of the third number of pieces of data and the total number of data of the second number of pieces of data is equal to the preset threshold, and the third reading sequence is opposite to the first reading sequence; the first reading order is a data reading order preset for sequentially reading the first data stored at each storage address in the first storage area.
15. An information recommendation apparatus, comprising:
the information recommendation request acquisition module is used for acquiring a first information recommendation request sent by the terminal;
The first data reading module is used for reading first data from a first storage area according to the first information recommendation request to obtain a first data set, and the first storage area is a preset area for storing data with generation time later than a preset time; the first data are generated into new data with time later than the preset time;
the judging module is used for judging whether the total quantity of the data in the first data set meets a preset threshold value or not to obtain a first judging result;
the second data reading module is used for reading second data from a second storage area according to the first information recommendation request to obtain a second data set when the first judgment result indicates that the total quantity of data in the first data set does not meet the preset threshold value; the second storage area is a preset area for storing data with generation time earlier than the preset time; the second storage area is different from the first storage area;
the third data set determining module is used for obtaining a third data set according to the first data set and the second data set; the total number of data in the third data set meets the preset threshold;
And the information recommending module is used for recommending information to the terminal according to the data in the third data set.
16. An information recommendation device, comprising:
at least one processor; the method comprises the steps of,
a memory communicatively coupled to the at least one processor; wherein, the liquid crystal display device comprises a liquid crystal display device,
the memory stores instructions executable by the at least one processor to enable the at least one processor to:
acquiring a first information recommendation request sent by a terminal;
reading first data from a first storage area according to the first information recommendation request to obtain a first data set, wherein the first storage area is a preset area for storing data with generation time later than a preset moment; the first data are generated into new data with time later than the preset time;
judging whether the total quantity of data in the first data set meets a preset threshold value or not to obtain a first judging result;
when the first judgment result indicates that the total quantity of the data in the first data set does not meet the preset threshold value, reading second data from a second storage area according to the first information recommendation request to obtain a second data set; the second storage area is a preset area for storing data with generation time earlier than the preset time; the second storage area is different from the first storage area;
Obtaining a third data set according to the first data set and the second data set; the total number of data in the third data set meets the preset threshold;
and recommending information to the terminal according to the data in the third data set.
17. A computer readable medium having stored thereon computer readable instructions executable by a processor to implement the information recommendation method of any one of claims 1 to 14.
CN201910896892.0A 2019-09-23 2019-09-23 Information recommendation method, device and equipment Active CN110647685B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910896892.0A CN110647685B (en) 2019-09-23 2019-09-23 Information recommendation method, device and equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910896892.0A CN110647685B (en) 2019-09-23 2019-09-23 Information recommendation method, device and equipment

Publications (2)

Publication Number Publication Date
CN110647685A CN110647685A (en) 2020-01-03
CN110647685B true CN110647685B (en) 2023-07-28

Family

ID=68992330

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910896892.0A Active CN110647685B (en) 2019-09-23 2019-09-23 Information recommendation method, device and equipment

Country Status (1)

Country Link
CN (1) CN110647685B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111427540A (en) * 2020-03-24 2020-07-17 北京奇艺世纪科技有限公司 Random number generation method and device, electronic equipment and storage medium
CN111459667B (en) * 2020-03-27 2024-01-05 深圳市梦网科技发展有限公司 Data processing method, device, server and medium
CN113518097A (en) * 2020-04-09 2021-10-19 北京意锐新创科技有限公司 Transaction data pushing method and device

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108874831A (en) * 2017-05-12 2018-11-23 阿里巴巴集团控股有限公司 A kind of information recommendation method and device
CN114202370A (en) * 2018-03-07 2022-03-18 创新先进技术有限公司 Information recommendation method and device
CN110110229B (en) * 2019-04-25 2021-06-04 深圳前海微众银行股份有限公司 Information recommendation method and device

Also Published As

Publication number Publication date
CN110647685A (en) 2020-01-03

Similar Documents

Publication Publication Date Title
TWI738902B (en) Display of business objects, processing method of map data, client and server
CN110647685B (en) Information recommendation method, device and equipment
US9483475B2 (en) Content recommendation method
US8812988B2 (en) Dynamic icons associated with remote content
US8756516B2 (en) Methods, systems, and computer program products for interacting simultaneously with multiple application programs
US20200221185A1 (en) Method for pushing video information, apparatus, device and storage medium
CN108848244B (en) Page display method and device
US10007711B2 (en) Data rendering optimization
WO2017215175A1 (en) Page processing method and device, terminal, and server
CN109766457B (en) Media content searching method, device and storage medium
CN109144649A (en) Display methods, device, terminal and the storage medium of icon
US20150347615A1 (en) Active Web Page Consolidator and Internet History Management System
CN105824830B (en) Method, client and equipment for displaying page
CN109828811B (en) Card object display method and device
WO2016014100A1 (en) Matrix interface for enabling access to digital content
CN109388737B (en) Method and device for sending exposure data of content item and storage medium
CN111191132B (en) Information recommendation method and device and electronic equipment
CN109116718B (en) Method and device for setting alarm clock
CN113779416A (en) Information recommendation method and device, electronic equipment and computer-readable storage medium
CN108737850B (en) Video recommendation method, server and client
CN111459686A (en) Queue message storing and forwarding method and system and computer device with operating system
US11106277B2 (en) Cartoon statistical reading data method and apparatus
CN114143590A (en) Video playing method, server and storage medium
CN108428189B (en) Social resource processing method and device and readable medium
US20120198326A1 (en) Method and apparatus for web browsing of handheld device

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
TA01 Transfer of patent application right
TA01 Transfer of patent application right

Effective date of registration: 20201012

Address after: Cayman Enterprise Centre, 27 Hospital Road, George Town, Grand Cayman Islands

Applicant after: Advanced innovation technology Co.,Ltd.

Address before: A four-storey 847 mailbox in Grand Cayman Capital Building, British Cayman Islands

Applicant before: Alibaba Group Holding Ltd.

Effective date of registration: 20201012

Address after: Cayman Enterprise Centre, 27 Hospital Road, George Town, Grand Cayman Islands

Applicant after: Innovative advanced technology Co.,Ltd.

Address before: Cayman Enterprise Centre, 27 Hospital Road, George Town, Grand Cayman Islands

Applicant before: Advanced innovation technology Co.,Ltd.

GR01 Patent grant
GR01 Patent grant