Industrial manufacturing system gray release method based on dynamic routing and flow scheduling

By employing a canary release method based on dynamic routing and traffic scheduling, the rigidity of traditional canary release schemes in industrial manufacturing systems is solved. This enables second-level fault rollback and fine-grained traffic control, ensuring system stability and security, and supporting efficient and reliable delivery for industrial digital transformation.

CN121309679APending Publication Date: 2026-01-09GUANGZHOU HONGYI TECH CO LTD

Patent Information

Application Number
CN202511405075.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-09-29
Publication Date
2026-01-09

AI Technical Summary

Technical Problem

Existing gray-scale release schemes for industrial manufacturing systems suffer from strong intrusiveness and static scheduling defects, resulting in rigid release processes, difficulty in achieving second-level rollback, and inability to support dynamic and refined flow control based on industrial entities such as production lines, equipment, or work orders, thus threatening the stability, security, and continuity of production systems.

Method used

By adopting a dynamic routing and traffic scheduling approach, a traffic hierarchical routing decision system is constructed through a real-time configuration loading and monitoring mechanism, multi-dimensional features and JWT factory identifiers. Combined with the tagging and tracking of canary requests and the precise scheduling process of instances, the system enables dynamic activation of canary releases and rapid fault isolation. It supports fine-grained traffic control and second-level fault rollback based on industrial entities.

Benefits of technology

It significantly improves the system's second-level rollback efficiency in the event of a failure, reduces the risk of production interruption and equipment accidents, ensures the stability, security and continuity of the production system, and provides efficient and reliable software delivery support for industrial digital transformation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121309679A_ABST
    Figure CN121309679A_ABST
Patent Text Reader

Abstract

The invention discloses an industrial manufacturing system gray release method based on dynamic routing and flow scheduling. According to the method, the configuration takes effect in real time by loading a routing rule and monitoring configuration change; client requests are received, and the client requests are preliminarily classified based on the request feature attributes and the global gray switch state; dynamically executing a routing decision based on the preliminary classification result and a factory identifier obtained by JWT analysis; a client request routed to a gray environment is marked, the marked client request is routed to a target service instance to complete request forwarding, accurate isolation of core service traffic and gray traffic is ensured based on a traffic pre-classification mechanism, and accurate scheduling of service granularity is realized in combination with intelligent routing decision of a factory identifier. And the closure and observability of the gray environment are guaranteed through full-link mark tracking, the controllability and safety of the gray release process are improved, and meanwhile efficient and stable iteration of the industrial manufacturing system is achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of grayscale distribution technology, and in particular to a grayscale publishing method for industrial manufacturing systems based on dynamic routing and traffic scheduling. Background Technology

[0002] The digital transformation of industrial manufacturing systems is essentially a process of evolving their core architecture from a closed, rigid traditional model to a flexible intelligent system based on cloud computing, the Internet of Things, and data analytics. However, fundamentally different from applications in the purely information technology domain, manufacturing systems are deeply embedded in and directly control physical production lines. This means that any system update failure can have consequences far exceeding service interruptions, potentially leading to significant economic losses, product quality issues, and even production safety risks. Due to this high-risk coupling with the physical world, manufacturing systems impose near-zero-tolerance requirements on the stability, reliability, and business continuity of the update process. Against this backdrop, canary release strategies have become a crucial technical solution. Their core value lies in verifying the new version on a strictly limited set of production units before a global update, thereby achieving smooth and secure iterative upgrades of the system under absolutely controllable risks.

[0003] The core of existing canary release technology in the industrial manufacturing sector lies in a risk control system guided by the principles of "layering and isolation." Its implementation heavily relies on the fundamental capabilities provided by industrial IoT platforms and edge computing architectures: First, the new software version is precisely deployed on edge servers or pre-defined pilot areas, creating a physical or logical isolation zone from the production environment. Then, through a rule engine or policy routing mechanism pre-set at the gateway layer, business "traffic" meeting specific conditions (such as specific production orders, equipment serial numbers, or operation instructions) is intelligently directed to the new version system, completing initial traffic segmentation. Throughout the verification cycle, the system continuously compares key business indicators (such as Overall Equipment Effectiveness (OEE) and product yield) between the canary environment and the baseline production environment, objectively evaluating the performance and stability of the new version in a data-driven manner. Only after thorough verification can the release scope be gradually expanded; and once an anomaly is detected, traffic is immediately switched back to the old version for rapid rollback, ultimately ensuring that the principles of production continuity and paramount security are guaranteed.

[0004] For example, the invention patent announcement CN117834183B discloses a gray-scale publishing system, which includes: a webpage content acquisition unit, a user management unit, a webpage management unit, and a distribution unit; the webpage content acquisition unit is used to acquire HTML content; the user management unit is used to log in and verify user IDs, and generate corresponding user verification information for verified user IDs; the webpage management unit is used to switch webpage scenes and webpage states according to user verification information; the distribution unit is used to refresh the webpage according to the switched webpage scene and webpage state, and receive HTML content for content distribution.

