Activity recall matching method, system and equipment in game scene and medium
By synchronizing activity configuration data and user portrait data in real time, combining activity rule matching and collaborative filtering algorithms, a personalized activity recommendation list is generated, and through reinforcement learning optimization, the problem of game operators recalling and matching game activities is solved, improving activity conversion rate and user participation.
Patent Information
- Application Number
- CN202411606153.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-12
- Publication Date
- 2025-02-28
AI Technical Summary
Game operators face the problem of how to accurately and quickly recall and match a large number of diverse and multi-scene game activities. Traditional methods are inefficient and difficult to adapt to the rapidly changing market environment and user needs.
By constructing the Redis cache cluster, synchronize activity configuration data in real time, combining the preset activity rule matching engine and collaborative filtering algorithm, a personalized activity recommendation list is generated, and the recommendation list is optimized through reinforcement learning algorithm.
It realizes accurate matching and personalized push of activities, significantly improves event conversion rate and user participation, and provides strong support for the continuous optimization of game operation strategies.
Smart Images

Figure CN119524429A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of game operation technology, and in particular to an activity recall matching method, system, device and medium in a game scenario. Background Art
[0002] In the current fierce market competition environment of the gaming industry, game operators are facing huge challenges, including how to effectively maintain existing users, improve user activity and payment ability, and how to maximize the long-term value of games by extending the life cycle of games. In order to achieve these goals, game operators need to continuously launch diversified operation strategies and content to attract and retain users.
[0003] However, with the increase in game projects and the interweaving of game nodes, especially during major holidays and when events are intensively output, game operators are faced with the challenge of how to accurately and quickly recall and match a large number of diverse, multi-scenario game events. Traditional event recall and matching methods often rely on manual configuration and static rules, which is not only inefficient but also difficult to adapt to the rapidly changing market environment and user needs. Summary of the invention
[0004] The purpose of the present invention is to provide an activity recall matching method, system, device and medium in a game scenario, which realizes accurate matching and personalized push of activities, significantly improves activity conversion rate and user participation, and provides strong support for the continuous optimization of game operation strategies, so as to solve at least one of the above-mentioned prior art problems.
[0005] In a first aspect, the present invention provides an activity recall matching method in a game scenario, the method specifically comprising:
[0006] According to the business demand data of the game activity, activity configuration data is set, and the activity configuration data is stored in a MySQL database, wherein the activity configuration data includes basic configuration data and advanced configuration data;
[0007] Build a Redis cache cluster, monitor the MySQL database through the Canal component, and synchronize the activity configuration data to the Redis cache cluster in real time;
[0008] Acquire user portrait attribute data from a preset game user database in real time, and determine the activity recall result of each user by matching the user portrait attribute data with the activity configuration data based on a preset activity rule matching engine;
[0009] Collecting each user's participation behavior data on an activity, analyzing the participation behavior data using a collaborative filtering algorithm, and generating an activity recommendation list, wherein the activity recommendation list includes a plurality of recommended activities;
[0010] According to each user's feedback data on the recommended activities, the activity recommendation list is optimized and adjusted through a reinforcement learning algorithm.
[0011] In a second aspect, the present invention provides an activity recall matching system in a game scenario, the system specifically comprising:
[0012] A first matching module, used to set activity configuration data according to business demand data of the game activity, and store the activity configuration data in a MySQL database, wherein the activity configuration data includes basic configuration data and advanced configuration data;
[0013] The second matching module is used to build a Redis cache cluster, monitor the MySQL database through the Canal component, and synchronize the activity configuration data to the Redis cache cluster in real time;
[0014] A third matching module is used to obtain user portrait attribute data from a preset game user database in real time, and determine the activity recall result of each user by matching the user portrait attribute data with the activity configuration data based on a preset activity rule matching engine;
[0015] a fourth matching module, configured to collect each user's participation behavior data on an activity, analyze the participation behavior data using a collaborative filtering algorithm, and generate an activity recommendation list, wherein the activity recommendation list includes a plurality of recommended activities;
[0016] The fifth matching module is used to optimize and adjust the activity recommendation list through a reinforcement learning algorithm according to the feedback data of each user on the recommended activities.
[0017] In a third aspect, the present invention provides a computer device, comprising: a memory and a processor and a computer program stored in the memory, and when the computer program is executed on the processor, an activity recall matching method in a game scenario as described in any one of the above methods is implemented.
[0018] In a fourth aspect, the present invention provides a computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the activity recall matching method in a game scenario as described in any one of the above methods is implemented.
[0019] Compared with the prior art, the present invention has at least one of the following technical effects:
[0020] 1. The present invention realizes accurate matching and personalized push of activities, significantly improves activity conversion rate and user participation, and provides strong support for the continuous optimization of game operation strategies.
[0021] 2. The present invention improves the real-time performance and efficiency of data synchronization by synchronizing active configuration data to the Redis cache cluster in real time.
[0022] 3. The present invention realizes precise grasp of user needs by constructing accurate and real-time user portraits.
[0023] 4. The present invention uses collaborative filtering algorithm and reinforcement learning algorithm to optimize and adjust the activity recommendation list, thereby improving the accuracy of activity recommendations and user satisfaction.
[0024] 5. The present invention can accurately and quickly recall and match a large number of diverse, multi-scenario game activities, thereby improving user activity and payment ability, extending the life cycle of the game, and maximizing the long-term value of the game. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0026] Figure 1 It is a flowchart of an activity recall matching method in a game scenario provided by an embodiment of the present invention;
[0027] Figure 2 It is a structural diagram of an activity recall matching system in a game scenario provided by an embodiment of the present invention;
[0028] Figure 3 It is a structural schematic diagram of a computer device provided by an embodiment of the present invention. DETAILED DESCRIPTION
[0029] In the following description, specific details such as specific system structures, technologies, etc. are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the present application may also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present application.
[0030] It should be understood that when used in the present specification and the appended claims, the term "comprising" indicates the presence of described features, wholes, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or combinations thereof.
[0031] It should also be understood that the term “and / or” used in the specification and appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes these combinations.
[0032] As used in the specification and appended claims of this application, the term "if" can be interpreted as "when" or "uponce" or "in response to determining" or "in response to detecting", depending on the context. Similarly, the phrase "if it is determined" or "if [described condition or event] is detected" can be interpreted as meaning "uponce it is determined" or "in response to determining" or "uponce [described condition or event] is detected" or "in response to detecting [described condition or event]", depending on the context.
[0033] In addition, in the description of the present application specification and the appended claims, the terms "first", "second", "third", etc. are only used to distinguish the descriptions and cannot be understood as indicating or implying relative importance.
[0034] References to "one embodiment" or "some embodiments" etc. described in the specification of this application mean that one or more embodiments of the present application include specific features, structures or characteristics described in conjunction with the embodiment. Therefore, the statements "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. that appear in different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways. The terms "including", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized in other ways.
[0035] In the embodiment of the present application, the execution subject of the process includes a terminal device, which includes but is not limited to: a server, a computer, a smart phone, a tablet computer, and other devices capable of executing the method disclosed in the present application. Figure 1 A flow chart of an activity recall matching method in a game scenario disclosed in an embodiment of the present invention is shown, and the details are as follows:
[0036] S101, setting activity configuration data according to business demand data of the game activity, and storing the activity configuration data in a MySQL database, wherein the activity configuration data includes basic configuration data and advanced configuration data.
[0037] In this embodiment, according to business needs, operational activities are configured through the activity orchestration background. The basic configuration specifies the game scope and channel scope in which the activity is effective, and the advanced configuration specifies the version, region, service, portrait features and other attributes.
[0038] Specifically, according to the business needs of the game activities, analyze and extract the attributes and formats required for the activity configuration data, design a data structure that meets the business needs, and create a corresponding data table in the MySQL database. Use Web front-end technologies such as HTML, CSS, and JavaScript to design the configuration data entry interface, and use form controls such as text boxes, drop-down lists, and radio buttons to implement the configuration data entry function. At the same time, use JavaScript to perform preliminary format verification on the data entered by the user, including data type and value range. Further format the activity configuration data entered through the interface, convert the numerical type data, map the enumeration type data, and standardize the date and time type data. At the same time, it includes checking whether the required fields are empty, whether the values are within the legal range, and whether the date and time are logical.
[0039] Using Java language and JDBC technology, the connection channel between the application and the database is established through the connection driver of the MySQL database. The formatted and verified active configuration data is inserted into the corresponding data table through SQL insert statements, using precompiled statements and parameter binding to avoid SQL injection attacks.
[0040] After the data is inserted, the inserted activity configuration data is read from the data table through SQL query statements, and the query results are compared with the original configuration data to verify whether the data is completely and accurately stored in the database. At the same time, the corresponding data access interface is called in the game activity business system to read the configuration data in the database and check whether the configuration data can be read and used normally.
[0041] S102, building a Redis cache cluster, monitoring the MySQL database through a Canal component, and synchronizing the activity configuration data to the Redis cache cluster in real time.
[0042] In this embodiment, according to business needs, the active configuration data table that needs to be cached is determined, and the table name and primary key information of the data table are recorded; for the active configuration data table that needs to be cached, Canal listening tasks are respectively established on the Canal server; the binlog log of the MySQL database is parsed by the Canal component to obtain data change information; according to the parsed data change information, it is determined whether the changed table name is an active configuration table that needs to be synchronized; if the changed table name is an active configuration table that needs to be synchronized, a synchronization message is sent to the Kafka message queue as a trigger source for Redis cache update; according to the table name and primary key value of the synchronization message, a consistent hashing algorithm is used to calculate the target node of the Redis cluster where the data should be stored; the changed data is written to the target node to update the Redis cache; through the RedisSentinel or Redis Cluster mechanism, Redis master-slave replication and automatic fault switching are configured to achieve high availability of the Redis cache cluster; when the active configuration data in the MySQL database changes, the Canal component captures the change event in real time and triggers the data synchronization process.
[0043] For example, by analyzing the business needs of game activities, it is determined that the activity configuration data tables that need to be cached are activity_config and activity_rule, and the table names and the corresponding primary key field activity_id are recorded. On the Canal server, monitoring tasks are established for these two tables respectively. The Canal component obtains the data change information of these two tables by parsing the MySQL binlog log. When the table name of the parsed change event matches activity_config or activity_rule, the change data is encapsulated as a synchronization message, including the table name, primary key value, change type, and changed data, and sent to the Kafka topic: activity_config_sync. The Redis cache update service subscribes to the topic. After receiving the synchronization message, the consistent hashing algorithm is used to calculate the target storage node of the data in the Redis cluster according to the table name and primary key value in the message, and the change data is written to Redis. The consistent hashing algorithm uses the FNV1_32_HASH algorithm to hash the primary key value, and then modulo the hash value by the number of Redis nodes to ensure that data with the same primary key is always assigned to the same Redis node. The Redis cluster adopts a 1-master-2-slave deployment mode, and uses Redis Sentinel to achieve master-slave replication and automatic fault switching. When the master node fails, Sentinel automatically promotes one of the slave nodes to the new master node to ensure the high availability of the Redis cache service. When the active configuration data in the MySQL database changes, the Canal component can capture the change event in real time, trigger the data synchronization process, and ensure that the cached data is consistent with the database.
[0044] In some embodiments, in the above step S102, monitoring the MySQL database through the Canal component and synchronizing the activity configuration data to the Redis cache cluster in real time specifically includes:
[0045] According to the business demand data, determine the activity configuration data table that needs to be cached, and establish a corresponding Canal listening task for each activity configuration data table on the Canal server;
[0046] Parse the binlog log of the MySQL database through the Canal component to obtain data change information;
[0047] According to the data change information, determine the activity configuration data table that needs to be changed, and form a synchronization message;
[0048] According to the synchronization message, the activity configuration data table that needs to be modified is extracted from the MySQL database and stored in the Redis cache cluster.
[0049] In this embodiment, according to the business demand data, the active configuration data table that needs to be cached is determined, and a corresponding listening task is established on the Canal server for each data table. The binlog log of the MySQL database is parsed by the Canal server to obtain the data change information of the data table. According to the data change information, it is determined whether there is an active configuration data table that needs to be synchronized. If so, a corresponding synchronization message is formed. Distributed message queue technology is used to publish the synchronization message to the message queue to ensure the reliable transmission and sequentiality of the message. The data synchronization module is deployed on each node of the Redis cache cluster and subscribes to the synchronization message in the message queue. The data synchronization module extracts the active configuration data table that needs to be changed from the MySQL database based on the received synchronization message. The extracted active configuration data table is stored in the corresponding node of the Redis cache cluster, and the consistent hashing algorithm is used to ensure the balanced distribution of data in the cluster, thereby improving the query efficiency and availability of the cache.
[0050] Exemplarily, according to the business demand data analysis, it is determined that the activity configuration data tables that need to be cached mainly include the activity basic information table, the activity rule table, the activity prize table, etc. On the Canal server, the Canal-admin management platform is used to establish corresponding Canal listening tasks for these three data tables respectively, and the batch size of the listening task is set to 1000, indicating that a maximum of 1000 change records are listened to each time. The Canal component parses the binlog log of the MySQL database, adopts the incremental subscription binlog method, uses the Kafka message queue to cache data change information, and then consumes the Kafka message through the Canal-client. According to the metadata such as the table name and operation type in the data change information, the activity configuration data table that needs to be synchronized is determined, and the change data is encapsulated as a synchronization message in JSON format. According to the table name and primary key id in the synchronization message, the hash data structure of Redis is used, and "table_name:primary_key" is used as the key to extract the activity configuration data that needs to be changed from the MySQL database, serialize it into a JSON string, and store it in the Redis cache cluster, and set a reasonable expiration time, such as the end time of the activity plus one day. The entire synchronization process uses an asynchronous non-blocking approach to ensure the eventual consistency of cached data.
[0051] S103, obtaining user portrait attribute data from a preset game user database in real time, and determining the activity recall result of each user by matching the user portrait attribute data with the activity configuration data based on a preset activity rule matching engine.
[0052] In this embodiment, user portrait attribute data is stored, including user basic information (such as region, gender, age, etc.), game behavior data (such as game time, game preferences, consumption records, etc.) and other related attributes. Based on the preset activity rules, the user portrait attribute data and activity configuration data are matched to determine the user's activity recall results.
[0053] The preset activity rule matching engine is set with basic rules and advanced rules: matching basic rules, such as game matching, exclusion of some game rules; game channels, exclusion of channel rules, if the rules are passed, continue to execute downwards, if the rules are not passed, the activity will be abandoned and the next activity will be judged. Matching advanced rules, such as whether the SDK version meets the conditions, whether the region and service range meets the conditions, whether the frequency of user participation in the activity is within the valid range, etc., if the rules are passed, continue to execute downwards, if the rules are not passed, the activity will be abandoned and the next activity will be judged.
[0054] In some embodiments, in the above step S103, the real-time acquisition of user portrait attribute data from a preset game user database specifically includes:
[0055] Using Hadoop data warehouse as game user database, using ETL tools to collect original game user data and importing it into the ODS layer of the Hadoop data warehouse;
[0056] Performing data cleaning and data preprocessing on the original game user data of the ODS layer to obtain game user standard data, and storing the game user standard data in the DWD layer of the Hadoop data warehouse;
[0057] Performing integration and conversion processing on the game user standard data of the DWD layer to obtain user portrait indicators, wherein the user portrait indicators include user activity indicators, purchase frequency indicators and consumption amount derivative indicators;
[0058] The K-Means clustering algorithm is used to perform data clustering on the user portrait indicators to obtain user portrait attribute data of different user groups.
[0059] In this embodiment, the original game user data is obtained from the game business database through tools such as Sqoop, and the data is imported into the HDFS file system of Hadoop. According to the pre-set data quality rules, the original game user data in HDFS is cleaned, and noise data such as missing values and outliers are removed to obtain clean standardized game user data. The cleaned standardized game user data is imported into the ODS layer table of the Hadoop data warehouse through Hive, and partitions are set according to the data update frequency. Hive SQL is used to aggregate the standardized game user data of the ODS layer, such as statistics on user activity, purchase frequency and other indicators in each time period, and the aggregation results are stored in the wide table corresponding to the DWD layer. Based on the wide table data of the DWD layer, tools such as Spark SQL or Python are used to design and implement user tag calculation logic according to business needs, such as dividing high, medium and low consumption levels according to the consumption amount. The calculated user tag data is written back to the DWD layer user tag table of the Hadoop data warehouse, and associated with the original user attribute data to form a complete user portrait. Use tools such as Sqoop and Kettle to export the user portrait data in the Hadoop data warehouse to external databases such as MySQL for use by downstream applications such as game operations and recommendations.
[0060] Based on the user portrait index data, data preprocessing technology is used to clean and normalize the data to obtain standardized user attribute data; based on the standardized user attribute data, the K-Means clustering algorithm is used to divide users with high similarity into the same group by calculating the Euclidean distance between data points; based on the clustering results, the portrait attribute data of each user group is statistically analyzed to obtain the user characteristics of different groups; based on the user characteristics of different groups, the association rule mining algorithm is used to discover the association between different attributes and obtain the behavioral patterns of user groups; based on the behavioral patterns of user groups, the decision tree algorithm is used to establish a user classification model, automatically classify new users, and predict the group they belong to; based on the group to which the user belongs, a personalized recommendation algorithm is used to recommend products or services suitable for the user's characteristics to the user, thereby improving user satisfaction and loyalty; based on user feedback data, the user portrait index system is optimized, the parameters of the clustering algorithm are dynamically adjusted, and the accuracy and precision of user group division are continuously improved.
[0061] Exemplarily, Hadoop data warehouse is used as the game user database, and ETL tools such as Sqoop are used to collect original game user data from source systems such as MySQL, including basic user information, login logs, consumption records, etc., and import them into the ODS layer of Hadoop's HDFS file system. In the data cleaning and preprocessing stage, Hive SQL and MapReduce programs are used to perform operations such as deduplication, data type conversion, and missing value filling on the original data of the ODS layer to generate standardized game user data and store it in the DWD layer of the Hive table. Then, Hive SQL is used to aggregate and calculate the DWD layer data to obtain user activity indicators (such as monthly active days, login frequency, etc.), purchase frequency indicators (such as monthly purchase times, purchase interval days, etc.) and consumption amount derivative indicators (such as monthly average consumption, single highest consumption, etc.), which constitute user portrait indicators. Then, the K-Means clustering algorithm is used, with the cluster number K=5, the number of iterations as 10 times, and the convergence threshold as 0.01, to cluster the user portrait indicators and obtain five user groups such as high activity and high consumption, medium activity and medium consumption.
[0062] In some embodiments, the preset activity rule matching engine determines the activity recall result of each user by matching the user portrait attribute data and the activity configuration data, specifically including:
[0063] Adopting the Apriori association rule mining algorithm, analyzing the association rules between the user portrait attribute data and the activity configuration data, taking the user portrait attribute as input and the activity configuration data as output, setting the minimum support and confidence thresholds, and generating frequent item sets and association rules;
[0064] Constructing activity participation condition judgment rules according to the frequent item sets and the association rules;
[0065] Based on the activity participation condition judgment rule, traverse each user to judge whether each user meets the activity participation condition, and if the user meets the activity participation condition, add the user ID of the user to the activity recall result set;
[0066] The users in the activity recall result set are sorted according to the activity priority field in the activity configuration data.
[0067] In this embodiment, user portrait attribute data and activity configuration data are obtained, the data is preprocessed, and the data format is unified. The Apriori association rule mining algorithm is used to set the minimum support and confidence thresholds to mine the association rules between user portrait attributes and activity configurations. Based on the mined frequent item sets and association rules, activity participation condition judgment rules are constructed, and attribute combinations with high correlation are used as participation conditions. The portrait attribute data of the target user is obtained, and based on the constructed activity participation condition judgment rules, it is determined whether the user meets the activity participation conditions. If the target user meets the activity participation conditions, the activity is recommended to the user; if the conditions are not met, the activity is not recommended. Collect user feedback data on recommended activities, including participation status, satisfaction, etc., and add the feedback data to the user portrait attributes. Based on the updated user portrait attribute data, regularly re-mine association rules and update activity participation condition judgment rules to adapt to changes in user preferences.
[0068] Get the activity participation condition judgment rules and user list data. Traverse the user list and make condition judgments for each user according to the activity participation condition judgment rules. If the user meets the participation conditions, add the user ID of the user to the activity recall result set. Get the priority field information from the activity configuration data. According to the priority field, use the sorting algorithm to sort the users in the recall result set to obtain the sorted user list. Determine the sorted user list as the final list of activity participating users. Store the activity participating user list in the database for use in subsequent activity processes.
[0069] S104, collecting each user's participation behavior data on activities, analyzing the participation behavior data using a collaborative filtering algorithm, and generating an activity recommendation list, wherein the activity recommendation list includes a plurality of recommended activities.
[0070] In this embodiment, the user's participation behavior data on various activities is collected in real time through the background system of the game or application, including but not limited to the type, time, frequency, duration, completion, feedback evaluation, etc. of the user's participation in the activity. At the same time, the user's basic information is collected, such as age, gender, region, interest preferences, etc., so as to conduct more accurate user portrait construction and collaborative filtering analysis later.
[0071] Clean and organize the collected user activity participation behavior data to remove invalid or abnormal data. Standardize the data to ensure that data from different sources and formats can be uniformly compared and analyzed. Construct a user-activity rating matrix based on the user's activity behavior data. The rows of the matrix represent users, the columns represent activities, and the values in the matrix represent the user's rating of the activity (which can be calculated based on factors such as the user's completion of the activity, duration, or feedback evaluation).
[0072] Then, apply the collaborative filtering algorithm:
[0073] User-based collaborative filtering: Find other users with similar interests to the target user and recommend activities that similar users have participated in but the target user has not yet participated in. This can be achieved by calculating the similarity between users (such as cosine similarity, Pearson correlation coefficient, etc.).
[0074] Activity-based collaborative filtering: Analyze the similarity between activities and recommend other activities that are similar to the activities the user has participated in. This can be achieved by calculating the similarity between activities (cosine similarity, Pearson correlation coefficient, etc. can also be used).
[0075] Based on the results of the collaborative filtering algorithm, a list of recommended activities is generated for each user. The activities in the recommended list are sorted according to the predicted score, so that users can see the activities that are most likely to be of interest first.
[0076] As user activity participation behavior data is continuously updated, the collaborative filtering algorithm is re-run regularly to generate the latest activity recommendation list. The effectiveness of the recommendation algorithm is continuously monitored and evaluated, and the algorithm is optimized and adjusted based on the evaluation results to improve the accuracy and effectiveness of the recommendation.
[0077] In this embodiment, through the collaborative filtering algorithm, personalized activity recommendations can be provided to users based on their interest preferences and behavioral characteristics, which helps to improve users' satisfaction and participation in the recommended activities.
[0078] In some embodiments, in the above step S104, the use of a collaborative filtering algorithm to analyze the participation behavior data to generate an activity recommendation list specifically includes:
[0079] Based on the participation behavior data, using a collaborative filtering algorithm to calculate each user's interest in the non-participated activities;
[0080] Generating a preliminary activity recommendation list for each user based on the interest level;
[0081] The similarity between users is calculated, and the preliminary activity recommendation list is optimized and adjusted according to the similarity to form a target activity recommendation list.
[0082] In this embodiment, historical participation behavior data of the user is obtained, including information on activities that the user has participated in, activity types, participation time, etc., to form a user participation behavior feature vector; based on the user participation behavior feature vector, a collaborative filtering algorithm is used to calculate the user's interest score for activities that the user has not participated in, and the higher the interest score, the greater the user's potential interest in the activity; based on the user's interest score, a sorted preliminary activity recommendation list is generated for each user, and the activities in the list are sorted from high to low according to the interest score; the similarity between users is calculated, and an algorithm such as cosine similarity can be used to calculate the similarity between users based on the user participation behavior feature vector; based on the user similarity, the preliminary activity recommendation list is optimized and adjusted, and activities that similar users like are recommended to the target user with a higher priority; after optimization and adjustment, a personalized activity recommendation list for the target user is formed, and the recommendation list comprehensively considers the user's own interest preferences and the preferences of similar users; the user's participation feedback on the recommended activities is continuously tracked, and the recommendation model is optimized and updated according to the user's actual participation behavior to improve the accuracy of the recommendation and user satisfaction.
[0083] Exemplarily, firstly, a collaborative filtering algorithm is used to calculate the user's interest in the activities that he / she has not participated in. Based on the collaborative filtering of users, a user-activity matrix is constructed with users as the center, and the matrix elements are the number of times users participate in the activities. The Pearson correlation coefficient is used to calculate the similarity between users, and the threshold is set to 8 to filter out users with high similarity. For the activities that these similar users participate in but the target user does not participate in, the interest scores of the target user in these activities are calculated by weighting the user similarity. Then, a preliminary recommendation list containing 10 activities is generated for each user according to the order of interest scores from high to low. Then, the similarity between users is calculated, and the cosine similarity algorithm is used to calculate the similarity between two users with the number of times users participate in the activities as the feature vector. The threshold is set to 7 to obtain a set of similar users. For each activity in the preliminary recommendation list, the participation rate in the set of similar users is counted, and if the participation rate is less than 20%, it is removed from the recommendation list. Finally, the optimized and adjusted recommendation list is used as the personalized activity recommendation result for the target user, and the length of the recommendation list is controlled within 5. By mining user interests through collaborative filtering and optimizing recommendation results using user similarities, we have formed a personalized activity recommendation process from user behavior to similarity calculation to recommendation generation and adjustment, which improves the accuracy of recommendations and user acceptance.
[0084] S105, optimizing and adjusting the activity recommendation list through a reinforcement learning algorithm according to each user's feedback data on the recommended activities.
[0085] In this embodiment, the user's click, browsing time, and participation feedback data on the recommended activities are obtained. These data are generated by the user when interacting with the recommendation system. According to the feedback data, multiple feedback indicators such as click-through rate, browsing time, and participation are combined to convert into a reward function. The DQN reinforcement learning algorithm is used to optimize and adjust the recommended activity list according to the reward function. The DQN algorithm selects the optimal action to optimize the recommendation list by learning the state-action value function. The ε-greedy strategy is used to balance exploration and utilization, where ε is the exploration probability, and the activity with the highest Q value is selected with a probability of 1-ε, and other activities are randomly selected with a probability of ε, so as to give the system the opportunity to explore new recommended activities. The changing trend of the recommendation effect is continuously monitored, and the hyperparameters of the DQN algorithm are dynamically adjusted according to the changing trend, including the learning rate, the size of the experience replay pool, and the network structure. The recommendation performance is further optimized according to the improvement of recommendation accuracy and user satisfaction.
[0086] In some embodiments, in the above step S105, optimizing and adjusting the activity recommendation list by using a reinforcement learning algorithm based on each user's feedback data on the recommended activity specifically includes:
[0087] Setting user feedback indicators for recommendation activities, wherein the feedback indicators include click-through rate, browsing time, and participation;
[0088] Determine the feedback data of each user on the recommendation activity according to the feedback indicator, and set the reward function according to the feedback data;
[0089] Based on the reward function, the DQN reinforcement learning algorithm is used to select the optimal action to optimize the activity recommendation list, and the hyperparameters of the DQN reinforcement learning algorithm are dynamically adjusted according to the change trend of the recommendation effect of the activity recommendation list.
[0090] In this embodiment, preset feedback indicators are obtained, and the feedback indicators include at least click-through rate, browsing time and participation; for each user, the feedback data of the user on the recommended activity is determined according to the feedback indicators; a reward function is established according to the feedback data to quantify the effect of the recommended activity; the feedback data is used as the input of the DQN reinforcement learning algorithm, and the optimal recommended action is selected through the algorithm to obtain an optimized activity recommendation list; the recommendation effect change trend of the activity recommendation list is obtained, and if the change trend meets the preset conditions, the hyperparameters of the DQN reinforcement learning algorithm are dynamically adjusted; the above steps are repeated until the recommendation effect tends to stabilize or the preset optimization goal is reached; the optimized activity recommendation list is output and pushed to the user, and the user feedback is continuously monitored to achieve adaptive optimization of the recommendation system.
[0091] Exemplarily, when setting the user's feedback index for the recommended activity, it can be achieved by recording the user's click rate, browsing time, and participation in the recommended activity list. For example, the click rate can be calculated by counting the ratio of the number of times the user clicks on the recommended activity to the total number of recommended activities, the browsing time can be obtained by recording the user's stay time on the recommended activity details page, and the participation can be measured by counting the user's registration, sharing, and commenting on the recommended activity. The system will use the logistic regression algorithm to establish a reward function model based on these feedback indicator data, where the input of the model is the feedback indicator data, the output is the reward value, and the model parameters are obtained through training. When the DQN reinforcement learning algorithm is used to optimize the recommendation list, user feedback is used as the environment state of reinforcement learning, and the adjustment of the recommendation list is used as the action of the intelligent agent. The reward function is used to guide the intelligent agent to learn, and finally the optimal recommendation list is obtained. During the optimization process, the system will monitor the changing trend of the recommendation effect in real time, such as calculating the average click rate, average browsing time, average participation and other indicators of the recommended activities. When these indicators show a continuous downward trend, the system will automatically adjust the hyperparameters of the DQN algorithm, such as the learning rate, exploration rate, etc., to adapt to changes in user preferences. Through this dynamic tuning method, the recommendation system can continuously learn and optimize, providing users with more accurate and personalized activity recommendation services.
[0092] In some embodiments, the method further comprises:
[0093] Use the Prometheus monitoring system to regularly collect key indicator data of the activity recall service, including interface response time, request volume, and error rate;
[0094] A time series anomaly detection algorithm is used to perform real-time analysis on the key indicator data to determine whether there are any abnormalities in the activity recall service.
[0095] In this embodiment, by setting predefined key indicator thresholds in the Prometheus monitoring system, the collected key indicator data such as the response time, request volume and error rate of the activity recall service interface are compared and analyzed in real time. If one or more key indicator data are detected to exceed the preset threshold range, the activity recall service is determined to be abnormal. For the abnormal situation of the activity recall service, an abnormal detection algorithm based on statistical principles is adopted, an abnormal detection model is established by analyzing the historical time series data, and a sliding time window mechanism is used to perform abnormal detection on the latest collected time series data. If it is detected that the data point deviates from the normal mode, a potential service abnormality is warned. When an abnormality is detected in the activity recall service, a clustering algorithm is used to classify the abnormal situation according to the characteristic pattern of the abnormal indicator data, and different types of abnormal patterns are obtained. Corresponding emergency treatment measures such as current limiting, fuse breaking, downgrading, etc. are taken for different abnormal types to ensure the availability and stability of the activity recall service. By statistically analyzing the key indicator data of the activity recall service, a regression algorithm is used to establish a mathematical model between the key indicator and the service status, and the model is used to predict the future status of the service. If the prediction result shows that the service may be abnormal, preventive measures are taken in advance to avoid risks. The incremental learning algorithm is used to update and optimize the anomaly detection model online, and the model parameters are continuously adjusted according to the latest collected time series data to improve the accuracy and real-time performance of anomaly detection, so that the system can quickly respond to changes in service status and handle abnormal situations in a timely manner. By statistically analyzing the key indicator data such as the request volume and response time of the activity recall service, a short-term trend prediction model is established using the time series prediction algorithm to predict the indicator data for a period of time in the future. If the prediction result exceeds the normal range, resources are deployed in advance to cope with possible service pressure and ensure the stable operation of the service. According to the business characteristics and data characteristics of the activity recall service, a multi-dimensional, multi-indicator comprehensive anomaly detection method is adopted. By integrating multiple key indicators to construct a composite anomaly indicator, a machine learning algorithm is used to establish an anomaly detection model to improve the comprehensiveness and accuracy of anomaly detection, and to achieve real-time monitoring and early warning of abnormal behaviors in many aspects of the service.
[0096] Exemplarily, the Prometheus monitoring system is used to collect key indicator data of the activity recall service every 5 seconds, including interface response time, request volume and error rate. Among them, the threshold of the interface response time is set to 500 milliseconds, the threshold of the request volume is set to 1000 times / minute, and the threshold of the error rate is set to 1%. The time series anomaly detection algorithm ARIMA is used to analyze the collected key indicator data in real time, and by establishing a time series model, the indicator data trend in the future period is predicted and compared with the actual collected data. When there is a large deviation between the actual data and the predicted data, it is determined to be an abnormal situation. For example, when the interface response time exceeds 800 milliseconds for 5 minutes, the request volume is less than 500 times / minute for 5 minutes, and the error rate exceeds 2% for 5 minutes, the system automatically issues an alarm and notifies the relevant operation and maintenance personnel to handle it. At the same time, the system will automatically generate a problem analysis report based on the abnormal indicator data to assist the operation and maintenance personnel to quickly locate the cause of the problem and ensure the stable operation of the activity recall service.
[0097] Reference Figure 2 An embodiment of the present invention provides an activity recall matching system 2 in a game scenario, and the system 2 specifically includes:
[0098] The first matching module 201 is used to set activity configuration data according to the business demand data of the game activity, and store the activity configuration data in a MySQL database, wherein the activity configuration data includes basic configuration data and advanced configuration data;
[0099] The second matching module 202 is used to build a Redis cache cluster, monitor the MySQL database through the Canal component, and synchronize the activity configuration data to the Redis cache cluster in real time;
[0100] The third matching module 203 is used to obtain user portrait attribute data from a preset game user database in real time, and determine the activity recall result of each user by matching the user portrait attribute data with the activity configuration data based on a preset activity rule matching engine;
[0101] The fourth matching module 204 is used to collect each user's participation behavior data on the activities, analyze the participation behavior data using a collaborative filtering algorithm, and generate an activity recommendation list, wherein the activity recommendation list includes a plurality of recommended activities;
[0102] The fifth matching module 205 is used to optimize and adjust the activity recommendation list through a reinforcement learning algorithm according to the feedback data of each user on the recommended activities.
[0103] It is understandable that if Figure 1The contents of the embodiment of the activity recall matching method in the game scenario shown in FIG. 1 are all applicable to the embodiment of the activity recall matching system in the game scenario. The functions specifically implemented by the embodiment of the activity recall matching system in the game scenario are similar to those in FIG. 1 . Figure 1 The activity recall matching method embodiment in the game scenario shown is the same as that in the embodiment shown in FIG. Figure 1 The beneficial effects achieved by the activity recall matching method embodiment in the game scenario shown are also the same.
[0104] It should be noted that the information interaction, execution process and other contents between the above-mentioned systems are based on the same concept as the embodiment of the method of the present invention. Their specific functions and technical effects can be found in the method embodiment part and will not be repeated here.
[0105] Those skilled in the art can clearly understand that, for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In practical applications, the above-mentioned function allocation can be completed by different functional units and modules as needed, that is, the internal structure of the system can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated in a processing unit, or each unit can exist physically separately, or two or more units can be integrated in one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, which will not be repeated here.
[0106] Reference Figure 3 The embodiment of the present invention further provides a computer device 3, comprising: a memory 302 and a processor 301 and a computer program 303 stored in the memory 302. When the computer program 303 is executed on the processor 301, an activity recall matching method in a game scenario as described in any one of the above methods is implemented.
[0107] The computer device 3 may be a computing device such as a desktop computer, a notebook, a PDA, or a cloud server. The computer device 3 may include, but is not limited to, a processor 301 and a memory 302. Those skilled in the art will appreciate that Figure 3 It is only an example of computer device 3 and does not constitute a limitation on computer device 3. It may include more or fewer components than shown in the figure, or a combination of certain components, or different components, for example, it may also include input and output devices, network access devices, etc.
[0108] The processor 301 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc.
[0109] In some embodiments, the memory 302 may be an internal storage unit of the computer device 3, such as a hard disk or memory of the computer device 3. In other embodiments, the memory 302 may also be an external storage device of the computer device 3, such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. equipped on the computer device 3. Further, the memory 302 may also include both an internal storage unit of the computer device 3 and an external storage device. The memory 302 is used to store an operating system, an application program, a boot loader (Boot Loader), data, and other programs, such as the program code of the computer program, etc. The memory 302 may also be used to temporarily store data that has been output or is to be output.
[0110] An embodiment of the present invention further provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the activity recall matching method in a game scenario as described in any one of the above methods is implemented.
[0111] In this embodiment, if the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present application implements all or part of the processes in the above-mentioned embodiment method, which can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a computer-readable storage medium. When the computer program is executed by the processor, the steps of the above-mentioned various method embodiments can be implemented. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium can at least include: any entity or device that can carry the computer program code to the camera / terminal device, recording medium, computer memory, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), electric carrier signal, telecommunication signal and software distribution medium. For example, a USB flash drive, a mobile hard disk, a disk or an optical disk. In some jurisdictions, according to legislation and patent practice, computer-readable media cannot be electric carrier signals and telecommunication signals.
[0112] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0113] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0114] In the embodiments disclosed in the present application, it should be understood that the disclosed devices / terminal equipment and methods can be implemented in other ways. For example, the device / terminal equipment embodiments described above are only schematic. For example, the division of the modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0115] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
Claims
1. An activity recall matching method in a game scenario, characterized in that: The method specifically comprises: According to the business demand data of the game activity, activity configuration data is set, and the activity configuration data is stored in a MySQL database, wherein the activity configuration data includes basic configuration data and advanced configuration data; Build a Redis cache cluster, monitor the MySQL database through the Canal component, and synchronize the activity configuration data to the Redis cache cluster in real time; Acquire user portrait attribute data from a preset game user database in real time, and determine the activity recall result of each user by matching the user portrait attribute data with the activity configuration data based on a preset activity rule matching engine; Collecting each user's participation behavior data on an activity, analyzing the participation behavior data using a collaborative filtering algorithm, and generating an activity recommendation list, wherein the activity recommendation list includes a plurality of recommended activities; According to each user's feedback data on the recommended activities, the activity recommendation list is optimized and adjusted through a reinforcement learning algorithm.
2. The method according to claim 1, characterized in that The monitoring of the MySQL database through the Canal component and synchronizing the activity configuration data to the Redis cache cluster in real time specifically includes: According to the business demand data, determine the activity configuration data table that needs to be cached, and establish a corresponding Canal listening task for each activity configuration data table on the Canal server; Parse the binlog log of the MySQL database through the Canal component to obtain data change information; According to the data change information, determine the activity configuration data table that needs to be changed, and form a synchronization message; According to the synchronization message, the activity configuration data table that needs to be modified is extracted from the MySQL database and stored in the Redis cache cluster.
3. The method according to claim 1, characterized in that The real-time acquisition of user portrait attribute data from a preset game user database specifically includes: Using Hadoop data warehouse as game user database, using ETL tools to collect original game user data and importing it into the ODS layer of the Hadoop data warehouse; Performing data cleaning and data preprocessing on the original game user data of the ODS layer to obtain game user standard data, and storing the game user standard data in the DWD layer of the Hadoop data warehouse; Performing integration and conversion processing on the game user standard data of the DWD layer to obtain user portrait indicators, wherein the user portrait indicators include user activity indicators, purchase frequency indicators and consumption amount derivative indicators; The K-Means clustering algorithm is used to perform data clustering on the user portrait indicators to obtain user portrait attribute data of different user groups.
4. The method according to claim 1, characterized in that: The preset activity rule matching engine determines the activity recall result of each user by matching the user portrait attribute data and the activity configuration data, specifically including: Adopting the Apriori association rule mining algorithm, analyzing the association rules between the user portrait attribute data and the activity configuration data, taking the user portrait attribute as input and the activity configuration data as output, setting the minimum support and confidence thresholds, and generating frequent item sets and association rules; Constructing activity participation condition judgment rules according to the frequent item sets and the association rules; Based on the activity participation condition judgment rule, traverse each user to judge whether each user meets the activity participation condition, and if the user meets the activity participation condition, add the user ID of the user to the activity recall result set; The users in the activity recall result set are sorted according to the activity priority field in the activity configuration data.
5. The method according to claim 1, characterized in that The using of a collaborative filtering algorithm to analyze the participation behavior data to generate an activity recommendation list specifically includes: Based on the participation behavior data, using a collaborative filtering algorithm to calculate each user's interest in the non-participated activities; Generating a preliminary activity recommendation list for each user based on the interest level; The similarity between users is calculated, and the preliminary activity recommendation list is optimized and adjusted according to the similarity to form a target activity recommendation list.
6. The method according to claim 1, characterized in that The optimization and adjustment of the activity recommendation list by using a reinforcement learning algorithm based on each user's feedback data on the recommended activity specifically includes: Setting user feedback indicators for recommendation activities, wherein the feedback indicators include click-through rate, browsing time, and participation; Determine the feedback data of each user on the recommendation activity according to the feedback indicator, and set the reward function according to the feedback data; Based on the reward function, the DQN reinforcement learning algorithm is used to select the optimal action to optimize the activity recommendation list, and the hyperparameters of the DQN reinforcement learning algorithm are dynamically adjusted according to the change trend of the recommendation effect of the activity recommendation list.
7. The method according to any one of claims 1 to 6, characterized in that The method further comprises: Use the Prometheus monitoring system to regularly collect key indicator data of the activity recall service, including interface response time, request volume, and error rate; A time series anomaly detection algorithm is used to perform real-time analysis on the key indicator data to determine whether there are any abnormalities in the activity recall service.
8. An activity recall matching system in a game scenario, characterized in that: The system specifically comprises: A first matching module, used to set activity configuration data according to business demand data of the game activity, and store the activity configuration data in a MySQL database, wherein the activity configuration data includes basic configuration data and advanced configuration data; The second matching module is used to build a Redis cache cluster, monitor the MySQL database through the Canal component, and synchronize the activity configuration data to the Redis cache cluster in real time; A third matching module is used to obtain user portrait attribute data from a preset game user database in real time, and determine the activity recall result of each user by matching the user portrait attribute data with the activity configuration data based on a preset activity rule matching engine; a fourth matching module, configured to collect each user's participation behavior data on an activity, analyze the participation behavior data using a collaborative filtering algorithm, and generate an activity recommendation list, wherein the activity recommendation list includes a plurality of recommended activities; The fifth matching module is used to optimize and adjust the activity recommendation list through a reinforcement learning algorithm according to the feedback data of each user on the recommended activities.
9. A computer device, characterized in that: include: A memory, a processor and a computer program stored in the memory, when the computer program is executed on the processor, implements the activity recall matching method in the game scenario as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that: A computer program is stored thereon, and when the computer program is executed by a processor, the activity recall matching method in the game scenario according to any one of claims 1 to 7 is implemented.
Citation Information
Cited By
Data sharing method and system for multi-agent platform
CN120832328A