Recommended methods, apparatus, equipment, and storage media for testing environments.

By identifying the relationships between business systems, the system automatically recommends test environment chains, solving the problem of time-consuming test environment allocation in existing technologies and improving efficiency and accuracy.

CN115827472BActive Publication Date: 2026-05-26BEIJING PACTERA JINXIN TECH LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
BEIJING PACTERA JINXIN TECH LTD
Filing Date
2022-12-14
Publication Date
2026-05-26

Smart Images

  • Figure CN115827472B_ABST
    Figure CN115827472B_ABST
Patent Text Reader

Abstract

This application provides a method, apparatus, device, and storage medium for recommending test environments. The method includes: receiving an input identifier of a business system to be tested; determining, based on the identifier, whether there is a business logic relationship between the business system to be tested and other business systems, indicating whether the testing of the business system to be tested depends on the test results of other business systems; if a business logic relationship exists, identifying the other business systems as related business systems; determining a target environment chain from multiple preset environment chains based on the identifier of the business system to be tested and the identifiers of the related business systems; and displaying test environment recommendation information for the business system to be tested, including information about the target environment chain. In this application, by matching the business system to be tested to determine related business systems with which it has a business logic relationship, and automatically recommending the target environment chain, communication time is saved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of computer technology, and more specifically, to a recommended method, apparatus, device, and storage medium for a testing environment. Background Technology

[0002] The overall business process in the project consists of multiple business systems. To improve testing efficiency, each business system corresponds to multiple test environments, and there may be relationships between different business systems.

[0003] In the existing technology, when applying for a test environment, the applicant (i.e. the tester) does not know the relationship between the business systems or whether the test environment is available. The environment auditor needs to consult relevant personnel during the approval process to know which test environments are available in the business systems and which test environments need to be used together, and then allocate the corresponding test environments to the applicant.

[0004] However, the process of manually allocating test environments results in a significant time delay during the environment application stage. Summary of the Invention

[0005] In view of this, embodiments of this application provide a recommended method, apparatus, device, and storage medium for a testing environment to solve the problem of significant time wastage caused by the testing environment process.

[0006] In a first aspect, embodiments of this application provide a method for recommending a testing environment, including:

[0007] Receive the identifier of the business system to be tested;

[0008] Based on the identifier of the business system to be tested, it is determined whether there is a business logic relationship between the business system to be tested and other business systems, which is used to indicate whether the test of the business system to be tested depends on the test results of other business systems;

[0009] If the aforementioned business logic relationship exists, then the other business systems are identified as related business systems;

[0010] Based on the identifier of the business system to be tested and the identifier of the associated business system, a target environment chain is determined from multiple preset environment chains; each preset environment chain includes: the identifiers of the test environments of at least two business systems that have business logic association, and the target environment chain includes at least: the identifier of the first test environment of the business system to be tested and the identifier of the second test environment of the associated business system;

[0011] The test environment recommendation information for the business system to be tested is displayed. The test environment recommendation information includes: information about the target environment chain.

[0012] In an optional implementation, determining the target environment chain from multiple preset environment chains based on the identifier of the business system to be tested and the identifier of the associated business system includes:

[0013] Based on the identifier of the business system to be tested and the identifier of the associated business system, a plurality of first candidate environment chains are determined from the plurality of preset environment chains, and each first candidate environment chain includes at least: the identifier of the first test environment and the identifier of the second test environment;

[0014] Based on the first state information of the test environments within the plurality of first candidate environment chains, the target environment chain is determined from the plurality of first candidate environment chains, wherein the first state information is used to indicate whether the corresponding test environment is a preset exclusive test environment.

[0015] In an optional implementation, determining the target environment chain from the plurality of first candidate environment chains involves using the first state information of the test environments within the plurality of first candidate environment chains.

[0016] Based on the first state information of the test environment within the plurality of first candidate environment chains, at least one second candidate environment chain is determined from the plurality of first candidate environment chains;

[0017] The target environment chain is determined from the at least one second candidate environment chain based on the attribute information of the at least one second candidate environment chain.

[0018] In an optional implementation, before determining the target environment chain from the at least one second candidate environment chain based on the attribute information of the at least one second candidate environment chain, the method further includes:

[0019] The length of each second candidate environment chain is determined based on the number of test environments within each second candidate environment chain, and the attribute information of each second candidate environment chain includes: the length of each second candidate environment chain;

[0020] The step of determining the target environment chain from the at least one second candidate environment chain based on the attribute information of the at least one second candidate environment chain includes:

[0021] The target environment chain is determined from the at least one second candidate environment chain based on the length of the at least one second candidate environment chain.

[0022] In an optional implementation, before determining the target environment chain from the at least one second candidate environment chain based on the attribute information of the at least one second candidate environment chain, the method further includes:

[0023] Based on the first state information of the test environment within each second candidate environment chain, determine the number of test environments in a preset state within each second candidate environment chain.

[0024] The step of determining the target environment chain from the at least one second candidate environment chain based on the attribute information of the at least one second candidate environment chain includes:

[0025] The target environment chain is determined from the at least one second candidate environment chain based on the number of test environments in the preset state on the at least one second candidate environment chain.

[0026] In an optional implementation, the preset state includes an idle state and a reusable state, and determining the target environment chain from the at least one second candidate environment chain based on the number of test environments in the preset state on the at least one second candidate environment chain includes:

[0027] The target environment chain is determined from the at least one second candidate environment chain based on the number of test environments in the idle state and the number of test environments in the reusable state within the at least one second candidate environment chain.

[0028] In an optional implementation, the method further includes:

[0029] If the business logic association does not exist, then obtain the identifiers of multiple test environments corresponding to the business system to be tested;