[0005] For example, the invention patent announcement CN106202123B describes a method and apparatus for canary release, which includes: selecting the optimal task execution path from all candidate task execution paths as modified metadata and sending it to the corresponding server based on the execution progress of the canary release task on each server and the distribution batch of each canary release task. During the execution of one or more canary release tasks, new canary release requests can be added, and the optimal task execution path is selected according to the distribution batch.

[0006] However, in the process of implementing the inventive technical solution in the embodiments of this application, it was found that the above-mentioned technology has at least the following technical problems: In existing technologies, the highly intrusive nature and static scheduling defects of traditional canary deployment schemes in industrial manufacturing systems lead to a fundamental rigidity in their deployment processes. This rigidity not only makes it difficult for the system to achieve second-level rollback in the event of a failure, thus significantly amplifying the risk of production interruptions and equipment accidents, but also, due to its deep coupling with business code, it cannot support dynamic and refined flow control based on industrial entities such as production lines, equipment, or work orders. This seriously threatens the stability, security, and continuity of the production system, and fails to support the efficient and reliable delivery goals required for industrial digital transformation. Summary of the Invention

[0007] This application provides a canary release method for industrial manufacturing systems based on dynamic routing and traffic scheduling. This method addresses the inherent intrusiveness and static scheduling defects of traditional canary release schemes in industrial manufacturing systems, which lead to a fundamentally rigid release process. This rigidity not only makes it difficult for the system to achieve second-level rollback in the event of a failure, significantly amplifying the risk of production interruptions and equipment accidents, but also, due to its deep coupling with business code, it cannot support dynamic and fine-grained traffic control based on industrial entities such as production lines, equipment, or work orders. This seriously threatens the stability, security, and continuity of the production system, failing to support the efficient and reliable delivery goals required for industrial digital transformation. The proposed method achieves low-intrusive canary release based on factory identification and dynamic traffic scheduling, supporting fine-grained traffic control and second-level fault rollback based on industrial entities, thus ensuring the stability and security of the industrial manufacturing system.

[0008] This application provides a method for canary deployment of industrial manufacturing systems based on dynamic routing and traffic scheduling, including the following steps: One or more technical solutions provided in the embodiments of this application have at least the following technical effects or advantages: 1. This invention achieves dynamic activation of release strategies, precise traffic segmentation at the industrial entity level, and closed-loop isolation and rapid fault isolation capabilities in grayscale environments by constructing a real-time configuration loading and monitoring mechanism, a traffic hierarchical routing decision system based on multi-dimensional features and JWT factory identifiers, and a tagging and tracking process for grayscale requests and precise instance scheduling. This fundamentally solves the problem of rigid release processes caused by the strong intrusiveness and static scheduling defects of traditional solutions, significantly improves the system's second-level rollback efficiency in case of failure, effectively reduces the risk of production interruption and equipment accidents, and comprehensively ensures the stability, security, and continuity of the production system through dynamic and refined traffic control of industrial entities such as production lines, equipment, and work orders, providing efficient and reliable software delivery support for industrial digital transformation.

[0009] 2. By constructing a dual judgment mechanism based on global grayscale switch status and multi-dimensional request feature attributes, and combining a refined routing decision process with predefined hierarchical rule sets and JWT factory identifier parsing, we have achieved accurate identification and forced routing of non-business traffic such as management requests, whitelisted interfaces, and static resources in the production environment. We have also dynamically allocated business requests in the grayscale environment based on factory identifiers, thereby establishing a traffic hierarchical control system oriented towards business security. While ensuring the stability of system management functions and core interfaces, we have achieved refined control of grayscale traffic scheduling at the factory level, effectively avoiding unnecessary traffic interference to the grayscale environment, and providing a highly reliable and highly isolated grayscale release foundation for industrial manufacturing systems.

[0010] 3. By constructing a deterministic routing algorithm based on device identifier hash mapping and traffic ratio comparison, a gray-scale environment identification system combining request / response dual-link tag injection and cookie persistence mechanism, and an instance scheduling closed loop integrating Nacos service discovery, load balancing and failover capabilities, mathematical precision control of gray-scale traffic allocation, end-to-end gray-scale environment isolation guarantee and high availability routing at the service instance level are achieved. This forms a complete gray-scale release control chain from traffic identification, environment tagging to instance forwarding, effectively improving the system's stability and fault self-healing capability during the gray-scale period while ensuring session consistency on the same device. Attached Figure Description

[0011] Figure 1 A flowchart illustrating the canary deployment method for an industrial manufacturing system based on dynamic routing and traffic scheduling, provided in an embodiment of this application. Figure 2 A flowchart illustrating the client request classification process for the canary release method of an industrial manufacturing system based on dynamic routing and traffic scheduling, provided in this application embodiment. Detailed Implementation

