Variable detection method and device, equipment and medium

By obtaining metadata and screening key variables for anomaly detection in the CI/CD process, the problem of low variable detection efficiency in the CI/CD process is solved, and the efficiency of variable detection and the stability and security of the application are improved.

CN120653532APending Publication Date: 2025-09-16INDUSTRIAL AND COMMERCIAL BANK OF CHINA
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510763156.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-09
Publication Date
2025-09-16

AI Technical Summary

Technical Problem

Existing technologies have low efficiency in detecting millions of configured variables in the CI/CD process, resulting in a high risk of configuration errors and affecting the stability and security of applications.

Method used

By obtaining the metadata of the target application during the testing phase, calculating the correlation information of the variables, screening out key variables, and performing anomaly detection, it is determined whether the variables can be deployed to the production environment.

Benefits of technology

This reduces the number of configured variables that need to be tested, improves detection efficiency, reduces the risk of configuration errors, and ensures the stability and security of applications in production environments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120653532A_ABST
    Figure CN120653532A_ABST
Patent Text Reader

Abstract

The invention discloses a variable detection method, device and equipment and a medium, which are applied to the field of financial science and technology. The method comprises the steps of obtaining current metadata of each configured variable of a target application after a test stage; the current metadata comprises at least one of the following items: a variable name, a variable type, a variable nesting relationship, a variable source path and a variable dependency relationship; according to the current metadata, current associated information of each configured variable is obtained through calculation; screening the configured variables according to the current associated information of the configured variables to obtain at least one current key variable; performing anomaly detection on each current key variable to obtain an anomaly detection result; and detecting whether the target application is deployed to the production environment or not according to the anomaly detection result. According to the embodiment of the invention, the number of the configured variables needing to be detected can be reduced, so that the detection efficiency of the configured variables is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of distributed technology, and in particular to a variable detection method, device, equipment and medium. Background Art

[0002] With the widespread application of CI / CD (Continuous Integration / Continuous Delivery) processes, CI / CD processes can achieve rapid production versions of applications. Before production, it is necessary to check whether millions of configured variables are correctly configured to prevent zero-outage problems caused by variable configuration errors.

[0003] Currently, the existing technology implements pre-checking of configuration variables by checking all variables one by one.

[0004] However, the number of configured variables that need to be checked is huge, and checking whether all configured variables are correctly configured has the defect of low efficiency. Summary of the Invention

[0005] The present invention provides a variable detection method, apparatus, device, and medium. Embodiments of the present invention can reduce the number of configured variables that need to be detected, thereby improving the efficiency of configured variable detection.

[0006] In a first aspect, an embodiment of the present invention provides a variable detection method, the method comprising:

[0007] Obtaining current metadata of each configured variable of the target application after the testing phase; the current metadata includes at least one of the following: variable name, variable type, variable nesting relationship, variable source path, and variable dependency relationship;

[0008] Based on the current metadata, calculate the current association information of each configured variable;

[0009] According to the current association information of each configured variable, the configured variables are screened to obtain at least one current key variable;

[0010] Perform anomaly detection on each current key variable to obtain anomaly detection results;

[0011] Based on the anomaly detection results, check whether the target application has been deployed to the production environment.

[0012] In a second aspect, an embodiment of the present invention further provides a variable detection device, the device comprising:

[0013] A metadata acquisition module is used to obtain the current metadata of each configured variable of the target application after the test phase; the current metadata includes at least one of the following: variable name, variable type, variable nesting relationship, variable source path and variable dependency relationship;

[0014] The association information calculation module is used to calculate the current association information of each configured variable based on the current metadata;

[0015] A key variable screening module, configured to screen each configured variable according to current association information of each configured variable to obtain at least one current key variable;

[0016] Anomaly detection module, used to perform anomaly detection on each current key variable and obtain anomaly detection results;

[0017] The application deployment detection module is used to detect whether the target application is deployed to the production environment based on the anomaly detection results.

[0018] In a third aspect, an embodiment of the present invention further provides a variable detection device, the variable detection device comprising:

[0019] at least one processor; and

[0020] a memory communicatively connected to at least one processor; wherein,

[0021] The memory stores a computer program that can be executed by at least one processor. The computer program is executed by the at least one processor so that the at least one processor can perform the variable detection method according to any embodiment of the present invention.

[0022] In a fourth aspect, an embodiment of the present invention further provides a computer-readable storage medium, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the variable detection method of any embodiment of the present invention when executed.

