Testing method and device for voice interaction function, storage medium and electronic device
By analyzing the interactive interface elements and response information of the client, combining test scripts and search servers, automated voice interaction function testing is realized, solving the problem of cumbersome and time-consuming testing in the existing technology, and improving the testing efficiency and accuracy .
Patent Information
- Application Number
- CN202210552454.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-05-20
- Publication Date
- 2024-12-20
- Estimated Expiration
- 2042-05-20
AI Technical Summary
In the prior art, the voice interaction function test of clients lacks automation, which leads to cumbersome and time-consuming and easy to miss tests, and cannot effectively ensure the accuracy of the test results.
By obtaining the test text and playing the test audio on the target host computer, analyzing the client's interactive interface elements, determining the converted text and response information, setting similar value thresholds to automatically judge the normality of the voice interaction function, and using the test script to simulate clicking on the microphone control and search server to obtain preset response information to realize automated testing.
It improves the efficiency of voice interaction function testing, reduces manual intervention, ensures the accuracy of test results, and avoids omissions in multi-corpus situations.
Smart Images

Figure CN114999494B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of communications, and in particular to a method and device for testing a voice interaction function, a storage medium and an electronic device. Background Art
[0002] Clients with voice interaction functions, i.e. intelligent voice applications, must pass a series of tests before going online to ensure that the voice interaction functions of the client are normal, and only then can they pass the tests and finally go online for download. As an emerging function, the voice interaction function of the client has no automated testing software for online testing, and only relies on manual testing by assembly line workers to verify according to test instructions, which not only greatly reduces the efficiency of client online, but also makes it difficult to guarantee the accuracy of test results due to manual participation.
[0003] Currently, there is no automated testing software for the online testing of the client. When testing the voice interaction of the intelligent voice application, it is necessary to manually click the "wake-up" button, then input the voice, and after receiving the reply, manually judge the correctness of the result to determine the success rate of the voice interaction. This testing solution has the disadvantages of being cumbersome, time-consuming, and easy to miss tests.
[0004] In the related technologies, the testing scheme for the voice interaction function of the client is cumbersome, time-consuming, and prone to missed tests, and no effective solution has been proposed yet. Summary of the invention
[0005] The embodiments of the present invention provide a method and device for testing a voice interaction function, a storage medium and an electronic device, so as to at least solve the problems in the related art that the testing scheme for the voice interaction function of the client is cumbersome, time-consuming, and easy to miss the test.
[0006] According to an embodiment of the present invention, a method for testing a voice interaction function is provided, including: obtaining a first test text for testing a voice interaction function of a client; when a target host computer corresponding to the client plays a corresponding test audio according to the first test text, determining a second test text obtained by the client converting the test audio by analyzing a first interface element in an interactive interface of the client, and determining first response information of the client in response to the test audio; when a first similarity value between the first test text and the second test text is greater than or equal to a first preset threshold, and a second similarity value between the first response information and the preset response information is greater than or equal to a second preset threshold, determining that the voice interaction function of the client is normal.
[0007] In an exemplary embodiment, by analyzing the first interface element in the interactive interface of the client, determining the second test text obtained by the client according to the test audio conversion, and determining the first response information of the client in response to the test audio, the method includes: obtaining a first test script for locating a text box in the interactive interface corresponding to the client; analyzing the first interface element in the interactive interface of the client through the first test script to obtain the first text box and the second text box in the first interface element; extracting the first text information in the first text box, and determining the second test text obtained by the client according to the first text information conversion of the test audio; and extracting the second text information in the second text box, and determining the first response information of the client in response to the test audio according to the second text information.
[0008] In an exemplary embodiment, determining a second test text obtained by the client according to the test audio conversion and determining first response information of the client in response to the test audio include: determining a first similarity value between the first test text and the second test text when the second test text converted by the client according to the test audio is obtained; when the first similarity value between the first test text and the second test text is less than the first preset threshold, controlling the host computer to play the corresponding test audio again according to the first test text, obtaining a third test text obtained by the client according to the test audio conversion and a third similarity value between the first test text and the third test text; and determining first response information of the client in response to the test audio when the third similarity value is greater than or equal to the first preset threshold.
[0009] In an exemplary embodiment, before determining that the voice interaction function of the client is normal, the method also includes: sending a request to a search server to obtain preset response information corresponding to the test audio; upon receiving a second response information sent by the search server in response to the acquisition request, extracting a first keyword of the preset response information, and extracting a second keyword of the first response information, wherein the second response information contains the preset response information; determining a similarity value between the first keyword and the second keyword, and using the similarity value as a second similarity value between the first response information and the preset response information.
[0010] In an exemplary embodiment, before obtaining a first test text for testing the voice interaction function of a client, the method further includes: obtaining a second test script for simulating clicking a microphone control in an interactive interface corresponding to the client; analyzing a second interface element in the interactive interface corresponding to the client through the second test script, and determining a microphone control in the second interface element; and simulating clicking the microphone control through the second test script to enable the voice interaction function of the client.
[0011] In an exemplary embodiment, after determining a second test text obtained by the client according to conversion of the test audio, and determining a first response message of the client in response to the test audio, the method further includes: determining that a voice interaction function of the client is abnormal when a first similarity value between the first test text and the second test text is less than a first preset threshold, and / or a second similarity value between the first response message and the preset response message is less than a second preset threshold; determining abnormal reason information of the abnormal voice interaction function of the client according to the second test text and the first response message; and sending the abnormal reason information to a server system corresponding to the client.
[0012] In an exemplary embodiment, after obtaining a first test text for testing a voice interaction function of a client, the method further includes: determining a target host computer having a text-to-speech conversion function among multiple host computers; sending the first test text to the target host computer, so that the target host computer converts the first test text into a test audio through the text-to-speech conversion function, and plays the test audio.
[0013] According to another embodiment of the embodiments of the present invention, a testing device for voice interaction function is also provided, including: an acquisition module, used to acquire a first test text for testing the voice interaction function of a client; a first determination module, used to determine a second test text obtained by the client converting the test audio and a first response information of the client in response to the test audio by analyzing a first interface element in an interactive interface of the client, when a target host computer corresponding to the client plays a corresponding test audio according to the first test text; and a second determination module, used to determine that the voice interaction function of the client is normal when a first similarity value between the first test text and the second test text is greater than or equal to a first preset threshold, and a second similarity value between the first response information and the preset response information is greater than or equal to a second preset threshold.
[0014] According to another aspect of an embodiment of the present invention, a computer-readable storage medium is provided, in which a computer program is stored, wherein the computer program is configured to execute the test method for the above-mentioned voice interaction function when running.
[0015] According to another aspect of an embodiment of the present invention, there is also provided an electronic device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the test method for the voice interaction function through the computer program.
[0016] In an embodiment of the present invention, a first test text for testing a voice interaction function of a client is obtained; when a target host computer corresponding to the client plays a corresponding test audio according to the first test text, a second test text obtained by converting the test audio by the client is determined by analyzing a first interface element in an interactive interface of the client, and first response information of the client in response to the test audio is determined; when a first similarity value between the first test text and the second test text is greater than or equal to a first preset threshold, and a second similarity value between the first response information and the preset response information is greater than or equal to a second preset threshold, it is determined that the voice interaction function of the client is normal; the above technical solution is adopted to solve the problems that the test solution for the voice interaction function of the client is cumbersome and time-consuming, and easy to miss, and the like, and thus the efficiency of inputting test corpus when testing the voice interaction function of the client can be improved; and even in the case of a large amount of corpus, some corpus will not be missed. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] 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.
[0018] 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.
[0019] Figure 1 It is a hardware environment schematic diagram of a method for testing a voice interaction function according to an embodiment of the present application;
[0020] Figure 2 is a flow chart of a method for testing a voice interaction function according to an embodiment of the present invention;
[0021] Figure 3is a system block diagram of a method for testing a voice interaction function according to an optional embodiment of the present invention;
[0022] Figure 4 is a flow chart of a method for testing a voice interaction function according to an optional embodiment of the present invention;
[0023] Figure 5 is a schematic diagram of a method for testing a voice interaction function according to an optional embodiment of the present invention;
[0024] Figure 6 It is a structural block diagram of a testing device for voice interaction function according to an embodiment of the present invention. DETAILED DESCRIPTION
[0025] 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.
[0026] 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.
[0027] According to one aspect of an embodiment of the present application, a method for testing a voice interaction function is provided. The method for testing the voice interaction function is widely used in smart home, smart home, smart home device ecology, smart home ecology and other whole-house intelligent digital control application scenarios. Optionally, in this embodiment, the method for testing the voice interaction function 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.
[0028] 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.
[0029] In this embodiment, a method for testing a voice interaction function is provided. Figure 2 1 is a flow chart of a method for testing a voice interaction function according to an embodiment of the present invention, the flow chart comprising the following steps:
[0030] Step S202, obtaining a first test text for testing a voice interaction function of a client;
[0031] Step S204, when the target host computer corresponding to the client plays the corresponding test audio according to the first test text, by analyzing the first interface element in the interactive interface of the client, determining the second test text obtained by the client converting the test audio, and determining the first response information of the client in response to the test audio;
[0032] Step S206, when the first similarity value between the first test text and the second test text is greater than or equal to a first preset threshold, and the second similarity value between the first response information and the preset response information is greater than or equal to a second preset threshold, it is determined that the voice interaction function of the client is normal.
[0033] Through the above steps, a first test text for testing the voice interaction function of the client is obtained; when the target host computer corresponding to the client plays the corresponding test audio according to the first test text, the second test text obtained by the client converting the test audio is determined by analyzing the first interface element in the interactive interface of the client, and the first response information of the client in response to the test audio is determined; when the first similarity value between the first test text and the second test text is greater than or equal to the first preset threshold, and the second similarity value between the first response information and the preset response information is greater than or equal to the second preset threshold, it is determined that the voice interaction function of the client is normal, which solves the problems in the related art that the test scheme for the voice interaction function of the client is cumbersome and time-consuming, and easy to miss, and further improves the efficiency of inputting test corpus when testing the voice interaction function of the client; and even in the case of a large amount of corpus, some corpus will not be missed.
[0034] In an exemplary embodiment, by analyzing the first interface element in the interactive interface of the client, determining the second test text obtained by the client according to the test audio conversion, and determining the first response information of the client in response to the test audio, the method includes: obtaining a first test script for locating a text box in the interactive interface corresponding to the client; analyzing the first interface element in the interactive interface of the client through the first test script to obtain the first text box and the second text box in the first interface element; extracting the first text information in the first text box, and determining the second test text obtained by the client according to the first text information conversion of the test audio; and extracting the second text information in the second text box, and determining the first response information of the client in response to the test audio according to the second text information.
[0035] That is to say, in order to automatically test the voice interaction function of the client, it is necessary to construct a first test script for locating the text box in the interactive interface corresponding to the client, obtain a second test script for simulating clicking the microphone control in the interactive interface corresponding to the client, and other multiple test scripts; when determining the second test text obtained by the client according to the test audio conversion, and determining the first response information of the client in response to the test audio, obtain a pre-constructed first test script for locating the text box in the interactive interface corresponding to the client, determine the positions of the first text box and the second text box in the interactive interface of the client through the first test script, and extract the first text information in the first text box and the second text information in the second text box, the first text information is the second test text obtained by the client according to the test audio conversion, and the second text information is the first response information of the client in response to the test audio.
[0036] In an exemplary embodiment, determining a second test text converted by the client according to the test audio, and determining first response information of the client in response to the test audio, comprises the following steps:
[0037] Step S2041: when obtaining a second test text converted by the client according to the test audio, determining a first similarity value between the first test text and the second test text;
[0038] Step S2042: when the first similarity value between the first test text and the second test text is less than the first preset threshold, controlling the host computer to play the corresponding test audio according to the first test text again;
[0039] Step S2043: obtaining a third test text converted by the client according to the test audio, and a third similarity value between the first test text and the third test text;
[0040] Step S2044: when the third similarity value is greater than or equal to the first preset threshold, determine the first response information of the client in response to the test audio; when the third similarity value is less than the first preset threshold, execute steps S2042-S2043.
[0041] That is to say, first, determine the first similarity value between the second test text obtained by the client converting the test audio and the first test text corresponding to the test audio; when the first similarity value is less than the first preset threshold, determine that the voice conversion function of the client is abnormal; when the first similarity value is greater than or equal to the first preset threshold, determine that the voice conversion function of the client is normal; secondly, when the voice conversion function of the client is normal, determine the first response information of the client in response to the test audio; when the voice conversion function of the client is abnormal, the client again converts according to the test audio to obtain a third test text, and determines the third similarity value between the first test text and the third test text.
[0042] It should be noted that the voice interaction function includes: a voice conversion function and a voice response function. When the similarity value between the test text obtained by the client converting the test audio and the test text corresponding to the test audio is greater than or equal to a first preset threshold, the voice conversion function of the client is determined to be normal; when the similarity between the response information of the client in response to the test audio and the preset response information is greater than or equal to a second preset threshold, the voice response function of the client is determined to be normal.
[0043] In an exemplary embodiment, before determining that the voice interaction function of the client is normal, a request for obtaining preset response information corresponding to the test audio is sent to a search server; upon receiving a second response information sent by the search server in response to the acquisition request, a first keyword of the preset response information is extracted, and a second keyword of the first response information is extracted, wherein the second response information contains the preset response information; a similarity value between the first keyword and the second keyword is determined, and the similarity value is used as the second similarity value between the first response information and the preset response information.
[0044] An embodiment of the present invention provides a method for determining a second similarity value between first response information and preset response information, which is specifically as follows: sending a request for obtaining preset response information corresponding to the test audio to a search server; the search server sends the preset response information to a server system according to the acquisition request, and when the server receives the preset response information, extracts the first keyword of the preset response information and extracts the second keyword of the first response information; and determining the second similarity value between the first response information and the preset response information according to the similarity value of the first keyword and the second keyword.
[0045] For example, when the test audio is "How is the weather today", the first response information of the client is determined to be "Today's weather is sunny, the temperature is 10℃-15℃", and the preset response information sent by the search server is "The temperature is 10℃-15℃, the weather is sunny", and the first keyword is extracted as "Temperature: 10℃-15℃, sunny", and the second keyword is "Sunny, temperature: 10℃-15℃", and the similarity value of the first keyword and the second keyword is used as the second similarity value of the first response information and the preset response information. It should be noted that the above embodiment is only for a better understanding of the present invention, and the present invention is not limited to the above numerical values.
[0046] In an exemplary embodiment, before obtaining a first test text for testing the voice interaction function of a client, a second test script for simulating clicking a microphone control in an interactive interface corresponding to the client is obtained; a second interface element in the interactive interface corresponding to the client is analyzed by the second test script, and a microphone control is determined in the second interface element; and a click on the microphone control is simulated by the second test script to enable the voice interaction function of the client.
[0047] That is to say, the embodiment of the present invention can also realize automatic clicking of the microphone control of the client. Specifically, the microphone control is determined in the interactive interface through the second test script, and the second test script is used to simulate clicking the microphone control to turn on the voice interaction function of the client, thereby achieving the technical effect of simulating waking up the device and making functional testing more intelligent.
[0048] In an exemplary embodiment, after determining a second test text obtained by the client according to conversion of the test audio, and determining a first response message of the client in response to the test audio, when a first similarity value between the first test text and the second test text is less than a first preset threshold, and / or a second similarity value between the first response message and the preset response message is less than a second preset threshold, it is determined that the voice interaction function of the client is abnormal; based on the second test text and the first response message, abnormal reason information of the abnormal voice interaction function of the client is determined; and the abnormal reason information is sent to the server system corresponding to the client.
[0049] That is to say, the abnormal reason information of the voice interaction function is determined so that the target object can optimize the client according to the abnormal reason information; for example, the abnormal reason information is: the similarity between the text information converted by the client and the text information corresponding to the test audio is less than a preset threshold, and the voice conversion function has an abnormality; the similarity between the response information of the client in response to the test audio and the preset response information corresponding to the test audio is less than a preset threshold, and the voice response function has an abnormality, etc.
[0050] In an exemplary embodiment, after obtaining a first test text for testing the voice interaction function of a client, a target host computer having a text-to-speech conversion function is determined among multiple host computers; the first test text is sent to the target host computer so that the target host computer converts the first test text into a test audio through the text-to-speech conversion function, and plays the test audio.
[0051] In an embodiment of the present invention, the test audio is automatically played by the host computer. Therefore, when determining the target host computer, it is necessary to determine the target host computer with the text-to-speech conversion function among multiple host computers, so that when the server system sends the test text to the target host computer, the target host computer can convert the first test text into test audio and play the test audio.
[0052] In order to better understand the process of the testing method of the above-mentioned voice interaction function, the implementation method flow of the testing of the above-mentioned voice interaction function is described below in combination with an optional embodiment, but it is not used to limit the technical solution of the embodiment of the present invention.
[0053] In this embodiment, a method for testing a voice interaction function is provided. Figure 3 It is a system block diagram of a method for testing the voice interaction function according to an optional embodiment of the present invention, specifically comprising: a host computer, a cloud server (equivalent to the above-mentioned server system), and an Android device equipped with an intelligent voice application (equivalent to the client in the above-mentioned embodiment).
[0054] The specific process of the test method for the voice interaction function provided in this application is as follows Figure 4 As shown, Figure 4 This is a flow chart of a method for testing a voice interaction function according to an optional embodiment of the present invention, which includes the following steps:
[0055] Step S401: start the test;
[0056] Step S402: Start the voice application through the test script and jump to the voice interaction interface;
[0057] In this solution, an automated testing framework, such as APPIUM, is used to simulate manual operation, open the voice application to be tested, and jump to the voice interaction interface to be tested, such as Figure 5 , Figure 5 It is a schematic diagram of a method for testing a voice interaction function according to an optional embodiment of the present invention.
[0058] Step S403: Simulate clicking the wake-up button, such as Figure 5 The microphone icon in the
[0059] The interface elements are analyzed through a test script (equivalent to the second test script in the above embodiment), the microphone icon is located, and a manual click is simulated to wake up the device and enter the sound pickup process.
[0060] Step S404: Determine whether to enter the sound pickup process; if the sound pickup process is entered, execute step S405, otherwise, execute step S403;
[0061] Step S405: Control the host computer to play the test audio through the test script;
[0062] Specifically, the test corpus (equivalent to the test text in the above embodiment) is converted into a test audio through TTS (Text To Speech) and played to the device under test;
[0063] Step S406: Determine whether the text converted by the intelligent voice application is consistent with the text corresponding to the test audio;
[0064] If the text converted by the intelligent voice application is consistent with the text corresponding to the test audio, execute step S407; otherwise, execute step S405;
[0065] Step S407: extracting the reply of the intelligent voice application (equivalent to the first response information in the above embodiment);
[0066] Step S408: Compare the received reply with the expected reply (equivalent to the preset response information in the above embodiment) to determine whether it meets the expectations; if it meets the expectations, execute step S409, otherwise execute step S410;
[0067] For example, if the user inputs "weather" and receives a reply such as "Beijing's weather is cloudy to sunny today", the text box can be located and keywords such as "weather", "degrees", "wind", etc. can be extracted and compared with the expected reply. If it is consistent with the expected reply, the interaction is marked as successful, otherwise it is marked as failed.
[0068] Step S409: The interaction result is successful;
[0069] Step S410: The interaction result fails.
[0070] Through the above embodiments, the problems in the related art such as the testing scheme for the voice interaction function of the client being cumbersome and time-consuming and easy to miss are solved, thereby improving the efficiency of inputting test corpora when testing the voice interaction function of the client; and even when there is a lot of corpora, some corpora will not be missed.
[0071] 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 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 is essentially 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 a terminal device (which can be a mobile phone, a computer, a server, or a network device, etc.) to execute the methods of various embodiments of the present invention.
[0072] In the present embodiment, a test device for voice interaction function is also provided, and the test device for voice interaction function 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.
[0073] Figure 6 is a structural block diagram of a test device for a voice interaction function according to an embodiment of the present invention; Figure 6 As shown, including:
[0074] An acquisition module 62 is used to acquire a first test text for performing a voice interaction function test on a client;
[0075] A first determination module 64 is used to determine, when the target host computer corresponding to the client plays the corresponding test audio according to the first test text, a second test text obtained by the client converting the test audio by analyzing a first interface element in the interactive interface of the client, and determine first response information of the client responding to the test audio;
[0076] The second determination module 66 is used to determine that the voice interaction function of the client is normal when the first similarity value between the first test text and the second test text is greater than or equal to a first preset threshold, and the second similarity value between the first response information and the preset response information is greater than or equal to a second preset threshold.
[0077] Through the above-mentioned device, a first test text for testing the voice interaction function of the client is obtained; when the target host computer corresponding to the client plays the corresponding test audio according to the first test text, the second test text obtained by the client converting the test audio is determined by analyzing the first interface element in the interactive interface of the client, and the first response information of the client in response to the test audio is determined; when the first similarity value between the first test text and the second test text is greater than or equal to the first preset threshold, and the second similarity value between the first response information and the preset response information is greater than or equal to the second preset threshold, it is determined that the voice interaction function of the client is normal, which solves the problems in the related art that the test scheme for the voice interaction function of the client is cumbersome and time-consuming, and easy to miss, and further improves the efficiency of inputting test corpus when testing the voice interaction function of the client; and even in the case of a large amount of corpus, some corpus will not be missed.
[0078] In an exemplary embodiment, a first determination module is used to obtain a first test script for locating a text box in an interactive interface corresponding to the client; analyze a first interface element in the interactive interface of the client through the first test script to obtain a first text box and a second text box in the first interface element; extract the first text information in the first text box, and determine a second test text obtained by the client converting the test audio according to the first text information; and extract the second text information in the second text box, and determine first response information of the client in response to the test audio according to the second text information.
[0079] In an exemplary embodiment, a first determination module is used to determine a first similarity value between the first test text and the second test text when a second test text converted by the client according to the test audio is obtained; when the first similarity value between the first test text and the second test text is less than the first preset threshold, control the host computer to play the corresponding test audio again according to the first test text, obtain a third test text converted by the client according to the test audio, and a third similarity value between the first test text and the third test text; when the third similarity value is greater than or equal to the first preset threshold, determine the first response information of the client in response to the test audio.
[0080] In an exemplary embodiment, a second determination module is used to send a request to a search server to obtain preset response information corresponding to the test audio; upon receiving second response information sent by the search server in response to the acquisition request, extract the first keyword of the preset response information, and extract the second keyword of the first response information, wherein the second response information includes the preset response information; determine a similarity value between the first keyword and the second keyword, and use the similarity value as the second similarity value between the first response information and the preset response information.
[0081] In an exemplary embodiment, a first determination module is used to obtain a second test script for simulating a click on a microphone control in an interactive interface corresponding to a client; analyze a second interface element in the interactive interface corresponding to the client through the second test script, and determine the microphone control in the second interface element; and simulate a click on the microphone control through the second test script to enable a voice interaction function of the client.
[0082] In an exemplary embodiment, a second determination module is used to determine that the voice interaction function of the client is abnormal when a first similarity value between the first test text and the second test text is less than a first preset threshold, and / or a second similarity value between the first response information and the preset response information is less than a second preset threshold; determine abnormal cause information of the abnormal voice interaction function of the client based on the second test text and the first response information; and send the abnormal cause information to the server system corresponding to the client.
[0083] In an exemplary embodiment, the first determination module is used to determine the target host computer with a text-to-speech conversion function among multiple host computers; send the first test text to the target host computer so that the target host computer converts the first test text into a test audio through the text-to-speech conversion function, and plays the test audio.
[0084] An embodiment of the present invention further provides a storage medium, which includes a stored program, wherein the program executes any of the above methods when it is run.
[0085] Optionally, in this embodiment, the storage medium may be configured to store program codes for executing the following steps:
[0086] S1, obtaining a first test text for testing a voice interaction function of a client;
[0087] S2, when the target host computer corresponding to the client plays the corresponding test audio according to the first test text, by analyzing the first interface element in the interactive interface of the client, determining the second test text obtained by the client converting the test audio, and determining the first response information of the client in response to the test audio;
[0088] S3, when the first similarity value between the first test text and the second test text is greater than or equal to a first preset threshold, and the second similarity value between the first response information and the preset response information is greater than or equal to a second preset threshold, it is determined that the voice interaction function of the client is normal.
[0089] 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.
[0090] Optionally, 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.
[0091] Optionally, in this embodiment, the processor may be configured to perform the following steps through a computer program:
[0092] S1, obtaining a first test text for testing a voice interaction function of a client;
[0093] S2, when the target host computer corresponding to the client plays the corresponding test audio according to the first test text, by analyzing the first interface element in the interactive interface of the client, determining the second test text obtained by the client converting the test audio, and determining the first response information of the client in response to the test audio;
[0094] S3, when the first similarity value between the first test text and the second test text is greater than or equal to a first preset threshold, and the second similarity value between the first response information and the preset response information is greater than or equal to a second preset threshold, it is determined that the voice interaction function of the client is normal.
[0095] Optionally, 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 program codes.
[0096] Optionally, the specific examples in this embodiment may refer to the examples described in the above embodiments and optional implementation modes, and this embodiment will not be described in detail here.
[0097] 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, and optionally, 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. Thus, the present invention is not limited to any specific combination of hardware and software.
[0098] 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 interaction function, characterized in that: include: Obtaining a first test text for testing a voice interaction function of a client; In a case where the target host computer corresponding to the client plays the corresponding test audio according to the first test text, by analyzing the first interface element in the interactive interface of the client, determining the second test text obtained by the client converting the test audio, and determining the first response information of the client in response to the test audio; When a first similarity value between the first test text and the second test text is greater than or equal to a first preset threshold, and a second similarity value between the first response information and the preset response information is greater than or equal to a second preset threshold, determining that the voice interaction function of the client is normal; Before determining that the voice interaction function of the client is normal, the method further includes: Sending a request to a search server to obtain preset response information corresponding to the test audio; Upon receiving the second response information sent by the search server in response to the acquisition request, extracting the first keyword of the preset response information and extracting the second keyword of the first response information, wherein the second response information includes the preset response information; A similarity value between the first keyword and the second keyword is determined, and the similarity value is used as a second similarity value between the first response information and the preset response information.
2. The method according to claim 1, characterized in that The method includes analyzing a first interface element in an interactive interface of the client, determining a second test text converted by the client according to the test audio, and determining first response information of the client in response to the test audio, including: Obtaining a first test script for locating a text box in an interactive interface corresponding to the client; Analyzing a first interface element in the interactive interface of the client through the first test script to obtain a first text box and a second text box in the first interface element; Extract the first text information in the first text box, and determine the second test text obtained by the client converting the test audio according to the first text information; and extract the second text information in the second text box, and determine the first response information of the client in response to the test audio according to the second text information.
3. The method according to claim 1, characterized in that Determining a second test text converted by the client according to the test audio, and determining first response information of the client in response to the test audio, includes: In a case where a second test text converted by the client according to the test audio is obtained, determining a first similarity value between the first test text and the second test text; When the first similarity value between the first test text and the second test text is less than the first preset threshold, control the host computer to play the corresponding test audio according to the first test text again, obtain the third test text converted by the client according to the test audio, and the third similarity value between the first test text and the third test text; When the third similarity value is greater than or equal to the first preset threshold, first response information of the client in response to the test audio is determined.
4. The method according to any one of claims 1 to 3, characterized in that: Before obtaining a first test text for performing a voice interaction function test on the client, the method further includes: Obtain a second test script for simulating clicking a microphone control in an interactive interface corresponding to the client; Analyzing a second interface element in the interactive interface corresponding to the client through the second test script, and determining a microphone control in the second interface element; The second test script simulates clicking the microphone control to enable the voice interaction function of the client.
5. The method according to any one of claims 1 to 3, characterized in that: After determining the second test text converted by the client according to the test audio, and determining the first response information of the client in response to the test audio, the method further includes: When a first similarity value between the first test text and the second test text is less than a first preset threshold, and / or a second similarity value between the first response information and the preset response information is less than a second preset threshold, determining that the voice interaction function of the client is abnormal; Determine, according to the second test text and the first response information, abnormal reason information of the abnormal voice interaction function of the client; The abnormal reason information is sent to the server system corresponding to the client.
6. The method according to any one of claims 1 to 3, characterized in that: After obtaining the first test text for performing a voice interaction function test on the client, the method further includes: Determining the target host computer having a text-to-speech conversion function among multiple host computers; The first test text is sent to the target host computer, so that the target host computer converts the first test text into a test audio through a text-to-speech conversion function, and plays the test audio.
7. A test device for voice interaction function, characterized in that: include: An acquisition module, used to acquire a first test text for testing a voice interaction function of a client; A first determination module is used to determine, when the target host computer corresponding to the client plays the corresponding test audio according to the first test text, a second test text obtained by the client converting the test audio by analyzing a first interface element in the interactive interface of the client, and determine first response information of the client responding to the test audio; A second determination module is used to determine that the voice interaction function of the client is normal when the first similarity value between the first test text and the second test text is greater than or equal to a first preset threshold, and the second similarity value between the first response information and the preset response information is greater than or equal to a second preset threshold; wherein the second determination module is also used to send a request to the search server to obtain the preset response information corresponding to the test audio; when receiving the second response information sent by the search server in response to the acquisition request, extract the first keyword of the preset response information and the second keyword of the first response information, wherein the second response information contains the preset response information; determine the similarity value between the first keyword and the second keyword, and use the similarity value as the second similarity value between the first response information and the preset response information.
8. A computer-readable storage medium, characterized in that: The computer-readable storage medium includes a stored program, wherein the program executes the method described in any one of claims 1 to 6 when executed.
9. An electronic device comprising a memory and a processor, characterized in that: A computer program is stored in the memory, and the processor is configured to execute the method according to any one of claims 1 to 6 through the computer program.
