Metadata processing method and device for cloud sandbox platform

By introducing a globally expired ordered set index and single pipeline transactions into the key-value database of the cloud sandbox platform, the problems of accidental index deletion and dangling entries were solved, achieving efficient metadata management and system stability.

CN123115146APending Publication Date: 2026-11-17BEIJING JILIU TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611423790.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-09-14
Publication Date
2026-11-17

AI Technical Summary

Technical Problem

In concurrent recovery scenarios on cloud sandbox platforms, existing technologies have led to the reuse of sandbox identifiers, resulting in the accidental deletion of valid indexes. When cleaning up expired sandboxes, network partitions or process crashes can cause dangling entries to remain in the team collection index, increasing the system burden and blocking the database event loop.

Method used

The sandbox state metadata and identifiers are stored in a key-value database. The sandbox state is managed through a global expired ordered set index. Missing triples are supplemented by periodically traversing the data keys. The index is cleaned up synchronously using a single pipeline transaction. The sandbox list is obtained by reading atomic snapshots.

Benefits of technology

It achieves instance-level isolation under concurrent operations, avoids accidental deletion of indexes, automatically cleans up dangling entries, prevents resource consumption, and improves the security and stability of metadata management.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123115146A_ABST
    Figure CN123115146A_ABST
Patent Text Reader

Abstract

This application relates to the field of data processing technology, specifically to a metadata processing method and apparatus for a cloud sandbox platform. The method includes: storing sandbox state metadata in a key-value database's sandbox data key; storing the sandbox identifier in a key-value database's team set index; storing triples in a key-value database's global expired ordered set index; if it is determined that the sandbox state metadata corresponding to an expired member is missing, determining the target team identifier and sandbox identifier corresponding to the expired member, and simultaneously removing the expired member from the global expired ordered set index and the sandbox identifier from the team set index corresponding to the target team identifier; traversing all sandbox data keys, querying the corresponding triple in the global expired ordered set index for each sandbox data key; if the triple does not exist, determining that there is a missing registration, and supplementing the triple corresponding to the sandbox data key into the global expired ordered set index.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of data processing technology, and in particular to a method and apparatus for metadata processing of a cloud sandbox platform. Background Technology

[0002] With the development of cloud computing technology, cloud sandbox platforms need to manage the lifecycle and state metadata of a large number of user sandboxes in real time. Existing technologies typically store the state data of each sandbox in a distributed key-value database and organize it collaboratively through a multi-level index structure. For example, they use a team collection index to provide the ability to query active sandboxes by team dimension, while relying on a globally expired ordered collection index scored by expiration time to assist the background eviction daemon process in polling and cleaning up resources of timed-out sandboxes.

[0003] However, existing technologies have multiple shortcomings when dealing with large-scale concurrent metadata processing. First, the reuse of sandbox identifiers in concurrent recovery scenarios can easily lead to the eviction mechanism mistakenly deleting valid indexes from different periods. Second, when cleaning up expired sandboxes, network partitions or process crashes often result in a large number of dangling entries remaining in the team collection index that cannot be automatically cleaned up, which increases the system burden and can also block the database event loop. Summary of the Invention

[0004] This application provides a metadata processing method and apparatus for a cloud sandbox platform to solve the technical problems in the prior art where the reuse of sandbox identifiers in concurrent recovery scenarios easily leads to the accidental deletion of valid indexes at different periods by the eviction mechanism. When cleaning up expired sandboxes, network partitions or process crashes often result in a large number of dangling entries remaining in the team collection index that cannot be automatically cleaned up, which increases the system burden and can also block the database event loop.

[0005] This application provides a metadata processing method for a cloud sandbox platform, including the following steps: The sandbox state metadata is stored in the sandbox data key of the key-value database, the sandbox identifier is stored in the team set index of the key-value database, and the triple is stored in the global expired ordered set index of the key-value database. The triple includes the target team identifier, the sandbox identifier, and the execution instance identifier. During the process of processing expired members based on the global expired ordered set index, if it is determined that the sandbox status metadata corresponding to the expired member is missing, then the target team identifier and the sandbox identifier corresponding to the expired member are determined, and the expired member in the global expired ordered set index and the sandbox identifier in the team set index corresponding to the target team identifier are removed simultaneously. Periodically traverse all sandbox data keys, and for each sandbox data key, query its corresponding triple in the global expired ordered set index. If the triple does not exist, it is determined that there is a missing registration, and the triple corresponding to the sandbox data key is added to the global expired ordered set index in a conditional write manner.