[0023] The technical solution of the embodiment of the present invention automatically obtains the current metadata of each configured variable when detecting that the target application is in the test phase, and can calculate the current association information of the configured variables through the current metadata. According to the current association information, the configured variables are screened to obtain the current key variables, and the current key variables are tested to obtain anomaly detection results, thereby determining whether the configured variables can be deployed in the production environment; by screening a smaller number of current key variables from a large number of configured variables, the number of configured variables that need to be tested can be reduced, solving the current technical problem of low efficiency in detecting whether all configured variables are correctly configured. The embodiment of the present invention can reduce the number of configured variables that need to be tested, thereby improving the efficiency of configured variable detection.

[0024] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present invention, nor is it intended to limit the scope of the present invention. Other features of the present invention will become readily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0025] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.

[0026] Figure 1 A flow chart of a variable detection method provided by an embodiment of the present invention;

[0027] Figure 2 A flow chart of a variable detection method provided by an embodiment of the present invention;

[0028] Figure 3 A schematic structural diagram of a variable detection device provided by an embodiment of the present invention;

[0029] Figure 4 A schematic structural diagram of a variable detection device provided in an embodiment of the present invention. DETAILED DESCRIPTION

[0030] In order to enable those skilled in the art to better understand the solutions of the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the embodiments described are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts should fall within the scope of protection of the present invention.

[0031] It should be noted that the terms "first", "second", etc. in the description and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that the numbers used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0032] In the technical solutions of the embodiments of the present invention, the acquisition, storage and application of metadata involved are in compliance with the provisions of relevant laws and regulations and do not violate public order and good morals.

[0033] Figure 1 This is a flow chart of a variable detection method provided by an embodiment of the present invention. This embodiment of the present invention is applicable to situations where it is necessary to verify the correct configuration of millions of configured variables before an application is officially put into production. This method can be performed by a variable detection device, which can be implemented in hardware and / or software.

[0034] See also Figure 1 The variable detection method shown includes:

[0035] S101. Obtain current metadata of each configured variable of the target application after the test phase; the current metadata includes at least one of the following: variable name, variable type, variable nesting relationship, variable source path, and variable dependency relationship.

[0036] The target application may refer to a software system, service, program module or application being deployed.

[0037] The "after-test phase" refers to the phase after the test phase in the CI / CD process and before deployment to the production environment. The CI / CD process includes the development phase, continuous integration phase, build / packaging phase, testing phase, and deployment to the production environment. Retrieving the current metadata of configured variables after the test phase ensures that the target application has passed the test phase and is ready for deployment in the production environment. After the test phase, the configured variables are checked for compliance with expectations, ensuring there are no omissions, errors, or potential risks before deployment.

[0038] Configured variables refer to pre-configured parameters in the target application. They control key process parameters such as the environment, image, and configuration. They can be configured in configuration files, environment variables, command-line parameters, and server-side injection. For example, a configured variable could be a database connection configuration with the variable name DB_HOST and the value 127.0.0.1; or a service port configuration with the variable name SERVER_PORT and the value 8080.

[0039] Metadata refers to auxiliary information that describes the structure, properties, and relationships of configured variables. In configured variables, metadata includes variable name, variable type, variable nesting relationship, variable source path, and variable dependency relationship.

[0040] The variable name may refer to a unique identifier that identifies a configured variable. Variable names typically follow specific naming rules, which may vary across different programming languages, frameworks, or platforms. However, some configured variables are not named according to these rules. For example, a variable named "DB_HOST" represents the database host address and is set according to the naming rules. Another variable named "ZJDZ" is named based on the initials of the host address in pinyin, not according to the naming rules.

[0041] The variable type refers to the type of data stored in the configured variable. Variable types include: string, integer, Boolean, and date.

[0042] Nested variables refer to the hierarchical structure between variables. Nested variables reflect the hierarchical structure of complex configurations. For example, a configured variable contains the values ​​of other configured variables. For example, the expression for the variable "DB_URI" is DB_URI = ${DB_HOST}:${DB_PORT}, indicating that the variables "DB_HOST" and "DB_PORT" are nested within the variable "DB_URI."

[0043] The variable source path may refer to a source location or path describing a configured variable. The variable source path indicates the source of the variable configuration, including configuration files, environment variables, system default values, or databases.

[0044] A variable dependency relationship can be used to describe the dependency relationship between a configured variable and other variables. When the value of one variable needs to be calculated, adjusted, or determined based on the value of another variable, a variable dependency relationship exists between two configured variables.

[0045] S102: Calculate and obtain current association information of each configured variable according to the current metadata.

[0046] The associated information may refer to information describing whether a configured variable is prone to configuration errors. The associated information may include: variable complexity, variable configuration source, variable naming conventions, and variable dependencies.

[0047] S103 : Screen the configured variables according to the current association information of the configured variables to obtain at least one current key variable.

