Method and device for verifying operating environment of cloud platform and computer program product

By comparing the actual and expected environment parameters when the target container starts up on the cloud platform, calculating the accuracy rate and automatically verifying it, the problem of container environment duplication caused by the duplicate configuration of multiple sets of environment parameters on the cloud platform is solved, and higher accuracy environment verification and security are achieved.

CN121501424APending Publication Date: 2026-02-10INDUSTRIAL AND COMMERCIAL BANK OF CHINA
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202511723510.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-11-21
Publication Date
2026-02-10

AI Technical Summary

Technical Problem

In existing technologies, the problem of container string environment caused by the duplicate configuration of multiple sets of environment parameters on cloud platforms cannot be effectively identified and avoided, resulting in data chaos and security risks.

Method used

When the target container starts on the cloud platform, the actual environment parameters are compared with the expected environment parameters to calculate the parameter accuracy rate. The container runtime environment verification is determined to be passed when the parameter accuracy rate reaches the threshold. This includes automated environment version switching and parameter verification mechanisms.

Benefits of technology

It improves the depth and accuracy of cloud platform runtime environment verification, avoiding the situation where a container passes health checks but the actual runtime environment is misconfigured, ensuring that containers run under the correct configuration, and preventing data corruption and security risks.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121501424A_ABST
    Figure CN121501424A_ABST
Patent Text Reader

Abstract

The invention discloses a running environment verification method and device of a cloud platform and a computer program product. The method relates to the field of cloud computing and comprises the steps that under the condition that it is detected that a target container of a cloud platform is started, actual environment parameters of the target container are obtained, and the actual environment parameters are configuration parameters which the target container depends on when the target container currently runs on the cloud platform; a target environment version of the environment needing to be operated by the target container is determined, expected environment parameters of the target environment version are obtained, and the cloud platform deploys operation environments of multiple environment versions; comparing the actual environment parameters with the expected environment parameters to obtain a comparison result, and calculating parameter accuracy based on the comparison result; and when the parameter correct rate is greater than or equal to a correct rate threshold value, determining that the operation environment verification of the target container is passed. Through the method and the device, the problem of a container string environment caused by repeated configuration of multiple sets of environmental parameters of a cloud platform in related technologies is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of cloud computing, and more specifically, to a method, apparatus, and computer program product for verifying the operating environment of a cloud platform. Background Technology

[0002] In cloud computing architectures, the cloud platform's runtime environment has become a critical infrastructure for software development and deployment. It allows developers to build, host, and manage applications on a unified platform without needing to concern themselves with the details of the underlying hardware. Cloud platform environment detection mechanisms in related technologies rely on container health checks, assessing container status by monitoring whether applications within containers can start and run normally. If a container passes the health check, meaning the application within it can start successfully, it can be inferred that the entire cloud platform environment is functioning correctly. However, relying solely on container health checks to assess the effectiveness and configuration correctness of a cloud platform environment has significant limitations. First, while health checks can verify whether a container can start, they cannot delve into the availability of the environment, especially when multiple environments coexist. In practice, cloud platforms often need to support multiple environments running in parallel, such as development, testing, pre-production, and production environments. Each environment may have different parameter configurations, such as database connection information, batch processing machine addresses, and access points for other critical services. This shallow container health check fails to provide sufficient mechanisms to ensure that parameter configurations do not conflict between multiple environments.

[0003] For example, a container in a development environment might be configured to connect to a production environment database. This might not immediately reveal problems during health checks within the container, but when the container is actually deployed, it can lead to data corruption and security risks—a phenomenon known as "cross-environment" issues. Environment detection mechanisms in related technologies are ineffective at identifying and preventing duplicate parameter configurations, and they cannot distinguish the true availability of multiple environments. This is especially problematic in scenarios with highly similar parameter configurations, potentially leading to serious environment management and data security issues.

[0004] There is currently no effective solution to the problem of containerized environments caused by duplicate configurations of multiple sets of environment parameters on cloud platforms in related technologies. Summary of the Invention

[0005] The main purpose of this application is to provide a method, apparatus and computer program product for verifying the operating environment of a cloud platform, so as to solve the problem of container environment duplication caused by the duplicate configuration of multiple sets of environment parameters of the cloud platform in the related technology.

[0006] To achieve the above objectives, according to one aspect of this application, a method for verifying the runtime environment of a cloud platform is provided. The method includes: upon detecting the startup of a target container on the cloud platform, obtaining the actual environment parameters of the target container, wherein the actual environment parameters are the configuration parameters that the target container currently depends on while running on the cloud platform; determining the target environment version of the environment that the target container needs to run, and obtaining the expected environment parameters of the target environment version, wherein the cloud platform deploys multiple environment versions of the runtime environment; comparing the actual environment parameters and the expected environment parameters to obtain a comparison result, and calculating a parameter accuracy rate based on the comparison result; if the parameter accuracy rate is greater than or equal to an accuracy rate threshold, determining that the runtime environment verification of the target container has passed.

[0007] Optionally, after calculating the parameter accuracy based on the comparison results, the method further includes: if the parameter accuracy is less than the accuracy threshold, determining that the runtime environment verification of the target container has failed, and issuing a prompt message, wherein the prompt message is used to indicate that the runtime environment version is incorrect; switching the runtime environment version of the target container, and determining the parameter accuracy of the current environment version based on the switched environment version, until the parameter accuracy is greater than or equal to the accuracy threshold.

[0008] Optionally, obtaining the expected environment parameters for the target environment version includes: receiving environment parameter data entered by the user, parsing the environment parameter data, and obtaining the name and value of each environment parameter for the target environment version; performing data integrity verification on the name and value of each environment parameter; issuing a second prompt message if the data integrity verification of the name and value of at least one environment parameter fails, wherein the second prompt message is used to indicate an environment parameter abnormality; and determining the names and values ​​of all environment parameters for the target environment version as the expected environment parameters if the data integrity verification of the names and values ​​of all environment parameters passes.

[0009] Optionally, comparing the actual environment parameters with the expected environment parameters to obtain the comparison results includes: deploying an assertion program on the node corresponding to the target container in the cloud platform, and controlling the assertion program to load the expected environment parameters; matching the expected environment parameters with the actual environment parameters to obtain the matching results, wherein the matching results contain multiple sets of environment parameters, each set of environment parameters contains the actual value and the expected value of the same type of environment parameter, the actual value is the value in the actual environment parameter, and the expected value is the value in the expected environment parameter; comparing the actual value and the expected value of each set of environment parameters in the matching results to obtain the comparison results of each set of environment parameters, and the comparison results of each set of environment parameters constitute the comparison results of the actual environment parameters and the expected environment parameters.