[0006] According to the metadata processing method for a cloud sandbox platform provided in this application, the method further includes: In response to a request to obtain a list of sandboxes for a target team corresponding to a target team identifier, obtain all sandbox identifiers corresponding to the target team; Based on a preset batch, all sandbox identifiers are divided into multiple subsets; Read the sandbox state metadata corresponding to each subset.

[0007] According to the metadata processing method of the cloud sandbox platform provided in this application, the execution instance identifier is a globally generated identifier that is dynamically generated each time the sandbox is created or resumed from a paused state.

[0008] According to the metadata processing method for a cloud sandbox platform provided in this application, the synchronous removal of expired members from the global expired ordered set index and the sandbox identifier from the team set index corresponding to the target team identifier includes: Add the expired members that are determined to have missing sandbox state metadata to the cleanup set; In a single pipeline transaction, a member removal command is executed on the global expired ordered set index to delete all members in the set to be cleaned up, and a sandbox identifier removal command is executed on the team set index corresponding to the target team identifier.

[0009] According to the metadata processing method for a cloud sandbox platform provided in this application, the step of querying the corresponding triplet of each sandbox data key in the global expired ordered set index, and if the triplet does not exist, determining that there is a missing registration, and supplementing the triplet corresponding to the sandbox data key into the global expired ordered set index by conditional write, includes: Use the batch scoring query command to query the expiration time score of the triplet corresponding to each sandbox data key in the global expiration ordered set index. If the expiration time score is empty and the sandbox creation time corresponding to the sandbox data key exceeds the preset grace period, execute a write command that does not overwrite the existing score to supplement the triple corresponding to the sandbox data key into the global expiration ordered set index.

[0010] According to the metadata processing method for a cloud sandbox platform provided in this application, obtaining all sandbox identifiers corresponding to the target team includes: The atomic snapshot read command retrieves all sandbox identifiers at the time of command execution, corresponding to the team set index of the target team identifier.

[0011] This application provides a metadata processing device for a cloud sandbox platform, including the following modules: The storage module is used to store the sandbox state metadata of the sandbox in the sandbox data key of the key-value database, store the sandbox identifier of the sandbox in the team set index of the key-value database, and store the triple in the global expired ordered set index of the key-value database, wherein the triple includes the target team identifier, the sandbox identifier, and the execution instance identifier; The removal module is used to determine the target team identifier and the sandbox identifier corresponding to the expired member if it is determined that the sandbox status metadata corresponding to the expired member is missing during the process of processing expired members based on the global expired ordered set index, and simultaneously remove the expired member from the global expired ordered set index and the sandbox identifier from the team set index corresponding to the target team identifier. The write module is used to periodically traverse all sandbox data keys, query the corresponding triple in the global expired ordered set index for each sandbox data key, and if the triple does not exist, it is determined that there is a missing registration, and the triple corresponding to the sandbox data key is added to the global expired ordered set index in a conditional write manner.

[0012] The metadata processing apparatus for a cloud sandbox platform provided in this application further includes: The acquisition module is used to acquire all sandbox identifiers corresponding to the target team in response to a request to acquire a list of sandboxes for the target team corresponding to the target team identifier. The partitioning module is used to divide all the sandbox identifiers into multiple subsets based on a preset batch. The reading module is used to read the sandbox status metadata corresponding to each subset.

[0013] According to the metadata processing device of the cloud sandbox platform provided in this application, the execution instance identifier is a globally generated identifier that is dynamically generated each time the sandbox is created or resumed from a paused state.

[0014] According to the metadata processing device for a cloud sandbox platform provided in this application, the removal module is specifically used for: Add the expired members that are determined to have missing sandbox state metadata to the cleanup set; In a single pipeline transaction, a member removal command is executed on the global expired ordered set index to delete all members in the set to be cleaned up, and a sandbox identifier removal command is executed on the team set index corresponding to the target team identifier.

[0015] According to the metadata processing device for a cloud sandbox platform provided in this application, the writing module is specifically used for: Use the batch scoring query command to query the expiration time score of the triplet corresponding to each sandbox data key in the global expiration ordered set index. If the expiration time score is empty and the sandbox creation time corresponding to the sandbox data key exceeds the preset grace period, execute a write command that does not overwrite the existing score to supplement the triple corresponding to the sandbox data key into the global expiration ordered set index.

[0016] According to the metadata processing device for a cloud sandbox platform provided in this application, the acquisition module is specifically used for: The atomic snapshot read command retrieves all sandbox identifiers at the time of command execution, corresponding to the team set index of the target team identifier.

[0017] This application also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the metadata processing method of any of the cloud sandbox platforms described above.