[0048] Key variables refer to configured variables prone to misconfiguration. Due to their characteristics, frequency of use, complexity, and dependencies, key variables carry a high potential risk of misconfiguration. Misconfiguration can easily lead to system malfunctions, performance degradation, failures, or security risks. Therefore, configured variables prone to misconfiguration are called key variables. Key variables are inherently complex, potentially involving multiple parameters, numerous nested or multi-level dependencies, increasing the likelihood of misconfiguration. Key variables are relied upon by multiple system modules, services, or applications, and improper configuration can cause a chain reaction of anomalies. Key variables are used in multiple environments (such as development, testing, and production), and differences in these environments can lead to configuration errors.

[0049] S104: Perform anomaly detection on each current key variable to obtain anomaly detection results.

[0050] Anomaly detection can be used to detect abnormalities in key variables. This includes checking whether configured variable values ​​fall within expected ranges, are correctly formatted, or whether there are any dependency conflicts. Anomaly detection can promptly identify configuration errors in key variables and prevent serious failures in production environments.

[0051] Anomaly detection results can refer to the results of determining whether the configuration of key variables meets expected requirements. Anomaly detection results can be normal or abnormal. A normal result indicates that the configuration of key variables meets expected configuration standards. An abnormal result indicates that there is a problem with the configuration of key variables, such as a format error, an out-of-range condition, or a dependency conflict.

[0052] S105. Determine whether the configured variables are deployed to the production environment based on the anomaly detection result.

[0053] The production environment refers to the environment in which the application actually runs. The production environment is where end users or customers utilize the application. Therefore, the correct configuration of configured variables is crucial to the stability, performance, and security of the application. For example, in a production environment, the correct configuration variables for the database must be set correctly. These variables include the host address, port number, username, and password. Misconfiguration of these variables can prevent the application from accessing the database, potentially causing the entire application service to malfunction.

[0054] It can be seen that in the embodiment of the present application, the technical solution of the embodiment of the present invention automatically obtains the current metadata of each configured variable when it is detected that the pipeline execution has been completed to the deployment test environment stage. The current association information of the configured variables can be calculated through the current metadata. According to the current association information, the configured variables are screened to obtain the current key variables, and the current key variables are detected to obtain abnormal detection results, so as to determine whether the configured variables can be deployed to the production environment; by screening a smaller number of current key variables from a large number of configured variables, the number of configured variables that need to be detected can be reduced, which solves the current technical problem of low efficiency in detecting whether all configured variables are correctly configured. The embodiment of the present invention can reduce the number of configured variables that need to be detected, thereby improving the efficiency of configured variable detection.

[0055] In an optional embodiment, Figure 2 A flowchart of a variable detection method provided in an embodiment of the present invention refines "screening each configured variable according to the current association information of each configured variable to obtain at least one current key variable" into "performing a weighted calculation according to each parameter item in the current association information of each configured variable and the weight corresponding to each parameter item to obtain the current criticality corresponding to each configured variable; inputting the current criticality corresponding to each configured variable into a pre-trained key variable extraction model to obtain at least one current key variable" to improve the variable detection operation.

[0056] It should be noted that for parts not described in detail in the embodiments of the present invention, reference may be made to the descriptions of other embodiments.

[0057] See also Figure 2 The variable detection method shown includes:

[0058] S201. Obtain current metadata of each configured variable of the target application after the test phase; the current metadata includes at least one of the following: variable name, variable type, variable nesting relationship, variable source path, and variable dependency relationship.

[0059] S202: Calculate and obtain current association information of each configured variable according to the current metadata.

[0060] S203 : Perform weighted calculation based on each parameter item and the weight corresponding to each parameter item in the current association information of each configured variable to obtain the current criticality corresponding to each configured variable.

[0061] The weights associated with each parameter item can refer to the influence ratio or contribution coefficient assigned to each parameter item in the associated information of each configured variable (such as variable complexity and variable naming standardization) when evaluating whether each configured variable is a key variable. The weights associated with each parameter item reflect the importance of each parameter item in determining whether a configured variable is a key variable.

[0062] Criticality can be used to measure the degree to which a configured variable is prone to misconfiguration. A higher criticality indicates a higher likelihood of misconfiguration; a lower criticality indicates that the configured variable is generally correctly configured. Criticality is a unified metric formed by weighted calculation of various parameters in multiple current association information. Criticality is used to screen for key variables among configured variables and serves as input to the key variable extraction model.

[0063] S204: Input the current criticality corresponding to each configured variable into a pre-trained key variable extraction model to obtain at least one current key variable.

[0064] The key variable extraction model may be configured to input the current criticality of each configured variable and output at least one current key variable. In a specific example, the key variable extraction model extracts features from the current criticality of each configured variable and encodes the extracted features to obtain at least one current key variable.

