A game playing strategy generation system, method, device and medium

By generating a unified style embedding vector through style parameter extraction and embedding encoding modules, and combining it with the game engine and value network, the problem of strategy adaptation for traditional game agents under multiple rule types and dynamic card dealing structures is solved, achieving efficient game decision-making and behavior control, and improving the realism and controllability of the game.

CN122499478APending Publication Date: 2026-08-04ZHEJIANG CHANGTANG NETWORK CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
ZHEJIANG CHANGTANG NETWORK CO LTD
Filing Date
2026-06-25
Publication Date
2026-08-04

AI Technical Summary

Technical Problem

Traditional game-playing AI agents lack adaptability when faced with multiple types of rules and dynamic card dealing structures, resulting in fluctuating strategy decision-making performance, difficulty in achieving stable control and generalization consistency of game behavior, and low strategy generation efficiency.

Method used

The system employs a style parameter extraction module to parse the card dealing style configuration parameters, and a style embedding encoding module to generate a unified style embedding vector. By combining the game engine, value network, and policy network, it achieves controllable sampling and decision evaluation of the game state and outputs a conditional game action strategy distribution.

Benefits of technology

It improves the agent's ability to adapt to different distributions and regulate behavior during the game, enhances the realism and controllability of the game, and overcomes the shortcomings of traditional models such as poor adaptation to different card distributions, uncontrollable behavior, and inaccurate decision-making logic.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122499478A_ABST
    Figure CN122499478A_ABST
Patent Text Reader

Abstract

The application discloses a kind of playing strategy generation system, method, equipment and medium, it is related to computer technology field, including: style parameter extraction module reads game configuration file, random sampler output data or operation background instruction, parses dealing style configuration parameter and outputs structured style vector;Style embedding coding module carries out feature coding conversion to style vector by pre-set mapping function, generates the style embedding vector of corresponding dimension;Game engine module receives the configuration data related to card dealing, initializes and runs game process, and outputs game state and valid action mask;Value network module quantitatively evaluates game decision income, and outputs value evaluation information;Strategy network module outputs playing action strategy distribution according to game state, style embedding vector and valid action mask.It can improve the distribution adaptation ability, behavior control ability and decision rationality of game decision of intelligent agent, improve the reality and controllability of game.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of computer technology, and in particular to a game strategy generation system, method, device, and medium. Background Technology

[0002] In online competitive gaming scenarios with multiple game rules and dynamic random card dealing architectures, the server often applies customized constraints and distribution biases to the card dealing logic and game generation process, resulting in multiple card distribution patterns with different statistical characteristics under the same basic game rules. However, traditional game intelligence agents use fixed strategy modeling methods, which only adapt to a single, fixed card data distribution. When faced with multiple types of rules and dynamic card dealing structures, their ability to model and adapt to differentiated game distributions is insufficient. When there is a discrepancy between the card dealing style of the training environment and the actual operating environment, it is easy to cause fluctuations in strategy decision-making performance. The model has poor generalization consistency under different card distribution scenarios, and the decision logic is prone to inaccuracy, making it difficult to achieve stable control of game behavior. Moreover, conventional methods mostly use fixed environment single scenario training, multi-sub-model superposition deployment, or rely on implicit rules to passively adapt to changes in card dealing style. This not only results in low strategy generation efficiency, but also makes it difficult to achieve effective sampling of card dealing style samples, full recording of the game process, and reproduction and reuse of historical scenarios. Summary of the Invention

[0003] The purpose of this invention is to provide a game strategy generation system, method, device and medium that can overcome the shortcomings of traditional models such as poor adaptation across card distribution, uncontrollable behavior and inaccurate decision logic, improve the distribution adaptation ability, behavior control ability and decision rationality of intelligent agents in game decisions, and enhance the realism and controllability of the game.

[0004] To address the aforementioned technical problems, this invention provides a game strategy generation system, comprising: The style parameter extraction module is used to read game configuration files, random sampler output data, or operation backend instructions, parse the card dealing style configuration parameters, and output a structured style vector. The style embedding encoding module is used to perform feature encoding transformation on the style vector through a preset mapping function to generate a style embedding vector of the corresponding dimension. The game engine module is used to receive configuration data related to card dealing and initialization, run the game process, and output the game status and valid action mask. The value network module is used to quantify the benefits of game decisions based on the game state and the style embedding vector, and output value assessment information. The strategy network module is used to output a distribution of game action strategies carrying effective action mask constraints based on the game state, the style embedding vector, and the effective action mask.

[0005] To address the aforementioned technical problems, the present invention also provides a method for generating game strategies, comprising: The style parameter extraction module reads the game configuration file, random sampler output data, or operation backend instructions, parses the card dealing style configuration parameters, and outputs a structured style vector. The style embedding encoding module uses a preset mapping function to perform feature encoding transformation on the style vector to generate a style embedding vector of the corresponding dimension; The game engine module receives card-making and dealing configuration data, initializes and runs the game process, and outputs the game status and valid action mask. The value network module is used to quantitatively evaluate the benefits of game decisions based on the game state and the style embedding vector, and outputs value evaluation information. The policy network module outputs a distribution of game action policies with constraints of the effective action mask based on the game state, the style embedding vector, and the effective action mask.

[0006] To address the aforementioned technical problems, the present invention also provides an electronic device, comprising: a memory for storing a computer program; and a processor for executing the computer program to implement the steps of the above-described game strategy generation method.

[0007] To address the aforementioned technical problems, the present invention also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps of the aforementioned game strategy generation method.

[0008] The beneficial effects of this invention are as follows: The game strategy generation system provided by this invention analyzes the card-dealing style configuration parameters from multiple dimensions, including game configuration files, random sampler output data, and operational backend instructions, through a style parameter extraction module. It outputs a structured style vector, thereby establishing an explicit parameterization mechanism for card-dealing style, achieving controllable sampling, full recording, and accurate reproduction of card-dealing style. The style embedding encoding module performs feature encoding transformation on the style vector, generating a style embedding vector with unified dimensions, completing the mapping expression of style parameters to a network-understandable representation. The game engine module can receive card-making and card-dealing related configuration data, outputting game status and effective action masks, providing game environment and action constraints for decision evaluation under style conditions. The value network module can combine the game state and style embedding vector to quantify the benefits of game decisions, enabling the value network to explicitly depend on the style embedding vector and achieve conditional value assessment. The policy network module outputs a distribution of game action policies with effective action mask constraints based on the game state, style embedding vector, and effective action mask. This allows the policy function to be explicitly associated with the style embedding vector, achieving conditional policy generation and adapting to the game decision-making needs under different card dealing styles. This improves the efficiency of policy generation and overcomes the shortcomings of traditional models, such as poor adaptation across card dealing distributions, uncontrollable behavior, and inaccurate decision-making logic. It enhances the agent's distribution adaptation ability, behavior control ability, and decision rationality in game decisions, and also improves the realism and controllability of the game.

