Multi-merchant distributed serial number generation method, system and related device

By constructing a multi-merchant serial number isolation system and AI intelligent scheduling, combined with two-layer anti-counterfeiting verification, the problems of serial number mixing, resource waste and security in multi-merchant scenarios are solved, and efficient and secure serial number generation and management are achieved.

CN122491575APending Publication Date: 2026-07-31SHENZHEN ZHONGNONG DATA CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
SHENZHEN ZHONGNONG DATA CO LTD
Filing Date
2026-04-24
Publication Date
2026-07-31

AI Technical Summary

Technical Problem

Existing distributed serial number generation solutions cannot adapt to the differentiated needs of multiple merchant scenarios, and suffer from problems such as mixed serial numbers, waste of resources, concurrency congestion, and insufficient anti-counterfeiting capabilities.

Method used

A multi-merchant serial number isolation system is constructed, which uses the merchant's unique identifier and periodic node code as a combination key to generate an independent serial number pool. It is then intelligently scheduled through an AI time-series prediction model and combined with a two-layer anti-counterfeiting verification mechanism to achieve isolation between merchants, periodic reset, and high-concurrency adaptation.

Benefits of technology

It achieves independent isolation of serial numbers among merchants, supports configurable periodic reset, optimizes resource utilization, improves system concurrency performance and security, effectively intercepts malicious forgery behavior, and reduces operation and maintenance costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122491575A_ABST
    Figure CN122491575A_ABST
Patent Text Reader

Abstract

This invention provides a method, system, and related equipment for generating distributed serial numbers for multiple merchants. The method constructs a multi-merchant serial number isolation system, maintaining an independent serial number pool in a distributed cache using unique merchant identifiers and periodic node codes. This ensures that serial numbers between merchants do not interfere with each other and supports merchants' custom periodic resets. A timed task and critical value verification mechanism ensures accurate serial number clearing. The method also incorporates an AI time-series prediction model for intelligent scheduling, dynamically adjusting the pre-fetched serial number segment length based on the real-time concurrency of merchants to optimize resource utilization and high-concurrency performance. Furthermore, a two-layer anti-counterfeiting verification mechanism combining static encryption and an AI risk control model is employed to identify and intercept malicious forgery and abnormal request behavior. This invention solves the core pain points of serial number isolation, periodic reset, high-concurrency adaptation, and security anti-counterfeiting in multi-merchant scenarios, improving system performance and operational efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of e-commerce order management, and in particular to a method, system and related equipment for generating distributed serial numbers for multiple merchants. Background Technology

[0002] With the rapid development of SaaS platforms, multi-merchant platforms have become the mainstream business model. These platforms aggregate a large number of merchants of different sizes and industries, each with its own independent business processes, statistical needs, and archiving habits. As order volumes experience explosive growth and concurrent scenarios become increasingly complex, different merchants have varying needs for serial numbers. At the same time, malicious users frequently forge and traverse serial numbers, leading to security issues such as data leaks, fake orders, and malicious reconciliation, further increasing the requirements for serial number anti-counterfeiting capabilities.

[0003] However, most existing distributed serial number generation solutions are not optimized for the core needs of multi-merchant scenarios and still have many shortcomings. For example, although the Snowflake algorithm can achieve high-concurrency generation, the serial number is globally incremented and cannot be reset according to the merchant's needs. It also lacks a merchant isolation mechanism, resulting in mixed serial numbers from different merchants, making reconciliation difficult. Furthermore, the fixed allocation of serial numbers in the existing number segment mode cannot adapt to fluctuations in merchant traffic, which can easily lead to resource waste or concurrency congestion. In addition, the anti-counterfeiting mechanism is not perfect. It can only handle known counterfeiting behavior and cannot adaptively identify unknown malicious requests, which can easily lead to security problems such as data leakage and fake orders. Moreover, it cannot achieve intelligent scheduling and proactive risk control, making it difficult to adapt to high-concurrency and differentiated business scenarios of multiple merchants.

[0004] Therefore, existing technologies still need to develop a serial number generation scheme that can achieve periodic configurable reset, multi-merchant isolation, anti-counterfeiting, and intelligent scheduling. Summary of the Invention

[0005] This invention provides a method, system, and related equipment for generating distributed serial numbers for multiple merchants. The main objective of this invention is to solve the technical problems mentioned in the background section of the prior art.

[0006] The first aspect of this invention provides a method for generating distributed serial numbers for multiple merchants, comprising: A multi-merchant serial number isolation system is constructed, using the merchant's unique identifier and periodic node code as a composite key. An independent atomic counter is maintained for each composite key in the distributed cache to generate an independent serial number pool for each merchant. Configure and execute the serial number periodic reset, obtain the merchant's customized reset period, and reset the merchant's serial number from the starting value to zero at the end of the period through a scheduled task and threshold verification mechanism. Intelligent scheduling is based on AI models. The AI ​​time series prediction model is used to analyze the merchant's historical business data and time period traffic characteristics to predict the real-time concurrency. The pre-fetch length of a single node number segment is dynamically adjusted according to the real-time concurrency. A two-layer anti-counterfeiting verification is implemented. During the serial number generation and request phase, a static encryption verification layer is used to generate and verify the verification characters embedded in the serial number, and an AI risk control model layer is used to identify and intercept malicious forgery and abnormal request behaviors in real time.

