Model training method, device and electronic equipment
By acquiring and storing two types of user behavior data, and adding labels through user identification association, training data for model training is formed, and the problem of low model training efficiency in the prior art is solved, achieving more efficient and flexible data processing.
Patent Information
- Application Number
- CN202111261168.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-10-27
- Publication Date
- 2025-04-18
- Estimated Expiration
- 2041-10-27
AI Technical Summary
In the prior art, the model training process is low efficiency, mainly because it requires multiple versions of data to be generated multiple times when processing slow reflow behavioral data, resulting in large occupancy of redundant data processing, storage space and poor flexibility.
By obtaining and storing two types of user behavior data (slow reflow and slow reflow) and adding behavior type tags to slow reflow data through user identification association, forming training data for model training.
It reduces the storage space and processing time of data, improves the efficiency and flexibility of model training, and avoids redundant processing of multi-version data.
Smart Images

Figure CN113962316B_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of computer technology, and specifically relates to a model training method, device and electronic equipment. Background Art
[0002] With the rapid development of Internet technology, the functions of the network are becoming more and more abundant, and more and more users choose to use the network to meet their needs in life, work and study. Internet users generate a large amount of user behavior data every day when using the network. If we can use this user behavior data to train the recommendation model and recommend network information to users based on the recommendation model, it will undoubtedly provide better services for users.
[0003] According to the data return rate, user behavior data can be divided into two categories: behavior data with slow return and behavior data without slow return. Among them, behavior data with slow return refers to user behavior data that is not returned until 1 hour and can not be obtained until more than 1 hour, for example, it may include: registration behavior data and activation behavior data, etc.; behavior data without slow return refers to user behavior data that can be returned within 1 hour and can be obtained within 1 hour, for example, it may include: exposure behavior data and click behavior data, etc.
[0004] When training the recommendation model, it is necessary to use the above two types of user behavior data at the same time. In the prior art, the slow return behavior data is processed by repeatedly processing to generate multiple copies of data and version control. Specifically, the slow return behavior data within the previous N days is generated every hour, and a version number is added; if N changes, it is necessary to regenerate the slow return behavior data within the previous N days every hour and add a version number. Such processing will result in a large amount of redundant data between different versions of behavior data, as well as a large amount of redundant data processing, which is time-consuming and less flexible, resulting in low efficiency of the entire model training process. Summary of the invention
[0005] The purpose of the embodiments of the present application is to provide a model training method, device and electronic device that can solve the problem of low efficiency of the model training process in the prior art.
[0006] In a first aspect, an embodiment of the present application provides a model training method, the method comprising:
[0007] Acquire first reflow data, and store the first reflow data in a first file, wherein the first reflow data is user behavior data whose time interval from generation to return exceeds a preset time length, and the first reflow data includes a user identifier and a corresponding behavior type tag;
[0008] Acquire second return flow data, and store the second return flow data in a second file, wherein the second return flow data is user behavior data whose time interval from generation to return does not exceed a preset time length, and the second return flow data includes a user identifier and corresponding user behavior characteristics;
[0009] Load the first reflow data of the last M days and the second reflow data of the last M days, and associate the first reflow data of the last M days with the second reflow data through the user identifier. After the association is completed, add the behavior type label in the first reflow data of the last M days to the second reflow data of the last M days to obtain the training data of the last M days, where M is a positive integer;
[0010] Model training is performed based on the training data of the most recent M days.
[0011] In a second aspect, an embodiment of the present application provides a model training device, the device comprising:
[0012] A first acquisition module is used to acquire first reflow data, wherein the first reflow data is user behavior data whose time interval from generation to return exceeds a preset time length, and the first reflow data includes a user identifier and a corresponding behavior type tag;
[0013] A first storage module, used for storing the first reflow data in a first file;
[0014] A second acquisition module is used to acquire second reflow data, wherein the second reflow data is user behavior data whose time interval from generation to return does not exceed a preset time length, and the second reflow data includes a user identifier and a corresponding user behavior feature;
[0015] A second storage module, used for storing the second reflux data in a second file;
[0016] A loading module, used to load the first reflow data of the last M days and the second reflow data of the last M days, and associate the first reflow data of the last M days with the second reflow data through a user identifier, and after the association is completed, add the behavior type label in the first reflow data of the last M days to the second reflow data of the last M days to obtain the training data of the last M days, where M is a positive integer;
[0017] The training module is used to perform model training based on the training data of the most recent M days.
[0018] In a third aspect, an embodiment of the present application provides an electronic device, which includes a processor, a memory, and a program or instruction stored in the memory and executable on the processor, wherein the program or instruction, when executed by the processor, implements the steps of the method described in the first aspect.
[0019] In a fourth aspect, an embodiment of the present application provides a readable storage medium, on which a program or instruction is stored, and when the program or instruction is executed by a processor, the steps of the method described in the first aspect are implemented.
[0020] In a fifth aspect, an embodiment of the present application provides a chip, comprising a processor and a communication interface, wherein the communication interface is coupled to the processor, and the processor is used to run a program or instruction to implement the method described in the first aspect.
[0021] In the embodiment of the present application, during each model training, the behavior data of no slow reflux and slow reflux in the last M days can be loaded from the stored data, and real-time association can be performed through the user identifier, and the corresponding behavior type label can be added to the user behavior features in the behavior data of no slow reflux in the last M days, so as to obtain the training data for model training, and then perform model training. Compared with the prior art, in the embodiment of the present application, when processing the behavior data of slow reflux, there is no need to generate multiple versions of data multiple times, nor to store duplicate data. During model training, there is no need to repeatedly process multiple data offline, which can reduce the storage space of data and the processing time of data, and has high flexibility, thereby improving the efficiency of the entire model training process. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] Figure 1 is a flow chart of a model training method provided in an embodiment of the present application;
[0023] Figure 2 It is a structural block diagram of a model training device provided in an embodiment of the present application;
[0024] Figure 3 It is a structural schematic diagram of an electronic device provided in an embodiment of the present application;
[0025] Figure 4 It is a schematic diagram of the hardware structure of an electronic device implementing various embodiments of the present application. DETAILED DESCRIPTION
[0026] The following will be combined with the drawings in the embodiments of the present application to clearly describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all the embodiments. All other embodiments obtained by ordinary technicians in this field based on the embodiments in the present application belong to the scope of protection of this application.
[0027] The terms "first", "second", etc. in the specification and claims of the present application are used to distinguish similar objects, and are not used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable under appropriate circumstances, so that the embodiments of the present application can be implemented in an order other than those illustrated or described here, and the objects distinguished by "first", "second", etc. are generally of one type, and the number of objects is not limited. For example, the first object can be one or more. In addition, "and / or" in the specification and claims represents at least one of the connected objects, and the character " / " generally indicates that the objects associated with each other are in an "or" relationship.
[0028] At present, among the behavioral data generated by users when surfing the Internet, some behavioral data have a relatively short transmission time, such as exposure behavior data (for example, when a user opens a browser to browse a page, a page refresh of the browser is an exposure behavior, or when a user opens an APP and the APP plays an advertisement, it is an exposure behavior. The exposure behavior data transmission time is relatively short, usually not exceeding 1 hour), click behavior data, etc. Other behavioral data transmission times are relatively long, such as activation behavior data (since users may not activate the APP immediately after downloading it, and may activate it after a few days, the activation behavior data transmission time is relatively long, usually more than 1 hour), registration behavior data, etc. For the sake of ease of description, the former behavioral data is referred to as "behavioral data without slow return", and the latter behavioral data is referred to as "behavioral data with slow return".
[0029] Although there is no problem of slow reflux when there is no behavior data with slow reflux, the generalization ability of the trained model is poor due to the small amount of data when only the behavior data without slow reflux is used for model training. In order to improve the generalization ability of the model, the behavior data with slow reflux will be added.
[0030] In the prior art, version control is used to obtain slow reflow behavior data. Specifically, the slow reflow behavior data within the previous N days is generated every hour, and a version number is added, and so on. For example, N is set to 3, and the behavior data for the three days from 8:00 am on 2021-9-23 to 8:00 am on 2021-9-26 is generated from 8:00 am on 2021-9-26 to 8:00 am on 2021-9-23, and a version number is set for the behavior data. One hour later, that is, 9:00-10:00 am on 2021-9-26, the behavior data for the three days from 9:00 am on 2021-9-23 to 9:00 am on 2021-9-26 is generated, and the version of the behavior data is added by 1 on the basis of the previous version number, and so on. It can be seen that there is redundancy and duplication of data between behavior data with adjacent version numbers, which takes a long time to generate and occupies more storage space when stored. In addition, when training the model, it can only be trained based on the behavioral data within 3 days. If it is desired to train based on the behavioral data within 2 days, it is necessary to regenerate N=2 behavioral data, which is relatively inflexible. In summary, the existing technology leads to low efficiency in the entire model training process.
[0031] In order to solve the above technical problems, the embodiments of the present application provide a model training method, device and electronic device.
[0032] The model training method provided in the embodiment of the present application is described in detail below through specific embodiments and their application scenarios in conjunction with the accompanying drawings.
[0033] Figure 1 is a flow chart of a model training method provided in an embodiment of the present application, such as Figure 1 As shown, the method may include the following steps: step 101, step 102, step 103 and step 104, wherein:
[0034] In step 101, first reflow data is obtained and stored in a first file, wherein the first reflow data is user behavior data whose time interval from generation to return exceeds a preset time length, and the first reflow data includes a user identifier and a corresponding behavior type label.
[0035] In the embodiment of the present application, the preset duration may be 1 hour.
[0036] In the embodiment of the present application, the first reflux data is: the slow reflux behavior data mentioned in the background technology. The second reflux data is the non-slow reflux behavior data mentioned in the background technology. For the convenience of description and understanding, the "slow reflux behavior data" will be used instead of the "first reflux data", and the "non-slow reflux behavior data" will be used instead of the "second reflux data" for description.
[0037] In order to obtain the slow reflux behavior data as quickly as possible, ensure that the slow reflux behavior data loaded during model training is more real-time, and better understand the user behavior preferences, in an embodiment of the present application, the slow reflux behavior data can be obtained from the online server in real time.
[0038] Specifically, in an embodiment provided in the present application, the above step 101 may include the following steps (not shown in the figure): step 1011 and step 1012, wherein:
[0039] In step 1011, the conversion behavior log data is read from the online server in real time;
[0040] In step 1012, a user identifier and a corresponding conversion behavior type label are extracted from the conversion behavior log data.
[0041] In the embodiment of the present application, the conversion behavior log data includes the conversion behaviors that the user has completed, such as activation behavior, registration behavior, download behavior, purchase behavior, etc.
[0042] In the embodiment of the present application, the user identifier is used to associate the behavior data of slow reflux with the behavior data of no slow reflux, and the conversion behavior type label is used to update the label of the training data in the behavior data of no slow reflux.
[0043] In an embodiment of the present application, in order to improve the efficiency of data storage, the first file may be an hourly file or a daily file, and the first file is stored in a distributed file system.
[0044] In one example, the first file is a daily file, which can read the conversion behavior log data in real time, extract the user identifier and conversion behavior type label, and write them one by one in real time to the distributed file system. The data of the day is automatically written to the daily file corresponding to the day. When it reaches midnight of the next day, it automatically switches to writing to the daily file corresponding to the next day, so that subsequent models can load training data on a daily basis.
[0045] In step 102, the second reflow data is obtained and stored in a second file, wherein the second reflow data is user behavior data whose time interval from generation to return does not exceed a preset time length, and the second reflow data includes a user identifier and corresponding user behavior characteristics.
[0046] In the embodiment of the present application, in order to improve the efficiency of data storage, the second file may be an hourly file or a daily file, and the second file is stored in a distributed file system.
[0047] In an embodiment provided in the present application, the above step 102 may include the following steps (not shown in the figure): step 1021, step 1022 and step 1023, wherein:
[0048] In step 1021, the exposure click log data is read from the server, where the server may be an online server or an offline server.
[0049] In step 1022, a user identifier and at least one of the following features are extracted from the exposure click log data: user feature, item feature, cross feature, and scene feature.
[0050] In step 1023, the extracted features are concatenated to obtain user behavior features.
[0051] In the embodiment of the present application, the exposure-click log data includes characteristics of the user's exposure behavior and click behavior when surfing the Internet.
[0052] In step 103, the first reflow data of the last M days and the second reflow data of the last M days are loaded, and the first reflow data of the last M days and the second reflow data of the last M days are associated through the user identifier. After the association is completed, the behavior type label in the first reflow data of the last M days is added to the second reflow data of the last M days to obtain the training data of the last M days, where M is a positive integer.
[0053] In the embodiment of the present application, since the behavior data without slow reflux contains user behavior features but does not contain user behavior type labels, the behavior data with slow reflux contains behavior type labels, and the user features and labels of the model training data are indispensable, it is necessary to use the behavior data with slow reflux to add training labels to the behavior data without slow reflux.
[0054] In the embodiment of the present application, the training data of the most recent M days includes: user behavior features of the most recent M days and corresponding training labels.
[0055] In an embodiment of the present application, during model training, the behavior data of no slow reflux in the last M days and the behavior data of slow reflux in the last M days can be loaded from the distributed file system into the memory of the training machine, so as to update the labels of user behavior features in the behavior data of no slow reflux in the last M days, that is, the labels of the training data.
[0056] In an embodiment of the present application, during model training, the loaded behavior data of no slow reflux in the last M days and the behavior data of slow reflux in the last M days are associated through the user identifier. If the association is successful, the label of the user behavior feature in the behavior data of no slow reflux in the last M days is updated; if the association fails, it is not updated.
[0057] In the embodiment of the present application, the selection of the M value in the most recent M days of data can be determined by calculating the index for the recommended scenario effect over a few days.
[0058] It can be seen that in the embodiment of the present application, during one model training, it is only necessary to load the behavior data without slow reflux and the behavior data with slow reflux, perform real-time association through the user's unique identification code, and update the training label in the behavior data without slow reflux. This method uses data flexibly and can obtain corresponding data on demand. There is no need to associate multiple times to generate multiple versions of data, so there is no need to repeatedly process data offline or store multiple copies of data. This can reduce data storage space as well as data processing and generation time. It has strong flexibility, and the model can flexibly select the last M days of data for association.
[0059] In step 104, model training is performed based on the training data of the most recent M days.
[0060] To ensure the correctness of the training data, in the embodiment of the present application, a monitoring function may be added. In this case, the first reflow data also includes a request response time, wherein the request response time is the time when a user initiates a request. For example, the time when a user clicks on an advertisement request is the time when the user initiates an advertisement request.
[0061] Accordingly, the monitoring function can calculate the first data volume of the behavior type label in the first return flow data in the last M days according to the request response time; calculate the second data volume of the behavior type label in the offline data warehouse table, wherein the first return flow data in the last M days is stored in the offline data warehouse table through a preset channel; if there is no difference between the first data volume and the second data volume, perform model training based on the training data of the last M days. If there is a difference between the first data volume and the second data volume, output the difference information, send an alarm message, and do not perform model training.
[0062] In the embodiment of the present application, the relevant interface of the monitoring function will be called each time the model is trained. This interface will return whether the amount of user behavior data loaded for model training is normal. Training will only start after confirming that there is no problem with the data of the last M days loaded by the model.
[0063] In the embodiment of the present application, the model uses the training data of the last M days for model training. There is a large amount of user behavior data, and the model generalization is strongly improved. It can accurately grasp the user behavior preferences and output the recommendation ranking results. The final recommended information or videos are more in line with user preferences, thereby optimizing the user experience.
[0064] As can be seen from the above embodiments, in this embodiment, during each model training, the behavior data of no slow reflux and slow reflux in the last M days can be loaded from the stored data, and real-time association can be performed through the user identifier, and the corresponding behavior type label can be added to the user behavior features in the behavior data of no slow reflux in the last M days, thereby obtaining the training data for model training, and then performing model training. Compared with the prior art, in the embodiment of the present application, when processing the behavior data of slow reflux, there is no need to generate multiple versions of data multiple times, nor is there any need to store duplicate data. During model training, there is no need to repeatedly process multiple data offline, which can reduce the storage space of data and the processing time of data, and has high flexibility, thereby improving the efficiency of the entire model training process.
[0065] It should be noted that the model training method provided in the embodiment of the present application can be executed by a model training device, or a control module in the model training device for executing the loading model training method. In the embodiment of the present application, the model training device provided in the embodiment of the present application is illustrated by taking the execution of the loading model training method by the model training device as an example.
[0066] Figure 2 is a structural block diagram of a model training device provided in an embodiment of the present application, such as Figure 2 As shown, the model training device 200 may include: a first acquisition module 201, a first storage module 202, a second acquisition module 203, a second storage module 204, a loading module 205 and a training module 206, wherein:
[0067] A first acquisition module 201 is used to acquire first reflow data, wherein the first reflow data is user behavior data whose time interval from generation to return exceeds a preset time length, and the first reflow data includes a user identifier and a corresponding behavior type tag;
[0068] A first storage module 202, configured to store the first reflux data in a first file;
[0069] A second acquisition module 203 is used to acquire second reflow data, wherein the second reflow data is user behavior data whose time interval from generation to retransmission does not exceed a preset time length, and the second reflow data includes a user identifier and a corresponding user behavior feature;
[0070] A second storage module 204, configured to store the second reflux data in a second file;
[0071] A loading module 205 is used to load the first reflow data of the last M days and the second reflow data of the last M days, and associate the first reflow data of the last M days with the second reflow data through a user identifier. After the association is completed, the behavior type label in the first reflow data of the last M days is added to the second reflow data of the last M days to obtain the training data of the last M days, where M is a positive integer;
[0072] The training module 206 is used to perform model training based on the training data of the most recent M days.
[0073] As can be seen from the above embodiments, in this embodiment, during each model training, the behavior data of no slow reflux and slow reflux in the last M days can be loaded from the stored data, and real-time association can be performed through the user identifier, and the corresponding behavior type label can be added to the user behavior features in the behavior data of no slow reflux in the last M days, thereby obtaining the training data for model training, and then performing model training. Compared with the prior art, in the embodiment of the present application, when processing the behavior data of slow reflux, there is no need to generate multiple versions of data multiple times, nor is there any need to store duplicate data. During model training, there is no need to repeatedly process multiple data offline, which can reduce the storage space of data and the processing time of data, and has high flexibility, thereby improving the efficiency of the entire model training process.
[0074] Optionally, as an embodiment, the first acquisition module 201 may include:
[0075] The first reading submodule is used to read the conversion behavior log data from the online server in real time;
[0076] The first extraction submodule is used to extract the user identifier and the corresponding conversion behavior type label from the conversion behavior log data.
[0077] Optionally, as an embodiment, the second obtaining module 203 may include:
[0078] The second reading submodule is used to read the exposure click log data from the server;
[0079] A second extraction submodule is used to extract a user identifier and at least one of the following features from the exposure click log data: user feature, item feature, cross feature and scene feature;
[0080] The splicing submodule is used to splice the extracted features to obtain user behavior features.
[0081] Optionally, as an embodiment, the first reflow data further includes a request response time, wherein the request response time is the time it takes for a user to initiate a request;
[0082] The model training device 200 may further include:
[0083] A first calculation module, configured to calculate a first data volume of a behavior type label in the first reflow data within the last M days according to the request response time;
[0084] A second calculation module is used to calculate a second data volume of the behavior type label in the offline data warehouse table, wherein the first return flow data in the last M days is stored in the offline data warehouse table through a preset channel;
[0085] The training module 206 is used to perform model training based on the training data of the most recent M days when there is no difference between the first data amount and the second data amount.
[0086] Optionally, as an embodiment, the first file is an hourly file or a daily file; the second file is an hourly file or a daily file; the first file and the second file are both stored in a distributed file system.
[0087] The model training device in the embodiment of the present application can be a device, or a component, integrated circuit, or chip in a terminal. The device can be a mobile electronic device or a non-mobile electronic device. Exemplarily, the mobile electronic device can be a mobile phone, a tablet computer, a laptop computer, a PDA, an in-vehicle electronic device, a wearable device, an ultra-mobile personal computer (ultra-mobile personal computer, UMPC), a netbook or a personal digital assistant (personal digital assistant, PDA), etc., and the non-mobile electronic device can be a server, a network attached storage (Network Attached Storage, NAS), a personal computer (personal computer, PC), a television (television, TV), a teller machine or a self-service machine, etc., which is not specifically limited in the embodiment of the present application.
[0088] The model training device in the embodiment of the present application may be a device having an operating system. The operating system may be an Android operating system, an iOS operating system, or other possible operating systems, which are not specifically limited in the embodiment of the present application.
[0089] The model training device provided in the embodiment of the present application can achieve Figure 1 To avoid repetition, the various processes implemented in the method embodiment will not be described again here.
[0090] Alternatively, if Figure 3As shown, an embodiment of the present application also provides an electronic device 300, including a processor 301, a memory 302, and a program or instruction stored in the memory 302 and executable on the processor 301. When the program or instruction is executed by the processor 301, each process of the above-mentioned model training method embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.
[0091] It should be noted that the electronic devices in the embodiments of the present application include the mobile electronic devices and non-mobile electronic devices mentioned above.
[0092] Figure 4 It is a schematic diagram of the hardware structure of an electronic device implementing various embodiments of the present application.
[0093] The electronic device 400 includes but is not limited to components such as a radio frequency unit 401 , a network module 402 , an audio output unit 403 , an input unit 404 , a sensor 405 , a display unit 406 , a user input unit 407 , an interface unit 408 , a memory 409 , and a processor 410 .
[0094] Those skilled in the art will appreciate that the electronic device 400 may also include a power source (such as a battery) for supplying power to each component, and the power source may be logically connected to the processor 410 through a power management system, thereby implementing functions such as managing charging, discharging, and power consumption management through the power management system. Figure 4 The electronic device structure shown in the figure does not constitute a limitation on the electronic device. The electronic device may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently, which will not be described in detail here.
[0095] Among them, the processor 410 is used to obtain first reflow data and store the first reflow data in a first file, wherein the first reflow data is user behavior data whose time interval from generation to return exceeds a preset time length, and the first reflow data includes a user identifier and a corresponding behavior type label; obtain second reflow data and store the second reflow data in a second file, wherein the second reflow data is user behavior data whose time interval from generation to return does not exceed a preset time length, and the second reflow data includes a user identifier and a corresponding user behavior feature; load the first reflow data of the last M days and the second reflow data of the last M days, and associate the first reflow data and the second reflow data of the last M days through the user identifier. After the association is completed, add the behavior type label in the first reflow data of the last M days to the second reflow data of the last M days to obtain the training data of the last M days, wherein M is a positive integer; perform model training based on the training data of the last M days.
[0096] It can be seen that in the embodiment of the present application, during each model training, the behavior data of no slow reflux and slow reflux in the last M days can be loaded from the stored data, and real-time association can be performed through the user identifier, and the corresponding behavior type label can be added to the user behavior features in the behavior data of no slow reflux in the last M days, so as to obtain the training data for model training, and then perform model training. Compared with the prior art, in the embodiment of the present application, when processing the behavior data of slow reflux, there is no need to generate multiple versions of data multiple times, nor is there any need to store duplicate data. During model training, there is no need to repeatedly process multiple data offline, which can reduce the storage space of data and the processing time of data, and has high flexibility, thereby improving the efficiency of the entire model training process.
[0097] Optionally, as an embodiment, the processor 410 is further configured to read conversion behavior log data from an online server in real time; and extract a user identifier and a corresponding conversion behavior type tag from the conversion behavior log data.
[0098] Optionally, as an embodiment, the processor 410 is also used to read exposure click log data from the server; extract a user identifier and at least one of the following features from the exposure click log data: user features, item features, cross features and scene features; and splice the extracted features to obtain user behavior features.
[0099] Optionally, as an embodiment, the first reflow data further includes a request response time, wherein the request response time is the time it takes for a user to initiate a request;
[0100] Processor 410 is further used to calculate a first data volume of behavior type labels in the first reflow data within the last M days according to the request response time; calculate a second data volume of behavior type labels in an offline data warehouse table, wherein the first reflow data within the last M days is stored in the offline data warehouse table through a preset channel; if there is no difference between the first data volume and the second data volume, perform model training based on the training data of the last M days.
[0101] Optionally, as an embodiment, the first file is an hourly file or a daily file; the second file is an hourly file or a daily file; the first file and the second file are both stored in a distributed file system.
[0102] It should be understood that in the embodiment of the present application, the input unit 404 may include a graphics processor (GPU) 4041 and a microphone 4042, and the graphics processor 4041 processes the image data of a static picture or video obtained by an image capture device (such as a camera) in a video capture mode or an image capture mode. The display unit 406 may include a display panel 4061, and the display panel 4061 may be configured in the form of a liquid crystal display, an organic light emitting diode, etc. The user input unit 407 includes a touch panel 4071 and other input devices 4072. The touch panel 4071 is also called a touch screen. The touch panel 4071 may include two parts: a touch detection device and a touch controller. Other input devices 4072 may include, but are not limited to, a physical keyboard, a function key (such as a volume control button, a switch button, etc.), a trackball, a mouse, and a joystick, which will not be repeated here. The memory 409 may be used to store software programs and various data, including but not limited to applications and operating systems. The processor 410 may integrate an application processor and a modem processor, wherein the application processor mainly processes an operating system, a user interface, and applications, and the modem processor mainly processes wireless communications. It is understandable that the above-mentioned modem processor may not be integrated into the processor 410.
[0103] An embodiment of the present application also provides a readable storage medium, on which a program or instruction is stored. When the program or instruction is executed by a processor, each process of the above-mentioned model training method embodiment is implemented, and the same technical effect can be achieved. To avoid repetition, it will not be repeated here.
[0104] The processor is a processor in the electronic device described in the above embodiment. The readable storage medium includes a computer readable storage medium, such as a computer read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0105] An embodiment of the present application further provides a chip, which includes a processor and a communication interface, wherein the communication interface is coupled to the processor, and the processor is used to run programs or instructions to implement the various processes of the above-mentioned model training method embodiment, and can achieve the same technical effect. To avoid repetition, it will not be repeated here.
[0106] It should be understood that the chip mentioned in the embodiments of the present application can also be called a system-level chip, a system chip, a chip system or a system-on-chip chip, etc.
[0107] It should be noted that, in this article, the terms "comprise", "include" or any other variant thereof are intended to cover non-exclusive inclusion, so that the process, method, article or device including a series of elements includes not only those elements, but also includes other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise one..." do not exclude the presence of other identical elements in the process, method, article or device including the element. In addition, it should be pointed out that the scope of the methods and devices in the embodiments of the present application is not limited to performing functions in the order shown or discussed, and may also include performing functions in a substantially simultaneous manner or in reverse order according to the functions involved, for example, the described method may be performed in an order different from that described, and various steps may also be added, omitted, or combined. In addition, the features described with reference to certain examples may be combined in other examples.
[0108] Through the description of the above implementation methods, those skilled in the art can clearly understand that the above-mentioned embodiment methods can be implemented by means of software plus a necessary general hardware platform, and of course by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present application, or the part that contributes to the prior art, can be embodied in the form of a computer software product, which is stored in a storage medium (such as ROM / RAM, a disk, or an optical disk), and includes a number of instructions for a terminal (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods described in each embodiment of the present application.
[0109] The embodiments of the present application are described above in conjunction with the accompanying drawings, but the present application is not limited to the above-mentioned specific implementation methods. The above-mentioned specific implementation methods are merely illustrative and not restrictive. Under the guidance of the present application, ordinary technicians in this field can also make many forms without departing from the purpose of the present application and the scope of protection of the claims, all of which are within the protection of the present application.
Claims
1. A model training method, characterized in that: The method comprises: Acquire first reflow data, and store the first reflow data in a first file, wherein the first reflow data is user behavior data whose time interval from generation to return exceeds a preset time length, and the first reflow data includes a user identifier and a corresponding behavior type tag; the acquiring of the first reflow data includes: reading conversion behavior log data from an online server in real time; extracting the user identifier and the corresponding conversion behavior type tag from the conversion behavior log data; Acquire second return flow data, and store the second return flow data in a second file, wherein the second return flow data is user behavior data whose time interval from generation to return does not exceed a preset time length, and the second return flow data includes a user identifier and corresponding user behavior characteristics; Load the first reflow data of the last M days and the second reflow data of the last M days, and associate the first reflow data of the last M days with the second reflow data through the user identifier. After the association is completed, add the behavior type label in the first reflow data of the last M days to the second reflow data of the last M days to obtain the training data of the last M days, where M is a positive integer; Model training is performed based on the training data of the most recent M days.
2. The method according to claim 1, characterized in that The obtaining of the second reflow data comprises: Read exposure click log data from the server; Extracting a user identifier and at least one of the following features from the exposure click log data: user feature, item feature, cross feature, and scene feature; The extracted features are concatenated to obtain user behavior features.
3. The method according to claim 1, characterized in that The first reflow data also includes a request response time, wherein the request response time is the time it takes for a user to initiate a request; Before the step of performing model training based on the training data of the most recent M days, the method further includes: Calculate, according to the request response time, a first data volume of the behavior type label in the first reflow data within the last M days; Calculating a second data volume of the behavior type label in the offline data warehouse table, wherein the first return flow data in the most recent M days is stored in the offline data warehouse table through a preset channel; If there is no difference between the first data amount and the second data amount, model training is performed based on the training data of the most recent M days.
4. The method according to claim 1, characterized in that: The first file is an hourly file or a daily file; the second file is an hourly file or a daily file; the first file and the second file are both stored in a distributed file system.
5. A model training device, characterized in that: The device comprises: A first acquisition module is used to acquire first reflow data, wherein the first reflow data is user behavior data whose time interval from generation to return exceeds a preset time length, and the first reflow data includes a user identifier and a corresponding behavior type tag; A first storage module, used for storing the first reflow data in a first file; A second acquisition module is used to acquire second reflow data, wherein the second reflow data is user behavior data whose time interval from generation to return does not exceed a preset time length, and the second reflow data includes a user identifier and a corresponding user behavior feature; A second storage module, used for storing the second reflux data in a second file; A loading module, used to load the first reflow data of the last M days and the second reflow data of the last M days, and associate the first reflow data of the last M days with the second reflow data through a user identifier, and after the association is completed, add the behavior type label in the first reflow data of the last M days to the second reflow data of the last M days to obtain the training data of the last M days, where M is a positive integer; A training module, used for performing model training based on the training data of the most recent M days; The first acquisition module includes: The first reading submodule is used to read the conversion behavior log data from the online server in real time; The first extraction submodule is used to extract the user identifier and the corresponding conversion behavior type label from the conversion behavior log data.
6. The device according to claim 5, characterized in that The second acquisition module includes: The second reading submodule is used to read the exposure click log data from the server; A second extraction submodule is used to extract a user identifier and at least one of the following features from the exposure click log data: user feature, item feature, cross feature and scene feature; The splicing submodule is used to splice the extracted features to obtain user behavior features.
7. The device according to claim 5, characterized in that The first reflow data also includes a request response time, wherein the request response time is the time it takes for a user to initiate a request; The device also includes: A first calculation module, configured to calculate a first data volume of a behavior type label in the first reflow data within the last M days according to the request response time; A second calculation module is used to calculate a second data volume of the behavior type label in the offline data warehouse table, wherein the first return flow data in the last M days is stored in the offline data warehouse table through a preset channel; The training module is used to perform model training based on the training data of the most recent M days when there is no difference between the first data amount and the second data amount.
8. The device according to claim 5, characterized in that The first file is an hourly file or a daily file; the second file is an hourly file or a daily file; the first file and the second file are both stored in a distributed file system.
9. An electronic device, characterized in that: The electronic device includes a processor, a memory, and a program or instruction stored in the memory and executable on the processor. When the program or instruction is executed by the processor, the steps of the model training method as described in any one of claims 1 to 4 are implemented.
Citation Information
Patent Citations
Model training method and device and computer equipment
CN112613938A