WO2019134578A1 - 设备兼容性的测试方法、装置、电子设备及介质 - Google Patents

设备兼容性的测试方法、装置、电子设备及介质 Download PDF

Info

Publication number
WO2019134578A1
WO2019134578A1 PCT/CN2018/124340 CN2018124340W WO2019134578A1 WO 2019134578 A1 WO2019134578 A1 WO 2019134578A1 CN 2018124340 W CN2018124340 W CN 2018124340W WO 2019134578 A1 WO2019134578 A1 WO 2019134578A1
Authority
WO
WIPO (PCT)
Prior art keywords
user interface
execution data
node
abnormal
index
Prior art date
Application number
PCT/CN2018/124340
Other languages
English (en)
French (fr)
Inventor
徐国诚
刘慧众
丁晶晶
Original Assignee
深圳壹账通智能科技有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 深圳壹账通智能科技有限公司 filed Critical 深圳壹账通智能科技有限公司
Publication of WO2019134578A1 publication Critical patent/WO2019134578A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3688Test management for test execution, e.g. scheduling of test suites
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology

Definitions

  • the present application belongs to the field of Internet technologies, and in particular, to a test method, device, electronic device and medium for device compatibility.
  • the prior art has a problem of poor security in the testing and storage process of device compatibility.
  • a first aspect of the embodiments of the present invention provides a method for testing device compatibility, including:
  • test execution data generated by the test device where the test execution data is response data generated after the test device executes the preset instruction input by the main device, where the test execution data includes an element display position of each element of the user interface on the screen; Determining whether the location of the user interface of the test device is abnormal; if the user interface of the test device is abnormal in position, determining that the master device is compatible with the test device If the user interface of the test device does not have a location abnormality, acquiring execution data of the non-compatibility exception generated by the plurality of compatible devices according to the preset instruction input by the master device, to generate a compatible execution data group, Performing a neural network model according to the compatible execution data group; calculating an abnormal actual index corresponding to the test execution data according to the neural network model, and determining the master device if the abnormal actual index is greater than a preset index threshold There is a compatibility exception with the test device.
  • the second aspect of the embodiments of the present application provides a device compatibility testing device, where the device compatibility testing device includes: an acquiring unit, configured to acquire test execution data generated by the testing device, where the test execution data is a testing device.
  • the response data generated after the preset instruction input by the main device is executed, the test execution data includes an element display position of each element of the user interface on the screen, and the position determining unit is configured to determine, according to the display position of the element corresponding to each element, Whether the location of the user interface of the test device is abnormal;
  • the first determining unit is configured to determine that there is a compatibility abnormality between the master device and the test device if the user interface of the test device has a location abnormality;
  • a unit configured to: if the user interface of the test device does not have a location abnormality, acquire execution data of the non-compatibility exception generated by the plurality of compatible devices according to the preset instruction input by the master device, to generate a compatible execution data group And training the neural network model according to the
  • a third aspect of the embodiments of the present application provides an electronic device including a memory and a processor, wherein the memory stores computer readable instructions executable on the processor, the processor executing the computer
  • the steps of the test method for device compatibility as described in the first aspect are implemented when the instructions are read.
  • a fourth aspect of embodiments of the present application provides a computer non-volatile readable storage medium storing computer readable instructions that are executed by a processor The steps of the test method for device compatibility as described in the first aspect are achieved.
  • the test execution data generated by the test device is acquired to obtain the element display position of each element of the user interface on the screen; if the location of the user interface of the test device is abnormal, it is determined between the master device and the test device. If there is no location abnormality in the user interface of the test device, the execution data of the non-compatible abnormality generated by the plurality of compatible devices according to the preset instruction input by the main device is acquired, and the execution data is trained according to the execution data.
  • a neural network model calculating an abnormal actual index corresponding to the test execution data according to the neural network model, and determining that the master device and the test device are compatible if the abnormal actual index is greater than a preset index threshold Sexual anomaly, to quickly and accurately test the compatibility abnormality between the test device and the main device, thereby reminding the user to modify the configuration of the device and improve the success rate of synchronization operations of different devices.
  • FIG. 1 is a flowchart of implementing a test method for device compatibility provided by an embodiment of the present application
  • FIG. 2 is a specific implementation flowchart of a device compatibility testing method S102 provided by an embodiment of the present application
  • FIG. 3 is a flowchart of a specific implementation of a test method S104 for device compatibility provided by an embodiment of the present application;
  • FIG. 4 is a structural block diagram of a device for testing device compatibility provided by an embodiment of the present application.
  • FIG. 5 is a schematic diagram of an electronic device according to an embodiment of the present application.
  • FIG. 1 shows an implementation flow of a test method for device compatibility provided by an embodiment of the present application, where the method flow includes steps S101 to S105.
  • the specific implementation principle of each step is as follows.
  • test execution data generated by the test device, where the test execution data is response data generated after the test device executes a preset instruction input by the main device, where the test execution data includes an element display position of each element of the user interface on the screen.
  • the operation of one master device may be performed synchronously in multiple slave devices. It is understood that after the user inputs a preset command in the master device, the master device may make according to the preset command. Corresponding operations, such as opening a user interface and displaying different content on the user interface, at almost the same time, when the slave device of the master device receives the data transmitted by the master device, the slave device can generate a series of responses. Data, under normal circumstances, these response data enables the slave device to make the same operations as the master device and display the same or very similar user interface on the screen of the slave device and present similar content on the screen of the slave device.
  • a slave device in order to detect whether the master device is compatible with each slave device, a slave device needs to be used as a test device for subsequent device compatibility testing, and notably, the test device performs a preset input by the master device.
  • the response data generated after the instruction is the test execution data of the test device.
  • the test execution data may be a character string or may exist in the form of a matrix, and may be used to indicate which element of the user interface is displayed by each pixel on the screen of the test device. It can be understood that the test device can display a user interface because the corresponding relationship between the elements of each user interface and the pixels on the screen exists in the test execution data, so all the pixels in the screen follow this correspondence. When the relationship shows the corresponding element, the test execution data realizes the purpose of controlling the screen to display the user interface.
  • the element display position is a position at which an element is displayed on a pixel on the screen.
  • the resolution of one screen is: 1600 ⁇ 1200
  • the element display position of the first column of the first row is marked as (1, 1); the display position of the last column of the last row is marked as ( 1600, 1200)
  • other element display positions can be analogized according to the above marking method.
  • the element display position of each element of each user interface on the screen can be analyzed, thereby providing data support for subsequent analysis of whether the user interface is displayed normally.
  • S102 Determine whether a user interface of the test device has a position abnormality according to the element display position corresponding to each element.
  • the first aspect is to determine whether the user interface of the test device has a display abnormality. It can be understood that if a device is on the screen If the display interface overlaps, the interface is folded, and the display is abnormal beyond the parent border, it proves that there is a compatibility abnormality between the test device and the master device. On the other hand, it is judged whether the user interface of the test device is the user of the master device. There is a large difference in the interface.
  • test device is a slave device of the master device
  • slave device needs to synchronize various operations of the master device in the embodiment of the present application, so once the user interface and the master device of the test device are tested A large difference in the user interface proves that there may be a compatibility exception between the test device and the master device.
  • the determining process of the first aspect of the present application is mainly implemented by determining whether a user interface of the test device is abnormal in position.
  • the location exceptions that may occur in the user interface include: user interface overlap exception, user interface folding exception, and user interface exceeding the parent border.
  • the user interface overlap abnormality indicates that two or more user interfaces are partially overlapped when displayed on the screen;
  • a user interface folding exception indicates that a portion of a user interface coincides with other portions of the user interface; exceeding the parent border indicates that the child user interface is displayed on the screen with a partial or global extent that is not displayed within the parent user interface.
  • the foregoing S102 includes:
  • the test execution data further includes an association relationship between the user interface and its parent user interface, and an association relationship between the user interface and its sub-user interface.
  • test device may generate multiple user interfaces according to preset instructions input by the master device, and there may be a user interface between the user interfaces that is a parent-child user interface relationship.
  • the parent user interface contains a sub-user interface. When the screen is displayed normally, the sub-user interface must be within the range displayed by the parent user interface.
  • two user interfaces corresponding to the elements having the same element display position are determined, and then it is determined whether two user interfaces to which the two elements having the same element display position belong belong to the parent-child user interface relationship. .
  • the user interface must have a user interface folding abnormality; if there are two of the same element display position
  • the two user interfaces to which the elements belong do not belong to the parent-child user interface relationship.
  • the two user interfaces are likely to interfere with each other.
  • the user may not be able to see or control the two user interfaces, so there are users between the two user interfaces.
  • the interface overlap is abnormal.
  • the effective The user interface overlap exception and the user interface folding abnormality are recognized.
  • the foregoing S102 further includes:
  • the element display positions of all elements of the parent user interface of the user interface are combined into an element display set.
  • the test execution data includes the association relationship between each user interface and its parent user interface, so each user interface can be determined by the association relationship with the parent user interface.
  • the parent user interface of the user interface After all the parent user interfaces of a user interface are determined, the element display locations of all the elements contained in these parent user interfaces are combined into an element display set of the user interface.
  • the user interface 2 and the element display positions of all the elements included in the user interface 3 are combined into a user interface 1 correspondingly.
  • the elements show the collection.
  • the element display position of the element in which the user interface exists is not in the element display set, it is determined that the user interface of the test device has a position abnormality.
  • the element display corresponding to the user interface 1 contains the element display position of the user interface 2 and all the elements included in the user interface 3, so if there is an element display position of one element in the user interface 1 Not in its corresponding element display set, it proves that the user interface 1 must be displayed beyond the display range of its parent user interface when displayed on the screen of the test device, that is, an exception occurs beyond the parent border.
  • the user interface of the test device may directly determine that there is a compatibility abnormality between the primary device and the test device.
  • the present application determines whether there is a compatibility abnormality between the test device and the master device based on two aspects. Therefore, if the location of the user interface of the test device is not found to be abnormal by the judgment of the first aspect, the second pass The aspect determines whether the user interface of the test device is significantly different from the user interface of the master device, so as to determine whether there is a compatibility abnormality between the test device and the master device.
  • the neural network model is used to identify the difference between the test device and the master device to determine whether there is a compatibility abnormality between the test device and the master device.
  • a large number of devices that have been proved to be compatible with the master device are used as compatible devices, and the compatible devices generate execution data of the non-compatibility exception after executing the preset instruction input by the master device.
  • the execution data generated by each compatible device is more or less different from the execution data generated by the master device.
  • the abnormal value between the execution data generated by each compatible device and the execution data generated by the master device has been pre-calculated as the abnormal theory index corresponding to the execution data of each of the non-compatibility exceptions.
  • the compatible execution data group is generated according to the correspondence between the execution data generated by the plurality of compatible devices and the corresponding abnormal anomaly index, and the compatible execution data group is used as the parameter of the training neural network model.
  • the foregoing S104 includes:
  • the compatible execution data set includes a correspondence between the execution data and a preset anomaly index, the neural network including an input layer, a hidden layer, and an output layer, wherein the input layer and the hidden layer each include multiple nodes.
  • the output layer has a node.
  • the data corresponding to each node of the input layer is the execution data in the compatible execution data group, and the execution data may be stored and operated in the form of a matrix.
  • the hidden layer of the neural network model also includes j nodes, and the nodes i of different input layers are to different hidden layers.
  • the weight of the path corresponding to the node j is different, and each node of the hidden layer also corresponds to an offset value, so the neural network model has two important parameters, namely a weight value and an offset value.
  • each weight value and each offset value need to be given an initial weight value and Offset initial value.
  • S1042 Calculate the abnormal actual index by the first formula.
  • the first formula is:
  • the W ij is a weight value of the node i of the input layer to the node j of the hidden layer
  • the X i is a feature vector of the feature vector generated according to the execution data corresponding to the i th node of the input layer i row data group
  • the P j is an offset value corresponding to the jth node of the hidden layer
  • the Z is an abnormal actual index.
  • S1043 Determine whether a difference between the abnormal actual index and the abnormal theoretical index is greater than a preset difference threshold.
  • S1044 If the difference between the abnormal actual index and the abnormal theoretical index is greater than a preset difference threshold, update the weight value and the offset value, and return to perform the calculation of the abnormal actual index by using the first formula, and determine Whether the difference between the abnormal actual index and the abnormal theoretical index is greater than a preset difference threshold.
  • the first formula is:
  • the execution is passed back through the first formula:
  • the abnormal actual index it is necessary to select an execution data that has not been used to train the neural network model from the compatible execution data set and the difference theory index corresponding to the execution data for a new round of calculation.
  • the second formula Calculating a weight error of the jth node of the hidden layer, the T is the abnormal actual index, Z is an abnormal theory index, and the W ij is the node i of the input layer to the node j of the hidden layer a weight value, the X i is an i-th row data group of the feature vector generated according to the execution data corresponding to the i-th node of the input layer, and the P j is corresponding to the j-th node of the hidden layer Offset value
  • W ij +Err j ⁇ X i is used as the weight value of the node i of the updated input layer to the node j of the hidden layer; P j +Err j is taken as the updated jth node of the hidden layer Corresponding offset value.
  • the purpose of cyclically updating the weight value of the neural network model and the offset value is achieved, thereby training a Accurate neural network model.
  • S105 Calculate an abnormal actual index corresponding to the test execution data according to the neural network model, and if the abnormal actual index is greater than a preset index threshold, determine that there is a compatibility abnormality between the primary device and the test device. .
  • an i-dimensional feature vector of the test execution data is calculated, and each row data group of the feature vector is used as a value corresponding to an input layer node of the neural network model calculated by the above embodiment, thereby calculating a basis according to the neural network model.
  • the abnormal actual index corresponding to the test execution data is calculated.
  • the test execution data generated by the test device is acquired to obtain the element display position of each element of the user interface on the screen; if the location of the user interface of the test device is abnormal, it is determined between the master device and the test device. If there is no location abnormality in the user interface of the test device, the execution data of the non-compatible abnormality generated by the plurality of compatible devices according to the preset instruction input by the main device is acquired, and the execution data is trained according to the execution data.
  • a neural network model calculating an abnormal actual index corresponding to the test execution data according to the neural network model, and determining that the master device and the test device are compatible if the abnormal actual index is greater than a preset index threshold Sexual anomaly, to quickly and accurately test the compatibility abnormality between the test device and the main device, thereby reminding the user to modify the configuration of the device and improve the success rate of synchronization operations of different devices.
  • FIG. 4 is a structural block diagram of the device compatibility testing device provided by the embodiment of the present application. For the convenience of description, only the embodiment of the present application is shown. Related parts.
  • the apparatus includes:
  • the obtaining unit 401 is configured to acquire test execution data generated by the test device, where the test execution data is response data generated after the test device executes the preset instruction input by the main device, where the test execution data includes each element of the user interface on the screen. Element display position;
  • the location determining unit 402 is configured to determine, according to the element display location corresponding to each element, whether the user interface of the test device has a location abnormality;
  • the first determining unit 403 is configured to determine that there is a compatibility abnormality between the primary device and the testing device if the user interface of the testing device has a location abnormality;
  • the calculating unit 404 is configured to: if the user interface of the test device does not have a location abnormality, acquire execution data of the non-compatibility exception generated by the plurality of compatible devices according to the preset instruction input by the master device, to generate compatible execution a data group, training a neural network model according to the compatible execution data group;
  • a second determining unit 405 configured to calculate an abnormal actual index corresponding to the test execution data according to the neural network model, and if the abnormal actual index is greater than a preset index threshold, determine the primary device and the testing device There is a compatibility exception between them.
  • the location determining unit 402 includes:
  • a judging subunit is displayed for judging whether two different elements have the same display position of the element.
  • a relationship judging subunit configured to determine that the two different elements have the same display position, and the same relationship is determined according to the association relationship between the user interface and the parent user interface and the association relationship between the user interface and the sub user interface. Whether the two user interfaces to which the two elements of the element display position belong belong to the parent-child user interface relationship.
  • the abnormality determining sub-unit is configured to determine that the user interface of the test device has a position abnormality if two user interfaces to which the two elements having the same element display position belong do not belong to the parent-child user interface relationship.
  • the location determining unit 402 is further configured to:
  • the element display positions of all the elements of the parent user interface of the user interface are combined into an element display set
  • the element display position of the element in which the user interface exists is not in the element display set, it is determined that the user interface of the test device has a position abnormality.
  • the calculating unit 404 includes:
  • the index calculation subunit is used to pass the first formula: Calculating an abnormality actual index, where W ij is a weight value of a node i of the input layer to a node j of the hidden layer, and the X i is generated according to the execution data corresponding to an i th node of the input layer The i-th row data group of the feature vector, wherein P j is an offset value corresponding to the j-th node of the hidden layer;
  • a difference judgment subunit configured to determine whether a difference between the abnormal actual index and the abnormal theoretical index is greater than a preset difference threshold
  • a cyclic subunit configured to update the weight value and the offset value if the difference between the abnormal actual index and the abnormal theoretical index is greater than a preset difference threshold, and return to execute by using the first formula: Calculating an abnormal actual index, and determining whether the difference between the abnormal actual index and the abnormal theoretical index is greater than a preset difference threshold;
  • the loop subunit is specifically configured to:
  • P j +Err j is taken as the offset value corresponding to the jth node of the hidden layer.
  • the test execution data generated by the test device is acquired to obtain the element display position of each element of the user interface on the screen; if the location of the user interface of the test device is abnormal, it is determined between the master device and the test device. If there is no location abnormality in the user interface of the test device, the execution data of the non-compatible abnormality generated by the plurality of compatible devices according to the preset instruction input by the main device is acquired, and the execution data is trained according to the execution data.
  • a neural network model calculating an abnormal actual index corresponding to the test execution data according to the neural network model, and determining that the master device and the test device are compatible if the abnormal actual index is greater than a preset index threshold Sexual anomaly, to quickly and accurately test the compatibility abnormality between the test device and the main device, thereby reminding the user to modify the configuration of the device and improve the success rate of synchronization operations of different devices.
  • FIG. 5 is a schematic diagram of an electronic device according to an embodiment of the present application.
  • the electronic device 5 of this embodiment includes a processor 50, a memory 51, and computer readable instructions 52 stored in the memory 51 and operable on the processor 50, such as device compatibility. Test procedure.
  • the steps in the embodiment of the test method for implementing the above-described respective device compatibility when the processor 50 executes the computer readable instructions 52 such as steps 101 to 105 shown in FIG.
  • the processor 50 executes the computer readable instructions 52
  • the functions of the modules/units in the above various device embodiments are implemented, such as the functions of the units 401 to 405 shown in FIG.
  • the computer readable instructions 52 may be partitioned into one or more modules/units that are stored in the memory 51 and executed by the processor 50, To complete this application.
  • the one or more modules/units may be a series of computer readable instruction instructions segments capable of performing a particular function, the instruction segments being used to describe the execution of the computer readable instructions 52 in the electronic device 5.
  • the electronic device 5 may be a computing device such as a desktop computer, a notebook, a palmtop computer, and a cloud server.
  • the electronic device may include, but is not limited to, a processor 50, a memory 51. It will be understood by those skilled in the art that FIG. 5 is only an example of the electronic device 5, and does not constitute a limitation on the electronic device 5, and may include more or less components than those illustrated, or combine some components, or different components.
  • the electronic device may further include an input and output device, a network access device, a bus, and the like.
  • the processor 50 may be a central processing unit (CPU), or may be other general-purpose processors, a digital signal processor (DSP), an application specific integrated circuit (ASIC), Field-Programmable Gate Array (FPGA) or other programmable logic device, discrete gate or transistor logic device, discrete hardware components, etc.
  • the general purpose processor may be a microprocessor or the processor or any conventional processor or the like.
  • the memory 51 may be an internal storage unit of the electronic device 5, such as a hard disk or a memory of the electronic device 5.
  • the memory 51 may also be an external storage device of the electronic device 5, such as a plug-in hard disk equipped on the electronic device 5, a smart memory card (SMC), and a secure digital (SD). Card, flash card, etc. Further, the memory 51 may also include both an internal storage unit of the electronic device 5 and an external storage device.
  • the memory 51 is configured to store the computer readable instructions and other programs and data required by the electronic device.
  • the memory 51 can also be used to temporarily store data that has been output or is about to be output.
  • the integrated modules/units if implemented in the form of software functional units and sold or used as separate products, may be stored in a computer readable storage medium. Based on such understanding, the present application implements all or part of the processes in the foregoing embodiments, and may also be implemented by computer readable instructions, which may be stored in a computer non-volatile. Readable in storage media.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Health & Medical Sciences (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Computational Linguistics (AREA)
  • Data Mining & Analysis (AREA)
  • Evolutionary Computation (AREA)
  • Biomedical Technology (AREA)
  • Molecular Biology (AREA)
  • Computing Systems (AREA)
  • Artificial Intelligence (AREA)
  • Biophysics (AREA)
  • Mathematical Physics (AREA)
  • Software Systems (AREA)
  • Health & Medical Sciences (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Debugging And Monitoring (AREA)
  • Test And Diagnosis Of Digital Computers (AREA)

Abstract

一种设备兼容性的测试方法、装置、电子设备及介质,通过获取测试设备生成的测试执行数据,以获取用户界面各元素在屏幕上的元素显示位置;若测试设备的用户界面存在位置异常,则判定主设备与测试设备之间存在兼容性异常;若所述测试设备的用户界面不存在位置异常,则获取多个可兼容设备根据主设备输入的预设指令生成的无兼容性异常的执行数据,并根据这些执行数据训练出神经网络模型;根据所述神经网络模型计算所述测试执行数据对应的异常实际指数,若所述异常实际指数大于预设的指数阈值,则判定所述主设备与所述测试设备之间存在兼容性异常,以快速准确地测试出测试设备与主设备之间的兼容性异常。

Description

设备兼容性的测试方法、装置、电子设备及介质
本申请要求于2018年01月02日提交中国专利局、申请号为201810001746.2、发明名称为“设备兼容性的测试方法及终端设备”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请属于互联网技术领域,尤其涉及一种设备兼容性的测试方法、装置、电子设备及介质。
背景技术
随着互联网技术的发展,设备和设备之间的数据交互日益密切,其中一种常见的数据交互形式体现为将一个设备上的操作同步地在其他设备上执行,使得多台设备出现相同的用户界面,从而为不同的用户呈现相同的执行结果。但是在实际操作中,由于不同的设备的操作系统、屏幕分别率以及应用软件版本等参数均可能存在差异,所以在多个设备同步操作时,经常会遇到不同的设备在根据同一个设备进行同步操作时显示出的用户界面不同,甚至出现用户界面显示异常的现象,即用户界面不兼容的情况发生。
目前,往往需要人工通过观察各自的设备是否存在用户界面的显示异常,才能判断用户界面的兼容性是否出现异常,这样的判断方法效率非常低,而且由于一台设备的使用者可能不清楚其他设备上用户界面的显示情况,所以可能存在设备兼容性的判断不准确的问题。
技术问题
现有技术在设备兼容性的测试和保存过程中存在的安全性差的问题。
技术解决方案
本发明实施例的第一方面提供了一种设备兼容性的测试方法,包括:
获取测试设备生成的测试执行数据,所述测试执行数据为测试设备执行主设备输入的预设指令后生成的响应数据,所述测试执行数据包括用户界面各元素在屏幕上的元素显示位置;根据各元素对应的所述元素显示位置,判断所述测试设备的用户界面是否存在位置异常;若所述测试设备的用户界面存在位置异常,则判定所述主设备与所述测试设备之间存在兼容性异常;若所述测试设备的用户界面不存在位置异常,则获取多个可兼容设备根据所述主设备输入的预设指令生成的无兼容性异常的执行数据,以生成兼容执行数据组,根据所述兼容 执行数据组训练出神经网络模型;根据所述神经网络模型计算所述测试执行数据对应的异常实际指数,若所述异常实际指数大于预设的指数阈值,则判定所述主设备与所述测试设备之间存在兼容性异常。
本申请实施例的第二方面提供了一种设备兼容性的测试装置,该设备兼容性的测试装置包括:获取单元,用于获取测试设备生成的测试执行数据,所述测试执行数据为测试设备执行主设备输入的预设指令后生成的响应数据,所述测试执行数据包括用户界面各元素在屏幕上的元素显示位置;位置判断单元,用于根据各元素对应的所述元素显示位置,判断所述测试设备的用户界面是否存在位置异常;第一判定单元,用于若所述测试设备的用户界面存在位置异常,则判定所述主设备与所述测试设备之间存在兼容性异常;计算单元,用于若所述测试设备的用户界面不存在位置异常,则获取多个可兼容设备根据所述主设备输入的预设指令生成的无兼容性异常的执行数据,以生成兼容执行数据组,根据所述兼容执行数据组训练出神经网络模型;第二判定单元,用于根据所述神经网络模型计算所述测试执行数据对应的异常实际指数,若所述异常实际指数大于预设的指数阈值,则判定所述主设备与所述测试设备之间存在兼容性异常。
本申请实施例的第三方面提供了一种电子设备,包括存储器以及处理器,所述存储器中存储有可在所述处理器上运行的计算机可读指令,所述处理器执行所述计算机可读指令时实现如第一方面所述的设备兼容性的测试方法的步骤。
本申请实施例的第四方面提供了一种计算机非易失性可读存储介质,所述计算机非易失性可读存储介质存储有计算机可读指令,所述计算机可读指令被处理器执行时实现如第一方面所述的设备兼容性的测试方法的步骤。
有益效果
在本申请实施例中,通过获取测试设备生成的测试执行数据,以获取用户界面各元素在屏幕上的元素显示位置;若测试设备的用户界面存在位置异常,则判定主设备与测试设备之间存在兼容性异常;若所述测试设备的用户界面不存在位置异常,则获取多个可兼容设备根据主设备输入的预设指令生成的无兼容性异常的执行数据,并根据这些执行数据训练出神经网络模型;根据所述神经网络模型计算所述测试执行数据对应的异常实际指数,若所述异常实际指数大于预设的指数阈值,则判定所述主设备与所述测试设备之间存在兼容性异常,以快速准确地测试出测试设备与主设备之间的兼容性异常,从而提醒用户修改设备的配置,提高不同设备进行同步操作的成功率。
附图说明
图1是本申请实施例提供的设备兼容性的测试方法的实现流程图;
图2是本申请实施例提供的设备兼容性的测试方法S102的具体实现流程图;
图3是本申请实施例提供的设备兼容性的测试方法S104的具体实现流程图;
图4是本申请实施例提供的设备兼容性的测试装置的结构框图;
图5是本申请实施例提供的电子设备的示意图。
本申请的实施方式
为了说明本申请所述的技术方案,下面通过具体实施例来进行说明。
图1示出了本申请实施例提供的设备兼容性的测试方法的实现流程,该方法流程包括步骤S101至S105。各步骤的具体实现原理如下。
S101:获取测试设备生成的测试执行数据,所述测试执行数据为测试设备执行主设备输入的预设指令后生成的响应数据,所述测试执行数据包括用户界面各元素在屏幕上的元素显示位置。
在本申请实施例中,一个主设备的操作可以被同步地在多个从属设备中执行,可以理解地,用户在主设备中输入一个预设指令后,主设备会根据该预设指令做出相应的操作,例如打开一个用户界面,并在该用户界面上显示不同的内容,在几乎同一时间,当该主设备的从属设备接收到主设备传递的数据后,从属设备可以生成一系列的响应数据,正常情况下,这些响应数据使得从属设备可以做出与主设备相同的操作,并在从属设备的屏幕上显示出与主设备的屏幕上相同或非常相似的用户界面以及呈现相似的内容。
可以理解地,在现实生活中,由于不同的设备之间存在配置上的差异,所以并不是所有的从属设备都可以和主设备兼容,即从属设备在接收到主设备传递的数据后,无法显示出与主设备的屏幕上相似的用户界面和内容。所以在本申请实施例中,为了检测主设备是否与各个从属设备兼容,需要将一个从属设备作为测试设备进行后续的设备兼容性的测试工作,值得注意地,测试设备执行主设备输入的预设指令后生成的响应数据就是该测试设备的测试执行数据。
在本申请实施例中,测试执行数据可以是一个字符串,也可以以矩阵的形式存在,可以用于指示测试设备的屏幕上的各个像素点显示哪个用户界面的哪个元素。可以理解地,测试设备之所以可以显示出一个用户界面,是由于测试执行数据中存在各个用户界面的元素与屏幕上的像素点的对应关系,所以当屏幕中的所有像素点都按照这种对应关系显示对应的元素时,测试执行数据就实现了控制屏幕显示用户界面的目的。
在本申请实施例中,元素显示位置即一个元素显示在屏幕上的像素点的位置。示例性地,如果一个屏幕的分辨率为:1600×1200,则将其第一行第一列的元素显示位置标为(1,1);将其最后一行最后一列的元素显示位置标为(1600,1200),其他的元素显示位置依照上述 标记方式可以类推得到。
在本申请实施例中,通过获取测试设备的测试执行数据,可以分析出各个用户界面的各个元素在屏幕上的元素显示位置,从而为后续分析用户界面是否显示正常提供数据支持。
S102:根据各元素对应的所述元素显示位置,判断所述测试设备的用户界面是否存在位置异常。
在本申请实施例中,基于两个方面判断测试设备与主设备之间是否存在兼容性异常,第一方面是判断测试设备的用户界面是否存在显示异常,可以理解地,如果一个设备的屏幕上显示出的用户界面存在界面重叠、界面折叠以及超出父边框等显示异常,则证明测试设备和主设备之间一定存在兼容性异常;另一方面是判断测试设备的用户界面是否与主设备的用户界面存在较大差异,可以理解地,由于测试设备是主设备的从属设备,而从属设备在本申请实施例中就是需要同步主设备的各种操作的,所以一旦测试设备的用户界面与主设备的用户界面存在较大差异,则证明测试设备和主设备之间可能存在兼容性异常。
具体地,本申请实施例针对上述第一方面的判断过程,主要是通过判断测试设备的用户界面是否出现位置异常而实现的。用户界面可能出现的位置异常包括:用户界面重叠异常、用户界面折叠异常以及用户界面超出父边框,其中,用户界面重叠异常表示两个或两个以上用户界面在屏幕上显示时,有一部分重叠;用户界面折叠异常表示一个用户界面的一个局部与该用户界面的其他部分重合;超出父边框表示子用户界面在屏幕上显示时存在一个局部或整体没有在父用户界面显示的范围内。
作为本申请的一个实施例,如图2所示,上述S102包括:
S1021,判断两个不同的元素是否具有相同的所述元素显示位置;
在本申请实施例中,如果两个不同的元素具有相同的元素显示位置,则证明在显示时有不同或相同的用户界面出现局部重合的现象,但是这还并不能代表用户界面出现位置异常,需要进一步的判断过程。
S1022,若两个不同的元素具有相同的所述元素显示位置,则根据用户界面与其父用户界面的关联关系以及用户界面与其子用户界面的关联关系,判断具有相同的所述元素显示位置的两个元素所属的两个用户界面是否属于父子用户界面关系。
在本申请实施例中,测试执行数据还包括用户界面与其父用户界面的关联关系以及用户界面与其子用户界面的关联关系。
可以理解地,测试设备根据主设备输入的预设指令可能生成多个用户界面,而这些用户界面之间可能存在互为父子用户界面关系的用户界面。在常见的设备中,父用户界面内包含着子用户界面,在屏幕上正常显示时,子用户界面必须在父用户界面显示的范围之内。
在本申请实施例中,首先确定两个具有相同的元素显示位置的元素对应的用户界面,随后判断具有相同的所述元素显示位置的两个元素所属的两个用户界面是否属于父子用户界面关系。
S1023,若具有相同的所述元素显示位置的两个元素所属的两个用户界面不属于父子用户界面关系,则判定所述测试设备的用户界面存在位置异常。
可以理解地,如果在测试设备的屏幕中具有相同的元素显示位置的两个元素属于同一个用户界面,则该用户界面一定出现了用户界面折叠异常;如果具有相同的所述元素显示位置的两个元素所属的两个用户界面不属于父子用户界面关系,则这两个用户界面很可能会互相干扰,用户可能无法看清或控制这两个用户界面,所以这两个用户界面之间存在用户界面重叠异常。
在本申请实施例中,通过首先判断是否有不同的元素具有相同的元素显示位置,再判断具有相同的元素显示位置的两个元素所属的两个用户界面是否属于父子用户界面关系,可以有效地识别出用户界面重叠异常以及用户界面折叠异常。
作为本申请的一个实施例,上述S102还包括:
根据用户界面与其父用户界面的关联关系,将所述用户界面的父用户界面的所有元素的元素显示位置,组合成元素显示集合。
具体地,在本申请实施例中,如上文所述,测试执行数据内包含了各个用户界面与其父用户界面的关联关系,所以可以通过每个用户界面与其父用户界面的关联关系,确定每个用户界面的父用户界面。在确定了一个用户界面的所有父用户界面后,将这些父用户界面包含的所有的元素的元素显示位置组合成为该用户界面的元素显示集合。示例性地,如果一个用户界面1有两个父用户界面,分别为用户界面2以及用户界面3,则将用户界面2以及用户界面3包含的所有的元素的元素显示位置组合成为用户界面1对应的元素显示集合。
若所述用户界面存在一个元素的元素显示位置不在所述元素显示集合中,则判定所述测试设备的用户界面存在位置异常。
示例性地,如上文示例所述,用户界面1对应的元素显示集合内含有用户界面2以及用户界面3包含的所有的元素的元素显示位置,所以如果用户界面1中存在一个元素的元素显示位置不在其对应的元素显示集合中,则证明用户界面1在测试设备的屏幕中显示时一定超出了其父用户界面的显示范围,即出现了超出父边框异常。
在本申请实施例中,通过首先确定各个用户界面的父用户界面的所有元素的元素显示位置,再分别判断各个用户界面中是否存在一个元素的元素显示位置不在该用户界面对应的元素显示集合中,以准确判断所述测试设备的用户界面是否出现了超出父边框异常。
S103:若所述测试设备的用户界面存在位置异常,则判定所述主设备与所述测试设备之间存在兼容性异常。
可以理解地,如果测试设备的用户界面出现用户界面折叠异常、用户界面重叠异常以及用户界面超出父边框异常等位置异常,则可以直接确定主设备与测试设备之间存在兼容性异常。
S104,若所述测试设备的用户界面不存在位置异常,则获取多个可兼容设备根据所述主设备输入的预设指令生成的无兼容性异常的执行数据,以生成兼容执行数据组,根据所述兼容执行数据组训练出神经网络模型。
如上文实施例所述,本申请基于两个方面判断测试设备与主设备之间是否存在兼容性异常,所以如果通过第一方面的判断未发现测试设备的用户界面存在位置异常,则通过第二方面判断测试设备的用户界面是否与主设备的用户界面存在较大差异,以判断测试设备与主设备之间是否存在兼容性异常。
具体地,在本申请实施例中,采用神经网络模型识别测试设备与主设备之间的差异,以判断测试设备与主设备之间是否存在兼容性异常。
具体地,在本申请实施例中,将大量的已经证明与主设备兼容的设备作为可兼容设备,这些可兼容设备执行主设备输入的预设指令后生成无兼容性异常的执行数据。在本申请实施例中,虽然可兼容设备与主设备兼容,但是每一个可兼容设备生成的执行数据都或多或少的与主设备生成的执行数据有一定的差异,在本申请实施例中,已经预先计算出各个可兼容设备生成的执行数据与主设备生成的执行数据之间的异常值作为各个无兼容性异常的执行数据对应的异常理论指数。
在本申请实施例中,根据多个可兼容设备生成的执行数据与其对应的预设的异常理论指数的对应关系,生成兼容执行数据组,并将兼容执行数据组作为训练神经网络模型的参数。
作为本申请的一个实施例,如图3所示,上述S104包括:
S1041:设置权重初始值以及偏置初始值。
如上文实施例所述,兼容执行数据组包括执行数据与预设的异常理论指数的对应关系,所述神经网络包括输入层、隐藏层以及输出层,其中输入层以及隐藏层均包含多个节点,输出层有一个节点。
在本申请实施例的神经网络模型中,输入层的各个节点对应的数据为兼容执行数据组中的执行数据,这些执行数据可以以矩阵的形式存储以及运算。
示例性地,假设兼容执行数据组中一共有100个执行数据,则从这100个执行数据中选取一个执行数据,并计算该执行数据的i维特征向量,该i维特征向量的各行数据组分别对 应神经网络输入层的X 1、X 2......X i,以此作为神经网络模型在训练时的输入数据。如上文所述,虽然可兼容设备与主设备兼容,但是每一个可兼容设备生成的执行数据都或多或少的与主设备生成的执行数据有一定的差异,所以神经网络的输出层对应的数据为异常实际指数Z,而该无兼容性异常的执行数据的异常理论指数为T,此外,神经网络模型的隐藏层还包括j个节点,而不同的输入层的节点i到不同的隐藏层的节点j对应的路径的权重不同,隐藏层的每个节点还对应一个偏置值,所以神经网络模型具有两个重要的参数,分别为权重值以及偏置值。
可以理解地,由于训练神经网络的过程是一个逐渐确定所有权重值以及所有偏置值的过程,所以在第一轮训练时,需要为每个权重值以及每个偏置值赋予权重初始值以及偏置初始值。
S1042:通过第一公式计算异常实际指数。
所述第一公式为:
Figure PCTCN2018124340-appb-000001
所述W ij为所述输入层的节点i到所述隐藏层的节点j的权重值,所述X i为所述输入层第i个节点对应的根据所述执行数据生成的特征向量的第i行数据组,所述P j为所述隐藏层第j个节点对应的偏置值,所述Z即异常实际指数。
S1043:判断述异常实际指数与所述异常理论指数的差值是否大于预设的差异阈值。
可以理解地,通过比较异常实际指数Z以及预设的异常理论指数T,可以判断出当前的神经网络模型是否准确。
S1044:若所述异常实际指数与所述异常理论指数的差值大于预设的差异阈值,则更新所述权重值以及所述偏置值,并返回执行通过第一公式计算异常实际指数,判断所述异常实际指数与所述异常理论指数的差值是否大于预设的差异阈值的操作。
所述第一公式为:
Figure PCTCN2018124340-appb-000002
可以理解地,如果异常实际指数与异常理论指数的差值过大,则证明当前的神经网络模型还不够准确,所以需要继续更新权重值以及偏置值,以更新神经网络模型,并返回执行S1042以及S1043重新计算异常理论指数以及再次做出判断。
值得注意地,在返回执行通过第一公式:
Figure PCTCN2018124340-appb-000003
计算异常实际指数时,需要从兼容执行数据组中,选择出一个尚未被用于训练神经网络模型的执行数据以及该执行数据对应的差异理论指数,用于新一轮的计算。
具体地,通过第二公式:
Figure PCTCN2018124340-appb-000004
计 算出所述隐藏层第j个节点的权重误差,所述T为所述异常实际指数,Z为异常理论指数,所述W ij为所述输入层的节点i到所述隐藏层的节点j的权重值,所述X i为所述输入层第i个节点对应的根据所述执行数据生成的特征向量的第i行数据组,所述P j为所述隐藏层第j个节点对应的偏置值;
将W ij+Err j×X i作为更新后的所述输入层的节点i到所述隐藏层的节点j的权重值;将P j+Err j作为更新后的所述隐藏层第j个节点对应的偏置值。
S1045,若所述异常实际指数与所述异常理论指数的差值不大于预设的差异阈值,则输出更新后的第一公式,作为所述神经网络模型。
在本申请实施例中,通过反复判断异常实际指数与异常理论指数的差值是否大于预设的差异阈值,实现了循环更新神经网络模型的权重值以及偏置值的目的,从而训练出了一个准确的神经网络模型。
S105,根据所述神经网络模型计算所述测试执行数据对应的异常实际指数,若所述异常实际指数大于预设的指数阈值,则判定所述主设备与所述测试设备之间存在兼容性异常。
具体地,计算测试执行数据的i维特征向量,并将该特征向量的各行数据组作为通过上文实施例计算出的神经网络模型的输入层节点对应的值,从而根据神经网络模型计算出所述测试执行数据对应的异常实际指数。
可以理解地,如果计算出的测试执行数据对应的异常实际指数大于预设的指数阈值,则证明测设设备与主设备的用户界面的差异较大,存在兼容性异常。
在本申请实施例中,通过获取测试设备生成的测试执行数据,以获取用户界面各元素在屏幕上的元素显示位置;若测试设备的用户界面存在位置异常,则判定主设备与测试设备之间存在兼容性异常;若所述测试设备的用户界面不存在位置异常,则获取多个可兼容设备根据主设备输入的预设指令生成的无兼容性异常的执行数据,并根据这些执行数据训练出神经网络模型;根据所述神经网络模型计算所述测试执行数据对应的异常实际指数,若所述异常实际指数大于预设的指数阈值,则判定所述主设备与所述测试设备之间存在兼容性异常,以快速准确地测试出测试设备与主设备之间的兼容性异常,从而提醒用户修改设备的配置,提高不同设备进行同步操作的成功率。
对应于上文实施例所述的设备兼容性的测试方法,图4示出了本申请实施例提供的设备兼容性的测试装置的结构框图,为了便于说明,仅示出了与本申请实施例相关的部分。
参照图4,该装置包括:
获取单元401,用于获取测试设备生成的测试执行数据,所述测试执行数据为测试设备 执行主设备输入的预设指令后生成的响应数据,所述测试执行数据包括用户界面各元素在屏幕上的元素显示位置;
位置判断单元402,用于根据各元素对应的所述元素显示位置,判断所述测试设备的用户界面是否存在位置异常;
第一判定单元403,用于若所述测试设备的用户界面存在位置异常,则判定所述主设备与所述测试设备之间存在兼容性异常;
计算单元404,用于若所述测试设备的用户界面不存在位置异常,则获取多个可兼容设备根据所述主设备输入的预设指令生成的无兼容性异常的执行数据,以生成兼容执行数据组,根据所述兼容执行数据组训练出神经网络模型;
第二判定单元405,用于根据所述神经网络模型计算所述测试执行数据对应的异常实际指数,若所述异常实际指数大于预设的指数阈值,则判定所述主设备与所述测试设备之间存在兼容性异常。
可选地,所述位置判断单元402包括:
显示判断子单元,用于判断两个不同的元素是否具有相同的所述元素显示位置。
关系判断子单元,用于若两个不同的元素具有相同的所述元素显示位置,则根据用户界面与其父用户界面的关联关系以及用户界面与其子用户界面的关联关系,判断具有相同的所述元素显示位置的两个元素所属的两个用户界面是否属于父子用户界面关系。
异常判定子单元,用于若具有相同的所述元素显示位置的两个元素所属的两个用户界面不属于父子用户界面关系,则判定所述测试设备的用户界面存在位置异常。
可选地,所述位置判断单元402还用于:
根据用户界面与其父用户界面的关联关系,将所述用户界面的父用户界面的所有元素的元素显示位置,组合成元素显示集合;
若所述用户界面存在一个元素的元素显示位置不在所述元素显示集合中,则判定所述测试设备的用户界面存在位置异常。
可选地,所述计算单元404包括:
设置子单元,用于设置权重初始值以及偏置初始值;
指数计算子单元,用于通过第一公式:
Figure PCTCN2018124340-appb-000005
计算异常实际指数,所述W ij为所述输入层的节点i到所述隐藏层的节点j的权重值,所述X i为所述输入层第i个节点对应的根据所述执行数据生成的特征向量的第i行数据组,所述P j为所述隐藏层第j个节点对应的偏置值;
差异判断子单元,用于判断述异常实际指数与所述异常理论指数的差值是否大于预设的差异阈值,
循环子单元,用于若所述异常实际指数与所述异常理论指数的差值大于预设的差异阈值,则更新所述权重值以及所述偏置值,并返回执行通过第一公式:
Figure PCTCN2018124340-appb-000006
计算异常实际指数,判断所述异常实际指数与所述异常理论指数的差值是否大于预设的差异阈值的操作;
输出模型子单元,用于若所述异常实际指数与所述异常理论指数的差值不大于预设的差异阈值,则输出更新后的第一公式,作为所述神经网络模型。
可选地,所述循环子单元具体用于:
通过第二公式:
Figure PCTCN2018124340-appb-000007
计算出所述隐藏层第j个节点的权重误差,所述T为所述异常实际指数,所述W ij为所述输入层的节点i到所述隐藏层的节点j的权重值,所述X i为所述输入层第i个节点对应的根据所述执行数据生成的特征向量的第i行数据组,所述P j为所述隐藏层第j个节点对应的偏置值;
将W ij+Err j×X i作为更新后的所述输入层的节点i到所述隐藏层的节点j的权重值;
将P j+Err j作为更新后的所述隐藏层第j个节点对应的偏置值。
在本申请实施例中,通过获取测试设备生成的测试执行数据,以获取用户界面各元素在屏幕上的元素显示位置;若测试设备的用户界面存在位置异常,则判定主设备与测试设备之间存在兼容性异常;若所述测试设备的用户界面不存在位置异常,则获取多个可兼容设备根据主设备输入的预设指令生成的无兼容性异常的执行数据,并根据这些执行数据训练出神经网络模型;根据所述神经网络模型计算所述测试执行数据对应的异常实际指数,若所述异常实际指数大于预设的指数阈值,则判定所述主设备与所述测试设备之间存在兼容性异常,以快速准确地测试出测试设备与主设备之间的兼容性异常,从而提醒用户修改设备的配置,提高不同设备进行同步操作的成功率。
图5是本申请一实施例提供的电子设备的示意图。如图5所示,该实施例的电子设备5包括:处理器50、存储器51以及存储在所述存储器51中并可在所述处理器50上运行的计算机可读指令52,例如设备兼容性的测试程序。所述处理器50执行所述计算机可读指令52时实现上述各个设备兼容性的测试方法实施例中的步骤,例如图1所示的步骤101至105。或者,所述处理器50执行所述计算机可读指令52时实现上述各装置实施例中各模块/单元的功能,例如图4所示单元401至405的功能。
示例性的,所述计算机可读指令52可以被分割成一个或多个模块/单元,所述一个或者多个模块/单元被存储在所述存储器51中,并由所述处理器50执行,以完成本申请。所述一个或多个模块/单元可以是能够完成特定功能的一系列计算机可读指令指令段,该指令段用于描述所述计算机可读指令52在所述电子设备5中的执行过程。
所述电子设备5可以是桌上型计算机、笔记本、掌上电脑及云端服务器等计算设备。所述电子设备可包括,但不仅限于,处理器50、存储器51。本领域技术人员可以理解,图5仅仅是电子设备5的示例,并不构成对电子设备5的限定,可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件,例如所述电子设备还可以包括输入输出设备、网络接入设备、总线等。
所称处理器50可以是中央处理单元(Central Processing Unit,CPU),还可以是其他通用处理器、数字信号处理器(Digital Signal Processor,DSP)、专用集成电路(Application Specific Integrated Circuit,ASIC)、现成可编程门阵列(Field-Programmable Gate Array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。
所述存储器51可以是所述电子设备5的内部存储单元,例如电子设备5的硬盘或内存。所述存储器51也可以是所述电子设备5的外部存储设备,例如所述电子设备5上配备的插接式硬盘,智能存储卡(Smart Media Card,SMC),安全数字(Secure Digital,SD)卡,闪存卡(Flash Card)等。进一步地,所述存储器51还可以既包括所述电子设备5的内部存储单元也包括外部存储设备。所述存储器51用于存储所述计算机可读指令以及所述电子设备所需的其他程序和数据。所述存储器51还可以用于暂时地存储已经输出或者将要输出的数据。
所述集成的模块/单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请实现上述实施例方法中的全部或部分流程,也可以通过计算机可读指令来指令相关的硬件来完成,所述的计算机可读指令可存储于一计算机非易失性可读存储介质中。
以上所述实施例仅用以说明本申请的技术方案,而非对其限制;尽管参照前述实施例对本申请进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本申请各实施例技术方案的精神和范围,均应包含在本申请的保护范围之内。

Claims (20)

  1. 一种设备兼容性的测试方法,其特征在于,包括:
    获取测试设备生成的测试执行数据,所述测试执行数据为测试设备执行主设备输入的预设指令后生成的响应数据,所述测试执行数据包括用户界面各元素在屏幕上的元素显示位置;
    根据各元素对应的所述元素显示位置,判断所述测试设备的用户界面是否存在位置异常;
    若所述测试设备的用户界面存在位置异常,则判定所述主设备与所述测试设备之间存在兼容性异常;
    若所述测试设备的用户界面不存在位置异常,则获取多个可兼容设备根据所述主设备输入的预设指令生成的无兼容性异常的执行数据,以生成兼容执行数据组,根据所述兼容执行数据组训练出神经网络模型;
    根据所述神经网络模型计算所述测试执行数据对应的异常实际指数,若所述异常实际指数大于预设的指数阈值,则判定所述主设备与所述测试设备之间存在兼容性异常。
  2. 如权利要求1所述的设备兼容性的测试方法,其特征在于,所述测试执行数据还包括用户界面与其父用户界面的关联关系以及用户界面与其子用户界面的关联关系;
    所述根据各元素对应的所述元素显示位置,判断所述测试设备的用户界面是否存在位置异常,包括:
    若两个不同的元素具有相同的所述元素显示位置,则根据用户界面与其父用户界面的关联关系以及用户界面与其子用户界面的关联关系,判断具有相同的所述元素显示位置的两个元素所属的两个用户界面是否属于父子用户界面关系;
    若具有相同的所述元素显示位置的两个元素所属的两个用户界面不属于父子用户界面关系,则判定所述测试设备的用户界面存在位置异常。
  3. 如权利要求1所述的设备兼容性的测试方法,其特征在于,所述测试执行数据还包括用户界面与其父用户界面的关联关系;
    所述根据所述元素显示位置,判断所述测试设备的用户界面是否存在位置异常,还包括:
    根据用户界面与其父用户界面的关联关系,将所述用户界面的父用户界面的所有元素的元素显示位置,组合成元素显示集合;
    若所述用户界面任意一个元素的元素显示位置不在所述元素显示集合中,则判定所述 测试设备的用户界面存在位置异常。
  4. 如权利要求1所述的设备兼容性的测试方法,其特征在于,所述兼容执行数据组包括执行数据与预设的异常理论指数的对应关系;所述神经网络包括输入层以及隐藏层,所述输入层以及隐藏层各包含多个节点;
    所述根据所述兼容执行数据组训练出神经网络模型,包括:
    设置权重初始值以及偏置初始值;
    通过第一公式:
    Figure PCTCN2018124340-appb-100001
    计算异常实际指数,所述W ij为所述输入层的节点i到所述隐藏层的节点j的权重值,所述X i为所述输入层第i个节点对应的根据所述执行数据生成的特征向量的第i行数据组,所述P j为所述隐藏层第j个节点对应的偏置值;
    判断述异常实际指数与所述异常理论指数的差值是否大于预设的差异阈值,
    若所述异常实际指数与所述异常理论指数的差值大于预设的差异阈值,则更新所述权重值以及所述偏置值,并返回执行通过第一公式:
    Figure PCTCN2018124340-appb-100002
    计算异常实际指数,判断所述异常实际指数与所述异常理论指数的差值是否大于预设的差异阈值的操作;
    若所述异常实际指数与所述异常理论指数的差值不大于预设的差异阈值,则输出更新后的第一公式,作为所述神经网络模型。
  5. 如权利要求4所述的设备兼容性的测试方法,其特征在于,所述更新所述权重值以及所述偏置值,包括:
    通过第二公式:
    Figure PCTCN2018124340-appb-100003
    计算出所述隐藏层第j个节点的权重误差,所述T为所述异常实际指数,所述W ij为所述输入层的节点i到所述隐藏层的节点j的权重值,所述X i为所述输入层第i个节点对应的根据所述执行数据生成的特征向量的第i行数据组,所述P j为所述隐藏层第j个节点对应的偏置值;
    将W ij+Err j×X i作为更新后的所述输入层的节点i到所述隐藏层的节点j的权重值;
    将P j+Err j作为更新后的所述隐藏层第j个节点对应的偏置值。
  6. 一种设备兼容性的测试装置,其特征在于,包括:
    获取单元,用于获取测试设备生成的测试执行数据,所述测试执行数据为测试设备执行主设备输入的预设指令后生成的响应数据,所述测试执行数据包括用户界面各元素在屏幕上的元素显示位置;
    位置判断单元,用于根据各元素对应的所述元素显示位置,判断所述测试设备的用户界面是否存在位置异常;
    第一判定单元,用于若所述测试设备的用户界面存在位置异常,则判定所述主设备与 所述测试设备之间存在兼容性异常;
    计算单元,用于若所述测试设备的用户界面不存在位置异常,则获取多个可兼容设备根据所述主设备输入的预设指令生成的无兼容性异常的执行数据,以生成兼容执行数据组,根据所述兼容执行数据组训练出神经网络模型;
    第二判定单元,用于根据所述神经网络模型计算所述测试执行数据对应的异常实际指数,若所述异常实际指数大于预设的指数阈值,则判定所述主设备与所述测试设备之间存在兼容性异常。
  7. 根据权利要求6所述的设备兼容性的测试装置,其特征在于,所述位置判断单元包括:
    显示判断子单元,用于判断两个不同的元素是否具有相同的所述元素显示位置。
    关系判断子单元,用于若两个不同的元素具有相同的所述元素显示位置,则根据用户界面与其父用户界面的关联关系以及用户界面与其子用户界面的关联关系,判断具有相同的所述元素显示位置的两个元素所属的两个用户界面是否属于父子用户界面关系。
    异常判定子单元,用于若具有相同的所述元素显示位置的两个元素所属的两个用户界面不属于父子用户界面关系,则判定所述测试设备的用户界面存在位置异常。
  8. 根据权利要求6所述的设备兼容性的测试装置,其特征在于,所述位置判断单元还用于:
    根据用户界面与其父用户界面的关联关系,将所述用户界面的父用户界面的所有元素的元素显示位置,组合成元素显示集合;若所述用户界面存在一个元素的元素显示位置不在所述元素显示集合中,则判定所述测试设备的用户界面存在位置异常。
  9. 根据权利要求6所述的设备兼容性的测试装置,其特征在于,所述计算单元包括:
    设置子单元,用于设置权重初始值以及偏置初始值;
    指数计算子单元,用于通过第一公式:
    Figure PCTCN2018124340-appb-100004
    计算异常实际指数,所述W ij为所述输入层的节点i到所述隐藏层的节点j的权重值,所述X i为所述输入层第i个节点对应的根据所述执行数据生成的特征向量的第i行数据组,所述P j为所述隐藏层第j个节点对应的偏置值;
    差异判断子单元,用于判断述异常实际指数与所述异常理论指数的差值是否大于预设的差异阈值,
    循环子单元,用于若所述异常实际指数与所述异常理论指数的差值大于预设的差异阈值,则更新所述权重值以及所述偏置值,并返回执行通过第一公式:
    Figure PCTCN2018124340-appb-100005
    计 算异常实际指数,判断所述异常实际指数与所述异常理论指数的差值是否大于预设的差异阈值的操作;
    输出模型子单元,用于若所述异常实际指数与所述异常理论指数的差值不大于预设的差异阈值,则输出更新后的第一公式,作为所述神经网络模型。
  10. 根据权利要求9所述的设备兼容性的测试装置,其特征在于,所述循环子单元具体用于:通过第二公式:
    Figure PCTCN2018124340-appb-100006
    计算出所述隐藏层第j个节点的权重误差,所述T为所述异常实际指数,所述W ij为所述输入层的节点i到所述隐藏层的节点j的权重值,所述X i为所述输入层第i个节点对应的根据所述执行数据生成的特征向量的第i行数据组,所述P j为所述隐藏层第j个节点对应的偏置值;将W ij+Err j×X i作为更新后的所述输入层的节点i到所述隐藏层的节点j的权重值;将P j+Err j作为更新后的所述隐藏层第j个节点对应的偏置值。
  11. 一种电子设备,其特征在于,包括存储器以及处理器,所述存储器中存储有可在所述处理器上运行的计算机可读指令,所述处理器执行所述计算机可读指令时实现如下步骤:
    获取测试设备生成的测试执行数据,所述测试执行数据为测试设备执行主设备输入的预设指令后生成的响应数据,所述测试执行数据包括用户界面各元素在屏幕上的元素显示位置;根据各元素对应的所述元素显示位置,判断所述测试设备的用户界面是否存在位置异常;若所述测试设备的用户界面存在位置异常,则判定所述主设备与所述测试设备之间存在兼容性异常;若所述测试设备的用户界面不存在位置异常,则获取多个可兼容设备根据所述主设备输入的预设指令生成的无兼容性异常的执行数据,以生成兼容执行数据组,根据所述兼容执行数据组训练出神经网络模型;根据所述神经网络模型计算所述测试执行数据对应的异常实际指数,若所述异常实际指数大于预设的指数阈值,则判定所述主设备与所述测试设备之间存在兼容性异常。
  12. 根据权利要求11所述的电子设备,其特征在于,所述测试执行数据还包括用户界面与其父用户界面的关联关系以及用户界面与其子用户界面的关联关系;
    所述根据各元素对应的所述元素显示位置,判断所述测试设备的用户界面是否存在位置异常,包括:若两个不同的元素具有相同的所述元素显示位置,则根据用户界面与其父用户界面的关联关系以及用户界面与其子用户界面的关联关系,判断具有相同的所述元素显示位置的两个元素所属的两个用户界面是否属于父子用户界面关系;若具有相同的所述元素显示位置的两个元素所属的两个用户界面不属于父子用户界面关系,则判定所述测试设备的用 户界面存在位置异常。
  13. 根据权利要求11所述的电子设备,其特征在于,所述测试执行数据还包括用户界面与其父用户界面的关联关系;所述根据所述元素显示位置,判断所述测试设备的用户界面是否存在位置异常,还包括:根据用户界面与其父用户界面的关联关系,将所述用户界面的父用户界面的所有元素的元素显示位置,组合成元素显示集合;若所述用户界面任意一个元素的元素显示位置不在所述元素显示集合中,则判定所述测试设备的用户界面存在位置异常。
  14. 根据权利要求11所述的电子设备,其特征在于,所述兼容执行数据组包括执行数据与预设的异常理论指数的对应关系;所述神经网络包括输入层以及隐藏层,所述输入层以及隐藏层各包含多个节点;
    所述根据所述兼容执行数据组训练出神经网络模型,包括:
    设置权重初始值以及偏置初始值;
    通过第一公式:
    Figure PCTCN2018124340-appb-100007
    计算异常实际指数,所述W ij为所述输入层的节点i到所述隐藏层的节点j的权重值,所述X i为所述输入层第i个节点对应的根据所述执行数据生成的特征向量的第i行数据组,所述P j为所述隐藏层第j个节点对应的偏置值;
    判断述异常实际指数与所述异常理论指数的差值是否大于预设的差异阈值,
    若所述异常实际指数与所述异常理论指数的差值大于预设的差异阈值,则更新所述权重值以及所述偏置值,并返回执行通过第一公式:
    Figure PCTCN2018124340-appb-100008
    计算异常实际指数,判断所述异常实际指数与所述异常理论指数的差值是否大于预设的差异阈值的操作;
    若所述异常实际指数与所述异常理论指数的差值不大于预设的差异阈值,则输出更新后的第一公式,作为所述神经网络模型。
  15. 根据权利要求14所述的电子设备,其特征在于,所述更新所述权重值以及所述偏置值,包括:
    通过第二公式:
    Figure PCTCN2018124340-appb-100009
    计算出所述隐藏层第j个节点的权重误差,所述T为所述异常实际指数,所述W ij为所述输入层的节点i到所述隐藏层的节点j的权重值,所述X i为所述输入层第i个节点对应的根据所述执行数据生成的特征向量的第i行数据组,所述P j为所述隐藏层第j个节点对应的偏置值;
    将W ij+Err j×X i作为更新后的所述输入层的节点i到所述隐藏层的节点j的权重值;
    将P j+Err j作为更新后的所述隐藏层第j个节点对应的偏置值。
  16. 一种计算机非易失性可读存储介质,所述计算机非易失性可读存储介质存储有计 算机可读指令,其特征在于,所述计算机可读指令被至少一个处理器执行时实现如下步骤:
    获取测试设备生成的测试执行数据,所述测试执行数据为测试设备执行主设备输入的预设指令后生成的响应数据,所述测试执行数据包括用户界面各元素在屏幕上的元素显示位置;根据各元素对应的所述元素显示位置,判断所述测试设备的用户界面是否存在位置异常;若所述测试设备的用户界面存在位置异常,则判定所述主设备与所述测试设备之间存在兼容性异常;若所述测试设备的用户界面不存在位置异常,则获取多个可兼容设备根据所述主设备输入的预设指令生成的无兼容性异常的执行数据,以生成兼容执行数据组,根据所述兼容执行数据组训练出神经网络模型;根据所述神经网络模型计算所述测试执行数据对应的异常实际指数,若所述异常实际指数大于预设的指数阈值,则判定所述主设备与所述测试设备之间存在兼容性异常。
  17. 如权利要求16所述的计算机非易失性可读存储介质,其特征在于,所述测试执行数据还包括用户界面与其父用户界面的关联关系以及用户界面与其子用户界面的关联关系;所述根据各元素对应的所述元素显示位置,判断所述测试设备的用户界面是否存在位置异常,包括:
    若两个不同的元素具有相同的所述元素显示位置,则根据用户界面与其父用户界面的关联关系以及用户界面与其子用户界面的关联关系,判断具有相同的所述元素显示位置的两个元素所属的两个用户界面是否属于父子用户界面关系;若具有相同的所述元素显示位置的两个元素所属的两个用户界面不属于父子用户界面关系,则判定所述测试设备的用户界面存在位置异常。
  18. 如权利要求16所述的计算机非易失性可读存储介质,其特征在于,所述测试执行数据还包括用户界面与其父用户界面的关联关系;
    所述根据所述元素显示位置,判断所述测试设备的用户界面是否存在位置异常,还包括:根据用户界面与其父用户界面的关联关系,将所述用户界面的父用户界面的所有元素的元素显示位置,组合成元素显示集合;若所述用户界面任意一个元素的元素显示位置不在所述元素显示集合中,则判定所述测试设备的用户界面存在位置异常。
  19. 如权利要求16所述的计算机非易失性可读存储介质,其特征在于,所述兼容执行数据组包括执行数据与预设的异常理论指数的对应关系;所述神经网络包括输入层以及隐藏层,所述输入层以及隐藏层各包含多个节点;
    所述根据所述兼容执行数据组训练出神经网络模型,包括:
    设置权重初始值以及偏置初始值;
    通过第一公式:
    Figure PCTCN2018124340-appb-100010
    计算异常实际指数,所述W ij为所述输入层的节点i到所述隐藏层的节点j的权重值,所述X i为所述输入层第i个节点对应的根据所述执行数据生成的特征向量的第i行数据组,所述P j为所述隐藏层第j个节点对应的偏置值;
    判断述异常实际指数与所述异常理论指数的差值是否大于预设的差异阈值,
    若所述异常实际指数与所述异常理论指数的差值大于预设的差异阈值,则更新所述权重值以及所述偏置值,并返回执行通过第一公式:
    Figure PCTCN2018124340-appb-100011
    计算异常实际指数,判断所述异常实际指数与所述异常理论指数的差值是否大于预设的差异阈值的操作;
    若所述异常实际指数与所述异常理论指数的差值不大于预设的差异阈值,则输出更新后的第一公式,作为所述神经网络模型。
  20. 如权利要求19所述的计算机非易失性可读存储介质,其特征在于,所述更新所述权重值以及所述偏置值,包括:
    通过第二公式:
    Figure PCTCN2018124340-appb-100012
    计算出所述隐藏层第j个节点的权重误差,所述T为所述异常实际指数,所述W ij为所述输入层的节点i到所述隐藏层的节点j的权重值,所述X i为所述输入层第i个节点对应的根据所述执行数据生成的特征向量的第i行数据组,所述P j为所述隐藏层第j个节点对应的偏置值;
    将W ij+Err j×X i作为更新后的所述输入层的节点i到所述隐藏层的节点j的权重值;
    将P j+Err j作为更新后的所述隐藏层第j个节点对应的偏置值。
PCT/CN2018/124340 2018-01-02 2018-12-27 设备兼容性的测试方法、装置、电子设备及介质 WO2019134578A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201810001746.2 2018-01-02
CN201810001746.2A CN108304318B (zh) 2018-01-02 2018-01-02 设备兼容性的测试方法及终端设备

Publications (1)

Publication Number Publication Date
WO2019134578A1 true WO2019134578A1 (zh) 2019-07-11

Family

ID=62868204

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2018/124340 WO2019134578A1 (zh) 2018-01-02 2018-12-27 设备兼容性的测试方法、装置、电子设备及介质

Country Status (2)

Country Link
CN (1) CN108304318B (zh)
WO (1) WO2019134578A1 (zh)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108304318B (zh) * 2018-01-02 2020-12-04 深圳壹账通智能科技有限公司 设备兼容性的测试方法及终端设备
CN109587013B (zh) * 2019-01-18 2022-08-19 深圳壹账通智能科技有限公司 App网络兼容性测试方法、装置、计算机设备及存储介质
CN110321257A (zh) * 2019-05-22 2019-10-11 深圳壹账通智能科技有限公司 异形屏兼容性测试方法、装置、计算机设备和存储介质
CN111198815B (zh) * 2019-12-24 2023-11-03 中移(杭州)信息技术有限公司 用户界面的兼容性测试方法及装置
CN111752870B (zh) * 2020-05-28 2022-02-22 苏州浪潮智能科技有限公司 一种基于神经网络的服务器接口的兼容方法及系统

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20130212461A1 (en) * 2012-02-13 2013-08-15 Accenture Global Services Limited Browser and operating system compatibility
CN104156309A (zh) * 2014-07-29 2014-11-19 深圳市腾讯计算机系统有限公司 终端应用的兼容性检测方法、装置及服务器
CN104636251A (zh) * 2014-12-30 2015-05-20 安科智慧城市技术(中国)有限公司 一种多浏览器兼容性测试方法及系统
CN107315682A (zh) * 2017-06-22 2017-11-03 北京凤凰理理它信息技术有限公司 测试浏览器兼容方法、装置、存储介质及电子设备
CN108304318A (zh) * 2018-01-02 2018-07-20 深圳壹账通智能科技有限公司 设备兼容性的测试方法及终端设备

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20150205882A1 (en) * 2007-03-19 2015-07-23 Dean Vukas Testing accessibility and compatibility of websites and web-based software
CN102981954B (zh) * 2012-11-28 2018-03-02 百度国际科技(深圳)有限公司 一种输入法的兼容性测试方法及电子装置
CN104424093A (zh) * 2013-08-26 2015-03-18 阿里巴巴集团控股有限公司 一种兼容性测试方法及系统
CN105843743B (zh) * 2016-04-11 2018-10-02 南京邮电大学 一种特殊自动化测试用例实际输出结果正确性的验证方法
CN106649805B (zh) * 2016-12-29 2020-02-11 中国科学院软件研究所 一种高效的Web应用跨浏览器布局兼容性检测系统及方法
CN107357726A (zh) * 2017-07-04 2017-11-17 广州云测信息技术有限公司 一种应用程序兼容性测试方法和装置

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20130212461A1 (en) * 2012-02-13 2013-08-15 Accenture Global Services Limited Browser and operating system compatibility
CN104156309A (zh) * 2014-07-29 2014-11-19 深圳市腾讯计算机系统有限公司 终端应用的兼容性检测方法、装置及服务器
CN104636251A (zh) * 2014-12-30 2015-05-20 安科智慧城市技术(中国)有限公司 一种多浏览器兼容性测试方法及系统
CN107315682A (zh) * 2017-06-22 2017-11-03 北京凤凰理理它信息技术有限公司 测试浏览器兼容方法、装置、存储介质及电子设备
CN108304318A (zh) * 2018-01-02 2018-07-20 深圳壹账通智能科技有限公司 设备兼容性的测试方法及终端设备

Also Published As

Publication number Publication date
CN108304318B (zh) 2020-12-04
CN108304318A (zh) 2018-07-20

Similar Documents

Publication Publication Date Title
WO2019134578A1 (zh) 设备兼容性的测试方法、装置、电子设备及介质
US8549478B2 (en) Graphical user interface input element identification
AU2020237195B2 (en) Distributed system generating rule compiler engine apparatuses, methods, systems and media
US9767001B2 (en) Method and apparatus for producing regulatory-compliant software
US11216342B2 (en) Methods for improved auditing of web sites and devices thereof
US9842139B1 (en) Metadata-driven program code generation for clinical data analysis
WO2019056494A1 (zh) 图表生成方法、装置、计算机设备和存储介质
US10868741B2 (en) Anchor shortening across streaming nodes
US11347864B2 (en) Ace: assurance, composed and explained
US10204187B1 (en) Method and system for implementing data reduction for waveform data
CN109213465B (zh) 一种用于教育操作系统的多显示器标识方法及系统
WO2019090691A1 (zh) Monkey测试方法及终端
US20150135159A1 (en) Event Based Code Generation
CN109324967A (zh) 应用程序弹窗控件测试的方法、装置及终端设备
CA2965283C (en) Systems and methods of subject state change notification
US20180126654A1 (en) Multi-part counting system for three-dimensional printed parts
WO2018205392A1 (zh) 控制响应区域显示控制方法、电子装置及存储介质
US20130346055A1 (en) Modeling and cooperative simulation of systems with interdependent discrete and continuous elements
WO2020250320A1 (ja) 操作ログ取得装置、操作ログ取得方法および操作ログ取得プログラム
US11698849B2 (en) Automated application testing of mutable interfaces
US11281890B2 (en) Method, system, and computer-readable media for image correction via facial ratio
US20200310791A1 (en) Error checking of notebook code blocks
CN111553375A (zh) 使用变换以验证计算机视觉质量
US11257264B2 (en) Maintaining data transformation graphs
US11812153B2 (en) Systems and methods for fisheye camera calibration and bird's-eye-view image generation in a simulation environment

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 18898570

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 11.11.2020)

122 Ep: pct application non-entry in european phase

Ref document number: 18898570

Country of ref document: EP

Kind code of ref document: A1