[0030] Based on the second status information of the plurality of test environments, a target test environment is determined from the plurality of test environments, wherein the second status information is used to indicate whether the corresponding test environment is idle or reusable.

[0031] The system displays recommended test environment information for the business system to be tested, which includes the identifier of the target test environment.

[0032] Secondly, embodiments of this application also provide a device for recommending a testing environment, comprising:

[0033] The receiving module is used to receive the identifier of the business system to be tested.

[0034] The determination module is used to determine whether there is a business logic relationship between the business system under test and other business systems based on the identifier of the business system under test, and to indicate whether the test of the business system under test depends on the test results of other business systems.

[0035] The determining module is further configured to determine the other business systems as associated business systems if the business logic association exists.

[0036] The determining module is further configured to determine a target environment chain from multiple preset environment chains based on the identifier of the business system to be tested and the identifier of the associated business system; each preset environment chain includes: the identifiers of the test environments of at least two business systems that have business logic association; the target environment chain includes at least: the identifier of the first test environment of the business system to be tested and the identifier of the second test environment of the associated business system.

[0037] The display module is used to display recommended test environment information for the business system to be tested. The recommended test environment information includes information about the target environment chain.

[0038] In an optional implementation, the determining module is specifically used for:

[0039] Based on the identifier of the business system to be tested and the identifier of the associated business system, a plurality of first candidate environment chains are determined from the plurality of preset environment chains, and each first candidate environment chain includes at least: the identifier of the first test environment and the identifier of the second test environment;

[0040] Based on the first state information of the test environments within the plurality of first candidate environment chains, the target environment chain is determined from the plurality of first candidate environment chains, wherein the first state information is used to indicate whether the corresponding test environment is a preset exclusive test environment.

[0041] In an optional implementation, the determining module is specifically used for:

[0042] Based on the first state information of the test environment within the plurality of first candidate environment chains, at least one second candidate environment chain is determined from the plurality of first candidate environment chains;

[0043] The target environment chain is determined from the at least one second candidate environment chain based on the attribute information of the at least one second candidate environment chain.

[0044] In an optional implementation, the determining module is further configured to:

[0045] The length of each second candidate environment chain is determined based on the number of test environments within each second candidate environment chain, and the attribute information of each second candidate environment chain includes: the length of each second candidate environment chain;

[0046] The determining module is specifically used for:

[0047] The target environment chain is determined from the at least one second candidate environment chain based on the length of the at least one second candidate environment chain.

[0048] In an optional implementation, the determining module is further configured to:

[0049] Based on the first state information of the test environment within each second candidate environment chain, the number of test environments in a preset state within each second candidate environment chain is determined. The attribute information of each second candidate environment chain includes the number of test environments in the preset state within each second candidate environment chain.

[0050] The determining module is specifically used for:

[0051] The target environment chain is determined from the at least one second candidate environment chain based on the number of test environments in the preset state on the at least one second candidate environment chain.

[0052] In an optional implementation, the preset state includes: an idle state and a reusable state, and the determining module is specifically used for:

[0053] The target environment chain is determined from the at least one second candidate environment chain based on the number of test environments in the idle state and the number of test environments in the reusable state within the at least one second candidate environment chain.

[0054] In an optional implementation, the apparatus further includes:

[0055] The acquisition module is used to acquire the identifiers of multiple test environments corresponding to the business system under test if the business logic association does not exist.

[0056] The determining module is further configured to determine a target test environment from the plurality of test environments based on the second status information of the plurality of test environments, wherein the second status information is used to indicate whether the corresponding test environment is idle or reusable;

[0057] The display module is also used to display recommended test environment information for the business system to be tested, including the identifier of the target test environment.

[0058] Thirdly, embodiments of this application also provide an electronic device, including: a processor, a memory, and a bus, wherein the memory stores machine-readable instructions executable by the processor, and when the electronic device is running, the processor communicates with the memory via the bus, and the processor executes the machine-readable instructions to perform the recommended method of any of the test environments described in the first aspect.

[0059] Fourthly, embodiments of this application also provide a computer-readable storage medium storing a computer program, which, when executed by a processor, performs the recommended method of any of the test environments described in the first aspect.

[0060] This application provides a method, apparatus, device, and storage medium for recommending test environments. The method includes: receiving an input identifier of a business system to be tested; determining, based on the identifier, whether there is a business logic relationship between the business system to be tested and other business systems; indicating whether the testing of the business system to be tested depends on the test results of the other business systems; if a business logic relationship exists, identifying the other business systems as related business systems; determining a target environment chain from multiple preset environment chains based on the identifier of the business system to be tested and the identifiers of the related business systems; and displaying test environment recommendation information for the business system to be tested, including information about the target environment chain. In this application, by matching the business system to be tested to determine related business systems with which it has a business logic relationship, and automatically recommending the target environment chain, communication time is saved.

[0061] To make the above-mentioned objectives, features and advantages of this application more apparent and understandable, preferred embodiments are described below in detail with reference to the accompanying drawings. Attached Figure Description

[0062] To more clearly illustrate the technical solutions of the embodiments of this application, the accompanying drawings used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of this application and should not be regarded as a limitation of the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.

[0063] Figure 1 A flowchart illustrating the recommended method for providing a testing environment for embodiments of this application. Figure 1 ;

[0064] Figure 2 A flowchart illustrating the recommended method for providing a testing environment for embodiments of this application. Figure 2 ;

[0065] Figure 3 A flowchart illustrating the recommended method for providing a testing environment for embodiments of this application. Figure 3 ;

[0066] Figure 4 A flowchart illustrating the recommended method for providing a testing environment for embodiments of this application. Figure 4 ;

[0067] Figure 5 A flowchart illustrating the recommended method for providing a testing environment for embodiments of this application. Figure 5 ;