[0007] In an optional embodiment of the first aspect of the present invention, the step of using a merchant's unique identifier and a periodic node code as a composite key, maintaining an independent atomic counter for each composite key in a distributed cache, and generating an independent sequence number pool for each merchant includes: The merchant code that corresponds one-to-one with the merchant ID and the cycle node code generated according to the merchant's custom reset cycle are combined as a composite key; In the distributed cache, an independent atomic counter is maintained for each of the composite keys. Each atomic counter corresponds to a serial number pool for the current period of a merchant. Through the key-value isolation mechanism of the distributed cache, the serial number pools of different merchants do not interfere with each other, and independent access and updates are achieved.

[0008] In an optional embodiment of the first aspect of the present invention, the mechanism for periodically resetting the serial number includes: During the critical period of the cycle, the merchant's independent sequence number pool is locked by a distributed lock to ensure that the reset operation is not performed until the sequence numbers not generated in the cycle are completed. An AI fault-tolerance mechanism is introduced to automatically calibrate clock deviations for merchants in different time zones to adapt to the corresponding cycle end nodes, and to trigger alarms and execute fallback reset strategies when reset fails.

[0009] In an optional embodiment of the first aspect of the present invention, the step of using an AI time-series prediction model to analyze the merchant's historical business data and time-period traffic characteristics, predicting real-time concurrency, and dynamically adjusting the prefetch length of a single node number segment based on the real-time concurrency includes: Predict merchant traffic using LSTM or Transformer time series models; When a low-traffic period is predicted, a small step size is used to pre-select number segments; When a high-traffic period is predicted or a sudden surge in traffic is detected, the number segment expansion mechanism is automatically triggered, using a large step size to pre-fetch number segments in order to adapt to traffic fluctuations and save system resources.

[0010] In an optional embodiment of the first aspect of the present invention, generating and verifying the verification characters embedded in the serial number through the static encryption verification layer includes: A combination of merchant-specific keys, CRC32, and modular arithmetic encryption is used to perform hash calculations on the merchant code, periodic node code, and current period sequence number; A fixed number of dynamic verification characters are extracted and embedded into the generated serial number structure; During verification, the target field is extracted, the hash value is recalculated, and compared with the embedded check bits to achieve offline verification.

[0011] In an optional embodiment of the first aspect of the present invention, the step of identifying and intercepting malicious forgery and abnormal request behaviors in real time through the AI ​​risk control model layer includes: A deep learning anomaly detection model was constructed, and the normal serial number generation pattern, merchant request frequency, IP behavior and time period distribution features were extracted for model training. The real-time request is input into the deep learning anomaly detection model, which adaptively identifies known and unknown malicious behaviors and directly intercepts and determines them as abnormal requests. The malicious behaviors include malicious high-frequency number guessing, random forgery, and batch requests.

[0012] In an optional embodiment of the first aspect of the present invention, the multi-merchant distributed serial number generation method further includes: Real-time monitoring includes core system metrics such as number segment consumption rate, clock offset, periodic reset status, and anti-counterfeiting interception rate. Identify abnormal trends and issue early warnings using AI models; When a node failure or cache anomaly is detected, a degradation strategy is automatically triggered to switch the system to database number segment mode, and the continuity of serial numbers is automatically checked daily to intelligently repair issues such as missing or skipped numbers.

[0013] A second aspect of the present invention provides a multi-merchant distributed serial number generation system, the multi-merchant distributed serial number generation system comprising: The multi-merchant serial number construction module is used to build a multi-merchant serial number isolation system. It uses the merchant's unique identifier and the periodic node code as a composite key. In the distributed cache, it maintains an independent atomic counter for each composite key and generates an independent serial number pool for each merchant. The serial number period reset module is used to configure and execute serial number period reset, obtain the merchant's customized reset period, and reset the merchant's serial number from the starting value to zero at the end of the period through scheduled tasks and threshold verification mechanism. The AI ​​intelligent scheduling module is used for intelligent scheduling based on AI models. It uses AI time series prediction models to analyze merchants' historical business data and time period traffic characteristics, predicts real-time concurrency, and dynamically adjusts the prefetch length of single node number segments according to the real-time concurrency. The dual-layer anti-counterfeiting verification module is used to perform dual-layer anti-counterfeiting verification. During the serial number generation and request phase, it generates and verifies the verification characters embedded in the serial number through a static encryption verification layer, and identifies and intercepts malicious forgery and abnormal request behavior in real time through an AI risk control model layer.

[0014] A third aspect of the present invention provides a multi-merchant distributed serial number generation device, the multi-merchant distributed serial number generation device comprising: a memory and at least one processor, wherein the memory stores instructions, and the memory and the at least one processor are interconnected via a line; The at least one processor invokes the instructions in the memory to cause the multi-merchant distributed serial number generation device to perform the multi-merchant distributed serial number generation method as described in any one of the first aspects of the present invention.

[0015] A fourth aspect of the present invention provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the multi-merchant distributed serial number generation method as described in any one of the first aspects of the present invention.

[0016] Beneficial Effects: This invention provides a method, system, and related equipment for generating distributed serial numbers for multiple merchants. The method constructs a multi-merchant serial number isolation system, maintaining an independent serial number pool in a distributed cache using unique merchant identifiers and periodic node codes. This ensures that serial numbers between merchants do not interfere with each other and supports merchants' custom periodic resets. A timed task and critical value verification mechanism ensures accurate serial number clearing. The method also introduces an AI time-series prediction model for intelligent scheduling, dynamically adjusting the number segment pre-fetching length based on the real-time concurrency of merchants to optimize resource utilization and high-concurrency performance. Furthermore, a two-layer anti-counterfeiting verification mechanism combining static encryption and an AI risk control model is employed to identify and intercept malicious forgery and abnormal request behavior. This invention solves the core pain points of serial number isolation, periodic reset, high-concurrency adaptation, and security anti-counterfeiting in multi-merchant scenarios, improving system performance and operational efficiency. Attached Figure Description