[0012] This application provides a canary release method for industrial manufacturing systems based on dynamic routing and traffic scheduling. This addresses the inherent intrusiveness and static scheduling defects of traditional canary release schemes in industrial manufacturing systems, which lead to a fundamentally rigid release process. This rigidity not only makes it difficult for the system to achieve second-level rollback in the event of a failure, significantly amplifying the risk of production interruptions and equipment accidents, but also, due to its deep coupling with business code, it cannot support dynamic and refined traffic control based on industrial entities such as production lines, equipment, or work orders. This seriously threatens the stability, security, and continuity of the production system, failing to support the efficient and reliable delivery goals required for industrial digital transformation. The overall approach is as follows: In a canary routing system built on OpenResty, the gateway loads routing rules from a remote configuration center to a shared storage area during startup and continuously monitors for configuration changes to ensure real-time rule effectiveness. Upon receiving a client request, the gateway first performs preliminary traffic classification based on request characteristics and the global canary status. Then, combining the classification results with the factory identifier obtained by parsing the JWT token, it dynamically decides whether to route the request to the production or canary environment. For requests determined to enter the canary environment, the gateway adds a specific tag, and the downstream load balancing component uses this tag to precisely locate the target instance from a dedicated canary service instance group within the service registry to complete the final request forwarding.

[0013] To better understand the above technical solutions, the following will provide a detailed explanation of the technical solutions in conjunction with the accompanying drawings and specific implementation methods.

[0014] like Figure 1 The diagram shown is a flowchart of a canary deployment method for an industrial manufacturing system based on dynamic routing and traffic scheduling, provided in an embodiment of this application. The method includes the following steps: Load routing rules and listen for configuration changes to ensure real-time configuration effectiveness; receive client requests and perform preliminary classification based on request characteristics and global grayscale switch status. This preliminary classification allows for pre-screening and priority routing of client requests to improve the accuracy of subsequent routing decisions and the efficiency of system resource allocation; dynamically execute routing decisions based on the preliminary classification results and the factory identifier obtained from JWT parsing, including allocating client requests to the production environment or the grayscale environment; mark client requests routed to the grayscale environment and then route them to the target service instance to complete request forwarding. The mark is a grayscale environment identifier for continuous tracking and routing to ensure that the processing of the request and its subsequent links is completed in the target grayscale environment.

[0015] In this embodiment, the present invention achieves highly automated and refined management of the canary release process in industrial manufacturing systems by constructing an intelligent routing gateway based on OpenResty. Its core effects are reflected in three aspects: First, by loading routing rules and monitoring configuration changes upon gateway startup, the dynamic effectiveness and global consistency of scheduling strategies are ensured, laying the foundation for real-time traffic control. Second, by integrating request characteristic attributes, global switch status, and factory identifiers parsed from JWTs for multi-layered decision-making, precise classification of traffic based on management end, interface whitelist, static resources, and business requests is achieved. Furthermore, based on factory whitelists, blacklists, and dynamic traffic ratio allocation mechanisms, canary traffic is precisely directed to specific production lines, equipment, or work orders, achieving industrial-grade fine-grained control. Finally, by injecting identifiers containing version and timestamps into canary traffic and combining this with service instance discovery in the registry center, it ensures that canary requests are continuously routed to the target canary environment in the complete call chain. Simultaneously, by dynamically adjusting traffic ratios based on health parameters, the controllability of the release process, system stability, and instantaneous fault rollback capability are significantly improved, effectively supporting the high-reliability, low-risk continuous delivery of industrial manufacturing systems.

[0016] like Figure 2 The diagram shows a client request classification flowchart for the canary deployment method for industrial manufacturing systems based on dynamic routing and traffic scheduling provided in this application embodiment. The method performs preliminary classification of client requests based on request feature attributes and the global canary deployment switch status. Specifically, it includes: obtaining the request feature attributes of the client request, which include request path features, request header features, and interface path; reading the pre-configured global canary deployment switch status; determining whether the global canary deployment switch status is enabled; if the global canary deployment switch status is disabled, directly routing the client request to the production environment; and if the global canary deployment switch status is enabled, executing the canary traffic classification process based on the request feature attributes.

[0017] In this embodiment, the present invention dynamically controls the global canary deployment state through Redis key-value pairs, enabling rapid start-up and shutdown of the canary deployment system during runtime, significantly improving the flexibility and response speed of system control. By introducing a two-layer judgment mechanism of "global canary deployment switch" and "request characteristic attributes," a traffic scheduling pre-filter with both global control and fine-grained screening capabilities is constructed. Its core technical effect is to provide flexible, secure, and efficient traffic access control for the entire canary deployment system. Specifically, the global canary deployment switch, as the highest priority global circuit breaker, when in the closed state, will unconditionally direct all traffic directly to the production environment regardless of the characteristics of a single request. This design allows operations and maintenance personnel to quickly and thoroughly roll back all traffic with a single click when they discover widespread risks in the canary deployment system or when urgent maintenance is required, greatly reducing systemic operational risks and ensuring the stability of core business operations. When the global switch is enabled, the system enters a refined management phase. Based on multi-dimensional request characteristic attributes such as request path features, request header features, and interface paths, a classification process is executed. This allows the system to accurately identify traffic that meets preset rules (such as accessing specific preview function paths, request headers marked by internal testers, or calling newly added interfaces), and filter it as traffic to be released for canary deployment. This ensures that the impact of canary testing is strictly controlled within the expected target group or specific business scenario, effectively avoiding inconsistent experiences caused by unrelated users being accidentally involved in the testing scope. In summary, this preliminary classification mechanism not only achieves a controllable one-click emergency response through the global switch, but also achieves precise traffic filtering through multi-dimensional characteristic attribute matching, ensuring the security and targeting of the canary release process from the source, and laying a solid foundation for subsequent dynamic traffic adjustment based on business health.

