A training sample processing method, device, equipment and storage medium
Through the analysis and preprocessing of data by the stream computing engine, the rapid and stable output of training samples is achieved, which solves the problem in the existing technology that training samples cannot be output in real time, and improves the timeliness and stability of recommendation models and systems.
Patent Information
- Application Number
- CN202110197693.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-02-22
- Publication Date
- 2024-10-18
- Estimated Expiration
- 2041-02-22
AI Technical Summary
The existing technology cannot realize the real-time output of training samples, resulting in insufficient timeliness of the recommendation model and affecting the effectiveness of the recommendation system.
Parse the event data through the stream computing engine, obtain user response data as labels, preprocess the characteristic data based on preset rules, store it in a distributed column database, form a training sample, and output it to a distributed messaging system or file system to achieve rapid and stable output.
It improves the timeliness of the recommendation model and the stability of the recommendation system, avoids the impact of erroneous data on the model, reduces rollback costs, and ensures the real-time and high efficiency of training samples.
Smart Images

Figure CN112925947B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of data processing technology, and in particular to a training sample processing method, apparatus, device and storage medium. Background Art
[0002] In scenarios such as short video recommendations, live broadcast recommendations, and advertising, the timeliness of recommended content is becoming increasingly important. In recommendation systems, timeliness plays a very important role in recommendation effectiveness. The faster the model of the recommendation system is updated, the more it can reflect the user's recent habits, the more it can reflect the latest popular trends, and the more it can recommend content that users are currently more interested in. The timeliness of the recommendation system consists of two parts: one is the timeliness of the features, and the other is the timeliness of the model.
[0003] In order to achieve content recommendations with high timeliness, the model needs to be trained quickly, and features need to be generated in real time. In order to achieve the fast operation of the recommendation link, the model can be trained online through online learning technology in the existing technology to improve the model training speed. However, the training samples of the online training model need to be produced in real time, and big data needs to be processed in real time to achieve real-time production of training samples. The current big data real-time processing technology foundation is relatively complete, and some excellent stream processing platforms are becoming increasingly mature. The stream computing engine provided by the stream processing platform can be used to realize real-time data processing. However, the current real-time data processing technology has not been applied to real-time training samples, that is, traditional training sample production methods cannot achieve real-time production of training samples. Summary of the invention
[0004] The embodiments of the present application provide a training sample processing method, apparatus, device and storage medium, which can solve the problem that training samples cannot be produced in real time, and ensure the timeliness of the recommendation model and recommendation system.
[0005] In a first aspect, an embodiment of the present application provides a training sample processing method, comprising:
[0006] Acquire the dot event data, parse the dot event data through the stream computing engine, parse out the user reaction data of the recommended content corresponding to the dot event, and use the user reaction data as the label of the corresponding dot event data;
[0007] Acquire feature data corresponding to the recommended content, and preprocess the feature data through the stream computing engine based on a preset first preprocessing rule;
[0008] The dotting event data is stored in a distributed column database, and the label of the dotting event data and the corresponding pre-processing feature data are stored in an associated field of the dotting event data;
[0009] After all the labels of the dot event data are stored in the corresponding associated fields, the dot event data and the data in the associated fields are used as training samples, and the training samples are stored in the distributed messaging system or distributed file system.
[0010] In a second aspect, an embodiment of the present application provides a training sample processing device, including:
[0011] A label parsing module is configured to obtain dot event data, parse the dot event data through a stream computing engine, parse out user reaction data of recommended content corresponding to the dot event, and use the user reaction data as a label of the corresponding dot event data;
[0012] A feature preprocessing module is configured to obtain feature data corresponding to the recommended content, preprocess the feature data through the stream computing engine based on a preset first preprocessing rule, and store the dot event data and the feature data in a distributed messaging system;
[0013] A data aggregation module is configured to store the dotting event data in a distributed column database, and store the label of the dotting event data and the corresponding pre-processing feature data in an associated field of the dotting event data;
[0014] The training sample generation module is configured to use the dot event data and the data in the associated fields as training samples after all the labels of the dot event data are stored in the corresponding associated fields, and store the training samples in the distributed messaging system or distributed file system.
[0015] In a third aspect, an embodiment of the present application provides an electronic device, including:
[0016] memory and one or more processors;
[0017] The memory is used to store one or more programs;
[0018] When the one or more programs are executed by the one or more processors, the one or more processors implement the training sample processing method as described in the first aspect.
[0019] In a fourth aspect, an embodiment of the present application provides a storage medium comprising computer executable instructions, which, when executed by a computer processor, are used to execute the training sample processing method as described in the first aspect.
[0020] The embodiment of the present application obtains dotting event data, parses the dotting event data through a stream computing engine, parses out user reaction data of the recommended content corresponding to the dotting event, and uses the user reaction data as a label of the corresponding dotting event data; obtains feature data corresponding to the recommended content, and pre-processes the feature data through the stream computing engine based on a preset first pre-processing rule; stores the dotting event data in a distributed columnar database, and stores the label of the dotting event data and the corresponding pre-processed feature data in the associated field of the dotting event data; after all the labels of the dotting event data are stored in the corresponding associated fields, the dotting event data and the data in the associated fields are used as training samples, and the training samples are stored in the distributed messaging system or distributed file system. The above-mentioned technical means are adopted to parse the dotting event data through a stream computing engine, quickly collect the label information of the dotting event data, pre-process the feature data through the stream computing engine, reduce the feature data memory, and reduce the subsequent cache pressure. Since the dot event data and feature data are different data sources, they are combined in a distributed column database and then output to the downstream model, which can quickly discover and solve faults, avoid the huge impact of a large amount of erroneous data on the recommendation model, avoid spending a lot of manpower and material resources to roll back the recommendation model, and improve the stability of the recommendation system. Based on the stream computing engine and data fusion processing, the rapid and stable output of training samples is achieved, ensuring the timeliness of the recommendation model and the timeliness of the recommendation system. BRIEF DESCRIPTION OF THE DRAWINGS
[0021] Figure 1 is a flow chart of a training sample processing method provided in Example 1 of the present application;
[0022] Figure 2 It is a flow chart of the confluence of dot event data and associated data in the first embodiment of the present application;
[0023] Figure 3 is a flow chart of training sample output in Embodiment 1 of the present application;
[0024] Figure 4 is a flow chart of training sample storage in Embodiment 1 of the present application;
[0025] Figure 5 is a flowchart of another training sample processing method provided in Example 1 of the present application;
[0026] Figure 6 It is a schematic diagram of the framework of the training sample processing system provided in Example 1 of the present application;
[0027] Figure 7 It is a structural schematic diagram of a training sample processing device provided in Embodiment 2 of the present application;
[0028] Figure 8 It is a structural schematic diagram of an electronic device provided in Example 3 of the present application. DETAILED DESCRIPTION
[0029] In order to make the purpose, technical scheme and advantages of the present application clearer, the specific embodiments of the present application are further described in detail below in conjunction with the accompanying drawings. It is understood that the specific embodiments described herein are only used to explain the present application, rather than to limit the present application. It should also be noted that, for the convenience of description, only the part related to the present application but not all the contents are shown in the accompanying drawings. Before discussing the exemplary embodiments in more detail, it should be mentioned that some exemplary embodiments are described as processes or methods depicted as flow charts. Although the flow chart describes each operation (or step) as a sequential process, many of the operations therein can be implemented in parallel, concurrently or simultaneously. In addition, the order of each operation can be rearranged. The process can be terminated when its operation is completed, but it can also have additional steps not included in the accompanying drawings. The process can correspond to a method, a function, a procedure, a subroutine, a subprogram, etc.
[0030] The training sample processing method, device, equipment and storage medium provided in the present application are intended to obtain dotting event data, parse the dotting event data through a stream computing engine, parse out the user reaction data of the recommended content corresponding to the dotting event, and use the user reaction data as the label of the corresponding dotting event data; obtain the feature data corresponding to the recommended content, and pre-process the feature data through the stream computing engine based on a preset first pre-processing rule; store the dotting event data in a distributed column database, and store the label of the dotting event data and the corresponding pre-processed feature data in the associated field of the dotting event data; after all the labels of the dotting event data are stored in the corresponding associated fields, use the dotting event data and the data in the associated fields as training samples, and store the training samples in the distributed messaging system or distributed file system. Compared with the traditional training sample output method, it is not applied to the real-time data processing technology application, that is, the traditional training sample output method cannot guarantee the timeliness of the training samples, and thus cannot guarantee the timeliness of the model, which reduces the timeliness of the recommendation system and reduces the data value. Based on this, the embodiments of the present application provide a training sample processing method, apparatus, device and storage medium, which processes training samples in real time based on a stream computing engine to efficiently produce training samples in real time, improve the timeliness of the model, and improve the timeliness of the recommendation system.
[0031] Embodiment 1:
[0032] Figure 1A flowchart of a training sample processing method provided in Embodiment 1 of the present application is given. The training sample processing method provided in this embodiment can be executed by a training sample processing device, and the training sample processing device can be implemented by software and / or hardware.
[0033] The following description is made by taking the training sample processing device as an example to perform the training sample processing method. Figure 1 , the training sample processing method includes:
[0034] S110: Acquire dot event data, parse the dot event data through a stream computing engine, parse out user reaction data of recommended content corresponding to the dot event, and use the user reaction data as a label of the corresponding dot event data.
[0035] Specifically, the dotting event data is user behavior data collected through client-side embedding, which can reflect the user's preference for the recommended content corresponding to the dotting event. Therefore, the dotting event data can be parsed to obtain the user's reaction data to the recommended content, and the reaction data can be used as the label information of the dotting event data, so as to achieve efficient real-time output of training samples in the future. Furthermore, since the number of dotting event data is too large, a stream computing engine is introduced to process the dotting event data in real time to improve the output rate of training sample data. Among them, the stream computing engine can use flink, which is an open source stream processing framework that provides a distributed stream data flow engine that can execute any data flow program in a data parallel and pipeline manner. Based on the characteristics of flink batch processing and stream processing, the embodiment of the present application parses and processes a large number of dotting event data streams to improve the real-time output efficiency of training samples.
[0036] S120: Acquire feature data corresponding to the recommended content, and preprocess the feature data through the stream computing engine based on a preset first preprocessing rule.
[0037] Feature data is the basis for the output of recommended content, which represents the content information of the recommended content. The data source of feature data is very stable, but the memory of feature data is very large, which easily affects the efficiency of subsequent data caching. Therefore, feature data is preprocessed. The memory of feature data after feature preprocessing is smaller, which reduces the pressure of subsequent data buffering, thereby improving data buffering efficiency and improving the efficiency of training sample output.
[0038] In addition, the embodiment of the present application is based on the stream computing engine of Flink, which executes the parsing of dot event data and the preprocessing of feature data in parallel. While improving the data processing rate, it constructs independent processing modules corresponding to the two data processing flows, so that the training sample processing system is fully decoupled and the stability of the training sample processing system is improved.
[0039] S130: Store the dot event data in a distributed column database, and store the label of the dot event data and the corresponding pre-processed feature data in an associated field of the dot event data.
[0040] Specifically, when the dot event data is generated, the same flow identifier will be automatically configured for the dot event data and the corresponding feature data. When parsing the tags and preprocessing feature data of the dot event data, the tags and preprocessing feature data will also be configured with consistent flow identifiers, so as to facilitate the subsequent merging of the dot event data and the associated data. Figure 2 , Figure 2 This is a flow chart of the integration of dot event data and associated data in the first embodiment of the present application. Figure 2 As shown, the integration process of dot event data and associated data includes:
[0041] S1301: at a second time point after the dot event data is stored in the distributed column-based database, determine, according to a stream identifier of the dot event data, a storage row of the dot event data in the distributed column-based database;
[0042] S1302: Store the label and the pre-processing feature data in the remaining columns of the storage row, wherein the label and the pre-processing feature data are configured with the same flow identifier as the dot event data.
[0043] Exemplarily, the dotting event data is stored in a distributed column database, and the distributed column database can adopt HBase, which is a high-reliability, high-performance, column-oriented, and scalable distributed storage system. HBase is used as an intermediate storage, and based on the characteristics of HBase column storage, the dotting event data, labels, and corresponding pre-processing feature data are stored in the fields of the same row, so as to achieve the purpose of merging the dotting event data and the associated data. Further, after the dotting event data is stored in HBase, in order to avoid the instability of the training sample processing system caused by storing a large amount of data streams such as dotting event data and associated data in HBase at the same time, thereby causing the loss of associated data, after the dotting event data is stored in HBase for one day, the labels and pre-processing feature data are stored in the associated fields in HBase. Among them, according to the flow identifier of the dotting event data, the storage row of the dotting event data is determined, and then the labels and pre-processing feature data are stored in the remaining columns of the storage row.
[0044] In the embodiment of the present application, in order to fully decouple the training sample processing system, HBase is also independent as a storage process. After the flink stream computing engine executes the label parsing process and the preprocessing process in parallel, the generated labels and preprocessing feature data are respectively stored in the corresponding fields to ensure the independence of each process, ensure that each link in the training sample processing system is fully decoupled, and improve the stability of the training sample processing system.
[0045] S140: After all the labels of the dot event data are stored in the corresponding associated fields, the dot event data and the data in the associated fields are used as training samples, and the training samples are stored in the distributed messaging system or distributed file system.
[0046] Specifically, after storing the dot event data and the associated data in HBase, the preprocessing of the training samples is completed. Subsequently, it is only necessary to store the dot event data and the associated data in the training sample database, and the downstream recommendation model randomly pulls the training samples in the training sample database. However, the dot event data has a large delay and is unstable. If the dot event data and the associated data are stored in the training sample database too early, the label information of the dot event data will be incomplete, affecting the training effect of the training samples. Therefore, how to judge whether its label information has been completely stored in the associated field is a problem. In this regard, when storing the dot event data and the associated data in the training sample database, the dot event data and the associated data can be cached for a period of time before reading the dot event data and the associated data from HBase, but the caching task is very complicated. Therefore, when reading data in HBase, the embodiment of the present application delays reading related data to achieve the same purpose as caching. Specifically, refer to Figure 3 , Figure 3 This is a flow chart of training sample output in Example 1 of this application. Figure 3 As shown in Figure 1, the training sample output process includes:
[0047] S1401, determining whether all labels of the dot event data are stored in corresponding associated fields; if all labels of the dot event data are stored in corresponding associated fields, taking the dot event data and data in the associated fields as sample data of the first response level;
[0048] S1402: At the first time point after the tag starts to be stored in the distributed column database, use the dot event data and the data in the associated field as sample data of the second response level.
[0049] Exemplarily, determine whether all the labels of the dotting event data are stored in HBase. If the labels are not completely stored in HBase, keep querying whether all the labels are stored in HBase until all the labels are stored in HBase. After the labels are completely stored in HBase, the dotting event data and associated data are stored in the training sample database, so that the downstream recommendation model can pull the dotting event data and associated data in the training sample database. Since the embodiment of the present application quickly stores the dotting event data and associated data in the training sample database after the label data is completely stored in HBase, the training sample is equivalent to real-time output, which ensures the timeliness of the dotting event data and associated data. Therefore, the dotting event data and associated data quickly stored in the training sample database after the label data is completely stored are used as sample data of the first response level.
[0050] Exemplarily, to enrich the time granularity of training samples, one hour after the tags start to be stored in HBase, the dot event data and associated data are stored in the training sample database, and this part of the data is used as sample data of the second response level.
[0051] The embodiments of the present application support training samples of multiple time granularities through different training sample output strategies, thereby enriching the usage scenarios of training samples.
[0052] Furthermore, the sample data of the first response level and the sample data of the second response level need to be stored in different training sample databases so that the recommendation model can pull the corresponding training samples from the corresponding training sample databases. Figure 4 , Figure 4 This is a flow chart of training sample storage in the first embodiment of the present application. Figure 4 As shown in the figure, the training sample storage process includes:
[0053] S1403, storing the sample data of the first response level in a topic message unit of the distributed message system, where the topic message unit is used to store message data of the same topic;
[0054] S1404: Store the sample data of the second response level in the distributed file system.
[0055] For example, the distributed messaging system uses Kafka, which is a high-throughput distributed publish-subscribe messaging system. Sample data of the first response level can be stored in a Kafka topic. The Kafka cluster provides real-time training samples to the recommendation model, and the Kafka topic stores the dot event data and related data. When the recommendation model pulls the training samples from Kafka, the dot event data and related data are pulled from the Kafka topic.
[0056] Exemplarily, the distributed file system adopts HDFS (Hadoop Distributed File System), which is a highly fault-tolerant distributed file system, and the sample data of the second response level can be stored in HDFS.
[0057] The embodiment of the present application provides real-time training samples to the recommendation model through the real-time push feature of the Kafka cluster, so as to achieve real-time output of training samples, improve the timeliness of the recommendation model, and improve the timeliness of the recommendation system.
[0058] on the other hand, Figure 5 A flowchart of another training sample processing method provided in the first embodiment of the present application is given. Figure 5 , the training sample processing method includes:
[0059] S210: Acquire, through the stream data management system, the dot event data sent by the client and the feature data of the pushed content corresponding to the dot event sent by the server.
[0060] S220: Store the dot event data and the corresponding feature data in the distributed message system, wherein the dot event data and the corresponding feature data are configured with the same flow identifier.
[0061] Specifically, the dot event data and feature data collected by the stream data management system are stored in Kafka.
[0062] S230: Acquire dot event data, parse the dot event data through a stream computing engine, parse out user reaction data of recommended content corresponding to the dot event, and use the user reaction data as a label of the corresponding dot event data.
[0063] S240: Acquire feature data corresponding to the recommended content, and preprocess the feature data through the stream computing engine based on a preset first preprocessing rule.
[0064] S250: Store the dot event data in a distributed column database, and store the label of the dot event data and the corresponding pre-processed feature data in an associated field of the dot event data.
[0065] S260: After all the labels of the dot event data are stored in the corresponding associated fields, the dot event data and the data in the associated fields are used as training samples, and the training samples are stored in the distributed messaging system or distributed file system.
[0066] The specific implementation process of steps S230 to S260 may refer to steps S110 to S140.
[0067] S270: Use the dot event data and the corresponding feature data as backup data, and store the backup data in the distributed file system.
[0068] S280: Based on a preset second preprocessing rule, preprocess the backup data by using the stream computing engine to obtain preprocessed backup data, and store the preprocessed backup data in the distributed file system.
[0069] Specifically, the dot event data and the corresponding feature data are stored in the original log of HDFS as backup data. When the training sample output fails or the dot event data and the corresponding feature data are used for other processing, the backup data in the original log can be used directly. Preprocess the feature data and dot event data to reduce the memory of the backup data and reduce the cache pressure of the backup data. Furthermore, the preprocessed backup data is stored in HDFS to facilitate the direct extraction of the corresponding preprocessed backup data from HDFS. It is understandable that the backup data and sample data are stored in different locations in HDFS.
[0070] Exemplary, reference Figure 6 , Figure 6 Schematic diagram of the framework of the training sample processing system provided in the first embodiment of the present application. Figure 6As shown, the server sends the feature data to the stream data management system, and the client sends the dot event data to the stream data management system. The dot event data and feature data in the stream data management system are stored in the distributed message system, and the stream computing engine pulls the dot event data and feature data, and performs label parsing and feature preprocessing in parallel. The labels and preprocessed feature data obtained by the stream computing engine, as well as the dot event data, are stored in the associated fields of the distributed column database. According to the real-time sample generation strategy and the hourly sample generation strategy, the dot event data and the associated data are used as sample data of the first response level and the second response level at different time nodes, and the sample data of the first response level is stored in the distributed message system, and the sample data of the second response level is stored in the distributed file system. On the other hand, the dot event data and feature data in the distributed message system are stored in the distributed file system as backup data, and the stream computing engine pulls the backup data and preprocesses it, and the preprocessed backup data is stored in the distributed file system. The recommendation model can pull appropriate sample data from the database of the corresponding sample data storage according to demand.
[0071] Furthermore, to ensure the stable operation of tasks in each link of the system, all tasks in the running process are equipped with a series of real-time monitoring and alarms, covering the data source, the logic of task operation, the quality of data output, data delay, etc. Through a large number of monitoring indicators, more detailed sample output conditions can be obtained to timely discover and solve system faults, thereby improving system reliability and stability.
[0072] In summary, by acquiring dotting event data, parsing the dotting event data through a stream computing engine, parsing out the user reaction data of the recommended content corresponding to the dotting event, and using the user reaction data as the label of the corresponding dotting event data; acquiring the feature data corresponding to the recommended content, and preprocessing the feature data through the stream computing engine based on a preset first preprocessing rule; storing the dotting event data in a distributed columnar database, and storing the label of the dotting event data and the corresponding preprocessed feature data in the associated field of the dotting event data; after all the labels of the dotting event data are stored in the corresponding associated fields, the dotting event data and the data in the associated fields are used as training samples, and the training samples are stored in the distributed messaging system or distributed file system. By adopting the above-mentioned technical means, the dotting event data is parsed through a stream computing engine, the label information of the dotting event data is quickly collected, the feature data is preprocessed through the stream computing engine, the feature data memory is reduced, and the subsequent cache pressure is reduced. Since the dot event data and feature data are different data sources, they are combined in a distributed column database and then output to the downstream model, which can quickly discover and solve faults, avoid generating a large amount of erroneous data that has a huge impact on the recommendation model, avoid spending a lot of manpower and material resources to roll back the recommendation model, and improve the stability of the training sample processing system. Based on the stream computing engine and data fusion processing, the rapid and stable output of training samples is achieved, ensuring the timeliness of the recommendation model and the timeliness of the recommendation system.
[0073] Embodiment 2:
[0074] Based on the above embodiments, Figure 7 This is a schematic diagram of the structure of a training sample processing device provided in Example 2 of the present application. Figure 7 The training sample processing device provided in this embodiment specifically includes: a label parsing module 21, a feature preprocessing module 22, a data aggregation module 23 and a training sample generating module 24.
[0075] The tag parsing module 21 is configured to obtain the dot event data, parse the dot event data through the stream computing engine, parse out the user reaction data of the recommended content corresponding to the dot event, and use the user reaction data as the tag of the corresponding dot event data;
[0076] The feature preprocessing module 22 is configured to obtain feature data corresponding to the recommended content, preprocess the feature data through the stream computing engine based on a preset first preprocessing rule, and store the dot event data and the feature data in a distributed messaging system;
[0077] The data aggregation module 23 is configured to store the dot event data in a distributed column database, and store the label of the dot event data and the corresponding pre-processed feature data in the associated field of the dot event data;
[0078] The training sample generation module 24 is configured to use the dot event data and the data in the associated fields as training samples after all the labels of the dot event data are stored in the corresponding associated fields, and store the training samples in the distributed messaging system or distributed file system.
[0079] In the above, by obtaining the dotting event data, the dotting event data is parsed by the stream computing engine, the user reaction data of the recommended content corresponding to the dotting event is parsed, and the user reaction data is used as the label of the corresponding dotting event data; the feature data corresponding to the recommended content is obtained, and the feature data is preprocessed by the stream computing engine based on the preset first preprocessing rule; the dotting event data is stored in a distributed column database, and the label of the dotting event data and the corresponding preprocessed feature data are stored in the associated field of the dotting event data; after all the labels of the dotting event data are stored in the corresponding associated fields, the dotting event data and the data in the associated fields are used as training samples, and the training samples are stored in the distributed messaging system or distributed file system. By adopting the above technical means, the dotting event data is parsed by the stream computing engine, the label information of the dotting event data is quickly collected, the feature data is preprocessed by the stream computing engine, the feature data memory is reduced, and the subsequent cache pressure is reduced. Since the dot event data and feature data are different data sources, they are combined in a distributed column database and then output to the downstream model, which can quickly discover and solve faults, avoid the huge impact of a large amount of erroneous data on the recommendation model, avoid spending a lot of manpower and material resources to roll back the recommendation model, and improve the stability of the recommendation system. Based on the stream computing engine and data fusion processing, the rapid and stable output of training samples is achieved, ensuring the timeliness of the recommendation model and the timeliness of the recommendation system.
[0080] The training sample processing device provided in the second embodiment of the present application can be used to execute the training sample processing method provided in the above-mentioned first embodiment, and has corresponding functions and beneficial effects.
[0081] Embodiment three:
[0082] Embodiment 3 of the present application provides an electronic device, referring to Figure 8The electronic device includes: an input device 33, an output device 34, a memory 32 and one or more processors 31; the memory 32 is used to store one or more programs; when the one or more programs are executed by the one or more processors 31, the one or more processors 31 implement the training sample processing method provided in the above embodiment 1. The above-mentioned electronic device can be used to execute the training sample processing method provided in the above embodiment 1, and has corresponding functions and beneficial effects.
[0083] Embodiment 4:
[0084] The embodiment of the present application also provides a storage medium containing computer executable instructions, which are used to execute a training sample processing method when executed by a computer processor. Of course, the storage medium containing computer executable instructions provided by the embodiment of the present application is not limited to the training sample processing method described above, and can also execute related operations in the training sample processing method provided by any embodiment of the present application.
[0085] The above are only preferred embodiments of the present application and the technical principles used. The present application is not limited to the specific embodiments described herein, and various obvious changes, readjustments and substitutions that can be made by those skilled in the art will not deviate from the scope of protection of the present application. Therefore, although the present application is described in more detail through the above embodiments, the present application is not limited to the above embodiments, and may include more other equivalent embodiments without departing from the concept of the present application, and the scope of the present application is determined by the scope of the claims.
Claims
1. A training sample processing method, characterized in that: include: Acquire the dot event data, parse the dot event data through the stream computing engine, parse out the user reaction data of the recommended content corresponding to the dot event, and use the user reaction data as the label of the corresponding dot event data; Acquire feature data corresponding to the recommended content, and preprocess the feature data through the stream computing engine based on a preset first preprocessing rule; wherein the stream computing engine performs the parsing of the dot event data and the preprocessing of the feature data in parallel; The dotting event data is stored in a distributed column database, and the label of the dotting event data and the corresponding pre-processing feature data are stored in an associated field of the dotting event data; After all the labels of the dot event data are stored in the corresponding associated fields, the dot event data and the data in the associated fields are used as training samples, and the training samples are stored in a distributed message system or a distributed file system; this includes: judging whether all the labels of the dot event data are stored in the corresponding associated fields; if all the labels of the dot event data have been stored in the corresponding associated fields, using the dot event data and the data in the associated fields as sample data of the first response level according to the real-time sample generation strategy; using the dot event data and the data in the associated fields as sample data of the second response level at the first time node after the labels start to be stored in the distributed column database according to the hourly sample generation strategy; storing the sample data of the first response level in the topic message unit of the distributed message system, and storing the sample data of the second response level in the distributed file system.
2. The method according to claim 1, characterized in that Before obtaining the dot event data, the method further includes: Obtain the dot event data sent by the client and the feature data of the push content corresponding to the dot event sent by the server through the stream data management system; The dot event data and the corresponding feature data are stored in the distributed message system, and the dot event data and the corresponding feature data are configured with the same flow identifier.
3. The method according to claim 2, characterized in that The step of storing the label of the dot event data and the corresponding pre-processed feature data in the associated fields of the dot event data includes: At a second time node after the dot event data is stored in the distributed column database, determining a storage row of the dot event data in the distributed column database according to a stream identifier of the dot event data; The label and the pre-processing feature data are stored in the remaining columns of the storage row, and the label and the pre-processing feature data are configured with the same flow identifier as the dot event data.
4. The method according to claim 2, characterized in that: After storing the dot event data and the corresponding feature data in the distributed message system, the method further includes: The dot event data and the corresponding feature data are used as backup data, and the backup data is stored in the distributed file system.
5. The method according to claim 4, characterized in that After storing the backup data in the distributed file system, the method further includes: Based on a preset second preprocessing rule, the backup data is preprocessed by the stream computing engine to obtain the preprocessed backup data, and the preprocessed backup data is stored in the distributed file system.
6. A training sample processing device, characterized in that: include: A label parsing module is configured to obtain dot event data, parse the dot event data through a stream computing engine, parse out user reaction data of recommended content corresponding to the dot event, and use the user reaction data as a label of the corresponding dot event data; A feature preprocessing module is configured to obtain feature data corresponding to the recommended content, and preprocess the feature data through the stream computing engine based on a preset first preprocessing rule, wherein the dot event data and the feature data are stored in a distributed message system; wherein the stream computing engine performs parsing of the dot event data and preprocessing of the feature data in parallel; A data aggregation module is configured to store the dotting event data in a distributed column database, and store the label of the dotting event data and the corresponding pre-processing feature data in an associated field of the dotting event data; The training sample generation module is configured to use the dotting event data and the data in the associated fields as training samples after all the labels of the dotting event data are stored in the corresponding associated fields, and store the training samples in the distributed message system or distributed file system; wherein the training sample generation module is further configured to: determine whether all the labels of the dotting event data are stored in the corresponding associated fields, if the labels of the dotting event data have been stored in the corresponding associated fields, use the dotting event data and the data in the associated fields as sample data of the first response level according to the real-time sample generation strategy; use the dotting event data and the data in the associated fields as sample data of the second response level at the first time node after the labels begin to be stored in the distributed column database according to the hourly sample generation strategy; store the sample data of the first response level in the topic message unit of the distributed message system, and store the sample data of the second response level in the distributed file system.
7. An electronic device, characterized in that: include: memory and one or more processors; The memory is used to store one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the training sample processing method as described in any one of claims 1-5.
8. A storage medium containing computer executable instructions, characterized in that: The computer executable instructions are used to execute the training sample processing method according to any one of claims 1 to 5 when executed by a computer processor.
Citation Information
Patent Citations
Data marking method, processing method and device
CN110555076A
Training sample generation method and device, server and storage medium
CN110728370A
