CN117573442A - Equipment testing method and device, storage medium and electronic device - Google Patents

Equipment testing method and device, storage medium and electronic device Download PDF

Info

Publication number
CN117573442A
CN117573442A CN202311353723.5A CN202311353723A CN117573442A CN 117573442 A CN117573442 A CN 117573442A CN 202311353723 A CN202311353723 A CN 202311353723A CN 117573442 A CN117573442 A CN 117573442A
Authority
CN
China
Prior art keywords
test
instruction
equipment
value
instructions
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202311353723.5A
Other languages
Chinese (zh)
Inventor
鲜文华
陈长运
尹德帅
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Qingdao Haier Technology Co Ltd
Haier Smart Home Co Ltd
Haier Uplus Intelligent Technology Beijing Co Ltd
Original Assignee
Qingdao Haier Technology Co Ltd
Haier Smart Home Co Ltd
Haier Uplus Intelligent Technology Beijing Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Qingdao Haier Technology Co Ltd, Haier Smart Home Co Ltd, Haier Uplus Intelligent Technology Beijing Co Ltd filed Critical Qingdao Haier Technology Co Ltd
Priority to CN202311353723.5A priority Critical patent/CN117573442A/en
Publication of CN117573442A publication Critical patent/CN117573442A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/22Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing
    • G06F11/2273Test methods

Landscapes

  • Engineering & Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Test And Diagnosis Of Digital Computers (AREA)

Abstract

The application discloses a device testing method and device, a storage medium and an electronic device, and relates to the technical field of smart families, wherein the device testing method comprises the following steps: testing the first equipment through a plurality of first test instructions to obtain a plurality of first test results of the first equipment; constructing an instruction set model of the first device according to the plurality of first test instructions and the plurality of first test results to obtain a virtual device of the first device, wherein the instruction set model is used for describing the virtual device; testing the virtual equipment through a second test instruction to obtain a second test result of the first equipment; by adopting the scheme, the problem that the test cost is high due to the fact that the test function is closely related to other subsystems and equipment in the related technology is solved.

Description

