WO2021147486A1 - 一种数据处理方法及装置 - Google Patents
一种数据处理方法及装置 Download PDFInfo
- Publication number
- WO2021147486A1 WO2021147486A1 PCT/CN2020/129123 CN2020129123W WO2021147486A1 WO 2021147486 A1 WO2021147486 A1 WO 2021147486A1 CN 2020129123 W CN2020129123 W CN 2020129123W WO 2021147486 A1 WO2021147486 A1 WO 2021147486A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- behavior
- user
- feature
- data
- trained
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Ceased
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06Q—INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
- G06Q30/00—Commerce
- G06Q30/02—Marketing; Price estimation or determination; Fundraising
- G06Q30/0201—Market modelling; Market analysis; Collecting market data
- G06Q30/0202—Market predictions or forecasting for commercial activities
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N20/00—Machine learning
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06Q—INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
- G06Q30/00—Commerce
- G06Q30/02—Marketing; Price estimation or determination; Fundraising
- G06Q30/0201—Market modelling; Market analysis; Collecting market data
Definitions
- the present invention relates to the technical field of financial technology (Fintech), in particular to a data processing method and device.
- each participant can only use locally stored user behavior data to train to obtain a behavior prediction model.
- the behavior prediction model trained by a certain participant can only be used to predict the behavior of users in this participant, and cannot predict the behavior of users in other participants. Behavior predictions result in poor versatility of behavior prediction models and low prediction accuracy.
- the present invention provides a data processing method and device for training to obtain a general behavior prediction model, so as to predict the behavior of users in each participant, thereby improving the accuracy of user behavior prediction.
- the present invention provides a data processing method applied to a participant device, the method comprising: the participant device receives a model training request sent by a federated server, and obtains locally stored user behavior data according to the model training request, The user behavior data is processed in accordance with the preset feature distribution rules to obtain a training data set consistent with the feature distribution of other participants’ equipment, and then use the training data set to train to obtain the participant model, and the participant model It is sent to the federation server, so that the federation server obtains a behavior prediction model based on the joint training of each participant's model.
- the preset feature distribution rule is a rule for generating data to be trained with consistent feature distribution according to the shared user behavior feature dimension and object behavior feature dimension.
- the participant’s device processes the user behavior data according to the preset feature distribution rules, and obtains a training data set consistent with the feature distribution of other participant’s devices, including: the participant’s device uses the shared user behavior feature dimension from the user to obtain a training data set.
- the feature pair between behavior features, based on the feature pair generate training data consistent with the feature distribution of other participants' devices, and construct the training data set based on the training data corresponding to each feature pair formed by each user and each object .
- the participant device extracts the user behavior characteristics of any user from the user behavior data according to the shared user behavior characteristic dimension, including: the participant device extracts the user's user behavior in any shared user behavior data from the user behavior data.
- the user behavior characteristic of the user is constructed according to the characteristic value of the user in each common user behavior characteristic dimension.
- the participant device extracts the object behavior feature of any object from the user behavior data according to the shared object behavior feature dimension, including: the participant device extracts the object under any common object behavior feature dimension from the user behavior data
- the object behavior characteristic of the object is constructed.
- the participant device generates training data consistent with the feature distribution of other participant devices based on the levy pair, including: the participant device extracts the user behavior data from the user behavior data according to the shared interaction behavior feature dimension The interaction characteristics of the user and the object, according to the interaction characteristics of the user and the object, determine the label corresponding to the feature pair, and then combine the user behavior characteristics of the user, the object behavior characteristics of the object, the interaction characteristics and the tag as the feature vector corresponding to the feature pair Data to be trained.
- the participant device constructs a data set to be trained according to the data to be trained corresponding to each feature pair, including: the participant device determines the data to be trained that belongs to the positive and negative samples according to the label corresponding to each feature pair Whether the ratio of is within the preset range, if it does not meet the preset range, down-sampling is performed on the data to be trained with the label as a negative sample, or the data to be trained with the label as a positive sample is up-sampled. If it meets the preset range, a data set to be trained is constructed based on each data to be trained.
- the participant device after the participant device sends the participant model to the federation server, it can also receive the behavior prediction model sent by the federation server, and input the characteristic information corresponding to the feature to be tested into the behavior prediction model for prediction , Get the predicted label corresponding to the feature pair to be tested.
- the feature information corresponding to the pair of features to be tested includes any one or more of the user behavior features of the user to be tested, the object behavior features of the object to be tested, and the interaction features between the user to be tested and the object to be tested.
- the prediction tag is used to determine whether the user under test will perform a preset behavior on the object under test.
- the shared user behavior characteristic dimension may include the time for the user to perform the preset behavior and/or the number of times the user performs the preset behavior in each time period.
- the shared object behavior characteristic dimension may include the time when the object is performed the preset behavior and/or the number of times the object is performed the preset behavior in each time period.
- the interactive behavior characteristic dimension may include the time for the user to perform the preset behavior on the object and/or the number of times the user performs the preset behavior on the object in each time period.
- the present invention provides a data processing device, which includes: a transceiver module for receiving a model training request sent by a federated server; an acquisition module for acquiring locally stored user behavior data according to the model training request; a processing module , Used to process user behavior data according to preset feature distribution rules to obtain a training data set consistent with the feature distribution of other participants’ equipment; training module used to train the participant’s model using the training data set, and participate
- the party model is sent to the federated server, and the federated server is used to obtain a behavior prediction model based on joint training of each participant's model.
- the preset feature distribution rule is a rule for generating data to be trained with consistent feature distribution according to the shared user behavior feature dimension and object behavior feature dimension.
- the processing module is specifically used to extract any user behavior characteristics from the user behavior data according to the shared user behavior characteristic dimension, and extract any user behavior characteristics from the user behavior data according to the shared object behavior characteristic dimension.
- Object behavior characteristics of the object construct a characteristic pair between the user behavior characteristic of any user and the object behavior characteristic of any object, based on the characteristic pair, generate training data consistent with the characteristic distribution of other participants’ equipment, based on each user’s and
- Each feature constituted by each object corresponds to the data to be trained to construct a data set to be trained.
- the processing module is specifically configured to: extract the user's characteristic value in any common user behavior characteristic dimension from the user behavior data, and according to the user's characteristic value in each shared user behavior characteristic dimension , Construct the user behavior characteristics of the user, extract the characteristic value of the object in any common object behavior characteristic dimension from the user behavior data, and construct the object of the object according to the characteristic value of the object in each shared object behavior characteristic dimension Behavioral characteristics.
- the processing module is specifically used to: extract the interaction features between the user and the object from the user behavior data according to the shared interaction behavior feature dimension, and determine the corresponding feature pair according to the interaction features between the user and the object
- the label uses the feature vector obtained by splicing the user behavior features of the user, the object behavior features of the object, the interaction feature, and the label as the data to be trained corresponding to the feature pair.
- the processing module is specifically configured to determine whether the proportion of the data to be trained belonging to the positive and negative samples meets the preset range according to the corresponding label of each feature pair; Down-sampling processing is performed on the data to be trained for negative samples, or up-sampling processing is performed on the data to be trained with labels of positive samples. If it meets the preset range, a data set to be trained is constructed based on each data to be trained.
- the device further includes a prediction module.
- the transceiver module may also receive the behavior prediction model sent by the federation server.
- the prediction module is used to input the feature information corresponding to the feature to be tested into the behavior prediction model for prediction, and obtain the prediction label corresponding to the feature to be tested.
- the feature information corresponding to the pair of features to be tested includes any one or more of the user behavior features of the user to be tested, the object behavior features of the object to be tested, and the interaction features between the user to be tested and the object to be tested.
- the prediction tag is used to determine whether the user under test will perform a preset behavior on the object under test.
- the shared user behavior characteristic dimension may include the time for the user to perform the preset behavior and/or the number of times the user performs the preset behavior in each time period.
- the shared object behavior characteristic dimension may include the time when the object is performed the preset behavior and/or the number of times the object is performed the preset behavior in each time period.
- the interactive behavior characteristic dimension may include the time for the user to perform the preset behavior on the object and/or the number of times the user performs the preset behavior on the object in each time period.
- a computing device in a third aspect, includes at least one processing unit and at least one storage unit, wherein the storage unit stores a computer program, and when the program is executed by the processing unit, the The processing unit executes any of the data processing methods described in the first aspect.
- the present invention provides a computer-readable storage medium that stores a computer program executable by a computing device.
- the program runs on the computing device, the computing device executes the first aspect described above. Any of the described data processing methods.
- the data processing method and device provided by the present invention process user behavior data according to preset feature distribution rules through each participant's equipment to obtain a data set to be trained that is consistent with the feature distribution of other participant's equipment, so that each participant's equipment can be used
- the training data set with the same feature distribution to be trained can obtain the participant model with the same model structure.
- the federated server can train the participant model with the same model structure obtained from the equipment training of each participant to obtain the behavior prediction model, because the behavior prediction model is combined
- the behavior data characteristics of each participant device can be used to predict the behavior of users in each participant device.
- the behavior prediction model is more versatile and can also improve the accuracy of user behavior prediction.
- FIG. 1 is a schematic diagram of a suitable system architecture provided by an embodiment of the present invention
- FIG. 2 is a schematic flowchart of a data processing method provided in an embodiment of the present invention.
- FIG. 3 is a schematic diagram of the execution flow of a data processing method provided in an embodiment of the present invention.
- FIG. 4 is a schematic diagram of the interaction process of a model training method provided by an embodiment of the present invention.
- FIG. 5 is a schematic structural diagram of a data processing device provided by an embodiment of the present invention.
- Figure 6 is a schematic structural diagram of a front-end device provided by an embodiment of the present invention.
- FIG. 7 is a schematic structural diagram of a back-end device provided by an embodiment of the present invention.
- FIG. 1 is a schematic diagram of an applicable system architecture provided by an embodiment of the present invention.
- the system architecture may include a federation server 110 and at least two participant devices, such as a participant device 121 and a participant device 122 ⁇ Participant device 123.
- the federation server 110 may be connected to each participant's device, for example, it may be connected in a wired manner, or may be connected in a wireless manner, which is not specifically limited.
- FIG. 2 is a schematic flowchart of a data processing method provided by an embodiment of the present invention.
- the method can be applied to any participant device, such as the participant device 121 shown in FIG. , The participant device 122 or the participant device 123, which is not specifically limited.
- the method includes:
- Step 201 The participant device receives a model training request sent by the federation server.
- Step 202 The participant device obtains locally stored user behavior data according to the model training request.
- Step 203 The participant device processes the user behavior data according to the preset feature distribution rule, and obtains a data set to be trained that is consistent with the feature distribution of other participant devices.
- Step 204 The participant device trains the participant model by using the data set to be trained, and sends the participant model to the federation server, so that the federation server obtains a behavior prediction model based on the joint training of each participant model.
- each participant device processes the user behavior data according to preset feature distribution rules to obtain a data set to be trained that is consistent with the feature distribution of other participant devices, so that each participant device can use
- the training data set with the same feature distribution to be trained can obtain the participant model with the same model structure.
- the federated server can train the participant model with the same model structure obtained from the equipment training of each participant to obtain the behavior prediction model, because the behavior prediction model is combined
- the behavior data characteristics of each participant's device can be used to predict the behavior of users in each participant's device, and the behavior prediction model has good versatility.
- step 203 there may be multiple possibilities for the preset feature distribution rule, such as:
- the preset feature distribution rule can be set as follows: the federated server 110 first counts all users and all objects in each participant's device, and then uses the one-hot algorithm to encode all users, and maps all users to the first In the vector space, all objects are encoded using the one-hot algorithm, and all objects are mapped to the second vector space. Furthermore, the federation server 110 synchronizes the first vector space and the second vector space to each participant device, so that each The participant device uses the mapping value of the local user in the first vector space and the mapping value of the local object in the second vector space to construct the to-be-trained data set of the participant device.
- the user behavior data is access control data
- the users of participant device A include user 1 and user 2
- the objects of participant device A include door 1 and door 2
- the users of participant device B include user 3 and User 4
- the objects of participant device B include gate 3 and gate 4.
- the federation server 110 maps all users to the first vector space [0 0 0 0] (each vector bit in the first vector space in turn Corresponding to user 1, user 2, user 3, and user 4), map all objects to the second vector space [0 0 0 0] (each vector bit in the second vector space corresponds to gate 1, gate 2, and gate 3 in turn In door 4), then: when user 1 swipes at door 1, user 2 does not swipe, user 3 swipes at door 4, and user 4 does not swipe, the data set to be trained constructed by participant device A includes to be trained Data [1 0 0 0 1 0 0] and data to be trained [0 1 0 0 0 0 0 0 0], the data set to be trained constructed by the participant device B includes the data to be trained [0 0 1 0 0 0 0 0] ] And the data to be trained [0 0 0 1 0 0 1 0].
- the data sets to be trained in each participant's device can have the same feature distribution.
- the training data is concentrated in the first, second, and fifth positions, and the third, fourth, sixth, and seventh positions are all zero.
- the training data of participant device B is concentrated in the third, The 4th, 6th, and 7th digits, while the 1st, 2nd, and 5th digits are all zero.
- the use of the data set to be trained on the participant’s device may contain more meaningless data for a while.
- these meaningless data may cause noise to the model training. Impact, resulting in poor model training.
- these meaningless data will also increase the model training time, resulting in a large loss of system performance and poor model training efficiency.
- the preset feature distribution rule can be set as:
- the federation server 110 uses the embedding algorithm to encode the users in each participant's device, so as to encode the users in each participant's device.
- the user maps to the first common vector space corresponding to each participant's device, and uses the embedding algorithm to encode the object in each participant's device to map the object in each participant's device to the corresponding first of each participant's device 2.
- Public vector space Further, the federation server 110 synchronizes the first vector space and the second vector space to each participant device, so that each participant device constructs a data set to be trained based on the same first common vector space and second common vector space.
- the user behavior feature is access control data
- the users of participant device A include user 1 and user 2
- the objects of participant device A include door 1 and door 2
- the users of participant device B include user 3 and User 4
- the objects of participant device B include door 3 and door 4.
- the federation server 110 maps user 1 and user 2 of participant device A (or user 3 and user 4 of participant device B) to In the first common vector space [0 0]
- the target door 1 and door 2 of the participant device A (or the door 3 and door 4 of the participant device B) are mapped to the second common vector space [0 0].
- the first bit of the first public vector space is used to identify user 1 in participant device A
- the second bit in participant device B is used to identify user 3
- the second bit of the first public vector space is used in participant device A. It is used to identify user 2 and is used to identify user 4 in participant device B; accordingly, the first bit of the second common vector space is used to identify gate 1 in participant device A, and is used in participant device B Identify gate 3.
- the second bit of the second common vector space is used to identify gate 2 in participant device A, and is used to identify gate 4 in participant device B.
- the training data set constructed by participant device A includes the data to be trained[1 0 1 0 ] And training data [0 1 0 0], the training data set constructed by the participant device B includes the training data [1 0 0 1] and the training data [0 1 1 0].
- the data sets to be trained in each participant's device can have the same feature distribution, and the training data of each participant's device basically does not contain meaningless Therefore, the amount of sample data can be reduced, and the efficiency of model training can be improved.
- the same bits in the training data of different participant's devices have different meanings in different participant's devices, so if Using data to be trained with the same form but different meanings for model training will prevent the federated server 110 from extracting the user characteristics and object characteristics of the devices of different participants, resulting in poor model effects and possibly increasing the probability of misjudgment of predictions .
- the embodiment of the present invention provides a possible data processing method.
- the preset feature distribution rule is set such that each participant device generates a feature distribution according to a common user behavior feature dimension and object behavior feature dimension. Consistent rules for the data to be trained.
- FIG. 3 is a schematic diagram of the execution flow of processing the data set to be trained by using the preset feature distribution rule.
- the method is applicable to any participant device, such as the participant device 121, the participant device 122, or the participant device shown in FIG. Equipment 123. As shown in Figure 3, the method includes:
- Step 301 The participant device extracts the user behavior feature of any user from the user behavior data according to the shared user behavior feature dimension.
- the user behavior data may include behavior data of each user in the participant device performing a preset behavior on one or more objects within a set time period. For example, if the user behavior data is community access control data, the set time period is early October, and the participant’s device is community A, then the user behavior data of the participant’s device can include each user in community A in early October. Swipe data at each door of cell A at the time. For example, if there are door 1 and door 2 in cell A, the user behavior data of the participant's device may include the date and time when the user swiped the card at door 1 and the date and time when the user swiped the card at door 2.
- the preset behavior refers to the behavior of swiping a card
- one or more objects refer to door 1 and door 2 in cell A.
- the user behavior data is e-commerce platform data
- the participant device is Bookseller C
- the set time period is early October
- the user behavior data of the participant device can include each user of Bookseller C 10 Consumption data of books purchased on bookseller C's platform in the first ten days of the month.
- the user behavior data of the participant's device may include the date and time when the user purchased book 1 and the date and time when the user purchased book 2.
- the preset behavior refers to a purchase behavior
- one or more objects refer to Book 1 and Book 2 published on the platform of Bookseller C.
- the participant device can extract the characteristic value of any user in any shared user behavior characteristic dimension from the user behavior data according to the shared user behavior characteristic dimension, and then according to the user’s shared user behavior characteristic
- the characteristic value under the dimension is constructed to obtain the user behavior characteristic of the user.
- the shared user behavior characteristic dimension is used to indicate the user's performance of each object, and the shared user behavior characteristic dimension may include the time the user performs the preset behavior and/or the number of times the user performs the preset behavior in each time period.
- the user behavior data includes the card swiping data of each user in community A at gate 1 and gate 2 of cell A in early October
- the user behavior characteristics of any user may include the data in early October.
- the user swipes the card at door 1 or door 2 the total number of times the user swipes at door 1 and door 2 in early October, and the number of times the user swipes at door 1 and door 2 each week in early October. Number of times, the number of times the user swiped the card at door 1 and door 2 in each day in early October.
- the common user behavior characteristic dimension can be set to include the time when the user performed the preset behavior last time, and the user performed the preset behavior in the last day. Any one or more of the number of behaviors and the number of times the user has performed preset behaviors in the past week. It is understandable that the time information in this example (that is, the most recent time, the most recent day, and the most recent week) can be set by those skilled in the art based on experience. For example, if the time information is the most recent five times, the most recent two days, and the most recent two weeks, it will be shared.
- the user behavior characteristic dimension of is the time when the user performed the preset behavior for the last five times, the number of times the user performed the preset behavior in the last two days, and the number of times the user performed the preset behavior in the last two weeks.
- Step 302 The participant device extracts the object behavior feature of any object from the user behavior data according to the shared object behavior feature dimension.
- the participant device can extract the feature value of any object in any shared object behavior feature dimension from the user behavior data according to the shared object behavior feature dimension, and then based on the object’s behavior features in each shared object The characteristic value under the dimension is constructed to obtain the object behavior characteristic of the object.
- the shared object behavior characteristic dimension is used to indicate the execution status of the object
- the shared object behavior characteristic dimension may include the time when the object is performed the preset behavior and/or the number of times the object performs the preset behavior in each time period, such as It may include the time during which the object performs the preset behavior in the set time period, the total number of times the object performs the preset behavior in the set time period, the number of times the object performs the preset behavior in each time interval of the set time period, and so on.
- the object behavior characteristics of the object may include 10 The time when the card was swiped at door 1 in the first ten days of the month, the total number of times the card was swiped at door 1 in the first ten days of October, the number of times the card was swiped at door 1 each week in early October, and the number of times the card was swiped at door 1 each day in early October.
- the common behavior characteristics of the object can be set to include the time when the object was last performed the preset behavior, and the object was performed the last day. Any one or more of the number of preset behaviors and the number of times the subject has performed preset behaviors in the last week. It is understandable that the time information in this example (that is, the most recent time, the most recent day, and the most recent week) can be set by those skilled in the art based on experience.
- the shared The behavior characteristics of the object may be the time when the object has performed the preset behavior in the last three times, the number of times the object has performed the preset behavior in the last three days, and the number of times the object has performed the preset behavior in the last two weeks.
- Step 303 The participant device constructs a feature pair between the user behavior feature of any user and the object behavior feature of any object, and based on the feature pair, generates data to be trained that is consistent with the feature distribution of other participant devices.
- the participant device may first obtain statistics of all users and all objects in the participant device, and then establish a feature pair for any user and any object.
- each user in the participant device can correspond to multiple feature pairs
- each object in the participant device can also correspond to multiple feature pairs.
- the participant device can construct four feature pairs based on all users and all objects in cell A, respectively: user1 -item1 feature pair, user1-item2 feature pair, user2-item1 feature pair, user2-item2 feature pair.
- user1 refers to user 1
- user2 refers to user 2
- item1 refers to object 1
- item2 refers to object 2.
- each user and each object can correspond to a data to be trained.
- the behavior data of each user and the data of each object are directly used.
- the amount of data in the data set to be trained can be reduced, and the efficiency of model training can be improved.
- the participant device may also extract the interaction features between the user in the feature pair and the object in the feature pair from the user behavior data according to the shared interaction behavior feature dimension.
- the shared interactive behavior characteristic dimension is used to indicate the user's performance on the object
- the interactive behavior characteristic dimension may include the time when the user performs a predetermined behavior on the object and/or the user performs the predetermined behavior on the object in each time period.
- the number of times for example, can include the time the user performs the preset behavior on the object in the set time period, the total number of times the user performs the preset behavior on the object in the set time period, and the user performs the preset behavior on the object in each time interval of the set time period. The number of times, etc.
- the user behavior data includes the card swiping data of each user in community A at gate 1 and gate 2 of cell A in early October
- the users and objects in the feature pair are user 1 and gate 1, respectively
- the interactive features can include the time the user swiped the card at door 1 in early October, the total number of times the user swiped the card at door 1 in early October, the number of times the user swiped the card at door 1 each week in early October, and October The number of times the user swiped the card at door 1 in the first ten days of the day, etc.
- the common interaction feature dimensions can be set to any one or more of the following: the time when the user last performed a preset behavior on the object , The number of times the user performed the preset behavior on the object in the past week, and the ranking of the number of times the user performed the preset behavior on the object among all users. It is understandable that the time information in this example (that is, the most recent time, the most recent week) can be set by those skilled in the art based on experience.
- the shared interaction feature dimension may also be the user The ranking of the time of performing the preset behavior on the object in the last three times, the number of times the user performed the preset behavior on the object in the last two weeks, and the number of times the user performed the preset behavior on the object among all users.
- the participant device may use a supervised machine learning algorithm to perform model training.
- a supervised machine learning algorithm each piece of data to be trained also needs to be set with a corresponding label.
- the label can be set according to the prediction function of the behavior prediction model.
- the label corresponding to the data to be trained is used to indicate whether the user and object in the feature pair are The function of the behavior prediction model is realized within the set time period.
- the participant device can also determine the label corresponding to the feature pair based on the interaction feature. For example, if the function of the behavior prediction model is to predict the number of times the user swipes the object, the label corresponding to the feature pair can be set within a set period of time. The number of times that the user in the feature pair swipes the object in the feature pair; if the function of the behavior prediction model is to predict whether the user will swipe the card at the object at a certain moment, the label corresponding to the feature pair can be based on the time of the set time period. Whether the user in the feature pair swipes the card at the object in the feature pair to set.
- the label corresponding to the feature pair can be set as the first label. If the user in the feature pair does not swipe the card at the object in the feature pair at that moment , the label corresponding to the feature pair can be set as the second label.
- the first label and the second label can be set by those skilled in the art based on experience. For example, the first label can be set to 1, the second label can be set to 0, or the first label can be set to 0, and the second label can be set to It is 1, which is not specifically limited.
- the behavior prediction model is used to predict whether a user will perform a preset behavior on an object on a certain day in the future period, then when the user in the feature pair is in a certain period of time (the same length as the future period) When the preset behavior is performed on the object on one day (corresponding to a certain day in the future time period), the label corresponding to the feature pair can be the first label. When the user in the feature pair does not perform pre-determination on the object on a certain day in the set time period. When the behavior is set, the label corresponding to the feature pair can be the second label.
- the behavior prediction model is used to predict that the user performs a preset behavior on the object at a certain moment
- the feature pair corresponds to the label It may be the first label
- the label corresponding to the feature pair may be the second label.
- the label corresponding to the feature pair can also be represented by a feature vector.
- the label corresponding to the feature pair may be a feature vector obtained by splicing user behavior features, object behavior features, and interaction features extracted based on user behavior data in a certain sub-period of a set period.
- the set time period is from day 1 to day 7, if the user behavior characteristics of user 1 swiping card, the behavior characteristics of the object swiped by door 1 and user 1 are extracted based on the user behavior data from day 1 to day 7
- the participant device by extracting the corresponding label of the feature pair, the participant device can implement model training based on the supervised machine learning algorithm, and the behavior prediction model is more targeted and the prediction effect is better.
- the participant device can also splice the user behavior characteristics, object behavior characteristics, interaction characteristics, and tags of the user in the characteristic pair, and use the spliced feature vector as the feature pair.
- the order of splicing is not limited. For example, it can be spliced in order according to the user's user behavior characteristics, the object's object behavior characteristics, the interaction characteristics, and the tags. It can also be according to the object's object behavior characteristics, the user's user behavior characteristics, the interaction characteristics,
- the order of the tags is spliced in order, and it can also be spliced according to the order of interaction characteristics, object behavior characteristics of objects, user behavior characteristics of users, tags, and so on.
- the user behavior characteristics of users in different participant devices have the same expression form
- the object behavior characteristics of objects in different participant devices have the same expression form
- the interaction characteristics of users and objects in different participant devices also have the same expression form.
- different participant devices can be constructed based on user behavior characteristics that have the same expression form as other participant devices, object behavior characteristics that have the same expression form as other participant devices, and interactions and labels that have the same expression form as other participant devices.
- Data to be trained with consistent feature distribution Since the training data of each participant device has the same data distribution and the same feature dimensions, different participant devices can train based on the training data with the same feature distribution to obtain participant models with the same model structure.
- Step 304 The participant device constructs the to-be-trained data set based on the to-be-trained data corresponding to each feature pair formed by each user and each object.
- the label corresponding to each data to be trained may indicate whether the data to be trained is positive sample data or negative sample data.
- the label corresponding to the data to be trained is the first label
- the data to be trained is positive sample data
- the label corresponding to the data to be trained is the second label
- the data to be trained is negative sample data.
- the label of the data to be trained indicates that the function of the behavior prediction model is realized within a set time period
- the data to be trained is positive sample data.
- the label in the data to be trained indicates that the function of the behavior prediction model cannot be realized within the set time period
- the data to be trained is negative sample data.
- each data to be trained constructed by the participant's device will contain less positive sample data and more negative sample data. For example, if there are many doors in a cell, and users habitually swipe their cards at a certain door of the cell, but rarely swipe their cards at other doors, so after constructing each door to be trained based on the user and each door in the cell, The number of positive sample data in each data to be trained is small, and the number of negative sample data is large.
- the participant device after the participant device constructs each to-be-trained data based on all users and all objects in the participant device, it can first determine the to-be-trained data according to the corresponding label of each feature.
- the positive sample data and the negative sample data in the training data set are then judged whether the proportion of the data to be trained belonging to the positive and negative samples meets the preset range. If it does not meet the preset range, the negative sample data can be down-sampled, or you can Up-sampling the positive sample data, such as using down-sampling method to reduce the number and weight of negative sample data, or using up-sampling method to increase the number or weight of positive sample data in the data to be trained.
- the preset range is met, the data set to be trained can be constructed based on each data to be trained.
- Upsampling method 1 The participant device can first obtain all or part of the positive sample data from the data to be trained corresponding to all users and all objects, and then copy all or part of the positive sample data to increase the number of samples to be trained by copying The number of positive samples in the data.
- Upsampling method 2 The participant device can first obtain all the positive sample data from the data to be trained corresponding to all users and all objects, and then from all the positive sample data (or the leftover positive sample data selected last time) each time At least two positive sample data are selected, and different parts of the at least two positive sample data are spliced to obtain a new positive sample data. For example, if two positive sample data are selected, the first half of the first positive sample data and the second half of the second positive sample data can be spliced into a new positive sample data, or the first positive sample data can be spliced The last 1/3 part of the sample data and the first 2/3 part of the second positive sample data are spliced into a new positive sample data, which is not specifically limited.
- Upsampling method 3 Participant equipment can first obtain all or part of the positive sample data from the data to be trained corresponding to all users and all objects, and then increase the weight of each positive sample data in the loss function, different positive sample data The increased weight can be the same or different, and is not limited. In this way, when the participant equipment uses the positive sample data and the negative sample data to train the model, because the weight of the positive sample data is larger, it can reduce the ability of the negative sample data to bias the model parameters, reduce the deviation of model training, and improve the model’s performance. Effect.
- Down-sampling method 1 The participant device can first obtain all the negative sample data from the data to be trained corresponding to all users and all objects, and then randomly select part of the negative sample data from all the negative sample data for deletion, so as to delete randomly. The way to reduce the number of negative sample data in the data to be trained.
- Downsampling method 2 The participant device can first obtain all the negative sample data from the data to be trained corresponding to all users and all objects, and then calculate the similarity between each negative sample data and other negative sample data, if the similarity is less than If the similarity threshold is preset, the negative sample data is deleted, and if the similarity is greater than or equal to the preset similarity threshold, the negative sample data is retained. By deleting negative samples that are less similar to other negative sample data, model training can be performed based on relatively similar negative sample data, thereby improving the ability of the behavior prediction model to recognize different data to be predicted and improving the prediction effect.
- the participant device can first calculate the similarity between the negative sample data and any other negative sample data, and then calculate the similarity between the negative sample data and all other negative sample data to be trained. The average or weighted average is used as the similarity between the negative sample data and other negative sample data.
- Downsampling method 3 Participating party equipment can first obtain all or part of the negative sample data from the data to be trained corresponding to all users and all objects, and then reduce the weight of each negative sample data in the loss function. Different negative sample data The reduced weight can be the same or different, and is not limited. In this way, when the participant equipment uses the positive sample data and the negative sample data to train the model, because the weight of the negative sample data is small, it can reduce the ability of the negative sample data to bias the model parameters, reduce the deviation of the model training, and improve the model's performance. Effect.
- the copy method in the up-sampling method one and/or the splicing method in the up-sampling method two is used to increase the number of positive sample data, or if the deletion method in the down-sampling method one is used And/or the similarity deletion method in the down-sampling method two reduces the number of negative sample data.
- the ratio of the number of positive sample data and negative sample data in the data to be trained is adjusted to 1:3, the effect of model training is better.
- the weighting method in the up-sampling method three is used to increase the weight of the positive sample data, or if the weight reduction method in the down-sampling method three is used to reduce the weight of the negative sample data, the When the weight ratio of weight to negative sample data is adjusted to 20:1, the effect of model training is better.
- the participant device may first divide all the data to be trained into training data, verification data, and test data.
- the training data is used for the participant device training to obtain the participant model
- the verification data is used for the participant device to verify the participant.
- the effect of the model, and the test data is used for the federation server 110 to verify the effect of the behavior prediction model after the model training is completed.
- the participant device may report the model parameters of the participant model obtained through training to the federation server 110, and the model parameters of the participant model are used by the federation server 110 to obtain comprehensive model parameters according to the model parameters of each participant model. If the end conditions of the model training are met, the behavior prediction model is obtained according to the comprehensive model parameters. If it is determined that the end conditions of the model training are not met, the comprehensive model parameters are issued to each participant's device to jointly perform step 201 with each participant's device. ⁇ Step 204.
- the participant device may only report the model parameters of the participant model to the federation server 110.
- the federated server 110 can calculate the average model parameters based on the respective model parameters, and can determine the average model parameters as the comprehensive model parameters for this training.
- the participant device may simultaneously send the model parameters and loss function of the participant model to the federation server 110.
- the federation server 110 may first determine according to each loss function. The weight of each model parameter is calculated using the weighted average method to obtain the comprehensive model parameter. Among them, if the loss function corresponding to the model parameter is smaller, the effect of the participant model is better.
- the loss functions can be sorted in descending order. If the loss function is sorted later, the weight of the model parameter corresponding to the loss function can be set to be smaller. If the loss function is sorted, the weight of the model parameter can be set to be smaller. The higher the weight of the model parameter corresponding to the loss function can be set.
- the federation server 110 can set the weights of the model parameters corresponding to participant device 121 to participant device 123 to 10 respectively. %, 60%, 30%.
- the end condition of the model training may include any one or more of the following: the comprehensive model parameters of the current training converge, the number of times the training has been performed is greater than or equal to the preset number, and the duration of the training performed is greater than or It is equal to the preset training duration, which can be specifically set by those skilled in the art based on experience, and is not specifically limited.
- the condition for the end of model training is that the number of times the training has been performed is greater than or equal to 5 times, then after the participant device has trained the participant model 5 times in sequence (that is, the 5th training is completed), the federation server 110 can determine The fifth training meets the end conditions of the model training.
- the model training request is issued from the federation server 110 to the fifth minute of execution (if the third training is being performed at this time)
- the federated server 110 may determine that the third training meets the end condition of the model training.
- the federation server 110 can also calculate the loss function of this training according to the loss function sent by each participant's device in this training. Comprehensive loss function.
- the comprehensive loss function of this training is in a state of convergence (for example, the comprehensive loss function of this training is less than or equal to a certain threshold), then it can be determined that this training meets the end condition of the model training, otherwise it is determined this time The training does not meet the end conditions of the model training.
- the federated server 110 can use the comprehensive model parameters of the current training to construct a behavior prediction model. If the current training does not meet the end conditions of the model training, the federated server 110 can Distribute the comprehensive model parameters of this training to each participant's device, so that each participant's device based on the comprehensive model parameters of this training, use the to-be-trained data set of each participant's device to re-execute the next training until the model is satisfied Until the end of training.
- the federation server 110 may also deliver the behavior prediction model to each participant's device.
- the feature information corresponding to the feature pair to be tested may include any one or more of the user behavior characteristics of the user to be tested, the object behavior characteristics of the object to be tested, and the interaction characteristics of the user to be tested with the object to be tested, and the predicted label Used to determine whether the user under test will perform a preset behavior on the object under test.
- a behavior prediction model is constructed by combining user behavior data in each participant's device, so that the behavior prediction model can be used to predict the behavior of a user in any participant's device, and the behavior prediction model has better performance.
- Versatility is constructed by combining user behavior data in each participant's device, so that the behavior prediction model can be used to predict the behavior of a user in any participant's device, and the behavior prediction model has better performance.
- FIG. 4 is a schematic diagram of the overall process of model training provided by an embodiment of the present invention, and the method includes:
- step 401 the federation server 110 issues a model training request to each participant device, and the model training request carries initial model parameters.
- Step 402 After receiving the model training request issued by the federation server, any participant device obtains the locally stored user behavior data, and processes the user behavior data according to the preset feature distribution rules, and obtains that the feature distribution is consistent with other participant devices.
- the data set to be trained After receiving the model training request issued by the federation server, any participant device obtains the locally stored user behavior data, and processes the user behavior data according to the preset feature distribution rules, and obtains that the feature distribution is consistent with other participant devices. The data set to be trained.
- Step 403 Based on the initial model parameters, any participant device uses the to-be-trained data set to train to obtain a participant model that is consistent with the structure of the other participant's device model.
- any participant device reports the model parameters of the participant model to the federation server.
- step 405 after receiving the model parameters of the participant models reported by each participant's device, the federation server obtains the comprehensive model parameters according to the model parameters of each participant's model.
- step 406 the federation server determines whether the end condition of the model training is met, if yes, execute step 407, and if not, execute step 408.
- step 407 the federated server constructs and obtains a behavior prediction model according to the comprehensive model parameters.
- step 408 the federation server delivers the comprehensive model parameters to each participant's device.
- Step 409 After any participant device receives the integrated model parameters issued by the federation server, it uses the integrated model parameters to update the locally stored initial model parameters, and executes step 403.
- the participant device receives the model training request sent by the federation server, obtains locally stored user behavior data according to the model training request, and processes the user behavior data according to preset feature distribution rules to obtain Use the to-be-trained data set to train a data set to be trained that is consistent with the feature distribution of other participants’ equipment, and then send the participant’s equipment model to the federation server so that the federation server is based on The equipment models of each participant are jointly trained to obtain a behavior prediction model.
- each participant device processes the user behavior data according to preset feature distribution rules to obtain a data set to be trained that is consistent with the feature distribution of other participant devices, so that each participant device can use the feature distribution
- the training of a consistent data set to be trained results in a participant device model with a consistent model structure.
- the federated server can train a participant device model based on the model structure obtained from the training of each participant's device to obtain a behavior prediction model. Because the behavior prediction model is combined
- the behavior data characteristics of each participant's device can be used to predict the behavior of users in each participant's device, and the behavior prediction model has good versatility.
- an embodiment of the present invention also provides a data processing device, and the specific content of the device can be implemented with reference to the foregoing method.
- FIG. 5 is a schematic structural diagram of a data processing device provided by an embodiment of the present invention. As shown in FIG. 5, the device includes:
- the transceiver module 501 is configured to receive a model training request sent by the federation server;
- the obtaining module 502 is configured to obtain locally stored user behavior data according to the model training request;
- the processing module 503 is configured to process the user behavior data according to preset feature distribution rules to obtain a data set to be trained that is consistent with the feature distribution of other participants' devices;
- the training module 504 is configured to train to obtain a participant model by using the to-be-trained data set, and send the participant model to the federation server, and the federation server is configured to obtain a behavior prediction model based on joint training of each participant model .
- the preset feature distribution rule is a rule for generating data to be trained with consistent feature distribution according to a shared user behavior feature dimension and object behavior feature dimension.
- the processing module 503 is specifically configured to: first extract the user behavior characteristics of any user from the user behavior data according to the shared user behavior characteristic dimension, and then follow the shared object behavior
- the feature dimension is to extract the object behavior feature of any object from the user behavior data, and then construct a feature pair between the user behavior feature of any user and the object behavior feature of any object, and based on the feature pair, generate and The data to be trained with the same feature distribution of other participants' devices, and finally the data set to be trained is constructed based on the data to be trained corresponding to each feature pair formed by each user and each object.
- the processing module 503 is specifically configured to first extract the characteristic value of the user in any shared user behavior characteristic dimension from the user behavior data, and then according to the user’s shared user behavior
- the feature value under the feature dimension is constructed to obtain the user behavior feature of the user.
- the processing module 503 is specifically configured to: first extract the interaction features between the user and the object from the user behavior data according to the shared interaction behavior feature dimension, and then extract the interaction features between the user and the object according to the shared interaction behavior feature dimensions.
- the interaction feature of the object, the label corresponding to the feature pair is determined, and then the user behavior feature of the user, the object behavior feature of the object, the interaction feature and the feature vector obtained from the tag are combined as the feature pair The corresponding data to be trained.
- the processing module 503 is specifically configured to determine whether the proportion of the data to be trained belonging to the positive and negative samples meets a preset range according to the labels corresponding to the respective feature pairs; Down-sampling processing is performed on the data to be trained for negative samples, or up-sampling processing is performed on the data to be trained with labels of positive samples. If it meets the preset range, construct the to-be-trained data set based on the respective to-be-trained data.
- the device further includes a prediction module 505.
- the transceiver module 501 sends the participant model to the federation server
- the transceiver module 501 also receives the behavior prediction model sent by the federation server.
- the prediction module 505 inputs the feature information corresponding to the feature pair to be tested into the behavior prediction model for prediction, and obtains the predicted label corresponding to the feature pair to be tested.
- the characteristic information corresponding to the characteristic pair to be tested includes any one or any of the user behavior characteristics of the user to be tested, the object behavior characteristics of the object to be tested, and the interaction characteristics between the user to be tested and the object to be tested. Multiple.
- the prediction tag is used to determine whether the user to be tested will perform a preset behavior on the object to be tested.
- the shared user behavior characteristic dimension may include the time for the user to perform the preset behavior and/or the number of times the user performs the preset behavior in each time period.
- the shared object behavior characteristic dimension may include the time when the object is performed the preset behavior and/or the number of times the object performs the preset behavior in each time period.
- the interactive behavior characteristic dimension may include the time for the user to perform the preset behavior on the object and/or the number of times the user performs the preset behavior on the object in each time period.
- the participant device receives the model training request sent by the federated server, obtains locally stored user behavior data according to the model training request, and analyzes the data according to the preset feature distribution rule.
- the user behavior data is processed to obtain a data set to be trained that is consistent with the feature distribution of other participants' equipment, and the participant model is obtained by training using the to-be-trained data set, and the participant model is sent to the federation server to facilitate
- the federated server obtains a behavior prediction model based on joint training of each participant model.
- each participant device processes the user behavior data according to preset feature distribution rules to obtain a data set to be trained that is consistent with the feature distribution of other participant devices, so that each participant device can use the feature distribution
- a consistent training data set to be trained can obtain a participant model with a consistent model structure.
- the federated server can obtain a behavior prediction model based on the participant model training with the same model structure obtained by the equipment training of each participant. Because the behavior prediction model combines each The behavior data characteristics of the participant's device can therefore be used to predict the behavior of users in each participant's device, and the behavior prediction model has good versatility.
- embodiments of the present invention also provide a computing device, including at least one processing unit and at least one storage unit, wherein the storage unit stores a computer program, and when the program is executed by the processing unit , So that the processing unit executes the method described in any of FIGS. 2 to 4.
- embodiments of the present invention also provide a computer-readable storage medium that stores a computer program executable by a computing device, and when the program runs on the computing device, the computing device executes The method described in any of FIGS. 2 to 4.
- an embodiment of the present invention provides a terminal device. As shown in FIG. 6, it includes at least one processor 601 and a memory 602 connected to the at least one processor.
- the processor 601 is not limited in the embodiment of the present invention.
- the processor 601 and the memory 602 are connected through a bus in FIG. 6 as an example.
- the bus can be divided into address bus, data bus, control bus and so on.
- the memory 602 stores instructions that can be executed by at least one processor 601, and the at least one processor 601 can execute the steps included in the aforementioned data processing method by executing the instructions stored in the memory 602.
- the processor 601 is the control center of the terminal device, which can use various interfaces and lines to connect various parts of the terminal device, and realize data by running or executing instructions stored in the memory 602 and calling data stored in the memory 602. handle.
- the processor 601 may include one or more processing units, and the processor 601 may integrate an application processor and a modem processor, where the application processor mainly processes the operating system, user interface, and application programs, etc.
- the adjustment processor mainly handles issuing instructions. It can be understood that the foregoing modem processor may not be integrated into the processor 601.
- the processor 601 and the memory 602 may be implemented on the same chip, and in some embodiments, they may also be implemented on separate chips.
- the processor 601 may be a general-purpose processor, such as a central processing unit (CPU), a digital signal processor, an application specific integrated circuit (ASIC), a field programmable gate array or other programmable logic devices, discrete gates or transistors Logic devices and discrete hardware components can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of the present invention.
- the general-purpose processor may be a microprocessor or any conventional processor or the like. The steps of the method disclosed in combination with the data processing embodiment can be directly embodied as being executed and completed by a hardware processor, or executed and completed by a combination of hardware and software modules in the processor.
- the memory 602 as a non-volatile computer-readable storage medium, can be used to store non-volatile software programs, non-volatile computer-executable programs, and modules.
- the memory 602 may include at least one type of storage medium, for example, may include flash memory, hard disk, multimedia card, card-type memory, random access memory (Random Access Memory, RAM), static random access memory (Static Random Access Memory, SRAM), Programmable Read Only Memory (PROM), Read Only Memory (ROM), Electrically Erasable Programmable Read-Only Memory (EEPROM), magnetic memory, disk , CD, etc.
- the memory 602 is any other medium that can be used to carry or store desired program codes in the form of instructions or data structures and that can be accessed by a computer, but is not limited thereto.
- the memory 602 in the embodiment of the present invention may also be a circuit or any other device capable of realizing a storage function for storing program instructions and/or data.
- an embodiment of the present invention provides a back-end device. As shown in FIG. 7, it includes at least one processor 701 and a memory 702 connected to the at least one processor.
- the embodiment of the present invention does not limit the processor.
- the specific connection medium between the 701 and the memory 702 is the connection between the processor 701 and the memory 702 through a bus in FIG. 7 as an example.
- the bus can be divided into address bus, data bus, control bus and so on.
- the memory 702 stores instructions that can be executed by at least one processor 701, and the at least one processor 701 can execute the steps included in the aforementioned data processing method by executing the instructions stored in the memory 702.
- the processor 701 is the control center of the back-end equipment, which can use various interfaces and lines to connect to various parts of the back-end equipment, and by running or executing instructions stored in the memory 702 and calling data stored in the memory 702, Realize data processing.
- the processor 701 may include one or more processing units, and the processor 701 may integrate an application processor and a modem processor, where the application processor mainly processes operating systems, application programs, etc., and the modem processor Mainly analyze the received instructions and analyze the received results. It can be understood that the foregoing modem processor may not be integrated into the processor 701.
- the processor 701 and the memory 702 may be implemented on the same chip, and in some embodiments, they may also be implemented on separate chips.
- the processor 701 may be a general-purpose processor, such as a central processing unit (CPU), a digital signal processor, an application specific integrated circuit (ASIC), a field programmable gate array or other programmable logic devices, discrete gates or transistors Logic devices and discrete hardware components can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of the present invention.
- the general-purpose processor may be a microprocessor or any conventional processor or the like. The steps of the method disclosed in combination with the data processing embodiment can be directly embodied as being executed and completed by a hardware processor, or executed and completed by a combination of hardware and software modules in the processor.
- the memory 702 as a non-volatile computer-readable storage medium, can be used to store non-volatile software programs, non-volatile computer-executable programs, and modules.
- the memory 702 may include at least one type of storage medium, for example, may include flash memory, hard disk, multimedia card, card-type memory, random access memory (Random Access Memory, RAM), static random access memory (Static Random Access Memory, SRAM), Programmable Read Only Memory (PROM), Read Only Memory (ROM), Electrically Erasable Programmable Read-Only Memory (EEPROM), magnetic memory, disk , CD, etc.
- the memory 702 is any other medium that can be used to carry or store desired program codes in the form of instructions or data structures and that can be accessed by a computer, but is not limited to this.
- the memory 702 in the embodiment of the present invention may also be a circuit or any other device capable of realizing a storage function for storing program instructions and/or data.
- the embodiments of the present invention can be provided as a method or a computer program product. Therefore, the present invention may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present invention may adopt the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes.
- a computer-usable storage media including but not limited to disk storage, CD-ROM, optical storage, etc.
- These computer program instructions can also be stored in a computer-readable memory that can guide a computer or other programmable data processing equipment to work in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture including the instruction device.
- the device implements the functions specified in one process or multiple processes in the flowchart and/or one block or multiple blocks in the block diagram.
- These computer program instructions can also be loaded on a computer or other programmable data processing equipment, so that a series of operation steps are executed on the computer or other programmable equipment to produce computer-implemented processing, so as to execute on the computer or other programmable equipment.
- the instructions provide steps for implementing the functions specified in one process or multiple processes in the flowchart and/or one block or multiple blocks in the block diagram.
Landscapes
- Engineering & Computer Science (AREA)
- Business, Economics & Management (AREA)
- Accounting & Taxation (AREA)
- Development Economics (AREA)
- Finance (AREA)
- Strategic Management (AREA)
- Entrepreneurship & Innovation (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- Data Mining & Analysis (AREA)
- General Physics & Mathematics (AREA)
- General Business, Economics & Management (AREA)
- Marketing (AREA)
- Economics (AREA)
- Game Theory and Decision Science (AREA)
- Software Systems (AREA)
- Artificial Intelligence (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Evolutionary Computation (AREA)
- Medical Informatics (AREA)
- Computing Systems (AREA)
- General Engineering & Computer Science (AREA)
- Mathematical Physics (AREA)
- Management, Administration, Business Operations System, And Electronic Commerce (AREA)
Abstract
一种数据处理方法及装置,涉及金融科技Fintech领域,用以解决现有技术无法训练得到通用的行为预测模型的问题。其中方法包括:参与方设备接收联邦服务器发送的模型训练请求,根据模型训练请求获取本地存储的用户行为数据(202),并按照预设特征分布规则处理用户行为数据得到与其他参与方设备特征分布一致的待训练数据集(203),通过各个参与方设备使用特征分布一致的待训练数据集训练得到模型结构一致的各个参与方模型,使得联邦服务器能够基于模型结构一致的各个参与方模型训练得到行为预测模型。由于行为预测模型结合了各个参与方设备的行为数据特征,因此该模型能够用于预测各个参与方设备中的用户的行为,模型的通用性较好,且准确率较高。
Description
相关申请的交叉引用
本申请要求在2020年01月21日提交中国专利局、申请号为202010071525.X、申请名称为“一种数据处理方法及装置”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
本发明涉及金融科技(Fintech)技术领域,尤其涉及一种数据处理方法及装置。
随着计算机技术的发展,越来越多的技术应用在金融领域,传统金融业正在逐步向金融科技(Fintech)转变。然而,由于金融行业的安全性和实时性要求较高,因此金融科技领域也对技术提出了更高的要求。在金融领域中,推广用户之前通常需要对用户的行为进行预测,比如通过预测用户对某商品感兴趣的概率,能够预先将对该商品不感兴趣的用户排除,从而降低无用的推广操作,提高推广效率。
现阶段,各个参与方仅能使用本地存储的用户行为数据训练得到行为预测模型。然而,由于不同参与方中的用户不同,对象也不同,因此某一参与方训练的行为预测模型仅能适用于对本参与方中的用户的行为进行预测,而无法对其它参与方中的用户的行为进行预测,从而导致行为预测模型的通用性较差,预测的准确率较低。
发明内容
本发明提供一种数据处理方法及装置,用以训练得到通用的行为预测模型,以实现对各个参与方中的用户的行为进行预测,进而能够提升用户行为预测的准确率。
第一方面,本发明提供一种数据处理方法,该方法应用于参与方设备,该方法包括:参与方设备接收联邦服务器发送的模型训练请求,根据该模型训练请求获取本地存储的用户行为数据,并按照预设特征分布规则对所述用户行为数据进行处理,得到与其他参与方设备特征分布一致的待训练数据集,之后利用该待训练数据集训练得到参与方模型,并将该参与方模型发送给所述联邦服务器,以使联邦服务器基于各个参与方模型联合训练得到行为预测模型。
在一种可能的实现方式中,预设特征分布规则为按照共用的用户行为特征维度和对象行为特征维度生成特征分布一致的待训练数据的规则。这种情况下,参与方设备按照预设特征分布规则对用户行为数据进行处理,得到与其他参与方设备特征分布一致的训练数据集,包括:参与方设备按照共用的用户行为特征维度,从用户行为数据中提取出任一用户的用户行为特征,再按照共用的对象行为特征维度,从用户行为数据中提取出任一对象的对象行为特征,之后构建任一用户的用户行为特征和任一对象的对象行为特征之间的特征对,基于该特征对,生成与其他参与方设备特征分布一致的待训练数据,并基于各个用户与各个对象构成的各个特征对对应的待训练数据,构建待训练数据集。
在一种可能的实现方式中,参与方设备按照共用的用户行为特征维度,从用户行为数据中提取出任一用户的用户行为特征,包括:参与方设备从用户行为数据中提取出用户在 任一共用的用户行为特征维度下的特征值,根据该用户在各个共用的用户行为特征维度下的特征值,构建得到该用户的用户行为特征。相应地,参与方设备按照共用的对象行为特征维度,从用户行为数据中提取出任一对象的对象行为特征,包括:参与方设备从用户行为数据中提取出对象在任一共用的对象行为特征维度下的特征值,根据对象在各个共用的对象行为特征维度下的特征值,构建得到对象的对象行为特征。
在一种可能的实现方式中,参与方设备基于征对,生成与其他参与方设备特征分布一致的待训练数据,包括:参与方设备按照共用的交互行为特征维度,从用户行为数据中提取出用户与对象的交互特征,根据用户与对象的交互特征,确定特征对对应的标签,之后将拼接用户的用户行为特征、对象的对象行为特征、交互特征及标签得到的特征向量作为特征对对应的待训练数据。
在一种可能的实现方式中,参与方设备根据各个特征对对应的待训练数据,构建待训练数据集,包括:参与方设备根据各个特征对对应的标签,确定属于正负样本的待训练数据的比例是否符合预设范围,若不符合预设范围,则对标签为负样本的待训练数据进行下采样,或者对标签为正样本的待训练数据进行上采样处理。若符合预设范围,则基于各个待训练数据构建待训练数据集。
在一种可能的实现方式中,参与方设备将参与方模型发送给联邦服务器之后,还可以接收联邦服务器发送的行为预测模型,并将待测特征对对应的特征信息输入行为预测模型中进行预测,得到待测特征对对应的预测标签。其中,待测特征对对应的特征信息包括待测用户的用户行为特征、待测对象的对象行为特征和待测用户与待测对象的交互特征中的任意一项或任意多项。预测标签用于确定待测用户是否会对待测对象执行预设行为。
在一种可能的实现方式中,共用的用户行为特征维度可以包括用户执行预设行为的时间和/或用户在各时段内执行预设行为的次数。相应地,共用的对象行为特征维度可以包括对象被执行预设行为的时间和/或对象在各时段内被执行预设行为的次数。
在一种可能的实现方式中,交互行为特征维度可以包括用户对对象执行预设行为的时间和/或用户在各时段内对对象执行预设行为的次数。
第二方面,本发明提供一种数据处理装置,该装置包括:收发模块,用于接收联邦服务器发送的模型训练请求;获取模块,用于根据模型训练请求获取本地存储的用户行为数据;处理模块,用于按照预设特征分布规则对用户行为数据进行处理,得到与其他参与方设备特征分布一致的待训练数据集;训练模块,用于利用待训练数据集训练得到参与方模型,并将参与方模型发送给联邦服务器,联邦服务器用于基于各个参与方模型联合训练得到行为预测模型。
在一种可能的实现方式中,预设特征分布规则为按照共用的用户行为特征维度和对象行为特征维度生成特征分布一致的待训练数据的规则。在这种情况下,处理模块具体用于:按照共用的用户行为特征维度,从用户行为数据中提取出任一用户的用户行为特征,按照共用的对象行为特征维度,从用户行为数据中提取出任一对象的对象行为特征,构建任一用户的用户行为特征和任一对象的对象行为特征之间的特征对,基于特征对,生成与其他参与方设备特征分布一致的待训练数据,基于各个用户与各个对象构成的各个特征对对应的待训练数据,构建待训练数据集。
在一种可能的实现方式中,处理模块具体用于:从用户行为数据中提取出用户在任一共用的用户行为特征维度下的特征值,根据用户在各个共用的用户行为特征维度下的特征 值,构建得到用户的用户行为特征,从用户行为数据中提取出对象在任一共用的对象行为特征维度下的特征值,根据对象在各个共用的对象行为特征维度下的特征值,构建得到对象的对象行为特征。
在一种可能的实现方式中,处理模块具体用于:按照共用的交互行为特征维度,从用户行为数据中提取出用户与对象的交互特征,根据用户与对象的交互特征,确定特征对对应的标签,将拼接用户的用户行为特征、对象的对象行为特征、交互特征及标签得到的特征向量作为特征对对应的待训练数据。
在一种可能的实现方式中,处理模块具体用于:根据各个特征对对应的标签,确定属于正负样本的待训练数据的比例是否符合预设范围,若不符合预设范围,则对标签为负样本的待训练数据进行下采样处理,或者对标签为正样本的待训练数据进行上采样处理。若符合预设范围,则基于各个待训练数据构建待训练数据集。
在一种可能的实现方式中,该装置还包括预测模块。在收发模块将参与方模型发送给联邦服务器之后,收发模块还可以接收联邦服务器发送的行为预测模型。预测模块用于:将待测特征对对应的特征信息输入行为预测模型中进行预测,得到待测特征对对应的预测标签。其中,待测特征对对应的特征信息包括待测用户的用户行为特征、待测对象的对象行为特征和待测用户与待测对象的交互特征中的任意一项或任意多项。预测标签用于确定待测用户是否会对待测对象执行预设行为。
在一种可能的实现方式中,共用的用户行为特征维度可以包括用户执行预设行为的时间和/或用户在各时段内执行预设行为的次数。相应地,共用的对象行为特征维度可以包括对象被执行预设行为的时间和/或对象在各时段内被执行预设行为的次数。
在一种可能的实现方式中,交互行为特征维度可以包括用户对对象执行预设行为的时间和/或用户在各时段内对对象执行预设行为的次数。
第三方面,本发明提供的一种计算设备,包括至少一个处理单元以及至少一个存储单元,其中,所述存储单元存储有计算机程序,当所述程序被所述处理单元执行时,使得所述处理单元执行上述第一方面任意所述的数据处理方法。
第四方面,本发明提供的一种计算机可读存储介质,其存储有可由计算设备执行的计算机程序,当所述程序在所述计算设备上运行时,使得所述计算设备执行上述第一方面任意所述的数据处理方法。
本发明提供的数据处理方法及装置,通过各个参与方设备按照预设特征分布规则对用户行为数据进行处理,得到与其他参与方设备特征分布一致的待训练数据集,使得各个参与方设备能够使用特征分布一致的待训练数据集训练得到模型结构一致的参与方模型,如此,联邦服务器能够基于各个参与方设备训练得到的模型结构一致的参与方模型训练得到行为预测模型,由于该行为预测模型结合了各个参与方设备的行为数据特征,因此能够用于对各个参与方设备中的用户的行为进行预测,行为预测模型的通用性较好,且还能够提升用户行为预测的准确率。
本发明的这些方面或其他方面在以下实施例的描述中会更加简明易懂。
为了更清楚地说明本发明实施例中的技术方案,下面将对实施例描述中所需要使用的附图作简要介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领 域的普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。
图1为本发明实施例提供的一种适用的系统架构示意图;
图2为本发明实施例中提供的一种数据处理方法的流程示意图;
图3为本发明实施例中提供的一种数据处理方式的执行流程示意图;
图4为本发明实施例提供的一种模型训练方法的交互流程示意图;
图5为本发明实施例提供的一种数据处理装置的结构示意图;
图6为本发明实施例提供的一种前端设备的结构示意图;
图7为本发明实施例提供的一种后端设备的结构示意图。
为了使本发明的目的、技术方案和优点更加清楚,下面将结合附图对本发明作进一步地详细描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其它实施例,都属于本发明保护的范围。
图1为本发明实施例提供的一种适用的系统架构示意图,如图1所示,该系统架构中可以包括联邦服务器110和至少两个参与方设备,比如参与方设备121、参与方设备122和参与方设备123。其中,联邦服务器110可以与每个参与方设备连接,比如可以通过有线方式连接,也可以通过无线方式连接,具体不作限定。
基于图1所示意的系统架构,图2为本发明实施例提供的一种数据处理方法对应的流程示意图,该方法可以应用于任一参与方设备,比如图1所示意出的参与方设备121、参与方设备122或参与方设备123,具体不作限定。如图2所示,该方法包括:
步骤201,参与方设备接收联邦服务器发送的模型训练请求。
步骤202,参与方设备根据模型训练请求获取本地存储的用户行为数据。
步骤203,参与方设备按照预设特征分布规则对用户行为数据进行处理,得到与其他参与方设备特征分布一致的待训练数据集。
步骤204,参与方设备利用待训练数据集训练得到参与方模型,并将参与方模型发送给所述联邦服务器,以使联邦服务器基于各个参与方模型联合训练得到行为预测模型。
本发明的上述实施例中,通过各个参与方设备按照预设特征分布规则对所述用户行为数据进行处理,得到与其他参与方设备特征分布一致的待训练数据集,使得各个参与方设备能够使用特征分布一致的待训练数据集训练得到模型结构一致的参与方模型,如此,联邦服务器能够基于各个参与方设备训练得到的模型结构一致的参与方模型训练得到行为预测模型,由于该行为预测模型结合了各个参与方设备的行为数据特征,因此能够用于对各个参与方设备中的用户的行为进行预测,行为预测模型的通用性较好。
在上述步骤203中,预设特征分布规则可以存在多种可能,比如:
可能一
在可能一中,预设特征分布规则可以设置为:联邦服务器110先统计各个参与方设备中的全部用户和全部对象,再使用one-hot算法对全部用户进行编码,将全部用户映射到第一向量空间,使用one-hot算法对全部对象进行编码,将全部对象映射到第二向量空间,进一步地,联邦服务器110将第一向量空间和第二向量空间同步给各个参与方设备,以使 各个参与方设备利用本地用户在第一向量空间中的映射值和本地对象在第二向量空间中的映射值构建参与方设备的待训练数据集。
举例来说,当用户行为数据为门禁数据时,若参与方设备A的用户包括用户1和用户2,参与方设备A的对象包括门1和门2,参与方设备B的用户包括用户3和用户4,参与方设备B的对象包括门3和门4,联邦服务器110通过one-hot算法将全部用户映射到第一向量空间[0 0 0 0](第一向量空间中的各个向量位依次对应用户1、用户2、用户3和用户4)中,将全部对象映射到第二向量空间[0 0 0 0](第二向量空间中的各个向量位依次对应门1、门2、门3和门4)中,则:当用户1在门1处刷卡、用户2未刷卡、用户3在门4处刷卡、用户4未刷卡时,参与方设备A构建得到的待训练数据集包括待训练数据[1 0 0 0 1 0 0 0]和待训练数据[0 1 0 0 0 0 0 0],参与方设备B构建得到的待训练数据集包括待训练数据[0 0 1 0 0 0 0 1]和待训练数据[0 0 0 1 0 0 1 0]。
由此可知,通过设置可能一中的预设特征分布规则,使得各个参与方设备中的待训练数据集能够具有相同的特征分布。然而,可能一将各个参与方设备的全部用户和全部对象映射到对应的向量空间,而不同参与方设备的待训练数据通常集中分布在各自对应的映射值范围内,比如参与方设备A的待训练数据集中在第1位、第2位和第5位,而第3位、第4位、第6位和第7位均为零,参与方设备B的待训练数据集中在第3位、第4位、第6位和第7位,而第1位、第2位和第5位均为零。因此,采用可能一会使得参与方设备的待训练数据集中包含较多的无意义数据,当使用该种形式的待训练数据集进行模型训练时,这些无意义的数据可能会对模型训练产生噪声影响,导致模型训练的效果较差。且,这些无意义的数据还会增加模型训练时间,导致系统的性能损耗较大,模型训练的效率较差。
可能二
在可能二中,为了解决可能一存在的上述问题,预设特征分布规则可以设置为:联邦服务器110使用embedding算法对每个参与方设备中的用户进行编码,以将每个参与方设备中的用户映射到各个参与方设备对应的第一公共向量空间,并使用embedding算法对每个参与方设备中的对象进行编码,以将每个参与方设备中的对象映射到各个参与方设备对应的第二公共向量空间。进一步地,联邦服务器110将第一向量空间和第二向量空间同步给各个参与方设备,以使各个参与方设备基于相同的第一公共向量空间和第二公共向量空间构建待训练数据集。
举例来说,当用户行为特征为门禁数据时,若参与方设备A的用户包括用户1和用户2,参与方设备A的对象包括门1和门2,参与方设备B的用户包括用户3和用户4,参与方设备B的对象包括门3和门4,联邦服务器110通过one-hot算法将参与方设备A的用户1和用户2(或者参与方设备B的用户3和用户4)映射到第一公共向量空间[0 0]中,将参与方设备A的对象门1和门2(或者参与方设备B的门3和门4)映射到第二公共向量空间[0 0]中。其中,第一公共向量空间的第1位在参与方设备A中用于标识用户1,在参与方设备B中用于标识用户3,第一公共向量空间的第2位在参与方设备A中用于标识用户2,在参与方设备B中用于标识用户4;相应地,第二公共向量空间的第1位在参与方设备A中用于标识门1,在参与方设备B中用于标识门3,第二公共向量空间的第2位在参与方设备A中用于标识门2,在参与方设备B中用于标识门4。如此,若用户1在门1处刷卡,用户2未刷卡,用户3在门4处刷卡,用户4未刷卡,则参与方设备A构建得 到的待训练数据集中包括待训练数据[1 0 1 0]和待训练数据[0 1 0 0],参与方设备B构建得到的待训练数据集中包括待训练数据[1 0 0 1]和待训练数据[0 1 1 0]。
由此可知,通过设置可能二中的预设特征分布规则,使得各个参与方设备中的待训练数据集能够具有相同的特征分布,且各个参与方设备的待训练数据中基本不包含无意义的数据,因此可以降低样本数据的数据量,提高模型训练的效率。然而,由于可能二将各个参与方设备的用户和对象分别映射到同一公共向量空间中,因此不同参与方设备的待训练数据中的相同位在不同参与方设备中表示不同的含义,如此,若使用具有相同形式但含义不同的待训练数据进行模型训练,会使得联邦服务器110无法提取出不同参与方设备的用户特征以及对象特征,导致模型的效果较差,可能会增大预测的误判概率。
基于此,本发明实施例提供了一种可能的数据处理方式,在该数据处理方式中,预设特征分布规则设置为各个参与方设备按照共用的用户行为特征维度和对象行为特征维度生成特征分布一致的待训练数据的规则。
图3为利用该预设特征分布规则处理得到待训练数据集的执行流程示意图,该方法适用于任一参与方设备,例如图1所示意出的参与方设备121、参与方设备122或参与方设备123。如图3所示,该方法包括:
步骤301,参与方设备按照共用的用户行为特征维度,从用户行为数据中提取出任一用户的用户行为特征。
本发明实施例中,用户行为数据可以包括设定时段内参与方设备中的每个用户对一个或多个对象执行预设行为的行为数据。举例来说,若用户行为数据为社区门禁数据,设定时段为10月上旬,参与方设备为社区A,则参与方设备的用户行为数据中可以包括社区A中的每个用户在10月上旬时在小区A的每个门处的刷卡数据。比如,若小区A中设置有门1和门2,则参与方设备的用户行为数据可以包括用户在门1处刷卡的日期和时间、用户在门2处刷卡的日期和时间。在该示例中,预设行为是指刷卡行为,一个或多个对象是指小区A中的门1和门2。再举一个例子,若用户行为数据为电商平台数据,参与方设备为书商C,设定时段为10月上旬,则参与方设备的用户行为数据中可以包括书商C的每个用户10月上旬时在书商C的平台上购买书的消费数据。比如,若书商C的平台上发布有书1和书2,则参与方设备的用户行为数据可以包括用户购买书1的日期和时间、用户购买书2的日期和时间。在该示例中,预设行为是指购买行为,一个或多个对象是指书商C的平台上发布的书1和书2。
具体实施中,参与方设备可以按照共用的用户行为特征维度,从用户行为数据中提取出任一用户在任一共用的用户行为特征维度下的特征值,然后再根据该用户在各个共用的用户行为特征维度下的特征值,构建得到该用户的用户行为特征。其中,共用的用户行为特征维度用于指示用户对各个对象的执行情况,共用的用户行为特征维度可以包括用户执行预设行为的时间和/或用户在各时段内执行所述预设行为的次数,比如可以包括设定时段内用户每次执行预设行为的时间、设定时段内用户执行预设行为的总次数、设定时段的每个时间间隔内用户执行预设行为的次数,等等。举例来说,若用户行为数据包括社区A中的每个用户在10月上旬时在小区A的门1、门2处的刷卡数据,则任一用户的用户行为特征可以包括10月上旬时该用户每次在门1或门2处刷卡的时间、10月上旬时该用户在门1和门2处刷卡的总次数、10月上旬的每周内该用户在门1和门2处刷卡的次数、10月上旬的每天内该用户在门1和门2处刷卡的次数等。
在一个示例中,为了简化待训练数据集的数据量,并提高用户行为特征的时效性,共用的用户行为特征维度可以设置为包括用户最近一次执行预设行为的时间、用户最近一天执行预设行为的次数、用户最近一周执行预设行为的次数中的任意一项或任意多项。可以理解的,该示例中的时间信息(即最近一次、最近一天和最近一周)可以由本领域技术人员根据经验进行设置,比如若时间信息为最近五次、最近两天、最近两周,则共用的用户行为特征维度为用户最近五次执行预设行为的时间、用户最近两天执行预设行为的次数、用户最近两周执行预设行为的次数。
步骤302,参与方设备按照共用的对象行为特征维度,从用户行为数据中提取出任一对象的对象行为特征。
具体实施中,参与方设备可以按照共用的对象行为特征维度,从用户行为数据中提取出任一对象在任一共用的对象行为特征维度下的特征值,然后再根据该对象在各个共用的对象行为特征维度下的特征值,构建得到该对象的对象行为特征。其中,共用的对象行为特征维度用于指示对象的被执行情况,共用的对象行为特征维度可以包括对象被执行预设行为的时间和/或对象在各时段内被执行预设行为的次数,比如可以包括设定时段内对象被执行预设行为的时间、设定时段内对象被执行预设行为的总次数、设定时段的每个时间间隔内对象被执行预设行为的次数,等等。举例来说,若用户行为数据包括社区A中的每个用户在10月上旬时在小区A的门1、门2处的刷卡数据,对象为门1,则该对象的对象行为特征可以包括10月上旬时门1被刷卡的时间、10月上旬时门1被刷卡的总次数、10月上旬的每周内门1被刷卡的次数、10月上旬的每天内门1被刷卡的次数等。
在一个示例中,为了简化待训练数据集的数据量,提高对象行为特征的时效性,共用的对象行为特征特为可以设置为包括对象最近一次被执行预设行为的时间、对象最近一天被执行预设行为的次数、对象最近一周被执行预设行为的次数中的任意一项或任意多项。可以理解的,该示例中的时间信息(即最近一次、最近一天和最近一周)可以由本领域技术人员根据经验进行设置,比如若时间信息为最近三次、最近三天、最近两周,则共用的对象行为特征可以为对象最近三次被执行预设行为的时间、对象最近三天被执行预设行为的次数、对象最近两周被执行预设行为的次数。
步骤303,参与方设备构建任一用户的用户行为特征和任一对象的对象行为特征之间的特征对,基于所述特征对,生成与其他参与方设备特征分布一致的待训练数据。
具体实施中,参与方设备可以先统计得到参与方设备中的全部用户和全部对象,然后针对任一用户和任一对象建立一个特征对。如此,参与方设备中的每个用户可以对应多个特征对,且参与方设备中的每个对象也可以对应多个特征对。举例来说,当小区A中的用户包括用户1和用户2,对象包括门1和门2时,参与方设备可以根据小区A中的全部用户和全部对象构建四个特征对,分别为:user1-item1特征对、user1-item2特征对、user2-item1特征对、user2-item2特征对。其中,user1是指用户1,user2是指用户2,item1是指对象1,item2是指对象2。如此,通过为每个用户和每个对象设置一个特征对,能够使得每个用户和每个对象对应一个待训练数据,相比于现有技术直接使用每个用户的行为数据和每个对象的行为数据训练模型来说,可以降低待训练数据集的数据量,提高模型训练的效率。
在一个示例中,针对于任一特征对,参与方设备还可以按照共用的交互行为特征维度,从用户行为数据中提取出该特征对中的用户与该特征对中的对象的交互特征。其中,共用的交互行为特征维度用于指示用户对对象的执行情况,交互行为特征维度可以包括用户对 对象执行预设行为的时间和/或用户在各时段内对对象执行所述预设行为的次数,比如可以包括设定时段内用户对对象执行预设行为的时间、设定时段内用户对对象执行预设行为的总次数、设定时段的每个时间间隔内用户对对象执行预设行为的次数,等等。举例来说,若用户行为数据包括社区A中的每个用户在10月上旬时在小区A的门1、门2处的刷卡数据,特征对中的用户和对象分别为用户1和门1,则交互特征可以包括10月上旬时用户在门1处刷卡的时间、10月上旬时用户在门1处刷卡的总次数、10月上旬的每周内用户在门1处刷卡的次数、10月上旬的每天内用户在门1处刷卡的次数等。
在一个示例中,为了简化待训练数据集的数据量,提高交互特征的时效性,共用的交互特征维度可以设置为如下任意一项或任意多项:用户最近一次对对象执行预设行为的时间、用户最近一周对对象执行预设行为的次数、用户对对象执行预设行为的次数在所有用户中的排名。可以理解的,该示例中的时间信息(即最近一次、最近一周)可以由本领域技术人员根据经验进行设置,比如若时间信息为最近三次、最近两周,则共用的交互特征维度也可以为用户最近三次对对象执行预设行为的时间、用户最近两周对对象执行预设行为的次数、用户对对象执行预设行为的次数在所有用户中的排名。
本发明实施例中,参与方设备可以采用监督式的机器学习算法执行模型训练。在监督式的机器学习算法中,每条待训练数据还需要设置对应的标签,标签可以根据行为预测模型的预测功能来设置,待训练数据对应的标签用于指示特征对中的用户和对象是否在设定时段内实现了行为预测模型的功能。
在一个示例中,参与方设备还可以根据交互特征确定特征对对应的标签,比如:若行为预测模型的功能为预测用户对对象刷卡的次数,则特征对对应的标签可以设置为设定时段内特征对中的用户对特征对中的对象刷卡的次数;若行为预测模型的功能为预测用户在某一时刻是否会在对象处刷卡,则特征对对应的标签可以基于设定时段的该时刻时特征对中的用户是否在特征对中的对象处刷卡来设置。比如若该时刻时特征对中的用户在特征对中的对象处刷卡,则可以设置特征对对应的标签为第一标签,若该时刻时特征对中的用户未在特征对中的对象处刷卡,则可以设置特征对对应的标签为第二标签。其中,第一标签和第二标签可以由本领域技术人员根据经验进行设置,比如第一标签可以设置为1,第二标签可以设置为0,或者第一标签可以设置为0,第二标签可以设置为1,具体不作限定。举例来说,若行为预测模型用于预测用户在未来时段的某一天是否会对某一对象执行预设行为,则当该特征对中的用户在设定时段(与未来时段时长相同)的某一天(与未来时段的某一天对应)对对象执行了预设行为时,该特征对对应的标签可以为第一标签,当该特征对中的用户在设定时段的某一天没有对对象执行预设行为时,该特征对对应的标签可以为第二标签。或者,若行为预测模型用于预测用户在某一时刻对对象执行预设行为,则当该特征对中的用户在设定时段的该时刻对对象执行了预设行为时,特征对对应的标签可以为第一标签,当该特征对中的用户在设定时段的该时刻没有对对象执行预设行为时,该特征对对应的标签可以为第二标签。
或者,特征对对应的标签也可以由特征向量来表示。比如,特征对对应的标签可以为基于设定时段的某一子时段内的用户行为数据提取得到的用户行为特征、对象行为特征和交互特征拼接得到的特征向量。举例来说,设定时段为第1天至第7天,若根据第1天至第7天的用户行为数据提取得到用户1刷卡的用户行为特征、门1被刷卡的对象行为特征和用户1在门1处刷卡的交互特征,则还可以根据第8天的用户行为数据提取得到第8天 中用户1在门1处刷卡的交互特征,然后将拼接第8天的交互特征作为特征对对应的标签。
本发明实施例中,通过提取特征对对应的标签,使得参与方设备能够基于监督式的机器学习算法实现模型训练,且行为预测模型更有针对性,预测效果较好。
进一步地,针对于任一特征对,参与方设备还可以对该特征对中的用户的用户行为特征、对象的对象行为特征、交互特征以及标签进行拼接,并将拼接得到的特征向量作为特征对对应的待训练数据。其中,拼接的顺序不作限定,比如可以按照用户的用户行为特征、对象的对象行为特征、交互特征、标签的顺序依次拼接,也可以按照对象的对象行为特征、用户的用户行为特征、交互特征、标签的顺序依次拼接,还可以按照交互特征、对象的对象行为特征、用户的用户行为特征、标签的顺序依次拼接,等等。
本发明实施例中,通过将用户执行预设行为的执行情况作为用户行为特征,将对象被执行预设行为的执行情况作为对象行为特征,将用户对对象执行行为的执行情况作为交互特征,可以使得不同参与方设备中用户的用户行为特征具有同一表达形式,不同参与方设备中对象的对象行为特征具有同一表达形式,不同参与方设备中用户与对象的交互特征也具有同一表达形式。如此,不同参与方设备可以根据与其他参与方设备具有同一表达形式的用户行为特征、与其他参与方设备具有同一表达形式的对象行为特征、与其他参与方设备具有同一表达形式的交互和标签构建特征分布一致的待训练数据。由于各个参与方设备的待训练数据具有相同的数据分布,且特征维度相同,因此不同参与方设备能够基于特征分布一致的待训练数据训练得到模型结构相同的参与方模型。
步骤304,参与方设备基于各个用户与各个对象构成的各个特征对对应的待训练数据,构建所述待训练数据集。
本发明实施例中,每个待训练数据对应的标签可以指示该待训练数据为正样本数据还是负样本数据。比如当待训练数据对应的标签为第一标签时,待训练数据为正样本数据,当待训练数据对应的标签为第二标签时,待训练数据为负样本数据。或者,当待训练数据的标签指示在设定时段内实现了行为预测模型的功能时,待训练数据为正样本数据。当待训练数据中的标签指示在设定时段内未能实现行为预测模型的功能时,待训练数据为负样本数据。
在一种可能的场景中,由于用户具有惯性思维,因此用户可能会经常对某一对象执行预设行为,而很少对其它的对象执行预设行为。如此,参与方设备构建得到的各个待训练数据中会包含较少的正样本数据和较多的负样本数据。比如若小区中的门较多,而用户习惯性地在小区的某一个门处刷卡,而很少在其它门处刷卡,因此在基于用户与小区中的各个门构建得到各个待训练数据后,各个待训练数据中的正样本数据的数量很少,而负样本数据的数量很多。如此,若参与方设备直接使用各个待训练数据进行模型训练,则数量较多的负样本数据可能会带偏模型参数,导致训练出的行为预测模型无法准确预测用户对对象执行预设行为的可能性,行为预测模型的效果较差。
为了解决上述问题,在一种可能的实现方式中,参与方设备在基于参与方设备中的全部用户与全部对象构建得到各个待训练数据后,可以先根据各个特征对对应的标签,确定出待训练数据集中的正样本数据和负样本数据,然后判断属于正负样本的待训练数据的比例是否符合预设范围,若不符合预设范围,则可以对负样本数据进行下采样处理,或者可以对正样本数据进行上采样处理,比如采用下采样方法来减少负样本数据的数量和权重,或者使用上采样方法来增多待训练数据中正样本数据的数量或权重。相应地,若符合预设 范围,则可以基于各个待训练数据构建待训练数据集。
下面分别介绍几种可能的上采样方法和下采样方法。
上采样方法一:参与方设备可以先从全部用户与全部对象对应的待训练数据中获取全部或部分正样本数据,然后对这全部或部分正样本数据进行复制,以通过复制的方式增多待训练数据中正样本数据的数量。
上采样方法二:参与方设备可以先从全部用户与全部对象对应的待训练数据中获取全部的正样本数据,然后每次从全部的正样本数据(或上次选取遗留的正样本数据)中选取至少两个正样本数据,拼接至少两个正样本数据中的不同部分得到一个新的正样本数据。比如,若选取了两个正样本数据,则可以将第一个正样本数据的前半部分和第二个正样本数据的后半部分拼接为一个新的正样本数据,或者可以将第一个正样本数据的后1/3部分和第二个正样本数据的前2/3部分拼接为一个新的正样本数据,具体不作限定。
上采样方法三:参与方设备可以先从全部用户与全部对象对应的待训练数据中获取全部或部分正样本数据,然后增大其中每个正样本数据在损失函数中的权重,不同正样本数据被增大的权重可以相同,也可以不同,不作限定。如此,参与方设备在使用正样本数据和负样本数据训练模型时,由于这些正样本数据的权重较大,因此可以降低负样本数据带偏模型参数的能力,降低模型训练的偏差,提高模型的效果。
下采样方法一:参与方设备可以先从全部用户与全部对象对应的待训练数据中获取全部的负样本数据,然后随机从全部的负样本数据中选取部分负样本数据进行删除,以通过随机删除的方式减少待训练数据中负样本数据的数量。
下采样方法二:参与方设备可以先从全部用户与全部对象对应的待训练数据中获取全部的负样本数据,然后计算得到每个负样本数据与其它负样本数据的相似度,若相似度小于预设相似度阈值,则删除该负样本数据,若相似度大于或等于预设相似度阈值,则保留该负样本数据。通过将与其它负样本数据的相似度较小的负样本删除,可以基于较为相似的负样本数据执行模型训练,从而提高行为预测模型识别不同待预测数据的能力,提高预测效果。
具体实施中,针对于任一负样本数据,参与方设备可以先计算该负样本数据与任一其它负样本数据的相似度,然后将该负样本数据与所有其它负待训练数据的相似度的平均值或加权平均值作为该负样本数据与其它负样本数据的相似度。
下采样方法三:参与方设备可以先从全部用户与全部对象对应的待训练数据中获取全部或部分负样本数据,然后减小其中每个负样本数据在损失函数中的权重,不同负样本数据被减小的权重可以相同,也可以不同,不作限定。如此,参与方设备在使用正样本数据和负样本数据训练模型时,由于这些负样本数据的权重较小,因此可以降低负样本数据带偏模型参数的能力,降低模型训练的偏差,提高模型的效果。
本发明实施例中,通过实验发现,若采用上采样方法一中的复制方式和/或上采样方法二中的拼接方式增加正样本数据的数量,或者,若采用下采样方法一中的删除方式和/或下采样方法二中的相似度删除方式降低负样本数据的数量,则在将待训练数据中正样本数据和负样本数据的数量比例调整至1:3时,模型训练的效果较好。相应地,若采用上采样方法三中的加权方式增加正样本数据的权重,或者,若采用下采样方法三中的降权方式降低负样本数据的权重,则在将待训练数据中正样本数据的权重和负样本数据的权重比例调整至20:1时,模型训练的效果较好。
在步骤204中,参与方设备可以先将全部的待训练数据划分为训练数据、验证数据和测试数据,训练数据用于参与方设备训练得到参与方模型,验证数据用于参与方设备验证参与方模型的效果,测试数据用于在模型训练结束后,联邦服务器110验证行为预测模型的效果。
具体实施中,参与方设备可以将训练得到的参与方模型的模型参数上报给联邦服务器110,参与方模型的模型参数用于联邦服务器110根据各个参与方模型的模型参数得到综合模型参数,若确定满足模型训练的结束条件,则根据综合模型参数得到行为预测模型,若确定不满足模型训练的结束条件,则将综合模型参数下发给各个参与方设备,以联合各个参与方设备循环执行步骤201~步骤204。
作为一种示例,参与方设备可以仅将参与方模型的模型参数上报给联邦服务器110。如此,在接收到各个参与方模型的模型参数后,联邦服务器110可以基于各个模型参数计算得到平均模型参数,并可以将平均模型参数确定为本次训练的综合模型参数。作为另一种示例,参与方设备可以同时将参与方模型的模型参数和损失函数发送给联邦服务器110,如此,联邦服务器110在接收到各个模型参数和损失函数后,可以先根据各个损失函数确定各个模型参数的权重,再使用加权平均的方式对各个模型参数进行计算,得到综合模型参数。其中,若模型参数对应的损失函数越小,说明参与方模型的效果越好,因此可以为该模型参数分配较大的权重,相应地,若模型参数对应的损失函数越大,说明参与方模型的效果越差,因此可以为该模型参数分配较小的权重。具体实施中,可以先按照由小到大的顺序对各个损失函数进行排序,若损失函数的排序越靠后,则可以设置该损失函数对应的模型参数的权重越小,若损失函数的排序越靠前,则可以设置该损失函数对应的模型参数的权重越大。举例来说,若参与方设备121~参与方设备123的损失函数分别为0.05、0.30、0.15,说明参与方设备121~参与方设备123对应的参与方模型的效果排名为:参与方设备122对应的参与方模型>参与方设备123对应的参与方模型>参与方设备121对应的参与方模型,因此,联邦服务器110可以设置参与方设备121~参与方设备123对应的模型参数的权重分别为10%、60%、30%。
本发明实施例中,模型训练的结束条件可以包括以下任意一项或任意多项:本次训练的综合模型参数收敛、已执行训练的次数大于或等于预设次数、已执行训练的时长大于或等于预设训练时长,具体可以由本领域技术人员根据经验进行设置,具体不作限定。具体实施中,若模型训练的结束条件为已执行训练的次数大于或等于5次,则当参与方设备依次训练了5次参与方模型(即第5次训练结束)后,联邦服务器110可以确定第5次训练满足模型训练的结束条件。或者,若模型训练的结束条件为已执行训练的时长大于或等于5分钟,则从联邦服务器110下发模型训练请求开始至执行到第5分钟时(若此时正在执行第3次训练),联邦服务器110可以确定第3次训练满足模型训练的结束条件。相应的,若模型训练的结束条件为本次训练的综合模型参数收敛,则针对于本次训练,联邦服务器110还可以根据本次训练中各参与方设备发送的损失函数计算得到本次训练的综合损失函数,若确定本次训练的综合损失函数处于收敛状态(比如本次训练的综合损失函数小于或等于某一阈值),则可以确定本次训练满足模型训练的结束条件,否则确定本次训练不满足模型训练的结束条件。
进一步地,若本次训练满足模型训练的结束条件,则联邦服务器110可以使用本次训练的综合模型参数构建得到行为预测模型,若本次训练不满足模型训练的结束条件,则联 邦服务器110可以将本次训练的综合模型参数下发给各个参与方设备,以使各个参与方设备基于本次训练的综合模型参数,使用各个参与方设备的待训练数据集重新执行下一次训练,直至满足模型训练的结束条件为止。
在一个示例中,联邦服务器110构建得到行为预测模型后,还可以将行为预测模型下发给各个参与方设备。如此,任一参与方设备接收到行为预测模型后,可以将待测特征对对应的特征信息输入行为预测模型中进行预测,得到待测特征对对应的预测标签。其中,待测特征对对应的特征信息可以包括待测用户的用户行为特征、待测对象的对象行为特征和待测用户与待测对象的交互特征中的任意一项或任意多项,预测标签用于确定待测用户是否会对待测对象执行预设行为。
本发明实施例中,通过联合各个参与方设备中的用户行为数据构建得到行为预测模型,使得行为预测模型能够用于对任一参与方设备中的用户的行为进行预测,行为预测模型具有较好的通用性。
下面从联邦服务器与各个参与方设备的交互角度描述本发明实施例中的数据处理方法。
图4为本发明实施例提供的一种模型训练的整体流程示意图,该方法包括:
步骤401,联邦服务器110向各个参与方设备下发模型训练请求,模型训练请求中携带有初始模型参数。
步骤402,任一参与方设备接收到联邦服务器下发的模型训练请求后,获取本地存储的用户行为数据,按照预设特征分布规则对用户行为数据进行处理,得到与其他参与方设备特征分布一致的待训练数据集。
步骤403,任一参与方设备基于初始模型参数,利用待训练数据集训练得到与其他参与方设备模型结构一致的参与方模型。
步骤404,任一参与方设备将参与方模型的模型参数上报给联邦服务器。
步骤405,联邦服务器接收到各个参与方设备上报的参与方模型的模型参数后,根据各个参与方模型的模型参数得到综合模型参数。
步骤406,联邦服务器确定是否满足模型训练的结束条件,若是,则执行步骤407,若否,则执行步骤408。
步骤407,联邦服务器根据综合模型参数构建得到行为预测模型。
步骤408,联邦服务器将综合模型参数下发给各个参与方设备。
步骤409,任一参与方设备接收到联邦服务器下发的综合模型参数后,使用综合模型参数更新本地存储的初始模型参数,并执行步骤403。
本发明的上述实施例中,参与方设备接收联邦服务器发送的模型训练请求,根据所述模型训练请求获取本地存储的用户行为数据,按照预设特征分布规则对所述用户行为数据进行处理,得到与其他参与方设备特征分布一致的待训练数据集,利用所述待训练数据集训练得到参与方设备模型,并将所述参与方设备模型发送给所述联邦服务器,以便于所述联邦服务器基于各个参与方设备模型联合训练得到行为预测模型。本发明实施例中,通过各个参与方设备按照预设特征分布规则对所述用户行为数据进行处理,得到与其他参与方设备特征分布一致的待训练数据集,使得各个参与方设备能够使用特征分布一致的待训练数据集训练得到模型结构一致的参与方设备模型,如此,联邦服务器能够基于各个参与方设备训练得到的模型结构一致的参与方设备模型训练得到行为预测模型,由于该行为预测 模型结合了各个参与方设备的行为数据特征,因此能够用于对各个参与方设备中的用户的行为进行预测,行为预测模型的通用性较好。
针对上述方法流程,本发明实施例还提供一种数据处理装置,该装置的具体内容可以参照上述方法实施。
图5为本发明实施例提供的一种数据处理装置的结构示意图,如图5所示,该装置包括:
收发模块501,用于接收联邦服务器发送的模型训练请求;
获取模块502,用于根据所述模型训练请求获取本地存储的用户行为数据;
处理模块503,用于按照预设特征分布规则对所述用户行为数据进行处理,得到与其他参与方设备特征分布一致的待训练数据集;
训练模块504,用于利用所述待训练数据集训练得到参与方模型,并将所述参与方模型发送给所述联邦服务器,所述联邦服务器用于基于各个参与方模型联合训练得到行为预测模型。
可选地,所述预设特征分布规则为按照共用的用户行为特征维度和对象行为特征维度生成特征分布一致的待训练数据的规则。在这种情况下,所述处理模块503具体用于:先按照所述共用的用户行为特征维度,从所述用户行为数据中提取出任一用户的用户行为特征,再按照所述共用的对象行为特征维度,从所述用户行为数据中提取出任一对象的对象行为特征,之后构建任一用户的用户行为特征和任一对象的对象行为特征之间的特征对,基于所述特征对,生成与其他参与方设备特征分布一致的待训练数据,最后基于各个用户与各个对象构成的各个特征对对应的待训练数据,构建所述待训练数据集。
可选地,所述处理模块503具体用于:先从所述用户行为数据中提取出所述用户在任一共用的用户行为特征维度下的特征值,再根据所述用户在各个共用的用户行为特征维度下的特征值,构建得到所述用户的用户行为特征。以及,从所述用户行为数据中提取出所述对象在任一共用的对象行为特征维度下的特征值,根据所述对象在各个共用的对象行为特征维度下的特征值,构建得到所述对象的对象行为特征。
可选地,所述处理模块503具体用于:先按照共用的交互行为特征维度,从所述用户行为数据中提取出所述用户与所述对象的交互特征,再根据所述用户与所述对象的交互特征,确定所述特征对对应的标签,之后将拼接所述用户的用户行为特征、所述对象的对象行为特征、所述交互特征及所述标签得到的特征向量作为所述特征对对应的待训练数据。
可选地,所述处理模块503具体用于:根据所述各个特征对对应的标签,确定属于正负样本的待训练数据的比例是否符合预设范围,若不符合预设范围,则对标签为负样本的待训练数据进行下采样处理,或者对标签为正样本的待训练数据进行上采样处理。若符合预设范围,则基于所述各个待训练数据构建所述待训练数据集。
可选地,所述装置还包括预测模块505。在所述收发模块501将所述参与方模型发送给所述联邦服务器之后,所述收发模块501还接收所述联邦服务器发送的所述行为预测模型。所述预测模块505将待测特征对对应的特征信息输入所述行为预测模型中进行预测,得到所述待测特征对对应的预测标签。其中,所述待测特征对对应的特征信息包括待测用户的用户行为特征、待测对象的对象行为特征和所述待测用户与所述待测对象的交互特征中的任意一项或任意多项。所述预测标签用于确定所述待测用户是否会对所述待测对象执行预设行为。
可选地,所述共用的用户行为特征维度可以包括用户执行预设行为的时间和/或用户在 各时段内执行所述预设行为的次数。
可选地,所述共用的对象行为特征维度可以包括对象被执行所述预设行为的时间和/或对象在各时段内被执行所述预设行为的次数。
可选地,所述交互行为特征维度可以包括用户对对象执行预设行为的时间和/或用户在各时段内对对象执行所述预设行为的次数。
从上述内容可以看出:本发明的上述实施例中,参与方设备接收联邦服务器发送的模型训练请求,根据所述模型训练请求获取本地存储的用户行为数据,按照预设特征分布规则对所述用户行为数据进行处理,得到与其他参与方设备特征分布一致的待训练数据集,利用所述待训练数据集训练得到参与方模型,并将所述参与方模型发送给所述联邦服务器,以便于所述联邦服务器基于各个参与方模型联合训练得到行为预测模型。本发明实施例中,通过各个参与方设备按照预设特征分布规则对所述用户行为数据进行处理,得到与其他参与方设备特征分布一致的待训练数据集,使得各个参与方设备能够使用特征分布一致的待训练数据集训练得到模型结构一致的参与方模型,如此,联邦服务器能够基于各个参与方设备训练得到的模型结构一致的参与方模型训练得到行为预测模型,由于该行为预测模型结合了各个参与方设备的行为数据特征,因此能够用于对各个参与方设备中的用户的行为进行预测,行为预测模型的通用性较好。
基于同一发明构思,本发明实施例还提供了一种计算设备,包括至少一个处理单元以及至少一个存储单元,其中,所述存储单元存储有计算机程序,当所述程序被所述处理单元执行时,使得所述处理单元执行图2至图4任意所述的方法。
基于同一发明构思,本发明实施例还提供了一种计算机可读存储介质,其存储有可由计算设备执行的计算机程序,当所述程序在所述计算设备上运行时,使得所述计算设备执行图2至图4任意所述的方法。
基于同一发明构思,本发明实施例提供了一种终端设备,如图6所示,包括至少一个处理器601,以及与至少一个处理器连接的存储器602,本发明实施例中不限定处理器601与存储器602之间的具体连接介质,图6中处理器601和存储器602之间通过总线连接为例。总线可以分为地址总线、数据总线、控制总线等。
在本发明实施例中,存储器602存储有可被至少一个处理器601执行的指令,至少一个处理器601通过执行存储器602存储的指令,可以执行前述的数据处理方法中所包括的步骤。
其中,处理器601是终端设备的控制中心,可以利用各种接口和线路连接终端设备的各个部分,通过运行或执行存储在存储器602内的指令以及调用存储在存储器602内的数据,从而实现数据处理。可选的,处理器601可包括一个或多个处理单元,处理器601可集成应用处理器和调制解调处理器,其中,应用处理器主要处理操作系统、用户界面和应用程序等,调制解调处理器主要处理下发指令。可以理解的是,上述调制解调处理器也可以不集成到处理器601中。在一些实施例中,处理器601和存储器602可以在同一芯片上实现,在一些实施例中,它们也可以在独立的芯片上分别实现。
处理器601可以是通用处理器,例如中央处理器(CPU)、数字信号处理器、专用集成电路(Application Specific Integrated Circuit,ASIC)、现场可编程门阵列或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件,可以实现或者执行本发明实施例中公开的各方法、步骤及逻辑框图。通用处理器可以是微处理器或者任何常规的处理器等。 结合数据处理实施例所公开的方法的步骤可以直接体现为硬件处理器执行完成,或者用处理器中的硬件及软件模块组合执行完成。
存储器602作为一种非易失性计算机可读存储介质,可用于存储非易失性软件程序、非易失性计算机可执行程序以及模块。存储器602可以包括至少一种类型的存储介质,例如可以包括闪存、硬盘、多媒体卡、卡型存储器、随机访问存储器(Random Access Memory,RAM)、静态随机访问存储器(Static Random Access Memory,SRAM)、可编程只读存储器(Programmable Read Only Memory,PROM)、只读存储器(Read Only Memory,ROM)、带电可擦除可编程只读存储器(Electrically Erasable Programmable Read-Only Memory,EEPROM)、磁性存储器、磁盘、光盘等等。存储器602是能够用于携带或存储具有指令或数据结构形式的期望的程序代码并能够由计算机存取的任何其他介质,但不限于此。本发明实施例中的存储器602还可以是电路或者其它任意能够实现存储功能的装置,用于存储程序指令和/或数据。
基于同一发明构思,本发明实施例提供了一种后端设备,如图7所示,包括至少一个处理器701,以及与至少一个处理器连接的存储器702,本发明实施例中不限定处理器701与存储器702之间的具体连接介质,图7中处理器701和存储器702之间通过总线连接为例。总线可以分为地址总线、数据总线、控制总线等。
在本发明实施例中,存储器702存储有可被至少一个处理器701执行的指令,至少一个处理器701通过执行存储器702存储的指令,可以执行前述的数据处理方法中所包括的步骤。
其中,处理器701是后端设备的控制中心,可以利用各种接口和线路连接后端设备的各个部分,通过运行或执行存储在存储器702内的指令以及调用存储在存储器702内的数据,从而实现数据处理。可选的,处理器701可包括一个或多个处理单元,处理器701可集成应用处理器和调制解调处理器,其中,应用处理器主要处理操作系统、应用程序等,调制解调处理器主要对接收到的指令进行解析以及对接收到的结果进行解析。可以理解的是,上述调制解调处理器也可以不集成到处理器701中。在一些实施例中,处理器701和存储器702可以在同一芯片上实现,在一些实施例中,它们也可以在独立的芯片上分别实现。
处理器701可以是通用处理器,例如中央处理器(CPU)、数字信号处理器、专用集成电路(Application Specific Integrated Circuit,ASIC)、现场可编程门阵列或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件,可以实现或者执行本发明实施例中公开的各方法、步骤及逻辑框图。通用处理器可以是微处理器或者任何常规的处理器等。结合数据处理实施例所公开的方法的步骤可以直接体现为硬件处理器执行完成,或者用处理器中的硬件及软件模块组合执行完成。
存储器702作为一种非易失性计算机可读存储介质,可用于存储非易失性软件程序、非易失性计算机可执行程序以及模块。存储器702可以包括至少一种类型的存储介质,例如可以包括闪存、硬盘、多媒体卡、卡型存储器、随机访问存储器(Random Access Memory,RAM)、静态随机访问存储器(Static Random Access Memory,SRAM)、可编程只读存储器(Programmable Read Only Memory,PROM)、只读存储器(Read Only Memory,ROM)、带电可擦除可编程只读存储器(Electrically Erasable Programmable Read-Only Memory,EEPROM)、磁性存储器、磁盘、光盘等等。存储器702是能够用于携带或存储具有指令 或数据结构形式的期望的程序代码并能够由计算机存取的任何其他介质,但不限于此。本发明实施例中的存储器702还可以是电路或者其它任意能够实现存储功能的装置,用于存储程序指令和/或数据。
本领域内的技术人员应明白,本发明的实施例可提供为方法、或计算机程序产品。因此,本发明可采用完全硬件实施例、完全软件实施例、或结合软件和硬件方面的实施例的形式。而且,本发明可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。
本发明是参照根据本发明实施例的方法、设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。
这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。
这些计算机程序指令也可装载到计算机或其他可编程数据处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。
尽管已描述了本发明的优选实施例,但本领域内的技术人员一旦得知了基本创造性概念,则可对这些实施例作出另外的变更和修改。所以,所附权利要求意欲解释为包括优选实施例以及落入本发明范围的所有变更和修改。
显然,本领域的技术人员可以对本发明进行各种改动和变型而不脱离本发明的精神和范围。这样,倘若本发明的这些修改和变型属于本发明权利要求及其等同技术的范围之内,则本发明也意图包含这些改动和变型在内。
Claims (20)
- 一种数据处理方法,其特征在于,应用于参与方设备,所述方法包括:接收联邦服务器发送的模型训练请求;根据所述模型训练请求获取本地存储的用户行为数据;按照预设特征分布规则对所述用户行为数据进行处理,得到与其他参与方设备特征分布一致的待训练数据集;利用所述待训练数据集训练得到参与方模型,并将所述参与方模型发送给所述联邦服务器,所述联邦服务器用于基于各个参与方模型联合训练得到行为预测模型。
- 根据权利要求1所述的方法,其特征在于,所述预设特征分布规则为按照共用的用户行为特征维度和对象行为特征维度生成特征分布一致的待训练数据的规则;所述按照预设特征分布规则对所述用户行为数据进行处理,得到与其他参与方设备特征分布一致的训练数据集,包括:按照所述共用的用户行为特征维度,从所述用户行为数据中提取出任一用户的用户行为特征;按照所述共用的对象行为特征维度,从所述用户行为数据中提取出任一对象的对象行为特征;构建任一用户的用户行为特征和任一对象的对象行为特征之间的特征对,基于所述特征对,生成与其他参与方设备特征分布一致的待训练数据;基于各个用户与各个对象构成的各个特征对对应的待训练数据,构建所述待训练数据集。
- 根据权利要求2所述的方法,其特征在于,所述按照所述共用的用户行为特征维度,从所述用户行为数据中提取出任一用户的用户行为特征,包括:从所述用户行为数据中提取出所述用户在任一共用的用户行为特征维度下的特征值,根据所述用户在各个共用的用户行为特征维度下的特征值,构建得到所述用户的用户行为特征;所述按照所述共用的对象行为特征维度,从所述用户行为数据中提取出任一对象的对象行为特征,包括:从所述用户行为数据中提取出所述对象在任一共用的对象行为特征维度下的特征值,根据所述对象在各个共用的对象行为特征维度下的特征值,构建得到所述对象的对象行为特征。
- 根据权利要求2所述的方法,其特征在于,所述基于所述特征对,生成与其他参与方设备特征分布一致的待训练数据,包括:按照共用的交互行为特征维度,从所述用户行为数据中提取出所述用户与所述对象的交互特征;根据所述用户与所述对象的交互特征,确定所述特征对对应的标签;将拼接所述用户的用户行为特征、所述对象的对象行为特征、所述交互特征及所述标签得到的特征向量作为所述特征对对应的待训练数据。
- 根据权利要求4所述的方法,其特征在于,所述根据所述各个特征对对应的待训练数据,构建所述待训练数据集,包括:根据所述各个特征对对应的标签,确定属于正负样本的待训练数据的比例是否符合预设范围;若不符合预设范围,则对标签为负样本的待训练数据进行下采样处理,或者对标签为正样本的待训练数据进行上采样处理;若符合预设范围,则基于所述各个待训练数据构建所述待训练数据集。
- 根据权利要求5所述的方法,其特征在于,所述对标签为负样本的待训练数据进行下采样处理,包括:减少标签为负样本的所述待训练数据的数量和权重;所述对标签为正样本的待训练数据进行上采样处理,包括:增加标签为正样本的所述待训练数据的数量或权重。
- 根据权利要求1至6中任一项所述的方法,其特征在于,所述将所述参与方模型发送给所述联邦服务器之后,还包括:接收所述联邦服务器发送的所述行为预测模型;将待测特征对对应的特征信息输入所述行为预测模型中进行预测,得到所述待测特征对对应的预测标签;所述待测特征对对应的特征信息包括待测用户的用户行为特征、待测对象的对象行为特征和所述待测用户与所述待测对象的交互特征中的任意一项或任意多项;所述预测标签用于确定所述待测用户是否会对所述待测对象执行预设行为。
- 根据权利要求2至6中任一项所述的方法,其特征在于,所述共用的用户行为特征维度包括用户执行预设行为的时间和/或用户在各时段内执行所述预设行为的次数;所述共用的对象行为特征维度包括对象被执行所述预设行为的时间和/或对象在各时段内被执行所述预设行为的次数。
- 根据权利要求4至6中任一项所述的方法,其特征在于,所述交互行为特征维度包括用户对对象执行预设行为的时间和/或用户在各时段内对对象执行所述预设行为的次数。
- 一种数据处理装置,其特征在于,所述装置包括:收发模块,用于接收联邦服务器发送的模型训练请求;获取模块,用于根据所述模型训练请求获取本地存储的用户行为数据;处理模块,用于按照预设特征分布规则对所述用户行为数据进行处理,得到与其他参与方设备特征分布一致的待训练数据集;训练模块,用于利用所述待训练数据集训练得到参与方模型,并将所述参与方模型发送给所述联邦服务器,所述联邦服务器用于基于各个参与方模型联合训练得到行为预测模型。
- 根据权利要求10所述的装置,其特征在于,所述预设特征分布规则为按照共用的用户行为特征维度和对象行为特征维度生成特征分布一致的待训练数据的规则;所述处理模块具体用于:按照所述共用的用户行为特征维度,从所述用户行为数据中提取出任一用户的用户行为特征;按照所述共用的对象行为特征维度,从所述用户行为数据中提取出任一对象的对象行为特征;构建任一用户的用户行为特征和任一对象的对象行为特征之间的特征对,基于所述特 征对,生成与其他参与方设备特征分布一致的待训练数据;基于各个用户与各个对象构成的各个特征对对应的待训练数据,构建所述待训练数据集。
- 根据权利要求11所述的装置,其特征在于,所述处理模块具体用于:从所述用户行为数据中提取出所述用户在任一共用的用户行为特征维度下的特征值,根据所述用户在各个共用的用户行为特征维度下的特征值,构建得到所述用户的用户行为特征;所述按照所述共用的对象行为特征维度,从所述用户行为数据中提取出任一对象的对象行为特征,包括:从所述用户行为数据中提取出所述对象在任一共用的对象行为特征维度下的特征值,根据所述对象在各个共用的对象行为特征维度下的特征值,构建得到所述对象的对象行为特征。
- 根据权利要求11所述的装置,其特征在于,所述处理模块具体用于:按照共用的交互行为特征维度,从所述用户行为数据中提取出所述用户与所述对象的交互特征;根据所述用户与所述对象的交互特征,确定所述特征对对应的标签;将拼接所述用户的用户行为特征、所述对象的对象行为特征、所述交互特征及所述标签得到的特征向量作为所述特征对对应的待训练数据。
- 根据权利要求13所述的装置,其特征在于,所述处理模块具体用于:根据所述各个特征对对应的标签,确定属于正负样本的待训练数据的比例是否符合预设范围;若不符合预设范围,则对标签为负样本的待训练数据进行下采样处理,或者对标签为正样本的待训练数据进行上采样处理;若符合预设范围,则基于所述各个待训练数据构建所述待训练数据集。
- 根据权利要求14所述的装置,其特征在于,所述处理模块具体用于:减少标签为负样本的所述待训练数据的数量和权重;或者,增加标签为正样本的所述待训练数据的数量或权重。
- 根据权利要求10至15中任一项所述的装置,其特征在于,所述装置还包括预测模块;在所述收发模块将所述参与方模型发送给所述联邦服务器之后:所述收发模块还用于:接收所述联邦服务器发送的所述行为预测模型;所述预测模块用于:将待测特征对对应的特征信息输入所述行为预测模型中进行预测,得到所述待测特征对对应的预测标签;其中,所述待测特征对对应的特征信息包括待测用户的用户行为特征、待测对象的对象行为特征和所述待测用户与所述待测对象的交互特征中的任意一项或任意多项;所述预测标签用于确定所述待测用户是否会对所述待测对象执行预设行为。
- 根据权利要求11至15中任一项所述的装置,其特征在于,所述共用的用户行为特征维度包括用户执行预设行为的时间和/或用户在各时段内执行所述预设行为的次数;所述共用的对象行为特征维度包括对象被执行所述预设行为的时间和/或对象在各时段内被执行所述预设行为的次数。
- 根据权利要求13至15中任一项所述的装置,其特征在于,所述交互行为特征维 度包括用户对对象执行预设行为的时间和/或用户在各时段内对对象执行所述预设行为的次数。
- 一种计算设备,其特征在于,包括至少一个处理单元以及至少一个存储单元,其中,所述存储单元存储有计算机程序,当所述程序被所述处理单元执行时,使得所述处理单元执行权利要求1~9任一权利要求所述的方法。
- 一种计算机可读存储介质,其特征在于,其存储有可由计算设备执行的计算机程序,当所述程序在所述计算设备上运行时,使得所述计算设备执行权利要求1~9任一权利要求所述的方法。
Applications Claiming Priority (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202010071525.X | 2020-01-21 | ||
| CN202010071525.XA CN111275491B (zh) | 2020-01-21 | 2020-01-21 | 一种数据处理方法及装置 |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| WO2021147486A1 true WO2021147486A1 (zh) | 2021-07-29 |
Family
ID=71003365
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| PCT/CN2020/129123 Ceased WO2021147486A1 (zh) | 2020-01-21 | 2020-11-16 | 一种数据处理方法及装置 |
Country Status (2)
| Country | Link |
|---|---|
| CN (1) | CN111275491B (zh) |
| WO (1) | WO2021147486A1 (zh) |
Cited By (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN114429190A (zh) * | 2022-01-28 | 2022-05-03 | 上海富数科技有限公司 | 基于联邦学习的模型构建方法、授信评估方法及装置 |
| CN115130548A (zh) * | 2022-05-24 | 2022-09-30 | 腾讯科技(深圳)有限公司 | 数据处理方法和装置、存储介质及电子设备 |
| CN116684420A (zh) * | 2023-05-22 | 2023-09-01 | 中山大学 | 集群资源调度方法、装置、集群系统和可读存储介质 |
| CN116805251A (zh) * | 2022-03-15 | 2023-09-26 | 腾讯科技(深圳)有限公司 | 数据预测方法、装置、计算机设备和存储介质 |
| CN118447268A (zh) * | 2023-09-22 | 2024-08-06 | 荣耀终端有限公司 | 身份识别方法、电子设备及存储介质 |
Families Citing this family (15)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN111275491B (zh) * | 2020-01-21 | 2023-12-26 | 深圳前海微众银行股份有限公司 | 一种数据处理方法及装置 |
| CN111612168B (zh) * | 2020-06-30 | 2021-06-15 | 腾讯科技(深圳)有限公司 | 一种机器学习任务的管理方法以及相关装置 |
| CN111833179A (zh) * | 2020-07-17 | 2020-10-27 | 浙江网商银行股份有限公司 | 资源分配平台、资源分配方法及装置 |
| CN111833180A (zh) * | 2020-07-17 | 2020-10-27 | 浙江网商银行股份有限公司 | 一种资源分配方法以及装置 |
| CN111898769A (zh) * | 2020-08-17 | 2020-11-06 | 中国银行股份有限公司 | 基于横向联邦学习的建立用户行为周期模型的方法及系统 |
| CN112052915B (zh) * | 2020-09-29 | 2024-02-13 | 中国银行股份有限公司 | 一种数据训练方法、装置、设备及存储介质 |
| CN112396189B (zh) * | 2020-11-27 | 2023-09-01 | 中国银联股份有限公司 | 一种多方构建联邦学习模型的方法及装置 |
| CN114580697A (zh) * | 2020-12-02 | 2022-06-03 | 新智数字科技有限公司 | 洗涤塔预测性维护方法及装置 |
| CN112686388B (zh) * | 2020-12-10 | 2024-12-03 | 广州广电运通信息科技有限公司 | 一种在联邦学习场景下的数据集划分方法及系统 |
| CN114638449A (zh) * | 2020-12-16 | 2022-06-17 | 新智数字科技有限公司 | 一种售电方案确定方法、装置、可读介质及电子设备 |
| CN113158223B (zh) * | 2021-01-27 | 2024-08-27 | 深圳前海微众银行股份有限公司 | 基于状态转移核优化的数据处理方法、装置、设备及介质 |
| CN113570126B (zh) * | 2021-07-15 | 2024-07-23 | 远景智能国际私人投资有限公司 | 光伏发电站的发电功率预测方法、装置及系统 |
| CN113283185B (zh) * | 2021-07-23 | 2021-11-12 | 平安科技(深圳)有限公司 | 联邦模型训练、客户画像方法、装置、设备及介质 |
| CN113902473B (zh) * | 2021-09-29 | 2024-06-14 | 支付宝(杭州)信息技术有限公司 | 业务预测系统的训练方法及装置 |
| CN115687926A (zh) * | 2022-11-03 | 2023-02-03 | 中国工商银行股份有限公司 | 样本数据的处理方法、相关方法、装置、服务器和介质 |
Citations (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| WO2018052987A1 (en) * | 2016-09-13 | 2018-03-22 | Ohio State Innovation Foundation | Systems and methods for modeling neural architecture |
| CN110309923A (zh) * | 2019-07-03 | 2019-10-08 | 深圳前海微众银行股份有限公司 | 横向联邦学习方法、装置、设备及计算机存储介质 |
| CN110598870A (zh) * | 2019-09-02 | 2019-12-20 | 深圳前海微众银行股份有限公司 | 一种联邦学习方法及装置 |
| CN110633806A (zh) * | 2019-10-21 | 2019-12-31 | 深圳前海微众银行股份有限公司 | 纵向联邦学习系统优化方法、装置、设备及可读存储介质 |
| CN111275491A (zh) * | 2020-01-21 | 2020-06-12 | 深圳前海微众银行股份有限公司 | 一种数据处理方法及装置 |
-
2020
- 2020-01-21 CN CN202010071525.XA patent/CN111275491B/zh active Active
- 2020-11-16 WO PCT/CN2020/129123 patent/WO2021147486A1/zh not_active Ceased
Patent Citations (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| WO2018052987A1 (en) * | 2016-09-13 | 2018-03-22 | Ohio State Innovation Foundation | Systems and methods for modeling neural architecture |
| CN110309923A (zh) * | 2019-07-03 | 2019-10-08 | 深圳前海微众银行股份有限公司 | 横向联邦学习方法、装置、设备及计算机存储介质 |
| CN110598870A (zh) * | 2019-09-02 | 2019-12-20 | 深圳前海微众银行股份有限公司 | 一种联邦学习方法及装置 |
| CN110633806A (zh) * | 2019-10-21 | 2019-12-31 | 深圳前海微众银行股份有限公司 | 纵向联邦学习系统优化方法、装置、设备及可读存储介质 |
| CN111275491A (zh) * | 2020-01-21 | 2020-06-12 | 深圳前海微众银行股份有限公司 | 一种数据处理方法及装置 |
Cited By (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN114429190A (zh) * | 2022-01-28 | 2022-05-03 | 上海富数科技有限公司 | 基于联邦学习的模型构建方法、授信评估方法及装置 |
| CN116805251A (zh) * | 2022-03-15 | 2023-09-26 | 腾讯科技(深圳)有限公司 | 数据预测方法、装置、计算机设备和存储介质 |
| CN115130548A (zh) * | 2022-05-24 | 2022-09-30 | 腾讯科技(深圳)有限公司 | 数据处理方法和装置、存储介质及电子设备 |
| CN116684420A (zh) * | 2023-05-22 | 2023-09-01 | 中山大学 | 集群资源调度方法、装置、集群系统和可读存储介质 |
| CN118447268A (zh) * | 2023-09-22 | 2024-08-06 | 荣耀终端有限公司 | 身份识别方法、电子设备及存储介质 |
Also Published As
| Publication number | Publication date |
|---|---|
| CN111275491B (zh) | 2023-12-26 |
| CN111275491A (zh) | 2020-06-12 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| WO2021147486A1 (zh) | 一种数据处理方法及装置 | |
| CN111681091B (zh) | 基于时间域信息的金融风险预测方法、装置及存储介质 | |
| US10346782B2 (en) | Adaptive augmented decision engine | |
| CN111523678B (zh) | 业务的处理方法、装置、设备及存储介质 | |
| WO2021164317A1 (zh) | 序列挖掘模型的训练方法、序列数据的处理方法及设备 | |
| CN110264342A (zh) | 一种基于机器学习的业务审核方法及装置 | |
| WO2019205325A1 (zh) | 确定用户风险等级的方法、终端设备及计算机可读存储介质 | |
| CN114298232A (zh) | 用户的类型信息的确定方法、设备及存储介质 | |
| CN107133865A (zh) | 一种信用分的获取、特征向量值的输出方法及其装置 | |
| CN113344695A (zh) | 一种弹性风控方法、装置、设备和可读介质 | |
| CN113887214B (zh) | 基于人工智能的意愿推测方法、及其相关设备 | |
| CN113450211A (zh) | 一种用户授信方法、装置、电子设备与存储介质 | |
| CN118709754A (zh) | 一种模型训练的方法、装置、存储介质及电子设备 | |
| CN118227107A (zh) | 代码生成模型训练方法、代码生成方法、装置 | |
| CN114969543B (zh) | 推广方法、系统、电子设备和存储介质 | |
| CN114969280A (zh) | 对话生成方法及装置、对话预测模型的训练方法及装置 | |
| Bell et al. | The game of recourse: Simulating algorithmic recourse over time to improve its reliability and fairness | |
| CN111325572A (zh) | 一种数据处理方法及装置 | |
| CN116777639A (zh) | 案件风险评级方法、装置、计算机设备及存储介质 | |
| CN113781103B (zh) | 数据处理方法、装置、计算机设备和存储介质 | |
| CN116701896A (zh) | 画像标签确定方法、装置、计算机设备和存储介质 | |
| CN113535125A (zh) | 金融需求项生成方法及装置 | |
| CN115964485B (zh) | 情感分析处理方法、装置、计算机设备及可读存储介质 | |
| CN113837235B (zh) | 基于社交网络隐私协商系统的智能体行为追责方法 | |
| HK40032783B (zh) | 业务的处理方法、装置、设备及存储介质 |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| 121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 20915907 Country of ref document: EP Kind code of ref document: A1 |
|
| NENP | Non-entry into the national phase |
Ref country code: DE |
|
| 32PN | Ep: public notification in the ep bulletin as address of the adressee cannot be established |
Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 07.11.2022) |
|
| 122 | Ep: pct application non-entry in european phase |
Ref document number: 20915907 Country of ref document: EP Kind code of ref document: A1 |