[0009] In addition, the present invention also provides a corresponding game strategy generation method, electronic device and computer-readable storage medium for the game strategy generation system, which have the same or corresponding technical features as the game strategy generation system mentioned above, and have the same effect. Attached Figure Description

[0010] To more clearly illustrate the embodiments of the present invention, the accompanying drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0011] Figure 1 This is a schematic diagram of the structure of the game strategy generation system provided in an embodiment of the present invention; Figure 2 A schematic diagram of the conditional policy network structure provided in an embodiment of the present invention; Figure 3 This is a schematic diagram of reward modulation provided in an embodiment of the present invention; Figure 4 This is a schematic diagram of the overall architecture of the game strategy generation system provided in this embodiment of the invention; Figure 5 This is a schematic diagram of the training phase process provided in an embodiment of the present invention; Figure 6 This is a schematic diagram of the inference stage process provided in an embodiment of the present invention; Figure 7 This is a flowchart of a game strategy generation method provided in an embodiment of the present invention. Detailed Implementation

[0012] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative effort are within the protection scope of the present invention.

[0013] It should be noted that, in the description of this invention, the terms "comprising," "including," or any other variations thereof are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. The terms "first," "second," etc., used in this invention are used to distinguish similar objects and are not used to describe a specific order or sequence.

[0014] To enable those skilled in the art to better understand the present invention, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments.

[0015] An embodiment of the present invention provides a game strategy generation system. Figure 1 This is a schematic diagram of the structure of the game strategy generation system provided in an embodiment of the present invention, as shown below. Figure 1 As shown, the system includes: The style parameter extraction module is used to read game configuration files, random sampler output data, or operation backend instructions, parse the card dealing style configuration parameters, and output a structured style vector S. The style embedding encoding module is used to perform feature encoding transformation on the style vector S through a preset mapping function to generate the style embedding vector Z of the corresponding dimension. The game engine module is used to receive configuration data related to card making and dealing, initialize and run the game process, and output the game state s and the effective action mask; The value network module is used to quantify the benefits of game decisions based on the game state s and the style embedding vector Z, and output value assessment information. The strategy network module is used to output the distribution of game action strategies with constraints of the effective action mask, based on the game state s, style embedding vector Z, and effective action mask.

[0016] It should be noted that the game-playing method of the present invention can be applied to board game scenarios, including turn-based board games such as Go, Chinese chess, international chess, and Gomoku; it can also be applied to card game scenarios, covering mahjong and various card games; it can also be applied to multi-agent turn-based decision-making scenarios, adapting to two-player and multi-player game tasks with state evolution, action selection, and reward feedback features; and it can also be applied to time-series strategy competition scenarios, suitable for various interactive competitive scenarios that require dynamic situation analysis, behavioral decision optimization, and stylized strategy generation.

[0017] The above modules can be divided into processes, services, or library components in the software. Dealing style refers to the overall game distribution characteristics (including card structure, tempo of play, degree of exposure of key information, etc.) reflected in the card-making mechanism. The card-making mechanism is the method of generating the game structure through rules controlled during the dealing phase. The style vector S is a structured set of parameters obtained by parameterizing the card-making rules, used to explicitly describe the distribution and constraints followed by the current dealing / making. The style embedding vector Z maps the style vector S (or discrete style label) to a low-dimensional dense vector representation usable by the model. The game state s is the current game information, including at least the hand, played cards, remaining cards or estimated information, rounds, and public actions. The effective action mask (also called the legal action mask) is a binary or 0 / 1 vector of the same dimension as logits, used to mask illegal actions and prevent the policy quality from being diluted by invalid dimensions. The policy function π is the mapping from state to action probability distribution given conditional input. The value function V / Q is the long-term reward estimate of the state or state-action pair under condition Z. Actions in the strategy distribution of game actions These are the valid operations that the agent can perform under the current rules, such as playing a card, eating, ponging, konging, winning, and passing.

[0018] Taking a mahjong scenario as an example, the style parameter extraction module can be used to read mahjong game configuration files, random sampler output data, or operation backend activity instructions, parse mahjong dealing and card-making style configuration parameters, and output a structured mahjong dealing style vector S; the style embedding encoding module can be used to perform feature encoding transformation on the mahjong dealing style vector S through a preset mapping function to generate a mahjong dealing style embedding vector Z of the corresponding dimension; the game engine module is used to receive mahjong card-making and dealing related configuration data, initialize the mahjong game and run the entire game process, and output the mahjong game state s and the effective card-playing action mask; the value network module is used to quantify and evaluate the long-term benefits of mahjong game decisions based on the mahjong game state s and the mahjong dealing style embedding vector Z, and output value evaluation information; the strategy network module is used to output the mahjong card-playing action strategy distribution with action mask constraints based on the mahjong game state s, the mahjong dealing style embedding vector Z, and the effective card-playing action mask.

[0019] The game strategy generation system provided in this embodiment of the invention can uniformly model multiple card-dealing styles. Through a style parameter extraction module, it can analyze card-dealing style configuration parameters from multiple dimensions, including game configuration files, random sampler output data, and operational backend instructions, outputting a standardized and structured style vector S. This establishes an explicit parameterization mechanism for card-dealing styles, enabling controllable sampling, full recording, and accurate reproduction of card-dealing styles. A style embedding encoding module performs feature encoding transformation on the style vector S, generating a style embedding vector Z with unified dimensions, completing the mapping expression of style parameters to a model-understandable representation. The game engine module can receive card-making and card-dealing related configuration data, complete the initialization and operation of the game process, and stably output the game state s and effective action masks, providing decision evaluation under style conditions. The game environment and action constraints are considered. The value network module can combine the game state s and style embedding vector Z to quantify the game decision payoff, enabling the value network to explicitly depend on the style embedding vector Z and achieve conditional value assessment. The policy network module outputs a distribution of game action policies with effective action mask constraints based on the game state s, style embedding vector Z, and effective action mask. This allows the policy function to be explicitly associated with the style embedding vector Z, achieving conditional policy generation and adapting to the game decision requirements under different card dealing styles. This improves the efficiency of policy generation and overcomes the shortcomings of traditional models, such as poor adaptation across card dealing distributions, uncontrollable behavior, and inaccurate decision logic. It enhances the agent's distribution adaptation ability, behavior control ability, and decision rationality in game decisions, and also improves the realism and controllability of the game.

[0020] Furthermore, in a specific implementation, the game strategy generation system provided in the above-mentioned embodiment of the present invention may also include: a card-making rule generation module, which is used to receive a style vector S, generate a card wall or starting hand allocation scheme that adapts to the style according to preset card-making and card-dealing parameter constraints, and output card-making and card-dealing related configuration data.