[0068] Figure 6 A flowchart illustrating the recommended method for providing a testing environment for embodiments of this application. Figure 6 ;

[0069] Figure 7 A schematic diagram of the recommended apparatus for the testing environment provided in the embodiments of this application;

[0070] Figure 8 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation

[0071] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. The components of the embodiments of this application described and shown in the accompanying drawings can generally be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of this application provided in the accompanying drawings is not intended to limit the scope of the claimed application, but merely represents selected embodiments of this application. All other embodiments obtained by those skilled in the art based on the embodiments of this application without inventive effort are within the scope of protection of this application.

[0072] To address the issue of significant time wasted by environment applicants during the application process in existing test environment allocation methods, this application provides a test environment recommendation method. By pre-entering information on pre-configured test environments, environment chains, and the status of individual test environments, the method matches the business systems to be tested. During environment review, the method directly recommends the most available environments or environment chains, thus automatically recommending test environments or environment chains. This saves environment applicants considerable time spent on communication and inquiries, allowing them to directly select available environment chains based on their needs. Furthermore, environment reviewers do not need to repeatedly contact different relevant personnel and wait for feedback.

[0073] The recommended method for the testing environment provided in this application will be described below with reference to several specific embodiments.

[0074] Figure 1 A flowchart illustrating the recommended method for providing a testing environment for embodiments of this application. Figure 1 In this embodiment, the executing entity can be an electronic device, such as a terminal, server, or other device with data processing capabilities.

[0075] like Figure 1As shown, the method may include:

[0076] S101, Receive the identifier of the business system to be tested.

[0077] Electronic devices can provide a testing environment recommendation platform. When a testing environment needs to be applied for, the environment auditor can enter the identifier of the business system to be tested through the platform, and the electronic device will receive the entered identifier of the business system to be tested.

[0078] Taking electronic devices as terminals as an example, the terminal devices provide a test environment recommendation platform, where environment auditors can input the identifier of the business system to be tested; taking electronic devices as servers as an example, the servers provide a test environment recommendation platform, and the user terminals and servers communicate with each other. The user terminals provide an input window corresponding to the platform, through which environment auditors can input the identifier of the business system to be tested. The user terminals send the identifier to the server, and the server can then receive the identifier of the business system to be tested.

[0079] S102. Based on the identifier of the business system to be tested, determine whether there is a business logic relationship between the business system to be tested and other business systems, which is used to indicate whether the test of the business system to be tested depends on the test results of other business systems.

[0080] The business logic association is used to indicate that the test of the business system under test depends on the test results of other business systems. If a business logic association exists, it indicates that the test of the business system under test depends on the test results of other business systems. That is, there is a business relationship between the two business systems, and they need to be tested simultaneously.

[0081] The electronic device receives the identifier of the business system to be tested through the test environment recommendation platform, and queries the pre-saved correspondence between business systems with business logic relationships based on the identifier of the business system to be tested, so as to determine whether there is a business logic relationship between the business system to be tested and other business systems.

[0082] In some embodiments, it can first be determined whether the business system to be tested has been registered on the platform. If it has been registered, it can be determined whether there is a business logic relationship between the business system to be tested and other business systems. This can avoid the failure to match the subsequent test environment when it is not registered, which would result in a waste of time.

[0083] S103. If there is a business logic relationship, then other business systems are identified as related business systems.

[0084] If it is determined that the business system under test has a business logic connection with other business systems, then the other business system is identified as the associated business system, and the identifier of the other business system is identified as the identifier of the associated business system.

[0085] S104. Based on the identifier of the business system to be tested and the identifier of the associated business system, determine the target environment chain from multiple preset environment chains.

[0086] Among them, multiple preset environment chains can be environment chains of the pre-entered test environment recommendation platform. Each preset environment chain includes: the identifiers of test environments of at least two business systems that have business logic relationships, at least two business systems corresponding to different test environments, and one business system corresponding to one test environment.

[0087] Based on the identifiers of the business system to be tested and the associated business systems, multiple preset environment chains are queried to match and determine the target environment chain from the multiple preset environment chains. The target environment chain includes at least: the identifier of the first test environment of the business system to be tested and the identifier of the second test environment of the associated business system. There is a correspondence between the business system and the corresponding test environment. Therefore, based on the identifiers of the large test business system and the associated business systems, the target environment chain including the identifiers of the first test environment of the business system to be tested and the identifiers of the second test environment of the associated business system can be selected from the multiple preset environment chains.

[0088] In this context, the first test environment for the business system to be tested is the test environment for the business system to be tested, and the second test environment for the related business system is the test environment for the related business system. It is worth noting that "first" and "second" are only used for distinguishing descriptions and are not used to refer to importance or execution order.

[0089] For example, the user inputs the identifier of the business system to be tested as A, determines the identifier of the associated business system of A as B, retrieves and queries multiple preset environment chains, and determines the target environment chain from the multiple preset environment chains in which the test environment of A and the test environment of B coexist.

[0090] It should be noted that the number of first test environments for the business system to be tested includes, but is not limited to, one, and the number of second test environments for the associated business system includes, but is not limited to, one.

[0091] S105. Display recommended test environment information for the business system to be tested.

[0092] After the target environment chain is determined, the recommended test environment information for the business system to be tested can be displayed on the visualization interface. This recommended test environment information includes: the information of the target environment chain, which includes, but is not limited to: the identifier of the target environment chain and the identifier of each test environment on the target environment chain. In this way, the information of the recommended target environment chain for the business system to be tested can be viewed intuitively, so that the first test environment on the target environment chain can be used to test the business system to be tested and the second test environment can be used to test the related business system simultaneously.