[0065] S205: Perform anomaly detection on each current key variable to obtain anomaly detection results.

[0066] S206: Determine whether the configured variables are deployed to the production environment based on the anomaly detection result.

[0067] It can be seen that in this embodiment, by performing weighted calculation on multiple parameter items of the configured variables and introducing a weight mechanism, it is possible to achieve differentiated expression of the importance of different parameter items and improve the rationality of criticality assessment; by inputting the current criticality as an input feature into the key variable extraction model, it is possible to achieve automatic screening of key variables; by adopting a pre-trained model, it is possible to improve the efficiency and consistency of key variable screening and reduce the uncertainty caused by manual judgment.

[0068] In some embodiments, the current association information includes at least one of the following: variable complexity, variable configuration source type, degree of variable naming standardization, and degree of variable dependency;

[0069] Based on the current metadata, calculate the current association information of each configured variable, including:

[0070] According to the variable type and variable nesting relationship, the variable complexity of each configured variable is calculated;

[0071] Determine the variable configuration source type of each configured variable based on the variable source path and path mapping rules;

[0072] Compare the variable names and the variable name specifications to calculate the degree of naming standardization of each configured variable;

[0073] According to the variable dependency relationship, the variable dependency degree of each configured variable is calculated;

[0074] The current association information of each of the configured variables is determined based on the complexity of the variables, the type of the variable configuration source, the degree of naming standardization, and the degree of variable dependency.

[0075] Among them, variable complexity can refer to the complexity of the configured variable in the semantic structure, type structure or nested structure. By analyzing the variable type (such as string, object and array, etc.) and the number of nested levels of the configured variable, it is detected whether the variable has a multi-layer structure or a mixture of multiple data, thereby judging the complexity of the variable. For example, the configured variable is "HOST = 127.0.0.1", the variable type of the configured variable is a string, there is no variable nesting relationship, and the variable complexity is low; the configured variable is "DATABASE_CONFIG = {"host":"db","credentials":{"user":"u","pass":"p"}}", the variable type of the configured variable is an array, there is a variable nesting relationship, and the variable complexity is high.

[0076] The variable source path refers to the specific location or source location where a configured variable is defined, declared, or injected in an application. A variable source path typically includes a file path, class path, environment path, or configuration source identifier. The variable source path reflects the source from which a configured variable is loaded or imported.

[0077] The path mapping rule may refer to a set of rules for mapping a variable source path to a standardized source type. The path mapping rule is used to classify and parse the path with a certain configuration method to determine the source type of the configured variable.

[0078] The variable configuration source type refers to the type of method by which a configured variable is introduced or defined in the system. The variable configuration source identifies how the variable is configured in the target application. Variable configuration sources include automatic configuration and external injection.

[0079] The variable naming specification may refer to a predefined variable naming format and rules. The variable naming specification can be used to clarify the correct variable naming format.

[0080] The degree of variable naming standardization refers to the degree to which the variable name matches predefined naming conventions. The variable name is compared against the naming conventions, such as through regular expression matching or string pattern matching, and the degree of variable naming standardization is generated based on the degree of match. Configured variables with non-standardized names are often difficult for maintenance personnel to identify, which can easily lead to configuration errors.

[0081] The variable dependency level refers to the degree of dependency between a configured variable and other configuration variables, i.e., whether its value depends on other variables or configuration items. Highly dependent configured variables are more prone to configuration errors.

[0082] It can be seen that in this embodiment, by analyzing the type and nesting level of variables, a quantitative assessment of the complexity of variables can be achieved, which helps to identify configured variables with more complex implementation structures and may be more prone to errors; through the comparison relationship between paths and mapping rules, it can be clear whether the variables are generated by automatic configuration or injected by external systems, thereby achieving classification and identification of the sources of variables; by evaluating the matching degree between variable names and naming specifications, a quantitative judgment of the consistency and standardization of variable naming can be achieved; by evaluating the degree of dependence between variables, configuration items that are highly dependent on other variables can be identified; by comprehensively analyzing the above-mentioned dimensional information for aggregate judgment, the overall reliability and accuracy of the current related information can be improved, thereby providing a more effective reference basis for the screening of key variables.

[0083] In some embodiments, the current key variables include at least one of the following: security authentication class variables, path and resource address class variables, version control class variables, and dependency reference class variables.

[0084] Among them, security authentication variables can refer to variables used for security-related functions such as identifying identity, authenticating access rights, and protecting interface calls during the operation of an application. Among them, path and resource address variables can refer to variables used to specify paths or network addresses of resources, services, and configuration files. Among them, version control variables can refer to variables used to identify the version numbers of components, dependencies, services, and interfaces in an application. Among them, dependency reference variables can refer to variables used to specify the reference path, name, or identifier of external components, libraries, modules, or services required during application runtime or build time.

