Testing method and device for voice equipment, and storage medium
By installing the test application on the mobile terminal, automatically waking up the voice device and obtaining corpus data from the Internet of Things cloud for interactive testing, it solves the problems of limited interactive testing coverage and time-consuming manual identification in the existing technology, and improves testing efficiency and Problem discovery efficiency.
Patent Information
- Application Number
- CN202210582236.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-05-26
- Publication Date
- 2024-10-22
- Estimated Expiration
- 2042-05-26
AI Technical Summary
The interactive test coverage of voice devices in the existing technology is limited, and manual recognition results are time-consuming and cannot fully cover thousands or hundreds of test corpora, resulting in low test efficiency.
By installing the test application on the mobile terminal, calling the recognition interface to wake up the voice device, and obtaining the corpus data to be tested from the Internet of Things cloud, generating test audio, automatically conducting interactive tests, comparing the recognition results with the expected results, and determining whether the interactive function of the voice device is normal.
It improves the efficiency of voice device interaction testing, quickly discovers problem points, reduces the time-consuming manual recognition, and avoids recognition abnormalities of voice devices when used by users.
Smart Images

Figure CN115171657B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of smart home, and specifically, to a testing method and device for voice equipment, and a storage medium. Background Art
[0002] In the prior art, the intelligent voice in mobile phones often needs to support hundreds of interactive corpora to ensure that it can cover more skills and functions used by users in daily interactions. Therefore, when testing the intelligent voice of mobile phones, an automated method is often used to achieve hundreds of corpus interactions. However, in the current voice interaction test process of the device, each time the voice device is woken up, it is necessary to manually input the corpus for interaction. When the interaction result is generated in the cloud background, it is necessary to manually check the test results for each corpus one by one in the cloud background. This test method cannot fully cover the hundreds of test corpora, and it takes a long time to check the test results.
[0003] In response to the problems in related technologies such as limited coverage of interactive testing of voice devices and long time consumption of manual recognition results, no effective technical solution has been proposed. Summary of the invention
[0004] The embodiments of the present invention provide a method and apparatus for testing a voice device, and a storage medium, so as to at least solve the problems in the related art that the interactive test coverage of the voice device is limited and the manual recognition result is time-consuming.
[0005] According to one embodiment of the present invention, a method for testing a voice device is provided, comprising: in the case where a test application is installed on a mobile terminal, calling a recognition interface connecting the mobile terminal and the voice device through the test application, and waking up the voice device using the recognition interface; in the case where the voice device is successfully woken up through the recognition interface, the test application determines the corpus data to be tested corresponding to the voice device from the Internet of Things cloud, and determines a test audio based on the corpus data; transmits the test audio to the voice device to obtain a recognition result fed back by the voice device; and compares the recognition result with the expected result to determine whether the interactive function of the voice device is normal.
[0006] In an exemplary embodiment, the recognition result is compared with the expected result to determine whether the interactive function of the voice device is normal, including: dividing the recognition result into multiple dimensions according to preset dimensions for comparison; wherein the preset dimensions include at least one of the following: corpus, classification of corpus, interactive intent, and reply information; determining the expected result corresponding to the test audio, wherein the expected result is the reference data obtained by processing the collected corpus data on the IoT cloud; comparing the similarity between the recognition result of each dimension in the multiple dimensions and the expected result to obtain at least one similarity; and determining whether the interactive function of the voice device is normal according to at least one similarity.
[0007] In an exemplary embodiment, the similarity between the recognition result and the expected result in each dimension of multiple dimensions is compared to obtain at least one similarity, including: when the comparison dimension between the recognition result and the expected result is corpus, determining the difference between the first text of the corpus corresponding to the recognition result and the second text of the corpus corresponding to the expected result, and obtaining a first similarity, wherein the first similarity is the proportion of the corpus that is the same as the first text and the second text in the first text; when the comparison dimension between the recognition result and the expected result is the classification of the corpus, determining the difference between the first parsed data corresponding to the recognition result and the second parsed data corresponding to the expected result, and obtaining a second similarity, wherein the second similarity is the proportion of the remaining data in the first parsed data excluding the parsed data different from the second parsed data in the first parsed data; when the comparison dimension between the recognition result and the expected result is intent, determining whether the first intent corresponding to the recognition result and the second intent corresponding to the expected result are the same, and obtaining a third similarity; when the comparison dimension between the recognition result and the expected result is reply information, determining the difference between the first reply information corresponding to the recognition result and the second reply information corresponding to the expected result, and obtaining a fourth similarity, wherein the fourth similarity is the proportion of the corpus that is the same as the first reply information and the second reply information in the first text.
[0008] In an exemplary embodiment, determining whether the interactive function of a voice device is normal based on at least one similarity includes: determining that the interactive function of the voice device is normal when it is determined that there is a first comparison result, wherein the first comparison result includes: at least one of the first similarity being greater than or equal to a first target similarity, the second similarity being greater than or equal to a second target similarity, the third similarity being greater than or equal to a third target similarity, and the fourth similarity being greater than or equal to a fourth target similarity.
[0009] In an exemplary embodiment, when it is determined that there is a second comparison result, it is determined that the voice device interaction function is abnormal, wherein the second comparison result includes at least one of the first similarity being less than the first target similarity, the second similarity being less than the second target similarity, the third similarity being less than the third target similarity, and the fourth similarity being less than the fourth target similarity.
[0010] In an exemplary embodiment, when the fifth similarity is less than a preset similarity threshold, after determining that the interactive function of the voice device is abnormal, the above method also includes: determining a first difference between the first similarity and the first target similarity; and determining a second difference between the second similarity and the second target similarity; and determining a third difference between the third similarity and the third target similarity; and determining a fourth difference between the fourth similarity and the fourth target similarity; selecting the minimum value from the first difference, the second difference, the third difference, and the fourth difference, and retesting the test audio corresponding to the dimension indicated by the minimum value on the voice device.
[0011] In an exemplary embodiment, after determining that the interactive function of the voice device is abnormal, the method also includes: determining at least one abnormal similarity from the first similarity, the second similarity, the third similarity, and the fourth similarity according to the second comparison result, and the abnormal similarity is less than the corresponding target similarity; determining a comparison dimension in which the abnormality exists according to the abnormal similarity; determining a target module corresponding to the abnormal interactive function of the voice device according to the abnormal comparison dimension, wherein the target module includes at least one of the following: a voice recognition module, a semantic parsing module, and a voice interaction module.
[0012] In an exemplary embodiment, after comparing the recognition result with the expected result to determine whether the interactive function of the voice device is normal, the above method also includes: when it is determined that the interactive function of the voice device is normal, binding the recognition result with the device identifier corresponding to the voice device; adding test information that the interactive test is normal in the test record corresponding to the voice device in the test application.
[0013] In an exemplary embodiment, when the voice device is successfully awakened through the recognition interface, the test application determines the corpus data to be tested corresponding to the voice device from the IoT cloud, and determines the test audio based on the corpus data, including: obtaining the corpus data collected by the IoT cloud within a preset period; filtering out target corpus data for testing from the corpus data according to preset data types; converting the target corpus data to generate test audio for testing the voice device.
[0014] According to another embodiment of the present invention, a testing device for a voice device is provided, comprising: a wake-up module, for calling, through a test application installed on a mobile terminal, an identification interface connecting the mobile terminal and the voice device, and using the identification interface to wake up the voice device; a determination module, for determining, from the IoT cloud, corpus data to be tested corresponding to the voice device, and determining a test audio based on the corpus data, when the mobile terminal has been successfully connected to an IoT cloud; a test module, for transmitting the test audio to the voice device, and obtaining a recognition result fed back by the voice device; and a comparison module, for comparing the recognition result with the expected result, to determine whether the interactive function of the voice device is normal.
[0015] In an exemplary embodiment, the above-mentioned comparison module is also used to divide the recognition results into multiple dimensions according to preset dimensions for comparison; wherein the preset dimensions include at least one of the following: corpus, classification of corpus, interaction intention, and reply information; determine the expected result corresponding to the test audio, wherein the expected result is the reference data obtained by processing the collected corpus data on the IoT cloud; compare the similarity between the recognition results of each dimension in multiple dimensions and the expected results to obtain at least one similarity; determine whether the interactive function of the voice device is normal based on at least one similarity.
[0016] In an exemplary embodiment, the above-mentioned comparison module is also used to determine the difference between the first text of the corpus corresponding to the recognition result and the second text of the corpus corresponding to the expected result when the comparison dimension between the recognition result and the expected result is the corpus, and obtain a first similarity, wherein the first similarity is the proportion of the corpus that is the same as the first text and the second text in the first text; when the comparison dimension between the recognition result and the expected result is the classification of the corpus, determine the difference between the first parsed data corresponding to the recognition result and the second parsed data corresponding to the expected result, and obtain a second similarity, wherein the second similarity is the proportion of the remaining data in the first parsed data excluding the parsed data different from the second parsed data in the first parsed data; when the comparison dimension between the recognition result and the expected result is the intention, determine whether the first intention corresponding to the recognition result and the second intention corresponding to the expected result are the same, and obtain a third similarity; when the comparison dimension between the recognition result and the expected result is the reply information, determine the difference between the first reply information corresponding to the recognition result and the second reply information corresponding to the expected result, and obtain a fourth similarity, wherein the fourth similarity is the proportion of the corpus that is the same as the first reply information and the second reply information in the first text.
[0017] In an exemplary embodiment, the above-mentioned comparison module is also used to determine that the voice device interaction function is normal when it is determined that there is a first comparison result, wherein the first comparison result includes: the first similarity is greater than or equal to the first target similarity, the second similarity is greater than or equal to the second target similarity, the third similarity is greater than or equal to the third target similarity and the fourth similarity is greater than or equal to at least one of the fourth target similarity.
[0018] In an exemplary embodiment, the above-mentioned comparison module is also used to determine that the voice device interaction function is abnormal when it is determined that there is a second comparison result, wherein the second comparison result includes at least one of the first similarity being less than the first target similarity, the second similarity being less than the second target similarity, the third similarity being less than the third target similarity, and the fourth similarity being less than the fourth target similarity.
[0019] In an exemplary embodiment, the comparison module also includes: a difference unit, used to determine a first difference between the first similarity and the first target similarity; and to determine a second difference between the second similarity and the second target similarity; and to determine a third difference between the third similarity and the third target similarity; and to determine a fourth difference between the fourth similarity and the fourth target similarity; and to select a minimum value from the first difference, the second difference, the third difference, and the fourth difference, and retest the test audio corresponding to the dimension indicated by the minimum value on the voice device.
[0020] In an exemplary embodiment, the comparison module further includes: an abnormal unit, used to determine at least one abnormal similarity from the first similarity, the second similarity, the third similarity, and the fourth similarity according to the second comparison result, wherein the abnormal similarity is less than the corresponding target similarity; determine a comparison dimension where an abnormality exists according to the abnormal similarity; determine a target module corresponding to the abnormal interactive function of the voice device according to the abnormal comparison dimension, wherein the target module includes at least one of the following: a voice recognition module, a semantic parsing module, and a voice interaction module.
[0021] In an exemplary embodiment, the above-mentioned device also includes: a recording module, which is used to bind the recognition result with the device identifier corresponding to the voice device when it is determined that the voice device interaction function is normal; and add test information that the interaction test is normal in the test record corresponding to the voice device in the test application.
[0022] In an exemplary embodiment, the above-mentioned determination module is also used to obtain corpus data collected by the Internet of Things cloud within a preset period; filter out target corpus data for testing from the corpus data according to preset data types; and convert the target corpus data to generate test audio for testing the voice device.
[0023] According to yet another embodiment of the present invention, a storage medium is provided, in which a computer program is stored, wherein the computer program is configured to execute the steps of any one of the above method embodiments when running.
[0024] According to yet another embodiment of the present invention, there is provided an electronic device, including a memory and a processor, wherein the memory stores a computer program, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.
[0025] Through the present invention, when the test application is installed on the mobile terminal, the recognition interface connected between the mobile terminal and the voice device is called by the test application, and the voice device is awakened by the recognition interface; when the voice device is successfully awakened by the recognition interface, the test application determines the corpus data to be tested corresponding to the voice device from the Internet of Things cloud, and determines the test audio according to the corpus data; transmits the test audio to the voice device to obtain the recognition result fed back by the voice device; compares the recognition result with the expected result to determine whether the interactive function of the voice device is normal. That is to say, the connected voice device to be tested is automatically awakened by the test application, and the corpus data to be tested corresponding to the voice device is obtained from the Internet of Things cloud, and the test audio is determined according to the corpus data for interactive testing, and finally the interactive function of the voice device is determined by comparing the recognition result with the expected result. Therefore, the problems of limited coverage of the interactive test of the voice device in the prior art and more time-consuming manual recognition results can be solved, and the test efficiency of the interactive test process corresponding to the voice device is improved, and the efficiency of finding the problem points of the voice device in the interaction is improved, thereby avoiding the probability of recognition abnormality of the subsequent voice device when the user uses it. BRIEF DESCRIPTION OF THE DRAWINGS
[0026] 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 present application.
[0027] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0028] Figure 1 is a hardware environment diagram of a method for testing a voice device according to an embodiment of the present application;
[0029] Figure 2 is a flow chart of a method for testing a voice device according to an embodiment of the present invention;
[0030] Figure 3 is a schematic diagram of an implementation scenario of an automated test of a smart speaker according to an optional embodiment of the present invention;
[0031] Figure 4 is a flow chart of automated testing of a smart speaker according to an optional embodiment of the present invention;
[0032] Figure 5 4 is a structural block diagram of a testing device for a voice device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0033] In order to enable those skilled in the art to better understand the solution of the present application, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present application.
[0034] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchangeable where appropriate, so that the embodiments of the present application described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0035] According to one aspect of an embodiment of the present application, a method for testing a voice device is provided. The method for testing a voice device is widely used in smart home, smart home, smart home device ecosystem, smart home ecosystem and other whole-house intelligent digital control application scenarios. Optionally, in this embodiment, the method for testing a voice device can be applied to Figure 1 In the hardware environment composed of the terminal device 102 and the server 104 shown in FIG. Figure 1As shown, the server 104 is connected to the terminal device 102 via a network, and can be used to provide services (such as application services, etc.) for the terminal or a client installed on the terminal. A database can be set on the server or independently of the server to provide data storage services for the server 104. Cloud computing and / or edge computing services can be configured on the server or independently of the server to provide data computing services for the server 104.
[0036] The network may include but is not limited to at least one of the following: wired network, wireless network. The wired network may include but is not limited to at least one of the following: wide area network, metropolitan area network, local area network, and the wireless network may include but is not limited to at least one of the following: WIFI (Wireless Fidelity), Bluetooth. The terminal device 102 may be but is not limited to a PC, a mobile phone, a tablet computer, a smart air conditioner, a smart range hood, a smart refrigerator, a smart oven, a smart stove, a smart washing machine, a smart water heater, a smart washing device, a smart dishwasher, a smart projection device, a smart TV, a smart clothes drying rack, a smart curtain, a smart audio and video, a smart socket, a smart speaker, a smart fresh air device, a smart kitchen and bathroom device, a smart bathroom device, a smart sweeping robot, a smart window cleaning robot, a smart mopping robot, a smart air purification device, a smart steamer, a smart microwave oven, a smart kitchen treasure, a smart purifier, a smart water dispenser, a smart door lock, etc.
[0037] In this embodiment, a method for testing a voice device is provided. Figure 2 is a flow chart of a method for testing a voice device according to an embodiment of the present invention, the flow chart comprising the following steps:
[0038] Step S202, when a test application is installed in the mobile terminal, calling the recognition interface connecting the mobile terminal and the voice device through the test application, and waking up the voice device using the recognition interface;
[0039] Optionally, the above-mentioned identification interface can be a physical interface, such as a USB interface, or it can be a software interface for setting access rights, that is, through the identification interface, a connection with the voice device can be successfully established, and then the corresponding test audio is sent to the voice device, and the voice device generates a corresponding recognition result. For example, the simulated user test audio is: please play a cheerful song. At this time, the voice device recognizes that the user's demand is: play songs, and then recommends popular songs for the user to choose. The above is only an example and limits the implementation method of the present application.
[0040] Step S204, when the voice device is successfully awakened through the recognition interface, the test application determines the corpus data to be tested corresponding to the voice device from the IoT cloud, and determines the test audio according to the corpus data;
[0041] Step S206, transmitting the test audio to the voice device to obtain a recognition result fed back by the voice device;
[0042] Optionally, the above recognition result may be text information or voice information;
[0043] Step S208: compare the recognition result with the expected result to determine whether the interactive function of the voice device is normal.
[0044] That is, by comparing the real-time recognition results fed back by the voice device with the expected results corresponding to the test audio, and by determining the difference between the two, it is finally determined whether the interactive function of the voice device is normal.
[0045] Through the above steps, when the test application is installed on the mobile terminal, the recognition interface connected between the mobile terminal and the voice device is called by the test application, and the voice device is awakened by the recognition interface; when the voice device is successfully awakened through the recognition interface, the test application determines the corpus data to be tested corresponding to the voice device from the IoT cloud, and determines the test audio according to the corpus data; transmits the test audio to the voice device to obtain the recognition result fed back by the voice device; compares the recognition result with the expected result to determine whether the interactive function of the voice device is normal. In other words, the connected voice device to be tested is automatically awakened by the test application, and the corpus data to be tested corresponding to the voice device is obtained from the IoT cloud, and the test audio is determined according to the corpus data for interactive testing, and finally the interactive function of the voice device is determined by comparing the recognition result with the expected result. Therefore, the problems of limited coverage of the interactive test of the voice device in the prior art and the time-consuming manual recognition result can be solved, and the test efficiency of the interactive test process corresponding to the voice device is improved, and the efficiency of finding the problem points of the voice device in the interaction is improved, thereby avoiding the probability of recognition abnormality of the subsequent voice device when the user uses it.
[0046] In an exemplary embodiment, the recognition result is compared with the expected result to determine whether the interactive function of the voice device is normal, including: dividing the recognition result into multiple dimensions according to preset dimensions for comparison; wherein the preset dimensions include at least one of the following: corpus, classification of corpus, interactive intent, and reply information; determining the expected result corresponding to the test audio, wherein the expected result is the reference data obtained by processing the collected corpus data on the IoT cloud; comparing the similarity between the recognition result of each dimension in the multiple dimensions and the expected result to obtain at least one similarity; and determining whether the interactive function of the voice device is normal according to at least one similarity.
[0047] It should be noted that in order to make the comparison between the recognition result and the expected result more comprehensive, after the voice device generates the corresponding recognition result according to the test audio, it performs a multi-dimensional analysis on the recognition result; the corpus corresponding to the recognition result, the classification of the corpus, the interaction intention, the reply information, etc. can be compared one by one. As an optional analysis order, the corpus corresponding to the recognition result is first analyzed to mark the differences between the corpus and the expected result as recognition errors, and then the classification and interaction intention of the corpus are analyzed. The corpus with incorrect classification and interaction intention is marked as a parsing error, and finally the reply information is analyzed. The wrong reply language corresponding to the reply information is marked as an interaction failure. Through judgment in multiple dimensions, the recognition result is compared with the expected result, and finally it is determined whether the interactive function of the voice device is normal.
[0048] In an exemplary embodiment, the similarity between the recognition result and the expected result in each dimension of multiple dimensions is compared to obtain at least one similarity, including: when the comparison dimension between the recognition result and the expected result is corpus, determining the difference between the first text of the corpus corresponding to the recognition result and the second text of the corpus corresponding to the expected result, and obtaining a first similarity, wherein the first similarity is the proportion of the corpus that is the same as the first text and the second text in the first text; when the comparison dimension between the recognition result and the expected result is the classification of the corpus, determining the difference between the first parsed data corresponding to the recognition result and the second parsed data corresponding to the expected result, and obtaining a second similarity, wherein the second similarity is the proportion of the remaining data in the first parsed data excluding the parsed data different from the second parsed data in the first parsed data; when the comparison dimension between the recognition result and the expected result is intent, determining whether the first intent corresponding to the recognition result and the second intent corresponding to the expected result are the same, and obtaining a third similarity; when the comparison dimension between the recognition result and the expected result is reply information, determining the difference between the first reply information corresponding to the recognition result and the second reply information corresponding to the expected result, and obtaining a fourth similarity, wherein the fourth similarity is the proportion of the corpus that is the same as the first reply information and the second reply information in the first text.
[0049] In an exemplary embodiment, determining whether the interactive function of a voice device is normal based on at least one similarity includes: determining that the interactive function of the voice device is normal when it is determined that there is a first comparison result, wherein the first comparison result includes: at least one of the first similarity being greater than or equal to a first target similarity, the second similarity being greater than or equal to a second target similarity, the third similarity being greater than or equal to a third target similarity, and the fourth similarity being greater than or equal to a fourth target similarity.
[0050] In an exemplary embodiment, when it is determined that there is a second comparison result, it is determined that the voice device interaction function is abnormal, wherein the second comparison result includes at least one of the first similarity being less than the first target similarity, the second similarity being less than the second target similarity, the third similarity being less than the third target similarity, and the fourth similarity being less than the fourth target similarity.
[0051] Optionally, in order to ensure the efficiency of confirming whether the interactive function of the voice device is normal based on at least one similarity, when at least one of the following situations occurs: the first similarity is less than the first target similarity, the second similarity is less than the second target similarity, the third similarity is less than the third target similarity, the fourth similarity is less than the fourth target similarity, etc., it can be directly determined that the interactive function of the voice device is abnormal, which indicates that the differences corresponding to different comparison dimensions or the differences have exceeded the preset standards. At this time, the cause of the abnormal interactive function of the voice device can be located in combination with the difference content corresponding to different comparison dimensions to ensure the interactive effectiveness of the voice device in subsequent use.
[0052] It should be noted that, as an optional implementation, different similarities can be set to a progressive relationship, that is, the second similarity comparison will be performed only when the first similarity is normal, the third similarity comparison will be performed only when the second similarity is normal, and the fourth similarity comparison will be performed only when the third similarity is normal. Then, the abnormal comparison dimension of the corresponding interactive function of the voice device can be located according to the abnormal similarity, thereby achieving rapid location of the failure point of the voice device interaction.
[0053] In an exemplary embodiment, when the fifth similarity is less than a preset similarity threshold, after determining that the interactive function of the voice device is abnormal, the above method also includes: determining a first difference between the first similarity and the first target similarity; and determining a second difference between the second similarity and the second target similarity; and determining a third difference between the third similarity and the third target similarity; and determining a fourth difference between the fourth similarity and the fourth target similarity; selecting the minimum value from the first difference, the second difference, the third difference, and the fourth difference, and retesting the test audio corresponding to the dimension indicated by the minimum value on the voice device.
[0054] Optionally, when the first difference between the first similarity and the first target similarity is lower than a preset threshold, the current recognition result is determined as an abnormal recognition result, the comparison between the recognition result and the expected result is terminated, and the test audio is re-determined to test the voice device. That is, by determining in advance the first difference between the first similarity corresponding to the corpus, it is determined that the recognition result is significantly different from the expected result, and retesting is performed, which improves the efficiency of discovering abnormalities during the test and avoids the waste of test resources.
[0055] In an exemplary embodiment, after determining that the interactive function of the voice device is abnormal, the method also includes: determining at least one abnormal similarity from the first similarity, the second similarity, the third similarity, and the fourth similarity according to the second comparison result, and the abnormal similarity is less than the corresponding target similarity; determining a comparison dimension in which the abnormality exists according to the abnormal similarity; determining a target module corresponding to the abnormal interactive function of the voice device according to the abnormal comparison dimension, wherein the target module includes at least one of the following: a voice recognition module, a semantic parsing module, and a voice interaction module.
[0056] In simple terms, after determining that the interactive function of the voice device is abnormal, the corresponding abnormal comparison dimension can be further determined based on the abnormal similarity corresponding to each comparison dimension, and the cause of the abnormal interactive function can be confirmed, that is, determine which target module is abnormal, so that after the voice device is tested, the voice device can be debugged according to the cause to ensure the functional quality of the voice device.
[0057] In an exemplary embodiment, after comparing the recognition result with the expected result to determine whether the interactive function of the voice device is normal, the above method also includes: when it is determined that the interactive function of the voice device is normal, binding the recognition result with the device identifier corresponding to the voice device; adding test information that the interactive test is normal in the test record corresponding to the voice device in the test application.
[0058] It can be understood that when it is determined that the interactive function of the voice device is normal, in order for the objects after the test process to understand the test results of the voice device, a test record can be generated in the test application and the recognition results can be stored accordingly to facilitate subsequent search and verification. In addition, when it is determined that the voice device is a device in production, the unique identification code on the label carried by the voice device can also be bound to the test result, and the bound data can be uploaded to a unified background server. When searching, the test results and test data of the voice device can be quickly determined by the identification code.
[0059] In an exemplary embodiment, when the voice device is successfully awakened through the recognition interface, the test application determines the corpus data to be tested corresponding to the voice device from the IoT cloud, and determines the test audio based on the corpus data, including: obtaining the corpus data collected by the IoT cloud within a preset period; filtering out target corpus data for testing from the corpus data according to preset data types; converting the target corpus data to generate test audio for testing the voice device.
[0060] It should be noted that the above-mentioned IoT cloud can repeatedly collect the corpus data within a preset period, and add the non-repetitive corpus data appearing in the corpus data to the corpus database of the IoT cloud; optionally, when in use, the corresponding corpus data is matched from the corpus database according to the device type of the voice device, and the corpus data is converted into corresponding test audio and then sent to the test application.
[0061] In order to better understand the process of the test method for the above-mentioned voice device, the process of the test method for the above-mentioned voice device is described below in combination with several optional embodiments.
[0062] As an optional embodiment, an automated testing method and system for smart speaker voice interaction is proposed. Figure 3 It is a schematic diagram of an implementation scenario of the smart speaker automated test according to an optional embodiment of the present invention; including: a sound source machine 32, an IoT cloud server 34, and a smart speaker 36;
[0063] The sound source machine (equivalent to the mobile terminal in the embodiment of the present invention) 32 establishes a communication connection with the Internet of Things cloud server 34 in advance, so that when the sound source machine 32 wakes up the smart speaker 36 (equivalent to the voice device in the embodiment of the present invention) through the corresponding identification interface, the test audio for testing the smart speaker 36 can be determined from the Internet of Things cloud server 34 according to the device type of the smart speaker 36. After completing the test, the smart speaker 36 can also transmit the test results to the Internet of Things cloud server 34 for storage, which is convenient for subsequent calls to the test results.
[0064] As an optional implementation, Figure 4 is a flow chart of automated testing of a smart speaker according to an optional embodiment of the present invention;
[0065] Step 1: wake up the smart speaker through the automation interface;
[0066] The smart speaker is directly woken up through the ASR (automatic speech recognition, automatic speech recognition technology, referred to as ASR) interface, simulating the manual operation of waking up the smart speaker and entering the smart speaker interactive sound pickup process.
[0067] Step 2, collect corpus from the cloud backend corresponding to the IoT cloud server, input test corpus to the audio source machine, and then control the audio source machine to play the test audio through the test script (equivalent to the test application in the embodiment of the present invention);
[0068] Optionally, through an automated testing framework such as appium, selenium, etc., collect the test corpus commonly used by cloud backend users, convert it into audio through text-to-speech technology, and play the audio as test audio to the device.
[0069] Step 3: Use the test script to obtain the cloud interaction results and compare the test results;
[0070] Through automated testing frameworks such as appium, selenium, etc., the cloud backend test results are extracted and compared with the expected results.
[0071] Step 4: Compare the test results in multiple dimensions through automated test scripts;
[0072] Optionally, after obtaining the test results, a multi-dimensional comparison is performed on the recognition results, classification, intent, and responses of the corpus. First, the recognition results are analyzed, and incorrect recognition results are marked as recognition errors; secondly, the classification and intent of the corpus are analyzed, and corpora with incorrect classification and intent are marked as parsing errors; finally, the corpus responses are analyzed, and incorrect responses are marked as interaction failures, which is very effective in troubleshooting.
[0073] In summary, the written automated test script can simulate waking up the device, play the test corpus through the machine, extract the user's commonly used corpus, and conduct a comprehensive analysis of the test results, thereby replacing manual testing, improving test effectiveness, and helping to reduce user complaints. It solves the problems of time-consuming manual testing, difficulty in manually covering multiple corpuses, and easy omission of user's commonly used corpus during speaker voice interaction testing, improves the efficiency of problem analysis, and helps testers better find problems.
[0074] Through the description of the above implementation methods, those skilled in the art can clearly understand that the method according to the above embodiment can be implemented by means of software plus a necessary general hardware platform, and of course it can also be implemented by hardware, but in many cases the former is a better implementation method. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product, which is stored in a storage medium (such as ROM / RAM, a magnetic disk, or an optical disk), and includes a number of instructions for enabling a terminal device (which can be a mobile phone, a computer, a server, or a network device, etc.) to perform the test of the voice device described in each embodiment of the present invention.
[0075] In this embodiment, a test device for a speech device is also provided, which is used to implement the above-mentioned embodiments and preferred implementation modes, and the descriptions that have been made will not be repeated. As used below, the term "module" can implement a combination of software and / or hardware of a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.
[0076] Figure 5 is a structural block diagram of a testing device for a voice device according to an embodiment of the present invention. Figure 5 As shown, the device comprises:
[0077] (1) a wake-up module 52, which is used to call the recognition interface connecting the mobile terminal and the voice device through the test application when the test application is installed on the mobile terminal, and use the recognition interface to wake up the voice device;
[0078] (2) a determination module 54, configured to, when the voice device is successfully awakened through the recognition interface, cause the test application to determine the corpus data to be tested corresponding to the voice device from the IoT cloud, and determine the test audio according to the corpus data;
[0079] (3) a testing module 56, configured to transmit the test audio to the voice device and obtain a recognition result fed back by the voice device;
[0080] (4) A comparison module 58, used to compare the recognition result with the expected result to determine whether the interactive function of the voice device is normal.
[0081] Through the above device, when the test application is installed on the mobile terminal, the recognition interface connected between the mobile terminal and the voice device is called by the test application, and the voice device is awakened by the recognition interface; when the voice device is successfully awakened through the recognition interface, the test application determines the corpus data to be tested corresponding to the voice device from the IoT cloud, and determines the test audio according to the corpus data; transmits the test audio to the voice device to obtain the recognition result fed back by the voice device; compares the recognition result with the expected result to determine whether the interactive function of the voice device is normal. In other words, the connected voice device to be tested is automatically awakened by the test application, and the corpus data to be tested corresponding to the voice device is obtained from the IoT cloud, and the test audio is determined according to the corpus data for interactive testing, and finally the interactive function of the voice device is determined by comparing the recognition result with the expected result. Therefore, the problems of limited coverage of interactive testing of voice devices in the prior art and more time-consuming manual recognition results can be solved, and the test efficiency of the interactive testing process corresponding to the voice device is improved, and the efficiency of finding the problem points of the voice device in the interaction is improved, thereby avoiding the probability of recognition anomalies in subsequent voice devices when used by users.
[0082] In an exemplary embodiment, the above-mentioned comparison module is also used to divide the recognition results into multiple dimensions according to preset dimensions for comparison; wherein the preset dimensions include at least one of the following: corpus, classification of corpus, interaction intention, and reply information; determine the expected result corresponding to the test audio, wherein the expected result is the reference data obtained by processing the collected corpus data on the IoT cloud; compare the similarity between the recognition results of each dimension in multiple dimensions and the expected results to obtain at least one similarity; determine whether the interactive function of the voice device is normal based on at least one similarity.
[0083] In an exemplary embodiment, the above-mentioned comparison module is also used to determine the difference between the first text of the corpus corresponding to the recognition result and the second text of the corpus corresponding to the expected result when the comparison dimension between the recognition result and the expected result is the corpus, and obtain a first similarity, wherein the first similarity is the proportion of the corpus that is the same as the first text and the second text in the first text; when the comparison dimension between the recognition result and the expected result is the classification of the corpus, determine the difference between the first parsed data corresponding to the recognition result and the second parsed data corresponding to the expected result, and obtain a second similarity, wherein the second similarity is the proportion of the remaining data in the first parsed data excluding the parsed data different from the second parsed data in the first parsed data; when the comparison dimension between the recognition result and the expected result is the intention, determine whether the first intention corresponding to the recognition result and the second intention corresponding to the expected result are the same, and obtain a third similarity; when the comparison dimension between the recognition result and the expected result is the reply information, determine the difference between the first reply information corresponding to the recognition result and the second reply information corresponding to the expected result, and obtain a fourth similarity, wherein the fourth similarity is the proportion of the corpus that is the same as the first reply information and the second reply information in the first text.
[0084] In an exemplary embodiment, the above-mentioned comparison module is also used to determine that the voice device interaction function is normal when it is determined that there is a first comparison result, wherein the first comparison result includes: the first similarity is greater than or equal to the first target similarity, the second similarity is greater than or equal to the second target similarity, the third similarity is greater than or equal to the third target similarity and the fourth similarity is greater than or equal to at least one of the fourth target similarity.
[0085] In an exemplary embodiment, the above-mentioned comparison module is also used to determine that the voice device interaction function is abnormal when it is determined that there is a second comparison result, wherein the second comparison result includes at least one of the first similarity being less than the first target similarity, the second similarity being less than the second target similarity, the third similarity being less than the third target similarity, and the fourth similarity being less than the fourth target similarity.
[0086] In an exemplary embodiment, the comparison module also includes a difference unit for determining a first difference between the first similarity and the first target similarity; and determining a second difference between the second similarity and the second target similarity; and determining a third difference between the third similarity and the third target similarity; and determining a fourth difference between the fourth similarity and the fourth target similarity; selecting a minimum value from the first difference, the second difference, the third difference, and the fourth difference, and retesting the test audio corresponding to the dimension indicated by the minimum value on the voice device.
[0087] In an exemplary embodiment, the comparison module further includes: an abnormal unit, used to determine at least one abnormal similarity from the first similarity, the second similarity, the third similarity, and the fourth similarity according to the second comparison result, wherein the abnormal similarity is less than the corresponding target similarity; determine a comparison dimension where an abnormality exists according to the abnormal similarity; determine a target module corresponding to the abnormal interactive function of the voice device according to the abnormal comparison dimension, wherein the target module includes at least one of the following: a voice recognition module, a semantic parsing module, and a voice interaction module.
[0088] In an exemplary embodiment, the above-mentioned device also includes: a recording module, which is used to bind the recognition result with the device identifier corresponding to the voice device when it is determined that the voice device interaction function is normal; and add test information that the interaction test is normal in the test record corresponding to the voice device in the test application.
[0089] In an exemplary embodiment, the above-mentioned determination module is also used to obtain corpus data collected by the Internet of Things cloud within a preset period; filter out target corpus data for testing from the corpus data according to preset data types; and convert the target corpus data to generate test audio for testing the voice device.
[0090] In the description of the present invention, it should be understood that the orientations or positional relationships indicated by the terms "center", "upper", "lower", "front", "back", "left", "right", etc. are based on the orientations or positional relationships shown in the drawings, and are only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or component referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as limiting the present invention. In addition, the terms "first" and "second" are used for descriptive purposes only and cannot be understood as indicating or implying relative importance.
[0091] In the description of the present invention, it should be noted that, unless otherwise clearly specified and limited, the terms "installed", "connected" and "connected" should be understood in a broad sense. For example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection, or it can be an indirect connection through an intermediate medium, or it can be a connection between the two components. When a component is referred to as being "fixed to" or "disposed on" another element, it can be directly on the other component or there can also be a central component. When a component is considered to be "connected" to another element, it can be directly connected to the other element or there can be a central element at the same time. For those of ordinary skill in the art, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.
[0092] It should be noted that the above modules can be implemented by software or hardware. For the latter, it can be implemented in the following ways, but not limited to: the above modules are all located in the same processor; or the above modules are located in different processors in any combination.
[0093] An embodiment of the present invention further provides a storage medium, in which a computer program is stored, wherein the computer program is configured to execute the steps of any of the above method embodiments when running.
[0094] In an exemplary embodiment, in this embodiment, the above storage medium may be configured to store a computer program for performing the following steps:
[0095] S1, when a test application is installed in a mobile terminal, calling an identification interface connecting the mobile terminal and the voice device through the test application, and waking up the voice device using the identification interface;
[0096] S2, when the voice device is successfully awakened through the recognition interface, the test application determines the corpus data to be tested corresponding to the voice device from the IoT cloud, and determines the test audio according to the corpus data;
[0097] S3, transmitting the test audio to the voice device to obtain a recognition result fed back by the voice device;
[0098] S4, comparing the recognition result with the expected result to determine whether the interactive function of the voice device is normal.
[0099] In an exemplary embodiment, in this embodiment, the above-mentioned storage medium may include but is not limited to: a USB flash drive, a read-only memory (ROM), a random access memory (RAM), a mobile hard disk, a magnetic disk or an optical disk, and other media that can store computer programs.
[0100] An embodiment of the present invention further provides an electronic device, including a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.
[0101] In an exemplary embodiment, the electronic device 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.
[0102] In an exemplary embodiment, in this embodiment, the processor may be configured to perform the following steps through a computer program:
[0103] S1, when a test application is installed in a mobile terminal, calling an identification interface connecting the mobile terminal and the voice device through the test application, and waking up the voice device using the identification interface;
[0104] S2, when the voice device is successfully awakened through the recognition interface, the test application determines the corpus data to be tested corresponding to the voice device from the IoT cloud, and determines the test audio according to the corpus data;
[0105] S3, transmitting the test audio to the voice device to obtain a recognition result fed back by the voice device;
[0106] S4, comparing the recognition result with the expected result to determine whether the interactive function of the voice device is normal.
[0107] In an exemplary embodiment, the specific examples in this embodiment can refer to the examples described in the above embodiments and optional implementation modes, and this embodiment will not be described in detail here.
[0108] Obviously, those skilled in the art should understand that the above modules or steps of the present invention can be implemented by a general computing device, they can be concentrated on a single computing device, or distributed on a network composed of multiple computing devices. In an exemplary embodiment, they can be implemented by a program code executable by a computing device, so that they can be stored in a storage device and executed by the computing device, and in some cases, the steps shown or described can be executed in a different order than here, or they can be made into individual integrated circuit modules, or multiple modules or steps therein can be made into a single integrated circuit module for implementation. In this way, the present invention is not limited to any specific combination of hardware and software.
[0109] The above is only a preferred implementation of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.
Claims
1. A method for testing a voice device, characterized in that: include: In the case where a test application is installed on the mobile terminal, calling the recognition interface connecting the mobile terminal and the voice device through the test application, and waking up the voice device using the recognition interface; When the voice device is successfully awakened through the recognition interface, the test application determines the corpus data to be tested corresponding to the voice device from the IoT cloud, and determines the test audio according to the corpus data; Transmitting the test audio to the voice device to obtain a recognition result fed back by the voice device; Comparing the recognition result with the expected result to determine whether the interactive function of the voice device is normal; After determining that the interactive function of the voice device is abnormal, the method further includes: Compare the recognition result with the corpus, classification of the corpus, interaction intention, and reply information of the expected result in sequence, and determine a first difference between a first similarity corresponding to the corpus and a first target similarity, a second difference between a second similarity corresponding to the classification of the corpus and a second target similarity, a third difference between a third similarity corresponding to the interaction intention and a third target similarity, and a fourth difference between a fourth similarity corresponding to the reply information and a fourth target similarity, select a maximum value from the first difference, the second difference, the third difference, and the fourth difference, and retest the test audio corresponding to the dimension indicated by the maximum value on the voice device.
2. The method for testing a voice device according to claim 1, characterized in that: Comparing the recognition result with the expected result to determine whether the interactive function of the voice device is normal, including: Divide the recognition result into multiple dimensions according to preset dimensions and compare them respectively; wherein the preset dimensions include at least one of the following: corpus, classification of corpus, interaction intention, and reply information; Determine an expected result corresponding to the test audio, wherein the expected result is reference data obtained by processing the collected corpus data by the IoT cloud; Comparing the similarity between the recognition result of each dimension of the multiple dimensions and the expected result to obtain at least one similarity; Determine whether the interactive function of the voice device is normal according to the at least one similarity.
3. The method for testing a voice device according to claim 2, characterized in that: Comparing the similarity between the recognition result of each dimension of the multiple dimensions and the expected result to obtain at least one similarity includes at least one of the following steps: In the case where the comparison dimension between the recognition result and the expected result is corpus, determining the difference between a first text of the corpus corresponding to the recognition result and a second text of the corpus corresponding to the expected result, and obtaining a first similarity, wherein the first similarity is the proportion of the corpus that is the same between the first text and the second text in the first text; In the case where the comparison dimension between the recognition result and the expected result is the classification of the corpus, determining the difference between the first parsed data corresponding to the recognition result and the second parsed data corresponding to the expected result, and obtaining a second similarity, wherein the second similarity is the proportion of the remaining data in the first parsed data excluding the parsed data different from the second parsed data; In a case where the comparison dimension between the recognition result and the expected result is intention, determining whether a first intention corresponding to the recognition result and a second intention corresponding to the expected result are the same, and obtaining a third similarity; When the comparison dimension between the recognition result and the expected result is reply information, the difference between the first reply information corresponding to the recognition result and the second reply information corresponding to the expected result is determined, and a fourth similarity is obtained, wherein the fourth similarity is the proportion of the same corpus as the first reply information and the second reply information in the first text.
4. The method for testing a voice device according to claim 3, characterized in that: Determining whether the interactive function of the voice device is normal according to the at least one similarity includes: When it is determined that there is a first comparison result, it is determined that the voice device interaction function is normal, wherein the first comparison result includes: the first similarity is greater than or equal to the first target similarity, the second similarity is greater than or equal to the second target similarity, the third similarity is greater than or equal to the third target similarity, and the fourth similarity is greater than or equal to at least one of the fourth target similarity.
5. The method for testing a voice device according to claim 3, characterized in that: The method further comprises: determining whether the interactive function of the voice device is normal according to the at least one similarity: When it is determined that there is a second comparison result, it is determined that the voice device interaction function is abnormal, wherein the second comparison result includes at least one of the first similarity being less than a first target similarity, the second similarity being less than a second target similarity, the third similarity being less than a third target similarity, and the fourth similarity being less than a fourth target similarity.
6. The method for testing a voice device according to claim 5, characterized in that: After determining that the voice device interaction function is abnormal, the method further includes: determining at least one abnormal similarity from the first similarity, the second similarity, the third similarity, and the fourth similarity according to the second comparison result, wherein the abnormal similarity is less than the corresponding target similarity; Determining a comparison dimension in which an anomaly exists according to the anomaly similarity; The target module corresponding to the abnormal interactive function of the voice device is determined according to the comparison dimension of the anomaly, wherein the target module includes at least one of the following: a voice recognition module, a semantic analysis module, and a voice interaction module.
7. The method for testing a voice device according to any one of claims 1 to 6, characterized in that: After comparing the recognition result with the expected result to determine whether the interactive function of the voice device is normal, the method further includes: When it is determined that the voice device interaction function is normal, binding the recognition result with a device identifier corresponding to the voice device; Add test information that the interaction test is normal in the test record corresponding to the voice device in the test application.
8. The method for testing a voice device according to any one of claims 1 to 6, characterized in that: In the case where the voice device is successfully awakened through the recognition interface, the test application determines the corpus data to be tested corresponding to the voice device from the IoT cloud, and determines the test audio according to the corpus data, including: Obtaining corpus data collected by the IoT cloud within a preset period; Filtering target corpus data for testing from the corpus data according to preset data types; The target corpus data is converted to generate test audio for testing the speech device.
9. A testing device for a voice device, characterized in that: include: A wake-up module, used for, when a test application is installed in a mobile terminal, calling the recognition interface connecting the mobile terminal and the voice device through the test application, and waking up the voice device using the recognition interface; A determination module, configured to, when the voice device is successfully awakened through the recognition interface, cause the test application to determine the corpus data to be tested corresponding to the voice device from the IoT cloud, and determine the test audio according to the corpus data; A test module, used to transmit the test audio to the voice device and obtain a recognition result fed back by the voice device; A comparison module, used to compare the recognition result with the expected result to determine whether the interactive function of the voice device is normal; The comparison module also includes: a difference unit, which is used to compare the recognition result with the corpus, classification of the corpus, interaction intention, and reply information of the expected result in sequence after determining that the interactive function of the voice device is abnormal, and determine a first difference between a first similarity corresponding to the corpus and a first target similarity, a second difference between a second similarity corresponding to the classification of the corpus and a second target similarity, a third difference between a third similarity corresponding to the interaction intention and a third target similarity, and a fourth difference between a fourth similarity corresponding to the reply information and a fourth target similarity, select a maximum value from the first difference, the second difference, the third difference, and the fourth difference, and retest the test audio corresponding to the dimension indicated by the maximum value on the voice device.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a stored program, wherein the program executes the method according to any one of claims 1 to 8 when executed.
