Software operating environment detection method, device, computer equipment and storage medium
Through automated software operation environment detection methods, the problems of detection difficulties and long cycles in the entire life cycle of the software are solved, and efficient and low-cost environmental detection and deployment are achieved.
Patent Information
- Application Number
- CN202210384466.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-04-13
- Publication Date
- 2025-08-15
- Estimated Expiration
- 2042-04-13
AI Technical Summary
In the prior art, the detection of the software operating environment is difficult and the cycle is long, resulting in high manual detection costs and long cycles, making it difficult to meet the environmental requirements of the entire life cycle of the software.
It provides an automated software operation environment detection method, which determines the target business software by responding to business software selection operations, and displays multiple detection items on the preset interface, obtains environmental requirements information, performs installation, use and operation status detection, and generates detection results.
It realizes one-stop automatic detection of the entire life cycle of the software, reduces manual detection costs, shortens detection cycles, improves deployment efficiency, and provides data support for deployment and improvement of the environment to be tested.
Smart Images

Figure CN114780397B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of automated testing technology, and in particular to a software operating environment detection method, apparatus, computer equipment, storage medium, and program product. Background Art
[0002] Throughout the software lifecycle, from before to after the business software is installed in the software runtime environment, it's necessary to test whether the software runtime environment meets the requirements of each stage of the software lifecycle. As business software is updated or upgraded, or when new business software needs to be released, traditional methods rely on manual testing to determine whether the software runtime environment meets the requirements at each stage of the software lifecycle. This is difficult and time-consuming. Summary of the Invention
[0003] Based on this, it is necessary to provide a software operating environment detection method, device, computer equipment, storage medium and program product that automatically and quickly detect the software operating environment to address the above technical problems.
[0004] In a first aspect, the present invention provides a method for detecting a software operating environment, the method comprising: determining a target business software in response to a business software selection operation; displaying multiple detection items of the target business software on a preset interface, wherein the multiple detection items include detection items related to the environment to be tested and the target business software in the entire life cycle of the software; determining at least one target detection item from the multiple detection items in response to a detection item selection operation acting on the preset interface; obtaining environmental requirement information corresponding to the target business software and the target detection item, and detecting the environment to be tested based on the environmental requirement information to obtain a detection result.
[0005] In one embodiment, the target detection project includes at least one of installation condition detection, usage condition detection and operation status detection, and the environmental requirement information includes at least one of installation requirement information, usage requirement information and operation status requirement information; the steps of obtaining the environmental requirement information corresponding to the target business software and the target detection project, and detecting the environment to be tested according to the environmental requirement information include: obtaining the installation requirement information of the target business software, and performing an installation condition detection on the environment to be tested according to the installation requirement information of the target business software; and / or obtaining the usage requirement information of the target business software, and performing a usage condition detection on the environment to be tested according to the usage requirement information of the target business software; and / or obtaining the operation status requirement information of the target business software, and performing an operation status detection on the environment to be tested according to the operation status requirement information of the target business software.
[0006] In one embodiment, the installation requirement information includes the name of the target component and the required version of the target component, and the target component includes at least one component required for installing the target business software; the step of performing installation condition detection on the environment to be tested based on the installation requirement information of the target business software includes: determining whether the target component is installed in the component library of the environment to be tested based on the name of the target component, and obtaining the installation status of the target component; when the target component is installed in the component library, obtaining the actual version of the target component in the component library; and obtaining a first result based on the name of the target component, the installation status of the target component, the required version of the target component, and the actual version of the target component.
[0007] In one embodiment, the usage requirement information includes the name of the target port, and the target port includes at least one port required when using the business corresponding to the target business software; the step of performing usage condition detection on the environment to be tested based on the usage requirement information of the target business software includes: detecting whether the target port in the environment to be tested is occupied based on the name of the target port, and obtaining the occupancy status of the target port; if the target port is occupied, obtaining the occupation process information of the occupied target port; and obtaining a second result based on the name of the target port, the occupancy status of the target port, and the occupation process information of the target port.
[0008] In one embodiment, the operating status requirement information includes the name of the target service, and the target service includes at least one service corresponding to the target business software; the step of performing operating status detection on the environment to be tested based on the operating status requirement information of the target business software includes: detecting whether the target service in the environment to be tested is running stably based on the name of the target service, and obtaining the operating status of the target service; and obtaining a third result based on the name of the target service and the operating status of the target service.
[0009] In one of the embodiments, the step of detecting whether the target service in the test environment is running stably according to the name of the target service, and obtaining the running status of the target service includes: determining whether the target service in the test environment is closed multiple times within a preset time; if the number of times the target service in the test environment is closed reaches a preset number within the preset time, it is determined that the target service is not running stably in the test environment, otherwise it is determined that the target service is running stably in the test environment.
[0010] In the second aspect, an embodiment of the present invention provides a software operating environment detection device, the device including: a first response module, used to determine the target business software in response to a business software selection operation; a display module, used to display multiple detection items of the target business software on a preset interface, wherein the multiple detection items include detection items related to the target business software and the environment to be tested in the entire life cycle of the software; a second response module, used to respond to the detection item selection operation acting on the preset interface, and determine at least one target detection item from multiple detection items; a detection module, used to obtain environmental requirement information corresponding to the target business software and the target detection item, and detect the environment to be tested according to the environmental requirement information to obtain a detection result.
[0011] In a third aspect, an embodiment of the present invention provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the above method when executing the computer program.
[0012] In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium having a computer program stored thereon, which implements the steps of the above method when the computer program is executed by a processor.
[0013] In a fifth aspect, an embodiment of the present invention provides a computer program product, comprising a computer program, which implements the steps of the above method when executed by a processor.
[0014] Based on any of the above embodiments, when it is necessary to detect whether the environment to be tested and the target business software match, multiple detection items related to all the environments to be tested and the target business software in the entire life cycle of the software are provided. After the target detection item is determined from the multiple detection items, the environment to be tested is automatically detected according to the environmental requirement information corresponding to the target detection item and the detection results are obtained. This detection method supports one-stop automatic detection of the entire life cycle of software, reduces the high testing costs caused by manual detection, shortens the detection cycle, and the detection results also provide data support for the deployment and improvement of the environment to be tested, reduces the deployment cost of the environment to be tested, and improves the deployment efficiency of the environment to be tested. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] Figure 1 1 is a flow chart of a method for detecting a software operating environment in one embodiment;
[0016] Figure 2 A schematic diagram of the objects of a service selection operation in one embodiment;
[0017] Figure 3 A schematic diagram of the objects of a detection item selection operation in one embodiment;
[0018] Figure 4A schematic diagram of a process for detecting installation conditions in one embodiment;
[0019] Figure 5 A schematic diagram of a process for obtaining installation requirement information in one embodiment;
[0020] Figure 6 is a schematic diagram of a second dictionary in one embodiment;
[0021] Figure 7 A schematic diagram of a process for using conditional detection in one embodiment;
[0022] Figure 8 is a schematic diagram of a second dictionary in another embodiment;
[0023] Figure 9 1 is a flow chart of operation status detection in one embodiment;
[0024] Figure 10 A schematic diagram of a process for detecting whether a target service is running stably in one embodiment;
[0025] Figure 11 FIG. 1 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0026] In order to make the purpose, technical solutions and advantages of this application more clear, the following further describes this application in detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain this application and are not intended to limit this application.
[0027] The difficulty and long testing cycle mentioned in the background technology stems from the fact that throughout the software lifecycle, the software runtime environment must undergo various tests, as well as be deployed and configured, to ensure smooth installation, use, and stable operation within it. As software versions change and the number of software installed within it increases, the complexity of the software runtime environment increases. This necessitates manual intervention to confirm that the software runtime environment meets requirements at various stages of the software lifecycle, allowing for the subsequent deployment and improvement of the software runtime environment. For example, to run within the software runtime environment, software must install the corresponding components. Over time, new versions of software should automatically be backwards compatible with components used by older versions. However, these components may also rely on other components, and components may also undergo iterations between new and old versions. The proper functioning of these components also depends on the proper functioning of other components, necessitating manual intervention to confirm the component integrity and appropriate versions. Similar manual verification is also required at other stages of the software lifecycle, requiring high human expertise and lengthy testing cycles, significantly increasing the deployment and testing costs of the software runtime environment.
[0028] The software runtime environment detection method provided in this application can be applied to terminals, physical servers, or cloud servers. Terminals can include, but are not limited to, various personal computers, laptops, smartphones, tablet computers, etc. Physical servers can be implemented as independent servers or server clusters consisting of multiple servers. The software runtime environment includes the software and hardware environments required to run a target software. The hardware environment includes the various hardware configurations of the computer device, such as the central processing unit, memory, graphics accelerator card, etc. The software environment includes the various peripheral software required to run the target software, such as the operating system, component software, and driver software. The software runtime environment detection method can be deployed on terminals, physical servers, or cloud servers to detect the environment to be tested. The environment to be tested can be the development environment when software developers are developing business software, the test environment when software developers conduct testing after software development is completed, or the production environment when business software is released to users by the service provider. The environment to be tested can be selected based on actual conditions.
[0029] In one embodiment, Figure 1 As shown, a method for detecting a software operating environment is provided, comprising:
[0030] S102 : In response to the business software selection operation, determine the target business software.
[0031] The target business software is the business software that needs to be tested to see if it matches the environment to be tested. The target of the business software selection operation can be set as needed. In one embodiment, Figure 2 As shown, the business software selection operation can act on the selection interface to select multiple business software to be selected displayed on the selection interface. The business software selection operation is used to select the target business software from multiple business software to be selected. The business software to be selected can include various old versions of historical business software that have been released to users for use, and can also include historical business software that has been updated and is ready to be released to users for use in new versions, and can also include newly developed new business software, etc. In one embodiment, the business software selection operation can also act on the data in the memory, that is, the list of business software to be selected is stored in the memory. When responding to the business software selection operation, the target business software is selected from the list of business software to be selected in the memory according to preset rules, such as according to the update time of each business software to be selected, the test order of each business software to be selected, etc.
[0032] S104 , displaying multiple test items of the target business software on a preset interface, wherein the multiple test items include test items related to the environment to be tested and the target business software in the entire life cycle of the software.
[0033] For example and non-limiting purposes, please refer to the default interface. Figure 3. The software life cycle specifically includes the entire cycle of business software from before the business software is installed in the software operating environment to after the business software is installed in the software operating environment. During the software life cycle, the test items related to the test environment and the target business software include items used to detect whether the test environment has the various conditions required by the target business software at different stages of the software life cycle. Since different target business software have different characteristics, the content and number of test items for different target business software may be different, and corresponding test items can be customized for each selected business software.
[0034] S106 , in response to a detection item selection operation performed on a preset interface, determining at least one target detection item from a plurality of detection items.
[0035] The preset interface provides various detection items for the entire life cycle of the software, and users can select the corresponding target detection items as needed. For example, before the software developer delivers the new version of the historical business software to the business provider, it is necessary to detect whether the new version of the historical business software matches the production environment, so as to decide whether it can be delivered. The software developer can build the same test environment as the production environment, with the test environment as the test environment and the new version of the historical business software as the target business software. All detection items from before the target business software is installed in the test environment (for example, whether it supports installation in the test environment) to after the target business software is installed in the test environment (for example, whether it can be used in the test environment after installation, whether it can run stably in the test environment after installation, etc.) are selected as target detection items. Based on the results of each target detection item, it can be determined whether the new version of the historical business software can be delivered to the business provider.
[0036] S108 , obtaining environment requirement information corresponding to the target business software and the target detection item, and detecting the environment to be detected according to the environment requirement information to obtain a detection result.
[0037] The environmental requirement information is used to reflect the requirements of the target business software for the environment under test in the target detection project. If the environment under test meets the environmental requirement information corresponding to the target detection project, it means that the environment under test and the target business software match in the target detection project. For example, taking the target detection project as the installation condition detection, the environmental requirement information corresponding to the installation condition detection is the installation requirement information. If the environment under test meets the installation condition detection based on the installation requirement information, it means that the target business software can be successfully installed in the environment under test. The test results should include the results corresponding to all target detection projects, and comprehensively reflect the detection status of each target detection project.
[0038] If the target detection project is multiple, when each target detection project of the environment to be tested is detected according to the environmental requirement information, the timing of detection can be selected according to the hardware situation of the computer equipment equipped with the software operating environment, if the computer equipment supports multiple processes to run simultaneously, the detection of multiple target detection projects can be selected according to the environmental requirement information corresponding to each target detection project, to improve detection efficiency. If the computer equipment does not support multiple processes to run simultaneously, the detection of each target detection project can also be selected according to the environmental requirement information corresponding to each target detection project. In some embodiments, the detection instruction, detection algorithm etc. corresponding to each detection project are encapsulated as detection module, when the detection of a certain detection project needs to be carried out, the corresponding detection module can be called and the environmental requirement information is input into the detection module to detect. According to actual demand and technical improvement, the detection module can be optimized, and the quantity of the detection module can also be increased according to the increase adaptability of the detection project.
[0039] Based on the software operating environment detection method in this embodiment, when it is necessary to detect whether the environment to be tested and the target business software match, multiple detection items related to all the environments to be tested and the target business software in the entire life cycle of the software are provided. After the target detection item is determined from the multiple detection items, the environment to be tested is automatically detected according to the environmental requirement information corresponding to the target detection item and the detection results are obtained. This detection method supports one-stop automatic detection of the entire life cycle of software, reduces the high testing costs caused by manual detection, shortens the detection cycle, and the detection results also provide data support for deploying and improving the environment to be tested, reducing the deployment cost of the environment to be tested and improving the deployment efficiency of the environment to be tested.
[0040] In one embodiment, the target detection items include at least one of installation condition detection, usage condition detection, and operating status detection, and the environmental requirement information includes at least one of installation requirement information, usage requirement information, and operating status requirement information. That is, the environmental requirement information corresponding to the installation condition detection is the installation requirement information, the environmental requirement information corresponding to the usage condition detection is the usage requirement information, and the environmental requirement information corresponding to the operating status requirement information is the operating status requirement information. The steps of obtaining the environmental requirement information corresponding to the target business software and the target detection items, and testing the environment to be tested based on the environmental requirement information include:
[0041] Obtain the installation requirement information of the target business software, and perform an installation condition test on the environment to be tested based on the installation requirement information of the target business software; and / or obtain the usage requirement information of the target business software, and perform a usage condition test on the environment to be tested based on the usage requirement information of the target business software; and / or obtain the running status requirement information of the target business software, and perform a running status test on the environment to be tested based on the running status requirement information of the target business software. That is, when the target detection project includes installation condition detection, it is necessary to determine whether the environment to be tested can install the target business software based on the installation requirement information of the target business software. When the target detection project includes usage condition detection, it is necessary to determine whether the target business software can be used after being installed in the environment to be tested based on the usage requirement information of the target business software. When the target detection project includes running status detection, it is necessary to determine whether the target business software can run stably after being installed in the environment to be tested based on the running status requirement information of the target business software.
[0042] In one embodiment, the installation requirement information includes the name of the target component and the required version of the target component. The target component includes at least one component required for installing the target business software. It is understood that commonly used components of business software include .net framework, vc++, AspNetMVC, JDK, Chrome browser, IIS, MySQL database, Tomcat, message queue, etc. Figure 4 The step of performing installation condition detection on the environment to be tested according to the installation requirement information of the target business software includes steps S402 to S406.
[0043] S402: Determine whether the target component is installed in the component library of the test environment according to the name of the target component, and obtain the installation status of the target component.
[0044] Specifically, the component library of the test environment includes all installed components in the test environment. The installation status of the target component reflects whether the target component is installed in the component library. In some embodiments, after a component is installed in the test environment, a data set characterized by the name of the component will exist. Based on the name of the target component, a data set corresponding to the name of the target component is searched in the memory storing the component library to determine whether the target component is installed in the component library and the installation status of the target component is obtained. In a specific embodiment, the name of the target component is concatenated with a first string to obtain a first detection instruction; the first detection instruction is executed to implement the process of detecting whether the target component is installed in the component library. For example, in a test environment based on Windows or Linux, the test environment has a built-in first string for querying the installation location of the component. The name of the target component to be queried is concatenated with the first string to obtain a first detection instruction. Executing the first detection instruction in the command line can search the main folder corresponding to the component library, and then search the main folder to find whether there is a subfolder corresponding to the name of the target component to obtain the installation status of the target component.
[0045] S404: When the target component is installed in the component library, obtain the actual version of the target component in the component library.
[0046] Since traditional installation condition detection only provides feedback on whether the target component is installed, and cannot provide practical treatment suggestions to guide how to deploy and improve the component, the testing cost and deployment cost are high. In order to solve this problem, considering that the version of the component is a key issue when deploying the test environment, this embodiment obtains the actual version of the target component in the component library when the target component is installed in the component library, and provides practical suggestions for deploying and improving the component library in the test environment. In a specific embodiment, when the subfolder corresponding to the name of the target component is found in the above manner, there is also a folder characterized by the name of the actual version of the target component in the subfolder, so the actual version of the target component can be found in the subfolder.
[0047] S406 , obtaining a first result according to the name of the target component, the installation status of the target component, the required version of the target component, and the actual version of the target component.
[0048] The first result is the result corresponding to the installation condition detection, which can reflect the name of the target component, the installation status of the target component, the required version of the target component and the actual version of the target component. According to the first result, it can be quickly and accurately determined how to deploy the component library of the test environment so that the target business software can be installed in the redeployed test environment.
[0049] In one embodiment, see Figure 5The step of obtaining the installation requirement information of the target business software includes step S502 and step S504.
[0050] S502: Obtain the name of the target business software.
[0051] S504 , searching and acquiring installation requirement information corresponding to the name of the target business software in a first dictionary, wherein the first dictionary includes a data set with the names of multiple business software as keys and the installation requirement information corresponding to the names of the respective business software as values.
[0052] It can be understood that a dictionary is a data structure that stores data in the form of key-value pairs. To query data from a dictionary, one only needs to know the key name to obtain the value corresponding to the key name. Since there is no need to traverse the entire dictionary when querying in the dictionary, the query speed is very fast. Therefore, in this embodiment, the installation requirement information required for the installation condition detection of each target business software is stored in the first dictionary to speed up the detection speed. The installation condition information can also be stored in data structures such as lists, linked lists, stacks, etc., which are not limited in this application. Similarly, in some embodiments, the first dictionary also includes a data set with the names of multiple business software as keys and the usage requirement information and / or operating status requirement information corresponding to the names of each business software as values. That is, the usage requirement information and / or operating status requirement information can also be stored in the first dictionary in a similar manner, and the same method is used. Figure 5 The usage requirement information and / or the operation status requirement information are obtained in a similar manner.
[0053] In one embodiment, after obtaining the first result based on the name of the target component, the installation status of the target component, the required version of the target component, and the actual version of the target component, the step further includes: storing the first result in a second dictionary using the name of the target component as a key. The second dictionary can be found at Figure 6 In one embodiment, the first result may be in the form of a string, combining the target component's installation status, the target component's required version, and the target component's actual version in the same string, and adding a separator between the target component's installation status, the target component's required version, and the target component's actual version to facilitate extraction and separation of the target component's installation status, the target component's required version, and the target component's actual version from the string corresponding to the first result. For example Figure 6The "first result 1" is "installed, 4.0, 3.5", which means that the .net framework component has been installed in the component library, the target business software requires 4.0 for the .net framework, and the actual version in the component library is 3.5. In order to save storage space, the actual version can also be used to reflect the installation status of the target component. For example, if the target component is not installed in the component library, the actual version of the target component in the first result is set to empty. For example, "the first result 1" is "4.0," which means that the .net framework component has not been installed in the component library, and the target business software requires 4.0 for the .net framework. Or "the first result 1" is "4.0, 3.5," which means that the .net framework component has been installed in the component library, the target business software requires 4.0 for the .net framework, and the actual version in the component library is 3.5. In addition to the dictionary, the first result can also be stored in data structures such as lists, linked lists, stacks, etc., which are not limited in this application.
[0054] In one embodiment, the usage requirement information includes the name of the target port, and the target port includes at least one port required when using the service corresponding to the target service software. It can be understood that the port is the entrance and exit for computer equipment to communicate with the outside world. After the target service software is installed in the test environment, if the service corresponding to the target service software needs to be used, the corresponding port is sometimes used. For example, the test environment is based on Windows or Linux, and port 80 is used for web browsing. If web browsing is required when using the service corresponding to the target service software, then the target port includes port 80. Please refer to Figure 7 The step of performing usage condition detection on the environment to be tested according to the usage requirement information of the target business software includes S702 to S706.
[0055] S702: Detect whether the target port in the test environment is occupied according to the name of the target port, and obtain the occupation status of the target port.
[0056] Specifically, the occupancy status of the target port reflects whether the target port is occupied. Since there may be other running processes in the test environment, these running processes will occupy the target port, resulting in that even if the target business software is installed, the business in the target business software cannot be used because the target port is occupied. Therefore, when performing the usage condition detection, it is possible to detect whether the target port is occupied. In a specific embodiment, the name of the target port is spliced with the second character string to obtain a second detection instruction; the second detection instruction is executed to realize the process of detecting whether the target port is occupied in the test environment. For example, in a test environment based on Windows, Linux, etc., the test environment has a built-in second character string for querying the port, and the name of the target port to be queried is spliced with the second character string to obtain a second detection instruction. Executing the second detection instruction in the command line can realize the port query of the test environment. The execution result of the second detection instruction will feedback whether the target port is occupied, as well as the process name and process ID of the process occupying the target port.
[0057] S704: When the target port is occupied, obtain occupation process information of the occupied target port.
[0058] The target port's occupation process information is used to reflect relevant information about the process that is occupying the target port in the test environment, such as the name of the process. Since traditional usage condition detection only provides feedback on whether the target port is occupied, it cannot provide practical treatment opinions to guide how to deal with the problem of port occupation, resulting in high testing costs and deployment costs. In order to solve this problem, considering that in order to release the situation where the target port is occupied, it is necessary to first understand which process is occupying the target port, this embodiment obtains the occupation process information of the occupied target port when the target port is occupied, and provides practical opinions on how to deal with the problem of port occupation. In a specific embodiment, the occupation process information of the occupied target port can be obtained from the execution result of the second detection instruction.
[0059] S706: Obtain a second result according to the name of the target port, the occupation status of the target port, and the occupation process information of the target port.
[0060] The second result is the result corresponding to the usage condition detection, which can reflect the name of the target port, the occupancy status of the target port and the occupancy process information of the target port. According to the second result, it is possible to quickly and accurately determine how to deal with the occupied target port so that the business in the target business software installed in the environment to be tested can be used after the port occupation is released.
[0061] In one embodiment, after obtaining the second result based on the name of the target port, the occupation status of the target port and the occupation process information of the target port, the step further includes: storing the second result in a second dictionary using the name of the target port as a key. The second dictionary can be found at Figure 8 In one embodiment, the second result may be in the form of a character string, and the target port occupancy status and the target port occupancy process information are combined in the same character string, and a separator is added between the target port occupancy status and the target port occupancy process information to facilitate extraction and separation of the target port occupancy status and the target port occupancy process information from the character string corresponding to the second result. For example Figure 8 The "second result 1" is "occupied, nginx.exe, 17008", which means that the target port 8000 has been occupied by a process with the process name "nginx.exe" and the process ID "17008". In order to save storage space, the occupied process information of the target port can also be used to reflect the occupancy status of the target port. For example, if the target port is not occupied, the occupied process information of the target component in the first result is set to empty. For example, "first result 1" is "", which means that the target port 8000 is not occupied. Or "first result 1" is "nginx.exe, 17008", which means that the target port 8000 has been occupied by a process with the process name "nginx.exe" and the process ID "17008". In addition to the dictionary, the second result can also be stored in data structures such as lists, linked lists, stacks, etc., which are not limited in this application.
[0062] In one embodiment, the running state requirement information includes the name of the target service, and the target service includes at least one service corresponding to the target business software. The service can support internal communication of the target business software during runtime or provide access channels for external objects. Figure 9 The step of performing running status detection on the environment to be tested according to the running status requirement information of the target business software includes S902 to S904.
[0063] S902: Detect whether the target service in the test environment is running stably according to the name of the target service, and obtain the running status of the target service.
[0064] Specifically, the running status of the target service reflects whether the target service in the test environment is running stably. In a specific embodiment, the name of the target service is spliced with the third character string to obtain a third detection instruction; the third detection instruction is executed to realize the process of detecting whether the target service is running stably in the test environment. For example, in a test environment based on Windows, Linux, etc., the test environment has a built-in third character string for querying the status of built-in services or third-party services. The name of the target service to be queried and the third character string are spliced to obtain a third detection instruction. The query of the target service can be realized by executing the third detection instruction in the command line. The execution result of the third detection instruction will feedback whether the target service is running, the service provider, etc.
[0065] S904: Obtain a third result according to the name of the target service and the running status of the target service.
[0066] The third result is the result corresponding to the running status detection, which can reflect the name of the target service and the running status of the target service. According to the third result, it can be quickly and accurately determined whether the target business software can be used normally after being installed in the test environment.
[0067] In one embodiment, see Figure 10 , detecting whether the target service in the test environment is running stably according to the name of the target service, and obtaining the running status of the target service includes:
[0068] S1002: Determine multiple times within a preset time whether the target service in the test environment is closed.
[0069] S1004: If the target service in the test environment is shut down a preset number of times within the preset time, it is determined that the target service is not running stably in the test environment; otherwise, it is determined that the target service is running stably in the test environment.
[0070] It is understandable that when a target service exception occurs, some target services are constantly awakened by the corresponding waiting services, and the service will be in a start-stop-start-stop cycle. Multiple tests are required to determine whether the service is running stably to avoid misjudgment.
[0071] In one embodiment, after obtaining the third result according to the name of the target service and the running status of the target service, the method further includes: storing the third result in the second dictionary using the name of the target service as a key.
[0072] In one embodiment, the test result is obtained based on the results corresponding to each target detection item. Specifically, the results corresponding to each target detection item are stored in a third dictionary. The third dictionary includes a data set with the name of the target detection item as a key and the result corresponding to the target detection item as a value. In a specific embodiment, the target detection items include installation condition detection, usage condition detection, and operating status detection. The test result is obtained based on the first result, the second result, and the third result.
[0073] In one embodiment, the detection method further includes generating a detection report based on the detection results. Specifically, the detection method can be performed by traversing the third dictionary, sequentially retrieving key-value pairs from the third dictionary, and generating a detection report in a preset format based on the retrieved key-value pairs. For example, a detection report in .csv format can be generated. Finally, the detection report can be displayed on a preset interface.
[0074] It should be understood that, although the various steps in the flowcharts involved in the various embodiments described above are displayed in sequence according to the instructions of the arrows, these steps are not necessarily executed in sequence in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and these steps can be executed in other orders. Moreover, at least a portion of the steps in the flowcharts involved in the various embodiments described above can include multiple steps or multiple stages, and these steps or stages are not necessarily executed and completed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a portion of steps or stages in other steps.
[0075] Based on the same inventive concept, embodiments of the present application also provide a software runtime environment detection device for implementing the software runtime environment detection method described above. The implementation solution provided by this device is similar to the implementation solution described in the above method. Therefore, the specific limitations of one or more software runtime environment detection device embodiments provided below can be found in the above limitations of the software runtime environment detection method and will not be repeated here.
[0076] An embodiment of the present invention provides a software operating environment detection device, which includes a first response module, a display module, a second response module and a detection module. The first response module is used to determine the target business software in response to a business software selection operation. The display module is used to display a plurality of detection items of the target business software on a preset interface, wherein the plurality of detection items include detection items related to the target business software and the environment to be tested in the entire life cycle of the software. The second response module is used to respond to the detection item selection operation acting on the preset interface, and determine at least one target detection item from the plurality of detection items. The detection module is used to obtain the environmental requirement information corresponding to the target business software and the target detection item, and detect the environment to be tested according to the environmental requirement information to obtain a detection result.
[0077] Based on the detection device of the software operating environment in this embodiment, when it is necessary to detect whether the environment to be tested and the target business software match, multiple detection items related to all the environments to be tested and the target business software in the entire life cycle of the software are provided. After the target detection item is determined from the multiple detection items, the environment to be tested is automatically detected according to the environmental requirement information corresponding to the target detection item and the detection results are obtained. This detection method supports one-stop automatic detection of the entire life cycle of software, reduces the high testing costs caused by manual detection, shortens the detection cycle, and the detection results also provide data support for the deployment and improvement of the environment to be tested, reducing the deployment cost of the environment to be tested and improving the deployment efficiency of the environment to be tested.
[0078] In one embodiment, the target detection items include at least one of installation condition detection, usage condition detection, and operating status detection, and the environment requirement information includes at least one of installation requirement information, usage requirement information, and operating status requirement information. The detection module is used to obtain the installation requirement information of the target business software and perform an installation condition detection on the environment to be tested based on the installation requirement information of the target business software; and / or obtain the usage requirement information of the target business software and perform a usage condition detection on the environment to be tested based on the usage requirement information of the target business software; and / or obtain the operating status requirement information of the target business software and perform an operating status detection on the environment to be tested based on the operating status requirement information of the target business software.
[0079] In one embodiment, the detection module includes an installation condition detection submodule. The installation condition detection submodule is configured to determine whether the target component is installed in the component library of the test environment based on the name of the target component, and obtain the installation status of the target component; if the target component is installed in the component library, obtain the actual version of the target component in the component library; and obtain a first result based on the name of the target component, the installation status of the target component, the required version of the target component, and the actual version of the target component.
[0080] In one embodiment, the installation condition detection submodule includes an installation requirement information acquisition unit. The installation requirement information acquisition unit is configured to obtain the name of the target business software and retrieve the installation requirement information corresponding to the name of the target business software from a first dictionary, wherein the first dictionary includes a data set with the names of multiple business software as keys and the installation requirement information corresponding to the names of the respective business software as values.
[0081] In one embodiment, the installation condition detection submodule further includes a first result storage unit configured to store the first result in a second dictionary using the name of the target component as a key.
[0082] In one embodiment, the usage requirement information includes the name of the target port, and the target port includes at least one port required for using the service corresponding to the target service software. The detection module includes a usage condition detection submodule. The usage condition detection submodule is configured to detect whether the target port in the test environment is occupied based on the name of the target port, and obtain the occupancy status of the target port; if the target port is occupied, obtain the occupation process information of the occupied target port; and obtain a second result based on the name of the target port, the occupancy status of the target port, and the occupation process information of the target port.
[0083] In one embodiment, the usage condition detection submodule includes a usage requirement information acquisition unit. The usage requirement information acquisition unit is configured to acquire the name of target business software and retrieve usage requirement information corresponding to the name of the target business software from a first dictionary, wherein the first dictionary includes a data set having the names of multiple business software as keys and the usage requirement information corresponding to the names of the respective business software as values.
[0084] In one embodiment, the usage condition detection submodule further includes a second result storage unit configured to store the second result in a second dictionary using the name of the target port as a key.
[0085] In one embodiment, the operating status requirement information includes the name of the target service, which includes at least one service corresponding to the target business software. The detection module includes an operating status detection submodule. The operating status detection submodule is configured to detect whether the target service in the test environment is running stably based on the name of the target service, thereby obtaining the operating status of the target service; and to obtain a third result based on the name of the target service and the operating status of the target service.
[0086] In one embodiment, the operation status detection submodule includes an operation status requirement information acquisition unit. The operation status requirement information acquisition unit is configured to obtain the name of target business software and query and obtain the operation status requirement information corresponding to the name of the target business software from a first dictionary, wherein the first dictionary includes a data set with the names of multiple business software as keys and the operation status requirement information corresponding to the names of the respective business software as values.
[0087] In one of the embodiments, the operation status detection submodule is also used to determine whether the target service in the test environment is closed multiple times within a preset time; if the number of times the target service in the test environment is closed reaches a preset number within the preset time, it is determined that the target service is not running stably in the test environment, otherwise it is determined that the target service is running stably in the test environment.
[0088] Each module in the software operating environment detection device can be implemented in whole or in part through software, hardware, or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in the computer device in the form of software, so that the processor can call and execute the corresponding operations of each module.
[0089] An embodiment of the present invention provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the above method when executing the computer program.
[0090] In one embodiment, a computer device is provided, which may be a server, a terminal, etc. Its internal structure diagram may be as follows: Figure 11 As shown. The computer device includes a processor, memory, and a communication interface connected via a system bus. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of the operating system and computer program in the non-volatile storage medium. The communication interface of the computer device is used to communicate with an external terminal via a network connection. When the computer program is executed by the processor, a method for detecting a software operating environment is implemented.
[0091] Those skilled in the art will understand that Figure 11 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than shown in the figure, or combine certain components, or have a different component arrangement.
[0092] An embodiment of the present invention provides a computer-readable storage medium having a computer program stored thereon. When the computer program is executed by a processor, the steps of the above method are implemented.
[0093] An embodiment of the present invention provides a computer program product, including a computer program, which implements the steps of the above method when executed by a processor.
[0094] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties.
[0095] Those skilled in the art will appreciate that all or part of the processes in the above-mentioned embodiment methods can be implemented by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, database or other media used in the embodiments provided in this application may include at least one of non-volatile and volatile memory. Non-volatile memory may include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory may include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in the various embodiments provided herein may include at least one of a relational database and a non-relational database. Non-relational databases may include, but are not limited to, distributed databases based on blockchains. The processor involved in the various embodiments provided herein may be, but are not limited to, a general-purpose processor, a central processing unit, a graphics processing unit, a digital signal processor, a programmable logic unit, a data processing logic unit based on quantum computing, and the like.
[0096] The technical features of the above embodiments can be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0097] The above-described embodiments merely represent several implementation methods of the present application. While the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the present application. It should be noted that a person of ordinary skill in the art may make various modifications and improvements without departing from the spirit of the present application, and these modifications and improvements fall within the scope of protection of the present application. Therefore, the scope of protection of the present application shall be determined by the appended claims.
Claims
1. A software operating environment detection method, characterized in that: The method comprises: In response to the business software selection operation, determining target business software; wherein the target business software is the business software that needs to be tested to see if it matches the environment to be tested; Displaying multiple test items of the target business software on a preset interface, wherein the multiple test items include test items related to the target business software in the test environment throughout the software life cycle; In response to a detection item selection operation performed on the preset interface, determining at least one target detection item from the plurality of detection items; Obtain the environmental requirement information corresponding to the target business software and the target detection item, and detect the environment to be tested according to the environmental requirement information to obtain a detection result; wherein, the environment to be tested meets the environmental requirement information corresponding to the target detection item, indicating that the environment to be tested and the target business software match the target detection item.
2. The software operating environment detection method according to claim 1, characterized in that: The target detection items include at least one of installation condition detection, usage condition detection, and operation status detection, and the environmental requirement information includes at least one of installation requirement information, usage requirement information, and operation status requirement information; the step of obtaining the environmental requirement information corresponding to the target business software and the target detection items, and detecting the environment to be tested according to the environmental requirement information includes: Obtaining the installation requirement information of the target business software, and performing the installation condition detection on the environment to be tested according to the installation requirement information of the target business software; and / or Obtaining the usage requirement information of the target business software, and performing the usage condition detection on the environment to be tested according to the usage requirement information of the target business software; and / or The operating status requirement information of the target business software is acquired, and the operating status detection is performed on the environment to be tested according to the operating status requirement information of the target business software.
3. The software operating environment detection method according to claim 2, characterized in that: The installation requirement information includes the name of the target component and the required version of the target component, and the target component includes at least one component required for installing the target business software; the step of performing the installation condition detection on the environment to be tested according to the installation requirement information of the target business software includes: Determining whether the target component is installed in the component library of the environment to be tested according to the name of the target component, and obtaining the installation status of the target component; In a case where the target component is installed in the component library, obtaining an actual version of the target component in the component library; A first result is obtained according to the name of the target component, the installation state of the target component, the required version of the target component, and the actual version of the target component.
4. The software operating environment detection method according to claim 2, characterized in that: The usage requirement information includes a name of a target port, and the target port includes at least one port required when using the service corresponding to the target service software; the step of performing the usage condition detection on the environment to be tested according to the usage requirement information of the target service software includes: Detecting whether the target port in the test environment is occupied according to the name of the target port, and obtaining an occupation status of the target port; When the target port is occupied, obtaining occupation process information of the occupied target port; A second result is obtained according to the name of the target port, the occupation status of the target port, and the occupation process information of the target port.
5. The software operating environment detection method according to claim 2, characterized in that: The operation status requirement information includes the name of the target service, and the target service includes at least one service corresponding to the target business software; The step of performing the operating status detection on the environment to be tested according to the operating status requirement information of the target business software includes: Detecting whether the target service in the test environment is running stably according to the name of the target service, and obtaining the running status of the target service; A third result is obtained according to the name of the target service and the running status of the target service.
6. The software operating environment detection method according to claim 5, characterized in that: The step of detecting whether the target service in the test environment is running stably according to the name of the target service and obtaining the running status of the target service includes: Determine multiple times within a preset time whether the target service in the environment to be tested is closed; If the target service in the environment to be tested is shut down a preset number of times within the preset time, it is determined that the target service is not running stably in the environment to be tested; otherwise, it is determined that the target service is running stably in the environment to be tested.
7. A software operating environment detection device, characterized in that: The device comprises: A first response module is configured to determine target business software in response to a business software selection operation; wherein the target business software is business software that needs to be tested to see if it matches the environment to be tested; A display module is configured to display a plurality of test items of the target business software on a preset interface, wherein the plurality of test items include test items related to the target business software and the environment to be tested during the entire software life cycle; a second response module, configured to respond to a detection item selection operation performed on the preset interface and determine at least one target detection item from the plurality of detection items; A detection module is used to obtain the environmental requirement information corresponding to the target business software and the target detection project, and to detect the environment to be tested according to the environmental requirement information to obtain a detection result; wherein, if the environment to be tested meets the environmental requirement information corresponding to the target detection project, it indicates that the environment to be tested and the target business software match the target detection project.
8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
10. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
Citation Information
Patent Citations
Network port management method and device, terminal equipment and storage medium
CN109815110A
Software environment detection method and device, storage medium and processor
CN110069393A
Hardware WDT-based monitoring method and equipment, and readable medium
CN110427296A
Distributed application deployment method and device, storage medium and electronic equipment
CN113986270A