[0018] Further, the specific steps of the gray-scale traffic classification process are as follows: extract the request feature attributes of each client request and match them with a predefined hierarchical rule set, wherein the hierarchical rule set defines the mapping relationship between request feature attributes and path request categories; match one of the request path features, request header features, and interface paths according to the predefined hierarchical rule set to determine whether the client request belongs to gray-scale traffic, specifically including: matching the request path features with gray-scale path patterns defined in the rule set, such as specific URL (Uniform Resource Locator) prefixes or regular expressions; checking the request header features to verify the existence of gray-scale identification fields, such as specific header key-value pairs; comparing whether the interface path exists in the gray-scale interface whitelist; classifying the client request into gray-scale traffic to be released or production environment traffic based on the above matching and verification results; marking the client request into the corresponding path request category based on the matching results, wherein the path request category includes management requests, whitelisted interface requests, and static resource requests; marking client requests that do not meet the identification rules in the hierarchical rule set as business requests.

[0019] In this embodiment, under grayscale activation, the system performs precise matching based on multi-dimensional request feature attributes and a predefined hierarchical rule set to automatically identify and classify management requests, static resource requests, and whitelisted interface requests, and categorizes unmatched requests as business requests. This classification mechanism incorporates caching optimization technology, caching already classified request features to avoid redundant calculations, effectively improving classification efficiency and system performance. Simultaneously, the system implements comprehensive monitoring and logging throughout the entire classification process, meticulously tracking the grayscale activation / deactivation status, feature attribute matching process, and final classification results. This not only provides solid data support for operational diagnosis and rule optimization but also greatly enhances the system's observability and troubleshooting capabilities. Specifically, management requests are identified through dual verification using path features (such as detecting management interface-specific prefixes) and request header features (such as verifying internal network IP addresses), ensuring the security and stability of management traffic. Static resource requests are quickly identified and directly routed to the production environment using path features (such as directory prefixes and file extensions), ensuring the performance of resource access. Whitelisted interfaces achieve precise routing through interface path features (such as matching pre-configured lists and public service prefixes), ensuring the high availability of basic services and laying a solid foundation for end-to-end canary releases.

[0020] Furthermore, the steps for dynamically executing routing decisions based on the preliminary classification results and the factory identifier obtained from JWT parsing include: obtaining device credentials through a dual-path approach using HTTP (Hypertext Transfer Protocol) header tokens for API (Application Programming Interface) requests or browser cookies for page requests, and parsing the JWT to obtain the factory identifier. If the client request is a management request, the request is determined to enter the production environment, and a connection channel with the production environment is directly established; if the client request is a whitelisted interface request, the request is determined to enter the production environment, and forced routing to the production environment is performed; if the client request is a static resource request, the request is determined to enter the production environment, and redirected to the production environment; if the client request is a business request, the request is determined to enter the grayscale environment, and the grayscale decision process is initiated based on the factory identifier obtained from JWT parsing.

[0021] In this embodiment, the present invention implements dynamic routing decisions based on request classification and JWT parsing. A JWT consists of three parts: a header, a payload, and a signature. The header contains the token type and signature algorithm; the payload contains the declaration, i.e., the data to be transmitted; and the signature verifies the integrity and authenticity of the token, ensuring the security and reliability of identity authentication. The client carries the JWT in the request header. After receiving it, the gateway layer extracts and parses the token to obtain the factory identifier, and then executes the corresponding canary routing strategy. Differential processing improves system efficiency: for management requests, the shortest path is used to directly connect to the production environment, avoiding unnecessary decision-making overhead and ensuring the real-time performance of management operations; for whitelisted interface requests, the highest priority forced routing is used to ensure the stability and high availability of basic services; for static resource requests, the highest performance targeted service is used to improve resource access speed and reduce latency; for business requests, the canary decision-making process is based on the factory identifier, achieving fine-grained and dynamic traffic scheduling. This invention not only enhances system security through JWT verification but also optimizes resource allocation through classified routing, ensuring the priority processing of critical requests while maintaining the isolation and consistency of the canary environment, thereby improving system performance while ensuring the smoothness of business deployment.

[0022] Furthermore, the steps for entering the gray-scale decision-making process based on the factory identifier obtained from JWT parsing include: matching the factory identifier with a predefined factory classification list, which includes blacklisted factories and whitelisted factories; performing routing decisions based on the matching results: if the factory identifier belongs to a blacklisted factory, it is forcibly routed to the production environment; if the factory identifier belongs to a whitelisted factory, it is directed to the gray-scale environment; if the factory identifier does not belong to the factory classification list, the traffic allocation ratio is dynamically adjusted based on the business health parameters of the gray-scale environment, and dynamic environment allocation is performed based on the adjusted traffic allocation ratio and the device identifier corresponding to the client request.

