An anti-collision activation code-based intelligent distribution method and system
By implementing structured management of the activation code space and identity-guided modeling, combined with segmented time series prediction, the problems of frequent activation code conflicts and low distribution efficiency in high-concurrency scenarios are solved. This achieves adaptive control and data consistency in activation code generation and distribution, improving the stability and scalability of the system.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- SHALLBRIGHT HEALTHTECH CO LTD
- Filing Date
- 2026-05-21
- Publication Date
- 2026-07-31
AI Technical Summary
Existing activation code generation and distribution systems are prone to frequent conflicts and reduced generation efficiency in high-concurrency scenarios. They also suffer from unbalanced identity binding logic, making it difficult to achieve data consistency and automatic determination and switching of distribution modes in multi-organizational environments. Consequently, the systems lack stability and scalability.
By constructing a structured management system for the activation code space, introducing code segment topology control and identity-inducing modeling, and combining segmented time series prediction, adaptive control of activation code generation and distribution is achieved. Multi-granularity partitioning, identity-inducing fields, and cross-database association mechanisms are adopted to dynamically adjust the distribution strategy.
In high-concurrency scenarios, it reduces the probability of activation code conflicts, improves generation efficiency and system stability, avoids identity binding pressure and distribution imbalance, and enhances the scalability and manageability of the system in complex environments.
Smart Images