Equipment testing method and device, storage medium and electronic device
Technical Field
The application relates to the technical field of smart families, in particular to a device testing method and device, a storage medium and an electronic device.
Background
With the rapid development of business, a complete ecological environment of the Internet of things can be built, and the equipment of the Internet of things can reach tens or even hundreds. Most of the devices of the internet of things interact with other devices and network systems, so that the test function is closely related to other subsystems and devices, and the environment debugging cost is very high in the development and test process.
Aiming at the problems of higher test cost and the like caused by the close relation between the test function and other subsystems and equipment in the prior art, an effective solution is not proposed.
Disclosure of Invention
The embodiment of the invention provides a device testing method and device, a storage medium and an electronic device, which at least solve the problem of higher testing cost caused by the close relation between a testing function and other subsystems and devices in the prior art.
According to an embodiment of the present invention, there is provided an apparatus testing method including: testing the first equipment through a plurality of first test instructions to obtain a plurality of first test results of the first equipment; constructing an instruction set model of the first device according to the plurality of first test instructions and the plurality of first test results to obtain a virtual device of the first device, wherein the instruction set model is used for describing the virtual device; and testing the virtual equipment through a second test instruction to obtain a second test result of the first equipment.
In an exemplary embodiment, before the virtual device is tested by the second test instruction, the method further includes: counting the instruction values of the plurality of first test instructions to determine the effective instruction values of the first equipment; and generating the second test instruction according to the valid instruction value.
In an exemplary embodiment, counting instruction values of the plurality of first test instructions, determining a valid instruction value of the first device includes: determining a plurality of third test results with the first category as a first category in the plurality of first test results; determining a plurality of third test instructions corresponding to the plurality of third test results; and respectively counting the instruction value of each third test sub-instruction in the plurality of third test instructions to determine a first value range of the instruction value of each third test sub-instruction, and determining each first value range as a second value range of the effective instruction value.
In an exemplary embodiment, generating the second test instruction according to the valid instruction value includes: generating a fourth test instruction according to the second value range, wherein a third value range of the fourth test instruction is larger than the second value range, and a first difference value and a second difference value of the third value range and the second value range are smaller than a preset threshold value, wherein the first difference value is used for indicating the difference between the maximum value of the third value range and the maximum value of the second value range, and the second difference value is used for indicating the difference between the minimum value of the second value range and the minimum value of the third value range; determining a data type of the valid instruction value; correcting an abnormal instruction value contained in the fourth test instruction according to the data type to obtain the second test instruction, wherein the abnormal instruction value is an instruction value which does not accord with the data type.
In an exemplary embodiment, after constructing an instruction set model of the first device according to the plurality of first test instructions and the plurality of first test results, the method further includes: inputting a fifth test instruction into the instruction set model to obtain a fourth test result; and verifying the fourth test result through a fifth test result to verify whether the instruction set model is trained, wherein the fifth test result is an expected test result corresponding to the fifth test instruction.
In an exemplary embodiment, constructing an instruction set model of the first device according to the plurality of first test instructions and the plurality of first test results includes: determining first attribute names of a plurality of equipment attributes contained in the first equipment, wherein a plurality of first sub-test instructions contained in the first test instructions are in one-to-one correspondence with the plurality of equipment attributes; determining a plurality of standardized attribute names of the plurality of device attributes respectively; respectively standardizing a plurality of first attribute names contained in a plurality of second devices through the plurality of standardized attribute names, wherein the first devices comprise the plurality of second devices; and constructing the instruction set model according to the plurality of standardized attribute names.
In an exemplary embodiment, after normalizing the plurality of first attribute names contained in the plurality of second devices by the plurality of normalized attribute names, respectively, the method further includes: and storing the correspondence among the standardized attribute name, the equipment identifier of the second equipment and the first attribute name so as to determine the first attribute name of the second equipment through the standardized attribute name and the equipment identifier.
According to another embodiment of the present invention, there is also provided an apparatus testing device including: the first test module is used for testing the first equipment through a plurality of first test instructions to obtain a plurality of first test results of the first equipment; the building module is used for building an instruction set model of the first device according to the plurality of first test instructions and the plurality of first test results to obtain virtual devices of the first device, wherein the instruction set model is used for describing the virtual devices; and the second test module is used for testing the virtual equipment through a second test instruction to obtain a second test result of the first equipment.
According to yet another aspect of the embodiments of the present invention, there is also provided a computer-readable storage medium having a computer program stored therein, wherein the computer program is configured to perform the above-described device testing method when run.
According to still another aspect of the embodiments of the present invention, there is further provided an electronic apparatus including a memory, a processor, and a computer program stored on the memory and executable on the processor, wherein the processor executes the above-mentioned device testing method through the computer program.
In the embodiment of the application, a plurality of first test instructions are used for testing the first equipment in advance to obtain a plurality of first test results; then constructing an instruction set model of the first device according to the plurality of first test instructions and the plurality of first test results, so as to obtain virtual equipment of the first device, wherein the instruction set model is used for describing the virtual equipment; testing the virtual equipment by using a second test instruction to obtain a second test result of the first equipment; by adopting the scheme, the virtual equipment of the equipment is constructed through the historically accumulated test instructions and the result thereof, so that the equipment test process can be independently completed through the virtual equipment, and the dependence on real equipment (first equipment) in the test process is relieved; the problem of in the correlation technique test function with other subsystems, equipment relation is inseparable, leads to the test cost higher is solved.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the application and together with the description, serve to explain the principles of the application.
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings that are required to be used in the description of the embodiments or the prior art will be briefly described below, and it will be obvious to those skilled in the art that other drawings can be obtained from these drawings without inventive effort.
FIG. 1 is a schematic diagram of a hardware environment of an alternative device testing method according to an embodiment of the present application;
FIG. 2 is a flow chart of an alternative device testing method according to an embodiment of the invention;
FIG. 3 is a schematic diagram of a test flow of an alternative real plant according to an embodiment of the invention;
FIG. 4 is a schematic diagram of a data structure of an alternative test instruction set in accordance with an embodiment of the invention;
FIG. 5 is a schematic flow chart diagram of an alternative normalization of device attributes according to embodiments of the present invention;
FIG. 6 is a schematic diagram of an alternative access flow of a virtual device according to an embodiment of the invention;
FIG. 7 is a block diagram of an alternative device testing apparatus according to an embodiment of the present invention.
Detailed Description
In order to make the present application solution better understood by those skilled in the art, the following description will be made in detail and with reference to the accompanying drawings in the embodiments of the present application, it is apparent that the described embodiments are only some embodiments of the present application, not all embodiments. All other embodiments, which can be made by one of ordinary skill in the art based on the embodiments herein without making any inventive effort, shall fall within the scope of the present application.
It should be noted that the terms "first," "second," and the like in the description and claims of the present application and the above figures are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate such that embodiments of the present application described herein may be implemented in sequences other than those illustrated or otherwise described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
According to one aspect of the embodiments of the present application, a device testing method is provided. The equipment testing method is widely applied to full-house intelligent digital control application scenes such as intelligent Home (Smart Home), intelligent Home equipment ecology, intelligent Home (Intelligence House) ecology and the like. Alternatively, in the present embodiment, the above-described device testing method may be applied to a hardware environment constituted by the terminal device 102 and the server 104 as shown in fig. 1. As shown in fig. 1, the server 104 is connected to the terminal device 102 through a network, and may be used to provide services (such as application services and the like) for a terminal or a client installed on the terminal, a database may be set on the server or independent of the server, for providing data storage services for the server 104, and cloud computing and/or edge computing services may be configured on the server or independent of the server, for providing data computing services for the server 104.
The network may include, but is not limited to, at least one of: wired network, wireless network. The wired network may include, but is not limited to, at least one of: a wide area network, a metropolitan area network, a local area network, and the wireless network may include, but is not limited to, at least one of: WIFI (Wireless Fidelity ), bluetooth. The terminal device 102 may not be limited to a PC, a mobile phone, a tablet computer, an intelligent air conditioner, an intelligent smoke machine, a refrigerator device, an intelligent oven, an intelligent cooking range, an intelligent washing machine, an intelligent water heater, an intelligent washing device, an intelligent dish washer, an intelligent projection device, an intelligent television, an intelligent clothes hanger, an intelligent curtain, an intelligent video, an intelligent socket, an intelligent sound box, an intelligent fresh air device, an intelligent kitchen and toilet device, an intelligent bathroom device, an intelligent sweeping robot, an intelligent window cleaning robot, an intelligent mopping robot, an intelligent air purifying device, an intelligent steam box, an intelligent microwave oven, an intelligent kitchen appliance, an intelligent purifier, an intelligent water dispenser, an intelligent door lock, and the like.
In this embodiment, a device testing method is provided and applied to a computer terminal, and fig. 2 is a flowchart of an alternative device testing method according to an embodiment of the present invention, where the flowchart includes the following steps:
step S202, testing first equipment through a plurality of first test instructions to obtain a plurality of first test results of the first equipment;
as shown in fig. 3, fig. 3 depicts a Test flow of a real device (first device), the real device is tested by a plurality of Test cases (Test cases, which are equivalent to the first Test instructions described above), rule processing flows of the device corresponding to the Test cases are output, for example, the real device is tested by Test case function sets X1 and X2, and output device-related output instruction sets Y1 and Y2, respectively.
Step S204, an instruction set model of the first device is constructed according to the plurality of first test instructions and the plurality of first test results to obtain a virtual device of the first device, wherein the instruction set model is used for describing the virtual device;
after the virtual device is constructed, the virtual device can be stored as a digital asset, and can be used for testing in the subsequent development process at any time, so that the digital asset is effectively accumulated.
And step S206, testing the virtual equipment through a second test instruction to obtain a second test result of the first equipment.
It should be noted that the second test instruction may be obtained from the plurality of first test instructions, or may be generated separately, which is not limited in this application.
In the embodiment of the application, a plurality of first test instructions are used for testing the first equipment in advance to obtain a plurality of first test results; then constructing an instruction set model of the first device according to the plurality of first test instructions and the plurality of first test results, so as to obtain virtual equipment of the first device, wherein the instruction set model is used for describing the virtual equipment; testing the virtual equipment by using a second test instruction to obtain a second test result of the first equipment; by adopting the scheme, the virtual equipment of the equipment is constructed through the historically accumulated test instructions and the result thereof, so that the equipment test process can be independently completed through the virtual equipment, and the dependence on real equipment (first equipment) in the test process is relieved; the problem of in the correlation technique test function with other subsystems, equipment relation is inseparable, leads to the test cost higher is solved.
Optionally, the above step S206 is performed: before the virtual device is tested through the second test instruction, the method further comprises: counting the instruction values of the plurality of first test instructions to determine the effective instruction values of the first equipment; and generating the second test instruction according to the valid instruction value.
If the second test instruction is to be generated, the test instruction capable of achieving the test effect is required to be generated according to the real situation of the equipment, so that the instruction values of the plurality of first test instructions are required to be counted, and the effective instruction value of the first equipment is determined, namely, the digital interval in which the effective instruction value is located is determined or the effective instruction is enumerated; the first test instruction is then generated based on the valid instruction value.
Optionally, the step of counting: the statistics of the instruction values of the plurality of first test instructions and the determination of the effective instruction value of the first device can be realized by the following scheme, which specifically comprises the following steps: determining a plurality of third test results with the first category as a first category in the plurality of first test results; determining a plurality of third test instructions corresponding to the plurality of third test results; and respectively counting the instruction value of each third test sub-instruction in the plurality of third test instructions to determine a first value range of the instruction value of each third test sub-instruction, and determining each first value range as a second value range of the effective instruction value.
The process of determining the valid instruction value of the first device comprises: firstly, determining a plurality of third test results in a first category from the plurality of first test results, wherein the first category test results can be test passing or test effective test results; and then determining a plurality of third test instructions corresponding to the plurality of third test results, respectively counting the instruction values of a plurality of third test sub-instructions contained in the plurality of third test instructions, determining a first value range according to the instruction values of the third test sub-instructions, and forming a second value range of the effective instruction value by the first value ranges of all the third test sub-instructions contained in the third test instructions.
For example, the instruction set for testing the water outlet function includes: child lock state, water yield, temperature, water outlet switch, etc., child lock state (effective instruction value) includes 1 or 0; the effective instruction value range of the water yield is 0-200, the effective range of the temperature is 25-100, and the water outlet switch is 1 or 0; the third test instruction is a set of test instructions corresponding to a water outlet switch of 1 and a water outlet result of 1, for example, a set of instructions is {1,20000,21,1} (corresponding to the four sub-instructions respectively), and the water outlet result of 0 proves that the set of instructions does not belong to the third test instruction; and the other group of instructions are {1,20,21,1}, the water outlet result is 1, so that an effective value of the water outlet is 20, the child lock state is 1, the temperature is 21, the water outlet switch is 1, the effective value range of each test sub-instruction is determined through accumulation of a large number of test results, and finally, the second value range of the effective instruction value is determined.
Taking the water-out function as an example, the instruction set in the test procedure may form an m×n instruction matrix as shown in fig. 4, where M represents a column (functional feature), N represents a row (test sample), and the column may be further divided into X, Y, X is input (input variable), and Y is output (output result). First, X represents the pre-dependency at output Y, namely the feature, independent variable and input variable. Y represents the results, namely class labels, dependent variables and output variables. In fig. 4, the water outlet 20000 and the temperature 120 are both data exceeding the normal command value range, so the water outlet result is 0.
Optionally, the generating step includes: generating the second test instruction according to the valid instruction value may be achieved by: generating a fourth test instruction according to the second value range, wherein a third value range of the fourth test instruction is larger than the second value range, and a first difference value and a second difference value of the third value range and the second value range are smaller than a preset threshold value, wherein the first difference value is used for indicating the difference between the maximum value of the third value range and the maximum value of the second value range, and the second difference value is used for indicating the difference between the minimum value of the second value range and the minimum value of the third value range; determining a data type of the valid instruction value; correcting an abnormal instruction value contained in the fourth test instruction according to the data type to obtain the second test instruction, wherein the abnormal instruction value is an instruction value which does not accord with the data type.
The process of generating the second test instruction according to the valid instruction value includes: generating a fourth test instruction according to the second value range, wherein a third value range of the fourth test instruction is larger than the second value range, and the difference between the maximum value and the minimum value of the third value range and the second value range is smaller than a preset threshold; then determining the data type of the effective instruction value, correcting the abnormal instruction value according to the data type, for example, the water outlet switch is 0,1, and the decimal such as 0.1 appears in the test instruction, so that the data needs to be corrected; thereby obtaining a second test instruction.
It will be appreciated that when testing a device, some error instructions are also required to be used to test the device, so as to check whether the response of the device to the error instructions is normal, and therefore, after determining the second value range of the valid instruction value, the value range of the generated test instruction needs to be properly beyond the second value range, for example, the valid instruction value range of the water yield is 0-200, and the test instruction can be abnormal data such as-1, 210, etc.
Based on the above steps, the above step S204 is performed: after constructing an instruction set model of the first device according to the plurality of first test instructions and the plurality of first test results, the method further includes: inputting a fifth test instruction into the instruction set model to obtain a fourth test result; and verifying the fourth test result through a fifth test result to verify whether the instruction set model is trained, wherein the fifth test result is an expected test result corresponding to the fifth test instruction.
After the instruction set model is constructed, the model needs to be verified to determine whether the model is trained, so that a fifth test instruction needs to be input into the instruction set model to obtain a fourth test result, the fourth test result is verified by using the fifth test result to verify whether the instruction set model is trained, and if the instruction set model is not trained, the model needs to be trained continuously.
In the whole scheme, the data set can be segmented according to the proportion of 60% of the training set, 20% of the verification set and 20% of the test set, namely, 60% of the data set is adopted for model training, 20% of the data is adopted for model verification, and then 20% of the data is adopted for device testing. The above ratio data is a preferable scheme, and other ratios are also possible, which is not limited in this application.
Optionally, step S204 is as follows: the implementation scheme for constructing the instruction set model of the first device according to the plurality of first test instructions and the plurality of first test results may include: determining first attribute names of a plurality of equipment attributes contained in the first equipment, wherein a plurality of first sub-test instructions contained in the first test instructions are in one-to-one correspondence with the plurality of equipment attributes; determining a plurality of standardized attribute names of the plurality of device attributes respectively; respectively standardizing a plurality of first attribute names contained in a plurality of second devices through the plurality of standardized attribute names, wherein the first devices comprise the plurality of second devices; and constructing the instruction set model according to the plurality of standardized attribute names.
For the devices of the same type but different types, the definitions of the device attribute names may be different, that is, there is a difference in the device attribute definitions, so if a virtual device suitable for the devices of the same type and different types of devices is to be constructed, the device attribute needs to be standardized first, and a plurality of first attribute names contained in each of a plurality of device attributes contained in a first device of the same type are determined first, wherein a plurality of first sub-test instructions contained in the first test instruction are in one-to-one correspondence with the plurality of device attributes; and then respectively determining a plurality of standardized attribute names of the plurality of equipment attributes, namely determining the standardized attribute name of each equipment attribute, and normalizing the first attribute names contained in a plurality of second equipment by the standardized attribute name.
As shown in fig. 5, for the same attribute of the same type of device, such as a water outlet problem, the names defined by the device attribute include multiple types, such as curTemperature, currentTemperature, targetTemperature, temperature, and the names of the multiple types of attributes are unified into currentTempotent (i.e. standardized attribute names) through the operation logic F.
After the Virtual Device is constructed, the Virtual Device can be applied to Device test, as shown in fig. 6, in the prior art, the Device capability is accessed through the plug-in SDK, and the Virtual Device is accessed through the plug-in SDK according to the real Device, so that the dependence of using the real Device test is reduced, the uncertainty when the SDK calls the real Device is reduced, and the effect of isolating the Device is achieved.
Based on the above steps, after the plurality of first attribute names contained in the plurality of second devices are respectively normalized by the plurality of normalized attribute names, the method further includes: and storing the correspondence among the standardized attribute name, the equipment identifier of the second equipment and the first attribute name so as to determine the first attribute name of the second equipment through the standardized attribute name and the equipment identifier.
The normalization is only used for constructing the virtual device, and does not change the real attribute name of the real device, so that the correspondence relationship among the device identifier of the second device, the normalized attribute name and the first attribute name (i.e., the real attribute name of the second device) needs to be saved, so that the corresponding second device can be found when needed in the subsequent test.
From the description of the above embodiments, it will be clear to a person skilled in the art that the method according to the above embodiments may be implemented by means of software plus the necessary general hardware platform, but of course also by means of hardware, but in many cases the former is a preferred embodiment. Based on such understanding, the technical solution of the present invention may be embodied essentially or in a part contributing to the prior art in the form of a software product stored in a storage medium (e.g. ROM/RAM, magnetic disk, optical disk) comprising several instructions for causing a terminal device (which may be a mobile phone, a computer, a server, or a network device, etc.) to perform the method of the various embodiments of the present invention.
In this embodiment, an apparatus testing device is further provided, and the apparatus testing device is used to implement the foregoing embodiments and preferred embodiments, and is not described in detail. As used below, the term "module" may be a combination of software and/or hardware that implements a predetermined function. While the means described in the following embodiments are preferably implemented in software, implementation in hardware, or a combination of software and hardware, is also possible and contemplated.
FIG. 7 is a block diagram of an alternative device testing apparatus in accordance with an embodiment of the present invention; as shown in fig. 7, includes:
a first testing module 72, configured to test a first device by using a plurality of first testing instructions, to obtain a plurality of first test results of the first device;
a building module 74, configured to build an instruction set model of the first device according to the plurality of first test instructions and the plurality of first test results, so as to obtain a virtual device of the first device, where the instruction set model is used to describe the virtual device;
after the virtual device is constructed, the virtual device can be stored as a digital asset, and can be used for testing in the subsequent development process at any time, so that the digital asset is effectively accumulated.
And a second test module 76, configured to test the virtual device through a second test instruction, so as to obtain a second test result of the first device.
It should be noted that the second test instruction may be obtained from the plurality of first test instructions, or may be generated separately, which is not limited in this application.
Through the device, the first equipment is tested in advance by using a plurality of first test instructions, and a plurality of first test results are obtained; then constructing an instruction set model of the first device according to the plurality of first test instructions and the plurality of first test results, so as to obtain virtual equipment of the first device, wherein the instruction set model is used for describing the virtual equipment; testing the virtual equipment by using a second test instruction to obtain a second test result of the first equipment; by adopting the scheme, the virtual equipment of the equipment is constructed through the historically accumulated test instructions and the result thereof, so that the equipment test process can be independently completed through the virtual equipment, and the dependence on real equipment (first equipment) in the test process is relieved; the problem of in the correlation technique test function with other subsystems, equipment relation is inseparable, leads to the test cost higher is solved.
Optionally, the second test module 76 is further configured to count instruction values of the plurality of first test instructions, and determine valid instruction values of the first device; and generating the second test instruction according to the valid instruction value.
If the second test instruction is to be generated, the test instruction capable of achieving the test effect is required to be generated according to the real situation of the equipment, so that the instruction values of the plurality of first test instructions are required to be counted, and the effective instruction value of the first equipment is determined, namely, the digital interval in which the effective instruction value is located is determined or the effective instruction is enumerated; the first test instruction is then generated based on the valid instruction value.
Optionally, the second test module 76 is further configured to determine a plurality of third test results of the plurality of first test results classified as the first class; determining a plurality of third test instructions corresponding to the plurality of third test results; and respectively counting the instruction value of each third test sub-instruction in the plurality of third test instructions to determine a first value range of the instruction value of each third test sub-instruction, and determining each first value range as a second value range of the effective instruction value.
The process of determining the valid instruction value of the first device comprises: firstly, determining a plurality of third test results in a first category from the plurality of first test results, wherein the first category test results can be test passing or test effective test results; and then determining a plurality of third test instructions corresponding to the plurality of third test results, respectively counting the instruction values of a plurality of third test sub-instructions contained in the plurality of third test instructions, determining a first value range according to the instruction values of the third test sub-instructions, and forming a second value range of the effective instruction value by the first value ranges of all the third test sub-instructions contained in the third test instructions.
For example, the instruction set for testing the water outlet function includes: child lock state, water yield, temperature, water outlet switch, etc., child lock state (effective instruction value) includes 1 or 0; the effective instruction value range of the water yield is 0-200, the effective range of the temperature is 25-100, and the water outlet switch is 1,0; the third test instruction is a set of test instructions corresponding to a water outlet switch of 1 and a water outlet result of 1, for example, a set of instructions is {1,20000,21,1} (corresponding to the four sub-instructions respectively), and the water outlet result of 0 proves that the set of instructions does not belong to the third test instruction; and the other group of instructions are {1,20,21,1}, the water outlet result is 1, so that an effective value of the water outlet is 20, the child lock state is 1, the temperature is 21, the water outlet switch is 1, the effective value range of each test sub-instruction is determined through accumulation of a large number of test results, and finally, the second value range of the effective instruction value is determined.
Optionally, the second test module 76 is further configured to generate a fourth test instruction according to the second value range, where a third value range of the fourth test instruction is greater than the second value range, and a first difference value and a second difference value of the third value range and the second value range are both less than a preset threshold, where the first difference value is used to indicate a difference between a maximum value of the third value range and a maximum value of the second value range, and the second difference value is used to indicate a difference between a minimum value of the second value range and a minimum value of the third value range; determining a data type of the valid instruction value; correcting an abnormal instruction value contained in the fourth test instruction according to the data type to obtain the second test instruction, wherein the abnormal instruction value is an instruction value which does not accord with the data type.
The process of generating the second test instruction according to the valid instruction value includes: generating a fourth test instruction according to the second value range, wherein a third value range of the fourth test instruction is larger than the second value range, and the difference between the maximum value and the minimum value of the third value range and the second value range is smaller than a preset threshold; then determining the data type of the effective instruction value, correcting the abnormal instruction value according to the data type, for example, the water outlet switch is 0,1, and the decimal such as 0.1 appears in the test instruction, so that the data needs to be corrected; thereby obtaining a second test instruction.
It will be appreciated that when testing a device, some error instructions are also required to be used to test the device, so as to check whether the response of the device to the error instructions is normal, and therefore, after determining the second value range of the valid instruction value, the value range of the generated test instruction needs to be properly beyond the second value range, for example, the valid instruction value range of the water yield is 0-200, and the test instruction can be abnormal data such as-1, 210, etc.
Optionally, the building module 74 is further configured to input a fifth test instruction into the instruction set model to obtain a fourth test result; and verifying the fourth test result through a fifth test result to verify whether the instruction set model is trained, wherein the fifth test result is an expected test result corresponding to the fifth test instruction.
After the instruction set model is constructed, the model needs to be verified to determine whether the model is trained, so that a fifth test instruction needs to be input into the instruction set model to obtain a fourth test result, the fourth test result is verified by using the fifth test result to verify whether the instruction set model is trained, and if the instruction set model is not trained, the model needs to be trained continuously.
In the whole scheme, the data set can be segmented according to the proportion of 60% of the training set, 20% of the verification set and 20% of the test set, namely, 60% of the data set is adopted for model training, 20% of the data is adopted for model verification, and then 20% of the data is adopted for device testing. The above ratio data is a preferable scheme, and other ratios are also possible, which is not limited in this application.
Optionally, the building module 74 is further configured to determine a first attribute name of a plurality of device attributes included in the first device, where a plurality of first subtest instructions included in the first test instruction are in one-to-one correspondence with the plurality of device attributes; determining a plurality of standardized attribute names of the plurality of device attributes respectively; respectively standardizing a plurality of first attribute names contained in a plurality of second devices through the plurality of standardized attribute names, wherein the first devices comprise the plurality of second devices; and constructing the instruction set model according to the plurality of standardized attribute names.
For the devices of the same type but different types, the definitions of the device attribute names may be different, that is, there is a difference in the device attribute definitions, so if a virtual device suitable for the devices of the same type and different types of devices is to be constructed, the device attribute needs to be standardized first, and a plurality of first attribute names contained in each of a plurality of device attributes contained in a first device of the same type are determined first, wherein a plurality of first sub-test instructions contained in the first test instruction are in one-to-one correspondence with the plurality of device attributes; and then respectively determining a plurality of standardized attribute names of the plurality of equipment attributes, namely determining the standardized attribute name of each equipment attribute, and normalizing the first attribute names contained in a plurality of second equipment by the standardized attribute name.
Optionally, the building module 74 is further configured to store a correspondence between the standardized attribute name, a device identifier of the second device, and the first attribute name, so as to determine the first attribute name of the second device through the standardized attribute name and the device identifier.
The normalization is only used for constructing the virtual device, and does not change the real attribute name of the real device, so that the correspondence relationship among the device identifier of the second device, the normalized attribute name and the first attribute name (i.e., the real attribute name of the second device) needs to be saved, so that the corresponding second device can be found when needed in the subsequent test.
An embodiment of the present invention also provides a storage medium including a stored program, wherein the program executes the method of any one of the above.
Alternatively, in the present embodiment, the above-described storage medium may be configured to store program code for performing the steps of:
s1, testing first equipment through a plurality of first test instructions to obtain a plurality of first test results of the first equipment;
s2, constructing an instruction set model of the first device according to the plurality of first test instructions and the plurality of first test results to obtain virtual devices of the first device, wherein the instruction set model is used for describing the virtual devices;
s3, testing the virtual equipment through a second test instruction to obtain a second test result of the first equipment.
An embodiment of the invention also provides an electronic device comprising a memory having stored therein a computer program and a processor arranged to run the computer program to perform the steps of any of the method embodiments described above.
Optionally, the electronic apparatus may further include a transmission device and an input/output device, where the transmission device is connected to the processor, and the input/output device is connected to the processor.
Alternatively, in the present embodiment, the above-described processor may be configured to execute the following steps by a computer program:
s1, testing first equipment through a plurality of first test instructions to obtain a plurality of first test results of the first equipment;
s2, constructing an instruction set model of the first device according to the plurality of first test instructions and the plurality of first test results to obtain virtual devices of the first device, wherein the instruction set model is used for describing the virtual devices;
s3, testing the virtual equipment through a second test instruction to obtain a second test result of the first equipment.
Alternatively, in the present embodiment, the storage medium may include, but is not limited to: a U-disk, a Read-Only Memory (ROM), a random access Memory (Random Access Memory, RAM), a removable hard disk, a magnetic disk, or an optical disk, or other various media capable of storing program codes.
Alternatively, specific examples in this embodiment may refer to examples described in the foregoing embodiments and optional implementations, and this embodiment is not described herein.
It will be appreciated by those skilled in the art that the modules or steps of the invention described above may be implemented in a general purpose computing device, they may be concentrated on a single computing device, or distributed across a network of computing devices, they may alternatively be implemented in program code executable by computing devices, so that they may be stored in a memory device for execution by computing devices, and in some cases, the steps shown or described may be performed in a different order than that shown or described, or they may be separately fabricated into individual integrated circuit modules, or multiple modules or steps within them may be fabricated into a single integrated circuit module for implementation. Thus, the present invention is not limited to any specific combination of hardware and software.
The above description is only of the preferred embodiments of the present invention and is not intended to limit the present invention, but various modifications and variations can be made to the present invention by those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the principle of the present invention should be included in the protection scope of the present invention.

