CN114490228A - A kind of Bluetooth automatic test method and related device - Google Patents
A kind of Bluetooth automatic test method and related device Download PDFInfo
- Publication number
- CN114490228A CN114490228A CN202110826439.XA CN202110826439A CN114490228A CN 114490228 A CN114490228 A CN 114490228A CN 202110826439 A CN202110826439 A CN 202110826439A CN 114490228 A CN114490228 A CN 114490228A
- Authority
- CN
- China
- Prior art keywords
- electronic device
- bluetooth
- electronic equipment
- instruction
- application program
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
- 238000010998 test method Methods 0.000 title abstract description 3
- 238000013515 script Methods 0.000 claims abstract description 108
- 238000012360 testing method Methods 0.000 claims abstract description 95
- 238000000034 method Methods 0.000 claims abstract description 83
- 230000006870 function Effects 0.000 claims description 85
- 238000004891 communication Methods 0.000 claims description 62
- 230000002159 abnormal effect Effects 0.000 claims description 13
- 238000004590 computer program Methods 0.000 claims description 7
- 230000005856 abnormality Effects 0.000 claims 1
- 230000008569 process Effects 0.000 description 23
- 239000000243 solution Substances 0.000 description 16
- 238000007726 management method Methods 0.000 description 15
- 238000012545 processing Methods 0.000 description 15
- 230000000694 effects Effects 0.000 description 8
- 239000012085 test solution Substances 0.000 description 8
- 238000010295 mobile communication Methods 0.000 description 7
- 238000001514 detection method Methods 0.000 description 6
- 230000005236 sound signal Effects 0.000 description 6
- 230000003993 interaction Effects 0.000 description 5
- 229920001621 AMOLED Polymers 0.000 description 4
- 238000010586 diagram Methods 0.000 description 4
- 238000005516 engineering process Methods 0.000 description 4
- 230000001133 acceleration Effects 0.000 description 3
- 238000013528 artificial neural network Methods 0.000 description 3
- 238000004088 simulation Methods 0.000 description 3
- 238000013522 software testing Methods 0.000 description 3
- 230000000007 visual effect Effects 0.000 description 3
- 230000003321 amplification Effects 0.000 description 2
- 230000009286 beneficial effect Effects 0.000 description 2
- 210000000988 bone and bone Anatomy 0.000 description 2
- 230000000295 complement effect Effects 0.000 description 2
- 238000003199 nucleic acid amplification method Methods 0.000 description 2
- 230000003287 optical effect Effects 0.000 description 2
- 239000002096 quantum dot Substances 0.000 description 2
- 230000005855 radiation Effects 0.000 description 2
- 238000009877 rendering Methods 0.000 description 2
- 239000004065 semiconductor Substances 0.000 description 2
- 238000009662 stress testing Methods 0.000 description 2
- 206010033307 Overweight Diseases 0.000 description 1
- 238000013529 biological neural network Methods 0.000 description 1
- 230000005540 biological transmission Effects 0.000 description 1
- 210000004556 brain Anatomy 0.000 description 1
- 238000004422 calculation algorithm Methods 0.000 description 1
- 238000004364 calculation method Methods 0.000 description 1
- 230000008859 change Effects 0.000 description 1
- 238000006243 chemical reaction Methods 0.000 description 1
- 230000019771 cognition Effects 0.000 description 1
- 238000013500 data storage Methods 0.000 description 1
- 238000011990 functional testing Methods 0.000 description 1
- 230000004927 fusion Effects 0.000 description 1
- 230000005484 gravity Effects 0.000 description 1
- 238000007689 inspection Methods 0.000 description 1
- 238000009434 installation Methods 0.000 description 1
- 239000004973 liquid crystal related substance Substances 0.000 description 1
- 230000004807 localization Effects 0.000 description 1
- 238000013507 mapping Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 210000002569 neuron Anatomy 0.000 description 1
- 239000013307 optical fiber Substances 0.000 description 1
- 238000005457 optimization Methods 0.000 description 1
- 238000011056 performance test Methods 0.000 description 1
- 230000002093 peripheral effect Effects 0.000 description 1
- 238000012805 post-processing Methods 0.000 description 1
- 230000004044 response Effects 0.000 description 1
- 230000006641 stabilisation Effects 0.000 description 1
- 238000011105 stabilization Methods 0.000 description 1
- 230000001960 triggered effect Effects 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/22—Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing
- G06F11/26—Functional testing
- G06F11/263—Generation of test inputs, e.g. test vectors, patterns or sequences ; with adaptation of the tested hardware for testability with external testers
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/22—Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing
- G06F11/2273—Test methods
Landscapes
- Engineering & Computer Science (AREA)
- General Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Computer Hardware Design (AREA)
- Quality & Reliability (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Telephone Function (AREA)
Abstract
Description
技术领域technical field
本申请涉及蓝牙测试领域,尤其涉及一种蓝牙自动化测试方法及相关装置。The present application relates to the field of Bluetooth testing, and in particular, to a Bluetooth automated testing method and related devices.
背景技术Background technique
在进行蓝牙测试时,一般需要耗费大量人力。为了降低人力耗费,设备制造商开始寻求蓝牙自动化测试方案。手机、平板电脑等设备具有操作系统(例如,安卓系统等),并且可以通过一些接口实现自动化控制。因此,对于手机、平板电脑等设备的蓝牙自动化测试方案已较为成熟。Generally, a lot of manpower is required to perform a Bluetooth test. In order to reduce manpower consumption, equipment manufacturers have begun to seek Bluetooth automated test solutions. Devices such as mobile phones and tablet computers have operating systems (for example, Android systems, etc.), and can realize automatic control through some interfaces. Therefore, the Bluetooth automated test solution for devices such as mobile phones and tablet computers is relatively mature.
然而,由于蓝牙耳机、蓝牙音箱等设备没有操作系统,且没有能实现自动化控制的接口,所以,对于蓝牙耳机、蓝牙音箱等设备来说,无法采用适用于手机、平板等设备的蓝牙自动化测试方案。一般来说,蓝牙耳机、蓝牙音箱等设备的蓝牙自动化测试方案主要通过硬件来实现。例如,拆解设备,将设备的控制单元或管脚,与自动化控制线缆焊接。再例如,通过机械手控制来实现蓝牙自动化测试。可理解,上述蓝牙自动化测试方案不仅需要耗费大量的金钱成本和时间成本,并且低效。However, since devices such as Bluetooth headsets and Bluetooth speakers have no operating system and no interface that can realize automatic control, for devices such as Bluetooth headsets and Bluetooth speakers, it is impossible to use Bluetooth automated test solutions for mobile phones, tablets, and other devices. . Generally speaking, the bluetooth automation test scheme of bluetooth earphones, bluetooth speakers and other equipment is mainly realized by hardware. For example, disassemble the equipment, and weld the control unit or pins of the equipment with the automation control cable. For another example, Bluetooth automated testing is achieved through robotic control. It can be understood that the above-mentioned Bluetooth automated test solution not only requires a lot of money cost and time cost, but also is inefficient.
因此,如何在降低蓝牙自动化测试的成本的情况下提高蓝牙自动化测试的效率是目前亟待解决的问题。Therefore, how to improve the efficiency of the Bluetooth automated test while reducing the cost of the Bluetooth automated test is an urgent problem to be solved at present.
发明内容SUMMARY OF THE INVENTION
本申请提供了一种蓝牙自动化测试方法及相关装置,可以通过自动化脚本控制第二电子设备或第三电子设备上的应用程序,进而通过该应用程序来控制第四电子设备的蓝牙功能,从而实现对第四电子设备的蓝牙测试。无需耗费大量金钱成本和人力资源,提高了蓝牙自动化测试的效率。另外,还可以通过第四电子设备的提示音,来判断第四电子设备和第三电子设备之间的蓝牙连接状态,提升了蓝牙测试的准确性。The present application provides a Bluetooth automated testing method and related device, which can control an application program on a second electronic device or a third electronic device through an automated script, and then control the Bluetooth function of the fourth electronic device through the application program, thereby realizing Bluetooth testing of the fourth electronic device. There is no need to spend a lot of money cost and human resources, which improves the efficiency of Bluetooth automated testing. In addition, the Bluetooth connection state between the fourth electronic device and the third electronic device can also be judged through the prompt tone of the fourth electronic device, which improves the accuracy of the Bluetooth test.
第一方面,本申请提供一种蓝牙自动化测试方法。该方法可以应用于第一电子设备。该方法可以包括:第一电子设备可以根据标识信息选择与第四电子设备关联的自动化脚本;第一电子设备还可以根据自动化脚本控制第四电子设备与第三电子设备之间的蓝牙功能。可理解,标识信息用于标识第四电子设备。自动化脚本用于测试第四电子设备与第三电子设备之间的蓝牙功能。第四电子设备与第三电子设备之间存在蓝牙连接。In a first aspect, the present application provides a Bluetooth automated testing method. The method can be applied to the first electronic device. The method may include: the first electronic device may select an automation script associated with the fourth electronic device according to the identification information; the first electronic device may also control a Bluetooth function between the fourth electronic device and the third electronic device according to the automation script. It can be understood that the identification information is used to identify the fourth electronic device. The automation script is used to test the Bluetooth functionality between the fourth electronic device and the third electronic device. There is a Bluetooth connection between the fourth electronic device and the third electronic device.
在本申请提供的方案中,第一电子设备通过自动化脚本即可控制第四电子设备(蓝牙设备)与第三电子设备之间的蓝牙功能。比如,第一电子设备可以通过自动化脚本断开或连接第四电子设备和第三电子设备之间的蓝牙。再比如,第一电子设备可以通过自动化脚本实现切换至下一曲。可理解,第三电子设备上的音乐软件切换至下一曲,第四电子设备也相应的切换至下一曲。可理解,这种方法无需拆卸第四电子设备,也无需另外添加机械手,即可完成对第四电子设备的蓝牙测试,节约了金钱成本和人力成本,同时,也提高了蓝牙自动化测试的效率。In the solution provided in this application, the first electronic device can control the Bluetooth function between the fourth electronic device (Bluetooth device) and the third electronic device through an automated script. For example, the first electronic device may disconnect or connect the Bluetooth between the fourth electronic device and the third electronic device through an automated script. For another example, the first electronic device may switch to the next song through an automated script. It can be understood that, the music software on the third electronic device switches to the next song, and the fourth electronic device also switches to the next song accordingly. It can be understood that this method can complete the Bluetooth test on the fourth electronic device without disassembling the fourth electronic device or adding a manipulator, which saves money and labor costs, and at the same time improves the efficiency of the Bluetooth automated test.
结合第一方面,在第一方面的一种可能的实现方式中,第二电子设备安装有应用程序X。应用程序X用于控制第四电子设备的蓝牙功能。在第一电子设备根据标识信息选择自动化脚本之前,该方法还可以包括:第一电子设备可以接收第二电子设备发送的应用程序X的第一信息;第一电子设备还可以基于第一信息获取控制流程;第一电子设备还可以根据控制流程生成与第四电子设备关联的自动化脚本。可理解,第一信息用于标识应用程序X和应用程序X的控件。控制流程用于控制应用程序X。With reference to the first aspect, in a possible implementation manner of the first aspect, an application X is installed on the second electronic device. The application X is used to control the Bluetooth function of the fourth electronic device. Before the first electronic device selects the automation script according to the identification information, the method may further include: the first electronic device may receive the first information of the application X sent by the second electronic device; the first electronic device may also acquire based on the first information Control flow; the first electronic device may also generate an automation script associated with the fourth electronic device according to the control flow. Understandably, the first information is used to identify application X and controls of application X. Control flow is used to control application X.
在本申请提供的方案中,第一电子设备可以通过第二电子设备来获取应用程序X的包名、控件信息等相关信息(第一信息),并根据这些信息来获取控制流程。可理解,控制流程可以为测试人员基于第一信息写的代码。控制流程可以控制应用程序X。比如,控制流程可以控制应用程序X中的控件,使得应用程序X显示一个新的界面。第一电子设备还可以根据控制流程生成与第四电子设备关联的自动化脚本。也就是说,第一电子设备可以通过基于控制流程生成的自动化脚本,来控制应用程序X,从而控制第四电子设备的蓝牙功能,完成第四电子设备的蓝牙测试。可理解,该方法无需耗费大量金钱成本和人力成本,提高了蓝牙自动化测试的效率。In the solution provided in this application, the first electronic device can obtain related information (first information) such as the package name and control information of the application X through the second electronic device, and obtain the control flow according to the information. Understandably, the control flow may be code written by the tester based on the first information. Control flow can control application X. For example, the control flow can control a control in application X, causing application X to display a new interface. The first electronic device may also generate an automation script associated with the fourth electronic device according to the control flow. That is, the first electronic device can control the application X through an automated script generated based on the control process, thereby controlling the Bluetooth function of the fourth electronic device, and completing the Bluetooth test of the fourth electronic device. It is understandable that this method does not need to spend a lot of money cost and labor cost, and improves the efficiency of Bluetooth automated testing.
结合第一方面,在第一方面的一种可能的实现方式中,第三电子设备安装有应用程序X。应用程序X用于控制第四电子设备的蓝牙功能。在第一电子设备根据标识信息选择自动化脚本之前,该方法还可以包括:第一电子设备可以接收第三电子设备发送的应用程序X的第一信息;第一电子设备可以基于第一信息获取控制流程;第一电子设备可以根据控制流程生成与第四电子设备关联的自动化脚本。可理解,第一信息用于标识应用程序X和应用程序X的控件。控制流程用于控制应用程序X。With reference to the first aspect, in a possible implementation manner of the first aspect, an application X is installed on the third electronic device. The application X is used to control the Bluetooth function of the fourth electronic device. Before the first electronic device selects the automation script according to the identification information, the method may further include: the first electronic device may receive the first information of the application X sent by the third electronic device; the first electronic device may acquire control based on the first information Process; the first electronic device may generate an automation script associated with the fourth electronic device according to the control process. Understandably, the first information is used to identify application X and controls of application X. Control flow is used to control application X.
在本申请提供的方案中,第一电子设备可以通过第三电子设备来获取应用程序X的包名、控件信息等相关信息(第一信息),并根据这些信息来获取控制流程。可理解,控制流程可以为测试人员基于第一信息写的代码。控制流程可以控制应用程序X。比如,控制流程可以控制应用程序X中的控件,使得应用程序X显示一个新的界面。第一电子设备还可以根据控制流程生成与第四电子设备关联的自动化脚本。也就是说,第一电子设备可以通过基于控制流程生成的自动化脚本,来控制应用程序X,从而控制第四电子设备的蓝牙功能,完成第四电子设备的蓝牙测试。可理解,该方法无需耗费大量金钱成本和人力成本,提高了蓝牙自动化测试的效率。In the solution provided in this application, the first electronic device can obtain related information (first information) such as the package name and control information of the application X through the third electronic device, and obtain the control flow according to the information. Understandably, the control flow may be code written by the tester based on the first information. Control flow can control application X. For example, the control flow can control a control in application X, causing application X to display a new interface. The first electronic device may also generate an automation script associated with the fourth electronic device according to the control flow. That is, the first electronic device can control the application X through an automated script generated based on the control process, thereby controlling the Bluetooth function of the fourth electronic device, and completing the Bluetooth test of the fourth electronic device. It is understandable that this method does not need to spend a lot of money cost and labor cost, and improves the efficiency of Bluetooth automated testing.
结合第一方面,在第一方面的一种可能的实现方式中,第二电子设备安装有应用程序X。第一电子设备根据自动化脚本控制第四电子设备与第三电子设备之间的蓝牙功能,具体可以包括:第一电子设备可以根据自动化脚本向第二电子设备发送第一指令。第一指令用于控制第二电子设备中的应用程序X向第四电子设备发送第二指令。第二指令用于控制第四电子设备与第三电子设备之间的蓝牙功能。With reference to the first aspect, in a possible implementation manner of the first aspect, an application X is installed on the second electronic device. The first electronic device controls the Bluetooth function between the fourth electronic device and the third electronic device according to the automation script, which may specifically include: the first electronic device may send the first instruction to the second electronic device according to the automation script. The first instruction is used to control the application X in the second electronic device to send the second instruction to the fourth electronic device. The second instruction is used to control the Bluetooth function between the fourth electronic device and the third electronic device.
在本申请提供的方案中,第一电子设备可以通过自动化脚本控制第二电子设备上的应用程序X,进而控制第四电子设备的蓝牙功能。具体地,第一电子设备可以根据自动化脚本向第二电子设备发送第一指令。第一指令可以用于控制第二电子设备中的应用程序X。应用程序X再向第四电子设备发送第二指令。第二指令可以用于控制第四电子设备和第三电子设备之间的蓝牙功能。可理解,第一电子设备通过运行自动化脚本即可完成对第四电子设备的蓝牙测试,节约了大量金钱成本和人力成本,还提高了蓝牙测试的效率。In the solution provided by the present application, the first electronic device can control the application X on the second electronic device through an automated script, thereby controlling the Bluetooth function of the fourth electronic device. Specifically, the first electronic device may send the first instruction to the second electronic device according to the automation script. The first instruction can be used to control the application X in the second electronic device. The application X then sends the second instruction to the fourth electronic device. The second instruction may be used to control the Bluetooth function between the fourth electronic device and the third electronic device. It can be understood that the first electronic device can complete the Bluetooth test on the fourth electronic device by running the automated script, which saves a lot of money and labor costs, and also improves the efficiency of the Bluetooth test.
在本申请的一些实施例中,第一电子设备可以基于第二电子设备上的应用程序X来生成自动化脚本,并通过运行该自动化脚本来控制第二电子设备上的应用程序X,从而完成对第四电子设备的蓝牙自动化测试。In some embodiments of the present application, the first electronic device may generate an automation script based on the application X on the second electronic device, and control the application X on the second electronic device by running the automation script, thereby completing the Bluetooth automated testing of the fourth electronic device.
在本申请的一些实施例中,第一电子设备可以基于第三电子设备上的应用程序X来生成自动化脚本,并通过运行该自动化脚本来控制第二电子设备上的应用程序X,从而完成对第四电子设备的蓝牙自动化测试。In some embodiments of the present application, the first electronic device may generate an automation script based on the application X on the third electronic device, and control the application X on the second electronic device by running the automation script, thereby completing the Bluetooth automated testing of the fourth electronic device.
结合第一方面,在第一方面的一种可能的实现方式中,第三电子设备安装有应用程序X。第一电子设备根据自动化脚本控制第四电子设备与第三电子设备之间的蓝牙功能,具体可以包括:第一电子设备根据自动化脚本向第三电子设备发送第三指令。第三指令用于控制第三电子设备中的应用程序X向第四电子设备发送第二指令。第二指令用于控制第四电子设备与第三电子设备之间的蓝牙功能。With reference to the first aspect, in a possible implementation manner of the first aspect, an application X is installed on the third electronic device. The first electronic device controls the Bluetooth function between the fourth electronic device and the third electronic device according to the automated script, which may specifically include: the first electronic device sends a third instruction to the third electronic device according to the automated script. The third instruction is used to control the application X in the third electronic device to send the second instruction to the fourth electronic device. The second instruction is used to control the Bluetooth function between the fourth electronic device and the third electronic device.
在本申请提供的方案中,第一电子设备可以通过自动化脚本控制第三电子设备上的应用程序X,进而控制第四电子设备的蓝牙功能。具体地,第一电子设备可以根据自动化脚本向第三电子设备发送第三指令。第三指令可以用于控制第三电子设备中的应用程序X。应用程序X再向第四电子设备发送第二指令。第二指令可以用于控制第四电子设备和第三电子设备之间的蓝牙功能。可理解,第一电子设备通过运行自动化脚本即可完成对第四电子设备的蓝牙测试,节约了大量金钱成本和人力成本,还提高了蓝牙测试的效率。In the solution provided by the present application, the first electronic device can control the application X on the third electronic device through an automated script, thereby controlling the Bluetooth function of the fourth electronic device. Specifically, the first electronic device may send the third instruction to the third electronic device according to the automation script. The third instruction can be used to control the application X in the third electronic device. The application X then sends the second instruction to the fourth electronic device. The second instruction may be used to control the Bluetooth function between the fourth electronic device and the third electronic device. It can be understood that the first electronic device can complete the Bluetooth test on the fourth electronic device by running the automated script, which saves a lot of money and labor costs, and also improves the efficiency of the Bluetooth test.
在本申请的一些实施例中,第一电子设备可以基于第二电子设备上的应用程序X来生成自动化脚本,并通过运行该自动化脚本来控制第三电子设备上的应用程序X,从而完成对第四电子设备的蓝牙自动化测试。In some embodiments of the present application, the first electronic device may generate an automation script based on the application X on the second electronic device, and control the application X on the third electronic device by running the automation script, so as to complete the Bluetooth automated testing of the fourth electronic device.
在本申请的一些实施例中,第一电子设备可以基于第三电子设备上的应用程序X来生成自动化脚本,并通过运行该自动化脚本来控制第三电子设备上的应用程序X,从而完成对第四电子设备的蓝牙自动化测试。In some embodiments of the present application, the first electronic device may generate an automation script based on the application X on the third electronic device, and control the application X on the third electronic device by running the automation script, so as to complete the Bluetooth automated testing of the fourth electronic device.
结合第一方面,在第一方面的一种可能的实现方式中,该方法还可以包括:第一电子设备可以接收第四电子设备发送的提示音;第一电子设备还可以将第四电子设备发送的提示音与第四电子设备存储的提示音集S中的提示音进行比对,并确定蓝牙连接状态M。提示音集S包括第四电子设备在不同连接状态下的提示音。第一电子设备与第四电子设备之间存在通信连接。With reference to the first aspect, in a possible implementation manner of the first aspect, the method may further include: the first electronic device may receive a prompt tone sent by the fourth electronic device; the first electronic device may also send the fourth electronic device The sent prompt tone is compared with the prompt tone in the prompt tone set S stored by the fourth electronic device, and the Bluetooth connection state M is determined. The prompt tone set S includes prompt sounds of the fourth electronic device in different connection states. A communication connection exists between the first electronic device and the fourth electronic device.
在本申请提供的方案中,第一电子设备可以基于第四电子设备的提示音来判断第四电子设备与第三电子设备之间的蓝牙连接状态。具体地,第一电子设备可以将接收的第四电子设备发送的提示音,与预先存储的提示音集S中的提示音进行比对,在提示音集S中找到与第四电子设备发送的提示音一致的提示音,并根据该提示音对应的蓝牙连接状态确定蓝牙连接状态M。不直接通过查看第三电子设备的蓝牙连接状态来确定第三电子设备和第四电子设备之间的蓝牙连接状态,降低了误判的几率。即提高了蓝牙连接状态检测的准确性。In the solution provided by the present application, the first electronic device may determine the Bluetooth connection state between the fourth electronic device and the third electronic device based on the prompt sound of the fourth electronic device. Specifically, the first electronic device may compare the received prompt tone sent by the fourth electronic device with the prompt tone in the pre-stored prompt tone set S, and find in the prompt tone set S the prompt tone sent by the fourth electronic device. The prompt tone is the same, and the Bluetooth connection state M is determined according to the Bluetooth connection state corresponding to the prompt tone. The Bluetooth connection state between the third electronic device and the fourth electronic device is not directly determined by checking the Bluetooth connection state of the third electronic device, which reduces the probability of misjudgment. That is, the accuracy of the Bluetooth connection state detection is improved.
结合第一方面,在第一方面的一种可能的实现方式中,第一电子设备接收第四电子设备发送的提示音之前,该方法还可以包括:第一电子设备接收并存储测试人员录制的提示音集S。With reference to the first aspect, in a possible implementation manner of the first aspect, before the first electronic device receives the prompt tone sent by the fourth electronic device, the method may further include: the first electronic device receives and stores the sound recorded by the tester. Prompt tone set S.
在本申请提供的方案中,测试人员会录制不同型号的第四电子设备在不同连接状态下的提示音,并将其发送给第一电子设备。第一电子设备可以接收并存储这些提示音,以用于之后蓝牙自动化测试过程中的蓝牙状态检测。In the solution provided in this application, the tester will record the prompt sounds of different types of fourth electronic devices in different connection states, and send them to the first electronic device. The first electronic device may receive and store these prompt tones for use in subsequent Bluetooth state detection in the Bluetooth automated test process.
结合第一方面,在第一方面的一种可能的实现方式中,该方法还可以包括:第一电子设备可以通过第三电子设备确定蓝牙连接状态N;第一电子设备可以根据蓝牙连接状态M和蓝牙连接状态N,并确定第四电子设备与第三电子设备之间的蓝牙连接状态。With reference to the first aspect, in a possible implementation manner of the first aspect, the method may further include: the first electronic device may determine the Bluetooth connection state N through the third electronic device; the first electronic device may determine the Bluetooth connection state M according to the Bluetooth connection state M and the Bluetooth connection state N, and determine the Bluetooth connection state between the fourth electronic device and the third electronic device.
在本申请提供的方案中,第一电子设备还可以通过第三电子设备确定第四电子设备与第三电子设备之间的蓝牙连接状态——蓝牙连接状态N,并根据蓝牙连接状态N和蓝牙连接状态M最终确定第四电子设备与第三电子设备之间的蓝牙连接状态。该方法结合了多种检测方式来判断蓝牙连接状态,提高了蓝牙连接状态检测的准确性。In the solution provided in this application, the first electronic device can also determine the Bluetooth connection state between the fourth electronic device and the third electronic device—the Bluetooth connection state N through the third electronic device, and according to the Bluetooth connection state N and the Bluetooth connection state N The connection state M finally determines the Bluetooth connection state between the fourth electronic device and the third electronic device. The method combines a variety of detection methods to judge the Bluetooth connection state, and improves the accuracy of the Bluetooth connection state detection.
结合第一方面,在第一方面的一种可能的实现方式中,该方法可以包括:若自动化脚本中的指令所指示的蓝牙连接状态,与第四电子设备与第三电子设备之间的蓝牙连接状态不一致,第一电子设备判断蓝牙连接异常。第一电子设备可以通过控制声音和/或灯光提醒测试人员蓝牙连接异常。With reference to the first aspect, in a possible implementation manner of the first aspect, the method may include: if the Bluetooth connection state indicated by the instruction in the automation script is in the Bluetooth connection state indicated by the instruction in the automation script, and the Bluetooth connection between the fourth electronic device and the third electronic device If the connection status is inconsistent, the first electronic device determines that the Bluetooth connection is abnormal. The first electronic device can remind the tester of abnormal Bluetooth connection by controlling sound and/or light.
在本申请提供的方案中,第一电子设备可以判断第四电子设备和第三电子设备之间的蓝牙连接是否异常。若判断异常,则可以通过控制声音或灯光来提醒测试人员,便于测试人员及时记录并调整,可以提高蓝牙自动化测试的准确性。In the solution provided by this application, the first electronic device can determine whether the Bluetooth connection between the fourth electronic device and the third electronic device is abnormal. If it is judged to be abnormal, the tester can be reminded by controlling the sound or light, which is convenient for the tester to record and adjust in time, which can improve the accuracy of the Bluetooth automated test.
第二方面,本申请提供一种蓝牙自动化测试系统,该系统可以包括:第一电子设备、第三电子设备和第四电子设备。其中,第一电子设备,可以用于根据标识信息选择与第四电子设备关联的自动化脚本。第一电子设备,还可以用于根据自动化脚本控制第四电子设备与第三电子设备之间的蓝牙功能。可理解,标识信息用于标识第四电子设备。自动化脚本用于测试第四电子设备与第三电子设备之间的蓝牙功能。第三电子设备,可以用于与第四电子设备建立蓝牙连接。第四电子设备,用于与第三电子设备建立蓝牙连接。In a second aspect, the present application provides a Bluetooth automated testing system, which may include: a first electronic device, a third electronic device, and a fourth electronic device. The first electronic device may be used to select an automation script associated with the fourth electronic device according to the identification information. The first electronic device can also be used to control the Bluetooth function between the fourth electronic device and the third electronic device according to the automation script. It can be understood that the identification information is used to identify the fourth electronic device. The automation script is used to test the Bluetooth functionality between the fourth electronic device and the third electronic device. The third electronic device can be used to establish a Bluetooth connection with the fourth electronic device. The fourth electronic device is used to establish a Bluetooth connection with the third electronic device.
结合第二方面,在第二方面的一种可能的实现方式中,该系统还可以包括第二电子设备。第二电子设备安装有应用程序X。应用程序X可以用于控制第四电子设备的蓝牙功能。第一电子设备,在用于根据标识信息选择自动化脚本之前,还可以用于:接收第二电子设备发送的应用程序X的第一信息;基于第一信息获取控制流程;根据控制流程生成与第四电子设备关联的自动化脚本。可理解,第一信息用于标识应用程序X和应用程序X的控件。控制流程用于控制应用程序X。With reference to the second aspect, in a possible implementation manner of the second aspect, the system may further include a second electronic device. The second electronic device has an application X installed. Application X can be used to control the Bluetooth function of the fourth electronic device. Before the first electronic device is used to select the automation script according to the identification information, it can also be used to: receive the first information of the application X sent by the second electronic device; obtain the control flow based on the first information; Automated scripts for four electronic device associations. Understandably, the first information is used to identify application X and controls of application X. Control flow is used to control application X.
结合第二方面,在第二方面的一种可能的实现方式中,第三电子设备安装有应用程序X。应用程序X可以用于控制第四电子设备的蓝牙功能。第一电子设备,在用于根据标识信息选择自动化脚本之前,还可以用于:接收第三电子设备发送的应用程序X的第一信息;基于第一信息获取控制流程;根据控制流程生成与第四电子设备关联的自动化脚本。可理解,第一信息用于标识应用程序X和应用程序X的控件。控制流程用于控制应用程序X。With reference to the second aspect, in a possible implementation manner of the second aspect, an application X is installed on the third electronic device. Application X can be used to control the Bluetooth function of the fourth electronic device. Before the first electronic device is used to select the automation script according to the identification information, it can also be used to: receive the first information of the application X sent by the third electronic device; obtain the control flow based on the first information; Automated scripts for four electronic device associations. Understandably, the first information is used to identify application X and controls of application X. Control flow is used to control application X.
结合第二方面,在第二方面的一种可能的实现方式中,第一电子设备,在用于根据自动化脚本控制第四电子设备与第三电子设备之间的蓝牙功能时,具体可以用于:根据自动化脚本向第二电子设备发送第一指令。第一指令可以用于控制第二电子设备中的应用程序X向第四电子设备发送第二指令。第二指令用于控制第四电子设备与第三电子设备之间的蓝牙功能。With reference to the second aspect, in a possible implementation manner of the second aspect, when the first electronic device is used to control the Bluetooth function between the fourth electronic device and the third electronic device according to an automated script, it can specifically be used for : Send the first instruction to the second electronic device according to the automation script. The first instruction can be used to control the application X in the second electronic device to send the second instruction to the fourth electronic device. The second instruction is used to control the Bluetooth function between the fourth electronic device and the third electronic device.
结合第二方面,在第二方面的一种可能的实现方式中,该系统还包括第二电子设备。第二电子设备安装有应用程序X。第一电子设备,在用于根据自动化脚本控制第四电子设备与第三电子设备之间的蓝牙功能时,具体可以用于:根据自动化脚本向第二电子设备发送第一指令。第一指令可以用于控制第二电子设备中的应用程序X向第四电子设备发送第二指令。第二指令用于控制第四电子设备与第三电子设备之间的蓝牙功能。With reference to the second aspect, in a possible implementation manner of the second aspect, the system further includes a second electronic device. The second electronic device has an application X installed. When the first electronic device is used to control the Bluetooth function between the fourth electronic device and the third electronic device according to the automation script, it may specifically be used to: send the first instruction to the second electronic device according to the automation script. The first instruction can be used to control the application X in the second electronic device to send the second instruction to the fourth electronic device. The second instruction is used to control the Bluetooth function between the fourth electronic device and the third electronic device.
结合第二方面,在第二方面的一种可能的实现方式中,第三电子设备安装有应用程序X。第一电子设备,在用于根据自动化脚本控制第四电子设备与第三电子设备之间的蓝牙功能时,具体可以用于:根据自动化脚本向第三电子设备发送第三指令。第三指令用于控制第三电子设备中的应用程序X向第四电子设备发送第二指令。第二指令用于控制第四电子设备与第三电子设备之间的蓝牙功能。With reference to the second aspect, in a possible implementation manner of the second aspect, an application X is installed on the third electronic device. When the first electronic device is used to control the Bluetooth function between the fourth electronic device and the third electronic device according to the automation script, it can be specifically used for: sending a third instruction to the third electronic device according to the automation script. The third instruction is used to control the application X in the third electronic device to send the second instruction to the fourth electronic device. The second instruction is used to control the Bluetooth function between the fourth electronic device and the third electronic device.
结合第二方面,在第二方面的一种可能的实现方式中,第四电子设备,还可以用于:向第一电子设备发送提示音。第一电子设备与第四电子设备之间存在通信连接。第一电子设备,还可以用于:接收第四电子设备发送的提示音;将第四电子设备发送的提示音与提示音集S中的提示音进行比对,确定蓝牙连接状态M。提示音集S包括第四电子设备在不同连接状态下的提示音。With reference to the second aspect, in a possible implementation manner of the second aspect, the fourth electronic device may also be used to: send a prompt tone to the first electronic device. A communication connection exists between the first electronic device and the fourth electronic device. The first electronic device can also be used for: receiving the prompt tone sent by the fourth electronic device; The prompt tone set S includes prompt sounds of the fourth electronic device in different connection states.
结合第二方面,在第二方面的一种可能的实现方式中,第一电子设备,在用于接收第四电子设备发送的提示音之前,还可以用于:接收并存储测试人员录制的提示音集S。With reference to the second aspect, in a possible implementation manner of the second aspect, the first electronic device, before being used to receive the prompt tone sent by the fourth electronic device, can also be used to: receive and store the prompt recorded by the tester Tone Collection S.
结合第二方面,在第二方面的一种可能的实现方式中,第一电子设备,还可以用于:通过第三电子设备确定蓝牙连接状态N;根据蓝牙连接状态M和蓝牙连接状态N,确定第四电子设备与第三电子设备之间的蓝牙连接状态。With reference to the second aspect, in a possible implementation manner of the second aspect, the first electronic device can also be used to: determine the Bluetooth connection state N through the third electronic device; according to the Bluetooth connection state M and the Bluetooth connection state N, Determine the Bluetooth connection status between the fourth electronic device and the third electronic device.
结合第二方面,在第二方面的一种可能的实现方式中,第一电子设备,还可以用于:若自动化脚本中的指令所指示的蓝牙连接状态,与第四电子设备与第三电子设备之间的蓝牙连接状态不一致,判断蓝牙连接异常,并通过控制声音和/或灯光提醒测试人员蓝牙连接异常。In combination with the second aspect, in a possible implementation manner of the second aspect, the first electronic device can also be used to: if the Bluetooth connection state indicated by the instruction in the automation script, communicates with the fourth electronic device and the third electronic device If the Bluetooth connection status between the devices is inconsistent, it is judged that the Bluetooth connection is abnormal, and the tester is reminded that the Bluetooth connection is abnormal by controlling the sound and/or light.
第三方面,本申请提供一种电子设备。该电子设备可以包括:存储器、一个或多个处理器。存储器与一个或多个处理器耦合。存储器用于存储计算机程序代码。计算机程序代码包括计算机指令。一个或多个处理器用于调用计算机指令以使得该电子设备执行上述第一方面中任一种可能的实现方式。In a third aspect, the present application provides an electronic device. The electronic device may include: memory, one or more processors. A memory is coupled to the one or more processors. Memory is used to store computer program code. Computer program code includes computer instructions. The one or more processors are used to invoke computer instructions to cause the electronic device to perform any of the possible implementations of the first aspect above.
第四方面,本申请提供一种计算机存储介质,包括指令,当上述指令在电子设备上运行时,使得上述电子设备执行上述第一方面中任一种可能的实现方式。In a fourth aspect, the present application provides a computer storage medium, comprising instructions, when the above-mentioned instructions are executed on an electronic device, the above-mentioned electronic device is made to execute any one of the possible implementations of the above-mentioned first aspect.
第五方面,本申请实施例提供一种芯片,该芯片应用于电子设备,该芯片包括一个或多个处理器,该处理器用于调用计算机指令以使得该电子设备执行上述第一方面中任一种可能的实现方式。In a fifth aspect, an embodiment of the present application provides a chip, the chip is applied to an electronic device, the chip includes one or more processors, and the processor is configured to invoke computer instructions to cause the electronic device to execute any one of the first aspects above a possible implementation.
第六方面,本申请实施例提供一种包含指令的计算机程序产品,当上述计算机程序产品在设备上运行时,使得上述电子设备执行上述第一方面中任一种可能的实现方式。In a sixth aspect, an embodiment of the present application provides a computer program product containing instructions, which, when the computer program product is run on a device, enables the electronic device to execute any possible implementation manner of the first aspect.
可以理解地,上述第二方面提供的蓝牙自动化测试系统、第三方面提供的电子设备、第四方面提供的计算机存储介质、第五方面提供的芯片、第六方面提供的计算机程序产品均用于执行本申请实施例所提供的方法。因此,其所能达到的有益效果可参考对应方法中的有益效果,此处不再赘述。Understandably, the Bluetooth automated test system provided in the second aspect, the electronic device provided in the third aspect, the computer storage medium provided in the fourth aspect, the chip provided in the fifth aspect, and the computer program product provided in the sixth aspect are all used for Execute the methods provided in the embodiments of the present application. Therefore, for the beneficial effects that can be achieved, reference may be made to the beneficial effects in the corresponding method, which will not be repeated here.
附图说明Description of drawings
图1为本申请实施例提供的一种蓝牙自动化测试的系统架构;FIG. 1 is a system architecture of a Bluetooth automated test provided by an embodiment of the present application;
图2A-图2G为本申请实施例提供的一组用户界面;FIG. 2A-FIG. 2G provide a set of user interfaces according to an embodiment of the present application;
图3为本申请实施例提供的一种生成自动化脚本的方法;FIG. 3 provides a method for generating an automated script according to an embodiment of the present application;
图4为本申请实施例提供的一种检测蓝牙连接状态的方法;FIG. 4 provides a method for detecting a Bluetooth connection state according to an embodiment of the present application;
图5为本申请实施例提供的一种蓝牙自动化测试方法;Fig. 5 is a kind of Bluetooth automatic testing method provided by the embodiment of this application;
图6为本申请实施例提供的一种电子设备100的硬件结构示意图;FIG. 6 is a schematic diagram of a hardware structure of an electronic device 100 according to an embodiment of the present application;
图7为本申请实施例提供的一种电子设备100的软件结构框图。FIG. 7 is a block diagram of a software structure of an electronic device 100 according to an embodiment of the present application.
具体实施方式Detailed ways
下面将结合附图对本申请实施例中的技术方案进行清楚、详尽地描述。其中,在本申请实施例的描述中,除非另有说明,“/”表示或的意思,例如,A/B可以表示A或B;文本中的“和/或”仅仅是一种描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况,另外,在本申请实施例的描述中,“多个”是指两个或多于两个。The technical solutions in the embodiments of the present application will be described clearly and in detail below with reference to the accompanying drawings. Wherein, in the description of the embodiments of the present application, unless otherwise specified, “/” means or, for example, A/B can mean A or B; “and/or” in the text is only a description of an associated object The association relationship indicates that there can be three kinds of relationships, for example, A and/or B can indicate that A exists alone, A and B exist at the same time, and B exists alone. In addition, in the description of the embodiments of this application , "plurality" means two or more than two.
以下,术语“第一”、“第二”仅用于描述目的,而不能理解为暗示或暗示相对重要性或者隐含指明所指示的技术特征的数量。由此,限定有“第一”、“第二”的特征可以明示或者隐含地包括一个或者更多个该特征,在本申请实施例的描述中,除非另有说明,“多个”的含义是两个或两个以上。Hereinafter, the terms "first" and "second" are only used for descriptive purposes, and should not be construed as implying or implying relative importance or implying the number of indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include one or more of the features. In the description of the embodiments of the present application, unless otherwise specified, the "multiple" The meaning is two or more.
本申请涉及蓝牙测试领域,为了便于理解本申请提供的方法,下面对蓝牙测试领域的一些术语进行介绍。This application relates to the field of Bluetooth testing. In order to facilitate the understanding of the method provided by this application, some terms in the field of Bluetooth testing are introduced below.
1、蓝牙测试1. Bluetooth test
蓝牙测试大致可以分为三种:蓝牙设备认证测试、蓝牙协议一致性测试和软件测试。Bluetooth testing can be roughly divided into three types: Bluetooth device certification testing, Bluetooth protocol conformance testing and software testing.
其中,蓝牙设备认证测试一般根据蓝牙设备测试规范来进行。蓝牙设备测试规范包括一系列为验证蓝牙设备而设计的测试。蓝牙设备应对蓝牙设备测试规范中所有的蓝牙设备测试案例逐一进行验证。蓝牙协议一致性测试用于检查蓝牙协议的实现实体是否与该协议的内在动工规范要求相一致。Among them, the Bluetooth device certification test is generally carried out according to the Bluetooth device test specification. The Bluetooth Device Test Specification includes a series of tests designed to verify Bluetooth devices. The Bluetooth device shall verify all the Bluetooth device test cases in the Bluetooth device test specification one by one. The Bluetooth protocol conformance test is used to check whether the implementation entity of the Bluetooth protocol is consistent with the internal start-up specification requirements of the protocol.
可理解,在此提及的设备为包括蓝牙模块的设备。例如,手机、蓝牙耳机、蓝牙音箱等。It can be understood that the device mentioned here is a device including a Bluetooth module. For example, mobile phones, bluetooth headsets, bluetooth speakers, etc.
除了上述测试,还应该关注蓝牙的软件测试。因为蓝牙模块功能的好坏,还依赖于整个设备的软件的实现。同时,蓝牙模块的功能实现也在影响着设备软件的性能和功能。In addition to the above tests, you should also focus on software testing of Bluetooth. Because the function of the Bluetooth module is good or bad, it also depends on the realization of the software of the whole device. At the same time, the function realization of the Bluetooth module also affects the performance and function of the device software.
2、蓝牙软件测试2. Bluetooth software test
蓝牙软件测试基本上可以分为三类:功能测试、系统测试和互操作性测试。Bluetooth software testing can basically be divided into three categories: functional testing, system testing and interoperability testing.
功能测试是对蓝牙模块可以实现的功能进行测试。功能测试包括蓝牙的各个应用规范(profile)所实现的功能点以及人机界面的检验。系统测试是为了保证整个设备的软件系统具有一定的稳定性。系统测试包括接口测试、交互测试、性能测试、压力测试和互操作性测试等。其中,接口测试是为了测试蓝牙模块与其他模块之间的调用接口的功能是否正常。交互测试是为了测试蓝牙模块和其他模块的交互作用。性能测试是为了测试蓝牙模块的功能实现的用时是否能满足用户需求。压力测试一般通过重复操作来测试系统的稳定性。互操作性测试是为了测试一个蓝牙设备是否能与其他蓝牙设备兼容且正常工作。Functional test is to test the functions that can be realized by the Bluetooth module. The function test includes the function point realized by each application specification (profile) of Bluetooth and the inspection of the man-machine interface. System testing is to ensure that the software system of the entire equipment has a certain stability. System testing includes interface testing, interaction testing, performance testing, stress testing and interoperability testing. Among them, the interface test is to test whether the function of the calling interface between the Bluetooth module and other modules is normal. Interaction testing is to test the interaction between the Bluetooth module and other modules. The performance test is to test whether the functional realization time of the Bluetooth module can meet the user's needs. Stress testing generally tests the stability of a system by repeating operations. Interoperability testing is to test whether a Bluetooth device is compatible and working properly with other Bluetooth devices.
一般来说,在进行蓝牙测试时,需要耗费大量人力。例如,在进行功能测试时,一般需要手动测试。再例如,在进行系统测试时,需要重复操作,更是要耗费大量人力。Generally speaking, it takes a lot of manpower to perform Bluetooth testing. For example, when performing functional testing, manual testing is generally required. For another example, when performing system testing, repeated operations are required, and a lot of manpower is consumed.
为了降低人力耗费,设备制造商开始寻求蓝牙自动化测试方案。手机、平板电脑等设备具有操作系统(例如,安卓系统等),并且可以通过一些接口实现自动化控制。因此,对于手机、平板电脑等设备的蓝牙自动化测试方案已较为成熟。In order to reduce manpower consumption, equipment manufacturers have begun to seek Bluetooth automated test solutions. Devices such as mobile phones and tablet computers have operating systems (for example, Android systems, etc.), and can realize automatic control through some interfaces. Therefore, the Bluetooth automated test solution for devices such as mobile phones and tablet computers is relatively mature.
然而,由于蓝牙耳机、蓝牙音箱等设备没有操作系统,且没有能实现自动化控制的接口,所以,对于蓝牙耳机、蓝牙音箱等设备来说,无法采用适用于手机、平板等设备的蓝牙自动化测试方案。However, since devices such as Bluetooth headsets and Bluetooth speakers have no operating system and no interface that can realize automatic control, for devices such as Bluetooth headsets and Bluetooth speakers, it is impossible to use Bluetooth automated test solutions for mobile phones, tablets, and other devices. .
一般来说,蓝牙耳机、蓝牙音箱等设备的蓝牙自动化测试方案主要通过硬件来实现。例如,拆解设备,将设备的控制单元或管脚,与自动化控制线缆焊接。再例如,通过机械手控制来实现蓝牙自动化测试。Generally speaking, the bluetooth automation test scheme of bluetooth earphones, bluetooth speakers and other equipment is mainly realized by hardware. For example, disassemble the equipment, and weld the control unit or pins of the equipment with the automation control cable. For another example, Bluetooth automated testing is achieved through robotic control.
可理解,上述蓝牙自动化测试方案需要耗费大量的金钱成本和时间成本。It can be understood that the above-mentioned Bluetooth automated test solution requires a lot of money cost and time cost.
本申请提供了一种蓝牙自动化测试方法及相关装置。其中,第一电子设备可以通过自动化脚本控制第二电子设备或第三电子设备上的应用程序(Application,APP),而该APP用于控制第四电子设备的蓝牙,从而实现对第四电子设备的蓝牙测试。另外,第一电子设备还可以通过第三电子设备和/或第四电子设备,来判断第四电子设备和第三电子设备之间的蓝牙连接状态。The present application provides a Bluetooth automatic test method and related device. Wherein, the first electronic device can control an application (Application, APP) on the second electronic device or the third electronic device through an automated script, and the APP is used to control the Bluetooth of the fourth electronic device, so as to realize the connection to the fourth electronic device. Bluetooth test. In addition, the first electronic device may also use the third electronic device and/or the fourth electronic device to determine the Bluetooth connection state between the fourth electronic device and the third electronic device.
可理解,上述方法无需耗费大量金钱成本和人力资源,提高了蓝牙自动化测试的效率,也提升了蓝牙测试的准确性。It can be understood that the above method does not need to spend a lot of money cost and human resources, improves the efficiency of the Bluetooth automated test, and also improves the accuracy of the Bluetooth test.
下面结合图1介绍本申请提供的系统架构。The following describes the system architecture provided by the present application with reference to FIG. 1 .
如图1所示,第一电子设备与第二电子设备之间、第二电子设备与第四电子设备之间、第三电子设备与第四电子设备之间,以及第一电子设备与第四电子设备之间均建立了通信连接。其中,第四电子设备与第三电子设备之间建立的是蓝牙连接。As shown in FIG. 1, between the first electronic device and the second electronic device, between the second electronic device and the fourth electronic device, between the third electronic device and the fourth electronic device, and between the first electronic device and the fourth electronic device A communication connection is established between the electronic devices. Wherein, a Bluetooth connection is established between the fourth electronic device and the third electronic device.
可理解,第一电子设备和第二电子设备之间的通信连接方式可以包括但不限于通过无线局域网(Wireless Local Area Networks,WLAN)等无线通信方式,以及有线通信方式。例如,通过无线保真(Wireless Fidelity,Wi-Fi)网络建立通信连接。再例如,利用同轴电缆、双绞线、光纤等介质建立通信连接。It can be understood that the communication connection between the first electronic device and the second electronic device may include, but is not limited to, wireless communication such as wireless local area networks (Wireless Local Area Networks, WLAN), and wired communication. For example, a communication connection is established through a wireless fidelity (Wireless Fidelity, Wi-Fi) network. For another example, a communication connection is established using media such as coaxial cable, twisted pair, and optical fiber.
类似的,第二电子设备和第四电子设备之间的通信连接方式也可以包括但不限于无线通信方式和有线通信方式。Similarly, the communication connection manner between the second electronic device and the fourth electronic device may also include, but is not limited to, a wireless communication manner and a wired communication manner.
可理解,第一电子设备为可以与第二电子设备进行交互的终端。例如,第一电子设备可以为个人电脑(Personal Computer,PC)等终端设备中的任意一个。第二电子设备为可以与第一电子设备、第四电子设备进行交互的终端。例如,第二电子设备可以为智能手机、平板电脑等终端设备中的任意一个。第三电子设备为可以与第二电子设备、第四电子设备进行交互的终端。例如,第三电子设备可以为智能手机、平板电脑等终端设备中的任意一个。第四电子设备为可以与第二电子设备、第三电子设备进行交互的蓝牙设备。例如,第四电子设备可以为蓝牙耳机、蓝牙音箱等蓝牙设备中的任意一个。Understandably, the first electronic device is a terminal that can interact with the second electronic device. For example, the first electronic device may be any one of terminal devices such as a personal computer (Personal Computer, PC). The second electronic device is a terminal that can interact with the first electronic device and the fourth electronic device. For example, the second electronic device may be any one of terminal devices such as a smart phone and a tablet computer. The third electronic device is a terminal that can interact with the second electronic device and the fourth electronic device. For example, the third electronic device may be any one of terminal devices such as a smart phone and a tablet computer. The fourth electronic device is a Bluetooth device that can interact with the second electronic device and the third electronic device. For example, the fourth electronic device may be any one of Bluetooth devices such as a Bluetooth headset and a Bluetooth speaker.
在本申请的一些实施例中,第二电子设备上存在控制第四电子设备的蓝牙功能的APP。第一电子设备可以获取该APP的各个功能控件的信息,并基于这些信息获得对第四电子设备的蓝牙功能的控制流程,然后生成自动化脚本。当第一电子设备上运行自动化脚本时,第一电子设备根据该自动化脚本的内容向第二电子设备发送指令A,第二电子设备再根据该指令A向第四电子设备发送指令B,第四电子设备再根据该指令B向第三电子设备发送指令C,第三电子设备再向第四电子设备发送指令D,并根据该指令D实现对第四电子设备的蓝牙功能的控制,从而实现对第四电子设备的蓝牙功能的测试。In some embodiments of the present application, an APP for controlling the Bluetooth function of the fourth electronic device exists on the second electronic device. The first electronic device may obtain information of various function controls of the APP, and based on the information, obtain a control flow for the Bluetooth function of the fourth electronic device, and then generate an automation script. When the automation script is run on the first electronic device, the first electronic device sends an instruction A to the second electronic device according to the content of the automated script, and the second electronic device sends an instruction B to the fourth electronic device according to the instruction A, and the fourth electronic device sends an instruction B to the fourth electronic device. The electronic device then sends the instruction C to the third electronic device according to the instruction B, and the third electronic device sends the instruction D to the fourth electronic device, and realizes the control of the Bluetooth function of the fourth electronic device according to the instruction D, so as to realize the The test of the Bluetooth function of the fourth electronic device.
可理解,第二电子设备上的APP可以用于控制第四电子设备和第三电子设备之间的蓝牙功能。It can be understood that the APP on the second electronic device can be used to control the Bluetooth function between the fourth electronic device and the third electronic device.
在本申请的一些实施例中,第一电子设备与第三电子设备之间可以建立通信连接。第三电子设备上存在控制第四电子设备的蓝牙功能的APP。第一电子设备可以获取该APP的各个功能控件的信息,并基于这些信息获得对第四电子设备的蓝牙功能的控制流程,然后生成自动化脚本。当第一电子设备上运行自动化脚本时,第一电子设备根据该自动化脚本的内容向第三电子设备发送指令E,第三电子设备根据该指令E实现对第四电子设备的蓝牙功能的控制,从而实现对第四电子设备的蓝牙功能的测试。可理解,在这些实施例中,无需第二电子设备即可完成对第四电子设备的蓝牙功能的测试。In some embodiments of the present application, a communication connection may be established between the first electronic device and the third electronic device. An APP for controlling the Bluetooth function of the fourth electronic device exists on the third electronic device. The first electronic device may obtain information of various function controls of the APP, and based on the information, obtain a control flow for the Bluetooth function of the fourth electronic device, and then generate an automation script. When the automated script is run on the first electronic device, the first electronic device sends an instruction E to the third electronic device according to the content of the automated script, and the third electronic device controls the Bluetooth function of the fourth electronic device according to the instruction E, Thus, the test of the Bluetooth function of the fourth electronic device is realized. It can be understood that, in these embodiments, the test of the Bluetooth function of the fourth electronic device can be completed without the second electronic device.
可理解,第二电子设备和第四电子设备之间的通信连接方式也可以包括但不限于无线通信方式和有线通信方式。第三电子设备上的APP可以用于控制第四电子设备和第三电子设备之间的蓝牙功能。It can be understood that the communication connection manner between the second electronic device and the fourth electronic device may also include, but is not limited to, a wireless communication manner and a wired communication manner. The APP on the third electronic device can be used to control the Bluetooth function between the fourth electronic device and the third electronic device.
下面结合图2A~图2G介绍本申请实施例提供的一些用户界面。Some user interfaces provided by the embodiments of the present application are described below with reference to FIGS. 2A to 2G .
可理解,本申请的说明书和权利要求书及附图中的术语“用户界面”,是应用程序或操作系统与用户之间进行交互和信息交换的介质接口,它实现信息的内部形式与用户可以接受形式之间的转换。用户界面常用的表现形式是图形用户界面(graphic userinterface,GUI),是指采用图形方式显示的与计算机操作相关的用户界面。它可以是在电子设备的显示屏中显示的一个图标、窗口、控件等界面元素,其中控件可以包括图标、按钮、菜单、选项卡、文本框、对话框、状态栏、导航栏、Widget等可视的界面元素。It can be understood that the term "user interface" in the description, claims and drawings of this application is a medium interface for interaction and information exchange between an application program or an operating system and a user, and it realizes the internal form of information and the user interface. Conversions between accepted forms. A commonly used form of user interface is a graphical user interface (graphic user interface, GUI), which refers to a user interface related to computer operations displayed in a graphical manner. It can be an icon, window, control and other interface elements displayed on the display screen of the electronic device, wherein the control can include icons, buttons, menus, tabs, text boxes, dialog boxes, status bars, navigation bars, Widgets, etc. visual interface elements.
下面以图1所示的系统架构中存在第二电子设备的场景为例进行说明。The following description will be given by taking a scenario in which a second electronic device exists in the system architecture shown in FIG. 1 as an example.
1、建立电子设备间的通信连接(图2A~图2C)1. Establish a communication connection between electronic devices (Figure 2A to Figure 2C)
第一电子设备和第二电子设备之间建立通信连接,第二电子设备和第四电子设备之间建立蓝牙连接,第三电子设备和第四电子设备之间建立蓝牙连接。其中,第二电子设备上可以安装有控制第四电子设备的蓝牙功能的APP。A communication connection is established between the first electronic device and the second electronic device, a Bluetooth connection is established between the second electronic device and the fourth electronic device, and a Bluetooth connection is established between the third electronic device and the fourth electronic device. Wherein, an APP for controlling the Bluetooth function of the fourth electronic device may be installed on the second electronic device.
可理解,第二电子设备和第四电子设备之间还可以采取其他无线通信方式(例如,Wi-Fi等),或者有线通信方式,本申请对此不作限制。It can be understood that other wireless communication modes (eg, Wi-Fi, etc.) or wired communication modes may also be adopted between the second electronic device and the fourth electronic device, which is not limited in this application.
图2A示例性示出了第二电子设备上的用于展示第二电子设备安装的应用程序的用户界面210。FIG. 2A exemplarily shows a
用户界面210显示了一个放置有应用图标的页面,该页面可包括多个应用图标(例如,天气应用图标、日历应用图标、相册应用图标、便签应用图标、电子邮件应用图标、应用商店应用图标、设置应用图标、蓝牙设备控制应用图标211等等)。上述多个应用图标下方还可显示有页面指示符,以表明当前显示的页面与其他页面的位置关系。页面指示符的下方有多个托盘图标(例如,相机应用图标、浏览器应用图标、信息应用图标、拨号应用图标)。托盘图标在页面切换时保持显示。本申请提供的实施例对用户界面210上显示的内容不作限定。另外,本申请提供的实施例对上述图标的名称不作限制。相应的,上述图标所对应的应用程序的名称也不作限制。
需要说明的是,蓝牙设备控制应用图标211所对应的应用程序为蓝牙设备控制应用程序。可理解,该应用程序为控制第四电子设备的蓝牙功能的APP。It should be noted that the application corresponding to the Bluetooth device
可理解,第二电子设备可以检测到作用于蓝牙设备控制图标211的用户操作(比如触摸/点击操作),响应于该操作,电子设备100可以显示图2B所示的用户界面220。Understandably, the second electronic device can detect a user operation (such as a touch/click operation) acting on the Bluetooth
图2B示例性示出了第二电子设备上的蓝牙设备控制应用程序的用户界面220。如图2B所示,用户界面220可以包括设备显示区域221、蓝牙连接显示区域222和播放显示区域223。FIG. 2B exemplarily shows the
其中,设备显示区域221用于显示第二电子设备控制的第四电子设备的名称、电量等。Wherein, the
蓝牙连接显示区域222用于显示第四电子设备与其它设备的蓝牙连接状态。如图2B所示,第四电子设备已连接的设备包括DEVICE 2和DEVICE 3。其中,DEVICE 2表示的是第二电子设备,DEVICE 3表示的是第三电子设备。另外,DEVICE 3后的图标表明第四电子设备正在播放第三电子设备所播放的内容。The Bluetooth
播放显示区域223用于显示第四电子设备的播放内容。如图2B所示,第四电子设备播放的是歌曲《指北针》,当前播放的歌词是“人世间,不知归处”。可理解,播放显示区域223可以包括切换上一曲控件2231、暂停控件2232、切换下一曲控件2233、播放进度控件2234和音量控件2235。其中,切换上一曲控件2231用于将当前播放歌曲切换为上一首歌曲。暂停控件2232用于暂停当前播放的歌曲。切换下一曲控件2233用于将当前播放歌曲切换为下一首歌曲。播放进度控件2234用于显示及调节当前歌曲的播放进度。音量控件2235用于调节音量。The
图2C示例性示出了第三电子设备上的音乐播放应用程序的用户界面230。如图2C所示,用户界面230可以包括播放进度控件233和显示区域232。FIG. 2C exemplarily shows the
其中,播放进度控件233用于显示及调节当前歌曲的播放进度。Among them, the playback progress control 233 is used to display and adjust the playback progress of the current song.
显示区域232可以包括切换上一曲控件2321、暂停控件2322和切换下一曲控件2323。其中,切换上一曲控件2321用于将当前播放歌曲切换为上一首歌曲。暂停控件2322用于暂停当前播放的歌曲。切换下一曲控件2323用于将当前播放歌曲切换为下一首歌曲。The
2、进行蓝牙自动化测试(图2D~图2F)2. Carry out the Bluetooth automated test (Figure 2D ~ Figure 2F)
第一电子设备与第二电子设备之间建立通信连接,且第二电子设备和第四电子设备之间、第三电子设备和第四电子设备之间均建立蓝牙连接之后,第一电子设备可以根据标识信息来选择自动化脚本,并运行自动化脚本来进行蓝牙自动化测试。可理解,进行蓝牙自动化测试的具体方法会在后续实施例中介绍,在此不展开说明。After a communication connection is established between the first electronic device and the second electronic device, and a Bluetooth connection is established between the second electronic device and the fourth electronic device, and between the third electronic device and the fourth electronic device, the first electronic device can The automation script is selected based on the identification information, and the automation script is run to perform the Bluetooth automation test. It is understandable that the specific method for performing the Bluetooth automated test will be introduced in the subsequent embodiments, and will not be described here.
在本申请的一些实施例中,第一电子设备运行的自动化脚本中存在暂停/启动播放控制流程。也就是说,第一电子设备可以模拟作用在暂停控件2322上的用户操作,从而使得第二电子设备向第四电子设备发送指令,再由第四电子设备向第三电子设备发送指令,使得第三电子设备停止播放,最终由第三电子设备将停止播放的指令发送给第四电子设备,使得第四电子设备也停止播放。类似的,第一电子设备还可以通过控制第二电子设备,使得第三电子设备启动播放。In some embodiments of the present application, there is a pause/start playback control flow in the automation script run by the first electronic device. That is to say, the first electronic device can simulate the user operation acting on the
图2D示例性示出了第二电子设备上的蓝牙设备控制应用程序的用户界面240。用户界面240为第一电子设备模拟作用在暂停控件2322上的用户操作之后第二电子设备所显示的用户界面。用户界面240中的控件与用户界面220中的控件基本一致。区别在于,用户界面240还包括播放控件241,而不包括暂停控件2322。可理解,播放控件241用于播放当前暂停的歌曲。FIG. 2D exemplarily shows the
图2E示例性示出了第三电子设备上的音乐播放应用程序的用户界面250。用户界面250为第一电子设备模拟作用在暂停控件2322上的用户操作之后第三电子设备所显示的用户界面。用户界面250中的控件与用户界面230中的控件基本一致。区别在于,用户界面250还包括播放控件251,而不包括暂停控件2322。可理解,播放控件251用于播放当前暂停的歌曲。FIG. 2E exemplarily shows the
在本申请的一些实施例中,还可以在其他场景(例如,图1所示的系统架构中不存在第二电子设备的场景)下实现蓝牙自动化测试。第一电子设备可以和第三电子设备之间建立通信连接,第三电子设备和第四电子设备之间建立蓝牙连接。可理解,第三电子设备上可以安装有蓝牙设备控制应用程序(如图2A所示)和音乐播放应用程序。In some embodiments of the present application, the Bluetooth automated test may also be implemented in other scenarios (eg, a scenario in which the second electronic device does not exist in the system architecture shown in FIG. 1 ). A communication connection can be established between the first electronic device and the third electronic device, and a Bluetooth connection can be established between the third electronic device and the fourth electronic device. Understandably, a Bluetooth device control application (as shown in FIG. 2A ) and a music playing application may be installed on the third electronic device.
图2F示例性示出了第三电子设备上的蓝牙设备控制应用程序的用户界面260。用户界面260中的控件与用户界面220中的控件基本一致。蓝牙连接显示区域222用于显示第四电子设备与其它设备的蓝牙连接状态。如图2B所示,第四电子设备已连接的设备包括DEVICE 3。DEVICE 3表示的是第三电子设备。另外,DEVICE 3后的图标表明第四电子设备正在播放第三电子设备所播放的内容。FIG. 2F exemplarily shows the
可理解,第三电子设备在显示用户界面260时,音乐播放应用程序在后台运行。若第三电子设备上的音乐播放应用程序退出后台运行,第三电子设备可以显示如图2C所示的用户界面230。It can be understood that when the third electronic device displays the
在本申请的一些实施例中,第一电子设备运行的自动化脚本中存在暂停/启动播放控制流程。也就是说,第一电子设备可以模拟作用在暂停控件2322上的用户操作,来控制第三电子设备上的蓝牙设备控制应用程序,从而使得第三电子设备停止播放,并且,最终由第三电子设备将停止播放的指令发送给第四电子设备,使得第四电子设备也停止播放。可理解,启动播放的过程与上述暂停播放的过程类似,参考上述内容即可,在此不再赘述。In some embodiments of the present application, there is a pause/start playback control flow in the automation script run by the first electronic device. That is to say, the first electronic device can simulate the user operation acting on the
具体地,第一电子设备模拟作用在暂停控件2322上的用户操作,第三电子设备可以显示如图2D所示的用户界面240。若第三电子设备上的音乐播放应用程序退出后台运行,第三电子设备可以显示如图2E所示的用户界面250。也就是说,第三电子设备停止了播放音乐。Specifically, the first electronic device simulates a user operation acting on the
可理解,上述蓝牙自动化测试仅通过一些电子设备即可完成,无需耗费大量金钱成本和人力资源,提高了蓝牙自动化测试的效率。It can be understood that the above-mentioned Bluetooth automatic test can be completed only by some electronic devices, without consuming a lot of money cost and human resources, which improves the efficiency of the Bluetooth automatic test.
3、检测蓝牙连接状态(图2G)3. Check the Bluetooth connection status (Figure 2G)
第一电子设备可以根据第四电子设备发送的提示音判断第四电子设备与第三电子设备的蓝牙连接状态。第一电子设备也可以根据第二电子设备显示的用户界面和/或第三电子设备显示的用户界面,判断第四电子设备与第三电子设备的蓝牙连接状态。The first electronic device can determine the Bluetooth connection state between the fourth electronic device and the third electronic device according to the prompt tone sent by the fourth electronic device. The first electronic device may also determine the Bluetooth connection state between the fourth electronic device and the third electronic device according to the user interface displayed by the second electronic device and/or the user interface displayed by the third electronic device.
如图2B和图2D所示,蓝牙连接显示区域222中显示第四电子设备已连接的设备包括DEVICE 2和DEVICE 3。其中,DEVICE 2表示的是第二电子设备。DEVICE 3表示的是第三电子设备。也就是说,根据第二电子设备显示的用户界面220和用户界面240可得:第四电子设备与第三电子设备的蓝牙连接状态为连接状态。As shown in FIG. 2B and FIG. 2D , the connected devices of the fourth electronic device in the Bluetooth
图2G示例性示出了第三电子设备上的蓝牙连接界面270。蓝牙连接界面270包括显示区域271、显示区域272和显示区域273。FIG. 2G exemplarily shows the
其中,显示区域271用于显示第三电子设备的蓝牙是否开启,以及该设备用于蓝牙连接时的设备名称。如图2G所示,设备名称为DEVICE 3,即表示该设备为第三电子设备。Wherein, the
显示区域272用于显示第三电子设备已连接的设备。如图2G所示,第三电子设备已连接的设备包括DEVICE 4,即第三电子设备与第四电子设备之间存在蓝牙连接。The
显示区域273用于显示第三电子设备可以检测到的已开启蓝牙,并可以建立蓝牙连接的设备。如图2G所示,第三电子设备检测到DEVICE 1和DEVICE 2均开启了蓝牙,并且这些设备可以与第三电子设备建立蓝牙连接。其中,DEVICE 1表示的是第一电子设备,DEVICE2表示的是第二电子设备。The
可理解,第一电子设备可以选择通过不同的方式来检测第三电子设备与第四电子设备之间的蓝牙连接状态。第一电子设备可以将检测结果与自动化脚本中的控制流程进行比对,从而确定第三电子设备与第四电子设备之间的蓝牙连接状态是否正常。上述方式可以提高蓝牙自动化测试的准确性。It can be understood that the first electronic device may choose to detect the Bluetooth connection state between the third electronic device and the fourth electronic device in different ways. The first electronic device can compare the detection result with the control flow in the automated script, so as to determine whether the Bluetooth connection state between the third electronic device and the fourth electronic device is normal. The above method can improve the accuracy of the Bluetooth automated test.
下面结合图3具体介绍本申请提供的一种生成自动化脚本的方法。A method for generating an automated script provided by the present application will be described in detail below with reference to FIG. 3 .
S301:第一电子设备和第二电子设备之间建立通信连接,第二电子设备和第四电子设备之间建立通信连接,第三电子设备和第四电子设备之间建立蓝牙连接。S301: Establish a communication connection between the first electronic device and the second electronic device, establish a communication connection between the second electronic device and the fourth electronic device, and establish a Bluetooth connection between the third electronic device and the fourth electronic device.
可理解,第一电子设备与第二电子设备之间建立的通信连接方式可以包括但不限于无线通信方式和有线通信方式。It can be understood that the communication connection manner established between the first electronic device and the second electronic device may include, but is not limited to, a wireless communication manner and a wired communication manner.
类似的,第二电子设备和第四电子设备之间的通信连接方式也可以包括蓝牙、Wi-Fi等无线通信方式,以及有线通信方式。Similarly, the communication connection method between the second electronic device and the fourth electronic device may also include wireless communication methods such as Bluetooth and Wi-Fi, as well as wired communication methods.
需要说明的是,第二电子设备上安装有可以控制第四电子设备与第三电子设备之间的蓝牙功能的APP。可理解,该APP可以为上述实施例中提及的蓝牙设备控制应用程序。为了便于后续描述,将该APP记为应用程序X。It should be noted that an APP capable of controlling the Bluetooth function between the fourth electronic device and the third electronic device is installed on the second electronic device. It can be understood that the APP can be the Bluetooth device control application mentioned in the above embodiment. For the convenience of subsequent description, the APP is denoted as application X.
S302:第二电子设备向第一电子设备发送应用程序X的第一信息。S302: The second electronic device sends the first information of the application X to the first electronic device.
第二电子设备可以将应用程序X的第一信息发送给第一电子设备。可理解,应用程序X的第一信息可以包括但不限于包名和控件信息。也就是说,第一信息可以用于标识应用程序X和应用程序X的控件。The second electronic device may send the first information of the application X to the first electronic device. It can be understood that the first information of the application X may include, but is not limited to, the package name and control information. That is, the first information may be used to identify application X and controls of application X.
可理解,包名为APP的唯一标识。不同APP的包名一般不同。控件信息可以包括启动页activity名称、控件text和控件id等。其中,启动页为启动应用程序X后显示的页面。控件text为用于标识控件的文字信息。控件id也用于标识控件。不同控件的控件id一般不同。Understandably, the package name is the unique identifier of the APP. The package names of different apps are generally different. The control information can include the activity name of the startup page, the control text, and the control id, etc. The startup page is the page displayed after the application X is started. The control text is text information used to identify the control. The control id is also used to identify the control. The control ids of different controls are generally different.
示例性的,如图2B所示,音量控件2235的控件text为“音量”。Exemplarily, as shown in FIG. 2B , the control text of the
示例性的,如图2B所示,第二电子设备将切换上一曲控件2231、暂停控件2232、切换下一曲控件2233、播放进度控件2234和音量控件2235的控件text和控件id发送给第一电子设备。Exemplarily, as shown in FIG. 2B , the second electronic device sends the control text and control id of the switch to the
S303:第一电子设备接收第二电子设备发送的应用程序X的第一信息。S303: The first electronic device receives the first information of the application X sent by the second electronic device.
相应的,第二电子设备将应用程序X的包名和控件信息等第一信息发送给第一电子设备后,第一电子设备可以接收该应用程序X的包名和控件信息。Correspondingly, after the second electronic device sends the first information such as the package name and control information of the application X to the first electronic device, the first electronic device can receive the package name and control information of the application X.
可理解,第一电子设备可以根据控件text和控件id找到具体的控件。It is understandable that the first electronic device can find a specific control according to the control text and the control id.
S304:第一电子设备获取控制流程。S304: The first electronic device acquires a control process.
具体地,测试人员可以在第一电子设备上写入一个或多个控制流程,第一电子设备可以获取该一个或多个控制流程。若第一电子设备执行该一个或多个控制流程,可以控制第二电子设备上的应用程序X作出相应的调节,进而控制第四电子设备和第三电子设备。Specifically, the tester can write one or more control procedures on the first electronic device, and the first electronic device can obtain the one or more control procedures. If the first electronic device executes the one or more control procedures, it can control the application X on the second electronic device to make corresponding adjustments, thereby controlling the fourth electronic device and the third electronic device.
可理解,控制流程用于控制第二电子设备上的应用程序X,使其完成相应的调节。在本申请的一些实施例中,控制流程为测试人员写入的代码。It can be understood that the control flow is used to control the application X on the second electronic device, so that it can complete the corresponding adjustment. In some embodiments of the present application, the control flow is code written by a tester.
例如,控制流程可以包括切换下一曲控制流程、切换上一曲控制流程、暂停/启动播放控制流程、音量控制流程、蓝牙连接和断开控制流程、接听/挂断来电控制流程等。For example, the control flow may include switching the next song control flow, switching the previous song control flow, pause/start playback control flow, volume control flow, Bluetooth connection and disconnection control flow, answer/hang up call control flow, etc.
具体地,第一电子设备可以通过切换下一曲控制流程来控制第二电子设备上的应用程序X执行切换下一曲的命令。第一电子设备可以通过切换上一曲控制流程来控制第二电子设备上的应用程序X执行切换上一曲的命令。第一电子设备可以通过切换暂停/启动播放控制流程来控制第二电子设备上的应用程序X执行切换暂停播放或启动播放的命令。第一电子设备可以通过音量控制流程来控制第二电子设备上的应用程序X执行调节音量的命令。第一电子设备可以通过蓝牙连接和断开控制流程来控制第二电子设备上的应用程序X执行断开/连接第四电子设备和第三电子设备之间的蓝牙的命令。第一电子设备可以通过接听/挂断来电控制流程来控制第二电子设备上的应用程序X执行接听/挂断来电的命令。Specifically, the first electronic device can control the application X on the second electronic device to execute the command to switch the next song by switching the next song control flow. The first electronic device can control the application X on the second electronic device to execute the command of switching the previous song by switching the control flow of the previous song. The first electronic device can control the application X on the second electronic device to execute the command of switching to pause or start playback by switching the pause/start playback control process. The first electronic device can control the application X on the second electronic device to execute the command to adjust the volume through the volume control process. The first electronic device can control the application X on the second electronic device to execute the command of disconnecting/connecting the Bluetooth between the fourth electronic device and the third electronic device through the Bluetooth connection and disconnection control procedure. The first electronic device can control the application X on the second electronic device to execute the command of answering/hanging up the incoming call through the control procedure of answering/hanging up the incoming call.
可理解,控制流程还可以包括其他内容,上述示例不应视为对本申请的限制。It is understandable that the control flow may also include other contents, and the above examples should not be regarded as a limitation of the present application.
一般来说,控制流程包括一项或多项操作。Generally speaking, a control flow consists of one or more operations.
在本申请的一些实施例中,控制流程可以包括对控件的操作。具体地,控制流程可以包括根据控件text、控件id查找相应的控件,再实现对该控件的模拟操作。可理解,模拟操作指的是模拟用户操作。例如,模拟操作可以包括对单击、按字符单击、按控件单击、双击、滑动控件、向左滑动控件、向右滑动控件等用户操作的模拟。第一电子设备完成模拟操作所达到的效果,与用户作用在应用程序X上的操作所达到的效果一般是相同的。In some embodiments of the present application, the control flow may include operations on controls. Specifically, the control flow may include searching for a corresponding control according to the control text and the control id, and then implementing a simulation operation for the control. It can be understood that the simulated operation refers to simulated user operation. For example, the simulated operations may include simulation of user operations such as click, click by character, click by control, double click, slide control, slide left control, slide right control, and the like. The effect achieved by the first electronic device completing the simulation operation is generally the same as the effect achieved by the operation performed by the user on the application X.
可理解,第一电子设备可以利用ADB来实现对第二电子设备上的应用程序X的控件的模拟操作。ADB的全称为Android Debug Bridge,中文含义是安卓调试桥。ADB是androidsdk里的一个工具,用这个工具可以直接操作管理android模拟器或者真实的andriod设备。也可以将ADB理解为一个客户端-服务器端程序。其中,客户端是用来操作的设备(例如,本申请中的第一电子设备),服务器端是android设备(例如,本申请中的第二电子设备)。It can be understood that the first electronic device can use ADB to implement the simulated operation on the control of the application X on the second electronic device. The full name of ADB is Android Debug Bridge, which means Android Debug Bridge in Chinese. ADB is a tool in androidsdk, with which you can directly operate and manage android emulators or real andriod devices. ADB can also be understood as a client-server program. The client is a device used for operation (for example, the first electronic device in this application), and the server is an android device (for example, the second electronic device in this application).
ADB的主要功能有:1)运行设备的shell(命令行);2)管理模拟器或设备的端口映射;3)计算机和设备之间上传/下载文件;4)将本地安卓安装包(Android Package,APK)软件安装至模拟器或android设备。The main functions of ADB are: 1) run the shell (command line) of the device; 2) manage the port mapping of the emulator or device; 3) upload/download files between the computer and the device; 4) upload the local Android installation package (Android Package) , APK) software is installed to the emulator or android device.
具体地,第一电子设备可以通过运行对第二电子设备的ADBshell来实现对第二电子设备上的控件的模拟操作。Specifically, the first electronic device may implement the simulated operation on the controls on the second electronic device by running the ADBshell on the second electronic device.
在本申请的一些实施例中,控制流程可以包括启动应用程序X。也就是说,控制流程可以包括显示应用程序X的启动页。具体地,控制流程可以包括根据包名和activity名称找到应用程序X,并打开应用程序X的启动页。In some embodiments of the present application, the control flow may include launching application X. That is, the control flow may include displaying the application X's startup page. Specifically, the control flow may include finding the application X according to the package name and the activity name, and opening the startup page of the application X.
需要说明的是,为了便于操作,测试人员可以先定义应用程序X中的操作对象(例如,启动页和控件等)。为了实现对应用程序X中的控件的控制,测试人员还可以将操作对象与接收的应用程序X的第一信息进行关联。也就是说,在执行步骤S304之前,测试人员可以将接收到的应用程序X的第一信息与定义的操作对象进行关联。测试人员写入控制流程时就可以直接查找操作对象,并实现对操作对象的模拟操作,无需根据控件text和控件id查找控件。It should be noted that, in order to facilitate the operation, the tester can first define the operation objects in the application X (for example, the startup page and controls, etc.). In order to control the controls in the application X, the tester can also associate the operation object with the received first information of the application X. That is, before performing step S304, the tester can associate the received first information of the application X with the defined operation object. When the tester writes the control flow, he can directly find the operation object, and realize the simulated operation of the operation object, without searching for the control according to the control text and control id.
示例性的,测试人员可以将应用程序X中的启动页定义为win_name,将应用程序X中的播放&暂停控件定义为play_pause_button,将应用程序X中的前一曲控件定义为previous_button,将应用程序X中的后一曲控件定义为next_button,将应用程序X中的音量控件定义为volume_slider。Exemplarily, the tester may define the startup page in application X as win_name, the play&pause control in application X as play_pause_button, the previous control in application X as previous_button, and the application The next track control in X is defined as next_button, and the volume control in application X is defined as volume_slider.
下面示例性给出控制流程。The control flow is exemplified below.
1、切换下一曲控制流程1. Switch to the next control flow
①第一电子设备启动应用程序X,并显示应用程序X的启动页。① The first electronic device starts the application X, and displays the startup page of the application X.
具体地,第一电子设备找到包名为xxx_apk.win_name的APP,并启动该APP。可理解,该APP即为应用程序X。Specifically, the first electronic device finds an APP whose package name is xxx_apk.win_name, and starts the APP. Understandably, the APP is the application X.
②第一电子设备切换下一曲。②The first electronic device switches to the next song.
具体地,第一电子设备通过ADB对next_button进行单击操作。Specifically, the first electronic device performs a click operation on the next_button through the ADB.
2、音量控制流程2. Volume control process
①第一电子设备启动应用程序X,并显示应用程序X的启动页。① The first electronic device starts the application X, and displays the startup page of the application X.
具体地,第一电子设备找到包名为xxx_apk.win_name的APP,并启动该APP。可理解,该APP即为应用程序X。Specifically, the first electronic device finds an APP whose package name is xxx_apk.win_name, and starts the APP. Understandably, the APP is the application X.
②第一电子设备增加音量。②The first electronic device increases the volume.
具体地,第一电子设备通过ADB对volume_slider进行向右滑动操作。Specifically, the first electronic device performs a rightward sliding operation on the volume_slider through the ADB.
③第一电子设备减小音量。③ The first electronic device reduces the volume.
具体地,第一电子设备通过ADB对volume_slider进行向左滑动操作。Specifically, the first electronic device performs a leftward sliding operation on the volume_slider through the ADB.
可理解,上述两个示例是对控制流程的说明,不应理解为对控制流程的限制。控制流程可以包括但不限于上述两个示例。It can be understood that the above two examples are descriptions of the control flow, and should not be construed as a limitation on the control flow. The control flow may include but is not limited to the above two examples.
S305:第一电子设备根据获取的控制流程生成自动化脚本。S305: The first electronic device generates an automation script according to the acquired control process.
具体地,第一电子设备生成一个或多个自动化脚本。可理解,自动化脚本中可以包括重复执行的单个控制流程,还可以包括顺序执行的多个控制流程,本申请对此不作限制。Specifically, the first electronic device generates one or more automation scripts. It can be understood that the automation script may include a single control flow that is repeatedly executed, and may also include multiple control flows that are executed sequentially, which is not limited in this application.
示例性的,自动化脚本中可以包括重复执行(例如,重复执行500次)的蓝牙连接和断开控制流程。Exemplarily, the automation script may include a Bluetooth connection and disconnection control process that is repeatedly executed (for example, repeatedly executed 500 times).
示例性的,自动化脚本中可以包括顺序执行开机和关机控制流程、接听来电和挂断来电控制流程。其中,顺序执行的次数可以为一次或多次。例如,第一电子设备顺序执行上述两个控制流程的次数可以为300次。Exemplarily, the automation script may include sequentially executing the power-on and power-off control procedures, and the control procedures for answering an incoming call and hanging up an incoming call. The number of times of sequence execution may be one or more times. For example, the number of times that the first electronic device sequentially executes the above two control procedures may be 300 times.
示例性的,自动化脚本中可以包括顺序执行切换下一曲控制流程、切换上一曲控制流程、暂停/启动播放控制流程、音量控制流程、蓝牙连接和断开控制流程、开机和关机控制流程、接听来电和挂断来电控制流程。其中,顺序执行的次数可以为一次或多次。Exemplarily, the automation script may include sequentially executing the control flow of switching to the next song, switching the control flow of the previous song, pausing/starting the playback control flow, volume control flow, Bluetooth connection and disconnection control flow, power-on and shutdown control flow, Answer incoming calls and hang up incoming calls control process. The number of times of sequence execution may be one or more times.
需要说明的是,第一电子设备根据上述方法生成的自动化脚本为与第四电子设备关联的自动化脚本。It should be noted that the automation script generated by the first electronic device according to the above method is an automation script associated with the fourth electronic device.
在本申请的一些实施例中,无需第二电子设备也可以生成自动化脚本。具体地,第一电子设备可以接收第三电子设备发送的应用程序X的第一信息,并基于该第一信息获取控制流程,进而生成与第四电子设备关联的自动化脚本。也就是说,应用程序X可以安装在第三电子设备上,且第三电子设备上的应用程序X可以控制第三电子设备与第四电子设备之间的蓝牙功能。In some embodiments of the present application, an automated script may be generated without a second electronic device. Specifically, the first electronic device may receive the first information of the application X sent by the third electronic device, obtain a control process based on the first information, and then generate an automation script associated with the fourth electronic device. That is, the application X can be installed on the third electronic device, and the application X on the third electronic device can control the Bluetooth function between the third electronic device and the fourth electronic device.
另外,第一电子设备可以通过获取的控制流程来控制第三电子设备上的应用程序X。需要说明的是,若控制流程为蓝牙连接和断开控制流程,第一电子设备通过控制第三电子设备上的应用程序X来改变蓝牙连接状态。若第一电子设备控制应用程序X使得第三电子设备与第四电子设备之间的蓝牙连接断开,可以由测试人员手动连接第三电子设备与第四电子设备之间的蓝牙。In addition, the first electronic device can control the application X on the third electronic device through the acquired control flow. It should be noted that, if the control process is the Bluetooth connection and disconnection control process, the first electronic device changes the Bluetooth connection state by controlling the application X on the third electronic device. If the first electronic device control application X disconnects the Bluetooth connection between the third electronic device and the fourth electronic device, the tester can manually connect the Bluetooth between the third electronic device and the fourth electronic device.
下面结合图4具体介绍本申请提供的一种检测蓝牙连接状态的方法。A method for detecting a Bluetooth connection state provided by the present application will be described in detail below with reference to FIG. 4 .
S401:第一电子设备与第四电子设备建立通信连接。S401: The first electronic device establishes a communication connection with the fourth electronic device.
可理解,第一电子设备与第四电子设备之间建立的通信连接方式可以包括但不限于无线通信方式和有线通信方式。It can be understood that the communication connection manner established between the first electronic device and the fourth electronic device may include, but is not limited to, a wireless communication manner and a wired communication manner.
S402:第四电子设备将本设备的提示音发送给第一电子设备。S402: The fourth electronic device sends the prompt sound of the device to the first electronic device.
具体地,第四电子设备可以实时收集本设备的提示音,并将其发送给第一电子设备。Specifically, the fourth electronic device can collect the prompt sound of the device in real time, and send it to the first electronic device.
S403:第一电子设备接收第四电子设备发送的提示音。S403: The first electronic device receives the prompt tone sent by the fourth electronic device.
在第四电子设备向第一电子设备发送提示音以后,第以一电子设备可以接收该提示音。可理解,第四电子设备可以对提示音进行功率放大处理后再发送给第一电子设备,也可以由第一电子设备收到提示音后再进行放大处理。After the fourth electronic device sends the prompt tone to the first electronic device, the first electronic device can receive the prompt tone. It can be understood that the fourth electronic device may perform power amplification processing on the prompt sound before sending it to the first electronic device, or the first electronic device may receive the prompt sound and then perform amplification processing.
S404:第一电子设备根据提示音确定蓝牙连接状态M。S404: The first electronic device determines the Bluetooth connection state M according to the prompt sound.
第一电子设备可以将接收的第四电子设备发送的提示音,与第一电子设备存储的提示音进行比较,从而确定蓝牙连接状态M。也就是说,蓝牙连接状态M为第一电子设备根据提示音确定的第四电子设备和第三电子设备之间的蓝牙连接状态。可理解,蓝牙连接状态可以包括连接、断开、已配对等,本申请对此不作限制。The first electronic device may compare the received prompt tone sent by the fourth electronic device with the prompt tone stored by the first electronic device, so as to determine the Bluetooth connection state M. That is to say, the Bluetooth connection state M is the Bluetooth connection state between the fourth electronic device and the third electronic device determined by the first electronic device according to the prompt sound. It can be understood that the Bluetooth connection state may include connected, disconnected, paired, etc., which is not limited in this application.
需要说明的是,第一电子设备中储存有不同型号的蓝牙设备的配对提示音、连接提示音和断开提示音等。第一电子设备可以根据不同的提示音来判断该蓝牙设备的当前状态。It should be noted that the first electronic device stores a pairing prompt tone, a connection prompt tone, a disconnection prompt tone, and the like of different types of Bluetooth devices. The first electronic device can judge the current state of the Bluetooth device according to different prompt tones.
可理解,第一电子设备可以和不同型号的蓝牙设备建立通信连接。测试人员可以调整不同型号的蓝牙设备的连接状态,并录制不同型号的蓝牙设备在不同连接状态下的提示音。测试人员还可以将该录制的提示音以及相关信息输入给第一电子设备。可理解,该相关信息可以包括但不限于蓝牙设备的型号、连接状态等。第一电子设备可以接收并存储测试人员录制的不同型号的蓝牙设备在不同连接状态下的提示音,以及与该提示音相对应的连接状态。另外,第一电子设备还可以存储相应的蓝牙设备的型号。It can be understood that the first electronic device can establish a communication connection with Bluetooth devices of different models. Testers can adjust the connection status of different types of Bluetooth devices, and record the prompt sounds of different types of Bluetooth devices in different connection states. The tester can also input the recorded prompt tone and related information to the first electronic device. It can be understood that the relevant information may include, but is not limited to, the model and connection status of the Bluetooth device. The first electronic device can receive and store the prompt sounds recorded by the tester for different types of Bluetooth devices in different connection states, and the connection states corresponding to the prompt sounds. In addition, the first electronic device may also store the model of the corresponding Bluetooth device.
表1Table 1
示例性的,如表1所示,第一电子设备中存储有不同型号的蓝牙设备(例如,蓝牙耳机等)在不同状态下的提示音。其中,当型号1的蓝牙耳机处于连接状态时,相应的提示音为音频1。当型号1的蓝牙耳机处于断开状态时,相应的提示音为音频2。当型号1的蓝牙耳机完成配对时,相应的提示音为音频3。当型号2的蓝牙耳机处于连接状态时,相应的提示音为音频4。当型号2的蓝牙耳机处于断开状态时,相应的提示音为音频5。Exemplarily, as shown in Table 1, the first electronic device stores prompt sounds of different types of Bluetooth devices (eg, Bluetooth headsets, etc.) in different states. Among them, when the Bluetooth headset of
可理解,提示音的音频内容(例如,音频1-音频6等)可以包括但不限于说话声、歌声或乐器声,本申请对此不做限定。It can be understood that the audio content of the prompt tone (for example, audio 1-audio 6, etc.) may include, but is not limited to, speaking, singing, or musical instrument sound, which is not limited in this application.
为了便于描述,可以将第一电子设备发送给第四电子设备的提示音记为提示音R,将第四电子设备存储的提示音记为提示音集S。可理解,提示音集S包括至少一种提示音。For ease of description, the prompt tone sent by the first electronic device to the fourth electronic device may be denoted as prompt tone R, and the prompt tone stored by the fourth electronic device may be denoted as prompt tone set S. It can be understood that the prompt tone set S includes at least one prompt tone.
第一电子设备可以将接收的提示音R与存储的提示音集S中的提示音进行比对,确定提示音集S中的提示音Q与提示音R相同。第一电子设备再根据提示音R查找相应的状态。The first electronic device may compare the received prompt tone R with the prompt tone in the stored prompt tone set S, and determine that the prompt tone Q in the prompt tone set S is the same as the prompt tone R. The first electronic device then searches for the corresponding state according to the prompt sound R.
示例性的,第一电子设备比对后确定提示音Q与音频4相同,第一电子设备可以根据音频4确定第四电子设备当前的状态为连接状态。Exemplarily, after comparing, the first electronic device determines that the prompt tone Q is the same as the
需要说明的是,在本申请的一些实施例中,第一电子设备还可以直接根据第三电子设备来判断第三电子设备与第四电子设备之间的蓝牙连接状态。为了便于描述,将该蓝牙连接状态记为蓝牙连接状态N。可理解,测试人员可以直接根据第三电子设备显示的用户界面(例如,图2G所示的蓝牙连接界面)获取蓝牙连接状态N,然后再向第一电子设备输入蓝牙连接状态N。另外,第三电子设备还可以将本设备与第四电子设备的蓝牙连接状态N直接传输给第一电子设备。It should be noted that, in some embodiments of the present application, the first electronic device may also directly determine the Bluetooth connection state between the third electronic device and the fourth electronic device according to the third electronic device. For the convenience of description, the Bluetooth connection state is denoted as the Bluetooth connection state N. Understandably, the tester can directly obtain the Bluetooth connection state N according to the user interface displayed by the third electronic device (eg, the Bluetooth connection interface shown in FIG. 2G ), and then input the Bluetooth connection state N to the first electronic device. In addition, the third electronic device may also directly transmit the Bluetooth connection state N between the device and the fourth electronic device to the first electronic device.
在本申请的一些实施例中,第一电子设备还可以根据第二电子设备显示的用户界面(如图2B、图2D和图2F所示的用户界面)来判断第三电子设备与第四电子设备之间的蓝牙连接状态。In some embodiments of the present application, the first electronic device may also determine the third electronic device and the fourth electronic device according to the user interface displayed by the second electronic device (such as the user interfaces shown in FIG. 2B , FIG. 2D , and FIG. 2F ). Bluetooth connection status between devices.
在本申请的一些实施例中,第一电子设备可以确定蓝牙连接状态M为第四电子设备与第三电子设备之间的蓝牙连接状态。In some embodiments of the present application, the first electronic device may determine that the Bluetooth connection state M is the Bluetooth connection state between the fourth electronic device and the third electronic device.
在本申请的一些实施例中,第一电子设备可以确定蓝牙连接状态N为第四电子设备与第三电子设备之间的蓝牙连接状态。In some embodiments of the present application, the first electronic device may determine that the Bluetooth connection state N is the Bluetooth connection state between the fourth electronic device and the third electronic device.
在本申请的一些实施例中,第一电子设备可以根据蓝牙连接状态M和蓝牙连接状态N确定第四电子设备与第三电子设备之间的蓝牙连接状态。In some embodiments of the present application, the first electronic device may determine the Bluetooth connection state between the fourth electronic device and the third electronic device according to the Bluetooth connection state M and the Bluetooth connection state N.
表2Table 2
示例性的,如表2所示,若蓝牙连接状态M和/或蓝牙连接状态N为连接,第一电子设备确定第四电子设备与第三电子设备之间的蓝牙连接状态为连接状态。若蓝牙连接状态M和蓝牙连接状态N均为断开,第一电子设备确定第四电子设备与第三电子设备之间的蓝牙连接状态为断开状态。Exemplarily, as shown in Table 2, if the Bluetooth connection state M and/or the Bluetooth connection state N are connected, the first electronic device determines that the Bluetooth connection state between the fourth electronic device and the third electronic device is the connected state. If both the Bluetooth connection state M and the Bluetooth connection state N are disconnected, the first electronic device determines that the Bluetooth connection state between the fourth electronic device and the third electronic device is the disconnected state.
可理解,第一电子设备根据蓝牙连接状态M和蓝牙连接状态N确定第四电子设备与第三电子设备之间的蓝牙连接状态的方式,不限于上述表2。表2所示的方式仅为一个示例,不应视为对本申请的限制。It can be understood that the manner in which the first electronic device determines the Bluetooth connection state between the fourth electronic device and the third electronic device according to the Bluetooth connection state M and the Bluetooth connection state N is not limited to Table 2 above. The manner shown in Table 2 is only an example and should not be regarded as a limitation of the present application.
下面结合图5具体介绍本申请提供的一种蓝牙自动化测试方法。A Bluetooth automated testing method provided by the present application will be described in detail below with reference to FIG. 5 .
S501:第一电子设备和第二电子设备之间建立通信连接,第二电子设备和第四电子设备之间建立通信连接,第三电子设备和第四电子设备之间建立蓝牙连接。S501: Establish a communication connection between the first electronic device and the second electronic device, establish a communication connection between the second electronic device and the fourth electronic device, and establish a Bluetooth connection between the third electronic device and the fourth electronic device.
可理解,第一电子设备与第二电子设备之间建立的通信连接方式可以包括但不限于无线通信方式和有线通信方式。It can be understood that the communication connection manner established between the first electronic device and the second electronic device may include, but is not limited to, a wireless communication manner and a wired communication manner.
类似的,第二电子设备和第四电子设备之间的通信连接方式也可以包括蓝牙、Wi-Fi等无线通信方式,以及有线通信方式。Similarly, the communication connection method between the second electronic device and the fourth electronic device may also include wireless communication methods such as Bluetooth and Wi-Fi, as well as wired communication methods.
需要说明的是,第二电子设备上存在可以控制第四电子设备与第三电子设备之间的蓝牙功能的APP。为了便于后续描述,将该APP记为应用程序X。It should be noted that there is an APP on the second electronic device that can control the Bluetooth function between the fourth electronic device and the third electronic device. For the convenience of subsequent description, the APP is denoted as application X.
S502:第一电子设备根据标识信息来选择自动化脚本。S502: The first electronic device selects an automation script according to the identification information.
可理解,标识信息可以包括第四电子设备的型号和设备类型。并且,第一电子设备可以存储多个类型、多个型号的电子设备的自动化脚本。因此,第一电子设备可以根据标识信息来确定第四电子设备的型号,从而根据该型号选择相应的自动化脚本。It can be understood that the identification information may include the model and device type of the fourth electronic device. Also, the first electronic device may store automation scripts for multiple types and models of electronic devices. Therefore, the first electronic device can determine the model of the fourth electronic device according to the identification information, so as to select a corresponding automation script according to the model.
S503:第一电子设备运行自动化脚本。S503: The first electronic device runs the automation script.
第一电子设备可以根据自动化脚本中的控制流程来控制第四电子设备与第三电子设备之间的蓝牙功能。具体地,第一电子设备向第二电子设备发送指令A。第二电子设备可以接收第一电子设备发送的指令A,并根据指令A来模拟作用在应用程序X上的用户操作。第二电子设备检测到作用在应用程序X上的模拟操作后,可以向第四电子设备发送指令B。第四电子设备可以接收第二电子设备发送的指令B,并根据指令B向第三电子设备发送指令C。第三电子设备接收第四电子设备发送的指令C,并根据指令C来进行相应的调节。例如,切换歌曲、增加音量等。第三电子设备进行相应调节后,可以发送指令D来控制第四电子设备也做出相应的调节。The first electronic device can control the Bluetooth function between the fourth electronic device and the third electronic device according to the control flow in the automation script. Specifically, the first electronic device sends the instruction A to the second electronic device. The second electronic device can receive the instruction A sent by the first electronic device, and simulate the user operation acting on the application X according to the instruction A. After the second electronic device detects the simulated operation acting on the application X, it can send the instruction B to the fourth electronic device. The fourth electronic device may receive the instruction B sent by the second electronic device, and send the instruction C to the third electronic device according to the instruction B. The third electronic device receives the instruction C sent by the fourth electronic device, and makes corresponding adjustments according to the instruction C. For example, switch songs, increase volume, etc. After the third electronic device performs the corresponding adjustment, the instruction D can be sent to control the fourth electronic device to also make the corresponding adjustment.
在本申请的一些实施例中,无需第二电子设备也可以实现蓝牙自动化测试。具体地,第一电子设备向第三电子设备发送指令E。第三电子设备可以接收第一电子设备发送的指令E,并根据指令E向第四电子设备发送指令F。第四电子设备接收第三电子设备发送的指令F,并根据指令F向第三电子设备发送指令G。第三电子设备接收第四电子设备发送的指令G,并根据指令G来进行相应的调节。例如,切换歌曲、增加音量等。第三电子设备进行相应调节后,可以发送指令H来控制第四电子设备也做出相应的调节。In some embodiments of the present application, Bluetooth automated testing can be implemented without the need for a second electronic device. Specifically, the first electronic device sends the instruction E to the third electronic device. The third electronic device may receive the instruction E sent by the first electronic device, and send the instruction F to the fourth electronic device according to the instruction E. The fourth electronic device receives the instruction F sent by the third electronic device, and sends the instruction G to the third electronic device according to the instruction F. The third electronic device receives the command G sent by the fourth electronic device, and makes corresponding adjustments according to the command G. For example, switch songs, increase volume, etc. After the third electronic device makes the corresponding adjustment, the instruction H can be sent to control the fourth electronic device to also make the corresponding adjustment.
可理解,若第一电子设备运行的自动化脚本中包括蓝牙连接和断开控制流程,第一电子设备可以判断第三电子设备与第四电子设备之间的蓝牙连接状态,并将该蓝牙连接状态与蓝牙连接和断开控制流程中的指令进行比较。若该蓝牙连接状态为连接,而该蓝牙连接和断开控制指令中的指令用于指示第三电子设备与第四电子设备之间建立蓝牙连接,则第一电子设备确定蓝牙连接状态正常。可理解,此处所指的蓝牙连接状态为第三电子设备和第四电子设备之间的蓝牙连接状态。类似的,若该蓝牙连接状态为断开,而该蓝牙连接和断开控制指令中的指令用于指示第三电子设备与第四电子设备之间断开蓝牙连接,则第一电子设备确定蓝牙连接状态正常。然而,若该蓝牙连接状态为连接,而该蓝牙连接和断开控制指令中的指令用于指示第三电子设备与第四电子设备之间断开蓝牙连接,则第一电子设备确定蓝牙连接状态异常。若该蓝牙连接状态为断开,而该蓝牙连接和断开控制指令中的指令用于指示第三电子设备与第四电子设备之间建立蓝牙连接,则第一电子设备确定蓝牙连接状态异常。It can be understood that if the automation script run by the first electronic device includes the Bluetooth connection and disconnection control process, the first electronic device can determine the Bluetooth connection state between the third electronic device and the fourth electronic device, and use the Bluetooth connection state. Compare with the instructions in the bluetooth connect and disconnect control flow. If the Bluetooth connection state is connected, and the instructions in the Bluetooth connection and disconnection control instructions are used to instruct the third electronic device and the fourth electronic device to establish a Bluetooth connection, the first electronic device determines that the Bluetooth connection state is normal. It can be understood that the Bluetooth connection state referred to here is the Bluetooth connection state between the third electronic device and the fourth electronic device. Similarly, if the Bluetooth connection status is disconnected, and the instruction in the Bluetooth connection and disconnection control instruction is used to instruct the third electronic device and the fourth electronic device to disconnect the Bluetooth connection, the first electronic device determines the Bluetooth connection. Status is normal. However, if the Bluetooth connection state is connected, and the instruction in the Bluetooth connection and disconnection control instruction is used to instruct the third electronic device and the fourth electronic device to disconnect the Bluetooth connection, the first electronic device determines that the Bluetooth connection state is abnormal . If the Bluetooth connection state is disconnected, and the instructions in the Bluetooth connection and disconnection control instructions are used to instruct the third electronic device and the fourth electronic device to establish a Bluetooth connection, the first electronic device determines that the Bluetooth connection state is abnormal.
可理解,若第一电子设备确定蓝牙连接状态异常,可以通过控制声音和/或灯光(例如,设置警示音)来提醒测试人员注意第三电子设备与第四电子设备之间的蓝牙连接状态异常。可理解,第一电子设备还可以通过其他方式来提醒测试人员,本申请对此不作限制。另外,本申请对警示音的具体内容不作限制。It can be understood that if the first electronic device determines that the Bluetooth connection state is abnormal, the tester can be reminded to pay attention to the abnormal Bluetooth connection state between the third electronic device and the fourth electronic device by controlling the sound and/or light (for example, setting a warning sound). . It can be understood that the first electronic device can also remind the tester in other ways, which is not limited in this application. In addition, the present application does not limit the specific content of the warning sound.
下面介绍本申请实施例涉及的装置。The devices involved in the embodiments of the present application are described below.
图6为本申请实施例提供的一种电子设备100的硬件结构示意图。FIG. 6 is a schematic diagram of a hardware structure of an electronic device 100 according to an embodiment of the present application.
可理解,电子设备100可以为上述实施例中的第一电子设备、第二电子设备、第三电子设备和第四电子设备。It can be understood that the electronic device 100 may be the first electronic device, the second electronic device, the third electronic device and the fourth electronic device in the above embodiments.
电子设备100可以包括处理器110,外部存储器接口120,内部存储器121,通用串行总线(Universal Serial Bus,USB)接口130,充电管理模块140,电源管理模块141,电池142,天线1,天线2,移动通信模块150,无线通信模块160,音频模块170,扬声器170A,受话器170B,麦克风170C,耳机接口170D,传感器模块180,按键190,马达191,指示器192,摄像头193,显示屏194,以及用户标识模块(Subscriber Identification Module,SIM)卡接口195等。其中传感器模块180可以包括压力传感器180A,陀螺仪传感器180B,气压传感器180C,磁传感器180D,加速度传感器180E,距离传感器180F,接近光传感器180G,指纹传感器180H,温度传感器180J,触摸传感器180K,环境光传感器180L,骨传导传感器180M等。The electronic device 100 may include a
可以理解的是,本发明实施例示意的结构并不构成对电子设备100的具体限定。在本申请另一些实施例中,电子设备100可以包括比图示更多或更少的部件,或者组合某些部件,或者拆分某些部件,或者不同的部件布置。图示的部件可以以硬件,软件或软件和硬件的组合实现。It can be understood that, the structures illustrated in the embodiments of the present invention do not constitute a specific limitation on the electronic device 100 . In other embodiments of the present application, the electronic device 100 may include more or less components than shown, or combine some components, or separate some components, or arrange different components. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
处理器110可以包括一个或多个处理单元,例如:处理器110可以包括应用处理器(Application Processor,AP),调制解调处理器,图形处理器(Graphics Processingunit,GPU),图像信号处理器(Image Signal Processor,ISP),控制器,存储器,视频编解码器,数字信号处理器(Digital Signal Processor,DSP),基带处理器,和/或神经网络处理器(Neural-network Processing Unit,NPU)等。其中,不同的处理单元可以是独立的器件,也可以集成在一个或多个处理器中。The
其中,控制器可以是电子设备100的神经中枢和指挥中心。控制器可以根据指令操作码和时序信号,产生操作控制信号,完成取指令和执行指令的控制。The controller may be the nerve center and command center of the electronic device 100 . The controller can generate an operation control signal according to the instruction operation code and timing signal, and complete the control of fetching and executing instructions.
在本申请提供的实施例中,电子设备100可以通过处理器110执行图3、图4和图5所示的方法。In the embodiments provided in this application, the electronic device 100 may execute the methods shown in FIG. 3 , FIG. 4 and FIG. 5 through the
处理器110中还可以设置存储器,用于存储指令和数据。在一些实施例中,处理器110中的存储器为高速缓冲存储器。该存储器可以保存处理器110刚用过或循环使用的指令或数据。如果处理器110需要再次使用该指令或数据,可从所述存储器中直接调用。避免了重复存取,减少了处理器110的等待时间,因而提高了系统的效率。A memory may also be provided in the
在一些实施例中,处理器110可以包括一个或多个接口。USB接口130是符合USB标准规范的接口,具体可以是Mini USB接口,Micro USB接口,USB Type C接口等。USB接口130可以用于连接充电器为电子设备100充电,也可以用于电子设备100与外围设备之间传输数据。也可以用于连接耳机,通过耳机播放音频。该接口还可以用于连接其他电子设备100,例如AR设备等。In some embodiments, the
充电管理模块140用于从充电器接收充电输入。充电管理模块140为电池142充电的同时,还可以通过电源管理模块141为电子设备100供电。The
电源管理模块141用于连接电池142,充电管理模块140与处理器110。电源管理模块141接收电池142和/或充电管理模块140的输入,为处理器110,内部存储器121,外部存储器,显示屏194,摄像头193,和无线通信模块160等供电。The
电子设备100的无线通信功能可以通过天线1,天线2,移动通信模块150,无线通信模块160,调制解调处理器以及基带处理器等实现。The wireless communication function of the electronic device 100 may be implemented by the
天线1和天线2用于发射和接收电磁波信号。电子设备100中的每个天线可用于覆盖单个或多个通信频带。不同的天线还可以复用,以提高天线的利用率。
移动通信模块150可以提供应用在电子设备100上的包括2G/3G/4G/5G等无线通信的解决方案。移动通信模块150可以包括至少一个滤波器,开关,功率放大器,低噪声放大器(Low Noise Amplifier,LNA)等。移动通信模块150可以由天线1接收电磁波,并对接收的电磁波进行滤波,放大等处理,传送至调制解调处理器进行解调。移动通信模块150还可以对经调制解调处理器调制后的信号放大,经天线1转为电磁波辐射出去。The
调制解调处理器可以包括调制器和解调器。其中,调制器用于将待发送的低频基带信号调制成中高频信号。解调器用于将接收的电磁波信号解调为低频基带信号。随后解调器将解调得到的低频基带信号传送至基带处理器处理。低频基带信号经基带处理器处理后,被传递给应用处理器。应用处理器通过音频设备(不限于扬声器170A,受话器170B等)输出声音信号,或通过显示屏194显示图像或视频。The modem processor may include a modulator and a demodulator. Wherein, the modulator is used to modulate the low frequency baseband signal to be sent into a medium and high frequency signal. The demodulator is used to demodulate the received electromagnetic wave signal into a low frequency baseband signal. Then the demodulator transmits the demodulated low-frequency baseband signal to the baseband processor for processing. The low frequency baseband signal is processed by the baseband processor and passed to the application processor. The application processor outputs sound signals through audio devices (not limited to the speaker 170A, the receiver 170B, etc.), or displays images or videos through the display screen 194 .
无线通信模块160可以提供应用在电子设备100上的包括无线局域网(WirelessLocal Area Networks,WLAN)(如无线保真(Wireless Fidelity,Wi-Fi)网络),蓝牙(Bluetooth,BT),全球导航卫星系统(Global Navigation Satellite System,GNSS),调频(Frequency Modulation,FM),近距离无线通信技术(Near Field Communication,NFC),红外技术(Infrared,IR)等无线通信的解决方案。无线通信模块160可以是集成至少一个通信处理模块的一个或多个器件。无线通信模块160经由天线2接收电磁波,将电磁波信号调频以及滤波处理,将处理后的信号发送到处理器110。无线通信模块160还可以从处理器110接收待发送的信号,对其进行调频,放大,经天线2转为电磁波辐射出去。The
在一些实施例中,电子设备100的天线1和移动通信模块150耦合,天线2和无线通信模块160耦合,使得电子设备100可以通过无线通信技术与网络以及其他设备通信。In some embodiments, the
电子设备100通过GPU,显示屏194,以及应用处理器等实现显示功能。GPU为图像处理的微处理器,连接显示屏194和应用处理器。GPU用于执行数学和几何计算,用于图形渲染。处理器110可包括一个或多个GPU,其执行程序指令以生成或改变显示信息。The electronic device 100 implements a display function through a GPU, a display screen 194, an application processor, and the like. The GPU is a microprocessor for image processing, and is connected to the display screen 194 and the application processor. The GPU is used to perform mathematical and geometric calculations for graphics rendering.
显示屏194用于显示图像,视频等。显示屏194包括显示面板。显示面板可以采用液晶显示屏(Liquid Crystal Display,LCD),有机发光二极管(Organic Light-EmittingDiode,OLED),有源矩阵有机发光二极体或主动矩阵有机发光二极体(Active-MatrixOrganic Light Emitting Diode的,AMOLED),柔性发光二极管(Flex Light-EmittingDiode,FLED),Mini LED,Micro LED,Micro-OLED,量子点发光二极管(Quantum Dot LightEmitting Diodes,QLED)等。在一些实施例中,电子设备100可以包括1个或N个显示屏194,N为大于1的正整数。Display screen 194 is used to display images, videos, and the like. Display screen 194 includes a display panel. The display panel can be a Liquid Crystal Display (LCD), an Organic Light-Emitting Diode (OLED), an Active Matrix Organic Light Emitting Diode or an Active-Matrix Organic Light Emitting Diode (Active-Matrix Organic Light Emitting Diode). , AMOLED), flexible light-emitting diode (Flex Light-Emitting Diode, FLED), Mini LED, Micro LED, Micro-OLED, quantum dot light-emitting diode (Quantum Dot Light Emitting Diodes, QLED) and so on. In some embodiments, the electronic device 100 may include one or N display screens 194 , where N is a positive integer greater than one.
电子设备100可以通过ISP,摄像头193,视频编解码器,GPU,显示屏194以及应用处理器等实现获取功能。The electronic device 100 can realize the acquisition function through the ISP, the camera 193, the video codec, the GPU, the display screen 194, and the application processor.
ISP用于处理摄像头193反馈的数据。例如,拍照时,打开快门,光线通过镜头被传递到摄像头感光元件上,光信号转换为电信号,摄像头感光元件将所述电信号传递给ISP处理,转化为肉眼可见的图像或视频。ISP还可以对图像的噪点,亮度,肤色进行算法优化。ISP还可以对拍摄场景的曝光,色温等参数优化。在一些实施例中,ISP可以设置在摄像头193中。The ISP is used to process the data fed back by the camera 193 . For example, when taking a photo, the shutter is opened, the light is transmitted to the camera photosensitive element through the lens, the light signal is converted into an electrical signal, and the camera photosensitive element transmits the electrical signal to the ISP for processing, and converts it into an image or video visible to the naked eye. ISP can also perform algorithm optimization on image noise, brightness, and skin tone. ISP can also optimize the exposure, color temperature and other parameters of the shooting scene. In some embodiments, the ISP may be provided in the camera 193 .
摄像头193用于捕获静态图像或视频。物体通过镜头生成光学图像投射到感光元件。感光元件可以是电荷耦合器件(Charge Coupled Device,CCD)或互补金属氧化物半导体(Complementary Metal-Oxide-Semiconductor,CMOS)光电晶体管。感光元件把光信号转换成电信号,之后将电信号传递给ISP转换成数字图像或视频信号。ISP将数字图像或视频信号输出到DSP加工处理。DSP将数字图像或视频信号转换成标准的RGB,YUV等格式的图像或视频信号。在一些实施例中,电子设备100可以包括1个或N个摄像头193,N为大于1的正整数。例如,在一些实施例中,电子设备100可以利用N个摄像头193获取多个曝光系数的图像,进而,在视频后处理中,电子设备100可以根据多个曝光系数的图像,通过HDR技术合成HDR图像。Camera 193 is used to capture still images or video. The object is projected through the lens to generate an optical image onto the photosensitive element. The photosensitive element can be a charge coupled device (Charge Coupled Device, CCD) or a complementary metal-oxide-semiconductor (Complementary Metal-Oxide-Semiconductor, CMOS) phototransistor. The photosensitive element converts the optical signal into an electrical signal, and then transmits the electrical signal to the ISP to convert it into a digital image or video signal. ISP outputs digital image or video signal to DSP for processing. DSP converts digital image or video signal into standard RGB, YUV and other formats of image or video signal. In some embodiments, the electronic device 100 may include 1 or N cameras 193 , where N is a positive integer greater than 1. For example, in some embodiments, the electronic device 100 may use the N cameras 193 to acquire images of multiple exposure coefficients, and further, in the video post-processing, the electronic device 100 may use the HDR technology to synthesize HDR according to the images of the multiple exposure coefficients image.
数字信号处理器用于处理数字信号,除了可以处理数字图像或视频信号,还可以处理其他数字信号。例如,当电子设备100在频点选择时,数字信号处理器用于对频点能量进行傅里叶变换等。A digital signal processor is used to process digital signals, in addition to digital image or video signals, it can also process other digital signals. For example, when the electronic device 100 selects a frequency point, the digital signal processor is used to perform Fourier transform on the frequency point energy and so on.
视频编解码器用于对数字视频压缩或解压缩。电子设备100可以支持一种或多种视频编解码器。这样,电子设备100可以播放或录制多种编码格式的视频,例如:动态图像专家组(Moving Picture Experts Group,MPEG)1,MPEG2,MPEG3,MPEG4等。Video codecs are used to compress or decompress digital video. The electronic device 100 may support one or more video codecs. In this way, the electronic device 100 can play or record videos in various encoding formats, such as: Moving Picture Experts Group (MPEG) 1, MPEG2, MPEG3, MPEG4, and so on.
NPU为神经网络(Neural-Network,NN)计算处理器,通过借鉴生物神经网络结构,例如借鉴人脑神经元之间传递模式,对输入信息快速处理,还可以不断的自学习。通过NPU可以实现电子设备100的智能认知等应用,例如:图像识别,人脸识别,语音识别,文本理解等。NPU is a neural network (Neural-Network, NN) computing processor. By borrowing the structure of biological neural network, such as the transmission mode between neurons in the human brain, it can quickly process the input information and can continuously learn by itself. Applications such as intelligent cognition of the electronic device 100 can be implemented through the NPU, such as image recognition, face recognition, speech recognition, text understanding, and the like.
外部存储器接口120可以用于连接外部存储卡,例如Micro SD卡,实现扩展电子设备100的存储能力。外部存储卡通过外部存储器接口120与处理器110通信,实现数据存储功能。例如将音乐,视频等文件保存在外部存储卡中。The
内部存储器121可以用于存储计算机可执行程序代码,所述可执行程序代码包括指令。处理器110通过运行存储在内部存储器121的指令,从而执行电子设备100的各种功能应用以及数据处理。内部存储器121可以包括存储程序区和存储数据区。其中,存储程序区可存储操作系统,至少一个功能所需的应用程序(比如声音播放功能,图像视频播放功能等)等。存储数据区可存储电子设备100使用过程中所创建的数据(比如音频数据,电话本等)等。Internal memory 121 may be used to store computer executable program code, which includes instructions. The
电子设备100可以通过音频模块170,扬声器170A,受话器170B,麦克风170C,耳机接口170D,以及应用处理器等实现音频功能。例如音乐播放,录音等。The electronic device 100 may implement audio functions through an
音频模块170用于将数字音频信息转换成模拟音频信号输出,也用于将模拟音频输入转换为数字音频信号。The
扬声器170A,也称“喇叭”,用于将音频电信号转换为声音信号。Speaker 170A, also referred to as a "speaker", is used to convert audio electrical signals into sound signals.
受话器170B,也称“听筒”,用于将音频电信号转换成声音信号。The receiver 170B, also referred to as "earpiece", is used to convert audio electrical signals into sound signals.
麦克风170C,也称“话筒”,“传声器”,用于将声音信号转换为电信号。电子设备100可以设置至少一个麦克风170C。The
耳机接口170D用于连接有线耳机。The
传感器模块180可以包括1个或多个传感器,这些传感器可以为相同类型或不同类型。可理解,图1所示的传感器模块180仅为一种示例性的划分方式,还可能有其他划分方式,本申请对此不作限制。Sensor module 180 may include one or more sensors, which may be of the same type or of different types. It can be understood that the sensor module 180 shown in FIG. 1 is only an exemplary division manner, and there may be other division manners, which are not limited in this application.
压力传感器180A用于感受压力信号,可以将压力信号转换成电信号。在一些实施例中,压力传感器180A可以设置于显示屏194。当有触摸操作作用于显示屏194,电子设备100根据压力传感器180A检测所述触摸操作强度。电子设备100也可以根据压力传感器180A的检测信号计算触摸的位置。在一些实施例中,作用于相同触摸位置,但不同触摸操作强度的触摸操作,可以对应不同的操作指令。The pressure sensor 180A is used to sense pressure signals, and can convert the pressure signals into electrical signals. In some embodiments, the pressure sensor 180A may be provided on the display screen 194 . When a touch operation acts on the display screen 194, the electronic device 100 detects the intensity of the touch operation according to the pressure sensor 180A. The electronic device 100 may also calculate the touched position according to the detection signal of the pressure sensor 180A. In some embodiments, touch operations acting on the same touch position but with different touch operation intensities may correspond to different operation instructions.
陀螺仪传感器180B可以用于确定电子设备100的运动姿态。在一些实施例中,可以通过陀螺仪传感器180B确定电子设备100围绕三个轴(即,x,y和z轴)的角速度。陀螺仪传感器180B可以用于拍摄防抖。The gyro sensor 180B may be used to determine the motion attitude of the electronic device 100 . In some embodiments, the angular velocity of electronic device 100 about three axes (ie, x, y, and z axes) may be determined by gyro sensor 180B. The gyro sensor 180B can be used for image stabilization.
气压传感器180C用于测量气压。在一些实施例中,电子设备100通过气压传感器180C测得的气压值计算海拔高度,辅助定位和导航。The air pressure sensor 180C is used to measure air pressure. In some embodiments, the electronic device 100 calculates the altitude through the air pressure value measured by the air pressure sensor 180C to assist in positioning and navigation.
磁传感器180D包括霍尔传感器。电子设备100可以利用磁传感器180D检测翻盖皮套的开合。The magnetic sensor 180D includes a Hall sensor. The electronic device 100 can detect the opening and closing of the flip holster using the magnetic sensor 180D.
加速度传感器180E可检测电子设备100在各个方向上(一般为三轴)加速度的大小。当电子设备100静止时可检测出重力的大小及方向。还可以用于识别电子设备100姿态,应用于横竖屏切换,计步器等应用。The acceleration sensor 180E can detect the magnitude of the acceleration of the electronic device 100 in various directions (generally three axes). The magnitude and direction of gravity can be detected when the electronic device 100 is stationary. It can also be used to recognize the posture of the electronic device 100, and can be used in applications such as horizontal and vertical screen switching, and pedometers.
距离传感器180F,用于测量距离。电子设备100可以通过红外或激光测量距离。在一些实施例中,拍摄场景,电子设备100可以利用距离传感器180F测距以实现快速对焦。Distance sensor 180F for measuring distance. The electronic device 100 can measure the distance through infrared or laser. In some embodiments, when shooting a scene, the electronic device 100 can use the distance sensor 180F to measure the distance to achieve fast focusing.
接近光传感器180G可以包括例如发光二极管(LED)和光检测器,例如光电二极管。发光二极管可以是红外发光二极管。电子设备100通过发光二极管向外发射红外光。电子设备100使用光电二极管检测来自附近物体的红外反射光。当检测到充分的反射光时,可以确定电子设备100附近有物体。当检测到不充分的反射光时,电子设备100可以确定电子设备100附近没有物体。Proximity light sensor 180G may include, for example, light emitting diodes (LEDs) and light detectors, such as photodiodes. The light emitting diodes may be infrared light emitting diodes. The electronic device 100 emits infrared light to the outside through the light emitting diode. Electronic device 100 uses photodiodes to detect infrared reflected light from nearby objects. When sufficient reflected light is detected, it can be determined that there is an object near the electronic device 100 . When insufficient reflected light is detected, the electronic device 100 may determine that there is no object near the electronic device 100 .
环境光传感器180L用于感知环境光亮度。The ambient light sensor 180L is used to sense ambient light brightness.
指纹传感器180H用于获取指纹。The fingerprint sensor 180H is used to acquire fingerprints.
温度传感器180J用于检测温度。The temperature sensor 180J is used to detect the temperature.
触摸传感器180K,也称“触控面板”。触摸传感器180K可以设置于显示屏194,由触摸传感器180K与显示屏194组成触摸屏,也称“触控屏”。触摸传感器180K用于检测作用于其上或附近的触摸操作。触摸传感器可以将检测到的触摸操作传递给应用处理器,以确定触摸事件类型。可以通过显示屏194提供与触摸操作相关的视觉输出。在另一些实施例中,触摸传感器180K也可以设置于电子设备100的表面,与显示屏194所处的位置不同。Touch sensor 180K, also called "touch panel". The touch sensor 180K may be disposed on the display screen 194 , and the touch sensor 180K and the display screen 194 form a touch screen, also called a “touch screen”. The touch sensor 180K is used to detect a touch operation on or near it. The touch sensor can pass the detected touch operation to the application processor to determine the type of touch event. Visual output related to touch operations may be provided through display screen 194 . In other embodiments, the touch sensor 180K may also be disposed on the surface of the electronic device 100 , which is different from the location where the display screen 194 is located.
在本申请的一个实施例中,用户利用电子设备100进行延时摄影或连拍,需要获取一系列图像。在延时摄像或连拍的场景中,电子设备100可以采取AE模式。即电子设备100自动调整AE值,在预览这一系列图像的过程中,若用户有触摸操作作用于显示屏194,可能触发touchAE模式。在touchAE模式下,电子设备100可以调整用户触摸显示屏的相应位置的亮度,并进行高权重测光。使得计算画面平均亮度的时候,用户触摸区域的权重明显高于其他区域,最终计算所得的画面平均亮度更加靠近用户触摸区域的平均亮度。In one embodiment of the present application, the user uses the electronic device 100 to perform time-lapse photography or continuous shooting, and needs to acquire a series of images. In the scene of time-lapse or continuous shooting, the electronic device 100 may adopt the AE mode. That is, the electronic device 100 automatically adjusts the AE value. In the process of previewing the series of images, if the user performs a touch operation on the display screen 194, the touchAE mode may be triggered. In the touchAE mode, the electronic device 100 can adjust the brightness of the corresponding position where the user touches the display screen, and perform high-weight light metering. When calculating the average brightness of the screen, the weight of the user's touch area is significantly higher than that of other areas, and the final calculated average brightness of the screen is closer to the average brightness of the user's touch area.
骨传导传感器180M可以获取振动信号。The bone conduction sensor 180M can acquire vibration signals.
按键190包括开机键,音量键等。按键190可以是机械按键。也可以是触摸式按键。电子设备100可以接收按键输入,产生与电子设备100的用户设置以及功能控制有关的键信号输入。The keys 190 include a power-on key, a volume key, and the like. Keys 190 may be mechanical keys. It can also be a touch key. The electronic device 100 may receive key inputs and generate key signal inputs related to user settings and function control of the electronic device 100 .
马达191可以产生振动提示。马达191可以用于来电振动提示,也可以用于触摸振动反馈。例如,作用于不同应用(例如拍照,音频播放等)的触摸操作,可以对应不同的振动反馈效果。作用于显示屏194不同区域的触摸操作,马达191也可对应不同的振动反馈效果。不同的应用场景(例如:时间提醒,接收信息,闹钟,游戏等)也可以对应不同的振动反馈效果。触摸振动反馈效果还可以支持自定义。Motor 191 can generate vibrating cues. The motor 191 can be used for vibrating alerts for incoming calls, and can also be used for touch vibration feedback. For example, touch operations acting on different applications (such as taking pictures, playing audio, etc.) can correspond to different vibration feedback effects. The motor 191 can also correspond to different vibration feedback effects for touch operations on different areas of the display screen 194 . Different application scenarios (for example: time reminder, receiving information, alarm clock, games, etc.) can also correspond to different vibration feedback effects. The touch vibration feedback effect can also support customization.
指示器192可以是指示灯,可以用于指示充电状态,电量变化,也可以用于指示消息,未接来电,通知等。The indicator 192 can be an indicator light, which can be used to indicate the charging state, the change of the power, and can also be used to indicate a message, a missed call, a notification, and the like.
SIM卡接口195用于连接SIM卡。SIM卡可以通过插入SIM卡接口195,或从SIM卡接口195拔出,实现和电子设备100的接触和分离。电子设备100可以支持1个或N个SIM卡接口,N为大于1的正整数。电子设备100通过SIM卡和网络交互,实现通话以及数据通信等功能。在一些实施例中,电子设备100采用eSIM,即:嵌入式SIM卡。eSIM卡可以嵌在电子设备100中,不能和电子设备100分离。The
图7为本申请实施例提供的一种电子设备100的软件结构框图。FIG. 7 is a block diagram of a software structure of an electronic device 100 according to an embodiment of the present application.
分层架构将软件分成若干个层,每一层都有清晰的角色和分工。层与层之间通过软件接口通信。在一些实施例中,将系统分为四层,从上至下分别为应用程序层,应用程序框架层,运行时(Runtime)和系统库,以及内核层。The layered architecture divides the software into several layers, and each layer has a clear role and division of labor. Layers communicate with each other through software interfaces. In some embodiments, the system is divided into four layers, which are, from top to bottom, an application layer, an application framework layer, a runtime (Runtime) and a system library, and a kernel layer.
应用程序层可以包括一系列应用程序包。The application layer can include a series of application packages.
如图7所示,应用程序包可以包括相机,图库,日历,通话,地图,导航,WLAN,蓝牙,音乐,视频,短信息等应用程序(也可以称为应用)。As shown in FIG. 7 , the application package may include applications (also referred to as applications) such as camera, gallery, calendar, call, map, navigation, WLAN, Bluetooth, music, video, and short message.
应用程序框架层为应用程序层的应用程序提供应用编程接口(ApplicationProgramming Interface,API)和编程框架。应用程序框架层包括一些预先定义的函数。The application framework layer provides an application programming interface (Application Programming Interface, API) and a programming framework for the applications of the application layer. The application framework layer includes some predefined functions.
如图7所示,应用程序框架层可以包括窗口管理器,内容提供器,视图系统,电话管理器,资源管理器,通知管理器等。As shown in Figure 7, the application framework layer may include a window manager, a content provider, a view system, a telephony manager, a resource manager, a notification manager, and the like.
窗口管理器用于管理窗口程序。窗口管理器可以获取显示屏大小,判断是否有状态栏,锁定屏幕,截取屏幕等。A window manager is used to manage window programs. The window manager can get the size of the display screen, determine whether there is a status bar, lock the screen, take screenshots, etc.
内容提供器用来存放和获取数据,并使这些数据可以被应用程序访问。所述数据可以包括视频,图像,音频,拨打和接听的电话,浏览历史和书签,电话簿等。Content providers are used to store and retrieve data and make these data accessible to applications. The data may include video, images, audio, calls made and received, browsing history and bookmarks, phone book, etc.
视图系统包括可视控件,例如显示文字的控件,显示图片的控件等。视图系统可用于构建应用程序。显示界面可以由一个或多个视图组成的。例如,包括短信通知图标的显示界面,可以包括显示文字的视图以及显示图片的视图。The view system includes visual controls, such as controls for displaying text, controls for displaying pictures, and so on. View systems can be used to build applications. A display interface can consist of one or more views. For example, the display interface including the short message notification icon may include a view for displaying text and a view for displaying pictures.
电话管理器用于提供电子设备100的通信功能。例如通话状态的管理(包括接通,挂断等)。The phone manager is used to provide the communication function of the electronic device 100 . For example, the management of call status (including connecting, hanging up, etc.).
资源管理器为应用程序提供各种资源,比如本地化字符串,图标,图片,布局文件,视频文件等等。The resource manager provides various resources for the application, such as localization strings, icons, pictures, layout files, video files and so on.
通知管理器使应用程序可以在状态栏中显示通知信息,可以用于传达告知类型的消息,可以短暂停留后自动消失,无需用户交互。比如通知管理器被用于告知下载完成,消息提醒等。通知管理器还可以是以图表或者滚动条文本形式出现在系统顶部状态栏的通知,例如后台运行的应用程序的通知,还可以是以对话界面形式出现在屏幕上的通知。例如在状态栏提示文本信息,发出提示音,电子设备振动,指示灯闪烁等。The notification manager enables applications to display notification information in the status bar, which can be used to convey notification-type messages, and can disappear automatically after a brief pause without user interaction. For example, the notification manager is used to notify download completion, message reminders, etc. The notification manager can also display notifications in the status bar at the top of the system in the form of graphs or scroll bar text, such as notifications from applications running in the background, and can also display notifications on the screen in the form of a dialog interface. For example, text information is prompted in the status bar, a prompt sound is issued, the electronic device vibrates, and the indicator light flashes.
运行时(Runtime)包括核心库和虚拟机。Runtime负责系统的调度和管理。Runtime (Runtime) includes core libraries and virtual machines. Runtime is responsible for the scheduling and management of the system.
核心库包含两部分:一部分是编程语言(例如,java语言)需要调用的功能函数,另一部分是系统的核心库。The core library consists of two parts: one part is the function functions that the programming language (for example, java language) needs to call, and the other part is the core library of the system.
应用程序层和应用程序框架层运行在虚拟机中。虚拟机将应用程序层和应用程序框架层的编程文件(例如,java文件)执行为二进制文件。虚拟机用于执行对象生命周期的管理,堆栈管理,线程管理,安全和异常的管理,以及垃圾回收等功能。The application layer and the application framework layer run in virtual machines. The virtual machine executes programming files (eg, java files) of the application layer and the application framework layer as binary files. The virtual machine is used to perform functions such as object lifecycle management, stack management, thread management, safety and exception management, and garbage collection.
系统库可以包括多个功能模块。例如:表面管理器(Surface Manager),媒体库(Media Libraries),三维图形处理库(例如:OpenGL ES),二维图形引擎(例如:SGL)等。A system library can include multiple functional modules. For example: surface manager (Surface Manager), media library (Media Libraries), 3D graphics processing library (eg: OpenGL ES), 2D graphics engine (eg: SGL) and so on.
表面管理器用于对显示子系统进行管理,并且为多个应用程序提供了二维(2-Dimensional,2D)和三维(3-Dimensional,3D)图层的融合。The Surface Manager is used to manage the display subsystem and provides a fusion of two-dimensional (2-Dimensional, 2D) and three-dimensional (3-Dimensional, 3D) layers for multiple applications.
媒体库支持多种常用的音频,视频格式回放和录制,以及静态图像文件等。媒体库可以支持多种音视频编码格式,例如:MPEG4,H.264,MP3,AAC,AMR,JPG,PNG等。The media library supports playback and recording of a variety of commonly used audio and video formats, as well as still image files. The media library can support a variety of audio and video encoding formats, such as: MPEG4, H.264, MP3, AAC, AMR, JPG, PNG, etc.
三维图形处理库用于实现3D图形绘图,图像渲染,合成,和图层处理等。The 3D graphics processing library is used to implement 3D graphics drawing, image rendering, compositing, and layer processing.
2D图形引擎是2D绘图的绘图引擎。2D graphics engine is a drawing engine for 2D drawing.
内核层是硬件和软件之间的层。内核层至少包含显示驱动,摄像头驱动,音频驱动,传感器驱动,虚拟卡驱动。The kernel layer is the layer between hardware and software. The kernel layer contains at least display drivers, camera drivers, audio drivers, sensor drivers, and virtual card drivers.
以上实施例仅用以说明本申请的技术方案,而非对其限制;尽管参照前述实施例对本申请进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本申请各实施例技术方案的范围。The above embodiments are only used to illustrate the technical solutions of the present application, but not to limit them; although the present application has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that: The recorded technical solutions are modified, or some technical features thereof are equivalently replaced; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the scope of the technical solutions of the embodiments of the present application.
Claims (22)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110826439.XA CN114490228B (en) | 2021-07-21 | 2021-07-21 | A bluetooth automatic test method and related device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110826439.XA CN114490228B (en) | 2021-07-21 | 2021-07-21 | A bluetooth automatic test method and related device |
Publications (2)
Publication Number | Publication Date |
---|---|
CN114490228A true CN114490228A (en) | 2022-05-13 |
CN114490228B CN114490228B (en) | 2022-11-29 |
Family
ID=81491526
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202110826439.XA Active CN114490228B (en) | 2021-07-21 | 2021-07-21 | A bluetooth automatic test method and related device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN114490228B (en) |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN115002736A (en) * | 2022-05-16 | 2022-09-02 | Oppo广东移动通信有限公司 | Low-power-consumption Bluetooth test method, device, system, test equipment and storage medium |
CN115334485A (en) * | 2022-09-15 | 2022-11-11 | 北京华创互联科技股份有限公司 | Bluetooth device testing device and Bluetooth testing system |
Citations (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102438055A (en) * | 2011-12-06 | 2012-05-02 | 广东欧珀移动通信有限公司 | Mobile phone automatic testing method based on Bluetooth communication |
US20140178853A1 (en) * | 2012-12-21 | 2014-06-26 | General Electric Company | Testing system and method |
CN104202105A (en) * | 2014-09-24 | 2014-12-10 | 福建联迪商用设备有限公司 | Bluetooth device testing method and system |
CN106776294A (en) * | 2016-11-29 | 2017-05-31 | 任子行网络技术股份有限公司 | Android mobile phone automated testing method and system |
CN106850091A (en) * | 2017-02-03 | 2017-06-13 | 珠海市杰理科技股份有限公司 | Bluetooth equipment method of testing and system |
CN108829609A (en) * | 2018-07-27 | 2018-11-16 | 深圳智芯数据服务有限公司 | A kind of test method and system of blue tooth products |
WO2019090454A1 (en) * | 2017-11-07 | 2019-05-16 | 深圳市汇顶科技股份有限公司 | Bluetooth test system and method |
CN110389886A (en) * | 2018-04-16 | 2019-10-29 | 腾讯科技(深圳)有限公司 | Additional function testing method, device and storage medium of main application program |
CN112839323A (en) * | 2020-12-31 | 2021-05-25 | Tcl通力电子(惠州)有限公司 | Bluetooth device testing method and device, terminal and computer readable storage medium |
-
2021
- 2021-07-21 CN CN202110826439.XA patent/CN114490228B/en active Active
Patent Citations (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102438055A (en) * | 2011-12-06 | 2012-05-02 | 广东欧珀移动通信有限公司 | Mobile phone automatic testing method based on Bluetooth communication |
US20140178853A1 (en) * | 2012-12-21 | 2014-06-26 | General Electric Company | Testing system and method |
CN104202105A (en) * | 2014-09-24 | 2014-12-10 | 福建联迪商用设备有限公司 | Bluetooth device testing method and system |
CN106776294A (en) * | 2016-11-29 | 2017-05-31 | 任子行网络技术股份有限公司 | Android mobile phone automated testing method and system |
CN106850091A (en) * | 2017-02-03 | 2017-06-13 | 珠海市杰理科技股份有限公司 | Bluetooth equipment method of testing and system |
WO2019090454A1 (en) * | 2017-11-07 | 2019-05-16 | 深圳市汇顶科技股份有限公司 | Bluetooth test system and method |
CN110389886A (en) * | 2018-04-16 | 2019-10-29 | 腾讯科技(深圳)有限公司 | Additional function testing method, device and storage medium of main application program |
CN108829609A (en) * | 2018-07-27 | 2018-11-16 | 深圳智芯数据服务有限公司 | A kind of test method and system of blue tooth products |
CN112839323A (en) * | 2020-12-31 | 2021-05-25 | Tcl通力电子(惠州)有限公司 | Bluetooth device testing method and device, terminal and computer readable storage medium |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN115002736A (en) * | 2022-05-16 | 2022-09-02 | Oppo广东移动通信有限公司 | Low-power-consumption Bluetooth test method, device, system, test equipment and storage medium |
CN115334485A (en) * | 2022-09-15 | 2022-11-11 | 北京华创互联科技股份有限公司 | Bluetooth device testing device and Bluetooth testing system |
CN115334485B (en) * | 2022-09-15 | 2024-01-30 | 北京华创互联科技股份有限公司 | Test device and Bluetooth test system for Bluetooth devices |
Also Published As
Publication number | Publication date |
---|---|
CN114490228B (en) | 2022-11-29 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US12184921B2 (en) | Cross-device content projection method and electronic device | |
CN110825469A (en) | Voice assistant display method and device | |
WO2022161119A1 (en) | Display method and electronic device | |
WO2022160991A1 (en) | Permission control method and electronic device | |
CN112148400A (en) | Display method and device in locked state | |
CN111858382A (en) | Application testing method, device, server, system and storage medium | |
CN116048358B (en) | Control methods and related devices for suspended balls | |
CN114371985A (en) | Automated testing method, electronic device, and storage medium | |
CN114444000A (en) | Method, apparatus, electronic device and readable storage medium for generating page layout file | |
CN114640742A (en) | Vibration method, apparatus, electronic device and readable storage medium | |
CN116483734B (en) | Pile inserting method and system based on compiler and related electronic equipment | |
CN114490228B (en) | A bluetooth automatic test method and related device | |
CN114124980A (en) | A method, device and system for starting an application | |
CN115016697A (en) | Screen projection method, computer device, readable storage medium, and program product | |
CN113190362A (en) | Service calling method and device, computer equipment and storage medium | |
WO2022127130A1 (en) | Method for adding operation sequence, electronic device, and system | |
CN113380240B (en) | Voice interaction method and electronic device | |
CN114173286B (en) | Method and device for determining test path, electronic equipment and readable storage medium | |
CN117234351B (en) | Touch processing method, terminal equipment and storage medium | |
CN113157570B (en) | Method, device and storage medium for determining trigger subject information | |
CN111982037B (en) | Height measuring method and electronic equipment | |
CN116991532A (en) | A method, electronic device and system for displaying a virtual machine window | |
CN113467821A (en) | Application program repairing method, device, equipment and readable storage medium | |
CN115017227A (en) | Data synchronization method and related equipment | |
CN113867851A (en) | Electronic equipment operation guide information recording method, electronic equipment operation guide information acquisition method and terminal equipment |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant | ||
CP03 | Change of name, title or address | ||
CP03 | Change of name, title or address |
Address after: Unit 3401, unit a, building 6, Shenye Zhongcheng, No. 8089, Hongli West Road, Donghai community, Xiangmihu street, Futian District, Shenzhen, Guangdong 518040 Patentee after: Honor Terminal Co.,Ltd. Country or region after: China Address before: 3401, unit a, building 6, Shenye Zhongcheng, No. 8089, Hongli West Road, Donghai community, Xiangmihu street, Futian District, Shenzhen, Guangdong Patentee before: Honor Device Co.,Ltd. Country or region before: China |