[0017] Figure 1 This is a schematic diagram of an embodiment of the multi-merchant distributed serial number generation method of the present invention; Figure 2 This is a schematic diagram of an embodiment of the AI ​​operation and maintenance process of the multi-merchant distributed serial number generation method of the present invention; Figure 3 This is a schematic diagram of an embodiment of the multi-merchant distributed serial number generation system of the present invention; Figure 4 This is a schematic diagram of an embodiment of a multi-merchant distributed serial number generation device according to the present invention. Detailed Implementation

[0018] The terms "first," "second," "third," "fourth," etc. (if present) in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" or "having" and any variations thereof are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0019] Distributed serial number generation is a solution designed to provide efficient, secure, and independent order numbering services for multi-merchant platforms. By optimizing the entire process of serial number generation, verification, and scheduling, it solves core issues such as multi-merchant isolation, periodic reset, anti-counterfeiting, and high-concurrency adaptation. In large-scale multi-merchant operation scenarios, such as multi-merchant e-commerce platforms and SaaS service systems, each merchant has independent reconciliation, statistics, and archiving needs, requiring serial numbers to be reset according to preset periods (daily, weekly, monthly, etc.), while preventing malicious forgery and serial number traversal. The platform needs to handle scenarios with massive concurrent order generation, ensuring unique serial numbers and reasonable resource utilization. However, most current distributed serial number generation solutions cannot adapt to the differentiated needs of multi-merchant scenarios.

[0020] To address the aforementioned issues with existing distributed sequence number generation schemes, see [link to relevant documentation]. Figure 1 The first aspect of this invention provides a method for generating distributed serial numbers for multiple merchants, comprising: S100. Construct a multi-merchant serial number isolation system, using the merchant's unique identifier and periodic node code as a composite key. Maintain an independent atomic counter for each composite key in a distributed cache, generating an independent serial number pool for each merchant. Specifically, this step may include: combining the merchant code, which corresponds one-to-one with the merchant ID, and the periodic node code generated according to the merchant's custom reset period, as a composite key; maintaining an independent atomic counter for each composite key in the distributed cache, with each atomic counter corresponding to a merchant's current period serial number pool; and using the key-value isolation mechanism of the distributed cache to ensure that the serial number pools of different merchants do not interfere with each other, enabling independent access and updates.

[0021] Specifically, the core function of step S100 of this invention is to achieve independent isolation of serial numbers for different merchants, avoid serial number conflicts and business confusion between merchants, and provide basic support for periodic reset. This step uses the combination of "merchant unique identifier (merchant code) + periodic node code" as the unique key. In the distributed cache (Redis / etcd), an independent atomic counter is maintained for each unique key. Each atomic counter corresponds to a serial number pool for the current period of a merchant. Serial number pools for different merchants and different periods do not interfere with each other.

[0022] In this invention, the merchant code can be a 4-digit number / letter combination (expandable according to business needs), corresponding one-to-one with the merchant ID and embedded in the serial number structure to achieve rapid identification and isolation of merchant identity. The periodic node code is generated according to the reset period configured by the merchant. For example, the code corresponding to daily reset is YYMMDD, the code corresponding to weekly reset is YYWW, and the code corresponding to monthly reset is YYMM. This ensures that the serial number pools of different periods are independently distinguished. Furthermore, through the key-value isolation mechanism of distributed caching, it ensures that the serial number pools of different merchants can be accessed and updated independently, avoiding serial number conflicts when multiple merchants generate serial numbers. At the same time, it meets the needs of merchants for independent reconciliation and archiving.

[0023] A specific example of step S100 of the present invention can be as follows: The system assigns a unique 4-digit number or letter combination as a merchant code to each connected merchant. At the same time, according to the reset period configured by the merchant in the background (such as daily reset, monthly reset), the system automatically generates the corresponding period node code (such as "231027" for daily reset and "2310" for monthly reset). The system concatenates the "merchant code + period node code" as the key of the atomic counter (AtomicCounter) in Redis. Whenever the merchant initiates a serial number request, the system only performs an auto-increment operation under the corresponding key. This mechanism ensures that the serial number generation between merchants does not interfere with each other in high-concurrency scenarios with multiple merchants and is logically completely isolated, solving the problem of mixed serial numbers of different merchants and difficulties in reconciliation in existing technical solutions.

[0024] S200. Configure and execute the serial number periodic reset, obtain the merchant's customized reset period, and reset the merchant's serial number from the initial value to zero at the end of the period through a scheduled task and critical value verification mechanism. In this invention, the serial number periodic reset mechanism may include: locking the merchant's independent serial number pool through a distributed lock during the critical period of the period to ensure that the reset operation is performed only after the serial numbers not generated in the period are completed; introducing an AI fault tolerance mechanism to automatically calibrate the clock deviation for merchants in cross-time zones to adapt to the corresponding end of the period, and triggering an alarm and executing a fallback reset strategy when the reset fails.

