Intelligent routing of service requests and gray data processing in a unitized system

By employing a classification-based intelligent routing method for business requests and a grayscale data processing method in a unitized system, and utilizing distributed caching and thread-local variable passing tools, the problems of business request routing and grayscale data passing in existing technologies are solved. This achieves efficient business feature matching and non-intrusive grayscale control, improving the system's partitioning efficiency and code stability.

CN122286241APending Publication Date: 2026-06-26PICC INFORMATION TECH CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610178918.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-02-06
Publication Date
2026-06-26

AI Technical Summary

Technical Problem

In the existing unitized architecture, the business request routing method does not take into account business characteristics, resulting in a disconnect between traffic allocation and business logic. Furthermore, the transmission of canary data affects interface stability and increases maintenance costs.

Method used

Business requests are classified based on a pre-defined classification model. Distributed cache is used to store grayscale judgment data. Grayscale switching is performed in an asynchronous processing thread using a thread-local variable passing tool, achieving non-intrusive grayscale data transmission.

Benefits of technology

It implements intelligent routing based on business characteristics, improves the partitioning efficiency of the unitized architecture, maintains code stability, and reduces maintenance costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122286241A_ABST
    Figure CN122286241A_ABST
Patent Text Reader

Abstract

This invention proposes a method for intelligent routing of business requests and grayscale data processing in a unitized system. The invention includes: receiving a business request; classifying the business request based on a preset classification model; and routing the business request to the corresponding partition unit according to the classification result; extracting grayscale judgment data from the business request and storing the grayscale judgment data in a distributed cache; when the partition unit processes the business request, retrieving the corresponding grayscale judgment data from the distributed cache and passing the grayscale judgment data to an asynchronous processing thread using a thread-local variable passing tool; and in the asynchronous processing thread, performing grayscale on / off judgment based on the passed grayscale judgment data. This invention enables intelligent routing based on business characteristics, fully leveraging the advantages of a unitized architecture; simultaneously, by passing grayscale data in a non-intrusive manner, it avoids modification of business code, improving system maintainability and stability.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the fields of artificial intelligence, modular architecture, and system update technology, and in particular to a method for intelligent routing of business requests and grayscale data processing in a modular system. Background Technology

[0002] As a crucial support for the business operations of insurance companies, the core insurance system's contract system is responsible for handling key processes such as insurance application and underwriting, and is widely used in the daily operations of large insurance companies. With the expansion of business scale and the increase in system complexity, unitized architecture has become the mainstream deployment solution for achieving high availability and elastic scaling. Among related technologies, a technical system for handling insurance application requests has been constructed through the collaborative operation of gateways, partition units, and a microservice architecture based on the CQRS pattern. Specifically, this system covers the entire process from traffic access to business processing. The gateway routes and distributes traffic based on the hash value of the insurance application number, while the microservices within each partition unit pass on / off data for controlling method-level canary releases in a thread pool environment through interface parameters and method parameters.

[0003] However, existing routing methods directly employ hash partitioning rules based on insurance policy numbers without considering business characteristics (such as product type and sales channels). This leads to a disconnect between traffic allocation and actual business logic, failing to achieve the design intent of a unitized architecture that partitions data by business to optimize data locality and processing efficiency. Furthermore, in terms of canary data delivery, current technologies typically transmit temporary canary switch data by modifying business interfaces and method signatures. This results in non-business-related data being mixed with core business logic, compromising interface stability and code integrity. Moreover, frequent modifications and testing of business code are required when canary features are launched or delaunched, significantly increasing system maintenance costs and iteration risks. Summary of the Invention

[0004] The present invention aims to at least partially solve one of the technical problems in the related art.

[0005] Therefore, the first objective of this invention is to propose a method for intelligent routing of service requests and grayscale data processing in a unitized system.

[0006] Another objective of this invention is to provide a device for intelligent routing of service requests and grayscale data processing in a unitized system.

[0007] The third objective of this invention is to provide a computer device.

[0008] A fourth objective of this invention is to provide a non-transitory computer-readable storage medium.

[0009] To achieve the above objectives, a first aspect of the present invention proposes a method for intelligent routing of service requests and grayscale data processing in a unitized system, comprising:

