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

Information recommendation method, device and equipment Download PDF

Info

Publication number
CN110647685A
CN110647685A CN201910896892.0A CN201910896892A CN110647685A CN 110647685 A CN110647685 A CN 110647685A CN 201910896892 A CN201910896892 A CN 201910896892A CN 110647685 A CN110647685 A CN 110647685A
Authority
CN
China
Prior art keywords
data
storage area
storage
address
preset
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.)
Granted
Application number
CN201910896892.0A
Other languages
Chinese (zh)
Other versions
CN110647685B (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
Alibaba Group Holding 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 Alibaba Group Holding Ltd filed Critical Alibaba Group Holding 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

Images

Classifications

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

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 a first storage area according to a first information recommendation request to obtain a first data set; judging whether the total amount of data in the first data set meets a preset threshold value or not to obtain a first judgment result; when the first judgment result shows that the total amount 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; obtaining a third data set according to the first data set and the second data set; the total amount 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 application 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 the latest information every day through the internet. The system or the server may recommend or recommend some information for the user, such as: the filtered 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 services (e.g., online news application, friend-making software, mobile phone-on-demand service, web novel reading service, etc.), the variety of media contents (e.g., audio, video, news, information, web novel, etc.) is increasing, and how to recommend the latest and high-quality related contents to the user 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 set according to data generation time (from new to old) to form a recommendation list, and puts the recommendation list on a line for recommendation according to the sort; and when new data appears, inserting the new data into the next position of the current recommended position to ensure that the newly added data is preferentially recommended. However, in an actual application value, because 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 circular recommendation is performed according to the list again.
Disclosure of Invention
In view of this, embodiments of the present application provide an information recommendation method, apparatus, and device, which are used to preferentially recommend the latest information, and ensure accuracy of information recommendation results without destroying the priority order of the original data.
In order to solve the above technical problem, the embodiments of the present specification are implemented as follows:
an information recommendation method provided in an 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 of which the generation time is later than a preset time;
judging whether the total amount of the data in the first data set meets a preset threshold value or not to obtain a first judgment result;
when the first judgment result shows that the total amount 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 the 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 amount of data in the third set of data 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 specification includes:
the information recommendation request acquisition module is used for acquiring a first information recommendation request sent by a 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, wherein the first storage area is a preset area for storing data of which the generation time is later than a preset time;
the judging module is used for judging whether the total amount 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 shows that the total amount of the data in the first data set does not meet the preset threshold; the second storage area is a preset area for storing data with the generation time earlier than the preset time; the second storage area is different from the first storage area;
a third data set determining module, configured to obtain a third data set according to the first data set and the second data set; the total amount of data in the third set of data meets the preset threshold;
and the information recommendation 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; and the number of the first and second groups,
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
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 of which the generation time is later than a preset time;
judging whether the total amount of the data in the first data set meets a preset threshold value or not to obtain a first judgment result;
when the first judgment result shows that the total amount 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 the 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 amount of data in the third set of data meets the preset threshold;
and recommending information to the terminal according to the data in the third data set.
Embodiments of the present specification provide a computer-readable medium having stored thereon computer-readable instructions executable by a processor to implement an information recommendation method.
The embodiment of the specification adopts at least one technical scheme which can achieve the following beneficial effects: the method comprises the steps of obtaining a first information recommendation request sent by a terminal; first data with the generation time later than a preset time are read from a first storage area according to a first information recommendation request to obtain a first data set, and second data with the generation time earlier than the preset time are read from a second storage area according to the first information recommendation request to obtain a second data set when the total amount of the data in the first data set does not meet a preset threshold; and obtaining a third data set with the total data quantity meeting a preset threshold value according to the first data set and the second data set, and recommending information to the terminal according to data in the third data set, wherein the priority sequence of the original second data is not damaged, the recommendation results to other users are not influenced, and the accuracy of the information recommendation result is ensured under the condition that the first data with higher timeliness is preferentially recommended when information recommendation is performed to the user terminal.
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 embodiment(s) of the application and together with the description serve to explain the application and not to limit the application. In the drawings:
FIG. 1 is a diagram illustrating a data structure storage method used in an information recommendation method in the prior art;
fig. 2 is a schematic view of a scene of information recommendation according to an embodiment of the present disclosure;
fig. 3 is a schematic flowchart of an information recommendation method provided in an embodiment of the present specification;
fig. 4 is a schematic diagram of a first data reading method corresponding to an information recommendation method provided in an embodiment of the present specification;
fig. 5 is a schematic diagram illustrating a method for cyclically 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 provided in an embodiment of the present specification;
fig. 7 is a schematic diagram illustrating a storage manner of first data and second data corresponding to an information recommendation method provided in an embodiment of the present specification;
fig. 8 is a schematic structural diagram of an information recommendation device corresponding to fig. 3 provided in an embodiment of the present disclosure;
fig. 9 is a schematic structural diagram of an information recommendation device corresponding to fig. 3 provided in an embodiment of this specification.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the technical solutions of the present application will be described in detail and completely with reference to the following specific embodiments of the present application and the accompanying drawings. It should be apparent that the described embodiments are only some of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
The technical solutions provided by the embodiments of the present application are described in detail below with reference to the accompanying drawings.
With the development of the internet, information recommendation or recommendation scenes using the internet are more and more common, for example: web content recommendations, video recommendations, news recommendations, and the like. When information recommendation is performed, a system usually calculates a data set offline, scores data in the calculated data set according to a scoring rule to obtain a priority order, and then puts the ordered data set on a line to recommend the ordered data set to a terminal user according to the priority order. In practical application, however, when online information is recommended or recommended, besides data which is well calculated off-line, some new data can be generated, and when recommendation is performed, a user hopes to see content which is faster in timeliness and higher in quality; therefore, if new high-quality content is found, the new high-quality content should be pushed preferentially; when there is no new content, the data in the ordered data set may be recommended according to the popularity or other score of the content.
In the prior art, in order to meet the above requirements, recommendation is made in the manner shown in fig. 1:
fig. 1 is a schematic diagram of a data structure storage manner used in an information recommendation method in the prior art, and as shown in fig. 1, a newly added element or data (data 11) is directly inserted into the next of a current reading (data 2) to realize preferential display of the newly added element or data. However, in order to save storage space, multiple users may share one 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 recommending information to another user, a recommendation order is disturbed, that is, the new element destroys an original data order and a score ordering system, and when cycling again (when recommending content to another user), a data priority is wrong, for example: when the user a reads the second position, the newly added element is inserted into the next position (the 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 information is recommended for the user B, the ordering of the recommendation list when the user B recommends is disturbed, and the order is: 1 → 2 → 11 → 3 → 4 → 5, which affects the recommendation result for the B user. In addition, when the unordered list is used for recommendation for multiple times, the recommended times of the newly added element data 11 are obviously higher than those of other newly added element data 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 defects in the prior art, the scheme 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 an online according to the information recommendation request, and 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 view. After receiving the request sent by the terminal 202, the server 201 how to take out the data to be recommended from the line is what the present solution needs to elaborate.
Fig. 3 is a schematic flowchart of an information recommendation method provided in an embodiment of the present specification. From a procedural perspective, the execution subject of the flow may be a server.
As shown in fig. 3, the process may include the following steps:
step 301: the method comprises the steps of obtaining a first information recommendation request sent by a 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 broadcast data service) or a cluster working mode.
A Terminal (Terminal), also called a Terminal device, 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 can be a mobile phone, a tablet computer, an intelligent television, a computer and the like used by a user, and can also be a large display device (such as a device with a large display screen in a live broadcast hall) in some practical application scenarios, which does not limit the 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 perform information recommendation for the terminal. For example: a textual content recommendation request, a video recommendation request, a web page recommendation request, a product recommendation request, 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 the generation time later than a preset time.
The storage space is divided into a first storage area and a second storage area according to preset time.
When data generated within a specified time range is stored, the data can be stored in two different storage areas according to time, the first storage area can be an area for storing data generated later than a preset time, and the first storage area can be understood as new data stored within 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. With the above example, the preset time is 12:00, and the data later than 12:00 is: data 1(13:00), data 2(13:30), data 3(14:00), and data 4(15:00), and these four data are stored as first data in the first storage area. The first data may be data whose generation time is later than a preset time, where it should be noted that the generation time of the first data is later than the preset time, and data whose generation time is later than the preset time and meets a preset condition may also be defined, for example: the first data may represent data in which a click rate generated later than a preset time is higher than a preset threshold. Here, the present solution does not limit this;
the first storage area may or may not store data: when there is no data whose generation time is later than the preset time, the data may not exist in the first storage area.
The second storage area may be an area for storing data whose generation time is earlier than a preset time, the second data in the second storage area may be data calculated offline, and a storage sequence of the second data in the storage area may be stored according to a sequence obtained by performing statistical processing on a preset scoring system.
The preset time may refer to a generation time of data whose generation time of data stored in the second storage area is calculated offline latest. 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 generated later than 15:00 in a set period (for example: one day) is stored in the first storage area as first data. In this embodiment, the preset time may generally indicate a generation time corresponding to the last data stored in the second storage area. With the foregoing example, the last data in the second storage area is D, and the corresponding data generation time is 15:00, in this case, 15:00 may be used as the preset time.
Therefore, after the server acquires the first information recommendation request sent by the terminal, first, the first data with the generation time later than the preset time is read from the first storage area.
Step 303: and judging whether the total amount of the data in the first data set meets a preset threshold value or not to obtain a first judgment result.
In the recommended scene, a service parameter of how many data are refreshed/pulled down each time; if the fetch is full, the fetch is complete. At this time, the service parameter of the data refreshed or pulled each time may be used as a preset threshold, for example: if the service parameter of the data refreshed or pulled each time is 5, the preset threshold may be considered as 5.
After the first data is read from the first data set, it is necessary to determine whether the total amount of the first data in the first data set satisfies a preset threshold, where the preset threshold may represent a preset amount of information recommended to the terminal each time, such as: and presetting 5 pieces of information recommended to the terminal each time, wherein the preset threshold value can be 5, and recommending the information corresponding to 5 pieces of data at the terminal every time 5 pieces of data are read.
Step 304: when the first judgment result shows that the total amount 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 the generation time earlier than the preset time; the second storage area is different from the first storage area.
When the total amount of the first data in the first data set does not satisfy the preset threshold (for example, the preset recommended amount each time is 5, and the total amount of the first data taken at this time is 3), the data needs to be continuously read, at this time, the data 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 click/browse heat, or scoring according to a preset scoring rule, and sorting according to the size of the score, where the scheme does not limit the sorting basis in the second storage area.
It should be noted that in the present solution, two different storage areas are used to store data of different time periods, the data before the preset time may also be called old data, and may be stored in the second storage area, and the data after the preset time may also be called new data, and may be stored in the first storage area. A storage area is understood to be a storage area/space for storing data, such as: databases, data tables, and the like. The first storage area and the second storage area may belong to the same database or different databases, but the first storage area and the second storage area belong to two different storage areas.
Step 305: obtaining a third data set according to the first data set and the second data set; the total amount of data in the third set of data satisfies the preset threshold.
And reading a set amount of data from the first data set and the second data set and putting the data 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 a terminal sending the information recommendation request.
The method in fig. 1 includes acquiring a first information recommendation request sent by a terminal; first data with the generation time later than a preset time are read from a first storage area according to a first information recommendation request to obtain a first data set, and second data with the generation time earlier than the preset time are read from a second storage area according to the first information recommendation request to obtain a second data set when the total amount of the data in the first data set does not meet a preset threshold; and obtaining a third data set with the total data quantity meeting a preset threshold value according to the first data set and the second data set, and recommending information to the terminal according to data in the third data set, wherein the priority sequence of the original second data is not damaged, the recommendation results to other users are not influenced, and the accuracy of the information recommendation result is ensured under the condition that the first data with higher timeliness is preferentially recommended when information recommendation is performed to the user terminal.
Based on the method of fig. 3, the embodiments of the present specification also provide some specific implementations of the method, which are described below.
In practical application, after acquiring the first information recommendation request sent by the terminal, the method may further include;
judging whether first data with the generation time later than a preset time exists in the first storage area according to the first information recommendation request;
if the first data set does not exist, directly taking second data from a second storage area to obtain a second data set;
and if so, taking out the first data from the first storage area according to the first reading sequence to obtain a first data set.
After obtaining the first determination result, the method may further include:
and when the first judgment result shows that the total amount 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 new data is enough, the number of new data may meet the preset threshold, and at this time, the old data does not need to be fetched, for example: the total amount of data in the first data set is 10, the preset threshold value is 5, at this time, five pieces of data can be directly taken out from the first data set in sequence, and information recommendation can be performed on the terminal. 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 actual situations.
In the specific data fetching process, 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 used for storing initial data in the first storage area;
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; and when storing, storing the first data in the first storage area according to a preset first storage sequence, wherein 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 storage convenience, the storage locations in the storage space may be numbered with byte addresses of the storage locations in hexadecimal, for example: its address numbers may range from 0000 to FFFF, with sequentiality.
When fetching data, first, a first storage address for storing initial data in a first storage area needs to be determined, and the first storage location is used as a starting location for reading data. The preset first reading order may indicate a first storing order of the first data. The preset first storage order may be a storage order according to a sequence of 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), where the data 1 with the earliest generation time is stored at the initial position, and then the data 2 to 4 are sequentially stored in chronological order, and the storage order of the first data may be expressed as: if the reading order of data 1, data 2, data 3, and data 4 is the same as the storage order, the reading order at the time of fetching is also data 1, data 2, data 3, and data 4. It should be noted that the reading order during fetching may be different from the storing order, and is set according to actual needs, and is not limited herein.
Specifically, when the first data is read, the reading the first data stored in each storage address in the first storage area sequentially according to a preset first reading order may specifically include:
creating a first cursor, the first cursor pointing to the first storage address;
determining an address number corresponding to each storage address 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 number corresponding to each storage address in the first storage area.
The cursor can be considered a representative bit on a queue or data set to indicate where data has been read, or can be understood as a pointer. The first cursor may be defined as the cursor used to fetch new data.
Each memory address in the memory area may be set with a corresponding address label, such as: numbering is done in hexadecimal or in decimal order.
After the first data (new data) is taken out from the first storage area, when the number of new data does not meet the recommended or recommended preset threshold, the second data (old data) may be continuously read from the second storage area, and when the second data is read, the reading of the second data from the second storage area according to the first information recommendation request may specifically include:
determining a second storage address used for storing initial data in the second storage area;
sequentially reading second data stored in each storage address in the second storage area from the second storage address according to a preset second reading sequence; and when storing, storing the second data in the second storage area 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 at each storage address in the second storage area according to a preset second reading order may specifically include:
creating a second cursor, the second cursor pointing to the second storage address;
determining an address number corresponding to each storage address in the second storage area;
and moving the second cursor to sequentially read the second data stored in each storage address in the second storage area according to the address number corresponding to each storage address in the second storage area.
It should be noted that the second cursor can be defined as a cursor for fetching the second data. When the data stored in each storage address in the storage area is read in sequence according to a preset reading sequence, the data may be read according to an increasing sequence of the address numbers, or may be read according to a decreasing sequence of the address numbers, and a reading rule may be set according to an actual situation, which is not limited in this scheme.
In order to better understand the method for extracting the first data and the second data, it can be additionally explained in conjunction with fig. 4:
fig. 4 is a schematic diagram of a first data reading method corresponding to an information recommendation method provided in an embodiment of the present specification. 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 region 401, the second data is stored in the second region 402, two cursors are created during the specific fetching, which are the first cursor new and the second cursor old, respectively, and data 1(new _1) is stored at the first storage address of the first storage region 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 number corresponding to each storage address in the first storage area. As shown in FIG. 4, the new cursor and old cursor take numbers in opposite directions. And in each time of fetching, new data is required to be fetched preferentially, the new cursor/pointer is moved upwards to fetch according to the address number until the new pointer is moved to the top, that is, the first data is completely fetched, if the number of the new cursor/pointer does not meet the preset threshold after the first data is completely fetched, the old pointer is moved downwards to fetch according to the address number in sequence at the moment.
Through the steps of the method, the first data and the second data are guaranteed to be stored in different storage areas, the first data are preferentially read when the data are fetched, then the second data are read according to the priority sequence, and under the condition that the first data with high timeliness are preferentially recommended when information is recommended to the user terminal, the original scoring system or the original ranking sequence of the second data is not damaged, and the recommendation results of other users are not influenced.
In an actual application scenario, the server may receive information recommendation requests of different users, and may also receive multiple requests sent by the same terminal. Such as: the user a requests to recommend a video in a certain video APP, and when viewing the video, refreshes, repeatedly clicks a recommendation button or pulls down, and at this time, every refreshing, clicking a related button or pulling down may be regarded as sending out a further information recommendation request, so that after performing information recommendation 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 piece of data in the first number of pieces of data;
taking the first address number as a reference, and moving the second cursor to sequentially read data of which the quantity 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 according to the second information recommendation request;
and recommending the data of which the number meets the preset threshold value to the terminal.
When the server receives a second information recommendation request, the position of the data read by the server at the last time needs to be determined, and then the data is continuously read at the last position for recommendation, so that the content which is just watched by the user can be prevented from being recommended to the user again.
Such as: when the server receives a first information recommendation request, sequentially selecting data from an online database as { data 1, data 2, data 3, data 4 and data 5}, determining that an address number corresponding to the last piece of data (data 5) is an address 5, and when the server receives a second information recommendation request, sequentially reading the data { data 6, data 7, data 8, data 9 and data 10} of which the quantity meets a preset threshold value from a next storage position address 6 of a storage position corresponding to the first address number (address 5) by moving a second cursor on the basis of the address number 5 corresponding to the data 5 according to a preset reading sequence.
Further, the moving the second cursor to sequentially read the data satisfying the preset threshold from the second address information backward 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 data item meets the preset threshold value or not to obtain a second judgment result;
when the second judgment result shows that the second number of pieces of data meet the preset threshold value, recommending information to the terminal according to the second number of pieces of data;
and when the second judgment result shows that the second number of pieces of data do 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, and 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 the third number of pieces of data and the total number 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 scene, when the system is just online or in a cold start state, because the content stored in the online database is relatively few, after the data stored in the online database is completely recommended to the user, a circular recommendation method may be adopted when no content is displayable on the user terminal due to no data, and a specific manner may be: moving a 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, at this time, determining whether the fetched data meets a recommended preset threshold, if so, directly recommending, and if not, continuing fetching data, for convenience of understanding, which can be described with reference to fig. 5 and 6:
fig. 5 is a schematic diagram of a method for reading data cyclically according to an information recommendation method provided in an embodiment of the present specification. As shown in fig. 5, the first cursor new has moved to the top, it can be considered that all the data in the first region has been fetched, the second cursor has moved to the bottom, it can be considered that all the data in the second storage region has also been fetched, at this time, if the total amount of the data read still does not satisfy the preset threshold, a circular recommendation method can be adopted, the first cursor new and the second cursor old can be reset to the top position of the queue, and the old cursor is moved downward to fetch according to the address number. For example: since the system is just on line, the data stored in the online database is less, the data stored in the first storage region includes data 1 and data 2, and the data stored in the second storage region includes data 3 and data 4, when the first cursor is moved to finish the data 1 and data 2 (the order of fetching is to first fetch the data 1 and then fetch the data 2), and the second cursor is moved to finish the data 3 and data 4 (the order of fetching is to first fetch the data 3 and then fetch the data 4), the preset threshold 6 for information recommendation cannot be met, at this time, the second cursor needs to be moved to read the data 2 and data 1 from the first storage region in sequence, and at this time, the preset threshold is met, at this time, the order of reading the data from the first storage region during the loop fetching is opposite to the order of fetching from the first storage region corresponding to the first information recommendation request. However, as an extendable embodiment, the order of fetching may remain consistent whether or not the fetching is looped.
Fig. 6 is a schematic diagram of a method for reading data corresponding to an information recommendation method provided in an embodiment of the present specification. As shown in fig. 6, the data extraction may be performed according to the following steps:
step 601: when the instruction is obtained, sorting the data according to time and placing the data in an online database;
step 602: placing the created first cursor new and the created second cursor old at the forefront of the data queue in the database;
step 603: when new elements or data exist, the new elements are placed on the top of a data queue in a database;
step 604: when data is fetched, the first cursor is moved to fetch data upwards, the second cursor is moved to fetch data downwards, and whether the first cursor is located at the head of a data queue in the database or not 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 completely take out the new data, at the moment, the second cursor is moved to take out the old data downwards, and whether the two cursors are positioned at the tail of the data queue is judged;
step 606: when the second cursor is positioned at the tail of the data queue, the second cursor is proved to completely take out the old data, and the first cursor and the second cursor are placed at the forefront of the queue for cycle taking;
step 607: if the second cursor is not positioned at the tail of the data queue, continuously moving the second cursor to fetch data;
step 608: judging whether the access is finished;
step 609: if the number fetching is finished, the number fetching is finished;
step 610: if the number fetching is not finished, continuing to fetch the number by adopting a second cursor;
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 data upwards;
step 612: judging whether the access is finished;
step 613: if the access is finished, ending the access;
step 614: if the fetching is not completed, the fetching is continued.
The above example is only one possible way in the practical application scenario in the embodiment of the present application, and does not constitute a limitation to the present application.
By the method, when the first data and the second data in the online database are not obtained and the recommended preset threshold value is still not met, the method of circularly obtaining data and circularly recommending is adopted, and the phenomenon that the user terminal is blank is avoided.
In an actual application scenario, reading first data from a first storage area to obtain a first data set, reading second data from a second storage area to obtain a second data set, but the amount of the finally recommended data only needs to meet a preset threshold, so that a preset amount of data is taken from the first data set and the second data set to form a third data set, and obtaining the third data set according to the first data set and the second data set may specifically include:
putting all data in the first data set into a third data set;
reading a first number of pieces of data from the second data set, and 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 all pieces of data in the first data set is equal to the preset threshold, and the total number of pieces of data in the second data set is greater than or equal to the first number of pieces of data.
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, all data in the first data set are firstly put into the third data set, then the first piece of data (data 3) is read from the second data set, the third data set is obtained as { data 1, data 2, data 3}, and information corresponding to the three pieces of data is recommended to the terminal for display.
It should be noted that the method for obtaining recommendation information may also adopt the following implementation manners:
determining a preset threshold value of information to be recommended;
taking out all data from the first storage area and putting the data into a data set to be recommended;
and then taking out a first number of pieces of data from the second storage area, wherein the sum of the first number of pieces of data and the quantity of all data in the data set to be recommended is equal to the preset threshold value.
By the method, the first data are read preferentially when the data are read, and the second data are read after the first data are read, so that timeliness of recommending information to the terminal is guaranteed.
In practical applications, before the reading 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 the storage addresses in the first storage area and the second storage area;
sequentially storing first data with the generation time later than a preset time to corresponding storage addresses in the first storage area according to the sequence of the generation time and the address numbers;
and sequentially storing the second data with the generation time earlier than the preset time to the corresponding storage addresses in the second storage area according to a preset sequencing sequence and the address numbers.
Further, the sequentially storing the data whose generation time is later than the preset time to the corresponding storage addresses in the first storage area according to the sequence of the generation time and the address numbers may specifically include:
determining a first storage address used for storing initial data in the first storage area;
and sequentially storing the first data to corresponding storage addresses in the first storage area according to the sequence of the generation time, wherein the storage address of one address number in the first storage area correspondingly stores one piece of the 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 storage manner of the first data and the second data, the method in fig. 6 may be described in detail:
fig. 7 is a schematic diagram illustrating a storage manner of first data and second data corresponding to an information recommendation method provided in an embodiment of the present specification. As shown in fig. 7, when there is new data, the new data is stored in the head of the old data set, the new data/first data is new _1 … … new _ n, the old data/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, numbering may be performed sequentially from the first storage area according to a preset numbering rule (for example, numbering is performed 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 cannot be damaged after the newly added data is inserted into the online database.
Specifically, according to the generation time of the first data, the acquired data are sequentially stored in the first storage area from morning to evening according to the generation time, during storage, the first piece of data may be correspondingly stored in the first storage address where the first storage area starts to store, and the data generation time and the number of the storage location are corresponded. The storage sequence may be opposite to the numbering sequence, or may be the same as the numbering sequence, and the number corresponding to the first storage address to be stored in the first storage area may be new _1 in fig. 6, or new _ n, for example: data 1 is stored in the first storage location in the first storage area according to the morning and evening of the time, and data 2-4 are stored in the corresponding locations in the first storage area in a manner that the address number in the first storage area is decreased. 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 can also be stored in the first memory area in corresponding positions in the first memory area in such a way that the address number in the first memory area is incremented. 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 sequentially storing the second data whose generation time is 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 may specifically include:
determining a second storage address used for storing initial data in the second storage area;
determining a priority order of the second data;
and sequentially storing the second data to corresponding storage addresses in the second storage area according to the priority sequence, wherein a storage address with one address number in the second storage area correspondingly stores one piece of second data, the data with the highest priority in the second data is stored in the second storage address, and the second storage address is adjacent to the first storage address.
Sorting the second data according to a preset scoring system to obtain a priority order corresponding to the updated data;
and sequentially storing the updating data into the second storage area according to the priority order corresponding to the updating 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 stored in the second storage area in sequence, for example: the address numbers of the storage locations in the second storage area are address 1, address 2, address 3, address 4, address 5, and address 6, and 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.
It should be noted that, when data storage is specifically performed, it is only required to store the sorted data according to a certain storage rule, and the data may be stored in sequential storage locations or in discontinuous storage locations, for example: by applying the above example, data old _1 can be stored at address 1, data old _2 can be stored at address 3, data old _3 can be stored at address 5, and data old _4 can be stored at address 7.
In addition, when the first data is stored, another embodiment exists: the storage may be performed based on a real storage location in the second storage area, and the specific method may include:
carrying out address numbering 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 sequentially storing the first data in front of the address number corresponding to the initial storage position according to the time sequence by taking the address number corresponding to the initial storage position as a reference.
Such as: the storage location numbers in the storage space are sequentially address 1, address 2, address 3 and address … …, the storage space is divided into two storage areas, the storage location addresses in the first storage area are address 1-address 100, and the storage location addresses in the second storage area are address 101-address n. During specific storage, the address number corresponding to the starting storage position in the second storage area is determined to be the address 101, and if the first data is the data 1-10, the data 1 can be stored on the address 100 and the data 2 can be stored on the address 99 and the … … can be stored on the address 91 before the data 1-10 are stored on the address 101. It is worth emphasizing that when the first data is stored, it is still only necessary to store the first data sorted according to time into the first storage area according to a certain storage rule.
In practical application scenarios, the internet generates a lot of information content every day, so that the data in the second storage area needs to be updated periodically or conditionally, for example: the content is updated at 00:00 a.m. every morning, or the content is updated according to the click rate heat, and the content can be 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 time length of the earliest time in the first generation time from the current time;
and when the duration meets a data updating period, updating the data in the second storage area.
The updating of the data in the second storage area may specifically include:
acquiring updating data generated in a time period corresponding to the second generation time; a start time of the second generation time is later than a generation time of the second data;
sorting the updating data according to a preset scoring system to obtain the sorted updating data;
reading a preset number of update data ranked in the front from the ranked update data;
and sequentially storing the updating data into the second storage area according to the priority order corresponding to the preset number of updating data.
During updating, determining the time length of the earliest time in the first generation time from the current time according to the time corresponding to the data with the earliest generation time in the first data; 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 updating data according to a preset scoring system to obtain the sorted updating data; reading a preset number of update data ranked in the front from the ranked update data; and sequentially storing the updating data into the second storage area according to the priority order corresponding to the preset number of updating data.
Such as: of the generation times of the first data, the earliest generation time is: 00:01, determining that the time length from the current time is 24 hours, meeting the updating condition, at the moment, acquiring data generated after 00:01 in the next day, sequencing the data according to the time sequence, the grade and the like, and then storing the data into a second storage area.
By the method, the data in the second storage area are updated according to the data generation time, so that the data in the second storage area can be guaranteed to be stronger in timeliness, and the recommendation effect is more timely and accurate.
Based on the same idea, the embodiment of the present specification further provides a device corresponding to the above method. Fig. 8 is a schematic structural diagram of an information recommendation device corresponding to fig. 3 provided in an embodiment of the present disclosure. As shown in fig. 8, the apparatus may include:
an information recommendation request obtaining module 801, configured to obtain 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 whose generation time is later than a preset time;
a determining module 803, configured to determine whether the total amount 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, when the first determination result indicates that the total amount of data in the first data set does not satisfy the preset threshold, read 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 the 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 amount of data in the third set of data meets the preset threshold;
and an information recommendation module 806, configured to recommend information to the terminal according to the data in the third data set.
Optionally, the apparatus may be further configured to:
and when the first judgment result shows that the total amount 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 in the first storage area for storing initial data;
a first data reading unit, configured to sequentially read, starting from the first storage address, first data stored in each storage address in the first storage area according to a preset first reading order; and when storing, storing the first data in the first storage area according to a preset first storage sequence, wherein the first storage sequence is the same as the first reading sequence.
Optionally, the first data reading unit may be specifically configured to:
creating a first cursor, the first cursor pointing to the first storage address;
determining an address number corresponding to each storage address 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 number corresponding to each storage address in the first storage area.
Optionally, the third data set determining module 805 may be specifically configured to:
putting all data in the first data set into a third data set;
reading a first number of pieces of data from the second data set, and 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 all pieces of data in the first data set is equal to the preset threshold, and the total number of pieces of data in the second data set is greater than or equal to the first number of pieces of data.
Optionally, the second data reading module 804 may specifically include:
a second storage address determination unit configured to determine a second storage address in the second storage area for storing initial data;
a second data reading unit, configured to sequentially read, starting from the second storage address, second data stored in each storage address in the second storage area according to a preset second reading order; and when storing, storing the second data in the second storage area 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 be specifically configured to:
creating a second cursor, the second cursor pointing to the second storage address;
determining an address number corresponding to each storage address in the second storage area;
and moving the second cursor to sequentially read the second data stored in each storage address in the second storage area according to the address number corresponding to each storage address in the second storage area.
Optionally, the apparatus may further include:
determining address numbers corresponding to the storage addresses in the first storage area and the second storage area;
sequentially storing first data with the generation time later than a preset time to corresponding storage addresses in the first storage area according to the sequence of the generation time and the address numbers;
and sequentially storing the second data with the generation time earlier than the preset time to the corresponding storage addresses in the second storage area according to a preset sequencing sequence and the address numbers.
Optionally, the apparatus may be specifically configured to:
determining a first storage address used for storing initial data in the first storage area;
and sequentially storing the first data to corresponding storage addresses in the first storage area according to the sequence of the generation time, wherein the storage address of one address number in the first storage area correspondingly stores one piece of the first data, and the data with the earliest generation time in the first data is stored in the first storage address.
Optionally, the apparatus is specifically configured to:
determining a second storage address used for storing initial data in the second storage area;
determining a priority order of the second data;
and sequentially storing the second data to corresponding storage addresses in the second storage area according to the priority sequence, wherein a storage address with one address number in the second storage area correspondingly stores one piece of second data, the data with the highest priority in the second data is stored in 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 determination module configured to determine a first generation time of each of the 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 time;
and the updating module is used for updating the data in the second storage area when the duration meets a data updating period.
Optionally, the update module may specifically include:
an update data acquisition unit configured to acquire update data generated in a time period corresponding to the second generation time; a start time of the second generation time is later than a generation time of the second data;
the sorting unit is used for sorting the updating data according to a preset scoring system to obtain the sorted updating data;
the updating data determining unit is used for reading a preset number of updating data which are sorted in the front from the sorted updating data;
and the updating unit is used for sequentially storing the updating data into the second storage area according to the priority order corresponding to the preset number of updating 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;
the first address number determining module is used for determining a first address number corresponding to the last piece of data in the first number of pieces of data;
the data reading module is used for moving the second cursor to sequentially read data of which the quantity 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 by taking the first address number as a reference according to the second information recommendation request;
and recommending the data of which the number meets 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 data item meets the preset threshold value or not to obtain a second judgment result;
when the second judgment result shows that the second number of pieces of data meet the preset threshold value, recommending information to the terminal according to the second number of pieces of data;
and when the second judgment result shows that the second number of pieces of data do 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, and 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 the third number of pieces of data and the total number 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 idea, the embodiment of the present specification further provides a device corresponding to the above method.
Fig. 9 is a schematic structural diagram of an information recommendation device corresponding to fig. 3 provided in an embodiment of this specification. As shown in fig. 9, the apparatus 900 may include:
at least one processor 910; and the number of the first and second groups,
a memory 930 communicatively coupled to the at least one processor; wherein the content of the first and second substances,
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 of which the generation time is later than a preset time;
judging whether the total amount of the data in the first data set meets a preset threshold value or not to obtain a first judgment result;
when the first judgment result shows that the total amount 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 the 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 amount of data in the third set of data 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 in a technology could clearly distinguish between improvements in hardware (e.g., improvements in circuit structures such as diodes, transistors, switches, etc.) and improvements in software (improvements in process flow). However, as technology advances, many of today's process flow improvements have been seen as direct improvements in hardware circuit architecture. Designers almost always obtain the corresponding hardware circuit structure by programming an improved method flow into the hardware circuit. Thus, it cannot be said that an improvement in the process flow cannot be realized by hardware physical modules. For example, a Programmable Logic Device (PLD), such as a Field Programmable Gate Array (FPGA), is an integrated circuit whose Logic functions are determined by programming the Device by a user. A digital system is "integrated" on a PLD by the designer's own programming without requiring the chip manufacturer to design and fabricate application-specific integrated circuit chips. Furthermore, nowadays, instead of manually making an integrated Circuit chip, such Programming is often implemented by "logic compiler" software, which is similar to a software compiler used in program development and writing, but the original code before compiling is also written by a specific Programming Language, which is called Hardware Description Language (HDL), and HDL is not only one but many, such as abel (advanced Boolean Expression Language), ahdl (alternate Language Description Language), traffic, pl (core unified Programming Language), HDCal, JHDL (Java Hardware Description Language), langue, Lola, HDL, laspam, hardsradware (Hardware Description Language), vhjhd (Hardware Description Language), and vhigh-Language, which are currently used in most common. It will also be apparent to those skilled in the art that hardware circuitry that implements the logical method flows can be readily obtained by merely slightly programming the method flows into an integrated circuit using 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, an Application Specific Integrated Circuit (ASIC), a programmable logic controller, and an embedded microcontroller, 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 for the memory. Those skilled in the art will also appreciate that, in addition to implementing the controller as pure computer readable program code, the same functionality can be implemented by logically programming method steps such that the controller is in the form of logic gates, switches, application specific integrated circuits, programmable logic controllers, embedded microcontrollers and the like. Such a controller may thus be considered a hardware component, and the means included therein for performing the various functions may also be considered as a structure within the hardware component. Or even means for performing the functions may be regarded as being both a software module for performing the method and a structure within a hardware component.
The systems, devices, modules or units illustrated in the above embodiments may be implemented by a computer chip or an entity, or by a product with certain functions. One typical implementation device is a computer. In particular, the computer may be, for example, a personal computer, a laptop computer, a cellular telephone, a camera phone, a smartphone, 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 divided into various units by function, and are described separately. Of course, the functionality of the units may be implemented in one or more software and/or hardware when implementing the present application.
As will be appreciated by one skilled in the art, 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 flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams 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 a typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include forms of volatile memory in a computer readable medium, Random Access Memory (RAM) and/or non-volatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). Memory is an example of a computer-readable medium.
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 computer storage media 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 that can be used to store information that can be accessed by a computing device. As defined herein, a computer readable medium does not include a transitory computer readable medium such as a modulated data signal and a carrier wave.
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 an … …" 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.
The embodiments in the present specification are described in a progressive manner, and the same and similar parts among the embodiments are referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, for the system embodiment, since it is substantially similar to the method embodiment, the description is simple, and for the relevant points, reference may be made to the partial description of the method embodiment.
The above description is only an example of the present application and is not intended to limit the present application. Various modifications and changes may occur to those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in 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 of which the generation time is later than a preset time;
judging whether the total amount of the data in the first data set meets a preset threshold value or not to obtain a first judgment result;
when the first judgment result shows that the total amount 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 the 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 amount of data in the third set of data 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, after obtaining the first determination result, further comprising:
and when the first judgment result shows that the total amount 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 according to claim 1, wherein reading the first data from the first storage area according to the first information recommendation request specifically includes:
determining a first storage address used for storing initial data in the first storage area;
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; and when storing, storing the first data in the first storage area according to a preset first storage sequence, wherein the first storage sequence is the same as the first reading sequence.
4. The method according to claim 3, wherein the sequentially reading the first data stored in each storage address of the first storage area according to a preset first reading order includes:
creating a first cursor, the first cursor pointing to the first storage address;
determining an address number corresponding to each storage address 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 number corresponding to each storage address in the first storage area.
5. The method according to claim 1, wherein obtaining a third data set according to the first data set and the second data set specifically includes:
putting all data in the first data set into a third data set;
reading a first number of pieces of data from the second data set, and 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 all pieces of data in the first data set is equal to the preset threshold, and the total number of pieces of data in the second data set is greater than or equal to the first number of pieces of data.
6. The method according to claim 1, wherein reading the second data from the second storage area according to the first information recommendation request specifically includes:
determining a second storage address used for storing initial data in the second storage area;
sequentially reading second data stored in each storage address in the second storage area from the second storage address according to a preset second reading sequence; and when storing, storing the second data in the second storage area according to a preset second storage sequence, wherein the second storage sequence is the same as the second reading sequence.
7. The method according to claim 6, wherein the sequentially reading the second data stored in each storage address of the second storage area according to a preset second reading order includes:
creating a second cursor, the second cursor pointing to the second storage address;
determining an address number corresponding to each storage address in the second storage area;
and moving the second cursor to sequentially read the second data stored in each storage address in the second storage area according to the address number corresponding to each storage address in the second storage area.
8. The method of claim 1, before reading the first data from the first storage area according to the first information recommendation request, further comprising:
determining address numbers corresponding to the storage addresses in the first storage area and the second storage area;
sequentially storing first data with the generation time later than a preset time to corresponding storage addresses in the first storage area according to the sequence of the generation time and the address numbers;
and sequentially storing the second data with the generation time earlier than the preset time to the corresponding storage addresses in the second storage area according to a preset sequencing sequence and the address numbers.
9. The method according to claim 8, wherein the sequentially storing the data whose generation time is later than a preset time to the corresponding storage addresses in the first storage area according to the sequence of the generation time and the address numbers includes:
determining a first storage address used for storing initial data in the first storage area;
and sequentially storing the first data to corresponding storage addresses in the first storage area according to the sequence of the generation time, wherein the storage address of one address number in the first storage area correspondingly stores one piece of the first data, and the data with the earliest generation time in the first data is stored in the first storage address.
10. The method according to claim 8, wherein the step of sequentially storing the second data whose generation time is earlier than the preset time in the corresponding storage addresses of the second storage area according to the preset sorting order and the address numbers includes:
determining a second storage address used for storing initial data in the second storage area;
determining a priority order of the second data;
and sequentially storing the second data to corresponding storage addresses in the second storage area according to the priority sequence, wherein a storage address with one address number in the second storage area correspondingly stores one piece of second data, the data with the highest priority in the second data is stored in 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 recommending information to 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 time length of the earliest time in the first generation time from the current time;
and when the duration meets a data updating period, updating the data in the second storage area.
12. The method according to claim 11, wherein the updating the data in the second storage area specifically includes:
acquiring updating data generated in a time period corresponding to the second generation time; a start time of the second generation time is later than a generation time of the second data;
sorting the updating data according to a preset scoring system to obtain the sorted updating data;
reading a preset number of update data ranked in the front from the ranked update data;
and sequentially storing the updating data into the second storage area according to the priority order corresponding to the preset number of updating data.
13. The method of claim 7, further comprising, after recommending information to 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 piece of data in the first number of pieces of data;
taking the first address number as a reference, and moving the second cursor to sequentially read data of which the quantity 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 according to the second information recommendation request;
and recommending the data of which the number meets the preset threshold value to the terminal.
14. The method according to claim 13, wherein moving the second cursor to sequentially read data satisfying the preset threshold bar from the second address information backward 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 data item meets the preset threshold value or not to obtain a second judgment result;
when the second judgment result shows that the second number of pieces of data meet the preset threshold value, recommending information to the terminal according to the second number of pieces of data;
and when the second judgment result shows that the second number of pieces of data do 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, and 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 the third number of pieces of data and the total number 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.
15. An information recommendation apparatus comprising:
the information recommendation request acquisition module is used for acquiring a first information recommendation request sent by a 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, wherein the first storage area is a preset area for storing data of which the generation time is later than a preset time;
the judging module is used for judging whether the total amount 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 shows that the total amount of the data in the first data set does not meet the preset threshold; the second storage area is a preset area for storing data with the generation time earlier than the preset time; the second storage area is different from the first storage area;
a third data set determining module, configured to obtain a third data set according to the first data set and the second data set; the total amount of data in the third set of data meets the preset threshold;
and the information recommendation module is used for recommending information to the terminal according to the data in the third data set.
16. An information recommendation apparatus comprising:
at least one processor; and the number of the first and second groups,
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
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 of which the generation time is later than a preset time;
judging whether the total amount of the data in the first data set meets a preset threshold value or not to obtain a first judgment result;
when the first judgment result shows that the total amount 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 the 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 amount of data in the third set of data 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 computer-readable instructions stored thereon, the computer-readable instructions being 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 true CN110647685A (en) 2020-01-03
CN110647685B 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)