[0093] It should be noted that environmental auditors can also input allocation operations for the target environmental chain through a visual interface. The device responds to the allocation operation and allocates the target environmental chain to the environmental applicant.

[0094] In the test environment recommendation method of this embodiment, the identifier of the business system to be tested is received. Based on the identifier, it is determined whether there is a business logic relationship between the business system to be tested and other business systems. This relationship indicates whether the test of the business system to be tested depends on the test results of other business systems. If a business logic relationship exists, the other business systems are identified as related business systems. Based on the identifier of the business system to be tested and the identifiers of the related business systems, a target environment chain is determined from multiple preset environment chains. Test environment recommendation information for the business system to be tested is then displayed, including information about the target environment chain. By matching the business system to be tested to determine related business systems with which it has a business logic relationship and automatically recommending the target environment chain, communication time is saved.

[0095] Figure 2 A flowchart illustrating the recommended method for providing a testing environment for embodiments of this application. Figure 2 ,like Figure 2 As shown, based on the identifier of the business system to be tested and the identifier of the associated business system, the target environment chain is determined from multiple preset environment chains, which may include:

[0096] S201. Based on the identifier of the business system to be tested and the identifier of the associated business system, determine multiple first candidate environment chains from multiple preset environment chains.

[0097] Each first candidate environment chain includes at least: the identifier of the first test environment and the identifier of the second test environment. That is, based on the identifier of the business system to be tested and the identifier of the associated business system, multiple preset environment chains are queried to determine multiple first candidate environment chains from the multiple environment chains in which the first test environment of the business system to be tested and the second test environment of the associated business system coexist.

[0098] S202. Based on the first state information of the test environment within multiple first candidate environment chains, determine the target environment chain from multiple first candidate environment chains.

[0099] The first status information is used to indicate whether the corresponding test environment is a preset exclusive test environment. A preset exclusive test environment can be understood as the test environment being used to test another business system. This test environment is not reusable, meaning that only one business system can be tested at the same time, and two or more business systems cannot be tested at the same time.

[0100] Each first candidate environment chain includes at least: the identifier of the first test environment and the identifier of the second test environment. Based on the first state information of the test environment in each first candidate environment chain, multiple first candidate environment chains can be filtered to determine the target environment chain from the multiple first candidate environment chains. The state of the test environment in the target environment chain is not a preset exclusive test state.

[0101] In other words, after selecting multiple first candidate environment chains from multiple preset environment chains, the first state information of the test environment within the multiple first candidate environment chains is obtained. Then, based on the first state information of the test environment, the multiple first candidate environment chains are further filtered to obtain the target environment chain.

[0102] In some embodiments, the test environment in the preset exclusive state can be a first test environment or a second test environment. Since the test environment cannot test two business systems at the same time, the test environment in the preset exclusive state can be filtered out from the first candidate environment chain in this way.

[0103] In some other embodiments, the test environment in the preset exclusive state may not be the first test environment or the second test environment. If the first candidate environment chain corresponding to the test environment in the preset exclusive state is used as the target environment chain to test the business system under test using the first test environment on the first candidate environment chain, it may affect the test results corresponding to the test environment in the preset exclusive state. Therefore, the above screening method can avoid affecting the test results in the test environment in the preset exclusive state.

[0104] Taking the business system under test as system A, the associated business system as system B, and multiple first candidate environment chains including: environment chain 1, environment chain 2, environment chain 3, and environment chain 4 as an example, Table 1 shows the multiple first candidate environment chains. Referring to Table 1, it can be seen that:

[0105] Environment Chain 1: System A - Environment 1, System B - Environment 1, System C - Environment 1; Environment Chain 2: System A - Environment 2, System B - Environment 2; Environment Chain 3: System A - Environment 3, System B - Environment 3, System C - Environment 3, System D - Environment 3; Environment Chain 4: System A - Environment 4, System B - Environment 4, System C - Environment 4.

[0106]

[0107] Table 1

[0108] Among them, System A-Environment 1, System A-Environment 2, System A-Environment 3, and System A-Environment 4 are all test environments for System A, meaning System A has 4 test environments; similarly, System B-Environment 1, System B-Environment 2, System B-Environment 3, and System B-Environment 4 are all test environments for System B, meaning System B has 4 test environments; System C-Environment 1, System C-Environment 3, and System C-Environment 4 are all test environments for System C; and System D-Environment 3 and System D-Environment 4 are all test environments for System D.

[0109] As can be seen from the environmental states (i.e. first state information) in Table 1, the C system-environment 4 in environment chain 4 is in an exclusive state. Therefore, the first candidate environment chains are filtered out, and environment chain 4 is eliminated. Then, the target environment chain is determined from environment chain 1, environment chain 2, and environment chain 3.

[0110] In the recommended test environment method of this embodiment, based on the identification of the business system, the target environment chain is further filtered by combining the first state information, so that the filtered target environment chain is more effective and avoids affecting the test results of the test environment with the preset exclusive state on the chain.

[0111] Figure 3 A flowchart illustrating the recommended method for providing a testing environment for embodiments of this application. Figure 3 ,like Figure 3 As shown, the first state information of the test environments within multiple first candidate environment chains is used to determine the target environment chain from the multiple first candidate environment chains, including:

[0112] S301. Based on the first state information of the test environment within the multiple first candidate environment chains, determine at least one second candidate environment chain from the multiple first candidate environment chains.

[0113] The first state information is used to indicate whether the corresponding test environment is a preset exclusive test environment. The first state information of the test environment in multiple first candidate environment chains is obtained, and the multiple first candidate environment chains are filtered according to the first state information of the test environment to determine at least one second candidate environment chain from the multiple first candidate environment chains. The state of the test environment in each second candidate environment chain is not a preset exclusive test state.