[0010] S1, Receive a service request, classify the service request based on a preset classification model, and route the service request to the corresponding partition unit according to the classification result; S2, extract the grayscale judgment data from the business request, and store the grayscale judgment data in a distributed cache; S3, when the partition unit processes a business request, it obtains the corresponding grayscale judgment data from the distributed cache and uses the thread-local variable passing tool to pass the grayscale judgment data to the asynchronous processing thread; S4, in the asynchronous processing thread, grayscale switching is determined based on the transmitted grayscale judgment data.

[0011] In one embodiment of the present invention, training the classification model to classify the business request includes: Collect historical business data and perform anonymization preprocessing to obtain preprocessed historical business data; Preset business features are extracted from the preprocessed historical business data, and the historical business data is classified and labeled according to the business features to obtain labeled historical business data. A classification algorithm is used to train a model on the labeled historical business data to generate the preset classification model.

[0012] In one embodiment of the present invention, the step of extracting grayscale judgment data from the business request and storing the grayscale judgment data in a distributed cache includes: At the requesting access node, extract the target data for grayscale switch determination from the message of the service request; The target data is stored in a distributed cache using the unique identifier of the business request as the index key.

[0013] In one embodiment of the present invention, when the partitioning unit processes the business request, it obtains the corresponding grayscale judgment data from the distributed cache and uses a thread-local variable passing tool to pass the grayscale judgment data to the asynchronous processing thread, including: The business request is captured by the interception mechanism at the interface layer of the partition unit. The corresponding target data is obtained from the distributed cache according to the unique identifier of the business request, and the target data is written into the thread-local variable of the current interface thread. When the business request is submitted to the thread pool via the system bus, the target data in the thread local variable of the interface thread is synchronized to the thread local variable of the asynchronous processing thread in the thread pool through the thread local variable passing tool.

[0014] In one embodiment of the present invention, when the partitioning unit processes the business request, it obtains the corresponding grayscale judgment data from the distributed cache and uses a thread-local variable passing tool to pass the grayscale judgment data to the asynchronous processing thread, including: The business request is captured by the interception mechanism at the interface layer of the partition unit. The corresponding target data is obtained from the distributed cache according to the unique identifier of the business request, and the target data is written into the thread-local variable of the current interface thread. When the business request is submitted to the thread pool via the system bus, the target data in the thread local variable of the interface thread is synchronized to the thread local variable of the asynchronous processing thread in the thread pool through the thread local variable passing tool.

[0015] In one embodiment of the present invention, the step of performing grayscale on / off judgment based on the transmitted grayscale judgment data in the asynchronous processing thread includes: Load a preset grayscale judgment rule set, which includes logical matching conditions based on business attributes; The transmitted grayscale judgment data is matched with the grayscale judgment rule set, and the activation status of the grayscale switch is determined based on the matching result.

[0016] To achieve the above objectives, a second aspect of the present invention provides a device for intelligent routing of service requests and grayscale data processing in a unitized system, comprising: The request receiving and routing module is used to receive business requests, classify the business requests based on a preset classification model, and route the business requests to the corresponding partition units according to the classification results. The grayscale data extraction and caching module is used to extract grayscale judgment data from the business request and store the grayscale judgment data in a distributed cache. The grayscale data acquisition and transmission module is used to acquire the corresponding grayscale judgment data from the distributed cache when the partition unit processes the business request, and to transmit the grayscale judgment data to the asynchronous processing thread using a thread-local variable transmission tool. The grayscale switch determination module is used to determine the grayscale switch based on the transmitted grayscale determination data in the asynchronous processing thread.

[0017] This invention discloses a method and apparatus for intelligent routing of business requests and grayscale data processing in a unitized system. It realizes intelligent routing based on business characteristics, improves the partitioning efficiency of the unitized architecture, and maintains code stability and reduces maintenance costs through non-intrusive grayscale data transmission.

[0018] To achieve the above objectives, a third aspect of this application provides a computer device, including a processor and a memory; wherein the processor reads executable program code stored in the memory to run a program corresponding to the executable program code, for implementing a method for intelligent routing of service requests and grayscale data processing in a unitized system as described in the first aspect embodiment.

[0019] To achieve the above objectives, a fourth aspect of this application provides a non-transitory computer-readable storage medium storing a computer program that, when executed by a processor, implements a method for intelligent routing of service requests and grayscale data processing in a unitized system as described in the first aspect embodiment.

[0020] Additional aspects and advantages of the invention will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention. Attached Figure Description