[0010] Optionally, comparing the actual and expected values ​​of each set of environment parameters in the matching results includes: sequentially traversing each set of environment parameters in the matching results to determine the current set of environment parameters to be compared; if the set of environment parameters to be compared is a time parameter, skipping the comparison of that set of environment parameters, where the time parameter is a parameter that changes over time; if the set of environment parameters to be compared is a dynamic parameter, performing a fuzzy comparison between the actual value and the expected value of the dynamic parameter, where the dynamic parameter is a parameter that changes with the startup of the target container; if the set of environment parameters to be compared is a threshold parameter, comparing the actual value and the expected threshold range of the threshold parameter; if the set of environment parameters to be compared is an encrypted parameter, decrypting the actual value and the expected value of the encrypted parameter, and comparing the actual value with the plaintext after decryption of the expected value.

[0011] Optionally, calculating the parameter accuracy based on the comparison results includes: determining the number of targets whose actual and expected values ​​match, and the total number of all comparison results; calculating the ratio of the number of targets to the total number to obtain the parameter accuracy.

[0012] Optionally, after obtaining the parameter accuracy, the method further includes: obtaining the abnormal environmental parameters that characterize the mismatch between the actual and expected values ​​in the comparison results; and writing the abnormal environmental parameters, parameter accuracy, and target quantity into the target log.

[0013] To achieve the above objectives, according to another aspect of this application, a cloud platform runtime environment verification device is provided. The device includes: an acquisition unit, configured to acquire actual environment parameters of the target container when the startup of a target container on the cloud platform is detected, wherein the actual environment parameters are configuration parameters that the target container currently depends on while running on the cloud platform; a first determination unit, configured to determine the target environment version of the environment that the target container needs to run on, and acquire the expected environment parameters of the target environment version, wherein the cloud platform deploys multiple environment versions of the runtime environment; a comparison unit, configured to compare the actual environment parameters and the expected environment parameters to obtain a comparison result, and calculate a parameter accuracy rate based on the comparison result; and a second determination unit, configured to determine that the runtime environment verification of the target container has passed if the parameter accuracy rate is greater than or equal to an accuracy rate threshold.

[0014] In this embodiment, upon detecting the startup of a target container on the cloud platform, the actual environment parameters of the target container are obtained. These actual environment parameters are the configuration parameters that the target container currently relies on while running on the cloud platform. The target environment version required by the target container is determined, and the expected environment parameters for that version are obtained. The cloud platform deploys multiple environment versions. The actual environment parameters and the expected environment parameters are compared to obtain a comparison result, and the parameter accuracy rate is calculated based on this result. If the parameter accuracy rate is greater than or equal to a threshold, the target container's runtime environment verification is considered successful. By comparing the actual and expected environment parameters, it is ensured that the container runs in the correct configuration environment, avoiding situations where the container health check passes but the actual runtime environment configuration is incorrect. This achieves the goal of improving the depth and accuracy of cloud platform runtime environment verification, thereby avoiding cloud platform environment configuration conflicts and errors, and ultimately solving the technical problem of container environment conflicts caused by duplicate configurations of multiple sets of environment parameters on the cloud platform. Attached Figure Description

[0015] The accompanying drawings, which form part of this application, are used to provide a further understanding of this application. The illustrative embodiments and descriptions of this application are used to explain this application and do not constitute an undue limitation of this application. In the drawings:

[0016] Figure 1 A hardware structure block diagram of a computer terminal (or mobile device) for implementing a cloud platform runtime environment verification method is shown.

[0017] Figure 2 This is a flowchart of a cloud platform runtime environment verification method provided in the embodiments of this application;

[0018] Figure 3 This is a schematic diagram of a cloud platform runtime environment verification system provided according to an embodiment of this application;

[0019] Figure 4 This is a schematic diagram of an optional cloud platform runtime environment verification method provided according to an embodiment of this application;

[0020] Figure 5 This is a schematic diagram of a cloud platform runtime environment verification device provided according to an embodiment of this application;

[0021] Figure 6 This is a structural block diagram of an electronic device according to an embodiment of this application. Detailed Implementation

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

[0023] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0024] It should be noted that the information collected in this application (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for display, data used for analysis, etc.) are information and data authorized by the user or fully authorized by all parties. Furthermore, the collection, storage, use, processing, transmission, provision, disclosure, and application of this data all comply with relevant laws, regulations, and standards, necessary confidentiality measures have been taken, and they do not violate public order and good morals. Corresponding access points are provided for users to choose to authorize or refuse. For example, interfaces are set up between this system and relevant users or organizations, providing users with corresponding access points to choose to agree to or refuse automated decision-making results; if the user chooses to refuse, the process proceeds to the expert decision-making stage.

[0025] Example 1

[0026] According to an embodiment of this application, a method embodiment for verifying the operating environment of a cloud platform is also provided. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than that shown here.

