Test environment energy-saving scheduling method and device and readable medium

By determining the energy-saving strategy in the cloud testing environment and dynamically adjusting the power state of the test environment based on the blueprint and test environment information, the problem of insufficient resources in the cloud testing environment is solved, and resource utilization and energy-saving effects are improved.

CN119396700APending Publication Date: 2025-02-07ZTE CORP
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310923505.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-07-25
Publication Date
2025-02-07

AI Technical Summary

Technical Problem

The cloud testing environment has serious shortages of resources, which makes it difficult to achieve the goal of wasting resources and energy conservation and emission reduction.

Method used

By obtaining blueprint information and test environment information, combining the mapping relationship between the pre-configured blueprint and the test environment and the mapping relationship between the influencing factors and judgment rules, an energy-saving strategy is determined and the test environment is instructed to power on or off.

Benefits of technology

It realizes monitoring, dynamic recycling and release of test resources, improves the utilization rate of the test environment, reduces resource consumption, and meets the matching needs of test tasks and environmental supply.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119396700A_ABST
    Figure CN119396700A_ABST
Patent Text Reader

Abstract

The invention provides an energy-saving scheduling method for a test environment. The method comprises the following steps: acquiring blueprint information and test environment information; according to the blueprint information, the test environment information, a first mapping relation between a pre-configured blueprint and the test environment and a second mapping relation between the influence factor and the judgment rule, an energy-saving strategy is determined and executed, and the energy-saving strategy is used for indicating the test environment to be powered on or powered off. According to the embodiment of the invention, monitoring, dynamic recovery and release of test resources can be realized, test environment resources are shared, the utilization rate of the test environment is improved, and the influence of power on test scheduling in the test environment is reduced; the test environment supply is matched with the busy degree of the test task, resource consumption caused by redundant test environment supply is reduced, the test task can be quickly established, the test environment can be associated, and execution of the test task is more energy-saving, more accurate and more convenient. The invention also provides a test environment energy-saving scheduling device and a readable medium.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the technical field of cloud computing energy-saving scheduling, and in particular to a test environment energy-saving scheduling method, device and readable medium. Background Art

[0002] Testing is a key step to ensure the quality, reliability and security of software or products. The network management system has complex functions, and testing can be divided into unit, system, and integration testing. Therefore, the network management system has many testing tasks, and the corresponding test environment maintenance is very energy-consuming.

[0003] Since the test busy cycles of various test scenarios are different, and old test tasks are likely to be missed, the cloud test environment resources that the test tasks rely on are seriously insufficient, but in fact, there is no need to provide so many resources. In addition, carbon neutrality has been promoted to a national and even global strategy in recent years, and energy conservation and emission reduction have important economic, environmental and social values ​​for enterprises. Therefore, under heavy test tasks, in order to achieve the goal of energy conservation and emission reduction, an energy-saving scheduling solution in a cloud test environment is urgently needed. Summary of the invention

[0004] The present disclosure provides a test environment energy-saving scheduling method, device and readable medium.

[0005] In a first aspect, an embodiment of the present disclosure provides a test environment energy-saving scheduling method, the method comprising:

[0006] Get blueprint information and test environment information;

[0007] Determine an energy-saving strategy according to the blueprint information, the test environment information, a first mapping relationship between a pre-configured blueprint and a test environment, and a second mapping relationship between an influencing factor and a judgment rule, wherein the energy-saving strategy is used to instruct the test environment to power on or off;

[0008] The energy saving strategy is executed.

[0009] In another aspect, the embodiment of the present disclosure further provides a test environment energy-saving scheduling device, comprising: a blueprint management module, a test environment management module, an energy-saving scheduling module and a power-saving execution module, wherein the blueprint management module stores a first mapping relationship between a pre-configured blueprint and a test environment, and is used to manage blueprint information; the test environment management module is used to manage test environment information; the energy-saving scheduling module stores a second mapping relationship between a pre-configured influencing factor and a judgment rule;

[0010] The energy-saving scheduling module is used to obtain blueprint information from the blueprint management module and to obtain test environment information from the test environment management module; determine an energy-saving strategy according to the blueprint information, the test environment information, a first mapping relationship between a pre-configured blueprint and the test environment, and a second mapping relationship between an influencing factor and a judgment rule, wherein the energy-saving strategy is used to instruct the test environment to power on or off;

[0011] The power saving execution module is used to execute the energy saving strategy.

[0012] On the other hand, an embodiment of the present disclosure further provides a computer-readable medium having a computer program stored thereon, wherein when the program is executed, the test environment energy-saving scheduling method as described above is implemented.

[0013] The test environment energy-saving scheduling method provided by the embodiment of the present disclosure includes: obtaining blueprint information and test environment information; determining an energy-saving strategy according to the blueprint information, the test environment information, the first mapping relationship between the pre-configured blueprint and the test environment, and the second mapping relationship between the influencing factor and the judgment rule, and executing the energy-saving strategy, wherein the energy-saving strategy is used to instruct the test environment to power on or off. By customizing the mapping relationship between the blueprint and the test environment, and the mapping relationship between the influencing factor and the judgment rule, the energy-saving strategy is determined in combination with the blueprint information and the current test environment situation, and the monitoring, dynamic recovery and release of test resources, as well as the sharing of test environment resources, the utilization rate of the test environment is improved, and the impact of power on test scheduling under the test environment is reduced; while satisfying the test task, the embodiment of the present disclosure matches the test environment supply with the busyness of the test task, reduces the resource consumption caused by the redundant test environment supply, can quickly establish the test task and associate the test environment, so that the execution of the test task is more energy-saving, accurate, and convenient. BRIEF DESCRIPTION OF THE DRAWINGS