[0021] Figure 1 This is a flowchart of a method for intelligent routing of service requests and grayscale data processing in a unitized system according to an embodiment of the present invention; Figure 2 This is an overall architecture diagram according to an embodiment of the present invention; Figure 3 This is a structural diagram of a service request intelligent routing and grayscale data processing device in a unitized system according to an embodiment of the present invention; Figure 4 It is a computer device according to an embodiment of the present invention. Detailed Implementation

[0022] It should be noted that, unless otherwise specified, the embodiments and features described in the present invention can be combined with each other. The present invention will now be described in detail with reference to the accompanying drawings and embodiments.

[0023] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.

[0024] The following description, with reference to the accompanying drawings, describes a method and apparatus for intelligent routing of service requests and grayscale data processing in a unitized system according to an embodiment of the present invention.

[0025] Figure 1 This is a flowchart of a method for intelligent routing of service requests and grayscale data processing in a unitized system according to an embodiment of the present invention, as shown below. Figure 1 and Figure 2 As shown, it includes: S1, receive a service request, classify the service request based on a preset classification model, and route the service request to the corresponding partition unit according to the classification result.

[0026] Specifically, the gateway extracts the data from the insurance application message data and stores the data used for grayscale switching in Redis. The classification model is pre-trained using machine learning. The training data comes from historical insurance application messages in the production environment, which have been anonymized and labeled. For example, the feature vector {number of insured persons} ,gender Female, policyholder's address Sichuan Province, insured institution Sichuan Province, Age ,channel Ant Insurance, Product Number ,Profession Programmers, health The data will be labeled as "Individual Short-Term Insurance, Health Insurance New Contract Category". The model can use algorithms such as Random Forest and Logistic Regression, and its output is a specific business category label, such as "Individual Long-Term Insurance, Accident Insurance New Contract" or "Group Short-Term Insurance, Medical Insurance Renewal". The gateway internally maintains a "Business Category - Partition Unit" mapping table (such as in the configuration center or local cache), which defines the identifier or address of the backend physical or logical partition unit to which each business category should be routed.

[0027] Furthermore, this step is directly applied to the insurance application request entry point of the insurance company's core contract system. When a new application request arrives, the system no longer cares about its application number hash value, but instead deeply analyzes its business implications. For example, a personal health insurance application request from an online channel will be classified by the model and routed to a dedicated partition unit cluster that handles "individual short-term health insurance" business, thereby achieving a specialized match between business traffic and processing units.

[0028] Furthermore, this step transforms the routing strategy from "data-independent" hash allocation to "business-driven" intelligent distribution, truly aligning with the design philosophy of modular architecture that divides deployment units according to business dimensions. This facilitates data locality, improves cache hit rate, and enhances business processing efficiency. Secondly, through model-based classification, routing rules possess learnable and iterative characteristics, enabling flexible adjustments to routing strategies by updating the model as business evolves (e.g., new product launches, channel expansion), avoiding the maintenance complexity and lag associated with hard-coded routing rules. Ultimately, this intelligent routing mechanism lays a crucial technological foundation for building a highly scalable and easily maintainable modern insurance core system.

[0029] S2, extract the grayscale judgment data from the business request, and store the grayscale judgment data in a distributed cache.

[0030] Specifically, when the partition unit interface receives an insurance application request, the aspect function retrieves grayscale data from Redis and writes the grayscale data into the current thread variable Threadlocal.

[0031] Further, this step is executed at the system gateway. When the gateway receives an insurance application request from a client, it first parses the request message. The extraction operation, based on predefined grayscale judgment rules, locates and extracts specific field combinations from the parsed structured data. These fields are the "grayscale judgment data," and their composition depends on the specific grayscale strategy. For example, in some implementations, they may include key business attributes such as product numbers to identify grayscale versions, issuance channel codes, or insurance affiliation institutions. The extraction process is implemented programmatically, for example, using Java's JSONPath or XPath tools for precise location. Subsequently, the gateway encapsulates the extracted data set into an independent data object (such as a Map or DTO) and calls a distributed caching client to serialize (e.g., convert to a JSON string) the object before storing it. Redis is used as the distributed caching middleware; therefore, the storage operation specifically involves executing the Redis `SET` command to write the serialized grayscale judgment data into the Redis database.