Cited By (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
CN111459667A (en) * 2020-03-27 2020-07-28 深圳市梦网科技发展有限公司 Data processing method, device, server and medium
CN113518097A (en) * 2020-04-09 2021-10-19 北京意锐新创科技有限公司 Transaction data pushing method and device

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108537568A (en) * 2018-03-07 2018-09-14 阿里巴巴集团控股有限公司 A kind of information recommendation method and device
CN108874831A (en) * 2017-05-12 2018-11-23 阿里巴巴集团控股有限公司 A kind of information recommendation method and device
CN110110229A (en) * 2019-04-25 2019-08-09 深圳前海微众银行股份有限公司 A kind of information recommendation method and device

Patent Citations (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
CN108537568A (en) * 2018-03-07 2018-09-14 阿里巴巴集团控股有限公司 A kind of information recommendation method and device
CN110110229A (en) * 2019-04-25 2019-08-09 深圳前海微众银行股份有限公司 A kind of information recommendation method and device

Cited By (4)

* 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
CN111459667A (en) * 2020-03-27 2020-07-28 深圳市梦网科技发展有限公司 Data processing method, device, server and 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

Also Published As

Publication number Publication date
CN110647685B (en) 2023-07-28

Similar Documents

Publication Publication Date Title
TWI738902B (en) Display of business objects, processing method of map data, client and server
CN107957831B (en) Data processing method, device and processing equipment for displaying interface content
CN105956149B (en) method and device for recommending default search terms
CN110647685B (en) Information recommendation method, device and equipment
US20200221185A1 (en) Method for pushing video information, apparatus, device and storage medium
WO2017215175A1 (en) Page processing method and device, terminal, and server
CN109144649A (en) Display methods, device, terminal and the storage medium of icon
CN105824830B (en) Method, client and equipment for displaying page
CN109828811B (en) Card object display method and device
CN108848244B (en) Page display method and device
US10440435B1 (en) Performing searches while viewing video content
US20160026341A1 (en) Matrix interface for enabling access to digital content
US20160070690A1 (en) Display of user comments to timed presentation
WO2022247220A1 (en) Interface processing method and apparatus
CN113157753A (en) Display method and device and electronic equipment
CN111191132B (en) Information recommendation method and device and electronic equipment
CN104581399A (en) Hot word searching method and system in television box
CN109388737B (en) Method and device for sending exposure data of content item and storage medium
CN111898056A (en) Webpage display method and device, storage medium and electronic equipment
CN110647704A (en) Page updating method, device and equipment
CN114255066A (en) Entity advertisement putting point recommendation method and device
CN108737850B (en) Video recommendation method, server and client
CN113779416A (en) Information recommendation method and device, electronic equipment and computer-readable storage medium
CN103702218A (en) Video playing method and device
CN107066471B (en) Method and device for dynamically displaying information

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