[0014] Figure 1 A schematic diagram of an energy-saving scheduling scenario for a test environment according to an embodiment of the present disclosure;

[0015] Figure 2 A schematic diagram of the software architecture of an embodiment of the present disclosure;

[0016] Figure 3 Schematic diagram of the energy-saving scheduling process of the test environment provided by the embodiment of the present disclosure Figure 1 ;

[0017] Figure 4 Schematic diagram of the energy-saving scheduling process of the test environment provided by the embodiment of the present disclosure Figure 2 ;

[0018] Figure 5 A schematic diagram of a process for determining an energy-saving strategy provided in an embodiment of the present disclosure;

[0019] Figure 6 Schematic diagram of the energy-saving scheduling process of the test environment provided by the embodiment of the present disclosure Figure 3 ;

[0020] Figure 7 Schematic diagram of the energy-saving scheduling process of the test environment provided by the embodiment of the present disclosure Figure 4 ;

[0021] Figure 8 A schematic diagram of a test environment energy-saving scheduling process for a specific example of the present disclosure;

[0022] Fig. 9 A schematic diagram of the structure of a test environment energy-saving scheduling device provided in an embodiment of the present disclosure. DETAILED DESCRIPTION

[0023] Example embodiments will be described more fully below with reference to the accompanying drawings, but the example embodiments may be embodied in different forms and should not be construed as limited to the embodiments set forth herein. On the contrary, the purpose of providing these embodiments is to make the present disclosure thorough and complete and to enable those skilled in the art to fully understand the scope of the present disclosure.

[0024] As used herein, the term "and / or" includes any and all combinations of one or more of the associated listed items.

[0025] The terms used herein are only used to describe specific embodiments and are not intended to limit the present disclosure. As used herein, the singular forms "a", "an" and "the" are also intended to include the plural forms, unless the context clearly indicates otherwise. It will also be understood that when the terms "comprising" and / or "made of" are used in this specification, the presence of the features, wholes, steps, operations, elements and / or components is specified, but the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or groups thereof is not excluded.

[0026] The embodiments described herein may be described with reference to plan views and / or cross-sectional views by means of idealized schematic diagrams of the present disclosure. Therefore, the example illustrations may be modified according to manufacturing techniques and / or tolerances. Therefore, the embodiments are not limited to the embodiments shown in the accompanying drawings, but include modifications of the configurations formed based on the manufacturing process. Therefore, the regions illustrated in the accompanying drawings have schematic properties, and the shapes of the regions shown in the figures illustrate the specific shapes of the regions of the elements, but are not intended to be limiting.

[0027] Unless otherwise defined, all terms (including technical and scientific terms) used herein have the same meaning as commonly understood by those of ordinary skill in the art. It will also be understood that terms such as those defined in commonly used dictionaries should be interpreted as having a meaning consistent with their meaning in the context of the relevant art and the present disclosure, and will not be interpreted as having an idealized or overly formal meaning unless explicitly defined as such herein.

[0028] The present disclosure provides a test environment energy-saving scheduling method, which can be applied to a network management test pipeline cloud environment energy-saving scheduling scenario. Figure 1 Schematic diagram of energy-saving scheduling scenario of the test environment of the embodiment of the present disclosure. Figure 1 As shown, the scenario includes a cloud server and a cloud test environment. The cloud server includes a test environment energy-saving scheduling device and n containers, and the cloud test environment includes n test environments. The test environment energy-saving scheduling method of the disclosed embodiment is applied to the test environment energy-saving scheduling device of the cloud server, based on the microservice framework and Docker technology. It performs test tasks by energy-saving scheduling of each test environment, thereby reducing resource consumption caused by redundant test environment supply. The disclosed embodiment supports the management of energy-saving strategies, test tasks, and test environment information through a Web browser or other UI interface, and realizes intelligent power on and off, scheduling, and allocation of the test environment through the scheduling dependency of the blueprint on the test environment and the intelligent judgment of the energy-saving strategy, so that the entire cloud test environment pool can achieve energy-saving effects while meeting the test task requirements.

[0029] The disclosed embodiment first makes the microservices corresponding to each module of the test environment energy-saving scheduling device into corresponding Docker images, and then deploys the images to the native cloud server. In addition, the implementation of the disclosed embodiment also uses some basic services on the cloud server, such as database, log, permission control, etc. After each container of the cloud server is started, the user can use the visual blueprint arrangement, cloud test environment management, intelligent power-on and power-off strategy management and other functions of the test environment energy-saving scheduling device through the Web-UI interface.

[0030] Figure 2 FIG. 1 is a schematic diagram of the software architecture of an embodiment of the present disclosure. Figure 2 As shown, the software architecture includes a front-end interface (Web-UI) and a back-end test environment energy-saving scheduling device module.

[0031] 1) User Interface