[0085] As can be seen, in this embodiment, limiting key variables to security authentication variables, path and resource address variables, version control variables, and dependency reference variables allows for focused attention and detection of key configuration links that are most likely to cause application operation anomalies, deployment failures, or security risks, thereby improving the pertinence and accuracy of anomaly detection. These types of key variables typically play a decisive role in application operation, resource access, service compatibility, and dependency integrity. Therefore, prioritizing the identification and detection of these variables helps to detect potential configuration errors in advance, reduce the impact of configuration defects on the production environment, and improve the stability and security of application deployment.

[0086] In some embodiments, anomaly detection is performed on each key variable to obtain anomaly detection results, including:

[0087] Obtaining operation data of each key variable; the operation data includes at least one of the following: variable index, operation value and operation log;

[0088] Compare the running data with the variable standard library to obtain the running comparison results;

[0089] Based on the running comparison results, the anomaly detection results are determined.

[0090] The operation data may refer to a set of information related to the operation status generated or recorded by the key variables during the operation of the target application. The operation data indicates the configuration data of the key variables during the operation process.

[0091] The variable index may be a data identifier used to uniquely identify each configured variable. The variable index enables accurate association of operational data with specific variables, facilitating tracking and comparison.

[0092] The runtime value refers to the actual value of a configured variable when parsed, loaded, or assigned in the actual runtime environment. This value can be static (such as a Boolean or string) or dynamic (e.g., generated based on context). The runtime value reflects the actual configuration state of the configured variable at runtime and supports comparison with expected standards.

[0093] Operation logs refer to historical records of operations related to configured variables, such as changes, calls, and overwrites. Operation logs include the time, operator, and method of operation. For example, an operation log might record "20XX-XX-X 10:03:45, user admin modified the variable ENV_MODE to 'test'."

[0094] The variable standard library refers to a predefined set of standard variable data for comparison and comparison. This library includes standard variable names, recommended types, acceptable value ranges, and contextual dependencies. For example, the standard library specifies that the value of the variable "LOG_LEVEL" must be {"debug", "info", "warn", "error"}.

[0095] The operation comparison result may refer to the comparison result obtained after comparing the operation data with the variable standard library. The operation comparison results include match and mismatch. When the operation comparison result is mismatch, it means that the operation value of the configured variable does not match the comparison result in the variable standard library, and the configured variable is not operating according to the pre-set value. When the operation comparison result is match, it means that the operation value of the configured variable matches the comparison result in the variable standard library, and the configured variable is operating according to the pre-set value.

[0096] It can be seen that in this embodiment, by obtaining the operating data of each key variable, the behavior of the key variables in the actual operating environment can be accurately recorded; by including the variable index, the unique identification and precise positioning of the variable can be achieved; by including the operating value, the value of the variable in different operating states can be monitored; by including the operation log, the variable change process can be backtracked and the operation behavior can be audited; by comparing the operating data with the variable standard library, it can be determined whether the current state of the variable meets the standard or specification; by obtaining the operation comparison result, it can be detected whether the variable behavior is abnormal or deviates from the standard.

[0097] In some embodiments, the variable configuration source types include: automatic configuration and external injection.

[0098] Automatic configuration refers to the automatic generation of values ​​for configured variables. The values ​​of configured variables are automatically generated, populated, or derived by the application during the runtime or loading configuration phase based on preset rules, environmental parameters, and default settings, without requiring manual configuration or external intervention. Generally, configured variables with an automatic configuration source type are less prone to configuration errors.

[0099] External injection refers to configuring the value of a configured variable through an external source. External injection typically uses a configuration reading mechanism, parameter binding mechanism, or injection framework to map configuration values ​​from an external data source to program variables and inject them into the target variable at runtime. Variables configured with external injection as their source are often prone to configuration errors.

[0100] It can be seen that in this embodiment, by dividing the variable configuration source types into automatic configuration and external injection, refined classification management of variable sources can be achieved; by identifying whether the variables come from automatic configuration or external injection, differentiated detection of configuration error risks can be achieved.

[0101] In some embodiments, the key variable extraction model may be trained by:

[0102] Obtain historical real key variables;

[0103] Obtaining historical metadata of each configured variable of the target application after the testing phase; the historical metadata includes at least one of the following: variable name, variable type, variable nesting relationship, variable source path, and variable dependency relationship;

[0104] Based on historical metadata, calculate the historical correlation information of each configured variable;

