A distributed remote management and automated testing method based on the HarmonyOS
Through distributed remote management and automated testing methods based on Hongmeng system, the problem of inefficiency of large-scale distributed equipment management and testing is solved, efficient and accurate testing and management are achieved, and user experience is improved.
Patent Information
- Application Number
- CN202510661355.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-05-22
- Publication Date
- 2025-07-22
- Estimated Expiration
- 2045-05-22
AI Technical Summary
Existing distributed device management and testing methods cannot efficiently process the status information of large-scale distributed devices, have low management efficiency, slow test response, and automated testing lacks intelligence and flexibility, making it difficult to perform dynamic task scheduling and calibration of test results based on device status.
The distributed remote management and automation testing method based on the Hongmeng system, by obtaining the target device status data, data cleaning and feature extraction, generating an optimized device status data set, and performing distributed task scheduling. The distributed automation test model is used to generate test task allocation results and calibration test results, and real-time display is achieved by combining the distributed test task library and UI framework.
It realizes efficient management and precise testing of distributed devices, improves testing efficiency and accuracy, reduces manual intervention costs, and enhances user experience through real-time parameter association and UI framework display.
Smart Images

Figure CN120179567B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of distributed computing and automated testing. More specifically, the present invention relates to a distributed remote management and automated testing method and device based on the HarmonyOS system. Background Art
[0002] With the rapid development of the Internet of Things technology, distributed devices have been widely used in many fields such as smart home, smart office, and industrial automation. Due to its distributed characteristics, the HarmonyOS system can achieve seamless connection and collaborative work between devices, providing new opportunities for the management and testing of distributed devices. During the management and testing of distributed devices, it is usually necessary to monitor and analyze the running status of the devices in real time to promptly discover potential problems and optimize them. However, there are some deficiencies in the existing distributed device management and testing methods.
[0003] Traditional distributed device management and testing methods mainly rely on a centralized management architecture. When facing a large number of distributed devices, this method is prone to problems such as low management efficiency and slow test response. For example, in a smart home scenario, when multiple smart devices are simultaneously connected to the network, the centralized management architecture may cause delays in processing device status information, thereby affecting the user experience. In addition, the existing testing methods often require manual configuration of test tasks, which is not only time-consuming and laborious but also prone to human errors, resulting in inaccurate test results. In terms of automated testing, although there are already some rule-based automated testing tools, these tools usually can only target specific types of devices or test scenarios and lack the comprehensive analysis and intelligent scheduling capabilities for the overall status of distributed devices. For example, on an industrial automation production line, different types of devices may require different types of tests, and the existing automated testing tools are often difficult to meet the test requirements of multiple devices simultaneously.
[0004] In the process of implementing the embodiments of the present invention, the inventors found that there are at least the following problems or defects in the prior art: on the one hand, the existing distributed device management and testing methods cannot efficiently process the status information of a large number of distributed devices, resulting in limited management efficiency and test response speed; on the other hand, the existing automated testing methods lack intelligence and flexibility and cannot perform dynamic task scheduling and test result calibration according to the actual status of the devices, thus affecting the accuracy and reliability of the tests. Summary of the Invention
[0005] The present invention provides a distributed remote management and automated testing method, device, equipment, and medium based on the HarmonyOS system.
[0006] In the first aspect of the present invention, a distributed remote management and automated testing method based on the HarmonyOS is provided, including: obtaining a set of target distributed device status data, where the set of target distributed device status data is pre-collected operation status data of the HarmonyOS device to be tested; generating an optimized set of device status data according to the set of target distributed device status data, where the optimized device status data is data obtained by performing data cleaning and feature extraction on at least one set of target distributed device status data; performing distributed task scheduling on each optimized device status data in the optimized set of device status data to generate a test task allocation result; generating an initial test result and test description information according to the test task allocation result and a pre-trained distributed automated testing model, where the test description information includes: a set of test task description information, and the test task description information includes: task type, task feature vector, and task priority information, and the task priority information represents the priority of the test task corresponding to the test task description information in the distributed automated testing; for each test task description information in the set of test task description information, perform the following processing steps: determining whether there is a test task matching the test task description information in a pre-constructed distributed test task library according to the task type and task feature vector included in the test task description information; in response to the existence, determining the test task matching the test task description information as a candidate test task; calibrating the initial test result according to the obtained set of candidate test tasks to generate a calibrated test result.
[0007] Further, the method further includes: associating the real-time operation parameters of the HarmonyOS device to be tested with the calibrated test result; in response to successful parameter association, displaying the device operation status of the HarmonyOS device to be tested in real time through the calibrated test result, where the real-time display is implemented through the distributed UI framework of the HarmonyOS.
[0008] Further, generating an optimized device status data set according to the target distributed device status data set includes: for each group of target distributed device status data in the target distributed device status data set, performing the following data preprocessing steps: filtering noise from the target distributed device status data to generate filtered device status data; extracting features from the filtered device status data to generate a feature vector set, where the feature vectors in the feature vector set include: device performance indicators, device resource utilization rates, and device connection statuses; performing similarity clustering on the target distributed device status data in the target distributed device status data set according to the feature vector set corresponding to the target distributed device status data to generate a set of device status data groups; for each device status data group in the set of device status data groups, performing the following optimization steps: randomly selecting a group of device status data from the device status data group as reference data; enhancing the features of the reference data according to the device status data in the device status data group other than the reference data to generate optimized device status data in the optimized device status data set.
[0009] Further, performing distributed task scheduling on each piece of optimized device status data in the optimized device status data set to generate a test task allocation result includes: for each piece of optimized device status data in the optimized device status data set, calculating weights for the task priority information in the optimized device status data to generate a priority weight vector; performing distributed task scheduling on the optimized device status data in the optimized device status data set according to the priority weight vector corresponding to the optimized device status data to generate a task allocation index array, where the task allocation index array represents the task allocation order of each piece of optimized device status data in the optimized device status data set; performing distributed task scheduling on each piece of optimized device status data in the optimized device status data set according to the task allocation index array to generate the test task allocation result.
[0010] Further, the test tasks in the distributed test task library correspond to hash identifiers, and the hash identifier is a 256-bit hash string; and determining whether there is a test task matching the test task description information in the pre-constructed distributed test task library according to the task type and task feature vector included in the test task description information includes: performing one-hot encoding on the task type included in the test task description information to generate an encoded task type; concatenating the encoded task type with the task feature vector included in the test task description information to generate a concatenated vector; performing hash processing on the concatenated vector to generate a hashed vector, where the hashed vector is a 256-bit hash string; and matching the hashed vector with the hash identifier corresponding to the test task in the distributed test task library to determine whether there is a test task matching the test task description information in the distributed test task library.
[0011] Further, calibrating the initial test result according to the obtained candidate test task set to generate a calibrated test result includes: for each candidate test task in the candidate test task set, replacing the test result corresponding to the candidate test task in the initial test result with the calibration result of the candidate test task, where the calibration result is generated by the distributed calibration algorithm of the HarmonyOS system.
[0012] Further, the distributed automated test model includes: a state encoder, a task decoder, a feature calibration model, and a weight adjustment model; and generating an initial test result and test description information according to the test task allocation result and the pre-trained distributed automated test model includes: generating a state-encoded feature according to the state encoder and the test task allocation result; generating a task-decoded feature according to the task decoder and the state-encoded feature; generating a task-calibrated feature according to the feature calibration model and the task-decoded feature; generating a weight adjustment parameter according to the weight adjustment model and the test task allocation result; and generating the initial test result and the test description information according to the weight adjustment parameter and the task-calibrated feature.
[0013] In the second aspect of the present invention, a distributed remote management and automated testing device based on the HarmonyOS is provided, including: a data acquisition unit configured to obtain a set of target distributed device status data, where the set of target distributed device status data is pre-acquired operation status data of a HarmonyOS device to be tested; a data optimization unit configured to generate an optimized set of device status data according to the set of target distributed device status data, where the optimized device status data is data obtained by performing data cleaning and feature extraction on at least one set of target distributed device status data; a task scheduling unit configured to perform distributed task scheduling on each piece of optimized device status data in the optimized set of device status data to generate a test task allocation result; a test generation unit configured to generate an initial test result and test description information according to the test task allocation result and a pre-trained distributed automated testing model, where the test description information includes: a set of test task description information, and the test task description information includes: task type, task feature vector, and task priority information, and the task priority information represents the priority of the test task corresponding to the test task description information in the distributed automated testing; an execution unit configured to, for each piece of test task description information in the set of test task description information, perform the following processing steps: determine whether there is a test task matching the test task description information in a pre-constructed distributed test task library according to the task type and task feature vector included in the test task description information; in response to the existence, determine the test task matching the test task description information as a candidate test task; a result calibration unit configured to perform result calibration on the initial test result according to the obtained set of candidate test tasks to generate a calibrated test result.
[0014] In the third aspect of the present invention, an electronic device is provided, where the electronic device includes: at least one processor, a memory, and an input / output unit; wherein, the memory is used to store a computer program, and the processor is used to call the computer program stored in the memory to execute the method according to any one of the first aspect.
[0015] In the fourth aspect of the present invention, a computer-readable storage medium is provided, which includes instructions that, when running on a computer, cause the computer to execute the method according to any one of the first aspect.
[0016] The above embodiments of the present invention have at least the following beneficial effects: A distributed remote management and automated testing method and device based on the HarmonyOS provided by the present invention can efficiently obtain a target distributed device status data set, and generate an optimized device status data set through data cleaning and feature extraction. By performing distributed task scheduling on the optimized device status data, a reasonable test task allocation result can be generated, and then an initial test result and detailed test description information can be generated according to a pre-trained distributed automated testing model. In addition, by matching with the test tasks in the distributed test task library, candidate test tasks can be determined and the initial test result can be calibrated, thereby generating a more accurate calibrated test result. This method can achieve efficient management and accurate testing of distributed devices, improve testing efficiency and accuracy, and reduce the cost of manual intervention.
[0017] The present invention can also perform parameter association between the real-time operation parameters of the HarmonyOS device to be tested and the calibrated test result, and display the device operation status in real time through the distributed UI framework of the HarmonyOS. This enables users to intuitively understand the operation of the device, promptly discover potential problems and make optimization adjustments. At the same time, by performing data preprocessing steps such as noise filtering, feature extraction, and similarity clustering on the target distributed device status data set, the quality and usability of the device status data can be further improved, providing a more reliable data basis for subsequent test task scheduling and result calibration. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] By reading the following detailed description with reference to the accompanying drawings, the above and other objects, features, and advantages of the exemplary embodiments of the present invention will become readily understood. In the drawings, several embodiments of the present invention are shown by way of illustration and not limitation, wherein:
[0019] Figure 1 It is a schematic flow chart of a distributed remote management and automated testing method based on the HarmonyOS provided by an embodiment of the present invention.
[0020] Figure 2 It is a schematic structural diagram of a distributed remote management and automated testing device based on the HarmonyOS provided by an embodiment of the present invention.
[0021] Figure 3 It schematically shows a schematic structural diagram of an electronic device according to an embodiment of the present invention. DETAILED DESCRIPTION OF THE EMBODIMENTS
[0022] The principles and spirit of the present invention will be described below with reference to several exemplary embodiments. It should be understood that these embodiments are provided only to enable those skilled in the art to better understand and implement the present invention, and do not limit the scope of the present invention in any way. On the contrary, these embodiments are provided to make the present invention more thorough and complete, and to convey the scope of the present invention fully to those skilled in the art.
[0023] Those skilled in the art know that the embodiments of the present invention can be implemented as a device, apparatus, equipment, method, or computer program product. Therefore, the present invention can be specifically implemented in the following forms, namely: completely hardware, completely software (including firmware, resident software, microcode, etc.), or a combination of hardware and software.
[0024] It should be noted that any number of elements in the drawings is for illustration rather than limitation, and any naming is only for distinction and does not have any limiting meaning.
[0025] The following references Figure 1 , Figure 1 is a schematic flow chart of a distributed remote management and automated testing method based on the HarmonyOS provided for an embodiment of the present invention. As Figure 1 shown, a distributed remote management and automated testing method based on the HarmonyOS includes: S1, obtaining a set of target distributed device status data, where the set of target distributed device status data is pre-collected operation status data of the Harmony device to be tested.
[0026] S2, generating an optimized set of device status data according to the set of target distributed device status data, where the optimized device status data is data obtained by performing data cleaning and feature extraction on at least one set of target distributed device status data.
[0027] S3, performing distributed task scheduling on each optimized device status data in the optimized set of device status data to generate a test task allocation result.
[0028] S4, generating an initial test result and test description information according to the test task allocation result and a pre-trained distributed automated testing model, where the test description information includes: a set of test task description information, and the test task description information includes: task type, task feature vector, and task priority information, and the task priority information represents the priority of the test task corresponding to the test task description information in the distributed automated testing.
[0029] S5. For each test task description information in the test task description information set, perform the following processing steps: Determine whether there is a test task in the pre-constructed distributed test task library that matches the test task description information according to the task type and task feature vector included in the test task description information.
[0030] S6. In response to the existence, determine the test task that matches the test task description information as the candidate test task.
[0031] S7. According to the obtained candidate test task set, calibrate the initial test result to generate a calibrated test result.
[0032] It should be noted that the present invention proposes a distributed remote management and automated testing method based on the HarmonyOS. The core lies in realizing the efficient management and accurate testing of distributed devices through the processing and analysis of the target distributed device status data set. The target distributed device status data set refers to the pre-collected operation status data of the HarmonyOS device to be tested, and these data contain various operation parameters of the device, such as the performance indicators of the device, resource utilization rate, connection status, etc. Through data cleaning and feature extraction, an optimized device status data set can be generated, and these data can more accurately reflect the actual operation situation of the device after being processed, providing a basis for subsequent test task scheduling and result generation.
[0033] Specifically, each group of data in the target distributed device status data set contains the detailed operation information of the device. For example, the device performance indicators may include CPU usage rate, memory occupancy rate, network bandwidth utilization rate, etc.; the device resource utilization rate may cover battery power, storage space usage, etc.; the device connection status involves the connection status of the device with other devices or networks, such as Wi-Fi connection status, Bluetooth connection status, etc. The optimized device status data set is obtained by filtering noise and extracting features from the original data. Noise filtering means removing outliers or interference information in the data to improve the data quality; feature extraction is to extract the most valuable information for describing the device status from the original data, such as calculating statistical quantities such as the average value and variance of the device performance indicators as feature vectors. These feature vector sets will be used as the input for subsequent distributed task scheduling.
[0034] Preferably, when performing distributed task scheduling for each optimized device status data in the optimized device status data set, weight calculation can be performed according to task priority information. The task priority information characterizes the priority of the test task corresponding to the test task description information in the distributed automated test. For example, a higher priority can be assigned to the test task of critical devices. Weight calculation can be performed by quantifying the task priority information. For example, the priority is divided into three levels: high, medium, and low, and different weight values are assigned respectively. According to the priority weight vector corresponding to the optimized device status data, a task allocation index array can be generated, and this array characterizes the task allocation order of each optimized device status data in the optimized device status data set. In this way, it can be ensured that high-priority tasks can be executed first, thereby improving the test efficiency and accuracy.
[0035] In some embodiments, the method further includes: associating the real-time operation parameters of the to-be-tested HarmonyOS device with the calibrated test results; in response to successful parameter association, displaying the device operation status of the to-be-tested HarmonyOS device in real time through the calibrated test results, where the real-time display is implemented through the distributed UI framework of the HarmonyOS system.
[0036] It should be noted that in the distributed remote management and automated test method of the present invention, the parameter association between the real-time operation parameters of the to-be-tested HarmonyOS device and the calibrated test results is further realized. The real-time operation parameters here refer to various data dynamically generated by the device during the test, such as the current CPU usage rate, memory occupancy, network connection status, etc. Through parameter association, these real-time data can be combined with the test results, so as to more comprehensively reflect the actual performance of the device during the test. This association method can not only help testers more accurately evaluate the performance of the device, but also provide richer data support for subsequent optimization and improvement. Finally, the device operation status is displayed in real time through the distributed UI framework of the HarmonyOS system, enabling users to intuitively see the real-time operation situation and test results of the device, enhancing the user experience and management efficiency.
[0037] Specifically, parameter association refers to matching and integrating real-time operating parameters with calibrated test results. For example, real-time operating parameters can include the current performance metrics of the device (such as CPU usage rate, memory occupancy rate, etc.), resource utilization rates (such as battery power, storage space usage, etc.), and connection status (such as Wi-Fi connection strength, Bluetooth connection status, etc.). These parameters are collected in real time through sensors or system interfaces and compared and associated with the calibrated test results. For example, if the test results show that the device performs poorly in a certain performance test, through parameter association, it can be checked whether the CPU usage rate of the device is too high during the test, so as to determine whether there is a performance bottleneck. The distributed UI framework is an important feature of the HarmonyOS, which allows the same or related user interface content to be synchronously displayed on multiple devices. Through this framework, the running state of the device can be displayed in real time on the user's terminal devices, such as mobile phones, tablets or computers, and the user can intuitively see the running situation and test results of the device through these terminal devices.
[0038] Preferably, parameter association can be achieved by constructing an association model. This model can be constructed based on the correlation between the real-time operating parameters of the device and the calibrated test results. For example, the input parameters can include the real-time CPU usage rate, memory occupancy rate and other performance metrics of the device, as well as the performance scores in the calibrated test results. The model can determine the association strength between them by calculating the correlation coefficient between these parameters. For example, if the correlation coefficient between the CPU usage rate and the performance score is high, it can be judged that the CPU usage rate is one of the key factors affecting the device performance. In terms of real-time display, the distributed UI framework can achieve real-time update of the device running state through the publish-subscribe mechanism. For example, the device side acts as the publisher, sending the real-time operating parameters and test results to the framework, and the user terminal acts as the subscriber, receiving these data and updating the display content in real time. In this way, the user can monitor the running state of the device in real time and discover and solve problems in a timely manner.
[0039] In some embodiments, generating the optimized device status data set according to the target distributed device status data set includes: for each group of target distributed device status data in the target distributed device status data set, performing the following data preprocessing steps: filtering noise from the target distributed device status data to generate filtered device status data; extracting features from the filtered device status data to generate a set of feature vectors, wherein the feature vectors in the set of feature vectors include: device performance indicators, device resource utilization rates, and device connection statuses; performing similarity clustering on the target distributed device status data in the target distributed device status data set according to the set of feature vectors corresponding to the target distributed device status data to generate a set of device status data groups; for each device status data group in the set of device status data groups, performing the following optimization steps: randomly selecting a group of device status data from the device status data group as reference data; enhancing the features of the reference data according to the device status data in the device status data group other than the reference data to generate the optimized device status data in the optimized device status data set.
[0040] It should be noted that in the process of generating the optimized device status data set in the present invention, detailed data preprocessing is performed on each group of data in the target distributed device status data set. This process mainly includes steps such as noise filtering, feature extraction, and similarity clustering. The purpose is to improve the quality and usability of the data through these processes, so as to provide a more accurate basis for subsequent test task scheduling. Noise filtering is used to remove outliers and interference information in the data, feature extraction extracts the most valuable information for describing the device status from the data, and similarity clustering groups data with similar features for better subsequent processing. Through these steps, an optimized device status data set can be generated, providing high-quality data support for distributed task scheduling and test result generation.
[0041] Specifically, each set of data in the target distributed device status data set contains detailed operation information of the device. For example, device performance metrics can include CPU usage rate, memory occupancy rate, network bandwidth utilization rate, etc.; device resource utilization can cover battery power, storage space usage, etc.; device connection status involves the connection status of the device with other devices or networks, such as Wi-Fi connection status, Bluetooth connection status, etc. Noise filtering refers to removing outliers or interference information in the data to improve the data quality. For example, outliers outside the normal range can be filtered out by setting thresholds. Feature extraction is to extract the most valuable information for describing the device status from the original data. For example, statistical quantities such as the average value and variance of device performance metrics are calculated as feature vectors. Similarity clustering groups data with similar features. For example, the K-means algorithm can be used to divide device status data into different clusters, and the data within each cluster has similar feature vectors. For each device status data group, a set of device status data is randomly selected from the group as the reference data, and the feature vectors of the reference data are enhanced according to other data in the group to generate an optimized device status data set.
[0042] Preferably, noise filtering can be achieved by setting reasonable thresholds. For example, for CPU usage rate data, if the value of a data point exceeds 95%, it can be considered an outlier and filtered out. Feature extraction can be completed by calculating the statistics of device performance metrics. For example, calculating the average value, variance, etc. of CPU usage rate, and these statistics can be part of the feature vector. Similarity clustering can use the K-means algorithm, where the value of K can be adjusted according to the actual data distribution. For example, if the device status data is mainly divided into three situations: high load, medium load, and low load, the value of K can be set to 3. During the feature enhancement process, the feature vector of the reference data can be adjusted by calculating the similarity between other data in the group and the reference data. For example, if a data point is very close to the reference data in terms of CPU usage rate, the weight of the CPU usage rate feature in the reference data can be increased. Through these refined steps, the quality of the optimized device status data set can be further improved, providing a more accurate data basis for subsequent test task scheduling and result generation.
[0043] In some embodiments, performing distributed task scheduling on each of the optimized device status data in the optimized device status data set to generate a test task allocation result includes: for each optimized device status data in the optimized device status data set, calculating a weight for the task priority information in the optimized device status data to generate a priority weight vector; according to the priority weight vector corresponding to the optimized device status data, performing distributed task scheduling on the optimized device status data in the optimized device status data set to generate a task allocation index array, where the task allocation index array represents the task allocation order of each of the optimized device status data in the optimized device status data set; and according to the task allocation index array, performing distributed task scheduling on each of the optimized device status data in the optimized device status data set to generate the test task allocation result.
[0044] It should be noted that when the present invention performs distributed task scheduling on each of the optimized device status data in the optimized device status data set, a weight calculation mechanism for task priority information is introduced. The core of this mechanism is to generate a priority weight vector based on the task priority information of the device status data, and then perform task scheduling on the device status data through this vector to finally generate a task allocation index array. The task priority information represents the priority of the test task in the distributed automated test. For example, the test task of a key device may have a higher priority. In this way, it can be ensured that high-priority tasks can be executed first, thereby improving the test efficiency and accuracy.
[0045] Specifically, the task priority information refers to the parameter used to represent the importance of the test task in the test task description information. For example, the task priority can be divided into three levels: high, medium, and low, corresponding to different priority weight values respectively. The priority weight vector is a vector generated based on the task priority information and is used to sort the device status data during the task scheduling process. The task allocation index array is an index array that represents the task allocation order of each device status data in the optimized device status data set. For example, if a device status data has a higher task priority, its index value in the task allocation index array will be smaller, indicating that this task will be executed first. During the task scheduling process, the device status data can be sorted according to the priority weight vector, and then the task allocation index array can be generated according to the sorting result, so as to achieve a reasonable allocation of tasks.
[0046] Preferably, the weight calculation of the task priority information can be implemented through a simple linear mapping model. For example, assume that the task priorities are divided into three levels: high, medium, and low, and the corresponding weight values are 3, 2, and 1 respectively. For each optimized device status data, determine the corresponding weight value according to its task priority information, and generate a priority weight vector. During the task scheduling process, a simple sorting algorithm, such as bubble sort or quick sort, can be used to sort the device status data according to the priority weight vector. After the sorting is completed, generate a task assignment index array, where each index value in the array corresponds to the task assignment order of a device status data. For example, the device status data with an index value of 1 will execute its corresponding test task first. In this way, it can be ensured that high-priority tasks can be executed first, thereby improving the test efficiency and accuracy.
[0047] In some embodiments, the test tasks in the distributed test task library correspond to hash identifiers, and the hash identifier is a 256-bit hash string; and determining whether there is a test task in the pre-constructed distributed test task library that matches the test task description information according to the task type and task feature vector included in the test task description information includes: performing one-hot encoding on the task type included in the test task description information to generate an encoded task type; concatenating the encoded task type with the task feature vector included in the test task description information to generate a concatenated vector; performing hash processing on the concatenated vector to generate a hashed vector, where the hashed vector is a 256-bit hash string; and matching the hashed vector with the hash identifier corresponding to the test task in the distributed test task library to determine whether there is a test task in the distributed test task library that matches the test task description information.
[0048] It should be noted that when the present invention determines whether there is a test task in the distributed test task library that matches the test task description information, an efficient matching mechanism based on hash identifiers is adopted. Specifically, the task type and task feature vector in the test task description information are first processed into a unified hashed vector, and then matched with the hash identifier of the test task pre-stored in the distributed test task library. This method can quickly and accurately find the matching test task, thereby improving the test efficiency. The hash identifier is a 256-bit hash string used to uniquely identify the test task and is generated by performing hash processing on the task type and task feature vector. This mechanism not only improves the matching efficiency but also reduces the occupation of storage space.
[0049] Specifically, the task type refers to the category of test tasks, such as performance testing, functional testing, stability testing, etc. The task feature vector is a set of numerical values that describe the characteristics of the test task, such as the input parameters of the task, the expected output, the execution environment, etc. One-hot encoding is a coding method that converts categorical variables into numerical vectors. For example, the task type performance testing is encoded as a specific numerical vector. Concatenation is the process of connecting two vectors into a longer vector. For example, the encoded task type vector is concatenated with the task feature vector. Hashing is a process of converting input data into a fixed-length string. For example, the concatenated vector is converted into a 256-bit hash string using the SHA-256 algorithm. The distributed test task library is a database that stores all possible test tasks and their hash identifiers. Each test task has a unique hash identifier. By matching the generated hashed vector with the hash identifiers in the distributed test task library, it can be quickly determined whether there is a matching test task.
[0050] Preferably, the one-hot encoding process can be implemented as follows: Assume that there are three task types, namely performance testing, functional testing, and stability testing, which can be represented by the numerical vectors [1, 0, 0], [0, 1, 0], and [0, 0, 1] respectively. The task feature vector can contain multiple parameters, such as the input parameter range of the task, the expected output type, etc. The concatenation process is to directly connect the one-hot encoded task type vector with the task feature vector to form a longer vector. Hashing can use the SHA-256 algorithm, which converts the input vector into a 256-bit hash string. In the distributed test task library, the hash identifier of each test task is also generated through the same hashing process. The matching process is to compare the generated hashed vector with the hash identifiers in the library one by one. If the same hash identifier is found, it is considered that a matching test task has been found. This method can quickly and accurately find the matching test task, thereby improving the test efficiency.
[0051] In some embodiments, the result calibration of the initial test result to generate a calibrated test result according to the obtained candidate test task set includes: for each candidate test task in the candidate test task set, replacing the test result corresponding to the candidate test task in the initial test result with the calibration result of the candidate test task, where the calibration result is generated by the distributed calibration algorithm of the HarmonyOS system.
[0052] It should be noted that in the process of generating the calibrated test results in the present invention, a result calibration mechanism based on a set of candidate test tasks is adopted. Specifically, for each candidate test task, the test result corresponding to the candidate test task in the initial test results is replaced with the calibration result of the candidate test task. The calibration result here is generated by the distributed calibration algorithm of the HarmonyOS, aiming to improve the accuracy and reliability of the test results. This method can effectively correct the deviation in the initial test results and ensure that the final test results can truly reflect the actual performance of the device.
[0053] Specifically, the set of candidate test tasks refers to the set of test tasks found in the distributed test task library that match the test task description information. The initial test results refer to the preliminary results generated after the execution of the test tasks, and these results may have certain deviations due to factors such as the test environment and device status. The calibration result is the result after correcting the initial test results by the distributed calibration algorithm, and this algorithm takes into account the actual operating state of the device and the characteristics of the test tasks. For example, in performance testing, if the initial test results show that the response time of the device is longer than expected, the distributed calibration algorithm may adjust the response time according to the current load situation of the device to generate a more accurate calibration result. In this way, it can be ensured that the test results can truly reflect the actual performance of the device and improve the accuracy and reliability of the test.
[0054] Preferably, the distributed calibration algorithm can be constructed based on the real-time operating parameters of the device and the characteristics of the test tasks. For example, the algorithm can consider real-time parameters such as the CPU usage rate, memory occupancy rate, and network bandwidth utilization rate of the device, as well as characteristics such as the input parameters and expected outputs of the test tasks. The input parameters of the algorithm include the initial test results and the real-time operating parameters of the device. By analyzing the relationships between these parameters, the algorithm can calculate the calibration result. For example, if the CPU usage rate of the device is high during the test, the algorithm may adjust the response time in the performance test results upward to reflect the actual performance of the device under high load. In practical applications, the distributed calibration algorithm can be implemented through machine learning models, such as using linear regression models or neural network models, and these models can be trained based on historical data to improve the accuracy of the calibration results. In this way, the accuracy and reliability of the test results can be further improved, providing more reliable data support for the optimization and improvement of the device.
[0055] In some embodiments, the distributed automated test model includes: a state encoder, a task decoder, a feature calibration model, and a weight adjustment model; and based on the test task allocation result and the pre-trained distributed automated test model, an initial test result and test description information are generated, including: generating feature vectors after state encoding according to the state encoder and the test task allocation result; generating feature vectors after task decoding according to the task decoder and the feature vectors after state encoding; generating feature vectors after task calibration according to the feature calibration model and the feature vectors after task decoding; generating weight adjustment parameters according to the weight adjustment model and the test task allocation result; generating the initial test result and the test description information according to the weight adjustment parameters and the feature vectors after task calibration.
[0056] It should be noted that in the process of generating the initial test result and test description information in the present invention, a method based on a distributed automated test model is adopted. This model includes a state encoder, a task decoder, a feature calibration model, and a weight adjustment model. Through the collaborative work of these components, accurate initial test results and detailed test description information can be generated. The state encoder is used to convert device state data into encoded feature vectors, the task decoder is used to decode the encoded feature vectors into specific task features, the feature calibration model is used to calibrate the task features, and the weight adjustment model is used to adjust the weights according to the task priorities. The joint action of these components ensures that the generated test results and description information can accurately reflect the actual operating state of the device and the requirements of the test tasks.
[0057] Specifically, the state encoder is a component in the distributed automated test model. It receives the optimized device state data as input and converts it into feature vectors after state encoding. These features are a compact representation of the device state and can be used for subsequent processing. The task decoder is another component. It receives the feature vectors after state encoding and decodes them into feature vectors after task decoding, which are closer to the specific test task requirements. The feature calibration model is used to calibrate the feature vectors after task decoding to ensure the accuracy and consistency of the features. The weight adjustment model adjusts the weights according to the task priority information to generate weight adjustment parameters. These parameters are used to finally generate the initial test result and the test description information, where the test description information includes the task type, task feature vectors, and task priority information. The collaborative work of these components ensures the accuracy and reliability of the test results.
[0058] Preferably, the state encoder can be implemented by a neural network, such as a multi-layer perceptron (MLP) or a convolutional neural network (CNN). The input parameter is the optimized device state data, and the output is the state-encoded features. The task decoder can also use a neural network. The input is the state-encoded features, and the output is the task-decoded features. The feature calibration model can be implemented by a simple linear model. The input is the task-decoded features, and the output is the calibrated features. The weight adjustment model can dynamically adjust the weights according to the task priority information. For example, a simple linear function is used. The input is the task priority information, and the output is the weight adjustment parameter. In practical applications, these models can be trained by machine learning algorithms to improve their performance and accuracy. For example, historical test data can be used to train the model to ensure that the model can accurately generate test results and description information. In this way, the accuracy and reliability of the test results can be further improved, providing more reliable data support for the optimization and improvement of the device.
[0059] The above-mentioned embodiments of the present invention have the following beneficial effects: The present invention can improve the test efficiency and management ability of distributed devices in the HarmonyOS system. By pre-collecting device state data and performing data cleaning and feature extraction, the quality of test data can be optimized; based on the distributed task scheduling and automated test model, test tasks can be intelligently allocated and initial results can be generated; combined with the task priority matching and result calibration mechanism, the test process can be dynamically adjusted and the result accuracy can be improved.
[0060] The present invention can also realize real-time status monitoring and visual display of HarmonyOS devices. Using the distributed UI framework, the calibrated test results can be dynamically associated with the device operation parameters to intuitively present the device status; through algorithms such as feature enhancement, hash matching, and weight adjustment, the execution order of test tasks can be optimized to improve the overall system response speed; at the same time, based on the distributed calibration algorithm and task library matching, the reliability of the test results can be ensured, which is applicable to the automated test and management of large-scale distributed devices.
[0061] As Figure 2 shown, a distributed remote management and automated test device based on the HarmonyOS system in some embodiments, the device includes: a data acquisition unit 201, configured to obtain a set of target distributed device state data, where the set of target distributed device state data is pre-collected operation state data of the HarmonyOS device to be tested.
[0062] A data optimization unit 202, configured to generate a set of optimized device state data according to the set of target distributed device state data, where the optimized device state data is data obtained by performing data cleaning and feature extraction on at least one set of target distributed device state data.
[0063] The task scheduling unit 203 is configured to perform distributed task scheduling on each optimized device status data in the optimized device status data set to generate a test task allocation result.
[0064] The test generation unit 204 is configured to generate an initial test result and test description information according to the test task allocation result and a pre-trained distributed automated test model, wherein the test description information includes: a test task description information set, and the test task description information includes: a task type, a task feature vector, and task priority information, and the task priority information represents the priority of the test task corresponding to the test task description information in the distributed automated test.
[0065] The execution unit 205 is configured to, for each test task description information in the test task description information set, perform the following processing steps: determine whether there is a test task matching the test task description information in a pre-constructed distributed test task library according to the task type and task feature vector included in the test task description information; in response to the existence, determine the test task matching the test task description information as a candidate test task.
[0066] The result calibration unit 206 is configured to perform result calibration on the initial test result according to the obtained candidate test task set to generate a calibrated test result.
[0067] It can be understood that the various modules described in the distributed remote management and automated test device based on the HarmonyOS correspond to the respective steps in the distributed remote management and automated test method based on the HarmonyOS described in the reference Figure 1 Therefore, the operations, features, and beneficial effects described above for the distributed remote management and automated test method based on the HarmonyOS also apply to the distributed remote management and automated test device based on the HarmonyOS and the modules included therein, and will not be repeated here.
[0068] Next, refer to Figure 3 , which shows a schematic structural diagram of an electronic device 300 suitable for implementing some embodiments of the present invention. The electronic device in some embodiments of the present invention may include, but is not limited to, mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Tablet Computers), PMPs (Portable Multimedia Players), in-vehicle terminals (such as in-vehicle navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 3 The terminal device shown is only an example and should not impose any limitation on the functions and usage scope of the embodiments of the present invention.
[0069] AsFigure 3 As shown, the electronic device 300 may include a processing device (such as a central processing unit, a graphics processing unit, etc.) 301, which may perform various appropriate actions and processes according to the program stored in the read-only memory (ROM) 302 or the program loaded from the storage device 308 into the random access memory (RAM) 303. In the RAM 303, various programs and data required for the operation of the electronic device 300 are also stored. The processing device 301, the ROM 302, and the RAM 303 are connected to each other through a bus 304. The input / output (I / O) interface 305 is also connected to the bus 304.
[0070] Generally, the following devices may be connected to the I / O interface 305: an input device 306 including, for example, a touch screen, a touchpad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 307 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 308 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 309. The communication device 309 may allow the electronic device 300 to communicate with other devices wirelessly or wiredly to exchange data. Although Figure 3 the electronic device 300 with various devices is shown, it should be understood that it is not required to implement or have all the shown devices. Instead, more or fewer devices may be implemented or had. Figure 3 Each block shown in may represent a device or, as needed, multiple devices.
[0071] Furthermore, the storage medium of the embodiments of the present application stores program instructions capable of implementing all the above methods. Among them, the program instructions may be stored in the above storage medium in the form of a software product, including several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) or a processor to execute all or part of the steps of the methods described in the various embodiments of the present application. The foregoing storage medium includes: various media that can store program codes such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disc, or a terminal device such as a computer, a server, a mobile phone, or a tablet.
[0072] The above description is only some preferred embodiments of the present invention and an explanation of the applied technical principles. Those skilled in the art should understand that the scope of the invention involved in the embodiments of the present invention is not limited to the technical solutions formed by the specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above inventive concept. For example, the technical solutions formed by mutually replacing the above features with the technical features (but not limited to) having similar functions disclosed in the embodiments of the present invention.
Claims
1. A distributed remote management and automated testing method based on the HarmonyOS, characterized in that Including: Obtain a set of target distributed device status data, where the set of target distributed device status data is pre-collected operation status data for a Hongmeng device to be tested; generate an optimized set of device status data based on the set of target distributed device status data, where the optimized device status data is data obtained by performing data cleaning and feature extraction on at least one set of target distributed device status data; perform distributed task scheduling on each piece of optimized device status data in the optimized set of device status data to generate a test task allocation result; generate an initial test result and test description information based on the test task allocation result and a pre-trained distributed automation test model, where the test description information includes: a set of test task description information, and the test task description information includes: task type, task feature vector, and task priority information, and the task priority information represents the priority of the test task corresponding to the test task description information in the distributed automation test; for each test task description information in the set of test task description information, perform the following processing steps: determine whether there is a test task matching the test task description information in a pre-constructed distributed test task library according to the task type and task feature vector included in the test task description information; in response to the existence, determine the test task matching the test task description information as a candidate test task; calibrate the initial test result according to the obtained set of candidate test tasks to generate a calibrated test result.
2. The method according to claim 1, wherein The method further includes: associating the real-time operation parameters of the Hongmeng device to be tested with the calibrated test result; in response to successful parameter association, display the device operation status of the Hongmeng device to be tested in real time through the calibrated test result, where the real-time display is implemented through the distributed UI framework of the Hongmeng system.
3. The method according to claim 2, wherein Generating an optimized device status data set according to the target distributed device status data set includes: for each group of target distributed device status data in the target distributed device status data set, performing the following data preprocessing steps: filtering noise from the target distributed device status data to generate filtered device status data; extracting features from the filtered device status data to generate a set of feature vectors, where the feature vectors in the set of feature vectors include: device performance indicators, device resource utilization rates, and device connection statuses; performing similarity clustering on the target distributed device status data in the target distributed device status data set according to the set of feature vectors corresponding to the target distributed device status data to generate a set of device status data groups; for each device status data group in the set of device status data groups, performing the following optimization steps: randomly selecting a group of device status data from the device status data group as reference data; enhancing the features of the reference data according to the device status data in the device status data group other than the reference data to generate optimized device status data in the optimized device status data set.
4. The method according to claim 3, wherein Performing distributed task scheduling on each piece of optimized device status data in the optimized device status data set to generate a test task allocation result includes: for each piece of optimized device status data in the optimized device status data set, calculating weights for the task priority information in the optimized device status data to generate a priority weight vector; performing distributed task scheduling on the optimized device status data in the optimized device status data set according to the priority weight vector corresponding to the optimized device status data to generate a task allocation index array, where the task allocation index array represents the task allocation order of each piece of optimized device status data in the optimized device status data set; performing distributed task scheduling on each piece of optimized device status data in the optimized device status data set according to the task allocation index array to generate the test task allocation result.
5. The method according to claim 4, wherein The test tasks in the distributed test task library correspond to hash identifiers, and the hash identifiers are 256-bit hash strings; and determining whether there is a test task in the pre-constructed distributed test task library that matches the test task description information according to the task type and task feature vector included in the test task description information includes: performing one-hot encoding on the task type included in the test task description information to generate an encoded task type; concatenating the encoded task type with the task feature vector included in the test task description information to generate a concatenated vector; performing hash processing on the concatenated vector to generate a hashed vector, where the hashed vector is a 256-bit hash string; matching the hashed vector with the hash identifier corresponding to the test task in the distributed test task library to determine whether there is a test task in the distributed test task library that matches the test task description information.
6. The method according to claim 5, wherein Calibrating the initial test result according to the obtained candidate test task set to generate a calibrated test result includes: for each candidate test task in the candidate test task set, replacing the test result corresponding to the candidate test task in the initial test result with the calibration result of the candidate test task, where the calibration result is generated by the distributed calibration algorithm of the HarmonyOS system.
7. The method according to claim 6, wherein The distributed automated test model includes: a state encoder, a task decoder, a feature calibration model, and a weight adjustment model; and generating an initial test result and test description information according to the test task allocation result and the pre-trained distributed automated test model includes: generating a state-encoded feature according to the state encoder and the test task allocation result; generating a task-decoded feature according to the task decoder and the state-encoded feature; generating a task-calibrated feature according to the feature calibration model and the task-decoded feature; generating a weight adjustment parameter according to the weight adjustment model and the test task allocation result; generating the initial test result and the test description information according to the weight adjustment parameter and the task-calibrated feature.
8. A distributed remote management and automated testing device based on the HarmonyOS, characterized in that Includes: A data acquisition unit, configured to obtain a set of target distributed device status data, where the set of target distributed device status data is pre-acquired operation status data for a Hongmeng device to be tested; a data optimization unit, configured to generate an optimized set of device status data according to the set of target distributed device status data, where the optimized device status data is data obtained by performing data cleaning and feature extraction on at least one set of target distributed device status data; a task scheduling unit, configured to perform distributed task scheduling on each piece of optimized device status data in the optimized set of device status data to generate a test task allocation result; a test generation unit, configured to generate an initial test result and test description information according to the test task allocation result and a pre-trained distributed automated test model, where the test description information includes: a set of test task description information, and the test task description information includes: task type, task feature vector, and task priority information, and the task priority information represents the priority of the test task corresponding to the test task description information in the distributed automated test; an execution unit, configured to perform the following processing steps for each piece of test task description information in the set of test task description information: determine whether there is a test task matching the test task description information in a pre-constructed distributed test task library according to the task type and task feature vector included in the test task description information; in response to the existence, determine the test task matching the test task description information as a candidate test task; a result calibration unit, configured to perform result calibration on the initial test result according to the obtained set of candidate test tasks to generate a calibrated test result.
9. An electronic device, characterized in that, Comprising: One or more processors; A storage device on which one or more programs are stored; when the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 7.
10. A computer-readable medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Test method and device, test equipment, network equipment, medium and program product
CN119576755A
System and method for functional testing of distributed, component-based software
US6505342B1