Figure CN122240604B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of information security technology, and in particular to a method and system for intelligent distribution of anti-collision activation codes. Background Technology
[0002] With the rapid development of internet services, digital content distribution, and membership rights management, activation codes, as a common form of digital credentials, are widely used in software licensing, membership redemption, coupon distribution, and device activation. Existing activation code generation and distribution systems typically generate codes based on a preset character set using random combinations and verify uniqueness through database constraints to prevent duplicate codes. Meanwhile, some systems support binding activation codes to user identity information such as mobile phone numbers, ID card numbers, or device serial numbers to enable targeted use and access control.
[0003] However, as business scale expands and concurrent requests increase, existing technologies have gradually revealed several shortcomings in practical applications. On the one hand, the activation code generation process primarily relies on random strategies and post-event verification, lacking structured management of the activation code space. This can easily lead to frequent conflicts and decreased generation efficiency in high-concurrency scenarios. On the other hand, identity binding logic typically employs simple field validation and direct binding methods, failing to uniformly model identity distribution characteristics. This can easily create binding pressure in specific user groups or areas with concentrated devices, resulting in uneven activation code usage and management chaos. Existing distribution mechanisms largely rely on manual configuration or fixed rules, making it difficult to dynamically adjust distribution strategies based on real-time load changes.
[0004] In multi-organization, multi-system deployment environments, activation code data is often scattered across different databases or business systems. Existing technologies typically achieve organization mapping through static configuration or one-way associations, lacking a unified cross-database association and consistency control mechanism. This can easily lead to problems such as unclear activation code ownership and data synchronization delays. Especially in scenarios that require simultaneous support for targeted and non-targeted distribution, existing technologies struggle to automatically determine and switch distribution modes while ensuring data consistency. The overall system stability, scalability, and intelligence level still need improvement.
[0005] Therefore, how to provide a method and system for intelligent distribution of anti-conflict activation codes is a problem that urgently needs to be solved by those skilled in the art. Summary of the Invention
[0006] One objective of this invention is to propose an intelligent distribution method and system based on anti-collision activation codes. This invention comprehensively utilizes digital data processing, identity feature parsing, time-series prediction, and distribution control technologies to construct a holistic methodology encompassing activation code generation, code segment topology management, identity-guided modeling, and hierarchical distribution control. This systematically realizes intelligent processing of activation codes from generation and allocation to binding and distribution. By structurally partitioning the activation code space and introducing a code segment topology control mechanism, combining multi-dimensional identity data to construct an identity-guided field, and dynamically adjusting the distribution channel based on segmented time-series prediction, this invention achieves proactive anti-collision and adaptive control of the activation code generation and distribution process. It can maintain the stability and consistency of activation code distribution in high-concurrency, multi-organization, and multi-device scenarios, possessing advantages such as low collision rate, high distribution efficiency, strong management controllability, and good system scalability.
[0007] According to an embodiment of the present invention, a method for intelligent distribution of anti-collision activation codes includes: Construct an activation code character set, process the activation code character set, generate activation code candidate codes according to a preset length, and perform database uniqueness verification to obtain a set of activation code candidate codes that pass the verification. The activation code space is divided into multiple granularities based on the prefix of the activation code in the candidate activation code set, generating multiple code segment nodes, constructing a code segment topology map, and setting stable state, overload state, decay state and multiplication state for each code segment node; The format validation and field parsing of the identity data to be bound are performed, the mobile phone number, ID card number and device serial number are converted into standardized identity features, identity bucket identifiers are generated through hash mapping, and the identity inducement field strength corresponding to each code segment node is calculated. The historical code issuance request sequence and the historical conflict retry sequence are input into the improved SegRNN model for segmented time series prediction. Based on the prediction results, the channel switching threshold, conflict entropy threshold and channel switching time window parameters are generated. Based on the code segment topology map, code segment node status, identity inducement field strength, channel switching threshold, conflict entropy threshold, and channel switching time window parameters, an activation code is generated by selecting a balanced channel, an offset channel, or a rebalanced channel. The activation code undergoes identity binding processing. Based on the identity data or distribution quantity contained in the distribution task, it is determined whether to perform targeted or non-targeted distribution. Through a cross-database association mechanism, a mapping relationship is established between the organization identifier of the activation code and the organization database to complete the activation code distribution.
[0008] Optionally, the processing of the activation code character set includes removing the characters "0", "O" and "I" from the activation code character set.
[0009] Optionally, the step of generating activation code candidate codes according to a preset length and performing database uniqueness verification includes: According to the preset character length of 6 digits, characters are selected sequentially from the activation code character set to generate activation code candidate codes. Before writing the activation code candidate codes into the activation code database, a uniqueness check is performed on the activation code candidate codes based on the uniqueness constraint corresponding to the activation code field. If the uniqueness check fails, a new 6-digit activation code candidate code is generated and the uniqueness check is performed again; When the uniqueness check passes, the corresponding 6-digit activation code candidate code is confirmed as a usable activation code and added to the activation code candidate set.
[0010] Optionally, the construction of the code segment topology map, which sets stable state, overload state, decay state, and multiplication state for each code segment node, includes: Obtain the candidate set of activation codes, divide the activation code space according to the two-digit prefix as the main granularity and maintain one-digit and three-digit prefixes as the auxiliary granularity in parallel, generate the corresponding code segment node set, and initialize the number of activation codes, conflict count and identity binding distribution for each code segment node. Within a time window, summarize the percentage of activation codes, the percentage of conflict counts, and the distribution ratio of identity binding for each code segment node, record the difference between the previous time window and the current time window, and obtain three incremental statistical results: change in usage rate, change in conflict rate, and change in identity distribution. Based on the similarity intervals of identity binding distribution, the difference intervals of usage rate, and the difference intervals of conflict rate between each pair of code segment nodes, basic connections are constructed. When the three indicators simultaneously meet the corresponding preset intervals, basic connections are established. The three indicators are weighted and synthesized into edge weights, and only basic connections not lower than the preset threshold are retained to form the basic topology. Constructing multiple types of topologies on top of the basic topology to form a code segment topology map: For overloaded nodes, target nodes are selected in descending order of identity-induced field strength, utilization rate, and conflict rate. Pressure relief connections are established, and pressure relief connections are assigned a higher priority and maximum available capacity than basic connections. Based on the directed sequences successfully generated across historical code segments, migration edges are established. The priority of migration edges is determined by their frequency of occurrence and the time of their most recent occurrence. The priority is lower than that of pressure relief edges but higher than that of basic edges. When a node is in a decaying state and there are still collision counts, freeze the node's outward basic edges and migration edges, and only retain the pressure relief edges pointing to the node. Based on the incremental statistics and edge priority, stable state, overload state, decay state and multiplication state are set for each code segment node.
[0011] Optionally, the calculation of the identity inducement field strength corresponding to each code segment node includes: Obtain the set of identity data to be bound and the corresponding organization identifier, generate a record to be parsed for each piece of identity data in the identity data set, and establish a parsing result field for each record to be parsed; For each record to be parsed, perform format validation and field parsing to determine the identity type, where: A mobile phone number is identified based on identity data consisting of 11 digits. Identity data that consists of 18 characters and whose last character is a check digit, and which passes the verification rules, is identified as an ID card number. Identity data that meets the preset device serial number character set and whose length is within the preset serial number length range is determined as the device serial number type; For each record to be parsed, the identity data is standardized to obtain standardized identity features. The standardization process includes removing spaces and delimiters, converting alphabetic characters to uppercase characters, and combining the identity type, standardized identity features, and organization identifier to form a standardized identity identifier. Set a fixed number of identity buckets and set hash mapping rules. Input each standardized identity identifier into the hash mapping rules to obtain the identity bucket identifier. Write the identity bucket identifier into the parsing result field to obtain the identity bucket identifier set. Within a preset statistical time window, the binding frequency of each identity bucket identifier is counted, and the bucket weight corresponding to each identity bucket identifier is generated. Based on the code segment node set, the correspondence between identity bucket identifiers and code segment nodes is established. Based on the historical binding distribution of each code segment node on each identity bucket identifier and the bucket weight, the identity inducement field strength of each code segment node is calculated.
[0012] Optionally, generating the channel switching threshold, conflict entropy threshold, and channel switching time window parameters based on the prediction results includes: Obtain historical code issuance request records and historical conflict retry records, align them by timestamp to form historical code issuance request sequences and historical conflict retry sequences, and determine the sampling time interval, historical time window length, and prediction time window length. The historical code issuance request sequence and the historical conflict retry sequence are segmented. The segmentation includes initial division according to a preset segment length, and insertion of segment boundaries at positions where the change in adjacent sampling points exceeds a preset threshold, resulting in multiple segment sequence pairs. The improved SegRNN model is constructed as follows: Set up segmented embedding channels for historical code issuance request sequences and historical conflict retry sequences respectively; An intra-segment cross-gating fusion unit is set after the two segmented embedding channels to perform gating fusion on the code transmission request features and conflict retry features within the same segment. The global statistical features of the code segment topology map and the global statistical features of the identity inducement field intensity are obtained to generate a situation vector. Before each segment-level update of the inter-segment recursive unit, the situation vector is injected into the segment-level hidden state through the situation injection unit. An inter-segment memory cache unit is set up outside the inter-segment recursive unit to cache the most recently preset number of segment hidden states. When the next segment is updated, the cached information is read from the inter-segment memory cache unit and merged with the current segment hidden state. The SegRNN model is improved by inputting segmented sequences, and the predicted code issuance request sequence and the predicted conflict retry sequence within the prediction time window are output and a correspondence is established with the timestamp. The channel switching threshold is determined by weighting the peak predicted code issuance request volume and the peak predicted conflict retry count. The conflict entropy threshold is updated based on the ratio of the peak predicted conflict retry count to the peak predicted code issuance request volume. The channel switching time window parameter is determined based on the growth trend of the prediction time window length and the peak predicted code issuance request volume.
[0013] Optionally, the step of selecting the equalization channel, offset channel, or rebalance channel to generate the activation code includes: The conflict entropy is calculated based on the identity binding distribution of each code segment node. The conflict count, conflict entropy reversal, identity-induced field strength and activation code quantity ratio are synthesized according to preset weights to obtain the channel selection score. Code segment nodes in the decay state are eliminated to form a candidate code segment node set. Within the channel switching time window, compare the collision count of candidate code segment nodes with the channel switching threshold and the collision entropy with the collision entropy threshold. If the channel switching conditions are met, it is determined as a rebalancing channel. Otherwise, if there is a node that simultaneously satisfies that the collision entropy is not lower than the collision entropy threshold and the identity inducement field strength is not lower than the preset threshold, it is determined as an offset channel. In other cases, it is determined as a balanced channel. In the balanced channel, select the code segment node with the lowest channel selection score, generate the activation code under the prefix constraint and perform database uniqueness verification. In the offset channel, select the code segment node with the lowest channel selection score, perform local perturbation on the last character of the activation code by no more than the preset maximum number of characters, and perform weight offset generation in the adjacent code segment nodes according to the weight ratio of the outgoing edge. In the rebalancing channel, code segment nodes that meet the channel switching conditions are identified as risky code segment nodes. De-stressing edges, migration edges, and basic edges are selected according to edge priority to form a target node sequence and generate an activation code. During the channel switching time window, the outward basic edges and migration edges of risky code segment nodes that continuously meet the channel switching conditions are frozen, and only de-stressing edges are retained. The activation code that passes the verification is output.
[0014] Optionally, the process of distributing activation codes includes: Obtain the distribution task description information. When the distribution task contains an identity data set, the distribution quantity parameter is not used in the distribution task. When the distribution task does not contain an identity data set, the distribution quantity parameter is used in the distribution task. The distribution mode is determined based on the description information of the distribution task. When the distribution task contains an identity data set, the distribution mode is determined to be targeted distribution. When the distribution task does not contain an identity data set and the distribution quantity parameter is greater than zero, the distribution mode is determined to be non-targeted distribution. When it is determined to be targeted distribution, an activation code is generated for each piece of identity data in the identity data set, a one-to-one binding relationship is established between the activation code and the corresponding identity data, a binding record containing the activation code, identity data and organization identifier is generated, and the binding record is written into the activation code binding storage. When it is determined to be non-targeted distribution, activation codes are generated multiple times according to the distribution quantity parameter, generating a corresponding number of activation code sets. An unbound status flag is set for each activation code in the activation code set, and an unbound record containing the activation code and organization identifier is generated. Based on the organization identifier, a mapping relationship is established between the activation code storage and the organization database through a cross-database association mechanism. The bound records generated by targeted distribution or the unbound records generated by non-targeted distribution are written into the corresponding database, thus completing the distribution of activation codes and association with the organization.
[0015] According to an embodiment of the present invention, a smart distribution system based on anti-conflict activation codes includes the following modules: The activation code generation and verification module is used to construct the activation code character set, generate activation code candidate codes, and perform database uniqueness verification to obtain the activation code candidate set. The code segment partitioning and topology module is used to perform multi-granular partitioning of the activation code space based on the prefix of the activation code candidate set, construct the code segment topology map, and set the stable state, overload state, decay state and multiplication state; The identity resolution and inducement field module is used to perform format verification and field parsing on the identity data to be bound, and to calculate the identity inducement field strength corresponding to each code segment node. The segmented prediction and threshold module is used to input the historical code issuance request sequence and the historical conflict retry sequence into the improved SegRNN model to perform segmented time series prediction and generate channel switching threshold, conflict entropy threshold and channel switching time window parameters. The hierarchical channel generation module is used to generate activation codes by selecting the equalization channel, the offset channel, or the rebalancing channel based on the code segment topology map, the code segment node status, the identity inducement field strength, and the threshold parameters. The distribution determination and cross-database distribution module is used to perform identity binding processing on activation codes, perform targeted or non-targeted distribution, establish a mapping relationship between activation codes and the organization's database, and complete the activation code distribution.
[0016] The beneficial effects of this invention are: This invention achieves proactive management and dynamic control of the activation code space by structurally reconstructing the activation code generation and distribution process. This effectively overcomes the problems of frequent conflicts and decreased generation efficiency caused by relying on random generation and post-verification in existing technologies. By introducing a code segment partitioning and code segment topology map mechanism, the originally disordered activation code space is transformed into a schedulable and evolvable structural system. This allows the activation code generation process to adaptively select based on the code segment state, fundamentally reducing the probability of code value conflicts in high-concurrency scenarios and significantly improving the stability and reliability of activation code generation.
[0017] This invention further constructs an identity-inducing field by uniformly analyzing and modeling multidimensional identity data, and introduces it into the activation code generation and distribution decision-making process. This enables activation code allocation to dynamically perceive identity distribution characteristics, avoiding binding pressure and distribution imbalance caused by concentrated identity areas. Combined with segmented time series forecasting for forward-looking analysis of system load and conflict trends, it achieves intelligent switching and early intervention of distribution channels, effectively alleviating system pressure during peak business periods and improving overall distribution efficiency and responsiveness.
[0018] This invention introduces an automatic distribution mode determination and cross-database association mechanism during the distribution phase, enabling the system to automatically switch between targeted and non-targeted distribution, and maintain the consistency and traceability of activation code ownership in multi-organization and multi-system environments. Through a unified distribution control and data association method, it not only reduces manual configuration and maintenance costs but also enhances the system's scalability and management controllability in complex deployment scenarios, thus comprehensively improving the intelligence level and application value of the activation code distribution system. Attached Figure Description
[0019] The accompanying drawings are provided to further illustrate the invention and form part of the specification. They are used in conjunction with embodiments of the invention to explain the invention and do not constitute a limitation thereof. In the drawings: Figure 1 This is a flowchart of an intelligent distribution method based on anti-collision activation codes proposed in this invention; Figure 2 This is a schematic diagram of the structure of an intelligent distribution system based on anti-conflict activation codes proposed in this invention. Detailed Implementation
[0020] The present invention will now be described in further detail with reference to the accompanying drawings. These drawings are simplified schematic diagrams, illustrating only the basic structure of the invention, and therefore only show the components relevant to the invention.
[0021] refer to Figure 1A method for intelligent distribution of anti-conflict activation codes, comprising: Construct an activation code character set, process the activation code character set, generate activation code candidate codes according to a preset length, and perform database uniqueness verification to obtain a set of activation code candidate codes that pass the verification. The activation code space is divided into multiple granularities based on the prefix of the activation code in the candidate activation code set, generating multiple code segment nodes, constructing a code segment topology map, and setting stable state, overload state, decay state and multiplication state for each code segment node; The format validation and field parsing of the identity data to be bound are performed, the mobile phone number, ID card number and device serial number are converted into standardized identity features, identity bucket identifiers are generated through hash mapping, and the identity inducement field strength corresponding to each code segment node is calculated. The historical code issuance request sequence and the historical conflict retry sequence are input into the improved SegRNN model for segmented time series prediction. Based on the prediction results, the channel switching threshold, conflict entropy threshold and channel switching time window parameters are generated. Based on the code segment topology map, code segment node status, identity inducement field strength, channel switching threshold, conflict entropy threshold, and channel switching time window parameters, an activation code is generated by selecting a balanced channel, an offset channel, or a rebalanced channel. The activation code undergoes identity binding processing. Based on the identity data or distribution quantity contained in the distribution task, it is determined whether to perform targeted or non-targeted distribution. Through a cross-database association mechanism, a mapping relationship is established between the organization identifier of the activation code and the organization database to complete the activation code distribution.
[0022] In this embodiment, the processing of the activation code character set includes removing the characters "0", "O" and "I" from the activation code character set.
[0023] In this embodiment, the step of generating activation code candidate codes according to a preset length and performing database uniqueness verification includes: According to the preset character length of 6 digits, characters are selected sequentially from the activation code character set to generate activation code candidate codes. Before writing the activation code candidate codes into the activation code database, a uniqueness check is performed on the activation code candidate codes based on the uniqueness constraint corresponding to the activation code field. If the uniqueness check fails, a new 6-digit activation code candidate code is generated and the uniqueness check is performed again; When the uniqueness check passes, the corresponding 6-digit activation code candidate code is confirmed as a usable activation code and added to the activation code candidate set.
[0024] In this embodiment, the construction of the code segment topology map, which sets stable state, overload state, decay state, and multiplication state for each code segment node, includes: Obtain the candidate set of activation codes, divide the activation code space according to the two-digit prefix as the main granularity and maintain one-digit and three-digit prefixes as the auxiliary granularity in parallel, generate the corresponding code segment node set, and initialize the number of activation codes, conflict count and identity binding distribution for each code segment node. Within a time window, summarize the percentage of activation codes, the percentage of conflict counts, and the distribution ratio of identity binding for each code segment node, record the difference between the previous time window and the current time window, and obtain three incremental statistical results: change in usage rate, change in conflict rate, and change in identity distribution. Based on the similarity intervals of identity binding distribution, the difference intervals of usage rate, and the difference intervals of conflict rate between each pair of code segment nodes, basic connections are constructed. When the three indicators simultaneously meet the corresponding preset intervals, basic connections are established. The three indicators are weighted and synthesized into edge weights, and only basic connections not lower than the preset threshold are retained to form the basic topology. Constructing multiple types of topologies on top of the basic topology to form a code segment topology map: For overloaded nodes, target nodes are selected in descending order of identity-induced field strength, utilization rate, and conflict rate. Pressure relief connections are established, and pressure relief connections are assigned a higher priority and maximum available capacity than basic connections. Based on the directed sequences successfully generated across historical code segments, migration edges are established. The priority of migration edges is determined by their frequency of occurrence and the time of their most recent occurrence. The priority is lower than that of pressure relief edges but higher than that of basic edges. When a node is in a decaying state and there are still collision counts, freeze the node's outward basic edges and migration edges, and only retain the pressure relief edges pointing to the node. Based on incremental statistics and edge priority, stable, overloaded, decaying, and multiplying states are set for each code segment node, where: When the number of activation codes generated, the number of conflicts, and the distribution of identity bindings of a code segment node are all within a preset stable range within a preset statistical window, the code segment node is set to a stable state, and the existing basic connections, migration connections, and corresponding edge weights of the code segment node remain unchanged. When the number of activation codes generated by a code segment node within a preset statistics window continues to rise and the conflict count reaches or exceeds a preset overload threshold, the code segment node is set to an overload state, and the available capacity of the outward basic connection of the code segment node is limited. At the same time, pressure relief connections pointing to other code segment nodes are enabled first. When the number of activation codes generated by a code segment node within a preset statistical window is consistently lower than a preset lower limit and there are still conflict counts, the code segment node is set to a decay state, and the outward basic connection and migration connection of the code segment node are frozen, leaving only the pressure relief connection pointing to the code segment node. When the number of activation codes generated, the concentration of identity binding, or the number of conflicts in a code segment node exceeds a preset proliferation threshold within a preset statistical window, the code segment node is set to a proliferation state. The code segment node is then divided into multiple sub-code segment nodes according to the third character interval. The sub-code segment nodes inherit the pressure relief and migration edges of the original code segment node. Based on the statistical results of each sub-code segment node, the basic edges and corresponding edge weights between the code segment node and downstream nodes are re-evaluated.
[0025] In this embodiment, calculating the identity inducement field strength corresponding to each code segment node includes: Obtain the set of identity data to be bound and the corresponding organization identifier, generate a record to be parsed for each piece of identity data in the identity data set, and establish a parsing result field for each record to be parsed; For each record to be parsed, perform format validation and field parsing to determine the identity type, where: A mobile phone number is identified based on identity data consisting of 11 digits. Identity data that consists of 18 characters, with the last character being a check digit, and passes the verification rules is identified as an ID card number. The verification rules are as follows: Using the first 17 digits of the ID card number as the main code, multiply each digit by the corresponding weighting factor from left to right and sum them. Take the weighted sum modulo 11, and use the remainder as the verification index. Then, retrieve the corresponding verification character from a preset verification code lookup table based on the verification index. If the verification character matches the 18th character of the ID card number, the ID card number is deemed to have passed verification; if the verification character does not match the 18th character, the ID card number is deemed to have failed verification. The 18th character can be a number or the character X. Identity data that meets the preset device serial number character set and whose length is within the preset serial number length range is determined as the device serial number type, wherein: The default device serial number character set includes uppercase English letters and numbers, but does not contain easily confused characters "0", "O" and "I"; The default serial number length ranges from 8 to 20 digits; For each record to be parsed, the identity data is standardized to obtain standardized identity features. The standardization process includes removing spaces and delimiters, converting alphabetic characters to uppercase characters, and combining the identity type, standardized identity features, and organization identifier to form a standardized identity identifier. Set a fixed number of identity buckets and define hash mapping rules. Input each standardized identity identifier into the hash mapping rules to obtain an identity bucket identifier. Write the identity bucket identifiers into the parsing result field to obtain the identity bucket identifier set. The hash mapping rules are as follows: The standardized identity identifier is encoded into a string. The encoded result is input into a preset hash function to generate a hash value. The hash value is then modulo the total number of identity buckets to obtain the corresponding identity bucket identifier. The identity bucket identifier is used to indicate the location of the standardized identity identifier in the identity bucket space. Within a preset statistical time window, the binding frequency of each identity bucket identifier is counted, and the bucket weight corresponding to each identity bucket identifier is generated. Based on the code segment node set, the correspondence between identity bucket identifiers and code segment nodes is established. Based on the historical binding distribution of each code segment node on each identity bucket identifier and the bucket weight, the identity inducement field strength of each code segment node is calculated.
[0026] In this embodiment, generating the channel switching threshold, conflict entropy threshold, and channel switching time window parameters based on the prediction results includes: Obtain historical code issuance request records and historical conflict retry records, align them by timestamp to form historical code issuance request sequences and historical conflict retry sequences, and determine the sampling time interval, historical time window length, and prediction time window length. The historical code issuance request sequence and the historical conflict retry sequence are segmented. The segmentation includes initial segmentation according to a preset segment length, and segmentation boundary is inserted at the position where the change between adjacent sampling points exceeds a preset threshold to obtain multiple segment sequence pairs. When the change between adjacent sampling points exceeds 30% of the average change of the corresponding sequence in the previous statistical window, it is determined to exceed the preset threshold. The improved SegRNN model is constructed as follows: Set up segmented embedding channels for historical code issuance request sequences and historical conflict retry sequences respectively; An intra-segment cross-gating fusion unit is set after the two segmented embedding channels to perform gating fusion on the code transmission request features and conflict retry features within the same segment. The global statistical features of the code segment topology map and the global statistical features of the identity inducement field intensity are obtained to generate a situation vector. Before each segment-level update of the inter-segment recursive unit, the situation vector is injected into the segment-level hidden state through the situation injection unit. An inter-segment memory cache unit is set up outside the inter-segment recursive unit to cache the most recently preset number of segment hidden states. When the next segment is updated, the cached information is read from the inter-segment memory cache unit and merged with the current segment hidden state. The SegRNN model is improved by inputting segmented sequences, and the predicted code issuance request sequence and the predicted conflict retry sequence within the prediction time window are output and a correspondence is established with the timestamp. The channel switching threshold is determined by weighting the peak predicted code issuance request volume and the peak predicted conflict retry count. The conflict entropy threshold is updated based on the ratio of the peak predicted conflict retry count to the peak predicted code issuance request volume. The channel switching time window parameter is determined based on the growth trend of the prediction time window length and the peak predicted code issuance request volume.
[0027] In this embodiment, the step of selecting the equalization channel, offset channel, or rebalancing channel to generate the activation code includes: Calculate the conflict entropy based on the identity binding distribution of each code segment node. Then, synthesize the conflict count, conflict entropy reversal order, identity-induced field strength, and activation code quantity ratio according to preset weights to obtain a channel selection score. Remove code segment nodes in a decaying state to form a candidate code segment node set. The preset weights are: The weight corresponding to the conflict count is 0.35, the weight corresponding to the conflict entropy reversal is 0.30, the weight corresponding to the identity inducement field strength is 0.20, the weight corresponding to the activation code quantity ratio is 0.15, and the sum of all weights is 1. Within the channel switching time window, compare the collision count of candidate code segment nodes with the channel switching threshold and the collision entropy with the collision entropy threshold. If the channel switching conditions are met, it is determined as a rebalancing channel. Otherwise, if there is a node that simultaneously satisfies that the collision entropy is not lower than the collision entropy threshold and the identity inducement field strength is not lower than the preset threshold, it is determined as an offset channel. In other cases, it is determined as a balanced channel. In the balanced channel, the code segment node with the lowest score is selected. An activation code is generated under prefix constraints, and database uniqueness verification is performed. In the offset channel, the code segment node with the lowest score is selected. The last character of the activation code is subjected to a local perturbation not exceeding a preset maximum number of bits. Weight offset generation is then performed in adjacent code segment nodes according to the outgoing edge weight ratio. The prefix constraint refers to: During the activation code generation process, the first few characters of the activation code remain unchanged, and the first few characters are consistent with the prefix interval corresponding to the selected code segment node. Only the remaining characters of the activation code are generated or perturbed to ensure that the generated activation code still belongs to the activation code space corresponding to the code segment node. In the rebalancing channel, code segment nodes that meet the channel switching conditions are identified as risky code segment nodes. De-stressing edges, migration edges, and basic edges are selected according to edge priority to form a target node sequence and generate an activation code. During the channel switching time window, the outward basic edges and migration edges of risky code segment nodes that continuously meet the channel switching conditions are frozen, and only de-stressing edges are retained. The activation code that passes the verification is output.
[0028] In this embodiment, the step of completing the activation code distribution includes: Obtain the distribution task description information. When the distribution task contains an identity data set, the distribution quantity parameter is not used in the distribution task. When the distribution task does not contain an identity data set, the distribution quantity parameter is used in the distribution task. The distribution mode is determined based on the description information of the distribution task. When the distribution task contains an identity data set, the distribution mode is determined to be targeted distribution. When the distribution task does not contain an identity data set and the distribution quantity parameter is greater than zero, the distribution mode is determined to be non-targeted distribution. When it is determined to be targeted distribution, an activation code is generated for each piece of identity data in the identity data set, a one-to-one binding relationship is established between the activation code and the corresponding identity data, a binding record containing the activation code, identity data and organization identifier is generated, and the binding record is written into the activation code binding storage. When it is determined to be non-targeted distribution, activation codes are generated multiple times according to the distribution quantity parameter, generating a corresponding number of activation code sets. An unbound status flag is set for each activation code in the activation code set, and an unbound record containing the activation code and organization identifier is generated. Based on the organization identifier, a mapping relationship is established between the activation code storage and the organization database through a cross-database association mechanism. The bound records generated by targeted distribution or the unbound records generated by non-targeted distribution are written into the corresponding database, thus completing the distribution of activation codes and association with the organization.
[0029] refer to Figure 2 A smart distribution system based on anti-conflict activation codes includes the following modules: The activation code generation and verification module is used to construct the activation code character set, generate activation code candidate codes, and perform database uniqueness verification to obtain the activation code candidate set. The code segment partitioning and topology module is used to perform multi-granular partitioning of the activation code space based on the prefix of the activation code candidate set, construct the code segment topology map, and set the stable state, overload state, decay state and multiplication state; The identity resolution and inducement field module is used to perform format verification and field parsing on the identity data to be bound, and to calculate the identity inducement field strength corresponding to each code segment node. The segmented prediction and threshold module is used to input the historical code issuance request sequence and the historical conflict retry sequence into the improved SegRNN model to perform segmented time series prediction and generate channel switching threshold, conflict entropy threshold and channel switching time window parameters. The hierarchical channel generation module is used to generate activation codes by selecting the equalization channel, the offset channel, or the rebalancing channel based on the code segment topology map, the code segment node status, the identity inducement field strength, and the threshold parameters. The distribution determination and cross-database distribution module is used to perform identity binding processing on activation codes, perform targeted or non-targeted distribution, establish a mapping relationship between activation codes and the organization's database, and complete the activation code distribution.
[0030] Example 1:
[0031] To verify the feasibility of this invention in practice, it was applied to a regional digital service platform. This platform provides local users with video content, online courses, and value-added services, and uses activation codes as the primary method for distributing and redeeming membership benefits. The platform's activation codes are mainly distributed through online activities, partner channels, and offline promotions. The recipients include both targeted users with explicitly designated mobile phone numbers or devices, and non-targeted users who obtain the codes through activity pages.
[0032] In the early stages of operation, the platform had a small user base and a low frequency of activation code generation and distribution. The traditional method of random generation combined with database uniqueness verification was sufficient to meet basic needs. However, as the user base grew, the number of activation code requests increased significantly during holiday promotions and joint marketing events. Concentrated concurrent requests at certain times led to problems such as rising activation code generation conflict rates, fluctuating generation delays, failed redemptions in concentrated areas, and inefficiency of manual configuration and distribution. Since the platform serves multiple partner organizations, activation code data needs to be consistent between the activation code database and the organization's management database. Traditional static mapping methods suffer from untimely synchronization and complex attribution verification issues in actual operation and maintenance.
[0033] Based on the above-mentioned actual business needs, the platform has introduced the anti-conflict activation code intelligent distribution method described in this invention into the member activation code system, and has upgraded the activation code generation, scheduling, distribution and organization association process as a whole.
[0034] In this embodiment, the platform first constructs an activation code character set, uniformly using a combination of uppercase letters and numbers, and removes easily confused characters. It then generates activation code candidate codes according to a preset length. At the same time, database uniqueness verification is performed during the generation stage to ensure that there are no duplicate code values in the activation code candidate set that enters the subsequent process.
[0035] Subsequently, the system performs multi-granularity partitioning of the activation code prefixes in the activation code candidate set to form multiple code segment nodes, and counts the number of activation codes, conflict counts, and identity binding distribution of each code segment node to construct a code segment topology map. Based on the running status, the system dynamically sets stable state, overload state, decay state, or proliferation state for each code segment node, so that the activation code space is transformed from a disordered state to a perceptible and schedulable structured state.
[0036] During the identity processing phase, the system performs format verification and field parsing on the user-submitted mobile phone number, ID card number, and device serial number to generate standardized identity features and generate identity bucket identifiers through hash mapping. Based on historical binding data, the system calculates the identity-induced field strength of each code segment node to reflect the carrying pressure of different code segments on the current identity distribution.
[0037] During peak coding periods, the system inputs the historical number of coding requests and the number of conflict retries into the improved SegRNN model to perform segmented time series prediction, obtain the coding pressure and conflict trend prediction results within the future time window, and generate channel switching threshold, conflict entropy threshold, and channel switching time window parameters.
[0038] During the activation code generation phase, the system considers the overall code segment topology, identity-induced field strength, and threshold parameters to select between the equalization channel, offset channel, and rebalancing channel. When the system load is stable, the equalization channel is used to generate activation codes first; when an identity concentration trend is detected, the offset channel is used for local perturbation and code segment offset; when the risk of conflict increases, the rebalancing channel is activated to reduce the risk of conflict through cross-code segment migration and edge freezing mechanisms.
[0039] During the distribution phase, the system automatically determines whether to perform targeted or non-targeted distribution based on whether the distribution task contains specific identity data. It also establishes a mapping relationship between the organization identifier of the activation code and the organization database through a cross-database association mechanism to ensure that the activation code ownership information remains consistent across multiple organizations.
[0040] The platform conducted comparative tests on the original system and the system after incorporating the solution of this invention. The test environment consisted of the same business system, the same database size, and the same activation code length settings. The test covered peak hours on weekdays and weekends, with an average daily activation code generation of approximately 1.2 million and a peak request volume of approximately 25,000 times per second.
[0041] Table 1. Performance Comparison of Activation Code Generation and Distribution As can be seen from the data in Table 1, under test conditions where the activation code length, average daily generation volume, and peak concurrent requests remain completely consistent, the proposed solution demonstrates a significant advantage in multiple key performance indicators. This indicates that the performance improvement is not due to hardware expansion or changes in business scale, but rather a result of improvements in the activation code generation and distribution mechanism itself. Comparing the solutions under the same concurrent pressure and generation scale helps to objectively reflect the differences between the two solutions in a real business environment.
[0042] Regarding the stability of activation code generation, the traditional scheme has a conflict rate of 0.28%, while the present invention reduces this indicator to 0.07%. This demonstrates that by introducing code segment division, code segment topology control, and hierarchical generation channels, the conflict problems caused by code value concentration and repeated verification during random generation are effectively reduced. Simultaneously, the average generation time per code is reduced from 1.4 milliseconds to 0.9 milliseconds, and the peak generation failure retry rate is reduced from 0.19% to 0.05%. This reflects that in high-concurrency scenarios, the present invention can maintain the continuity and efficiency of the generation process through predictive control and channel switching mechanisms, avoiding the amplification effect of retry caused by frequent conflicts.
[0043] At the distribution and management level, the traditional solution has a 0.32% failure rate in areas with concentrated identities, while the solution of this invention reduces this rate to 0.11%, indicating that the identity-inducing field mechanism can effectively alleviate the pressure caused by concentrated redemption of specific identity types or regions, making the distribution of activation codes more balanced. The traditional solution requires frequent manual configuration during distribution mode switching, increasing the operational burden and the risk of human error. The solution of this invention eliminates the need for manual intervention by automatically determining targeted and non-targeted distribution. Finally, in multi-organizational environments, the traditional solution still exhibits occasional organizational mapping anomalies, while no related anomaly records were found in the solution of this invention during testing, demonstrating the practical effectiveness of the cross-database association mechanism in ensuring the consistency of activation code ownership.
[0044] The above description is only a preferred embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any equivalent substitutions or modifications made by those skilled in the art within the scope of the technology disclosed in the present invention, based on the technical solution and inventive concept of the present invention, should be covered within the scope of protection of the present invention.
Claims
1. A method for intelligent distribution of anti-collision activation codes, characterized in that, include: Construct an activation code character set, process the activation code character set, generate activation code candidate codes according to a preset length, and perform database uniqueness verification to obtain a set of activation code candidate codes that pass the verification. The activation code space is divided into multiple granularities based on the prefix of the activation code in the candidate activation code set, generating multiple code segment nodes, constructing a code segment topology map, and setting stable state, overload state, decay state and multiplication state for each code segment node; The format validation and field parsing of the identity data to be bound are performed, the mobile phone number, ID card number and device serial number are converted into standardized identity features, identity bucket identifiers are generated through hash mapping, and the identity inducement field strength corresponding to each code segment node is calculated. The historical code issuance request sequence and the historical conflict retry sequence are input into the improved SegRNN model for segmented time series prediction. Based on the prediction results, the channel switching threshold, conflict entropy threshold and channel switching time window parameters are generated. Based on the code segment topology map, code segment node status, identity inducement field strength, channel switching threshold, conflict entropy threshold, and channel switching time window parameters, an activation code is generated by selecting a balanced channel, an offset channel, or a rebalanced channel. The activation code undergoes identity binding processing. Based on the identity data or distribution quantity contained in the distribution task, it is determined whether to perform targeted or non-targeted distribution. Through a cross-database association mechanism, a mapping relationship is established between the organization identifier of the activation code and the organization database to complete the activation code distribution.
2. The intelligent distribution method based on the anti-collision activation code according to claim 1, characterized in that, The processing of the activation code character set includes removing the characters "0", "O", and "I" from the activation code character set.
3. The intelligent distribution method based on the anti-collision activation code according to claim 1, characterized in that, The step of generating activation code candidate codes according to a preset length and performing database uniqueness verification includes: According to the preset character length of 6 digits, characters are selected sequentially from the activation code character set to generate activation code candidate codes. Before writing the activation code candidate codes into the activation code database, a uniqueness check is performed on the activation code candidate codes based on the uniqueness constraint corresponding to the activation code field. If the uniqueness check fails, a new 6-digit activation code candidate code is generated and the uniqueness check is performed again; When the uniqueness check passes, the corresponding 6-digit activation code candidate code is confirmed as a usable activation code and added to the activation code candidate set.
4. The intelligent distribution method based on the anti-collision activation code according to claim 1, characterized in that, The construction of the code segment topology map involves setting stable, overloaded, decaying, and multiplying states for each code segment node, including: Obtain the candidate set of activation codes, divide the activation code space according to the two-digit prefix as the main granularity and maintain one-digit and three-digit prefixes as the auxiliary granularity in parallel, generate the corresponding code segment node set, and initialize the number of activation codes, conflict count and identity binding distribution for each code segment node. Within a time window, summarize the percentage of activation codes, the percentage of conflict counts, and the distribution ratio of identity binding for each code segment node, record the difference between the previous time window and the current time window, and obtain three incremental statistical results: change in usage rate, change in conflict rate, and change in identity distribution. Based on the similarity intervals of identity binding distribution, the difference intervals of usage rate, and the difference intervals of conflict rate between each pair of code segment nodes, basic connections are constructed. When the three indicators simultaneously meet the corresponding preset intervals, basic connections are established. The three indicators are weighted and synthesized into edge weights, and only basic connections not lower than the preset threshold are retained to form the basic topology. Constructing multiple types of topologies on top of the basic topology to form a code segment topology map: For overloaded nodes, target nodes are selected in descending order of identity-induced field strength, utilization rate, and conflict rate. Pressure relief connections are established, and pressure relief connections are assigned a higher priority and maximum available capacity than basic connections. Based on the directed sequences successfully generated across historical code segments, migration edges are established. The priority of migration edges is determined by their frequency of occurrence and the time of their most recent occurrence. The priority is lower than that of pressure relief edges but higher than that of basic edges. When a node is in a decaying state and there are still collision counts, freeze the node's outward basic edges and migration edges, and only retain the pressure relief edges pointing to the node. Based on the incremental statistics and edge priority, stable state, overload state, decay state and multiplication state are set for each code segment node.
5. The intelligent distribution method based on anti-collision activation codes according to claim 1, characterized in that, The calculation of the identity inducement field strength corresponding to each code segment node includes: Obtain the set of identity data to be bound and the corresponding organization identifier, generate a record to be parsed for each piece of identity data in the identity data set, and establish a parsing result field for each record to be parsed; For each record to be parsed, perform format validation and field parsing to determine the identity type, where: A mobile phone number is identified based on identity data consisting of 11 digits. Identity data that consists of 18 characters and whose last character is a check digit, and which passes the verification rules, is identified as an ID card number. Identity data that meets the preset device serial number character set and whose length is within the preset serial number length range is determined as the device serial number type; For each record to be parsed, the identity data is standardized to obtain standardized identity features. The standardization process includes removing spaces and delimiters, converting alphabetic characters to uppercase characters, and combining the identity type, standardized identity features, and organization identifier to form a standardized identity identifier. Set a fixed number of identity buckets and set hash mapping rules. Input each standardized identity identifier into the hash mapping rules to obtain the identity bucket identifier. Write the identity bucket identifier into the parsing result field to obtain the identity bucket identifier set. Within a preset statistical time window, the binding frequency of each identity bucket identifier is counted, and the bucket weight corresponding to each identity bucket identifier is generated. Based on the code segment node set, the correspondence between identity bucket identifiers and code segment nodes is established. Based on the historical binding distribution of each code segment node on each identity bucket identifier and the bucket weight, the identity inducement field strength of each code segment node is calculated.
6. The intelligent distribution method based on anti-collision activation codes according to claim 1, characterized in that, The process of generating channel switching threshold, conflict entropy threshold, and channel switching time window parameters based on the prediction results includes: Obtain historical code issuance request records and historical conflict retry records, align them by timestamp to form historical code issuance request sequences and historical conflict retry sequences, and determine the sampling time interval, historical time window length, and prediction time window length. The historical code issuance request sequence and the historical conflict retry sequence are segmented. The segmentation includes initial division according to a preset segment length, and insertion of segment boundaries at positions where the change in adjacent sampling points exceeds a preset threshold, resulting in multiple segment sequence pairs. The improved SegRNN model is constructed as follows: Set up segmented embedding channels for historical code issuance request sequences and historical conflict retry sequences respectively; An intra-segment cross-gating fusion unit is set after the two segmented embedding channels to perform gating fusion on the code transmission request features and conflict retry features within the same segment. The global statistical features of the code segment topology map and the global statistical features of the identity inducement field intensity are obtained to generate a situation vector. Before each segment-level update of the inter-segment recursive unit, the situation vector is injected into the segment-level hidden state through the situation injection unit. An inter-segment memory cache unit is set up outside the inter-segment recursive unit to cache the most recently preset number of segment hidden states. When the next segment is updated, the cached information is read from the inter-segment memory cache unit and merged with the current segment hidden state. The SegRNN model is improved by inputting segmented sequences, and the predicted code issuance request sequence and the predicted conflict retry sequence within the prediction time window are output and a correspondence is established with the timestamp. The channel switching threshold is determined by weighting the peak predicted code issuance request volume and the peak predicted conflict retry count. The conflict entropy threshold is updated based on the ratio of the peak predicted conflict retry count to the peak predicted code issuance request volume. The channel switching time window parameter is determined based on the growth trend of the prediction time window length and the peak predicted code issuance request volume.
7. The intelligent distribution method based on anti-collision activation codes according to claim 1, characterized in that, The step of selecting the equalization channel, offset channel, or rebalancing channel to generate the activation code includes: The conflict entropy is calculated based on the identity binding distribution of each code segment node. The conflict count, conflict entropy reversal, identity-induced field strength and activation code quantity ratio are synthesized according to preset weights to obtain the channel selection score. Code segment nodes in the decay state are eliminated to form a candidate code segment node set. Within the channel switching time window, compare the collision count of candidate code segment nodes with the channel switching threshold and the collision entropy with the collision entropy threshold. If the channel switching conditions are met, it is determined as a rebalancing channel. Otherwise, if there is a node that simultaneously satisfies that the collision entropy is not lower than the collision entropy threshold and the identity inducement field strength is not lower than the preset threshold, it is determined as an offset channel. In other cases, it is determined as a balanced channel. In the balanced channel, select the code segment node with the lowest channel selection score, generate the activation code under the prefix constraint and perform database uniqueness verification. In the offset channel, select the code segment node with the lowest channel selection score, perform local perturbation on the last character of the activation code by no more than the preset maximum number of characters, and perform weight offset generation in the adjacent code segment nodes according to the weight ratio of the outgoing edge. In the rebalancing channel, code segment nodes that meet the channel switching conditions are identified as risky code segment nodes. De-stressing edges, migration edges, and basic edges are selected according to edge priority to form a target node sequence and generate an activation code. During the channel switching time window, the outward basic edges and migration edges of risky code segment nodes that continuously meet the channel switching conditions are frozen, and only de-stressing edges are retained. The activation code that passes the verification is output.
8. The intelligent distribution method based on the anti-collision activation code according to claim 1, characterized in that, The completion of activation code distribution includes: Obtain the distribution task description information. When the distribution task contains an identity data set, the distribution quantity parameter is not used in the distribution task. When the distribution task does not contain an identity data set, the distribution quantity parameter is used in the distribution task. The distribution mode is determined based on the description information of the distribution task. When the distribution task contains an identity data set, the distribution mode is determined to be targeted distribution. When the distribution task does not contain an identity data set and the distribution quantity parameter is greater than zero, the distribution mode is determined to be non-targeted distribution. When it is determined to be targeted distribution, an activation code is generated for each piece of identity data in the identity data set, a one-to-one binding relationship is established between the activation code and the corresponding identity data, a binding record containing the activation code, identity data and organization identifier is generated, and the binding record is written into the activation code binding storage. When it is determined to be non-targeted distribution, activation codes are generated multiple times according to the distribution quantity parameter, generating a corresponding number of activation code sets. An unbound status flag is set for each activation code in the activation code set, and an unbound record containing the activation code and organization identifier is generated. Based on the organization identifier, a mapping relationship is established between the activation code storage and the organization database through a cross-database association mechanism. The bound records generated by targeted distribution or the unbound records generated by non-targeted distribution are written into the corresponding database, thus completing the distribution of activation codes and association with the organization.
9. An anti-collision activation code-based intelligent distribution system, which executes an anti-collision activation code-based intelligent distribution method according to any one of claims 1 to 8. Includes the following modules: The activation code generation and verification module is used to construct the activation code character set, generate activation code candidate codes, and perform database uniqueness verification to obtain the activation code candidate set. The code segment partitioning and topology module is used to perform multi-granular partitioning of the activation code space based on the prefix of the activation code candidate set, construct the code segment topology map, and set the stable state, overload state, decay state and multiplication state; The identity resolution and inducement field module is used to perform format verification and field parsing on the identity data to be bound, and to calculate the identity inducement field strength corresponding to each code segment node. The segmented prediction and threshold module is used to input the historical code issuance request sequence and the historical conflict retry sequence into the improved SegRNN model to perform segmented time series prediction and generate channel switching threshold, conflict entropy threshold and channel switching time window parameters. The hierarchical channel generation module is used to generate activation codes by selecting the equalization channel, the offset channel, or the rebalancing channel based on the code segment topology map, the code segment node status, the identity inducement field strength, and the threshold parameters. The distribution determination and cross-database distribution module is used to perform identity binding processing on activation codes, perform targeted or non-targeted distribution, establish a mapping relationship between activation codes and the organization's database, and complete the activation code distribution.