[0032] The Web-UI interface provides a way for users to interact with the backend and use the functions of various modules of the backend through buttons, forms and other components of the interface.

[0033] The main functional scope of the Web-UI interface is as follows:

[0034] Supports the maintenance of the energy-saving strategy of powering on and off the test environment on the front-end page corresponding to the energy-saving scheduling module of the test environment energy-saving scheduling device. Users can customize multiple factors that affect energy saving. These factors may come from the key information defined in the test environment management module and the blueprint management module, or they may be influencing conditions at a higher level of abstraction. Then, the judgment rules corresponding to these factors are set up. In this way, a set of energy-saving strategies for the test environment to automatically power off and save energy during the test environment scheduling process, and to power on to ensure the test business, can be established. According to the energy-saving strategy, it can be intelligently decided whether the test environment should be scheduled to be powered on or off.

[0035] It supports entering, modifying, viewing and deleting test environment information on the test environment front end, such as the test environment IP address, test environment group label, test environment type and other information. The test task information required in the subsequent test interaction with the test environment can be obtained from the Web-UI interface.

[0036] Supports adding, modifying, viewing and deleting blueprints in the front end of the blueprint management module, such as blueprint name, corresponding test environment group label, test case and other information. In the blueprint, configure the test environment IP address or test environment group label to bind the test environment required by the test business. When scheduling the blueprint, the applied test environment will be occupied and its status will be set to non-idle. At the same time, the trigger strategy of the blueprint can be set to manual trigger or timed trigger.

[0037] 2) Test environment energy-saving scheduling device

[0038] The test environment energy-saving scheduling device mainly includes the blueprint management module, the test environment management module, the power-saving execution module, the energy-saving scheduling module and the message notification module. It provides functions such as rapid scheduling of test tasks, unified management of cloud test environment resources, power-on and power-off operation execution of the test environment, test environment scheduling and energy-saving strategy creation, and user operation / test result / abnormal situation notification.

[0039] The test environment energy-saving scheduling method provided by the embodiment of the present disclosure is applied to the test environment energy-saving scheduling device, such as Figure 3 As shown, the test environment energy-saving scheduling method includes the following steps:

[0040] Step S11, obtaining blueprint information and test environment information.

[0041] The energy-saving scheduling module of the test environment energy-saving scheduling device obtains blueprint information from the blueprint management module, and obtains test environment information from the test environment management module. Among them, the blueprint information may include the current blueprint to be executed, the triggering strategy of the blueprint, etc., and the test environment information may include whether the test environment is managed and controlled, whether it is bound to the blueprint, etc.

[0042] Step S12, determining an energy-saving strategy based on blueprint information, test environment information, a first mapping relationship between a pre-configured blueprint and a test environment, and a second mapping relationship between an influencing factor and a judgment rule, wherein the energy-saving strategy is used to instruct the test environment to power on or off.

[0043] The energy-saving scheduling module of the test environment energy-saving scheduling device can determine the energy-saving strategy for scheduling the test environment based on the current blueprint information and test environment information, and in combination with the first mapping relationship and the second mapping relationship. The energy-saving strategy is used to control the test environment to perform power-on or power-off operations.

[0044] Impact factors refer to the factors that affect the power on and off of the test environment, which can be configured in the energy-saving scheduling module. Impact factors mainly come from key events or key elements in the test task scheduling process, such as release plans, policy execution time periods, blueprint trigger policies, business queuing events, and the number of test environment reservations. After the impact factor configuration is completed, it is also necessary to configure the judgment rules for each impact factor to generate the second mapping relationship.

[0045] Step S13, executing energy saving strategy.

[0046] The energy-saving scheduling module of the test environment energy-saving scheduling device instructs the power-saving execution module to execute the energy-saving strategy to control the power-on or power-off of the corresponding test environment.

[0047] The test environment energy-saving scheduling method provided by the embodiment of the present disclosure includes: obtaining blueprint information and test environment information; determining an energy-saving strategy according to the blueprint information, the test environment information, the first mapping relationship between the pre-configured blueprint and the test environment, and the second mapping relationship between the influencing factor and the judgment rule, and executing the energy-saving strategy, wherein the energy-saving strategy is used to instruct the test environment to power on or off. By customizing the mapping relationship between the blueprint and the test environment, and the mapping relationship between the influencing factor and the judgment rule, the energy-saving strategy is determined in combination with the blueprint information and the current test environment situation, and the monitoring, dynamic recovery and release of test resources, as well as the sharing of test environment resources, the utilization rate of the test environment is improved, and the impact of power on the test scheduling under the test environment is reduced; while satisfying the test task, the embodiment of the present disclosure matches the test environment supply with the busyness of the test task, reduces the resource consumption caused by powering on and off the test environment, can quickly establish the test task and associate the test environment, so that the execution of the test task is more energy-saving, accurate, and convenient.

[0048] In some embodiments, Figure 4 As shown, after executing the energy-saving strategy (i.e., step S13), the test environment energy-saving scheduling method may further include the following steps:

[0049] Step S14: storing execution information of the energy-saving strategy.

[0050] The execution information of the energy-saving strategy may include at least one of the following: blueprint scheduling information, test environment occupancy information, and test environment power-on and power-off operation information.

