CN111221734B - Verification method and device for graphic interface and computer storage medium - Google Patents

Verification method and device for graphic interface and computer storage medium Download PDF

Info

Publication number
CN111221734B
CN111221734B CN202010016488.2A CN202010016488A CN111221734B CN 111221734 B CN111221734 B CN 111221734B CN 202010016488 A CN202010016488 A CN 202010016488A CN 111221734 B CN111221734 B CN 111221734B
Authority
CN
China
Prior art keywords
verified
graphics
verification
graphic
api
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.)
Active
Application number
CN202010016488.2A
Other languages
Chinese (zh)
Other versions
CN111221734A (en
Inventor
马栋
张斌
刘微
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Xintong Semiconductor Technology (Xiamen) Co.,Ltd.
Original Assignee
Xi'an Xintong Semiconductor Technology Co ltd
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 Xi'an Xintong Semiconductor Technology Co ltd filed Critical Xi'an Xintong Semiconductor Technology Co ltd
Priority to CN202010016488.2A priority Critical patent/CN111221734B/en
Publication of CN111221734A publication Critical patent/CN111221734A/en
Application granted granted Critical
Publication of CN111221734B publication Critical patent/CN111221734B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Prevention of errors by analysis, debugging or testing of software
    • G06F11/3668Testing of software
    • G06F11/3672Test management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Prevention of errors by analysis, debugging or testing of software
    • G06F11/3668Testing of software
    • G06F11/3672Test management
    • G06F11/3688Test management for test execution, e.g. scheduling of test suites
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Image Generation (AREA)

Abstract

本发明实施例公开了一种图形接口的验证方法、装置及计算机存储介质;所述方法包括:根据输出数据类型将待验证图形应用程序接口API进行分类,获得所述待验证图形API对应的类型;基于预设的验证用例与输出数据类型之间的映射关系,根据所述待验证图形API对应的类型确定为验证所述待验证图形API所使用的验证用例;根据被确认的验证用例对所述待验证图形API进行验证。

Embodiments of the present invention disclose a verification method, device and computer storage medium for a graphical interface; the method includes: classifying the graphical application program interface API to be verified according to the output data type, and obtaining the type corresponding to the graphical API to be verified. ; Based on the mapping relationship between the preset verification use case and the output data type, the verification use case used to verify the graphics API to be verified is determined according to the type corresponding to the graphics API to be verified; based on the confirmed verification use case, the verification use case is Describe the graphics API to be verified for verification.

Description

一种图形接口的验证方法、装置及计算机存储介质A graphical interface verification method, device and computer storage medium

技术领域Technical field

本发明实施例涉及计算机图形技术领域,尤其涉及一种图形接口的验证方法、装置及计算机存储介质。Embodiments of the present invention relate to the field of computer graphics technology, and in particular, to a verification method, device and computer storage medium for a graphical interface.

背景技术Background technique

在GPU软件设计过程中,需要对图形标准的应用程序接口(API,ApplicationProgramming Interface),如开放图形库(OpenGL,Open Graphics Library)、Direct3D等进行全面的功能验证。而图形标准中所提供的API数量较多,举例来说,OpenGL4.5版本所包含的API数量接近1000条,同时每个API的参数数量也较多,甚至某些API的参数数量超过百余个,结合参数数量和API数量后的总数量会更多,因此,以OpenGL为例,针对其API的功能验证就需要很大量的测试用例来进行覆盖,从而增加了全面验证的难度并且在用例结果的判断和验证中极大地增加计算量。During the GPU software design process, comprehensive functional verification of graphics standard application programming interfaces (APIs, Application Programming Interfaces), such as OpenGL (Open Graphics Library), Direct3D, etc., is required. The graphics standard provides a large number of APIs. For example, the OpenGL 4.5 version contains nearly 1,000 APIs. At the same time, each API has a large number of parameters, and some APIs even have more than a hundred parameters. , the total number will be more after combining the number of parameters and the number of APIs. Therefore, taking OpenGL as an example, functional verification of its API requires a large number of test cases to cover, thus increasing the difficulty of comprehensive verification and increasing the number of use cases. The amount of calculation is greatly increased in the judgment and verification of results.

发明内容Contents of the invention

有鉴于此,本发明实施例期望提供一种图形接口的验证方法、装置及计算机存储介质;能够在保证验证全面性的同时,减少验证框架的负载和运算量,缩短运行时间,实现高效快速的全面验证。In view of this, embodiments of the present invention are expected to provide a graphical interface verification method, device and computer storage medium; while ensuring the comprehensiveness of verification, it can reduce the load and calculation amount of the verification framework, shorten the running time, and achieve efficient and fast Fully verified.

本发明实施例的技术方案是这样实现的:The technical solution of the embodiment of the present invention is implemented as follows:

第一方面,本发明实施例提供了一种图形接口的验证方法,所述方法包括:In a first aspect, an embodiment of the present invention provides a method for verifying a graphical interface. The method includes:

根据输出数据类型将待验证图形应用程序接口API进行分类,获得所述待验证图形API对应的类型;Classify the graphics application program interface API to be verified according to the output data type, and obtain the type corresponding to the graphics API to be verified;

基于预设的验证用例与输出数据类型之间的映射关系,根据所述待验证图形API对应的类型确定为验证所述待验证图形API所使用的验证用例;Based on the mapping relationship between the preset verification use case and the output data type, determine the verification use case used to verify the graphics API to be verified according to the type corresponding to the graphics API to be verified;

根据被确认的验证用例对所述待验证图形API进行验证。Verify the graphics API to be verified according to the confirmed verification use case.

第二方面,本发明实施例提供了一种图形接口的验证装置,所述装置包括:分类部分、映射部分、验证部分;其中,In a second aspect, embodiments of the present invention provide a graphical interface verification device, which device includes: a classification part, a mapping part, and a verification part; wherein,

所述分类部分,经配置为根据输出数据类型将待验证图形应用程序接口API进行分类,获得所述待验证图形API对应的类型;The classification part is configured to classify the graphics application program interface API to be verified according to the output data type, and obtain the type corresponding to the graphics API to be verified;

所述映射部分,经配置为基于预设的验证用例与输出数据类型之间的映射关系,根据所述待验证图形API对应的类型确定为验证所述待验证图形API所使用的验证用例;The mapping part is configured to determine the verification use case used to verify the graphics API to be verified based on the mapping relationship between the preset verification use case and the output data type according to the type corresponding to the graphics API to be verified;

所述验证部分,经配置为根据被确认的验证用例对所述待验证图形API进行验证。The verification part is configured to verify the graphics API to be verified according to the confirmed verification use case.

第三方面,本发明实施例提供了一种计算设备,其特征在于,所述计算设备包括:通信接口,存储器和处理器;各个组件通过总线系统耦合在一起;In a third aspect, embodiments of the present invention provide a computing device, characterized in that the computing device includes: a communication interface, a memory and a processor; each component is coupled together through a bus system;

所述通信接口,用于在与其他外部网元之间进行收发信息过程中,信号的接收和发送;The communication interface is used for receiving and sending signals during the process of sending and receiving information with other external network elements;

所述存储器,用于存储能够在所述处理器上运行的计算机程序;The memory is used to store computer programs capable of running on the processor;

所述处理器,用于在运行所述计算机程序时,执行第一方面所述图形接口的验证方法步骤。The processor is configured to execute the verification method steps of the graphical interface described in the first aspect when running the computer program.

第四方面,本发明实施例提供了一种计算机存储介质,其特征在于,所述计算机存储介质存储有图形接口的验证程序,所述图形接口的验证程序被至少一个处理器执行时实现第一方面所述图形接口的验证方法步骤。In a fourth aspect, embodiments of the present invention provide a computer storage medium, characterized in that the computer storage medium stores a verification program of a graphical interface, and when the verification program of the graphical interface is executed by at least one processor, the first The verification method steps of the graphical interface described in the aspect.

本发明实施例提供了一种图形接口的验证方法、装置及计算机存储介质;针对待验证图形API的输出数据类型进行分类,并对应于该分类而确定与之对应的验证用例进行验证。相比于目前常规的针对图形API的验证方式,无需构建完整的计算模型就能够完成功能验证,如此当后续图形标准版本更新后,也仅需针对各类型对应的验证用例进行修改就能够完全匹配更新后的图形标准版本,降低修改关联度,提升迭代速度。此外,也无需针对所有待验证图形API均使用golden模型进行全面比对,降低了验证过程中所耗费的运算量和运算时长,提高了验证效率。Embodiments of the present invention provide a graphical interface verification method, device and computer storage medium; classify the output data types of the graphical API to be verified, and determine corresponding verification use cases corresponding to the classification for verification. Compared with the current conventional verification method for graphics API, functional verification can be completed without building a complete computing model. In this way, when the subsequent graphics standard version is updated, only modifications to the corresponding verification use cases of each type can be fully matched. The updated graphics standard version reduces modification correlation and improves iteration speed. In addition, there is no need to use the golden model for comprehensive comparison of all graphics APIs to be verified, which reduces the amount of calculations and time spent in the verification process and improves verification efficiency.

附图说明Description of drawings

图1为本发明实施例提供的一种图形接口的验证方法流程示意图;Figure 1 is a schematic flow chart of a verification method for a graphical interface provided by an embodiment of the present invention;

图2为本发明实施例提供的验证用例分类示意图;Figure 2 is a schematic diagram of verification use case classification provided by the embodiment of the present invention;

图3为本发明实施例提供的少像素的基本绘制类型的验证流程示意图;Figure 3 is a schematic diagram of the verification process of a basic drawing type with few pixels provided by an embodiment of the present invention;

图4为本发明实施例提供的通过压缩编码进行验证的流程示意图;Figure 4 is a schematic flow chart of verification through compression coding provided by an embodiment of the present invention;

图5为本发明实施例提供的粗粒度验证示意图;Figure 5 is a schematic diagram of coarse-grained verification provided by an embodiment of the present invention;

图6为本发明实施例提供的细粒度验证示意图;Figure 6 is a schematic diagram of fine-grained verification provided by an embodiment of the present invention;

图7为本发明实施例提供的一种图形接口的验证装置组成示意图;Figure 7 is a schematic diagram of the composition of a verification device for a graphical interface provided by an embodiment of the present invention;

图8为本发明实施例提供的一种计算设备的具体硬件结构示意图。Figure 8 is a schematic diagram of a specific hardware structure of a computing device provided by an embodiment of the present invention.

具体实施方式Detailed ways

下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述。The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention.

图形标准的应用程序接口以OpenGL为例,目前针对其进行功能验证的方案可以包括两类方案:The graphics standard application program interface takes OpenGL as an example. The current functional verification solutions for it can include two types of solutions:

其一,通过模型进行计算,举例来说,首先按照图形标准实现一个软件渲染的计算模型;随后将应用程序的顶点、属性和状态作为输入,通过实现的计算模型运算以得到期望结果。这种方案对复杂的渲染应用程序来说,顶点数目和属性状态多,软件渲染的计算模型中需要处理的流程很多,导致运算时间长;其次,软件渲染的计算模型本身设计的算法处理和模块众多,计算模型本身的正确性仍旧需要进行全面验证,而计算模型的正确性很难保证;最后,如果图形标准版本出现更新,比如添加了新的特性,那么就需要重新对计算模型进行构建,修改过程中关联性大,影响迭代速度。First, calculation is performed through the model. For example, a software rendering calculation model is first implemented according to graphics standards; then the vertices, attributes, and states of the application are used as input, and the implemented calculation model is operated to obtain the desired results. For complex rendering applications, this solution has a large number of vertices and attribute states, and there are many processes that need to be processed in the calculation model of software rendering, resulting in a long calculation time; secondly, the algorithm processing and modules designed by the calculation model of software rendering itself Many, the correctness of the calculation model itself still needs to be fully verified, and the correctness of the calculation model is difficult to guarantee; finally, if the graphics standard version is updated, such as adding new features, then the calculation model needs to be rebuilt. The correlation during the modification process is large, which affects the iteration speed.

其二,通过golden模型进行全面对比,举例来说,预先存储一对于应正确处理结果的图形模型,即golden模型,随后将验证过程中所生成的图形与golden模型进行比较,通过差值以确定被验证对象的正确性。但是由于图形标准的API和参数组合众多,导致造成生成的图形数量多,所有图形都需要进行逐像素进行对比,从而造成运算量非常大,运算时间长,效率低下的情况。Second, conduct a comprehensive comparison through the golden model. For example, pre-store a pair of graphical models that should correctly process the results, that is, the golden model. Then compare the graphics generated during the verification process with the golden model, and determine the difference through the difference. The correctness of the object being verified. However, due to the numerous APIs and parameter combinations of graphics standards, a large number of generated graphics are generated, and all graphics need to be compared pixel by pixel, resulting in a very large amount of calculation, long calculation time, and low efficiency.

基于常规验证方案的缺陷,本发明实施例期望能够提供一种图形接口的验证方法、装置及计算机存储介质;能够在保证验证全面性的同时,减少验证框架的负载和运算量,缩短运行时间,实现高效快速的全面验证。基于此,参见图1,其示出了本发明实施例提供的一种图形接口的验证方法,该方法可以包括:Based on the shortcomings of conventional verification schemes, the embodiments of the present invention are expected to provide a graphical interface verification method, device and computer storage medium; while ensuring the comprehensiveness of verification, the load and calculation volume of the verification framework can be reduced, and the running time can be shortened. Achieve efficient and fast comprehensive verification. Based on this, refer to Figure 1, which shows a graphical interface verification method provided by an embodiment of the present invention. The method may include:

S101:根据输出数据类型将待验证图形API进行分类,获得所述待验证图形接口对应的类型;S101: Classify the graphics API to be verified according to the output data type, and obtain the type corresponding to the graphics interface to be verified;

S102:基于预设的验证用例与输出数据类型之间的映射关系,根据所述待验证图形API对应的类型确定为验证所述待验证图形API所使用的验证用例;S102: Based on the mapping relationship between the preset verification use case and the output data type, determine the verification use case used to verify the graphics API to be verified according to the type corresponding to the graphics API to be verified;

S103:根据被确认的验证用例对所述待验证图形API进行验证。S103: Verify the graphics API to be verified according to the confirmed verification use case.

可以理解地,通过图1所述的技术方案,针对待验证图形API的输出数据类型进行分类,并对应于该分类而确定与之对应的验证用例进行验证。相比于目前常规的针对图形API的验证方式,无需构建完整的计算模型就能够完成功能验证,如此当后续图形标准版本更新后,也仅需针对各类型对应的验证用例进行修改就能够完全匹配更新后的图形标准版本,降低修改关联度,提升迭代速度。此外,也无需针对所有待验证图形API均使用golden模型进行全面比对,降低了验证过程中所耗费的运算量和运算时长,提高了验证效率。It can be understood that through the technical solution described in Figure 1, the output data type of the graphics API to be verified is classified, and corresponding verification use cases are determined corresponding to the classification for verification. Compared with the current conventional verification method for graphics API, functional verification can be completed without building a complete computing model. In this way, when the subsequent graphics standard version is updated, only modifications to the corresponding verification use cases of each type can be fully matched. The updated graphics standard version reduces modification correlation and improves iteration speed. In addition, there is no need to use the golden model for comprehensive comparison of all graphics APIs to be verified, which reduces the amount of calculations and time spent in the verification process and improves verification efficiency.

对于图1所示的技术方案,在一些示例中,所述待验证图形API的输出数据类型可以包括:状态信息类型、少像素的基本绘制类型以及多像素的图形渲染类型;相应于以上输出数据类型,参见图2,验证用例可以包括:状态信息类用例、少像素基本绘制类用例以及多像素图形渲染类用例。For the technical solution shown in Figure 1, in some examples, the output data types of the graphics API to be verified may include: status information type, basic drawing type with few pixels, and graphics rendering type with multiple pixels; corresponding to the above output data Type, see Figure 2. Verification use cases can include: status information use cases, few-pixel basic drawing use cases, and multi-pixel graphics rendering use cases.

需要说明的是,在本发明实施例中,以上输出数据类型的分类依据优选为待验证图形API所输出数据的数据量来确定。举例来说,若待验证图形API所输出的数据为状态信息这类数据量极小的文本内容或者像素较少的绘制结果内容,采用前述常规的验证方案中所描述的构造计算模型或者golden模型全面比对方案,会造成大量的计算资源浪费,降低了验证效率。It should be noted that, in the embodiment of the present invention, the classification basis of the above output data types is preferably determined by the data amount of the data output by the graphics API to be verified. For example, if the data output by the graphics API to be verified is text content with a very small amount of data such as status information or drawing result content with fewer pixels, use the structural calculation model or golden model described in the aforementioned conventional verification scheme. A comprehensive comparison scheme will waste a lot of computing resources and reduce verification efficiency.

在一些示例中,相应于输出数据类型为状态信息类型,所述根据被确认的验证用例对所述待验证图形API进行验证,包括:In some examples, corresponding to the output data type being the status information type, the verification of the graphics API to be verified based on the confirmed verification use case includes:

将所述待验证图形API的输出文本与标准的输出文本结果进行比较,根据比较结果确认所述待验证图形API的验证结果。Compare the output text of the graphics API to be verified with the standard output text result, and confirm the verification result of the graphics API to be verified based on the comparison result.

举例来说,当待验证图形API的输出数据为诸如状态信息等文本类型数据,则可以基于待验证图形API的运行结果所输出的文本内容与标准的输出文本结果进行比较,若两者一致,则说明输出数据类型为状态信息类型的待验证图形API的功能验证通过;若两者不一致,则说明输出数据类型为状态信息类型的待验证图形API的功能验证没有通过,需要对其进行进一步的修改。For example, when the output data of the graphics API to be verified is text type data such as status information, the text content output based on the running result of the graphics API to be verified can be compared with the standard output text result. If the two are consistent, It means that the function verification of the graphics API to be verified whose output data type is the status information type has passed; if the two are inconsistent, it means that the function verification of the graphics API to be verified whose output data type is the status information type has not passed and further verification is required. Revise.

在一些示例中,参见图3,相应于输出数据类型为少像素的基本绘制类型,所述根据被确认的验证用例对所述待验证图形API进行验证,包括:In some examples, referring to Figure 3, corresponding to the basic drawing type where the output data type is a few pixels, the graphics API to be verified is verified according to the confirmed verification use case, including:

S301:基于渲染用例模型对输入的采样顶点及采样顶点属性进行计算,获得所述待验证图形API的理论渲染结果;S301: Calculate the input sampling vertices and sampling vertex attributes based on the rendering use case model, and obtain the theoretical rendering results of the graphics API to be verified;

S302:对输入的采样顶点及采样顶点属性通过所述待验证图形API进行处理,获得实际渲染结果;S302: Process the input sampling vertices and sampling vertex attributes through the graphics API to be verified to obtain actual rendering results;

S303:将所述理论渲染结果以及所述实际渲染结果进行比较,根据比较结果确认所述待验证图形API的验证结果。S303: Compare the theoretical rendering result and the actual rendering result, and confirm the verification result of the graphics API to be verified based on the comparison result.

举例来说,本示例中所采用的渲染用例模型并非前述常规方案中所描述的针对完整图形处理所设置的软件渲染计算模型,而是仅针对待验证图形API进行验证所简化的软件渲染计算模型。在图形渲染管线中,针对采样顶点以及采样顶点属性通过待验证图形API进行处理所得到的实际渲染结果可以通过变换反馈(transform feedback)等方式进行缓存。在具体比较时,可以将理论渲染结果的像素值和实际渲染结果的像素值进行对比,根据对比的一致性以确认输出数据类型为少像素的基本绘制类型的待验证图形API的功能验证是否通过。For example, the rendering use case model used in this example is not the software rendering calculation model set up for complete graphics processing as described in the aforementioned conventional solution, but a simplified software rendering calculation model that is only verified for the graphics API to be verified. . In the graphics rendering pipeline, the actual rendering results obtained by processing the sampled vertices and sampled vertex attributes through the graphics API to be verified can be cached through methods such as transform feedback. During the specific comparison, you can compare the pixel values of the theoretical rendering results with the pixel values of the actual rendering results. Based on the consistency of the comparison, you can confirm whether the function verification of the graphics API to be verified for the basic drawing type with few pixels as the output data type has passed. .

在一些示例中,相应于输出数据类型为多像素的图形渲染类型,所述根据被确认的验证用例对所述待验证图形API进行验证,包括:In some examples, corresponding to the output data type being a multi-pixel graphics rendering type, the verification of the graphics API to be verified based on the confirmed verification use case includes:

基于设定的分层判定策略对所述待验证图形API进行不同粒度验证。Verify the graphics API to be verified at different granularities based on the set hierarchical determination strategy.

在一些示例中,参见图4,所述基于设定的分层判定策略对所述待验证图形API进行不同粒度验证,包括:In some examples, referring to Figure 4, the graphics API to be verified is verified at different granularities based on the set hierarchical determination strategy, including:

S41:将通过所述待验证图形API渲染所得到的待验证图形以及设定的golden图形均按照相同的压缩编码方式进行编码,获得待验证图形对应的第一编码以及golden图形对应的第二编码;S41: Encode the graphics to be verified and the set golden graphics obtained by rendering the graphics to be verified API according to the same compression encoding method, and obtain the first code corresponding to the graphics to be verified and the second code corresponding to the golden graphics. ;

S42:将所述第一编码与所述第二编码进行比较:S42: Compare the first code with the second code:

S43:若两者一致,则确定所述待验证图形与golden图形一致;S43: If the two are consistent, it is determined that the graphic to be verified is consistent with the golden graphic;

S44:若两者不一致,则通过将待验证图形与golden图形对应位置像素相减以获得差异图形;S44: If the two are inconsistent, the difference graphic is obtained by subtracting the pixels at the corresponding positions of the graphic to be verified and the golden graphic;

S45:基于所述差异图形按照粗粒度或细粒度的比较,以确认待验证图形是否与golden图形相似。S45: Compare the difference graph at a coarse-grained or fine-grained level to confirm whether the graph to be verified is similar to the golden graph.

需要说明的是,压缩编码方式可以根据图形的精度以及尺寸进行选择,选择条件以碰撞概率尽可能小为前提,在具体实施过程中,压缩编码方式可以采用散列值计算算法,诸如sha128算法以及md5算法等,待验证图形与golden图形均采用相同的压缩编码方式进行。差异图形则可以通过将待验证图形与golden图形的相同位置像素值相减的差值以获得,通常来说,完全相同的两幅图形按照对应位置像素进行相减之后,所得到的差异图形为全黑色图形,而若差异图形不为全黑色图形,那么差异图形中非黑色像素点则为待验证图形与golden图形的差异像素点。It should be noted that the compression encoding method can be selected based on the accuracy and size of the graphics. The selection condition is based on the premise that the collision probability is as small as possible. During the specific implementation process, the compression encoding method can use a hash value calculation algorithm, such as the sha128 algorithm and md5 algorithm, etc., the graphics to be verified and the golden graphics use the same compression encoding method. The difference graph can be obtained by subtracting the pixel values at the same position between the graph to be verified and the golden graph. Generally speaking, after subtracting two identical graphs according to the pixels at the corresponding positions, the difference graph obtained is: A completely black graphic. If the difference graphic is not a completely black graphic, then the non-black pixels in the difference graphic are the difference pixels between the graphic to be verified and the golden graphic.

上述示例内容为前述分层判定策略中的第一层,通过图形粒度的编码比较以确认待验证图形与golden图形是否完全一致,若确认不完全一致,则按照以下具体实例继续进行相似性判定。The above example content is the first layer in the aforementioned hierarchical determination strategy. Through encoding comparison at graphic granularity, it is confirmed whether the graphic to be verified is completely consistent with the golden graphic. If it is confirmed that they are not completely consistent, the similarity determination will continue according to the following specific examples.

针对上述示例,具体来说,参见图5,S45所述基于所述差异图形按照粗粒度或细粒度的比较,以确认待验证图形是否与golden图形相似,包括:For the above example, specifically, referring to Figure 5, the coarse-grained or fine-grained comparison based on the difference graph described in S45 to confirm whether the graph to be verified is similar to the golden graph includes:

S451:根据所述差异图形中差异像素点的像素值平方和与设定的平方和阈值进行比较,根据比较结果确定所述待验证图形与所述golden图形之间的差异程度;S451: Compare the sum of squares of pixel values of different pixels in the difference graphic with the set sum of squares threshold, and determine the degree of difference between the graphic to be verified and the golden graphic based on the comparison result;

S452:若所述差异程度表征所述待验证图形与所述golden图形之间差异较小,则基于所述差异图形中差异像素点位置分别按照横、纵方向进行图形块像素值对比,根据对比结果确定所述待验证图形是否为所述golden图形的相似图形。S452: If the degree of difference indicates that the difference between the graphic to be verified and the golden graphic is small, compare the pixel values of graphic blocks in the horizontal and vertical directions based on the different pixel positions in the differential graphic. According to the comparison The result determines whether the graphic to be verified is a similar graphic to the golden graphic.

上述具体实例,需要说明的是,为前述分层判定策略中的第二层,以图形相减得到的差异图形为粒度,通过差异像素点的像素值平方和进行粗粒度判定,以确认待验证图形与golden图形差异程度是否较大;若差异程度较大,说明待验证图形与golden图形之间的色差较大,若差异程度较小,则可按照以下详细实例确定是否相似。It should be noted that the above specific example is the second layer in the aforementioned hierarchical judgment strategy. The difference graph obtained by graph subtraction is used as the granularity, and a coarse-grained judgment is made through the sum of the squares of the pixel values of the difference pixels to confirm the verification. Whether the difference between the graphic and the golden graphic is large; if the difference is large, it means that the color difference between the graphic to be verified and the golden graphic is large. If the difference is small, you can determine whether they are similar according to the following detailed examples.

更为详细来说,参见图6,S452所述基于所述差异图形中差异像素点位置分别按照横、纵方向进行图形块像素值对比,根据对比结果确定所述待验证图形是否为所述golden图形的相似图形,包括:In more detail, referring to Figure 6, S452 compares the pixel values of graphics blocks in the horizontal and vertical directions based on the different pixel positions in the difference graphics, and determines whether the graphics to be verified is the golden based on the comparison results. Similar figures to figures, including:

S4521:以差异像素点位置为中心按照设定尺寸从所述待验证图形中的相应区域选取第一图形块;S4521: Select the first graphics block from the corresponding area in the graphics to be verified based on the set size with the difference pixel position as the center;

S4522:分别在所述第一图形块的横、纵两个方向计算相应的像素值差值,以获取所述第一图形块内像素值的增减状态;S4522: Calculate the corresponding pixel value differences in the horizontal and vertical directions of the first graphics block to obtain the increase or decrease status of the pixel values in the first graphics block;

S4523:以差异像素点位置为中心按照设定尺寸从所述golden图形中的相应区域选取第二图形块;S4523: Select the second graphic block from the corresponding area in the golden graphic according to the set size with the difference pixel position as the center;

S4524:分别在所述第二图形块的横、纵两个方向计算相应的像素值差值,以获取所述第二图形块内像素值的增减状态;S4524: Calculate corresponding pixel value differences in the horizontal and vertical directions of the second graphics block to obtain the increase or decrease status of the pixel values in the second graphics block;

S4525:基于所述第一图形块内像素值的增减状态与所述第二图形块内像素值的增减状态之间的相关性,确定所述待验证图形与所述golden图形之间是否存在位置平移或像素值线性缩放;S4525: Based on the correlation between the increase and decrease status of the pixel value in the first graphics block and the increase and decrease status of the pixel value in the second graphics block, determine whether there is a relationship between the graphic to be verified and the golden graphic. There is positional translation or linear scaling of pixel values;

S4526:若确定存在位置平移或像素值线性缩放,则根据位置平移系数或像素值线性缩放系数判定所述待验证图形与所述golden图形之间是否相似。S4526: If it is determined that there is position translation or pixel value linear scaling, determine whether the graphic to be verified is similar to the golden graphic based on the position translation coefficient or the pixel value linear scaling coefficient.

对于上述详细实例,为前述分层判定策略中的第三层,以差异图形内的图形块为粒度,按照差异像素所在的图形块进行对比以进行细粒度比较。在本发明实施例中,设定尺寸可以为9×9像素,因此,第一图形块以及第二图形块均为大小相等的9×9像素块。For the above detailed example, it is the third layer in the aforementioned hierarchical determination strategy. The graphics blocks in the difference graphics are used as the granularity, and the comparison is performed according to the graphics blocks where the difference pixels are located to perform fine-grained comparisons. In this embodiment of the present invention, the set size may be 9×9 pixels. Therefore, the first graphic block and the second graphic block are both 9×9 pixel blocks of equal size.

通过以上本示例及各实例的描述,通过分层以及编码的方式,相比于常规方案中通过与golden图形逐像素对比的方式,减少了运算量以及运算结果判定所耗费的时间;通过上述分层策略,减少了需要进行存储的数据量,降低了存储空间的开辟数目;通过压缩编码的方式也减少了单个结果所需的存储空间。在具体实施过程中,可以将golden图形及其编码压缩后的编码值进行预存,从而在验证过程中减少重复编码计算过程,而上述设定的阈值以及尺寸可以根据实际应用过程中的情况进行选取和设置,本发明实施例对此不做赘述。Through the above description of this example and each instance, through layering and encoding, compared with the pixel-by-pixel comparison with golden graphics in the conventional scheme, the amount of calculation and the time spent in determining the calculation result are reduced; through the above analysis The layer strategy reduces the amount of data that needs to be stored and the number of storage spaces to be opened; the compression encoding method also reduces the storage space required for a single result. During the specific implementation process, the golden graphics and their compressed encoding values can be pre-stored, thereby reducing repeated encoding calculation processes during the verification process, and the thresholds and sizes set above can be selected according to the actual application process. and settings, which will not be described in detail in the embodiment of the present invention.

基于上述实施例,参见图7,其示出了本发明实施例提供的一种图形接口的验证装置70,所述装置70包括:分类部分701、映射部分702、验证部分703;其中,Based on the above embodiment, refer to Figure 7, which shows a graphical interface verification device 70 provided by an embodiment of the present invention. The device 70 includes: a classification part 701, a mapping part 702, and a verification part 703; wherein,

所述分类部分701,经配置为根据输出数据类型将待验证图形应用程序接口API进行分类,获得所述待验证图形API对应的类型;The classification part 701 is configured to classify the graphics application program interface API to be verified according to the output data type, and obtain the type corresponding to the graphics API to be verified;

所述映射部分702,经配置为基于预设的验证用例与输出数据类型之间的映射关系,根据所述待验证图形API对应的类型确定为验证所述待验证图形API所使用的验证用例;The mapping part 702 is configured to determine the verification use case used to verify the graphics API to be verified based on the mapping relationship between the preset verification use case and the output data type according to the type corresponding to the graphics API to be verified;

所述验证部分703,经配置为根据被确认的验证用例对所述待验证图形API进行验证。The verification part 703 is configured to verify the graphics API to be verified according to the confirmed verification use case.

在一些示例中,所述待验证图形API的输出数据类型包括:状态信息类型、少像素的基本绘制类型以及多像素的图形渲染类型;相应地,所述验证用例包括:状态信息类用例、少像素基本绘制类用例以及多像素图形渲染类用例。In some examples, the output data types of the graphics API to be verified include: status information type, basic drawing type with few pixels, and graphics rendering type with multiple pixels; correspondingly, the verification use cases include: status information use cases, few pixels Basic pixel drawing use cases and multi-pixel graphics rendering use cases.

在一些示例中,相应于所述输出数据类型为状态信息类型,所述验证部分703,经配置为:In some examples, corresponding to the output data type being the status information type, the verification part 703 is configured as:

将所述待验证图形API的输出文本与标准的输出文本结果进行比较,根据比较结果确认所述待验证图形API的验证结果。Compare the output text of the graphics API to be verified with the standard output text result, and confirm the verification result of the graphics API to be verified based on the comparison result.

在一些示例中,相应于所述输出数据类型为少像素的基本绘制类型,所述验证部分703,经配置为:In some examples, corresponding to the output data type being a basic drawing type with few pixels, the verification part 703 is configured as:

基于渲染用例模型对输入的采样顶点及采样顶点属性进行计算,获得所述待验证图形API的理论渲染结果;Calculate the input sampling vertices and sampling vertex attributes based on the rendering use case model to obtain the theoretical rendering results of the graphics API to be verified;

对输入的采样顶点及采样顶点属性通过所述待验证图形API进行处理,获得实际渲染结果;Process the input sampling vertices and sampling vertex attributes through the graphics API to be verified to obtain actual rendering results;

将所述理论渲染结果以及所述实际渲染结果进行比较,根据比较结果确认所述待验证图形API的验证结果。Compare the theoretical rendering result and the actual rendering result, and confirm the verification result of the graphics API to be verified based on the comparison result.

在一些示例中,相应于所述输出数据类型为多像素的图形渲染类型,所述验证部分703,经配置为:In some examples, corresponding to the output data type being a multi-pixel graphics rendering type, the verification part 703 is configured as:

基于设定的分层判定策略对所述待验证图形API进行不同粒度验证。Verify the graphics API to be verified at different granularities based on the set hierarchical determination strategy.

在一些示例中,所述验证部分703,经配置为:In some examples, the verification portion 703 is configured to:

将通过所述待验证图形API渲染所得到的待验证图形以及设定的金golden图形均按照相同的压缩编码方式进行编码,获得待验证图形对应的第一编码以及golden图形对应的第二编码;The graphics to be verified and the set golden graphics obtained by rendering the graphics to be verified API are encoded according to the same compression encoding method, and the first code corresponding to the graphics to be verified and the second code corresponding to the golden graphics are obtained;

将所述第一编码与所述第二编码进行比较:Compare the first encoding with the second encoding:

若两者一致,则确定所述待验证图形与golden图形一致;If the two are consistent, it is determined that the graph to be verified is consistent with the golden graph;

若两者不一致,则通过将待验证图形与golden图形对应位置像素相减以获得差异图形;If the two are inconsistent, the difference graphic is obtained by subtracting the pixels at the corresponding positions of the graphic to be verified and the golden graphic;

基于所述差异图形按照粗粒度或细粒度的比较,以确认待验证图形是否与所述golden图形相似。Based on the difference graph, a coarse-grained or fine-grained comparison is performed to confirm whether the graph to be verified is similar to the golden graph.

在一些示例中,所述验证部分703,经配置为:In some examples, the verification portion 703 is configured to:

根据所述差异图形中差异像素点的像素值平方和与设定的平方和阈值进行比较,根据比较结果确定所述待验证图形与所述golden图形之间的差异程度;Compare the sum of squares of pixel values of different pixels in the difference graphic with a set sum of squares threshold, and determine the degree of difference between the graphic to be verified and the golden graphic based on the comparison result;

若所述差异程度表征所述待验证图形与所述golden图形之间差异较小,则基于所述差异图形中差异像素点位置分别按照横、纵方向进行图形块像素值对比,根据对比结果确定所述待验证图形是否为所述golden图形的相似图形。If the degree of difference indicates that the difference between the graphic to be verified and the golden graphic is small, compare the pixel values of graphic blocks in the horizontal and vertical directions based on the positions of different pixels in the differential graphic, and determine based on the comparison results. Whether the graphic to be verified is a similar graphic to the golden graphic.

在一些示例中,所述验证部分703,经配置为:In some examples, the verification portion 703 is configured to:

以差异像素点位置为中心按照设定尺寸从所述待验证图形中的相应区域选取第一图形块;Select the first graphics block from the corresponding area in the graphics to be verified based on the set size with the difference pixel position as the center;

分别在所述第一图形块的横、纵两个方向计算相应的像素值差值,以获取所述第一图形块内像素值的增减状态;Calculate corresponding pixel value differences in the horizontal and vertical directions of the first graphics block to obtain the increase or decrease status of the pixel values in the first graphics block;

以差异像素点位置为中心按照设定尺寸从所述golden图形中的相应区域选取第二图形块;Select the second graphic block from the corresponding area in the golden graphic according to the set size with the difference pixel position as the center;

分别在所述第二图形块的横、纵两个方向计算相应的像素值差值,以获取所述第二图形块内像素值的增减状态;Calculate corresponding pixel value differences in the horizontal and vertical directions of the second graphics block to obtain the increase or decrease status of the pixel values in the second graphics block;

基于所述第一图形块内像素值的增减状态与所述第二图形块内像素值的增减状态之间的相关性,确定所述待验证图形与所述golden图形之间是否存在位置平移或像素值线性缩放;Based on the correlation between the increase and decrease status of the pixel value in the first graphics block and the increase and decrease status of the pixel value in the second graphics block, it is determined whether there is a position between the graphic to be verified and the golden graphic. Translation or linear scaling of pixel values;

若确定存在位置平移或像素值线性缩放,则根据位置平移系数或像素值线性缩放系数判定所述待验证图形与所述golden图形之间是否相似。If it is determined that there is position translation or pixel value linear scaling, it is determined whether the graphic to be verified is similar to the golden graphic based on the position translation coefficient or the pixel value linear scaling coefficient.

可以理解地,在本实施例中,“部分”可以是部分电路、部分处理器、部分程序或软件等等,当然也可以是单元,还可以是模块也可以是非模块化的。It can be understood that in this embodiment, "part" may be part of a circuit, part of a processor, part of a program or software, etc., and of course may also be a unit, or may be a module or non-modular.

另外,在本实施例中的各组成部分可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能模块的形式实现。In addition, each component in this embodiment can be integrated into one processing unit, or each unit can exist physically alone, or two or more units can be integrated into one unit. The above integrated units can be implemented in the form of hardware or software function modules.

所述集成的单元如果以软件功能模块的形式实现并非作为独立的产品进行销售或使用时,可以存储在一个计算机可读取存储介质中,基于这样的理解,本实施例的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)或processor(处理器)执行本实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(ROM,Read Only Memory)、随机存取存储器(RAM,Random Access Memory)、磁碟或者光盘等各种可以存储程序代码的介质。If the integrated unit is implemented in the form of a software function module and is not sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this embodiment is essentially either The part that contributes to the existing technology or all or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes a number of instructions to make a computer device (can It is a personal computer, server, or network device, etc.) or processor that executes all or part of the steps of the method described in this embodiment. The aforementioned storage media include: U disk, mobile hard disk, read only memory (ROM, Read Only Memory), random access memory (RAM, Random Access Memory), magnetic disk or optical disk and other various media that can store program codes.