[0025] Specifically, the core function of step S200 of this invention is to enable each merchant to automatically reset the serial number from the starting value to zero according to a preset period, adapting to the statistical and archiving habits of different merchants. This invention supports merchants to customize the reset period, with three basic periods preset: daily, weekly, and monthly. It also supports custom periods (such as every 3 days or every 15 days). Merchants can choose these periods independently through the backend configuration interface. The configuration information is synchronized to the distributed cache in real time and takes effect without restarting the system.

[0026] Furthermore, the reset trigger employs a triple mechanism of "scheduled task + critical value verification + AI fault tolerance." Based on the merchant's configured cycle, it automatically identifies the end node of the cycle (e.g., midnight daily, midnight every Sunday, midnight every month) and triggers the serial number reset. During the cycle's critical period (e.g., 23:59:50-00:00:10 daily), a distributed lock locks the serial number pool, prioritizing the completion of serial numbers not generated in the previous cycle before performing the reset operation. This avoids serial number corruption across cycles. AI intelligently calibrates clock deviations, automatically adapting to the cycle end node of the corresponding time zone for merchants operating across time zones, resolving reset corruption issues. Simultaneously, it monitors the reset status; if a reset fails (e.g., cache anomaly, node failure), it immediately triggers an AI alarm and executes a fallback reset strategy to ensure that the merchant's serial number for the next cycle starts incrementing normally from the initial value.

[0027] A specific example of step S200 of this invention can be as follows: Merchants select a reset cycle through the SaaS management backend, and configuration information is synchronized to the cache in real time. To ensure the smoothness of the reset process, the system adopts a "scheduled task + critical value verification + AI fault tolerance" mechanism. During the critical period of cycle switching (e.g., 23:59:50 to 00:00:10), the system locks the current sequence number pool through a distributed lock. During this period, the system prioritizes processing residual requests from the previous cycle in the buffer to ensure their numbering is continuous, and then immediately performs a zeroing operation. For cross-time zone merchants such as those engaged in cross-border trade, this invention automatically identifies the time zone offset of the request source through an AI module and intelligently calibrates the clock to ensure that the sequence number is accurately reset at midnight in the merchant's local time zone. If a Redis connection anomaly is detected, causing the reset command to fail, AI operations and maintenance will immediately intervene and execute a preset fallback strategy (such as marking the number segment as invalid and jumping to the new cycle start value) to ensure uninterrupted business operations.

[0028] S300. Intelligent scheduling based on AI models: Utilizing AI time-series prediction models to analyze merchants' historical business data and time-period traffic characteristics, predicting real-time concurrency, and dynamically adjusting the prefetch length of single-node number segments based on the real-time concurrency. Specifically, this step may include: using LSTM or Transformer time-series models to predict merchant traffic; when predicting a low-traffic period, using small-step prefetching of number segments; when predicting a high-traffic period or identifying a sudden traffic surge, automatically triggering a number segment expansion mechanism, using large-step prefetching of number segments to adapt to traffic fluctuations and save system resources.

[0029] Specifically, the core function of step S300 in this invention is to adapt to traffic fluctuations of different merchants and at different times, optimize number segment allocation, improve system concurrency performance, and avoid resource waste and congestion. This step can use AI time series models such as LSTM and Transformer, combined with merchants' historical business data, activity planning, and time period traffic characteristics, to predict the real-time concurrency of merchants and dynamically adjust the number segment prefetching length of a single node. During low-traffic periods, a small step size prefetching (such as prefetching 10 serial numbers each time) is used to avoid resource waste, while during high-traffic periods, a large step size prefetching (such as prefetching 100 serial numbers each time) is used to improve concurrency processing capabilities. The AI ​​model continuously learns the traffic patterns of merchants and continuously optimizes the prediction accuracy. For sudden traffic surges, a number segment expansion mechanism is automatically triggered to ensure uninterrupted serial number generation. For merchants with low traffic, the number segment prefetching length is automatically reduced to save system resources.

[0030] A specific example of step S300 of the present invention can be as follows: The system of the present invention integrates a time series prediction model based on LSTM (Long Short-Term Memory Network) or Transformer. The model obtains the merchant's historical business order volume, holiday activity plan and hourly traffic fluctuation characteristics in real time. The AI ​​time series prediction model can predict the peak concurrency in the next hour through training.

[0031] Low-traffic mode: When the predicted concurrency is low, the system adopts small-step prefetching (such as prefetching 10 number segments from the distributed cache to the application node memory each time) to avoid resource waste.

[0032] High-traffic mode: When a major promotional event or traffic peak is predicted, the system automatically switches to large-step prefetching (such as prefetching 100-500 number segments each time), reducing the frequency of interaction with the cache layer and greatly improving the system's throughput and response speed.

[0033] S400. Perform dual-layer anti-counterfeiting verification. During the serial number generation and request phase, a static encryption verification layer generates and verifies the verification characters embedded in the serial number, and an AI risk control model layer identifies and intercepts malicious forgery and abnormal request behaviors in real time. In this invention, this step may specifically include: using a combination of merchant-specific keys, CRC32, and modular arithmetic encryption to perform hash calculations on the merchant code, periodic node code, and current period serial number; embedding a fixed number of dynamic verification characters into the generated serial number structure; during verification, recalculating the hash value of the target field and comparing it with the embedded verification bits to achieve offline verification; and constructing a deep learning anomaly detection model to extract normal serial number generation patterns, merchant request frequency, IP behavior, and time period distribution features for model training; inputting real-time requests into the deep learning anomaly detection model to adaptively identify known and unknown malicious behaviors and directly intercept and determine them as abnormal requests. The malicious behaviors include malicious high-frequency number guessing, random forgery, and batch requests.