[0023] In this embodiment, a blacklist factory refers to a set of factories explicitly prohibited from accessing the gray-scale environment. These factories typically have extremely high stability requirements, are performing critical production tasks, or their business characteristics may have known incompatibility risks with the gray-scale version. Adding them to the blacklist is a conservative and secure strategy, ensuring that core production activities are not subject to any potential interference. When a request is identified as originating from a blacklist factory, all its traffic will be forcibly routed to the production environment. A whitelist factory refers to a set of factories authorized to have priority access to or test new version features. Through the whitelist, the initial impact of the gray-scale release can be precisely controlled. For requests from whitelist factories, the system will redirect them to the gray-scale environment, ensuring that new features can be fully verified by specific target groups, while strictly limiting the impact to the whitelist to avoid unexpected impacts on ordinary users. The factory classification list is based on a Redis dynamic policy library, matching and judging by querying the blacklist and whitelist factory sets in Redis. The factory classification list supports adding, deleting, and modifying blacklist and whitelist factories at runtime through a management interface. This invention first matches the factory identifiers parsed from JWT with a predefined list: blacklisted factories are forcibly routed to the production environment to ensure the absolute stability of core production lines; whitelisted factories are directed to the gray-scale environment for precise testing. For unlisted factories, the traffic allocation ratio is dynamically adjusted based on real-time business health parameters of the gray-scale environment, and deterministic routing is performed based on the device identifier hash value. This ensures zero risk for critical production units while achieving on-demand elastic allocation and closed-loop control of test traffic, effectively achieving the optimal balance between risk control and release efficiency.

[0024] Furthermore, business health parameters include business success rate, transaction completion rate, and data consistency indicators. The steps for dynamically adjusting the traffic allocation ratio based on business health parameters in a gray-scale environment include: obtaining a business health assessment index based on business health parameters, and comparing the business health assessment index with a predefined business health assessment threshold; if the business health assessment index reaches the business health assessment threshold, it indicates that the new version in the gray-scale environment is performing well, and the gray-scale traffic ratio is gradually increased based on a predefined step size; if the business health assessment index does not reach the business health assessment threshold, it indicates that the new version has problems in success rate, transactions, or data consistency, and continuing to increase traffic may affect more users or even cause online failures. The difference between the business health assessment threshold and the business health assessment index is marked as the deviation business health assessment index. The deviation business health assessment index is matched with a predefined traffic ratio adjustment mapping table, and the gray-scale traffic ratio is adjusted based on the obtained traffic ratio adjustment value. The traffic ratio adjustment mapping table defines the mapping relationship between the deviation business health assessment index and the gray-scale traffic ratio adjustment value.

[0025] The steps for obtaining the business health assessment index based on business health parameters include: obtaining predefined business health reference parameters and business health weight parameters. The business health reference parameters include critical business success rate, critical transaction completion rate, and critical data consistency index. The business health weight parameters include business success rate weight, transaction completion rate weight, and data consistency index weight. The business health reference parameters are compared with their corresponding business health parameters, and the ratios are then weighted using the business health weight parameters. Finally, the weighted results are coupled to obtain the business health assessment index, which is a comprehensive quantitative indicator for assessing the overall health status of the current grayscale environment based on the business health parameters.

[0026] In this embodiment, the business success rate is obtained by relying on the data embedded in the key service interfaces of the business monitoring system. Success or failure is determined by statistically analyzing the HTTP status code and business return code of each request, and then calculated as the ratio of the number of successful requests to the total number of requests within a period. This indicator directly reflects the availability and stability of the service interface. The transaction completion rate is obtained by using a distributed tracing system to assign a unique identifier to each complete business process and track its execution path between different service nodes. It is obtained by statistically analyzing the proportion of business transactions that successfully reach the destination within a period to the total number of initiated transactions, and is used to measure the end-to-end reliability of complex cross-service processes. The data consistency indicator is executed periodically by a dedicated data verification program. This program extracts related data from multiple independent data sources, such as business databases and financial accounts, and compares and verifies them according to predefined rules. Finally, the consistency rate is calculated based on the proportion of inconsistent data entries. The core is to evaluate the accuracy and eventual consistency of the system data. This invention combines three key dimensions: instantaneous interface status, macro-level business process integrity, and underlying data correctness. It avoids the limitations of a single indicator perspective, and can more comprehensively and three-dimensionally reveal the health status of the gray-scale environment. It also provides a quantitative and comprehensive judgment benchmark for operation and maintenance decisions such as gray-scale release and traffic scheduling, enabling automated control systems to perform operations based on more reliable information and effectively reducing the risk of decision-making errors.