[0018] This application also provides a non-transitory computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the metadata processing method of the cloud sandbox platform as described above.

[0019] This application also provides a computer program product, including a computer program that, when executed by a processor, implements a metadata processing method for any of the cloud sandbox platforms described above.

[0020] This application provides a metadata processing method and apparatus for a cloud sandbox platform. By introducing a triple structure containing execution instance identifiers into the global expired ordered set index, instance-level isolation under concurrent operations is achieved, effectively avoiding the security risk of accidental deletion of active indexes when sandbox identifiers are reused. At the same time, when processing expired members, the dangling team set index with missing metadata is cleaned up synchronously, realizing the automatic reclamation of dirty data with zero additional scanning overhead and preventing the infinite bloat of multi-level index structures. In addition, by periodically traversing all sandbox data keys and supplementing missing triples through conditional writing, a reliable metadata eventual consistency self-healing mechanism is constructed, completely eliminating the long-term illegal occupation of cloud platform computing resources due to abnormal process crashes. This comprehensively improves the concurrency security, resource utilization, and overall operational stability of metadata management in large-scale cloud sandbox systems. Attached Figure Description

[0021] To more clearly illustrate the technical solutions in 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 some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0022] Figure 1 This is one of the flowcharts illustrating the metadata processing method of the cloud sandbox platform provided in this application.

[0023] Figure 2 This is the second flowchart illustrating the metadata processing method of the cloud sandbox platform provided in this application.

[0024] Figure 3 This is a schematic diagram of the metadata processing device of the cloud sandbox platform provided in this application.

[0025] Figure 4 A schematic diagram of the physical structure of an electronic device is provided. Detailed Implementation

[0026] To make the objectives, technical solutions, and advantages of this application clearer, the technical solutions 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, 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.

[0027] Figure 1 This is one of the flowcharts illustrating the metadata processing method of the cloud sandbox platform provided in this application, such as... Figure 1 As shown, the method includes the following: Step 101: Store the sandbox state metadata in the sandbox data key of the key-value database, store the sandbox identifier in the team set index of the key-value database, and store the triple in the global expired ordered set index of the key-value database. The triple includes the target team identifier, the sandbox identifier, and the execution instance identifier.

[0028] In this context, a sandbox refers to an isolated runtime environment created by a cloud sandbox platform for each user session or each code execution task in the cloud. Each sandbox has its own independent file system, network stack, and process space for securely executing user-submitted code. Sandboxes have a limited lifespan and are destroyed when code execution is complete or when the timeout occurs. State metadata is a collection of information describing the sandbox's runtime state, including at least its lifecycle status, creation time, expiration time, resource configuration, and execution instance identifier.

[0029] Key-value databases, such as Redis, are in-memory key-value storage systems that support various data structures. Unlike relational databases, key-value databases uniquely identify data using keys and access corresponding values ​​via those keys. They offer extremely high read and write performance and are suitable for high-speed caching of metadata.

[0030] A sandbox data key is a key that stores the complete state metadata of a single sandbox. Its name includes the team identifier and the sandbox identifier, which are used to uniquely identify the data storage location of a sandbox.

[0031] The Team Set Index (SET) is a collection structure used to record all sandbox identifiers under a specific team. Its key name contains the team identifier, and its value is a collection of all sandbox identifiers for that team, used to support team-level sandbox list queries.

[0032] The Global Expiration Ordered Set Index (ZSET) is an index structure used to record the expiration times of all sandboxes across the entire platform. Its members are triples containing team identifier, sandbox identifier, and execution instance identifier, with the score being the sandbox's expiration timestamp.

[0033] In this embodiment, when managing a large number of user sandboxes in real time, the cloud sandbox platform extracts the real-time lifecycle status of each sandbox (e.g., running, paused, terminated, etc.) and serializes it into JSON format data. This JSON data, as sandbox state metadata, is directly stored in the specific sandbox data key in the Redis distributed cache. In actual deployment, the key name of this data key usually includes a hash label, for example, sandbox:storage:{teamID}:sandboxes:{sandbox ID}, to ensure consistency in subsequent cluster routing.

[0034] In the implementation of team collection index registration, in order to support the platform to efficiently organize and manage multi-level index structures, the system will write the unique identifier of the extracted sandbox (i.e., sandbox ID) into the team's exclusive Redis team member collection in the form of collection members, usually with the key name {team Index Key}.

[0035] Alternatively, in some embodiments, the execution instance identifier is a globally generated identifier that is dynamically generated each time the sandbox is created or resumed from a paused state.