[0034] Specifically, the core function of step S400 in this invention is to intercept malicious forgery and serial number traversal, ensuring serial number security. This is achieved through a dual-layer protection system consisting of a static verification layer and an AI risk control layer. The static verification layer uses a combination of "merchant-specific key + CRC32 + modulo operation" for encryption, performing hash calculations on "merchant code + periodic node code + current period serial number," extracting two dynamic verification characters, and embedding them into the serial number structure. This verification character is irreversible, preventing the key from being deduced from the serial number, thus achieving basic anti-forgery measures. During verification, the target field in the serial number is extracted. The hash value is recalculated and compared with the embedded check bit. If they match, the data is deemed legitimate, eliminating the need to query the database and achieving millisecond-level offline verification. The AI ​​risk control layer can build a deep learning anomaly detection model that learns the generation patterns of normal serial numbers, merchant request frequency, IP behavior, time period distribution, and other characteristics. It can identify malicious behaviors such as high-frequency number guessing, random forgery, and batch requests in real time and directly intercept abnormal requests. By continuously learning new forgery behavior samples, the model can achieve adaptive identification of unknown malicious behaviors, continuously improve the accuracy of anti-forgery, and avoid problems such as data leakage and false reconciliation caused by forged serial numbers.

[0035] A specific example of step S400 of this invention can be as follows: Static encryption verification: The system extracts "merchant code + periodic node code + current serial number", introduces the merchant's exclusive asymmetric encryption key, uses the CRC32 algorithm and modulo operation to generate a 2-bit hash check character, and embeds it into a specific position of the serial number. For example, the generated serial number structure may be: [merchant code][period code][serial value][check code]. The verifier only needs to use the same algorithm to achieve millisecond-level offline verification without accessing the database; AI risk control: The system deploys a deep learning anomaly detection model to monitor request characteristics in real time. If it detects that an IP address attempts to traverse the serial number in a short period of time, or that the request pattern deviates from the merchant's historical characteristics (such as a large number of requests outside of business hours), the AI ​​model will determine that it is malicious forgery and immediately block the connection. By continuously learning new attack samples, the model can adaptively identify unknown malicious traversal methods.

[0036] In summary, the multi-merchant distributed serial number generation scheme proposed in steps S100-S400 of this invention combines multi-merchant isolation, configurable periodic reset, AI intelligent scheduling, and dual-layer anti-counterfeiting verification technology. First, it constructs a two-dimensional serial number isolation system of "merchant + periodic node," allocating an independent serial number pool to each merchant for each period. Second, it dynamically adjusts the number segment allocation through AI intelligent scheduling to adapt to merchant traffic fluctuations. Subsequently, it employs a dual-layer anti-counterfeiting mechanism of "static encryption verification + AI anomaly recognition" to intercept malicious counterfeiting behavior. Finally, through system training and optimization, it addresses core pain points such as multi-merchant isolation, order serial number periodic reset, anti-counterfeiting, AI intelligent scheduling, and efficient operation and maintenance. This achieves independent, readable, secure, and intelligent generation and management of serial numbers, improving system concurrency performance, security, and operational efficiency, and adapting to the differentiated business needs of multi-merchant platforms.

[0037] See Figure 2 In an optional embodiment of the first aspect of the present invention, the multi-merchant distributed serial number generation method further includes: S500 real-time monitoring includes core system indicators such as number segment consumption rate, clock offset, periodic reset status and anti-counterfeiting interception rate. S600 uses AI models to identify abnormal trends and provide early warnings; When a node failure or cache anomaly is detected, the S700 automatically triggers a degradation strategy to switch the system to database number segment mode, and automatically checks the continuity of serial numbers daily, intelligently repairing issues such as missing or skipped numbers.

[0038] Specifically, this invention further provides AI-powered operation and maintenance (O&M) functions. The core function of steps S500-S600 of the aforementioned AI O&M functions is to reduce manual O&M costs, improve system stability, and achieve automatic monitoring and backup for anomalies. This invention can monitor key system indicators in real time, including number segment consumption rate, clock offset, periodic reset status, and anti-counterfeiting interception rate. It can identify abnormal trends through AI models and provide early warnings of abnormal risks (such as number segments about to run out, node failures, and clock deviations). For issues such as node failures and cache anomalies, it can automatically trigger degradation strategies (such as switching to database number segment mode for cache anomalies) to ensure uninterrupted serial number generation. It can automatically check the continuity and reset status of all merchant serial numbers daily, intelligently repair broken or skipped numbers, generate O&M reports, and reduce manual intervention.

[0039] A specific example of the AI ​​operation and maintenance process of this invention can be as follows: The AI ​​operation and maintenance module monitors system operation indicators in real time: Anomaly Warning: When the consumption rate of a number segment increases abnormally (suspected of fraudulent transactions) or when excessive clock offset is detected, the system will automatically issue a warning.

[0040] Automatic degradation: If a cluster failure occurs in the distributed caching layer, the system will automatically switch to "database number segment mode" within 0.1 seconds as a fallback after detecting the anomaly. Although the concurrency performance will decrease, it can ensure that the sequence number generation service will never be interrupted.

