Component testing method and device under multiple clusters, computer equipment, readable storage medium and program product
By configuring the target controller in a multi-cluster environment for component testing, the problem of low efficiency in existing technologies is solved, and high efficiency, flexibility and comprehensiveness of component testing are achieved.
Patent Information
- Application Number
- CN202410578922.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-10
- Publication Date
- 2025-11-11
AI Technical Summary
Existing technologies are inefficient for component testing in multi-cluster environments, requiring significant manpower and time, and cannot effectively support distributed component testing.
By obtaining the component identifier, we can determine the multiple target clusters to which it belongs, and perform component testing on the target controller configured in each cluster. The test results are then aggregated to reduce manual intervention.
It improves the efficiency of component testing, reduces the waste of manpower and time, and realizes the flexibility and comprehensiveness of component testing.
Smart Images

Figure CN120929342A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of testing technology, and in particular to a component testing method, apparatus, computer equipment, readable storage medium, and program product in a multi-cluster environment. Background Technology
[0002] With the continuous development of artificial intelligence technology, various system components have been developed and deployed in various clusters. In order to ensure that the components can meet the requirements of the cluster system, it is essential to test the components.
[0003] Since the same component can be deployed in different clusters, current testing methods often involve manually initiating test processes for that component in each cluster. However, this approach is time-consuming and labor-intensive, resulting in low efficiency for component testing. Summary of the Invention
[0004] Therefore, it is necessary to provide a method, apparatus, computer equipment, computer-readable storage medium, and computer program product for multi-cluster component testing that can improve the efficiency of component testing in multi-cluster environments, in order to address the aforementioned technical problems.
[0005] In a first aspect, this application provides a component testing method under multiple clusters, including: in response to a test instruction for a target component, obtaining the component identifier of the target component; based on the component identifier, determining multiple target clusters to which the target component belongs; for each target cluster, performing component testing on the target component through a target controller configured in the target cluster, and obtaining the component test results of the target component in the target cluster; and summarizing the component test results to obtain the target test results corresponding to the test instruction.
[0006] Secondly, this application also provides a component testing apparatus under multiple clusters, comprising: an identifier acquisition module, used to acquire the component identifier of the target component in response to a test command for the target component; a cluster determination module, used to determine multiple target clusters to which the target component belongs based on the component identifier; a test module, used to perform component testing on the target component for each target cluster through a target controller configured in the target cluster, and obtain the component test result of the target component in the target cluster; and a result acquisition module, used to summarize the test results of each component to obtain the target test result corresponding to the test command.
[0007] Thirdly, this application also provides a computer device, including a memory and a processor. The memory stores a computer program, and the processor executes the computer program to perform the following steps: in response to a test instruction for a target component, obtaining a component identifier of the target component; based on the component identifier, determining multiple target clusters to which the target component belongs; for each target cluster, performing component testing on the target component through a target controller configured in the target cluster, and obtaining the component test result of the target component in the target cluster; and summarizing the component test results to obtain the target test result corresponding to the test instruction.
[0008] Fourthly, this application also provides a computer-readable storage medium storing a computer program thereon, which, when executed by a processor, performs the following steps: in response to a test instruction for a target component, obtaining a component identifier of the target component; based on the component identifier, determining multiple target clusters to which the target component belongs; for each target cluster, performing component testing on the target component through a target controller configured in the target cluster, and obtaining the component test result of the target component in the target cluster; and summarizing the component test results to obtain the target test result corresponding to the test instruction.
[0009] Fifthly, this application also provides a computer program product, including a computer program that, when executed by a processor, performs the following steps: in response to a test instruction for a target component, obtains a component identifier of the target component; based on the component identifier, determines multiple target clusters to which the target component belongs; for each target cluster, performs component testing on the target component through a target controller configured in the target cluster, and obtains the component test result of the target component in the target cluster; and summarizes the component test results to obtain the target test result corresponding to the test instruction.
[0010] The aforementioned component testing method, apparatus, computer equipment, computer-readable storage medium, and computer program product under multi-cluster conditions. Upon receiving a test instruction for a target component, the system first obtains the component identifier of the target component and matches it to multiple target clusters. Then, for each target cluster, a pre-configured target controller is activated, and the target component is tested through this controller, yielding the component test results within that cluster. Finally, the component test results for each target cluster are aggregated to obtain the target test result for that component. Thus, by directly activating the target controller in each target cluster to perform component testing, manual initiation of test processes for the target component in each cluster is eliminated, reducing wasted manpower and time, thereby improving the efficiency of component testing under multi-cluster conditions. Attached Figure Description
[0011] To more clearly illustrate the technical solutions in the embodiments of this application or related technologies, the drawings used in the description of the embodiments of this application or related technologies will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0012] Figure 1 This is an application environment diagram of a component testing method under a multi-cluster environment in one embodiment;
[0013] Figure 2 This is a flowchart illustrating a component testing method under a multi-cluster environment in one embodiment;
[0014] Figure 3 This is a schematic diagram of the resource allocation process in one embodiment;
[0015] Figure 4 This is a schematic diagram of the resource allocation process in another embodiment;
[0016] Figure 5 This is a flowchart illustrating the process of testing rule matching in one embodiment;
[0017] Figure 6 This is a flowchart illustrating the component analysis process in one embodiment;
[0018] Figure 7 This is a diagram illustrating the specific application environment of a component testing method under a multi-cluster environment in one embodiment.
[0019] Figure 8 This is a structural block diagram of a component testing device under a multi-cluster configuration in one embodiment;
[0020] Figure 9 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation
[0021] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0022] With the continuous development of artificial intelligence technology, various system components have been developed, such as training components and scheduling components, and deployed in various clusters. A cluster is a high-performance computing system that connects multiple computers in a local area network or the Internet, achieving resource sharing and task allocation through software and hardware to jointly complete a task. Clusters are mainly used in fields such as large-scale data processing, scientific computing, and digital media processing, providing higher computing efficiency and larger data storage capacity. For example, Kubernetes clusters are also known as k8s clusters, and YARN (Yet Another Resource Negotiator) clusters.
[0023] To evaluate whether a component's performance and functionality meet the requirements of a cluster system, such as task latency, task success rate, task failure rate, and maximum requests per second, component testing is essential. Since the same component can be deployed in different clusters, current testing often requires manual intervention to initiate test processes for that component simultaneously in each cluster. This approach does not adequately support distributed component testing and is extremely time-consuming and labor-intensive, resulting in low testing efficiency for components across multiple clusters.
[0024] The component testing method under multi-cluster conditions provided in this application embodiment can be applied to, for example... Figure 1 In the application environment shown, the test system 102 is connected to the target controller 104, which is the controller corresponding to the target cluster 106. The target controller 104 performs component testing on the target component within the target cluster 104. Specifically, in response to a test command for the target component, the test system 102 first obtains the component identifier of the target component, and then determines the target cluster 106 to which the target component belongs based on the component identifier. There can be multiple target clusters. The test system 102 sends a test command to the target controller 104 in each target cluster 106 to instruct the target controller 104 to perform component testing on the target component and obtain the component test results of the target component in the target cluster 106. Each target controller 104 sends its obtained component test results to the test system 102. The test system 102 summarizes the component test results to obtain the target test result corresponding to the test command.
[0025] In one example, for each target cluster, the target controller and the target component in the target cluster can communicate through the cluster component connector. The cluster component connector does not belong to any particular cluster. In addition to controlling the communication between the target controller and the target component, the cluster component connector can also define test result acquisition metrics and component analysis metrics for different components in different clusters.
[0026] The test system 102 can be an independent physical server, a server cluster or distributed system consisting of multiple physical servers, or a cloud server that provides cloud computing services.
[0027] In one exemplary embodiment, such as Figure 2 As shown, a component testing method under a multi-cluster environment is provided, which is then applied to... Figure 1 Taking test system 102 as an example, the following steps are included:
[0028] Step S202: In response to the test command for the target component, obtain the component identifier of the target component.
[0029] The target component can refer to the component that needs to be tested. The component identifier can be a unique identifier used to identify the component, including but not limited to the component name, component identifier, component number, etc. The component identifier can be composed of numbers, letters or symbols.
[0030] For example, when the testing system receives a test instruction from a terminal device for a target component, it first identifies the target component to obtain its unique identifier. The terminal device refers to the terminal connected to the testing system, which may include, but is not limited to, various desktop computers, laptops, smartphones, tablets, and IoT devices.
[0031] Step S204: Based on the component identifier, determine the multiple target clusters to which the target component belongs.
[0032] The target cluster can refer to a cluster configured with the target component.
[0033] For example, after identifying the component identifier of the target component, the testing system can further query the multiple target clusters to which the target component belongs based on the correspondence between the component identifier and the clusters. One component identifier can correspond to multiple clusters, and the clusters that correspond to the component identifier are taken as the target clusters to which the target component belongs.
[0034] Step S206: For each target cluster, perform component testing on the target components through the target controller configured in the target cluster, and obtain the component test results of the target components in the target cluster.
[0035] The target controller can refer to a pre-configured test controller for the target cluster, used to test components within the target cluster. The target controller can also allocate resources and match test rules for the target components. Compared to the current method of manually initiating test processes for target components across multiple clusters, this embodiment configures a controller in each cluster. When the test system receives a test instruction for a component, it can directly activate the controllers of each cluster to which the component belongs, allowing the controllers to perform the tests. This supports distributed component testing and significantly improves the efficiency of component testing.
[0036] For example, after the testing system queries and obtains multiple target clusters to which the target component belongs, it can start the pre-configured target controller for each target cluster and send test requests for the target component to these target controllers, instructing them to test the target component. Upon receiving the test request, each target controller can then perform the test on the target component and obtain the component test results within the target cluster.
[0037] In practical applications, the notification mechanisms for component test status differ for different clusters. The target controller can also adapt the notification mechanism to the target cluster based on its characteristics. For example, for a Kubernetes cluster, the target controller can use the Informer mechanism to synchronize component test status. The Informer mechanism is used to monitor and respond to resource events, making component testing under multiple clusters more comprehensive.
[0038] It should be noted that the test instructions can also include test requirements, which can record multiple target clusters that need to be tested on the target component. That is, the test system can directly obtain multiple target clusters that need to be tested on the target component from the test instructions, and then directly start the target controllers corresponding to these target clusters. This makes the component testing more in line with the test requirements, improves the accuracy and reliability of component testing under multiple clusters, and further improves the efficiency of component testing.
[0039] Step S208: Summarize the test results of each component to obtain the target test result corresponding to the test instruction.
[0040] The target test result refers to the test result obtained by summarizing the component test results of the target component under each target cluster.
[0041] For example, to ensure the accuracy and completeness of the test results, it is necessary to aggregate the component test results. That is, each target controller returns its obtained component test results to the testing system, which then aggregates these results to obtain the final target test result. This target test result represents the test results of the target component across multiple clusters.
[0042] In this embodiment, when the testing system receives a test instruction for a target component, it first obtains the component identifier of the target component. Based on the component identifier, it matches the target component to multiple target clusters. Then, for each target cluster, a pre-configured target controller is activated, and the target component is tested through this target controller, obtaining the component test results for the target component within the target cluster. Finally, the component test results for the target component in each target cluster are summarized to obtain the target test result for the target component. Thus, by directly activating the target controller in each target cluster to perform component testing, there is no need for manual initiation of test processes for the target component in each target cluster, reducing the waste of manpower and time, thereby improving the efficiency of component testing across multiple clusters.
[0043] In one exemplary embodiment, such as Figure 3 As shown, for each target cluster, component testing is performed on the target components through the target controller configured in the target cluster, and the component test results of the target components in the target cluster are obtained, including:
[0044] Step S302: For each target cluster, obtain the test tasks of the target components in the target cluster.
[0045] Among them, a test task can refer to a test task when the target component is tested in the target cluster. It can be understood that there is at least one test task for the target component in the target cluster, and each test task can exist in the target controller as an abstract state of the test object.
[0046] For example, when testing a scheduling component, there can be at least one scheduling task in each target cluster. The scheduling component is tested by executing these scheduling tasks.
[0047] For example, the target controller can pre-configure the test settings for different components in each cluster, including but not limited to test tasks and task information, such as the number of test tasks, test start time, test task template, and test task priority. After the test system starts the target controller, the target controller can obtain at least one test task for the target component in the target cluster by reading the test configuration of the target component in the target cluster.
[0048] Step S304: Allocate resources to the test task through the target controller configured in the target cluster to obtain the test resource information of the test task.
[0049] Resource allocation refers to the process of allocating test resources for a test task. Test resources include, but are not limited to, CPU (Central Processing Unit) resources, memory resources, GPU (Graphics Processing Unit) resources, network resources, and disk resources. Test resource information refers to the resource information required when a test task is executed, which may also include, but is not limited to, CPU resource information, memory resource information, GPU resource information, network resource information, and disk resource information.
[0050] For example, after obtaining the test tasks of the target component in the target cluster, the target controller can further allocate resources to each test task based on the task information, such as the number of test tasks, test start time, test task template, test task priority, etc. That is, allocate the required CPU resources, memory resources, GPU resources, network resources, disk resources, etc. to each test task, thereby obtaining the test resource information of each test task, so as to execute the test task based on the test resource information in the future.
[0051] Step S306: Based on the test resource information, perform component testing on the target component to obtain the component test results of the target component in the target cluster.
[0052] It should be noted that current component testing technologies often rely on specific tools. For example, when evaluating a component's maximum requests per second, a JMeter stress testing platform is used; when analyzing task latency, Prometheus is used to collect task data and perform testing. This approach, which relies on specific tools for specific tasks, limits component testing. Therefore, this embodiment utilizes a cluster controller to allocate resources and match corresponding test rules for each test task. Based on the allocated test resources and rules, the test task is executed, completing the component testing of the target component. This eliminates the need to rely on specific tools, overcoming the limitations of current component testing techniques and improving the flexibility and comprehensiveness of component testing across multiple clusters.
[0053] For example, after obtaining the test resource information for each test task, the target controller can execute the test task based on the test resource information, and then use the execution result of the test task as the component test result of the target component in the target cluster.
[0054] In this embodiment, resource allocation is performed on the test tasks of the target component in the target cluster, and the test tasks are executed according to the allocated test resource information, thereby completing the component testing of the target component and obtaining the component test results. This improves the accuracy of component test results in multi-cluster environments.
[0055] In one exemplary embodiment, such as Figure 4 As shown, resource allocation is performed on the test task to obtain the test resource information for the test task, including:
[0056] Step S402: Obtain the parameter configuration tags of the cluster server corresponding to the target cluster.
[0057] Here, "cluster server" refers to the server where the target cluster resides. Parameter configuration tags can refer to the configuration tags of server parameters within the cluster server, used to indicate the configuration level of server parameters. Server parameters include, but are not limited to, memory, network, disk, and I / O (Input / Output). Parameter configuration tags can include, but are not limited to, high memory, low memory, high-speed disk, low-speed disk, high-speed I / O, normal I / O, high network speed, low network speed, etc.
[0058] For example, the target controller can pre-configure the parameters of the cluster servers of the target cluster to set corresponding parameter configuration tags to characterize the configuration level of the server parameters. When performing component testing, the target controller can obtain these parameter configuration tags and allocate resources for the test tasks of the target components in the target cluster according to the parameter configuration tags.
[0059] Step S404: Based on the parameter configuration tags, assign test resource information that matches the parameter configuration tags to the test tasks.
[0060] It should be noted that there is a correspondence between the parameter configuration label and the test resource information. For example, if the parameter configuration label is set to high memory, more memory resources can be allocated to the test task. As for the specific degree of resource allocation, it can be set according to the actual situation and there are no restrictions here.
[0061] For example, after the target controller obtains the parameter configuration label of the cluster server, it performs test resource matching based on the correspondence between the parameter configuration label and the test resource information to obtain the test resource information that matches the parameter configuration label.
[0062] In this embodiment, test resources are allocated to the test task based on the parameter configuration tags used to characterize the parameter configuration level in the cluster server where the target cluster is located. This improves the accuracy of test resource allocation, effectively avoids system crashes caused by unreasonable resource allocation, and makes component testing under the entire multi-cluster environment more stable.
[0063] In one exemplary embodiment, such as Figure 5 As shown, after the step of obtaining the test resource information for the test task, the following steps are also included:
[0064] Step S502: Obtain the component type of the target component.
[0065] Step S504: Based on the component type, determine the test rules that match the component type.
[0066] Here, "component type" can refer to the type of the target component, such as a scheduling component, training component, or service component. "Test rules" refer to the test methods for test tasks of the target component under the target cluster. It's understandable that different types of components will require different test methods.
[0067] For example, after obtaining the test resource information of the test task, the target controller can further obtain the component type of the target component, and then perform test rule matching according to the component type, that is, match the target component with the test rule that matches its type, and then execute the test task according to the test rule to complete the test of the target component under the target cluster.
[0068] For example, for a service component, the corresponding test rule could be a stress test on a certain service. For a scheduling component, the corresponding test rule could be a simulation method for different types of tasks, such as CPU-intensive tasks and disk-intensive tasks. CPU-intensive tasks refer to tasks that mainly rely on CPU processing power during execution, while disk-intensive tasks refer to tasks that mainly rely on disk processing power during execution.
[0069] In one embodiment, the component testing of the target component based on the test resource information further includes: performing component testing on the target component according to the test resource information and test rules.
[0070] For example, after the target controller obtains the test rules corresponding to the target component, it can execute each test task according to the test rules and the test resource information of each test task of the target component in the target cluster, thereby completing the component test of the target component.
[0071] In this embodiment, by obtaining the component type of the target component, corresponding test rules are matched to the target component, so that the target component can be tested according to the test rules in the future. This improves the accuracy of component testing in multi-cluster environments.
[0072] In an exemplary embodiment, before the step of summarizing the test results of each component to obtain the target test result corresponding to the test instruction, the method further includes: based on the test result acquisition index, collecting temporary test results that match the test result acquisition index from the test results of each component through the target controller.
[0073] In this context, test result collection metrics refer to the metrics used to collect the required test results from the test results of each component. It's understandable that component test results can contain multiple test results, and it's necessary to extract the test results corresponding to the target component. Different components may have different test result collection metrics. For example, for a scheduling component, test result collection metrics might include task creation time, task scheduling time, task completion time, and resource request amount.
[0074] For example, after obtaining the component test results of the target component in the target cluster, the target controller can further collect temporary test results that match the test result collection indicators corresponding to the target component from the component test results, and then send these temporary test results to the test system for the test system to summarize, analyze and store.
[0075] In practical applications, the target controller can also analyze the acquired temporary test results, add the analysis results to a pre-configured statistical template to obtain a test result file containing the analysis results, and send the test result file to the test system for direct aggregation and storage.
[0076] It should be noted that the target controller can monitor the test status of the target component in real time and determine whether to end the test based on the test status of the target component. For example, if all test tasks of the target component have been completed, the test can be ended; otherwise, the test continues.
[0077] In one embodiment, the test results of each component are summarized to obtain the target test result corresponding to the test instruction, and the method further includes: summarizing each temporary test result to obtain the target test result corresponding to the test instruction.
[0078] For example, after receiving the temporary test results sent by each target controller, the test system can summarize and analyze these temporary test results to obtain the target test results.
[0079] In this embodiment, temporary test results matching the test result collection indicators are collected from the component test results to meet the different test result collection needs of different components, thereby improving the accuracy and reliability of subsequent analysis of temporary test results and thus improving the accuracy and reliability of the target test results.
[0080] In one exemplary embodiment, such as Figure 6 As shown, the results of each temporary test are summarized to obtain the target test result corresponding to the test command, including:
[0081] Step S602: Summarize the results of each temporary test to obtain the summary test results.
[0082] Step S604: Based on the component analysis indicators and summary test results of the target component, perform performance analysis and functional analysis on the target component to obtain the performance analysis results and functional analysis results of the target component.
[0083] Step S606: Combine the performance analysis results and the functional analysis results as the target test results corresponding to the test instructions.
[0084] Component analysis metrics can refer to indicators used to analyze the target component, including but not limited to queue task distribution, node task distribution, and periodic task distribution. Performance analysis refers to the process of analyzing the performance of the target component, such as analyzing its response speed, reliability, security, stability, and maintainability. Functional analysis refers to the process of analyzing the business functions implemented by the target component, such as whether the functions execute normally and the execution time. Performance analysis results refer to the results obtained from performing performance analysis on the target component, and functional analysis results refer to the results obtained from analyzing the business functions implemented by the target component.
[0085] In one example, component analytics metrics may further include performance analytics metrics and functional analytics metrics.
[0086] For example, the testing system aggregates the temporary test results sent by each target controller to obtain aggregated test results. Then, based on the component analysis metrics of the target component and the aggregated test results, it performs performance analysis on the target component to obtain performance analysis results. Additionally, based on the functional analysis metrics of the target component—that is, the analysis metrics when the target component implements the corresponding business functions—it performs functional analysis on the target component to obtain functional analysis results. The performance analysis results and functional analysis results are then combined as the component test results for the target component.
[0087] In this embodiment, performance and functional analyses of the target component are performed based on its component analysis metrics, resulting in performance and functional analysis results. These two analysis results are then used together as the component test results for the target component, thus improving the accuracy of the component test results.
[0088] In one specific embodiment, such as Figure 7 The diagram illustrates a specific application scenario of a component testing method in a multi-cluster environment. The system includes a central experimental controller, experimental agent1 and experimental agent2, cluster component connectors, a Kubernetes cluster, a YARN cluster, an experimental configuration module, and components 1 and 2. The experimental agent is the target controller; the Kubernetes cluster corresponds to experimental agent1, and the YARN cluster corresponds to experimental agent2. The central experimental controller controls both experimental agent1 and experimental agent2. Component 1 is configured in the Kubernetes cluster, and component 2 is configured in the YARN cluster. It should be noted that components 1 and 2 belong to the same component. Experiments 1, 2, to n refer to the number of times the component is tested in the cluster. For example, experiment 1 represents the first experiment of the component in the cluster, experiment 2 represents the second experiment, and experiment n represents the nth experiment. Each experiment generates multiple experimental objects, i.e., experimental object 1 to experimental object n. These experimental objects are the test tasks. The experimental agent reads the experiment configuration through the experimental configuration module and allocates test resources to different experimental objects.
[0089] Specifically, in response to a test command for a target component, the overall experimental controller first obtains the component identifier of the target component. Based on the component identifier, it queries the Kubernetes cluster and YARN cluster to which the target component belongs. The target component is named Component 1 in the Kubernetes cluster and Component 2 in the YARN cluster. Next, the overall experimental controller starts Experiment Agent 1 configured for the Kubernetes cluster and Experiment Agent 2 configured for the YARN cluster. The following explanation uses component testing of Component 1 in the Kubernetes cluster as an example. For each experiment of Component 1 in the Kubernetes cluster, i.e., Experiment 1 to Experiment n, corresponding Experiment Object 1 to Experiment Object n are generated. Experiment Agent 1 obtains the parameter configuration tags of the cluster server corresponding to the Kubernetes cluster, such as high memory, high-speed disk, high-speed I / O, and normal I / O. It also obtains the experimental configuration of each experimental object from the experimental configuration module, i.e., the number of experimental tasks, experimental start time, experimental task template, experimental task priority, etc., to allocate resources for each experimental object, including network, CPU, and disk, and obtain the test resource information of each experimental object. Then, based on the component type of the target component, a suitable experimental execution method, i.e., test rules, is matched for the target component. Experiment agent1 runs experiment objects 1 to n according to the experimental execution method and test resource information. During the experiment, the experiment agent obtains the experimental status of each experiment object of component 1 in real time through status notification 1, and ends the experiment when all experiment objects 1 to n have completed the experiment, obtaining the experimental results of each of experiment objects 1 to n. Next, experiment agent1 collects temporary experimental results from these experimental results according to the pre-configured collection indicators, adds the temporary experimental results to the pre-configured experimental template, and then sends experimental result 1 to the experimental master controller.
[0090] Understandably, the testing process for component 2 in the YARN cluster is the same as that for component 1 in the Kubernetes cluster, and will not be repeated here. Experiment agent 2 sends the experimental result 2 of component 2 to the experimental controller, which then summarizes experimental result 1 and experimental result 2. Based on the pre-configured analysis metrics and the summarized experimental results, the controller performs functional and performance analysis on the target component, obtaining the functional and performance analysis results of the target component.
[0091] In this embodiment, upon receiving a test instruction for a target component, the component identifier of the target component is first obtained. Based on the component identifier, multiple target clusters to which the target component belongs are matched. Then, for each target cluster, a pre-configured target controller in that cluster is activated, and the target component is tested through this controller, yielding the component test results for that target cluster. Finally, the component test results for the target component in each target cluster are aggregated to obtain the target test result for that target component. Thus, by directly activating the target controller in each target cluster to perform component testing, there is no need for manual initiation of test processes for the target component in each target cluster, reducing the waste of manpower and time, thereby improving the efficiency of component testing across multiple clusters.
[0092] It should be understood that although the steps in the flowcharts of the above embodiments are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the above embodiments may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.
[0093] Based on the same inventive concept, this application also provides a component testing apparatus for multi-cluster environments to implement the aforementioned component testing method for multi-cluster environments. The solution provided by this apparatus is similar to the implementation described in the above method. Therefore, the specific limitations in one or more embodiments of the component testing apparatus for multi-cluster environments provided below can be found in the limitations of the component testing method for multi-cluster environments described above, and will not be repeated here.
[0094] In one exemplary embodiment, such as Figure 8 As shown, a component testing apparatus under a multi-cluster environment is provided, comprising: an identifier acquisition module 802, used to acquire the component identifier of the target component in response to a test command for the target component; a cluster determination module 804, used to determine multiple target clusters to which the target component belongs based on the component identifier; a test module 806, used to perform component testing on the target component for each target cluster through a target controller configured in the target cluster, and obtain the component test result of the target component in the target cluster; and a result acquisition module 808, used to summarize the test results of each component to obtain the target test result corresponding to the test command.
[0095] In one embodiment, the test module 806 further includes: a test task acquisition unit, used to acquire test tasks of the target component in the target cluster for each target cluster; a resource allocation unit, used to allocate resources to the test tasks through the target controller configured in the target cluster to obtain test resource information of the test tasks; and a component testing unit, used to perform component testing on the target components based on the test resource information to obtain component test results of the target components in the target cluster.
[0096] In one embodiment, the resource allocation unit is further configured to: obtain the parameter configuration tag of the cluster server corresponding to the target cluster; and allocate test resource information that matches the parameter configuration tag to the test task based on the parameter configuration tag.
[0097] In one embodiment, the apparatus is further configured to: obtain the component type of the target component; determine the test rules that match the component type based on the component type; the test module 806 is further configured to: perform component testing on the target component according to the test resource information and the test rules.
[0098] In one embodiment, the device is further configured to: based on the test result acquisition index, collect temporary test results that match the test result acquisition index from the test results of each component through the target controller; the result acquisition module 808 is further configured to: summarize each temporary test result to obtain the target test result corresponding to the test instruction.
[0099] In one embodiment, the result acquisition module 808 is further configured to: summarize the results of each temporary test to obtain a summary test result; perform performance analysis and functional analysis on the target component based on the component analysis indicators of the target component and the summary test result to obtain the performance analysis result and functional analysis result of the target component; and use the performance analysis result and functional analysis result together as the target test result corresponding to the test instruction.
[0100] Each module in the aforementioned multi-cluster component testing device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device, or stored in the memory of a computer device as software, so that the processor can call and execute the corresponding operations of each module.
[0101] In one exemplary embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 9As shown, this computer device includes a processor, memory, input / output interfaces (I / O), and a communication interface. The processor, memory, and I / O interfaces are connected via a system bus, and the communication interface is also connected to the system bus via the I / O interfaces. The processor provides computational and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and a database. The internal memory provides the environment for the operating system and computer programs stored in the non-volatile storage media. The database stores component test data under multi-cluster conditions. The I / O interfaces are used for exchanging information between the processor and external devices. The communication interface is used for communicating with external terminals via a network connection. When the computer program is executed by the processor, it implements a component testing method under multi-cluster conditions.
[0102] Those skilled in the art will understand that Figure 9 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0103] In an exemplary embodiment, a computer device is provided, including a memory and a processor. The memory stores a computer program, and the processor executes the computer program to perform the following steps: in response to a test instruction for a target component, obtaining a component identifier of the target component; based on the component identifier, determining multiple target clusters to which the target component belongs; for each target cluster, performing component testing on the target component through a target controller configured in the target cluster, and obtaining the component test result of the target component in the target cluster; and summarizing the component test results to obtain the target test result corresponding to the test instruction.
[0104] In one embodiment, when the processor executes the computer program, it further performs the following steps: for each target cluster, obtain the test tasks of the target components in the target cluster; allocate resources to the test tasks through the target controller configured in the target cluster to obtain the test resource information of the test tasks; and perform component testing on the target components based on the test resource information to obtain the component test results of the target components in the target cluster.
[0105] In one embodiment, when the processor executes the computer program, it also performs the following steps: obtaining the parameter configuration tag of the cluster server corresponding to the target cluster; and allocating test resource information that matches the parameter configuration tag to the test task based on the parameter configuration tag.
[0106] In one embodiment, when the processor executes the computer program, it further performs the following steps: obtaining the component type of the target component; determining test rules that match the component type based on the component type; and performing component testing on the target component based on test resource information, including: performing component testing on the target component according to the test resource information and the test rules.
[0107] In one embodiment, when the processor executes the computer program, it further implements the following steps: before the step of summarizing the test results of each component to obtain the target test result corresponding to the test instruction, it further includes: based on the test result acquisition index, through the target controller, acquiring temporary test results that match the test result acquisition index from the test results of each component; summarizing the test results of each component to obtain the target test result corresponding to the test instruction includes: summarizing each temporary test result to obtain the target test result corresponding to the test instruction.
[0108] In one embodiment, when the processor executes the computer program, it further performs the following steps: summarizing the results of each temporary test to obtain a summary test result; performing performance analysis and functional analysis on the target component based on the component analysis indicators of the target component and the summary test result to obtain the performance analysis result and functional analysis result of the target component; and using the performance analysis result and functional analysis result together as the target test result corresponding to the test instruction.
[0109] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, it performs the following steps: in response to a test instruction for a target component, obtaining a component identifier of the target component; based on the component identifier, determining multiple target clusters to which the target component belongs; for each target cluster, performing component testing on the target component through a target controller configured in the target cluster, and obtaining the component test result of the target component in the target cluster; and summarizing the component test results to obtain the target test result corresponding to the test instruction.
[0110] In one embodiment, when the computer program is executed by the processor, it further performs the following steps: for each target cluster, obtain the test tasks of the target components in the target cluster; allocate resources to the test tasks through the target controller configured in the target cluster to obtain the test resource information of the test tasks; and perform component testing on the target components based on the test resource information to obtain the component test results of the target components in the target cluster.
[0111] In one embodiment, when the computer program is executed by the processor, it further performs the following steps: obtaining the parameter configuration tag of the cluster server corresponding to the target cluster; and allocating test resource information that matches the parameter configuration tag to the test task based on the parameter configuration tag.
[0112] In one embodiment, when the computer program is executed by the processor, it further performs the following steps: obtaining the component type of the target component; determining test rules that match the component type based on the component type; and performing component testing on the target component based on test resource information, including: performing component testing on the target component according to the test resource information and the test rules.
[0113] In one embodiment, when the computer program is executed by the processor, it further implements the following steps: before the step of summarizing the test results of each component to obtain the target test result corresponding to the test instruction, it further includes: based on the test result acquisition index, through the target controller, acquiring temporary test results that match the test result acquisition index from the test results of each component; summarizing the test results of each component to obtain the target test result corresponding to the test instruction includes: summarizing each temporary test result to obtain the target test result corresponding to the test instruction.
[0114] In one embodiment, when the computer program is executed by the processor, it further performs the following steps: summarizing the results of each temporary test to obtain a summary test result; performing performance analysis and functional analysis on the target component based on the component analysis indicators of the target component and the summary test result to obtain the performance analysis result and functional analysis result of the target component; and using the performance analysis result and functional analysis result together as the target test result corresponding to the test instruction.
[0115] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, performs the following steps: in response to a test instruction for a target component, obtaining a component identifier of the target component; based on the component identifier, determining multiple target clusters to which the target component belongs; for each target cluster, performing component testing on the target component through a target controller configured in the target cluster, and obtaining the component test result of the target component in the target cluster; and summarizing the component test results to obtain the target test result corresponding to the test instruction.
[0116] In one embodiment, when the computer program is executed by the processor, it further performs the following steps: for each target cluster, obtain the test tasks of the target components in the target cluster; allocate resources to the test tasks through the target controller configured in the target cluster to obtain the test resource information of the test tasks; and perform component testing on the target components based on the test resource information to obtain the component test results of the target components in the target cluster.
[0117] In one embodiment, when the computer program is executed by the processor, it further performs the following steps: obtaining the parameter configuration tag of the cluster server corresponding to the target cluster; and allocating test resource information that matches the parameter configuration tag to the test task based on the parameter configuration tag.
[0118] In one embodiment, when the computer program is executed by the processor, it further performs the following steps: obtaining the component type of the target component; determining test rules that match the component type based on the component type; and performing component testing on the target component based on test resource information, including: performing component testing on the target component according to the test resource information and the test rules.
[0119] In one embodiment, when the computer program is executed by the processor, it further implements the following steps: before the step of summarizing the test results of each component to obtain the target test result corresponding to the test instruction, it further includes: based on the test result acquisition index, through the target controller, acquiring temporary test results that match the test result acquisition index from the test results of each component; summarizing the test results of each component to obtain the target test result corresponding to the test instruction includes: summarizing each temporary test result to obtain the target test result corresponding to the test instruction.
[0120] In one embodiment, when the computer program is executed by the processor, it further performs the following steps: summarizing the results of each temporary test to obtain a summary test result; performing performance analysis and functional analysis on the target component based on the component analysis indicators of the target component and the summary test result to obtain the performance analysis result and functional analysis result of the target component; and using the performance analysis result and functional analysis result together as the target test result corresponding to the test instruction.
[0121] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of the relevant data must comply with relevant regulations.
[0122] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, artificial intelligence (AI) processors, etc., and are not limited to these.
[0123] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.
[0124] The above embodiments are merely illustrative of several implementation methods of this application, and their descriptions are relatively specific and detailed. However, they should not be construed as limiting the scope of this application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.
Claims
1. A component testing method under a multi-cluster environment, characterized in that, The method includes: In response to a test command for a target component, obtain the component identifier of the target component; Based on the component identifier, determine the multiple target clusters to which the target component belongs; For each target cluster, the target component is tested using the target controller configured in the target cluster to obtain the component test results of the target component in the target cluster; The test results of each component are summarized to obtain the target test result corresponding to the test instruction.
2. The method according to claim 1, characterized in that, For each target cluster, the component testing of the target component is performed through the target controller configured in the target cluster to obtain the component test results of the target component in the target cluster, including: For each target cluster, obtain the test tasks of the target component in the target cluster; The test task is allocated resources through the target controller configured in the target cluster to obtain the test resource information of the test task; Based on the test resource information, component testing is performed on the target component to obtain the component test results of the target component in the target cluster.
3. The method according to claim 2, characterized in that, The process of allocating resources for the test task to obtain the test resource information for the test task includes: Obtain the parameter configuration tags of the cluster server corresponding to the target cluster; Based on the parameter configuration tags, test resource information matching the parameter configuration tags is allocated to the test task.
4. The method according to claim 2, characterized in that, After the step of obtaining the test resource information of the test task, the method further includes: Obtain the component type of the target component; Based on the component type, determine the test rules that match the component type; The step of performing component testing on the target component based on the test resource information includes: Component testing is performed on the target component according to the test resource information and the test rules.
5. The method according to claim 1, characterized in that, Before the step of summarizing the test results of each component to obtain the target test result corresponding to the test instruction, the method further includes: Based on the test result collection indicators, the target controller collects temporary test results that match the test result collection indicators from the test results of each component. The step of summarizing the test results of each component to obtain the target test result corresponding to the test instruction includes: The results of each temporary test are summarized to obtain the target test result corresponding to the test instruction.
6. The method according to claim 5, characterized in that, The step of summarizing the results of each temporary test to obtain the target test result corresponding to the test instruction includes: The results of each temporary test are summarized to obtain the summary test results; Based on the component analysis metrics of the target component and the summarized test results, performance analysis and functional analysis are performed on the target component to obtain the performance analysis results and functional analysis results of the target component. The performance analysis results and the functional analysis results are used together as the target test results corresponding to the test instructions.
7. A component testing device under multi-cluster conditions, characterized in that, The device includes: The identifier acquisition module is used to acquire the component identifier of the target component in response to a test command for the target component; A cluster determination module is used to determine multiple target clusters to which the target component belongs based on the component identifier; The testing module is used to perform component testing on the target component for each target cluster through the target controller configured in the target cluster, and obtain the component test results of the target component in the target cluster; The result acquisition module is used to summarize the test results of each component to obtain the target test result corresponding to the test instruction.
8. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 6.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 6.
10. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 6.