因此,本实施例提供了一种计算机存储介质,所述计算机存储介质存储有图形接口的验证程序,所述图形接口的验证程序被至少一个处理器执行时实现上述技术方案中所述图形接口的验证方法步骤。Therefore, this embodiment provides a computer storage medium that stores a verification program of a graphical interface. When the verification program of the graphical interface is executed by at least one processor, the graphical interface in the above technical solution is implemented. Validation method steps.

根据上述图形接口的验证装置70以及计算机存储介质,参见图8,其示出了本发明实施例提供的一种能够实施上述图形接口的验证装置70的计算设备80的具体硬件结构,该计算设备80可以为无线装置、移动或蜂窝电话(包含所谓的智能电话)、个人数字助理(PDA)、视频游戏控制台(包含视频显示器、移动视频游戏装置、移动视频会议单元)、膝上型计算机、桌上型计算机、电视机顶盒、平板计算装置、电子书阅读器、固定或移动媒体播放器,等。计算设备80包括:通信接口801,存储器802和处理器803;各个组件通过总线系统804耦合在一起。可理解,总线系统804用于实现这些组件之间的连接通信。总线系统804除包括数据总线之外,还包括电源总线、控制总线和状态信号总线。但是为了清楚说明起见,在图8中将各种总线都标为总线系统804。其中,According to the verification device 70 of the above graphical interface and the computer storage medium, see FIG. 8 , which shows the specific hardware structure of a computing device 80 capable of implementing the verification device 70 of the above graphical interface provided by an embodiment of the present invention. The computing device 80 may be a wireless device, a mobile or cellular phone (including so-called smart phones), a personal digital assistant (PDA), a video game console (including a video display, a mobile video game device, a mobile video conferencing unit), a laptop computer, Desktop computers, television set-top boxes, tablet computing devices, e-book readers, fixed or mobile media players, etc. Computing device 80 includes: communication interface 801, memory 802, and processor 803; the various components are coupled together through bus system 804. It can be understood that the bus system 804 is used to implement connection communication between these components. In addition to the data bus, the bus system 804 also includes a power bus, a control bus and a status signal bus. However, for the sake of clarity, the various buses are labeled bus system 804 in FIG. 8 . in,

