A large model gateway routing cache control method and device, equipment and medium
By determining the minimum route dependency closure and constructing immutable shared dependency blocks, the problem of full snapshots of gateway routes is solved, enabling precise limitation of the impact of configuration changes and physical reuse of common configurations, thus ensuring the integrity and security consistency of the route execution plan.
Patent Information
- Application Number
- CN202611437183.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-09-16
- Publication Date
- 2026-11-27
AI Technical Summary
The existing gateway routing full snapshot mechanism causes partial configuration changes to trigger the reconstruction of all routing data, resulting in a mismatch between the update scope and the actual scope of affected requests; full inline unit storage leads to a large amount of duplicate storage of common configurations; direct reference to shared cache undermines the validity of unit versions; ordinary content-addressed storage cannot verify the integrity of logical units; security changes such as key revocation are prone to partial effectiveness, making it difficult to balance storage reuse, version isolation, accurate change push and security consistency.
By determining the minimum routing dependency closure, constructing an immutable shared dependency block and a candidate unit list, and performing atomic activation of ordinary changes and batch atomic activation of safety-critical changes, the integrity and consistency of the routing execution plan are ensured.
It achieves precise limitation of the impact of configuration changes, avoids full rebuilds, reduces the scale of rebuilds and computational overhead, ensures physical reuse and version isolation of common configurations, guarantees security consistency and fault isolation, and improves the stability and security of configuration processing.
Smart Images