[0021] In implementation, this invention can read game configuration files, random samplers, or operational backend instructions through a style parameter extraction module, and uniformly compress and represent the card-making mechanism as a structured style vector S=[p1,p2,…,p n ]; where p1, p2, ..., p nThese are the various parameter components that constitute the card-dealing style vector S. Examples of each parameter component can be tailored or expanded according to the actual product line. p1 is the card type distribution control parameter, which can be used to set indicators such as the proportion of straights, triplets, pairs, and sequence density; p2 is the hand type tendency weight parameter, which can be used to configure the bias induction coefficient of hand types such as pure suit, all pairs, and mixed suit; p3 is the key card control parameter, which can be used to control the appearance or retention probability of cards such as treasure cards, honor cards, and wind cards; p4 is the local coherence control parameter, which constrains the probability of adjacent ordinal cards appearing together and the clustering degree of cards of the same suit; p5 is the confrontation strength parameter, which regulates the attack induction strength, the retention ratio of defensive cards, and the tendency of kong frequency, etc., as needed. In the future, p6, p7, etc. can be expanded as needed, all of which are uniformly called p. n .

[0022] The style vector S has constraints and sampling strategies. The first is rule setting: defining discrete style templates through an operational configuration table and providing adjustable ranges for continuous components. The second is training random sampling: uniformly distributing sampling within an effective convex hull or normalized simplex, sampling with beta distribution, or using Sobol low-discrepancy sequences to cover the high-dimensional style space. The third is hierarchical sampling: selecting a basic style template based on the activity ID, and then superimposing noise on continuous components within the template to improve the coverage of long-tail styles. The fourth is recording and reproduction: synchronously writing the style vector S, random seed, and configuration version number into the game metadata to support game tracing and accurate scenario reproduction. The constraints of the style vector S can follow the value range defined by preset card dealing and card-making parameters and the boundaries of business rules.

[0023] The style parameter extraction module can include a configuration instruction parsing unit, a style sampling generation unit, and a structured output unit. The configuration instruction parsing unit reads and parses style configuration instructions from the local game configuration file or the operations backend to obtain the original style configuration parameters. The style sampling generation unit calls a random sampler to perform hierarchical sampling and low-difference sequence sampling of the style vector S according to a preset sampling strategy to generate the original style parameters. The structured output unit performs normalization and validation on the parsed original style configuration parameters or the sampled original style parameters, and outputs a structured style vector S. These parameters can include the aforementioned p1, p2, ..., p... n The card-making rule generation module can receive a style vector S or equivalent configuration information, generate a card wall or starting hand distribution scheme that satisfies the card-making and dealing parameter constraints, and drive the dealing process. This enables the parameterized representation of the card-making mechanism, while being compatible with configuration-driven, random sampling, standardized output, and the ability to record and reproduce game processes.

[0024] Furthermore, in a specific implementation, in the game strategy generation system provided in the embodiments of the present invention, the style embedding encoding module can map the style vector S into a style embedding vector. ,in These are learnable parameters that can be jointly trained with policy networks and value networks.

[0025] The style embedding encoding module may include an input preprocessing unit, a feature embedding mapping unit, a feature regularization constraint unit, and an encoding parameter synchronization unit. The input preprocessing unit receives style vectors S, normalizes or hierarchically regularizes multiple consecutive style vectors S, and performs encoding mapping preprocessing on discrete style labels. The feature embedding mapping unit nonlinearly projects the preprocessed style vectors S onto a style embedding space of a set dimension using a learnable neural network mapping function to generate style embedding vectors Z. The feature regularization constraint unit applies normalization, orthogonal regularization, or contrast constraints to the style embedding vectors Z to enhance the separability of different card-dealing style representations. The encoding parameter synchronization unit iteratively updates the learnable parameters of the mapping function along with the parameters of the policy network and value network during model training to ensure that the style semantic representation is continuously optimized during training.

[0026] This invention is implemented using a neural network approach. Specific implementation methods include, but are not limited to: firstly, a continuous style vector S is non-linearly mapped to the style embedding space via a multi-layer perceptron (MLP). Secondly, the discrete style identifier is looked up in the embedding table and then projected through a linear layer or MLP to... Third, for mixed inputs consisting of discrete labels and continuous intensities, embedding is performed separately, followed by concatenation and unified projection; fourth, the style vector S is first L2 normalized or layer normalized before feature mapping to stabilize the training numerical scale. The model ultimately outputs a style embedding vector Z. d is a defined dimension (e.g., 16, 32, 64) that matches the width of the policy network. These are learnable parameters during the training phase. The style embedding vector Z is updated synchronously with the policy network and value network, enabling it to carry discriminative style semantics rather than arbitrary random vectors. Optionally, an orthogonal regularization or contrastive learning auxiliary task can be applied to the style embedding vector Z to further increase the separation of different style vectors S in the feature space. This approach is an optional embodiment and is not the only limiting implementation.

[0027] Furthermore, in specific implementations, in the game strategy generation system provided in the embodiments of the present invention, the game engine module may include a card-making and dealing adaptation unit, a game process control unit, an effective action generation unit, and a data output feedback unit. The card-making and dealing adaptation unit receives card-making and dealing related configuration data output by the card-making rule generation module, loads the card wall or starting hand allocation scheme, and completes the initial construction of the game's initial state. The game process control unit runs the entire game process, receives action instructions, executes game steps, and updates the game round, seat status, card wall information, and situation information until the game ends. The effective action generation unit generates an effective action mask for game state s based on preset game rules, masks illegal actions, and aligns with the output dimension of the strategy network. The data output feedback unit outputs game state s and, after the game ends, outputs the basic reward and hand type label.

[0028] It should be noted that the basic reward It is the scalar or vector reward signal before modulation, which is calculated according to the competition rules, such as the score for winning a hand and the penalty points for violations. It has not undergone additional reward modulation processing.

[0029] The game state s can be represented by selecting a subset of features as needed. The selected content must meet the requirements of normal game playability and mainly includes five types of information: The first type is hand card encoding: a single card is represented by a unique hot encoding or card identifier embedding method, which is compatible with multiple cards of the same type. It can be represented by a multi-set counting vector or sorted sequence encoding. The second type is the trajectory of played and discarded cards: independently encoded according to the multi-player game seats, and can be represented by time step trajectory expansion through multi-channel planar tensors. The third type is remaining card information: including the complete card wall inventory count (when the rules allow it to be visible) or estimated features derived from the game rules. The fourth type is situation information: including the current game round, field wind, circle wind, declared ready hand, current action seat, dowry card identifier, and history of kong, etc., which are all global game states. The fifth type is effective action mask: generated in real time by the rule engine, with dimensions consistent with the output of the policy network.