[0036] In other words, in constructing the triples and storing the global expiration index, the system needs to register sandboxes with the Global Expiration Ordered Set (ZSET) responsible for evicting timed-out sandboxes. To address the execution instance isolation issue in concurrent scenarios, the system dynamically generates a globally unique universally unique identifier (UUID) each time a sandbox is created or resumed from a paused state, using this as the execution instance identifier (execution ID). Subsequently, the system combines the target team ID, sandbox ID, and the newly generated execution instance identifier (execution ID) to construct a triple strictly according to the format {team ID}:{sandbox ID}:{execution ID}. After construction, the system uses the sandbox's planned expiration timestamp as a score and writes the triple as a specific member into the global expiration ordered set index.

[0037] Step 102: In the process of processing expired members based on the global expired ordered set index, if it is determined that the sandbox status metadata corresponding to the expired member is missing, then the target team identifier and sandbox identifier corresponding to the expired member are determined, and the expired member in the global expired ordered set index and the sandbox identifier in the team set index corresponding to the target team identifier are removed simultaneously.

[0038] Among them, expired members refer to specific records in the above-mentioned globally expired ordered set whose scores (i.e., sandbox expiration timestamps) have been earlier than the current time, and thus have been retrieved by the background eviction path. The specific data representation of this member is in the format of a triple of {team ID}:{sandbox ID}:{execution ID}.

[0039] Missing sandbox state metadata refers to a situation where, during the orphan cleanup logic of the eviction process, when attempting to read the sandbox JSON data key for an expired member, the returned result is nil. This typically means that the actual data key of the sandbox has been cleaned up through normal deletion operations, but due to anomalies such as interface process crashes or network partitions, the associated indexes were not cleaned up synchronously, resulting in the member becoming unsupported by actual data.

[0040] The target team identifier and sandbox identifier are extracted by disassembling and parsing expired members with missing metadata, specifically the triple format {team ID}:{sandbox ID}:{execution ID}. The target team identifier is used to locate the team index key to which the sandbox belongs, while the sandbox identifier is the specific target to be cleaned up.

[0041] Synchronous removal refers to the system not only adding the member to the cleanup set to be removed from ZSET after confirming the missing sandbox state metadata, but also removing the member from the corresponding team's SET index. Synchronization means merging these two different index structure cleanup actions into a single Redis pipeline operation, executed with a single pipe.Exec() submission, achieving zero-overhead index maintenance without the need for additional independent scan tasks.

[0042] Optionally, in some embodiments, the synchronous removal of expired members in the global expired ordered set index and sandbox identifiers in the team set index corresponding to the target team identifier includes: adding expired members that are determined to have missing sandbox state metadata to the cleanup set; in a single pipeline transaction, executing a member removal command for the global expired ordered set index to delete all members in the cleanup set, and executing a sandbox identifier removal command for the team set index corresponding to the target team identifier.

[0043] Among them, a single pipeline transaction is a mechanism that allows multiple database operation commands to be packaged, sent to the database server at once, and executed in a single network interaction, which can greatly reduce network latency overhead.

[0044] The member removal command is the ZREM command. It is specifically used to remove specified triplet-formatted members from a ZSET.

[0045] Among them, the sandbox identifier removal command is, for example, the SREM command, which is used to remove dangling sandbox ID references from the team collection index corresponding to the target team, which causes the index to become bloated.

[0046] In other words, in this embodiment of the application, when the system finds that the sandbox key corresponding to an expired member no longer exists through batch reading, the system will not only add the expired member to the cleanup set to be deleted later, but also parse the triplet format of the member at the same time to accurately extract the team ID and sandbox ID to which the sandbox belongs.

[0047] Secondly, the system obtains the corresponding team collection index key name (team IndexKey) based on the extracted team identifier. Subsequently, the system initiates a single pipeline transaction, appending two cleanup commands to the pipeline consecutively: the first is a sandbox identifier removal command executed on the team collection index (pipe.SREM(team Index Key, sandbox ID)); the second is a batch member removal command executed on the globally expired ordered collection, deleting orphans in the collection to be cleaned up.

[0048] Finally, the system executes the commit command (pipe.Exec()) to simultaneously send and execute the two commands in a single network interaction transaction.

[0049] Step 103: Periodically traverse all sandbox data keys. For each sandbox data key, query its corresponding triple in the global expired ordered set index. If the triple does not exist, it is determined that there is a missing registration. The triple corresponding to the sandbox data key is added to the global expired ordered set index by conditional write.

[0050] Periodic traversal is a process of continuously and cyclically calling the traversal interface at fixed time intervals to perform a full scan of all actually alive sandbox data keys in the system.