[0114] Referring to Table 1, at least one second candidate environment chain includes: environment chain 1, environment chain 2, and environment chain 3.

[0115] S302. Determine the target environment chain from at least one second candidate environment chain based on the attribute information of at least one second candidate environment chain.

[0116] Attribute information is used to characterize the link structure of the second candidate environment chain, such as the link length. After selecting at least one second candidate environment chain from multiple first candidate environment chains, the attribute information of at least one second candidate environment chain is obtained. Then, based on the attribute information, the environment chain that meets the preset link structure is selected as the target environment chain from the at least one second candidate environment chain. The link length can be understood as the number of test environments within the second candidate environment chain. Since the longer the link, the greater the impact range, the second candidate environment chain with the smallest link length can be determined as the target environment chain to reduce the impact range. The preset link structure may include the shortest link length.

[0117] Figure 4 A flowchart illustrating the recommended method for providing a testing environment for embodiments of this application. Figure 4 ,like Figure 4 As shown, before determining the target environment chain from at least one second candidate environment chain based on the attribute information of at least one second candidate environment chain, the method may further include:

[0118] S401. Determine the length of each second candidate environment chain based on the number of test environments within each second candidate environment chain.

[0119] The attribute information of each second candidate environment chain includes: the length of each second candidate environment chain, the number of test environments within each second candidate environment chain, and the determination of the number of test environments within each second candidate environment chain as the length of each second candidate environment chain, that is, the length of each second candidate environment chain is the number of test environments within each second candidate environment chain.

[0120] Accordingly, based on the attribute information of at least one second candidate environment chain, the target environment chain is determined from at least one second candidate environment chain, including:

[0121] S402. Determine the target environment chain from at least one second candidate environment chain based on the length of at least one second candidate environment chain.

[0122] Since the longer the link, the larger the influence range of the environmental chain, the target environmental chain can be determined from at least one second candidate environmental chain based on the length of at least one second candidate environmental chain. The length of the target environmental chain can be the environmental chain whose link length meets the preset length condition among at least one second candidate environmental chain. The preset length condition can be the shortest to reduce the influence range.

[0123] Referring to Table 1, at least one second candidate environment chain includes: environment chain 1, environment chain 2, and environment chain 3. The lengths of environment chain 1, environment chain 2, and environment chain 3 are obtained, which are 3, 2, and 4 respectively. It can be seen that the length of environment chain 1 is the shortest, so environment chain 1 can be determined as the target environment chain.

[0124] Figure 5 A flowchart illustrating the recommended method for providing a testing environment for embodiments of this application. Figure 5 ,like Figure 5 As shown, before determining the target environment chain from at least one second candidate environment chain based on the attribute information of at least one second candidate environment chain, the method may further include:

[0125] S501. Based on the first state information of the test environment within each second candidate environment chain, determine the number of test environments in a preset state within each second candidate environment chain.

[0126] The first state information of the test environment within the second candidate environment chain is also used to indicate whether the corresponding test environment is idle or reusable. Based on the first state information of each test environment within the second candidate environment chain, the test environments in the preset states within each second subsequent environment chain can be determined, and the number of test environments in the preset states can be determined. The preset states include: idle state and reusable state.

[0127] The attribute information for each second candidate environment chain includes: the number of test environments in a preset state within each second candidate environment chain.

[0128] A test environment in an idle state means that the test environment is not currently being used for testing. A test environment in a reusable state means that the test environment is being used to test another business system. However, since the test environment is reusable, it can be used to test two or more business systems at the same time.

[0129] Accordingly, based on the attribute information of at least one second candidate environment chain, the target environment chain is determined from at least one second candidate environment chain, including:

[0130] S502. Determine the target environment chain from at least one second candidate environment chain based on the number of test environments in a preset state on at least one second candidate environment chain.

[0131] Based on the number of test environments in a preset state within at least one second candidate environment chain, at least one second candidate environment chain can be screened to determine a target environment chain from at least one second candidate environment chain, wherein the number of test environments in a preset state on the target environment chain can satisfy a preset quantity condition.

[0132] In an optional implementation, step S502 may include: determining a target environment chain from at least one second candidate environment chain based on the number of test environments in an idle state and the number of test environments in a reusable state within at least one second candidate environment chain.

[0133] In other words, at least one second candidate environment chain is filtered based on the number of test environments in an idle state and the number of test environments in a reusable state on at least one second candidate environment chain to select a target environment chain. The number of test environments in an idle state on the target environment chain can meet a first preset quantity condition, and the number of test environments in a reusable state can meet a second preset quantity condition. The first preset quantity condition may include, for example, the number of test environments in an idle state exceeding a first preset threshold, and the second preset quantity condition may include, for example, the number of test environments in a reusable state not exceeding a second preset threshold.

[0134] It should be noted that for test environments in an idle state, the more numerous they are, the less impact they have on the current test, and therefore the higher their priority. For test environments in a reusable state, the more numerous they are, the more they can be shared, and the greater their impact on their own test results, thus the lower their priority. In this embodiment, the number of test environments in an idle state exceeds the first preset threshold, and the number of test environments in a reusable state does not exceed the second preset threshold, which can reduce the impact on the test results.

[0135] In summary, the attribute information of each second candidate environment chain includes: the length of each second candidate environment chain and the number of test environments in a preset state within each second candidate environment chain. The target environment chain can be determined from at least one second candidate environment chain based on the length of at least one second candidate environment chain and the number of test environments in a preset state on at least one second candidate environment chain.

[0136] In some embodiments, a weighted sum operation can be performed based on the weights of three factors: environment chain length, idle test environment, and reusable test environment, to calculate the weight value of each second candidate environment chain. Then, based on the weight value, a target environment chain is determined from at least one second candidate environment chain. The weight value of the target environment chain can satisfy a preset condition, such as maximizing the weight value.