[0051] Each time the test environment scheduling is completed and its power on or off is controlled, the power on or off operation of this test environment is promptly stored in the database, which can be used as the historical energy-saving strategy execution information for subsequent test environment energy-saving scheduling, so as to conduct historical record analysis and serve as a reference for formulating subsequent energy-saving strategies to correct the energy-saving strategies.

[0052] It should be noted that an energy-saving strategy can be formulated based on the current blueprint information and test environment information, and an automatic energy-saving strategy can be further formulated in combination with historical energy-saving strategy execution information.

[0053] In some embodiments, the energy-saving strategy is determined based on the blueprint information, the test environment information, the first mapping relationship between the pre-configured blueprint and the test environment, and the second mapping relationship between the influencing factor and the judgment rule (i.e., step S12), including the following steps: determining the first influencing factor based on the blueprint information and the test environment information, determining the first judgment rule corresponding to the first influencing factor based on the second mapping relationship, and determining the first energy-saving strategy based on the first judgment rule and the first mapping relationship. In other words, the first influencing factor is extracted from the blueprint information and the test environment information, the second mapping relationship between the influencing factor and the judgment rule is queried based on each extracted first influencing factor, the corresponding first judgment rules are obtained, and the first energy-saving strategy is generated in combination with the first mapping relationship between the blueprint and the test environment and the obtained first judgment rules.

[0054] Regarding the solution of automatically implementing energy-saving strategies by combining current blueprint information and test environment information with historical energy-saving strategy execution information, in some embodiments, such as Figure 5 As shown, the energy saving strategy (i.e., step S12) is determined according to the blueprint information, the test environment information, the first mapping relationship between the pre-configured blueprint and the test environment, and the second mapping relationship between the influencing factor and the judgment rule, including the following steps:

[0055] Step S121, determining a first influencing factor according to the blueprint information and the test environment information, and determining a first judgment rule corresponding to the first influencing factor according to the second mapping relationship.

[0056] Step S122: Acquire historical energy-saving strategy execution information.

[0057] Step S123: determining a second influencing factor according to the historical energy-saving strategy execution information, and determining a second judgment rule corresponding to the second influencing factor according to the second mapping relationship.

[0058] The second influencing factor can be determined by parsing at least one of the blueprint scheduling information, the test environment occupancy information, and the power-on and power-off operation information of the test environment, and the second judgment rule corresponding to the second influencing factor can be further determined according to the second mapping relationship. For example, by analyzing the blueprint scheduling information of the manual execution strategy, the user's daily approximate blueprint startup time can be analyzed, so the energy-saving scheduling module can set the test environment corresponding to the blueprint to the power-off state most of the time, and only needs to power on the test environment before predicting that the user is about to use the test environment (that is, predicting that the user manually triggers the blueprint to schedule the test environment).

[0059] It should be noted that the second impact factor is a supplementary impact factor to the first impact factor.

[0060] Step S124: determining a second energy-saving strategy according to the first judgment rule, the second judgment rule and the first mapping relationship.

[0061] By summarizing the first judgment rule and the second judgment rule, and combining the first mapping relationship between the blueprint and the test environment, the second energy-saving strategy can be obtained. Since the second energy-saving strategy refers to the historical energy-saving strategy execution information, the formulated second energy-saving strategy is more accurate and humanized, so that the energy-saving scheduling result is more matched with the execution of the test task.

[0062] In some embodiments, the execution of the energy-saving strategy (i.e., step S13) includes the following steps: executing the energy-saving strategy at a scheduled time, or executing the energy-saving strategy after at least one test environment is scheduled and occupied. The execution time of the energy-saving strategy also supports setting. The energy-saving strategy can be defined as being executed each time the test environment is scheduled and occupied, or it can be defined as being executed at a scheduled time. The energy-saving strategy is mainly executed on weekdays. In theory, the test environment should be powered off to save energy during non-working hours (non-working days and after get off work on working days). Therefore, the energy-saving strategy can be executed regularly on weekdays.

[0063] In some embodiments, the test environment energy-saving scheduling method may further include the following steps: when the blueprint is triggered, the test environment is allocated to the blueprint; the test environment is powered on and self-checked, and when the self-check passes, the state of the test environment is set to an idle state for blueprint scheduling to occupy. It should be noted that the allocated test environment is an idle test environment. If the blueprint is triggered on a scheduled basis, the corresponding test environment can be powered on in advance. If the blueprint is triggered manually, enough idle test blueprints can be reserved. The blueprint can be arranged in the blueprint management module, and the trigger strategy of the blueprint can be set to manual triggering or timed triggering. In the timed triggering mode, the user needs to specify a timing expression. The blueprint binds the test environment by setting the IP address of the test environment or the test environment group label. When the blueprint is manually triggered or timed, the energy-saving scheduling module checks the idle state of the test environment. If there is an idle test environment, it is allocated to the application blueprint, otherwise the blueprint enters the environment waiting queue.

[0064] The energy-saving scheduling module triggers the blueprints separately by parsing the triggering strategies of the blueprints. If it is a blueprint with a manual trigger strategy, it waits for the user to start the blueprint; if it is a blueprint with a timed trigger strategy, the energy-saving scheduling module starts the blueprint at the specified time by parsing the timing expression configured in the blueprint. Specifically, the idle status of the test environment under the corresponding group can be retrieved from the test environment management module according to the test environment IP address or test environment group label configured in the blueprint. After applying for an idle test environment, the test case configuration is parsed, and the test task is distributed to the test environment to execute the test case and return the test result, thereby completing the test task and generating a scheduling record.

[0065] In some embodiments, the test environment self-check may include: detecting whether each test environment meets the test business requirements, setting the test environment that does not meet the test business requirements to an abnormal state, and issuing an alarm.

[0066] The test environment management module provides standardized health self-check capabilities at the hardware, platform, and network management service interface levels. Before each test environment is flipped to the idle state, the self-check capability will be called to determine whether the current test environment meets the test service requirements. Only if the self-check passes will the test environment be set to the idle state. An unhealthy test environment will be set to the abnormal state, and the abnormal results of this self-check will be recorded. Furthermore, an abnormal report can be sent to maintenance personnel through the message notification module to achieve intelligent operation and maintenance of the cloud test environment. After the control test environment performs the power-on operation, the health check of the test environment, that is, the self-check, can minimize the impact of the power-on and power-off of the test environment, the test environment occupancy, and other operations on the standard cloud test environment.

[0067] The purpose of powering off the test environment is to reduce unnecessary test environment supply and achieve energy conservation and emission reduction, while the purpose of powering on the test environment is to avoid problems such as blueprint queuing and increased blueprint scheduling time due to too low test environment supply, and increased power consumption caused by frequent powering on of the test environment. When the energy-saving scheduling module detects that the blueprint scheduling is blocked due to the supply of the test environment or that an idle test environment needs to be provided in advance for some blueprints, the energy-saving scheduling module will call the power-saving execution module to power on the test environment. After the test environment is powered on and passes the self-test, the state can be set to an idle state for blueprint scheduling to occupy. If the test environment self-test fails, the relevant abnormal information will be sent to the maintenance personnel through the message notification module. After the power-on and power-off operations of the test environment are completed, the energy-saving scheduling module obtains the execution results of the energy-saving scheduling strategy from the power-saving execution module and notifies the relevant personnel through the message notification module.

[0068] The blueprint and test environment can be bound through the test environment group tag or the test environment's IP address.

[0069] For the scheme of binding the blueprint and the test environment through the test environment group label, the first mapping relationship is the mapping relationship between the blueprint and the test environment group label, the test environment group label is the label of the environment group, and the environment group includes at least one test environment. Figure 6 As shown, the test environment energy-saving scheduling method may also include the following steps:

[0070] Step S21, when the triggering strategy of the blueprint is manual triggering and the environment group corresponding to the blueprint includes multiple test environments, determine the number of reserved test environments in the environment group.

[0071] In some embodiments, the number of reserved test environments in an environment grouping can be determined according to the number of test environments in the environment grouping, or the number of reserved test environments in an environment grouping can be determined according to the number of test tasks and the number of test environments in the environment grouping. Exemplarily, the number of reserved test environments in an environment grouping can be set to 10% of the number of test environments in the environment grouping, or, when the number of test tasks is greater than a preset threshold, that is, when the test tasks are busy, the number of reserved test environments in an environment grouping can be set to 20% of the number of test environments in the environment grouping.

[0072] Step S22: determining the number of reserved test environments according to the priority of each test environment in the environment group.

[0073] The priority parameter may be defined by the user. For example, a performance priority may be selected. In this case, the number of test environments with higher performance are reserved within the environment group as reserved test environments.

[0074] Step S23: Power on the number of reserved test environments, and set the states of the number of reserved test environments to an idle state.

[0075] Generally speaking, the test environment can be powered off when it is idle, but due to the existence of the blueprint manual triggering strategy, there may be a situation where there is no available test environment when the blueprint applies for the test environment again after the test environment is powered on, and the test environment needs to be powered on again. Since the power consumption during the power-on process of the test environment is greater than that in the idle state, it is necessary to avoid frequent power-on and power-off operations of the test environment. To achieve this goal, the environment grouping needs to reserve some idle test environments. The fewer the number of idle reserved test environments, the more obvious the energy saving effect, but if the reserved number is too low, the frequent blueprint startup will cause the test environment to be powered on frequently, which will increase power consumption. The number of reserved test environments can be dynamically calculated by an algorithm based on the size of the environment grouping or the busyness of the task, or it can be manually set by the administrator, and can also be adjusted according to the actual test verification results.

[0076] For the scheme in which the blueprint and the test environment are bound through the IP address of the test environment, the first mapping relationship is the mapping relationship between the blueprint and the address of the test environment. Figure 7 As shown, the test environment energy-saving scheduling method may also include the following steps:

[0077] Step S31, when the trigger strategy of the blueprint is a timed trigger, the power-on time is determined according to the trigger time of the blueprint and the power-on duration of the test environment.

[0078] For the timed triggered blueprint, the test environment management module of the test environment energy-saving scheduling device can obtain the trigger time of the blueprint by parsing the timing expression. The power-on duration of the test environment is known and fixed. The power-on time is the power-on time of the test environment that the triggering blueprint is about to schedule and occupy, and the power-on time is earlier than the trigger time of the blueprint.

[0079] Step S32, when the power-on time arrives, determine the target test environment corresponding to the blueprint according to the first mapping relationship.

[0080] The target test environment is the test environment that the timed-triggered blueprint will schedule to occupy.

[0081] Step S33, power on the target test environment, and set the state of the target test environment to an idle state.

[0082] By reserving enough power-on time for the test environment before the trigger time of the blueprint and powering on the target test environment in advance before that, accurate power-on of the test environment can be achieved.

[0083] In some embodiments, after the target test environment is powered on (i.e., step S33), the test environment energy-saving scheduling method may further include the following steps:

[0084] Step S34, after the blueprint completes scheduling and occupying the target test environment, the target test environment is powered on, or, when the interval time to the next trigger time of the blueprint is greater than a preset threshold, the target test environment is powered on.

[0085] After the blueprint execution is completed, the target test environment can be powered off directly, or it can be powered off if the time left for the next scheduled blueprint scheduling to occupy the target test environment is long. If the time left for the next scheduled blueprint scheduling to occupy the target test environment is short, the target environment can be left powered on to avoid frequent power on and off of the test environment to increase power consumption.

[0086] The disclosed embodiment determines the energy-saving strategy by customizing the influencing factors and their judgment rules. While meeting the test requirements, the cloud test environment supply is matched with the test busyness. The monitoring, dynamic recovery and release of cloud test resources are strengthened, the cost of resource consumption and system development is reduced, and the product competitiveness is improved. By analyzing the energy-saving strategy execution information, supplementary influencing factors and their judgment rules are obtained, which can assist in generating more accurate and humanized energy-saving strategies, so that the energy-saving scheduling results and test task execution are more matched. For the blueprint trigger strategy for scheduled execution, the corresponding test environment can be launched before the test scheduling process begins, and the key status of the test environment can be monitored in real time during the test process, and the relevant person in charge can be notified in time for quick response. The blueprint associates the cloud test environment through IP address or label, dynamically allocates the test environment that is not powered off for test execution, realizes the sharing of test environment resources, reduces the impact of power off in the test environment on test scheduling, and improves the utilization rate of the test environment.

[0087] In order to clearly illustrate the technical solution of the embodiment of the present disclosure, the following Figure 8 , the energy-saving scheduling process of the test environment is described in detail through a specific example 1.

[0088] Test environment IP1 is entered in the environment management module, and the test environment group label is set to "Test environment group label 1". There are five test environments, IP2, IP3, IP4, and IP5, that have been entered with "Test environment group label 1" as the test environment group label. The label for test environment IP6 is set to "Test environment group label - No binding"; the label for test environment IP7 is set to "Test environment group label - Not included in management and control"; the label for test environment IP8 is set to "Test environment group label - No release plan".

[0089] In the test blueprint management module, users have arranged blueprints. Figure 1-8 There are 8 blueprints in total. Figure 1-6 The test environment bound to "Test Environment Group Label 1" is blue Figure 1-2 The trigger strategy is manual trigger, blue Figure 3-6 The trigger strategy is timed trigger; blue Figure 7 Test environments marked with "Test environment group tag - not included in control"; blue Figure 8 Tag the test environment using the "Test environment group tag - No release plan".

[0090] The implementation time of the energy-saving strategy is pre-set. The administrator can set the time period for the implementation of the energy-saving strategy in the energy-saving scheduling module. For example, the energy-saving strategy is implemented during the working time period on weekdays by default, that is, the energy-saving strategy is executed regularly at 9 am on weekdays.

[0091] The energy-saving scheduling module extracts key business elements and sets influencing factors. The second mapping relationship between the pre-configured influencing factors and the judgment rules is shown in Table 1:

[0092] Table 1

[0093] Serial number Impact Factor Judgment rules 1 Is there any plan to release a version in the near future? No version plan to power off 2 Is it bound to a blueprint? No binding power off 3 Blueprint trigger strategy Manual reservation, timed preparation 4 Is the test environment controlled? No control skip 5 Idle test environment reserved ratio Reserve 20% idle test environment 6 Energy saving strategy implementation time Implement energy-saving strategies from 9:00 to 17:00 on weekdays 7 Priority for applying for an idle test environment Random / Performance First

[0094] Energy-saving scheduling module scans blue Figure 1-8 , and test environment IP1-IP8, you can get the blueprint version, trigger strategy and other blueprint information, as well as whether the test environment is managed, whether the idle test environment is bound to the blueprint and other test environment information. Determine the influencing factor based on the above information, and then get the judgment rule corresponding to the influencing factor based on Table 1. Combined with Figure 8 As shown in the figure, it is determined whether the blueprint version has a release plan, whether the test environment is bound to the blueprint, and whether the test environment is controlled. If the blueprint version has no release plan at the current time, the corresponding test environment is directly powered off. For example, IP8 is blueprinted. Figure 8 If the IP8 is not bound and there is no recent release plan, it will be powered off. Figure 7 If the IP7 marked with "Test environment group tag - not included in the control" is marked in the blue Figure 7 and the scan of test environment 7; if IP6 is not bound to any blueprint, it is directly powered off, so it can be determined that IP6 and IP8 are directly powered off.

[0095] like Figure 8As shown, the triggering strategy of the blueprint is determined. The 5 test environments (IP1-IP5) in the environment group corresponding to "Test environment group label 1" are bound by 2 manual blueprints and 4 timing blueprints. For manually triggered blueprints, reserve idle test environments. Specifically, the environment group corresponding to "Test environment group label 1" is bound by 2 manually triggered blueprints, and 5*20%=1 test environment can be reserved. According to performance priority, in the environment group corresponding to "Test environment group label 1", the test environment IP1 with the best performance is reserved from IP1-IP5 (IP1 is blue Figure 1 and 2 Binding), the remaining 4 test environments IP2-IP5 are bound by 4 timing blue Figure 3-6 Binding. For the timed trigger blueprint, the power-on time of the corresponding test environment is determined by parsing the timed expression. Figure 3-6 It will be triggered and executed at 10:00 am every day. Assuming that the power-on time of the test environment is 10 minutes, the four test environments IP2-IP5 in "Test Environment Group Label 1" can be powered on at 9:40 am every day. Figure 3-6 After the execution is completed, you can directly power off the four test environments IP2-IP5.

[0096] In this way, the following energy-saving strategy can be obtained: test environments IP6 and IP8 are powered off at all times; IP7 is not judged for energy saving and is occupied by blueprint scheduling only according to the normal status; at least one idle test environment is retained in IP1-IP5 (that is, at least one of the test environments is powered on), and when selecting to retain the test environment, the test environment with the best performance is retained first according to the priority setting; the other four test environments in IP1-IP5 are powered on at 9:40 every day.

[0097] In specific example 2, an energy-saving strategy is specified based on historical energy-saving strategy execution information. Based on specific example 1, the energy-saving strategy can be supplemented by parsing the energy-saving strategy execution information, such as supplementing the influencing factors and their judgment rules. For example, the supplemented influencing factors and their judgment rules are shown in Table 2:

[0098] Table 2

[0099] Serial number Impact Factor Judgment rules 1 Blueprint past manual start time Predict startup time and prepare the environment 2 Test environment occupancy definition Environmental inspection to manual login means occupation

[0100] When reserving an environment for manually triggered blueprints, you can add some analysis of energy-saving strategy execution information. For example, if a blueprint is a manually triggered strategy blueprint, but users habitually start the blueprint at 7-8 a.m. every day when they get to work. After the blueprint is executed once in the morning, users habitually trigger the blueprint again around 2 p.m. By analyzing historical trigger data, the power-on strategy of the test environment associated with the blueprint can be set to power on the test environment 10 minutes before the user-intensive triggering time period on each working day, and the test environment can be powered off during other non-execution time.

[0101] In addition, you can also define whether the test environment is in a busy state. Generally, the test environment is considered to be occupied when it is occupied by the blueprint scheduling, but the test environment may also be logged in manually for some operation and maintenance operations. In this case, you can add a check script to detect whether the test environment can be considered idle and powered off. In this way, by analyzing the records of each idle state check, you can analyze user habits to obtain some regular operations, and finally assist in correction to obtain the best energy-saving strategy.

[0102] The present disclosure also provides a test environment energy-saving scheduling device, such as Fig. 9 As shown, the test environment energy-saving scheduling device includes: a blueprint management module 101, a test environment management module 102, an energy-saving scheduling module 103 and a power-saving execution module 104. The blueprint management module 101 stores a first mapping relationship between a pre-configured blueprint and a test environment, and is used to manage blueprint information; the test environment management module 102 is used to manage test environment information; the energy-saving scheduling module 103 stores a second mapping relationship between a pre-configured influencing factor and a judgment rule.

[0103] The energy-saving scheduling module 103 is used to obtain blueprint information from the blueprint management module 101 and to obtain test environment information from the test environment management module 102; and to determine an energy-saving strategy based on the blueprint information, the test environment information, a first mapping relationship between a pre-configured blueprint and the test environment, and a second mapping relationship between an influencing factor and a judgment rule, wherein the energy-saving strategy is used to instruct the test environment to power on or off.

[0104] The power saving execution module 104 is used to execute the energy saving strategy.

[0105] The embodiments of the present disclosure further provide a computer-readable medium on which a computer program is stored, wherein when the computer program is executed, the energy-saving scheduling method for the test environment provided in the aforementioned embodiments is implemented.

[0106] It will be appreciated by those skilled in the art that all or some of the steps in the method disclosed above, the functional modules / units in the device may be implemented as software, firmware, hardware, and appropriate combinations thereof. In hardware implementations, the division between the functional modules / units mentioned in the above description does not necessarily correspond to the division of physical components; for example, a physical component may have multiple functions, or a function or step may be performed by several physical components in cooperation. Some physical components or all physical components may be implemented as software executed by a processor, such as a central processing unit, a digital signal processor, or a microprocessor, or implemented as hardware, or implemented as an integrated circuit, such as an application-specific integrated circuit. Such software may be distributed on a computer-readable medium, which may include a computer storage medium (or non-transitory medium) and a communication medium (or temporary medium). As known to those skilled in the art, the term computer storage medium includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information (such as computer-readable instructions, data structures, program modules, or other data). Computer storage media include, but are not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, digital versatile disks (DVD) or other optical disk storage, magnetic cassettes, magnetic tapes, magnetic disk storage or other magnetic storage devices, or any other medium that can be used to store the desired information and can be accessed by a computer. In addition, it is well known to those of ordinary skill in the art that communication media typically contain computer-readable instructions, data structures, program modules, or other data in a modulated data signal such as a carrier wave or other transport mechanism, and may include any information delivery media.