[0030] The final conditional input of the policy network can be fused in various ways, such as: through The game state encoding and style embedding vector can be directly concatenated; or, the game state encoding Encode(s) and style embedding vector Z can be deeply fused in the feature dimension through gating mechanism, FiLM layer, cross attention and other methods, and then input into the policy network backbone structure.

[0031] This invention is not limited to a single feature fusion implementation; it only requires that the style embedding vector Z be explicitly invoked and utilized by the policy network at every decision time. In engineering implementation, a non-trivial fusion approach can be adopted, that is, adding linear transformations or attention mechanisms to the simple concatenation to prevent style representation information from being overwhelmed by high-dimensional game state features, thus ensuring the effective guidance of style conditions for policy decisions.

[0032] Furthermore, in a specific implementation, in the game strategy generation system provided in the embodiments of the present invention, the value network module can be used to estimate the conditional state value V(s,Z) or the conditional action value Q(s,Z). The value network module (Z) can fit a Monte Carlo reward objective to complete value regression, and can also use the fitted value result as a policy gradient baseline to reduce gradient variance. The value network module can include a conditional value evaluation unit and a training fitting unit. The conditional value evaluation unit is used to construct a conditional value evaluation system based on the game state s and the style embedding vector Z, outputting conditional state value or conditional action value. The training fitting unit is used to perform regression fitting based on the conditional state value or conditional action value, combined with the Monte Carlo reward objective, and uses the fitting result as a policy gradient baseline; it also outputs value supervision signals for the reinforcement learning training module.

[0033] When employing a joint structure of policy network and value network, the value network outputs V(s,Z) or Q(s, ,Z); with Monte Carlo return Simultaneous constructive regression loss, or as a baseline. Reduce policy gradient variance. The value network can share the underlying encoder with the policy network to reduce parameters and computational cost, separating them only at the output head.

[0034] If the conditional action value Q(s,a,Z) form is adopted, action a can be embedded first, then concatenated with the hidden features of the game state and input into the Q network, and Monte Carlo reward can be used. As The regression objective can also be a hybrid objective combining n-step truncated Monte Carlo and bootstrapping. As long as the Monte Carlo term is dominant, it belongs to a variant implementation of the deep Monte Carlo (DMC) algorithm.

[0035] It should be noted that the Monte Carlo return It is the estimated return obtained by inversely summing the modulated immediate reward according to the discount factor γ from the decision time t to the end of the game, and used as the supervision target or policy gradient weight of DMC; it can also be used as... The difference between the value estimate and the objective value is used as a dominance metric for variance reduction. Deep Monte Carlo (DMC) is a class of algorithms that parameterizes the policy π and / or value V (or Q) using a deep neural network, calculates the Monte Carlo reward over the complete game trajectory, and updates the parameters via regression or policy gradient. In this invention, DMC can be used as the main training framework, rather than proximal policy pruning methods. The trajectory is based on the process of a single game. The sequence of conditional style embedding vectors Z can be used for rollout storage and batch processing. Rollout is the process of collecting trajectory samples by simulating several steps or the entire game under a fixed strategy and environment.

[0036] Furthermore, in a specific implementation, in the game strategy generation system provided in the embodiments of the present invention, the strategy network module can be used to input conditional game state representations and output the game action strategy distribution π( |s,Z), where, Let s be the game action to be executed, Z be the game state, and Z be the style embedding vector. The policy network module may include a feature access unit, a policy backbone operation unit, an action mask management unit, and a parameter synchronization unit. The feature access unit receives the game state s, the style embedding vector Z, and the valid action mask, performs preliminary encoding on the input game state s, and generates feature data usable for network computation. The policy backbone operation unit loads a pre-defined policy network structure, combines state features and style embedding information, completes action probability calculation and decision logic computation, outputs an initial action distribution, and outputs valid actions based on the valid action mask constraints. The action mask management unit verifies the action distribution output by the policy, shielding illegal action dimensions to ensure that the policy output is consistent with the valid action requirements and avoids invalid decision outputs. The parameter synchronization unit synchronously receives parameter update instructions from the training module, adjusts the parameters of the policy network weights in real time, ensures that the policy output is consistent with the global card dealing style and card-making rules, and optimizes the policy in conjunction with reinforcement learning training.

[0037] The strategy function of this invention takes the form: π( |s,Z)=Softmax(F(X)); where the backbone network F can be a Transformer, LSTM, CNN+MLP, or pure MLP network structure; after the network outputs the original action logic value, the logic value corresponding to the illegal action is first set to a minimum negative value through a valid action mask, and then normalized by Softmax to ensure that the probability is only distributed within the valid action space. In the inference stage, the exploration and conservatism of the temperature parameter τ can be introduced to adjust the strategy, and Softmax(logits / τ) is used to achieve flexible control.

[0038] In multi-agent game scenarios, each agent in the same game can share the same style embedding Z or use a sub-vector of style embedding Z according to the game faction; it can also learn an independent style bias for each game position. Overlaying a common style embedding Z. This invention can be naturally extended from a single agent to multiple agents.