[0051] One issue is the omission of entries. If the process crashes the instant the sandbox key write succeeds but the ZSET write fails, an inconsistency arises, causing the sandbox's metadata to exist but not be found in the global expiration index. Due to the lack of ZSET index records, the sandbox will never be discovered by the eviction daemon.

[0052] Optionally, in some embodiments, for each sandbox data key, the corresponding triple in the global expired ordered set index is queried. If the triple does not exist, it is determined that there is a missing registration, and the triple corresponding to the sandbox data key is added to the global expired ordered set index in a conditional write manner. This includes: querying the expiration time score of the triple corresponding to each sandbox data key in the global expired ordered set index through a batch score query command; if the expiration time score is empty and the sandbox creation time corresponding to the sandbox data key exceeds the preset grace period, executing a write command that does not overwrite the existing score to add the triple corresponding to the sandbox data key to the global expired ordered set index.

[0053] The expiration time score corresponds to the weight value of each member in the Global Expiration Set (ZSET). In the business logic of the cloud sandbox platform, this score specifically represents the expiration time stamp of the sandbox's scheduled lifecycle, used by the eviction daemon to determine whether the sandbox has expired.

[0054] The preset grace period is to allow safe time for sandboxes that are being created normally, and to prevent the self-healing timer from misinterpreting normal short-term time differences as missed registrations and making incorrect rewriting interventions.

[0055] In other words, in this embodiment of the application, during the operation of an independent self-healing timed task in the background (such as the startHealer coroutine), after the system has traversed and obtained all the sandbox data keys that are alive, it will construct the triplet to be queried based on the data keys. Then, using the batch scoring query command, it will send a score query to the key-value database at once for the members of this batch of triplets in the global expired ordered set.

[0056] Secondly, the system verifies each score returned by the query. When it finds that the expiration time score of a certain triple is empty, the system does not immediately repair it, but further reads the sandbox creation time recorded in the sandbox metadata. The system calculates the difference between the current time and the creation time. Only when the difference exceeds the preset grace period does the system confirm that this is not a normal write time difference caused by network latency, but a real missed registration caused by anomalies such as historical process crashes, and thus marks it as a missing item that needs to be repaired.

[0057] Finally, for any omitted items identified during the screening process, the system initiates a write command (ZADD NX) that does not overwrite existing scores, replenishing the corresponding triples and initial scores to the globally expired ordered set. Thanks to the idempotency of this write command (NX constraint), even if multiple container groups on the cloud platform are concurrently executing the same self-healing scan task, repeated repair writes will not cause any conflicts, nor will they overwrite the original score data from the normal sandbox, ensuring both the reliability of the eviction mechanism and the absolute security of the production environment.

[0058] The metadata processing method of the cloud sandbox platform in this application introduces a triplet structure containing the execution instance identifier into the global expired ordered set index, thereby achieving instance-level isolation under concurrent operations. This effectively avoids the security risk of accidental deletion of the active index when the sandbox identifier is reused. At the same time, when processing expired members, it synchronously cleans up the dangling team set index with missing metadata, achieving automatic recycling of dirty data with zero additional scanning overhead and preventing the infinite bloat of multi-level index structures. In addition, by periodically traversing all sandbox data keys and supplementing missing triplets through conditional writing, a reliable metadata eventual consistency self-healing mechanism is constructed, completely eliminating the long-term illegal occupation of cloud platform computing resources due to abnormal process crashes. This comprehensively improves the concurrency security, resource utilization, and overall operational stability of metadata management in large-scale cloud sandbox systems.

[0059] Figure 2 This is the second flowchart illustrating the metadata processing method of the cloud sandbox platform provided in this application, such as... Figure 2 As shown, the method includes the following: Step 201: Store the sandbox state metadata in the sandbox data key of the key-value database, store the sandbox identifier in the team set index of the key-value database, and store the triple in the global expired ordered set index of the key-value database. The triple includes the target team identifier, the sandbox identifier, and the execution instance identifier.

[0060] For a detailed description of step 201, please refer to the above embodiments, which will not be repeated here.

[0061] Step 202: In response to the request to obtain the sandbox list of the target team corresponding to the target team identifier, obtain all sandbox identifiers corresponding to the target team.

[0062] Optionally, in some embodiments, obtaining all sandbox identifiers corresponding to the target team includes: The atomic snapshot read command retrieves all sandbox identifiers of the team set index corresponding to the target team identifier at the time of command execution.

[0063] The atomic snapshot read command is the `Set Members` command in Redis. This command is an atomic operation that can return a complete view of the collection's contents at the moment the command is executed, avoiding the duplicate or missed returns that can occur when using cursor pagination scan commands due to concurrent write operations across multiple requests.