[0027] This invention achieves intelligent management of traffic allocation ratios during canary releases by constructing a dynamic traffic control mechanism based on multi-dimensional business health parameters. This mechanism uses business success rate, transaction completion rate, and data consistency indicators as core monitoring dimensions. It generates a comprehensive business health assessment index by standardizing the ratios of actual indicator values ​​with predefined critical reference parameters and then weighting and fusing them with preset weighting coefficients for each dimension. This allows for a quantitative assessment of the canary environment's operational status. When the assessment index reaches a preset threshold, the system increases the canary traffic ratio in predetermined steps, steadily expanding the new version's coverage. When the index falls below the threshold, it queries the traffic ratio adjustment mapping table based on the deviation value and automatically reduces the traffic ratio to control risk. This closed-loop feedback control based on health status accelerates the release process when the version is stable and promptly curbs the impact of abnormal trends, significantly improving the security and reliability of the release process and effectively ensuring the continuity and data consistency of the production system.

[0028] Furthermore, the steps for dynamic environment allocation based on the corrected traffic allocation ratio and the device identifier corresponding to the client request include: obtaining the device identifier corresponding to the client request; calculating the device identifier using a predefined hash function to obtain a first hash value; mapping the first hash value to a ratio value within a predetermined numerical range; comparing the ratio value with the corrected traffic allocation ratio: if the ratio value is less than or equal to the corrected traffic allocation ratio, the client request is routed to the grayscale environment; if the ratio value is greater than the corrected traffic allocation ratio, the client request is routed to the production environment.

[0029] In this embodiment, the present invention achieves precise control of canary traffic allocation and ensures session consistency by constructing a deterministic routing decision mechanism based on device identifier hashing and ratio comparison. This mechanism takes the client device identifier as input, converts it into a uniformly distributed hash value using a predefined hash function, and maps it to a standardized ratio value. By deterministically comparing this ratio value with a dynamically adjusted traffic allocation threshold, a clear routing decision boundary is established: if the ratio value falls within the allocation threshold range, the traffic is routed to the canary environment; otherwise, it is routed to the production environment. This hash-based allocation strategy not only ensures the mathematical accuracy of traffic ratio control and avoids ratio deviations that may occur with random allocation, but more importantly, it ensures the consistency of traffic flow before and after the canary release for the same device. This effectively prevents session interruptions or data inconsistencies caused by environment switching, thereby maintaining the continuity and stability of business processing while achieving a smooth canary rollout.

[0030] Furthermore, the steps for marking client requests routed to the grayscale environment include: generating a grayscale environment identifier, which includes at least a grayscale version number and a request timestamp; injecting the grayscale environment identifier into the client request, specifically by: injecting ngx.req.set_header("hy-version", "gray") to set the grayscale environment identifier as a key-value pair in one or more custom fields of the HTTP header of the client request, thus achieving request-level coloring; before sending the response data returned by the backend service back to the client, adding the grayscale environment identifier to the HTTP header of the response by setting ngx.header["X-Custom-Header"] = "gray", so that the monitoring system can capture grayscale information at the request exit point for end-to-end analysis; encapsulating the grayscale environment identifier into a cookie token with a preset validity period, and setting the cookie token in the response to the client request by string.match(cookies, "token=([^;]+)"), so that subsequent requests initiated by the client within the validity period can be continuously identified and routed to the grayscale environment by carrying this cookie token. When the gateway first routes a user request to the gray-scale environment, it sets this cookie in the response. Thereafter, subsequent requests from the same user within the same browser session will automatically carry this cookie, ensuring that the user's entire session is consistently identified and routed to the correct gray-scale environment, guaranteeing a consistent user experience.

[0031] In this embodiment, the grayscale traffic coloring mechanism generates and injects a unique grayscale environment identifier for each request flowing into the grayscale environment. This identifier is continuously propagated across microservices throughout the subsequent request chain, forming a complete grayscale traffic trajectory. This mechanism lays a key technical foundation for achieving the observability and controllability of grayscale deployments. Its core value is mainly reflected in several aspects: At the end-to-end tracing level, operations personnel can accurately filter and aggregate full-dimensional behavioral data of grayscale traffic based on this identifier in logs and monitoring systems, and compare and analyze it with production environment traffic to obtain accurate differentiated insights. At the user experience assurance level, by encapsulating the identifier as a cookie with an expiration date, it can be ensured that all requests of the same user session are continuously routed to the designated grayscale environment, effectively avoiding inconsistencies in functional interactions caused by version switching, which is crucial for verifying complex business processes. At the fault management level, when an anomaly occurs in the grayscale environment, this identifier can quickly define the scope of impact, pinpointing the problem to the grayscale traffic, greatly improving troubleshooting efficiency and achieving accurate impact assessment. Furthermore, this mechanism is a prerequisite for the data reliability of the business health assessment index calculation. It ensures that all raw data used to calculate health indicators such as business success rate and transaction completion rate originates from clearly labeled gray-scale traffic, making the assessment results truly reflect the health status of gray-scale services, and thus providing reliable data input for automated traffic control decisions. In summary, traffic coloring is an indispensable technical foundation for building a secure, controllable, and observable gray-scale release system.