[0041] Intelligent repair: Every day at midnight, the system will automatically compare the serial number allocation table of the previous period. If abnormal number skipping or disconnection is found due to network jitter, the system will record it in the operation and maintenance report and decide whether to perform logical repair according to business rules, which greatly reduces the pressure of manual operation and maintenance.

[0042] Furthermore, in order to better simulate the real operation scenario of a multi-merchant platform and verify the performance and effectiveness of the present invention, the present invention selected several multi-merchant SaaS companies of different sizes in the delivery chain (covering multiple cargo owners and multiple outlet scenarios), including tens of millions of historical business order data, 5 million malicious forged request samples, and 2 million cross-period request samples. At the same time, traffic fluctuation data at different time periods were added to simulate complex scenarios such as high concurrency and cross time zones, so as to improve the robustness of the system.

[0043] This invention achieves conflict-free serial numbers between merchants through a multi-merchant serial number isolation module, enabling stable periodic resets and effectively blocking malicious forgery. Simultaneously, relying on an AI intelligent scheduling module for accurate prediction of merchant traffic and dynamic allocation of serial number segments, it significantly improves the system's concurrent processing capabilities and resource utilization. This avoids the congestion or resource waste problems caused by the rigid allocation of serial number segments in traditional solutions, and effectively adapts to the core requirements of multiple merchants, periodic resets, readability, anti-counterfeiting, and high concurrency.

[0044] Experimental Results Comparison: Five core indicators were selected in the experiment to comprehensively compare the performance differences between this technology and existing technologies. The specific comparison results are shown in Table 1 below: Table 1. Comparison of test results between the present invention and existing technologies on various test indicators.

[0045] Experimental results show that compared with existing conventional distributed order number generation technologies, this invention significantly improves core performance indicators: it achieves 100% unique order numbers, solving the problem of duplicate order numbers across multiple merchants and nodes; the forged order identification rate is improved by 34.5 percentage points, effectively reducing business risks; order management and archiving efficiency are both improved by more than 65%, significantly reducing labor costs; and business continuity is improved by 4.2 percentage points, stably adapting to multi-point and weak network scenarios in the delivery chain. The experiments fully verify the effectiveness, superiority, and practicality of this technology, effectively addressing the core pain points of existing technologies and providing a more efficient, secure, and flexible order number generation solution for multi-merchant scenarios in the delivery chain SaaS industry.

[0046] In summary, the multi-merchant distributed serial number generation scheme of this invention mainly realizes five core functions: multi-merchant serial number isolation, configurable periodic reset, dual-layer anti-counterfeiting verification, AI intelligent scheduling, and AI intelligent operation and maintenance. These functions work together to form a complete serial number generation and management system. Among them, the multi-merchant serial number isolation module enables serial numbers to be independent between merchants, the configurable periodic reset module enables serial numbers to be cleared at a preset period, the dual-layer anti-counterfeiting verification module intercepts malicious behavior, the AI ​​intelligent scheduling module adapts to traffic fluctuations, and the AI ​​intelligent operation and maintenance module ensures system stability. AI technology plays a core driving role in each module, and is not an auxiliary optimization method, but a key technical support for realizing the core functions of this invention.

[0047] This invention presents a distributed serial number generation solution for multi-merchant scenarios, featuring periodic resetting, anti-counterfeiting, and AI-driven capabilities. It addresses key pain points such as multi-merchant isolation, periodic resetting, anti-counterfeiting, and high-concurrency adaptation. Combining AI intelligent scheduling and dual-layer anti-counterfeiting technology, it achieves independent, readable, secure, and intelligent generation and management of serial numbers. This solution can adapt to the differentiated needs of merchants of different sizes and industries in multi-merchant platform scenarios, effectively improving system concurrency performance, security, and operational efficiency. Future optimizations will be made for more complex scenarios (such as extremely high-concurrency scenarios and multi-timezone / cross-regional scenarios), supplementing data from more scenarios to further improve the accuracy of AI-driven predictions and risk control capabilities. Simultaneously, the system architecture will be optimized to reduce deployment costs, making the system more practical and adaptable to more merchant business scenarios.

[0048] See Figure 3The second aspect of the present invention provides a multi-merchant distributed serial number generation system, the multi-merchant distributed serial number generation system comprising: The multi-merchant serial number construction module 10 is used to construct a multi-merchant serial number isolation system. It uses the merchant's unique identifier and the periodic node code as a combination key, maintains an independent atomic counter for each combination key in the distributed cache, and generates an independent serial number pool for each merchant. The serial number period reset module 20 is used to configure and execute the serial number period reset, obtain the merchant's customized reset period, and reset the merchant's serial number from the starting value to zero at the end of the period through a scheduled task and threshold verification mechanism. AI intelligent scheduling module 30 is used for intelligent scheduling based on AI model. It uses AI time series prediction model to analyze the merchant's historical business data and time period traffic characteristics, predicts the real-time concurrency, and dynamically adjusts the prefetch length of single node number segment according to the real-time concurrency. The dual-layer anti-counterfeiting verification module 40 is used to perform dual-layer anti-counterfeiting verification. During the serial number generation and request stage, it generates and verifies the verification characters embedded in the serial number through a static encryption verification layer, and identifies and intercepts malicious forgery and abnormal request behavior in real time through an AI risk control model layer.

[0049] In an optional embodiment of the second aspect of the present invention, the multi-merchant serial number construction module includes: The composite key construction unit is used to combine the merchant code that corresponds one-to-one with the merchant ID and the period node code generated according to the merchant's custom reset period as a composite key; The distributed isolation unit is used to maintain an independent atomic counter for each of the composite keys in the distributed cache. Each atomic counter corresponds to a serial number pool for the current period of a merchant. Through the key-value isolation mechanism of the distributed cache, the serial number pools of different merchants do not interfere with each other, and independent access and updates are achieved.