[0064] The preset batch is a maximum limit on the number of items read in each batch, set in advance to prevent a single network command from being too large. For example, the sandbox ScanBatchSize constant is 256, and there is no limit to this.

[0065] Among them, multiple subsets refer to the small array slices obtained by dividing the full array of sandbox identifiers into blocks according to the preset maximum length of each batch.

[0066] Reading the sandbox state metadata corresponding to each subset involves constructing the actual key name for each segmented batch ID list and sending a batch retrieval command to the key-value database to pull the corresponding JSON format sandbox state data.

[0067] In this embodiment, when the cloud sandbox platform's interface service receives a request to retrieve a list of sandboxes for a specific team, the system does not employ traditional cursor pagination scanning to avoid generating dirty data due to the concurrent creation or destruction of sandboxes during the reading process. Instead, the interface process constructs an index key name for the team set based on the target team identifier and directly sends a SMEMBERS atomic snapshot read command to the Redis key-value database.

[0068] Step 203: Divide all sandbox identifiers into multiple subsets based on preset batches.

[0069] In this embodiment, after obtaining a full snapshot of the sandbox identifiers, the interface process executes a loop slicing logic based on a fixed step size in memory. The system reads a uniformly preset batch size constant (e.g., sandbox ScanBatchSize=256) and performs cursor offset segmentation on the full sandbox identifier array. For example, by using the logic min(start+batchSize, len(sandbox IDs)), the 513 sandbox IDs obtained above are precisely divided into three subsets: [0,256), [256,512), and [512,513).

[0070] Step 204: Read the sandbox state metadata corresponding to each subset.

[0071] In this embodiment, for the multiple sandbox identifier subsets that have been segmented, the system sequentially initiates batch key-value read operations within a loop. Each loop constructs a request with no more than 256 keys and executes a single batch of MGET commands. During this process, since all sandbox data keys share a hash label containing the target team identifier (such as {team ID}) by design, this ensures from the bottom layer that each batch of requests will be stably routed to the same storage slot in the RedisCluster cluster, completely eliminating the overhead and error caused by cross-slot distribution. After the MGET results of each batch are returned and merged, the application layer performs post-processing on the results: dangling entries that are returned empty due to orphan index remnants are silently skipped, warnings are recorded for data that fails to be parsed, and finally, the successfully deserialized JSON data is filtered according to the request parameters and returned uniformly.

[0072] The metadata processing method of the cloud sandbox platform in this application embodiment fundamentally achieves instance-level isolation and precise management in concurrent scenarios by constructing a triple index containing execution instance identifiers in the underlying storage. When responding to large-scale sandbox list query requests, it uses atomic snapshot technology to obtain the full sandbox identifiers of the team, effectively avoiding data duplication or omission caused by cursor paging scanning during concurrent read and write operations. It also innovatively divides the massive query set into multiple controlled small batch subsets according to preset batches for step-by-step reading, thereby completely eliminating the long-term blocking of the key-value database event loop by a single ultra-large read command, significantly reducing the peak memory usage of the server and the queuing latency of other client requests under the same instance, and greatly ensuring the instantaneous data consistency and overall system throughput response performance of the cloud platform in high-concurrency scenarios.

[0073] Figure 3 This is a schematic diagram of the metadata processing device of the cloud sandbox platform provided in this application, as shown below. Figure 3 As shown, the device includes the following: Storage module 301 is used to store the sandbox state metadata of the sandbox in the sandbox data key of the key-value database, store the sandbox identifier of the sandbox in the team set index of the key-value database, and store the triple in the global expired ordered set index of the key-value database. The triple includes the target team identifier, the sandbox identifier, and the execution instance identifier. The removal module 302 is used to determine the target team identifier and sandbox identifier corresponding to the expired member if it is determined that the sandbox status metadata corresponding to the expired member is missing during the process of processing expired members based on the global expired ordered set index, and simultaneously remove the expired member in the global expired ordered set index and the sandbox identifier in the team set index corresponding to the target team identifier. The write module 303 is used to periodically traverse all sandbox data keys, query the corresponding triplet in the global expired ordered set index for each sandbox data key, and if the triplet does not exist, it is determined that there is a missing registration, and the triplet corresponding to the sandbox data key is added to the global expired ordered set index in a conditional write manner.

[0074] The metadata processing apparatus for a cloud sandbox platform provided in this application further includes: The acquisition module is used to respond to a request to acquire the list of sandboxes corresponding to the target team with the target team identifier, and to acquire all sandbox identifiers corresponding to the target team. The partitioning module is used to divide all sandbox identifiers into multiple subsets based on a preset batch. The read module is used to read the sandbox state metadata corresponding to each subset.