[0032] Furthermore, the steps for routing to the target service instance after marking to complete request forwarding include: adopting a hybrid service discovery mode based on the Nacos registry center and local route caching to obtain a list of available service instances; the service discovery component parses the HTTP header of the client request to identify the grayscale environment identifier contained therein; if a valid grayscale environment identifier is identified, the target node is selected first from the service instance pool corresponding to the grayscale environment; based on a pre-configured load balancing algorithm, the most suitable service instance is selected from the selected target nodes; the client request is forwarded to the selected service instance; if an instance failure or response timeout occurs during the request forwarding process, a failover mechanism is triggered, and a service instance is reselected according to the established strategy to complete the request forwarding.

[0033] In this embodiment, the present invention achieves precise scheduling and high availability of gray-scale traffic in a distributed environment by constructing an intelligent service routing mechanism based on tag recognition. This mechanism employs a hybrid service discovery mode that combines a registry center and local caching, improving routing performance while ensuring the real-time availability of the instance list. The core process accurately identifies requests that need to be routed to the gray-scale environment by parsing the gray-scale environment identifier in the request tag, and then selects target nodes from the dedicated service instance pool based on this, ensuring strict isolation between traffic and the environment. Furthermore, a load balancing algorithm is integrated to achieve intelligent routing at the instance level, ensuring the balanced distribution of traffic within the gray-scale cluster. When an instance failure or response timeout is detected, the system automatically triggers a failover process, reselecting an available instance according to a preset strategy to complete the request forwarding, forming a complete fault-tolerant closed loop. This technical approach effectively achieves end-to-end directional routing, load balancing, and fault self-healing for gray-scale traffic, significantly improving the reliability and system stability of the gray-scale release process.

[0034] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0035] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0036] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0037] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0038] Although preferred embodiments of the invention have been described, those skilled in the art, upon learning the basic inventive concept, can make other changes and modifications to these embodiments. Therefore, the appended claims are intended to be interpreted as including both the preferred embodiments and all changes and modifications falling within the scope of the invention.

[0039] Obviously, those skilled in the art can make various modifications and variations to this invention without departing from its spirit and scope. Therefore, if these modifications and variations fall within the scope of the claims of this invention and their equivalents, this invention also intends to include these modifications and variations.

Claims

1. A method for canary deployment in industrial manufacturing systems based on dynamic routing and traffic scheduling, characterized in that, Includes the following steps: Load routing rules and listen for configuration changes to ensure that the configuration takes effect in real time; Upon receiving a client request, the system performs a preliminary classification of the client request based on request feature attributes and global grayscale switch status. This preliminary classification is used to pre-screen and prioritize client requests to improve the accuracy of subsequent routing decisions and the efficiency of system resource allocation. Based on the preliminary classification results and the factory identifier obtained from JWT parsing, a dynamic routing decision is made, which includes allocating client requests to the production environment or the gray-scale environment. A tag is applied to client requests routed to a grayscale environment, and then the tag is routed to a target service instance to complete the request forwarding. The tag is a grayscale environment identifier that is continuously tracked and routed to ensure that the processing of the request and its subsequent links is completed in the target grayscale environment.

2. The canary release method for industrial manufacturing systems based on dynamic routing and traffic scheduling as described in claim 1, characterized in that, The preliminary classification of client requests based on request feature attributes and global grayscale switch status specifically includes: Obtain the request characteristic attributes of the client request, including request path characteristics, request header characteristics, and interface path; Read the pre-configured global grayscale switch status; Determine whether the global grayscale switch is in the on state; If the global grayscale switch is in the off state, the client request will be directly routed to the production environment; If the global grayscale switch is in the on state, then the grayscale traffic classification process is executed based on the request feature attributes.

3. The canary release method for industrial manufacturing systems based on dynamic routing and traffic scheduling as described in claim 2, characterized in that, The specific steps for performing the grayscale traffic classification process are as follows: Extract the request feature attributes of each client request and match them with a predefined hierarchical rule set. The hierarchical rule set defines the mapping relationship between request feature attributes and path request categories. The request feature attributes include request path features, request header features, and interface path. Matching is performed based on a predefined hierarchical rule set, considering one of the following: request path features, request header features, and interface path. Match the path characteristics of the request with the grayscale path patterns defined in the rule set; Check the request header features to verify the presence of a grayscale identifier field; Compare the matching relationship between the interface path and the grayscale interface whitelist; Based on the above matching and verification results, client requests are classified into traffic awaiting gray-scale deployment or production environment traffic. Based on the matching results, the client request is marked as the corresponding path request category, which includes management requests, whitelisted interface requests, and static resource requests. Client requests that do not meet the centralized identification rules of the hierarchical rules will be marked as business requests.

