Script generation method, device and script generation system
By recording and recognizing command keywords in the voice information of the device under test to generate script files, the problem of low efficiency in manual broadcast testing is solved, achieving efficient voice testing and accurate test results, and reducing labor costs.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-04-28
- Publication Date
- 2026-03-20
AI Technical Summary
Existing technologies for testing voice operation functions are inefficient, relying on manual broadcasting, which leads to high labor costs and low efficiency.
After the device under test receives the test start command, it records and recognizes the command keywords in the voice information, generates voice log data, and sends it to the data processing device to generate a script file. The script file records the command keywords and audio identifiers for automatic playback of voice information.
It improves the efficiency of voice testing, reduces labor costs, can reproduce the actual recording scenario, improves testing accuracy, and simplifies the script file generation process.
Smart Images

Figure CN116721650B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application belongs to the field of data processing, and particularly relates to a script generation method and device and a script generation system. BACKGROUND
[0002] With the improvement of product intelligence, the voice operation function has become one of the indispensable functions of products.
[0003] At present, the test process of the voice operation function of the product usually adopts a manual broadcast test mode. That is, a voice information is artificially output to a to-be-tested device to test whether the to-be-tested device can receive the voice information and execute a processing operation corresponding to the voice information. For example, a test personnel outputs "turn on music" to the to-be-tested device and checks whether the to-be-tested device will play music. However, the manual broadcast test mode has low efficiency. SUMMARY
[0004] The script generation method, device and script generation system provided by the embodiments of the present application can solve the problem of low efficiency of the manual broadcast test mode to a certain extent.
[0005] In a first aspect, a script generation method is provided, applied to a data processing device, and the method comprises:
[0006] In response to a script recording start instruction, a test start instruction is sent to the to-be-tested device, so that the to-be-tested device, in the case of receiving voice information, records and stores the voice information in response to the voice information, identifies an instruction keyword included in the voice information, executes a processing operation corresponding to the instruction keyword, generates voice log data, and the voice log data at least records the instruction keyword and an audio identifier of the voice information, and the audio identifier is used to indicate an audio storage address of the voice information;
[0007] Voice log data sent by the to-be-tested device is received;
[0008] Based on the voice log data, a script file is generated, and the script file at least includes the instruction keyword and the audio identifier.
[0009] In a second aspect, a script generation method is provided, applied to a to-be-tested device, and the method comprises:
[0010] In the case of receiving a test start instruction sent by a data processing device, voice information is received;
[0011] In response to the voice information, the voice information is recorded and stored;
[0012] An instruction keyword included in the voice information is identified;
[0013] perform a processing operation corresponding to the instruction keyword, and generate voice log data, the voice log data at least recording the instruction keyword and an audio identifier of the voice information, the audio identifier being used to indicate an audio storage address of the voice information;
[0014] send the voice log data to the data processing device, so that the data processing device generates a script file based on the voice log data, the script file at least including the instruction keyword and the audio identifier.
[0015] In a third aspect, a script generation apparatus is provided, and applied to a data processing device, the apparatus comprising:
[0016] a sending module, configured to, in response to a script recording start instruction, send a test start instruction to the device under test, so that the device under test, upon receiving voice information, records and stores the voice information in response to the voice information, identifies an instruction keyword included in the voice information, performs a processing operation corresponding to the instruction keyword, and generates voice log data, the voice log data at least recording the instruction keyword and an audio identifier of the voice information, the audio identifier being used to indicate an audio storage address of the voice information;
[0017] a receiving module, configured to receive voice log data sent by the device under test;
[0018] a generating module, configured to generate a script file based on the voice log data, the script file at least including the instruction keyword and the audio identifier.
[0019] In a fourth aspect, a script generation apparatus is provided, and applied to a device under test, the apparatus comprising:
[0020] a receiving module, configured to, upon receiving a test start instruction sent by a data processing device, receive voice information;
[0021] a recording module, configured to, in response to the voice information, record and store the voice information;
[0022] an identifying module, configured to identify an instruction keyword included in the voice information;
[0023] a generating module, configured to perform a processing operation corresponding to the instruction keyword, and generate voice log data, the voice log data at least recording the instruction keyword and an audio identifier of the voice information, the audio identifier being used to indicate an audio storage address of the voice information;
[0024] The sending module is used to send the voice log data to the data processing device, so that the data processing device generates a script file based on the voice log data, the script file including at least the instruction keywords and the audio identifier.
[0025] Fifthly, a script generation system is provided, the script generation system comprising: a data processing device and a device under test, the data processing device being used to implement any of the methods described in the first aspect above, and the device under test being used to implement any of the methods described in the second aspect above.
[0026] A sixth aspect provides an electronic device, comprising: a processor and a memory; the memory for storing a computer program; the processor for executing the program stored in the memory to implement the steps of the method as described in any of the first aspects; or to implement the steps of the method as described in any of the second aspects.
[0027] A seventh aspect provides a readable storage medium storing a program or instructions that, when executed by a processor, implement the steps of the method as described in any of the first aspects; or, implement the steps of the method as described in any of the second aspects.
[0028] The script generation method, apparatus, and system provided in this application allow the device under test (DUT) to record received voice information and identify command keywords within the voice information after receiving a test start command from a data processing device. After executing the processing operation corresponding to the command keywords, DUT generates and sends voice log data to the data processing device. The data processing device then generates a script file based on the voice log data. The script file records the command keywords included in the voice information recorded in the voice log data, as well as the audio storage address. Since the script file is used to automatically play the voice information corresponding to the audio identifier when the device runs the script file, the DUT can utilize the script file to perform voice testing. This solves the problem of excessive reliance on the number of personnel and their efficiency in manual broadcasting testing methods, improving voice testing efficiency and reducing the labor costs of voice testing. Attached Figure Description
[0029] Figure 1 This is a schematic diagram of the implementation environment of a script generation method provided in an embodiment of this application;
[0030] Figure 2 This is a flowchart of a script generation method provided in an embodiment of this application;
[0031] Figure 3 This is a schematic diagram of a script recording interface provided in an embodiment of this application;
[0032] Figure 4is a flowchart of another script generation method provided by an embodiment of the present application;
[0033] Figure 5 is a flowchart of still another script generation method provided by an embodiment of the present application;
[0034] Figure 6 is a flowchart of a script generation method provided by another embodiment of the present application;
[0035] Figure 7 is a flowchart of a script generation method provided by still another embodiment of the present application;
[0036] Figure 8 is a block diagram of a script generation apparatus provided by an embodiment of the present application;
[0037] Figure 9 is a block diagram of another script generation apparatus provided by an embodiment of the present application. DETAILED DESCRIPTION
[0038] The technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only some of the embodiments of the present application, but not all the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative work fall within the scope of protection of the present application.
[0039] The script generation method, apparatus and script generation system provided by the embodiments of the present application will be described in detail below with reference to the drawings and specific embodiments and application scenarios thereof.
[0040] Reference is made to Figure 1 which shows an implementation environment schematic diagram of a script generation method provided by an embodiment of the present application. As shown in Figure 1 , the implementation environment includes a data processing device 101 and a device under test 102. The data processing device 101 and the device under test 102 are connected through a wired network or a wireless network. The device under test 102 is used for a voice test scenario, and can be used for voice recognition test and voice operation test, etc. stress test or regression test scenario.
[0041] In some embodiments of the present application, after receiving the test task of the application under test, the tester can make the device under test run the application under test. The tester performs the voice test operation on the device under test according to the voice test requirement document preset for the application under test, so that the data processing device connected to the device under test generates a script file. The script file is used to automatically play the voice information corresponding to the voice test operation when it is running. In the embodiments of the present application, after the device under test undergoes a recording process of a plurality of voice information, the data processing device can generate a script file that can be permanently executed, and the script file can be shared to other testers for use in a test scenario with the same or similar voice test requirements.
[0042] Optionally, the device under test can be a mobile phone, a computer, a wearable device, a terminal device, etc. The data processing device can be a computer, a server, a server cluster, etc. In an application scenario, the device under test can be a car machine, which is a short form of a car information entertainment product installed in a car. The car machine can realize information communication between people and the car, and between the car and the outside world (car and car). The data processing device and the device under test are applied to a car machine voice test scenario.
[0043] Please refer to Figure 2 , which shows a flowchart of a script generation method provided by an embodiment of the present application. The script generation method can be applied to Figure 1 the implementation environment shown. As Figure 2 shown, the script generation method includes:
[0044] Step 201, the data processing device sends a test start instruction to the device under test in response to a script recording start instruction.
[0045] In the embodiments of the present application, the data processing device can generate and respond to the script recording start instruction when it is determined to start executing the script generation method.
[0046] Optionally, as Figure 3 shown, the data processing device displays a start control 301 on the script recording interface 300. If the tester wants to start the script generation process, the tester can perform a trigger input on the start control. After receiving the trigger input on the start control, the data processing device generates and responds to the script recording start instruction, and sends the test start instruction to the device under test in response to the trigger input.
[0047] The test start instruction is used to instruct the device under test to start recording the received voice information. The trigger input can be a click, a slide, a long press, or a voice input on the start control. For example, the tester clicks the start control, so that the data processing device sends the test start instruction to the device under test to start the script file generation process.
[0048] Step 202, the device under test records and stores the voice information in response to the voice information.
[0049] In the embodiment of the application, after receiving the test start instruction, the device under test can record and store the voice information in response to the received voice information. The device under test can store the voice information locally, in the cloud, or in a third-party device. The voice information includes an instruction keyword, which is used to trigger the device under test to perform a processing operation corresponding to the instruction keyword. For example, the instruction keyword is “turn on music”. The processing operation corresponding to the instruction keyword is to start a music application installed on the device under test. The instruction keyword is “navigate to X block”, and the processing operation corresponding to the instruction keyword is to start a navigation application installed on the device under test and start a navigation function from the location of the device under test to X block.
[0050] Optionally, the voice information received by the device under test can be voice broadcasted by a third-party device such as a data processing device to the device under test. Alternatively, it can also be voice broadcasted by a test personnel to the device under test artificially. Alternatively, it can also be pre-stored voice broadcasted by the device under test itself. For example, after clicking the start control displayed by the data processing device, the test personnel can broadcast voice information to the device under test.
[0051] Step 203, the device under test identifies the instruction keyword included in the voice information.
[0052] Optionally, the device under test can perform voice-to-text conversion processing on the voice information to obtain text content of the voice information, and identify the instruction keyword from the text content. The instruction keyword is also called wake-up phrase.
[0053] Step 204, the device under test performs a processing operation corresponding to the instruction keyword to generate voice log data. The voice log data at least records the instruction keyword and an audio identifier of the voice information. The audio identifier is used to indicate an audio storage address of the voice information.
[0054] Optionally, the device under test can pre-store a plurality of keywords and a processing operation identifier corresponding to each keyword. The processing operation identifier is used to indicate a processing operation. After identifying the instruction keyword in the voice information, the device under test can locally find the processing operation identifier corresponding to the instruction keyword and perform the processing operation indicated by the processing operation identifier.
[0055] In an optional implementation, in a case where the device under test identifies the instruction keyword from the voice information, the device under test can generate voice log data recording the instruction keyword. In a case where the device under test does not identify the instruction keyword from the voice information, the device under test can not generate voice log data.
[0056] Alternatively, in a case where the instruction keyword is not recognized from the voice information, the device under test generates voice log data, which records an audio identity of the voice information, but does not record the instruction keyword included in the voice information. It is understood that whether the voice information corresponding to the voice log data is recognized successfully can be determined by determining whether the voice log data records the instruction keyword.
[0057] In some embodiments of the present application, the format of the voice log data can be: keyword identity: instruction keyword audio identity: audio identity. For example, the format of the voice log data can be: onwakeup: instruction keyword audioId: audio identity. For example, the content of the voice information is: turn on music. The voice log data is: onwakeup: turn on music audioId: addr0. addr0 is the storage address of the recorded voice information.
[0058] Step 205, the device under test sends the voice log data to the data processing device.
[0059] Optionally, the device under test can send the voice log data to the data processing device in real time after generating the voice log data. Alternatively, the device under test can periodically send all voice log data generated in a period to the data processing device.
[0060] Step 206, the data processing device generates a script file based on the voice log data 。 The script file at least includes the instruction keyword and the audio identity.
[0061] In the embodiments of the present application, the data processing device extracts the instruction keyword and the audio identity of the voice information in the voice log data to generate the script file. The script file is used to automatically play the voice information corresponding to the audio identity when the script file is run.
[0062] Optionally, the data processing device can generate the script file based on the voice log data according to a preset script file format. In an optional implementation manner, the script file format is: voice broadcast(‘instruction keyword’, audio identity: audio identity).
[0063] For example, the script file format is: voice broadcast(‘instruction keyword’, audioId: audio identity). The voice log data received by the data processing device is: onwakeup: turn on music audioId: addr0; onwakeup: navigate to X block audioId: addr1. addr1 is the storage address of the recorded voice information including the content of navigating to X block. The script file generated by the data processing device is:
[0064] voice broadcast(‘turn on music’, audioId: addr0)
[0065] Voice broadcast ('navigate to X block', audioId: addr1).
[0066] In summary, the script generation method provided in the embodiments of the present application, after the measured device receives the test start instruction sent by the data processing device, records the received voice information, and identifies the instruction keyword included in the voice information, so as to generate and send voice log data to the data processing device after performing the processing operation corresponding to the instruction keyword. The data processing device generates a script file based on the voice log data. The script file records the instruction keyword included in the voice information recorded by the voice log data and the audio storage address. Since the script file is used to automatically play the audio corresponding to the voice information when the device runs the script file. Therefore, the measured device can use the script file to realize voice testing, which solves the excessive dependence on the number of personnel, the efficiency of personnel broadcasting and other abilities in the manual broadcasting test method, improves the voice testing efficiency, and reduces the labor cost of voice testing. Moreover, since the voice information recorded by the script file is the voice information received by the measured device, the voice information recorded by the script file can include background sound, environmental noise, etc., so that the playback of the voice information using the script file can restore the actual scene when the voice information is received by the device to a great extent, thereby improving the testing accuracy of voice testing.
[0067] Further, compared with the method of recording test voice first and then writing test script based on the recorded voice, the generation process of the test script file is simplified, and the generation efficiency of the script file is improved.
[0068] Please refer to Figure 4 which shows a flowchart of another script generation method provided in the embodiments of the present application. The script generation method can be applied to Figure 1 the implementation environment shown. As Figure 4 shown, the script generation method includes:
[0069] Step 401, the data processing device sends a test start instruction to the measured device in response to a script recording start instruction.
[0070] The explanation and implementation of this step can refer to the explanation and implementation of the aforementioned step 201, and the embodiments of the present application will not be repeated here.
[0071] Step 402, the measured device records and stores the voice information in response to the voice information.
[0072] The explanation and implementation of this step can refer to the explanation and implementation of the aforementioned step 202, and the embodiments of the present application will not be repeated here.
[0073] Step 403, the device under test identifies the instruction keyword included in the voice information.
[0074] The explanation and implementation of this step can refer to the explanation and implementation of the aforementioned step 203, and the embodiments of the present application do not repeat them here.
[0075] Step 404, the device under test performs the processing operation corresponding to the instruction keyword, and generates voice log data. The voice log data at least records the instruction keyword and the audio identifier of the voice information. The audio identifier is used to indicate the audio storage address of the voice information.
[0076] The explanation and implementation of this step can refer to the explanation and implementation of the aforementioned step 204, and the embodiments of the present application do not repeat them here.
[0077] Step 405, the device under test records the voice log data in the device log.
[0078] Optionally, the device under test writes the voice log data into the device log according to the voice log format in the device log. The voice log format specifies the unique field of the voice log data. The device log is also used to record other running data of the device under test. For example, the preset format of the device log is: OfflineSdk: [SpeechHotWordsEngine]: voice log data. For example, the device log written by the device under test is: OfflineSdk: [SpeechHotWordsEngine]: onwakeup: open music audioId: addr0.
[0079] Step 406, the device under test sends the device log to the data processing device.
[0080] Optionally, the device under test can send the device log to the data processing device in real time after generating the device log recording the voice log data. Alternatively, the device under test can periodically send the device log generated in the period to the data processing device.
[0081] Step 407, the data processing device screens the voice log data from the device log.
[0082] Optionally, the voice log format in the device log has a unique field of the voice log data. After receiving the device log, the data processing device obtains the unique field of the voice log data, and determines the voice log screening condition.
[0083] Based on this, the process of screening the voice log data from the device log by the data processing device can include: sequentially obtaining the log data of each entry in the device log, and determining that the obtained log data is the voice log data if the obtained log data meets the voice log screening condition.
[0084] The data processing device sequentially obtains log data of each of the device logs, and determines, for each piece of log data, whether the log data meets a voice log screening condition, so as to determine log data meeting the voice log screening condition as voice log data.
[0085] In an optional implementation, the screening condition is a piece of log data including a unique field in the plurality of pieces of log data of the device log. The data processing device determines the log data as voice log data in a case where the log data includes the unique field.
[0086] For example, a preset format of the device log is OfflineSdk: [SpeechHotWordsEngine]: onwakeup: instruction keyword audioId: audio identifier. The data processing device determines a log screening condition as a regular expression: OfflineSdk: [SpeechHotWordsEngine]: onwakeup: ${param} audioId: ${audioId}. The data processing device can establish a log analysis processing thread. The log analysis processing thread receives the device log of the device under test, that is, a log stream. The log analysis processing thread obtains each piece of log data in the device log, and determines whether the obtained log data meets the log screening condition. In a case where the log data meets the log screening condition, the log data is determined as voice log data; in a case where the log data does not meet the log screening condition, the log data is determined as non-voice log data.
[0087] Step 408: The data processing device generates a script file based on the voice log data 。 The script file at least includes an instruction keyword and an audio identifier.
[0088] The explanation and implementation of this step can refer to the explanation and implementation of the aforementioned step 204, and the embodiments of the present application do not repeat the explanation.
[0089] It should be noted that there can be a receiving gap between each piece of voice information received by the device under test. Optionally, the script file can also record a receiving gap duration between each piece of voice information, so as to restore the playback process of the voice information recorded by the script file to the greatest extent when the script file is executed. Optionally, the script processing method can further include steps 501 to 502.
[0090] In step 501, the device under test sends a receiving time of voice information corresponding to the voice log data to the data processing device.
[0091] The receiving time is the time when the voice information is received by the measured device. The measured device can record the current time when the voice information is received, and the current time is the receiving time of the voice information.
[0092] In step 502, the data processing device calculates the time difference between the receiving times of two adjacent voice information received by the measured device.
[0093] In the embodiment of the application, after the data processing device receives the receiving times of the multiple voice information sent by the measured device, the data processing device can calculate the time difference between the receiving times of two adjacent voice information received by the measured device. For example, the data processing device calculates the time difference between the receiving times of two adjacent voice information received by the measured device based on the receiving times of the two adjacent voice information and a target formula. The target formula satisfies: steptime=(steptime2-steptime1). The steptime is the time difference between the receiving times, and the unit of the time difference between the receiving times can be seconds (s). The steptime2 is the receiving time of the voice information received later in the two adjacent voice information. The steptime1 is the receiving time of the voice information received earlier in the two adjacent voice information.
[0094] Therefore, the data processing device generates the script file based on the voice log data, and the process can include: generating the script file based on the voice log data and the time difference between the receiving times.
[0095] The script file includes: the instruction keywords and the audio identifiers of the multiple voice information recorded in sequence according to the receiving sequence of the voice information, and the time difference between the receiving times of two adjacent voice information received by the measured device. The script file is used for the device to automatically play the voice information corresponding to the audio identifier according to the receiving sequence of the voice information when the device runs the script file.
[0096] Optionally, the script file includes the instruction keywords and the audio identifiers of the multiple voice information recorded in sequence according to the receiving sequence of the voice information. The time difference between the receiving times of two adjacent voice information is recorded between the two voice information. For example, the format of the script file is: voice broadcast (‘instruction keyword’, audioId: audio identifier). The voice log data received by the data processing device is: onwakeup: open music audioId: addr0; onwakeup: navigate to X block audioId: addr1. The addr1 is the storage address of the recorded content including the voice information of navigating to X street. The time difference between the receiving times of the voice information corresponding to the two voice log data is 9s. The script file generated by the data processing device is:
[0097] Voice broadcast (‘open music’, audioId: addr0)
[0098] Wait (9)
[0099] Voice broadcast ('navigate to X block', audioId: addr1).
[0100] In some embodiments of the present application, the script file can also be extended to add other functions. For example, the script file can also add a consistency check function of the text content of the voice information and the instruction keyword recognized by the device under test from the voice information, to further check the test accuracy of the voice test by using the script file.
[0101] Optionally, the script file can also include voice check information, which is used to describe the text recognition processing logic of the voice information corresponding to the audio identifier, and the comparison logic of the text recognition result and the instruction keyword corresponding to the audio identifier. The script file is also used to perform text recognition processing on the voice information corresponding to the audio identifier in the voice log data, and compare whether the text recognition result and the instruction keyword corresponding to the audio identifier are consistent, and output the comparison result. The comparison result includes recognition error or correct recognition.
[0102] For example, the voice check information is: text recognition (audioId: addr0), consistency comparison ('turn on music', text recognition (audioId: addr0)).
[0103] In order to facilitate understanding, the script generation method provided by the embodiments of the present application is further illustratively described by the following examples. For example, the device under test and the data processing device are connected through an adb interface. The adb interface is a data interface, which has the function of a debugging bridge.
[0104] As shown in Figure 5 The print instruction of the device under test for the log data of different projects can be different. The tester can input the print instruction to the device under test after determining the print instruction of the voice log data: adb shell "logcat | grep -i", so that the device under test generates voice log data in response to voice information.
[0105] The tester broadcasts voice information to the device under test, and the content of the voice information is to turn on music, so that the device under test prints the device log as follows:
[0106] OfflineSdk: [SpeechHotWordsEngine]: xxx
[0107] OfflineSdk: [SpeechHotWordsEngine]: onwakeup: 'open music' audioId: addr0. The data processing device extracts the row data of the voice log data from the device log as OfflineSdk: [SpeechHotWordsEngine]: onwakeup: 'open music' audioId: addr0. The data processing device replaces the wake-up speech in the row data of the voice log data with ${param} and the voice identifier with ${audioId} based on the unique fields onwakeup and audioId of the voice log data, and obtains the voice screening condition as OfflineSdk: [SpeechHotWordsEngine]: onwakeup: ${param} audioId: ${audioId}.
[0108] The tester clicks the voice automatic test identifier displayed by the data processing device, so that the data processing device runs the automation program and displays the script recording interface 300 as shown in Figure 3 The tester writes the voice screening condition into the screening condition entry control 302 in the script recording interface 300.
[0109] If the tester wants to start the voice script recording function, the tester clicks the start control 301. The data processing device receives the click input on the start control and sends a test start instruction to the device under test.
[0110] The tester issues a voice instruction to the device under test, that is, the tester plays voice information to the device under test. The device under test generates a device log, which records voice log data corresponding to the voice instruction. The data processing device uses the log analysis processing thread to obtain the device log sent by the device under test and the interface data of the execution interface through the adb interface. The execution interface is the interface displayed by the device under test in real time during the execution of the processing operation corresponding to the voice information.
[0111] The data processing device detects whether there is log data that meets the voice screening condition from the device log, and extracts log data that meets the voice screening condition, that is, extracts voice log data. The data processing device generates an executable automation script file based on the instruction keyword and the audio identifier recorded in the voice log data. The automation program run by the data processing device is connected to the browser, that is, the web end, through a websocket request. The data processing device displays the script recording interface 300 on the browser through the websocket request interface, and displays the script file in the script display area 303 of the script recording interface 300 and displays the execution interface of the device under test in the interface display area 304 of the script recording interface 300.
[0112] The device under test waits for the next voice command from the tester. If the tester issues another voice command, the device under test and the data processing device repeat the foregoing process until the data processing device generates and displays the script file again. The tester can also click the stop recording control 305 in the script recording interface 300 to cause the data processing device to receive the click input of the stop recording control 305 and exit the voice script recording process. The tester can play back the test script. The script file can also be edited again in the script display area 303 to add other functions to the script file.
[0113] If the tester first issues a first voice information to the device under test: navigate to x block. After an interval of 9s, issues a second voice information again: first. After an interval of 2s, issues a third voice information again: start navigation. After an interval of 30s, issues a fourth voice information again: exit navigation, the data processing device generates a script file as follows:
[0114] Voice broadcast ('navigate to x block', audioId = 'addr9')
[0115] Wait (9)
[0116] Voice broadcast ('first', audioId = 'addr20')
[0117] Wait (2)
[0118] Voice broadcast ('start navigation', audioId = 'addr30')
[0119] Wait (30)
[0120] Voice broadcast ('exit navigation', audioId = 'addr40').
[0121] Wherein, addr9 is an address for storing the first voice information. Addr20 is an address for storing the second voice information. Addr30 is an address for storing the third voice information. Addr40 is an address for storing the fourth voice information.
[0122] In summary, the script generation method provided in the embodiments of the present application, after the measured device receives the test start instruction sent by the data processing device, records the received voice information, and identifies the instruction keyword included in the voice information, generates and sends voice log data to the data processing device after performing the processing operation corresponding to the instruction keyword. The data processing device generates a script file based on the voice log data. The script file records the instruction keyword included in the voice information recorded by the voice log data and the audio storage address. Since the script file is used to automatically play the audio corresponding to the voice information when the device runs the script file. Therefore, the measured device can use the script file to realize voice testing, which solves the excessive dependence on the number of personnel, the efficiency of personnel broadcasting and other abilities in the manual broadcasting test method, improves the voice testing efficiency, and reduces the labor cost of voice testing. Moreover, since the voice information recorded by the script file is the voice information received by the measured device, the voice information recorded by the script file can include background sound, recording environment noise, etc., so that the playback of the voice information using the script file can restore the actual scene when the voice information is received by the device to a great extent, improving the testing accuracy of voice testing.
[0123] Further, compared with the method of testing voice recording first and then writing a test script based on the recorded voice, the generation process of the test script file is simplified, and the generation efficiency of the script file is improved.
[0124] Reference is made to Figure 6 which shows a flowchart of a script generation method provided in the embodiments of the present application. The script generation method can be applied to Figure 1 the implementation environment shown in the figure, and is executed by a data processing device. As Figure 6 shown, the script generation method includes:
[0125] Step 601, in response to a script recording start instruction, a test start instruction is sent to a measured device, so that the measured device, in the case of receiving voice information, records and stores the voice information in response to the voice information, identifies the instruction keyword included in the voice information, performs the processing operation corresponding to the instruction keyword, and generates voice log data.
[0126] Among them, the voice log data at least records the instruction keyword and the audio identifier of the voice information, and the audio identifier is used to indicate the audio storage address of the voice information.
[0127] Step 602, receiving the voice log data sent by the measured device.
[0128] Step 603, generating a script file based on the voice log data, the script file at least includes the instruction keyword and the audio identifier.
[0129] Optionally, the voice log data sent by the device under test is received, comprising:
[0130] The device log sent by the device under test is received, and the voice log data is recorded in the device log.
[0131] The voice log data is filtered from the device log.
[0132] Optionally, the method further comprises: obtaining a unique field of the voice log data, and determining a voice log filtering condition.
[0133] The voice log data is filtered from the device log, comprising: obtaining log data of each of the device log in sequence, and determining that the obtained log data is voice log data in a case where the obtained log data meets the voice log filtering condition.
[0134] Optionally, the method further comprises:
[0135] The receiving time of the voice information corresponding to the voice log data sent by the device under test is received.
[0136] The time difference between the receiving time of each two voice information received by the device under test in sequence is calculated.
[0137] Based on the voice log data, a script file is generated, comprising: based on the voice log data and the time difference between the receiving time, a script file is generated, and the script file comprises: an instruction keyword and an audio identifier of a plurality of voice information recorded in sequence according to the receiving sequence of the voice information, and the time difference between the receiving time of each two voice information received by the device under test in sequence.
[0138] In summary, the script generation method provided in the embodiments of the present application, after the measured device receives the test start instruction sent by the data processing device, records the received voice information, and identifies the instruction keyword included in the voice information, so as to generate and send voice log data to the data processing device after performing the processing operation corresponding to the instruction keyword. The data processing device generates a script file based on the voice log data. The script file records the instruction keyword included in the voice information recorded by the voice log data and the audio storage address. Since the script file is used to automatically play the audio corresponding to the voice information when the device runs the script file. Therefore, the measured device can use the script file to realize voice testing, which solves the excessive dependence on the number of personnel, the efficiency of personnel broadcasting and other abilities in the manual broadcasting test mode, improves the voice testing efficiency, and reduces the labor cost of voice testing. Moreover, since the voice information recorded by the script file is the voice information received by the measured device, the voice information recorded by the script file can include background sound, recording environment noise and the like, so that the actual scene when the voice information is received by the device can be restored to a great extent when the voice information is played back using the script file, and the testing accuracy of voice testing is improved.
[0139] Further, compared with the method of testing voice recording first and then writing a test script based on the recorded voice, the generation process of the test script file is simplified, and the generation efficiency of the script file is improved.
[0140] Reference is made to Figure 7 which shows a flowchart of a script generation method provided in the embodiments of the present application. The script generation method can be applied to Figure 1 the implementation environment shown in the figure, and is executed by the measured device. As Figure 7 shown, the script generation method comprises the following steps.
[0141] Step 701, in the case of receiving a test start instruction sent by a data processing device, receiving voice information.
[0142] Step 702, in response to the voice information, recording and storing the voice information.
[0143] Step 703, identifying the instruction keyword included in the voice information.
[0144] Step 704, performing the processing operation corresponding to the instruction keyword, generating voice log data, the voice log data at least recording the instruction keyword and the audio identifier of the voice information, the audio identifier being used to indicate the audio storage address of the voice information.
[0145] Step 705, sending the voice log data to the data processing device, so that the data processing device generates a script file based on the voice log data, and the script file at least includes the instruction keyword and the audio identifier.
[0146] Optionally, the method further comprises: recording the voice log data in the device log.
[0147] The sending of the voice log data to the data processing device comprises: sending the device log to the data processing device, so that the data processing device screens the voice log data from the device log.
[0148] Optionally, the method further comprises:
[0149] The recording of the receiving time of the voice information;
[0150] The sending of the receiving time of the voice information corresponding to the voice log data to the data processing device, so that the data processing device calculates the time difference between the receiving times of two adjacent voice information received by the device under test, generates a script file based on the voice log data and the time difference between the receiving times, and the script file comprises: the instruction keyword and the audio identifier of each of the plurality of voice information recorded in sequence according to the receiving sequence of the voice information, and the time difference between the receiving times of two adjacent voice information received by the device under test.
[0151] In summary, the script generation method provided by the embodiments of the present application, after the device under test receives the test start instruction sent by the data processing device, records the received voice information, and identifies the instruction keyword included in the voice information, so as to generate and send the voice log data to the data processing device after performing the processing operation corresponding to the instruction keyword. The data processing device generates a script file based on the voice log data. The script file records the instruction keyword and the audio storage address included in the voice information recorded by the voice log data. Since the script file is used to automatically play the voice information corresponding to the audio identifier when the device runs the script file. Therefore, the device under test can use the script file to realize voice testing, which solves the excessive dependence on the number of personnel, the efficiency of personnel broadcasting and other abilities in the manual broadcasting test method, improves the voice testing efficiency, and reduces the labor cost of voice testing. Moreover, since the voice information recorded by the script file is the voice information received by the device under test, the voice information recorded by the script file can include background sound, recording environment noise, etc., so that the playback of the voice information using the script file can restore the actual scene when the voice information is received by the device to a great extent, thereby improving the testing accuracy of voice testing.
[0152] Further, compared with the method of recording the test voice first and then writing the test script based on the recorded voice, the generation process of the test script file is simplified, and the generation efficiency of the script file is improved.
[0153] Please refer to Figure 8 which shows a block diagram of a script generation apparatus provided by an embodiment of the present application. The script generation apparatus is applied to a data processing device. As shown inFigure 8 As shown in the figure, the script generation apparatus 800 comprises a sending module 801, a receiving module 802 and a generation module 803.
[0154] The sending module 801 is configured to, in response to a script recording start instruction, send a test start instruction to the device under test, so that the device under test, in the case of receiving voice information, records and stores the voice information in response to the voice information, identifies an instruction keyword included in the voice information, performs a processing operation corresponding to the instruction keyword, and generates voice log data. The voice log data at least records the instruction keyword and an audio identifier of the voice information, and the audio identifier is used to indicate an audio storage address of the voice information.
[0155] The receiving module 802 is configured to receive voice log data sent by the device under test.
[0156] The generation module 803 is configured to generate a script file based on the voice log data, and the script file at least comprises the instruction keyword and the audio identifier.
[0157] Optionally, the receiving module 802 is further configured to:
[0158] receive device log sent by the device under test, and the device log records the voice log data;
[0159] filter the voice log data from the device log.
[0160] Optionally, the script generation apparatus 800 further comprises a determination module configured to obtain an exclusive field of the voice log data, determine a voice log filtering condition, and further configured to sequentially obtain log data of each piece of log data in the device log, and determine that the obtained log data is voice log data in the case that the obtained log data meets the voice log filtering condition.
[0161] Optionally, the receiving module 802 is further configured to receive a receiving time of voice information corresponding to the voice log data sent by the device under test;
[0162] The script generation apparatus 800 further comprises a calculation module configured to calculate a receiving time difference between every two adjacent voice information received by the device under test.
[0163] The generation module 803 is further configured to generate the script file based on the voice log data and the receiving time difference, and the script file comprises: instruction keywords and audio identifiers of a plurality of voice information recorded in sequence according to receiving time sequences of the voice information, and the receiving time difference between every two adjacent voice information received by the device under test.
[0164] In summary, the script generation apparatus provided in the embodiment of the present application, after the measured device receives the test start instruction sent by the data processing device, records the received voice information, and identifies the instruction keyword included in the voice information, so as to generate and send voice log data to the data processing device after performing the processing operation corresponding to the instruction keyword. The data processing device generates a script file based on the voice log data. The script file records the instruction keyword included in the voice information recorded in the voice log data and the audio storage address. Since the script file is used to automatically play the audio corresponding to the voice information when the device runs the script file. Therefore, the measured device can use the script file to realize voice testing, which solves the excessive dependence on the number of personnel, the efficiency of personnel broadcasting and other abilities in the manual broadcasting test mode, improves the voice testing efficiency, and reduces the labor cost of voice testing. Moreover, since the voice information recorded in the script file is the voice information received by the measured device, the voice information recorded in the script file can include background sound, environmental noise and the like, so that the actual scene when the voice information is received by the device can be restored to a great extent when the voice information is played back using the script file, and the testing accuracy of voice testing is improved.
[0165] Further, compared with the method of testing voice recording first and then writing a test script based on the recorded voice, the generation process of the test script file is simplified, and the generation efficiency of the script file is improved.
[0166] Please refer to Figure 9 which shows a block diagram of a script generation apparatus provided in the embodiment of the present application. The script generation apparatus can be applied to a measured device. As Figure 9 shown, the script generation apparatus 900 includes a receiving module 901, a recording module 902, an identifying module 903, a generating module 904 and a sending module 905.
[0167] The receiving module 901 is configured to receive voice information in the case of receiving a test start instruction sent by a data processing device.
[0168] The recording module 902 is configured to record and store voice information in response to the voice information.
[0169] The identifying module 903 is configured to identify the instruction keyword included in the voice information.
[0170] The generating module 904 is configured to perform a processing operation corresponding to the instruction keyword, generate voice log data, and the voice log data at least records the instruction keyword and the audio identifier of the voice information. The audio identifier is used to indicate the audio storage address of the voice information.
[0171] The sending module 905 is configured to send the voice log data to the data processing device, so that the data processing device generates a script file based on the voice log data, and the script file at least includes the instruction keyword and the audio identifier.
[0172] Optionally, the script generation apparatus 900 further includes a recording module configured to record the voice log data in a device log.
[0173] The sending module 905 is further configured to send the device log to the data processing device, so that the data processing device screens the voice log data from the device log.
[0174] Optionally, the recording module is further configured to record a receiving time of the voice information.
[0175] The sending module 905 is further configured to send the receiving time of the voice information corresponding to the voice log data to the data processing device, so that the data processing device calculates a receiving time difference between every two adjacent received voice information of the device under test, and generates a script file based on the voice log data and the receiving time difference, and the script file includes: the instruction keyword and the audio identifier of the plurality of voice information recorded in sequence according to the receiving time sequence of the voice information, and the receiving time difference between every two adjacent received voice information of the device under test.
[0176] In summary, the script generation method provided by the embodiments of the present application is that, after receiving the test start instruction sent by the data processing device, the device under test records the received voice information, and identifies the instruction keyword included in the voice information, so as to generate and send the voice log data to the data processing device after executing the processing operation corresponding to the instruction keyword. The data processing device generates a script file based on the voice log data. The script file records the instruction keyword and the audio storage address of the voice information recorded in the voice log data. Since the script file is used to automatically play the voice information corresponding to the audio identifier when the device runs the script file, the device under test can use the script file to realize voice testing, and solves the excessive dependence on the number of personnel, the efficiency of personnel broadcasting and other abilities in the manual broadcasting test mode, improves the voice testing efficiency, and reduces the labor cost of voice testing. Moreover, since the voice information recorded in the script file is the voice information received by the device under test, the voice information recorded in the script file can include the recording background sound and the recording environmental noise, so that the actual scene when the voice information is received by the device can be restored to a great extent when the voice information is played back by using the script file, and the testing accuracy of voice testing is improved.
[0177] Further, compared with the method of recording the test voice first and then writing the test script based on the recorded voice, the generation process of the test script file is simplified, and the generation efficiency of the script file is improved.
[0178] The embodiment of the present application further provides a script generation system, which can be as shown in the figure. Figure 1 The script generation system comprises a data processing device and a device under test. The data processing device is used to perform the steps performed by the data processing device in the foregoing embodiments. The device under test is used to perform the steps performed by the device under test in the foregoing embodiments.
[0179] The embodiment of the present application further provides an electronic device, which can comprise a processor and a memory. The memory is used to store a computer program. The processor is used to execute the program stored in the memory, so as to realize the steps performed by the data processing device in the method embodiments of the present application, or realize the steps performed by the device under test in the method embodiments of the present application.
[0180] The embodiment of the present application further provides a readable storage medium, which stores a program or instructions. The program or instructions are executed by a processor to realize the processes of the script generation method embodiments and achieve the same technical effects. To avoid repetition, details are not described herein.
[0181] The processor is the processor in the electronic device in the foregoing embodiments. The readable storage medium comprises a computer readable storage medium, such as a computer readable only memory (ROM), a random access memory (RAM), a magnetic disc or an optical disc, etc.
[0182] The embodiments of the present application are described above in combination with the accompanying drawings, but the present application is not limited to the above specific embodiments. The above specific embodiments are only illustrative, but not restrictive. Those skilled in the art can make many forms under the inspiration of the present application without departing from the scope of the present application and the protection scope of the claims.
Claims
1. A script generation method, characterized in that, Applied to a data processing device, the method includes: In response to a script recording start command, a test start command is sent to the device under test, so that when the device under test receives voice information, it records and stores the voice information, identifies the command keywords included in the voice information, executes the processing operation corresponding to the command keywords, and generates voice log data. The voice log data records at least the command keywords and the audio identifier of the voice information. The audio identifier is used to indicate the audio storage address of the voice information. Receive voice log data sent by the device under test; Based on the voice log data, a script file is generated, which includes at least the instruction keywords and the audio identifier.
2. The method according to claim 1, characterized in that, The receiving of voice log data sent by the device under test includes: Receive device logs sent by the device under test, wherein the device logs contain the voice log data; Filter the voice log data from the device log.
3. The method according to claim 2, characterized in that, The method further includes: obtaining unique fields of the voice log data and determining voice log filtering conditions; The step of filtering the voice log data from the device log includes: Log data for each entry in the device log is obtained sequentially, and if the obtained log data meets the voice log filtering conditions, the obtained log data is determined to be the voice log data.
4. The method according to claim 1, characterized in that, The method further includes: The time of receiving the voice information corresponding to the voice log data sent by the device under test; Calculate the time difference between the reception times of two adjacent voice messages received by the device under test; The step of generating a script file based on the voice log data includes: Based on the voice log data and the time difference of reception, a script file is generated. The script file includes: instruction keywords and audio identifiers of multiple voice information in sequence according to the reception time of the voice information, and the time difference of reception between each two adjacent voice information received by the device under test.
5. A script generation method, characterized in that, Applied to the device under test, the method includes: Upon receiving a test start command from the data processing device, it receives voice information; In response to the voice information, the voice information is recorded and stored; Identify the command keywords included in the voice information; Execute the processing operation corresponding to the instruction keyword to generate voice log data. The voice log data records at least the instruction keyword and the audio identifier of the voice information. The audio identifier is used to indicate the audio storage address of the voice information. The voice log data is sent to the data processing device so that the data processing device generates a script file based on the voice log data, the script file including at least the instruction keywords and the audio identifier.
6. The method according to claim 5, characterized in that, The method further includes: Record voice log data in the device log; Sending the voice log data to the data processing device includes: sending the device log to the data processing device so that the data processing device can filter the voice log data from the device log.
7. The method according to claim 5, characterized in that, The method further includes: Record the moment when the voice information is received; The data processing device sends the reception time of the voice information corresponding to the voice log data to the data processing device, so that the data processing device calculates the reception time difference between each two adjacent voice information received by the device under test. Based on the voice log data and the reception time difference, a script file is generated. The script file includes: instruction keywords and audio identifiers of multiple voice information recorded in sequence according to the reception time of the voice information, as well as the reception time difference between each two adjacent voice information received by the device under test.
8. A script generation device, characterized in that, Applied to a data processing device, the device includes: The sending module is used to send a test start command to the device under test in response to a script recording start command, so that when the device under test receives voice information, it records and stores the voice information, identifies the command keywords included in the voice information, executes the processing operation corresponding to the command keywords, and generates voice log data. The voice log data records at least the command keywords and the audio identifier of the voice information. The audio identifier is used to indicate the audio storage address of the voice information. A receiving module is used to receive voice log data sent by the device under test; The generation module is used to generate a script file based on the voice log data, the script file including at least the instruction keywords and the audio identifier.
9. A script generation device, characterized in that, The device, applied to the device under test, includes: The receiving module is used to receive voice information when a test start command is sent by the data processing device; The recording module is used to record and store the voice information in response to the voice information; A recognition module is used to recognize the instruction keywords included in the voice information; The generation module is used to perform the processing operation corresponding to the instruction keyword and generate voice log data. The voice log data records at least the instruction keyword and the audio identifier of the voice information. The audio identifier is used to indicate the audio storage address of the voice information. The sending module is used to send the voice log data to the data processing device, so that the data processing device generates a script file based on the voice log data, the script file including at least the instruction keywords and the audio identifier.
10. A script generation system, characterized in that, The script generation system includes a data processing device and a device under test. The data processing device is used to implement the method described in any one of claims 1 to 4, and the device under test is used to implement the method described in any one of claims 5 to 7.
Citation Information
Patent Citations
Automatic testing method and device based on workflow and electronic equipment
CN113064811A
Voice system test method, device, equipment, medium and program product
CN113674769A