Figure CN123185136A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of gateway control technology, and more specifically, to a method, apparatus, device, and medium for controlling routing cache in a large-scale gateway. Background Technology
[0002] The enterprise large-scale model gateway serves as a unified access hub for various internal business systems accessing external large-scale model services, undertaking request routing and forwarding capabilities. Internally, the gateway maintains multiple sets of static routing configurations, covering logical business models, candidate service channels, large-scale model vendor access addresses, authentication keys, vendor-side model identifiers, protocol conversion rules, and channel primary / backup and quota management information. Logical models corresponding to different businesses can reuse the same vendor address, authentication materials, and protocol configuration. When a business request arrives at the gateway, the gateway matches the corresponding routing configuration based on the request information, filters available upstream service channels, completes protocol adaptation and authentication processing, distributes the business request to the target large-scale model service provider, and simultaneously performs pre-processing such as traffic control and channel scheduling, enabling unified scheduling and access to heterogeneous large-scale model services in multi-business and multi-tenant scenarios.
[0003] In related technologies, the existing gateway routing full snapshot mechanism will trigger the reconstruction of all routing data due to local configuration changes, and the update scope does not match the actual scope of affected requests; although the use of complete inline unit storage has version isolation capabilities, it will cause a large amount of duplicate storage of common configurations such as supplier addresses, authentication materials, and protocol configurations; directly referencing shared caches that can be modified in place will destroy the validity of unit versions, making it impossible to reproduce historical configurations; ordinary content-addressed storage only realizes data deduplication and cannot complete the integrity verification of multiple physical objects after splitting, and the lack of a precise dependency propagation mechanism for shared entity changes makes it easy to miss units to be updated; security changes such as key revocation are more likely to cause partial effectiveness among multiple units, and failures during configuration reading will also produce static parameter combinations of old and new versions, making it difficult to meet the comprehensive requirements of storage reuse, version isolation, accurate change push, security consistency and fault isolation. Summary of the Invention
[0004] The present invention aims to solve at least one of the above-mentioned problems.
[0005] To address the aforementioned problems, this invention provides a method, apparatus, device, and medium for controlling routing cache in large-scale gateways.
[0006] In a first aspect, the present invention provides a method for controlling routing cache in a large-scale gateway, comprising: Determine the minimum route dependency closure based on the request route key corresponding to the revision change event; Based on the minimum routing dependency closure, construct and verify an immutable shared dependency block and a candidate unit list to obtain a shared block ready credential and a list completion identifier. Based on the shared block ready credential and the list completion identifier, perform atomic activation for ordinary changes and batch atomic activation for safety-critical changes respectively, and determine the current activity descriptor; Based on the user request, the corresponding immutable shared dependency block and the activated unit list are loaded according to the current activity descriptor, and then verified and encapsulated to obtain the routing execution plan.
[0007] Optionally, determining the minimum route dependency closure based on the request route key corresponding to the revision change event includes: Determine the reverse dependency index based on the aforementioned revision change event; Based on the reverse dependency index, the set of reference request keys before the change, and the set of reference request keys after the change, determine the set of affected request routing keys; The logical closure corresponding to the set of affected request routing keys is read in the same read-only consistent view to obtain the minimum routing dependency closure.
[0008] Optionally, the step of constructing and verifying an immutable shared dependency block and a candidate unit list based on the minimum routing dependency closure to obtain a shared block ready credential and a list completion identifier includes: The minimum route dependency closure is divided into exclusive fields and shared configurations; The immutable shared dependency block and the candidate unit list are constructed based on the exclusive field and the shared configuration, respectively. The immutable shared dependency block and the candidate unit list are verified respectively to obtain the shared block ready credential and the list completion identifier.
[0009] Optionally, the step of performing atomic activation for general changes and batch atomic activation for safety-critical changes based on the shared block ready credential and the inventory completion identifier, respectively, to determine the current activity descriptor, includes: When a normal change is activated atomically, an atomic operation verification is performed. If the verification passes, the active descriptor of the request routing key corresponding to the shared block ready credential and the list completion identifier is switched as the current active descriptor. If the verification fails, the corresponding original active descriptor is used as the current active descriptor. When a safety-critical change is activated in a batch atomic operation, all the shared block ready credentials and the candidate list corresponding to the list completion identifier are verified in the same atomic control operation. If all verifications pass, the corresponding active descriptor of the request routing key is switched in batches as the current active descriptor. If not all verifications pass, all the corresponding original active descriptors are used as the current active descriptors.
[0010] Optionally, the step of loading the corresponding immutable shared dependency block and the activated unit list according to the current activity descriptor based on the user request, and verifying and encapsulating them to obtain the routing execution plan includes: Based on the user request, extract the user request routing key and query the user activity descriptor corresponding to the user request routing key; Load the corresponding immutable shared dependency block and the activated unit list according to the user activity descriptor; Perform integrity and security checks on the corresponding immutable shared dependency blocks and the activated unit list. If the check fails, perform a local rollback process. After successful verification, the dynamic state is sampled independently, a candidate ranking is formed and encapsulated to obtain the routing execution plan.
[0011] Optionally, the local rollback process includes: Remove all current static parameters, re-extract the user descriptor based on the user request routing key, load the corresponding immutable shared dependency block and the activated unit list, and perform integrity and security checks.
[0012] Optionally, after obtaining the routing execution plan, the method further includes: Based on the delayed reclamation mechanism, shared blocks that do not meet the reachability protection scope of shared blocks are deleted.
[0013] Secondly, the present invention provides a large-scale gateway routing cache control device, comprising: The closure module is used to determine the minimum route dependency closure based on the request routing key corresponding to the revision change event; The construction module is used to construct and verify an immutable shared dependency block and a candidate unit list based on the minimum routing dependency closure, and obtain a shared block ready credential and a list completion identifier. The activation module is used to perform atomic activation of ordinary changes and batch atomic activation of safety-critical changes based on the shared block ready credential and the list completion identifier, and to determine the current activity descriptor; The planning module is used to load the corresponding immutable shared dependency block and the activated unit list according to the current activity descriptor based on the user request, and to verify and encapsulate them to obtain the routing execution plan.
[0014] Thirdly, the present invention provides an electronic device, including a memory and a processor; The memory is used to store computer programs; The processor is configured to implement the large-model gateway routing cache control method as described in the first aspect when executing the computer program.
[0015] Fourthly, the present invention provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the large-model gateway routing cache control method as described in the first aspect.
[0016] The beneficial effects of the large-scale gateway routing cache control method, apparatus, device, and medium of the present invention are: Based on the request routing key corresponding to the revision change event, the minimum routing dependency closure is determined. This allows for precise limitation of the impact of configuration changes to the set of request routing keys that actually depend on the change, using the minimum set of static configuration dependencies corresponding to the request routing key as the change boundary. This replaces the traditional global reconstruction mode of full snapshots, solving the problem of mismatch between the update scope and the actual affected request scope in existing technologies, and significantly reducing the reconstruction scale and computational overhead of a single configuration change. Furthermore, based on the minimum routing dependency closure, immutable shared dependency blocks and candidate unit lists are constructed, and shared block readiness credentials and list completion identifiers are verified. On one hand, common configurations are encapsulated into immutable shared dependency blocks to achieve physical reuse among multiple request routing keys, solving the problem of large-scale duplicate storage of common configurations in the full inline unit mode. Simultaneously, the immutability avoids the defects of unit version invalidation and the inability to reproduce historical configurations caused by in-situ modifications of shared configurations. On the other hand, through joint verification of readiness credentials and completion identifiers, the integrity proof of the logical closure across multiple physical objects after splitting is completed, compensating for the limitations of ordinary content-addressed storage. This approach addresses the shortcomings of data deduplication and the inability to verify the integrity of logical units. Subsequently, based on the shared block ready credential and list completion identifier, atomic activation for ordinary changes and batch atomic activation for security-critical changes are performed to determine the current activity descriptor. This leverages the dependency propagation mechanism to accurately cover all affected units, preventing omissions of units to be updated when shared entities are changed. Simultaneously, through a hierarchical atomic activation mode, ordinary changes are switched independently for each unit to narrow the scope of effect, while security-critical changes are switched synchronously in batches to ensure consistent effectiveness across all affected units, eliminating the risk of partial effectiveness of security changes such as key revocation across multiple units. Finally, based on the user request, the corresponding immutable shared dependency block and the activated unit list are loaded according to the current activity descriptor, and the routing execution plan is obtained through verification and encapsulation. This allows for the assembly and consistency verification of complete logical units on the request side, ensuring that all static configurations originate from a unified source and match versions. This avoids issues such as mixing old and new versions and splicing parameters across sources caused by configuration read failures. This achieves a comprehensive effect of version isolation, accurate change push, security consistency, and fault isolation while realizing storage reuse. Attached Figure Description
[0017] Figure 1 A flowchart illustrating the large-model gateway routing cache control method provided in an embodiment of the present invention; Figure 2This is a schematic diagram of the structure of the large-model gateway routing cache control device provided in an embodiment of the present invention; Figure 3 This is a schematic diagram of the structure of an electronic device provided in an embodiment of the present invention. Detailed Implementation
[0018] To make the above-mentioned objects, features, and advantages of the present invention more apparent and understandable, specific embodiments of the present invention will be described in detail below with reference to the accompanying drawings. Although some embodiments of the present invention are shown in the drawings, it should be understood that the present invention can be implemented in various forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided to provide a more thorough and complete understanding of the present invention. It should be understood that the accompanying drawings and embodiments of the present invention are for illustrative purposes only and are not intended to limit the scope of protection of the present invention.
[0019] It should be understood that the various steps described in the method embodiments of the present invention may be performed in different orders and / or in parallel. Furthermore, the method embodiments may include additional steps and / or omit the steps shown. The scope of the present invention is not limited in this respect.
[0020] The term "comprising" and its variations as used herein are open-ended, meaning "including but not limited to"; the term "based on" means "at least partially based on"; the term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments"; and the term "optionally" means "optional embodiments". Definitions of other terms will be given in the following description. It should be noted that the concepts of "first," "second," etc., mentioned in this invention are used only to distinguish different devices, modules, or units, and are not intended to limit the order of functions performed by these devices, modules, or units or their interdependencies.
[0021] It should be noted that the terms "a" and "a plurality of" used in this invention are illustrative rather than restrictive. Those skilled in the art should understand that, unless otherwise expressly indicated in the context, they should be understood as "one or more".
[0022] The names of the messages or information exchanged between the multiple devices in the embodiments of the present invention are for illustrative purposes only and are not intended to limit the scope of these messages or information.
[0023] The specific meanings of the core terms in this specification are as follows: Static routing configuration refers to the configuration that determines the upstream call target and call parameters and does not change in real time with a single request. It includes the logical model, candidate channels, vendor address, authentication materials, vendor model name, protocol conversion parameters, channel primary / backup order, and static quota configuration. The request routing key is an identifier generated based on fields that can reliably determine the routing configuration range in a single request. It includes at least the logical model name and may also include the tenant identifier, request protocol type, region constraints, or data boundary constraints. The minimum routing dependency closure is the minimum set of static configurations necessary to fully form the candidate upstream call parameters, derived from the logical model corresponding to the request routing key and following the reference relationships between the model, channel, vendor, authentication materials, vendor model, and protocol configuration. A logical route snapshot unit is a versioned logical object indexed by a request route key and containing business content based on the minimum route dependency closure. Its physical content can be stored inline or composed of a unit manifest and immutable shared dependency blocks. The unit manifest is an immutable metadata object that records the request route key, unit version, unique static fields, shared block reference list, dependency digest, security generation, shared block set digest, ready credential identifier, and completion identifier. An immutable shared dependency block is a static configuration block referenced by one or more request route keys. It is uniquely identified by a content digest, entity identifier, and revision number or a combination thereof. Once written, it cannot be overwritten in situ; a new block identifier is generated when the content changes. A shared block reference is a reference to an immutable shared dependency block in the unit manifest. The declaration must include at least the block type, block identifier, content digest, entity revision number, schema version, and security domain information; the shared block readiness certificate is metadata proving that all referenced shared blocks exist and pass the digest, type, revision number, security domain, and schema version verifications before the candidate list is activated; the reverse dependency index is a data structure that maps static route entity identifiers to a set of request route keys referencing that entity, used to determine the list of units that must be rebuilt when the entity changes; the affected unit set is the set of request route keys calculated based on the reverse dependency index, the reference relationships before the change, and the reference relationships after the route entity changes; the unit version is a version identifier that monotonically increases or irreversibly evolves for the same request route key, and different request routes... The cell versions of the keys are independent of each other; the dependency digest is a normalized digest of exclusive fields, shared block references, entity revision numbers, candidate order, and key execution fields, used to prove that the logical cell content matches the dependency set; the security generation is a global or grouped generation identifier used to constrain security-critical changes such as key revocation, vendor deactivation, and trusted address changes; the activity descriptor is the control metadata of the logical cells currently visible to the request routing key, which includes at least the cell version, cell manifest identifier or digest, security generation, and activation sequence; the side effect barrier is the state boundary from the static configuration resolution phase without side effects to the RPM counting, authentication material submission, network connection, or upstream call phase, and can only be crossed after the complete plan enters the SEALED state.
[0024] In related technologies, the existing gateway routing full snapshot mechanism will trigger the reconstruction of all routing data due to local configuration changes, and the update scope does not match the actual scope of affected requests; although the use of complete inline unit storage has version isolation capabilities, it will cause a large amount of duplicate storage of common configurations such as supplier addresses, authentication materials, and protocol configurations; directly referencing shared caches that can be modified in place will destroy the validity of unit versions, making it impossible to reproduce historical configurations; ordinary content-addressed storage only realizes data deduplication and cannot complete the integrity verification of multiple physical objects after splitting, and the lack of a precise dependency propagation mechanism for shared entity changes makes it easy to miss units to be updated; security changes such as key revocation are more likely to cause partial effectiveness among multiple units, and failures in configuration reading will also produce static parameter combinations of old and new versions. At the same time, the recycling logic of shared configurations is prone to accidentally deleting resources that are being requested, making it difficult to meet the comprehensive requirements of storage reuse, version isolation, accurate change push, security consistency and fault isolation.
[0025] To address the problems existing in the aforementioned related technologies, this embodiment provides a method, apparatus, device, and medium for controlling routing cache in a large-scale gateway.
[0026] like Figure 1 As shown in the figure, an embodiment of the present invention provides a large-model gateway routing cache control method, including: Determine the minimum route dependency closure based on the request route key corresponding to the revision change event.
[0027] Specifically, when a route configuration revision event occurs, all request routing keys associated with the change event are first located. Starting with each affected request routing key, a complete traversal is performed along the reference relationships of the logical model, candidate channels, vendors, authentication materials, vendor models, and protocol configurations to extract the minimum configuration set that can completely form all the static parameters required for the upstream call corresponding to that request routing key, i.e., the minimum route dependency closure. Revision change events include various static route configuration modification events such as vendor address updates, authentication material rotations, and protocol parameter adjustments. Using the request routing key as the smallest granularity logical index, each request routing key corresponds to an independent minimum route dependency closure. The closure only contains configuration items directly related to the route execution of that request routing key, without missing dependencies or redundant irrelevant configurations, ensuring the minimality and completeness of the closure. Closures of different request routing keys are isolated from each other, and changes to a single closure will not propagate to other undependent request routing keys, strictly limiting the impact of the change to the request routing keys that actually depend on the changed entity. This embodiment can anchor the scope of change impact by requesting the routing key, limiting the boundary of the route configuration change to the corresponding minimum route dependency closure, avoiding the overall reconstruction of the entire route configuration, and effectively reducing the processing scope and computational overhead of the change operation.
[0028] Based on the minimum routing dependency closure, an immutable shared dependency block and a candidate unit list are constructed and verified to obtain the shared block ready credential and the list completion identifier.
[0029] Specifically, after obtaining the minimum routing dependency closure corresponding to each request routing key, the configuration items in the closure are divided into two categories: one is exclusive fields used only by the current request routing key and closely related to the candidate channel order; the other is shared static configuration that can be referenced by multiple request routing keys. For shared static configuration, immutable shared dependency blocks are generated. These data blocks cannot be modified in-place after being written. When the content changes, a completely new block entity is generated, and a unique identifier is generated according to the content characteristics. Shared blocks with the same content can be referenced by multiple unit lists without needing to be stored repeatedly. For exclusive fields, a candidate unit list is generated. The list records the content of the exclusive fields and the reference information to the immutable shared dependency blocks, serving as independent metadata for each request routing key and carrying the reference relationship between exclusive configurations and shared blocks. After construction, the integrity of the candidate unit list and all its referenced shared dependency blocks is verified to confirm that all referenced shared blocks exist and their content matches. All candidate channels can parse complete upstream call parameters through the list and shared blocks. After verification, a shared block ready credential is generated, and the completion flag of the candidate unit list is set to a valid state. This embodiment can achieve physical reuse of shared configurations among multiple request routing keys through immutable shared dependency blocks, reducing redundant storage. At the same time, it ensures that logical units across multiple physical objects have complete executability through ready credentials and completion identifiers, avoiding configuration inconsistencies caused by partial loading.
[0030] Based on the shared block ready credential and the list completion identifier, perform atomic activation for ordinary changes and batch atomic activation for safety-critical changes respectively, and determine the current activity descriptor.
[0031] Specifically, after verifying the candidate unit list, different atomic activation operations are executed based on the type of change event. For ordinary routing configuration changes, atomic activation at the single request routing key granularity is performed. This atomic operation verifies that the completion flag and shared block ready credential of the corresponding candidate unit list are valid, and that the unit version is higher than the current active version. If the verification passes, the active descriptor corresponding to the request routing key is switched to point to the new candidate unit list; if the verification fails, the original active descriptor remains unchanged. For critical changes involving security, batch atomic activation is performed. In the same atomic operation, the candidate lists and ready credentials corresponding to all affected request routing keys are verified. If all verifications pass, all affected active descriptors are switched in batches; if any verification fails, all original active descriptors are retained. The active descriptor serves as the control entry point for the currently effective routing unit of the request routing key. All requests locate the corresponding routing configuration through the active descriptor. The atomic activation operation only modifies this small control metadata of the active descriptor, without operating on a large amount of shared block data, ultimately determining the current active descriptor corresponding to all request routing keys. This embodiment can balance the flexibility of ordinary changes with the consistency of safety-critical changes through a hierarchical atomic activation mechanism, avoid the partial effectiveness of safety changes across multiple units, and at the same time reduce the activation impact of ordinary changes, thus ensuring high performance of activation operations.
[0032] Based on the user request, the corresponding immutable shared dependency block and the activated unit list are loaded according to the current activity descriptor, and then verified and encapsulated to obtain the routing execution plan.
[0033] Specifically, upon receiving a user's large model call request, the system first extracts and generates a request routing key from the request. Based on this routing key, it queries the corresponding current activity descriptor, loads the corresponding list of activated units according to the activity descriptor, and loads the corresponding immutable shared dependency blocks based on the shared block references in the list. After loading, the integrity and consistency of the unit list and shared dependency blocks are verified, confirming that the version, digest, and security domain of the list and shared blocks match, together forming a complete logical route snapshot unit. Batch reading can be used to improve efficiency when loading shared blocks. The verification process covers multiple dimensions, including dependency digests and shared block set digests, ensuring that the assembled logical unit is completely consistent with the closure at the time of construction. After successful verification, a route execution plan is encapsulated based on the complete route configuration information. This plan contains all the static parameters required for upstream calls and can be directly used to execute upstream large model service calls. This embodiment loads route configuration through a unified entry point via the activity descriptor, completing the assembly and verification of complete logical units on the request side, ensuring the consistency of the execution plan configuration, avoiding configuration fragmentation issues caused by split storage, and guaranteeing the stability of upstream calls.
[0034] Optionally, determining the minimum route dependency closure based on the request route key corresponding to the revision change event includes: Determine the reverse dependency index based on the aforementioned revision change event; Based on the reverse dependency index, the set of reference request keys before the change, and the set of reference request keys after the change, determine the set of affected request routing keys; The logical closure corresponding to the set of affected request routing keys is read in the same read-only consistent view to obtain the minimum routing dependency closure.
[0035] Specifically, when a route revision event occurs, a route change transaction is first generated. This transaction records the changed static route entity, the entity revision number, the set of reference request route keys corresponding to that entity before the change, the set of reference request route keys corresponding to that entity after the change, and the global change sequence. A reverse dependency index is pre-maintained, which maps each static route entity identifier to all sets of request route keys referencing that entity. Static route entities include various entities such as vendors, authentication materials, vendor models, and channel or protocol configurations. The reverse dependency index is updated synchronously after each unit list is built to ensure consistency between the index and the actual reference relationships. After the transaction is committed, based on the reverse dependency index, the set of request route keys corresponding to the reference relationships before and after the change are queried. The union of the two sets is then taken and deduplicated to obtain the affected unit set, which contains all request route keys that need to rebuild the route closure. When an entity is deleted or its ownership is changed, both the old reference request key set before the change and the new reference request key set after the change must be included in the affected set to avoid omitting any original reference request keys. After determining the set of affected request routing keys, within the same read-only consistent view, for each request routing key in the set, a complete traversal is performed starting from its corresponding logical model, along the reference relationships of candidate channels, vendors, authentication materials, vendor models, and protocol configurations. All dependent configuration entities are read to form the minimum routing dependency closure for each request routing key. The same read-only consistent view avoids inconsistencies in closures caused by secondary configuration changes during the build process, ensuring that the closures of all affected units are generated based on the same version of the base configuration. For request routing keys not in the affected set, their corresponding routing closures and active units remain unchanged and do not require rereading and rebuilding. In optional implementations, the reverse dependency index can be stored in a relational database, a distributed key-value database, or a separate indexing service. Routing change transactions can be carried out through database transaction tables, Outbox messages, change log subscriptions, or reliable messaging systems to ensure reliable transmission of change events and consistent index updates. Request routing keys can be generated using only the logical model name, or they can be generated by combining tenant identifiers, request protocol types, region constraints, or data boundary constraints. However, high-cardinality or sensitive request content such as prompt words and message bodies must not be included in the generation of request routing keys to avoid an explosion in the number of routing keys or leakage of sensitive information. This embodiment can accurately locate the impact range of shared entity changes through the reverse dependency index, rebuilding closures only for affected request routing keys, significantly reducing unnecessary rebuilding operations. At the same time, the consistency of closure data is ensured through the same read-consistent view, avoiding closure incompleteness caused by intermediate states.
[0036] Optionally, the step of constructing and verifying an immutable shared dependency block and a candidate unit list based on the minimum routing dependency closure to obtain a shared block ready credential and a list completion identifier includes: The minimum route dependency closure is divided into exclusive fields and shared configurations; The immutable shared dependency block and the candidate unit list are constructed based on the exclusive field and the shared configuration, respectively. The immutable shared dependency block and the candidate unit list are verified respectively to obtain the shared block ready credential and the list completion identifier.
[0037] Specifically, after obtaining the minimum routing dependency closure, the configuration within the closure is first divided into two categories according to preset block division rules: exclusive fields and shared configurations. Exclusive fields are those used only by the current request routing key and closely related to the candidate channel ranking, including candidate channel order, channel weight, and other configurations bound to a single request routing key. Shared configurations include vendor access addresses, authentication materials, vendor model mappings, and protocol conversion parameters, which are referenced by multiple request routing keys. For shared configurations, immutable shared dependency blocks are constructed: first, the block type, schema version, entity identifier, entity revision number, security domain, and all fields affecting execution are normalized and encoded; then, a content digest is calculated to generate a unique identifier for the shared block. When the content changes, a completely new block identifier and block entity are generated; existing shared blocks are prohibited from being overwritten in place. For sensitive shared blocks containing authentication materials, the authentication materials can be stored as encrypted ciphertext or an immutable key version reference. The block identifier can be added to the tenant or security domain namespace and generated using an HMAC with a server secret, a random opaque identifier, or a key version identifier. Blocks from different security domains must not be merged solely because their plaintext content is identical, to avoid unintended cross-tenant reuse or leakage of sensitive information. Shared block writing employs a put-if-absent or equivalent condition write mechanism. If a block with the same identifier is found to already exist, its content digest, block type, schema version, and security domain must be re-verified. Inconsistent verification is considered a structural error, and overwriting existing blocks is not allowed, nor is generating a corresponding candidate unit list permitted. For unique fields, a candidate unit list is constructed. The list must at least record the request routing key, unit version, unique field content, shared block reference list, dependency digest, shared block set digest, security generation, number of candidates, number of dependencies, ready credential identifier, and completion identifier. Each shared block reference includes the block type, block identifier, content digest, entity revision number, schema version, and security domain information. The dependency digest is calculated by normalizing the unique fields, all block references, entity revision number, candidate order, and key execution fields in a defined order. The shared block set digest is calculated by sorting all block references. After construction, all shared blocks referenced in the candidate list are read and verified. Each shared block is confirmed to exist and its content digest, type, mode version, and security domain match. At the same time, it is verified that all candidate channels can be parsed from the list and shared blocks to obtain the complete upstream address, authentication materials, vendor model name, and protocol parameters. After confirming that the entire closure is complete and executable, a shared block ready credential is generated, and the completion flag of the candidate unit list is set to valid.
[0038] In optional implementations, shared blocks can be independently divided according to vendor, authentication materials, and protocol configuration, or fields with similar change frequencies and security domains can be combined into composite blocks; the shared block identifier can be a combination of a pure content digest, an entity identifier plus a revision number plus a digest, a time-ordered identifier, or an opaque random identifier, as long as the content changes to generate a new identifier and in-place overwriting is prohibited; shared blocks can be stored in a Redis cluster, distributed object storage, read-only KV storage, or a configuration service that supports immutable versions; the cell list can directly save the content of exclusive fields, or it can only save reference pointers to all fields, but it must be able to prove that the reference set together constitutes a complete logical closure; the shared block ready credential can be an independent control metadata object, or it can be used as a signature field in the candidate list, a block set digest value, or proof of completion of the transaction.
[0039] This embodiment can achieve physical deduplication of shared configurations through immutable shared blocks, which greatly reduces redundant data stored repeatedly across units. At the same time, multi-dimensional verification and ready credentials ensure that the logical closure after physical splitting remains complete and consistent, avoiding version inconsistencies and configuration splicing errors.
[0040] Optionally, the step of performing atomic activation for general changes and batch atomic activation for safety-critical changes based on the shared block ready credential and the inventory completion identifier, respectively, to determine the current activity descriptor, includes: When a normal change is activated atomically, an atomic operation verification is performed. If the verification passes, the active descriptor of the request routing key corresponding to the shared block ready credential and the list completion identifier is switched as the current active descriptor. If the verification fails, the corresponding original active descriptor is used as the current active descriptor. When a safety-critical change is activated in a batch atomic operation, all the shared block ready credentials and the candidate list corresponding to the list completion identifier are verified in the same atomic control operation. If all verifications pass, the corresponding active descriptor of the request routing key is switched in batches as the current active descriptor. If not all verifications pass, all the corresponding original active descriptors are used as the current active descriptors.
[0041] Specifically, the build and activation must follow a fixed release order: First, all immutable shared dependency blocks are written or confirmed; second, a list of candidate units with an invalid completion flag is written; third, all shared blocks are validated and shared block ready credentials are generated; only after the closure validation passes are the completion flags of the candidate list set. Before the completion flags of the candidate unit list take effect, the activity descriptor must not point to that candidate list to ensure that requests do not read incomplete routing units. For ordinary routing configuration changes, atomic activation of ordinary changes at the single request routing key granularity is performed: the atomic operation first verifies that the corresponding candidate unit list exists, the completion flag is valid, the shared block ready credentials match, the request routing key is consistent with the current key, and the unit version of the candidate unit is higher than the unit version in the current activity descriptor; after all validation items pass, the activity descriptor corresponding to the request routing key is switched to point to the new candidate unit list; if any validation item fails, the original activity descriptor remains unchanged, and no switching is performed. Atomic activation of ordinary changes can be achieved through Redis's CAS operations, Lua scripts, database transactions, or distributed consistency coordination services, modifying only the small control metadata of the activity descriptor without operating on a large amount of shared block data. For security-critical changes such as authentication material revocation, vendor deactivation, trusted access boundary adjustment, and data area restriction changes, batch atomic activation is performed: First, a new security generation is assigned to all affected candidate units. The security generation is a global or grouped generation identifier used to constrain the consistency of the security-critical change's effectiveness. Then, in the same atomic control operation, it is verified that the completion identifiers and shared block ready credentials of all candidate units in the affected set are valid, and that the security generation of all units matches the target generation. After all verifications pass, the activity descriptors corresponding to all request routing keys in the affected set are switched in batches, while simultaneously updating the current globally valid security generation. If any candidate unit fails verification, all affected activity descriptors remain in their original state without any switching, preventing the security change from partially taking effect across multiple units. Batch activation of security-critical changes can be achieved through a slot control table, transactional metadata table, or distributed consensus service, ensuring the atomicity of switching multiple activity descriptors.
[0042] In optional implementations, the activation of ordinary changes can be made atomic by using optimistic locking or pessimistic locking mechanisms, and the batch activation of security-critical changes can be made consistent by using two-phase commit or consensus algorithms. The activity descriptor includes at least the unit version, unit list identifier or summary, security generation and activation sequence, serving as a unified entry point for the requesting side to read the routing configuration.
[0043] This embodiment can reduce the activation granularity and improve release flexibility in ordinary change scenarios through a hierarchical atomic activation mechanism, and ensure consistent effectiveness of all affected units in security-critical scenarios, eliminating security vulnerabilities caused by partial effectiveness. At the same time, the activation operation only operates on lightweight control metadata, which has extremely high execution performance.
[0044] Optionally, the step of loading the corresponding immutable shared dependency block and the activated unit list according to the current activity descriptor based on the user request, and verifying and encapsulating them to obtain the routing execution plan includes: Based on the user request, extract the user request routing key and query the user activity descriptor corresponding to the user request routing key; Load the corresponding immutable shared dependency block and the activated unit list according to the user activity descriptor; Perform integrity and security checks on the corresponding immutable shared dependency blocks and the activated unit list. If the check fails, perform a local rollback process. After successful verification, the dynamic state is sampled independently, a candidate ranking is formed and encapsulated to obtain the routing execution plan.
[0045] Specifically, when a user's large model call request is received, a request routing key is first extracted and normalized from the stable fields of the request to generate a request routing key. The request routing key must at least include the logical model name, and can also include tenant identifiers, request protocol types, regional constraints, or data boundary constraints depending on the scenario. However, high-cardinality and highly variable request content such as prompt words and message bodies should not be included in the generation of request routing keys to avoid the number of routing keys becoming excessive. Based on the generated request routing key, the corresponding current activity descriptor is queried. The activity descriptor serves as the control metadata for the currently effective routing unit of the request routing key, and at least records the unit version, unit manifest identifier or summary, security generation, and activation sequence. Subsequently, the corresponding list of activated units is loaded based on the activity descriptor, and then the corresponding immutable shared dependency blocks are loaded in batches based on the shared block reference list in the list. Shared block reading can be improved in efficiency using methods such as MGET, Pipeline, and parallel reading, or it can be accelerated through instance-level immutable block caching. The instance block cache uses the block identifier and content summary as keys. After the cache is hit, the security domain and mode version of the block still need to be verified to avoid cross-security domain reuse. After loading, integrity and security checks are performed: The validity of the activity descriptor, dependency digests of the unit list, shared block set digests, content digests of each shared block, entity revision information, list completion identifiers, and security generations are checked sequentially to confirm that the unit list and all shared blocks together constitute a complete and consistent logical routing snapshot unit, without cross-version or cross-security domain configuration splicing. During the verification process, the current globally valid security generation must be checked again before plan encapsulation. If a change in the security generation is found, all currently parsed results are discarded, and loading and verification are restarted according to the new activity descriptor. After all checks pass, the unique fields and configurations in the shared blocks are assembled into a complete logical unit. Dynamic operating states such as RPM, channel health, and real-time latency are independently sampled. Candidate channel ranking is formed based on the dynamic states, and finally, a route execution plan in the SEALED state is encapsulated. Dynamic operating states are not part of the static routing closure. Conservative default values can be used when dynamic state reading fails, but static configuration content such as verified supplier addresses, authentication materials, supplier model names, and protocol parameters must not be modified.
[0046] In an optional implementation, instance-level immutable block caching can be implemented using local memory caching, caching only the content of shared blocks that have passed verification; dynamic status can be sampled from independent monitoring services, traffic statistics modules, or real-time probing interfaces; after the routing execution plan is encapsulated, all static parameters are frozen and cannot be modified during the execution phase.
[0047] This embodiment can complete the assembly and multi-dimensional verification of complete logical units on the request side, ensuring the consistency of the execution plan configuration. At the same time, it offsets the read overhead caused by physical splitting through batch reading and instance caching, thus balancing configuration correctness and request processing performance.
[0048] Optionally, the local rollback process includes: Remove all current static parameters, re-extract the user descriptor based on the user request routing key, load the corresponding immutable shared dependency block and the activated unit list, and perform integrity and security checks.
[0049] Specifically, before the routing execution plan is encapsulated and enters the SEALED state, if any failure occurs, such as Redis cluster access anomaly, missing unit list, missing referenced shared blocks, content digest mismatch, or security generation expiration, the currently parsed plan immediately enters the INVALIDATED state. All activity descriptors read during this parsing process, unit lists, loaded shared blocks, and all assembled static intermediate parameters are discarded, and no parsing results should be retained for subsequent concatenation. After a failure triggers a rollback, the corresponding local complete routing unit is read from the instance's local complete logical unit table using the same request routing key, and the verification and plan encapsulation process is re-executed. The instance's local complete logical unit can be stored in two ways: one is to store a copy of the fully parsed routing unit, directly containing all static routing parameters; the other is to store the local version of the unit list and local immutable shared dependency blocks, consistent with the structure of the distributed cache but stored locally. Regardless of the storage method used, all static fields in a single recalculation process must come from the same valid local unit. It is strictly prohibited to concatenate lists from the distributed cache, shared blocks from the distributed cache, and fields stored locally to avoid cross-version and cross-origin configuration combinations. If a corresponding complete logical unit is not available locally on the instance, upstream call processing for this request is stopped. Missing configuration items cannot be supplemented from other versions or sources using a single field to prevent call errors or security risks caused by partial configuration failure. The entire process achieves state isolation through a side effect barrier: from the static configuration parsing stage to stages with side effects such as RPM count writing, authentication material submission, network connection establishment, or upstream service calls, the boundary must be the execution plan entering the SEALED state. Only plans that have completed all verifications and encapsulation in the SEALED state are allowed to cross the side effect barrier to execute operations with side effects; plans that have not completed verification or have failed must not execute any operations with side effects.
[0050] In an optional implementation, the local complete logical unit can be updated asynchronously and synchronously with the switching of the activity descriptor, or it can be cached and updated after each successful resolution; the types of exceptions triggered by rollback can be expanded according to the deployment scenario, including network partitions, cache node failures, data verification failures, and other faults that may lead to configuration inconsistencies.
[0051] This embodiment can achieve overall rollback through local complete units when the distributed cache fails, strictly prohibits cross-source configuration splicing, avoids the risk of configuration inconsistency caused by partial failure, and isolates the parsing phase from the execution phase through side effect barriers to prevent incomplete configuration from entering the actual call process.
[0052] Optionally, after obtaining the routing execution plan, the method further includes: Based on the delayed reclamation mechanism, shared blocks that do not meet the reachability protection scope of shared blocks are deleted.
[0053] Specifically, the liveness status of shared blocks is determined based on the set of reachability roots. This set includes four types of reference sources: the first type is shared blocks referenced by all currently active unit lists; the second type is shared blocks referenced by candidate unit lists that have been built but not yet activated; the third type is shared blocks under construction or repair and protected by build leases; and the fourth type is shared blocks referenced by historical unit lists within their retention period. The recycling task periodically traverses all reachability root sets, collects all shared block references recorded within them, and aggregates them to generate a global reachable block set R. A shared block is only allowed to be deleted if all the following conditions are met simultaneously: 1) The shared block is not in the reachable block set R and has no valid or pending unit list references; 2) The shared block is not protected by any build lease or repair task and no ongoing build or repair operation depends on it; 3) The shared block's creation time is earlier than the sum of the maximum request execution time and the preset grace period, ensuring that all in-transit requests have been completed and will not read the block again; 4) The shared block is not within the retention scope required by security audits and does not involve compliance retention requirements. This delayed reclamation mechanism avoids the shortcomings of immediate reference counting: when a request fixes the old version of the activity descriptor, the corresponding immutable shared block can still be read and resolved within the grace period and will not be prematurely deleted due to the reference count reaching zero; in scenarios such as fault retries, inactive candidate lists, and concurrent request execution, the shared block will not be mistakenly deleted due to temporary reference count fluctuations, ensuring the stability of in-transit requests and the build process.
[0054] In optional implementations, shared block reclamation can be achieved through various methods such as mark-and-sweep, delayed reference counting, generational reclamation, or lease mechanisms, as long as it covers the three scenarios of activity list references, candidate build references, and in-transit request references. For configuration fields with extremely low sharing rates, they can be directly stored inline in the cell list without being stored as shared blocks, allowing a logical cell to contain both inline exclusive fields and shared block references, thus balancing storage efficiency and access performance.
[0055] This embodiment can ensure the availability of shared blocks in all dependent scenarios through multi-dimensional reachability judgment and grace period mechanism, avoid request failures or construction errors caused by premature recycling, and achieve automatic cleanup of useless shared blocks while ensuring security, thus balancing storage overhead and operational stability.
[0056] For example, each route configuration change generates a corresponding refresh task. This task includes a change sequence, a set of changed entities, a set of affected request routing keys, a change category, and target security generation information. Refresh tasks can be hosted via database task tables, Outbox messages, change log subscriptions, or reliable messaging systems. Multiple gateway instances preemptively execute tasks through conditional updates, avoiding duplicate execution. A retry mechanism is supported when a refresh task fails. During retry, existing immutable shared dependency blocks and candidate unit lists with consistent content digests can be reused without repeated construction. However, the shared block readiness credentials, activity descriptors, and security generations must be re-verified to ensure the configuration state at the time of retry is consistent with the target state. For refresh tasks of ordinary changes, request routing keys within the affected set are verified one by one during execution. Request routing keys that meet the target dependency digest can skip subsequent construction steps and directly enter the activation verification stage, improving retry efficiency. For refresh tasks of security-critical changes, batch activation operations can only be performed after all candidate units within the affected set have been built and passed verification. If some candidate units fail to build, the activation operation for the entire security change is suspended, and partial switching is not performed until all candidates are successfully built before unified activation. The convergence criteria for the refresh task are: the active descriptors of all request routing keys within the affected set are updated to the target version, the target security generation is consistent with the globally effective security generation, all referenced shared blocks are ready, and there are no incomplete candidate units. If a persistent convergence failure occurs, a full verification and reconstruction can be triggered to ensure the eventual consistency of the routing configuration. This embodiment ensures reliable delivery of changes through a reliable refresh task carrying mechanism, improves retry efficiency by reusing existing configurations, and guarantees the complete effectiveness of security changes through strict convergence criteria, avoiding inconsistencies caused by partial success.
[0057] For example, let the total size of all static routing configurations be N, the size of the request routing key set affected by a configuration change be A, and a single logical unit contain k candidate channels and b shared block references. Regarding storage overhead, the storage volume of the full snapshot scheme is positively correlated with the total configuration size N, while the storage volume of the full inline unit scheme is positively correlated with the product of the number of request routing keys and the configuration size per unit. This scheme achieves physical reuse of shared configurations through immutable shared dependency blocks. The higher the degree of sharing, the more significant the reduction in redundant storage of supplier addresses, authentication materials, protocol configurations, etc., resulting in significantly lower overall storage overhead than the full inline unit scheme. It is particularly suitable for scenarios where multiple models share a large number of supplier and channel configurations. Regarding change computation overhead, the full snapshot scheme requires rebuilding all routing data of size N for each change. This scheme only rebuilds the unit list and the changed shared blocks within the affected set A, while unaffected units and shared blocks remain unchanged. The computation overhead is positively correlated with the affected range A, rather than the total size N, significantly reducing the computational cost of small-scale changes. Regarding read overhead, both the full snapshot solution and the complete inline unit solution can obtain the complete configuration in a single read. This solution splits a single physical object read into a unit list read plus b shared block reads, increasing the overhead of b reference resolution and integrity verification. This overhead can be reduced through batch reads, instance-level immutable block caching, block size optimization, and list prefetching, and the actual request latency can be controlled within an acceptable range. The performance benefits and additional complexity of the solution need to be quantitatively verified using metrics such as sharing rate, Redis byte write volume, storage usage, P95 / P99 request latency, and fault recovery time. The return on investment of the solution should be evaluated based on the configuration sharing degree, change frequency, and request volume of the actual deployment scenario. This embodiment can quantitatively evaluate the resource overhead and performance of the solution, providing a basis for parameter tuning and solution selection in actual deployment, and has significant comprehensive advantages in scenarios with high sharing degree and high frequency of small-scale changes.
[0058] like Figure 2 As shown in the figure, an embodiment of the present invention provides a large-model gateway routing cache control device, comprising: The closure module is used to determine the minimum route dependency closure based on the request routing key corresponding to the revision change event; The construction module is used to construct and verify an immutable shared dependency block and a candidate unit list based on the minimum routing dependency closure, and obtain a shared block ready credential and a list completion identifier. The activation module is used to perform atomic activation of ordinary changes and batch atomic activation of safety-critical changes based on the shared block ready credential and the list completion identifier, and to determine the current activity descriptor; The planning module is used to load the corresponding immutable shared dependency block and the activated unit list according to the current activity descriptor based on the user request, and to verify and encapsulate them to obtain the routing execution plan.
[0059] like Figure 3 As shown, an electronic device 300 provided in this embodiment of the invention includes a memory 310 and a processor 320; the memory 310 is used to store a computer program; the processor 320 is used to implement the large-model gateway routing cache control method as described above when the computer program is executed.
[0060] Alternatively, an electronic device 300 includes a memory 310 and a processor 320 coupled to the memory 310; the memory 310 is configured to store a computer program; and the processor 320 is configured to perform the following operations when the computer program is executed: Determine the minimum route dependency closure based on the request route key corresponding to the revision change event; Based on the minimum routing dependency closure, construct and verify an immutable shared dependency block and a candidate unit list to obtain a shared block ready credential and a list completion identifier. Based on the shared block ready credential and the list completion identifier, perform atomic activation for ordinary changes and batch atomic activation for safety-critical changes respectively, and determine the current activity descriptor; Based on the user request, the corresponding immutable shared dependency block and the activated unit list are loaded according to the current activity descriptor, and then verified and encapsulated to obtain the routing execution plan.
[0061] This invention provides a computer-readable storage medium storing a computer program. When the computer program is executed by a processor, it implements the large-model gateway routing cache control method described above.
[0062] Alternatively, a non-volatile computer-readable storage medium storing a computer program that, when executed by a processor, causes the processor to perform the following operations: Determine the minimum route dependency closure based on the request route key corresponding to the revision change event; Based on the minimum routing dependency closure, construct and verify an immutable shared dependency block and a candidate unit list to obtain a shared block ready credential and a list completion identifier. Based on the shared block ready credential and the list completion identifier, perform atomic activation for ordinary changes and batch atomic activation for safety-critical changes respectively, and determine the current activity descriptor; Based on the user request, the corresponding immutable shared dependency block and the activated unit list are loaded according to the current activity descriptor, and then verified and encapsulated to obtain the routing execution plan.
[0063] The present invention will now be described an electronic device 300 that can serve as a server or client of the present invention, which is an example of a hardware device that can be applied to various aspects of the present invention. Electronic device 300 is intended to represent various forms of digital electronic computer devices, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. Electronic device 300 can also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the invention described and / or claimed herein.
[0064] Electronic device 300 includes a computing unit that can perform various appropriate actions and processes based on a computer program stored in read-only memory (ROM) or a computer program loaded from a storage unit into random access memory (RAM). The RAM may also store various programs and data required for device operation. The computing unit, ROM, and RAM are interconnected via a bus. Input / output (I / O) interfaces are also connected to the bus.
[0065] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The program can be stored in a computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. The storage medium can be a magnetic disk, optical disk, read-only memory (ROM), or random access memory (RAM), etc. In this application, the units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of the embodiments of the present invention according to actual needs. Furthermore, the functional units in the various embodiments of the present invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated units can be implemented in hardware or as software functional units.
[0066] While the present invention has been disclosed above, its scope of protection is not limited thereto. Those skilled in the art can make various changes and modifications without departing from the spirit and scope of the present invention, and all such changes and modifications will fall within the scope of protection of the present invention.
Claims
1. A method for controlling routing cache in a large-scale gateway, characterized in that, include: Determine the minimum route dependency closure based on the request route key corresponding to the revision change event; Based on the minimum routing dependency closure, construct and verify an immutable shared dependency block and a candidate unit list to obtain a shared block ready credential and a list completion identifier. Based on the shared block ready credential and the list completion identifier, perform atomic activation for ordinary changes and batch atomic activation for safety-critical changes respectively, and determine the current activity descriptor; Based on the user request, the corresponding immutable shared dependency block and the activated unit list are loaded according to the current activity descriptor, and then verified and encapsulated to obtain the routing execution plan.
2. The large-model gateway routing cache control method according to claim 1, characterized in that, The step of determining the minimum route dependency closure based on the request route key corresponding to the revision change event includes: Determine the reverse dependency index based on the aforementioned revision change event; Based on the reverse dependency index, the set of reference request keys before the change, and the set of reference request keys after the change, determine the set of affected request routing keys; The logical closure corresponding to the set of affected request routing keys is read in the same read-only consistent view to obtain the minimum routing dependency closure.
3. The large-model gateway routing cache control method according to claim 1, characterized in that, The step of constructing and verifying an immutable shared dependency block and a candidate unit list based on the minimum routing dependency closure, and obtaining a shared block ready credential and a list completion identifier, includes: The minimum route dependency closure is divided into exclusive fields and shared configurations; The immutable shared dependency block and the candidate unit list are constructed based on the exclusive field and the shared configuration, respectively. The immutable shared dependency block and the candidate unit list are verified respectively to obtain the shared block ready credential and the list completion identifier.
4. The large-model gateway routing cache control method according to claim 1, characterized in that, Based on the shared block ready credential and the list completion identifier, the process performs atomic activation for general changes and batch atomic activation for safety-critical changes, respectively, to determine the current activity descriptor, including: When a normal change is activated atomically, an atomic operation verification is performed. If the verification passes, the active descriptor of the request routing key corresponding to the shared block ready credential and the list completion identifier is switched as the current active descriptor. If the verification fails, the corresponding original active descriptor is used as the current active descriptor. When a safety-critical change is activated in a batch atomic operation, all the shared block ready credentials and the candidate list corresponding to the list completion identifier are verified in the same atomic control operation. If all verifications pass, the corresponding active descriptor of the request routing key is switched in batches as the current active descriptor. If not all verifications pass, all the corresponding original active descriptors are used as the current active descriptors.
5. The large-model gateway routing cache control method according to claim 1, characterized in that, The process of loading the corresponding immutable shared dependency block and the activated unit list based on the user request and the current activity descriptor, and then verifying and encapsulating them to obtain the routing execution plan includes: Based on the user request, extract the user request routing key and query the user activity descriptor corresponding to the user request routing key; Load the corresponding immutable shared dependency block and the activated unit list according to the user activity descriptor; Perform integrity and security checks on the corresponding immutable shared dependency blocks and the activated unit list. If the check fails, perform a local rollback process. After successful verification, the dynamic state is sampled independently, a candidate ranking is formed and encapsulated to obtain the routing execution plan.
6. The large-model gateway routing cache control method according to claim 5, characterized in that, The local rollback process includes: Remove all current static parameters, re-extract the user descriptor based on the user request routing key, load the corresponding immutable shared dependency block and the activated unit list, and perform integrity and security checks.
7. The large-model gateway routing cache control method according to claim 1, characterized in that, After obtaining the routing execution plan, the following is also included: Based on the delayed reclamation mechanism, shared blocks that do not meet the reachability protection scope of shared blocks are deleted.
8. A large-scale gateway routing cache control device, characterized in that, include: The closure module is used to determine the minimum route dependency closure based on the request routing key corresponding to the revision change event; The construction module is used to construct and verify an immutable shared dependency block and a candidate unit list based on the minimum routing dependency closure, and obtain a shared block ready credential and a list completion identifier. The activation module is used to perform atomic activation of ordinary changes and batch atomic activation of safety-critical changes based on the shared block ready credential and the list completion identifier, and to determine the current activity descriptor; The planning module is used to load the corresponding immutable shared dependency block and the activated unit list according to the current activity descriptor based on the user request, and to verify and encapsulate them to obtain the routing execution plan.
9. An electronic device, characterized in that, Including memory and processor; The memory is used to store computer programs; The processor is configured to implement the large-model gateway routing cache control method as described in any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium, characterized in that, The storage medium stores a computer program, which, when executed by a processor, implements the large-model gateway routing cache control method as described in any one of claims 1 to 7.