4. The canary release method for industrial manufacturing systems based on dynamic routing and traffic scheduling as described in claim 1, characterized in that, The steps for dynamically executing routing decisions based on the preliminary classification results and the factory identifiers obtained from JWT parsing include: If the client request is a management request, the request is determined to be an entry into the production environment, and a connection channel with the production environment is established directly. If the client request is a whitelisted interface request, the request will be determined to be entering the production environment and will be forcibly routed to the production environment; If the client requests a static resource, the request is determined to be destined for the production environment and redirected to the production environment. If the client request is a business request, the request will be determined to enter the grayscale environment, and the grayscale decision process will be initiated based on the factory identifier obtained from JWT parsing.

5. The canary release method for industrial manufacturing systems based on dynamic routing and traffic scheduling as described in claim 4, characterized in that, The steps for incorporating the factory identifier obtained from JWT parsing into the grayscale decision-making process include: Match the factory identifier with a predefined list of factory categories, which includes blacklisted factories and whitelisted factories; Decision-making is performed based on the matching results: If the factory identifier belongs to a blacklisted factory, then the route will be forced to the production environment; If the factory identifier belongs to a whitelisted factory, then the route will be redirected to the grayscale environment; If the factory identifier is not in the factory category list, the traffic allocation ratio is dynamically adjusted based on the business health parameters of the grayscale environment, and dynamic environment allocation is performed based on the adjusted traffic allocation ratio and the device identifier corresponding to the client request.

6. The canary release method for industrial manufacturing systems based on dynamic routing and traffic scheduling as described in claim 5, characterized in that, The business health parameters include business success rate, transaction completion rate, and data consistency indicators; The steps for dynamically adjusting the traffic allocation ratio based on the service health parameters in a grayscale environment include: A business health assessment index is obtained based on business health parameters, and then compared with a predefined business health assessment threshold. If the business health assessment index reaches the business health assessment threshold, the proportion of gray traffic will be gradually increased based on a predefined step size. If the business health assessment index does not reach the business health assessment threshold, the difference between the business health assessment threshold and the business health assessment index is marked as the deviation business health assessment index. The deviation business health assessment index is matched with a predefined traffic ratio adjustment mapping table, and the gray traffic ratio is corrected based on the obtained traffic ratio adjustment value. The traffic ratio adjustment mapping table defines the mapping relationship between the deviation business health assessment index and the gray traffic ratio adjustment value.

7. The canary release method for industrial manufacturing systems based on dynamic routing and traffic scheduling as described in claim 6, characterized in that, The steps for obtaining the business health assessment index based on business health parameters include: Obtain predefined business health reference parameters and business health weight parameters. The business health reference parameters include critical business success rate, critical transaction completion rate, and critical data consistency index. The business health weight parameters include business success rate weight, transaction completion rate weight, and data consistency index weight. The business health reference parameters are compared with the corresponding business health parameters, and then the ratios are weighted using the business health weight parameters. Finally, the weighted results are coupled to obtain the business health assessment index, which is a comprehensive quantitative indicator for assessing the overall health status of the current grayscale environment based on the business health parameters.

8. The canary release method for industrial manufacturing systems based on dynamic routing and traffic scheduling as described in claim 5, characterized in that, The step of dynamically allocating the environment based on the corrected traffic allocation ratio and the device identifier corresponding to the client request includes: Obtain the device identifier corresponding to the client request; The device identifier is calculated using a predefined hash function to obtain a first hash value; Map the first hash value to a proportional value within a predetermined numerical range; Compare the stated ratio with the corrected flow allocation ratio: If the ratio is less than or equal to the corrected traffic allocation ratio, the client request will be routed to the grayscale environment. If the ratio is greater than the corrected traffic allocation ratio, the client request will be routed to the production environment.

9. The canary release method for industrial manufacturing systems based on dynamic routing and traffic scheduling as described in claim 1, characterized in that, The step of marking client requests routed to the grayscale environment includes: Generate a grayscale environment identifier, wherein the grayscale environment identifier includes at least a grayscale version number and a request timestamp; Injecting the grayscale environment identifier into the client request specifically includes setting the grayscale environment identifier in the form of a key-value pair in one or more custom fields of the HTTP header of the client request; Before sending the response data returned by the backend service back to the client, the grayscale environment identifier is added to the HTTP header of the response; The grayscale environment identifier is encapsulated into a cookie token with a preset validity period, and the cookie token is set in the response to the client request.

10. The canary release method for industrial manufacturing systems based on dynamic routing and traffic scheduling as described in claim 9, characterized in that, The steps of routing the request forwarding to the target service instance after coloring include: Get a list of available service instances; Parse the HTTP header of the client request and identify the grayscale environment identifier contained therein; If a valid grayscale environment identifier is identified, the target node will be selected from the service instance pool corresponding to the grayscale environment. Based on a pre-configured load balancing algorithm, service instances are selected from the filtered target nodes; Forward the client request to the selected service instance; If an instance failure or response timeout occurs during request forwarding, the failover mechanism is triggered, and a new service instance is selected according to the established strategy to complete the request forwarding.

Citation Information

Patent Citations

  • Methods and equipment for grayscale deployment

    CN106202123B

  • A grayscale release system

    CN117834183B

Cited By

  • Gray release and flow control method and device for large model service

    CN121547403A