Conflict environment variable identification method and device, equipment and storage medium
By obtaining and analyzing the environment variables and command execution results of the target host, combining the dichotomous test method, we quickly identify and locate environmental variable conflicts, and solving the problem of inconsistent command execution results caused by the differences in environmental variable configurations in multiple users' shared environments, improving system stability and reliability.
Patent Information
- Application Number
- CN202411830176.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-12
- Publication Date
- 2025-03-14
AI Technical Summary
In a multi-user shared computing environment, differences in configuration of environment variables lead to different execution results of the same command in different user environments, making it difficult to locate specific conflicting variables. The existing technology lacks efficient methods to quickly identify and resolve environmental variable conflicts.
By obtaining the environment variables and command execution results of the target host's current running environment, saving them as environment variable files and execution result files, determining the target differential variables, and conducting test analysis based on the dichotomy method, quickly locate the target conflict variables that cause the difference in command execution results.
This method can quickly locate target conflict variables that cause differences in command execution results, greatly reducing the time and cost of manual analysis, ensuring the consistency of command execution results in a multi-user shared environment, and improving the stability and reliability of the system.
Smart Images

Figure CN119621582A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application relate to the field of computer technology, in particular to the field of cloud computing technology, and specifically to a method, device, equipment and storage medium for identifying conflicting environment variables. Background Art
[0002] In a multi-user shared computing environment, especially when logging in to a server remotely, different users' environment variable configurations may cause the same command to produce different execution results in different user environments. This situation is particularly common in software development, testing, and production environments. Differences in environment variables may lead to inconsistent system behavior, increasing the complexity of maintenance and troubleshooting.
[0003] Currently, there are the following problems in finding conflicting environment variables: different users may set multiple environment variables, and manually comparing and analyzing the differences between these variables is very difficult and time-consuming; due to the differences in environment variables, the same command may produce different results when executed under different users, making it difficult to locate the specific conflicting variables; the combination of multiple environment variables may jointly affect the execution results of the command, and detecting each variable separately cannot solve such problems. It can be seen that the existing technology lacks an efficient method to quickly identify and resolve environment variable conflicts, which affects the stability and reliability of the system. Summary of the invention
[0004] The present application provides a method, apparatus, device and storage medium for identifying conflicting environment variables to improve the efficiency of searching for conflicting environment variables.
[0005] According to one aspect of the present application, a method for identifying conflicting environment variables is provided, the method comprising:
[0006] Obtaining environment variables of a current operating environment of at least one target host, and a command execution result obtained by executing a target command in the current operating environment by the at least one target host;
[0007] The environment variables of the target host and the command execution result are saved respectively to obtain the environment variable file and the execution result file of the target host;
[0008] Determining a target difference variable according to the environment variable file of the at least one target host and the execution result file;
[0009] Based on the dichotomy method, the target difference variables are tested and analyzed to obtain target conflict variables.
[0010] According to another aspect of the present application, a device for identifying conflicting environment variables is provided, the device comprising:
[0011] A data acquisition module, used to acquire environment variables of a current operating environment of at least one target host, and a command execution result obtained by executing a target command in the current operating environment by the at least one target host;
[0012] A data saving module, used to save the environment variables of the target host and the command execution result respectively, to obtain the environment variable file and the execution result file of the target host;
[0013] A difference variable determination module, used to determine a target difference variable according to the environment variable file of the at least one target host and the execution result file;
[0014] The conflict variable determination module is used to test and analyze the target difference variable based on the dichotomy method to obtain the target conflict variable.
[0015] According to another aspect of the present application, an electronic device is provided, the electronic device comprising:
[0016] one or more processors;
[0017] A memory for storing one or more programs;
[0018] When the one or more programs are executed by the one or more processors, the one or more processors implement any one of the conflicting environment variable identification methods provided in the embodiments of the present application.
[0019] According to another aspect of the present application, a computer-readable storage medium is provided, on which a computer program is stored. When the program is executed by a processor, the method for identifying any conflicting environment variable provided in the embodiments of the present application is implemented.
[0020] According to another aspect of the present application, a computer program product is provided, including a computer program, wherein when the computer program is executed by a processor, the computer program implements any one of the conflicting environment variable identification methods provided in the embodiments of the present application.
[0021] The present application obtains the environment variables of the current operating environment of at least one target host, and the command execution results obtained by executing the target command in the current operating environment of at least one target host; respectively saves the environment variables and command execution results of the target host to obtain the environment variable file and execution result file of the target host; determines the target difference variable based on the environment variable file and execution result file of at least one target host; and tests and analyzes the target difference variable based on the dichotomy method to obtain the target conflict variable. The above technical solution can quickly locate the target conflict variable that causes the difference in command execution results through the dichotomy test method, which greatly reduces the time and cost of manual analysis. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] Figure 1 is a flow chart of a method for identifying conflicting environment variables provided according to Embodiment 1 of the present application;
[0023] Figure 2 is a flow chart of a method for identifying conflicting environment variables provided according to Embodiment 2 of the present application;
[0024] Figure 3 It is a structural schematic diagram of a device for identifying conflicting environmental variables provided according to Embodiment 3 of the present application;
[0025] Figure 4 It is a structural diagram of an electronic device that implements the method for identifying conflicting environmental variables of an embodiment of the present application. DETAILED DESCRIPTION
[0026] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present application.
[0027] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application 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 data used in this way can be interchangeable where appropriate, so that the embodiments of the present application 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 comprising 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.
[0028] In addition, it should be noted that the collection, storage, use, processing, transmission, provision and disclosure of relevant data such as environmental variables and command execution results involved in the technical solution of this application are in compliance with the relevant laws and regulations and do not violate public order and good morals.
[0029] Embodiment 1
[0030] Figure 1This is a flow chart of a method for identifying conflicting environment variables according to the first embodiment of the present application. This embodiment is applicable to the case of searching for conflicting environment variables in a computer environment scenario shared by multiple users. It can be performed by a conflicting environment variable identification device. The conflicting environment variable identification device can be implemented in the form of hardware and / or software. The conflicting environment variable identification device can be configured in a computer device, such as a server. Figure 1 As shown, the method includes:
[0031] S110: Obtain environment variables of a current operating environment of at least one target host, and a command execution result obtained by at least one target host executing a target command in the current operating environment.
[0032] In this embodiment, the target host refers to a remote host used to execute a specific command or operation in a computer network environment; users can access and manage the remote host through a network (such as the Internet, a local area network, etc.), and the remote host can be a computer running a server, a database, or an application. The current operating environment refers to the operating system configuration, operating status, system resources, environment variables, and other related settings of the target host; it includes all factors that may affect the execution of a program or command, such as the operating system version, loaded libraries, network configuration, etc. Environment variables refer to a set of dynamic values stored in the operating system, which can affect the behavior of the operating system or a running process; environment variables are usually used to store path information, configuration file locations, user information, etc.; for example, in Linux (Linux Operating System), PATH (Path Environment Variable) specifies the search path for executable files. The target command refers to a specific command for the target host to execute; the target command can be manually set according to actual needs or experience values; it should be noted that the target commands executed by different target hosts are the same. The command execution result refers to the output returned by the system after executing a command on the target host; this result can be text, error message, success or failure status code, etc.; the analysis of execution results is crucial to determine environmental differences and potential conflicting variables.
[0033] Specifically, a script may be used to obtain the environment variables of the current operating environment of the target host corresponding to each user; and obtain the command execution result obtained by executing the target command in the current operating environment of the target host corresponding to each user.
[0034] S120, respectively saving the environment variables and command execution results of the target host to obtain an environment variable file and an execution result file of the target host.
[0035] In this embodiment, the environment variable file refers to a file containing the current environment variable information of the target host; the file usually contains a set of key-value pairs, where each key represents the name of the environment variable and each value represents the current value of the environment variable; saving this file helps with subsequent analysis and comparison. The execution result file refers to a file that saves the command execution results; it records the output results when the target host executes a command, and is usually used for analysis and troubleshooting, helping to determine whether the command is successfully executed or whether any errors or exceptions occur.
[0036] Exemplarily, for obtaining and saving environment variables, you can log in to each user's remote host through SSH (Secure Shell), use a script to obtain all the user's environment variables, and save these variables to a file; the script can use the shell (command line interpreter) command printenv (print environment) or env (environment) to export the environment variables to a text file, with a unified storage path and naming convention.
[0037] Exemplarily, for obtaining and saving command execution results, a specific command can be executed in the current running environment of each user's remote host, and the output results of the command can be recorded; this step can be implemented through a script, which will execute the command in each user environment and save the output results to designated files respectively.
[0038] S130: Determine a target difference variable according to an environment variable file and an execution result file of at least one target host.
[0039] In this embodiment, the target difference variables refer to the differences found after comparing the environment variables and command execution results of multiple target hosts; these differences indicate that certain environment settings or conditions are different on different hosts, which may cause behavioral differences or conflicts.
[0040] Specifically, the environment variable files of different target hosts and the execution result files of different target hosts may be compared to determine the target difference variables.
[0041] S140. Based on the dichotomy method, test and analyze the target difference variable to obtain the target conflict variable.
[0042] In this embodiment, the binary search method is an algorithm that gradually narrows the search range by repeatedly dividing a data set into two halves; here, the binary search method is used to test and analyze target difference variables, and the purpose is to find the key difference variables that cause conflicts by gradually narrowing the variable set. The target conflict variable refers to the environment variable that is finally determined to cause command execution conflicts or errors when testing and analyzing the environment variables and execution results of multiple target hosts; the conflict variable is usually the key factor that causes inconsistent system behavior.
[0043] In an optional implementation, after testing and analyzing the target difference variables based on the dichotomy method to obtain the target conflict variables, the variable data of the target conflict variables may be summarized and analyzed to obtain a variable conflict report, which is fed back to the user.
[0044] In this embodiment, the variable conflict report is a report generated after testing and analyzing the target conflict variables; wherein, the report may include at least one of the identified difference items, the value corresponding to each difference item, and possible correction solutions, etc.; the purpose of the report is to help users understand and resolve conflicts caused by environmental differences or configuration problems.
[0045] Exemplarily, a report is generated for conflicting variables for developers to review and correct. The report may include the following: specific differences in environment variables and their values, variables or variable combinations that lead to different command execution results, and suggested correction solutions or variables that need to be further verified.
[0046] The embodiment of the present application obtains the environment variables of the current operating environment of at least one target host, and the command execution results obtained by executing the target command in the current operating environment of at least one target host; respectively saves the environment variables and command execution results of the target host to obtain the environment variable file and execution result file of the target host; determines the target difference variable based on the environment variable file and execution result file of at least one target host; and tests and analyzes the target difference variable based on the dichotomy method to obtain the target conflict variable. The above technical solution can quickly locate the target conflict variable that causes the difference in command execution results through the dichotomy test method, which greatly reduces the time and cost of manual analysis.
[0047] Embodiment 2
[0048] Figure 2It is a flow chart of a method for identifying conflicting environmental variables provided in accordance with the second embodiment of the present application. Based on the technical solutions of the above embodiments, this embodiment refines "based on the dichotomy, test and analyze the target difference variables to obtain the target conflicting variables" into "summarize the target difference variables in the form of a list to obtain the initial difference variable table and the table length of the initial difference variable table; based on the dichotomy, test and analyze the initial difference variable table according to the table length of the initial difference variable table to obtain the target conflicting variables". It should be noted that for the parts not described in detail in the embodiments of the present application, please refer to the relevant statements of other embodiments. Figure 2 As shown, the method includes:
[0049] S210: Obtain environment variables of a current operating environment of at least one target host, and a command execution result obtained by at least one target host executing a target command in the current operating environment.
[0050] S220 , respectively saving the environment variables and command execution results of the target host to obtain an environment variable file and an execution result file of the target host.
[0051] S230: Determine a target difference variable according to an environment variable file and an execution result file of at least one target host.
[0052] Optionally, environment variable files of different target hosts are compared to obtain candidate difference variables; and a target difference variable is determined based on the candidate difference variables and an execution result file of at least one target host.
[0053] In this embodiment, candidate difference variables refer to environment variables that may be different and are initially identified when comparing environment variables and execution result files of different target hosts; these variables need to be further analyzed to determine whether they will cause conflicts between target hosts.
[0054] Furthermore, based on the candidate difference variables and the execution result files of at least one target host, determining the target difference variable can be by performing a consistency check on the execution result files between the two target hosts for every two compared target hosts; if the consistency check fails, determining the candidate difference variable between the two target hosts as the target difference variable.
[0055] In this embodiment, consistency checking refers to the process of comparing the execution result files of multiple target hosts to verify whether they are consistent.
[0056] Exemplarily, the environment variable files of the target host corresponding to different users are compared to find the difference items of the variables; this step can use the script diff (difference, difference comparison) command to compare the environment variable files line by line, record the difference of each variable, and obtain the candidate difference variable. Compare the command execution results to determine whether there is a difference. If there is a difference, it proves that the candidate difference variable has an impact on the command execution result, and the difference variable may be a conflict variable; this step can identify the difference in results generated by different users executing the same command by comparing the command output files, and record these difference information.
[0057] S240 , summarizing the target difference variables in the form of a list to obtain an initial difference variable table and the table length of the initial difference variable table.
[0058] In this embodiment, the initial difference variable table refers to a list containing all target difference variables. The table length refers to the number of difference variables or the number of rows (ie, the amount of data contained) contained in the initial difference variable table.
[0059] S250, based on the dichotomy method, according to the table length of the initial difference variable table, test and analyze the initial difference variable table to obtain the target conflict variable.
[0060] Exemplarily, the variable list is divided into two parts, and the effects of the combination of the two parts on the command execution results are tested separately; if a certain combination of variables leads to a difference in results, further dichotomy tests are performed on that part until the specific conflicting variables are determined; the above process is repeated to gradually narrow the scope, accurately locate the single or multiple environmental variable combinations that lead to the difference in command execution results, and output the final target conflicting variables.
[0061] Optionally, the initial difference variable table is grouped according to the table length of the initial difference variable table to obtain a first candidate variable table and a second candidate variable table; the first candidate variable table and the second candidate variable table are tested and analyzed respectively, and a candidate conflict variable table is determined from the first candidate variable table and the second candidate variable table; based on the dichotomy method, the candidate conflict variable table is tested and analyzed until the target conflict variable is determined.
[0062] The first candidate variable table and the second candidate variable table refer to two variable tables obtained by grouping the initial difference variable table.
[0063] Exemplarily, the grouping method may be average grouping. Exemplarily, if the length of the difference variable list is an odd number, the list can usually be divided into two parts of equal size (for example, a list of length 5 is divided into [variable A, variable B] and [variable C, variable D, variable E]); if the length of the difference variable list is an even number, the list is evenly divided into two parts; taking the initial difference variable table as [variable A, variable B, variable C, variable D, variable E] as an example, the first candidate variable table may be [variable A, variable B, variable C], and the second candidate variable table may be [variable D, variable E].
[0064] It can be understood that this application can quickly locate the environment variables that cause differences in command execution results through automated scripts and binary testing methods, greatly reducing the time and cost of manual analysis; it can accurately find out the impact of single or multiple combined variables on command execution results, solving the problems caused by complex environmental variable combinations; by identifying and resolving environmental variable conflicts, it ensures the consistency of command execution results in a multi-user shared environment, and improves the stability and reliability of the system.
[0065] The embodiment of the present application obtains the environment variables of the current operating environment of at least one target host, and the command execution results obtained by executing the target command in the current operating environment of at least one target host; respectively saves the environment variables and command execution results of the target host to obtain the environment variable file and execution result file of the target host; determines the target difference variable according to the environment variable file and execution result file of at least one target host; summarizes the target difference variable in the form of a list to obtain the initial difference variable table and the table length of the initial difference variable table; based on the binary search method, the initial difference variable table is tested and analyzed according to the table length of the initial difference variable table to obtain the target conflict variable. The above technical scheme can quickly locate the target conflict variable that causes the difference in command execution results through the binary search test method, which greatly reduces the time and cost of manual analysis.
[0066] Embodiment 3
[0067] Figure 3 This is a schematic diagram of a conflict environment variable identification device according to the third embodiment of the present application, which can be applied to the situation of searching for conflict environment variables in a computer environment scenario shared by multiple users. The conflict environment variable identification device can be implemented in the form of hardware and / or software, and the conflict environment variable identification device can be configured in a computer device, such as a server. Figure 3 As shown, the device comprises:
[0068] The data acquisition module 310 is used to acquire the environment variables of the current operating environment of at least one target host, and the command execution result obtained by at least one target host executing the target command in the current operating environment;
[0069] The data saving module 320 is used to save the environment variables and command execution results of the target host respectively, and obtain the environment variable file and execution result file of the target host;
[0070] A difference variable determination module 330, configured to determine a target difference variable according to an environment variable file and an execution result file of at least one target host;
[0071] The conflict variable determination module 340 is used to test and analyze the target difference variable based on the dichotomy method to obtain the target conflict variable.
[0072] The embodiment of the present application obtains the environment variables of the current operating environment of at least one target host, and the command execution results obtained by executing the target command in the current operating environment of at least one target host; respectively saves the environment variables and command execution results of the target host to obtain the environment variable file and execution result file of the target host; determines the target difference variable based on the environment variable file and execution result file of at least one target host; and tests and analyzes the target difference variable based on the dichotomy method to obtain the target conflict variable. The above technical solution can quickly locate the target conflict variable that causes the difference in command execution results through the dichotomy test method, which greatly reduces the time and cost of manual analysis.
[0073] Optionally, the conflict variable determination module 340 includes:
[0074] A variable summary unit is used to summarize the target difference variables in the form of a list to obtain an initial difference variable table and the table length of the initial difference variable table;
[0075] The conflict variable determination unit is used to test and analyze the initial difference variable table based on the dichotomy method according to the table length of the initial difference variable table to obtain the target conflict variable.
[0076] Optionally, a conflict variable determination unit is specifically used to:
[0077] According to the table length of the initial difference variable table, the initial difference variable table is grouped to obtain a first candidate variable table and a second candidate variable table;
[0078] Performing test analysis on the first candidate variable table and the second candidate variable table respectively, and determining a candidate conflict variable table from the first candidate variable table and the second candidate variable table;
[0079] Based on the dichotomy method, the candidate conflict variable table is tested and analyzed until the target conflict variable is determined.
[0080] Optionally, the difference variable determination module 330 includes:
[0081] A file comparison unit is used to compare environment variable files of different target hosts to obtain candidate difference variables;
[0082] The difference variable determination unit is used to determine a target difference variable according to the candidate difference variables and an execution result file of at least one target host.
[0083] Optionally, a difference variable determination unit is used to:
[0084] For every two target hosts to be compared, a consistency check is performed on the execution result files between the two target hosts;
[0085] If the consistency check fails, the candidate difference variables between the two target hosts are determined as the target difference variables.
[0086] Optionally, the device also includes a report generation module; the report generation module is used to summarize and analyze the variable data of the target conflict variable, obtain a variable conflict report, and feed it back to the user; the variable conflict report includes a correction plan, difference items of the target conflict variable and the values corresponding to the difference items.
[0087] The conflict environment variable identification device provided in the embodiment of the present application can execute the conflict environment variable identification method provided in any embodiment of the present application, and has the corresponding functional modules and beneficial effects for executing each conflict environment variable identification method.
[0088] According to an embodiment of the present application, the present application also provides an electronic device, a readable storage medium and a computer program product.
[0089] Embodiment 4
[0090] Figure 4 It is a structural diagram of an electronic device 410 that implements the identification method of the conflicting environment variables of the embodiment of the present application. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workbenches, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are only examples and are not intended to limit the implementation of the present application described and / or required herein.
[0091] like Figure 4As shown, the electronic device 410 includes at least one processor 411, and a memory connected to the at least one processor 411 in communication, such as a read-only memory (ROM) 412, a random access memory (RAM) 413, etc., wherein the memory stores a computer program that can be executed by at least one processor, and the processor 411 can perform various appropriate actions and processes according to the computer program stored in the read-only memory (ROM) 412 or the computer program loaded from the storage unit 418 to the random access memory (RAM) 413. In RAM413, various programs and data required for the operation of the electronic device 410 can also be stored. The processor 411, ROM412 and RAM413 are connected to each other via a bus 414. An input / output (I / O) interface 415 is also connected to the bus 414.
[0092] Multiple components in the electronic device 410 are connected to the I / O interface 415, including: an input unit 416, such as a keyboard, a mouse, etc.; an output unit 417, such as various types of displays, speakers, etc.; a storage unit 418, such as a disk, an optical disk, etc.; and a communication unit 419, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 419 allows the electronic device 410 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0093] Processor 411 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of processor 411 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 processors, controllers, microcontrollers, etc. Processor 411 performs the various methods and processes described above, such as a method for identifying conflicting environmental variables.
[0094] In some embodiments, the method for identifying conflicting environment variables may be implemented as a computer program, which is tangibly contained in a computer-readable storage medium, such as a storage unit 418. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 410 via the ROM 412 and / or the communication unit 419. When the computer program is loaded into the RAM 413 and executed by the processor 411, one or more steps of the method for identifying conflicting environment variables described above may be performed. Alternatively, in other embodiments, the processor 411 may be configured as a method for identifying conflicting environment variables in any other appropriate manner (e.g., by means of firmware).
[0095] Various implementations of the systems and techniques described above herein 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), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including 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.
[0096] The computer programs for implementing the methods of the present application 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 conflict environment variable recognition device, so that when the computer program is executed by the processor, the functions / operations specified in the flow chart and / or block diagram are implemented. The computer program may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.
[0097] In the context of the present application, a computer readable storage medium may be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, device or equipment. A computer readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. Alternatively, a computer readable storage medium may be a machine readable signal medium. A more specific example of a machine readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0098] To provide interaction with a user, the systems and techniques described herein may be implemented on an electronic device having: 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 a pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).
[0099] The systems and techniques described herein may be implemented in a computing system that includes backend 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 frontend components (e.g., a user computer with a graphical user interface or a 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 backend components, middleware components, or frontend components. The components of the system may 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.
[0100] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The client and server relationship is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services.
[0101] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps recorded in this application can be executed in parallel, sequentially or in different orders, as long as the expected results of the technical solution of this application can be achieved, and this document is not limited here.
[0102] The above specific implementations do not constitute a limitation on the protection scope of this application. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of this application should be included in the protection scope of this application.
Claims
1. A method for identifying conflicting environment variables, characterized in that: include: Obtaining environment variables of a current operating environment of at least one target host, and a command execution result obtained by executing a target command in the current operating environment by the at least one target host; The environment variables of the target host and the command execution result are saved respectively to obtain the environment variable file and the execution result file of the target host; Determining a target difference variable according to the environment variable file of the at least one target host and the execution result file; Based on the dichotomy method, the target difference variables are tested and analyzed to obtain target conflict variables.
2. The method according to claim 1, characterized in that Based on the dichotomy method, the target difference variables are tested and analyzed to obtain target conflict variables, including: Summarizing the target difference variables in the form of a list to obtain an initial difference variable table and a table length of the initial difference variable table; Based on the dichotomy method, the initial difference variable table is tested and analyzed according to the table length of the initial difference variable table to obtain the target conflict variable.
3. The method according to claim 2, characterized in that Based on the dichotomy method, according to the table length of the initial difference variable table, the initial difference variable table is tested and analyzed to obtain the target conflict variable, including: According to the table length of the initial difference variable table, the initial difference variable table is grouped to obtain a first candidate variable table and a second candidate variable table; Performing tests and analyses on the first candidate variable table and the second candidate variable table respectively, and determining a candidate conflict variable table from the first candidate variable table and the second candidate variable table; Based on the dichotomy method, the candidate conflict variable table is tested and analyzed until the target conflict variable is determined.
4. The method according to claim 1, characterized in that: The determining the target difference variable according to the environment variable file of the at least one target host and the execution result file comprises: Compare the environment variable files of different target hosts to obtain candidate difference variables; A target difference variable is determined according to the candidate difference variable and the execution result file of the at least one target host.
5. The method according to claim 4, characterized in that The step of determining a target difference variable according to the candidate difference variable and the execution result file of the at least one target host includes: For every two target hosts to be compared, a consistency check is performed on the execution result files between the two target hosts; If the consistency check fails, the candidate difference variables between the two target hosts are determined as the target difference variables.
6. The method according to claim 1, characterized in that After testing and analyzing the target difference variables based on the dichotomy method to obtain the target conflict variables, the method further includes: The variable data of the target conflict variable are summarized and analyzed to obtain a variable conflict report, which is fed back to the user; the variable conflict report includes a correction plan, a difference item of the target conflict variable and a value corresponding to the difference item.
7. A device for identifying conflicting environmental variables, characterized in that: include: A data acquisition module, used to acquire environment variables of a current operating environment of at least one target host, and a command execution result obtained by executing a target command in the current operating environment by the at least one target host; A data saving module, used to save the environment variables of the target host and the command execution result respectively, to obtain the environment variable file and the execution result file of the target host; A difference variable determination module, used to determine a target difference variable according to the environment variable file of the at least one target host and the execution result file; The conflict variable determination module is used to test and analyze the target difference variable based on the dichotomy method to obtain the target conflict variable.
8. An electronic device, characterized in that: include: one or more processors; A memory for storing one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the method for identifying conflicting environment variables as described in any one of claims 1 to 6.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method for identifying conflicting environment variables as described in any one of claims 1 to 6 is implemented.
10. A computer program product, comprising a computer program, wherein when the computer program is executed by a processor, the computer program implements the method for identifying conflicting environment variables according to any one of claims 1 to 6.