[0027] The method embodiment provided in Embodiment 1 of this application can be executed on a mobile terminal, computer terminal, or similar computing device. Figure 1A hardware structure block diagram of a computer terminal (or mobile device) for implementing a cloud platform runtime environment verification method is shown. Figure 1 As shown, the computer terminal 10 (or mobile device) may include one or more processors 102 (shown as 102a, 102b, ..., 102n in the figure) 102 (processor 102 may include, but is not limited to, processing devices such as MCU (Microcontroller Unit) or FPGA (Field-Programmable Gate Array), memory 104 for storing data, and transmission device 106 for communication functions. In addition, it may also include: a display, input / output interfaces (I / O interfaces), a USB (Universal Serial Bus) port (which may be included as one of the ports of a BUS (Business Bus), a network interface, a power supply, and / or a camera. Those skilled in the art will understand that... Figure 1 The structure shown is for illustrative purposes only and does not limit the structure of the aforementioned electronic device. For example, computer terminal 10 may also include... Figure 1 The more or fewer components shown, or having the same Figure 1 The different configurations shown.

[0028] It should be noted that the aforementioned one or more processors 102 and / or other data processing circuits are generally referred to herein as "data processing circuits". These data processing circuits may be embodied, in whole or in part, in software, hardware, firmware, or any other combination thereof. Furthermore, the data processing circuits may be a single, independent processing module, or may be integrated, in whole or in part, into any other element within the computer terminal 10 (or mobile device). As involved in the embodiments of this application, the data processing circuits serve as a processor control mechanism (e.g., selection of a variable resistor termination path connected to an interface).

[0029] The memory 104 can be used to store software programs and modules of application software, such as the program instructions / data storage device corresponding to the cloud platform runtime environment verification method in this embodiment. The processor 102 executes various functional applications and data processing by running the software programs and modules stored in the memory 104, thereby realizing the aforementioned cloud platform runtime environment verification method. The memory 104 may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include memory remotely located relative to the processor 102, and these remote memories can be connected to the computer terminal 10 via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.

[0030] The transmission device 106 is used to receive or send data via a network. Specific examples of the network described above may include a wireless network provided by the communication provider of the computer terminal 10. In one example, the transmission device 106 includes a Network Interface Controller (NIC), which can connect to other network devices via a base station to communicate with the Internet. In another example, the transmission device 106 may be a Radio Frequency (RF) module, used for wireless communication with the Internet.

[0031] The display may be, for example, a touchscreen LCD display that allows the user to interact with the user interface of the computer terminal 10 (or mobile device).

[0032] Under the above operating environment, this application provides a method for verifying the operating environment of a cloud platform. Figure 2 This is a flowchart of a cloud platform runtime environment verification method provided in the embodiments of this application, such as... Figure 2 As shown, the method includes:

[0033] Step S201: When the target container on the cloud platform is detected to be running, the actual environment parameters of the target container are obtained. The actual environment parameters are the configuration parameters that the target container depends on when it is running on the cloud platform.

[0034] In step S201, the cloud platform is a platform for managing cloud-based applications, helping developers quickly build and deploy applications, and providing a series of services including databases, caching, and load balancing. Containers are virtual, containing programs and system configurations (i.e., dependencies and environments). They require the physical machine's operating system kernel; all three are necessary for them to run. The configurations and parameters that each application's container depends on are collectively referred to as the environment. During version development, multiple environments are used in rotation, such as environment version A, environment version B, environment version C, environment version D, and environment version F. The parameters in these environments often differ, and their values ​​are controlled through environment variables. For example, environment version A connects to database DB1, and environment version B connects to database DB2. The variable values ​​between environments are managed through a configuration center. When the variable values ​​in the configuration center do not match the corresponding environment information, it can lead to environment confusion and cross-environment issues. For example, a transaction is sent to environment version A, the transaction succeeds, but the transaction result is recorded in DB2.

[0035] When the target container starts on the cloud platform, the system automatically detects the container's startup status. Once successful startup is confirmed, the system accesses the container's internal or cloud platform configuration information through various methods to obtain the target container's actual environment parameters. Environment parameters may include, but are not limited to, database connection parameters: including the database server's address, port, username, and password, which are crucial for data processing and storage. Service port parameters: referring to the service ports provided by the container for network communication and other service calls. Network configuration parameters: such as DNS (Domain Name System) server addresses, network isolation settings, firewall rules, etc., ensuring the correctness and security of container network access. Storage volume parameters: defining the location and method of container data storage, such as the mount volume path and data persistence settings. Environment variables: containing various parameters required at runtime, such as application configuration, log levels, and debug modes.

[0036] Step S202: Determine the target environment version that the target container needs to run in, and obtain the expected environment parameters of the target environment version. The cloud platform deploys multiple environment versions of the runtime environment.

[0037] In step S202, the environment version on the cloud platform refers to different runtime environments, which may be used for different stages such as development, testing, pre-production, and production. Each environment version has its specific configuration parameters, which are customized according to the characteristics and requirements of the environment. Determining the environment version that the target container needs to run is based on the container's metadata, configuration files, or runtime parameters. The container's metadata usually contains information about its environment version, for example, specifying that the container is running in a production environment through the environment variable ENV=production. In addition, the container's configuration files or runtime parameters may also directly or indirectly indicate its runtime environment version. The process of determining the environment version ensures that the container can access the correct configuration parameters at startup, avoiding environment confusion.

[0038] After determining the target environment version, obtain the expected environment parameters for that version from the configuration center or the environment's configuration file. Expected environment parameters can be configuration parameters that the user extracts and enters that they expect the container to have at runtime. By comparing these expected parameters with the actual environment parameters of the target container, you can check whether the container is configured correctly and whether it can run stably in the current environment.

[0039] Step S203: Compare the actual environmental parameters with the expected environmental parameters to obtain the comparison results, and calculate the parameter accuracy rate based on the comparison results.

[0040] In step S203, the actual environmental parameters and expected environmental parameters are traversed, and the value of each parameter is compared one by one, recording which parameters match completely and which have differences. The number of matching parameters in the comparison results is counted; the total number of parameters is counted; finally, the number of matching parameters is divided by the total number of parameters to obtain the parameter accuracy rate.

[0041] Step S204: If the parameter accuracy rate is greater than or equal to the accuracy rate threshold, the runtime environment verification of the target container is determined to be passed.

[0042] In step S204, the parameter accuracy reflects the accuracy of the runtime environment configuration. The accuracy threshold is a baseline established during the parameter accuracy calculation to determine whether the container's runtime environment passes verification. Only when the parameter accuracy is greater than or equal to this threshold is the container's runtime environment configuration considered correct, and it can proceed to the next running state. After the parameter accuracy calculation is completed, if the parameter accuracy reaches or exceeds the accuracy threshold, the target container's runtime environment verification is considered successful. This indicates that the container's environment parameter configuration matches the expected environment version parameters, and the container can run safely and stably in the current environment.

[0043] The cloud platform runtime environment verification method provided in this application, upon detecting the startup of a target container on the cloud platform, obtains the actual environment parameters of the target container, which are the configuration parameters that the target container currently depends on while running on the cloud platform; determines the target environment version that the target container needs to run on, and obtains the expected environment parameters for the target environment version, wherein the cloud platform deploys multiple environment versions of the runtime environment; compares the actual environment parameters with the expected environment parameters to obtain a comparison result, and calculates the parameter accuracy rate based on the comparison result; if the parameter accuracy rate is greater than or equal to the accuracy rate threshold, it is determined that the runtime environment verification of the target container has passed. By comparing the actual environment parameters with the expected environment parameters, it can ensure that the container is running in the correct configuration environment, avoiding the situation where the container health check passes but the actual runtime environment is configured incorrectly. This achieves the goal of improving the depth and accuracy of cloud platform runtime environment verification, thereby realizing the technical effect of avoiding cloud platform environment configuration conflicts and errors, and thus solving the technical problem of container environment conflicts caused by the duplication of multiple sets of environment parameter configurations on the cloud platform.

[0044] If the runtime environment verification fails, the environment version needs to be switched. Optionally, in the runtime environment verification method of the cloud platform provided in this application embodiment, after calculating the parameter accuracy rate based on the comparison results, the method further includes: if the parameter accuracy rate is less than the accuracy rate threshold, determining that the runtime environment verification of the target container has failed, and issuing a prompt message, wherein the prompt message is used to indicate that the runtime environment version is incorrect; switching the runtime environment version of the target container, and determining the parameter accuracy rate of the current environment version based on the switched environment version, until the parameter accuracy rate is greater than or equal to the accuracy rate threshold.

[0045] In some embodiments, upon container startup, the actual environment parameters of the container are automatically detected and compared with the expected environment parameters to calculate the parameter accuracy rate. If the parameter accuracy rate is lower than the accuracy rate threshold, it indicates a problem with the container's environment configuration. An immediate alert is issued to notify operations personnel that the container's runtime environment verification has failed, indicating a possible environment version error, so that intervention can be initiated as soon as possible. Based on the alert, operations personnel or the automated system switch the environment version running on the target container. After switching, the parameter accuracy rate is reassessed, i.e., the actual environment parameters of the container are compared again with the expected environment parameters of the new environment version to ensure that the container is running in the correct configuration environment.

[0046] If the parameter accuracy rate remains below the threshold, the system will continue to issue prompts and switch the environment version again until the parameter accuracy rate is higher than or equal to the accuracy rate threshold, meaning the runtime environment verification passes. Environment switching and parameter verification are implemented through preset scripts or configuration management tools; however, monitoring and intervention by operations and maintenance personnel are also necessary, especially in complex or abnormal situations, where manual judgment and decision-making remain essential.

[0047] This embodiment ensures that the container always runs under the correct environment version through closed-loop adjustment, avoiding the risk of service interruption or data corruption, and enhancing the stability and reliability of the system. The automated environment switching and parameter verification mechanism reduces the time required for manual intervention, speeds up problem identification and resolution, and improves overall response efficiency.

[0048] The expected environment parameters can be entered by the user. Optionally, in the cloud platform runtime environment verification method provided in this application embodiment, obtaining the expected environment parameters of the target environment version includes: receiving environment parameter data entered by the user, parsing the environment parameter data, and obtaining the name and parameter value of each environment parameter of the target environment version; performing data integrity verification on the name and parameter value of each environment parameter; issuing a second prompt message if the data integrity verification of the name and parameter of at least one environment parameter fails, wherein the second prompt message is used to indicate that the environment parameter is abnormal; and determining the name and parameter value of all environment parameters of the target environment version as the expected environment parameters if the data integrity verification of the name and parameter of all environment parameters passes.

[0049] In some embodiments, the expected environment parameters can be entered by the user. After receiving the entered environment parameter data, it is parsed to extract the name and value of each environment parameter under the target environment version. Data integrity verification is performed on the parsed name and value of each environment parameter. Verification may include mandatory field checks (e.g., environment version, parameter name cannot be empty), data format verification, etc. If at least one environment parameter name or value fails the verification (e.g., parameter name is missing or parameter value format is invalid), the system will issue a "second prompt message" indicating which environment parameters are abnormal and require user correction.

[0050] If the names and values ​​of all environment parameters pass the integrity check, the names and values ​​of these environment parameters that pass the check are determined as the "expected environment parameters" for this target environment version.

[0051] This embodiment effectively reduces configuration errors caused by human negligence through data integrity verification, thereby improving the success rate of container deployment. Correct environment parameters prevent containers from mistakenly connecting to insecure databases or networks, protecting data and system security. Timely error alerts allow users to quickly locate and correct problems, avoiding prolonged waiting times and unnecessary service interruptions.

[0052] To ensure the correctness of the environment version, it is necessary to compare and verify the environment parameters. Optionally, in the cloud platform runtime environment verification method provided in this application embodiment, comparing the actual environment parameters with the expected environment parameters to obtain the comparison result includes: deploying an assertion program on the node corresponding to the target container in the cloud platform, and controlling the assertion program to load the expected environment parameters; matching the expected environment parameters with the actual environment parameters to obtain a matching result, wherein the matching result contains multiple sets of environment parameters, each set of environment parameters contains the actual value and the expected value of the same type of environment parameter, the actual value is the value in the actual environment parameter, and the expected value is the value in the expected environment parameter; comparing the actual value and the expected value of each set of environment parameters in the matching result to obtain the comparison result of each set of environment parameters, and the comparison results of each set of environment parameters constitute the comparison result of the actual environment parameters and the expected environment parameters.

[0053] In some embodiments, an assertion is deployed on the node where the target container resides. This assertion can be automatically injected at container startup or pre-installed as part of the container's build process. The assertion is designed to load expected environment parameter data from user input. This data contains the expected names and values ​​of all environment parameters for the target environment version. The assertion first matches the actual environment parameters of the target container against the expected environment parameters. This process produces a matching result containing comparison information for all environment parameters of the same type, i.e., the actual and expected values ​​for each group of environment parameters. For example, the actual and expected values ​​for database connection strings, network ports, etc. For each group of environment parameters in the matching result, the assertion performs an item-by-item comparison between the actual and expected values ​​to determine whether they match. The comparison result indicates in detail which parameters match completely and which parameters differ.

[0054] This embodiment deploys assertion programs on the nodes of the target container and compares the expected environment parameters with the actual environment parameters. This enables automatic detection of configuration errors at the system level, preventing the container from running under incorrect environment parameters and thus avoiding service interruptions or performance degradation.

[0055] Different comparison methods are selected for different types of environmental parameters. Optionally, in the cloud platform runtime environment verification method provided in this application embodiment, comparing the actual value and expected value of each set of environmental parameters in the matching result includes: sequentially traversing each set of environmental parameters in the matching result to determine the set of environmental parameters that need to be compared; if the set of environmental parameters to be compared is a time parameter, skipping the comparison of that set of environmental parameters, where the time parameter is a parameter that changes over time; if the set of environmental parameters to be compared is a dynamic parameter, performing a fuzzy comparison between the actual value and the expected value of the dynamic parameter, where the dynamic parameter is a parameter that changes with the startup of the target container; if the set of environmental parameters to be compared is a threshold parameter, comparing the actual value and the expected threshold range of the threshold parameter; if the set of environmental parameters to be compared is an encrypted parameter, decrypting the actual value and the expected value of the encrypted parameter, and comparing the actual value and the plaintext after decryption.

[0056] In some embodiments, the assertion program iterates through each set of environment parameters in the matching results, each set containing the actual and expected values ​​of the same type of environment parameter. The program identifies whether the currently iterated environment parameter is a time parameter; if so, the comparison is skipped because such parameters change over time, and their values ​​are typically not determined by the expected parameter. Examples include system startup time and event log timestamps. For dynamic parameters that change with the target container's startup, such as randomly generated keys or dynamically assigned port numbers, the assertion program uses a fuzzy comparison method to check whether the actual value matches the pattern or rule of the expected value. This comparison method focuses more on the parameter's format or attributes than its specific numerical value.

[0057] For parameters with defined expected threshold ranges, such as network bandwidth limits and disk I / O rate limits, the assertion program checks whether the actual value falls within the expected threshold range. If the actual value exceeds the expected range, even if it is near the threshold boundary, it is considered a mismatch. When encountering encrypted parameters, the assertion program first decrypts the actual and expected values, converts them to plaintext, and then compares them. This process ensures the correctness of encrypted parameters while protecting sensitive information.

[0058] This embodiment classifies and processes different types of environmental parameters, enabling the assertion program to more accurately determine the correctness of the parameters and avoid verification errors caused by misjudgment of parameter types.

[0059] After obtaining the comparison results, the parameter accuracy rate is calculated based on the comparison results. Optionally, in the cloud platform operation environment verification method provided in this application embodiment, the calculation of the parameter accuracy rate based on the comparison results includes: determining the target number of actual values ​​and expected values ​​that match the comparison results, and the total number of all comparison results; calculating the ratio of the target number to the total number to obtain the parameter accuracy rate.

[0060] In some embodiments, firstly, the number of environmental parameters whose actual values ​​match the expected values ​​in the comparison results is counted; this is called the "target number". These parameters are exactly consistent with the expected settings in the actual running container, representing the accuracy of the environmental parameter configuration. Next, the total number of all environmental parameters participating in the comparison is counted; this is called the "total number". This includes all environmental parameters, regardless of whether they match the expected values. Finally, the parameter accuracy is obtained by calculating the ratio between the target number and the total number.

[0061] This embodiment calculates the parameter accuracy rate to obtain a quantitative indicator to evaluate the correctness of the container environment parameters, and determines whether the container can start and run normally based on the parameter accuracy rate.

[0062] For each environmental parameter verification, auditing is performed through the target log. Optionally, in the cloud platform runtime environment verification method provided in this application embodiment, after obtaining the parameter accuracy rate, the method further includes: obtaining the comparison results to characterize abnormal environmental parameters where the actual value and the expected value do not match; and writing the abnormal environmental parameters, parameter accuracy rate, and target quantity into the target log.

[0063] In some embodiments, the assertion program analyzes and compares the results to identify environmental parameters whose actual and expected values ​​do not match; these parameters are called anomalous environmental parameters. This includes anomalous cases for all types of environmental parameters, such as ignoring time parameters, inconsistent fuzzy comparisons of dynamic parameters, threshold parameters exceeding the expected range, and decrypted values ​​of encrypted parameters not matching expectations. The assertion program collects information on all anomalous environmental parameters, such as the parameter name, actual value, expected value, and possible parameter types (e.g., dynamic parameters, threshold parameters, etc.). The assertion program writes the anomalous environmental parameters, parameter accuracy, and target number to the target log file.

[0064] This embodiment allows operations and maintenance personnel to quickly locate and correct problems in container configurations by recording abnormal environment parameters in the logs. The logs record historical parameter accuracy and abnormal environment parameters, which can be used for trend analysis to predict potential configuration issues and system bottlenecks.

[0065] According to another embodiment of this application, a cloud platform runtime environment verification system is also provided. Figure 3 This is a schematic diagram of a cloud platform runtime environment verification system provided according to an embodiment of this application, such as... Figure 3 As shown, the system includes: an expected value input module, a basic verification module, a parameter assertion module, and a result output module.

[0066] The expected value input module enables users to input expected values ​​for container configuration parameters. The input is in tabular format, with expandable rows and columns. Typically, the first row defines the variable name, and the remaining rows contain the expected parameter values. Environment version, functional scenario, and container name are mandatory fields. Table 1 shows the input expected environment parameters.

[0067] Table 1

[0068]

[0069] The basic validation module receives user-entered data, parses out the specific variable names and corresponding variable values, and performs basic validations such as mandatory field checks. If an environment version error or a mandatory field is empty, the module returns the corresponding error description.

[0070] The parameter assertion module is used to assert container parameters against user-entered expected values ​​of variables. First, when the container starts, an agent is deployed to the container node to install the assertion program. The assertion program actively loads the user-inputted expected values ​​of variables and compares them with the container's own parameters. Personalized comparisons are supported: parameters that change over time, such as timestamps, can be skipped during comparison. Parameters that change with container startup, such as a container acquiring a new IP after a restart, support fuzzy comparison, allowing IP changes but requiring verification that the comparison is within the expected subnet. Parameters with changing thresholds, such as sudden traffic spikes causing CPU utilization to jump from 30% to 90%, support setting dynamic thresholds for comparison. Sensitive data parameters: parameters where different encryption methods or specific salt values ​​in the environment result in inconsistent encrypted values, but the actual plaintext is the same. For these types of parameter comparisons, the system reverse-decrypts the encrypted password in the target environment and then compares the results.

[0071] The results output module outputs the environment parameter accuracy rate and comparison results details. The numerator is the sum of the parameter fields that passed the assertions, and the denominator is the sum of all parameter fields. A ratio is calculated by comparing the numerator and denominator; this ratio is the environment parameter accuracy rate and is written to the log. Details of whether assertions passed or failed after script execution are also written to the log as environment configuration validity details. All logs are output to a fixed directory for the caller to view.

[0072] This embodiment also provides an optional cloud platform runtime environment verification method applied to the aforementioned cloud platform runtime environment verification system. Figure 4 This is a schematic diagram of an optional cloud platform runtime environment verification method provided according to an embodiment of this application, such as... Figure 4As shown, the system receives user-entered data, including environment version, container name, variable name, and expected variable values. It parses the entered data and performs basic validations such as mandatory checks. It performs assertion comparisons between container parameters and expected variable values. Finally, it outputs the environment parameter accuracy rate and details of environment configuration validity.

[0073] This embodiment utilizes a cloud platform runtime environment verification system to ensure containers run under correct configurations, preventing service interruptions or data corruption caused by configuration errors. Automated parameter verification enhances cloud platform stability and reduces the frequency of failures. The output of environment parameter accuracy and configuration validity details provides operations and maintenance personnel with intuitive troubleshooting clues, improving problem-solving speed.

[0074] It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions, and although a logical order is shown in the flowchart, in some cases the steps shown or described may be executed in a different order than that shown here.

[0075] Example 2

[0076] This application also provides a cloud platform runtime environment verification device. It should be noted that the cloud platform runtime environment verification device of this application can be used to execute the cloud platform runtime environment verification method provided in this application. The following describes the cloud platform runtime environment verification device provided in this application.

[0077] According to an embodiment of this application, an apparatus for implementing the above-described cloud platform runtime environment verification method is also provided. Figure 5 This is a schematic diagram of a cloud platform runtime environment verification device provided according to an embodiment of this application, such as... Figure 5 As shown, the device includes:

[0078] The acquisition unit 501 is used to acquire the actual environment parameters of the target container when the target container on the cloud platform is detected to be running. The actual environment parameters are the configuration parameters that the target container currently depends on when it is running on the cloud platform.

[0079] The first determining unit 502 is used to determine the target environment version of the environment that the target container needs to run in, and to obtain the expected environment parameters of the target environment version. The cloud platform deploys multiple environment versions of the running environment.

[0080] The comparison unit 503 is used to compare the actual environmental parameters with the expected environmental parameters, obtain the comparison results, and calculate the parameter accuracy based on the comparison results;

[0081] The second determining unit 504 is used to determine that the target container's runtime environment verification has passed if the parameter accuracy rate is greater than or equal to the accuracy rate threshold.

[0082] The cloud platform runtime environment verification device provided in this application embodiment, through an acquisition unit 501, acquires the actual environment parameters of the target container when the target container on the cloud platform is detected to be running. The actual environment parameters are the configuration parameters that the target container currently depends on while running on the cloud platform. A first determination unit 502 determines the target environment version that the target container needs to run on and acquires the expected environment parameters for that version. The cloud platform deploys multiple runtime environment versions. A comparison unit 503 compares the actual environment parameters with the expected environment parameters to obtain a comparison result, and calculates the parameter accuracy rate based on the comparison result. A second determination unit 504 determines that the runtime environment verification of the target container has passed if the parameter accuracy rate is greater than or equal to an accuracy rate threshold. By comparing the actual environment parameters with the expected environment parameters, it ensures that the container runs in the correct configuration environment, avoiding situations where the container health check passes but the actual runtime environment configuration is incorrect. This achieves the goal of improving the depth and accuracy of cloud platform runtime environment verification, thereby avoiding cloud platform environment configuration conflicts and errors, and solving the technical problem of container environment conflicts caused by duplicate configurations of multiple sets of environment parameters on the cloud platform.

[0083] Optionally, in the cloud platform runtime environment verification device provided in this application embodiment, the device further includes: a third determining unit, used to determine that the runtime environment verification of the target container has failed when the parameter accuracy is less than the accuracy threshold, and to issue a prompt message, wherein the prompt message is used to indicate that the runtime environment version is incorrect; and a switching unit, used to switch the runtime environment version of the target container, and to determine the parameter accuracy of the current runtime environment version based on the switched runtime environment version, until the parameter accuracy is greater than or equal to the accuracy threshold.

[0084] Optionally, in the cloud platform runtime environment verification device provided in this application embodiment, the first determining unit 502 includes: a receiving module, used to receive environment parameter data entered by the user, parse the environment parameter data, and obtain the name and parameter value of each environment parameter of the target environment version; a verification module, used to perform data integrity verification on the name and parameter value of each environment parameter; a prompting module, used to issue a second prompting message when the data integrity verification of the name and parameter of at least one environment parameter fails, wherein the second prompting message is used to indicate an environment parameter abnormality; and a first determining module, used to determine the name and parameter value of all environment parameters of the target environment version as the expected environment parameters when the data integrity verification of the name and parameter of all environment parameters passes.

[0085] Optionally, in the cloud platform runtime environment verification device provided in this application embodiment, the comparison unit 503 includes: a loading module, used to deploy an assertion program on the node corresponding to the target container in the cloud platform, and control the assertion program to load expected environment parameters; a matching module, used to match the expected environment parameters with the actual environment parameters to obtain a matching result, wherein the matching result includes multiple sets of environment parameters, each set of environment parameters includes the actual value and expected value of the same type of environment parameter, the actual value is the value in the actual environment parameter, and the expected value is the value in the expected environment parameter; and a comparison module, used to compare the actual value and expected value of each set of environment parameters in the matching result to obtain a comparison result of each set of environment parameters, and the comparison results of each set of environment parameters constitute the comparison result of the actual environment parameters and the expected environment parameters.

[0086] Optionally, in the cloud platform runtime environment verification device provided in this application embodiment, the comparison module includes: a traversal submodule, used to traverse each set of environment parameters in the matching result sequentially to determine the set of environment parameters that need to be compared; a skip submodule, used to skip the comparison of the set of environment parameters that need to be compared when the set of environment parameters to be compared is a time parameter, where the time parameter is a parameter that changes with time; a fuzzy comparison submodule, used to perform a fuzzy comparison of the actual value and the expected value of the dynamic parameter when the set of environment parameters to be compared is a dynamic parameter, where the dynamic parameter is a parameter that changes with the startup of the target container; a threshold comparison submodule, used to compare the actual value and the expected threshold range of the threshold parameter when the set of environment parameters to be compared is a threshold-type parameter; and a plaintext comparison submodule, used to decrypt the actual value and the expected value of the encrypted parameter when the set of environment parameters to be compared is an encrypted parameter, and compare the actual value and the plaintext after decryption of the expected value.

[0087] Optionally, in the cloud platform operating environment verification device provided in this application embodiment, the comparison unit 503 includes: a second determining module, used to determine the target number of comparison results representing the actual value and the expected value matching, and the total number of all comparison results; and a calculation module, used to calculate the ratio of the target number to the total number to obtain the parameter accuracy rate.

[0088] Optionally, in the cloud platform runtime environment verification device provided in this application embodiment, the device further includes: a parameter acquisition unit, used to acquire abnormal environment parameters that indicate a mismatch between actual and expected values ​​in the comparison results; and a writing unit, used to write the abnormal environment parameters, parameter accuracy, and target quantity into the target log.

[0089] It should be noted that the acquisition unit 501, the first determination unit 502, the comparison unit 503, and the second determination unit 504 mentioned above correspond to steps S201 to S204 in Embodiment 1. The four units and the corresponding steps implement the same instances and application scenarios, but are not limited to the content disclosed in Embodiment 1. It should be noted that the above modules or units can be hardware or software components stored in memory (e.g., memory 104) and processed by one or more processors (e.g., processors 102a, 102b, ..., 102n). The above modules or units can also be part of a device and run in the computer terminal 10 provided in Embodiment 1.

[0090] Example 3

[0091] Embodiments of this application may provide an electronic device. Figure 6 This is a structural block diagram of an electronic device according to an embodiment of this application. Figure 6 As shown, the electronic device may include: one or more ( Figure 6 (Only one is shown) Processor 602, memory 604, memory controller, and peripheral interface, wherein the peripheral interface is connected to the radio frequency module, audio module and display.

[0092] The memory can be used to store software programs and modules, such as the program instructions / modules corresponding to the methods and apparatus in the embodiments of this application. The processor executes various functional applications and data processing by running the software programs and modules stored in the memory, thereby implementing the above-described methods. The memory may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory may further include memory remotely located relative to the processor, and these remote memories can be connected to the terminal via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.

[0093] The processor can access information and applications stored in memory via a transmission device to perform the following steps: upon detecting the startup of a target container on the cloud platform, obtain the actual environment parameters of the target container, where the actual environment parameters are the configuration parameters that the target container currently depends on while running on the cloud platform; determine the target environment version that the target container needs to run on, and obtain the expected environment parameters of the target environment version, where the cloud platform deploys multiple environment versions of the runtime environment; compare the actual environment parameters with the expected environment parameters to obtain the comparison result, and calculate the parameter accuracy rate based on the comparison result; if the parameter accuracy rate is greater than or equal to the accuracy rate threshold, determine that the runtime environment verification of the target container has passed.

[0094] The processor can also call the information and application stored in the memory through the transmission device to perform the following steps: if the parameter accuracy is less than the accuracy threshold, determine that the target container's runtime environment verification has failed and issue a prompt message, wherein the prompt message is used to indicate that the runtime environment version is incorrect; switch the runtime environment version of the target container and determine the parameter accuracy of the current environment version based on the switched environment version until the parameter accuracy is greater than or equal to the accuracy threshold.

[0095] The processor can also access information and applications stored in the memory via a transmission device to perform the following steps: receiving user-inputted environmental parameter data, parsing the environmental parameter data to obtain the name and value of each environmental parameter in the target environment version; performing data integrity verification on the name and value of each environmental parameter; issuing a second prompt message if the data integrity verification of the name and value of at least one environmental parameter fails, wherein the second prompt message is used to indicate an environmental parameter abnormality; and determining the names and values ​​of all environmental parameters in the target environment version as the expected environmental parameters if the data integrity verification of the names and values ​​of all environmental parameters passes.

[0096] The processor can also access information and applications stored in memory via a transmission device to perform the following steps: deploying an assertion program on the node corresponding to the target container in the cloud platform, controlling the assertion program to load expected environment parameters; matching the expected environment parameters with the actual environment parameters to obtain a matching result, wherein the matching result contains multiple sets of environment parameters, each set of environment parameters contains the actual value and expected value of the same type of environment parameter, the actual value is the value in the actual environment parameter, and the expected value is the value in the expected environment parameter; comparing the actual value and expected value of each set of environment parameters in the matching result to obtain a comparison result of each set of environment parameters, and the comparison results of each set of environment parameters constitute the comparison result of the actual environment parameters and the expected environment parameters.

[0097] The processor can also invoke information and applications stored in the memory via the transmission device to perform the following steps: sequentially traverse each set of environmental parameters in the matching results to determine the current set of environmental parameters to be compared; if the set of environmental parameters to be compared is a time parameter, skip the comparison of that set of environmental parameters, where the time parameter is a parameter that changes over time; if the set of environmental parameters to be compared is a dynamic parameter, perform a fuzzy comparison between the actual value and the expected value of the dynamic parameter, where the dynamic parameter is a parameter that changes as the target container starts; if the set of environmental parameters to be compared is a threshold parameter, compare the actual value and the expected threshold range of the threshold parameter; if the set of environmental parameters to be compared is an encrypted parameter, decrypt the actual value and the expected value of the encrypted parameter, and compare the actual value with the plaintext of the decrypted expected value.

[0098] The processor can also call the information and application programs stored in the memory through the transmission device to perform the following steps: determine the number of targets that match the actual value and the expected value in the comparison results, and the total number of all comparison results; calculate the ratio of the number of targets to the total number to obtain the parameter accuracy.

[0099] The processor can also call the information and application stored in the memory through the transmission device to perform the following steps: obtain the comparison results to characterize the abnormal environment parameters that do not match the actual value and the expected value; write the abnormal environment parameters, parameter accuracy and target quantity into the target log.

[0100] This application provides a method for obtaining the actual environment parameters of a target container when it is detected that the target container has started on a cloud platform. The actual environment parameters are the configuration parameters that the target container currently relies on while running on the cloud platform. The method involves determining the target environment version that the target container needs to run on and obtaining the expected environment parameters for that version, where the cloud platform deploys multiple environment versions. The actual environment parameters and expected environment parameters are compared to obtain a comparison result, and the parameter accuracy rate is calculated based on the comparison result. If the parameter accuracy rate is greater than or equal to an accuracy rate threshold, the target container's runtime environment verification is deemed successful. By comparing the actual environment parameters with the expected environment parameters, it ensures that the container runs in the correct configuration environment, avoiding situations where the container health check passes but the actual runtime environment configuration is incorrect. This improves the depth and accuracy of cloud platform runtime environment verification, thereby avoiding cloud platform environment configuration conflicts and errors, and solving the technical problem of container environment conflicts caused by duplicate configurations of multiple sets of environment parameters on the cloud platform.

[0101] Those skilled in the art will understand that Figure 6The structure shown is for illustrative purposes only. Electronic devices can also be smartphones, tablets, handheld computers, mobile internet devices (MIDs), PADs, and other terminal devices. Figure 6 This does not limit the structure of the aforementioned electronic device. For example, electronic devices may also include components that are more... Figure 6 The more or fewer components shown (such as network interfaces, display devices, etc.), or having the same Figure 6 The different configurations shown.

[0102] Those skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be implemented by a program instructing the hardware related to the terminal device. The program can be stored in a computer-readable storage medium, which may include: flash drive, read-only memory (ROM), random access memory (RAM), disk or optical disk, etc.

[0103] Example 4

[0104] Embodiments of this application also provide a storage medium. Optionally, in this embodiment, the storage medium can be used to store the program code executed by the cloud platform runtime environment verification method provided in Embodiment 1.

[0105] Optionally, in this embodiment, the storage medium may be located in any computer terminal in a group of computer terminals in a computer network, or in any mobile terminal in a group of mobile terminals.

[0106] This application also provides a computer program product that, when executed on a data processing device, is suitable for performing the steps of a cloud platform's runtime environment verification method.

[0107] The sequence numbers of the embodiments in this application are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.

[0108] In the above embodiments of this application, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments.

[0109] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. The device embodiments described above are merely illustrative; for example, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the displayed or discussed mutual coupling, direct coupling, or communication connection may be through some interfaces; the indirect coupling or communication connection between units or modules may be electrical or other forms.

[0110] 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 this embodiment according to actual needs.

[0111] Furthermore, the functional units in the various embodiments of this application 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 unit can be implemented in hardware or as a software functional unit.

[0112] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it 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 all or part 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 described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as a USB flash drive, read-only memory (ROM), random access memory (RAM), portable hard drive, magnetic disk, or optical disk.

[0113] The above description is only a preferred embodiment of this application. It should be noted that for those skilled in the art, several improvements and modifications can be made without departing from the principle of this application, and these improvements and modifications should also be considered within the scope of protection of this application.

Claims

1. A method for verifying the operating environment of a cloud platform, characterized in that, include: Upon detecting the startup of a target container on the cloud platform, the actual environment parameters of the target container are obtained, wherein the actual environment parameters are the configuration parameters that the target container currently depends on when running on the cloud platform. Determine the target environment version that the target container needs to run in, and obtain the expected environment parameters of the target environment version. The cloud platform deploys multiple environment versions of the runtime environment. The actual environmental parameters are compared with the expected environmental parameters to obtain the comparison results, and the parameter accuracy rate is calculated based on the comparison results. If the accuracy of the parameter is greater than or equal to the accuracy threshold, the runtime environment verification of the target container is deemed to have passed.

2. The method according to claim 1, characterized in that, After calculating the parameter accuracy based on the comparison results, the method further includes: If the accuracy rate of the parameter is less than the accuracy rate threshold, it is determined that the runtime environment verification of the target container has failed, and a prompt message is issued, wherein the prompt message is used to indicate that the runtime environment version is incorrect; Switch the environment version in which the target container runs, and determine the parameter accuracy of the current environment version based on the switched environment version, until the parameter accuracy is greater than or equal to the accuracy threshold.

3. The method according to claim 1, characterized in that, The expected environment parameters for obtaining the target environment version include: Receive user-inputted environment parameter data, parse the environment parameter data, and obtain the name and value of each environment parameter for the target environment version; Perform data integrity verification on the name and value of each environmental parameter; If the name and data integrity verification of at least one environmental parameter fail, a second prompt message is issued, wherein the second prompt message is used to indicate that the environmental parameter is abnormal; If the names and data integrity checks of all environmental parameters pass, the names and values ​​of all environmental parameters for the target environment version are determined as the expected environmental parameters.

4. The method according to claim 1, characterized in that, The actual environmental parameters and the expected environmental parameters are compared to obtain the following comparison results: In the cloud platform, an assertion program is deployed on the node corresponding to the target container to control the assertion program to load the expected environment parameters. The expected environmental parameters are matched with the actual environmental parameters to obtain a matching result. The matching result includes multiple sets of environmental parameters. Each set of environmental parameters includes the actual value and the expected value of the same type of environmental parameter. The actual value is the value in the actual environmental parameter, and the expected value is the value in the expected environmental parameter. The actual and expected values ​​of each set of environmental parameters in the matching results are compared to obtain the comparison results of each set of environmental parameters. The comparison results of each set of environmental parameters constitute the comparison results of the actual environmental parameters and the expected environmental parameters.

5. The method according to claim 4, characterized in that, The comparison between the actual and expected values ​​of each set of environmental parameters in the matching results includes: The environmental parameters in the matching results are iterated sequentially to determine the current set of environmental parameters that needs to be compared. If the set of environmental parameters to be compared is a time parameter, skip the comparison of that set of environmental parameters, where the time parameter is a parameter that changes over time. When the set of environmental parameters to be compared is a dynamic parameter, a fuzzy comparison is made between the actual value and the expected value of the dynamic parameter, wherein the dynamic parameter is a parameter that changes as the target container starts. When the set of environmental parameters to be compared is a threshold parameter, the comparison is made based on the actual value of the threshold parameter and the expected threshold range of the threshold parameter. When the set of environmental parameters to be compared is encrypted, the actual value and the expected value of the encrypted parameter are decrypted, and the plaintext obtained by decrypting the actual value and the expected value are compared.

6. The method according to claim 4, characterized in that, The accuracy of the parameters calculated based on the comparison results includes: Determine the target number of comparison results that represent the actual value and the expected value matching, and the total number of all comparison results; The ratio of the target quantity to the total quantity is calculated to obtain the parameter accuracy rate.

7. The method according to claim 6, characterized in that, After obtaining the accuracy of the parameters, the method further includes: Obtain comparison results to characterize abnormal environmental parameters where the actual value and the expected value do not match; Write the abnormal environment parameters, the parameter accuracy rate, and the target quantity into the target log.

8. A cloud platform operating environment verification device, characterized in that, include: The acquisition unit is used to acquire the actual environment parameters of the target container when the target container of the cloud platform is detected to be running, wherein the actual environment parameters are the configuration parameters that the target container currently depends on when running on the cloud platform. The first determining unit is used to determine the target environment version of the environment that the target container needs to run in, and to obtain the expected environment parameters of the target environment version, wherein the cloud platform deploys multiple environment versions of the running environment; The comparison unit is used to compare the actual environmental parameters with the expected environmental parameters, obtain the comparison result, and calculate the parameter accuracy rate based on the comparison result; The second determining unit is used to determine that the target container's operating environment verification has passed if the parameter accuracy rate is greater than or equal to the accuracy rate threshold.

9. An electronic device, characterized in that, include: Memory, which stores executable programs; A processor for running the program, wherein the program executes the cloud platform runtime environment verification method according to any one of claims 1 to 7 when it runs.

10. A computer program product comprising computer instructions, characterized in that, When the computer instructions are executed by the processor, they implement the steps of the cloud platform runtime environment verification method according to any one of claims 1 to 7.

Citation Information

Cited By

  • Environment variable configuration detection method and device, electronic equipment and medium

    CN122152719A