[0137] For example, if the weight of the environment chain length is x, the weight of the idle test environment is y, the weight of the reusable test environment is z, the length of the second candidate environment chain is O, the number of idle test environments on the second candidate environment chain is M, and the number of reusable test environments is N, then the weight of the second candidate environment chain is: x×O+y×M+z×N.

[0138] It should be noted that the weights of these three factors can be determined based on their impact on the test. For example, the longer the link length, the greater the impact on the environmental test, and the lower the priority, with a weight of -3. The more idle nodes (i.e., idle test environments) there are, the less impact they have on the test, and the higher the priority, with a weight of 1. Reused nodes (i.e., reused test environments) need to share the environment. The more reused nodes there are, the greater the impact on their own test, and the lower the priority. However, their priority can be higher than that of link length, with a weight of -2.

[0139] Based on Table 1, Table 2 shows at least one second candidate environment chain. Referring to Table 2, it can be seen that:

[0140] Environment Chain 1: System A - Environment 1 is in idle state, System B - Environment 1 is in reuse state, System C - Environment 1 is in idle state; Environment Chain 2: System A - Environment 2 is in idle state, System B - Environment 2 is in idle state; Environment Chain 3: System A - Environment 3 is in idle state, System B - Environment 3 is in idle state, System C - Environment 3 is in idle state, System D - Environment 3 is in idle state.

[0141]

[0142] Table 2

[0143] Therefore, we can see that, sorted from longest to shortest, the following are the characteristics of the environment chain: Environment chain 1 has a length of 3, 2 idle nodes, and 1 reused node; Environment chain 2 has a length of 2, 2 idle nodes, and 0 reused nodes; Environment chain 3 has a length of 4, 4 idle nodes, and 0 reused nodes.

[0144] The calculated weights of environment chain 1 are: (-3)×3+1×2+(-2)×1=-9; the weights of environment chain 2 are (-3)×2+1×2+(-2)×0=-4; and the weights of environment chain 3 are (-3)×4+1×4+(-2)×0=-8. Therefore, environment chain 2 is determined to be the target environment chain.

[0145] In this embodiment of the application, the environmental chains can also be prioritized according to the weight value of each environmental chain. Table 3 is the environmental chain priority ranking table. Referring to Table 3, the priority of environmental chain 2 is high, the priority of environmental chain 3 is medium, and the priority of environmental chain 2 is low.

[0146]

[0147] Table 3

[0148] As shown in Table 3, the environment chain priority ranking table shown in Table 3 can also be displayed through a visual interface. Table 3 also has an "Operation" option, which allows environment auditors to assign the corresponding test environment by clicking "Assign this environment to the applicant" for the corresponding environment chain.

[0149] Based on the above embodiments, if the business system to be tested does not have any business logic relationship, then it can also be executed. Figure 6 The steps are shown.

[0150] Figure 6 A flowchart illustrating the recommended method for providing a testing environment for embodiments of this application. Figure 6 ,like Figure 6 As shown, the method may further include:

[0151] S601. If there is no business logic association, obtain the identifiers of multiple test environments corresponding to the business system to be tested.

[0152] If there is no business logic relationship between the business system to be tested and other business systems, it means that the business system to be tested can be tested independently without relying on other business systems. In this case, the identifiers of multiple test environments corresponding to the business system to be tested can be obtained. For example, if the business system to be tested is system A, then the multiple test environments corresponding to the business system to be tested can include system A-environment 1, system A-environment 2, system A-environment 3, and system A-environment 4.

[0153] It is worth noting that the test environment recommendation platform can also store the correspondence between each test business system and the multiple test environments corresponding to each test business system. By querying this correspondence based on the identifier of the business system to be tested, the identifiers of the multiple test environments corresponding to the business system to be tested can be determined.

[0154] S602. Determine the target test environment from the multiple test environments based on the second state information of multiple test environments.

[0155] S603. Display recommended test environment information for the business system to be tested.

[0156] Based on the second state information of multiple test environments, multiple test environments are filtered to determine the target test environment from the multiple test environments. The state of the target test environment can be idle or reusable. The second state information is used to indicate whether the corresponding test environment is idle or reusable.

[0157] Then, the recommended test environment information for the business system under test is displayed. The recommended test environment information includes the identifier of the target test environment. In this way, the identifier of the recommended target test environment for the business system under test can be viewed intuitively, so as to use the target test environment to test the business system under test.

[0158] It should be noted that environmental auditors can also input allocation operations for the target test environment through a visual interface. The device responds to the allocation operation and allocates the target test environment to the environmental applicant.

[0159] In the test environment recommendation method of this embodiment, if there is no business logic association, the identifiers of multiple test environments corresponding to the business system to be tested are obtained. Based on the first state information of the multiple test environments, the target test environment is determined from the multiple test environments, and the test environment recommendation information of the business system to be tested is displayed. By matching the business system to be tested, the environment auditor can directly recommend the preferred available environment when approving the environment, thereby automatically recommending test environments and saving communication time.

[0160] Based on the above embodiments, this application also provides an implementation process for a specific method for recommending a testing environment, including the following steps:

[0161] Step 1: Check whether the business system to be tested has been registered.

[0162] Step 2: If registered, determine whether the business system to be tested has a test environment that is not associated with the environment chain and is in an idle or reused state.

[0163] If the business system under test has an idle or reused test environment that is not associated with the environment chain, it indicates that there is no business logic connection between the business system under test and other business systems. If the business system under test does not have an idle or reused test environment that is not associated with the environment chain, it indicates that there is a business logic connection between the business system under test and other business systems.