所述通信接口801,用于在与其他外部网元之间进行收发信息过程中,信号的接收和发送;The communication interface 801 is used for receiving and sending signals during the process of sending and receiving information with other external network elements;

所述存储器802,用于存储能够在所述处理器803上运行的计算机程序;The memory 802 is used to store computer programs that can run on the processor 803;

所述处理器803,用于在运行所述计算机程序时,执行前述技术方案中所述图形接口的验证方法方法步骤,这里不再进行赘述。The processor 803 is configured to execute the steps of the verification method of the graphical interface in the foregoing technical solution when running the computer program, which will not be described again here.

可以理解,本发明实施例中的存储器802可以是易失性存储器或非易失性存储器,或可包括易失性和非易失性存储器两者。其中,非易失性存储器可以是只读存储器(Read-Only Memory,ROM)、可编程只读存储器(Programmable ROM,PROM)、可擦除可编程只读存储器(Erasable PROM,EPROM)、电可擦除可编程只读存储器(Electrically EPROM,EEPROM)或闪存。易失性存储器可以是随机存取存储器(Random Access Memory,RAM),其用作外部高速缓存。通过示例性但不是限制性说明,许多形式的RAM可用,例如静态随机存取存储器(Static RAM,SRAM)、动态随机存取存储器(Dynamic RAM,DRAM)、同步动态随机存取存储器(Synchronous DRAM,SDRAM)、双倍数据速率同步动态随机存取存储器(Double Data RateSDRAM,DDRSDRAM)、增强型同步动态随机存取存储器(Enhanced SDRAM,ESDRAM)、同步连接动态随机存取存储器(Synchlink DRAM,SLDRAM)和直接内存总线随机存取存储器(DirectRambus RAM,DRRAM)。本文描述的系统和方法的存储器802旨在包括但不限于这些和任意其它适合类型的存储器。It can be understood that the memory 802 in the embodiment of the present invention may be a volatile memory or a non-volatile memory, or may include both volatile and non-volatile memories. Among them, the non-volatile memory can be read-only memory (Read-Only Memory, ROM), programmable read-only memory (Programmable ROM, PROM), erasable programmable read-only memory (Erasable PROM, EPROM), electrically removable memory. Erase programmable read-only memory (Electrically EPROM, EEPROM) or flash memory. The volatile memory may be random access memory (RAM), which is used as an external cache. By way of illustration, but not limitation, many forms of RAM are available, such as static random access memory (SRAM), dynamic random access memory (Dynamic RAM, DRAM), synchronous dynamic random access memory (Synchronous DRAM, SDRAM), double data rate synchronous dynamic random access memory (Double Data RateSDRAM, DDRSDRAM), enhanced synchronous dynamic random access memory (Enhanced SDRAM, ESDRAM), synchronous link dynamic random access memory (Synchlink DRAM, SLDRAM) and Direct memory bus random access memory (DirectRambus RAM, DRRAM). The memory 802 of the systems and methods described herein is intended to include, but is not limited to, these and any other suitable types of memory.

