CN115460117A - Device testing method and apparatus, storage medium, and electronic apparatus - Google Patents

Device testing method and apparatus, storage medium, and electronic apparatus Download PDF

Info

Publication number
CN115460117A
CN115460117A CN202210916789.XA CN202210916789A CN115460117A CN 115460117 A CN115460117 A CN 115460117A CN 202210916789 A CN202210916789 A CN 202210916789A CN 115460117 A CN115460117 A CN 115460117A
Authority
CN
China
Prior art keywords
target
test
result
equipment
target virtual
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
CN202210916789.XA
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
Original Assignee
Qingdao Haier Technology Co Ltd
Haier Smart Home 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 filed Critical Qingdao Haier Technology Co Ltd
Priority to CN202210916789.XA priority Critical patent/CN115460117A/en
Publication of CN115460117A publication Critical patent/CN115460117A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L43/00Arrangements for monitoring or testing data switching networks
    • H04L43/12Network monitoring probes
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/30Semantic analysis

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computational Linguistics (AREA)
  • Health & Medical Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Signal Processing (AREA)
  • General Health & Medical Sciences (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The application discloses an equipment testing method and device, a storage medium and an electronic device, and relates to the technical field of intelligent home, wherein the equipment testing method comprises the following steps: under the condition of acquiring target information of the to-be-tested equipment, generating target virtual equipment based on the target information; receiving a target test text for interactively testing the target virtual equipment, and performing semantic analysis on the target test text to obtain a semantic analysis result; and performing interactive test on the target virtual equipment based on the semantic analysis result to generate a test result, wherein the test result comprises the running state and the execution result of the target virtual equipment. The problem that the efficiency of the equipment testing method in the related technology is low can be solved, and the effect of improving the equipment testing efficiency is achieved.

Description

Device testing method and apparatus, storage medium, and electronic apparatus
Technical Field
The application relates to the technical field of smart home, in particular to a device testing method and device, a storage medium and an electronic device.
Background
In the field of equipment control, because a plurality of devices are supported, the test work on the devices is heavier and heavier, and in the current test link, a tester needs to face each real device to interact with the devices, so that the function test is performed. Similarly, developers also need to face each real device to interact with each other before self-testing the functions. Therefore, voice interaction is performed on a real machine during testing in the related art, and the testing method has many disadvantages, for example, it is necessary to rely on the entity home appliance device to cover all categories, and all devices cannot be taken for real machine testing during testing, so that all devices cannot be comprehensively tested, and thus, the safety of a project is affected; the waste of manpower resources, because the real machine needs to be switched continuously, the workload is relatively large; and the limit to the testing place, the tester must be at the place of the equipment to test face to face, and the testing cannot be carried out at any time and any place. That is, the device testing method in the related art has a problem of low efficiency.
Aiming at the problem of low efficiency of the equipment testing method in the related technology, no effective solution is provided at present.
Disclosure of Invention
The embodiment of the application provides a device testing method and device, a storage medium and an electronic device, so as to at least solve the problem that the device testing method in the related art is low in efficiency.
According to an embodiment of the present application, there is provided an apparatus testing method including: under the condition of acquiring target information of a device to be tested, generating target virtual equipment based on the target information; receiving a target test text for interactively testing the target virtual equipment, and performing semantic analysis on the target test text to obtain a semantic analysis result; and performing interactive test on the target virtual equipment based on the semantic parsing result to generate a test result, wherein the test result comprises the running state and the execution result of the target virtual equipment.
In an exemplary embodiment, performing semantic parsing on the target test text to obtain a semantic parsing result, including: performing semantic parsing on the target test text through Natural Language Processing (NLP) to obtain a semantic parsing result, wherein the semantic parsing result comprises a test type indicated by a corpus contained in the target test text; performing interactive test on the target virtual device based on the semantic parsing result, including: and performing interactive test on the target virtual equipment based on the test type.
In an exemplary embodiment, interactively testing the target virtual device based on the test type includes: under the condition that the test type is determined to be a device control type, performing the interactive test on the target virtual device in a mode of controlling the target virtual device based on the control operation indicated by the semantic parsing result; performing the interactive test on the target virtual device by performing the following operations under the condition that the test type is determined to be a third party type: and calling a third-party service to execute the operation indicated by the semantic analysis result, acquiring an execution result fed back by the third-party service, and displaying the execution result.
In an exemplary embodiment, performing an interactive test on the target virtual device based on the semantic parsing result, and generating a test result includes: performing interactive test on the target virtual equipment based on a target attribute field included in the semantic analysis result to obtain the running state, wherein the target attribute field is used for indicating that a target attribute corresponding to the target attribute field of the target virtual equipment is operated; and comparing the running state with a target result field included in the semantic parsing result to obtain the execution result, wherein the execution result is used for indicating whether the interaction test is successful, and the target result field is used for indicating a result of operating the target attribute of the target virtual device.
In an exemplary embodiment, comparing the running state with a target result field included in the semantic parsing result to obtain the execution result includes: comparing the running state with the target result field to obtain a comparison result; determining that the interaction test is successful under the condition that the comparison result indicates that the running state is consistent with the target result field; the method further comprises the following steps: and displaying the test result, wherein the test result comprises a target state code, and the target state code is used for indicating the execution result of the interactive test.
In an exemplary embodiment, in a case that target information of a device to be tested is obtained, generating a target virtual device based on the target information includes: under the condition that a request instruction for requesting to add test equipment is received, popping up a target window, wherein the request instruction is triggered after a first preset operation is executed on a specified control on a target page; and under the condition that the target information is detected to be input in the target window and the target information exists in a target information resource library, generating the target virtual equipment and adding the target virtual equipment into a target equipment list, wherein the target information resource library is pre-established and stores information of a plurality of equipment including the target information.
In an exemplary embodiment, interactively testing the target virtual device based on the semantic parsing result includes: under the condition that the target test text is determined to be a text containing a plurality of corpora, sequentially carrying out interactive test on the target virtual equipment on the basis of a plurality of semantic analysis results obtained by carrying out semantic analysis on the plurality of corpora; or, when the target virtual device includes a plurality of virtual devices, sequentially performing an interactive test on the plurality of virtual devices based on one or more semantic parsing results obtained by performing semantic parsing on one or more corpora included in the target test text.
According to another embodiment of the present application, there is also provided an apparatus testing device, including: the generating module is used for generating target virtual equipment based on target information under the condition of acquiring the target information of the equipment to be tested; the processing module is used for receiving a target test text for interactively testing the target virtual equipment and performing semantic analysis on the target test text to obtain a semantic analysis result; and the test module is used for carrying out interactive test on the target virtual equipment based on the semantic analysis result to generate a test result, and the test result comprises the running state and the execution result of the target virtual equipment.
There is also provided, in accordance with yet another embodiment of the present application, a computer-readable storage medium including a stored program, wherein the program when executed performs the steps in any one of the method embodiments described above.
According to a further embodiment of the embodiments of the present application, there is also provided an electronic device, including a memory and a processor, the memory having a computer program stored therein, the processor being configured to perform the steps of any of the method embodiments described above by means of the computer program.
According to the method and the device, under the condition that the target information of the device to be tested is obtained, the target virtual device is generated based on the target information, the target test text for interactively testing the target virtual device is received, the semantic analysis is carried out on the target test text to obtain a semantic analysis result, then the target virtual device is interactively tested based on the semantic analysis result, and the test result is generated and comprises the running state and the execution result of the target virtual device. The target virtual device is generated based on the target information of the device to be tested, the target virtual device is interactively tested through the semantic analysis result obtained by analyzing the received target test text, and the problems of large workload and waste of human resources caused by the fact that real devices need to be tested in the related technology are solved. The invention solves the problem of lower efficiency of the equipment testing method in the related technology and achieves the effect of improving the equipment testing efficiency.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present 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 used in the description of the embodiments or the prior art will be briefly described below, and it is obvious for those skilled in the art to obtain other drawings without inventive labor.
Fig. 1 is a hardware environment schematic diagram of an interaction method of smart home devices according to an embodiment of the present application;
FIG. 2 is a flow chart of a method of testing a device according to an embodiment of the present application;
FIG. 3 is a flow diagram of a device interaction test according to an embodiment of the present application;
FIG. 4 is a block diagram of an apparatus testing device according to an embodiment of the present application;
fig. 5 is a block diagram of a preferred structure of a device testing apparatus according to an embodiment of the present application.
Detailed Description
In order to make the technical solutions better understood by those skilled in the art, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only partial embodiments of the present application, but not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
It should be noted that the terms "first," "second," and the like in the description and claims of this application and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the application described herein are capable of operation in sequences other than those illustrated or 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 embodiment of the application, an interaction method of intelligent household equipment is provided. The interaction method of the intelligent Home equipment is widely applied to full-House intelligent digital control application scenes such as intelligent homes (Smart Home), intelligent homes, intelligent Home equipment ecology, intelligent House (Intelligent House) ecology and the like. Optionally, in this embodiment, the interaction method of the smart home device may be applied to a hardware environment formed 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 configured to provide a service (e.g., an application service) for the terminal or a client installed on the terminal, set a database on the server or independent of the server, and provide a data storage service for the server 104, and configure a cloud computing and/or edge computing service on the server or independent of the server, and provide a data operation service 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: wide area networks, metropolitan area networks, local area networks, which may include, but are not limited to, at least one of the following: WIFI (Wireless Fidelity), bluetooth. Terminal equipment 102 can be but not limited to be PC, the cell-phone, the panel computer, intelligent air conditioner, intelligent cigarette machine, intelligent refrigerator, intelligent oven, intelligent kitchen range, intelligent washing machine, intelligent water heater, intelligent washing equipment, intelligent dish washer, intelligent projection equipment, intelligent TV, intelligent clothes hanger, intelligent (window) curtain, intelligence audio-visual, smart jack, intelligent stereo set, intelligent audio amplifier, intelligent new trend equipment, intelligent kitchen guarding equipment, intelligent bathroom equipment, intelligence robot of sweeping the floor, intelligence robot of wiping the window, intelligence robot of mopping the ground, intelligent air purification equipment, intelligent steam ager, intelligent microwave oven, intelligent kitchen is precious, intelligent clarifier, intelligent water dispenser, intelligent lock etc..
In this embodiment, a device testing method is provided, and fig. 2 is a flowchart of a device testing method according to an embodiment of the present application, and as shown in fig. 2, the flowchart includes the following steps:
step S202, under the condition that target information of a device to be tested is obtained, generating a target virtual device based on the target information;
step S204, receiving a target test text for interactive test of the target virtual equipment, and performing semantic analysis on the target test text to obtain a semantic analysis result;
step S206, performing interactive test on the target virtual device based on the semantic parsing result to generate a test result, where the test result includes an operation state and an execution result of the target virtual device.
Through the steps, under the condition that target information of the device to be tested is obtained, the target virtual device is generated based on the target information, a target test text for interactively testing the target virtual device is received, semantic analysis is conducted on the target test text to obtain a semantic analysis result, then interactive testing is conducted on the target virtual device based on the semantic analysis result, and a test result is generated, wherein the test result comprises the running state and the execution result of the target virtual device. The target virtual device is generated based on the target information of the device to be tested, the target virtual device is interactively tested through the semantic analysis result obtained by analyzing the received target test text, and the problems of large workload and waste of human resources caused by the fact that real devices need to be tested in the related technology are solved. The invention solves the problem of lower efficiency of the equipment testing method in the related technology and achieves the effect of improving the equipment testing efficiency.
The main body of the above steps may be a platform, such as a test platform, or a test tool, or test software, or a terminal, or a processor with human-computer interaction capability configured on a storage device, or a processing device or a processing unit with similar processing capability, but is not limited thereto. The following description is given by taking the test platform as an example (which is only an exemplary illustration, and in actual operation, other devices or modules may also be used to perform the above operations):
in the above embodiment, the test platform generates the target virtual device based on the target information when acquiring the target information of the device to be tested, for example, the device to be tested is an intelligent air conditioner, an intelligent refrigerator, a washing machine, or the like, where the target information may include a device type, a device model, and a device ID of the device to be tested, and may also include other information of the device; in practical application, the to-be-tested equipment can be added to the test platform as required, for example, the target information of the to-be-tested equipment can be input by clicking an adding equipment control in the test platform, in practical application, only one to-be-tested equipment can be added at a time, a plurality of to-be-tested equipment can also be added at one time, and then the corresponding virtual equipment is respectively generated; after the target virtual device is generated, receiving a target test text for performing interactive test on the target virtual device, and performing semantic analysis on the target test text to obtain a semantic analysis result, for example, when a plurality of virtual devices have been generated in a test platform, one of the virtual devices (e.g., the target virtual device) may be selected for testing, where the target test text includes a corpus for performing interactive test on the target virtual device, for example, the corpus in the target test text is "current temperature of air conditioner", in an actual application, the target test text may include one corpus or more corpora, and when the target test text includes a plurality of corpora, the target test text including the plurality of corpora may be imported in an excel file form, and one or more corpora included in the target test text may be subjected to semantic analysis to obtain one or more semantic analysis results; and then carrying out interactive test on the target virtual equipment based on the semantic analysis result to generate a test result, wherein the test result comprises the running state and the execution result of the target virtual equipment. In practical application, after the interactive test is performed, a test result may be generated, where the test result may include an operating state of the target virtual device, for example, a change condition of attribute information of the target virtual device, for example, if the semantic analysis result indicates that the air conditioner temperature is adjusted to 28 ℃, the temperature attribute of the target virtual device may be modified accordingly to indicate that the test is normal, and if the temperature attribute is not modified according to the semantic, the test is failed; the test result may further include a target status code, and the result of success or failure of the interactive test may be determined based on the target status code, that is, the execution result of the interactive test executed by the target virtual device may be determined. Through the embodiment, the target virtual equipment is generated based on the target information of the equipment to be tested, and the target virtual equipment is interactively tested based on the corpus included in the target test text, so that the problems of large workload and waste of human resources caused by the fact that real equipment needs to be tested in the related technology are solved. The invention solves the problem of lower efficiency of the equipment testing method in the related technology and achieves the effect of improving the equipment testing efficiency.
In an optional embodiment, performing semantic parsing on the target test text to obtain a semantic parsing result, including: performing semantic parsing on the target test text through Natural Language Processing (NLP) to obtain a semantic parsing result, wherein the semantic parsing result comprises a test type indicated by a corpus contained in the target test text; performing interactive testing on the target virtual device based on the semantic parsing result, including: and performing interactive test on the target virtual equipment based on the test type. In this embodiment, after receiving a target test text, a test platform may perform semantic parsing on the target test text through an NLP to obtain a semantic parsing result, where the target test text includes a corpus for performing an interactive test on a target virtual device, where the target test text may include one corpus or multiple corpora, for example, performing semantic recognition on the target test text to obtain a semantic parsing result, and determining a test type indicated by the corpus according to the semantic parsing result, and in an actual application, the test type of the corpus may be a device control type, taking a test of an air conditioner as an example, the corpus is an "air conditioner current temperature", and then performing an interactive test on the target virtual device based on the semantic parsing result of the corpus, for example, executing the interactive test by a program and modifying a device attribute (such as an air conditioner temperature attribute) corresponding to the corpus to complete the interactive test; or the test type indicated by the corpus may also be a third-party type, where the third-party type is that semantics indicated by the corpus need to be queried through a third-party service to obtain a feedback result, for example, the corpus is "how the weather is today" or "how the chicken in the palace house does", and the corpus needs to call the third-party service to query to obtain the feedback result so as to complete the interactive test. By the embodiment, the purpose of determining the test type indicated by the corpus included in the target test text and performing interactive test on the target virtual equipment based on the test type of the corpus is achieved.
In an optional embodiment, performing an interactive test on the target virtual device based on the test type includes: under the condition that the test type is determined to be a device control type, performing the interactive test on the target virtual device in a mode of controlling the target virtual device based on the control operation indicated by the semantic parsing result; performing the interactive test on the target virtual device by performing the following operations under the condition that the test type is determined to be a third party type: and calling a third-party service to execute the operation indicated by the semantic analysis result, acquiring an execution result fed back by the third-party service, and displaying the execution result. In this embodiment, when it is determined that the test type indicated by the corpus included in the target test text is the device control type, the target virtual device is interactively tested based on the semantic parsing result of the corpus, for example, the corpus is "turn on air conditioner", the interactive test is executed by the program, and the device attribute (such as the on/off attribute) corresponding to the corpus is modified, so as to complete the interactive test; when the test type indicated by the corpus is determined to be the third-party type, the semantic meaning indicated by the corpus needs to be queried through the third-party service, then a query result (namely an execution result of the execution operation of the third-party service) is returned, the query result is used as a test result of the interactive test, and the query result is displayed. By the embodiment, the aim of executing different interactive test strategies on the target virtual equipment according to different test types is fulfilled.
In an optional embodiment, performing an interactive test on the target virtual device based on the semantic parsing result to generate a test result, includes: performing interactive test on the target virtual equipment based on a target attribute field included in the semantic analysis result to obtain the running state, wherein the target attribute field is used for indicating that a target attribute corresponding to the target attribute field of the target virtual equipment is operated; and comparing the running state with a target result field included in the semantic parsing result to obtain the execution result, wherein the execution result is used for indicating whether the interaction test is successful, and the target result field is used for indicating a result of operating the target attribute of the target virtual device. In this embodiment, by determining a target attribute field included in the semantic parsing result, for example, the target attribute field is a switch attribute, a temperature attribute, or another attribute, an interactive test is performed on the target virtual device based on the target attribute field to obtain an operating state, that is, to obtain attribute information of the target virtual device, for example, switch attribute change information or temperature change information; then, the running state is compared with a target result field included in the semantic parsing result to obtain an execution result, for example, the temperature is adjusted to 28 ℃ as the semantic parsing result, and the target result field in the semantic parsing result is 28 ℃, at this time, the temperature attribute change information in the running state may be compared with the target result field, so that the execution result may be obtained, and whether the interaction test is successful or not may be known.
In an optional embodiment, comparing the running state with a target result field included in the semantic parsing result to obtain the execution result includes: comparing the running state with the target result field to obtain a comparison result; determining that the interaction test is successful under the condition that the comparison result indicates that the running state is consistent with the target result field; the method further comprises the following steps: and displaying the test result, wherein the test result comprises a target state code, and the target state code is used for indicating the execution result of the interactive test. In this embodiment, the running status is compared with the target result field to obtain a comparison result, and when the comparison result indicates that the running status is consistent with the target result field, it may be determined that the interactive test is successful, and conversely, when the comparison result indicates that the running status is inconsistent with the target result field, it may be determined that the interactive test is failed; after the interactive test is performed, a test result is generated, the test result may include a target status code, and the target status code is used to indicate a successful or failed status of the interactive test of the target virtual device, that is, a result of the current interactive test. In practical application, for each interactive test, a corresponding log is generated, and a developer or a tester can judge the reason of interactive failure according to the log.
In an optional embodiment, in a case where target information of a device to be tested is obtained, generating a target virtual device based on the target information includes: the method comprises the steps that under the condition that a request instruction for requesting to add test equipment is received, a target window pops up, wherein the request instruction is triggered after a first preset operation is executed on a specified control on a target page; and under the condition that the target information is detected to be input in the target window and the target information exists in a target information resource library, generating the target virtual equipment and adding the target virtual equipment into a target equipment list, wherein the target information resource library is pre-established and stores information of a plurality of equipment including the target information. In this embodiment, when a user or a tester performs a first predetermined operation on a designated control on a target page of a test platform, a request instruction is triggered to request to add a device to be tested, at this time, the target page pops up a target window to allow the user or the tester to input target information of the test device, for example, the designated control is a control in an upper right corner or an upper left corner region or a middle upper-bias region or other regions in the target page, a name of the designated control may be an add device, a newly added device, or the like, the first predetermined operation may be a single-click operation, a double-click operation, or a touch operation, and after the user or the tester inputs the target information of the device to be tested, the test platform checks that a device corresponding to the target information exists in a target information resource library, generates the target virtual device, and adds the target virtual device to a target device list, where the target device list may include basic information of the target virtual device, such as a device type, a device model, and a device ID, and may also include other information of the target virtual devices, for example, and the attribute information of the target device may include multiple pieces of the target information stored in the target information library. Through the embodiment, the purpose of adding the target information of the device to be tested to generate the target virtual device is achieved.
In an optional embodiment, receiving a target test text for performing an interactive test on the target virtual device includes: receiving the target test text if it is determined that the target virtual device has been selected from the list of target devices. In this embodiment, when a user or a tester selects a target virtual device from a target device list, a test platform may receive an input target test text, the target device list may include multiple devices, in an actual application, the target device list may be displayed in a designated area of the test platform, and the target device list may be displayed in a drop-down box form for the user to select, that is, the user may select a corresponding virtual device through the drop-down box of the target device list in a page, for example, when the user needs to perform an interactive test on a certain type of air conditioning device, the type of air conditioning device in the target device list may be selected. Through the embodiment, the purpose of selecting the target virtual equipment from the target equipment list to carry out interactive test is achieved.
In an optional embodiment, receiving a target test text for performing an interactive test on the target virtual device includes: displaying the target equipment list in a designated area of the target page, wherein the target equipment list comprises the target information and the target attribute information of the target virtual equipment; updating the target device list in a case where it is determined that a second predetermined operation is performed on the target attribute information; receiving the target test text if it is determined that the target virtual device has been selected from the updated list of target devices. In this embodiment, a target device list is displayed in a specified area of a target page, for example, a target device list is displayed in a middle left area or a middle right area or other areas of the target page, the target device list includes target information of the aforementioned devices to be tested, which may also be referred to as target information of a target virtual device, and also includes target attribute information of the target virtual device, taking an air conditioner as an example, and may also include on/off attribute information of the air conditioner, or temperature attribute information, or wind speed attribute information, and in an actual application, when the target virtual device is generated and added to the target device list, attribute information of the devices to be tested corresponding to the target information of the devices to be tested, which is included in the target information resource library, and the target information are added to the target device list together; when the second predetermined operation is executed on the target attribute information, the target equipment list is updated, in practical application, an entry for editing the attribute of the equipment (or the virtual equipment) to be tested is provided for a user in the test platform, so that the user can check or edit the attribute information of the equipment, for example, the attribute information of the target virtual equipment is added or deleted, or the attribute information of the target virtual equipment is modified, and the purpose of editing the attribute information of the target virtual equipment is realized.
In an optional embodiment, performing an interactive test on the target virtual device based on the semantic parsing result includes: under the condition that the target test text is determined to be a text containing a plurality of corpora, sequentially carrying out interactive test on the target virtual equipment on the basis of a plurality of semantic analysis results obtained by carrying out semantic analysis on the plurality of corpora; or, when the target virtual device includes a plurality of virtual devices, sequentially performing an interactive test on the plurality of virtual devices based on one or more semantic parsing results obtained by performing semantic parsing on one or more corpora included in the target test text. In this embodiment, when the target test text is a text including multiple corpora, the multiple corpora may be analyzed through the NLP, and then the target virtual device may be interactively tested in sequence based on semantics respectively indicated by the multiple corpora, that is, the target test text including the multiple corpora may be input once, so that the target virtual device may be interactively tested for multiple times, and in practical applications, the target virtual device may be interactively tested in sequence based on multiple semantic parsing results, that is, the target virtual device may be interactively tested in batches; optionally, the interactive test may be performed on multiple virtual devices in sequence according to the same corpus or multiple corpora. Through the embodiment, the purpose of carrying out batch interactive test on the target virtual equipment based on the target test text is achieved, the effect of improving the test efficiency is achieved, and the experience degree of a user is improved.
In order to better understand the process of the device testing method, the following describes the flow of the device testing method with reference to an alternative embodiment, but the flow is not limited to the technical solution of the embodiment of the present application.
In this embodiment, a method for testing device interaction is provided, and fig. 3 is a flowchart for testing device interaction according to an embodiment of the present application, and as shown in fig. 3, the method specifically includes the following steps:
step 1, adding virtual equipment (corresponding to the equipment to be tested) manually. Inputting the equipment type, the equipment model and the equipment id (corresponding to the target information) in the page, and if the step 2 is met, saving the input data in the database.
And step 2, equipment data. The device data refers to a large amount of current device data information pools, which are equivalent to a device information resource library (corresponding to the target information resource library), that is, a device information resource library is determined or searched. The detailed information of the device, including the attribute information of the device, is included in the verification result, which can be used to verify whether the data added in step 1 is qualified.
And step 3, checking. And (3) verifying whether the virtual equipment added in the step (1) exists in the equipment information resource library in the step (2) or not, and verifying whether the step (1) meets the standard equipment data or not.
And 4, successfully adding the virtual equipment. If the validation in step 3 is successful, the virtual device may be added, and all the device data associated with the virtual device added this time in steps 1 and 2 is stored, including the attribute information of the device contained in the device information resource library.
And 5, generating the virtual equipment. At this time, a virtual device has been generated while containing basic information of the device, such as the device type, the device model, the device id, and the like, and detailed information of the device, and attribute information of the device.
And 6, selecting equipment. Since the virtual device has been successfully added in step 4, we can get a list of all virtual devices added by themselves (corresponding to the aforementioned list of target devices). We present the device list in the form of a drop-down box for user selection.
By means of a device list pull-down box in a page, a corresponding device can be selected, for example, if an air conditioner device needs to be controlled, an air conditioner is selected.
And 7, inputting the linguistic data. When the user wants to inquire the relevant conditions of the air conditioner, the user can input the linguistic data, such as the current temperature of the air conditioner. Or when the equipment needs to be controlled in batch, the excel files can be imported to interact with the equipment in batch. Step 7 corresponds to receiving the target test text, where the target test text may be a single corpus or an excel file including multiple corpora.
And 8, judging whether the equipment is in the control type or not. After the step 6 and the step 7, the device name and the corpus can be obtained, whether the device is of the device control type or the third party type can be known through NLP analysis, if the device is of the device control type, the attribute of the controlled field needs to be modified, namely, the device is subjected to interactive test based on the corpus, and meanwhile, the latest information is synchronously updated to the virtual device list in the step 6.
The NLP is a subject that analyzes, understands and processes natural language by using computer technology, that is, a research that quantifies language information with the support of a computer using the computer as a powerful tool for language research and provides language description that can be used by both human and computer.
Step 9, other services. If the condition in the step 8 is not met, that is, if the interactive test type corresponding to the corpus does not belong to the device control type, the interactive test type belongs to a third party type, for example, asking "how do the weather today? "," how do the palace chicken do? "etc. may effect a corresponding reply by third party skills.
Step 10, generating a log. If the equipment is successfully interacted at this time, a result (corresponding to the test result) is generated, and all current information of the equipment is displayed to a user, wherein the current information comprises a successful or failed status code, the running status of the equipment, the execution result and the like. The user can conveniently know whether the interaction is successful or not or the reason of the failure, and the reason of the failure can be judged according to the state code.
It should be noted that, in step 6, the virtual device list may already be obtained, and we may show it to the user. And the user is provided with an entrance for editing the running state of the equipment (or called equipment attribute information), so that the user can view and edit the basic state of the equipment. After the user has edited (corresponding to the second predetermined operation performed on the target attribute information as described above), the latest data edited by the user is synchronized to step 6, and thus the function of editing the operating state of the apparatus is realized.
In the embodiment, the purpose of simulating the final result of equipment interaction by adding the virtual equipment is realized; the voice control of the equipment is simulated by inputting the text, and the Excel file is imported, so that the interaction of the equipment is simulated in batch; in addition, the purposes of conveniently troubleshooting problems and obtaining the execution condition of the interaction can be realized through the response result generated after simulation, the equipment details, the state code and other information, and the purpose of modifying the running state of the current virtual equipment through editing the running state (or the equipment attribute) of the equipment is realized.
Compared with the related art, the voice interaction test needs to be performed on real equipment, and the test mode has many disadvantages, for example, the first disadvantage is that all categories cannot be covered by the entity home appliance equipment, so that all equipment cannot be comprehensively tested. And secondly, the real machine is tested, so that the equipment resource is lost, secondary sale cannot be realized, and the income of a company is influenced. And thirdly, the manpower resource is wasted, and the workload is relatively large when the real machine is interacted. And the disadvantage is that the testing personnel cannot test at any time and any place due to the limitation of the testing place.
According to the embodiment of the invention, the virtual equipment is subjected to the simulation interactive test through the equipment simulator, on one hand, the problem of lack of equipment functions and equipment local limitation and the loss of real equipment resources are solved by adding the virtual equipment functions, so that the test resources can be saved, and the test efficiency, the test integrity and the project safety are improved. The equipment simulator can also import a large amount of mutual corpora in batches to realize one-time operation, can carry out the batch interaction to equipment, to a great extent can promote tester's work efficiency, also can let the more convenient that development personnel's problem investigation becomes.
According to the method provided by the embodiment of the invention, on one hand, diversification and comprehensiveness of the equipment can be realized by adding the virtual equipment. Meanwhile, equipment loss can be avoided, and the testing time of testers and developers is reduced, so that corresponding profit is increased for companies. And the other is convenient, a plurality of corpora can be led in batch, so that the function of one-time operation and multiple interaction is realized, and the working efficiency is improved to a great extent. Staff do not need face-to-face equipment to test, and can carry out simulation test by visiting the webpage at home, so that the limit of a test place is avoided, and equipment interaction test becomes more flexible. Meanwhile, a return result can be displayed, the details of the equipment and whether the interaction is normal or abnormal can be known, and the problem type can be positioned according to the state code, so that the problem positioning is convenient. The device state can be edited, a plurality of states of a certain device can be modified at one time, and the running state of the device can be modified more quickly.
Through the above description of the embodiments, those skilled in the art can clearly understand that the method according to the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but the former is a better implementation mode in many cases. Based on such understanding, the technical solutions of the present application or portions thereof that contribute to the prior art may be embodied in the form of a software product, where the computer software product is stored in a storage medium (such as a ROM/RAM, a magnetic disk, and an optical disk), and includes several instructions for enabling a terminal device (which may be a mobile phone, a computer, a server, or a network device) to execute the method of the embodiments of the present application.
In this embodiment, a device testing apparatus is further provided, and fig. 4 is a block diagram of a structure of a device testing apparatus according to an embodiment of the present application, as shown in fig. 4, including:
a generating module 402, configured to generate a target virtual device based on target information of a device to be tested when the target information is obtained;
the processing module 404 is configured to receive a target test text for performing an interactive test on the target virtual device, and perform semantic analysis on the target test text to obtain a semantic analysis result;
the testing module 406 is configured to perform an interactive test on the target virtual device based on the semantic parsing result, and generate a testing result, where the testing result includes an operation state and an execution result of the target virtual device.
In an alternative embodiment, the processing module 404 includes: the analysis unit is used for performing semantic analysis on the target test text through Natural Language Processing (NLP) to obtain a semantic analysis result, wherein the semantic analysis result comprises a test type indicated by a corpus contained in the target test text; the test module 406 includes: and the first testing unit is used for carrying out interactive testing on the target virtual equipment based on the testing type.
In an alternative embodiment, the first test unit includes: a first testing subunit, configured to, if it is determined that the testing type is a device control type, perform the interaction test on the target virtual device in a manner of controlling the target virtual device based on the control operation indicated by the semantic parsing result; a second testing subunit, configured to, if it is determined that the test type is a third-party type, perform the interactive test on the target virtual device by performing the following operations: and calling a third-party service to execute the operation indicated by the semantic analysis result, acquiring an execution result fed back by the third-party service, and displaying the execution result.
In an alternative embodiment, the test module 406 includes: a second testing unit, configured to perform an interactive test on the target virtual device based on a target attribute field included in the semantic parsing result to obtain the running state, where the target attribute field is used to indicate to operate a target attribute of the target virtual device corresponding to the target attribute field; a comparing unit, configured to compare the running state with a target result field included in the semantic parsing result to obtain the execution result, where the execution result is used to indicate whether the interaction test is successful, and the target result field is used to indicate a result of operating the target attribute of the target virtual device.
In an alternative embodiment, the comparison unit includes: the comparison subunit is used for comparing the running state with the target result field to obtain a comparison result; a determining subunit, configured to determine that the interaction test is successful when the comparison result indicates that the operating state is consistent with the target result field; the above-mentioned device still includes: a display module 408, as shown in fig. 5, fig. 5 is a preferred structural block diagram of a device testing apparatus according to an embodiment of the present application, where the display module 408 is configured to display the test result after performing an interactive test on the target virtual device based on the target test text, where the test result includes a target status code, and the target status code is used to indicate the execution result of the interactive test.
In an alternative embodiment, the generating module 402 includes: the system comprises a popup unit, a display unit and a control unit, wherein the popup unit is used for popping up a target window under the condition that a request instruction for requesting to add test equipment is received, and the request instruction is triggered after a first preset operation is executed on a specified control on a target page; and the processing unit is used for generating the target virtual equipment and adding the target virtual equipment into a target equipment list when detecting that the target information is input in the target window and determining that the target information exists in a target information resource library, wherein the target information resource library is pre-established and stores information of a plurality of equipment including the target information.
In an alternative embodiment, the test module 406 includes: the third testing unit is used for carrying out interactive testing on the target virtual equipment in sequence on the basis of a plurality of semantic analysis results obtained by carrying out semantic analysis on a plurality of linguistic data under the condition that the target testing text is determined to be a text containing a plurality of linguistic data; or, the fourth testing unit is configured to, when the target virtual device includes multiple virtual devices, sequentially perform an interactive test on the multiple virtual devices based on one or more semantic parsing results obtained by performing semantic parsing on one or more corpora included in the target test text.
It should be noted that, the above modules may be implemented by software or hardware, and for the latter, the following may be implemented, but not limited to: the modules are all positioned in the same processor; alternatively, the modules are respectively located in different processors in any combination.
Embodiments of the present application further provide a computer-readable storage medium comprising a stored program, wherein the program when executed performs the steps in the method embodiment of any of the above.
In an exemplary embodiment, the computer-readable storage medium may include, but is not limited to: various media capable of storing computer programs, such as a usb disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a removable hard disk, a magnetic disk, or an optical disk.
Embodiments of the present application further provide an electronic device, comprising a memory in which a computer program is stored and a processor configured to execute the computer program to perform the steps in any of the method embodiments described above.
In an exemplary embodiment, the electronic apparatus may further include a transmission device and an input/output device, wherein the transmission device is connected to the processor, and the input/output device is connected to the processor.
For specific examples in this embodiment, reference may be made to the examples described in the above embodiments and exemplary embodiments, and details of this embodiment are not repeated herein.
It will be apparent to those skilled in the art that the modules or steps of the present application described above may be implemented by a general purpose computing device, they may be centralized on a single computing device or distributed across a network of multiple computing devices, and alternatively, they may be implemented by program code executable by a computing device, such that they may be stored in a storage device and executed by a computing device, and in some cases, the steps shown or described may be performed in an order different than that described herein, or they may be separately fabricated into individual integrated circuit modules, or multiple ones of them may be fabricated into a single integrated circuit module. Thus, the present application is not limited to any specific combination of hardware and software.
The foregoing is only a preferred embodiment of the present application and it should be noted that, as will be apparent to those skilled in the art, numerous modifications and adaptations can be made without departing from the principles of the present application and such modifications and adaptations are intended to be considered within the scope of the present application.

Claims (10)

1. A method for testing a device, comprising:
under the condition of acquiring target information of a device to be tested, generating target virtual equipment based on the target information;
receiving a target test text for interactively testing the target virtual equipment, and performing semantic analysis on the target test text to obtain a semantic analysis result;
and performing interactive test on the target virtual equipment based on the semantic parsing result to generate a test result, wherein the test result comprises the running state and the execution result of the target virtual equipment.
2. The method of claim 1,
performing semantic analysis on the target test text to obtain a semantic analysis result, wherein the semantic analysis result comprises the following steps: performing semantic parsing on the target test text through Natural Language Processing (NLP) to obtain a semantic parsing result, wherein the semantic parsing result comprises a test type indicated by a corpus contained in the target test text;
performing interactive testing on the target virtual device based on the semantic parsing result, including: and performing interactive test on the target virtual equipment based on the test type.
3. The method of claim 2, wherein interactively testing the target virtual device based on the test type comprises:
under the condition that the test type is determined to be a device control type, performing the interactive test on the target virtual device in a mode of controlling the target virtual device based on the control operation indicated by the semantic parsing result;
performing the interactive test on the target virtual device by performing the following operations under the condition that the test type is determined to be a third party type: and calling a third-party service to execute the operation indicated by the semantic analysis result, acquiring an execution result fed back by the third-party service, and displaying the execution result.
4. The method according to any one of claims 1-3, wherein interactively testing the target virtual device based on the semantic parsing result to generate a test result comprises:
performing interactive test on the target virtual equipment based on a target attribute field included in the semantic analysis result to obtain the running state, wherein the target attribute field is used for indicating that a target attribute corresponding to the target attribute field of the target virtual equipment is operated;
and comparing the running state with a target result field included in the semantic parsing result to obtain the execution result, wherein the execution result is used for indicating whether the interaction test is successful, and the target result field is used for indicating a result of operating the target attribute of the target virtual device.
5. The method of claim 4, wherein comparing the running state with a target result field included in the semantic parsing result to obtain the execution result comprises:
comparing the running state with the target result field to obtain a comparison result;
determining that the interaction test is successful under the condition that the comparison result indicates that the running state is consistent with the target result field; the method further comprises the following steps:
and displaying the test result, wherein the test result comprises a target state code, and the target state code is used for indicating the execution result of the interactive test.
6. The method according to any one of claims 1 to 5, wherein in a case where target information of a device to be tested is obtained, generating a target virtual device based on the target information includes:
the method comprises the steps that under the condition that a request instruction for requesting to add test equipment is received, a target window pops up, wherein the request instruction is triggered after a first preset operation is executed on a specified control on a target page;
and under the condition that the target information is detected to be input in the target window and the target information exists in a target information resource library, generating the target virtual equipment and adding the target virtual equipment into a target equipment list, wherein the target information resource library is pre-established and stores information of a plurality of equipment including the target information.
7. The method according to any one of claims 1-5, wherein interactively testing the target virtual device based on the semantic parsing result comprises:
under the condition that the target test text is determined to be a text containing a plurality of corpora, sequentially carrying out interactive test on the target virtual equipment on the basis of a plurality of semantic analysis results obtained by carrying out semantic analysis on the plurality of corpora;
alternatively, the first and second electrodes may be,
and under the condition that the target virtual equipment comprises a plurality of pieces of virtual equipment, sequentially carrying out interactive test on the plurality of pieces of virtual equipment based on one or more semantic analysis results obtained by carrying out semantic analysis on one or more linguistic data contained in the target test text.
8. An apparatus testing device, comprising:
the generating module is used for generating target virtual equipment based on target information under the condition of acquiring the target information of the equipment to be tested;
the processing module is used for receiving a target test text for interactively testing the target virtual equipment and performing semantic analysis on the target test text to obtain a semantic analysis result;
and the test module is used for carrying out interactive test on the target virtual equipment based on the semantic analysis result to generate a test result, and the test result comprises the running state and the execution result of the target virtual equipment.
9. A computer-readable storage medium, comprising a stored program, wherein the program when executed performs the method of any 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 of any of claims 1 to 7 by means of the computer program.
CN202210916789.XA 2022-08-01 2022-08-01 Device testing method and apparatus, storage medium, and electronic apparatus Pending CN115460117A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210916789.XA CN115460117A (en) 2022-08-01 2022-08-01 Device testing method and apparatus, storage medium, and electronic apparatus

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210916789.XA CN115460117A (en) 2022-08-01 2022-08-01 Device testing method and apparatus, storage medium, and electronic apparatus

Publications (1)

Publication Number Publication Date
CN115460117A true CN115460117A (en) 2022-12-09

Family

ID=84296332

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210916789.XA Pending CN115460117A (en) 2022-08-01 2022-08-01 Device testing method and apparatus, storage medium, and electronic apparatus

Country Status (1)

Country Link
CN (1) CN115460117A (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20210073108A1 (en) * 2019-09-09 2021-03-11 Inventec (Pudong) Technology Corporation Virtualized device-based test system and method thereof
US20210209309A1 (en) * 2020-04-30 2021-07-08 Beijing Baidu Netcom Science And Technology Co., Ltd. Semantics processing method, electronic device, and medium
CN113434421A (en) * 2021-06-30 2021-09-24 青岛海尔科技有限公司 Virtual equipment testing method and device
CN113919360A (en) * 2020-07-09 2022-01-11 阿里巴巴集团控股有限公司 Semantic understanding method, voice interaction method, device, equipment and storage medium
CN114185782A (en) * 2021-12-08 2022-03-15 北京百度网讯科技有限公司 Interactive testing method and device for virtual object and electronic equipment

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20210073108A1 (en) * 2019-09-09 2021-03-11 Inventec (Pudong) Technology Corporation Virtualized device-based test system and method thereof
US20210209309A1 (en) * 2020-04-30 2021-07-08 Beijing Baidu Netcom Science And Technology Co., Ltd. Semantics processing method, electronic device, and medium
CN113919360A (en) * 2020-07-09 2022-01-11 阿里巴巴集团控股有限公司 Semantic understanding method, voice interaction method, device, equipment and storage medium
CN113434421A (en) * 2021-06-30 2021-09-24 青岛海尔科技有限公司 Virtual equipment testing method and device
CN114185782A (en) * 2021-12-08 2022-03-15 北京百度网讯科技有限公司 Interactive testing method and device for virtual object and electronic equipment

Similar Documents

Publication Publication Date Title
US9419884B1 (en) Intelligent automated testing method for restful web services
CN108959068A (en) Software interface testing method, device and storage medium
CN108647141A (en) Automatic test approach, device, computer-readable medium and electronic equipment
US10791033B2 (en) Cloud-native network function assessment tool
CN112100079B (en) Test method and system based on simulation data calling and electronic equipment
CN109614312A (en) Method for generating test case, device, electronic equipment and storage medium
CN111934908A (en) Internet of things simulation method, device and system and storage medium
CN115687349A (en) Database table generation method and device, storage medium and electronic device
CN113204495A (en) Automatic testing method and device based on B/S architecture, storage medium and equipment
CN106815150B (en) Server-side interface test system and method
CN115480746A (en) Method, device, equipment and medium for generating execution file of data processing task
CN111737431A (en) Equipment exception processing method and device, storage medium and electronic device
CN115358395A (en) Knowledge graph updating method and device, storage medium and electronic device
CN114896003A (en) Page configuration method and device, storage medium and electronic device
CN114201144A (en) Micro service system construction method, device and medium based on domain-driven design
CN115460117A (en) Device testing method and apparatus, storage medium, and electronic apparatus
CN112148623B (en) LIMS-based intelligent complete scene test method
CN113238901B (en) Multi-device automatic testing method and device, storage medium and computer device
CN115639998A (en) Report management method and device, storage medium and electronic device
CN110738384B (en) Event sequence checking method and system
KR20130125491A (en) System and method using realtime simulator and programmed system switching for the validation of large-scaled dcs
CN112965910A (en) Automatic regression testing method and device, electronic equipment and storage medium
CN115357446A (en) Device testing method and device, storage medium and electronic device
CN113760750B (en) Intelligent device testing method and device, electronic device and storage medium
CN117667650A (en) Software development kit testing method, 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