[0050] In an optional embodiment of the second aspect of the present invention, the serial number period reset module includes: The critical locking unit is used to lock the merchant's independent sequence number pool through a distributed lock during the critical period of the cycle, so as to ensure that the reset operation is not performed after the sequence numbers not generated in the cycle are completed. The AI ​​fault-tolerant unit is used to introduce an AI fault-tolerant mechanism to automatically calibrate clock deviations for merchants in different time zones to adapt to the corresponding cycle end node, and to trigger an alarm and execute a fallback reset strategy when the reset fails.

[0051] In an optional embodiment of the second aspect of the present invention, the AI ​​intelligent scheduling module includes: Traffic prediction unit, used to predict merchant traffic using LSTM or Transformer time series models; The low-traffic processing unit is used to pre-fetch number segments with small steps when a low-traffic period is predicted. The high-traffic processing unit is used to automatically trigger the number segment expansion mechanism when a high-traffic period is predicted or a sudden traffic surge is detected. It adopts a large step size to pre-fetch number segments in order to adapt to traffic fluctuations and save system resources.

[0052] In an optional embodiment of the second aspect of the present invention, the dual-layer anti-counterfeiting verification module includes: The combined encryption unit is used to perform hash calculations on the merchant code, the periodic node code, and the current periodic sequence number using a combination encryption method that employs a merchant-specific key, CRC32, and modular arithmetic. The verification embedding unit is used to extract a fixed number of dynamic verification characters and embed them into the generated sequence number structure; The field verification unit is used to extract the target field, recalculate its hash value, and compare it with the embedded check bits during verification, thereby achieving offline verification.

[0053] In an optional embodiment of the second aspect of the present invention, the dual-layer anti-counterfeiting verification module further includes: The model building training unit is used to build a deep learning anomaly detection model and extract the normal sequence number generation pattern, merchant request frequency, IP behavior and time period distribution features for model training. The malicious behavior identification unit is used to input real-time requests into the deep learning anomaly detection model, adaptively identify known and unknown malicious behaviors, and directly intercept and determine them as abnormal requests. The malicious behaviors include malicious high-frequency number guessing, random forgery, and batch requests.

[0054] See Figure 3 In an optional embodiment of the second aspect of the present invention, the multi-merchant distributed serial number generation system further includes an AI intelligent operation and maintenance module 50, the AI ​​intelligent operation and maintenance module comprising: The core indicator monitoring unit is used to monitor the system's core indicators in real time, including number segment consumption rate, clock offset, periodic reset status, and anti-counterfeiting interception rate. The AI ​​anomaly identification and early warning unit is used to identify abnormal trends and issue early warnings through AI models. The system mode switching unit is used to automatically trigger a degradation strategy to switch the system to database number segment mode when a node failure or cache anomaly is detected, and automatically checks the continuity of serial numbers daily to intelligently repair broken or skipped numbers.

[0055] Figure 4This is a schematic diagram of the structure of a multi-merchant distributed serial number generation device provided in an embodiment of the present invention. This multi-merchant distributed serial number generation device can vary significantly due to differences in configuration or performance. It may include one or more processors 60 (central processing units, CPUs) (e.g., one or more processors) and memory 70, and one or more storage media 80 (e.g., one or more mass storage devices) for storing applications or data. The memory and storage media can be temporary or persistent storage. The program stored in the storage media may include one or more modules (not shown in the diagram), each module including a series of instruction operations on the multi-merchant distributed serial number generation device. Furthermore, the processor may be configured to communicate with the storage media and execute the series of instruction operations in the storage media on the multi-merchant distributed serial number generation device.

[0056] The multi-merchant distributed serial number generation device of the present invention may further include one or more power supplies 90, one or more wired or wireless network interfaces 100, one or more input / output interfaces 110, and / or one or more operating systems, such as Windows Server, Mac OS X, Unix, Linux, FreeBSD, etc. Those skilled in the art will understand that... Figure 4 The structure of the multi-merchant distributed serial number generation device shown does not constitute a limitation on the multi-merchant distributed serial number generation device. It may include more or fewer components than shown, or combine certain components, or have different component arrangements.

[0057] The present invention also provides a computer-readable storage medium, which can be a non-volatile computer-readable storage medium or a volatile computer-readable storage medium, wherein the computer-readable storage medium stores instructions that, when the instructions are executed on a computer, cause the computer to perform the steps of the multi-merchant distributed serial number generation method.

[0058] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working process of the system or system / unit described above can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.

[0059] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0060] The above-described embodiments are only used to illustrate the technical solutions of the present invention, and are not intended to limit it. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A method for generating distributed serial numbers for multiple merchants, characterized in that, include: A multi-merchant serial number isolation system is constructed, using the merchant's unique identifier and periodic node code as a composite key. An independent atomic counter is maintained for each composite key in the distributed cache to generate an independent serial number pool for each merchant. Configure and execute the serial number periodic reset, obtain the merchant's customized reset period, and reset the merchant's serial number from the starting value to zero at the end of the period through a scheduled task and threshold verification mechanism. Intelligent scheduling is based on AI models. The AI ​​time series prediction model is used to analyze the merchant's historical business data and time period traffic characteristics to predict the real-time concurrency. The pre-fetch length of a single node number segment is dynamically adjusted according to the real-time concurrency. A two-layer anti-counterfeiting verification is implemented. During the serial number generation and request phase, a static encryption verification layer is used to generate and verify the verification characters embedded in the serial number, and an AI risk control model layer is used to identify and intercept malicious forgery and abnormal request behaviors in real time.

2. The multi-merchant distributed serial number generation method according to claim 1, characterized in that, The process of using a merchant's unique identifier and a periodic node code as a composite key, and maintaining an independent atomic counter for each composite key in the distributed cache to generate an independent sequence number pool for each merchant includes: The merchant code that corresponds one-to-one with the merchant ID and the cycle node code generated according to the merchant's custom reset cycle are combined as a composite key; In the distributed cache, an independent atomic counter is maintained for each of the composite keys. Each atomic counter corresponds to a serial number pool for the current period of a merchant. Through the key-value isolation mechanism of the distributed cache, the serial number pools of different merchants do not interfere with each other, and independent access and updates are achieved.

3. The multi-merchant distributed serial number generation method according to claim 1, characterized in that, The mechanism for resetting the serial number periodically includes: During the critical period of the cycle, the merchant's independent sequence number pool is locked by a distributed lock to ensure that the reset operation is not performed until the sequence numbers not generated in the cycle are completed. An AI fault-tolerance mechanism is introduced to automatically calibrate clock deviations for merchants in different time zones to adapt to the corresponding cycle end nodes, and to trigger alarms and execute fallback reset strategies when reset fails.

4. The multi-merchant distributed serial number generation method according to claim 1, characterized in that, The step of using an AI time-series prediction model to analyze merchants' historical business data and time-period traffic characteristics, predicting real-time concurrency, and dynamically adjusting the prefetch length of a single node number segment based on the real-time concurrency includes: Predict merchant traffic using LSTM or Transformer time series models; When a low-traffic period is predicted, a small step size is used to pre-select number segments; When a high-traffic period is predicted or a sudden surge in traffic is detected, the number segment expansion mechanism is automatically triggered, using a large step size to pre-fetch number segments in order to adapt to traffic fluctuations and save system resources.

5. The multi-merchant distributed serial number generation method according to claim 1, characterized in that, The verification characters embedded in the serial number generated and verified through the static encryption verification layer include: A combination of merchant-specific keys, CRC32, and modular arithmetic encryption is used to perform hash calculations on the merchant code, periodic node code, and current period sequence number; A fixed number of dynamic verification characters are extracted and embedded into the generated serial number structure; During verification, the target field is extracted, the hash value is recalculated, and compared with the embedded check bits to achieve offline verification.

6. The multi-merchant distributed serial number generation method according to claim 1, characterized in that, The aforementioned real-time identification and interception of malicious forgery and abnormal request behaviors through the AI ​​risk control model layer includes: A deep learning anomaly detection model was constructed, and the normal serial number generation pattern, merchant request frequency, IP behavior and time period distribution features were extracted for model training. The real-time request is input into the deep learning anomaly detection model, which adaptively identifies known and unknown malicious behaviors and directly intercepts and determines them as abnormal requests. The malicious behaviors include malicious high-frequency number guessing, random forgery, and batch requests.

7. The multi-merchant distributed serial number generation method according to claim 1, characterized in that, Also includes: Real-time monitoring includes core system metrics such as number segment consumption rate, clock offset, periodic reset status, and anti-counterfeiting interception rate. Identify abnormal trends and issue early warnings using AI models; When a node failure or cache anomaly is detected, a degradation strategy is automatically triggered to switch the system to database number segment mode, and the continuity of serial numbers is automatically checked daily to intelligently repair issues such as missing or skipped numbers.

8. A multi-merchant distributed serial number generation system, characterized in that, The multi-merchant distributed serial number generation system includes: The multi-merchant serial number construction module is used to build a multi-merchant serial number isolation system. It uses the merchant's unique identifier and the periodic node code as a composite key. In the distributed cache, it maintains an independent atomic counter for each composite key and generates an independent serial number pool for each merchant. The serial number period reset module is used to configure and execute serial number period reset, obtain the merchant's customized reset period, and reset the merchant's serial number from the starting value to zero at the end of the period through scheduled tasks and threshold verification mechanism. The AI ​​intelligent scheduling module is used for intelligent scheduling based on AI models. It uses AI time series prediction models to analyze merchants' historical business data and time period traffic characteristics, predicts real-time concurrency, and dynamically adjusts the prefetch length of single node number segments according to the real-time concurrency. The dual-layer anti-counterfeiting verification module is used to perform dual-layer anti-counterfeiting verification. During the serial number generation and request phase, it generates and verifies the verification characters embedded in the serial number through a static encryption verification layer, and identifies and intercepts malicious forgery and abnormal request behavior in real time through an AI risk control model layer.

9. A multi-merchant distributed serial number generation device, characterized in that, The multi-merchant distributed serial number generation device includes: a memory and at least one processor, wherein the memory stores instructions, and the memory and the at least one processor are interconnected via a line; The at least one processor invokes the instructions in the memory to cause the multi-merchant distributed serial number generation device to perform the multi-merchant distributed serial number generation method as described in any one of claims 1-7.

10. A computer-readable storage medium storing a computer program thereon, characterized in that, When the computer program is executed by the processor, it implements the multi-merchant distributed serial number generation method as described in any one of claims 1-7.