Sample construction method and device, electronic equipment and storage medium
By filtering and migrating the target information set in a distributed data cluster, the problem of resource waste during sample construction is solved, and more efficient resource utilization and time reduction is achieved.
Patent Information
- Application Number
- CN202410171845.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-02-06
- Publication Date
- 2025-08-08
AI Technical Summary
When constructing sample data in the prior art, there are problems of waste of computing resources and a sharp increase in data volume, especially in distributed data clusters, where invalid computing resource consumption caused by no feedback data of some push content and resource waste caused by large-scale attribute data splicing.
The first computing node filters out the target information set based on the identification reference information, and migrates to the second computing node where the corresponding feedback information set belongs, and constructs sample data in combination with the feedback information set to reduce data migration and computing resource consumption.
It effectively saves the computing resources required for data migration, reduces data migration time, and improves the resource utilization and efficiency of the sample construction process.
Smart Images

Figure CN120455531A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing technology, and in particular to a sample construction method, device, electronic device and storage medium. Background Art
[0002] The sample data used to train recommendation models typically consists of the content data of multimedia content pushed to an object, the object's feedback data regarding the pushed content, and the object's attribute data. In a distributed data cluster, all content data, feedback data, and attribute data are stored on different compute nodes. Therefore, when constructing sample data, it is necessary to obtain content data, feedback data, and attribute data from different compute nodes.
[0003] In related technologies, when constructing sample data, first, based on the identification (IdentityDocument, ID) of the pushed content and the ID of the object, data exchange connections (shuffle join) are performed between multiple computing nodes, and the content data and attribute data corresponding to the pushed content are moved to the same computing node and spliced. Then, through the shufflejoin operation again, the feedback data corresponding to the pushed content and the spliced content data and attribute data are moved to the same computing node, and spliced to obtain sample data.
[0004] However, when constructing sample data based on the above method, some pushed content is not actually viewed by the object after being pushed to it. Therefore, there is no corresponding feedback data for this pushed content. Exchanging the content data of this pushed content between computing nodes is meaningless, resulting in a waste of computing resources. In addition, since attribute data often has a large amount of data, when the attribute data and content data are spliced and then a second shuffle join is performed, the amount of data exchanged will increase sharply, consuming a large amount of computing resources.
[0005] Therefore, how to improve resource utilization during sample construction has become an urgent problem to be solved. Summary of the Invention
[0006] Embodiments of the present application provide a sample construction method, apparatus, electronic device, and storage medium to improve resource utilization during sample construction.
[0007] The first sample construction method provided in the embodiment of the present application is applied to a distributed data cluster including multiple computing nodes, including:
[0008] The following operations are respectively performed by each first computing node: based on identification reference information, each target information set is filtered out from each stored historical information set, wherein the identification reference information is generated based on the request identifier of the push request associated with each feedback information set; the historical information set is generated and stored in the corresponding first computing node by the recommendation system based on the attribute information of the push object that sends the corresponding push request and the content information of each push content returned in response to the push request; each feedback information set is stored in each second computing node, wherein the feedback information set includes: the push object that sends the associated push request and each feedback information generated based on each received push content; and
[0009] Migrating each obtained target information set to the second computing node to which the feedback information set associated with the corresponding push request belongs;
[0010] The following operations are respectively performed by each second computing node: based on the feedback information set stored by a second computing node and in combination with the target information set associated with the corresponding push request, each sample data corresponding to the push request is constructed.
[0011] The second sample construction method provided in the embodiment of the present application is applied to a recommendation system and includes:
[0012] generating a historical information set associated with the push request based on content information of each push content returned in response to the push request and attribute information of the push object that sent the push request;
[0013] The historical information set is stored in the first computing node of the distributed data cluster, so that the first computing node can screen out each target information set from each stored historical information set based on the identification reference information, and migrate each obtained target information set to the second computing node to which the feedback information set associated with the corresponding push request belongs, and construct each sample data through the feedback information set stored in the second computing node and the corresponding target information set. The identification reference information is generated based on the request identifier of the push request associated with each feedback information set, and the feedback information set includes: the push object of the associated push request, and each feedback information generated based on the received push content.
[0014] The first sample construction device provided in the embodiment of the present application includes:
[0015] The mobile unit is configured to respectively perform the following operations through each first computing node: based on identification reference information, filter out each target information set from each stored historical information set, wherein the identification reference information is generated based on the request identifier of the push request associated with each feedback information set; the historical information set is generated and stored in the corresponding first computing node by the recommendation system based on the attribute information of the push object that sends the corresponding push request and the content information of each push content returned in response to the push request; the feedback information set is stored in each second computing node, wherein the feedback information set includes: the push object that sends the associated push request and each feedback information generated based on each received push content; and
[0016] Migrating each obtained target information set to the second computing node to which the feedback information set associated with the corresponding push request belongs;
[0017] The construction unit is used to perform the following operations respectively through the second computing nodes: based on the feedback information set stored by a second computing node and in combination with the target information set associated with the corresponding push request, construct each sample data corresponding to the push request.
[0018] Optionally, the device further includes a selection unit, configured to:
[0019] Selecting a second computing node that meets preset conditions from among the second computing nodes to which each piece of feedback information corresponding to a push request belongs as a target second computing node;
[0020] Each piece of feedback information corresponding to the push request is migrated to the target second computing node to obtain a feedback information set associated with the push request.
[0021] Optionally, the device further includes a generating unit, configured to:
[0022] generating, by a third computing node, the identification reference information in combination with the request identifiers of the push requests associated with each feedback information set, and sending the identification reference information to each of the first computing nodes;
[0023] Then, before a first computing node filters out each target information set from each stored historical information set based on the identification reference information, the method further includes:
[0024] Receive identification reference information sent by the third computing node.
[0025] Optionally, the identification reference information includes a target array; the generating unit is specifically configured to:
[0026] The target array is generated as follows:
[0027] Mapping the request identifiers of the push requests associated with each feedback information set respectively through a preset hash function to obtain corresponding target mapping values;
[0028] The mapping positions corresponding to the obtained target mapping values in the preset initial array are respectively determined, and the elements in each mapping position are respectively updated to preset values to obtain the target array.
[0029] Optionally, the generating unit is specifically configured to:
[0030] For each historical information set, perform the following operations:
[0031] Mapping the request identifier of the push request corresponding to a historical information set through the hash function to obtain a historical mapping value;
[0032] A mapping position corresponding to the historical mapping value in the target array is determined, and when the element value of the element in the mapping position is the preset value, the one historical information set is used as a target information set associated with the corresponding push request.
[0033] Optionally, the construction unit is specifically used to:
[0034] For each piece of feedback information included in the feedback information set and each piece of content information included in the target information set, splicing the feedback information and content information corresponding to the same pushed content to obtain each piece of intermediate data;
[0035] The intermediate data are respectively concatenated with the attribute information included in the target information set to obtain the sample data.
[0036] Optionally, the construction unit is specifically used to:
[0037] Based on the content identifiers of the pushed contents corresponding to the respective pieces of feedback information and the respective pieces of content information, obtaining the position information of the respective pieces of feedback information and the respective pieces of content information in the hash table;
[0038] Based on the obtained position information, the feedback information and content information are respectively stored in the hash table, and the feedback information and content information corresponding to the same position information are spliced to obtain the intermediate data.
[0039] Optionally, the device further includes a conversion unit, configured to:
[0040] The dynamic link library is loaded to convert the data format of each sample data to obtain each sample data in an input data format that conforms to the recommendation model, and the obtained sample data is used to train the recommendation model.
[0041] The second sample construction device provided in the embodiment of the present application includes:
[0042] a generating unit, configured to generate a historical information set associated with a push request based on content information of each push content returned in response to the push request and attribute information of a push object that sends the push request;
[0043] A storage unit is used to store the historical information set to the first computing node of the distributed data cluster, so that the first computing node can screen out each target information set from each stored historical information set based on the identification reference information, and migrate each obtained target information set to the second computing node to which the feedback information set associated with the corresponding push request belongs, and construct each sample data through the feedback information set stored by the second computing node and the corresponding target information set. The identification reference information is generated based on the request identifier of the push request associated with each feedback information set, and the feedback information set includes: the push object of the associated push request, and each feedback information generated based on the received push content.
[0044] An electronic device provided in an embodiment of the present application includes a processor and a memory, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor performs the steps of any one of the above-mentioned sample construction methods.
[0045] An embodiment of the present application provides a computer-readable storage medium, which includes a computer program. When the computer program is run on an electronic device, the computer program is used to enable the electronic device to perform the steps of any one of the above-mentioned sample construction methods.
[0046] An embodiment of the present application provides a computer program product, which includes a computer program stored in a computer-readable storage medium. When a processor of an electronic device reads the computer program from the computer-readable storage medium, the processor executes the computer program, causing the electronic device to perform the steps of any one of the above-mentioned sample construction methods.
[0047] The beneficial effects of this application are as follows:
[0048] The embodiments of the present application provide a sample construction method, apparatus, electronic device, and storage medium. First, a first computing node filters out target information sets from stored historical information sets based on identification reference information, and migrates each obtained target information set to a second computing node to which the feedback information set associated with the corresponding push request belongs. Then, the second computing node constructs sample data corresponding to the push request based on a feedback information set stored by the second computing node and the target information set associated with the corresponding push request.
[0049] On the one hand, by filtering the historical information set, only the filtered target information set needs to be migrated during data migration, which reduces the amount of data to be migrated and can effectively save the computing resources required for data migration.
[0050] On the other hand, in the prior art, each piece of content data and attribute data are spliced together before the data migration operation is performed. In fact, when each piece of content data is moved, a piece of attribute data needs to be moved. In the present application, since the content information of each pushed content contained in the target information set is for the same push object, the target information set only carries one piece of attribute information for this push object. In this way, when migrating the target information set, in fact, when multiple pieces of content information are moved, only one piece of attribute data is moved accordingly, which further reduces the amount of data during the data migration process.
[0051] Based on the above method, the computing resources used in the data migration process are reduced, thereby improving the resource utilization of the entire sample construction process. In addition, since the amount of data migrated is reduced, the time spent in the data migration process will also be reduced accordingly, thereby reducing the time required for the sample construction process and improving the efficiency of sample construction.
[0052] Other features and advantages of the present application will be described in the following description, and in part will become apparent from the description, or will be understood by practicing the present application. The purposes and other advantages of the present application can be realized and obtained by the structures particularly pointed out in the written description, claims, and drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0053] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0054] Figure 1A A schematic diagram of association based on external storage in the related art;
[0055] Figure 1B A schematic diagram showing how item characteristics change over time;
[0056] Figure 2 This is an optional schematic diagram of an application scenario in an embodiment of the present application;
[0057] Figure 3 This is a flow chart of an implementation of a sample construction method in an embodiment of the present application;
[0058] Figure 4 A schematic diagram of a recommendation process of a recommendation system in an embodiment of the present application;
[0059] Figure 5 A schematic diagram of a target array generation process in an embodiment of the present application;
[0060] Figure 6 This is a schematic diagram of another target array generation process in an embodiment of the present application;
[0061] Figure 7A This is a schematic diagram showing the comparison before and after screening in the examples of this application;
[0062] Figure 7B Schematic diagram of the process of obtaining the historical information set and the feedback information set in the embodiment of the present application;
[0063] Figure 8 A schematic diagram of a data splicing method in an embodiment of the present application;
[0064] Figure 9A A logical diagram of a sample construction method in an embodiment of the present application;
[0065] Figure 9B A logical diagram of a sample splicing method in an embodiment of the present application;
[0066] Figure 9C This is a flowchart of another sample construction method in an embodiment of the present application;
[0067] Figure 10 This is a schematic structural diagram of a sample construction device in an embodiment of the present application;
[0068] Figure 11 This is a schematic structural diagram of another sample construction device in an embodiment of the present application;
[0069] Figure 12 A schematic diagram of the hardware structure of an electronic device to which an embodiment of the present application is applied;
[0070] Figure 13 A schematic diagram of the hardware structure of another electronic device to which an embodiment of the present application is applied. DETAILED DESCRIPTION
[0071] To make the purpose, technical solutions, and advantages of the embodiments of this application more clear, the technical solutions of this application will be clearly and completely described below in conjunction with the drawings in the embodiments of this application. Obviously, the described embodiments are part of the embodiments of the technical solutions of this application, but not all of them. Based on the embodiments described in this application document, all other embodiments obtained by ordinary technicians in this field without making creative efforts shall fall within the scope of protection of the technical solutions of this application.
[0072] The following is an introduction to some concepts involved in the embodiments of this application.
[0073] Recommendation system: Receives push requests (also called recommendation requests) from push recipients and distributes personalized push content, such as videos, products, and images, to the push recipients based on their needs, interests, and other information. In this embodiment of the present application, after determining the push content for each push recipient, the recommendation system also packages the content information of each push content with the attribute information of the push recipient, generates a historical information set, and stores it in the first computing node of the distributed data cluster to implement subsequent sample construction operations.
[0074] Distributed data cluster: has multiple computing nodes. In the embodiment of this application, it mainly refers to a cluster that deploys a computing engine (Apache Spark), which has good performance in large-scale data processing.
[0075] Content information: mainly includes relevant information about the pushed content (also called items), which can include media classification, vertical tags, interest tags, starring actors, and duration.
[0076] Attribute information: related information about the push object, which may include a profile of the push object, such as age, gender, interests and hobbies, etc. It may also include contextual features, such as the time, location, keywords, etc. of sending the request.
[0077] Feedback information: The push recipient's feedback behavior on the pushed content, such as clicks, plays, likes, comments, playback duration, interactive behavior, etc. Feedback information can be used as a label for sample data for supervised learning of the model.
[0078] Artificial Intelligence (AI) is the theory, methods, techniques, and application systems that use digital computers or machines controlled by digital computers to simulate, extend, and expand human intelligence, to perceive the environment, acquire knowledge, and use that knowledge to achieve optimal results. In other words, AI is a comprehensive technology within computer science that seeks to understand the essence of intelligence and produce new intelligent machines that can respond in a manner similar to human intelligence. AI also studies the design principles and implementation methods of various intelligent machines, enabling them to possess the capabilities of perception, reasoning, and decision-making.
[0079] Artificial intelligence technology is a comprehensive discipline covering a wide range of fields, encompassing both hardware and software technologies. Basic AI technologies generally include sensors, dedicated AI chips, cloud computing, distributed storage, big data processing, operating / interactive systems, and mechatronics. AI software technologies primarily encompass computer vision, speech processing, natural language processing, and machine learning / deep learning. The technical solutions provided in the embodiments of this application primarily relate to machine learning / deep learning within AI.
[0080] Machine Learning (ML) is a multidisciplinary field that encompasses probability theory, statistics, approximation theory, convex analysis, and algorithmic complexity theory. It specifically studies how computers can simulate or implement human learning behaviors to acquire new knowledge or skills and reorganize existing knowledge structures to continuously improve their performance. Machine learning is at the core of artificial intelligence and the fundamental way to make computers intelligent. Its applications span all areas of AI. Machine learning and deep learning typically include techniques such as artificial neural networks, belief networks, reinforcement learning, transfer learning, inductive learning, and self-learning.
[0081] The sample construction method in the embodiments of this application can be applied to the field of machine learning. For example, when a click-through rate prediction model based on machine learning or deep learning is needed to push multimedia content to a push target, the method in the embodiments of this application can be used to construct the sample data required for model training, thereby improving the model's estimation accuracy.
[0082] The following is a brief introduction to the design concept of the embodiment of this application:
[0083] The sample data used to train the recommendation model typically consists of the content data of multimedia content pushed to an object, the object's feedback on the pushed content, and the object's attribute data. Item features (content data) for positive ranking are obtained by joining the full offline positive ranking data, typically divided into hourly and daily levels based on the offline frequency of positive ranking. Profile features (attribute data) are obtained by joining the offline data provided by the profile service based on the user ID, i.e., obtaining item and object features through external offline data. Feedback data is obtained from the object's behavior log.
[0084] When joining samples, two methods are generally used: direct shuffle join based on frameworks such as Spark and association based on external storage.
[0085] (1) For direct shuffle join:
[0086] In a distributed data cluster, all content data, feedback data, and attribute data are stored on different computing nodes. Therefore, when constructing sample data, you need to obtain content data, feedback data, and attribute data from different computing nodes.
[0087] In related technologies, when constructing sample data, first, based on the identification ID of the pushed content and the ID of the object, shuffle join is performed between multiple computing nodes, and the content data and attribute data corresponding to the pushed content are moved to the same computing node and spliced. Then, the shuffle join operation is performed again to move the feedback data corresponding to the pushed content and the spliced content data and attribute data to the same computing node, and spliced to obtain sample data.
[0088] However, when constructing sample data based on the above method, some pushed content is not actually viewed by the object after being pushed to it. Therefore, there is no corresponding feedback data for this pushed content. Exchanging the content data of this pushed content between computing nodes is meaningless, resulting in a waste of computing resources. In addition, since attribute data often has a large amount of data, when the attribute data and content data are spliced and then a second shuffle join is performed, the amount of data exchanged will increase sharply, consuming a large amount of computing resources.
[0089] Therefore, how to improve resource utilization during sample construction has become an urgent problem to be solved.
[0090] (2) For the association method based on external storage:
[0091] like Figure 1A As shown in FIG, it is a schematic diagram of the association based on external storage in the related art. After collecting the item features (content information) and object features (attribute information) of the content exposed and pushed to the user, the smaller label data can be first poured into the external storage. Figure 1A In this example, the external storage is a remote dictionary service (Redis). Based on the exposed item features, the label data is obtained by batch querying the external storage according to the request identifier (sequence number, abbreviated as seqnum) of the corresponding push request. The label data is then expanded to the item features and object features to obtain sample data. This can avoid shuffling large item features and object features.
[0092] However, although this method can avoid large amounts of data shuffle, the performance of external storage often becomes a bottleneck. If memory-based storage is used, throughput is guaranteed, but costs are often difficult to control.
[0093] Based on the above problems in related technologies, Figure 1B As shown in the figure, after the item is pushed to the user, the user's feedback information on the item is certain, such as clicks. Since some features of the item will continue to change in real application scenarios, such as the exposure and playback volume, click volume, and comment volume of the video, taking the exposure and playback volume as an example, as time goes by, the exposure and playback volume of the video when it is pushed to the user has changed from v1 to v5 during model training. If the item features are obtained from the full amount of offline positive row or portrait data, the data for the predicted live version cannot be obtained, which will bring the problem of feature crossing to the sample data. Using such sample data to train the model will interfere with the model, resulting in increasing deviations in subsequent predictions.
[0094] In view of this, embodiments of the present application provide a sample construction method, apparatus, electronic device, and storage medium. First, a first computing node, based on identification reference information, filters out target information sets from stored historical information sets, and migrates each obtained target information set to a second computing node to which the feedback information set associated with the corresponding push request belongs. Then, a second computing node, based on a feedback information set stored by the second computing node and combined with the target information set associated with the corresponding push request, constructs sample data corresponding to the push request.
[0095] On the one hand, by filtering the historical information set, only the filtered target information set needs to be migrated during data migration, which reduces the amount of data to be migrated and can effectively save the computing resources required for data migration.
[0096] On the other hand, in the prior art, each piece of content data and attribute data are spliced together before the data migration operation is performed. In fact, when each piece of content data is moved, a piece of attribute data needs to be moved. In the present application, since the content information of each pushed content contained in the target information set is for the same push object, the target information set only carries one piece of attribute information for this push object. In this way, when migrating the target information set, in fact, when multiple pieces of content information are moved, only one piece of attribute data is moved accordingly, which further reduces the amount of data during the data migration process.
[0097] Based on the above method, the computing resources used in the data migration process are reduced, thereby improving the resource utilization of the entire sample construction process. In addition, since the amount of data migrated is reduced, the time spent in the data migration process will also be reduced accordingly, thereby reducing the time required for the sample construction process and improving the efficiency of sample construction.
[0098] The preferred embodiments of the present application are described below in conjunction with the drawings in the specification. It should be understood that the preferred embodiments described herein are only used to illustrate and explain the present application and are not used to limit the present application. In addition, the embodiments and features in the embodiments of the present application can be combined with each other if there is no conflict.
[0099] The solution provided in the embodiment of this application can be applied to the sample data required for constructing the training recommendation model. The solution can be applied as a basic technology in various scenarios, including but not limited to cloud technology, artificial intelligence, smart transportation, assisted driving and other scenarios. Figure 2 , which is a schematic diagram of an application scenario of an embodiment of the present application. The application scenario diagram includes two first computing nodes 210 and two second computing nodes 220.
[0100] In an embodiment of the present application, the first computing node and the second computing node can both be terminal devices or servers, and the terminal devices include but are not limited to mobile phones, tablet computers, laptop computers, desktop computers, e-book readers, intelligent voice interaction devices, smart home appliances, car-mounted terminals and other devices; a client related to sample construction can be installed on the terminal device, and the client can be software (such as a browser, sample construction software, etc.), or a web page, a small program, etc. The server is a background server corresponding to the software or web page, small program, etc., or a server specifically used for sample construction, which is not specifically limited in this application. The server can be an independent physical server, or a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, content delivery networks (CDNs), and basic cloud computing services such as big data and artificial intelligence platforms.
[0101] Therefore, the sample construction method in the embodiment of the present application can be executed by an electronic device, which can be a server or a terminal device. That is, the method can be executed by the server or the terminal device alone, or by the server and the terminal device together.
[0102] In an optional implementation, the computing nodes may communicate with each other via a communication network.
[0103] In an optional implementation, the communication network is a wired network or a wireless network.
[0104] It should be noted that Figure 2 The figure is only an example. In fact, the number of computing nodes is not limited and is not specifically limited in the embodiments of this application.
[0105] In an embodiment of the present application, when the computing node is a server, multiple servers can be combined into a blockchain, and the server is a node on the blockchain; as disclosed in the sample construction method of the embodiment of the present application, the historical information set and feedback information set involved can be saved on the blockchain.
[0106] The following are some common sample construction application scenarios:
[0107] (1) Video application: The sample construction method in the embodiment of the present application can be used to construct sample data based on the pushed content on the homepage of the user's video application, train the recommendation model, improve the prediction accuracy of the pushed content on the homepage of the video application, and thus improve the user's satisfaction with the pushed content.
[0108] (2) Music application: The sample construction method in the embodiment of the present application can be used to construct sample data based on the daily recommended songs of the user's music application, train the recommendation model, and improve the prediction accuracy of the recommended songs.
[0109] (3) Shopping applications: The sample construction method in the embodiments of the present application can be used to construct sample data based on the products on the homepage of the user's shopping application, train the recommendation model, and improve the prediction accuracy of the recommended products displayed on the homepage.
[0110] The following describes the sample construction method provided by the exemplary embodiment of the present application in combination with the application scenarios described above and with reference to the accompanying drawings. It should be noted that the above application scenarios are only shown to facilitate understanding of the spirit and principles of the present application, and the implementation of the present application is not limited in this respect.
[0111] See Figure 3 FIG. 1 is a flowchart of an implementation of a sample construction method provided in an embodiment of the present application, which is applied to a distributed data cluster comprising multiple computing nodes. The specific implementation process of the method includes the following steps S31-S32:
[0112] S31: Perform the following operations on each first computing node:
[0113] S311: Filtering target information sets from stored historical information sets based on identification reference information;
[0114] The historical information set is generated and stored in the corresponding first computing node by the recommendation system based on the attribute information of the push object that sends the corresponding push request and the content information of each push content returned in response to the push request.
[0115] One or more historical information sets may be stored on a first computing node. Each historical information set is associated with a corresponding push request. The request identifier (seqnum) of the push request may be used as the ID of the historical information set.
[0116] The following describes the process of generating the historical information set:
[0117] Specifically, as described in the design idea part of the embodiment of this application, one of the difficulties of sample engineering is the problem of feature crossing. Therefore, in order to avoid using "future features" in model training, this application proposes that the recommendation system generates a historical information set associated with the push request based on the content information of each push content returned in response to the push request and the attribute information of the push object that sends the push request, and stores the historical information set to the first computing node of the distributed data cluster.
[0118] like Figure 4 As shown, this is a schematic diagram of the recommendation process of a recommendation system in an embodiment of the present application. After receiving a push request, the recommendation system once requests the fine ranking module to finely rank and score each candidate content. After the prediction is completed and n recommended contents are obtained, the reflow service is requested for feature storage a second time to pull the content information of the n winning recommended contents, and at the same time, the attribute information (such as push request ID, context features, object features) is packaged together to generate reflow data (historical information set) for log reporting and store it in the first computing node. After data cleaning, it is used as the input of the sample project, so that features that are extremely close to the score can be obtained.
[0119] In addition, to avoid differences in data synchronization progress between different machines in a distributed environment, the same machine and service version as those used by the predictor are specified here to ensure accurate data consistency. After the reflux service obtains the item features of n items, it can obtain the on-site features at the time of scoring based on the attribute information (portrait features and context features) carried in the push request. Finally, this data is packaged into one reflux data, recorded through a log system such as Wormhole, and then saved to the offline data warehouse for use in sample construction.
[0120] Based on the above method, after the recommendation system filters out the pushed content to the object, it generates a historical information set through the reflux service to obtain more accurate content information, and then uses the sample data constructed based on the content information to train the model and improve the model's estimation accuracy.
[0121] The identification reference information is generated based on the request identification of the push request associated with each feedback information set stored in each second computing node.
[0122] The identification reference information can directly include each request identifier. For example, the request identifier of push request 1 is 0001, the request identifier of push request 2 is 0002, and the request identifier of push request 3 is 0003. Then the identification reference information can be: 001002003, or 0123; the identification reference information can also be generated indirectly based on each request identifier. For example, after encoding each request identifier, the identification reference information is generated: 000a000b000c. No specific limitation is made here.
[0123] Each second computing node may store one or more feedback information sets, where the feedback information set includes the push object that sends the associated push request and each piece of feedback information generated based on each received push content.
[0124] It should be noted that the first computing node and the second computing node in the embodiment of the present application can be the same computing node or different computing nodes, that is, a computing node can only store historical information sets, or only store feedback information sets, or store historical information sets and feedback information sets at the same time, which is not specifically limited here.
[0125] The following describes the process of generating the feedback information set:
[0126] From the second computing nodes to which each piece of feedback information corresponding to a push request belongs, a second computing node that meets the preset conditions is selected as the target second computing node; each piece of feedback information corresponding to a push request is migrated to the target second computing node respectively to obtain a set of feedback information associated with the push request.
[0127] Specifically, each feedback information (object behavior data) corresponding to a push request is initially distributed and stored in each second computing node. It is necessary to migrate each feedback information corresponding to a push request to the same computing node, that is, the target second computing node, to generate a feedback information set associated with this push request.
[0128] Among them, the preset condition can be the second computing node that stores the most feedback information corresponding to a push request among each second computing node. For example, the second computing node 1 stores two pieces of feedback information, the second computing node 2 stores one piece of feedback information, and the second computing node 3 stores four pieces of feedback information, then computing node 3 is the target second computing node; the preset condition can also be to randomly designate one of the second computing nodes as the target second computing node. For example, the second computing node 2 can be designated as the target second computing node, and no specific limitation is made here.
[0129] Optionally, generate identification reference information in the following manner:
[0130] Generate identification reference information by combining the request identifiers of the push requests associated with each feedback information set through the third computing node, and send the identification reference information to each first computing node respectively;
[0131] Among them, the third computing node can be one of the first computing nodes, or it can be other nodes in the distributed data cluster, such as the master node. After the third computing node generates the identification reference information, it broadcasts the identification reference information to each first computing node through a strategy based on broadcast variables. The first computing node receives the identification reference information sent by the third computing node to filter out the target information set.
[0132] Since the push content corresponding to some historical information sets may not be seen by the push recipients, there is no corresponding feedback information set. Such historical information sets cannot be applied to sample construction. By filtering out such information sets, the amount of data migration can be reduced.
[0133] Each historical information set corresponds one-to-one to the request identifier of the corresponding push request, and the identification reference information is generated based on the request identifier of the push request associated with each feedback information set. Therefore, based on the identification reference information, the historical information set corresponding to the push request associated with a feedback information set can be filtered out, that is, the target information set of this push request.
[0134] For example, the request identifier of push request 1 associated with feedback information set 1 is 0001, the request identifier of push request 2 associated with feedback information set 2 is 0002, the request identifier of push request 3 associated with feedback information set 3 is 0003, and the request identifier of push request 4 associated with feedback information set 4 is 0004. The identifier reference information is 0001234, the request identifier corresponding to historical information set 1 is 0005, the request identifier corresponding to historical information set 2 is 0002, the request identifier corresponding to historical information set 3 is 1007, the request identifier corresponding to historical information set 4 is 0004, the request identifier corresponding to historical information set 5 is 3001, the request identifier corresponding to historical information set 6 is 0001, and the request identifier corresponding to historical information set 7 is 0003. The filtered target information sets include: historical information set 2, historical information set 4, historical information set 6, and historical information set 7.
[0135] Optionally, the identification reference information includes a target array, and the target array is generated using the following steps S41-S42:
[0136] S41: Mapping the request identifiers of the push requests associated with each feedback information set using a preset hash function to obtain corresponding target mapping values;
[0137] S42: respectively determining the mapping positions corresponding to the obtained target mapping values in the preset initial array, and respectively updating the elements in each mapping position to preset values to obtain the target array.
[0138] Specifically, the request identifier is mapped through a hash function to obtain a target mapping value. For a target mapping value, the target mapping value is modulo the length of the initial array to obtain the corresponding mapping position. For example, if the target mapping value is 105 and the length of the initial array is 100, the mapping position is 5, and the 5th element in the initial array is updated to the preset value. It should be noted that none of the elements contained in the initial array are preset arrays. For example, if the preset value is 1, the initial array does not contain 1. In the embodiments of this application, the initial array is mainly described as all 0s.
[0139] like Figure 5 As shown, this is a schematic diagram of the generation process of a target array in an embodiment of the present application. The initial array contains all elements 0. The request identifier "1010" is mapped using hash function 1, and the target mapping value is 40. The element at the corresponding mapping position is the 8th element. The 8th element is updated to 1. The request identifier "3054" is mapped using hash function 1, and the target mapping value is 34. The element at the corresponding mapping position is the 2nd element. The 2nd element is updated to 1. The request identifier "5063" is mapped using hash function 1, and the target mapping value is 30. The element at the corresponding mapping position is the 14th element. The 14th element is updated to 1 to obtain the target array.
[0140] The above mainly uses a hash function as an example to illustrate. In fact, for each request identifier, x hash functions can be used in sequence to map to obtain x target mapping values, and the elements of the x target mapping values in the initial array are updated to preset values to obtain the target array.
[0141] like Figure 6 As shown, Figure 5 Taking the initial array and request identifiers "1010", "3054", and "1846" in as examples, each request identifier is mapped through three hash functions to obtain three target mapping values, and the elements at the mapping positions corresponding to each target mapping value are updated to 1 to obtain the target array.
[0142] The number of hash functions used and the length of the initial array can be set as required and are not specifically limited here.
[0143] Optionally, after obtaining the target array, in step S311, for a historical information set, determining whether the historical information set is the target information set is performed in the following manner:
[0144] Through a hash function, the request identifier of a push request corresponding to a historical information set is mapped to obtain a historical mapping value; the mapping position corresponding to the historical mapping value in the target array is determined, and when the element value of the element in the mapping position is a preset value, a historical information set is used as the target information set associated with the corresponding push request.
[0145] Specifically, the request identifier corresponding to the historical information set is mapped using the same hash function as in step S41 to obtain a historical mapping value, and the historical mapping value is modulo the length of the target array to obtain a mapping position. If the element value of the element at the mapping position is a preset value, the historical information set is determined to be the target information set.
[0146] For example, if the historical mapping value is 257 and the length of the target array is 50, the mapping position is 7, and the 7th element of the target array is 0, which is not the preset value 1, then this historical information set is not the target information set; if the historical mapping value is 344 and the length of the target array is 50, the mapping position is 44, and the 7th element of the target array is 1, then this historical information set is the target information set.
[0147] In order to show the effect of the screening step in step S311, as shown in FIG. Figure 7A As shown, this is a schematic diagram comparing the before and after screening in an embodiment of the present application. The left side is before screening. It can be seen that the full historical information set is spliced with a small amount of feedback information set, and after screening, a small amount of target information set is spliced with a small amount of feedback information set. During the screening process, the Random Forest (RF) algorithm can be used. Specifically, a Bloom filter is constructed based on the request identifier corresponding to the feedback information set to screen the historical information set.
[0148] In step S311, after filtering the historical information set based on the identification reference information, the feedback information set and target information set associated with a push request can be determined. For n push contents corresponding to a push request, there may still be only m push contents seen by the user, that is, only m push contents have feedback information. At this time, in order to further reduce the amount of data migration, for a target information set associated with a push request, the content information contained in the target information set can be filtered based on the content identification of the push content corresponding to each feedback information in the associated feedback information set to obtain each target content information. In this way, filtering is performed for each target information set, which further reduces the data amount of the target information set and saves computing resources used in the data migration process.
[0149] S312: Migrating each obtained target information set to the second computing node to which the feedback information set associated with the corresponding push request belongs;
[0150] For example, if the feedback information set 1 associated with push request 1 belongs to the second computing node 15, then the target information set associated with push request 1 will be migrated to the second computing node 15; if the feedback information set 5 associated with push request 5 belongs to the second computing node 2, then the target information set associated with push request 5 will be migrated to the second computing node 2.
[0151] Through step S31, the first join is completed, that is, the n push contents pushed out under the same push request and the m push contents exposed and played by the user are associated together and migrated to the same second computing node. In this way, the return characteristics (content information) of the n items and the behavioral characteristics (feedback information) of the m items corresponding to a push request will be processed by the same task on the second computing node.
[0152] like Figure 7B As shown, this is a schematic diagram of the process of obtaining the historical information set and the feedback information set in an embodiment of the present application. The push content corresponding to the historical information set is displayed to the user through the recommendation system. The user's terminal device is responsible for reporting the user's feedback behavior. After the feedback behavior is cleaned, the feedback information set is obtained, and sample splicing is performed based on the historical information set and the feedback information set.
[0153] S32: performing the following operations respectively through each second computing node: constructing each sample data corresponding to the push request based on the feedback information set stored by a second computing node and in combination with the target information set associated with the corresponding push request.
[0154] Specifically, multiple pieces of sample data can be constructed based on the feedback information contained in the feedback information set, the attribute information contained in the target information set, and the content information. For example, sample data 1 can be constructed based on feedback information 1, content information 1, and attribute information. Sample data 2 can be constructed based on feedback information 2, content information 2, and attribute information. Sample data 3 can be constructed based on feedback information 3, content information 3, and attribute information.
[0155] In this embodiment of the present application, a first computing node first selects target information sets from stored historical information sets based on identification reference information, and then migrates each obtained target information set to a second computing node to which the feedback information set associated with the corresponding push request belongs. Then, a second computing node constructs sample data corresponding to the push request based on the feedback information set stored by the second computing node and the target information set associated with the corresponding push request.
[0156] On the one hand, by filtering the historical information set, only the filtered target information set needs to be migrated during data migration, which reduces the amount of data to be migrated and can effectively save the computing resources required for data migration.
[0157] On the other hand, in the prior art, each piece of content data and attribute data are spliced together before the data migration operation is performed. In fact, when each piece of content data is moved, a piece of attribute data needs to be moved. In the present application, since the content information of each pushed content contained in the target information set is for the same push object, the target information set only carries one piece of attribute information for this push object. In this way, when migrating the target information set, in fact, when multiple pieces of content information are moved, only one piece of attribute data is moved accordingly, which further reduces the amount of data during the data migration process.
[0158] Based on the above method, the computing resources used in the data migration process are reduced, thereby improving the resource utilization of the entire sample construction process. In addition, since the amount of data migrated is reduced, the time spent in the data migration process will also be reduced accordingly, thereby reducing the time required for the sample construction process and improving the efficiency of sample construction.
[0159] Optionally, step S32 may be implemented as follows:
[0160] For each feedback information contained in the feedback information set and each content information contained in the target information set, the feedback information and content information corresponding to the same pushed content are spliced to obtain each intermediate data; each intermediate data is spliced with the attribute information contained in the target information set to obtain each sample data.
[0161] Specifically, since the target information set only contains one set of attribute information of the push object, first, the feedback information and content information corresponding to the same push content are spliced together to obtain intermediate data, and then the attribute information is spliced onto each intermediate data to obtain each sample data.
[0162] like Figure 8 As shown, this is a schematic diagram of a data splicing method in an embodiment of the present application. According to the content identifier of the pushed content, the feedback information and content information corresponding to the same pushed content are spliced to obtain intermediate data 1-5, and then the attribute information is spliced onto the intermediate data 1-5 to obtain sample data 1-5.
[0163] Based on this method of splicing sample data, the target information set of the feedback information set associated with a push request has been migrated to the same computing node. Therefore, there is no need to trigger data shuffle during the splicing process, which can greatly reduce the amount of shuffle data and thus reduce the cost of sample splicing.
[0164] Optionally, obtain the intermediate data in the following ways:
[0165] Based on the content identifier of the pushed content corresponding to each feedback information and each content information, the position information of each feedback information and each content information in the hash table is obtained; based on the obtained position information, each feedback information and each content information is stored in the hash table respectively, and the feedback information and content information corresponding to the same position information are spliced to obtain various intermediate data.
[0166] Specifically, first, a hash detection table is constructed for each feedback information according to the corresponding content identifier, and then each content information is stored in the constructed hash detection table according to the corresponding content identifier. The content information is spliced onto the feedback information using a hash join method to complete the second join and obtain intermediate data.
[0167] Since the second join does not trigger data shuffle, and the first join has shuffle but has not yet expanded the attribute information (user) and other features, the amount of shuffle data is greatly reduced compared to joining the user features with the content information at the beginning. In batch processing tasks, this often becomes the bottleneck of the entire task. Therefore, the two-step join in this application can greatly reduce the cost of sample splicing.
[0168] In order to verify the sample construction method in the embodiment of the present application, and its effect on the reduction of data volume and time consumption when applied to a distributed data cluster, the sample construction method in the present application is applied on a Spark cluster, and the following Tables 1 and 2 show the data volume and runtime of the shuffle at each intermediate stage of the task runtime before and after applying the sample construction method in the present application:
[0169] Run time enter Output Shuffle Read (Shuffle Read) Shuffle Write (Shuffle Write) 9.2 minutes 4.9TB 6.4TB 36 minutes 31.3TB 6.1TB 40 minutes 35.8TB 30.4TB 11 minutes 23.2GB 38.0GB 46 seconds 20.4GB 23.0GB 16 minutes 30.2GB
[0170] Table 1
[0171] Run time enter Output Shuffle Read Shuffle Write 9.2 minutes 950.5GB 1883.7GB 36 minutes 1611.3GB 1857.9GB 40 minutes 22.5GB 29.1GB 11 minutes 21.9GB 22.4GB 46 seconds 1169.0MB 16 minutes 22.4GB 1169.0MB
[0172] Table 2
[0173] As can be seen from Table 1, a direct shuffle join generates approximately 30TB of shuffle data. In Table 2, using the embodiment of the present application, this data volume is sharply reduced to 30GB, while the overall stage time is reduced by approximately 80 minutes. This comparison fully demonstrates the reduction in data volume and time consumption achieved by the embodiment of the present application.
[0174] Optionally, the sample data obtained in the above way cannot be directly recognized by the recommendation model, so the sample data needs to be converted:
[0175] The dynamic link library is loaded to convert the data format of each sample data to obtain each sample data in an input data format that conforms to the recommendation model. The obtained sample data is used to train the recommendation model.
[0176] Data format conversion of sample data, also known as feature extraction, is primarily based on dynamic link library (DLL) plugins and configuration, achieving separation of algorithms from engineering. First, the algorithm and engineering teams should agree on a set of operator interfaces. Algorithm developers can then expand and implement the feature extraction logic, compiling it into a dynamic link library (C++.so file). Operator parameters and sample formats are then configured. On the engineering data processing side, dynamically loading configurations and plugins allows the algorithm's feature extraction logic to be embedded in large-scale data processing tasks.
[0177] Based on the above method, data format conversion and algorithm model iteration are performed without changing the data processing task itself. In addition, cross-language functions are realized with the help of dynamic link libraries, which decouples engineering and algorithms and has high flexibility.
[0178] In addition, the above describes how to convert sample data by loading a dynamic link library. In fact, it can also be replaced according to actual conditions, such as by calling a Python script.
[0179] like Figure 9A As shown, it is a logical diagram of a sample construction method in an embodiment of the present application. Taking three first computing nodes as an example, computing node 1 stores historical information set 1 and historical information set 4, computing node 2 stores historical information set 3 and historical information set 5, and computing node 3 stores historical information set 2. Taking three second computing nodes as an example, computing node 4 stores feedback information set 1, computing node 5 stores feedback information set 2, and computing node 6 stores feedback information set 3. The identification reference information is 123, then historical information set 1 is stored as Take the target information set, i.e., target information set 1, as the target information set. On computing node 2, use historical information set 3 as the target information set, i.e., target information set 3. On computing node 3, use historical information set 2 as the target information set, i.e., target information set 2. Migrate target information set 1 to computing node 4, migrate target information set 2 to computing node 5, and migrate target information set 3 to computing node 6. Taking computing node 4 as an example, concatenate the feedback information 1-3 contained in feedback information set 1 with the content information 1-3 and attribute information contained in the target information set to obtain sample data 1-3.
[0180] In the embodiment of the present application, both the target information set and the feedback information set can be a table-type data structure, such as Figure 9BAs shown, the target information set is in the form of a sample return table, and the feedback information set is in the form of a feedback information table (Label table). Through sample splicing, a sample splicing table is obtained, which contains the sample data corresponding to each push request. After feature extraction of the sample splicing table, it can be used in three scenarios, including training of recommendation models used online, training of backup data and experimental recommendation models.
[0181] In addition, when actually building offline samples, you need to provide the Label table and feature extraction configuration. The Label table contains video playback duration, completion rate, whether it is effectively played, etc. Since these label data are cleaned into offline Hive tables by the algorithm, you need to obtain the table name in advance, and obtain external configuration files such as the feature extraction dynamic link library and extraction configuration, sample format configuration, etc. for building offline samples.
[0182] like Figure 9C FIG. 1 is a flowchart of another sample construction method in an embodiment of the present application, which is applied to a recommendation system and includes the following steps S91-S92:
[0183] S91: The recommendation system generates a historical information set associated with the push request based on the content information of each push content returned in response to the push request and the attribute information of the push object that sent the push request;
[0184] S92: The recommendation system stores the historical information set to the first computing node of the distributed data cluster, so that the first computing node can filter out each target information set from each stored historical information set based on the identification reference information, and migrate each obtained target information set to the second computing node to which the feedback information set associated with the corresponding push request belongs, and construct each sample data through the feedback information set stored in the second computing node and the corresponding target information set. The identification reference information is generated based on the request identifier of the push request associated with each feedback information set. The feedback information set includes: the push object of the associated push request, and each feedback information generated based on each received push content.
[0185] After the prediction is completed, the recommendation system requests the feature storage again to obtain all the features of the n winning items. At the same time, it packages the push request ID, context features, and object features together and reports them as return data for logging. After data cleaning, it serves as input for the sample project. This can obtain features that are extremely close to the scoring, thus solving the feature crossing problem existing in existing technologies.
[0186] In this embodiment of the present application, a first computing node first selects target information sets from stored historical information sets based on identification reference information, and then migrates each obtained target information set to a second computing node to which the feedback information set associated with the corresponding push request belongs. Then, a second computing node constructs sample data corresponding to the push request based on the feedback information set stored by the second computing node and the target information set associated with the corresponding push request.
[0187] On the one hand, by filtering the historical information set, only the filtered target information set needs to be migrated during data migration, which reduces the amount of data to be migrated and can effectively save the computing resources required for data migration.
[0188] On the other hand, in the prior art, each piece of content data and attribute data are spliced together before the data migration operation is performed. In fact, when each piece of content data is moved, a piece of attribute data needs to be moved. In the present application, since the content information of each pushed content contained in the target information set is for the same push object, the target information set only carries one piece of attribute information for this push object. In this way, when migrating the target information set, in fact, when multiple pieces of content information are moved, only one piece of attribute data is moved accordingly, which further reduces the amount of data during the data migration process.
[0189] Based on the above method, the computing resources used in the data migration process are reduced, thereby improving the resource utilization of the entire sample construction process. In addition, since the amount of data migrated is reduced, the time consumed in the data migration process will also be reduced accordingly, thereby reducing the time required for the sample construction process and improving the efficiency of sample construction.
[0190] Based on the same inventive concept, the present application also provides a sample construction device. Figure 10 As shown, it is a schematic structural diagram of a sample construction device 1000, which may include:
[0191] The mobile unit 1001 is configured to perform the following operations, respectively, through each first computing node: based on identification reference information, filter out each target information set from each stored historical information set, where the identification reference information is generated based on the request identifier of the push request associated with each feedback information set; the historical information set is generated and stored in the corresponding first computing node by the recommendation system based on the attribute information of the push object that sent the corresponding push request and the content information of each push content returned in response to the push request; each feedback information set is stored in each second computing node, where the feedback information set includes: the push object that sent the associated push request and each feedback information generated based on each received push content; and,
[0192] Migrating each obtained target information set to the second computing node to which the feedback information set associated with the corresponding push request belongs;
[0193] The construction unit 1002 is configured to perform the following operations through each second computing node: construct each sample data corresponding to the push request based on the feedback information set stored in a second computing node and in combination with the target information set associated with the corresponding push request.
[0194] In this embodiment of the present application, a first computing node first selects target information sets from stored historical information sets based on identification reference information, and then migrates each obtained target information set to a second computing node to which the feedback information set associated with the corresponding push request belongs. Then, a second computing node constructs sample data corresponding to the push request based on the feedback information set stored by the second computing node and the target information set associated with the corresponding push request.
[0195] On the one hand, by filtering the historical information set, only the filtered target information set needs to be migrated during data migration, which reduces the amount of data to be migrated and can effectively save the computing resources required for data migration.
[0196] On the other hand, in the prior art, each piece of content data and attribute data are spliced together before the data migration operation is performed. In fact, when each piece of content data is moved, a piece of attribute data needs to be moved. In the present application, since the content information of each pushed content contained in the target information set is for the same push object, the target information set only carries one piece of attribute information for this push object. In this way, when migrating the target information set, in fact, when multiple pieces of content information are moved, only one piece of attribute data is moved accordingly, which further reduces the amount of data during the data migration process.
[0197] Based on the above method, the computing resources used in the data migration process are reduced, thereby improving the resource utilization of the entire sample construction process. In addition, since the amount of data migrated is reduced, the time consumed in the data migration process will also be reduced accordingly, thereby reducing the time required for the sample construction process and improving the efficiency of sample construction.
[0198] Optionally, the device further includes a selection unit 1003, configured to:
[0199] Selecting a second computing node that meets preset conditions from among the second computing nodes to which each piece of feedback information corresponding to a push request belongs as a target second computing node;
[0200] Each piece of feedback information corresponding to a push request is migrated to the target second computing node respectively, and a feedback information set associated with the push request is obtained.
[0201] Optionally, the apparatus further includes a generating unit 1004, configured to:
[0202] Generate identification reference information by combining the request identifiers of the push requests associated with each feedback information set through the third computing node, and send the identification reference information to each first computing node respectively;
[0203] Then, before a first computing node filters out each target information set from each stored historical information set based on the identification reference information, the method further includes:
[0204] Receive identification reference information sent by the third computing node.
[0205] Optionally, the identification reference information includes a target array; the generating unit 1004 is specifically configured to:
[0206] Generate the target array as follows:
[0207] Mapping the request identifiers of the push requests associated with each feedback information set using a preset hash function to obtain corresponding target mapping values;
[0208] The mapping positions corresponding to the obtained target mapping values in the preset initial array are respectively determined, and the elements in each mapping position are respectively updated to preset values to obtain the target array.
[0209] Optionally, the generating unit 1004 is specifically configured to:
[0210] For each historical information set, perform the following operations:
[0211] Mapping the request identifier of the push request corresponding to a historical information set through a hash function to obtain a historical mapping value;
[0212] A mapping position corresponding to the historical mapping value in the target array is determined, and when the element value of the element in the mapping position is a preset value, a historical information set is used as a target information set associated with the corresponding push request.
[0213] Optionally, the construction unit 1002 is specifically configured to:
[0214] For each piece of feedback information included in the feedback information set and each piece of content information included in the target information set, the feedback information and content information corresponding to the same pushed content are spliced together to obtain each piece of intermediate data;
[0215] Each intermediate data is spliced with the attribute information contained in the target information set to obtain each sample data.
[0216] Optionally, the construction unit 1002 is specifically configured to:
[0217] Based on the content identifiers of the pushed contents corresponding to the respective pieces of feedback information and the respective pieces of content information, obtaining the position information of the respective pieces of feedback information and the respective pieces of content information in the hash table;
[0218] Based on the obtained position information, each piece of feedback information and each piece of content information is stored in a hash table respectively, and the feedback information and content information corresponding to the same position information are concatenated to obtain each piece of intermediate data.
[0219] Optionally, the device further includes a conversion unit 1005, configured to:
[0220] The dynamic link library is loaded to convert the data format of each sample data to obtain each sample data in an input data format that conforms to the recommendation model. The obtained sample data is used to train the recommendation model.
[0221] Based on the same inventive concept, the present embodiment also provides another sample construction device. Figure 11 As shown, it is a schematic structural diagram of a sample construction device 1100, which may include:
[0222] The generating unit 1101 is configured to generate a historical information set associated with a push request based on the content information of each push content returned in response to a push request and the attribute information of the push object that sends the push request;
[0223] Storage unit 1102 is used to store the historical information set to the first computing node of the distributed data cluster, so that the first computing node can screen out each target information set from each stored historical information set based on the identification reference information, and migrate each obtained target information set to the second computing node to which the feedback information set associated with the corresponding push request belongs, and construct each sample data through the feedback information set stored by the second computing node and the corresponding target information set. The identification reference information is generated based on the request identifier of the push request associated with each feedback information set. The feedback information set includes: the push object of the associated push request, and each feedback information generated based on the received push content.
[0224] For the convenience of description, the above parts are divided into modules (or units) according to their functions and described separately. Of course, when implementing this application, the functions of each module (or unit) can be implemented in the same or multiple software or hardware.
[0225] In the embodiments of the present application, the term "module" or "unit" refers to a computer program or a part of a computer program that has a predetermined function and works together with other related parts to achieve a predetermined goal, and can be implemented in whole or in part by using software, hardware (such as processing circuits or memories) or a combination thereof. Similarly, a processor (or multiple processors or memories) can be used to implement one or more modules or units. In addition, each module or unit can be part of an overall module or unit that includes the function of the module or unit.
[0226] Those skilled in the art will appreciate that various aspects of the present application can be implemented as systems, methods, or program products. Therefore, various aspects of the present application can be specifically implemented in the following forms: a complete hardware implementation, a complete software implementation (including firmware, microcode, etc.), or an implementation that combines hardware and software aspects, which may be collectively referred to herein as a "circuit," "module," or "system."
[0227] Based on the same inventive concept as the above method embodiment, an electronic device is also provided in the embodiment of the present application. In one embodiment, the electronic device may be a server. In this embodiment, the structure of the electronic device may be as follows: Figure 12 As shown, it includes a memory 1201 , a communication module 1203 and one or more processors 1202 .
[0228] Memory 1201 is used to store computer programs executed by processor 1202. Memory 1201 may primarily include a program storage area and a data storage area. The program storage area may store an operating system and programs required for running instant messaging functions, while the data storage area may store various instant messaging messages and operating instruction sets.
[0229] Memory 1201 may be a volatile memory, such as random-access memory (RAM); a non-volatile memory, such as read-only memory, flash memory, a hard disk drive (HDD), or a solid-state drive (SSD); or any other medium capable of carrying or storing a desired computer program in the form of instructions or data structures and accessible by a computer, but is not limited thereto. Memory 1201 may be a combination of the aforementioned memories.
[0230] The processor 1202 may include one or more central processing units (CPUs) or digital processing units, etc. The processor 1202 is configured to implement the above-mentioned sample construction method when calling the computer program stored in the memory 1201 .
[0231] The communication module 1203 is used to communicate with terminal devices and other servers.
[0232] The specific connection medium between the memory 1201, the communication module 1203 and the processor 1202 is not limited in the embodiment of the present application. Figure 12 In the embodiment, the memory 1201 and the processor 1202 are connected via a bus 1204. The bus 1204 is connected to the processor 1202 via a bus 1204. Figure 12 The connections between the other components are shown in bold lines, which are only for illustration and are not intended to be limiting. The bus 1204 can be divided into an address bus, a data bus, a control bus, etc. For ease of description, Figure 12 The diagram shows a single thick line, but this does not indicate that there is only one bus or one type of bus.
[0233] The memory 1201 stores a computer storage medium, which stores computer executable instructions. The computer executable instructions are used to implement the sample construction method of the embodiment of the present application. The processor 1202 is used to execute the above sample construction method, such as Figure 3 Or as shown in 9.
[0234] In another embodiment, the electronic device may also be other electronic devices, such as terminal devices. In this embodiment, the structure of the electronic device may be as follows: Figure 13 As shown, it includes: a communication component 1310, a memory 1320, a display unit 1330, a camera 1340, a sensor 1350, an audio circuit 1360, a Bluetooth module 1370, a processor 1380 and other components.
[0235] The communication component 1310 is used to communicate with the server. In some embodiments, it may include a wireless fidelity (WiFi) module. The WiFi module is a short-range wireless transmission technology. Electronic devices can help users send and receive information through the WiFi module.
[0236] The memory 1320 can be used to store software programs and data. The processor 1380 executes various functions and data processing of the terminal device by running the software programs or data stored in the memory 1320. The memory 1320 may include high-speed random access memory and may also include non-volatile memory, such as at least one disk storage device, flash memory device, or other volatile solid-state memory device. The memory 1320 stores the operating system that enables the terminal device to operate. In the present application, the memory 1320 can store the operating system and various application programs, and may also store the computer program that executes the sample construction method in the embodiments of the present application.
[0237] The display unit 1330 can also be used to display information input by the user or provided to the user, as well as a graphical user interface (GUI) of various menus of the terminal device. Specifically, the display unit 1330 may include a display screen 1332 disposed on the front of the terminal device. The display screen 1332 may be configured in the form of a liquid crystal display, a light-emitting diode, etc. The display unit 1330 can be used to display the sample construction user interface in the embodiments of the present application, etc.
[0238] The display unit 1330 can also be used to receive input digital or character information and generate signal input related to user settings and function control of the terminal device. Specifically, the display unit 1330 may include a touch screen 1331 set on the front of the terminal device, which can collect user touch operations on or near it, such as clicking a button, dragging a scroll box, etc.
[0239] The touch screen 1331 can be covered on the display screen 1332, or the touch screen 1331 and the display screen 1332 can be integrated to realize the input and output functions of the terminal device. The integrated touch screen can be simply called a touch display screen. In this application, the display unit 1330 can display the application and the corresponding operation steps.
[0240] The camera 1340 can be used to capture still images, and users can post comments on the images captured by the camera 1340 through the application. The camera 1340 can be one or more. The object generates an optical image through the lens and projects it onto the photosensitive element. The photosensitive element can be a charge coupled device (CCD) or a complementary metal-oxide-semiconductor (CMOS) phototransistor. The photosensitive element converts the optical signal into an electrical signal, and then transmits the electrical signal to the processor 1380 to convert it into a digital image signal.
[0241] The terminal device may further include at least one sensor 1350, such as an acceleration sensor 1351, a distance sensor 1352, a fingerprint sensor 1353, and a temperature sensor 1354. The terminal device may also be configured with other sensors such as a gyroscope, a barometer, a hygrometer, a thermometer, an infrared sensor, a light sensor, and a motion sensor.
[0242] The audio circuit 1360, speaker 1361, and microphone 1362 provide an audio interface between the user and the terminal device. The audio circuit 1360 can convert the received audio data into an electrical signal and transmit it to the speaker 1361, which converts it into a sound signal for output. The terminal device may also be equipped with a volume button for adjusting the volume of the sound signal. Meanwhile, the microphone 1362 converts the collected sound signal into an electrical signal, which is then received by the audio circuit 1360 and converted into audio data. The audio data is then output to the communication component 1310 for transmission to, for example, another terminal device, or the audio data is output to the memory 1320 for further processing.
[0243] The Bluetooth module 1370 is used to exchange information with other Bluetooth devices having a Bluetooth module through the Bluetooth protocol. For example, the terminal device can establish a Bluetooth connection with a wearable electronic device (such as a smart watch) that also has a Bluetooth module through the Bluetooth module 1370 to exchange data.
[0244] The processor 1380 is the control center of the terminal device. It uses various interfaces and lines to connect various parts of the entire terminal. By running or executing software programs stored in the memory 1320 and calling data stored in the memory 1320, it performs various functions of the terminal device and processes data. In some embodiments, the processor 1380 may include one or more processing units; the processor 1380 may also integrate an application processor and a baseband processor, wherein the application processor mainly processes the operating system, user interface, and application programs, and the baseband processor mainly processes wireless communications. It is understandable that the above-mentioned baseband processor may not be integrated into the processor 1380. In this application, the processor 1380 can run the operating system, application programs, user interface display and touch response, as well as the sample construction method of the embodiment of the application. In addition, the processor 1380 is coupled to the display unit 1330.
[0245] In some possible implementations, various aspects of the sample construction method provided in the present application may also be implemented in the form of a program product, which includes a computer program. When the program product is run on an electronic device, the computer program is used to enable the electronic device to execute the steps of the sample construction method according to various exemplary embodiments of the present application described above in this specification. For example, the electronic device may execute the following steps: Figure 3 or Figure 9C Follow the steps shown in .
[0246] The program product may employ any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or component, or any combination thereof. More specific examples of readable storage media (a non-exhaustive list) include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof.
[0247] The program product of the embodiment of the present application may be a portable compact disc read-only memory (CD-ROM) and include a computer program, and can be run on an electronic device. However, the program product of the present application is not limited thereto. In this document, a readable storage medium may be any tangible medium containing or storing a program that can be used by or in conjunction with a command execution system, apparatus, or device.
[0248] A readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, which carries a readable computer program. Such a propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A readable signal medium may also be any readable medium other than a readable storage medium that can transmit, propagate, or transfer a program for use by or in conjunction with a command execution system, apparatus, or device.
[0249] The computer program embodied on the readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
[0250] The computer program for performing the operations of the present application can be written in any combination of one or more programming languages, including object-oriented programming languages such as Java, C++, etc., and conventional procedural programming languages such as "C" or similar programming languages. The computer program can be executed entirely on the user electronic device, partially on the user device, as a separate software package, partially on the user electronic device and partially on a remote electronic device, or entirely on a remote electronic device or server. In cases involving remote electronic devices, the remote electronic device can be connected to the user electronic device through any type of network, including a local area network (LAN) or a wide area network (WAN), or can be connected to an external electronic device (for example, using an Internet service provider to connect through the Internet).
[0251] It should be noted that although several units or subunits of the device are mentioned in the detailed description above, this division is merely exemplary and not mandatory. In fact, depending on the embodiment of the application, the features and functions of two or more units described above can be embodied in a single unit. Conversely, the features and functions of a single unit described above can be further divided and embodied by multiple units.
[0252] Furthermore, although the operations of the method of the present application are described in a particular order in the accompanying drawings, this does not require or imply that the operations must be performed in this particular order, or that all illustrated operations must be performed to achieve the desired results. Additionally or alternatively, some steps may be omitted, multiple steps may be combined into one step, and / or one step may be decomposed into multiple steps.
[0253] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Furthermore, the present application may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) that contain a computer-usable computer program.
[0254] The present application is described with reference to the flow chart and / or block diagram of the method, device (system) and computer program product according to the embodiment of the present application. It should be understood that each flow process and / or box in the flow chart and / or block diagram and the combination of the flow process and / or box in the flow chart and / or block diagram can be realized by computer program commands. These computer program commands can be provided to the processor of a general-purpose computer, a special-purpose computer, an embedded processing machine or other programmable data processing device to produce a machine, so that the command executed by the processor of the computer or other programmable data processing device produces a device for realizing the function specified in one flow chart flow or multiple flows and / or one box or multiple boxes of the block diagram.
[0255] These computer program commands may also be stored in a computer-readable memory that can direct a computer or other programmable data processing device to operate in a specific manner, so that the commands stored in the computer-readable memory produce a manufactured product including a command device that implements the functions specified in one or more processes in the flowchart and / or one or more boxes in the block diagram.
[0256] These computer program commands can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, so that the commands executed on the computer or other programmable device provide steps for implementing the functions specified in one or more processes in the flowchart and / or one or more boxes in the block diagram.
[0257] Although the preferred embodiments of the present application have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the present application.
[0258] Obviously, those skilled in the art may make various changes and modifications to this application without departing from the spirit and scope of this application. Thus, if these modifications and variations of this application fall within the scope of the claims of this application and their equivalents, this application is intended to include these modifications and variations.
Claims
1. A sample construction method, characterized in that: Applied to a distributed data cluster comprising multiple computing nodes, the method comprises: The following operations are respectively performed by each first computing node: based on identification reference information, each target information set is filtered out from each stored historical information set, wherein the identification reference information is generated based on the request identifier of the push request associated with each feedback information set; the historical information set is generated and stored in the corresponding first computing node by the recommendation system based on the attribute information of the push object that sends the corresponding push request and the content information of each push content returned in response to the push request; each feedback information set is stored in each second computing node, wherein the feedback information set includes: the push object that sends the associated push request and each feedback information generated based on each received push content; and Migrating each obtained target information set to the second computing node to which the feedback information set associated with the corresponding push request belongs; The following operations are respectively performed by each second computing node: based on the feedback information set stored by a second computing node and in combination with the target information set associated with the corresponding push request, each sample data corresponding to the push request is constructed.
2. The method according to claim 1, wherein The feedback information set is obtained in the following manner: Selecting a second computing node that meets preset conditions from among the second computing nodes to which each piece of feedback information corresponding to a push request belongs as a target second computing node; Each piece of feedback information corresponding to the push request is migrated to the target second computing node to obtain a feedback information set associated with the push request.
3. The method according to claim 1, wherein The method further comprises: generating, by a third computing node, the identification reference information in combination with the request identifiers of the push requests associated with each feedback information set, and sending the identification reference information to each of the first computing nodes; Then, before a first computing node filters out each target information set from each stored historical information set based on the identification reference information, the method further includes: Receive identification reference information sent by the third computing node.
4. The method according to claim 3, wherein The identification reference information includes a target array; The target array is generated in the following manner: Mapping the request identifiers of the push requests associated with each feedback information set respectively through a preset hash function to obtain corresponding target mapping values; The mapping positions corresponding to the obtained target mapping values in the preset initial array are respectively determined, and the elements in each mapping position are respectively updated to preset values to obtain the target array.
5. The method according to claim 4, wherein The method of filtering out target information sets from stored historical information sets based on identification reference information includes: For each historical information set, perform the following operations: Mapping the request identifier of the push request corresponding to a historical information set through the hash function to obtain a historical mapping value; A mapping position corresponding to the historical mapping value in the target array is determined, and when the element value of the element in the mapping position is the preset value, the one historical information set is used as a target information set associated with the corresponding push request.
6. The method according to any one of claims 1 to 5, wherein: The step of constructing sample data corresponding to the push request based on a feedback information set stored in a second computing node and in combination with a target information set associated with the push request includes: For each piece of feedback information included in the feedback information set and each piece of content information included in the target information set, splicing the feedback information and content information corresponding to the same pushed content to obtain each piece of intermediate data; The intermediate data are respectively concatenated with the attribute information included in the target information set to obtain the sample data.
7. The method according to claim 6, wherein The splicing of feedback information and content information corresponding to the same pushed content to obtain various intermediate data includes: Based on the content identifiers of the pushed contents corresponding to the respective pieces of feedback information and the respective pieces of content information, obtaining the position information of the respective pieces of feedback information and the respective pieces of content information in the hash table; Based on the obtained position information, the feedback information and content information are respectively stored in the hash table, and the feedback information and content information corresponding to the same position information are spliced to obtain the intermediate data.
8. The method according to any one of claims 1 to 5, wherein: The method further comprises: The dynamic link library is loaded to convert the data format of each sample data to obtain each sample data in an input data format that conforms to the recommendation model, and the obtained sample data is used to train the recommendation model.
9. A sample construction method, characterized in that: Applied to a recommendation system, the method includes: generating a historical information set associated with the push request based on content information of each push content returned in response to the push request and attribute information of the push object that sent the push request; The historical information set is stored in the first computing node of the distributed data cluster, so that the first computing node can screen out each target information set from each stored historical information set based on the identification reference information, and migrate each obtained target information set to the second computing node to which the feedback information set associated with the corresponding push request belongs, and construct each sample data through the feedback information set stored in the second computing node and the corresponding target information set. The identification reference information is generated based on the request identifier of the push request associated with each feedback information set, and the feedback information set includes: the push object of the associated push request, and each feedback information generated based on the received push content.
10. A sample construction device, characterized in that: include: The mobile unit is configured to perform the following operations, respectively, through each first computing node: based on identification reference information, filter out each target information set from each stored historical information set, wherein the identification reference information is generated based on the request identifier of the push request associated with each feedback information set; the historical information set is generated and stored in the corresponding first computing node by the recommendation system based on attribute information of the push object that sent the corresponding push request and content information of each push content returned in response to the push request; the feedback information set is stored in each second computing node, wherein the feedback information set includes: the push object that sent the associated push request and each feedback information generated based on each received push content; as well as, Migrating each obtained target information set to the second computing node to which the feedback information set associated with the corresponding push request belongs; The construction unit is used to perform the following operations respectively through the second computing nodes: based on the feedback information set stored by a second computing node and in combination with the target information set associated with the corresponding push request, construct each sample data corresponding to the push request.
11. A sample construction device, characterized in that: include: a generating unit, configured to generate a historical information set associated with a push request based on content information of each push content returned in response to the push request and attribute information of a push object that sends the push request; A storage unit is used to store the historical information set to the first computing node of the distributed data cluster, so that the first computing node can screen out each target information set from each stored historical information set based on the identification reference information, and migrate each obtained target information set to the second computing node to which the feedback information set associated with the corresponding push request belongs, and construct each sample data through the feedback information set stored by the second computing node and the corresponding target information set. The identification reference information is generated based on the request identifier of the push request associated with each feedback information set, and the feedback information set includes: the push object of the associated push request, and each feedback information generated based on the received push content.
12. An electronic device, characterized in that: The method comprises a processor and a memory, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor is enabled to perform the steps of any one of the methods of claims 1 to 9.
13. A computer-readable storage medium, characterized in that The method comprises a computer program. When the computer program is run on an electronic device, the computer program is used to enable the electronic device to execute the steps of any one of the methods of claims 1 to 9.
14. A computer program product, characterized in that The method comprises a computer program stored in a computer-readable storage medium; when a processor of an electronic device reads the computer program from the computer-readable storage medium, the processor executes the computer program, so that the electronic device performs the steps of any one of the methods described in claims 1 to 9.