[0107] Example embodiments have been disclosed herein, and although specific terms are employed, they are used and should be interpreted only in a general illustrative sense and not for limiting purposes. In some instances, it will be apparent to those skilled in the art that, unless otherwise expressly stated, features, characteristics, and / or elements described in conjunction with a particular embodiment may be used alone or in combination with features, characteristics, and / or elements described in conjunction with other embodiments. Therefore, it will be understood by those skilled in the art that various changes in form and detail may be made without departing from the scope of the invention as set forth in the appended claims.

Claims

1. A test environment energy-saving scheduling method, characterized in that: The method comprises: Get blueprint information and test environment information; Determine an energy-saving strategy according to the blueprint information, the test environment information, a first mapping relationship between a pre-configured blueprint and a test environment, and a second mapping relationship between an influencing factor and a judgment rule, wherein the energy-saving strategy is used to instruct the test environment to power on or off; The energy saving strategy is executed.

2. The method according to claim 1, characterized in that After executing the energy-saving strategy, the method further includes: storing execution information of the energy-saving strategy.

3. The method according to claim 1, characterized in that The determining of the energy saving strategy according to the blueprint information, the test environment information, a first mapping relationship between a pre-configured blueprint and a test environment, and a second mapping relationship between an influencing factor and a judgment rule includes: A first influencing factor is determined according to the blueprint information and the test environment information, a first judgment rule corresponding to the first influencing factor is determined according to the second mapping relationship, and a first energy-saving strategy is determined according to the first judgment rule and the first mapping relationship.

4. The method according to claim 1, characterized in that The determining of the energy saving strategy according to the blueprint information, the test environment information, a first mapping relationship between a pre-configured blueprint and a test environment, and a second mapping relationship between an influencing factor and a judgment rule includes: Determine a first influencing factor according to the blueprint information and the test environment information, and determine a first judgment rule corresponding to the first influencing factor according to the second mapping relationship; Obtain historical energy-saving strategy execution information; Determine a second influencing factor according to the historical energy-saving strategy execution information, and determine a second judgment rule corresponding to the second influencing factor according to the second mapping relationship; A second energy-saving strategy is determined according to the first judgment rule, the second judgment rule and the first mapping relationship.

5. The method according to claim 1, characterized in that The energy-saving strategy is used to indicate power-off in a test environment. After executing the energy-saving strategy, the method further includes: Check whether each test environment meets the test business requirements; The test environment that does not meet the test business requirements is set to an abnormal state and an alarm is issued.

6. The method according to claim 1, characterized in that The executing the energy-saving strategy includes: The energy-saving strategy is executed regularly, or after at least one test environment is scheduled to be occupied.

7. The method according to claim 1, characterized in that The method further comprises: When a blueprint is triggered, a test environment is allocated to the blueprint; The test environment is powered on and self-checked. If the self-check passes, the state of the test environment is set to an idle state for occupation by the blueprint scheduling.

8. The method according to claim 1, characterized in that The first mapping relationship is a mapping relationship between a blueprint and a test environment group label, and the test environment group label is a label of an environment group including at least one test environment; the method further includes: When the triggering strategy of the blueprint is manual triggering and the environment group corresponding to the blueprint includes multiple test environments, determining the number of reserved test environments in the environment group; Determining the number of reserved test environments according to the priority of each of the test environments in the environment group; The number of reserved test environments are powered on, and the states of the number of reserved test environments are set to idle states.

9. The method according to claim 1, characterized in that The first mapping relationship is a mapping relationship between a blueprint and an address of a test environment; the method further includes: When the trigger strategy of the blueprint is timed triggering, the power-on time is determined according to the trigger time of the blueprint and the power-on duration of the test environment; When the power-on time arrives, determining a target test environment corresponding to the blueprint according to the first mapping relationship; The target test environment is powered on, and the state of the target test environment is set to an idle state.

10. The method according to claim 9, characterized in that After the target test environment is powered on, the method further includes: After the blueprint completes scheduling and occupying the target test environment, the target test environment is powered on, or, when the interval time to the next trigger time of the blueprint is greater than a preset threshold, the target test environment is powered on.

11. A test environment energy-saving scheduling device, characterized in that: include: A blueprint management module, a test environment management module, an energy-saving scheduling module and a power-saving execution module, wherein the blueprint management module stores a first mapping relationship between a pre-configured blueprint and a test environment, and is used to manage blueprint information; the test environment management module is used to manage test environment information; the energy-saving scheduling module stores a second mapping relationship between a pre-configured influencing factor and a judgment rule; The energy-saving scheduling module is used to obtain blueprint information from the blueprint management module and to obtain test environment information from the test environment management module; determine an energy-saving strategy according to the blueprint information, the test environment information, a first mapping relationship between a pre-configured blueprint and the test environment, and a second mapping relationship between an influencing factor and a judgment rule, wherein the energy-saving strategy is used to instruct the test environment to power on or off; The power saving execution module is used to execute the energy saving strategy.

12. A computer readable medium having a computer program stored thereon, wherein: When the program is executed, the test environment energy-saving scheduling method as described in any one of claims 1 to 10 is implemented.