[0039] Style embedding vector is given by Z= The generated data, after being concatenated, fused, or otherwise integrated with the game state s, are input into the same policy network to participate in modeling and inference, forming π( The conditional strategy structure (|s,Z) is used, along with effective action masking.

[0040] Figure 2 This is a schematic diagram of the conditional policy network structure provided in an embodiment of the present invention. Figure 2 The main process is as follows: First, the game state information, such as hand cards, discarded cards, and remaining cards, is input into the state encoder to obtain the corresponding state hidden features. At the same time, style vectors Input style is embedded in the encoding module, through a mapping function. Obtain the style embedding vector Then, the state hiding feature is implemented. With style embedding vector Joint fusion is performed at the fusion layer, and the fusion method can be splicing, addition, or other conditional injection methods; the fused features are then further input into the policy backbone network. The algorithm outputs action logits. Then, a valid action mask is applied to the action logits to mask illegal action dimensions, and finally, Softmax normalization is performed to obtain the final policy distribution. . Figure 2 This demonstrates that in this invention, state information and style information are not processed independently, but are jointly modeled through the same conditional policy network, thereby achieving controllable generation of action distribution under different dealing styles.

[0041] Furthermore, in a specific implementation, the game strategy generation system provided in the embodiments of the present invention may further include: a reward modulation module, used to perform reward weighting and shaping modulation based on the basic reward, the game pattern label, and the style embedding vector Z, combined with the game process features, to generate modulated reward data; a reinforcement learning training module, used to collect the game trajectory and receive the modulated reward data, calculate the Monte Carlo discount reward in reverse along the game trajectory, and construct the strategy loss and value loss functions; and perform gradient backpropagation based on the strategy loss and value loss functions to iteratively optimize and update the learnable parameters of the strategy network module, the value network module, and the style embedding encoding module.

[0042] In implementation, the reward modulation module can be used to adjust the base reward. The modulation function g is input with features such as style embedding vector Z, game type label, and game duration, and outputs a modulation reward. Modulate reward It is a reward for reinforcement learning after being modulated by a style and pattern-related modulation function. The reward modulation module may include a feature aggregation unit, a reward modulation calculation unit, and a reward rule modulation unit. Among them, the feature aggregation unit is used to aggregate the basic reward. The input features for reward modulation are formed from the game type label, style embedding vector Z, and game process features; the reward modulation calculation unit is used to apply preset modulation coefficients to the basic reward. The system performs reward weighting and calculates the initial modulation reward by superimposing auxiliary shaping terms based on game process features. The reward rule modulation unit is used to regularize and correct the initial modulation reward according to preset constraint rules, generate modulation reward data, and output it to the reinforcement learning training module to align the learning objective with the operational business indicators.

[0043] Among them, basic rewards The rules engine calculates rewards based on winning hand patterns, discard / self-draw, and fouls. = ×g(Z, hand pattern features)+h(Z, game duration, event sequence); where the modulation function g can be a lookup table weight, a piecewise function, or a learnable small network, and the network input is the style embedding vector Z and the one-hot encoding of the hand pattern or the hand pattern embedding features; in practical applications, the relative weight of high hand completion can be increased under the setting of the card dealing and operation style, or extreme dragging of the game can be suppressed; the auxiliary shaping term h can be an auxiliary term such as a quick winning reward, a step penalty, or a style consistency penalty.

[0044] To ensure the stability of training values, upper and lower bound constraints can be set on the output of the modulation function g, such as clipping it to [g_min, g_max] to avoid gradient explosion; for the basic reward... The steps with a value of 0 (most intermediate steps) can use only the sparse signal in the shaping term h or have a value of 0 throughout, which can be flexibly configured according to the actual engineering implementation.

[0045] The goal of reward modulation is to enable the same policy network to have distinguishable optimization objectives under different style embedding vectors Z, thereby inducing agents to produce differentiated game behaviors, while always maintaining the basic reward. This serves as an anchor, preventing a complete deviation from competitive fairness.

[0046] Figure 3 This is a schematic diagram of reward modulation provided for an embodiment of the present invention. Figure 3 As shown, basic reward Modulation functions related to style and format Perform multiplication first, then add the auxiliary term. The sums are used to obtain the modulated reward for reinforcement learning training. The correspondence can be expressed as: . Figure 3 This can be intuitively explained by the fact that the reward signal in this invention is composed of rule-based scores, style-related modulation terms, and auxiliary shaping terms.

[0047] This invention implements a style-related reward modulation mechanism, modulating the reward. Based on basic rewards To anchor the benchmark, a dynamic balance is achieved between controllable operational goals and the fairness of game rules by combining style modulation and auxiliary shaping items.

[0048] In addition, the reinforcement learning training module can be used for game trajectory sampling, empirical data caching, Monte Carlo target computation by DMC, and gradient updates for the policy network, value network, and style embedding parameters. The reinforcement learning training module may include a style sampling scheduling unit, a game trajectory acquisition unit, a Monte Carlo reward computation unit, a loss construction and gradient update unit, and a training evaluation convergence control unit. The system comprises the following components: a style sampling scheduling unit, used to sample style vectors S according to a preset hierarchical sampling and importance sampling strategy, covering the long-tail style space, supporting multi-style binning batch construction and progressive dimensionality expansion during course learning; a game trajectory acquisition unit, used to generate the initial state of the game in conjunction with the card-making module, calculate and cache the style embedding vector Z for each game, and gradually collect trajectory data containing the game state s, decision actions, modulated rewards, style embedding vector Z, and effective action masks during the game interaction; a Monte Carlo reward calculation unit, used to recursively calculate the discounted Monte Carlo reward along the complete game trajectory after a single game ends, serving as a model training supervision target; a loss construction and gradient update unit, used to construct value regression loss and policy gradient loss based on the Monte Carlo reward, and jointly iteratively update the learnable parameters of the policy network module, value network module, and style embedding encoding module through backpropagation; and a training evaluation convergence control unit, used to periodically calculate indicators such as win rate, average hand type, and game length on the reserved style set, monitor the model training convergence status, determine whether the training iteration limit has been reached, and control the start and stop of the training loop.

[0049] The reinforcement learning training module supports joint training of a single model on multi-style data, improving the model's generalization ability across different card-dealing styles. Through style-related reward modulation, the learning objectives of the agent can be aligned with operational indicators such as high-scoring incentives and rhythm control, balancing intensity and diversity.

[0050] Model training follows a fixed iterative process until the model converges or reaches a preset training resource limit. Specific steps include: Step 1: Sample the style vector S. The long-tail style sample space can be covered by hierarchical sampling and importance sampling.

[0051] Step 2: The card-making module generates the initial state of the game based on the style vector S.

[0052] Step 3: Calculate the style embedding vector Z= And maintain a fixed cache throughout the entire game (the style of the game remains unchanged).

[0053] Step 4: Multi-step game simulation rollout, collect ( (Valid mask, termination flag).

[0054] Step 5: After the game ends, calculate the Monte Carlo reward for each step in reverse along the trajectory based on the modulated reward sequence and the DMC. Construct value regression loss and / or policy gradient loss, and update the policy network, value network, and style embedding mapping parameters. (If trainable).

[0055] Step 6: Periodically evaluate metrics such as win rate, average handicap, and game length on the reserved independent (held-out) style set.

[0056] Step 7: Optional course learning mechanism can be introduced. In the early stage of training, a narrow range of style distribution is used, and the range of values ​​of style vector S is gradually expanded as the training progresses.

[0057] The training process supports mixing multiple style vectors S within the same training batch, enabling joint training of a single model across multiple styles. Batch construction can employ style-based binning followed by concatenation to ensure that each bin contributes to the gradient. Joint training of a single model across multiple styles involves simultaneously optimizing the same parameter set across multiple S-induced distributions.

[0058] Figure 4 This is a schematic diagram of the overall architecture of the game strategy generation system provided in an embodiment of the present invention. Figure 4 The overall business chain is divided into three parts: the environment-side card-making and dealing chain, the agent-side conditional decision-making chain, and the reward modulation and training chain. The main process is as follows: The configuration center outputs card-making related configurations, which are parsed by the style parameter extraction module to obtain the style vector S; the card-making rule generation module generates a card wall or starting hand allocation scheme based on the style vector S, and the corresponding hand is input into the game engine through the card-dealing control unit. At the same time, the style vector S is input into the style embedding encoding module, which is mapped to obtain the style embedding vector Z, and then the style embedding vector Z is sent to the policy network π and value network V on the agent side. The game engine interacts with the agent side during the card dealing and game process. The agent side performs decision calculations based on the state information s, the style embedding vector Z, and the effective action mask, and outputs the action through the decision execution unit. Return to the game engine module. The game engine module further outputs the basic rewards. The program incorporates pattern information and status update information, along with the style embedding vector Z, into the reward modulation module to generate a modulation reward. The data is then fed into the reinforcement learning training module to complete the joint training of the policy network, value network, and style embedding encoding module. This achieves a complete closed loop from style configuration generation, conditional policy decision-making, reward signal modulation to model parameter iterative updates, while forming a standardized data flow with the game engine and configuration center, facilitating business auditing and canary release implementation.

[0059] Figure 5 This is a schematic diagram of the training phase process provided in an embodiment of the present invention. Figure 5 As shown, after training starts, the style vector S is sampled first; then the card-making rule generation module generates the initial state of the game based on the style vector S and calculates the style embedding vector. The style embedding vector Z remains unchanged throughout a single game. Then, the game enters an intra-game loop, where at each decision step, the following actions are executed sequentially: observe the current state, sample actions according to the policy network, and so on. The environment executes the stepping and records trajectory information. And obtain modulation reward through the reward modulation module. If the current game is not over, the next game cycle continues. If the current game has ended, the Monte Carlo reward is accumulated in reverse along the trajectory after the game ends. The model constructs a DMC loss based on the reward to perform gradient updates. It then checks if an update cycle has been reached; if so, it executes the corresponding training update process. Further, it checks if the model has converged or reached the step limit; if not, it returns to resampling Z or the style vector S and enters the next round of training; if it has reached the limit, training ends. Figure 5 The dashed box on the left represents the rollout sampling process within a single session, while the dashed box on the right represents the reward calculation and parameter update process that only exists during the training period, thus reflecting the training mechanism of the present invention with fixed style conditions within the session and unified backhaul update at the end of the session.

[0060] It should be noted that this invention can establish style consistency constraints between the training and card dealing sides: the style vector S, style embedding vector Z, and game engine configuration are of the same origin and traceable. By introducing explicit style conditions Z and participating in policy and reward modeling, the policy possesses the ability to adapt to the card dealing distribution, reducing the performance loss caused by training-deployment distribution offset. Due to multi-style joint training and style space sampling, the generalization potential for unseen or interpolated styles can be improved, reducing the operational burden of fine-tuning once per activity.

[0061] Furthermore, in a specific implementation, the game strategy generation system provided in the embodiments of the present invention may further include: an inference control module, used to load the fixed parameters of the trained network, obtain the style embedding vector Z and the game state s, call the strategy network module to obtain the game action strategy distribution, solve the effective game actions through a preset decision method, encapsulate and generate action instructions and send them to the game engine module; the game engine module is also used to receive action instructions, execute game steps and update the game process until the game ends.

[0062] In implementation, the inference control module can load the fixed parameters of the trained network and output actions or action distributions by embedding the vector Z with the current game state s according to a specified style. The inference control module may include an activity configuration parsing unit, a style embedding conversion unit, a strategy decision unit, an action instruction generation unit, a game loop control unit, and a consistency verification unit. The system comprises the following components: an activity configuration parsing unit, which reads the current activity configuration, parses the configuration information, and extracts the corresponding style vector S; a style embedding conversion unit, which receives the style vector S, calls a preset mapping function to convert it into a style embedding vector Z, caches the style embedding vector Z, and ensures that it remains fixed within a single game to avoid style bias; a policy decision unit, which loads fixed model weights, combines the current observation state s with the cached style embedding vector Z, calculates the conditional policy distribution, and selects the optimal action or samples actions according to the policy distribution based on inference requirements via argmax; an action instruction generation unit, which normalizes the actions obtained from the decision, generates executable action instructions, and sends them to the game engine module; a game loop control unit, which drives the game engine to execute action instructions, update the game state s, and loop through the observation state, decision, and action execution process until the game ends, without involving loss calculation or parameter updates, ensuring low inference latency; and a consistency verification unit, which caches the style embedding vector Z for a single game to ensure style consistency within a single game, avoids cognitive bias between the policy side and the card dealing configuration (actual style), and ensures that the style is consistent with the card dealing configuration during inference.

[0063] This invention fully covers the style space during the training phase and allows for on-demand control of behavioral tendencies during the inference phase, enabling a single model to simultaneously possess multi-style adaptability and interpretable differentiated behavior.

[0064] It should be noted that the modules exchange S, Z, s through a clearly defined interface. Effective action masks and game identifiers are provided. The training and inference processes reuse the same set of style encoding logic and conditional forward computation logic, ensuring consistency between training distribution and deployment / inference distribution. During the inference phase, multiple styles are supported, including fixed style, style switching based on game, or dynamic injection of style embedding Z according to operational strategies. Flexible injection of Z enables controllable generation of agent game behavior.

[0065] Specifically, this invention can implement the use of DMC as a training framework: within a single game with a fixed-style embedding Z, records are made step-by-step ( After the game ends, the Monte Carlo reward is recursively calculated from the terminating step back to the starting step, for example: ; in The modulated reward obtained after reward modulation is T, where T is the game termination time and γ∈(0,1] is the discount factor. The conditional forward unification of state and style is represented as follows: .

[0066] State value For example, fitting is achieved by minimizing the regression loss: ; Where the loss function The mean squared error or Huber loss can be used; These are the parameters of the value network.

[0067] If we take the action value Q(s, If Z is the primary factor, then the actual actions performed will be... use .

[0068] When jointly training policy and value, a policy gradient with baseline can be used, for example: ; Where sg(·) represents stopping the gradient at the baseline. The strategy parameter is used; alternatively, entropy can be weighted by β to encourage exploration, and the joint loss is: ; in It is a strategic loss. It is a loss of value. It is the weighting coefficient for value loss. The entropy regularization weight.

[0069] Throughout the game, the style is embedded in Z and remains fixed, Monte Carlo reward. The computation and forward pass of the policy network π and the value network V are performed under the same Z condition, ensuring consistency of the condition variables. In engineering implementation, multi-site parallel rollout and batch-aggregated gradients can be used; target network or gradient pruning can be selected to stabilize training, without changing the DMC nature of Monte Carlo reward as the main objective.

[0070] Figure 6 This is a schematic diagram of the inference stage flow provided in an embodiment of the present invention. Figure 6As shown, the current activity configuration is first read, and the corresponding style vector S is obtained from the activity configuration; then, the style vector S is input into the style embedding encoding module, and mapped by the mapping function. The style embedding Z is obtained. Then, the game loop begins, where the model weights remain fixed, and the model is adjusted based on the current observation state. The system calculates the conditional policy distribution using style embedding Z, and selects actions based on inference needs using the argmax method or sampling according to the policy distribution to obtain the actions to be executed. The game engine then executes the actions and proceeds to the next round of state observation, repeating this cycle until the end of the game. Unlike the training phase, this process... Figure 6 The reasoning process does not include DMC loss calculation or Monte Carlo return. The reverse accumulation and gradient update process demonstrate the low latency characteristics of the inference path; at the same time, the style embedding Z is cached within a single game and kept consistent with the card dealing configuration to avoid inconsistencies between the strategy-side style perception and the actual card dealing style.

[0071] This invention, by enabling a single model to support multiple styles, has lower deployment and maintenance costs than a single-style-per-model solution, while reducing model size and inference routing complexity. Because Z can be injected during the inference phase, diverse behaviors such as difficulty gradients, character differentiation, and activity theming can be implemented at the product layer, and these can be adjusted via grayscale through the configuration center.

[0072] Furthermore, in specific implementations, the game strategy generation system provided in the embodiments of the present invention may further include: a game recording and replay module, used to collect and store game process data, record game state s, style embedding vector Z, decision actions and reward information, for game process backtracking, process data retrieval and game trajectory reproduction; and a monitoring and indicator module, used to collect game operation data, perform hierarchical statistical analysis of relevant indicators including win rate, hand type distribution and average game steps according to style dimension, collect inference latency and module operation status data and complete archiving and storage.

[0073] In implementation, the data output feedback unit in the game engine module can also be used to feed back game progress data to the monitoring and indicator module and the game recording and replay module. The game recording and replay module can persistently store the entire game process data, retaining style vector S, segmentation embedding vector Z, game state s, and game actions. Basic Rewards Modulation reward This information is used for offline analysis and compliance auditing. The monitoring and metrics module can perform tiered statistics according to different dealing styles, outputting key operational metrics such as agent win rate, histograms of hand distribution, and average number of moves per game. This invention effectively improves the realism, controllability, and operational flexibility of the game while maintaining rule interpretability and audit traceability.

[0074] It should be added that this invention can also employ a combination of discrete style labels and embedding tables, without using continuous style vectors S, and achieve style representation only through table lookup embedding by category ID. For each dealing style, a corresponding sub-model can be trained separately, and the corresponding sub-model is selected through routing scheduling during the inference phase. This invention emphasizes the efficiency advantage of single-model multi-style joint training; this multi-model discrete scheme can be implemented as a parallel approach. This invention can also perform temperature scaling, action reweighting, or rule-level modifications and optimizations on the unified policy output. Furthermore, this invention can also avoid setting explicit style vectors S, instead relying on game trajectories to infer latent style variables through models such as VAEs.

[0075] Based on the same inventive concept, embodiments of the present invention also provide a method for generating game strategies. Figure 7 This is a flowchart of a game strategy generation method provided in an embodiment of the present invention. Figure 7 As shown, the method includes: S701: Use the style parameter extraction module to read the game configuration file, random sampler output data, or operation backend instructions, parse the card dealing style configuration parameters, and output a structured style vector.

[0076] S702. The style embedding coding module uses a preset mapping function to perform feature encoding transformation on the style vector to generate a style embedding vector of the corresponding dimension.

[0077] S703: Receives card-making and dealing configuration data using the game engine module, initializes and runs the game process, and outputs the game status and valid action mask.

[0078] S704. The value network module is used to embed vectors based on the game state and style to quantitatively evaluate the benefits of game decisions and output value assessment information.

[0079] S705. Using the policy network module, based on the game state, style embedding vector, and effective action mask, output the distribution of game action policies with constraints of the effective action mask.

[0080] In the game strategy generation method provided in the embodiments of the present invention, an explicit parameterization mechanism for dealing style can be established, allowing the dealing style to support flexible sampling, full recording and accurate reproduction, completing the mapping expression of style parameters to a model-understandable representation, stably outputting the game state and effective action mask, and providing game environment and action constraints for decision evaluation under style conditions; and enabling the value network to explicitly depend on the style embedding vector to achieve conditional value evaluation; and enabling the policy function to explicitly associate with the style embedding vector to achieve conditional policy generation, adapting to the game decision requirements under different dealing styles, improving policy generation efficiency, overcoming the defects of traditional models such as poor cross-dealing distribution adaptation, uncontrollable behavior, and easy inaccuracy of decision logic, improving the distribution adaptation ability, behavior control ability and decision rationality of the agent's game decision, and improving the realism and controllability of the game.

[0081] Since the embodiments of the game strategy generation method correspond to the embodiments of the game strategy generation system, the descriptions of the features in the embodiments corresponding to the game strategy generation method can be found in the relevant descriptions of the embodiments corresponding to the game strategy generation system, and will not be repeated here. Furthermore, it has the same beneficial effects as the game strategy generation system mentioned above.

[0082] Furthermore, in specific implementation, the game strategy generation method provided in the embodiments of the present invention may further include: using a reward modulation module to perform reward weighting and shaping modulation based on the basic reward, the game pattern label, and the style embedding vector, combined with the game process features, to generate modulated reward data; using a reinforcement learning training module to collect the game trajectory and receive the modulated reward data, and calculating the Monte Carlo discount reward in reverse along the game trajectory to construct the strategy loss and value loss functions; and performing gradient backpropagation based on the strategy loss and value loss functions to iteratively optimize and update the learnable parameters of the strategy network module, the value network module, and the style embedding encoding module.

[0083] Furthermore, in specific implementation, the game strategy generation method provided in the embodiments of the present invention may further include: using the inference control module to load the fixed parameters of the trained network, obtaining the style embedding vector and the game state, calling the strategy network module to obtain the game action strategy distribution, solving for effective game actions through a preset decision method, encapsulating and generating action instructions and sending them to the game engine module; using the game engine module to receive the action instructions, execute the game steps and update the game process until the game ends.

[0084] Furthermore, in a specific implementation, in the above-mentioned game strategy generation method provided in the embodiments of the present invention, before executing step S703 of receiving the card-making and card-dealing related configuration data using the game engine module, it may also include: receiving the style vector using the card-making rule generation module, generating a card wall or starting hand allocation scheme that matches the style according to the preset card-making and card-dealing parameter constraints, and outputting the card-making and card-dealing related configuration data.

[0085] Furthermore, in specific implementation, the game strategy generation method provided in the embodiments of the present invention may further include: collecting and storing game process data using the game recording and replay module, recording game status, style embedding vector, decision actions and reward information, for game process backtracking, process data retrieval and game trajectory reproduction; collecting game operation data using the monitoring and indicator module, statistically analyzing relevant indicators including win rate, hand type distribution and average game steps according to style dimension, collecting inference latency and module operation status data and completing archiving and storage.

[0086] From the above description of the embodiments, those skilled in the art can clearly understand that the methods according to the above embodiments can be implemented by software plus necessary general-purpose hardware platforms, and of course, they can also be implemented by hardware, but in many cases the former is a better implementation method.

[0087] Embodiments of the present invention also provide an electronic device, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to perform the steps in any of the above embodiments of the game strategy generation method.

[0088] Embodiments of the present invention also provide a computer-readable storage medium storing a computer program, wherein the computer program is configured to execute the steps in any of the above embodiments of the game strategy generation method when running.

[0089] In one exemplary embodiment, the aforementioned computer-readable storage medium may include, but is not limited to, various media capable of storing computer programs, such as USB flash drives, read-only memory (ROM), random access memory (RAM), portable hard drives, magnetic disks, or optical disks.

[0090] Embodiments of the present invention also provide a computer program product, which includes a computer program that, when executed by a processor, implements the steps in any of the above embodiments of the game strategy generation method.

[0091] Embodiments of the present invention also provide another computer program product, including a non-volatile computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps in any of the above embodiments of the game strategy generation method.

[0092] Any of the components, modules, units, parts, methods, and operations described herein can be implemented using software, firmware, hardware (e.g., fixed logic circuitry), manual processing, or any combination thereof. Alternatively or additionally, any functionality described herein can be executed at least in part by one or more hardware logic components, such as, but not limited to, a central processing unit (CPU), a field-programmable gate array (FPGA), an application-specific integrated circuit (ASIC), an application-specific standard product (ASSP), a system-on-chip (SoC), a complex programmable logic device (CPLD), a microcontroller unit (MCU), etc. The terms "system," "computing device," or "apparatus" as used herein encompass various means, devices, and machines for processing data, including, for example, one or more programmable processors, computers, SoCs, or combinations thereof. The apparatus may also include code that creates an execution environment for the computer program in question, such as code constituting processor firmware, a protocol stack, a database management system, an operating system, a cross-platform runtime environment, a virtual machine, or a combination thereof. The aforementioned computer program (also known as a program, software, software application, app, script, or code) can be written in any form of programming language, including compiled or interpreted languages, declarative or procedural languages, and can be deployed in any form, including as a standalone program or as a module, component, subroutine, object, or other unit suitable for a computing environment.

[0093] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this invention.

[0094] The above provides a detailed description of the game strategy generation system, method, device, and medium provided by this invention. Specific examples have been used to illustrate the principles and implementation methods of this invention. The descriptions of the above embodiments are only intended to help understand the method and core ideas of this invention. It should be noted that those skilled in the art can make various improvements and modifications to this invention without departing from its principles, and these improvements and modifications also fall within the protection scope of this invention.

Claims

1. A game strategy generation system, characterized in that, include: The style parameter extraction module is used to read game configuration files, random sampler output data, or operation backend instructions, parse the card dealing style configuration parameters, and output a structured style vector. The style embedding encoding module is used to perform feature encoding transformation on the style vector through a preset mapping function to generate a style embedding vector of the corresponding dimension. The game engine module is used to receive configuration data related to card dealing and initialization, run the game process, and output the game status and valid action mask. The value network module is used to quantify the benefits of game decisions based on the game state and the style embedding vector, and output value assessment information. The strategy network module is used to output a distribution of game action strategies carrying effective action mask constraints based on the game state, the style embedding vector, and the effective action mask.

2. The game strategy generation system according to claim 1, characterized in that, Also includes: The reward modulation module is used to perform reward weighting and shaping modulation based on the basic reward, the game type label and the style embedding vector, combined with the game process features, to generate modulated reward data. The reinforcement learning training module is used to collect game trajectories and receive the modulation reward data, calculate Monte Carlo discount rewards in reverse along the game trajectory, and construct policy loss and value loss functions; based on the policy loss and value loss functions, gradient backpropagation is performed to iteratively optimize and update the learnable parameters of the policy network module, the value network module, and the style embedding encoding module.

3. The game strategy generation system according to claim 2, characterized in that, Also includes: The inference control module is used to load the fixed parameters of the trained network, obtain the style embedding vector and the game state, call the policy network module to obtain the game action policy distribution, solve the effective game action through a preset decision method, encapsulate and generate action instructions and send them to the game engine module. The game engine module is also used to receive the action instructions, execute game steps and update the game process until the game ends.

4. The game strategy generation system according to claim 1, characterized in that, Also includes: The card-making rule generation module is used to receive the style vector, generate a card wall or starting hand allocation scheme that matches the style according to the preset card-making and dealing parameter constraints, and output card-making and dealing related configuration data.

5. The game strategy generation system according to claim 2, characterized in that, The value network module includes: The conditional value assessment unit is used to construct a conditional value assessment system based on the game state and the style embedding vector, and output the conditional state value or conditional action value. The training fitting unit is used to perform regression fitting based on the conditional state value or conditional action value, combined with the Monte Carlo reward objective, and uses the fitting result as the policy gradient baseline; it is also used to output value supervision signals for the reinforcement learning training module.

6. The game strategy generation system according to claim 2, characterized in that, The reward modulation module includes: The feature aggregation unit is used to aggregate the basic reward, the game pattern label, the style embedding vector, and the game process features to form the input features required for reward modulation. The reward modulation calculation unit is used to apply a preset modulation coefficient to the basic reward, and to calculate the initial modulation reward by superimposing an auxiliary shaping term on the game process features. The reward rule modulation unit is used to regulate and correct the initial modulation reward according to the preset constraint rules, generate modulation reward data and output it to the reinforcement learning training module, so that the learning objective is aligned with the business indicators on the operation side.

7. The game strategy generation system according to claim 1, characterized in that, Also includes: The game recording and replay module is used to collect and store game process data, record the game status, style embedding vector, decision actions and reward information, so as to trace the game process, retrieve process data and reproduce the game trajectory; The monitoring and metrics module is used to collect game operation data, perform hierarchical statistics on relevant metrics including win rate, hand distribution, and average game steps by style dimension, collect inference latency and module operation status data and complete archiving and storage.

8. A method for generating game strategies, characterized in that, include: The style parameter extraction module reads the game configuration file, random sampler output data, or operation backend instructions, parses the card dealing style configuration parameters, and outputs a structured style vector. The style embedding encoding module uses a preset mapping function to perform feature encoding transformation on the style vector to generate a style embedding vector of the corresponding dimension; The game engine module receives card-making and dealing configuration data, initializes and runs the game process, and outputs the game status and valid action mask. The value network module is used to quantitatively evaluate the benefits of game decisions based on the game state and the style embedding vector, and outputs value evaluation information. The policy network module outputs a distribution of game action policies with constraints of the effective action mask based on the game state, the style embedding vector, and the effective action mask.

9. An electronic device, characterized in that, include: Memory, used to store computer programs; A processor, configured to implement the steps of the game strategy generation method as described in claim 8 when executing the computer program.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the steps of the game strategy generation method as described in claim 8.