A multi-business scenario recommendation modeling method and system based on collaborative filtering
By merging and dividing the initial data set and building an optimized network model, the problem of insufficient generalization ability of traditional recommendation algorithms in multi-scenario applications is solved, and more efficient model training and accuracy are achieved.
Patent Information
- Application Number
- CN202510971724.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-15
- Publication Date
- 2025-10-03
- Estimated Expiration
- 2045-07-15
AI Technical Summary
Traditional recommendation algorithms have the problem that random negative sampling strategies cannot generate effective contrastive learning signals in multi-scenario applications, and traditional BPR loss functions lack the ability to distinguish samples of different difficulty levels, resulting in insufficient generalization and robustness of the model in complex scenarios.
By obtaining the initial data set for merging and partitioning, constructing a user-interaction graph and performing random walk operations, obtaining the target positive-negative sample set, constructing an optimized network model with an optimized BPR function and an optimized regularization strength function, and performing step-by-step training and evaluation to improve the accuracy of model training and reduce energy consumption.
It improves the accuracy of model training, reduces energy consumption during training, and enhances the generalization ability and robustness of the model in multiple scenarios.
Smart Images

Figure CN120470183B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of recommendation systems, and in particular to a multi-business scenario recommendation modeling method and system based on collaborative filtering. Background Art
[0002] With the continuous development of the Industrial Internet and electronic platforms, users are faced with a vast array of product choices. How to quickly and accurately locate desired products has become a critical challenge that needs to be addressed. Recommendation systems, as a core technology for information filtering and personalized services, are becoming increasingly important in today's digital age. Multi-scenario recommendation systems, by integrating multi-source data, can capture users' dynamic preferences in different scenarios in real time, generating highly personalized recommendations.
[0003] Users' behaviors and preferences in different scenarios often vary significantly. Early recommendation systems usually focused on single-scenario recommendations, but multi-scenario recommendation systems can capture these dynamic changes and provide recommendations that are more in line with users' current needs by analyzing their behavior patterns in different scenarios.
[0004] However, in actual applications, traditional recommendation algorithms have obvious limitations in multi-scenario applications: on the one hand, the random negative sampling strategy cannot generate effective contrastive learning signals; on the other hand, the traditional BPR loss function lacks the ability to distinguish samples of different difficulty levels, resulting in insufficient generalization and robustness of the model in complex scenarios. Summary of the Invention
[0005] The present invention provides a multi-business scenario recommendation modeling method based on collaborative filtering and a computer-readable storage medium, the main purpose of which is to improve the accuracy of model training and reduce the energy consumption required for model training.
[0006] To achieve the above objectives, the present invention provides a multi-business scenario recommendation modeling method based on collaborative filtering, comprising:
[0007] Acquire an initial data set, merge and divide the initial data set to obtain multiple scene-divided data sets, wherein the initial data set includes multiple initial data, and the initial data includes: user identification code, execution time, execution scene, content label, and interaction label;
[0008] The following operations are performed on each of the multiple scene division datasets:
[0009] constructing a user-interaction graph using the scene partitioning dataset, performing a random walk operation on the user-interaction graph to obtain a random walk vector set, and summarizing the random walk vector set to obtain multiple random walk vector sets;
[0010] Acquire multiple target positive and negative sample sets based on multiple random walk vector sets, and divide the multiple target positive and negative sample sets using a preset division ratio to obtain a training sample set and a test sample set;
[0011] Construct an optimization network model including optimizing BPR function and optimizing regularization strength function;
[0012] The optimized network model is trained using the training sample set to obtain a training network model. After the training network model is confirmed to be a preset target network model using the test sample set, a performance reference diagram is obtained using the training network model and the pre-confirmed reference network model set to achieve training of the training network model.
[0013] Optionally, merging and dividing the initial data set to obtain multiple scene division data sets includes:
[0014] According to the user identification code corresponding to the initial data, the initial data in the initial data set are respectively aggregated to obtain multiple user-divided data sets, and the following operation is performed on each of the multiple user-divided data sets:
[0015] Sort the user partition data in the user partition data set in descending order of execution time to obtain a user partition data sequence;
[0016] Initial partition data is sequentially extracted from the user partition data sequence, and the following operations are performed on the extracted initial partition data:
[0017] Extracting adjacent partition data from a user partition data sequence using the initial partition data, and extracting switching partition data from the user partition data sequence using the adjacent partition data, wherein the adjacent partition data is adjacent to and lags behind the extracted initial partition data, and wherein the switching partition data is adjacent to and lags behind the adjacent partition data;
[0018] Calculate the absolute difference between the execution time corresponding to the initial partition data and the execution time corresponding to the switch partition data to obtain the user response time;
[0019] Comparing the user response time with a preset false touch time threshold;
[0020] If the user response time is less than or equal to the false touch time threshold, the adjacent segmentation data is removed from the user segmentation data sequence, and the user segmentation data sequence after removing the adjacent segmentation data is used as the user segmentation data sequence, and the process returns to the step of extracting the adjacent segmentation data from the user segmentation data sequence using the initial segmentation data until it is confirmed that the user segmentation data sequence is the preset target segmentation data sequence;
[0021] The target partition data sequences are summarized to obtain a target partition data sequence set. The target partition data in the target partition data sequence set are summarized using the execution scenarios corresponding to the initial data to obtain multiple scenario partition data sets.
[0022] Optionally, the step of confirming that the user divided data sequence is a preset target divided data sequence includes:
[0023] When adjacent partition data is removed from the user partition data sequence, the number of removed adjacent partition data is accumulated to obtain the removal number;
[0024] Counting the number of user-divided data in the user-divided data sequence to obtain a reference number;
[0025] Calculate the ratio of the number of rejections to the reference number to obtain the rejection ratio;
[0026] Comparing the rejection ratio with a preset ratio threshold;
[0027] If the elimination ratio is greater than or equal to the ratio threshold, the user divided data sequence is eliminated;
[0028] Otherwise, if it is confirmed that each user segmentation data in the user segmentation data sequence is extracted and the elimination ratio is less than the ratio threshold, the user segmentation data sequence is confirmed as the target segmentation data sequence.
[0029] Optionally, obtaining multiple target positive-negative sample sets based on multiple random walk vector sets includes:
[0030] Using the user identification code, multiple cross-scene vector sets are identified from the multiple random walk vector sets, wherein the user identification code corresponds one-to-one to the cross-scene vector set;
[0031] Matrix construction is performed on each of the multiple cross-scenario vector sets to obtain multiple user behavior matrices;
[0032] The following operations are performed on each of the multiple user behavior matrices:
[0033] Sequentially extracting initial user behavior matrices from the multiple user behavior matrices, and removing the extracted initial user behavior matrices from the multiple user behavior matrices to obtain multiple filtered user behavior matrices;
[0034] Calculate the matrix similarity between the initial user behavior matrix and each of the multiple filtered user behavior matrices using a pre-built cosine similarity relationship to obtain a matrix similarity set;
[0035] Sort the matrix similarities in the matrix similarity set in descending order to obtain a matrix similarity sequence;
[0036] Using a preset extraction value, identifying a plurality of extraction similarity matrices in the matrix similarity sequence, wherein the number of the extraction similarity matrices is the extraction value;
[0037] Using the plurality of extracted similarity matrices, identifying similar execution item sets in a plurality of scene partitioning data sets;
[0038] Using the initial user behavior matrix, identify the target positive sample set in multiple scene division datasets;
[0039] A plurality of target positive-negative sample sets are identified based on the target positive sample set and the similar execution item set.
[0040] Optionally, the identifying a plurality of target positive-negative sample sets based on the target positive sample set and the similar execution item set includes:
[0041] The sample reference value is calculated using the pre-built negative sample screening relationship, the target positive sample set, and the similar execution item set. The negative sample screening relationship is as follows:
[0042] ;
[0043] ;
[0044] in, Indicates the first Similar projects, represents the target positive sample set, Represents a set of similar execution items, Indicates the sample reference value;
[0045] After confirming that the sample reference value is 0, similar execution items are confirmed as target negative samples, the target negative samples are aggregated to obtain a target negative sample set, the target positive sample set and the target negative sample set are associated to obtain a target positive-negative sample set, and the target positive-negative sample sets are aggregated to obtain multiple target positive-negative sample sets.
[0046] Optionally, the optimized BPR function is as follows:
[0047] ;
[0048] in, Represents the optimized BPR function, Indicates the first of multiple execution scenarios corresponding to the initial data set An execution scenario, Indicates multiple execution scenarios corresponding to the initial data set, Indicates the first of multiple user identification codes corresponding to the initial data set A user identification code, Indicates that the user There are interactive tags with content tags in each execution scenario. Indicates that the user There is no interaction tag between the content tag and the execution scenario, among which, , Indicates in The training sample set extracted from the execution scenario, , represents the dynamic sample weight, ,in, represents the marginal coefficient, represents the average score difference between the target positive and negative samples in the training sample set, is a learnable parameter used to adjust the overall scale of the margin, Indicates that in multiple execution scenarios The sampling probability of users interacting with content tags in each execution scenario, Indicates that in multiple execution scenarios The sampling probability that the user does not interact with the content tag in the execution scenario.
[0049] Optionally, the step of training the optimized network model using the training sample set to obtain the trained network model includes:
[0050] Using the preset batch division ratio, multiple batch training sample sets are extracted from the training sample set, batch training sample sets are extracted from the multiple batch training sample sets in sequence, and the following operations are performed on the extracted batch training sample sets:
[0051] The optimized network model is trained using a batch training sample set, and an initial reference value of the optimized network model after training is obtained through the optimized BPR function;
[0052] Sequentially filling the initial reference values into a pre-constructed blank sequence to obtain an initial reference value sequence;
[0053] Get the initial AUC value sequence of the optimized network model after training;
[0054] Initial reference values are sequentially extracted from the initial reference value sequence, and the following operations are performed on each of the extracted initial reference values:
[0055] Using the extracted initial reference value, identifying an iterative reference value in the initial reference value sequence, wherein the iterative reference value is adjacent to the extracted initial reference value and lags behind the extracted initial reference value;
[0056] Calculating an iteration difference ratio using the initial reference value and the iteration reference value, and using the iteration reference value as the extracted initial reference value, returning to the step of using the extracted initial reference value to identify the iteration reference value in the initial reference value sequence, summarizing the iteration difference ratios to obtain an iteration difference ratio set, and obtaining an iteration difference ratio sequence based on the iteration difference ratio set;
[0057] Using a preset difference ratio threshold, identifying a target difference ratio sequence in the iterative difference ratio sequence, wherein the target difference ratio sequence includes a plurality of target difference ratios, and all of the target difference ratios are less than or equal to the difference ratio threshold;
[0058] Extract reference difference ratios in the target difference ratio sequence in sequence, and perform the following operations on the extracted reference difference ratios:
[0059] Using the reference difference ratio, identifying adjacent difference ratios in the target difference ratio sequence, wherein the adjacent difference ratio is adjacent to the reference difference ratio and lags behind the reference difference ratio;
[0060] Calculating the difference between the reference difference ratio and the adjacent difference ratio to obtain an adjacent difference ratio, and after confirming that the adjacent difference ratio is less than the reference difference ratio and the adjacent difference ratio is less than a preset adjacent threshold, using the adjacent difference ratio as the reference difference ratio, returning to the step of using the reference difference ratio to determine the adjacent difference ratio in the target difference ratio sequence, and counting the number of times the adjacent difference ratio is less than the reference difference ratio and the adjacent difference ratio is less than the preset adjacent threshold, to obtain a reference number;
[0061] When the reference number reaches a preset reference threshold and the initial AUC value sequence is confirmed to be a preset target AUC value sequence, a training network model is obtained.
[0062] Optionally, the confirming, by using the test sample set, that the training network model is a preset target network model includes:
[0063] Obtaining a test reference value and a test AUC value based on the test sample set and the training network model;
[0064] Extracting a final reference value and a final AUC value from the initial reference value sequence and the initial AUC value sequence respectively, and calculating the product of a preset first error ratio and the final reference value to obtain a verification reference value;
[0065] Obtain a verification AUC value using the preset second error ratio and the final AUC value;
[0066] After confirming that the test reference value is less than or equal to the verification reference value and the test AUC value is greater than or equal to the verification AUC value, the training network model is confirmed to be the target network model.
[0067] Optionally, the obtaining of a performance reference map using the trained network model and the pre-confirmed reference network model set includes:
[0068] Obtain a validation data set for performance comparison, and use the training network model, validation data set, and reference network model set to obtain a training AUC value set, a comparison AUC value set, a training index value set, and a comparison index value set, wherein the comparison AUC value and the comparison index value correspond one-to-one to the reference network model;
[0069] A line graph is drawn using the training AUC value and the comparison AUC value set as well as the training index value and the comparison index value set to obtain a performance reference graph.
[0070] To achieve the above objectives, the present invention further provides a multi-business scenario recommendation modeling system based on collaborative filtering, comprising:
[0071] A training data preprocessing module is used to obtain an initial data set, merge and divide the initial data set to obtain multiple scene division data sets, wherein the initial data set includes multiple initial data, and the initial data includes: user identification code, execution time, execution scene, content label, and interaction label;
[0072] The positive-negative data partitioning module is used to perform the following operations on each of the multiple scene partitioning data sets:
[0073] constructing a user-interaction graph using the scene partitioning dataset, performing a random walk operation on the user-interaction graph to obtain a random walk vector set, and summarizing the random walk vector set to obtain multiple random walk vector sets;
[0074] Acquire multiple target positive and negative sample sets based on multiple random walk vector sets, and divide the multiple target positive and negative sample sets using a preset division ratio to obtain a training sample set and a test sample set;
[0075] The network model construction module is used to construct an optimized network model including an optimized BPR function and an optimized regularization strength function;
[0076] The network model training and evaluation module is used to train the optimized network model using the training sample set to obtain a trained network model. After confirming that the trained network model is the preset target network model using the test sample set, the performance reference diagram is obtained using the trained network model and the pre-confirmed reference network model set to realize the training of the trained network model.
[0077] In order to solve the above problem, the present invention further provides an electronic device, comprising:
[0078] A memory storing at least one instruction; and a processor executing the instruction stored in the memory to implement the above-mentioned collaborative filtering-based multi-business scenario recommendation modeling method.
[0079] In order to solve the above problems, the present invention also provides a computer-readable storage medium, which stores at least one instruction, and the at least one instruction is executed by a processor in an electronic device to implement the above-mentioned multi-business scenario recommendation modeling method based on collaborative filtering.
[0080] In order to solve the problems described in the background technology, the present invention obtains an initial data set, merges and divides the initial data set to obtain multiple scene division data sets, wherein the initial data set includes multiple initial data, and the initial data includes: user identification code, execution time, execution scene, content label, interaction label. It can be seen that when obtaining the initial data set, the present invention takes into account the initial data with large errors that may exist in the initial data set. Therefore, the initial data set is filtered to reduce the interference of the initial data with large errors, thereby improving the accuracy of the subsequent identification of the target positive-negative sample set in multiple scene division data sets. By eliminating abnormal initial data, the energy consumption required for subsequent model training can be reduced, and the accuracy of model training can be improved. A user-interaction graph is constructed using a scene partitioning data set, a random walk operation is performed on the user-interaction graph to obtain a random walk vector set, the random walk vector set is summarized to obtain multiple random walk vector sets, multiple target positive-negative sample sets are obtained based on the multiple random walk vector sets, the multiple target positive-negative sample sets are divided using a preset partitioning ratio to obtain a training sample set and a test sample set. It can be seen that when the present invention identifies the target negative sample, it does not select a random negative sample as the target negative sample, but identifies the target negative sample through a random walk and a negative sample screening relationship, thereby improving the accuracy of the target negative sample obtained, and thereby improving the accuracy of the data used when training the model. An optimized network model including an optimized BPR function and an optimized regularization strength function is constructed. It can be seen that the optimized network model constructed by the present invention not only considers inter-scene factors but also intra-scene factors, and sets an optimized BPR function and an optimized regularization strength function to improve the learning ability of the model and the accuracy of the model prediction. The optimized network model is trained using the training sample set to obtain a trained network model. After the trained network model is confirmed to be the preset target network model using the test sample set, the performance reference diagram is obtained using the trained network model and the pre-confirmed reference network model set to implement the training of the trained network model. It can be seen that when the optimized network model is trained, the present invention takes into account factors such as possible over-training, which in turn leads to energy waste when training the model. Therefore, a step-by-step training and evaluation form is adopted to evaluate whether the model has completed training. When evaluating whether the model has completed training, factors under different circumstances are also considered to improve the accuracy of judging whether the model training has been completed. Therefore, the present invention can improve the accuracy of model training and reduce the energy consumption required for model training. BRIEF DESCRIPTION OF THE DRAWINGS
[0081] Figure 1 A flowchart of a collaborative filtering-based multi-business scenario recommendation modeling method provided by one embodiment of the present invention;
[0082] Figure 2 A functional module diagram of a multi-business scenario recommendation modeling system based on collaborative filtering provided by one embodiment of the present invention;
[0083] Figure 3 A schematic diagram of the structure of an electronic device for implementing the collaborative filtering-based multi-business scenario recommendation modeling method provided by an embodiment of the present invention;
[0084] Figure 4 A performance reference diagram of the collaborative filtering-based multi-business scenario recommendation modeling method provided in one embodiment of the present invention.
[0085] Description of reference numerals:
[0086] 1. Electronic device; 10. Processor; 11. Memory; 12. Bus.
[0087] The purpose, features and advantages of the present invention will be further described with reference to the accompanying drawings and in conjunction with the embodiments. DETAILED DESCRIPTION
[0088] It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.
[0089] The embodiment of the present application provides a multi-business scenario recommendation modeling method based on collaborative filtering. The execution subject of the multi-business scenario recommendation modeling method based on collaborative filtering includes but is not limited to at least one of the electronic devices such as a server and a terminal that can be configured to execute the method provided by the embodiment of the present application. In other words, the multi-business scenario recommendation modeling method based on collaborative filtering can be executed by software or hardware installed on a terminal device or a server device, and the software can be a blockchain platform. The server includes but is not limited to: a single server, a server cluster, a cloud server or a cloud server cluster, etc.
[0090] Reference Figure 1 FIG. 1 is a flow chart of a collaborative filtering-based multi-business scenario recommendation modeling method according to an embodiment of the present invention. In this embodiment, the collaborative filtering-based multi-business scenario recommendation modeling method includes:
[0091] S1. Obtain an initial data set, merge and divide the initial data set to obtain multiple scene division data sets, wherein the initial data set includes multiple initial data, and the initial data includes: user identification code, execution time, execution scene, content label, and interaction label.
[0092] It should be explained that the initial data is data to be processed after collection. The embodiment of the present invention uses the public AliCCP dataset and the Alipay industrial dataset AntM2C dataset as the initial datasets respectively. The user identification code refers to the unique identifier of the user. The execution scenario refers to the scenario in which the user is located. For example, advertisements, coupons, mini-programs, content, videos. Optionally, the execution scenario is formulated by the unique identifier of the scenario. The execution time refers to the timestamp when the user behavior occurs. The interaction label refers to the label of the user's interaction with the content in the scenario. For example, when the user clicks on the corresponding content, 1 is used as the interaction label, and when the user does not click on the corresponding content, 0 is used as the interaction label. The content label refers to a unique identifier used to distinguish content. For example, when making a purchase on an e-commerce platform, the execution scenario is the e-commerce platform, the content label is the product purchased, clicked or searched on the e-commerce platform, and the interaction label is purchase or click.
[0093] It is understandable that the initial data set is merged and divided to obtain multiple scene division data sets, including:
[0094] According to the user identification code corresponding to the initial data, the initial data in the initial data set are respectively aggregated to obtain multiple user-divided data sets, and the following operation is performed on each of the multiple user-divided data sets:
[0095] Sort the user partition data in the user partition data set in descending order of execution time to obtain a user partition data sequence;
[0096] Initial partition data is sequentially extracted from the user partition data sequence, and the following operations are performed on the extracted initial partition data:
[0097] Extracting adjacent partition data from a user partition data sequence using the initial partition data, and extracting switching partition data from the user partition data sequence using the adjacent partition data, wherein the adjacent partition data is adjacent to and lags behind the extracted initial partition data, and wherein the switching partition data is adjacent to and lags behind the adjacent partition data;
[0098] Calculate the absolute difference between the execution time corresponding to the initial partition data and the execution time corresponding to the switch partition data to obtain the user response time;
[0099] Comparing the user response time with a preset false touch time threshold;
[0100] If the user response time is less than or equal to the false touch time threshold, the adjacent segmentation data is removed from the user segmentation data sequence, and the user segmentation data sequence after removing the adjacent segmentation data is used as the user segmentation data sequence, and the process returns to the step of extracting the adjacent segmentation data from the user segmentation data sequence using the initial segmentation data until it is confirmed that the user segmentation data sequence is the preset target segmentation data sequence;
[0101] The target partition data sequences are summarized to obtain a target partition data sequence set. The target partition data in the target partition data sequence set are summarized using the execution scenarios corresponding to the initial data to obtain multiple scenario partition data sets.
[0102] Furthermore, when the user response time is less than or equal to the false touch time threshold, it indicates that the user has a false touch operation, and therefore, the false touch operation of the user is subsequently eliminated. By screening and eliminating the initial data that may be a false touch operation in the initial data set, the accuracy of the acquired scene division data set can be improved. For example, when the operator is using an e-commerce platform, he accidentally touches an advertisement pushed by the e-commerce platform, and then the operator quickly closes the false touch advertisement and continues to browse on the e-commerce platform. Here, the advertisement pushed by the e-commerce platform is the adjacent division data that needs to be eliminated. Using user identification codes to separately summarize the initial data in the initial data set means dividing the initial data in the initial data set according to users, and then being able to judge the behavior of a certain user, thereby realizing the identification of user behavior, so as to perform corresponding operations on the initial data corresponding to the user. For specific operations, please refer to the subsequent embodiments. The initial division data refers to the user division data extracted from the user division data sequence.
[0103] It should be understood that the process of confirming that the user partition data sequence is the preset target partition data sequence includes:
[0104] When adjacent partition data is removed from the user partition data sequence, the number of removed adjacent partition data is accumulated to obtain the removal number;
[0105] Counting the number of user-divided data in the user-divided data sequence to obtain a reference number;
[0106] Calculate the ratio of the number of rejections to the reference number to obtain the rejection ratio;
[0107] Comparing the rejection ratio with a preset ratio threshold;
[0108] If the elimination ratio is greater than or equal to the ratio threshold, the user divided data sequence is eliminated;
[0109] Otherwise, if it is confirmed that each user segmentation data in the user segmentation data sequence is extracted and the elimination ratio is less than the ratio threshold, the user segmentation data sequence is confirmed as the target segmentation data sequence.
[0110] Furthermore, the number of eliminations changes as the number of adjacent partitioning data eliminated changes. For example, when one adjacent partitioning data is eliminated in the user partitioning data sequence, the number of eliminations is 1, and when two adjacent partitioning data are eliminated in the user partitioning data sequence, the number of eliminations is 2. When the elimination ratio is greater than or equal to the ratio threshold, it indicates that there are more interfering user partitioning data in the current user partitioning data sequence. When the user partitioning data is subsequently processed, additional energy will be consumed and the accuracy of the subsequent acquisition of target negative samples will be interfered with. Therefore, it is necessary to eliminate the user partitioning data sequence. Generally speaking, confirming that each user partitioning data in the user partitioning data sequence is extracted and the elimination ratio is less than the ratio threshold means confirming that the proportion of interfering data (mis-touched data) in the user partitioning data sequence is less than the ratio threshold.
[0111] S2. Build a user-interaction graph using the scene partitioning dataset, perform a random walk operation on the user-interaction graph to obtain a random walk vector set, and summarize the random walk vector set to obtain multiple random walk vector sets.
[0112] It should be explained that the user-interaction graph is a graph (graph structure) used to express the interactive relationship between users and objects, and the technology of constructing a user-interaction graph by dividing the data set into scenes is an existing technology and will not be repeated here. Performing a random walk operation on the user-interaction graph means that at each node of the user-interaction graph, a random walk of a fixed length is performed starting from the node, and at each step, a neighbor of the current node is uniformly randomly selected as the next step. This is an existing technology and will not be repeated here. By performing a random walk on the user-interaction graph, a set of multiple node sequences can be obtained, and embedding processing is performed on each node sequence to obtain a random walk vector. The technology of using embedding technology to process the node sequence to obtain a vector is an existing technology and will not be repeated here. Generally speaking, a random walk vector set is constructed using each scene in this application document. Therefore, there is a one-to-one correspondence between the random walk vector set and the scene.
[0113] S3. Acquire multiple target positive-negative sample sets based on multiple random walk vector sets, and divide the multiple target positive-negative sample sets using a preset division ratio to obtain a training sample set and a test sample set.
[0114] It should be understood that the step of obtaining multiple target positive and negative sample sets based on multiple random walk vector sets includes:
[0115] Using the user identification code, multiple cross-scene vector sets are identified from the multiple random walk vector sets, wherein the user identification code corresponds one-to-one to the cross-scene vector set;
[0116] Matrix construction is performed on each of the multiple cross-scenario vector sets to obtain multiple user behavior matrices;
[0117] The following operations are performed on each of the multiple user behavior matrices:
[0118] Sequentially extracting initial user behavior matrices from the multiple user behavior matrices, and removing the extracted initial user behavior matrices from the multiple user behavior matrices to obtain multiple filtered user behavior matrices;
[0119] Calculate the matrix similarity between the initial user behavior matrix and each of the multiple filtered user behavior matrices using a pre-built cosine similarity relationship to obtain a matrix similarity set;
[0120] Sort the matrix similarities in the matrix similarity set in descending order to obtain a matrix similarity sequence;
[0121] Using a preset extraction value, identifying a plurality of extraction similarity matrices in the matrix similarity sequence, wherein the number of the extraction similarity matrices is the extraction value;
[0122] Using the plurality of extracted similarity matrices, identifying similar execution item sets in a plurality of scene partitioning data sets;
[0123] Using the initial user behavior matrix, identify the target positive sample set in multiple scene division datasets;
[0124] A plurality of target positive-negative sample sets are identified based on the target positive sample set and the similar execution item set.
[0125] It should be explained that a cross-scene vector set refers to a set of vectors of the same user in different scenes. Matrix construction for each of the multiple cross-scene vector sets refers to converting multiple vectors into matrices in a certain form. Optionally, a user behavior matrix is obtained by stacking multiple vectors. Generally speaking, there is a one-to-one correspondence between the user behavior matrix and the user. The initial user matrix refers to the user behavior matrix extracted from the multiple user behavior matrices. The screening user behavior matrix refers to the complement of the initial user matrix in the multiple user behavior matrices. Extracting the initial user behavior matrix from the multiple user behavior matrices in sequence refers to extracting each user behavior matrix from the multiple user behavior matrices, and the extracted user behavior matrix is the initial user behavior matrix. For example, if the multiple user behavior matrices include matrix No. 1, matrix No. 3, and matrix No. 2, then matrix No. 1 can be extracted from the multiple user behavior matrices, and matrix No. 2 and matrix No. 3 can be used as the screening user behavior matrix, and the similarity between the initial user behavior matrix and the screening user behavior matrix can be calculated. The next extraction can use matrix No. 3 as the initial user behavior matrix, matrix No. 1 and matrix No. 2 as the screening user behavior matrix, and so on.
[0126] It is understandable that the cosine similarity relationship is used to calculate the similarity between two matrices, and the cosine similarity relationship is a prior art and will not be described in detail here. Generally speaking, the set of similar execution items identified refers to the matrix similarities that are identified in sequence in the matrix similarity sequence and the matrix similarities that are the same as the extracted values, and the set of objects in the cross-scene vector set corresponding to the matrix similarity is identified by the matrix similarity. Generally speaking, a target positive sample refers to a sample that has an interactive label with a content label. In the embodiment of the present invention, samples, objects, and items have the same properties and are all used to describe the content corresponding to the content label.
[0127] Furthermore, the identifying of a plurality of target positive-negative sample sets based on the target positive sample set and the similar execution item set includes:
[0128] The sample reference value is calculated using the pre-built negative sample screening relationship, the target positive sample set, and the similar execution item set. The negative sample screening relationship is as follows:
[0129] ;
[0130] ;
[0131] in, Indicates the first Similar projects, represents the target positive sample set, Represents a set of similar execution items, Indicates the sample reference value;
[0132] After confirming that the sample reference value is 0, similar execution items are confirmed as target negative samples, the target negative samples are aggregated to obtain a target negative sample set, the target positive sample set and the target negative sample set are associated to obtain a target positive-negative sample set, and the target positive-negative sample sets are aggregated to obtain multiple target positive-negative sample sets.
[0133] It is understood that in this embodiment of the present invention, samples that were not randomly operated by users are not selected as negative samples. Instead, samples that were not executed in multiple similar execution project sets are identified as negative samples to improve the accuracy of the obtained negative samples. Associating the target positive sample set and the target negative sample set means treating the target positive sample set and the target negative sample set as a whole set.
[0134] Furthermore, different users have different executed and unexecuted projects. Therefore, each user corresponds to a target positive sample set and a target negative sample set. The difference between positive and negative samples is that positive samples refer to projects that the user has interacted with, while negative samples refer to projects that multiple users with the same situation have not interacted with.
[0135] It should be explained that the division ratio refers to the ratio used to divide the target positive-negative sample set. Optionally, 0.7:0.3 is used as the division ratio, that is, after dividing the target positive-negative sample set into 10 equal parts, 7 equal parts are taken as the training sample set, and 3 equal parts are taken as the test sample set.
[0136] S4. Construct an optimized network model including optimizing the BPR function and optimizing the regularization strength function.
[0137] It should be explained that the optimization network model is a model that, after training, can identify items that a user may be interested in from multiple pre-confirmed items based on the user's usage habits (habits of interacting with items). Optionally, a graph neural network model is used as the optimization network model.
[0138] Furthermore, the optimized network model adopted in the embodiment of the present invention also includes: aggr_user and aggr_item as shared embeddings across scenes, which are used to capture the common features of users and items in multiple scenes, and embedding_user and embedding_item lists to maintain scene-specific embeddings. Among them, aggr_user is a user embedding matrix shared across scenes, which is used to capture the common features of users in all scenes. aggr_item is an item embedding matrix shared across scenes, which is used to capture the common features of items in all scenes. embedding_user is a list containing an independent user embedding matrix for each scene, which is used to capture the unique features of users in each scene. embedding_item is a list containing an independent item embedding matrix for each scene, which is used to capture the unique features of items in each scene.
[0139] Furthermore, the optimized BPR function is as follows:
[0140] ;
[0141] in, Represents the optimized BPR function, Indicates the first of multiple execution scenarios corresponding to the initial data set An execution scenario, Indicates multiple execution scenarios corresponding to the initial data set, Indicates the first of multiple user identification codes corresponding to the initial data set A user identification code, Indicates that the user There are interactive tags with content tags in each execution scenario. Indicates that the user There is no interaction tag between the content tag and the execution scenario, among which, , Indicates in The training sample set extracted from the execution scenario, , represents the dynamic sample weight, ,in, represents the marginal coefficient, represents the average score difference between the target positive and negative samples in the training sample set, is a learnable parameter used to adjust the overall scale of the margin, Indicates that in multiple execution scenarios The sampling probability of users interacting with content tags in each execution scenario, Indicates that in multiple execution scenarios The sampling probability that the user does not interact with the content tag in the execution scenario.
[0142] It should be understood that the user There is an interaction tag between the content tag and the execution scene, indicating that the user In the execution scenario, the content tag has been interacted with, for example, clicked, purchased, etc. Please refer to the subsequent embodiments for the process of obtaining the training sample set extracted from each execution scenario. The average score difference between the target positive and negative samples in the training sample set refers to the average of the differences between the predicted scores of the optimized network model for the user-positive sample pair and the predicted scores of the user-negative sample pair, where the user-positive sample pair refers to the content label with which the user interacted, and the user-negative sample pair refers to the identified target negative sample.
[0143] It should be explained that the optimization regularization strength function is as follows:
[0144] ;
[0145] in, represents the adaptive regularization strength parameter, represents the learnable parameters, is a preset constant.
[0146] S5. Use the training sample set to train the optimized network model to obtain a training network model. After using the test sample set to confirm that the training network model is a preset target network model, use the training network model and the pre-confirmed reference network model set to obtain a performance reference diagram to achieve training of the training network model.
[0147] It should be explained that the use of the training sample set to train the optimized network model to obtain the training network model includes:
[0148] Using the preset batch division ratio, multiple batch training sample sets are extracted from the training sample set, batch training sample sets are extracted from the multiple batch training sample sets in sequence, and the following operations are performed on the extracted batch training sample sets:
[0149] The optimized network model is trained using a batch training sample set, and an initial reference value of the optimized network model after training is obtained through the optimized BPR function;
[0150] Sequentially filling the initial reference values into a pre-constructed blank sequence to obtain an initial reference value sequence;
[0151] Get the initial AUC value sequence of the optimized network model after training;
[0152] Initial reference values are sequentially extracted from the initial reference value sequence, and the following operations are performed on each of the extracted initial reference values:
[0153] Using the extracted initial reference value, identifying an iterative reference value in the initial reference value sequence, wherein the iterative reference value is adjacent to the extracted initial reference value and lags behind the extracted initial reference value;
[0154] Calculating an iteration difference ratio using the initial reference value and the iteration reference value, and using the iteration reference value as the extracted initial reference value, returning to the step of using the extracted initial reference value to identify the iteration reference value in the initial reference value sequence, summarizing the iteration difference ratios to obtain an iteration difference ratio set, and obtaining an iteration difference ratio sequence based on the iteration difference ratio set;
[0155] Using a preset difference ratio threshold, identifying a target difference ratio sequence in the iterative difference ratio sequence, wherein the target difference ratio sequence includes a plurality of target difference ratios, and all of the target difference ratios are less than or equal to the difference ratio threshold;
[0156] Extract reference difference ratios in the target difference ratio sequence in sequence, and perform the following operations on the extracted reference difference ratios:
[0157] Using the reference difference ratio, identifying adjacent difference ratios in the target difference ratio sequence, wherein the adjacent difference ratio is adjacent to the reference difference ratio and lags behind the reference difference ratio;
[0158] Calculating the difference between the reference difference ratio and the adjacent difference ratio to obtain an adjacent difference ratio, and after confirming that the adjacent difference ratio is less than the reference difference ratio and the adjacent difference ratio is less than a preset adjacent threshold, using the adjacent difference ratio as the reference difference ratio, returning to the step of using the reference difference ratio to determine the adjacent difference ratio in the target difference ratio sequence, and counting the number of times the adjacent difference ratio is less than the reference difference ratio and the adjacent difference ratio is less than the preset adjacent threshold, to obtain a reference number;
[0159] When the reference number reaches a preset reference threshold and the initial AUC value sequence is confirmed to be a preset target AUC value sequence, a training network model is obtained.
[0160] Furthermore, the batch division ratio is used to extract the ratio of the batch training sample set in the training sample set. Optionally, 0.1 is used as the batch division ratio. The purpose of dividing the training sample set is to prevent the problem of inaccurate training results of the optimized network model caused by over-learning of the optimized network model. The technology of training the optimized network model using batch training sample sets is a prior art and will not be described here. The initial reference value refers to the parameters of the optimized network model during training extracted by the optimized BPR function after the optimized network model is trained using the batch training sample set. The initial reference value is used to characterize the loss value of the optimized network model during the training process, and the smaller the loss value, the better. Generally speaking, when training the optimized network model, the batch training sample set is divided again, and the batch training sample set used for verification after division is used as the verification data set, and the initial reference value and the initial AUC value are obtained using the verification data set.
[0161] It should be explained that the blank sequence refers to the sequence to be filled, and when filling, it needs to be filled in sequence. For example, the blank sequence can accommodate three elements, and when the optimization network model is trained for the first time, the initial reference value obtained is 0.6, the initial reference value obtained when the optimization network model is trained for the second time is 0.5, and the initial reference value obtained when the optimization network model is trained for the third time is 0.4. After the three initial reference values are filled into the blank sequence in sequence, the resulting initial reference value sequence is: {0.6, 0.5, 0.4}. The method for obtaining the initial AUC value sequence is the same as the method for obtaining the initial reference value sequence, and can achieve the same effect, so it will not be repeated here. The initial AUC value refers to the result of evaluating the effect of training the optimization network model using the AUC indicator. Among them, the AUC indicator (Area Under the ROC Curve) is the core indicator for evaluating the model ranking ability, and the technology for evaluating the effect of the optimization network model using the AUC indicator is an existing technology and will not be repeated here.
[0162] It should be explained that the calculation formula for calculating the iterative difference ratio using the initial reference value and the iterative reference value is as follows:
[0163] ;
[0164] in, represents the iterative difference ratio, represents the initial reference value, Indicates the iteration reference value.
[0165] Furthermore, obtaining an iteration difference ratio sequence using the iteration difference ratio set refers to sorting the iteration difference ratios in the iteration difference ratio set in descending order of the time corresponding to the acquisition of the iteration difference ratios to obtain the iteration difference ratio sequence. Generally, when the optimized network model is trained and does not reach overtraining, each iteration reference value obtained using the optimized network model is less than the initial reference value.
[0166] It should be explained that the process of confirming that the initial AUC value sequence is a preset target AUC value sequence is similar to the process of confirming that the reference number reaches a preset reference threshold, and will not be repeated here. The difference is that the AUC value will increase with the number of training times, while the initial reference value will decrease with the number of training times. The reference threshold is a pre-set value used to determine whether the process of training the optimized network model is stable. When the reference number reaches the reference threshold, the optimized network model is deemed to be stable under the current evaluation value, so as to facilitate early stopping of the optimized network model training.
[0167] Exemplarily, the training sample set is divided into 5 batch training sample sets. After each batch training sample set is used to train the optimized network model, the initial reference value and initial AUC value of the trained optimized network model are obtained. The obtained initial reference value and initial AUC value are used to determine whether the optimized network model has completed training. If the preset training standard is not met, a new batch training sample set is used to train the optimized network model. If the training standard has been met, the training of the optimized network model is stopped. Here, the training standard is that the reference number reaches a reference threshold.
[0168] It should be explained that the use of the test sample set to confirm that the training network model is a preset target network model includes:
[0169] Obtaining a test reference value and a test AUC value based on the test sample set and the training network model;
[0170] Extracting a final reference value and a final AUC value from the initial reference value sequence and the initial AUC value sequence respectively, and calculating the product of a preset first error ratio and the final reference value to obtain a verification reference value;
[0171] Obtain a verification AUC value using the preset second error ratio and the final AUC value;
[0172] After confirming that the test reference value is less than or equal to the verification reference value and the test AUC value is greater than or equal to the verification AUC value, the training network model is confirmed to be the target network model.
[0173] It is understandable that the final reference value and the final AUC value are the last initial reference value in the initial reference value sequence and the last initial AUC value in the initial AUC value sequence, respectively. The first error ratio is a preset value used to expand the acceptable error range. Optionally, the first error ratio is set to 1.1. The method for obtaining the verification AUC value using the second error ratio is the same as the method for obtaining the verification reference value, and will not be repeated here. Generally speaking, the verification AUC value should be less than the final AUC value in order to expand the acceptable error range. Optionally, the second error ratio is set to 0.9.
[0174] Furthermore, the step of obtaining a performance reference map using the trained network model and the pre-confirmed reference network model set includes:
[0175] Obtain a validation data set for performance comparison, and use the training network model, validation data set, and reference network model set to obtain a training AUC value set, a comparison AUC value set, a training index value set, and a comparison index value set, wherein the comparison AUC value and the comparison index value correspond one-to-one to the reference network model;
[0176] A line graph is drawn using the training AUC value and the comparison AUC value set as well as the training index value and the comparison index value set to obtain a performance reference graph.
[0177] It should be explained that the comparison index value refers to the relative improvement rate, which is an indicator used to quantify the performance improvement of the model in the recommendation system and machine learning. The method of obtaining the training index value is the same as the method of obtaining the comparison index value, which will not be repeated here. The method of obtaining the training AUC value and the comparison AUC value is the same as the method of obtaining the initial AUC value, which will not be repeated here. The reference network model refers to an existing model for implementing recommendations for services, such as a probabilistic neural network model. The technology of drawing a line graph using the training AUC value and the comparison AUC value set and the training index value and the comparison index value set is an existing technology and will not be repeated here. For details, refer to Figure 4 As shown, Figure 4The performance graph shows a multi-task learning framework, where SB stands for Shared Bottom. It is characterized by sharing bottom-level parameters. MMOE implicitly models the inter-task relationship during multi-task learning, allowing different tasks to have their own label spaces. This model uses multiple expert networks to learn knowledge from different scenarios and tasks and fuses this knowledge for prediction. Each task is equipped with its own gating network to integrate the outputs of the expert networks, thereby identifying and leveraging similarities and differences between tasks. PLE is a multi-task learning architecture that effectively prevents negative transfer and seesaw effects by partitioning the expert network into specialized expert groups and a general shared expert group. This model utilizes a hierarchical and progressive knowledge extraction mechanism to efficiently transfer knowledge between multiple tasks, thereby improving cross-task representation efficiency. Star trains a unified network architecture to simultaneously serve all different application scenarios. Specifically, it introduces an innovative star topology that adapts to the unique characteristics of each specific scenario. In this structure, the shared network serves as the core node for knowledge sharing, while the dedicated network for each scenario is connected only to this central node, enabling efficient knowledge transfer and cross-scenario collaboration. SAR Net can predict a user's interests in a specific network based on the characteristics of the user's scene or target item, and flexibly extract specific network-related information in multiple different scenarios. M-scan is an advanced neural network model optimized specifically for complex recommendation system tasks. Utilizing a multi-stage cross-attention mechanism, the model efficiently integrates historical user behavior data with current interaction features, significantly improving the accuracy and personalization of recommendation results. The EDDA model is a deep learning model for cross-domain recommendation systems. It aims to improve the performance of recommendation systems by enhancing inter-domain differences and adaptability. Ours refers to the trained network model. Here, SB, MMOE, PLE, Star, SAR Net, M-scan, and EDDA are reference network models. RelaImpr represents the relative improvement rate.
[0178] In order to solve the problems described in the background technology, the present invention obtains an initial data set, merges and divides the initial data set to obtain multiple scene division data sets, wherein the initial data set includes multiple initial data, and the initial data includes: user identification code, execution time, execution scene, content label, interaction label. It can be seen that when obtaining the initial data set, the present invention takes into account the initial data with large errors that may exist in the initial data set. Therefore, the initial data set is filtered to reduce the interference of the initial data with large errors, thereby improving the accuracy of the subsequent identification of the target positive-negative sample set in multiple scene division data sets. By eliminating abnormal initial data, the energy consumption required for subsequent model training can be reduced, and the accuracy of model training can be improved. A user-interaction graph is constructed using a scene partitioning data set, a random walk operation is performed on the user-interaction graph to obtain a random walk vector set, the random walk vector set is summarized to obtain multiple random walk vector sets, multiple target positive-negative sample sets are obtained based on the multiple random walk vector sets, the multiple target positive-negative sample sets are divided using a preset partitioning ratio to obtain a training sample set and a test sample set. It can be seen that when the present invention identifies the target negative sample, it does not select a random negative sample as the target negative sample, but identifies the target negative sample through a random walk and a negative sample screening relationship, thereby improving the accuracy of the target negative sample obtained, and thereby improving the accuracy of the data used when training the model. An optimized network model including an optimized BPR function and an optimized regularization strength function is constructed. It can be seen that the optimized network model constructed by the present invention not only considers inter-scene factors but also intra-scene factors, and sets an optimized BPR function and an optimized regularization strength function to improve the learning ability of the model and the accuracy of the model prediction. The optimized network model is trained using the training sample set to obtain a trained network model. After the trained network model is confirmed to be the preset target network model using the test sample set, the performance reference diagram is obtained using the trained network model and the pre-confirmed reference network model set to implement the training of the trained network model. It can be seen that when the optimized network model is trained, the present invention takes into account factors such as possible over-training, which in turn leads to energy waste when training the model. Therefore, a step-by-step training and evaluation form is adopted to evaluate whether the model has completed training. When evaluating whether the model has completed training, factors under different circumstances are also considered to improve the accuracy of judging whether the model training has been completed. Therefore, the present invention can improve the accuracy of model training and reduce the energy consumption required for model training.
[0179] like Figure 2 , which is a functional module diagram of a multi-business scenario recommendation modeling system based on collaborative filtering provided by an embodiment of the present invention.
[0180] The multi-business scenario recommendation modeling system 100 based on collaborative filtering of the present invention can be installed in an electronic device. Depending on the functions implemented, the multi-business scenario recommendation modeling system 100 based on collaborative filtering may include a training data preprocessing module 101, a positive-negative data partitioning module 102, a network model construction module 103, and a network model training and evaluation module 104. The module of the present invention may also be referred to as a unit, which refers to a series of computer program segments that can be executed by an electronic device processor and can perform fixed functions, and is stored in the memory of the electronic device.
[0181] The training data preprocessing module 101 is used to obtain an initial data set, merge and divide the initial data set to obtain multiple scene division data sets, wherein the initial data set includes multiple initial data, and the initial data includes: user identification code, execution time, execution scene, content label, and interaction label;
[0182] The positive-negative data division module 102 is configured to perform the following operations on each of the multiple scene division data sets:
[0183] constructing a user-interaction graph using the scene partitioning dataset, performing a random walk operation on the user-interaction graph to obtain a random walk vector set, and summarizing the random walk vector set to obtain multiple random walk vector sets;
[0184] Acquire multiple target positive and negative sample sets based on multiple random walk vector sets, and divide the multiple target positive and negative sample sets using a preset division ratio to obtain a training sample set and a test sample set;
[0185] The network model construction module 103 is used to construct an optimized network model including an optimized BPR function and an optimized regularization strength function;
[0186] The network model training evaluation module 104 is used to train the optimized network model using the training sample set to obtain a trained network model, and after confirming that the trained network model is a preset target network model using the test sample set, obtain a performance reference diagram using the trained network model and the pre-confirmed reference network model set to achieve training of the trained network model.
[0187] In detail, the modules in the collaborative filtering-based multi-business scenario recommendation modeling system 100 in the embodiment of the present invention are used in the same manner as above. Figure 1 The same technical means are used in the multi-business scenario recommendation modeling method based on collaborative filtering and can produce the same technical effects, so they will not be repeated here.
[0188] like Figure 3, which is a structural diagram of an electronic device for implementing a multi-business scenario recommendation modeling method based on collaborative filtering provided by an embodiment of the present invention.
[0189] The electronic device 1 may include a processor 10, a memory 11 and a bus 12, and may also include a computer program stored in the memory 11 and executable on the processor 10, such as a multi-business scenario recommendation modeling method program based on collaborative filtering.
[0190] The memory 11 includes at least one type of readable storage medium, including flash memory, a removable hard disk, a multimedia card, a card-type memory (e.g., SD or DX memory), a magnetic memory, a magnetic disk, an optical disk, etc. In some embodiments, the memory 11 may be an internal storage unit of the electronic device 1, such as a removable hard disk of the electronic device 1. In other embodiments, the memory 11 may also be an external storage device of the electronic device 1, such as a plug-in removable hard disk, a Smart Media Card (SMC), a Secure Digital (SD) card, a flash memory card, etc. equipped on the electronic device 1. Furthermore, the memory 11 includes both the internal storage unit of the electronic device 1 and an external storage device. The memory 11 can be used not only to store application software installed on the electronic device 1 and various types of data, such as the code of a collaborative filtering-based multi-business scenario recommendation modeling method program, but also to temporarily store data that has been output or is about to be output.
[0191] In some embodiments, the processor 10 may be comprised of an integrated circuit, such as a single packaged integrated circuit or a plurality of packaged integrated circuits with the same or different functions, including a combination of one or more central processing units (CPUs), microprocessors, digital processing chips, graphics processors, and various control chips. The processor 10 is the control core (control unit) of the electronic device, connecting the various components of the electronic device using various interfaces and circuits. It executes programs or modules stored in the memory 11 (e.g., a collaborative filtering-based multi-business scenario recommendation modeling method program) and calls data stored in the memory 11 to perform various functions of the electronic device 1 and process data.
[0192] The bus 12 may be a peripheral component interconnect (PCI) bus or an extended industry standard architecture (EISA) bus. The bus 12 may be divided into an address bus, a data bus, a control bus, etc. The bus 12 is configured to enable communication between the memory 11 and at least one processor 10, etc.
[0193] Figure 3 Only the electronic device with components is shown, and it can be understood by those skilled in the art that Figure 3 The structure shown does not constitute a limitation on the electronic device 1 , and may include fewer or more components than shown in the figure, or combine certain components, or arrange the components differently.
[0194] For example, although not shown, the electronic device 1 may further include a power source (e.g., a battery) to power various components. Preferably, the power source may be logically connected to the at least one processor 10 via a power management system, thereby enabling functions such as charge management, discharge management, and power consumption management through the power management system. The power source may further include any components such as one or more DC or AC power sources, a recharging system, a power failure detection circuit, a power converter or inverter, and a power status indicator. The electronic device 1 may further include various sensors, Bluetooth modules, Wi-Fi modules, etc., which are not further described here.
[0195] Furthermore, the electronic device 1 may also include a network interface. Optionally, the network interface may include a wired interface and / or a wireless interface (such as a WI-FI interface, a Bluetooth interface, etc.), which is generally used to establish a communication connection between the electronic device 1 and other electronic devices.
[0196] Optionally, the electronic device 1 may further include a user interface, which may be a display or an input unit (such as a keyboard). Optionally, the user interface may also be a standard wired interface or a wireless interface. Optionally, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, or an OLED (Organic Light-Emitting Diode) touchscreen. The display may also be appropriately referred to as a display screen or a display unit, and is used to display information processed by the electronic device 1 and to display a visual user interface.
[0197] The collaborative filtering-based multi-business scenario recommendation modeling method program stored in the memory 11 of the electronic device 1 is a combination of multiple instructions. When running in the processor 10, it can achieve:
[0198] Acquire an initial data set, merge and divide the initial data set to obtain multiple scene-divided data sets, wherein the initial data set includes multiple initial data, and the initial data includes: user identification code, execution time, execution scene, content label, and interaction label;
[0199] The following operations are performed on each of the multiple scene division datasets:
[0200] constructing a user-interaction graph using the scene partitioning dataset, performing a random walk operation on the user-interaction graph to obtain a random walk vector set, and summarizing the random walk vector set to obtain multiple random walk vector sets;
[0201] Acquire multiple target positive and negative sample sets based on multiple random walk vector sets, and divide the multiple target positive and negative sample sets using a preset division ratio to obtain a training sample set and a test sample set;
[0202] Construct an optimization network model including optimizing BPR function and optimizing regularization strength function;
[0203] The optimized network model is trained using the training sample set to obtain a training network model. After the training network model is confirmed to be a preset target network model using the test sample set, a performance reference diagram is obtained using the training network model and the pre-confirmed reference network model set to achieve training of the training network model.
[0204] Specifically, the specific implementation method of the processor 10 for the above instructions can refer to Figures 1 to 3 The description of the relevant steps in the corresponding embodiments will not be repeated here.
[0205] Furthermore, if the modules / units integrated into the electronic device 1 are implemented as software functional units and sold or used as independent products, they may be stored in a computer-readable storage medium. The computer-readable storage medium may be volatile or non-volatile. For example, the computer-readable medium may include any entity or system capable of carrying the computer program code, a recording medium, a USB flash drive, a mobile hard drive, a magnetic disk, an optical disk, a computer memory, or a read-only memory (ROM).
[0206] The present invention further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program. When the computer program is executed by a processor of an electronic device, the computer program can implement:
[0207] Acquire an initial data set, merge and divide the initial data set to obtain multiple scene-divided data sets, wherein the initial data set includes multiple initial data, and the initial data includes: user identification code, execution time, execution scene, content label, and interaction label;
[0208] The following operations are performed on each of the multiple scene division datasets:
[0209] constructing a user-interaction graph using the scene partitioning dataset, performing a random walk operation on the user-interaction graph to obtain a random walk vector set, and summarizing the random walk vector set to obtain multiple random walk vector sets;
[0210] Acquire multiple target positive and negative sample sets based on multiple random walk vector sets, and divide the multiple target positive and negative sample sets using a preset division ratio to obtain a training sample set and a test sample set;
[0211] Construct an optimization network model including optimizing BPR function and optimizing regularization strength function;
[0212] The optimized network model is trained using the training sample set to obtain a training network model. After the training network model is confirmed to be a preset target network model using the test sample set, a performance reference diagram is obtained using the training network model and the pre-confirmed reference network model set to achieve training of the training network model.
[0213] In the several embodiments provided by the present invention, it should be understood that the disclosed devices, systems and methods can be implemented in other ways. For example, the system embodiments described above are only exemplary, and actual implementations may have other division methods.
[0214] The modules described as separate components may or may not be physically separate, and the components shown as modules may or may not be physical units, that is, they may be located in one place or distributed across multiple network elements. Some or all of the modules may be selected to achieve the purpose of the solution of this embodiment according to actual needs.
[0215] In addition, the functional modules in various embodiments of the present invention may be integrated into a single processing unit, each unit may exist physically separately, or two or more units may be integrated into a single unit. The aforementioned integrated units may be implemented in the form of hardware or hardware plus software functional modules.
[0216] It will be apparent to those skilled in the art that the present invention is not limited to the details of the exemplary embodiments described above, and that the present invention can be implemented in other specific forms without departing from the spirit or essential characteristics of the present invention.
[0217] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not limiting. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solutions of the present invention may be modified or replaced by equivalents without departing from the spirit and scope of the technical solutions of the present invention.
Claims
1. A multi-business scenario recommendation modeling method based on collaborative filtering, characterized by: The method comprises: Acquire an initial data set, merge and divide the initial data set to obtain multiple scene-divided data sets, wherein the initial data set includes multiple initial data, and the initial data includes: user identification code, execution time, execution scene, content label, and interaction label; The following operations are performed on each of the multiple scene division datasets: constructing a user-interaction graph using the scene partitioning dataset, performing a random walk operation on the user-interaction graph to obtain a random walk vector set, and summarizing the random walk vector set to obtain multiple random walk vector sets; Acquire multiple target positive and negative sample sets based on multiple random walk vector sets, and divide the multiple target positive and negative sample sets using a preset division ratio to obtain a training sample set and a test sample set; The step of obtaining multiple target positive and negative sample sets based on multiple random walk vector sets includes: Using the user identification code, multiple cross-scene vector sets are identified from the multiple random walk vector sets, wherein the user identification code corresponds one-to-one to the cross-scene vector set; Matrix construction is performed on each of the multiple cross-scenario vector sets to obtain multiple user behavior matrices; The following operations are performed on each of the multiple user behavior matrices: Sequentially extracting initial user behavior matrices from the multiple user behavior matrices, and removing the extracted initial user behavior matrices from the multiple user behavior matrices to obtain multiple filtered user behavior matrices; Calculate the matrix similarity between the initial user behavior matrix and each of the multiple filtered user behavior matrices using a pre-built cosine similarity relationship to obtain a matrix similarity set; Sort the matrix similarities in the matrix similarity set in descending order to obtain a matrix similarity sequence; Using a preset extraction value, a plurality of extraction matrix similarities are identified in the matrix similarity sequence, and using the plurality of extraction matrix similarities, a plurality of extraction similarity matrices are identified in the plurality of screening user behavior matrices, wherein the number of the extraction matrix similarities is the extraction number; Using the plurality of extracted similarity matrices, identifying similar execution item sets in a plurality of scene partitioning data sets; Using the initial user behavior matrix, target positive sample sets are identified in multiple scene-divided datasets. Target positive samples are samples that have interaction tags with content tags. Using similar executed item sets, target negative sample sets are identified in multiple scene segmentation datasets. Target negative samples refer to samples that have not been executed in both the item set corresponding to the initial user behavior matrix and the similar executed item set in the multiple scene segmentation datasets. Associating the target positive sample set and the target negative sample set to obtain a target positive-negative sample set, and aggregating the target positive-negative sample set to obtain multiple target positive-negative sample sets; An optimized network model including an optimized BPR function and an optimized regularization strength function is constructed; the optimized network model is trained using a training sample set to obtain a trained network model; after confirming that the trained network model is a preset target network model using the test sample set, a performance reference diagram is obtained using the training network model and a pre-confirmed reference network model set to realize the training of the training network model.
2. The collaborative filtering-based multi-business scenario recommendation modeling method according to claim 1, characterized in that: The initial data set is merged and divided to obtain multiple scene division data sets, including: According to the user identification code corresponding to the initial data, the initial data in the initial data set are respectively aggregated to obtain multiple user-divided data sets, and the following operation is performed on each of the multiple user-divided data sets: Sort the user partition data in the user partition data set in descending order of execution time to obtain a user partition data sequence; Initial partition data is sequentially extracted from the user partition data sequence, and the following operations are performed on the extracted initial partition data: Extracting adjacent partition data from a user partition data sequence using the initial partition data, and extracting switching partition data from the user partition data sequence using the adjacent partition data, wherein the adjacent partition data is adjacent to and lags behind the extracted initial partition data, and wherein the switching partition data is adjacent to and lags behind the adjacent partition data; Calculate the absolute difference between the execution time corresponding to the initial partition data and the execution time corresponding to the switch partition data to obtain the user response time; Comparing the user response time with a preset false touch time threshold; If the user response time is less than or equal to the false touch time threshold, the adjacent segmentation data is removed from the user segmentation data sequence, and the user segmentation data sequence after removing the adjacent segmentation data is used as the user segmentation data sequence, and the process returns to the step of extracting the adjacent segmentation data from the user segmentation data sequence using the initial segmentation data until it is confirmed that the user segmentation data sequence is the preset target segmentation data sequence; The target partition data sequences are summarized to obtain a target partition data sequence set. The target partition data in the target partition data sequence set are summarized using the execution scenarios corresponding to the initial data to obtain multiple scenario partition data sets.
3. The collaborative filtering-based multi-business scenario recommendation modeling method according to claim 2, characterized in that: The method of confirming that the user divided data sequence is a preset target divided data sequence includes: When adjacent partition data is removed from the user partition data sequence, the number of removed adjacent partition data is accumulated to obtain the removal number; Counting the number of user-divided data in the user-divided data sequence to obtain a reference number; Calculate the ratio of the number of rejections to the reference number to obtain the rejection ratio; Comparing the rejection ratio with a preset ratio threshold; If the elimination ratio is greater than or equal to the ratio threshold, the user divided data sequence is eliminated; Otherwise, if it is confirmed that each user segmentation data in the user segmentation data sequence is extracted and the elimination ratio is less than the ratio threshold, the user segmentation data sequence is confirmed as the target segmentation data sequence.
4. The collaborative filtering-based multi-business scenario recommendation modeling method according to claim 3, characterized in that: The optimized BPR function is as follows: ; in, Represents the optimized BPR function, Indicates the first of multiple execution scenarios corresponding to the initial data set An execution scenario, Indicates multiple execution scenarios corresponding to the initial data set, Indicates the first of multiple user identification codes corresponding to the initial data set A user identification code, Indicates that the user There are interactive tags with content tags in each execution scenario. Indicates that the user There is no interaction tag between the content tag and the execution scenario, among which, , Indicates in The training sample set extracted from the execution scenario, , represents the dynamic sample weight, ,in, represents the marginal coefficient, represents the average score difference between the target positive and negative samples in the training sample set, is a learnable parameter used to adjust the overall scale of the margin, Indicates that in multiple execution scenarios The sampling probability of users interacting with content tags in each execution scenario, Indicates that in multiple execution scenarios The sampling probability that the user does not interact with the content tag in the execution scenario.
5. The collaborative filtering-based multi-business scenario recommendation modeling method according to claim 4, characterized in that: The method of training the optimized network model using the training sample set to obtain the training network model includes: Using the preset batch division ratio, multiple batch training sample sets are extracted from the training sample set, batch training sample sets are extracted from the multiple batch training sample sets in sequence, and the following operations are performed on the extracted batch training sample sets: The optimized network model is trained using a batch training sample set, and an initial reference value of the optimized network model after training is obtained through the optimized BPR function; Sequentially filling the initial reference values into a pre-constructed blank sequence to obtain an initial reference value sequence; Get the initial AUC value sequence of the optimized network model after training; Initial reference values are sequentially extracted from the initial reference value sequence, and the following operations are performed on each of the extracted initial reference values: Using the extracted initial reference value, identifying an iterative reference value in the initial reference value sequence, wherein the iterative reference value is adjacent to the extracted initial reference value and lags behind the extracted initial reference value; Calculating an iteration difference ratio using the initial reference value and the iteration reference value, and using the iteration reference value as the extracted initial reference value, returning to the step of using the extracted initial reference value to identify the iteration reference value in the initial reference value sequence, summarizing the iteration difference ratios to obtain an iteration difference ratio set, and obtaining an iteration difference ratio sequence based on the iteration difference ratio set; Using a preset difference ratio threshold, identifying a target difference ratio sequence in the iterative difference ratio sequence, wherein the target difference ratio sequence includes a plurality of target difference ratios, and all of the target difference ratios are less than or equal to the difference ratio threshold; Extract reference difference ratios in the target difference ratio sequence in sequence, and perform the following operations on the extracted reference difference ratios: Using the reference difference ratio, identifying adjacent difference ratios in the target difference ratio sequence, wherein the adjacent difference ratio is adjacent to the reference difference ratio and lags behind the reference difference ratio; Calculating the difference between the reference difference ratio and the adjacent difference ratio to obtain an adjacent difference ratio, and after confirming that the adjacent difference ratio is less than the reference difference ratio and the adjacent difference ratio is less than a preset adjacent threshold, using the adjacent difference ratio as the reference difference ratio, returning to the step of using the reference difference ratio to determine the adjacent difference ratio in the target difference ratio sequence, and counting the number of times the adjacent difference ratio is less than the reference difference ratio and the adjacent difference ratio is less than the preset adjacent threshold, to obtain a reference number; When the reference number reaches a preset reference threshold and the initial AUC value sequence is confirmed to be a preset target AUC value sequence, a training network model is obtained.
6. The collaborative filtering-based multi-business scenario recommendation modeling method according to claim 5, characterized in that: The step of using the test sample set to confirm that the training network model is a preset target network model includes: Obtaining a test reference value and a test AUC value based on the test sample set and the training network model; Extracting a final reference value and a final AUC value from the initial reference value sequence and the initial AUC value sequence respectively, and calculating the product of a preset first error ratio and the final reference value to obtain a verification reference value; Obtain a verification AUC value using the preset second error ratio and the final AUC value; After confirming that the test reference value is less than or equal to the verification reference value and the test AUC value is greater than or equal to the verification AUC value, the training network model is confirmed to be the target network model.
7. The collaborative filtering-based multi-business scenario recommendation modeling method according to claim 6, characterized in that: The method of obtaining a performance reference map using the training network model and the pre-confirmed reference network model set includes: Obtain a validation data set for performance comparison, and use the training network model, validation data set, and reference network model set to obtain a training AUC value set, a comparison AUC value set, a training index value set, and a comparison index value set, wherein the comparison AUC value and the comparison index value correspond one-to-one to the reference network model; A line graph is drawn using the training AUC value and the comparison AUC value set as well as the training index value and the comparison index value set to obtain a performance reference graph.
8. A multi-business scenario recommendation modeling system based on collaborative filtering, characterized by: The system comprises: A training data preprocessing module is used to obtain an initial data set, merge and divide the initial data set to obtain multiple scene division data sets, wherein the initial data set includes multiple initial data, and the initial data includes: user identification code, execution time, execution scene, content label, and interaction label; The positive-negative data partitioning module is used to perform the following operations on each of the multiple scene partitioning data sets: constructing a user-interaction graph using the scene partitioning dataset, performing a random walk operation on the user-interaction graph to obtain a random walk vector set, and summarizing the random walk vector set to obtain multiple random walk vector sets; Acquire multiple target positive and negative sample sets based on multiple random walk vector sets, and divide the multiple target positive and negative sample sets using a preset division ratio to obtain a training sample set and a test sample set; The step of obtaining multiple target positive and negative sample sets based on multiple random walk vector sets includes: Using the user identification code, multiple cross-scene vector sets are identified from the multiple random walk vector sets, wherein the user identification code corresponds one-to-one to the cross-scene vector set; Matrix construction is performed on each of the multiple cross-scenario vector sets to obtain multiple user behavior matrices; The following operations are performed on each of the multiple user behavior matrices: Sequentially extracting initial user behavior matrices from the multiple user behavior matrices, and removing the extracted initial user behavior matrices from the multiple user behavior matrices to obtain multiple filtered user behavior matrices; Calculate the matrix similarity between the initial user behavior matrix and each of the multiple filtered user behavior matrices using a pre-built cosine similarity relationship to obtain a matrix similarity set; Sort the matrix similarities in the matrix similarity set in descending order to obtain a matrix similarity sequence; Using a preset extraction value, a plurality of extraction matrix similarities are identified in the matrix similarity sequence, and using the plurality of extraction matrix similarities, a plurality of extraction similarity matrices are identified in the plurality of screening user behavior matrices, wherein the number of the extraction matrix similarities is the extraction number; Using the plurality of extracted similarity matrices, identifying similar execution item sets in a plurality of scene partitioning data sets; Using the initial user behavior matrix, target positive sample sets are identified in multiple scene-divided datasets. Target positive samples are samples that have interaction tags with content tags. Using similar executed item sets, target negative sample sets are identified in multiple scene segmentation datasets. Target negative samples refer to samples that have not been executed in both the item set corresponding to the initial user behavior matrix and the similar executed item set in the multiple scene segmentation datasets. Associating the target positive sample set and the target negative sample set to obtain a target positive-negative sample set, and aggregating the target positive-negative sample set to obtain multiple target positive-negative sample sets; The network model construction module is used to construct an optimized network model including an optimized BPR function and an optimized regularization strength function; The network model training and evaluation module is used to train the optimized network model using the training sample set to obtain a trained network model. After confirming that the trained network model is the preset target network model using the test sample set, the performance reference diagram is obtained using the trained network model and the pre-confirmed reference network model set to realize the training of the trained network model.
Citation Information
Patent Citations
Cross-domain recommendation and model training method and device
CN112307256A
Multi-behavior recommendation system based on behavior perception fusion graph convolutional network
CN116385077A