[0164] Step 3: If it exists, return the available test environment.

[0165] Step 4: If it does not exist, query for an idle environment chain or a reusable environment chain containing the business system to be tested.

[0166] Step 5: Sort the environment chains from longest to shortest, and check the number of idle test environments and the number of reusable test environments.

[0167] Step 6: Calculate the weight value of the environment chain based on the length of the environment chain, the number of idle test environments, and the number of reusable test environments.

[0168] Step 7: Based on the weight values ​​of each environment chain, return a list of available environment chains.

[0169] Based on the same inventive concept, this application also provides a test environment recommendation device corresponding to the test environment recommendation method. Since the principle of the device in this application to solve the problem is similar to the test environment recommendation method described above in this application, the implementation of the device can refer to the implementation of the method, and the repeated parts will not be described again.

[0170] Figure 7 This is a schematic diagram of a recommended apparatus for a testing environment provided in an embodiment of this application. This apparatus can be integrated into an electronic device. Figure 7 As shown, the device may include:

[0171] The receiving module 701 is used to receive the identifier of the business system to be tested.

[0172] The determination module 702 is used to determine whether there is a business logic relationship between the business system under test and other business systems based on the identifier of the business system under test, and to indicate whether the test of the business system under test depends on the test results of other business systems.

[0173] The determining module 702 is further configured to determine the other business systems as related business systems if there is a business logic relationship.

[0174] The determination module 702 is further configured to determine a target environment chain from multiple preset environment chains based on the identifier of the business system to be tested and the identifier of the associated business system; each preset environment chain includes: the identifiers of the test environments of at least two business systems that have business logic relationships, and the target environment chain includes at least: the identifier of the first test environment of the business system to be tested and the identifier of the second test environment of the associated business system;

[0175] The display module 703 is used to display recommended test environment information for the business system to be tested. The recommended test environment information includes: information about the target environment chain.

[0176] In an optional implementation, the determining module 702 is specifically used for:

[0177] Based on the identifier of the business system to be tested and the identifier of the associated business system, multiple first candidate environment chains are determined from multiple preset environment chains. Each first candidate environment chain includes at least: the identifier of the first test environment and the identifier of the second test environment.

[0178] Based on the first state information of the test environments within multiple first candidate environment chains, the target environment chain is determined from the multiple first candidate environment chains. The first state information is used to indicate whether the corresponding test environment is a preset exclusive test environment.

[0179] In an optional implementation, the determining module 702 is specifically used for:

[0180] Based on the first state information of the test environment within multiple first candidate environment chains, at least one second candidate environment chain is determined from the multiple first candidate environment chains;

[0181] The target environment chain is determined from at least one second candidate environment chain based on the attribute information of at least one second candidate environment chain.

[0182] In an optional implementation, the determining module 702 is further configured to:

[0183] The length of each second candidate environment chain is determined based on the number of test environments within each second candidate environment chain. The attribute information of each second candidate environment chain includes: the length of each second candidate environment chain.

[0184] Module 702 is specifically used for:

[0185] The target environment chain is determined from at least one second candidate environment chain based on the length of at least one second candidate environment chain.

[0186] In an optional implementation, the determining module 702 is further configured to:

[0187] Based on the first state information of the test environment within each second candidate environment chain, determine the number of test environments in a preset state within each second candidate environment chain. The attribute information of each second candidate environment chain includes: the number of test environments in a preset state within each second candidate environment chain.

[0188] Module 702 is specifically used for:

[0189] The target environment chain is determined from at least one second candidate environment chain based on the number of test environments in a preset state on at least one second candidate environment chain.

[0190] In an optional implementation, the preset states include: an idle state and a reusable state. The determining module 702 is specifically used for:

[0191] The target environment chain is determined from at least one second candidate environment chain based on the number of test environments in an idle state and the number of test environments in a reusable state within at least one second candidate environment chain.

[0192] In an optional embodiment, the device further includes:

[0193] The module 704 is used to obtain the identifiers of multiple test environments corresponding to the business system under test if there is no business logic association.

[0194] The determination module 702 is also used to determine the target test environment from multiple test environments based on the second status information of multiple test environments. The second status information is used to indicate whether the corresponding test environment is idle or reusable.

[0195] The display module 703 is also used to display recommended test environment information for the business system to be tested. The recommended test environment information includes: the identifier of the target test environment.

[0196] The processing flow of each module in the device and the interaction flow between each module can be referred to the relevant descriptions in the above method embodiments, and will not be detailed here.

[0197] Figure 8 This is a schematic diagram of the structure of the electronic device provided in the embodiments of this application, such as... Figure 8 As shown, the device may include a processor 801, a memory 802, and a bus 803. The memory 802 stores machine-readable instructions that can be executed by the processor 801. When the electronic device is running, the processor 801 communicates with the memory 802 through the bus 803. The processor 801 executes the machine-readable instructions to perform the recommended method of the test environment in the above method embodiment.

[0198] This application also provides a computer-readable storage medium storing a computer program that is executed by a processor, wherein the processor performs the recommended method of the test environment in the above method embodiments.

[0199] In this embodiment, the computer program, when run by the processor, can also execute other machine-readable instructions to perform other methods as described in the embodiments. For details on the specific execution steps and principles, please refer to the description of the embodiments, which will not be repeated here.

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

[0201] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.

[0202] In addition, the functional units in the embodiments provided in this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.

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

[0204] It should be noted that similar labels and letters in the following figures indicate similar items. Therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures. In addition, the terms "first", "second", "third", etc. are used only to distinguish descriptions and should not be construed as indicating or implying relative importance.