[0105] Perform weighted calculation based on each parameter item and the weight corresponding to each parameter item in the historical association information of each configured variable to obtain the historical criticality corresponding to each configured variable;

[0106] Inputting the historical criticality corresponding to each configured variable into a pre-trained key variable extraction model to obtain at least one historical key variable;

[0107] According to the differences between historical key variables and historical true key variables, the parameters of the key variable extraction model are adjusted.

[0108] Historically verified key variables refer to configured variables that have been verified to have a high frequency of errors during configuration. Historically, these variables have caused application failures, malfunctions, and security risks due to improper configuration. These historically verified key variables serve as labels in supervised learning and are used to train the key variable extraction model. This allows the model to learn to distinguish configured variables that are more likely to be key variables. By comparing the key variables extracted by the model with these historically verified key variables, model effectiveness can be evaluated and parameter adjustments can be guided.

[0109] It can be seen that in this embodiment, by using historical real key variables as training labels, supervised optimization of model output can be achieved, thereby improving the accuracy of key variable identification; by using historical criticality as model input, supervised training of the key variable extraction model can be achieved, thereby improving the model's ability to identify key variables; by adjusting parameters based on the difference between the predicted results and the real labels, iterative optimization of the model can be achieved, thereby improving the model's extraction accuracy and generalization ability.

[0110] Figure 3A schematic diagram of the structure of a variable detection device provided in an embodiment of the present invention. This embodiment of the present invention is applicable to situations where it is necessary to verify the correct configuration of millions of configured variables before an application is officially put into production. The device can perform a variable detection method and can be implemented in hardware and / or software.

[0111] See also Figure 3 The variable detection device shown includes: a metadata acquisition module 301, a correlation information calculation module 302, a key variable screening module 303, an anomaly detection module 304 and an application deployment detection module 305, wherein:

[0112] The metadata acquisition module 301 is used to obtain the current metadata of each configured variable of the target application after the test phase; the current metadata includes at least one of the following: variable name, variable type, variable nesting relationship, variable source path, and variable dependency relationship;

[0113] The association information calculation module 302 is used to calculate the current association information of each configured variable based on the current metadata;

[0114] A key variable screening module 303 is configured to screen each configured variable according to current association information of each configured variable to obtain at least one current key variable;

[0115] Anomaly detection module 304, used to perform anomaly detection on each current key variable to obtain anomaly detection results;

[0116] The application deployment detection module 305 is used to detect whether the target application is deployed to the production environment based on the abnormality detection result.

[0117] The technical solution of the embodiment of the present invention is to automatically obtain the current metadata of each configured variable when detecting that the pipeline has completed the deployment test environment stage, and to calculate the current association information of the configured variables through the current metadata. According to the current association information, the configured variables are screened to obtain the current key variables, and the current key variables are detected to obtain abnormality detection results, thereby determining whether the configured variables can be deployed in the production environment; by screening a small number of current key variables from a large number of configured variables, the number of configured variables that need to be detected can be reduced, which solves the current technical problem of low efficiency in detecting whether all configured variables are correctly configured. The embodiment of the present invention can reduce the number of configured variables that need to be detected, thereby improving the efficiency of configured variable detection.

[0118] In some embodiments, in filtering each configured variable according to current association information of each configured variable to obtain at least one current key variable, the metadata acquisition module 301 is specifically configured to:

[0119] Perform weighted calculation based on each parameter item and the weight corresponding to each parameter item in the current association information of each configured variable to obtain the current criticality corresponding to each configured variable;

[0120] The current criticality corresponding to each configured variable is input into a pre-trained key variable extraction model to obtain at least one current key variable.

[0121] In some embodiments, the current association information includes at least one of the following: variable complexity, variable configuration source type, variable naming standardization, and variable dependency. In calculating the current association information of each configured variable based on the current metadata, the association information calculation module 302 is specifically configured to:

[0122] According to the variable type and variable nesting relationship, the variable complexity of each configured variable is calculated;

[0123] Determine the variable configuration source type of each configured variable based on the variable source path and path mapping rules;

[0124] Compare the variable names and the variable name specifications to calculate the degree of naming standardization of each configured variable;

[0125] According to the variable dependency relationship, the variable dependency degree of each configured variable is calculated;

[0126] The current association information of each of the configured variables is determined according to the complexity of the variable, the source type of the variable configuration, the degree of naming standardization, and the degree of variable dependency.

[0127] In some embodiments, the current key variables include at least one of the following: security authentication class variables, path and resource address class variables, version control class variables, and dependency reference class variables.

[0128] In some embodiments, in performing anomaly detection on each key variable and obtaining anomaly detection results, the anomaly detection module 304 is specifically configured to:

[0129] Obtaining operation data of each key variable; the operation data includes at least one of the following: variable index, operation value and operation log;

[0130] Compare the running data with the variable standard library to obtain the running comparison results;

[0131] Based on the running comparison results, the anomaly detection results are determined.

[0132] In some embodiments, the variable configuration source types include: automatic configuration and external injection.

[0133] In some embodiments, the key variable extraction model can be trained in the following manner, and the key variable screening module is specifically configured to:

[0134] Obtain historical real key variables;

[0135] Obtaining historical metadata of each configured variable of the target application after the testing phase; the historical metadata includes at least one of the following: variable name, variable type, variable nesting relationship, variable source path, and variable dependency relationship;

[0136] Based on historical metadata, calculate the historical correlation information of each configured variable;

[0137] Perform weighted calculation based on each parameter item and the weight corresponding to each parameter item in the historical association information of each configured variable to obtain the historical criticality corresponding to each configured variable;

[0138] Inputting the historical criticality corresponding to each configured variable into a pre-trained key variable extraction model to obtain at least one historical key variable;

[0139] According to the differences between historical key variables and historical true key variables, the parameters of the key variable extraction model are adjusted.

[0140] The variable detection device provided in the embodiment of the present invention can execute the variable detection method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects for executing the variable detection method.

[0141] Figure 4 A schematic structural diagram of a variable detection device provided in an embodiment of the present invention.

[0142] like Figure 4 As shown, the variable detection device 400 includes at least one processor 401, and a memory connected to the at least one processor 401, such as a read-only memory (ROM) 402, a random access memory (RAM) 403, etc., wherein the memory stores a computer program that can be executed by the at least one processor, and the processor 401 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 402 or the computer program loaded from the storage unit 408 to the random access memory (RAM) 403. Various programs and data required for the operation of the variable detection device 400 can also be stored in the RAM 403. The processor 401, ROM 402 and RAM 403 are connected to each other via a bus 404. An input / output (I / O) interface 408 is also connected to the bus 404.

[0143] Multiple components in the variable detection device 400 are connected to the I / O interface 405, including an input unit 406, such as a keyboard and mouse; an output unit 407, such as various types of displays and speakers; a storage unit 408, such as a magnetic disk and optical disk; and a communication unit 409, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 409 allows the variable detection device 400 to exchange information / data with other devices via a computer network such as the Internet and / or various telecommunication networks.

[0144] Processor 401 can be any general-purpose and / or specialized processing component with processing and computing capabilities. Some examples of processor 401 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processor, controller, microcontroller, etc. Processor 401 executes the various methods and processes described above, such as the variable detection method.

[0145] In some embodiments, the variable detection method can be implemented as a computer program tangibly embodied in a computer-readable storage medium, such as storage unit 408. In some embodiments, part or all of the computer program can be loaded and / or installed on the variable detection device 400 via ROM 402 and / or communication unit 409. When the computer program is loaded into RAM 403 and executed by processor 401, one or more steps of the variable detection method described above can be performed. Alternatively, in other embodiments, processor 401 can be configured to perform the variable detection method in any other suitable manner (e.g., via firmware).

[0146] Various embodiments of the systems and techniques described above can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), system-on-chip systems (SOCs), complex programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments can include being implemented in one or more computer programs that are executable and / or interpreted on a programmable system that includes at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0147] Computer programs for implementing the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, such that when the computer program is executed by the processor, the functions / operations specified in the flowcharts and / or block diagrams are implemented. The computer program may be executed entirely on the machine, partially on the machine, as a stand-alone software package, partially on the machine and partially on a remote machine, or entirely on a remote machine or server.

[0148] In the context of the present invention, computer-readable storage media can be tangible media that can contain or store a computer program for use with an instruction execution system, device or equipment or used in combination with an instruction execution system, device or equipment. Computer-readable storage media can include but are not limited to electronic, magnetic, optical, electromagnetic, infrared or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, computer-readable storage media can be machine-readable signal media. More specific examples of machine-readable storage media can include electrical connections based on one or more lines, portable computer disks, hard disks, random access memories (RAM), read-only memories (ROM), erasable programmable read-only memories (EPROM or flash memory), optical fibers, portable compact disk read-only memories (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.

[0149] To provide interaction with a user, the systems and techniques described herein can be implemented on an operation detection device 4444, which has: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball), through which the user can provide input to the device 4444. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and the input from the user can be received in any form (including acoustic input, voice input, or tactile input).

[0150] The systems and techniques described herein can be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer with a graphical user interface or web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.

