Method and device for processing recommendation information, storage medium, and electronic device
The bitmap merging operation solves the problem of time-consuming recommendation information processing, realizes fast recommendation information processing and responds to data requests from terminal devices, and improves user experience.
Patent Information
- Application Number
- CN202011140692.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-10-22
- Publication Date
- 2025-10-21
- Estimated Expiration
- 2040-10-22
AI Technical Summary
In the prior art, the process of processing recommendation information is time-consuming, resulting in a problem that it takes a long time to respond to the data request of the terminal device as a whole.
A bitmap is used to represent the recommendation results obtained from N databases, and a merge operation is performed on the N bitmaps to reduce the time complexity of the merge operation and shorten the time consumption of the merge operation.
Through the bitmap merging operation, the time complexity of the recommendation information processing process is significantly reduced, the overall time required to respond to data requests from terminal devices is shortened, and the user experience is improved.
Smart Images

Figure CN114385689B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computers, and in particular to a method and device for processing recommendation information, a storage medium, and an electronic device. Background Art
[0002] In related art, when recommending media information to users based on data requests sent by users, in multi-channel request scenarios, the data sources typically involve multiple databases. Therefore, after receiving the data request sent by the terminal device, the result aggregation server pulls multiple result sets from the multiple databases, merges and sorts the multiple result sets, obtains the final result, and returns it to the terminal device. For example, the result aggregation server pulls result set 1, result set 2, and result set 3 from database 1, database 2, and database 3, respectively.
[0003] When merging the results, it is necessary to deduplicate the results. Specifically, it is necessary to traverse each result in each result set pulled to perform the following operations: compare each result in a pulled result set with each result in another result set to deduplicate, thereby obtaining an intermediate result set. Then repeat the above comparison and deduplication operations on the intermediate result set and another result set until the results in all result sets are deduplicated and then merged to obtain the merged result, and then sort the merged results to obtain the final result. For example, if N result sets are pulled from N databases, and each result set includes M results, the time complexity of the merge and sort operations is O(N*M*M).
[0004] Therefore, the processing of the recommendation information provided by the related art takes a long time, which leads to the problem that it takes a long time overall to respond to the data request of the terminal device.
[0005] Currently, no effective solution has been proposed to the problem that the processing of recommendation information takes a long time. Summary of the Invention
[0006] Embodiments of the present invention provide a method and apparatus for processing recommendation information, a storage medium, and an electronic device, to at least solve the technical problem that the processing of recommendation information takes a long time.
[0007] According to one aspect of an embodiment of the present invention, a method for processing recommendation information is provided, comprising: obtaining a first data request sent by a target account, wherein the first data request is used to request media information recommended to the target account; sending a second data request to N databases respectively, wherein the second data request is used to request media information recommended to the target account; obtaining N bitmaps returned by the N databases, wherein each of the N bitmaps represents a recommendation result obtained by one of the N databases; performing a merge operation on the N bitmaps to obtain a target bitmap; and sending a first media information subset to the target account, wherein the first media information subset is part or all of the media information corresponding to the target bitmap.
[0008] According to another aspect of an embodiment of the present invention, a device for processing recommendation information is further provided, including: a first acquisition module, used to obtain a first data request sent by a target account, wherein the first data request is used to request to obtain media information recommended to the target account; a first sending module, used to send a second data request to N databases respectively, wherein the second data request is used to request to obtain media information recommended to the target account; a second acquisition module, used to obtain N bitmaps returned by the N databases, wherein each of the N bitmaps represents a recommendation result obtained by one of the N databases; a merging module, used to perform a merging operation on the N bitmaps to obtain a target bitmap; and a second sending module, used to send a first media information subset to the target account, wherein the first media information subset is part or all of the media information corresponding to the target bitmap.
[0009] According to another aspect of the embodiments of the present invention, a computer-readable storage medium is provided, in which a computer program is stored. The computer program is configured to execute the above-mentioned method for processing recommendation information when running.
[0010] According to another aspect of an embodiment of the present invention, an electronic device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to execute the method for processing recommendation information through the computer program.
[0011] In an embodiment of the present invention, a first data request sent by a target account is obtained, wherein the first data request is used to request media information recommended to the target account; a second data request is sent to each of N databases, wherein the second data request is used to request media information recommended to the target account; N bitmaps returned by the N databases are obtained, wherein each of the N bitmaps represents a recommendation result obtained from one of the N databases; a merge operation is performed on the N bitmaps to obtain a target bitmap; and a first subset of media information is sent to the target account, wherein the first subset of media information is part or all of the media information corresponding to the target bitmap. Because bitmaps are used to represent the recommendation results obtained from the N databases, a merge operation is performed on the N bitmaps to achieve a merge operation between the recommendation results obtained from the N databases, thereby achieving the purpose of reducing the time complexity of the merge operation, thereby achieving the technical effect of shortening the time consumption of the merge operation and reducing the overall time consumption of responding to data requests from the terminal device, thereby solving the technical problem of a long time consumption in the processing of recommendation information. BRIEF DESCRIPTION OF THE DRAWINGS
[0012] The drawings described herein are used to provide a further understanding of the present invention and constitute a part of this application. The exemplary embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation of the present invention. In the drawings:
[0013] Figure 1 is a schematic diagram of an application environment of an optional method for processing recommendation information according to an embodiment of the present invention;
[0014] Figure 2 is a flowchart of an optional method for processing recommendation information according to an embodiment of the present invention;
[0015] Figure 3 is a schematic diagram of an application environment of another optional method for processing recommendation information according to an embodiment of the present invention;
[0016] Figure 4 is a flow chart of a method for processing recommendation information according to another optional embodiment of the present invention;
[0017] Figure 5 is a schematic diagram of an interface of another optional method for processing recommendation information according to an embodiment of the present invention;
[0018] Figure 6 is a schematic diagram of another optional method for processing recommendation information according to an embodiment of the present invention;
[0019] Figure 7 is a schematic diagram of another optional method for processing recommendation information according to an embodiment of the present invention;
[0020] Figure 8 is a schematic diagram of another optional method for processing recommendation information according to an embodiment of the present invention;
[0021] Figure 9 is a structural block diagram of an optional device for processing recommendation information according to an embodiment of the present invention;
[0022] Figure 10 FIG. 4 is a schematic structural diagram of an optional electronic device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0023] In order to enable those skilled in the art to better understand the solutions of the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the embodiments described are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts should fall within the scope of protection of the present invention.
[0024] It should be noted that the terms "first", "second", etc. in the description and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that the numbers used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0025] According to one aspect of an embodiment of the present invention, a method for processing recommendation information is provided. Optionally, the above-mentioned method for processing recommendation information can be applied to, but is not limited to, Figure 1 In the environment shown in the figure, N databases (i.e. Figure 1 The target media information set is composed of all media information recorded in databases 1 to N shown in FIG. 1 . The terminal device 102 is connected to the target server 104 (or referred to as the result aggregation server) via a network. The target server 104 obtains the first data request sent by the target account (for example, the first data request is obtained from the terminal device 104 logged in by the target account). The target server 104 sends a second data request (i.e., Figure 1Database 1 to database N shown in the figure), and obtain N bitmaps returned by multiple databases, perform a merge operation on the N bitmaps, and determine the first media information subset in the target media information set according to the target bitmap, and send the first media information subset to the terminal device (that is, to the target account).
[0026] Optionally, in this embodiment, the terminal device 102 may be a terminal device configured with a target client, which may include but is not limited to at least one of the following: a mobile phone (such as an Android phone, an iOS phone, etc.), a laptop computer, a tablet computer, a PDA, an MID (Mobile Internet Device), a PAD, a desktop computer, a smart TV, etc. The target client may be a video client, an instant messaging client, a browser client, an education client, etc. The network may include but is not limited to: a wired network, a wireless network, wherein the wired network includes: a local area network, a metropolitan area network, and a wide area network, and the wireless network includes: Bluetooth, WIFI, and other networks that implement wireless communication. The above is only an example and is not limited to this in this embodiment.
[0027] Alternatively, as an optional implementation, as Figure 2 As shown, the method for processing the above recommendation information includes:
[0028] Step S202: Obtain a first data request sent by a target account, wherein the first data request is used to request media information recommended to the target account;
[0029] Step S204: Sending a second data request to each of the N databases, wherein the second data request is used to request media information recommended to the target account;
[0030] Step S206: Obtain N bitmaps returned by the N databases, wherein each of the N bitmaps represents a recommendation result obtained by one of the N databases;
[0031] Step S208, performing a merge operation on the N bitmaps to obtain a target bitmap;
[0032] Step S2010: Send the first media information subset to the target account, wherein the first media information subset is part or all of the media information corresponding to the target bitmap.
[0033] In an embodiment of the present invention, a first data request sent by a target account is obtained, wherein the first data request is used to request media information recommended to the target account; a second data request is sent to each of N databases, wherein the second data request is used to request media information recommended to the target account; N bitmaps returned by the N databases are obtained, wherein each bitmap in the N bitmaps represents a recommendation result obtained from one of the N databases; a merge operation is performed on the N bitmaps to obtain a target bitmap; and a first subset of media information is sent to the target account, wherein the first subset of media information is part or all of the media information corresponding to the target bitmap. Because bitmaps are used to represent the recommendation results obtained from the N databases, a merge operation is performed on the N bitmaps to achieve a merge operation between the recommendation results obtained from the N databases, thereby reducing the time complexity of the recommendation information processing process, thereby achieving the technical effect of shortening the time consumption of the recommendation information processing process and reducing the overall time consumption of responding to data requests from the terminal device, thereby resolving the technical problem of the long time consumption of the recommendation information processing process.
[0034] In an exemplary embodiment, each of N databases records part or all of the media information in a target media information set, the target media information set includes M media information arranged in a first arrangement order, where M and N are natural numbers greater than 1; each of the N bitmaps includes M bits arranged in a first arrangement order, the M bits have a one-to-one correspondence with the M media information, and a bit with a first value in the M bits indicates that the media information corresponding to the bit with the first value in the M media information is the media information to be recommended to the target account; sending the first media information subset to the target account includes: sending the first media information subset in the target media information set to the target account, wherein the target bitmap includes M bits arranged in the first arrangement order, and the first media information subset is part or all of the media information corresponding to the bit with the first value in the target bitmap in the M media information.
[0035] Optionally, for example, the target media information set includes 6 media information (eg, media information 1 to media information 6) arranged in a first arrangement order, such as Figure 3 As shown, when there are three databases, the bit returned by database 1 is Figure 1 110100, the bit returned by database 2 Figure 2 =011011, the bit returned by database 3 Figure 3 is: 110110, where the bit with the first value in each bitmap indicates that the media information corresponding to the bit with the first value in the target media information set is the media information to be recommended to the target account. Figure 1 : 110100 indicates that the media information returned by database 1 to be recommended to the target account is media information 1, media information 2 and media information 4 in the target media information set. Figure 2 :011011 indicates that the media information returned by database 2 to be recommended to the target account is media information 2, media information 3, media information 5 and media information 6 in the target media information set. Figure 3 :110110 indicates that the media information returned by the database 3 to be recommended to the target account is media information 1, media information 2, media information 4 and media information 5 in the target media information set.
[0036] In an optional embodiment, a first media information subset in a target media information set is sent to a target account, including: when P1 bits in a target bitmap have a first value, obtaining a sorting factor of P1 media information corresponding to the P1 bits in M media information, wherein P1 is less than or equal to M; obtaining P2 media information from the P1 media information according to the value of the sorting factor, wherein the P2 media information is the P2 media information corresponding to the P2 sorting factor with the largest value among the sorting factors of the P1 media information in the P1 media information; and sending the P2 media information to the target account, wherein P2 is less than or equal to P1, and the first media information subset includes the P2 media information.
[0037] In the above embodiment, each piece of media information in the target media information set may include but is not limited to a preset ranking factor. After obtaining the target bitmap, in order to improve recommendation efficiency and accuracy, the P2 pieces of media information therein are determined based on the ranking factors of the P1 pieces of media information corresponding to the P1 bits having the first value in the target bitmap and are sent to the target account.
[0038] It should be noted that, in the above embodiment, the sorting factor of the above P1 media information is obtained, and the sorting factor is determined as the priority of the corresponding media information, the above P1 media information is saved in a priority queue, and the P2 media information in the P1 media information is determined based on the priority queue, and the P2 media information is dequeued (i.e., the P2 media information is taken out from the priority queue), thereby realizing the ability to quickly determine the P2 media information to be sent to the target account.
[0039] Among them, each media information in the priority queue has a priority. When accessing the media information in the priority queue, the media information with the highest priority is deleted first (taken out of the priority queue first, i.e., dequeued). For example, the media information corresponding to the bit with the first value in the target bitmap is media information 1, media information 3, media information 5, media information 6, media information 7, and media information 9, and their corresponding sorting factors are 4, 5, 3, 2, 1, and 5, respectively. Media information 1, media information 3, media information 5, media information 6, media information 7, and media information 9 are inserted into the priority queue; when P2 is equal to 3, the priority queue is dequeued three times, and the media information with the highest priority in the priority queue is taken out each time. The final sorted result (i.e., the media information in the first media information subset in the above embodiment) is media information 3, media information 9, and media information 1.
[0040] Optionally, the priority queue may be implemented using, but is not limited to, a heap data structure, wherein the heap data structure may include, but is not limited to, a dynamic array.
[0041] Based on the above embodiment, P1 pieces of media information determined according to the target bitmap are inserted into the priority queue, and P2 pieces of media information therein are determined based on the priority queue. The time complexity corresponding to this process is O(P2*logP1).
[0042] Based on the above embodiments, by combining bit operations and priority queues, the merging speed of request results can be further accelerated, thereby further reducing the request time of the overall interface, that is, further reducing the overall time of responding to data requests of the target account in the multi-way recall (i.e., multi-way request) scenario.
[0043] In an optional embodiment, obtaining a ranking factor of P1 media information corresponding to P1 bits in M media information includes: obtaining a heat parameter of P1 media information corresponding to P1 bits in M media information, wherein the ranking factor includes the heat parameter, and the value of the heat parameter is positively correlated with at least one of the following: the number of times the media information is requested, the number of times the media information is paid attention to, and the number of times the media information is accessed; and / or obtaining an evaluation level of P1 media information corresponding to P1 bits in M media information, wherein the ranking factor includes the evaluation level, and the evaluation level is used to indicate the degree to which the media information is recognized, and a higher evaluation level indicates a higher degree to which the media information is recognized.
[0044] Optionally, the evaluation level of the media information may include but is not limited to being calculated through the score of the media information, that is, in the above embodiment, the score of the media information may be used as a ranking factor for the media information.
[0045] In an optional embodiment, P2 media information among P1 media information is obtained according to the value of the sorting factor, including: when the sorting factor includes a heat parameter, P2 media information with the largest heat parameter value among P1 media information is obtained according to the value of the heat parameter; or when the sorting factor includes an evaluation level, P2 media information with the largest evaluation level value among P1 media information is obtained according to the value of the evaluation level.
[0046] It should be noted that, in the above embodiment, when the sorting factor includes a heat parameter, according to the priority of each media information in the P1 media information stored in the above priority queue (i.e., the value of the heat parameter), the operation of searching for the media information with the largest heat parameter value from the priority queue and dequeuing the media information with the largest heat parameter value is repeated until P2 media information with the largest heat parameter value is obtained; when the sorting factor includes an evaluation level, according to the priority of each media information in the P1 media information stored in the above priority queue (i.e., the value of the evaluation level), the operation of searching for the media information with the largest evaluation level value from the priority queue and dequeuing the media information with the largest evaluation level value is repeated until P2 media information with the largest evaluation level value is obtained.
[0047] Optionally, in an optional embodiment, P2 media information among P1 media information is obtained according to the value of the ranking factor, including: when the ranking factor includes a popularity parameter and an evaluation level, weighted summing the popularity parameters and the evaluation level of the P1 media information is performed to obtain the ranking parameter of the P1 media information; and according to the value of the ranking parameter of the P1 media information, P2 media information with the largest value of the ranking parameter among the P1 media information is obtained.
[0048] Among them, when the sorting factor includes the heat parameter and the evaluation level, the heat parameters and the evaluation levels of P1 media information are weighted and summed to obtain the sorting parameter of P1 media information, and the sorting parameter is determined as the priority of the media information. According to the priority of each media information in the P1 media information saved in the above-mentioned priority queue (that is, the value of the sorting parameter), the operation of searching for the media information with the largest value of the sorting parameter from the priority queue and dequeuing the media information with the largest value of the sorting parameter is repeatedly performed until P2 media information with the largest value of the sorting parameter is obtained.
[0049] In an optional embodiment, a merge operation is performed on N bitmaps, including: when the first value is 1, performing an OR operation on the N bitmaps to obtain a target bitmap, wherein the values of M bits are 0 or 1, and the merge operation includes an OR operation; or when the first value is 0, performing an AND operation on the N bitmaps to obtain a target bitmap, wherein the values of M bits are 0 or 1, and the merge operation includes an AND operation.
[0050] In the above embodiment, the merging of multiple result sets (i.e., the merging of multiple recommendation results) can be achieved by performing a merging operation on N bitmaps, so that the merging operation of the recommendation results can be completed quickly, wherein the time complexity of performing the merging operation on N bitmaps is O(N).
[0051] Based on the above embodiment, for example, Figure 3 The bit returned by database 1 Figure 1 :110100, the bit returned by database 2 Figure 2 :011011, the bit returned by database 3 Figure 3 : 110110, when the first value is 1, the target bitmap obtained is: 111111, which represents the recommendation result obtained by merging the recommendation results obtained from database 1 to database 3, and the recommendation result obtained by the merger indicates that the media information to be recommended to the target account is media information 1 to media information 6 in the target media information set.
[0052] It should be noted that the overall time complexity of merging and sorting recommendation information in the above embodiment is O(N+P2*logP1), which is significantly lower than the O(N*M*M) time complexity of merging and sorting operations in related technologies, thereby significantly reducing the time required to process recommendation information. In an exemplary application scenario of an embodiment of the present invention, the total time required to merge and sort recommendation information was reduced from 50 milliseconds in related technologies to less than 10 milliseconds, shortening user waiting time and improving the user experience.
[0053] In an optional embodiment, after sending the second data request to N databases respectively, the method further includes: when the target server sends the second data request to the N databases respectively, searching for media information to be recommended to the target account in each of the N databases according to a corresponding query condition, and obtaining a total of N recommendation results, wherein the N query conditions corresponding to the N databases are different, and each recommendation result is used to represent the media information to be recommended to the target account queried in a corresponding database of the N databases; obtaining N bitmaps corresponding to the N recommendation results; and sending the N bitmaps to the target server.
[0054] The method searches for media information to be recommended to the target account in each of the N databases according to a corresponding query condition, obtaining a total of N recommendation results, including: each database searches for media information from the recorded media information according to the query condition corresponding to the database in response to the second data request, and obtains a corresponding bitmap based on the search results and the above-mentioned first arrangement order of the M media information in the target media information set. For example, taking database 1 as an example, the media information found by database 1 includes media information 1, media information 2, and media information 4. When the first value is 1, since the first arrangement order is media information 1, media information 2, media information 3, media information 4, media information 5, and media information 6, the bits at the positions corresponding to media information 1, 2, and 4 in the first arrangement order are 1, and the bits at other positions are 0, that is, the bitmap obtained by database 1 is: 110100.
[0055] Optionally, each database has corresponding preset query conditions. For example, for a popular application database, its corresponding query conditions may include searching for applications stored in the popular application database based on the application's popularity index (such as the number of downloads); for a latest application database, its corresponding query conditions may include obtaining applications stored in the latest application database based on the application's release time; for an editor recommendation database, its corresponding query conditions may include obtaining applications stored in the editor recommendation database based on the application's rating.
[0056] In an optional embodiment, when the media information is an application and the target media information set includes M applications arranged in a first arrangement order, sending the first media information subset in the target media information set to the target account includes: sending the first application subset of the M applications to the target account.
[0057] Optionally, the media information in the above embodiment may include but is not limited to applications, videos, pictures, songs, etc.
[0058] Through the above embodiment, a bitmap is used to represent the recommendation results obtained from N databases, and the bit with the first value among the M bits included in each bitmap indicates that the media information corresponding to the bit with the first value among the M media information in the target media information set is the media information to be recommended to the target account. Then, by performing a merging operation on the N bitmaps, a merging operation between the recommendation results obtained from the N databases is realized, thereby achieving the purpose of reducing the time complexity of the merging operation, thereby achieving the technical effect of shortening the time of the merging operation and reducing the overall time of responding to the data request of the terminal device. Therefore, for media information of types such as applications, videos, pictures, songs, etc., the time of performing the processing operation of the recommendation information when recommending applications, videos, pictures, songs, etc. to the target account in a multi-channel request scenario can be shortened, thereby reducing the overall time of responding to the data request of the terminal device.
[0059] In an optional embodiment, when the media information is an application and the target media information set includes M applications arranged in a first arrangement order, a second data request is sent to N databases respectively, including: sending a second data request to at least two databases among a popular application database, a latest application database, and an editor recommendation database, wherein the N databases include at least two databases.
[0060] The following explains the method for processing recommendation information in the above embodiment with reference to an example, but is not intended to limit the technical solution of the embodiment of the present invention.
[0061] In an embodiment of the present invention, media information may include game applications. Figure 4 FIG. 1 is a flow chart of a method for processing recommendation information according to another optional embodiment of the present invention. The following takes the media information as a game application as an example to illustrate the method for processing recommendation information in the above embodiment. Figure 4 As shown, the method includes the following steps:
[0062] Step 401: The target account requests data from the target server (or result aggregation server);
[0063] The target account may send a first data request to the target server through the terminal device to request the target server to recommend a game application to the target account.
[0064] Alternatively, as Figure 5 As shown, the terminal device generates a first data request in response to a trigger operation performed by a target account detected in the interactive interface of the terminal device (for example, clicking a "stand-alone" button in the interactive interface), and sends the first data request to the target server.
[0065] The first data request may be generated when the terminal device corresponding to the target account receives a trigger signal.
[0066] Steps 402-1 to 402-N, the target server passes through multiple databases (as an example Figure 4 A data interface (shown in FIG) requests data from multiple databases;
[0067] Steps 403-1 to 403-N: the target server obtains multiple bitmaps from multiple databases;
[0068] For example, multiple bitmaps are bit Figure 1 :110100,bit Figure 2 :011011,bit Figure 3 :110110.
[0069] Optionally, the data interface corresponds to the database one-to-one, that is, the target server obtains multiple bitmaps from multiple databases through multiple data interfaces. Figure 6 In the process, the target server 104 obtains the location information from the popular game application database. Figure 1 , obtained from the latest game application database Figure 2 , obtained from the editor recommended game application database Figure 3 .
[0070] In the media information recommendation scenario, the total number of media information to be recorded in multiple databases (for example, the total number of game applications) can be obtained in advance. The set of all media information to be recorded in multiple databases is the target media information set in the above embodiment, and each game application is recorded in multiple databases according to the attribute information of each game application (for example, release time, rating, etc.). There may be duplicate media information between multiple databases, that is, some of the media information recorded in the multiple databases is the same.
[0071] For example, Figure 7 As shown, the target media information set includes multiple media information arranged in a first order (i.e., game A, game B, game C, game D, game E, game F). In the case where the first value is "1", for the position Figure 1 :110100, determine the position Figure 1 Indicates that the game applications to be recommended to the target account in the recommendation results returned by the popular game application database are game A, game B, and game D. Similarly, determine Figure 6 The middle position Figure 2 Indicates that the game applications to be recommended to the target account in the recommendation results returned by the latest game application database are Game B, Game C, Game E, and Game F. Figure 3It indicates that the game applications to be recommended to the target account in the recommendation results returned by the editor-recommended game application database are Game A, Game B, Game D, and Game E.
[0072] Step 404: When the first value is 1, the target server performs an AND operation on the obtained multiple bitmaps to obtain a target bitmap;
[0073] Among them, multiple bitmaps returned by multiple databases are merged (i.e. Figure 6 The target bitmap is obtained after merging the game application lists in the target account, where the target bitmap indicates that the game applications to be recommended to the target account are Game A, Game B, Game C, Game D, Game E, and Game F, where each game has a preset level (i.e., the ranking factor in the above embodiment).
[0074] Step 405: The target server restores the target bitmap into a list and sorts it based on the priority queue (i.e., performs enqueueing and dequeuing) to obtain a final result list (i.e., the first media information subset in the above embodiment);
[0075] Among them, the target server restores the target bitmap into a list including: determining the game applications (i.e., P1 media information in the above embodiment) corresponding to each bit in the target bitmap that takes the first value (e.g., P1 bit in the above embodiment), and the above list is a list composed of identification information referenced by each determined game (such as the name, icon, and other information of the game application).
[0076] In the above embodiment, after determining P1 game applications (i.e., P1 media information), the preset sorting factor of the game application is determined as the priority of the game application, and the P1 game application is queued (i.e., inserted into the priority queue). Optionally, the priority queue is used to save the P1 game applications and the sorting factors corresponding to each game application.
[0077] When dequeuing, the priority queue is dequeued according to the number of results corresponding to the final result list (ie, the total number P2 of media information to be sent to the target account) to obtain the game application to be sent to the target account.
[0078] like Figure 8 As shown, alignment Figure 1 ,Bit Figure 2 ,Bit Figure 3 After performing the merge operation, the target bitmap is obtained: 111111. The bits with values of 1 in the target bitmap correspond to game A, game B, game C, game D, game E, and game F in the target media information set (that is, the determined first media information subset is the same as the target media information set), among which the sorting factors corresponding to game A, game B, game C, game D, game E, and game F are 5, 3, 4, 5, 1, and 3, respectively.
[0079] The sorting factor of the media information is determined as the priority of the media information, and all the media information corresponding to the bits with a value of "1" in the target bitmap (i.e., P1 media information in the above embodiment) are inserted into the priority queue, and a dequeue operation is performed based on the priority queue to obtain P2 media information with the highest priority, and the P2 media information is used as the media information to be sent to the target account. Figure 6 As shown, the final game application to be sent to the target account (i.e. Figure 6 The three applications with the highest levels obtained are games A, D, and C, and games A, D, and C are sent to the target account.
[0080] The step of sending the first media information subset in the target media information set to the target account includes sending the name, icon, and download address of each media information in the first media information subset to the target account.
[0081] Step 406: Send the final result list (i.e., the first media information subset in the above embodiment) to the target account; optionally, send the media information name corresponding to each media information in the first media information subset and the download address corresponding to the media information to the target account.
[0082] It should be noted that for the aforementioned method embodiments, for simplicity of description, they are all expressed as a series of action combinations. However, those skilled in the art should be aware that the present invention is not limited by the order of the actions described, because according to the present invention, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in this specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present invention.
[0083] According to another aspect of the embodiments of the present invention, a device for processing recommendation information for implementing the above-mentioned method for processing recommendation information is also provided. Figure 9 As shown, the device includes:
[0084] A first acquisition module 62 is configured to acquire a first data request sent by a target account, wherein the first data request is for requesting to acquire media information recommended to the target account;
[0085] A first sending module 64 is configured to send a second data request to each of the N databases, wherein the second data request is configured to request media information recommended to a target account;
[0086] A second acquisition module 66 is configured to acquire N bitmaps returned by the N databases, wherein each bitmap in the N bitmaps represents a recommendation result acquired by one of the N databases;
[0087] A merging module 68 is configured to perform a merging operation on the N bitmaps to obtain a target bitmap;
[0088] The second sending module 610 is configured to send the first media information subset to a target account, wherein the first media information subset is part or all of the media information corresponding to the target bitmap.
[0089] In an embodiment of the present invention, a first data request sent by a target account is obtained, wherein the first data request is used to request media information recommended to the target account; a second data request is sent to each of N databases, wherein the second data request is used to request media information recommended to the target account; N bitmaps returned by the N databases are obtained, wherein each of the N bitmaps represents a recommendation result obtained from one of the N databases; a merge operation is performed on the N bitmaps to obtain a target bitmap; and a first subset of media information is sent to the target account, wherein the first subset of media information is part or all of the media information corresponding to the target bitmap. Since bitmaps are used to represent the recommendation results obtained from the N databases, a merge operation is performed on the N bitmaps to achieve a merge operation between the recommendation results obtained from the N databases, thereby achieving the purpose of reducing the time complexity of the merge operation, thereby achieving the technical effect of shortening the time consumption of the merge operation and reducing the overall time consumption of responding to data requests, thereby solving the technical problem of a long time consumption in the processing of recommendation information.
[0090] Optionally, each of the N databases records part or all of the media information in the target media information set, and the target media information set includes M media information arranged in a first arrangement order, where M and N are natural numbers greater than 1; each of the N bitmaps includes M bits arranged in the first arrangement order, and the M bits have a one-to-one correspondence with the M media information. The bit with the first value in the M bits indicates that the media information corresponding to the bit with the first value in the M media information is the media information to be recommended to the target account; the second sending module 610 is further used to: send a first media information subset in the target media information set to the target account, wherein the target bitmap includes M bits arranged in the first arrangement order, and the first media information subset is part or all of the media information corresponding to the bit with the first value in the target bitmap in the M media information.
[0091] Optionally, the second sending module 610 is further used to: when P1 bits in the target bitmap have a first value, obtain a sorting factor of P1 media information corresponding to the P1 bit in M media information, where P1 is less than or equal to M; obtain P2 media information from the P1 media information according to the value of the sorting factor, where the P2 media information is the P2 media information corresponding to the P2 sorting factor with the largest value among the sorting factors of the P1 media information in the P1 media information; and send the P2 media information to the target account, where P2 is less than or equal to P1, and the first media information subset includes the P2 media information.
[0092] Optionally, the second sending module 610 is further used to: obtain the heat parameters of P1 media information corresponding to P1 bits in M media information, wherein the sorting factor includes the heat parameter, and the value of the heat parameter is positively correlated with at least one of the following: the number of times the media information is requested, the number of times the media information is paid attention to, and the number of times the media information is accessed; and / or obtain the evaluation level of P1 media information corresponding to P1 bits in M media information, wherein the sorting factor includes the evaluation level, and the evaluation level is used to indicate the degree to which the media information is recognized, and the higher the evaluation level, the higher the degree to which the media information is recognized.
[0093] Optionally, the second sending module 610 is further used to: when the sorting factor includes a popularity parameter, obtain P2 media information with the largest value of the popularity parameter among the P1 media information according to the value of the popularity parameter; or when the sorting factor includes an evaluation level, obtain P2 media information with the largest value of the evaluation level among the P1 media information according to the value of the evaluation level.
[0094] Optionally, the second sending module 610 is also used to: when the sorting factor includes a popularity parameter and an evaluation level, perform weighted summation on the popularity parameters and evaluation levels of P1 media information to obtain the sorting parameters of P1 media information; and obtain P2 media information with the largest value of the sorting parameter among the P1 media information according to the values of the sorting parameters of the P1 media information.
[0095] Optionally, the merging module 68 is further used to: when the first value is 1, perform an OR operation on the N bitmaps to obtain a target bitmap, wherein the values of the M bits are 0 or 1, and the merging operation includes an OR operation; or when the first value is 0, perform an AND operation on the N bitmaps to obtain a target bitmap, wherein the values of the M bits are 0 or 1, and the merging operation includes an AND operation.
[0096] Optionally, the second acquisition module 66 is further used to: when the target server sends a second data request to N databases respectively, obtain N bitmaps returned by the N databases, wherein the N bitmaps correspond to N recommendation results, and the N recommendation results are the N recommendation results obtained by searching each database in the N databases for the media information to be recommended to the target account according to a corresponding query condition, wherein the N query conditions corresponding to the N databases are different, and each recommendation result is used to represent the media information to be recommended to the target account found in a corresponding database of the N databases.
[0097] Optionally, when the media information is an application and the target media information set includes M applications arranged in a first arrangement order, the second sending module 610 is further configured to send a first application subset of the M applications to the target account.
[0098] Optionally, when the media information is an application and the target media information set includes M applications arranged in a first arrangement order, the first sending module 64 is further used to send a second data request to at least two databases among a popular application database, a latest application database, and an editor recommendation database, respectively, wherein the N databases include at least two databases.
[0099] According to another aspect of the embodiment of the present invention, an electronic device for implementing the above-mentioned method for processing recommendation information is provided. The electronic device may be Figure 1 The target server 104 shown is the result aggregation server in the above embodiment. This embodiment is described by taking the electronic device as the server as an example. Figure 10 As shown, the electronic device includes a memory 1102 and a processor 1104. The memory 1102 stores a computer program, and the processor 1104 is configured to execute the steps in any of the above method embodiments through the computer program.
[0100] Optionally, in this embodiment, the electronic device may be located in at least one network device among a plurality of network devices of a computer network.
[0101] Optionally, in this embodiment, the processor may be configured to execute the following steps through a computer program:
[0102] S1, obtaining a first data request sent by a target account, wherein the first data request is for requesting to obtain media information recommended to the target account;
[0103] S2, sending a second data request to each of the N databases, wherein the second data request is used to request media information recommended to the target account;
[0104] S3, obtaining N bitmaps returned by N databases, where each bitmap in the N bitmaps represents a recommendation result obtained from one of the N databases;
[0105] S4, performing a merge operation on the N bitmaps to obtain a target bitmap;
[0106] S5. Send the first media information subset to the target account, where the first media information subset is part or all of the media information corresponding to the target bitmap.
[0107] Alternatively, those skilled in the art will appreciate that Figure 10 The structure shown is for illustration only, and the electronic device may also be a smart phone (such as an Android phone, an iOS phone, etc.), a tablet computer, a PDA, a mobile Internet device (MID), a PAD, or other terminal devices. Figure 10 It does not limit the structure of the electronic device. For example, the electronic device may also include Figure 10 More or fewer components (such as network interfaces, etc.) as shown in, or with Figure 10 Different configurations shown.
[0108] Among them, the memory 1102 can be used to store software programs and modules, such as the program instructions / modules corresponding to the method and device for processing recommendation information in the embodiment of the present invention. The processor 1104 executes various functional applications and data processing by running the software programs and modules stored in the memory 1102, that is, realizes the above-mentioned method for processing recommendation information. The memory 1102 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 1102 may further include a memory remotely located relative to the processor 1104, and these remote memories may be connected to the terminal via a network. Examples of the above-mentioned networks include but are not limited to the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof. Among them, the memory 1102 can be used specifically but not limited to store information such as target accounts. As an example, if Figure 10 As shown, the memory 1102 may include, but is not limited to, the first acquisition module 62, the first sending module 64, the second acquisition module 66, the merging module 68, and the second sending module 610 of the recommendation information processing device. Furthermore, the memory 1102 may also include, but is not limited to, other modules and units of the recommendation information processing device, which will not be described in detail in this example.
[0109] Optionally, the transmission device 1106 is configured to receive or send data via a network. Specific examples of the network may include a wired network and a wireless network. In one embodiment, the transmission device 1106 includes a network interface controller (NIC), which can be connected to other network devices and a router via a network cable to communicate with the Internet or a local area network. In one embodiment, the transmission device 1106 is a radio frequency (RF) module, which is configured to communicate with the Internet wirelessly.
[0110] In addition, the electronic device further includes: a display 1108; and a connection bus 1110 for connecting various module components in the electronic device.
[0111] In other embodiments, the terminal device or server may be a node in a distributed system, wherein the distributed system may be a blockchain system, and the blockchain system may be a distributed system formed by connecting multiple nodes through network communication. The nodes may form a peer-to-peer (P2P) network, and any computing device, such as a server, terminal, or other electronic device, may become a node in the blockchain system by joining the peer-to-peer network.
[0112] According to one aspect of the present application, a computer program product or computer program is provided, comprising computer instructions stored in a computer-readable storage medium. A processor of a computer device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computer device to perform the methods for processing recommendation information provided in the various optional implementations described above. The computer program is configured to execute the steps of any of the above-described method embodiments when executed.
[0113] Optionally, in this embodiment, the computer-readable storage medium may be configured to store a computer program for performing the following steps:
[0114] S1, obtaining a first data request sent by a target account, wherein the first data request is for requesting to obtain media information recommended to the target account;
[0115] S2, sending a second data request to each of the N databases, wherein the second data request is used to request media information recommended to the target account;
[0116] S3, obtaining N bitmaps returned by N databases, where each bitmap in the N bitmaps represents a recommendation result obtained from one of the N databases;
[0117] S4, performing a merge operation on the N bitmaps to obtain a target bitmap;
[0118] S5. Send the first media information subset to the target account, where the first media information subset is part or all of the media information corresponding to the target bitmap.
[0119] Optionally, in this embodiment, a person of ordinary skill in the art may understand that all or part of the steps in the various methods of the above embodiments may be completed by instructing the hardware related to the terminal device through a program, and the program may be stored in a computer-readable storage medium, which may include: a flash drive, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, etc.
[0120] The serial numbers of the above embodiments of the present invention are for description only and do not represent the advantages or disadvantages of the embodiments.
[0121] If the integrated units in the above embodiments are implemented in the form of software functional units and sold or used as independent products, they can be stored in the above-mentioned computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes a number of instructions for causing one or more computer devices (such as personal computers, servers, or network devices) to execute all or part of the steps of the methods of various embodiments of the present invention.
[0122] In the above embodiments of the present invention, the description of each embodiment has its own focus. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0123] In the several embodiments provided in this application, it should be understood that the disclosed client can be implemented in other ways. The device embodiments described above are merely illustrative. For example, the division of units is merely a logical functional division. In actual implementation, there may be other division methods, such as combining or integrating multiple units or components into another system, or ignoring or not implementing some features. Furthermore, the mutual coupling or direct coupling or communication connection shown or discussed may be through some interface, indirect coupling or communication connection of units or modules, and may be electrical or other forms.
[0124] Units described as separate components may or may not be physically separate, and components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected to achieve the purpose of this embodiment according to actual needs.
[0125] In addition, the functional units in the various embodiments of the present invention may be integrated into a single processing unit, each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or software functional units.
[0126] The above are only preferred embodiments of the present invention. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.
Claims
1. A method for processing recommendation information, characterized in that: include: Obtaining a first data request for requesting to recommend media information to a target account, wherein the first data request is sent by the target account; Sending a second data request corresponding to each of the N databases, respectively, wherein the second data request corresponding to each of the databases respectively carries a query condition that matches the respective database, and each of the query conditions includes at least one of the following: a popularity parameter of the media information, a rating parameter of the media information, and a release time parameter of the media information; Obtaining N bitmaps corresponding to N recommendation results found from the N databases according to the N query conditions, wherein a bit corresponding to the i-th media information recommended to the target account in the i-th bitmap is configured as a first value; Performing a merging operation on the N bitmaps to obtain a target bitmap; When there are P1 bits in the target bitmap whose values are the first value, obtaining a ranking parameter for each piece of media information in the P1 pieces of media information corresponding to the P1 bits, wherein the ranking parameter is a weighted sum of a popularity parameter of the media information and an evaluation level of the media information; Determining P2 pieces of media information from the P1 pieces of media information based on the sorting parameters of the pieces of media information; A first media information subset including the P2 media information is sent to the target account.
2. The method according to claim 1, characterized in that Each of the N databases records part or all of the media information in the target media information set, and the target media information set includes M media information arranged in a first arrangement order, where M and N are natural numbers greater than 1; each of the N bitmaps includes M bits arranged in the first arrangement order, and the M bits have a one-to-one correspondence with the M media information. A bit in the M bits whose value is the first value indicates that the media information corresponding to the bit with the first value in the M media information is the media information to be recommended to the target account; the target bitmap includes M bits arranged in the first arrangement order.
3. The method according to claim 2, wherein After performing the merging operation on the N bitmaps to obtain the target bitmap, the method further includes: Obtaining a popularity parameter of the P1 media information corresponding to the P1 bits in the M media information, wherein a value of the popularity parameter is positively correlated with at least one of the following: the number of times the media information is requested, the number of times the media information is viewed, and the number of times the media information is accessed; and / or Obtain evaluation levels of P1 pieces of media information corresponding to the P1 bits in the M pieces of media information, wherein the evaluation level is used to indicate the degree to which the media information is recognized. A higher evaluation level indicates a higher degree to which the media information is recognized.
4. The method according to claim 3, wherein After performing the merging operation on the N bitmaps to obtain the target bitmap, the method further includes: Obtaining the P2 media information with the largest value of the popularity parameter among the P1 media information according to the value of the popularity parameter; or The P2 media information with the largest evaluation level among the P1 media information is obtained according to the evaluation level.
5. The method according to claim 3, characterized in that The obtaining of the ranking parameter of each piece of media information in the P1 pieces of media information corresponding to the P1 bits includes: performing a weighted summation of the popularity parameter and the evaluation level of the P1 pieces of media information to obtain the ranking parameter of the P1 pieces of media information; The P2 media information having the largest value of the sorting parameter among the P1 media information is obtained according to the values of the sorting parameters of the P1 media information.
6. The method according to any one of claims 1 to 5, characterized in that The performing a merging operation on the N bitmaps to obtain a target bitmap includes: In a case where the first value is 1, performing an OR operation on the N bitmaps to obtain the target bitmap, wherein each of the N bitmaps includes M bits, the value of the M bits is 0 or 1, and the merging operation includes the OR operation; or In the case where the first value is 0, an AND operation is performed on the N bitmaps to obtain the target bitmap, wherein the values of the M bits are 0 or 1, and the merging operation includes the AND operation.
7. The method according to any one of claims 1 to 5, characterized in that After sending the second data request corresponding to each database in the N databases respectively, the method further includes: When the target server sends the second data requests corresponding to each of the N databases to each of the N databases, the media information to be recommended to the target account is searched for in each of the N databases according to a corresponding query condition, thereby obtaining a total of N recommendation results, wherein the N query conditions corresponding to the N databases are different, and each recommendation result represents the media information to be recommended to the target account found in a corresponding database of the N databases; Obtain the N bitmaps corresponding to the N recommendation results; The N bitmaps are sent to the target server.
8. The method according to claim 2, characterized in that In a case where the media information is an application and the target media information set includes M applications arranged in the first arrangement order, sending the first media information subset including the P2 media information to the target account includes: A first application subset among the M applications is sent to the target account.
9. The method according to claim 8, characterized in that When the media information is an application and the target media information set includes M applications arranged in the first arrangement order, sending a second data request corresponding to each database in the N databases respectively includes: The second data request is sent to at least two databases among a popular application database, a latest application database, and an editor recommendation database, respectively, wherein the N databases include the at least two databases.
10. A device for processing recommendation information, characterized in that: include: a first acquiring module, configured to acquire a first data request for requesting to recommend media information to a target account, wherein the first data request is sent by the target account; A first sending module is configured to send, to each of the N databases, a second data request corresponding to each of the N databases, wherein the second data request corresponding to each of the N databases carries a query condition that matches each of the databases, each of the query conditions including at least one of the following: a popularity parameter of the media information, a rating parameter of the media information, and a release time parameter of the media information; a second acquisition module, configured to acquire N bitmaps corresponding to the N recommendation results found from the N databases according to the N query conditions, wherein a bit corresponding to the i-th media information recommended to the target account in the i-th bitmap is configured as a first value; a merging module, configured to perform a merging operation on the N bitmaps to obtain a target bitmap; The second sending module is configured to obtain, when P1 bits in the target bitmap have the first value, a sorting parameter for each piece of media information in the P1 pieces of media information corresponding to the P1 bits, wherein the sorting parameter is a weighted sum of a popularity parameter of the media information and an evaluation level of the media information; determine P2 pieces of media information from the P1 pieces of media information based on the sorting parameters of the pieces of media information; and send a first media information subset including the P2 pieces of media information to the target account.
11. The device according to claim 10, characterized in that Each of the N databases records part or all of the media information in the target media information set, and the target media information set includes M media information arranged in a first arrangement order, where M and N are natural numbers greater than 1; each of the N bitmaps includes M bits arranged in the first arrangement order, and the M bits have a one-to-one correspondence with the M media information. A bit in the M bits whose value is the first value indicates that the media information corresponding to the bit with the first value in the M media information is the media information to be recommended to the target account; the target bitmap includes M bits arranged in the first arrangement order.
12. The device according to claim 11, wherein The second sending module is further configured to: Obtaining a popularity parameter of the P1 media information corresponding to the P1 bits in the M media information, wherein a value of the popularity parameter is positively correlated with at least one of the following: the number of times the media information is requested, the number of times the media information is viewed, and the number of times the media information is accessed; and / or Obtain evaluation levels of P1 pieces of media information corresponding to the P1 bits in the M pieces of media information, wherein the evaluation level is used to indicate the degree to which the media information is recognized. A higher evaluation level indicates a higher degree to which the media information is recognized.
13. The device according to claim 10, wherein The second sending module is further configured to: Obtaining the P2 media information with the largest value of the popularity parameter among the P1 media information according to the value of the popularity parameter; or The P2 media information with the largest evaluation level among the P1 media information is obtained according to the evaluation level.
14. A computer-readable storage medium, characterized in that The computer-readable storage medium includes a stored program, wherein the method according to any one of claims 1 to 9 is executed when the program is executed.
15. An electronic device comprising a memory and a processor, characterized in that: A computer program is stored in the memory, and the processor is configured to execute the method according to any one of claims 1 to 9 through the computer program.
Citation Information
Patent Citations
Resource downloading method and system and application server
CN102546686A
Program content recommendation method
CN107426620A