而处理器803可能是一种集成电路芯片,具有信号的处理能力。在实现过程中,上述方法的各步骤可以通过处理器803中的硬件的集成逻辑电路或者软件形式的指令完成。上述的处理器803可以是通用处理器、数字信号处理器(Digital Signal Processor,DSP)、专用集成电路(Application Specific Integrated Circuit,ASIC)、现场可编程门阵列(Field Programmable Gate Array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件。可以实现或者执行本发明实施例中的公开的各方法、步骤及逻辑框图。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。结合本发明实施例所公开的方法的步骤可以直接体现为硬件译码处理器执行完成,或者用译码处理器中的硬件及软件模块组合执行完成。软件模块可以位于随机存储器,闪存、只读存储器,可编程只读存储器或者电可擦写可编程存储器、寄存器等本领域成熟的存储介质中。该存储介质位于存储器802,处理器803读取存储器802中的信息,结合其硬件完成上述方法的步骤。The processor 803 may be an integrated circuit chip with signal processing capabilities. During the implementation process, each step of the above method can be completed by instructions in the form of hardware integrated logic circuits or software in the processor 803 . The above-mentioned processor 803 can be a general-purpose processor, a digital signal processor (Digital Signal Processor, DSP), an application specific integrated circuit (Application Specific Integrated Circuit, ASIC), a field programmable gate array (Field Programmable Gate Array, FPGA) or other Programmable logic devices, discrete gate or transistor logic devices, discrete hardware components. Each method, step and logical block diagram disclosed in the embodiment of the present invention can be implemented or executed. A general-purpose processor may be a microprocessor or the processor may be any conventional processor, etc. The steps of the method disclosed in conjunction with the embodiments of the present invention can be directly implemented by a hardware decoding processor, or executed by a combination of hardware and software modules in the decoding processor. The software module can be located in random access memory, flash memory, read-only memory, programmable read-only memory or electrically erasable programmable memory, registers and other mature storage media in this field. The storage medium is located in the memory 802. The processor 803 reads the information in the memory 802 and completes the steps of the above method in combination with its hardware.

可以理解的是,本文描述的这些实施例可以用硬件、软件、固件、中间件、微码或其组合来实现。对于硬件实现,处理单元可以实现在一个或多个专用集成电路(ApplicationSpecific Integrated Circuits,ASIC)、数字信号处理器(Digital Signal Processing,DSP)、数字信号处理设备(DSP Device,DSPD)、可编程逻辑设备(Programmable LogicDevice,PLD)、现场可编程门阵列(Field-Programmable Gate Array,FPGA)、通用处理器、控制器、微控制器、微处理器、用于执行本申请所述功能的其它电子单元或其组合中。It is understood that the embodiments described herein may be implemented in hardware, software, firmware, middleware, microcode, or a combination thereof. For hardware implementation, the processing unit can be implemented in one or more Application Specific Integrated Circuits (ASIC), Digital Signal Processing (DSP), Digital Signal Processing Device (DSP Device, DSPD), programmable logic Device (Programmable LogicDevice, PLD), field-programmable gate array (Field-Programmable Gate Array, FPGA), general processor, controller, microcontroller, microprocessor, other electronic units used to perform the functions described in this application or a combination thereof.

对于软件实现,可通过执行本文所述功能的模块(例如过程、函数等)来实现本文所述的技术。软件代码可存储在存储器中并通过处理器执行。存储器可以在处理器中或在处理器外部实现。For software implementation, the techniques described herein may be implemented through modules (eg, procedures, functions, etc.) that perform the functions described herein. Software code may be stored in memory and executed by a processor. The memory can be implemented in the processor or external to the processor.

具体来说,处理器803还配置为运行所述计算机程序时,Specifically, the processor 803 is further configured to run the computer program,

需要说明的是:本发明实施例所记载的技术方案之间,在不冲突的情况下,可以任意组合。It should be noted that the technical solutions recorded in the embodiments of the present invention can be combined arbitrarily as long as there is no conflict.

以上所述,仅为本发明的具体实施方式,但本发明的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本发明揭露的技术范围内,可轻易想到变化或替换,都应涵盖在本发明的保护范围之内。因此,本发明的保护范围应以所述权利要求的保护范围为准。The above are only specific embodiments of the present invention, but the protection scope of the present invention is not limited thereto. Any person familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed by the present invention. should be covered by the protection scope of the present invention. Therefore, the protection scope of the present invention should be subject to the protection scope of the claims.

Claims (11)

1.一种图形接口的验证方法,其特征在于,所述方法包括:1. A graphical interface verification method, characterized in that the method includes: 根据输出数据类型将待验证图形应用程序接口API进行分类,获得所述待验证图形API对应的类型;Classify the graphics application program interface API to be verified according to the output data type, and obtain the type corresponding to the graphics API to be verified; 基于预设的验证用例与输出数据类型之间的映射关系,根据所述待验证图形API对应的类型确定为验证所述待验证图形API所使用的验证用例;Based on the mapping relationship between the preset verification use case and the output data type, determine the verification use case used to verify the graphics API to be verified according to the type corresponding to the graphics API to be verified; 根据被确认的验证用例对所述待验证图形API进行验证。Verify the graphics API to be verified according to the confirmed verification use case. 2.根据权利要求1所述的方法,其特征在于,所述待验证图形API的输出数据类型包括:状态信息类型、少像素的基本绘制类型以及多像素的图形渲染类型;相应地,所述验证用例包括:状态信息类用例、少像素基本绘制类用例以及多像素图形渲染类用例。2. The method according to claim 1, wherein the output data type of the graphics API to be verified includes: status information type, basic drawing type with few pixels, and graphics rendering type with multiple pixels; accordingly, the Verification use cases include: status information use cases, few-pixel basic drawing use cases, and multi-pixel graphics rendering use cases. 3.根据权利要求2所述的方法,其特征在于,相应于所述输出数据类型为状态信息类型,所述根据被确认的验证用例对所述待验证图形API进行验证,包括:3. The method according to claim 2, characterized in that, corresponding to the output data type being a status information type, the verification of the graphics API to be verified according to the confirmed verification use case includes: 将所述待验证图形API的输出文本与标准的输出文本结果进行比较,根据比较结果确认所述待验证图形API的验证结果。Compare the output text of the graphics API to be verified with the standard output text result, and confirm the verification result of the graphics API to be verified based on the comparison result. 4.根据权利要求2所述的方法,其特征在于,相应于所述输出数据类型为少像素的基本绘制类型,所述根据被确认的验证用例对所述待验证图形API进行验证,包括:4. The method according to claim 2, characterized in that, corresponding to the output data type being a basic drawing type with few pixels, the verification of the graphics API to be verified according to the confirmed verification use case includes: 基于渲染用例模型对输入的采样顶点及采样顶点属性进行计算,获得所述待验证图形API的理论渲染结果;Calculate the input sampling vertices and sampling vertex attributes based on the rendering use case model to obtain the theoretical rendering results of the graphics API to be verified; 对输入的采样顶点及采样顶点属性通过所述待验证图形API进行处理,获得实际渲染结果;Process the input sampling vertices and sampling vertex attributes through the graphics API to be verified to obtain actual rendering results; 将所述理论渲染结果以及所述实际渲染结果进行比较,根据比较结果确认所述待验证图形API的验证结果。Compare the theoretical rendering result and the actual rendering result, and confirm the verification result of the graphics API to be verified based on the comparison result. 5.根据权利要求2所述的方法,其特征在于,相应于所述输出数据类型为多像素的图形渲染类型,所述根据被确认的验证用例对所述待验证图形API进行验证,包括:5. The method according to claim 2, characterized in that, corresponding to the output data type being a multi-pixel graphics rendering type, the verification of the graphics API to be verified according to the confirmed verification use case includes: 基于设定的分层判定策略对所述待验证图形API进行不同粒度验证。Verify the graphics API to be verified at different granularities based on the set hierarchical determination strategy. 6.根据权利要求5所述的方法,其特征在于,所述基于设定的分层判定策略对所述待验证图形API进行不同粒度验证,包括:6. The method according to claim 5, wherein the graphical API to be verified is verified at different granularities based on the set hierarchical determination strategy, including: 将通过所述待验证图形API渲染所得到的待验证图形以及设定的golden图形均按照相同的压缩编码方式进行编码,获得待验证图形对应的第一编码以及golden图形对应的第二编码;The graphics to be verified and the set golden graphics obtained by rendering the graphics to be verified API are encoded according to the same compression encoding method, and the first code corresponding to the graphics to be verified and the second code corresponding to the golden graphics are obtained; 将所述第一编码与所述第二编码进行比较:Compare the first encoding to the second encoding: 若两者一致,则确定所述待验证图形与golden图形一致;If the two are consistent, it is determined that the graph to be verified is consistent with the golden graph; 若两者不一致,则通过将待验证图形与golden图形对应位置像素相减以获得差异图形;If the two are inconsistent, the difference graphic is obtained by subtracting the pixels at the corresponding positions of the graphic to be verified and the golden graphic; 基于所述差异图形按照粗粒度或细粒度的比较,以确认待验证图形是否与所述golden图形相似。Based on the difference graph, a coarse-grained or fine-grained comparison is performed to confirm whether the graph to be verified is similar to the golden graph. 7.根据权利要求6所述的方法,其特征在于,所述基于所述差异图形按照粗粒度或细粒度的比较,以确认待验证图形是否与所述golden图形相似,包括:7. The method according to claim 6, characterized in that the comparison based on the difference graphic according to coarse-grained or fine-grained to confirm whether the graphic to be verified is similar to the golden graphic includes: 根据所述差异图形中差异像素点的像素值平方和与设定的平方和阈值进行比较,根据比较结果确定所述待验证图形与所述golden图形之间的差异程度;Compare the sum of squares of pixel values of different pixels in the difference graphic with a set sum of squares threshold, and determine the degree of difference between the graphic to be verified and the golden graphic based on the comparison result; 若所述差异程度表征所述待验证图形与所述golden图形之间差异较小,则基于所述差异图形中差异像素点位置分别按照横、纵方向进行图形块像素值对比,根据对比结果确定所述待验证图形是否为所述golden图形的相似图形。If the degree of difference indicates that the difference between the graphic to be verified and the golden graphic is small, compare the pixel values of graphic blocks in the horizontal and vertical directions based on the positions of different pixels in the differential graphic, and determine based on the comparison results. Whether the graphic to be verified is a similar graphic to the golden graphic. 8.根据权利要求7所述的方法,其特征在于,所述基于所述差异图形中差异像素点位置分别按照横、纵方向进行图形块像素值对比,根据对比结果确定所述待验证图形是否为所述golden图形的相似图形,包括:8. The method according to claim 7, characterized in that, based on the difference pixel point positions in the difference graphics, the pixel values of the graphics blocks are compared in the horizontal and vertical directions respectively, and whether the graphics to be verified is determined according to the comparison results. Similar graphics to the golden graphics include: 以差异像素点位置为中心按照设定尺寸从所述待验证图形中的相应区域选取第一图形块;Select the first graphics block from the corresponding area in the graphics to be verified based on the set size with the difference pixel position as the center; 分别在所述第一图形块的横、纵两个方向计算相应的像素值差值,以获取所述第一图形块内像素值的增减状态;Calculate corresponding pixel value differences in the horizontal and vertical directions of the first graphics block to obtain the increase or decrease status of the pixel values in the first graphics block; 以差异像素点位置为中心按照设定尺寸从所述golden图形中的相应区域选取第二图形块;Select the second graphic block from the corresponding area in the golden graphic according to the set size with the difference pixel position as the center; 分别在所述第二图形块的横、纵两个方向计算相应的像素值差值,以获取所述第二图形块内像素值的增减状态;Calculate corresponding pixel value differences in the horizontal and vertical directions of the second graphics block to obtain the increase or decrease status of the pixel values in the second graphics block; 基于所述第一图形块内像素值的增减状态与所述第二图形块内像素值的增减状态之间的相关性,确定所述待验证图形与所述golden图形之间是否存在位置平移或像素值线性缩放;Based on the correlation between the increase and decrease status of the pixel value in the first graphics block and the increase and decrease status of the pixel value in the second graphics block, it is determined whether there is a position between the graphic to be verified and the golden graphic. Translation or linear scaling of pixel values; 若确定存在位置平移或像素值线性缩放,则根据位置平移系数或像素值线性缩放系数判定所述待验证图形与所述golden图形之间是否相似。If it is determined that there is position translation or pixel value linear scaling, it is determined whether the graphic to be verified is similar to the golden graphic based on the position translation coefficient or the pixel value linear scaling coefficient. 9.一种图形接口的验证装置,其特征在于,所述装置包括:分类部分、映射部分、验证部分;其中,9. A graphical interface verification device, characterized in that the device includes: a classification part, a mapping part, and a verification part; wherein, 所述分类部分,经配置为根据输出数据类型将待验证图形应用程序接口API进行分类,获得所述待验证图形API对应的类型;The classification part is configured to classify the graphics application program interface API to be verified according to the output data type, and obtain the type corresponding to the graphics API to be verified; 所述映射部分,经配置为基于预设的验证用例与输出数据类型之间的映射关系,根据所述待验证图形API对应的类型确定为验证所述待验证图形API所使用的验证用例;The mapping part is configured to determine the verification use case used to verify the graphics API to be verified based on the mapping relationship between the preset verification use case and the output data type according to the type corresponding to the graphics API to be verified; 所述验证部分,经配置为根据被确认的验证用例对所述待验证图形API进行验证。The verification part is configured to verify the graphics API to be verified according to the confirmed verification use case. 10.一种计算设备,其特征在于,所述计算设备包括:通信接口,存储器和处理器;各个组件通过总线系统耦合在一起;10. A computing device, characterized in that the computing device includes: a communication interface, a memory and a processor; each component is coupled together through a bus system; 所述通信接口,用于在与其他外部网元之间进行收发信息过程中,信号的接收和发送;The communication interface is used for receiving and sending signals during the process of sending and receiving information with other external network elements; 所述存储器,用于存储能够在所述处理器上运行的计算机程序;The memory is used to store computer programs capable of running on the processor; 所述处理器,用于在运行所述计算机程序时,执行权利要求1至8任一项所述图形接口的验证方法步骤。The processor is configured to execute the verification method steps of the graphical interface according to any one of claims 1 to 8 when running the computer program. 11.一种计算机存储介质,其特征在于,所述计算机存储介质存储有图形接口的验证程序,所述图形接口的验证程序被至少一个处理器执行时实现权利要求1至8任一项所述图形接口的验证方法步骤。11. A computer storage medium, characterized in that the computer storage medium stores a verification program of a graphical interface, and when executed by at least one processor, the verification program of the graphical interface implements any one of claims 1 to 8 Verification method steps of graphical interface.
CN202010016488.2A 2020-01-08 2020-01-08 Verification method and device for graphic interface and computer storage medium Active CN111221734B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010016488.2A CN111221734B (en) 2020-01-08 2020-01-08 Verification method and device for graphic interface and computer storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010016488.2A CN111221734B (en) 2020-01-08 2020-01-08 Verification method and device for graphic interface and computer storage medium

Publications (2)

Publication Number Publication Date
CN111221734A CN111221734A (en) 2020-06-02
CN111221734B true CN111221734B (en) 2023-09-12

Family

ID=70808824

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010016488.2A Active CN111221734B (en) 2020-01-08 2020-01-08 Verification method and device for graphic interface and computer storage medium

Country Status (1)

Country Link
CN (1) CN111221734B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112631895A (en) * 2020-12-05 2021-04-09 西安翔腾微电子科技有限公司 Verification method for packing and unpacking functions of graphic processing subsets
CN115293309B (en) * 2022-08-17 2024-04-05 蚂蚁区块链科技(上海)有限公司 Graphic code verification method and device, graphic code registration method and device
CN115409687B (en) * 2022-10-31 2023-01-13 北京麟卓信息科技有限公司 Rendering difference detection method based on display buffer synthesis

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109582525A (en) * 2018-10-19 2019-04-05 京信通信系统(中国)有限公司 Test code verification method, verifying device, equipment and storage medium
US10503853B1 (en) * 2017-07-28 2019-12-10 Synopsys, Inc. Formal verification using cached search path information to verify previously proved/disproved properties

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20150188977A1 (en) * 2013-11-04 2015-07-02 Google Inc. Verifying Content Rendering on a Client Device

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10503853B1 (en) * 2017-07-28 2019-12-10 Synopsys, Inc. Formal verification using cached search path information to verify previously proved/disproved properties
CN109582525A (en) * 2018-10-19 2019-04-05 京信通信系统(中国)有限公司 Test code verification method, verifying device, equipment and storage medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
夏宇闻,山岗.可重构的通用硬线逻辑电路算法验证平台的设计.遥测遥控.2000,(第01期),全文. *

Also Published As

Publication number Publication date
CN111221734A (en) 2020-06-02

Similar Documents

Publication Publication Date Title
CN111221734B (en) Verification method and device for graphic interface and computer storage medium
US11551068B2 (en) Processing system and method for binary weight convolutional neural network
CN109064399B (en) Image super-resolution reconstruction method and system, computer device and storage medium thereof
WO2020113355A1 (en) A content adaptive attention model for neural network-based image and video encoders
CN106030652B (en) Method, system and composite display controller for providing output surface and computer medium
US20120176386A1 (en) Reducing recurrent computation cost in a data processing pipeline
WO2023184759A1 (en) Method and apparatus for completing shape of three-dimensional object, and device and storage medium
CN110189384B (en) Image compression method, device, computer equipment and storage medium based on Unity3D
CN111008934B (en) Scene construction method, device, equipment and storage medium
US20150242988A1 (en) Methods of eliminating redundant rendering of frames
CN115145391B (en) AI deep learning-based virtual reality treadmill self-adaptation method and system
CN107621982A (en) A method for adjusting performance parameters of a processor and a mobile terminal
WO2024140568A1 (en) Image processing method and apparatus, electronic device, and readable storage medium
CN113625923B (en) Remote cloud desktop-based mouse processing method and device, storage medium and equipment
CN117649478B (en) Model training method, image processing method and electronic device
US20240171758A1 (en) System and method for rendering differential video on graphical displays
CN116309274B (en) Method and device for detecting small target in image, computer equipment and storage medium
CN117975473A (en) Bill text detection model training and detection method, device, equipment and medium
CN114647411B (en) Programming interface loading method, device, electronic device and storage medium
EP2903288A1 (en) Method and apparatus for constructing an epitome from an image
CN114666600B (en) Data encoding method and device based on irregular template, electronic equipment and medium
US20240231893A1 (en) Ai-assisted context-aware pipeline creation
CN115880249B (en) Image-based object segmentation method, device, equipment and medium
CN110276720B (en) Image generation method and device
CN117478901A (en) Encoding and decoding methods, devices and 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: Room 301, Building D, Yeda Science and Technology Park, No. 300 Changjiang Road, Yantai Area, China (Shandong) Pilot Free Trade Zone, Yantai City, Shandong Province, 265503

Patentee after: Xi'an Xintong Semiconductor Technology Co.,Ltd.

Address before: Room 21101, 11 / F, unit 2, building 1, Wangdu, No. 3, zhangbayi Road, Zhangba Street office, hi tech Zone, Xi'an City, Shaanxi Province

Patentee before: Xi'an Xintong Semiconductor Technology Co.,Ltd.

CP03 Change of name, title or address
CP03 Change of name, title or address

Address after: Unit 802, No. 63 Chengyi North Street, Software Park Phase III, Torch High tech Zone, Xiamen City, Fujian Province 361006

Patentee after: Xintong Semiconductor Technology (Xiamen) Co.,Ltd.

Country or region after: China

Address before: Room 301, Building D, Yeda Science and Technology Park, No. 300 Changjiang Road, Yantai Area, China (Shandong) Pilot Free Trade Zone, Yantai City, Shandong Province

Patentee before: Xi'an Xintong Semiconductor Technology Co.,Ltd.

Country or region before: China