Claims (10)

1. A method of device testing, comprising:
testing the first equipment through a plurality of first test instructions to obtain a plurality of first test results of the first equipment;
constructing an instruction set model of the first device according to the plurality of first test instructions and the plurality of first test results to obtain a virtual device of the first device, wherein the instruction set model is used for describing the virtual device;
and testing the virtual equipment through a second test instruction to obtain a second test result of the first equipment.
2. The device testing method of claim 1, wherein prior to testing the virtual device by the second test instruction, the method further comprises:
counting the instruction values of the plurality of first test instructions to determine the effective instruction values of the first equipment;
and generating the second test instruction according to the valid instruction value.
3. The device testing method of claim 2, wherein counting the instruction values of the plurality of first test instructions to determine the valid instruction values of the first device comprises:
determining a plurality of third test results with the first category as a first category in the plurality of first test results;
determining a plurality of third test instructions corresponding to the plurality of third test results;
and respectively counting the instruction value of each third test sub-instruction in the plurality of third test instructions to determine a first value range of the instruction value of each third test sub-instruction, and determining each first value range as a second value range of the effective instruction value.
4. The device testing method of claim 3, wherein generating the second test instruction from the valid instruction value comprises:
generating a fourth test instruction according to the second value range, wherein a third value range of the fourth test instruction is larger than the second value range, and a first difference value and a second difference value of the third value range and the second value range are smaller than a preset threshold value, wherein the first difference value is used for indicating the difference between the maximum value of the third value range and the maximum value of the second value range, and the second difference value is used for indicating the difference between the minimum value of the second value range and the minimum value of the third value range;
determining a data type of the valid instruction value;
correcting an abnormal instruction value contained in the fourth test instruction according to the data type to obtain the second test instruction, wherein the abnormal instruction value is an instruction value which does not accord with the data type.
5. The device testing method of claim 1, wherein after constructing an instruction set model of the first device from the plurality of first test instructions and the plurality of first test results, the method further comprises:
inputting a fifth test instruction into the instruction set model to obtain a fourth test result;
and verifying the fourth test result through a fifth test result to verify whether the instruction set model is trained, wherein the fifth test result is an expected test result corresponding to the fifth test instruction.
6. The device testing method of claim 1, wherein constructing an instruction set model of the first device from the plurality of first test instructions and the plurality of first test results comprises:
determining first attribute names of a plurality of equipment attributes contained in the first equipment, wherein a plurality of first sub-test instructions contained in the first test instructions are in one-to-one correspondence with the plurality of equipment attributes;
determining a plurality of standardized attribute names of the plurality of device attributes respectively;
respectively standardizing a plurality of first attribute names contained in a plurality of second devices through the plurality of standardized attribute names, wherein the first devices comprise the plurality of second devices;
and constructing the instruction set model according to the plurality of standardized attribute names.
7. The device testing method of claim 6, wherein after normalizing the plurality of first attribute names included in the plurality of second devices by the plurality of normalized attribute names, respectively, the method further comprises:
and storing the correspondence among the standardized attribute name, the equipment identifier of the second equipment and the first attribute name so as to determine the first attribute name of the second equipment through the standardized attribute name and the equipment identifier.
8. A device testing apparatus, comprising:
the first test module is used for testing the first equipment through a plurality of first test instructions to obtain a plurality of first test results of the first equipment;
the building module is used for building an instruction set model of the first device according to the plurality of first test instructions and the plurality of first test results to obtain virtual devices of the first device, wherein the instruction set model is used for describing the virtual devices;
and the second test module is used for testing the virtual equipment through a second test instruction to obtain a second test result of the first equipment.
9. A computer-readable storage medium, characterized in that the computer-readable storage medium comprises a stored program, wherein the program, when run, performs the method of any one of claims 1 to 7.
10. An electronic device comprising a memory and a processor, characterized in that the memory has stored therein a computer program, the processor being arranged to execute the method according to any of the claims 1 to 7 by means of the computer program.
CN202311353723.5A 2023-10-17 2023-10-17 Equipment testing method and device, storage medium and electronic device Pending CN117573442A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311353723.5A CN117573442A (en) 2023-10-17 2023-10-17 Equipment testing method and device, storage medium and electronic device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311353723.5A CN117573442A (en) 2023-10-17 2023-10-17 Equipment testing method and device, storage medium and electronic device