[0032] Furthermore, this step involves several specific technical parameters and configurations. First, the field mapping rules for data extraction need to be explicitly configured, such as defining the paths of fields like `productCode` and `channelId` in the request message. Second, a reasonable time-to-live (TTL) expiration time must be set for cached data; this is a critical parameter to prevent cached data from accumulating indefinitely and occupying space. Based on the typical duration of a gray-scale verification session, this TTL can be set to 300 seconds (5 minutes) to 600 seconds (10 minutes), ensuring that the data is available in subsequent processing flows while being automatically cleaned up after the timeout. In addition, the serialization protocol (such as JSON), the maximum number of connections in the Redis connection pool, and the timeout period are also important parameters for ensuring the stable and efficient operation of this step.

[0033] Furthermore, this step is directly applied to canary releases or A / B testing scenarios in insurance company contract systems. Specifically, when the system needs to enable a new service method in the canary testing phase for a specific type of business, the gateway executes this step before routing. In actual operating environments, gateways are typically deployed in a cluster, and Redis is configured as a highly available cluster or sentinel mode to ensure high performance and fault tolerance of the caching service. The gateway must guarantee extremely low latency when retrieving and storing data to avoid significantly impacting the overall request response time.

[0034] Furthermore, this step decouples the grayscale judgment data from the core business logic and provides temporary externalized storage, resulting in significant technical benefits and value. First, it avoids passing grayscale parameters as formal input parameters to the business interface, thus maintaining the purity and stability of the business interface and adhering to the "non-intrusive" design principle. After grayscale verification, there is no need to modify or clean up the interface definition, reducing code maintenance costs. Second, storing data in a high-performance distributed cache like Redis provides a high-speed, shared data access point for subsequent processing units, ensuring that different service instances (such as gateways and business processing services) can reliably access the same grayscale context data in a distributed microservice architecture. Finally, by setting TTL, automatic data lifecycle management is achieved, preventing invalid data from occupying memory resources for extended periods and improving the overall robustness of the system. This lays a solid data foundation for subsequently dynamically acquiring data through AOP and using TTL (Transmittable-Thread-Local) for inter-thread transmission, ultimately achieving method-level grayscale on / off judgment.

[0035] S3, when the partition unit processes a business request, it obtains the corresponding grayscale judgment data from the distributed cache and uses the thread-local variable passing tool to pass the grayscale judgment data to the asynchronous processing thread.

[0036] Specifically, when the interface sends a request to the thread pool via the system bus, it uses the TTL tool to copy the grayscale data in the interface thread variable to the thread variable in the thread pool that processes the request.

[0037] Specifically, this step in the technical solution serves the function of non-intrusively transmitting grayscale judgment data to the asynchronous processing environment. Its technical implementation mainly relies on the collaborative work of distributed caching (taking Redis as an example) and thread-local variable passing tools (taking TTL as an example) to ensure that, under a unitized architecture, when business requests switch across threads in the processing chain, critical grayscale control information can be accurately and efficiently carried without modifying the business interface or method signature.

[0038] Further, this step begins with the application service interface of the partition unit receiving a business request (such as an insurance application). To achieve non-intrusiveness, Aspect-Oriented Programming (AOP) is typically used to intercept the request before the interface method is executed. The aspect logic extracts a pre-agreed business identifier, such as the insurance application number, from the context of the current request (e.g., from the HTTP request header or message body). Then, using this identifier as the core, a cache key is constructed in Redis to store the corresponding grayscale data for this request, according to predefined rules (e.g., concatenating fixed prefixes or suffixes). The system executes a GET command through a Redis client to retrieve the corresponding grayscale assessment data using this key. This data is usually stored in a simple data structure (such as String or Hash), and its content may include whether grayscale is enabled, the grayscale version number, a specific experimental strategy ID, etc. After retrieving the data, it is immediately stored in the thread-local variable (ThreadLocal) of the current service interface thread. Next, when the business logic asynchronously submits commands or queries to the thread pool for execution via the system bus (e.g., following the CQRS pattern), the key operation is to wrap the thread pool using TTL tools.

[0039] Furthermore, this step involves several configurable technical parameters. First, the rules for constructing cache keys must ensure their global uniqueness and readability. Second, the Time-to-Live (TTL) of Redis data needs to be set reasonably based on the business scenario (e.g., 30 seconds to 5 minutes) to prevent the cache from growing indefinitely and to ensure data timeliness. Third, the naming of thread-local variables must be clearly defined to avoid conflicts. In addition, the timing of TTL wrapping the thread pool is also a critical configuration point; wrapping must be completed before the business code submits asynchronous tasks, and it is generally recommended to initialize it during application startup or the dependency injection phase.

[0040] Furthermore, this step is specifically applied to the business processing flow within the unitized architecture of an insurance company's contract system. This process is triggered when the application service interface of a specific partition unit processes an insurance application request. In Java-based microservices, aspect components intercept interface methods annotated with `@PostMapping(" / policy / issue")`. On the asynchronous processing side, before executing specific underwriting, billing, and other business logic, the business processor (CommandHandler or QueryHandler) can directly read grayscale data from its thread's ThreadLocal and determine whether to enable a new algorithm, call a new service endpoint, or adopt different business rules, thereby achieving fine-grained grayscale control at the method level.

[0041] Furthermore, this step, by combining distributed caching and thread-local variable passing mechanisms, achieves significant technical effects and value. First, it achieves complete non-intrusiveness; the acquisition and transmission of grayscale data are entirely independent of the parameter list and business logic code of the business interface. After grayscale verification, there is no need for cumbersome code rollback, maintaining the cleanliness and stability of the system architecture. Second, it ensures the reliability and context consistency of data transmission. Utilizing TTL, it solves the classic problem of ThreadLocal data loss in traditional thread pool scenarios, guaranteeing that asynchronous processing threads can access the grayscale context strictly corresponding to the original request. Finally, it improves the maintainability and scalability of the system. The logic for grayscale switching is centrally managed at the aspect and basic tool layers. Adding new grayscale rules or data items does not require affecting a large amount of business code, significantly reducing development and maintenance costs.

[0042] S4, in the asynchronous processing thread, grayscale switching is determined based on the transmitted grayscale judgment data.

[0043] Specifically, the grayscale switch in the processor of the thread pool reads the grayscale data in the thread variable and performs grayscale judgment.

[0044] Specifically, this step is the core execution stage of the grayscale switching process, where the grayscale status determination for a specific business request is completed in an asynchronous processing thread. Technically, after an insurance application request is distributed to an asynchronous processing thread in the thread pool via the system bus, the handler executing the business logic within that thread first reads the grayscale judgment data previously passed via TTL from the thread's ThreadLocal variable. This data is typically stored in key-value pairs, and may contain key business characteristics such as `policyNo` (insurance policy number), `productId` (product number), `channel` (issuance channel code), and `region` (insurance location). The handler integrates or calls a lightweight rule engine, which loads a predefined grayscale rule set. These rules typically exist in a configurable form, such as stored in a configuration center (e.g., Apollo, Nacos) or a database. Their logical expression might be: "If `productId` is in the list `[888,999]` and `channel` equals `'ANT_INSURANCE'`, then enable the new grayscale logic." The processor takes the read grayscale judgment data as input and feeds it into the rule engine for line-by-line matching and calculation. The matching process may involve exact string matching, numerical range matching (e.g., age between 18-30 years old), list inclusion checks, and logical AND and OR combinations of multiple conditions. Once an enabled rule is matched, the request is determined to be grayscale traffic, and the corresponding grayscale identifier (e.g., `isGray=true` and grayscale version number `grayVersion='V2.0'`) is returned; if no rule is matched, it is determined to be official traffic (`isGray=false`).

[0045] Furthermore, this step is triggered before each specific insurance application processing method is called in the actual system. For example, in the "premium calculation" or "underwriting rule verification" methods of the contract system, the processor will call the gray-scale judgment logic of this step before executing the core algorithm. Specific application scenarios include: Gray-scale release of new features: When a new premium calculation model is launched, only requests matching gray-scale rules (such as customers purchasing specific pilot products) are calculated using the new model; other requests still use the old model. Differentiated services: Applying different business logic or rate strategies to requests from different channels (such as online direct sales vs. agent channels). Fault isolation and rollback: If a problem occurs with the new logic, a rollback can be achieved in seconds by dynamically updating the rule configuration (such as setting the rule status to `enable:false`), switching all traffic back to the old logic and achieving rapid fault isolation.

[0046] Furthermore, this step achieves: Fine-grained method-level canary release control: refining the granularity of canary release switching from the interface level to the specific business method, enabling more precise and risk-controllable release capabilities. Decoupling of business logic and canary release control logic: by reading data from ThreadLocal and combining it with externalized rule configuration, the business code does not need to hard-code canary release judgment logic, achieving "non-intrusive" canary release capability embedding, maintaining the purity and stability of the business interface, and significantly reducing code maintenance costs. Reliable transmission of asynchronous context data: relying on TTL tools, ensuring that canary release judgment data can be transmitted losslessly from the gateway layer to the final business processing unit in complex asynchronous thread pool scheduling scenarios, solving the key technical problem of ThreadLocal data loss in the traditional thread pool model. Dynamic real-time effect: relying on the externalized storage of rule configuration, changes to the canary release strategy do not require restarting the application service, achieving dynamic real-time effect, greatly improving operational flexibility and system availability.

[0047] In one embodiment of the present invention, the classification model training includes: collecting insurance application messages from the production environment and performing preprocessing such as anonymization; processing the insurance application messages and extracting preset features, such as policyholder information, policy issuance channel, product information, occupation, health data, and special agreements; then classifying and labeling the insurance application messages according to the features, with classification categories divided according to function, such as individual long-term insurance accident insurance new contract category, individual short-term insurance health insurance new contract category, group long-term insurance critical illness insurance renewal category, etc.; and selecting a suitable classification algorithm (random forest) to model the labeled data and produce a classification model. For example, when {number of insured persons = 1, gender = female, policyholder address = Sichuan Province, insurance agency = Sichuan Province, age = 28, channel = Ant Insurance, product number = 888, occupation = programmer, health = standard}, the classification result is individual short-term insurance health insurance new contract category.

[0048] This invention also offers the following technical advantages: a combination of artificial intelligence, TTL, Redis, and non-intrusive design. Artificial intelligence replaces existing insurance policy hashing rules, generating business classifications for partitioning, fully leveraging the advantages of a unitized architecture. Based on TTL, thread-local variable values ​​are passed, avoiding data loss during thread switching. Based on Redis, Redis is used as a middleware for caching data, facilitating data exchange between microservices. Based on non-intrusive design, excellent code design improves maintainability, scalability, and reusability, reduces coupling between code segments, and lowers development and maintenance costs.

[0049] To achieve the above embodiments, such as Figure 3 As shown, this embodiment also provides a service request intelligent routing and grayscale data processing device 10 in a unitized system, including: The request receiving and routing module 100 is used to receive service requests, classify the service requests based on a preset classification model, and route the service requests to the corresponding partition units according to the classification results. The grayscale data extraction and caching module 200 is used to extract grayscale judgment data from the business request and store the grayscale judgment data in a distributed cache. The grayscale data acquisition and transmission module 300 is used to acquire corresponding grayscale judgment data from the distributed cache when the partition unit processes the business request, and to transmit the grayscale judgment data to the asynchronous processing thread using a thread-local variable transmission tool. The grayscale switch judgment module 400 is used to perform grayscale switch judgment based on the transmitted grayscale judgment data in the asynchronous processing thread.

[0050] Furthermore, the request receiving and routing module 100 is also used for: Collect historical business data and perform anonymization preprocessing to obtain preprocessed historical business data; Preset business features are extracted from the preprocessed historical business data, and the historical business data is classified and labeled according to the business features to obtain labeled historical business data. A classification algorithm is used to train a model on the labeled historical business data to generate the preset classification model.

[0051] Furthermore, the grayscale data extraction and caching module 200 is also used for: At the requesting access node, extract the target data for grayscale switch determination from the message of the service request; The target data is stored in a distributed cache using the unique identifier of the business request as the index key.

[0052] This invention discloses a business request intelligent routing and grayscale data processing device in a unitized system. The device realizes intelligent routing based on business characteristics, improves the partitioning efficiency of the unitized architecture, and maintains code stability and reduces maintenance costs through non-intrusive grayscale data transmission.

[0053] To implement the methods of the above embodiments, the present invention also provides a computer device, such as... Figure 4 As shown, the computer device 600 includes a memory 601 and a processor 602; wherein, the processor 602 reads the executable program code stored in the memory 601 to run a program corresponding to the executable program code, so as to implement the various steps of the intelligent routing of business requests and grayscale data processing method in a unitized system described above.

[0054] To implement the above embodiments, this application also proposes a non-transitory computer-readable storage medium storing a computer program thereon. When the program is executed by a processor, it implements a method for intelligent routing of service requests and grayscale data processing in a unitized system as described in the foregoing embodiments.

[0055] In the description of this specification, the references to terms such as "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., indicate that a specific feature, structure, material, or characteristic described in connection with that embodiment or example is included in at least one embodiment or example of the present invention. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples. Moreover, without contradiction, those skilled in the art can combine and integrate the different embodiments or examples described in this specification, as well as the features of different embodiments or examples.

[0056] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one of that feature. In the description of this invention, "a plurality of" means at least two, such as two, three, etc., unless otherwise explicitly specified.

Claims

1. A method for intelligent routing of business requests and grayscale data processing in a unitized system, characterized in that, include: S1, Receive a service request, classify the service request based on a preset classification model, and route the service request to the corresponding partition unit according to the classification result; S2, extract the grayscale judgment data from the business request, and store the grayscale judgment data in a distributed cache; S3, when the partition unit processes a business request, it obtains the corresponding grayscale judgment data from the distributed cache and uses the thread-local variable passing tool to pass the grayscale judgment data to the asynchronous processing thread; S4, in the asynchronous processing thread, grayscale switching is determined based on the transmitted grayscale judgment data.

2. The method according to claim 1, characterized in that, Training the classification model to perform business classification on the business requests includes: Collect historical business data and perform anonymization preprocessing to obtain preprocessed historical business data; Preset business features are extracted from the preprocessed historical business data, and the historical business data is classified and labeled according to the business features to obtain labeled historical business data. A classification algorithm is used to train a model on the labeled historical business data to generate the preset classification model.

3. The method according to claim 1, characterized in that, The step of extracting grayscale judgment data from the business request and storing the grayscale judgment data in a distributed cache includes: At the requesting access node, extract the target data for grayscale switch determination from the message of the service request; The target data is stored in a distributed cache using the unique identifier of the business request as the index key.

4. The method according to claim 1, characterized in that, When the partitioning unit processes the business request, it retrieves the corresponding grayscale judgment data from the distributed cache and uses a thread-local variable passing tool to pass the grayscale judgment data to the asynchronous processing thread, including: The business request is captured by the interception mechanism at the interface layer of the partition unit. The corresponding target data is obtained from the distributed cache according to the unique identifier of the business request, and the target data is written into the thread-local variable of the current interface thread. When the business request is submitted to the thread pool via the system bus, the target data in the thread local variable of the interface thread is synchronized to the thread local variable of the asynchronous processing thread in the thread pool through the thread local variable passing tool.

5. The method according to claim 1, characterized in that, The grayscale on / off judgment based on the transmitted grayscale judgment data in the asynchronous processing thread includes: Load a preset grayscale judgment rule set, which includes logical matching conditions based on business attributes; The transmitted grayscale judgment data is matched with the grayscale judgment rule set, and the activation status of the grayscale switch is determined based on the matching result.

6. A device for intelligent routing of service requests and grayscale data processing in a unitized system, characterized in that, include: The request receiving and routing module is used to receive business requests, classify the business requests based on a preset classification model, and route the business requests to the corresponding partition units according to the classification results. The grayscale data extraction and caching module is used to extract grayscale judgment data from the business request and store the grayscale judgment data in a distributed cache. The grayscale data acquisition and transmission module is used to acquire the corresponding grayscale judgment data from the distributed cache when the partition unit processes the business request, and to transmit the grayscale judgment data to the asynchronous processing thread using a thread-local variable transmission tool. The grayscale switch determination module is used to determine the grayscale switch based on the transmitted grayscale determination data in the asynchronous processing thread.

7. The apparatus according to claim 6, characterized in that, The request receiving and routing module is also used for: Collect historical business data and perform anonymization preprocessing to obtain preprocessed historical business data; Preset business features are extracted from the preprocessed historical business data, and the historical business data is classified and labeled according to the business features to obtain labeled historical business data. A classification algorithm is used to train a model on the labeled historical business data to generate the preset classification model.

8. The apparatus according to claim 6, characterized in that, The grayscale data extraction and caching module is also used for: At the requesting access node, extract the target data for grayscale switch determination from the message of the service request; The target data is stored in a distributed cache using the unique identifier of the business request as the index key.

9. A computer device, characterized in that, Including processor and memory; The processor reads executable program code stored in the memory to run a program corresponding to the executable program code, so as to implement the intelligent routing of service requests and grayscale data processing method in a unitized system as described in any one of claims 1-5.

10. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that, When executed by the processor, the program implements a method for intelligent routing of business requests and grayscale data processing in a unitized system as described in any one of claims 1-5.