[0075] According to the metadata processing device of the cloud sandbox platform provided in this application, the execution instance identifier is a globally generated identifier that is dynamically generated each time the sandbox is created or resumed from a paused state.

[0076] According to the metadata processing device for a cloud sandbox platform provided in this application, the removal module is specifically used for: Add expired members that are determined to have missing sandbox state metadata to the cleanup set; In a single pipeline transaction, a member removal command is executed on the global expired ordered set index to delete all members in the set to be cleaned up, and a sandbox identifier removal command is executed on the team set index corresponding to the target team identifier.

[0077] According to the metadata processing device for a cloud sandbox platform provided in this application, the writing module is specifically used for: Use the batch scoring query command to query the expiration time score of the triplet corresponding to each sandbox data key in the global expiration ordered set index; If the expiration time score is empty and the sandbox creation time corresponding to the sandbox data key exceeds the preset grace period, execute a write command that does not overwrite the existing score to supplement the triple corresponding to the sandbox data key into the global expiration ordered set index.

[0078] According to the metadata processing device for a cloud sandbox platform provided in this application, the acquisition module is specifically used for: The atomic snapshot read command retrieves all sandbox identifiers of the team set index corresponding to the target team identifier at the time of command execution.

[0079] The metadata processing device of the cloud sandbox platform in this application introduces a triplet structure containing the execution instance identifier into the global expired ordered set index, thereby achieving instance-level isolation under concurrent operations. This effectively avoids the security risk of accidental deletion of the active index when the sandbox identifier is reused. At the same time, when processing expired members, it synchronously cleans up the dangling team set index with missing metadata, achieving automatic recycling of dirty data with zero additional scanning overhead and preventing the infinite bloat of multi-level index structures. In addition, by periodically traversing all sandbox data keys and supplementing missing triplets through conditional writing, a reliable metadata eventual consistency self-healing mechanism is constructed, completely eliminating the long-term illegal occupation of cloud platform computing resources due to abnormal process crashes. This comprehensively improves the concurrency security, resource utilization, and overall operational stability of metadata management in large-scale cloud sandbox systems.

[0080] Figure 4 An example is a schematic diagram of the physical structure of an electronic device, such as... Figure 4 As shown, the electronic device may include: a processor 410, a communications interface 420, a memory 430, and a communication bus 440, wherein the processor 410, the communications interface 420, and the memory 430 communicate with each other via the communication bus 440. The processor 410 can call logical instructions in the memory 430 to execute the metadata processing method of the cloud sandbox platform, which includes: Collect spatial dimensions, operational status data, current set temperature, external environmental data, and inventory status data of the target cold storage facility; Based on the space size information, operating status data and current set temperature, a target digital twin model corresponding to the target cold storage is constructed. The target digital twin model includes multiple spatial regions. Based on the current set temperature, external environmental data, and the location information of the measuring points, determine the predicted temperature information for each spatial region; Based on the predicted temperature information, and the reference storage temperature range and temperature fluctuation threshold of each type of goods in the inventory status data, the temperature matching relationship between each type of goods and each spatial area is predicted. Based on the temperature matching relationship, a temperature control strategy corresponding to each type of goods is generated.

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

[0082] On the other hand, this application also provides a computer program product, which includes a computer program that can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer is able to execute the metadata processing method of the cloud sandbox platform provided by the above methods, the method including: Collect spatial dimensions, operational status data, current set temperature, external environmental data, and inventory status data of the target cold storage facility; Based on the space size information, operating status data and current set temperature, a target digital twin model corresponding to the target cold storage is constructed. The target digital twin model includes multiple spatial regions. Based on the current set temperature, external environmental data, and the location information of the measuring points, determine the predicted temperature information for each spatial region; Based on the predicted temperature information, and the reference storage temperature range and temperature fluctuation threshold of each type of goods in the inventory status data, the temperature matching relationship between each type of goods and each spatial area is predicted. Based on the temperature matching relationship, a temperature control strategy corresponding to each type of goods is generated.

