Object selection method and device, computer readable medium and electronic equipment
By predetermining the bucketing method and bitset data structure of the shuffling strategy, the problem of high computational complexity in traditional shuffling schemes is solved, enabling faster response in content recommendation and improved user experience.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- TENCENT TECH (BEIJING) CO LTD
- Filing Date
- 2024-11-21
- Publication Date
- 2026-05-22
AI Technical Summary
Traditional scattering algorithms have high time complexity, resulting in slow content recommendation response times.
By pre-determining the object set corresponding to each scattering strategy, a bucketing approach is adopted to reduce the amount of computation, and a bitset data structure is used to optimize the object selection process.
It significantly shortens the time spent on the fragmentation process, improving the response speed of content recommendation and user experience.
Smart Images

Figure CN122072664A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of content recommendation technology, and more specifically, to an object selection method, apparatus, computer-readable medium, and electronic device. Background Technology
[0002] In recommender systems, reordering is a method for adjusting recommendation results to optimize their display order and meet specific business needs or objectives. Reordering strategies can be based on various factors, such as item relevance, novelty, diversity, and user satisfaction. Diversification, on the other hand, is a reordering strategy used to ensure the diversity and novelty of recommendation results, preventing similar items from clustering together and thus avoiding overly concentrated and homogeneous recommendations. Diversification typically involves grouping, sorting, and recombining recommendation results to ensure good diversity in the recommendation list. Diversification techniques can improve user satisfaction and engagement, making the recommender system more robust and efficient, thereby improving its overall performance.
[0003] However, traditional shuffling schemes use algorithms with high time complexity and the shuffling process takes a long time, resulting in a slow response speed for content recommendation. Summary of the Invention
[0004] The embodiments of this application provide an object selection method, apparatus, computer-readable medium, and electronic device, which can at least reduce the amount of computation required for the object selection process, thereby significantly shortening the time consumed in the shuffling process.
[0005] Other features and advantages of this application will become apparent from the following detailed description, or may be learned in part from practice of this application.
[0006] According to one aspect of the embodiments of this application, an object selection method is provided. The method includes: when it is necessary to select a new object to add to a set of selected objects, for each object set corresponding to a scattering strategy in a scattering strategy set, determining the object set as an unselectable set corresponding to the scattering strategy based on the condition that the number of selected objects corresponding to the object set in the current set of selected objects reaches the quantity limit corresponding to the scattering strategy; wherein, the scattering strategy set includes at least two scattering strategies, the scattering strategy corresponds to at least one object set, the object set includes at least one object, and the object belongs to the overall object set; merging the unselectable sets corresponding to each scattering strategy to obtain an overall unselectable set; performing an inversion operation on the overall unselectable set relative to the overall object set to obtain a selectable set of objects; selecting a target object from the selectable set of objects, and adding the target object to the set of selected objects.
[0007] According to one aspect of the embodiments of this application, an object selection apparatus is provided. The apparatus includes: a judging unit, configured to, when it is necessary to select a new selection object to be added to a selection object set, determine, for each object set corresponding to a scattering strategy in a scattering strategy set, that the number of selection objects corresponding to the current selection object set reaches the quantity limit corresponding to the scattering strategy, the object set is designated as an unselectable set corresponding to the scattering strategy; wherein, the scattering strategy set includes at least two scattering strategies, each scattering strategy corresponds to at least one object set, each object set includes at least one object, and the object belongs to an overall object set; a merging unit, configured to merge the unselectable sets corresponding to each scattering strategy to obtain an overall unselectable set; an inverting unit, configured to invert the overall unselectable set relative to the overall object set to obtain a selectable object set; and a selection unit, configured to select a target selection object from the selectable object set and add the target selection object to the selection object set.
[0008] In some embodiments of this application, based on the foregoing scheme, the scattering strategy has a priority; the device further includes a reselection unit; the selection unit is configured to: if the selectable object set is not empty, select a target selection object from the selectable object set; after obtaining the selectable object set, the reselection unit is used to: if the selectable object set is empty, perform a downgrade operation on the scattering strategy with the lowest priority in the scattering strategy set to obtain a new scattering strategy set, wherein the downgrade operation includes removing the scattering strategy with the lowest priority or increasing the quantity limit corresponding to the scattering strategy with the lowest priority; and select objects based on the new scattering strategy set.
[0009] In some embodiments of this application, based on the foregoing scheme, the merging unit is configured to: merge each unselectable set corresponding to each scattering strategy in the scattering strategy set to obtain the merged unselectable set corresponding to the scattering strategy; and merge the merged unselectable sets corresponding to each scattering strategy to obtain the overall unselectable set.
[0010] In some embodiments of this application, based on the aforementioned scheme, the merging unit is configured to: set the intermediate result of the overall unselectable set to an empty set; starting from the highest priority scattering strategy in the scattering strategy set, perform merging operations sequentially on each scattering strategy in the scattering strategy set in descending order of priority, and take the intermediate result obtained from the last merging operation as the overall unselectable set; wherein, the merging operation includes: merging the unselectable set corresponding to the current scattering strategy with the intermediate result of the current overall unselectable set to obtain a new intermediate result of the overall unselectable set.
[0011] In some embodiments of this application, based on the foregoing scheme, the reselection unit is configured as follows: if the selectable object set is an empty set, and the intermediate result obtained after performing a merge operation on the lowest priority scattering strategy in the scattering strategy set has changed compared to the last intermediate result obtained before performing the merge operation, then the lowest priority scattering strategy in the scattering strategy set is downgraded to obtain a new scattering strategy set; the last intermediate result obtained before performing the merge operation on the lowest priority scattering strategy is obtained as the overall unselectable set corresponding to the new scattering strategy set, and the step of inverting the overall unselectable set relative to the overall object set and subsequent steps are re-executed based on the overall unselectable set corresponding to the new scattering strategy set.
[0012] In some embodiments of this application, based on the foregoing scheme, the selected objects in the selected object set are content to be recommended, and the device further includes an acquisition and sorting unit; before determining that the object set is the unselectable set corresponding to the scattering strategy, the acquisition and sorting unit is used to: acquire the recommendation score corresponding to each object in the overall object set, the recommendation score being used to measure the target user's preference for the object; sort each object in the overall object set from high to low according to the corresponding recommendation score; the selection unit is configured to: select the object with the smallest sorting number from the selectable object set as the target selection object.
[0013] In some embodiments of this application, based on the foregoing scheme, the selection object set is a set of recommended content to be displayed on the target page, the target page includes at least two locations for displaying the recommended content, and the judgment unit is configured to: whenever it is necessary to select an object for a new location on the target page, for each object set corresponding to each scattering strategy in the scattering strategy set, if the number of selected objects corresponding to the current selection object set reaches the quantity limit corresponding to the scattering strategy, the object set is designated as the unselectable set corresponding to the scattering strategy; the selection unit is configured to: select the object with the smallest sorting number from the selectable object set as the target selection object for the new location on the target page.
[0014] In some embodiments of this application, based on the foregoing scheme, the device further includes a recommendation unit; after the target selection object is added to the selection object set, the recommendation unit is used to: if the selection object set contains selection objects selected for each position of the target page, recommend the selection objects in the selection object set to the target user through the target page.
[0015] In some embodiments of this application, based on the foregoing scheme, each set of objects corresponding to each scattering strategy is stored in a bit set, and each bit data in the bit set corresponds to an object in the overall set of objects. The bit data is used to indicate whether the object corresponding to the bit data in the overall set of objects is located in the set of objects corresponding to the scattering strategy.
[0016] According to one aspect of the embodiments of this application, a computer-readable medium is provided having a computer program stored thereon, which, when executed by a processor, implements the object selection method as described in the above embodiments.
[0017] According to one aspect of the embodiments of this application, an electronic device is provided, including: one or more processors; and a storage device for storing one or more programs, which, when executed by the one or more processors, cause the one or more processors to implement the object selection method as described in the above embodiments.
[0018] According to one aspect of the embodiments of this application, a computer program product is provided, the computer program product including computer instructions stored in a computer-readable storage medium, a processor of a computer device reading the computer instructions from the computer-readable storage medium, and the processor executing the computer instructions, causing the computer device to perform the object selection method as described in the above embodiments.
[0019] In some embodiments of this application, when a new selection object needs to be selected for a set of selection objects, for each set of objects corresponding to each scattering strategy, if the number of selection objects corresponding to that set in the current selection object set reaches the quantity limit corresponding to the scattering strategy, then that set of objects is regarded as an unselectable set corresponding to the scattering strategy. The above operation is performed on each set of objects corresponding to each scattering strategy in the scattering strategy set to obtain an unselectable set corresponding to each scattering strategy. Then, the unselectable sets corresponding to each scattering strategy are merged to obtain an overall unselectable set, and the overall unselectable set is inverted relative to the overall set of objects to obtain a set of selectable objects. Finally, the target selection object can be directly selected from the set of selectable objects and added to the selection object set, thereby realizing the selection of a new selection object.
[0020] Therefore, the solution provided in this application innovatively proposes to select objects by selecting a set of objects instead of directly selecting the objects themselves. Since the set of objects corresponding to each scattering strategy is predetermined before the object selection process, there is no need to perform calculations during the formal object selection process. This reduces the complexity of the algorithm, reduces the amount of computation required for the object selection process, and significantly shortens the time consumed by the scattering process. In turn, it can improve the response speed of content recommendation and improve the user experience.
[0021] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and do not limit this application. Attached Figure Description
[0022] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application. It is obvious that the drawings described below are merely some embodiments of this application, and those skilled in the art can obtain other drawings based on these drawings without any inventive effort. In the drawings:
[0023] Figure 1 A flowchart illustrating a breakdown framework in related technologies that includes a degradation strategy is shown.
[0024] Figure 2 A schematic diagram of an exemplary system architecture to which the technical solutions of the embodiments of this application can be applied is shown;
[0025] Figure 3 A flowchart of an object selection method according to an embodiment of this application is shown;
[0026] Figure 4 An embodiment according to this application is shown. Figure 3 A flowchart detailing the steps preceding step 330 and step 370 in the embodiment;
[0027] Figure 5 A flowchart illustrating the overall framework of an object selection method according to an embodiment of this application is shown.
[0028] Figure 6 An embodiment according to this application is shown. Figure 4 A flowchart detailing steps 330 and 370' in the embodiment;
[0029] Figure 7 An embodiment according to this application is shown. Figure 3 The flowcharts of the steps before step 370, the details of step 370, and the steps after step 350 in the embodiment;
[0030] Figure 8 An embodiment according to this application is shown. Figure 7 A flowchart detailing step 340 in the embodiment;
[0031] Figure 9 A schematic diagram comparing the latency of existing scattering methods with the solutions provided in two embodiments of this application in a channel page scenario is shown;
[0032] Figure 10 A schematic diagram comparing the latency of existing scattering methods with the solution provided in the embodiments of this application in a homepage search and filtering scenario is shown;
[0033] Figure 11 A block diagram of an object selection apparatus according to an embodiment of this application is shown;
[0034] Figure 12 A schematic diagram of the structure of a computer system suitable for implementing the electronic device of the present application is shown. Detailed Implementation
[0035] Exemplary embodiments will now be described more fully with reference to the accompanying drawings. However, these exemplary embodiments can be implemented in many forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided to make this application more comprehensive and complete, and to fully convey the concept of the exemplary embodiments to those skilled in the art.
[0036] Furthermore, the described features, structures, or characteristics can be combined in any suitable manner in one or more embodiments. Numerous specific details are provided in the following description to give a thorough understanding of embodiments of this application. However, those skilled in the art will recognize that the technical solutions of this application can be practiced without one or more of the specific details, or other methods, components, apparatuses, steps, etc., can be employed. In other instances, well-known methods, apparatuses, implementations, or operations are not shown or described in detail to avoid obscuring various aspects of this application.
[0037] In this application embodiment, the terms "module" or "unit" refer to a computer program or part of a computer program that has a predetermined function and works with other related parts to achieve a predetermined goal, and can be implemented wholly or partially using software, hardware (such as processing circuitry or memory), or a combination thereof. Similarly, a processor (or multiple processors or memory) can be used to implement one or more modules or units. Furthermore, each module or unit can be part of an overall module or unit that includes the functionality of that module or unit.
[0038] The block diagrams shown in the accompanying drawings are merely functional entities and do not necessarily correspond to physically independent entities. That is, these functional entities can be implemented in software, in one or more hardware modules or integrated circuits, or in different network and / or processor devices and / or microcontroller devices.
[0039] The flowcharts shown in the accompanying drawings are merely illustrative and do not necessarily include all content and operations / steps, nor do they necessarily have to be performed in the described order. For example, some operations / steps can be broken down, while others can be combined or partially combined; therefore, the actual execution order may change depending on the specific circumstances.
[0040] A recommender system is an information filtering system designed to predict a user's preference for items or products and recommend those items to the user. The main goal of a recommender system is to provide personalized recommendations, helping users find content of interest from a large amount of information. Recommender systems are widely used in e-commerce, social media, news portals, and other fields.
[0041] Reordering is a method for adjusting the recommendation results of a recommendation system. Its purpose is to optimize the display order of these results to meet specific business needs or objectives. Reordering strategies can be based on various factors, such as item relevance, novelty, diversity, and user satisfaction.
[0042] Dispersing is a rearrangement strategy aimed at introducing diversity into the recommendations provided by a recommender system, preventing similar items from clustering together. Dispersing can improve user satisfaction and exploration, thereby enhancing the overall performance of the recommender system. Dispersing typically involves grouping, sorting, and recombining the recommendations to ensure good diversity in the recommended list.
[0043] Figure 1 A flowchart illustrating a breakdown framework in related technologies that includes a degradation strategy is shown. Please refer to [link / reference]. Figure 1 As shown, in related technologies, the breakdown framework that includes a degradation strategy has four layers of loops, and its specific process is as follows:
[0044] 101. Selection Operator.
[0045] The selection operator is executed, which is the core selection process of the rearrangement service.
[0046] 102. Initialization.
[0047] Execute the initialization logic in the selection operator.
[0048] 103. Control (Select a location).
[0049] Determine the location to which the selected content will be located.
[0050] 104. Traverse the items.
[0051] Iterate through all the candidate items one by one.
[0052] 105. Check (verify each breakup strategy).
[0053] For each candidate item, check whether it passes all the scattering strategies. If a candidate item passes all the scattering strategies, select the candidate item and return to step 103 to continue selecting content for the next position. If a candidate item fails one of the scattering strategies, i.e. the candidate item fails the check, discard the candidate item and return to step 104 to continue checking the next candidate item until a candidate item that passes all the scattering strategies is selected.
[0054] 106. Downgrade the strategy of breaking up the system.
[0055] If all candidate items fail to be validated, a downgrade of a certain shuffling strategy will be performed once (each shuffling strategy has a unique priority order, and the shuffling strategy with the lowest priority will be downgraded first), and then return to step 104.
[0056] Assuming the total number of requests is N, the number of candidate contents is M, and the number of scattering strategies is X, then in the best case, the validity of only one content is checked at each position, and the time complexity is O(N×X). In the worst case, each scattering strategy at each position performs a downgrade, so the number of downgrades is X, and the worst-case time complexity is O(N×M×X²).
[0057] Therefore, the fragmentation framework in related technologies has the following drawbacks:
[0058] First, each candidate item needs to be re-evaluated to see if it meets all the conditions of the shuffling strategy each time it is selected, even for those rules that have not been downgraded, which inherently wastes some performance.
[0059] Second, during the downgrade process, it is impossible to effectively determine whether the downgrade can select legal content that satisfies the remaining shuffling strategy. This will cause some high-priority blocking downgrade strategies to be downgraded later, while many low-priority strategies have been downgraded many times but have no effect, resulting in additional performance overhead.
[0060] Third, in the worst case, the time complexity is high, which will lead to a significant increase in the time consumption of long tail as the business iterates and evolves, with the increase in the number of candidate contents M or the number of scattering strategies X.
[0061] To address this, this application first provides an object selection method. The object selection method provided by the embodiments of this application overcomes the aforementioned deficiencies of related technologies, breaking away from the conventional approach of "selecting items one by one." It innovatively proposes selecting "buckets" instead of individual items. By pre-calculating the buckets for each scattering rule, the computational load during the selection process is reduced. Furthermore, by using a data structure compatible with this algorithm framework—bitset—time efficiency is significantly optimized.
[0062] Figure 2 A schematic diagram of an exemplary system architecture to which the technical solutions of the embodiments of this application can be applied is shown. For example... Figure 2As shown, the system architecture 200 may include a user terminal 210, a backend server 220, a recommendation system server 230, a first database server 240, a second database server 250, and a third database server 260. The user terminal 210, recommendation system server 230, and third database server 260 are all connected to the backend server 220. The first database server 240 and second database server 250 are also connected to the backend server 220. The user terminal 210 has a video platform client deployed on it, the backend server 220 has a video platform server deployed on it, the recommendation system server 230 has a recommendation system, a recall model, and a deep neural network model deployed on it, the first database server 240 stores user-related data, the second database server 250 stores video-related data, and the third database server 260 stores video recommendation list data. The recommendation system server 230 can be the execution entity of the scheme in this application embodiment. When the object selection method provided in this application embodiment is applied... Figure 2 In the system architecture shown, a process can be like this:
[0063] First, a user initiates an access request to the video platform's homepage to the backend server 220 via the video platform's client on user terminal 210. This access request carries the user's user identifier. Then, upon receiving the access request, the backend server 220 generates a recommendation request based on the user identifier in the access request and sends it to the recommendation system server 230. Next, upon receiving the recommendation request, the recommendation system server 230 performs a recall operation. The recommendation system uses a recall model to determine a suitable original video set for recommendation based on the user identifier in the recommendation request, user-related data in the first database server 240, and video-related data in the second database server 250. Then, the recommendation system continues to perform preliminary screening (coarse ranking) of the videos in the original video set based on the video-related data in the second database server 250, according to predefined rules (such as video popularity, upload time, tag matching, etc.), to obtain a preliminary candidate video set. Finally, the recommendation system uses the user-related data in the first database server 240 and the video-related data in the second database server 250... The system constructs feature data for each candidate video in the initial candidate video set, inputs this feature data into a deep neural network model, and obtains the model prediction score for each candidate video. Next, the recommendation system sorts the candidate videos from highest to lowest according to their model prediction scores, records the sorting number, and assigns each candidate video to a candidate video set corresponding to a specific scattering strategy. Then, based on the candidate videos in the video sets corresponding to each scattering strategy, the sorting number of each candidate video, and the scattering strategy, the recommendation system sequentially selects candidate videos for each position on the video platform's homepage, thus obtaining the final selected video set. The recommendation system then sends the final selected video set to the backend server 220. Finally, the backend server 220 retrieves recommendation list data corresponding to the videos in the final video set from the third database server 260, constructs the video platform's homepage page based on this recommendation list data, and returns the page to the user terminal 210, where it is displayed on the video platform's client.
[0064] In some embodiments of this application, user-related data includes each user's viewing history, search history, likes, shares, comments, subscriptions, and other data.
[0065] In some embodiments of this application, video-related data includes video metadata (title, description, tags, category), video features (duration, resolution, encoding format), user-generated comments and ratings, etc.
[0066] In some embodiments of this application, the video recommendation list data includes information such as the ID, title, description, thumbnail URL, and number of plays for each video.
[0067] In some embodiments of this application, the recall model is a collaborative filtering algorithm.
[0068] In some embodiments of this application, the candidate video set corresponding to each scattering strategy is stored in memory.
[0069] It should be noted that, Figure 2 The illustration shown is merely one embodiment of this application. Although in Figure 2 In the embodiment, the user terminal is a desktop computer. However, in other embodiments of this application, the user terminal can also be various types of terminal devices such as smartphones, laptops, tablets, vehicle terminals, portable wearable devices, and workstations. When the user terminal is a smartphone, the client of the video platform deployed on the user terminal can be an APP. Although Figure 2 The embodiment applies the object selection method to the selection of video content. However, in other embodiments of this application, the object selection method can also be applied to the selection of social media content, news content on news portals, and product content in e-commerce scenarios. Figure 2 In the embodiment, user-related data, video-related data, and recommendation list data are stored in different databases. However, in other embodiments of this application, one or more of these data may be stored in the same database. Figure 2 In the embodiment, the recommendation system, recall model, and deep neural network model are deployed on the same server; however, in other embodiments of this application, they may be deployed on different servers. Figure 2 In the embodiment, the recommendation system performs preliminary screening of videos in the original video set according to predefined rules. However, in other embodiments of this application, machine learning models such as logistic regression and decision trees can also be used to perform preliminary screening of videos in the original video set. Figure 2 In the embodiments described, the recommendation system and the video platform servers are deployed on different servers. However, in other embodiments of this application, they may be deployed on the same server. This application does not limit the scope of protection in any way.
[0070] It should be understood that Figure 2The number of user terminals, backend servers, recommendation system servers, and database servers shown is merely illustrative. Depending on implementation needs, there can be any number of user terminals, and the backend servers, recommendation system servers, and database servers can all be server clusters consisting of multiple servers.
[0071] It is easy to understand that the object selection method provided in the embodiments of this application is generally executed by a server, and correspondingly, the object selection device is generally located in the server. However, in other embodiments of this application, the terminal device may also have similar functions to the server, thereby executing the object selection scheme provided in the embodiments of this application.
[0072] Therefore, the embodiments of this application can be applied to terminals or servers. The server can be a standalone physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN, and big data and artificial intelligence platforms. The terminal can be a smartphone, tablet, laptop, desktop computer, smart speaker, smartwatch, etc., but is not limited to these. The terminal and server can be directly or indirectly connected via wired or wireless communication, and this application does not impose any restrictions.
[0073] The implementation details of the technical solutions in the embodiments of this application are described in detail below:
[0074] Figure 3 A flowchart illustrating an object selection method according to an embodiment of this application is shown. This object selection method can be executed by various devices with processing and computing capabilities. Specifically, it can be executed by a target device, such as a user terminal or a cloud server. User terminals include, but are not limited to, mobile phones, computers, smart voice interaction devices, smart home appliances, vehicle terminals, aircraft, smartwatches, etc. Please refer to... Figure 3 As shown, the object selection method includes at least the following steps:
[0075] Step 330: When it is necessary to select a new object to add to the selection object set, for the object sets corresponding to each scattering strategy in the scattering strategy set, based on the situation where the number of selected objects corresponding to the current selection object set reaches the quantity limit corresponding to the scattering strategy, the object set is determined as the unselectable set corresponding to the scattering strategy.
[0076] The selected objects in the selection set can be content to be recommended. This content can include videos, music, online news, social media posts, and any other content that can be recommended to and accessed by the user.
[0077] Before going into detail about step 330, let’s first go into the steps that precede step 330.
[0078] Figure 4 An embodiment according to this application is shown. Figure 3 A flowchart detailing the steps preceding step 330 and step 370 in this embodiment. Please refer to [link / reference]. Figure 4 As shown, before determining the set of objects as the unselectable set corresponding to the scattering strategy, the object selection method may include the following steps:
[0079] In step 310, the recommendation score for each object in the overall object set is obtained. The recommendation score is used to measure the target user's preference for the object.
[0080] The objects in the overall collection can be videos, music, online news, social media posts, etc.
[0081] Step 310 can be executed after the target user initiates an access request to the target page, which has multiple object layout positions, each used to display the object selected for it.
[0082] After a target user initiates an access request to the target page, you can first identify each object in the overall object set, and then obtain the recommendation score corresponding to each object.
[0083] Each object in the overall object set can be determined based on the target user who initiated the access request. Each object in the overall object set can be a candidate object that the user may like to access based on user-related data, i.e., the item to be selected.
[0084] A higher recommendation score for an object indicates a stronger user preference for it. The recommendation score can be a score predicted by a model (model-predicted score), which can be a deep neural network model or other machine learning model. The recommendation score can be generated by the model based on the features related to each object and the target user.
[0085] To simplify the calculation process, each object in the overall collection of objects can actually be an object identifier (object ID).
[0086] In step 320, the objects in the overall object set are sorted from highest to lowest according to their corresponding recommendation scores.
[0087] The objects in a collection can be sorted using sorting algorithms such as bubble sort.
[0088] As is readily understood, in other embodiments of this application, the cosine distance between the feature vectors corresponding to each object in the overall object set and the feature vectors corresponding to the target user can also be obtained, and the objects in the overall object set can be sorted from low to high according to the corresponding cosine distance.
[0089] Figure 5 A general framework flowchart of an object selection method according to an embodiment of this application is shown. Please refer to... Figure 5 As shown, the object selection method requires initialization before execution. This initialization involves the execution of the Constructbitset operator. During the Constructbitset operator, each object in the overall object set is sorted from highest to lowest according to its recommended score, and the sorting number of each object is recorded. This sorting number is used as the object's index number. For example, if the overall object set contains 1000 objects, then the index number of each object can be from 0 to 999.
[0090] Please continue reading Figure 3 In step 330, when it is necessary to select a new object to add to the selection object set, for the object sets corresponding to each scattering strategy in the scattering strategy set, based on the situation that the number of selected objects corresponding to the object set in the current selection object set reaches the quantity limit corresponding to the scattering strategy, the object set is determined as the unselectable set corresponding to the scattering strategy.
[0091] Whenever a new selection object needs to be added to the selection object set, for each object set corresponding to each scattering strategy in the scattering strategy set, if the number of selection objects in the current selection object set that correspond to the object set reaches the quantity limit corresponding to the scattering strategy, the object set will be regarded as the unselectable set corresponding to the scattering strategy.
[0092] The scattering strategy is used to make the selected object set more diverse. The scattering strategy set includes at least two scattering strategies, each scattering strategy corresponds to at least one object set, the object set includes at least one object, and the object belongs to the overall object set.
[0093] In one embodiment of this application, the selected object set is a set of recommended content to be displayed on the target page, and the target page includes at least two locations for displaying the recommended content.
[0094] As mentioned earlier, the selected object can be the content to be recommended. In order to display a complete target page, it is necessary to first determine what content to be recommended will be displayed in each position on the target page. Therefore, before generating the target page, it is necessary to first determine the set of content to be recommended that will be displayed in each position on the target page.
[0095] Figure 6 An embodiment according to this application is shown. Figure 4 A flowchart detailing steps 330 and 370' in the embodiment is provided. Please refer to [link / reference]. Figure 6 As shown, when a new object needs to be added to the selection object set, for each object set corresponding to a scattering strategy in the scattering strategy set, based on whether the number of selected objects corresponding to the current object set reaches the quantity limit corresponding to the scattering strategy, the object set is determined as the unselectable set corresponding to the scattering strategy. Specifically, this may include the following steps:
[0096] In step 330', whenever it is necessary to select an object for a new location on the target page, for each object set corresponding to each scattering strategy in the scattering strategy set, if the number of selected objects in the current selected object set reaches the quantity limit corresponding to the scattering strategy, the object set is regarded as the unselectable set corresponding to the scattering strategy.
[0097] Specifically, objects need to be selected for each location on the target page, following the order in which they are arranged on the page. The first location a user sees on the target page is the first one selected. The locations on the target page can be arranged in a grid or a list. When arranged in a grid, each row can include multiple locations; the higher a location is in the row, the earlier it appears in the list. Within the same row, the leftmost location of a location indicates its earlier appearance. When arranged in a list, the higher or leftmost location of a location indicates its earlier appearance.
[0098] A set of scattering strategies can include at least two different scattering strategies. A scattering strategy, also known as a scattering rule, is used to introduce diversity into the recommendation results and prevent similar items from clustering together.
[0099] Each scattering strategy corresponds to a method of object partitioning, and the set of objects corresponding to each scattering strategy can be obtained by partitioning the objects using the object partitioning method corresponding to that scattering strategy. Each object partitioning method corresponds to a set of labels, and the objects in each set of objects partitioned using that object partitioning method correspond to each label in that set of labels.
[0100] There are many ways to store a collection of objects, as long as it can group different objects together.
[0101] For example, each set of objects can be a bucket, specifically a bucket for tagging in a scattering strategy. In a scattering strategy, objects with the same tag are placed into the same tag bucket. For instance, in a video recommendation system, a video may belong to one of multiple categories (such as movies, TV series, variety shows, animation, documentaries, children's content, etc.). If a scattering strategy requires that "content of the same category cannot appear consecutively," then these categories will correspond to different tag buckets under that scattering strategy; these categories are the tags.
[0102] Specifically, this application can be applied to the shuffling framework in the reordering service of recommendation systems, and is particularly suitable for scenarios with many shuffling strategies and degradation requirements.
[0103]
[0104] Table 1
[0105] Please refer to Table 1, which illustrates a simple video recommendation scenario requiring content fragmentation. In this scenario, assume there are three fragmentation strategies: A, B, and C. For example, fragmentation strategy A is "maximum of two items of the same category can appear," meaning that at most two items of the same category will appear on the target page. Each fragmentation strategy corresponds to at least one tag bucket, and tag buckets can belong to the corresponding fragmentation strategy. The numbers in the "item" column of Table 1 represent objects, specifically videos. Each tag bucket includes at least one object (item), meaning each tag bucket includes at least one candidate content. For example, fragmentation strategy A has six tag buckets: TV series, movies, variety shows, animation, children's content, and documentaries. The "TV series" tag bucket includes two objects: item 1 and item 6. Points of interest (POIs) are also equivalent to tags, and their corresponding tags in the tag buckets are usually located in different dimensions. For example, POIs can be dimensions such as history, urban life, and food, or dimensions such as actors, plot highlights, emotional value, directors, and character design. For example, in Table 1, item 1 is a TV series category, which is a mid-length video, and it has the point of interest (POI A).
[0106] Each object does not necessarily participate in all shuffling strategies. For example, there are three shuffling strategies in the set of shuffling strategies: shuffling strategy 1, shuffling strategy 2, and shuffling strategy 3. Object A corresponds to shuffling strategy 1 and shuffling strategy 2, that is, object A exists in the object set corresponding to shuffling strategy 1 and shuffling strategy 2, respectively. However, object A may not correspond to shuffling strategy 3, that is, object A may not exist in the object set corresponding to shuffling strategy 3.
[0107] It is easy to understand that the same object can exist in different sets of objects corresponding to the same scattering strategy. In other words, at least one object in different sets of objects corresponding to the same scattering strategy can be the same.
[0108] For example, in Table 1, the object item 6 exists in both POI A and POI B tag buckets.
[0109] The quantity limit for a breakup strategy is a limitation on the number of items within the breakup strategy itself. For example, for a breakup strategy where "a maximum of two items of the same category can be published," the corresponding quantity limit is 2.
[0110] The Limit value can be used in conjunction with the Window size, which is the dimensions of the sliding window used to specify the range of observation limits. In a shuffling strategy, Limit represents the maximum number of times a content item from the same Bucket can appear in the recommendation results within the Window. For example, if the shuffling strategy requires that "content items of the same category cannot appear consecutively," then a Limit value of 1 and a Window value of 2 mean that in any two adjacent positions (with a window size of 2), at most one item of the same category can appear.
[0111] Window size is generally below 10. When the window size is 10, the "maximum of 2 items of the same category" scattering strategy means that at most 2 items of the same category can appear in any 10 consecutive positions on the target page.
[0112] In one embodiment of this application, each set of objects corresponding to each scattering strategy is stored in a bit set. Each bit data in the bit set corresponds to an object in the overall set of objects. The bit data is used to indicate whether the object corresponding to the bit data in the overall set of objects is located in the set of objects corresponding to the scattering strategy.
[0113] A bitset is a class template in the C++ standard library that provides a fixed-size set of bits to represent a group of binary bits (0 or 1). `std::bitset` provides a series of methods for manipulating bits, such as setting, resetting, toggling, and counting. In addition, `std::bitset` supports bitwise operations such as AND (&), OR (|), and XOR (^).
[0114] Please continue reading Figure 5 When executing the bit set construction operator, the objects contained in each tag bucket corresponding to all the shuffling strategies will also be stored using a two-level map, which can be represented in code as follows:
[0115] std::unordered_map <std::string,std::unordered_map<std::string,std::bitset<LONG_ITEM_AT_MOST> >>
[0116] In this two-level map, the first-level key represents a certain scattering strategy, the second-level key represents a certain tag bucket, and the value is a bitset structure indicating whether each object matches the tag bucket. If it matches, it is set to 1; otherwise, it can be set to 0.
[0117] Therefore, the collection of objects can be stored in memory to speed up object selection.
[0118] In other words, the tag buckets in this embodiment are stored in the form of a bitset structure. Of course, in other embodiments of this application, the tag buckets can also adopt structures such as std::vector, std::set, std::unordered_sett.
[0119] To further improve the speed of object selection, the original object set to which all objects belong can be pre-calculated. Then, when object selection is required, since it is only necessary to select based on a portion of all objects (other objects have been filtered out), the objects can be divided into new object sets corresponding to each original object set according to the relationship between all objects and the original object set, and object selection can be performed based on the new object set.
[0120] In the shuffling strategy of the reordering service, it is known which shuffling strategies and which tag buckets each object belongs to. For example, an album belongs to the anime category in the "category shuffling rule," and this will not change due to other factors. It is also known whether the quantity limit corresponding to the tag bucket under certain shuffling strategies has been reached. For example, if two anime categories have already been selected, and there is a rule that "a maximum of two anime categories can be selected," then the quantity limit corresponding to the anime category has already been reached in the next position.
[0121] When selecting objects at a certain location, without downgrading, if the number of objects in the selected object set that corresponds to a certain object set of a certain scattering strategy reaches the quantity limit corresponding to that scattering strategy, then all objects in that object set cannot be selected at that location.
[0122] In step 340, the unselectable sets corresponding to each scattering strategy are merged to obtain the overall unselectable set.
[0123] Figure 7An embodiment according to this application is shown. Figure 3 The flowcharts of the steps before step 370, the details of step 370, and the steps after step 350 in the embodiment; Figure 8 An embodiment according to this application is shown. Figure 7 A flowchart detailing step 340 in the embodiment is provided. Please refer to [link / reference]. Figures 7-8 The process of merging the unselectable sets corresponding to each scattering strategy to obtain the overall unselectable set may include the following steps:
[0124] In step 341, for each scattering strategy in the scattering strategy set, the unselectable sets corresponding to the scattering strategy are merged to obtain the merged unselectable set corresponding to the scattering strategy.
[0125] The number of selected objects corresponding to the current selected object set reaches the quantity limit corresponding to the scattering strategy, which means that the object set meets the limit condition.
[0126] If a labeled bucket satisfies the limit condition, it can be represented as P(B). Then, the set of unselectable buckets after merging corresponding to the shuffling strategy R is S. R for:
[0127]
[0128] Among them, B j To create a bucket for the j-th label, P(B) j ) indicates that the label is in bin B. j B meets the limit conditions j ∈R represents B j The j-th label of the scattering strategy R is divided into buckets.
[0129] In other words, if the label is divided into bins B j If the limit condition is met, then it becomes an unselectable set corresponding to the scattering strategy R.
[0130] Merging the unselectable sets corresponding to the scattering strategy can be done by finding the union of the unselectable sets corresponding to the scattering strategy.
[0131] In step 342, the unselectable sets corresponding to each scattering strategy are merged to obtain the overall unselectable set.
[0132] The unselectable sets after merging can be merged in the following way:
[0133]
[0134] Among them, R i For the i-th scattering strategy, B j ∈Ri Representing B j For the scattering strategy R i Let the j-th label be a bucket, and let S be the set of all unselectable labels.
[0135] Dispersion strategies can have priorities, and different dispersion strategies can have different priorities.
[0136] In one embodiment of this application, merging the merged unselectable sets corresponding to each scattering strategy to obtain an overall unselectable set includes: setting the intermediate result of the overall unselectable set to an empty set; starting from the scattering strategy with the highest priority in the scattering strategy set, performing a merge operation on each scattering strategy in the scattering strategy set in descending order of priority, and using the intermediate result obtained from the last merge operation as the overall unselectable set; wherein, the merge operation includes: combining the intermediate result of the merged unselectable set corresponding to the current scattering strategy with the intermediate result of the current overall unselectable set to obtain a new intermediate result of the overall unselectable set.
[0137] In the set of shuffling strategies, the priorities are ranked from highest to lowest as follows: first shuffling strategy, second shuffling strategy, third shuffling strategy, and so on. That is, the second shuffling strategy is the shuffling strategy with the second highest priority in the set of shuffling strategies, and the third shuffling strategy is the shuffling strategy with the third highest priority in the set of shuffling strategies.
[0138] During program algorithm execution, the computation of the set S that is not selectable as a whole can actually be completed iteratively.
[0139] For all N scattering strategies, the following operations can be performed sequentially:
[0140]
[0141] Among them, all N scattering strategies can be sorted in descending order of priority, R i This represents the i-th scattering strategy among all N scattering strategies, ranked from highest to lowest priority. Represents the i-th scattering strategy R i The resulting merged set cannot be selected. The representative will target the i-th scattering strategy R i The resulting unselectable set after merging and the set based on the priority-higher-than-dispersal strategy R i The intermediate result S of the overall unselectable set obtained by merging the unselectable sets corresponding to all the scattering strategies, where the initial value of S can be an empty set.
[0142] In step 350, the set of unselectable objects is inverted relative to the set of objects to obtain the set of selectable objects.
[0143] The operation of negating the set of unselectable objects relative to the set of objects means obtaining the set of objects that belong to the set of objects but do not belong to the set of unselectable objects.
[0144] The selectable object set can be obtained in the following way:
[0145]
[0146] Where S is a set that cannot be selected as a whole, S ′ This is a set of selectable objects.
[0147] Please see Figure 7 As shown, prior to step 370, the object selection method may include the following steps:
[0148] In step 360, it is determined whether the set of selectable objects is an empty set.
[0149] If no, proceed to step 371; if yes, proceed to step 380.
[0150] In step 370, the target selection object is selected from the selectable object set and added to the selection object set.
[0151] Each time a target object is selected, it can be removed from the corresponding object collection; of course, you can also choose not to remove the target object, as long as the selected objects in the collection are not duplicated.
[0152] Please continue reading Figure 4 As shown, selecting the target object from the selectable object set can specifically include the following steps:
[0153] In step 370', the object with the smallest sorting number is selected from the selectable object set as the target selection object.
[0154] Since the objects in the overall object set are sorted from highest to lowest according to their corresponding recommendation scores, selecting the object with the smallest sort number ensures that the object with the highest recommendation score is selected first.
[0155] Please continue reading Figure 6 As shown, when the method provided in the above embodiment is executed for the aforementioned new location on the target page, selecting the object with the smallest sorting number from the selectable object set as the target selection object can specifically include the following steps:
[0156] In step 370", the object with the smallest sort number is selected from the selectable object set and used as the target selection object for the new location of the target page.
[0157] In one embodiment of this application, after adding the target selection object to the selection object set, the object selection method may further include: if the selection object set contains selection objects selected for each location on the target page, recommending the selection objects in the selection object set to the target user through the target page.
[0158] As is easy to understand, the selected object set can contain object IDs or index numbers. In practical scenarios, it's necessary to retrieve the recommendation list information for each selected object in the set based on its ID and / or index number, and then present this information to the target user through the target page. For example, in a video recommendation scenario, the recommendation list information could include video thumbnails, titles, and other information.
[0159] You can add each selected object from the selection set to the target page according to its corresponding position, and then return the target page to the target user who requested access to the target page.
[0160] Please continue reading Figure 7 As shown, selecting the target object from the selectable object set can specifically include the following steps:
[0161] In step 371, if the selectable object set is not empty, the target object is selected from the selectable object set.
[0162] If the set of selectable objects is not empty, it means that the target object can be selected.
[0163] After obtaining the set of selectable objects, the object selection method may also include:
[0164] In step 380, if the selectable object set is an empty set, then the lowest priority scattering strategy in the scattering strategy set is downgraded to obtain a new scattering strategy set. The downgrade operation includes removing the lowest priority scattering strategy or increasing the quantity limit corresponding to the lowest priority scattering strategy.
[0165] The downgrade operation can either remove the lowest priority breakup strategy or increase the quantity limit corresponding to the lowest priority breakup strategy.
[0166] When the selectable object set S ′ When the set is empty, a degradation process needs to be performed. Degradation can involve discarding the lowest priority shuffling strategy and all its corresponding object sets, then reselecting objects based on the remaining shuffling strategies and their corresponding object sets, and recalculating the overall unselectable set S and selectable object set S'. ′ If S ′ If it is still empty, continue the downgrade process until a non-empty S is obtained.′ .
[0167] Downgrading can also increase the quantity limit corresponding to the lowest priority shuffling strategy. This will result in a new set of shuffling strategies, requiring object selection to be performed again based on this new set of strategies and their corresponding object sets, and the overall unselectable set S and selectable object set S''''''''''''''''''''''''''''""""""'s' ... ′ If S ′ If it is still empty, continue the downgrade process until a non-empty S is obtained. ′ .
[0168] When downgrading to increasing the quantity limit corresponding to the lowest priority shuffling strategy, the downgrading operation can be performed on the lowest priority shuffling strategy among the shuffling strategies that have undergone the fewest downgrading operations. For example, if the shuffling strategies are A, B, C, and D from high to low priority, and D has been downgraded to D1, then the next downgrading operation can be performed on C, because D1 is the shuffling strategy obtained after performing one downgrading operation.
[0169] It is easy to understand that the downgrade operation of the scatter strategy in the scatter strategy set is only for the current position. When it is necessary to select an object for a next position on the target page, the object selection needs to be re-based on the scatter strategy set used in step 330.
[0170] In one embodiment of this application, if the selectable object set is an empty set, then the lowest priority scattering strategy in the scattering strategy set is downgraded to obtain a new scattering strategy set. This includes: if the selectable object set is an empty set, and the intermediate result obtained after performing a merge operation on the lowest priority scattering strategy in the scattering strategy set has changed compared to the last intermediate result obtained before performing the merge operation, then the lowest priority scattering strategy in the scattering strategy set is downgraded to obtain a new scattering strategy set.
[0171] The final intermediate result obtained before performing the merge operation is: the intermediate result obtained after performing the merge operation on the shuffling strategies in the shuffling strategy set whose priority is only higher than the lowest priority shuffling strategy.
[0172] It is easy to understand that the set cannot be selected after merging. For the scattering strategy R i When merging the intermediate result S obtained after the previous shuffling strategy, by obtaining... The new intermediate result obtained by the union of the intermediate result S and the intermediate result S will not change relative to the intermediate result S. Thus, even if a shuffling strategy is used to shuffle the strategy R, the result will remain unchanged. i Degrading will not result in a non-empty set of selectable objects.
[0173] Please continue reading Figure 7 As shown, in step 390, object selection is performed based on the new set of scattering strategies.
[0174] Step 330 and subsequent steps can be re-executed based on the new set of scattering strategies to reselect objects.
[0175] When the downgrade operation involves removing the lowest-priority shuffling strategy, the overall unselectable set S can be redefined as follows:
[0176]
[0177] Where α is the lowest priority scattering strategy in the scattering strategy set.
[0178] In one embodiment of this application, object selection based on a new set of scattering strategies includes: obtaining the last intermediate result obtained before performing a merge operation on the scattering strategy with the lowest priority, as the overall unselectable set corresponding to the new set of scattering strategies, and re-executing the step of inverting the overall unselectable set relative to the overall set of objects based on the overall unselectable set corresponding to the new set of scattering strategies, as well as subsequent steps.
[0179] In this way, there is no need to recalculate the overall unselectable set corresponding to the new set of shuffling strategies, which can effectively save computational costs.
[0180] It is easy to understand that if the intermediate result obtained after performing a merge operation on the lowest priority shuffling strategy in the shuffling strategy set has not changed compared to the last intermediate result obtained before the merge operation, then the lowest priority shuffling strategy among the shuffling strategies whose intermediate result obtained after the merge operation has changed compared to the last intermediate result obtained before the merge operation needs to be downgraded.
[0181] Therefore, there are two main ways to determine the shuffling strategy to be downgraded during a downgrade operation. The first method is to save each intermediate result; then, when downgrading the lowest-priority shuffling strategy, determine if the intermediate results before and after the merge operation for that shuffling strategy have changed. If so, downgrade the lowest-priority rule; otherwise, repeat the above judgment for the next lowest-priority shuffling strategy until a shuffling strategy whose intermediate results before and after the merge operation have changed is found. The second method is to save the intermediate result after each merge operation if the intermediate result obtained after the merge operation has changed compared to the last intermediate result obtained before the merge operation. When downgrading is required, directly downgrade the lowest-priority shuffling strategy among the saved intermediate results. Here, "intermediate result corresponds to shuffling strategy" means that the intermediate result is the intermediate result obtained after performing a merge operation on that shuffling strategy.
[0182] It is easy to prove that, according to It can be deduced in, S is the true containment symbol. tmp S represents the intermediate result obtained before the final merge operation that modified S, while S represents the intermediate result obtained after the merge operation was executed. In other words, if S... tmp If S is a proper subset, and if the negation of S is the empty set, then S... tmp If you take the negation, it is no longer an empty set.
[0183] Specifically, suppose there are 6 shuffling strategies, and their corresponding unselectable sets after merging are: Shuffling Strategy 1: {1,2,3}, Shuffling Strategy 2: {1,3,5}, Shuffling Strategy 3: {1,4,7}, Shuffling Strategy 4: {1,5,9}, Shuffling Strategy 5: {1,6,11}, and Shuffling Strategy 6: {2,3,4,5,6,7,...,999}. In this case, the unselectable objects in shuffling strategies 1-5 all contain the number 1, while in shuffling strategy 6, only 1 is selectable, and all other objects are unselectable. If shuffling strategy 6 has the highest priority, using the original method, shuffling strategy 6 will be the last to be demoted, at which point shuffling strategies 1-5 will have already been demoted. Therefore, at least 999 × 6 iterations of the item traversal are required, and at least 999 × (6 + 5 + 4 + 3 + 2) check operations are needed.
[0184] By employing the technical means provided in the above embodiments, this application achieves S = {1,2,3,4,5,...,999}. tmp ={2,3,4,5,...,999}, thus allowing direct selection of the selectable object set.
[0185] Please continue reading Figure 5 As shown, the execution of the selection operator involves two modules: Control-New and Update. In the Control-New module, the Mergebitset is first executed to identify the unselectable sets. All unselectable sets are then merged and inverted. Based on the need for degradation, a non-empty set of selectable objects is obtained. Next, FindMinIndex is executed to find the element with the smallest sorted index from this non-empty set of selectable objects; this is the optimal solution for the current position. In the Update module, after selecting objects for a position, the limits for each tag bucket need to be updated, and a portion of the bitset is selectively updated.
[0186] The inventors of this application also conducted experiments for different page scenarios in the field of video recommendation.
[0187] Figure 9 A schematic diagram comparing the latency of existing fragmentation methods with the solutions provided in two embodiments of this application in a channel page scenario is shown. The channel page scenario refers to the infinitely streaming, single-video autoplay cards on a video app's channel page. For example, a video app may include channel pages for multiple channels such as TV series and movies, where playback cards for several videos belonging to the corresponding channel can be seen on each channel page. Please refer to... Figure 9 As shown, in the official environment on January 30th, the inventors statistically analyzed the latency consumed by the selection operator for the following solutions: those using related technologies (corresponding to data in row 11479270), those based on bucketing using a std::vector structure (corresponding to data in row 11479271), and those based on bucketing using a bitset structure (corresponding to data in row 11479271). It can be seen that P95, P99, and P99.9 represent the 95th, 99th, and 99.9th percentile values after sorting the latency data in ascending order. It can be seen that, on average, the execution time of the selection operator did not increase significantly. However, in terms of the P99.9 metric, the execution time of the solution based on bucketing using a bitset structure in this application was reduced by 10ms compared to the solution using related technologies.
[0188] Figure 10 This diagram illustrates a latency comparison between existing scattering methods and the solution provided in this application's embodiment on a homepage search and filtering page scenario. The homepage search and filtering page scenario refers to the homepage of a video app, where users can search and filter videos. The homepage may include multiple streaming recommendation cards to display recommended videos to the user. Please refer to... Figure 10As shown, it illustrates the time delay variation curves obtained at various times for the existing scattering method and the solution provided in this application under different experimental recall data, based on the P99.9 index. This diagram can be displayed on the chart page. In it, a curve represents a combination of an experimental recall number and a solution. The experimental recall number is the number of objects in the overall object set. Curves with odd numbers represent the existing scattering method, and curves with even numbers represent the solution provided in this application. The numbers, from smallest to largest, represent experimental recall numbers of 300, 400, 500, and 600, respectively. For example, 11503907 represents the P99.9 index data of existing scattering methods at various time points when the experimental recall is 300; 11503908 represents the P99.9 index data of the solution provided in this application at various time points when the experimental recall is 300; 11503909 represents the P99.9 index data of existing scattering methods at various time points when the experimental recall is 400; and 11503910 represents the P99.9 index data of the solution provided in this application at various time points when the experimental recall is 400. When a user hovers their mouse over a location on the chart, the chart page will automatically display the data for each curve at the corresponding time in a floating window. For example, when the user hovers their mouse over the minute 15:39 on February 2, 2024, the chart page will display a floating window showing the data for each curve at that minute. For instance, at 15:39 on February 2, 2024, with an experimental recall of 300, the P99.9 metric for the existing scattering method at each time point is 54.62.
[0189] Easy to understand, although Figure 10 The colors of the different curves in the chart are not clearly distinguishable, but in a real-world environment, different curves on a chart page can be different colors but have the same line thickness.
[0190] Figure 10 The overall statistical results of the data are shown in Table 2. Please refer to Table 2, where the LongCardSelector operator is the selection operator. "Original" indicates the original shuffling method, and "new" indicates the shuffling method provided by the embodiment of this application.
[0191]
[0192] Table 2
[0193] As shown in Table 2, when recalling 600 objects, the performance of the scattering method in this embodiment on P99.9 is basically the same as the original scattering method when recalling 300 objects. When the number of recalled objects is ≥400, the long tail of the original method starts to time out, and the performance of P99.9 is very poor.
[0194] In summary, the solution of this application embodiment is based on the C++ bitset structure to design an index-based shuffling framework, which can be applied to the reordering service in the recommendation system. It supports efficient operation of large-scale shuffling strategies and supports priority downgrading of different shuffling strategies. Compared with the traditional practices in the industry, it significantly reduces the algorithm complexity and greatly reduces the time consumed in the shuffling process.
[0195] The following describes an apparatus embodiment of this application, which can be used to execute the object selection method described above in this application. For details not disclosed in the apparatus embodiments of this application, please refer to the embodiments of the object selection method described above in this application.
[0196] Figure 11 A block diagram of an object selection apparatus according to an embodiment of this application is shown. Please refer to... Figure 11 As shown, an object selection device 1100 according to an embodiment of the present application includes: a judgment unit 1110, a merging unit 1120, an inversion unit 1130, and a selection unit 1140. The judgment unit 1110 is used to determine, when a new selection object needs to be added to the selection object set, the object set corresponding to each scattering strategy in the scattering strategy set as the unselectable set corresponding to the scattering strategy, based on the condition that the number of selection objects corresponding to the object set in the current selection object set reaches the quantity limit corresponding to the scattering strategy. The scattering strategy set includes at least two scattering strategies, each scattering strategy corresponds to at least one object set, and each object set includes at least one object belonging to the overall object set. The merging unit 1120 is used to merge the unselectable sets corresponding to each scattering strategy to obtain an overall unselectable set. The inversion unit 1130 is used to invert the overall unselectable set relative to the overall object set to obtain a selectable object set. The selection unit 1140 is used to select a target selection object from the selectable object set and add the target selection object to the selection object set.
[0197] In some embodiments of this application, based on the aforementioned scheme, the scattering strategy has a priority; the device further includes a reselection unit; the selection unit 1140 is configured to: if the selectable object set is not an empty set, select a target selection object from the selectable object set; after obtaining the selectable object set, the reselection unit is used to: if the selectable object set is an empty set, perform a downgrade operation on the scattering strategy with the lowest priority in the scattering strategy set to obtain a new scattering strategy set, wherein the downgrade operation includes removing the scattering strategy with the lowest priority or increasing the quantity limit corresponding to the scattering strategy with the lowest priority; and select objects based on the new scattering strategy set.
[0198] In some embodiments of this application, based on the aforementioned scheme, the merging unit 1120 is configured to: merge each unselectable set corresponding to each scattering strategy in the scattering strategy set to obtain the merged unselectable set corresponding to the scattering strategy; and merge the merged unselectable sets corresponding to each scattering strategy to obtain the overall unselectable set.
[0199] In some embodiments of this application, based on the aforementioned scheme, the merging unit 1120 is configured to: set the intermediate result of the overall unselectable set to an empty set; starting from the highest priority scattering strategy in the scattering strategy set, perform merging operations sequentially on each scattering strategy in the scattering strategy set in descending order of priority, and take the intermediate result obtained from the last merging operation as the overall unselectable set; wherein, the merging operation includes: combining the merged unselectable set corresponding to the current scattering strategy with the intermediate result of the current overall unselectable set to obtain a new intermediate result of the overall unselectable set.
[0200] In some embodiments of this application, based on the foregoing scheme, the reselection unit is configured as follows: if the selectable object set is an empty set, and the intermediate result obtained after performing a merge operation on the lowest priority scattering strategy in the scattering strategy set has changed compared to the last intermediate result obtained before performing the merge operation, then the lowest priority scattering strategy in the scattering strategy set is downgraded to obtain a new scattering strategy set; the last intermediate result obtained before performing the merge operation on the lowest priority scattering strategy is obtained as the overall unselectable set corresponding to the new scattering strategy set, and the step of inverting the overall unselectable set relative to the overall object set and subsequent steps are re-executed based on the overall unselectable set corresponding to the new scattering strategy set.
[0201] In some embodiments of this application, based on the foregoing scheme, the selected objects in the selected object set are content to be recommended, and the device further includes an acquisition and sorting unit; before determining that the object set is the unselectable set corresponding to the scattering strategy, the acquisition and sorting unit is used to: acquire the recommendation score corresponding to each object in the overall object set, the recommendation score being used to measure the target user's preference for the object; sort each object in the overall object set from high to low according to the corresponding recommendation score; the selection unit 1140 is configured to: select the object with the smallest sorting number from the selectable object set as the target selection object.
[0202] In some embodiments of this application, based on the foregoing scheme, the selection object set is a set of recommended content to be displayed on the target page, and the target page includes at least two positions for displaying the recommended content. The judgment unit 1110 is configured to: whenever it is necessary to select an object for a new position on the target page, for each object set corresponding to each scattering strategy in the scattering strategy set, if the number of selected objects corresponding to the current selection object set reaches the quantity limit corresponding to the scattering strategy, the object set is regarded as the unselectable set corresponding to the scattering strategy; the selection unit 1140 is configured to: select the object with the smallest sorting number from the selectable object set as the target selection object for the new position on the target page.
[0203] In some embodiments of this application, based on the foregoing scheme, the device further includes a recommendation unit; after the target selection object is added to the selection object set, the recommendation unit is used to: if the selection object set contains selection objects selected for each position of the target page, recommend the selection objects in the selection object set to the target user through the target page.
[0204] In some embodiments of this application, based on the foregoing scheme, each set of objects corresponding to each scattering strategy is stored in a bit set, and each bit data in the bit set corresponds to an object in the overall set of objects. The bit data is used to indicate whether the object corresponding to the bit data in the overall set of objects is located in the set of objects corresponding to the scattering strategy.
[0205] Figure 12 A schematic diagram of the structure of a computer system suitable for implementing the electronic device of the present application is shown.
[0206] It should be noted that, Figure 12 The computer system 1200 of the electronic device shown is merely an example and should not impose any limitation on the functionality and scope of use of the embodiments of this application.
[0207] like Figure 12As shown, the computer system 1200 includes a Central Processing Unit (CPU) 1201, which can perform various appropriate actions and processes based on programs stored in Read-Only Memory (ROM) 1202 or programs loaded from storage portion 1008 into Random Access Memory (RAM) 1203, such as performing the methods described in the above embodiments. Various programs and data required for system operation are also stored in RAM 1203. The CPU 1201, ROM 1202, and RAM 1203 are interconnected via bus 1204. An Input / Output (I / O) interface 1205 is also connected to bus 1204.
[0208] The following components are connected to I / O interface 1205: an input section 1206 including a keyboard, mouse, etc.; an output section 1207 including a cathode ray tube (CRT), liquid crystal display (LCD), etc., and speakers, etc.; a storage section 1208 including a hard disk, etc.; and a communication section 1209 including a network interface card such as a LAN (Local Area Network) card, modem, etc. The communication section 1209 performs communication processing via a network such as the Internet. A drive 1210 is also connected to I / O interface 1205 as needed. Removable media 1211, such as a disk, optical disk, magneto-optical disk, semiconductor memory, etc., are installed on drive 1210 as needed so that computer programs read from them can be installed into storage section 1208 as needed.
[0209] Specifically, according to embodiments of this application, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of this application include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via communication section 1209, and / or installed from removable medium 1211. When the computer program is executed by central processing unit (CPU) 1201, it performs various functions defined in the system of this application.
[0210] It should be noted that the computer-readable medium shown in the embodiments of this application can be a computer-readable signal medium or a computer-readable storage medium, or any combination of the two. A computer-readable storage medium can be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM), flash memory, optical fiber, portable compact disc read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this application, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In this application, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such transmitted data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. The computer-readable signal medium can also be any computer-readable medium other than a computer-readable storage medium, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to wireless, wired, etc., or any suitable combination thereof.
[0211] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this application. Each block in a flowchart or block diagram may represent a module, segment, or portion of code, which contains one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in a block diagram or flowchart, and combinations of blocks in a block diagram or flowchart, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0212] The units described in the embodiments of this application can be implemented in software or hardware, and the described units can also be located in a processor. The names of these units do not necessarily limit the specific unit itself.
[0213] In one aspect, this application also provides a computer-readable medium, which may be included in the electronic device described in the above embodiments; or it may exist independently and not assembled into the electronic device. The computer-readable medium carries one or more programs, which, when executed by the electronic device, cause the electronic device to perform the methods described in the above embodiments.
[0214] It should be noted that although several modules or units for the device used to perform actions have been mentioned in the detailed description above, this division is not mandatory. In fact, according to the embodiments of this application, the features and functions of two or more modules or units described above can be embodied in one module or unit. Conversely, the features and functions of one module or unit described above can be further divided and embodied by multiple modules or units.
[0215] Through the above description of the embodiments, those skilled in the art will readily understand that the exemplary embodiments described herein can be implemented by software or by combining software with necessary hardware. Therefore, the technical solutions according to the embodiments of this application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (such as a CD-ROM, USB flash drive, external hard drive, etc.) or on a network, including several instructions to cause a computing device (such as a personal computer, server, touch terminal, or network device, etc.) to execute the method according to the embodiments of this application.
[0216] Other embodiments of this application will readily occur to those skilled in the art upon consideration of the specification and practice of the embodiments disclosed herein. This application is intended to cover any variations, uses, or adaptations of this application that follow the general principles of this application and include common knowledge or customary techniques in the art not disclosed herein.
[0217] The data collection and processing plan outlined in this application must be implemented in strict accordance with the requirements of relevant national laws and regulations, obtaining the informed consent or separate consent of the data subject (or having a legal basis as stipulated by the relevant national laws and regulations), and conducting subsequent data use and processing within the scope authorized by laws and regulations and the data subject.
[0218] It should be understood that this application is not limited to the precise structure described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this application is limited only by the appended claims.
Claims
1. A method for selecting objects, characterized in that, The method includes: When it is necessary to select a new object to add to the selection object set, for the object set corresponding to each scattering strategy in the scattering strategy set, based on the situation where the number of selected objects corresponding to the current selection object set reaches the quantity limit corresponding to the scattering strategy, the object set is determined as the unselectable set corresponding to the scattering strategy. The set of scattering strategies includes at least two scattering strategies, each scattering strategy corresponds to at least one set of objects, and each set of objects includes at least one object, which belongs to the overall set of objects. The unselectable sets corresponding to each of the aforementioned scattering strategies are merged to obtain the overall unselectable set; Invert the set of unselectable objects relative to the set of objects to obtain the set of selectable objects. Select a target object from the set of selectable objects and add the target object to the set of selectable objects.
2. The object selection method according to claim 1, characterized in that, The scattering strategy has priority; the step of selecting the target selection object from the selectable object set includes: If the selectable object set is not empty, then the target selection object is selected from the selectable object set; If the selectable object set is an empty set, then the lowest priority scattering strategy in the scattering strategy set is downgraded to obtain a new scattering strategy set. The downgrade operation includes removing the lowest priority scattering strategy or increasing the quantity limit corresponding to the lowest priority scattering strategy. Object selection is performed based on the new set of scattering strategies.
3. The object selection method according to claim 1, characterized in that, The step of merging the unselectable sets corresponding to each of the aforementioned scattering strategies to obtain the overall unselectable set includes: For each scattering strategy in the scattering strategy set, the unselectable sets corresponding to the scattering strategy are merged to obtain the merged unselectable set corresponding to the scattering strategy. The unselectable sets corresponding to each of the aforementioned scattering strategies are merged to obtain the overall unselectable set.
4. The object selection method according to claim 3, characterized in that, The step of merging the unselectable sets corresponding to each of the aforementioned scattering strategies to obtain the overall unselectable set includes: Set the intermediate results of the entire unselectable set to an empty set; Starting with the highest priority scattering strategy in the scattering strategy set, the merging operation is performed on each scattering strategy in the scattering strategy set in descending order of priority, and the intermediate result obtained from the last merging operation is taken as the overall unselectable set; wherein, the merging operation includes: taking the intermediate result of the merged unselectable set corresponding to the current scattering strategy and the current overall unselectable set to obtain a new overall unselectable set.
5. The object selection method according to claim 4, characterized in that, If the selectable object set is empty, the step of downgrading the lowest priority scattering strategy in the scattering strategy set to obtain a new scattering strategy set includes: If the selectable object set is an empty set, and the intermediate result obtained after performing a merge operation on the lowest priority scattering strategy in the scattering strategy set has changed compared with the last intermediate result obtained before performing the merge operation, then the lowest priority scattering strategy in the scattering strategy set is downgraded to obtain a new scattering strategy set. The steps for selecting objects based on the new set of scattering strategies include: Obtain the final intermediate result obtained before performing the merge operation on the lowest priority scattering strategy, and use it as the overall unselectable set corresponding to the new scattering strategy set. Then, based on the overall unselectable set corresponding to the new scattering strategy set, re-execute the step of inverting the overall unselectable set relative to the overall object set, as well as subsequent steps.
6. The object selection method according to claim 1, characterized in that, The selected objects in the selected object set are the content to be recommended. Before determining that the object set is the unselectable set corresponding to the scattering strategy, the method further includes: Obtain the recommendation score for each object in the overall object set, and the recommendation score is used to measure the target user's preference for the object; Sort each object in the overall object set from highest to lowest according to its corresponding recommendation score; The step of selecting a target object from the selectable object set includes: The object with the smallest sort number is selected from the set of selectable objects and used as the target selection object.
7. The object selection method according to claim 6, characterized in that, The selection object set is a set of recommended content to be displayed on the target page. The target page includes at least two locations for displaying the recommended content. When a new selection object needs to be added to the selection object set, the step of determining the object set as the unselectable set corresponding to the scattering strategy, based on the number of selection objects corresponding to the current selection object set reaching the quantity limit corresponding to the scattering strategy, includes: Whenever it is necessary to select an object for a new location on the target page, for each object set corresponding to each scattering strategy in the scattering strategy set, if the number of selected objects in the current selected object set that corresponds to the object set reaches the quantity limit corresponding to the scattering strategy, the object set is regarded as the unselectable set corresponding to the scattering strategy. The step of selecting the object with the smallest sort number from the selectable object set as the target selection object includes: The object with the smallest sort number is selected from the set of selectable objects and used as the target selection object for the new position on the target page.
8. The object selection method according to claim 7, characterized in that, After adding the target selection object to the selection object set, the method further includes: If the selection object set contains selection objects selected for each position on the target page, the selection objects in the selection object set are recommended to the target user through the target page.
9. The object selection method according to claim 1, characterized in that, Each set of objects corresponding to each scattering strategy is stored in a bit set. Each bit data in the bit set corresponds to an object in the overall set of objects. The bit data is used to indicate whether the object corresponding to the bit data in the overall set of objects is located in the set of objects corresponding to the scattering strategy.
10. An object selection device, characterized in that, The device includes: The judgment unit is used to determine, when a new selection object needs to be added to the selection object set, for the object sets corresponding to each scattering strategy in the scattering strategy set, based on the situation that the number of selection objects in the current selection object set corresponding to the object set reaches the quantity limit corresponding to the scattering strategy, the object set is determined as the unselectable set corresponding to the scattering strategy. The set of scattering strategies includes at least two scattering strategies, each scattering strategy corresponds to at least one set of objects, and each set of objects includes at least one object, which belongs to the overall set of objects. The merging unit is used to merge the unselectable sets corresponding to each of the aforementioned scattering strategies to obtain the overall unselectable set; The negation unit is used to negate the overall unselectable set relative to the overall set of objects to obtain the selectable set of objects. The selection unit is used to select a target selection object from the selectable object set and add the target selection object to the selection object set.
11. A computer-readable medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the object selection method as described in any one of claims 1 to 9.
12. An electronic device, characterized in that, include: One or more processors; A storage device for storing one or more programs, which, when executed by one or more processors, cause the one or more processors to implement the object selection method as described in any one of claims 1 to 9.
13. A computer program product, characterized in that, The computer program product includes computer instructions stored in a computer-readable storage medium, a processor of a computer device reading the computer instructions from the computer-readable storage medium, and the processor executing the computer instructions to cause the computer device to perform the object selection method as described in any one of claims 1 to 9.