[0205] Finally, it should be noted that the above-described embodiments are merely specific implementations of this application, used to illustrate the technical solutions of this application, and not to limit them. The protection scope of this application is not limited thereto. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that any person skilled in the art can still modify or easily conceive of changes to the technical solutions described in the foregoing embodiments, or make equivalent substitutions for some of the technical features, within the scope of the technology disclosed in this application; and these modifications, changes, or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application. All should be covered within the protection scope of this application. Therefore, the protection scope of this application should be determined by the protection scope of the claims.

Claims

1. A method for recommending a testing environment, characterized in that, include: Receive the identifier of the business system to be tested; Based on the identifier of the business system to be tested, it is determined whether there is a business logic relationship between the business system to be tested and other business systems, which is used to indicate whether the test of the business system to be tested depends on the test results of other business systems; If the aforementioned business logic relationship exists, then the other business systems are identified as related business systems; Based on the identifier of the business system to be tested and the identifier of the associated business system, a target environment chain is determined from multiple preset environment chains; Each preset environment chain includes: the identifiers of the test environments of at least two business systems that have business logic association; the target environment chain includes at least: the identifier of the first test environment of the business system to be tested and the identifier of the second test environment of the associated business system, wherein the first test environment is the test environment of the business system to be tested and the second test environment is the test environment of the associated business system. The test environment recommendation information for the business system to be tested is displayed, and the test environment recommendation information includes: information about the target environment chain; The step of determining the target environment chain from multiple preset environment chains based on the identifier of the business system to be tested and the identifier of the associated business system includes: Based on the identifier of the business system to be tested and the identifier of the associated business system, a plurality of first candidate environment chains are determined from the plurality of preset environment chains, and each first candidate environment chain includes at least: the identifier of the first test environment and the identifier of the second test environment; Based on the first state information of the test environment within the plurality of first candidate environment chains, the target environment chain is determined from the plurality of first candidate environment chains, wherein the first state information is used to indicate whether the corresponding test environment is a preset exclusive test environment; The step of determining the target environment chain from the plurality of first candidate environment chains based on the first state information of the test environments within the plurality of first candidate environment chains includes: Based on the first state information of the test environment within the plurality of first candidate environment chains, at least one second candidate environment chain is determined from the plurality of first candidate environment chains; Based on the first state information of the test environment in each second candidate environment chain, the number of test environments in a preset state in each second candidate environment chain is determined. The preset state includes: idle state and reusable state. The first state information is also used to indicate whether the corresponding test environment is idle or reusable. The target environment chain is determined from the at least one second candidate environment chain based on the number of test environments in the idle state and the number of test environments in the reusable state within the at least one second candidate environment chain.

2. The method according to claim 1, characterized in that, Before determining the target environment chain from the at least one second candidate environment chain based on the attribute information of the at least one second candidate environment chain, the method further includes: The length of each second candidate environment chain is determined based on the number of test environments within each second candidate environment chain, and the attribute information of each second candidate environment chain includes: the length of each second candidate environment chain; The step of determining the target environment chain from the at least one second candidate environment chain based on the attribute information of the at least one second candidate environment chain includes: The target environment chain is determined from the at least one second candidate environment chain based on the length of the at least one second candidate environment chain.

3. The method according to claim 1, characterized in that, The method further includes: If the business logic association does not exist, then obtain the identifiers of multiple test environments corresponding to the business system under test; Based on the second status information of the plurality of test environments, a target test environment is determined from the plurality of test environments, wherein the second status information is used to indicate whether the corresponding test environment is idle or reusable. The system displays recommended test environment information for the business system to be tested, which includes the identifier of the target test environment.

4. A device for recommending a testing environment, characterized in that, include: The receiving module is used to receive the identifier of the business system to be tested. The determination module is used to determine whether there is a business logic relationship between the business system under test and other business systems based on the identifier of the business system under test, and to indicate whether the test of the business system under test depends on the test results of other business systems. The determining module is further configured to determine the other business systems as associated business systems if the business logic association exists. The determining module is further configured to determine a target environment chain from multiple preset environment chains based on the identifier of the business system to be tested and the identifier of the associated business system; Each preset environment chain includes: the identifiers of the test environments of at least two business systems that have business logic association; the target environment chain includes at least: the identifier of the first test environment of the business system to be tested and the identifier of the second test environment of the associated business system, wherein the first test environment is the test environment of the business system to be tested and the second test environment is the test environment of the associated business system. The display module is used to display test environment recommendation information for the business system to be tested. The test environment recommendation information includes: information about the target environment chain. The determining module is specifically used for: Based on the identifier of the business system to be tested and the identifier of the associated business system, a plurality of first candidate environment chains are determined from the plurality of preset environment chains, and each first candidate environment chain includes at least: the identifier of the first test environment and the identifier of the second test environment; Based on the first state information of the test environment within the plurality of first candidate environment chains, at least one second candidate environment chain is determined from the plurality of first candidate environment chains, wherein the first state information is used to indicate whether the corresponding test environment is a preset exclusive test environment; Based on the first state information of the test environment in each second candidate environment chain, the number of test environments in a preset state in each second candidate environment chain is determined. The preset state includes: idle state and reusable state. The first state information is also used to indicate whether the corresponding test environment is idle or reusable. The target environment chain is determined from the at least one second candidate environment chain based on the number of test environments in the idle state and the number of test environments in the reusable state within the at least one second candidate environment chain.

5. An electronic device, characterized in that, include: The device includes a processor, a memory, and a bus, wherein the memory stores machine-readable instructions executable by the processor, and when the electronic device is running, the processor communicates with the memory via the bus, and the processor executes the machine-readable instructions to perform the recommended method of the test environment as described in any one of claims 1 to 3.

6. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, performs the recommended method of the test environment as described in any one of claims 1 to 3.