Commodity extension instance dynamic management method
By dynamically managing product extension instances and utilizing product routing information and weighted scoring mechanisms, the system solves the problems of poor scalability and difficult operation and maintenance in traditional product service architectures, enabling flexible business expansion and stable system operation, and improving management efficiency and fault response capabilities.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-30
- Publication Date
- 2026-04-10
AI Technical Summary
Traditional product and service architectures are inadequate in terms of business scalability, management efficiency, and effectiveness, leading to problems such as system rigidity, complex testing, difficult operation and maintenance, and the spread of faults.
By acquiring product routing information, calculating comprehensive weight scores, filtering target extended instances, and monitoring their running status in real time, combined with resource isolation configuration and dependency injection, dynamic management and gradual canary release of extended instances are achieved, reducing component coupling and ensuring the stability of core processes.
It improves the system's flexibility, stability, and maintainability, reduces the impact of full deployment on the system, supports small-scale pilots and smooth iterations, and enhances operational observability and rapid fault response capabilities.
Smart Images

Figure CN121832992A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of extended instance management, and more particularly to a method for dynamic management of product extended instances. Background Technology
[0002] In the product management business, the product service needs to support multiple business scenarios. However, the traditional product service architecture has certain limitations. On the one hand, the expansion of business capabilities requires intrusive modifications to the core code, which leads to system rigidity and violates the open / closed principle. The system has poor scalability and is prone to chain modification risks. At the same time, the full release mode forces minor changes to require service restarts. Moreover, the testing coverage cost of new functions is high and affects stability. In the operation and maintenance process, the mixed deployment of business strategies leads to problems such as large impact of failures or difficulty in isolation.
[0003] Therefore, a dynamic management method for product extension instances is needed to solve the problem of poor business scalability of product extension instances in practical applications, and to improve management efficiency and effectiveness. Summary of the Invention
[0004] The purpose of this application is to at least address one of the aforementioned technical deficiencies, particularly the technical deficiencies of existing technology in terms of poor business scalability, insufficient management efficiency, and insufficient effectiveness of product extension instances in practical applications.
[0005] Firstly, this application provides a method for dynamic management of product extension instances, the method comprising:
[0006] Obtain the product routing information corresponding to the target product;
[0007] The product routing information is used to determine the matching degree parameter between each target product and each optional extended instance;
[0008] Calculate the comprehensive weight score corresponding to each of the optional extension instances, and select the target extension instance from each of the optional extension instances based on the comprehensive weight score;
[0009] The comprehensive weight score is calculated based on the static weight parameter, the extended instance health parameter, and the matching degree parameter.
[0010] Inject the target extended instance into the main business process;
[0011] The system monitors the running parameters of the target extended instance in real time and dynamically adjusts the running status of the target extended instance.
[0012] As an optional implementation, injecting the target extended instance into the main business process includes:
[0013] Create the target extension instance;
[0014] Configure resource isolation and dependency injection for the target extended instance, and update the configuration items corresponding to the target extended instance;
[0015] Based on the configuration items, load the target extended instance and inject it into the main business process.
[0016] As an optional implementation, updating the configuration items corresponding to the target extended instance includes:
[0017] Create a memory snapshot of the current configuration item;
[0018] Load the new configuration item and perform syntax validation, semantic validation, and dependency validation on the new configuration item;
[0019] The syntax validation is used to check the executableness of the statement structure of the new configuration item; the semantic validation is used to verify the business rationality of the parameter values and text items in the new configuration item; and the dependency validation is used to confirm the service relevance of the new configuration item.
[0020] After all the syntax validation, semantic validation, and dependency validation have passed, the configuration change is submitted, the target extended instance configuration item is updated based on the new configuration item, and if any of the syntax validation, semantic validation, or dependency validation fails, the rollback is performed based on the memory snapshot, and the target extended instance configuration item is restored based on the current configuration item.
[0021] As an optional implementation, the product routing information includes product type, sales model, business channel, user characteristics, and geographic information, and the matching degree parameter is determined in the following ways:
[0022] Parse the product routing information and generate structured routing features;
[0023] The structured routing features include text-based features, encoded features, or parameter-based features;
[0024] Based on the data format of the structured routing features, the routing parameters for each dimension are determined, and the matching degree parameter is obtained by weighted calculation based on each of the routing parameters.
[0025] As an optional implementation, the real-time monitoring of the operating parameters of the target extended instance and the dynamic adjustment of the operating state of the target extended instance include:
[0026] During the operation of the target extended instance, system performance parameters and related service parameters are obtained;
[0027] Based on the system performance parameters and the business parameters, determine the operational health parameters of the target extended instance, and execute the preset exception handling process and / or alarm process according to the operational health parameters;
[0028] In addition, an extended instance running report is generated and pushed to a preset terminal.
[0029] As an optional implementation, the method is also used for the gradual gray-scale release of each of the target extended instances, wherein the target extended instances include the original instance and the new instance, and the gradual gray-scale release specifically includes:
[0030] Based on the product routing information, determine the product hash value;
[0031] Based on the product hash value, determine the proportion of traffic allocated to the new instance;
[0032] Monitor the error rate and response time of the new instance:
[0033] Based on the error rate and the response time, adjust the operation mode of the new instance;
[0034] The specific methods for adjusting the traffic ratio include version rollback, pausing debugging, increasing the ratio, or maintaining observation.
[0035] As an optional implementation, the method further includes dynamically adjusting the comprehensive weight score, specifically including:
[0036] During the first time period, obtain the unit time call volume, success rate and response time of each optional extended instance;
[0037] When the success rate is lower than the first preset ratio, or the response time exceeds the first threshold, the comprehensive weight score is reduced by the second preset ratio.
[0038] Secondly, this application provides a product extension instance dynamic management device, comprising:
[0039] The acquisition module is used to obtain the product routing information corresponding to the target product;
[0040] The product routing information is used to determine the matching degree parameter between each target product and each optional extended instance;
[0041] The processing module is used to calculate the comprehensive weight score corresponding to each of the optional extended instances, and to filter the target extended instance from each of the optional extended instances based on the comprehensive weight score;
[0042] The comprehensive weight score is calculated based on the static weight parameter, the extended instance health parameter, and the matching degree parameter.
[0043] The processing module is also used to inject the target extended instance into the main business process;
[0044] The processing module is also used to monitor the running parameters of the target extended instance in real time and dynamically adjust the running status of the target extended instance.
[0045] Thirdly, this application provides a computer device including one or more processors and a memory storing computer-readable instructions that, when executed by the one or more processors, perform the steps of the method described in the first aspect.
[0046] Fourthly, this application provides a storage medium storing computer-readable instructions that, when executed by one or more processors, cause the one or more processors to perform the steps of the method described in the first aspect.
[0047] As can be seen from the above technical solutions, the embodiments of this application have the following advantages:
[0048] Based on any of the above embodiments, this application analyzes multi-dimensional features of product routing information and achieves intelligent screening and dynamic injection of extended instances through matching degree parameters and a comprehensive weight scoring mechanism, thereby improving business adaptability from the root. Resource isolation configuration and dependency injection reduce component coupling and ensure the stability of core processes; hot updates of configuration items ensure atomicity of changes through memory snapshots and triple verification of syntax, semantics, and dependencies, eliminating the risk of system interruption caused by configuration errors. Real-time monitoring of running parameters and triggering of anomaly handling processes build rapid fault response and self-healing capabilities, and combined with extended instance reports, enhances operational observability. Gradual canary releases allocate traffic based on product hash values, and dynamically adjust the release strategy through error rate and response time monitoring, supporting small-scale pilots and smooth iterations, significantly reducing the impact of full releases on the system. The dynamic weight adjustment mechanism optimizes routing decisions in real time based on instance performance, improving resource utilization and business continuity. The overall solution uses a lightweight architecture to achieve pluggable extension of business capabilities, runtime governance, and gradual evolution, completely solving the problems of rigid code, frequent releases, complex testing, and fault propagation in traditional product services, and improving the system's flexibility, stability, and maintainability. Attached Figure Description
[0049] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0050] Figure 1 A flowchart illustrating a method for dynamically managing extended product instances provided in one embodiment of this application;
[0051] Figure 2 A schematic diagram of the system architecture corresponding to the product extended instance dynamic management method provided in one embodiment of this application;
[0052] Figure 3 This is an internal structural diagram of a computer device provided in an embodiment of this application. Detailed Implementation
[0053] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.
[0054] In product management, as business complexity increases, product services need to support multiple business scenarios:
[0055] Multiple product types: physical goods, virtual goods, services, etc.
[0056] Multiple sales models: regular sales, pre-sales, group buying, flash sales, etc.;
[0057] Multiple business channels: online store, offline stores, third-party platforms, etc.;
[0058] Multi-regional strategy: Different regions have different pricing, inventory, and delivery strategies.
[0059] However, the traditional goods and services architecture faces the following challenges:
[0060] Rigid code: Adding a new product type or business model requires modifying the core code;
[0061] Frequent releases: Even minor changes require a full release, impacting system stability;
[0062] Testing is complex: testing new features needs to cover all product scenarios;
[0063] Operation and maintenance difficulties: Different business strategies are deployed together, making fault isolation difficult.
[0064] Furthermore, in specific application scenarios, the main problems with the product service architecture lie in two aspects:
[0065] On the one hand, there's the issue of scalability:
[0066] Traditional product and service logic suffers from scattered hard-coded logic, requiring modifications to existing code when adding new product types or logic, resulting in poor scalability.
[0067] High logical coupling and difficult maintenance can easily lead to a chain of modifications.
[0068] Violating the open / closed principle hinders the flexible evolution of the system.
[0069] On the other hand, governance issues:
[0070] Disorganized configuration: Product strategy configurations are scattered across the database, configuration files, and code;
[0071] Lack of monitoring: It is impossible to monitor the operational status of each expansion point in real time;
[0072] Fault propagation: A single extension point failure can affect the entire product service.
[0073] Therefore, this application designs a lightweight dynamic extension governance framework for commodity services based on the SPI mechanism (a service discovery mechanism that decouples class loading from configuration files), and implements the following:
[0074] Plug-in business capabilities: Product business capabilities are pluggable and support dynamic expansion;
[0075] Runtime governance: Supports dynamic configuration, monitoring, and circuit breaking of extension points;
[0076] Gradual evolution: small-scale pilot programs to gradually replace existing hard-coded logic;
[0077] Integrated DevOps: Provides complete development, testing, deployment, and monitoring capabilities.
[0078] In summary, the technical concept of this application lies in its ability to intelligently filter and dynamically inject extended instances based on multi-dimensional features derived from product routing information analysis, through matching degree parameters and a comprehensive weight scoring mechanism, thereby fundamentally improving business adaptability. Resource isolation configuration and dependency injection reduce component coupling and ensure the stability of core processes; hot updates of configuration items ensure atomicity of changes through memory snapshots and triple verification of syntax, semantics, and dependencies, eliminating the risk of system interruption due to configuration errors. Real-time monitoring of runtime parameters and triggering of anomaly handling processes build rapid fault response and self-healing capabilities, while extended instance reports enhance operational observability. Gradual canary releases allocate traffic based on product hash values, dynamically adjusting release strategies through error rate and response time monitoring, supporting small-scale pilots and smooth iterations, significantly reducing the impact of full releases on the system. The dynamic weight adjustment mechanism optimizes routing decisions in real time based on instance performance, improving resource utilization and business continuity. The overall solution uses a lightweight architecture to enable plug-in extension of business capabilities, runtime governance, and gradual evolution, completely solving the problems of rigid code, frequent releases, complex testing, and fault propagation in traditional product services, and improving the system's flexibility, stability, and maintainability.
[0079] The methods provided in this application will be described in detail below based on the corresponding implementation methods in some practical application scenarios.
[0080] Figure 1 This is a flowchart illustrating a method for dynamically managing extended product instances according to an embodiment of this application, as shown below. Figure 1 As shown, this application provides a method for dynamic management of product extended instances, the method comprising:
[0081] S101. Obtain the product routing information corresponding to the target product;
[0082] The product routing information is used to determine the matching degree parameter between each target product and each optional extended instance;
[0083] As an optional implementation, the product routing information includes product type, sales model, business channel, user characteristics, and geographic information, and the matching degree parameter is determined in the following ways:
[0084] Parse the product routing information and generate structured routing features;
[0085] The structured routing features include text-based features, encoded features, or parameter-based features;
[0086] Based on the data format of the structured routing features, the routing parameters for each dimension are determined, and the matching degree parameter is obtained by weighted calculation based on each of the routing parameters.
[0087] This implementation method parses product routing information to generate structured features (text, encoded, and parameter forms), unifying the processing standards for multi-source heterogeneous data. Based on these features, it extracts routing parameter dimensions and quantifies the matching degree through weighted calculations, transforming business characteristics such as product type, sales model, and channel into calculable indicators, thus achieving objectivity and refinement in routing decisions. This approach enhances the scalability of routing rules, adapts to multiple scenario requirements, lays a data foundation for accurate matching of extended instances, and improves the flexibility and accuracy of business strategies.
[0088] S102. Calculate the comprehensive weight score corresponding to each of the optional extended instances, and select the target extended instance from each of the optional extended instances based on the comprehensive weight score;
[0089] The comprehensive weight score is calculated based on the static weight parameter, the extended instance health parameter, and the matching degree parameter.
[0090] S103. Inject the target extended instance into the main business process;
[0091] As an optional implementation, injecting the target extended instance into the main business process includes:
[0092] Create the target extension instance;
[0093] Configure resource isolation and dependency injection for the target extended instance, and update the configuration items corresponding to the target extended instance;
[0094] Based on the configuration items, load the target extended instance and inject it into the main business process.
[0095] This implementation avoids resource contention between multiple instances and ensures the stability of core business processes by creating a target extended instance and performing resource isolation configuration. A dependency injection mechanism automatically assembles service components, reducing manual configuration costs and mitigating coupling risks. The configuration update process employs memory snapshots and multi-level verification (syntax, semantics, dependencies) to ensure the atomicity and security of changes, and allows for rapid rollback in case of verification failure, eliminating system interruptions caused by configuration errors. Finally, the instance is loaded based on the updated configuration items, achieving seamless integration of extended capabilities and improving the reliability and execution efficiency of the main business processes.
[0096] As an optional implementation, updating the configuration items corresponding to the target extended instance includes:
[0097] Create a memory snapshot of the current configuration item;
[0098] Load the new configuration item and perform syntax validation, semantic validation, and dependency validation on the new configuration item;
[0099] The syntax validation is used to check the executableness of the statement structure of the new configuration item; the semantic validation is used to verify the business rationality of the parameter values and text items in the new configuration item; and the dependency validation is used to confirm the service relevance of the new configuration item.
[0100] After all the syntax validation, semantic validation, and dependency validation have passed, the configuration change is submitted, the target extended instance configuration item is updated based on the new configuration item, and if any of the syntax validation, semantic validation, or dependency validation fails, the rollback is performed based on the memory snapshot, and the target extended instance configuration item is restored based on the current configuration item.
[0101] This implementation preserves the current configuration state by creating a memory snapshot, providing a reliable baseline for rollback. Added syntax validation ensures configuration statements are executable, semantic validation verifies the rationality of parameters and business logic, and dependency validation confirms service relevance. This triple validation mechanism comprehensively ensures the accuracy of configuration changes from both technical and business layers. Changes are only submitted after all validations pass; otherwise, rollback is based on the snapshot, preventing invalid or conflicting configurations from polluting the operating environment. This process significantly reduces system risks caused by configuration updates, supports hot reloading requirements, ensures service continuity, and improves operational security.
[0102] S104. Monitor the running parameters of the target extended instance in real time and dynamically adjust the running status of the target extended instance.
[0103] As an optional implementation, the real-time monitoring of the operating parameters of the target extended instance and the dynamic adjustment of the operating state of the target extended instance include:
[0104] During the operation of the target extended instance, system performance parameters and related service parameters are obtained;
[0105] Based on the system performance parameters and the business parameters, determine the operational health parameters of the target extended instance, and execute the preset exception handling process and / or alarm process according to the operational health parameters;
[0106] In addition, an extended instance running report is generated and pushed to a preset terminal.
[0107] This implementation method collects system performance and business parameters in real time, and monitors the operational status of target extended instances from multiple dimensions. Based on these parameters, it dynamically calculates operational health parameters, triggers preset anomaly handling processes (such as circuit breaking and degradation) and alarm processes, enabling rapid fault location and self-healing. The generation and push of extended instance operation reports provide real-time data support for operational and maintenance decisions. This mechanism effectively prevents the spread of localized faults, ensures high business availability, reduces manual maintenance costs, and improves overall system stability.
[0108] Figure 2 This is a schematic diagram of the system architecture corresponding to the product extended instance dynamic management method provided in one embodiment of this application. The various implementation methods in this application can be implemented as follows: Figure 2 The architecture implementation is shown.
[0109] For the product extension router, it is used to intelligently route to the appropriate extension implementation based on the product context. Specific functions include:
[0110] Enables intelligent routing and dynamic expansion of product business logic;
[0111] It supports decision-making based on multiple dimensions such as product type, sales model, channel, user characteristics, and region;
[0112] Configure and select the optimal business extension implementation to improve system flexibility and scalability.
[0113] Specifically, the architecture is used to execute the extension instance selection process, which involves parsing the product context, obtaining all candidate extensions, applying routing rules, and selecting the optimal extension instance, and then selecting the optimal extension based on weight and health.
[0114] The product extension router is the core decision engine of the entire framework. It is responsible for dynamically selecting and returning the most suitable extension implementation from numerous candidate implementations at runtime based on specific product context information (such as type, sales model, and channel). Its core goal is to achieve dynamic routing of business logic, improving system flexibility and scalability, and avoiding the rigidity problems caused by hard coding. In specific code design, the main implementation methods can include:
[0115] Context parsing: When business code (such as a product price calculation service) needs to call an extension point (such as a price calculator), it passes the current product context information (ProductContext) to the router's route method. Internally, the router first uses the contextParser component to perform deep parsing of this context information, extracting crucial dimensional information for routing decisions (such as whether the product type is physical or virtual, whether the sales model is regular or flash sale, target sales channels, user characteristics, etc.), and encapsulates this information into a standardized RoutingContext object. This step transforms the raw business data into decision-making criteria that the routing engine can understand.
[0116] Candidate extension discovery: The router queries the extensionRegistry component (usually implemented based on the SPI mechanism) to find all registered candidate extension implementations (ExtensionCandidate) that implement the target extension interface (such as PriceCalculator) in the system. Each candidate extension carries its own metadata information, such as weight, health status, and applicable scope (product type, sales model, etc.) defined by the @ProductExtension annotation.
[0117] Rule Application and Filtering: The router submits the candidate extension list and the resolved routing context to the ruleEngine. The rule engine then filters these candidates based on predefined routing policies (such as the product context-aware routing policy in section 3.3.1 below). A typical rule is to filter out extensions that do not meet the requirements of the current product context (e.g., the current product is virtual, but a candidate extension is only applicable to physical products). This step ensures that only extensions that theoretically meet the requirements of the current scenario will enter the final selection stage.
[0118] Optimal extension selection: For the remaining candidate extensions after filtering, the router calls the internal `selectOptimalExtension` method to score and rank them. The scoring model is multi-dimensional:
[0119] Static weight (weightScore): A static priority configured by developers or operations when extending the definition.
[0120] Dynamic health score: A real-time health status score (such as success rate and response time) of extended instances provided by the monitoring system, reflecting their current operational stability.
[0121] Context matching score (matchScore): This calculates how well the declared scope of the extension instance (from `@ProductExtension`) matches the current actual routing context (RoutingContext). (For example, a perfect match for the product type receives a high score). The router calculates the total score for each candidate extension instance using a weighted summation (e.g., 40% weight, 30% health, and 30% matching score). Finally, the extension instance with the highest total score is returned to the caller.
[0122] Thus, the dynamic decision-making approach breaks free from the limitations of traditional hard-coded if-else statements or strategy pattern enumeration, achieving dynamic and precise routing based on runtime context. Multi-dimensional evaluation integrates static configuration, dynamic runtime status, and business context characteristics for comprehensive decision-making, improving the scientific rigor and adaptability of the selection. The introduction of health factors enables the system to automatically avoid problematic instances when extended instances fail or experience performance degradation, enhancing the overall robustness of the service.
[0123] The product extension container is used to manage the lifecycle and runtime environment of product extension instances, specifically for:
[0124] Responsible for the lifecycle management of extended instances (creation, initialization, destruction, etc.);
[0125] Automatically complete dependency injection and configuration loading, simplifying extension integration;
[0126] It supports dynamic configuration updates, enabling hot reloading and flexible adjustment of extended instances.
[0127] Container characteristics include:
[0128] Lifecycle management: initialization, startup, shutdown, and destruction; resource isolation: CPU, memory, and thread pool isolation; dependency injection: automatic injection of required service dependencies; configuration management: dynamic configuration loading and updating.
[0129] The product extension container manages the entire lifecycle of extension instances and provides them with an isolated and secure runtime environment. It simplifies the access and use of extension instances, implementing lazy loading, caching, dependency injection, configuration loading, and, crucially, hot configuration updates. In specific code design, the main implementation methods may include:
[0130] Instantiation and Lazy Loading: When business code requests an extension instance through the router or by directly calling the container's `getExtension` method, the container first checks if an instance with that name already exists in its internal cache (`extensionInstances`). If not (cache miss), the instantiation process is executed.
[0131] createExtensionInstance: Creates an instance of the extension class based on the extension name and interface type using mechanisms such as reflection.
[0132] Resource isolation: Immediately after instance creation, the resourceIsolator component is invoked to configure resource isolation for that instance. This is to prevent a failure of a single extended instance (such as CPU exhaustion, memory leaks, or thread blocking) from affecting other extended instances within the container or even the host application. Common isolation methods include setting up a separate thread pool, limiting CPU share, or memory quotas.
[0133] Dependency Injection: The dependencyInjector component is invoked to automatically resolve and inject other services or components (such as database access objects, caching clients, other extended interfaces, etc.) that the extension instance depends on. This follows the Inversion of Control (IoC) principle, allowing extension developers to focus solely on declaring the required dependencies without needing to worry about how they are acquired.
[0134] Configuration loading and application: The container loads the configuration items (ExtensionConfig) corresponding to the extension from the configManager (usually interfacing with the configuration center). The loaded configuration is then applied to the extension instance (applyConfig), which is typically achieved by calling specific configuration setting methods on the extension instance or by utilizing configuration binding technology. This allows the behavior of the extension instance to be flexibly adjusted through configuration.
[0135] Initialization: Calls the initialization method (initializeExtension) that the extension instance may define to complete the preparation work required for its startup.
[0136] Cache management: Created, configured, and initialized extension instances are wrapped into `ExtensionInstance` objects, stored in the `extensionInstances` cache, and returned to the caller. Subsequent requests for the same extension will be retrieved directly from the cache, improving performance.
[0137] Dynamic configuration reload (reloadExtension): This is a key capability of containers. When an external configuration center updates the configuration of an extension instance, the operations or system can trigger the container's reloadExtension method. Container execution:
[0138] Reload the latest configuration (newConfig) from configManager.
[0139] Apply the new configuration to the cache instance corresponding to this extension (applyConfig).
[0140] Update the configuration reference (updateConfig) of the ExtensionInstance object in the cache.
[0141] The entire process requires no service restart or instance expansion, and the new configuration takes effect immediately.
[0142] Among these features, lifecycle management standardizes the creation, initialization, and destruction processes of extended instances. Resource isolation improves the overall stability and fault isolation capabilities of the system. Dependency decoupling simplifies extended development and reduces coupling through automatic injection. Hot configuration enables dynamic updates and effects of configurations, greatly improving operational efficiency and system flexibility, meeting the needs of rapid business iteration, and avoiding service restarts caused by configuration changes.
[0143] The Product Extension Monitor is used to monitor the running status and performance metrics of product extension instances in real time. Specific functions include:
[0144] Responsible for monitoring the running status and performance of product extension instances;
[0145] Real-time collection of multi-dimensional indicators such as performance, business, system, and health;
[0146] Supports anomaly alerts and notifications to ensure system stability.
[0147] The performance metrics include QPS, response time, and error rate; the business metrics include product type distribution and strategy hit rate; the system metrics include CPU, memory, and thread usage; and the health metrics include availability and circuit breaker status.
[0148] The product extension monitor is responsible for real-time monitoring of the running status and performance of all product extension instances in the system. It collects multi-dimensional metrics, performs health checks, and triggers alarms or circuit breakers when anomalies occur, making it a key component for ensuring system stability and observability. In specific code design, the main implementation methods may include:
[0149] Metric recording entry (recordInvocation): After each extension is invoked (whether successfully or not), the caller (usually a router or AOP aspect) needs to create an ExtensionInvocationRecord object (containing information such as extension name, call time, success or failure, product context, etc.) and submit it to the monitor's recordInvocation method.
[0150] Basic performance metric collection: The monitor uses the metricsCollector component to record core performance metrics:
[0151] QPS (QueriesPerSecond): Records the number of requests per second, reflecting the scaled load.
[0152] Response Time: Records the time taken for this call, used for performance analysis.
[0153] Error Rate: Records whether the call was successful and calculates the cumulative error rate.
[0154] Business-level metric collection: If the call log contains a product context (ProductContext), the monitor will further record business-related metrics. For example:
[0155] The frequency with which a certain type of product (such as virtual goods) uses a certain extension (such as a specific price calculator).
[0156] Success / failure status of calling a certain extended instance under a specific sales model (such as a flash sale).
[0157] The distribution of calls to extended instances across different business channels (such as App and Mini Program). These business metrics are crucial for understanding the actual performance of extended instances in different business scenarios.
[0158] Health Check: The monitor passes call logs to the healthChecker component for health status assessment. The healthChecker combines recent performance metrics (success rate, response time, call volume, etc.) and applies preset rules (such as consecutive failure count, error rate threshold, slow call ratio) to determine the extension's current health status (HealthStatus): HEALTHY, UNSTABLE, DOWN.
[0159] Exception handling: If the health check returns an unhealthy status (!healthStatus.isHealthy()), the monitor will call the handleUnhealthyExtension method. This method may trigger various actions internally, such as:
[0160] Circuit breaking: Notifies the router to temporarily mark the extension as unavailable to prevent subsequent traffic from causing an avalanche.
[0161] Degradation: Notify the system to switch to an alternative extended implementation or default logic.
[0162] Log the fault information: Record detailed fault information for troubleshooting.
[0163] Alarm Triggering: The monitor determines whether the current call record meets the alarm conditions (such as a sudden increase in error rate, excessively long response time, or a change in health status to DOWN) based on the preset alarm rules (shouldAlert). If the conditions are met, an alarm notification (such as email, SMS, or IM message) is sent to the relevant operations or development personnel via the alertManager component.
[0164] Health Report (getHealthReport): The monitor also provides an interface for external queries of a detailed health report (ExtensionHealthReport) for a specific extension instance. This report integrates performance metrics (ExtensionMetrics), health status (HealthStatus), and performance statistics (PerformanceStats), providing comprehensive data support for operational decisions.
[0165] This module implements panoramic monitoring, covering multiple dimensions such as performance, business, system, and health, providing comprehensive runtime insights. Business correlation links monitoring metrics with specific product business characteristics (type, mode, channel), giving monitoring data clear business meaning and facilitating problem localization based on business scenarios. Automated governance, based on automatic circuit breaking and degradation mechanisms according to health status, is the core of runtime governance, enabling rapid problem isolation and ensuring the stability of core links. Proactive alerts promptly identify potential risks and shorten fault response time.
[0166] This application also involves the modular development of some functionalities.
[0167] For product context-aware routing, the main functions include:
[0168] Intelligent routing is performed based on product context information (such as type, sales model, business channel, etc.);
[0169] The implementation of filtering out the candidates that match the current product features from the expanded pool;
[0170] Sort by priority to ensure the most appropriate extension is selected;
[0171] In addition, it enables dynamic decision-making and precise matching of product scenarios.
[0172] Specifically, this is a core routing strategy used by the router's internal rule engine. It is specifically designed for the product domain, and its core task is to filter and prioritize the candidate extension list based on the input product context information (ProductContext), ensuring that the ultimately selected extension is the most suitable for the current business scenario. In the specific code design, the main implementation methods can include:
[0173] Context retrieval: The strategy extracts the specific business context object, ProductContext, from the RoutingContext. This object contains the specific product information that needs to be processed and its business environment.
[0174] Candidate extension filtering: The strategy applies to the incoming list of candidate extensions (List <ExtensionCandidate <t>>) Perform multiple rounds of filtering, with each round based on a key dimension of the product context:
[0175] Product type matching (matchesProductType): Checks the applicable product type (productType) specified in the metadata of the candidate extension instance (defined via the @ProductExtension annotation). If the extension is declared to be applicable to a specific type (such as VIRTUAL), it is only retained if the product type in the context matches it; if the extension is declared to be ANY (applies to all types), it is always retained.
[0176] Sales Mode MatchesSalesMode: Similarly, check if the applicable sales mode (salesMode) in the extended declaration matches the sales mode in the context. ANY means match all modes.
[0177] Business Channel Matching (matchesBusinessChannel): Checks if the applicable business channel declared in the extension matches the channel in the context. ANY indicates matching all channels. These three layers of filtering (type, pattern, channel) ensure that only extensions that match the current context in terms of business scenario definition will proceed to the next stage. The matching logic for other dimensions (such as region, user characteristics) can be implemented analogously.
[0178] Priority sorting: For candidate extensions that pass the filter, the strategy sorts them in ascending or descending order according to their declared priority (@ProductExtension.order()) (ascending order is used in the example code, with smaller order values having higher priority). This allows developers to set higher priorities for extension implementations that are better suited for different scenarios.
[0179] Results returned: A filtered and sorted list of candidate extensions is returned to the router. The router typically selects the best extension from this list by combining it with other factors (such as health and weight), or if this is the only strategy, it directly selects the first (i.e., the highest priority) extension in the sorted list.
[0180] This enables business scenario-driven routing, clearly defining the core basis for routing decisions as the product's business characteristics (type, mode, channel) rather than purely technical indicators, making routing more aligned with business logic. Declarative configuration uses the `@ProductExtension` annotation to clearly and non-intrusively declare the business scope of extended instances, and the policy automatically parses and applies these declarations. Decoupling and flexibility are provided; this policy, as an independent rule implementation, can be easily replaced or combined with other routing policies (such as weight-based policies).
[0181] For defining and using product extension points, the main functions include:
[0182] Define product extension points and their applicable scope (such as product type, sales model, business channels, etc.) through annotations.
[0183] It provides a unified price calculation extension interface, supporting different types of goods to implement their own calculation logic;
[0184] By utilizing intelligent routing mechanisms, matching extended implementations (such as virtual product price calculators) can be automatically selected based on the product context.
[0185] Product services dynamically acquire appropriate extensions through routers, enabling flexible expansion and decoupling of business logic.
[0186] Therefore, by combining multiple code segments (extension point annotation definitions, extension point interface definitions, extension implementation definitions, and extension usage examples), the complete application flow of the entire product extension framework in actual business scenarios is demonstrated, particularly in the price calculation scenario. In the specific code design, the main implementation methods may include:
[0187] Extended point annotation definition (@ProductExtension):
[0188] This is a meta-annotation (@Retention(RetentionPolicy.RUNTIME) indicates runtime retention, and @Target(ElementType.TYPE) indicates that it applies to a class).
[0189] It defines metadata used to describe the scope of business applications for product extension implementation:
[0190] name: A unique identifier for the extended implementation.
[0191] productType: Applicable product type (e.g., VIRTUAL, PHYSICAL, SERVICE, ANY).
[0192] salesMode: Applicable sales mode (e.g., NORMAL, PRE_SALE, GROUP_BUY, FLASH_SALE, ANY).
[0193] channel: Applicable business channels (such as ONLINE_MALL, OFFLINE_STORE, THIRD_PARTY, ANY).
[0194] order: priority order (the smaller the value, the higher the priority).
[0195] weight: Static weight (used for routing decisions).
[0196] This annotation is a key source of information for the product context-aware routing strategy to perform matching and filtering.
[0197] Extension point interface definition (PriceCalculator):
[0198] Using the @SPI tag (for illustration purposes, the specific SPI mechanism may be Java SPI or a custom implementation) indicates that this is a ServiceProvider Interface.
[0199] The methods that the price calculation extension must implement are defined as follows:
[0200] calculate(Product,User,PriceContext): The core calculation method, which takes the product, user, and price context information as input and returns the calculated price.
[0201] supports(Product, User): A quick way to determine if the calculator supports a given product and user. Routers sometimes call this method for initial screening.
[0202] Extended implementation definition (VirtualProductPriceCalculator):
[0203] Use the @Component annotation (as in the Spring framework) to make it manageable by the container.
[0204] The metadata is declared using the `@ProductExtension` annotation: `name="virtualProductPriceCalculator", productType=ProductType.VIRTUAL, order=1`. This explicitly indicates that the implementation is specifically for virtual products and has a higher priority (`order=1`).
[0205] Implement the PriceCalculator interface:
[0206] The supports method directly checks whether the product type is VIRTUAL, and returns true to indicate that it is supported.
[0207] The calculate method contains the specific logic for calculating the price of virtual goods (e.g., VIP users enjoy a 20% discount).
[0208] Extended usage example (ProductPriceService):
[0209] In the ProductPriceService, the dependency is injected into ProductExtensionRouter.
[0210] When it is necessary to calculate the price of a product, the service method (calculateProductPrice) is used:
[0211] Obtain product information and user information.
[0212] Construct the context (PriceContext) required for price calculation.
[0213] Key steps: Call the router's `route` method, passing in the extension point interface class (`PriceCalculator.class`) and a `ProductContext` object built based on the product and user. The router will intelligently select the most suitable `PriceCalculator` implementation for the current product (e.g., if the product is a virtual product) based on the logic in the associated implementation.
[0214] Call the `calculate` method of the selected calculator instance to perform the final price calculation and return the result.
[0215] This achieves standardized extension definitions, clearly defining the business and technical relationships of extension instances through annotations and interfaces. Business logic is decoupled; the ProductPriceService doesn't need to know which price calculators exist or how to select one. It only depends on the router and the interface. Adding or modifying price calculation rules (such as adding a virtual product discount logic) only requires implementing the new PriceCalculator and adding the @ProductExtension annotation, without modifying the price service code. Dynamic routing demonstrates how the router automatically selects the matching extension implementation (VirtualProductPriceCalculator) based on the product context (here, the product type is virtual product). This presents an end-to-end process from extension definition and implementation to business usage, showcasing the framework's ease of use and value.
[0216] In addition, this paper will continue to introduce the implementation methods of some functional mechanisms in this application.
[0217] For the context-aware extended routing mechanism for goods, an intelligent extended selection method based on multi-dimensional goods features (type, mode, channel, region) is implemented. Specifically, this mechanism quantifies the relationship between the multi-dimensional features of goods and the applicability of extended features, thereby calculating the extended weight score used for routing decisions. It also includes a method to dynamically adjust the priority of extended features based on historical performance. In the specific code design, the main implementation methods may include:
[0218] Calculate ExtensionWeight:
[0219] Input: The metadata of the extension instance (ExtensionMetadata - containing the scope of its @ProductExtension definition) and the features of the current product (ProductFeatures - containing information such as product type, sales model, channel, and region).
[0220] Feature matching score calculation: For each key business feature dimension (product type, sales model, channel, region), a dedicated function (such as calculateTypeMatchScore) is called to calculate the matching score of the extension on that dimension. The calculation logic is usually based on the comparison between the applicable value declared by the extension (such as VIRTUAL) and the actual feature value of the product (a perfect match gets the highest score, an ANY declaration gets the baseline score, and a complete mismatch gets 0 points).
[0221] Weighted summation: Multiply the matching scores of each dimension by their corresponding weight coefficients (e.g., product type matching 30%, sales mode 30%, channel 20%, region 20%), and then sum them to obtain the comprehensive weighted score of the extended instance (returntypeMatch*0.3+modeMatch*0.3+channelMatch*0.2+regionMatch*0.2). This score represents the applicability of the extended instance to the current product in the business scenario. This algorithm is the core method for quantifying multi-dimensional product features and transforming them into routing decision criteria, and is the key difference between intelligent routing and simple rule-based routing.
[0222] Dynamic adjustment of extension priority:
[0223] Input: extension name (extensionName) and routing result (RoutingResult, which may include information such as whether the call was successful).
[0224] Obtain historical metrics: Use the monitor component to obtain recent performance metrics (ExtensionMetrics) for this extension instance, especially the success rate (successRate) and average response time (responseTime).
[0225] Adjustment logic: Based on metrics to judge the recent performance of extended instances:
[0226] If the success rate is too low (e.g., <95%) or the response time is too long (e.g., >1000ms), the priority of the extension instance is reduced by calling priorityManager.decreasePriority(extensionName) (this may involve modifying its @ProductExtension.order value or an internally maintained dynamic priority mapping). This will cause it to be placed later in subsequent route sorting or even filtered out.
[0227] Conversely, if the metric is healthy, call priorityManager.increasePriority(extensionName) to increase its priority, making it more likely to be selected.
[0228] This method enables dynamic adaptability in routing decisions. Instead of relying solely on static configuration, it adjusts the priority of extended instances in real time based on their actual performance (health, performance), allowing the routing policy to automatically adapt to online changes and continuously optimize the selection results.
[0229] This achieves feature quantification and fusion, innovatively quantifying and integrating product business characteristics (type, mode, etc.) into the routing weight calculation, ensuring that routing decisions closely align with business needs. Furthermore, it implements dynamic priority adjustment, introducing a feedback mechanism based on runtime monitoring metrics, enabling the routing system to possess self-learning and adaptive capabilities, continuously optimizing selection results and improving overall system stability and performance. Specific parameters in this code segment are configurable; for example, weight coefficients (30%, 30%, 20%, 20%) and adjustment thresholds (95%, 1000ms) can be configured to adapt to different business scenarios.
[0230] For the gradual canary release mechanism of product extension instances, a method for canary release during the update process of extension instances based on product characteristics and traffic ratios is provided. On one hand, an algorithm for allocating traffic based on product characteristics determines whether a specific product request should proceed with the new version extension; on the other hand, a method for automatically deciding the release process based on monitoring metrics determines whether to continue releasing, pause, or rollback based on the performance of the new version extension instance. In the specific code design, the main implementation methods can include:
[0231] Traffic allocation algorithm (shouldRouteToNewExtension):
[0232] Input: Product ID (productId), Name of the new extension instance (extensionName), Percentage of traffic to be allocated to the new extension instance (percentage).
[0233] Core logic: Perform a hash operation on the product ID (productId.hashCode()), take the absolute value and modulo 100 (Math.abs(...)%100) to get a hash value between 0 and 99.
[0234] Decision: Determine if the hash value is less than percentage * 100. For example, if the percentage is 0.1 (i.e., 10%), requests with hash < 10 will be routed to the new extension (return true), while the remaining 90% of requests will still use the old version. This ensures that traffic distribution is even and predictable.
[0235] In summary, this method uses the product ID itself as the basis for traffic distribution (rather than random or round-robin). This achieves the following results:
[0236] Multiple requests for the same product are always routed to the same extended version (consistency), avoiding inconsistencies in price calculation logic for the same product due to version switching.
[0237] Traffic allocation is precise and controllable, and strictly follows the set ratio.
[0238] It is particularly suitable for gray-scale testing of products, which have a clear business entity.
[0239] Automatic release decision (makeReleaseDecision):
[0240] Input: Release metrics collected during the canary release of the new extension, typically including error rate, response time, success rate, and possible baseline from older versions.
[0241] Decision-making logic: Judgment is made based on a preset business tolerance threshold.
[0242] Rollback: If the error rate is too high (e.g., >1%), it indicates that the new version has serious problems and needs to be rolled back to the old version immediately.
[0243] PAUSE: If the response time deteriorates significantly (e.g., >1.5 times the old version baseline), it indicates that the new version's performance is not up to standard. Pause the expansion of the grayscale range and investigate performance issues first.
[0244] PROCEED: If the success rate is extremely high (e.g., >99.5%), it indicates that the new version is performing well, and the grayscale ratio can be further increased (e.g., from 10% to 30%).
[0245] Hold: If the indicator does not meet the above criteria for "continue" or "deteriorate", then maintain the current grayscale ratio and continue to observe.
[0246] This method enables automated release decisions based on business metrics. It replaces the traditional method that relies on manual judgment, and can more quickly and objectively determine the direction of the release process (continue, pause, rollback) based on the actual performance of the new version (error rate, performance), significantly reducing the risk of canary releases and improving release efficiency and quality.
[0247] This achieves consistent traffic distribution, with the traffic distribution algorithm based on product ID hashing ensuring the consistency of requests for the same product. It also enables automated decision-making; by quantifying business metrics (error rate, response time) and setting threshold rules, it automates and intelligently manages the release process, significantly improving release security and efficiency. Furthermore, it possesses progressive risk control capabilities; combining small-volume canary releases with automated decision-making, it keeps the risks of new versions within a limited scope, achieving truly progressive and controllable releases.
[0248] For the runtime hot configuration mechanism of product extension instances, a method for dynamically loading, validating, and applying product extension configurations is implemented. It focuses on two key aspects of configuration changes: configuration verification before the change and atomic application of the change, ensuring the security and reliability of configuration updates. In the specific code design, the main implementation methods may include:
[0249] Configuration validation (validateConfig):
[0250] Input: The new configuration object (ExtensionConfig) to be applied.
[0251] Validation Levels: Performs multi-level, comprehensive validation and returns a validation result (ValidationResult) containing all the validation questions.
[0252] Syntax validation: Checks whether the configuration text / structure conforms to predefined formatting specifications (such as JSON syntax, XML syntax, the existence of key fields, and the correctness of data types). This is the most basic check.
[0253] Semantic validation (validateBusinessSemantics): Checks whether the values of configuration items are reasonable and valid in terms of business logic. For example:
[0254] Is a certain timeout threshold set too high or too low?
[0255] Will the configured switch combinations cause any contradictions?
[0256] Does the configured value comply with the business rule constraints?
[0257] Dependency validation (validateDependencies): Checks whether the conditions on which the new configuration depends are met. For example:
[0258] The configuration references another extension or service. Is that dependency available?
[0259] If configuration item A is enabled, does that require item B to also be enabled?
[0260] This method provides a comprehensive configuration verification mechanism to detect potential problems (syntax errors, business conflicts, missing dependencies) before the configuration takes effect, thus preventing online failures caused by incorrect configurations. It is the first line of defense for hot configuration security.
[0261] Atomicity (applyConfigAtomically):
[0262] Input: The target extension instance (ExtensionInstance) and the validated new configuration (newConfig).
[0263] Core process:
[0264] Create Snapshot: Creates a snapshot of the current configuration state (ConfigSnapshot) before applying new configuration. This is similar to the BEGIN operation in database transactions.
[0265] Try applying the new configuration (applyNewConfig): Apply the new configuration to the extended instance.
[0266] ValidateConfigEffect: After the new configuration is applied, necessary checks are performed to verify that the new configuration has truly taken effect and is functioning correctly. This may include:
[0267] Call a method of the extended instance to check if its internal state matches the new configuration expectations.
[0268] Send a test request to verify that the function works according to the new configuration and without any errors.
[0269] Verification failure handling: If the verification fails, immediately perform a rollback (rollbackToSnapshot) operation to restore the extended instance's state to the snapshot point and throw an exception to terminate the change. This ensures that the system state will not remain in an unknown intermediate state when verification fails.
[0270] Commit ConfigurationChange: If the validation passes, the configuration change is officially committed (e.g., updating the configuration reference in the cache, persisting the new configuration). This is similar to the COMMIT statement in a database transaction.
[0271] Exception rollback (catch block): If any unexpected exception occurs during the application of new configuration or verification, a rollback operation is also performed to restore the system to the snapshot state, ensuring system consistency.
[0272] This method achieves atomicity for configuration changes. Through snapshot and rollback mechanisms, it ensures that configuration changes either succeed completely (verification passes and is committed) or fail completely (verification fails or an exception occurs and a rollback occurs). The system is always in a known and consistent state, avoiding the possibility of services being in an uncertain or partially effective erroneous state due to configuration changes, thus greatly improving the reliability and security of hot configuration.
[0273] This achieves security verification before changes, and multi-layered configuration verification (syntax, semantics, dependencies) is a key guarantee against deploying erroneous configurations. It implements transactional activation, with a snapshot + verification + commit / rollback process, ensuring the atomicity of configuration changes. This is the core technical guarantee for the secure and reliable operation of hot configurations in production environments. These two points together ensure the high reliability of the solution and business continuity during hot configuration updates.
[0274] This application ensures accurate adaptation of extended instances to product business scenarios by acquiring product routing information and dynamically calculating matching parameters based on multi-dimensional features. It achieves intelligent optimization of extended instances through a comprehensive weighted scoring mechanism that integrates static weights, health scores, and matching parameters, fundamentally improving the accuracy and adaptability of business logic execution. Target extended instances are injected into the main process and their operational status is monitored in real time, forming a closed-loop governance system. This effectively solves the problems of poor scalability and chain reactions caused by modifications in traditional architectures due to hard coding, significantly improving the system's flexibility and maintainability. Simultaneously, the dynamic adjustment mechanism ensures continuous and efficient instance operation, reduces the risk of fault propagation, and provides lightweight support for business evolution.
[0275] As an optional implementation, the method is also used for the gradual gray-scale release of each of the target extended instances, wherein the target extended instances include the original instance and the new instance, and the gradual gray-scale release specifically includes:
[0276] Based on the product routing information, determine the product hash value;
[0277] Based on the product hash value, determine the proportion of traffic allocated to the new instance;
[0278] Monitor the error rate and response time of the new instance:
[0279] Based on the error rate and the response time, adjust the operation mode of the new instance;
[0280] The specific methods for adjusting the traffic ratio include version rollback, pausing debugging, increasing the ratio, or maintaining observation.
[0281] This implementation method allocates traffic proportions to new instances based on product hash values, achieving fine-grained traffic control. By monitoring core metrics such as error rate and response time, it dynamically adjusts the operating mode (rollback, pause, expansion, etc.) to ensure the controllability of the gray-scale process. This mechanism supports small-scale pilot verification, avoids the risks of full release, and combines gradual iteration with business feedback, significantly reducing the impact of new feature launches on stability and improving the security and efficiency of version delivery.
[0282] As an optional implementation, the method further includes dynamically adjusting the comprehensive weight score, specifically including:
[0283] During the first time period, obtain the unit time call volume, success rate and response time of each optional extended instance;
[0284] When the success rate is lower than the first preset ratio, or the response time exceeds the first threshold, the comprehensive weight score is reduced by the second preset ratio.
[0285] This implementation method evaluates the performance of extended instances in real time by statistically analyzing the number of calls per unit time, success rate, and response time. When the success rate falls below a preset ratio or the response exceeds a threshold, the overall weight score is automatically reduced proportionally to decrease traffic allocation to low-quality instances. This mechanism dynamically optimizes routing decisions, prioritizing high-performance instances to improve service response speed and success rate, while also passively isolating problematic instances and strengthening the system's adaptive fault tolerance.
[0286] This application also provides a device for dynamic management of product extension instances, including:
[0287] The acquisition module is used to obtain the product routing information corresponding to the target product;
[0288] The product routing information is used to determine the matching degree parameter between each target product and each optional extended instance;
[0289] The processing module is used to calculate the comprehensive weight score corresponding to each of the optional extended instances, and to filter the target extended instance from each of the optional extended instances based on the comprehensive weight score;
[0290] The comprehensive weight score is calculated based on the static weight parameter, the extended instance health parameter, and the matching degree parameter.
[0291] The processing module is also used to inject the target extended instance into the main business process;
[0292] The processing module is also used to monitor the running parameters of the target extended instance in real time and dynamically adjust the running status of the target extended instance.
[0293] This implementation method acquires product routing information and dynamically calculates matching parameters based on multi-dimensional features to ensure accurate adaptation of extended instances to product business scenarios. By integrating static weights, health scores, and matching parameters through a comprehensive weighted scoring mechanism, it achieves intelligent optimization of extended instances, fundamentally improving the accuracy and adaptability of business logic execution. Target extended instances are injected into the main process and their operational status is monitored in real time, forming a closed-loop governance system. This effectively solves the problems of poor scalability and chain reactions caused by modifications due to hard coding in traditional architectures, significantly improving the system's flexibility and maintainability. Simultaneously, the dynamic adjustment mechanism ensures continuous and efficient instance operation, reduces the risk of fault propagation, and provides lightweight support for business evolution.
[0294] As an optional implementation, the specific method by which the processing module injects the target extended instance into the main business process includes:
[0295] Create the target extension instance;
[0296] Configure resource isolation and dependency injection for the target extended instance, and update the configuration items corresponding to the target extended instance;
[0297] Based on the configuration items, load the target extended instance and inject it into the main business process.
[0298] This implementation avoids resource contention between multiple instances and ensures the stability of core business processes by creating a target extended instance and performing resource isolation configuration. A dependency injection mechanism automatically assembles service components, reducing manual configuration costs and mitigating coupling risks. The configuration update process employs memory snapshots and multi-level verification (syntax, semantics, dependencies) to ensure the atomicity and security of changes, and allows for rapid rollback in case of verification failure, eliminating system interruptions caused by configuration errors. Finally, the instance is loaded based on the updated configuration items, achieving seamless integration of extended capabilities and improving the reliability and execution efficiency of the main business processes.
[0299] As an optional implementation, the specific method by which the processing module updates the configuration items corresponding to the target extended instance includes:
[0300] Create a memory snapshot of the current configuration item;
[0301] Load the new configuration item and perform syntax validation, semantic validation, and dependency validation on the new configuration item;
[0302] The syntax validation is used to check the executableness of the statement structure of the new configuration item; the semantic validation is used to verify the business rationality of the parameter values and text items in the new configuration item; and the dependency validation is used to confirm the service relevance of the new configuration item.
[0303] After all the syntax validation, semantic validation, and dependency validation have passed, the configuration change is submitted, the target extended instance configuration item is updated based on the new configuration item, and if any of the syntax validation, semantic validation, or dependency validation fails, the rollback is performed based on the memory snapshot, and the target extended instance configuration item is restored based on the current configuration item.
[0304] This implementation preserves the current configuration state by creating a memory snapshot, providing a reliable baseline for rollback. Added syntax validation ensures configuration statements are executable, semantic validation verifies the rationality of parameters and business logic, and dependency validation confirms service relevance. This triple validation mechanism comprehensively ensures the accuracy of configuration changes from both technical and business layers. Changes are only submitted after all validations pass; otherwise, rollback is based on the snapshot, preventing invalid or conflicting configurations from polluting the operating environment. This process significantly reduces system risks caused by configuration updates, supports hot reloading requirements, ensures service continuity, and improves operational security.
[0305] As an optional implementation, the product routing information includes product type, sales model, business channel, user characteristics, and geographic information. The specific method by which the processing module determines the matching degree parameter includes:
[0306] Parse the product routing information and generate structured routing features;
[0307] The structured routing features include text-based features, encoded features, or parameter-based features;
[0308] Based on the data format of the structured routing features, the routing parameters for each dimension are determined, and the matching degree parameter is obtained by weighted calculation based on each of the routing parameters.
[0309] This implementation method parses product routing information to generate structured features (text, encoded, and parameter forms), unifying the processing standards for multi-source heterogeneous data. Based on these features, it extracts routing parameter dimensions and quantifies the matching degree through weighted calculations, transforming business characteristics such as product type, sales model, and channel into calculable indicators, thus achieving objectivity and refinement in routing decisions. This approach enhances the scalability of routing rules, adapts to multiple scenario requirements, lays a data foundation for accurate matching of extended instances, and improves the flexibility and accuracy of business strategies.
[0310] As an optional implementation, the processing module monitors the operating parameters of the target extended instance in real time and dynamically adjusts the operating state of the target extended instance in the following ways:
[0311] During the operation of the target extended instance, system performance parameters and related service parameters are obtained;
[0312] Based on the system performance parameters and the business parameters, determine the operational health parameters of the target extended instance, and execute the preset exception handling process and / or alarm process according to the operational health parameters;
[0313] In addition, an extended instance running report is generated and pushed to a preset terminal.
[0314] This implementation method collects system performance and business parameters in real time, and monitors the operational status of target extended instances from multiple dimensions. Based on these parameters, it dynamically calculates operational health parameters, triggers preset anomaly handling processes (such as circuit breaking and degradation) and alarm processes, enabling rapid fault location and self-healing. The generation and push of extended instance operation reports provide real-time data support for operational and maintenance decisions. This mechanism effectively prevents the spread of localized faults, ensures high business availability, reduces manual maintenance costs, and improves overall system stability.
[0315] As an optional implementation, the processing module is also used for the gradual canary release of each of the target extended instances, the target extended instances including the original instance and the new instance, and the specific method by which the processing module performs the gradual canary release includes:
[0316] Based on the product routing information, determine the product hash value;
[0317] Based on the product hash value, determine the proportion of traffic allocated to the new instance;
[0318] Monitor the error rate and response time of the new instance:
[0319] Based on the error rate and the response time, adjust the operation mode of the new instance;
[0320] The specific methods for adjusting the traffic ratio include version rollback, pausing debugging, increasing the ratio, or maintaining observation.
[0321] This implementation method allocates traffic proportions to new instances based on product hash values, achieving fine-grained traffic control. By monitoring core metrics such as error rate and response time, it dynamically adjusts the operating mode (rollback, pause, expansion, etc.) to ensure the controllability of the gray-scale process. This mechanism supports small-scale pilot verification, avoids the risks of full release, and combines gradual iteration with business feedback, significantly reducing the impact of new feature launches on stability and improving the security and efficiency of version delivery.
[0322] As an optional implementation, the processing module is also used to dynamically adjust the comprehensive weight score, specifically in the following ways:
[0323] During the first time period, obtain the unit time call volume, success rate and response time of each optional extended instance;
[0324] When the success rate is lower than the first preset ratio, or the response time exceeds the first threshold, the comprehensive weight score is reduced by the second preset ratio.
[0325] This implementation method evaluates the performance of extended instances in real time by statistically analyzing the number of calls per unit time, success rate, and response time. When the success rate falls below a preset ratio or the response exceeds a threshold, the overall weight score is automatically reduced proportionally to decrease traffic allocation to low-quality instances. This mechanism dynamically optimizes routing decisions, prioritizing high-performance instances to improve service response speed and success rate, while also passively isolating problematic instances and strengthening the system's adaptive fault tolerance.
[0326] It should be noted that the division of the various modules in the above device is merely a logical functional division. In actual implementation, they can be fully or partially integrated into a single physical entity, or they can be physically separated. Furthermore, these modules can be implemented entirely in software via processing element calls; they can be fully implemented in hardware; or some modules can be implemented by processing element calls to software, while others are implemented in hardware. For example, a processing module can be a separate processing element, or it can be integrated into a chip within the device. Alternatively, it can be stored as program code in the device's memory, and its functions can be called and executed by a processing element. The implementation of other modules is similar. Moreover, these modules can be fully or partially integrated together, or they can be implemented independently. The processing element here can be an integrated circuit with signal processing capabilities. During implementation, each step of the above method or each of the above modules can be completed through integrated logic circuits in the hardware of the processor element or through software instructions.
[0327] Indicatively, such as Figure 3 As shown, Figure 3 This is a schematic diagram of the internal structure of a computer device 300 provided in an embodiment of this application. The computer device 300 can be provided as a server. (Refer to...) Figure 3 The computer device 300 includes a processing component 302, which further includes one or more processors, and memory resources represented by memory 301 for storing instructions, such as application programs, that can be executed by the processing component 302. The application programs stored in memory 301 may include one or more modules, each corresponding to a set of instructions. Furthermore, the processing component 302 is configured to execute instructions to perform the methods of any of the embodiments described above.
[0328] The computer device 300 may also include a power supply component 303 configured to perform power management of the computer device 300, a wired or wireless network interface 304 configured to connect the computer device 300 to a network, and an input / output (I / O) interface 305. The computer device 300 may operate on an operating system stored in memory 301, such as Windows Server™, MacOSX™, Unix™, Linux™, FreeBSD™, or similar.
[0329] Those skilled in the art will understand that Figure 3 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0330] This application provides a storage medium storing computer-readable instructions that, when executed by one or more processors, cause the one or more processors to perform the method provided in any embodiment.
[0331] Finally, it should be noted that in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0332] The various embodiments in this specification are described in a progressive manner. Each embodiment focuses on the differences from other embodiments. The various embodiments can be combined as needed, and the same or similar parts can be referred to each other.
[0333] The above description of the disclosed embodiments enables those skilled in the art to make or use this application. Various modifications to these embodiments will be readily apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of this application. Therefore, this application is not to be limited to the embodiments shown herein, but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.< / t>
Claims
1. A method for dynamic management of product extended instances, characterized in that, include: Obtain the product routing information corresponding to the target product; The product routing information is used to determine the matching degree parameter between each target product and each optional extended instance; Calculate the comprehensive weight score corresponding to each of the optional extension instances, and select the target extension instance from each of the optional extension instances based on the comprehensive weight score; The comprehensive weight score is calculated based on the static weight parameter, the extended instance health parameter, and the matching degree parameter. Inject the target extended instance into the main business process; The system monitors the running parameters of the target extended instance in real time and dynamically adjusts the running status of the target extended instance.
2. The method according to claim 1, characterized in that, Injecting the target extended instance into the main business process includes: Create the target extension instance; Configure resource isolation and dependency injection for the target extended instance, and update the configuration items corresponding to the target extended instance; Based on the configuration items, load the target extended instance and inject it into the main business process.
3. The method according to claim 2, characterized in that, The update of the configuration items corresponding to the target extended instance includes: Create a memory snapshot of the current configuration item; Load the new configuration item and perform syntax validation, semantic validation, and dependency validation on the new configuration item; The syntax validation is used to check the executableness of the statement structure of the new configuration item; the semantic validation is used to verify the business rationality of the parameter values and text items in the new configuration item; and the dependency validation is used to confirm the service relevance of the new configuration item. After all the syntax validation, semantic validation, and dependency validation have passed, the configuration change is submitted, the target extended instance configuration item is updated based on the new configuration item, and if any of the syntax validation, semantic validation, or dependency validation fails, the rollback is performed based on the memory snapshot, and the target extended instance configuration item is restored based on the current configuration item.
4. The method according to claim 1, characterized in that, The product routing information includes product type, sales model, business channel, user characteristics, and geographic information. The matching degree parameter is determined in the following ways: Parse the product routing information and generate structured routing features; The structured routing features include text-based features, encoded features, or parameter-based features; Based on the data format of the structured routing features, the routing parameters for each dimension are determined, and the matching degree parameter is obtained by weighted calculation based on each of the routing parameters.
5. The method according to claim 1, characterized in that, The real-time monitoring of the operating parameters of the target extended instance and the dynamic adjustment of the operating status of the target extended instance include: During the operation of the target extended instance, system performance parameters and related service parameters are obtained; Based on the system performance parameters and the business parameters, determine the operational health parameters of the target extended instance, and execute the preset exception handling process and / or alarm process according to the operational health parameters; In addition, an extended instance running report is generated and pushed to a preset terminal.
6. The method according to any one of claims 1-5, characterized in that, The method is also used for the progressive canary release of each of the target extended instances, wherein the target extended instances include the original instance and the new instance, and the progressive canary release specifically includes: Based on the product routing information, determine the product hash value; Based on the product hash value, determine the proportion of traffic allocated to the new instance; Monitor the error rate and response time of the new instance: Based on the error rate and the response time, adjust the operation mode of the new instance; The specific methods for adjusting the traffic ratio include version rollback, pausing debugging, increasing the ratio, or maintaining observation.
7. The method according to any one of claims 1-5, characterized in that, The method also includes dynamically adjusting the comprehensive weight score, specifically including: During the first time period, obtain the unit time call volume, success rate and response time of each optional extended instance; When the success rate is lower than the first preset ratio, or the response time exceeds the first threshold, the comprehensive weight score is reduced by the second preset ratio.
8. A dynamic management device for product extended instances, characterized in that, include: The acquisition module is used to obtain the product routing information corresponding to the target product; The product routing information is used to determine the matching degree parameter between each target product and each optional extended instance; The processing module is used to calculate the comprehensive weight score corresponding to each of the optional extended instances, and to filter the target extended instance from each of the optional extended instances based on the comprehensive weight score; The comprehensive weight score is calculated based on the static weight parameter, the extended instance health parameter, and the matching degree parameter. The processing module is also used to inject the target extended instance into the main business process; The processing module is also used to monitor the running parameters of the target extended instance in real time and dynamically adjust the running status of the target extended instance.
9. A computer device, characterized in that, The method includes one or more processors and a memory storing computer-readable instructions that, when executed by the one or more processors, perform the steps of the method as described in any one of claims 1-7.
10. A storage medium, characterized in that, The storage medium stores computer-readable instructions that, when executed by one or more processors, cause the one or more processors to perform the steps of the method as described in any one of claims 1-7.