[0151] A computing system may include clients and servers. The clients and servers are generally remote from each other and typically interact via a communication network. This client-server relationship arises through computer programs running on the respective computers, creating a client-server relationship. The server may be a cloud server, also known as a cloud computing server or cloud host. This server is a hosting product within a cloud computing service ecosystem that addresses the management difficulties and limited scalability of traditional physical hosting and VPS (Virtual Private Server) services.

[0152] It should be understood that the various forms of the processes shown above can be used to reorder, add, or delete steps. For example, the steps described in the present invention can be performed in parallel, sequentially, or in a different order, as long as the desired results of the technical solution of the present invention can be achieved. This is not limited herein.

[0153] The above specific embodiments do not limit the scope of protection of the present invention. Those skilled in the art will appreciate that various modifications, combinations, sub-combinations, and substitutions may be made based on design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention are intended to be included within the scope of protection of the present invention.

Claims

1. A variable detection method, characterized in that: The method comprises: Obtaining current metadata of each configured variable of the target application after the test phase; the current metadata includes at least one of the following: variable name, variable type, variable nesting relationship, variable source path, and variable dependency relationship; Calculating and obtaining current association information of each of the configured variables according to the current metadata; Screening the configured variables according to current association information of the configured variables to obtain at least one current key variable; Performing anomaly detection on each of the current key variables to obtain an anomaly detection result; Based on the anomaly detection result, detect whether the target application is deployed to the production environment.

2. The method according to claim 1, characterized in that The step of screening the configured variables according to the current association information of the configured variables to obtain at least one current key variable includes: Performing weighted calculation based on each parameter item and the weight corresponding to each parameter item in the current association information of each configured variable to obtain the current criticality corresponding to each configured variable; The current criticality corresponding to each of the configured variables is input into a pre-trained key variable extraction model to obtain at least one of the current key variables.

3. The method according to claim 1, characterized in that The current association information includes at least one of the following: variable complexity, variable configuration source type, variable naming standardization level, and variable dependency level; The step of calculating the current association information of each configured variable according to the current metadata includes: Calculating the variable complexity of each configured variable according to the variable type and the variable nesting relationship; Determining the variable configuration source type of each configured variable according to the variable source path and the path mapping rule; According to the variable name and the variable name specification, the variable name and the variable name specification are compared to calculate the naming standardization degree of each of the configured variables; Calculating the variable dependency of each configured variable according to the variable dependency relationship; The current association information of each of the configured variables is determined according to the complexity of the variable, the source type of the variable configuration, the degree of naming standardization, and the degree of variable dependency.

4. The method according to claim 1, wherein The current key variables include at least one of the following: security authentication class variables, path and resource address class variables, version control class variables and dependency reference class variables.

5. The method according to claim 1, characterized in that The performing of anomaly detection on each of the key variables to obtain an anomaly detection result includes: Obtaining operation data of each of the key variables; the operation data includes at least one of the following: variable index, operation value and operation log; Comparing the operation data with a variable standard library to obtain an operation comparison result; An abnormality detection result is determined based on the operation comparison result.

6. The method according to claim 3, characterized in that The variable configuration source types include: automatic configuration and external injection.

7. The method according to claim 1, characterized in that The key variable extraction model can be trained by the following methods, including: Obtain historical real key variables; Obtaining historical metadata of each configured variable of the target application after the test phase; the historical metadata includes at least one of the following: variable name, variable type, variable nesting relationship, variable source path, and variable dependency relationship; Calculating historical association information of each of the configured variables according to the historical metadata; Performing weighted calculation based on each parameter item and the weight corresponding to each parameter item in the historical association information of each configured variable to obtain the historical criticality corresponding to each configured variable; Inputting the historical criticality corresponding to each of the configured variables into a pre-trained key variable extraction model to obtain at least one of the historical key variables; According to the difference between the historical key variables and the historical real key variables, the parameters of the key variable extraction model are adjusted.

8. A variable detection device, characterized in that: include: A metadata acquisition module is used to obtain current metadata of each configured variable of the target application after the test phase; the current metadata includes at least one of the following: variable name, variable type, variable nesting relationship, variable source path and variable dependency relationship; A correlation information calculation module, configured to calculate the current correlation information of each of the configured variables based on the current metadata; a key variable screening module, configured to screen each of the configured variables according to current association information of each of the configured variables to obtain at least one current key variable; An anomaly detection module, used to perform anomaly detection on each of the current key variables to obtain an anomaly detection result; The application deployment detection module is used to detect whether the target application is deployed to the production environment based on the abnormality detection result.

9. A variable detection device, characterized in that: The variable detection device includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores a computer program executable by the at least one processor. The computer program is executed by the at least one processor to enable the at least one processor to perform the variable detection method according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the variable detection method according to any one of claims 1 to 7 when executed.