[0083] Furthermore, this application also provides a non-transitory computer-readable storage medium storing a computer program thereon, which, when executed by a processor, is implemented to perform the metadata processing method of the cloud sandbox platform provided by the methods described above, the method comprising: Collect spatial dimensions, operational status data, current set temperature, external environmental data, and inventory status data of the target cold storage facility; Based on the space size information, operating status data and current set temperature, a target digital twin model corresponding to the target cold storage is constructed. The target digital twin model includes multiple spatial regions. Based on the current set temperature, external environmental data, and the location information of the measuring points, determine the predicted temperature information for each spatial region; Based on the predicted temperature information, and the reference storage temperature range and temperature fluctuation threshold of each type of goods in the inventory status data, the temperature matching relationship between each type of goods and each spatial area is predicted. Based on the temperature matching relationship, a temperature control strategy corresponding to each type of goods is generated.

[0084] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate, and 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 modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.

[0085] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., including several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods of various embodiments or some parts of embodiments.

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

Claims

1. A metadata processing method for a cloud sandbox platform, characterized in that, The method includes: The sandbox state metadata is stored in the sandbox data key of the key-value database, the sandbox identifier is stored in the team set index of the key-value database, and the triple is stored in the global expired ordered set index of the key-value database. The triple includes the target team identifier, the sandbox identifier, and the execution instance identifier. During the process of processing expired members based on the global expired ordered set index, if it is determined that the sandbox status metadata corresponding to the expired member is missing, then the target team identifier and the sandbox identifier corresponding to the expired member are determined, and the expired member in the global expired ordered set index and the sandbox identifier in the team set index corresponding to the target team identifier are removed simultaneously. Periodically traverse all sandbox data keys, and for each sandbox data key, query its corresponding triple in the global expired ordered set index. If the triple does not exist, it is determined that there is a missing registration, and the triple corresponding to the sandbox data key is added to the global expired ordered set index in a conditional write manner.

2. The method according to claim 1, characterized in that, The method further includes: In response to a request to obtain a list of sandboxes for a target team corresponding to a target team identifier, obtain all sandbox identifiers corresponding to the target team; Based on a preset batch, all sandbox identifiers are divided into multiple subsets; Read the sandbox state metadata corresponding to each subset.

3. The method according to claim 1, characterized in that, The execution instance identifier is a globally generated identifier that is dynamically generated each time the sandbox is created or resumed from a paused state.

4. The method according to claim 1, characterized in that, The synchronous removal of expired members from the globally expired ordered set index and the sandbox identifier from the team set index corresponding to the target team identifier includes: Add the expired members that are determined to have missing sandbox state metadata to the cleanup set; In a single pipeline transaction, a member removal command is executed on the global expired ordered set index to delete all members in the set to be cleaned up, and a sandbox identifier removal command is executed on the team set index corresponding to the target team identifier.

5. The method according to claim 1, characterized in that, The step of querying the corresponding triplet for each sandbox data key in the global expired ordered set index, and if the triplet does not exist, determines that there is a missing registration, and adds the triplet corresponding to the sandbox data key to the global expired ordered set index using a conditional write method, includes: Use the batch scoring query command to query the expiration time score of the triplet corresponding to each sandbox data key in the global expiration ordered set index. If the expiration time score is empty and the sandbox creation time corresponding to the sandbox data key exceeds the preset grace period, execute a write command that does not overwrite the existing score to supplement the triple corresponding to the sandbox data key into the global expiration ordered set index.

6. The method according to claim 2, characterized in that, The step of obtaining all sandbox identifiers corresponding to the target team includes: The atomic snapshot read command retrieves all sandbox identifiers at the time of command execution, corresponding to the team set index of the target team identifier.

7. A metadata processing device for a cloud sandbox platform, characterized in that, include: The storage module is used to store the sandbox state metadata of the sandbox in the sandbox data key of the key-value database, store the sandbox identifier of the sandbox in the team set index of the key-value database, and store the triple in the global expired ordered set index of the key-value database, wherein the triple includes the target team identifier, the sandbox identifier, and the execution instance identifier; The removal module is used to determine the target team identifier and the sandbox identifier corresponding to the expired member if it is determined that the sandbox status metadata corresponding to the expired member is missing during the process of processing expired members based on the global expired ordered set index, and simultaneously remove the expired member from the global expired ordered set index and the sandbox identifier from the team set index corresponding to the target team identifier. The write module is used to periodically traverse all sandbox data keys, query the corresponding triple in the global expired ordered set index for each sandbox data key, and if the triple does not exist, it is determined that there is a missing registration, and the triple corresponding to the sandbox data key is added to the global expired ordered set index in a conditional write manner.

8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that, When the processor executes the computer program, it implements the metadata processing method of the cloud sandbox platform as described in any one of claims 1 to 6.

9. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the metadata processing method of the cloud sandbox platform as described in any one of claims 1 to 6.

10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by the processor, it implements the metadata processing method of the cloud sandbox platform as described in any one of claims 1 to 6.