Publications (1)

Publication Number Publication Date
CN117573442A true CN117573442A (en) 2024-02-20

Family

ID=89859624

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311353723.5A Pending CN117573442A (en) 2023-10-17 2023-10-17 Equipment testing method and device, storage medium and electronic device

Country Status (1)

Country Link
CN (1) CN117573442A (en)

Similar Documents

Publication Publication Date Title
CN110209551B (en) Abnormal equipment identification method and device, electronic equipment and storage medium
CN116881752A (en) Data clustering method and device, storage medium and electronic equipment
CN116107975A (en) Control method and device of equipment, storage medium and electronic device
CN117573442A (en) Equipment testing method and device, storage medium and electronic device
CN116027937A (en) Rendering method and device of component to be edited, storage medium and electronic device
CN115934523A (en) Target test data generation method and device, storage medium and electronic device
CN114840557A (en) Data query method and device, storage medium and electronic device
CN115345225A (en) Method and device for determining recommended scene, storage medium and electronic device
CN116360584A (en) Virtual target product generation method and device, storage medium and electronic device
CN115291793A (en) Attribute data conversion method and device, storage medium and electronic device
CN114861678A (en) Method and apparatus for determining time information, storage medium, and electronic apparatus
CN116467173A (en) Method and device for determining key test, storage medium and electronic device
CN117743394A (en) Running state comparison method and device, storage medium and electronic device
CN116756480A (en) Data statistics method and device, storage medium and electronic device
CN116451140A (en) Method and device for determining type information, storage medium and electronic device
CN115296958B (en) Distribution method and device of equipment control tasks, storage medium and electronic device
CN117749549A (en) Equipment operation method and device, storage medium and electronic device
CN117573237A (en) Verification result determining method and device, storage medium and electronic device
CN116540998A (en) Statistical data determining method and device, storage medium and electronic device
CN116383042A (en) Method and device for determining module to be tested, storage medium and electronic device
CN117909872A (en) Method and device for determining classification result, storage medium and electronic device
CN117891490A (en) Method, system, electronic equipment and storage medium for configuring components
CN114880364A (en) Target behavior prediction method and device, storage medium and electronic device
CN116301767A (en) Interface file generation method and device, storage medium and electronic device
CN117579409A (en) Control instruction processing method and device, storage medium and electronic device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination