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 PDFInfo
- 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
- api
- graph
- verification
- 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
Links
- 238000012795 verification Methods 0.000 title claims abstract description 91
- 238000000034 method Methods 0.000 title claims abstract description 51
- 238000013507 mapping Methods 0.000 claims abstract description 13
- 238000009877 rendering Methods 0.000 claims description 36
- 235000019580 granularity Nutrition 0.000 claims description 19
- 238000012545 processing Methods 0.000 claims description 12
- 238000005070 sampling Methods 0.000 claims description 12
- 230000006835 compression Effects 0.000 claims description 9
- 238000007906 compression Methods 0.000 claims description 9
- 238000010200 validation analysis Methods 0.000 claims description 8
- 238000004891 communication Methods 0.000 claims description 7
- 238000004590 computer program Methods 0.000 claims description 7
- 230000003247 decreasing effect Effects 0.000 claims description 6
- 238000013519 translation Methods 0.000 claims description 6
- 238000004364 calculation method Methods 0.000 description 12
- 230000006870 function Effects 0.000 description 9
- 239000008186 active pharmaceutical agent Substances 0.000 description 8
- 238000010586 diagram Methods 0.000 description 6
- 238000004422 calculation algorithm Methods 0.000 description 4
- 238000012986 modification Methods 0.000 description 4
- 230000004048 modification Effects 0.000 description 4
- 230000001360 synchronised effect Effects 0.000 description 2
- KLDZYURQCUYZBL-UHFFFAOYSA-N 2-[3-[(2-hydroxyphenyl)methylideneamino]propyliminomethyl]phenol Chemical compound OC1=CC=CC=C1C=NCCCN=CC1=CC=CC=C1O KLDZYURQCUYZBL-UHFFFAOYSA-N 0.000 description 1
- 238000003491 array Methods 0.000 description 1
- 230000001413 cellular effect Effects 0.000 description 1
- 238000005094 computer simulation Methods 0.000 description 1
- 201000001098 delayed sleep phase syndrome Diseases 0.000 description 1
- 208000033921 delayed sleep phase type circadian rhythm sleep disease Diseases 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 230000003068 static effect Effects 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
- 238000012360 testing method Methods 0.000 description 1
- 230000009466 transformation Effects 0.000 description 1
- 239000002699 waste material Substances 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/36—Preventing errors by testing or debugging software
- G06F11/3668—Software testing
- G06F11/3672—Test management
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/36—Preventing errors by testing or debugging software
- G06F11/3668—Software testing
- G06F11/3672—Test management
- G06F11/3688—Test management for test execution, e.g. scheduling of test suites
-
- Y—GENERAL 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
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE 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/00—Energy 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
The embodiment of the application discloses a method and a device for verifying a graphic interface and a computer storage medium; the method comprises the following steps: classifying the graphical Application Program Interface (API) to be verified according to the type of the output data to obtain the type corresponding to the graphical API to be verified; based on a mapping relation between a preset verification use case and an output data type, determining the type corresponding to the graphic API to be verified as the verification use case used for verifying the graphic API to be verified; and verifying the graphic API to be verified according to the confirmed verification use case.
Description
Technical Field
The embodiment of the application relates to the technical field of computer graphics, in particular to a method and a device for verifying a graphics interface and a computer storage medium.
Background
In the GPU software design process, full functional verification is required for application program interfaces (APIs, application Programming Interface) of graphics standards, such as open graphics library (OpenGL, open Graphics Library), direct3D, and the like. The number of APIs provided in the graphics standard is large, for example, the number of APIs included in the OpenGL4.5 version is close to 1000, and meanwhile, the number of parameters of each API is large, even if the number of parameters of some APIs exceeds hundreds, the total number of APIs and the number of parameters are combined is large, so that, taking OpenGL as an example, functional verification of the APIs needs a large number of test cases to cover, thereby increasing the difficulty of comprehensive verification and greatly increasing the calculation amount in the judgment and verification of the use case result.
Disclosure of Invention
In view of this, embodiments of the present application desirably provide a method, an apparatus, and a computer storage medium for verifying a graphics interface; the comprehensive verification can be ensured, the load and the operation amount of the verification framework are reduced, the running time is shortened, and the efficient and rapid comprehensive verification is realized.
The technical scheme of the embodiment of the application is realized as follows:
in a first aspect, an embodiment of the present application provides a method for verifying a graphics interface, where the method includes:
classifying the graphical Application Program Interface (API) to be verified according to the type of the output data to obtain the type corresponding to the graphical API to be verified;
based on a mapping relation between a preset verification use case and an output data type, determining the type corresponding to the graphic API to be verified as the verification use case used for verifying the graphic API to be verified;
and verifying the graphic API to be verified according to the confirmed verification use case.
In a second aspect, an embodiment of the present application provides a device for verifying a graphics interface, where the device includes: a classification section, a mapping section, a verification section; wherein,,
the classifying part is configured to classify the graphics application program interface API to be verified according to the type of the output data to obtain the type corresponding to the graphics API to be verified;
the mapping part is configured to determine the verification case used for verifying the to-be-verified graphic API according to the type corresponding to the to-be-verified graphic API based on the mapping relation between the preset verification case and the output data type;
the verification section is configured to verify the graphics API to be verified according to the confirmed verification use case.
In a third aspect, an embodiment of the present application provides a computing device, including: a communication interface, a memory and a processor; the components are coupled together by a bus system;
the communication interface is used for receiving and transmitting signals in the process of receiving and transmitting information with other external network elements;
the memory is used for storing a computer program capable of running on the processor;
the processor is configured to execute the method steps of verifying the graphics interface of the first aspect when the computer program is run.
In a fourth aspect, an embodiment of the present application provides a computer storage medium, where a verification program of a graphics interface is stored, where the verification program of the graphics interface, when executed by at least one processor, implements the steps of the method for verifying the graphics interface of the first aspect.
The embodiment of the application provides a method and a device for verifying a graphic interface and a computer storage medium; and classifying the output data types of the graphic API to be verified, and determining the verification use cases corresponding to the classification for verification. Compared with the conventional verification mode aiming at the graphic API, the function verification can be completed without constructing a complete calculation model, so that after the subsequent graphic standard version is updated, the updated graphic standard version can be completely matched by only modifying the verification use cases corresponding to various types, the modification association degree is reduced, and the iteration speed is improved. In addition, the full comparison is not required to be carried out by using a golden model aiming at all the graphics APIs to be verified, the operation amount and operation time consumed in the verification process are reduced, and the verification efficiency is improved.
Drawings
FIG. 1 is a schematic flow chart of a method for verifying a graphics interface according to an embodiment of the present application;
FIG. 2 is a schematic diagram of classification of verification cases according to an embodiment of the present application;
FIG. 3 is a schematic diagram of a verification process of a basic rendering type of a few pixels according to an embodiment of the present application;
FIG. 4 is a schematic diagram of a verification process by compression encoding according to an embodiment of the present application;
FIG. 5 is a schematic diagram of coarse-grained verification provided by an embodiment of the application;
FIG. 6 is a fine grain verification schematic provided by an embodiment of the present application;
FIG. 7 is a schematic diagram of a verification device for a graphics interface according to an embodiment of the present application;
fig. 8 is a schematic diagram of a specific hardware structure of a computing device according to an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present application.
Taking OpenGL as an example, the current scheme for performing function verification on the application program interface of the graphics standard may include two types of schemes:
firstly, calculating through a model, for example, firstly, realizing a software rendered calculation model according to a graph standard; the vertices, attributes and states of the application are then used as inputs to operate through the implemented computational model to achieve the desired result. For a complex rendering application program, the number of vertexes and the attribute state are large, and the flow required to be processed in a software rendering calculation model is large, so that the operation time is long; secondly, the algorithm processing and the modules of the software-rendered calculation model are numerous, the correctness of the calculation model still needs to be comprehensively verified, and the correctness of the calculation model is difficult to guarantee; finally, if the standard version of the graph is updated, for example, new characteristics are added, the calculation model needs to be built again, and the relevance is high in the modification process, so that the iteration speed is influenced.
Secondly, the overall comparison is performed through the golden model, for example, a graph model which is a golden model for correctly processing results is stored in advance, then the graph generated in the verification process is compared with the golden model, and the correctness of the verified object is determined through the difference value. However, the number of generated graphics is large due to the numerous combinations of the API and parameters of the graphics standard, and all the graphics need to be compared pixel by pixel, so that the situations of very large operand, long operation time and low efficiency are caused.
Based on the shortcomings of conventional verification schemes, embodiments of the present application desire to provide a method, apparatus, and computer storage medium for verifying a graphics interface; the comprehensive verification can be ensured, the load and the operation amount of the verification framework are reduced, the running time is shortened, and the efficient and rapid comprehensive verification is realized. Based on this, referring to fig. 1, a method for verifying a graphics interface according to an embodiment of the present application may include:
s101: classifying the graphics API to be verified according to the type of the output data to obtain the type corresponding to the graphics interface to be verified;
s102: based on a mapping relation between a preset verification use case and an output data type, determining the type corresponding to the graphic API to be verified as the verification use case used for verifying the graphic API to be verified;
s103: and verifying the graphic API to be verified according to the confirmed verification use case.
It can be appreciated that, by the technical solution described in fig. 1, the output data types of the graphics API to be verified are classified, and the verification use cases corresponding to the classification are determined for verification. Compared with the conventional verification mode aiming at the graphic API, the function verification can be completed without constructing a complete calculation model, so that after the subsequent graphic standard version is updated, the updated graphic standard version can be completely matched by only modifying the verification use cases corresponding to various types, the modification association degree is reduced, and the iteration speed is improved. In addition, the full comparison is not required to be carried out by using a golden model aiming at all the graphics APIs to be verified, the operation amount and operation time consumed in the verification process are reduced, and the verification efficiency is improved.
For the solution shown in fig. 1, in some examples, the output data types of the graphics API to be verified may include: a state information type, a base rendering type of few pixels, and a graphics rendering type of multiple pixels; corresponding to the above output data types, referring to fig. 2, the verification use case may include: status information class use cases, low-pixel base rendering class use cases, and multi-pixel graphics rendering class use cases.
It should be noted that, in the embodiment of the present application, the above classification of the output data types is determined according to 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 extremely small data amount, such as status information, or drawing result content with fewer pixels, the adoption of the constructed computing model or golden model comprehensive comparison scheme described in the conventional verification scheme can cause a great deal of computing resource waste, and reduce the verification efficiency.
In some examples, the verifying the graphics API to be verified according to the validated verification use case, corresponding to the output data type being a status information type, includes:
and comparing the output text of the graphic API to be verified with a standard output text result, and confirming the verification result of the graphic API to be verified according to the comparison result.
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 may be compared with the standard output text result, and if the two are consistent, it is indicated that the function verification of the graphics API to be verified with the output data type being the status information type is passed; if the output data type and the output data type are inconsistent, the function verification of the graphics API to be verified, which is the state information type, is not passed, and further modification is needed.
In some examples, referring to fig. 3, the verifying the graphics API to be verified according to the validated verification use case, corresponding to the basic drawing type with the output data type of few pixels, includes:
s301: calculating the input sampling vertexes and sampling vertex attributes based on a rendering case model to obtain a theoretical rendering result of the graphic API to be verified;
s302: processing the input sampling vertexes and sampling vertex attributes through the graphics API to be verified to obtain an actual rendering result;
s303: and comparing the theoretical rendering result with the actual rendering result, and confirming the verification result of the graphic API to be verified according to the comparison result.
For example, the rendering case model employed in the present example is not the software rendering calculation model set for the complete graphics processing described in the foregoing conventional scheme, but is a simplified software rendering calculation model that is verified only for the graphics API to be verified. In the graphics rendering pipeline, the actual rendering results obtained by processing the sampled vertices and the sampled vertex attributes through the graphics API to be validated may be cached by means of transformation feedback (transform feedback) or the like. And in the specific comparison, comparing the pixel value of the theoretical rendering result with the pixel value of the actual rendering result, and confirming whether the function verification of the to-be-verified graphic API with the output data type of the basic drawing type with few pixels is passed or not according to the consistency of the comparison.
In some examples, the validating the graphics API to be validated according to the validated validation use case, corresponding to the graphics rendering type having the output data type of multiple pixels, includes:
and verifying the graphics API to be verified with different granularities based on the set layering judgment strategy.
In some examples, referring to fig. 4, the performing different granularity validation on the graphics API to be validated based on the set hierarchical decision policy includes:
s41: coding the graphics to be verified and the set golden graphics which are rendered by the graphics to be verified API according to the same compression coding mode, and obtaining a first code corresponding to the graphics to be verified and a second code corresponding to the golden graphics;
s42: comparing the first code with the second code:
s43: if the two patterns are consistent, determining that the pattern to be verified is consistent with the golden pattern;
s44: if the two images are inconsistent, obtaining a difference image by subtracting pixels at positions corresponding to the to-be-verified image and the golden image;
s45: and comparing the difference patterns according to coarse granularity or fine granularity to confirm whether the pattern to be verified is similar to the golden pattern.
It should be noted that, the compression coding mode may be selected according to the precision and the size of the graph, and the selection condition is based on that the collision probability is as small as possible, and in the specific implementation process, the compression coding mode may use a hash value calculation algorithm, such as sha128 algorithm and md5 algorithm, and the graph to be verified and the golden graph are both performed by using the same compression coding mode. The difference pattern can be obtained by subtracting the pixel values of the same positions of the pattern to be verified and the golden pattern, in general, after the pixels of the same positions are subtracted, the obtained difference pattern is a full black pattern, and if the difference pattern is not the full black pattern, the non-black pixel point in the difference pattern is the difference pixel point of the pattern to be verified and the golden pattern.
The above example is the first layer in the hierarchical decision strategy, and the comparison of the codes of the granularity of the patterns is used to confirm whether the patterns to be verified are completely consistent with the golden patterns, and if the patterns are not completely consistent with the golden patterns, the similarity decision is continued according to the following specific examples.
For the above example, specifically, referring to fig. 5, S45, the comparison of the difference pattern according to coarse granularity or fine granularity to confirm whether the pattern to be verified is similar to the golden pattern includes:
s451: comparing the square sum of pixel values of the difference pixel points in the difference graph with a set square sum threshold value, and determining the difference degree between the graph to be verified and the golden graph according to a comparison result;
s452: if the difference degree represents that the difference between the to-be-verified graph and the golden graph is smaller, comparing the pixel values of the graph blocks according to the transverse direction and the longitudinal direction based on the difference pixel points in the difference graph, and determining whether the to-be-verified graph is a similar graph of the golden graph according to a comparison result.
The above specific example should be described, for the second layer in the above hierarchical decision policy, taking the difference graph obtained by subtracting the graphs as granularity, and performing coarse granularity decision by square sum of pixel values of the difference pixels to determine whether the difference degree between the graph to be verified and the golden graph is larger; if the degree of difference is large, it is indicated that the color difference between the pattern to be verified and the golden pattern is large, and if the degree of difference is small, whether the patterns are similar or not can be determined according to the following detailed examples.
In more detail, referring to fig. 6, S452, comparing pixel values of the graphics block based on the difference pixel points in the difference graphics according to the horizontal direction and the vertical direction, and determining whether the graphics to be verified is a similar graphics of the golden graphics according to the comparison result includes:
s4521: selecting a first graph block from a corresponding area in the graph to be verified according to a set size by taking the position of the difference pixel point as a center;
s4522: calculating corresponding pixel value difference values in the transverse direction and the longitudinal direction of the first graph block respectively to obtain the increasing and decreasing states of the pixel values in the first graph block;
s4523: selecting a second graph block from the corresponding area in the golden graph according to the set size by taking the position of the difference pixel point as the center;
s4524: calculating corresponding pixel value difference values in the transverse direction and the longitudinal direction of the second graph block respectively to obtain the increasing and decreasing states of the pixel values in the second graph block;
s4525: determining whether there is a position shift or a linear scaling of pixel values between the graphic to be verified and the golden graphic based on a correlation between an increase or decrease state of pixel values within the first graphic block and an increase or decrease state of pixel values within the second graphic block;
s4526: if it is determined that the position translation or the pixel value linear scaling exists, whether the graphics to be verified are similar to the golden graphics or not is judged according to the position translation coefficient or the pixel value linear scaling coefficient.
For the above detailed example, the third layer in the above hierarchical decision strategy uses the graphics blocks in the difference graphics as granularity, and compares the graphics blocks with the difference pixels to make a fine granularity comparison. In the embodiment of the present application, the set size may be 9×9 pixels, so the first graphics block and the second graphics block are 9×9 pixel blocks with equal sizes.
Through the description of the present example and each example above, the amount of computation and the time consumed for determining the computation result are reduced by layering and encoding compared with the conventional scheme through pixel-by-pixel comparison with the golden graph; by the layering strategy, the data quantity required to be stored is reduced, and the number of the opened up storage spaces is reduced; the storage space required for a single result is also reduced by means of compression coding. In a specific implementation process, the golden graph and the code value after the code compression thereof can be pre-stored, so that repeated code calculation processes are reduced in a verification process, and the set threshold and size can be selected and set according to the situation in an actual application process, which is not described in detail in the embodiment of the application.
Based on the above embodiments, referring to fig. 7, there is shown a verification apparatus 70 for a graphics interface according to an embodiment of the present application, where the apparatus 70 includes: a classification section 701, a mapping section 702, a verification section 703; wherein,,
the classifying section 701 is configured to classify the graphics application program interface API to be verified according to the output data type, so as to obtain a type corresponding to the graphics API to be verified;
the mapping portion 702 is configured to determine, based on a mapping relationship between a preset verification use case and an output data type, a verification use case used for verifying the graphics API to be verified according to a type corresponding to the graphics API to be verified;
the verification section 703 is configured to verify the graphics API to be verified according to the confirmed verification use case.
In some examples, the output data types of the graphics API to be validated include: a state information type, a base rendering type of few pixels, and a graphics rendering type of multiple pixels; correspondingly, the verification case comprises: status information class use cases, low-pixel base rendering class use cases, and multi-pixel graphics rendering class use cases.
In some examples, the verification portion 703, corresponding to the output data type being a status information type, is configured to:
and comparing the output text of the graphic API to be verified with a standard output text result, and confirming the verification result of the graphic API to be verified according to the comparison result.
In some examples, the verification portion 703 is configured to:
calculating the input sampling vertexes and sampling vertex attributes based on a rendering case model to obtain a theoretical rendering result of the graphic API to be verified;
processing the input sampling vertexes and sampling vertex attributes through the graphics API to be verified to obtain an actual rendering result;
and comparing the theoretical rendering result with the actual rendering result, and confirming the verification result of the graphic API to be verified according to the comparison result.
In some examples, the verification portion 703 is configured to:
and verifying the graphics API to be verified with different granularities based on the set layering judgment strategy.
In some examples, the verification portion 703 is configured to:
coding the graphics to be verified and the set golden graphics which are rendered by the graphics to be verified API according to the same compression coding mode, and obtaining a first code corresponding to the graphics to be verified and a second code corresponding to the golden graphics;
comparing the first code with the second code:
if the two patterns are consistent, determining that the pattern to be verified is consistent with the golden pattern;
if the two images are inconsistent, obtaining a difference image by subtracting pixels at positions corresponding to the to-be-verified image and the golden image;
and based on the comparison of the difference graph according to coarse granularity or fine granularity, confirming whether the graph to be verified is similar to the golden graph.
In some examples, the verification portion 703 is configured to:
comparing the square sum of pixel values of the difference pixel points in the difference graph with a set square sum threshold value, and determining the difference degree between the graph to be verified and the golden graph according to a comparison result;
if the difference degree represents that the difference between the to-be-verified graph and the golden graph is smaller, comparing the pixel values of the graph blocks according to the transverse direction and the longitudinal direction based on the difference pixel points in the difference graph, and determining whether the to-be-verified graph is a similar graph of the golden graph according to a comparison result.
In some examples, the verification portion 703 is configured to:
selecting a first graph block from a corresponding area in the graph to be verified according to a set size by taking the position of the difference pixel point as a center;
calculating corresponding pixel value difference values in the transverse direction and the longitudinal direction of the first graph block respectively to obtain the increasing and decreasing states of the pixel values in the first graph block;
selecting a second graph block from the corresponding area in the golden graph according to the set size by taking the position of the difference pixel point as the center;
calculating corresponding pixel value difference values in the transverse direction and the longitudinal direction of the second graph block respectively to obtain the increasing and decreasing states of the pixel values in the second graph block;
determining whether there is a position shift or a linear scaling of pixel values between the graphic to be verified and the golden graphic based on a correlation between an increase or decrease state of pixel values within the first graphic block and an increase or decrease state of pixel values within the second graphic block;
if it is determined that the position translation or the pixel value linear scaling exists, whether the graphics to be verified are similar to the golden graphics or not is judged according to the position translation coefficient or the pixel value linear scaling coefficient.
It will be appreciated that in this embodiment, a "part" may be a part of a circuit, a part of a processor, a part of a program or software, etc., and of course may be a unit, or a module may be non-modular.
In addition, each component in the present embodiment may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit. The integrated units may be implemented in hardware or in software functional modules.
The integrated units, if implemented in the form of software functional modules, may be stored in a computer-readable storage medium, if not sold or used as separate products, and based on such understanding, the technical solution of the present embodiment may be embodied essentially or partly in the form of a software product, which is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, a server, or a network device, etc.) or processor to perform all or part of the steps of the method described in the present embodiment. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read Only Memory (ROM), a random access Memory (RAM, random Access Memory), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
Accordingly, the present embodiment provides a computer storage medium storing a verification program of a graphics interface, where the verification program of the graphics interface implements the steps of the verification method of the graphics interface in the above technical solution when executed by at least one processor.
According to the above-described graphical interface verification apparatus 70 and computer storage medium, referring to fig. 8, a specific hardware structure of a computing device 80 capable of implementing the above-described graphical interface verification apparatus 70 is shown, where the computing device 80 may be a wireless device, a mobile or cellular phone (including a so-called smart phone), a Personal Digital Assistant (PDA), a video game console (including a video display, a mobile video game device, a mobile video conference unit), a laptop computer, a desktop computer, a television set-top box, a tablet computing device, an e-book reader, a fixed or mobile media player, etc. The computing device 80 includes: a communication interface 801, a memory 802, and a processor 803; the various components are coupled together by a bus system 804. It is to be appreciated that the bus system 804 is employed to enable connected communications between these components. The bus system 804 includes a power bus, a control bus, and a status signal bus in addition to a data bus. But for clarity of illustration the various buses are labeled as bus system 804 in fig. 8. Wherein,,
the communication interface 801 is configured to receive and send signals during the process of receiving and sending information with other external network elements;
the memory 802 for storing a computer program capable of running on the processor 803;
the processor 803 is configured to execute the method steps of the verification method of the graphics interface in the foregoing technical solution when running the computer program, which is not described herein.
It will be appreciated that the memory 802 in embodiments of the application can be either volatile memory or nonvolatile memory, or can include both volatile and nonvolatile memory. The nonvolatile Memory may be a Read-Only Memory (ROM), a Programmable ROM (PROM), an Erasable PROM (EPROM), an Electrically Erasable EPROM (EEPROM), or a flash Memory. The volatile memory may be random access memory (Random Access Memory, RAM) which acts as an external cache. By way of example, and not limitation, many forms of RAM are available, such as Static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double Data Rate SDRAM (Double Data Rate SDRAM), enhanced SDRAM (ESDRAM), synchronous DRAM (SLDRAM), and Direct RAM (DRRAM). The memory 802 of the systems and methods described herein is intended to comprise, without being limited to, these and any other suitable types of memory.
And the processor 803 may be an integrated circuit chip having signal processing capabilities. In implementation, the steps of the above method may be performed by integrated logic circuitry of hardware or instructions in software form in the processor 803. The processor 803 may 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 device, discrete gate or transistor logic device, discrete hardware components. The disclosed methods, steps, and logic blocks in the embodiments of the present application may be implemented or performed. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. The steps of the method disclosed in connection with the embodiments of the present application may be embodied directly in the execution of a hardware decoding processor, or in the execution of a combination of hardware and software modules in a decoding processor. The software modules may be located in a random access memory, flash memory, read only memory, programmable read only memory, or electrically erasable programmable memory, registers, etc. as well known in the art. The storage medium is located in the memory 802, and the processor 803 reads information in the memory 802, and in combination with its hardware, performs the steps of the above method.
It is to be understood that the embodiments described herein may be implemented in hardware, software, firmware, middleware, microcode, or a combination thereof. For a hardware implementation, the processing units may be implemented within one or more application specific integrated circuits (Application Specific Integrated Circuits, ASIC), digital signal processors (Digital Signal Processing, DSP), digital signal processing devices (DSP devices, DSPD), programmable logic devices (Programmable Logic Device, PLD), field programmable gate arrays (Field-Programmable Gate Array, FPGA), general purpose processors, controllers, microcontrollers, microprocessors, other electronic units designed to perform the functions described herein, or a combination thereof.
For a software implementation, the techniques described herein may be implemented with modules (e.g., procedures, functions, and so on) that perform the functions described herein. The software codes may be stored in a memory and executed by a processor. The memory may be implemented within the processor or external to the processor.
In particular, the processor 803 is further configured to, when running the computer program,
it should be noted that: the technical schemes described in the embodiments of the present application may be arbitrarily combined without any collision.
The foregoing is merely illustrative of the present application, and the present application is not limited thereto, and any person skilled in the art will readily recognize that variations or substitutions are within the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.
Claims (11)
1. A method of validating a graphical interface, the method comprising:
classifying the graphical Application Program Interface (API) to be verified according to the type of the output data to obtain the type corresponding to the graphical API to be verified;
based on a mapping relation between a preset verification use case and an output data type, determining the type corresponding to the graphic API to be verified as the verification use case used for verifying the graphic API to be verified;
and verifying the graphic API to be verified according to the confirmed verification use case.
2. The method of claim 1, wherein the output data type of the graphics API to be validated comprises: a state information type, a base rendering type of few pixels, and a graphics rendering type of multiple pixels; correspondingly, the verification case comprises: status information class use cases, low-pixel base rendering class use cases, and multi-pixel graphics rendering class use cases.
3. The method of claim 2, wherein the validating the graphical API for validation according to the validated validation use case, corresponding to the output data type being a status information type, comprises:
and comparing the output text of the graphic API to be verified with a standard output text result, and confirming the verification result of the graphic API to be verified according to the comparison result.
4. The method of claim 2, wherein the validating the graphics API to be validated according to the validated validation use case, corresponding to the output data type being a low-pixel base drawing type, comprises:
calculating the input sampling vertexes and sampling vertex attributes based on a rendering case model to obtain a theoretical rendering result of the graphic API to be verified;
processing the input sampling vertexes and sampling vertex attributes through the graphics API to be verified to obtain an actual rendering result;
and comparing the theoretical rendering result with the actual rendering result, and confirming the verification result of the graphic API to be verified according to the comparison result.
5. The method of claim 2, wherein the validating the graphics API for validation according to the validated validation use case, corresponding to the output data type being a multi-pixel graphics rendering type, comprises:
and verifying the graphics API to be verified with different granularities based on the set layering judgment strategy.
6. The method of claim 5, wherein the performing different granularity validation of the graphics API to be validated based on the set hierarchical decision strategy comprises:
coding the graphics to be verified and the set golden graphics which are rendered by the graphics to be verified API according to the same compression coding mode, and obtaining a first code corresponding to the graphics to be verified and a second code corresponding to the golden graphics;
comparing the first code with the second code:
if the two patterns are consistent, determining that the pattern to be verified is consistent with the golden pattern;
if the two images are inconsistent, obtaining a difference image by subtracting pixels at positions corresponding to the to-be-verified image and the golden image;
and based on the comparison of the difference graph according to coarse granularity or fine granularity, confirming whether the graph to be verified is similar to the golden graph.
7. The method of claim 6, wherein said comparing, based on said difference pattern, in coarse or fine granularity to confirm whether a pattern to be verified is similar to said golden pattern, comprises:
comparing the square sum of pixel values of the difference pixel points in the difference graph with a set square sum threshold value, and determining the difference degree between the graph to be verified and the golden graph according to a comparison result;
if the difference degree represents that the difference between the to-be-verified graph and the golden graph is smaller, comparing the pixel values of the graph blocks according to the transverse direction and the longitudinal direction based on the difference pixel points in the difference graph, and determining whether the to-be-verified graph is a similar graph of the golden graph according to a comparison result.
8. The method according to claim 7, wherein the comparing the pixel values of the graphics blocks according to the horizontal direction and the vertical direction based on the difference pixel points in the difference graphics, and determining whether the graphics to be verified is a similar graphics of the golden graphics according to the comparison result includes:
selecting a first graph block from a corresponding area in the graph to be verified according to a set size by taking the position of the difference pixel point as a center;
calculating corresponding pixel value difference values in the transverse direction and the longitudinal direction of the first graph block respectively to obtain the increasing and decreasing states of the pixel values in the first graph block;
selecting a second graph block from the corresponding area in the golden graph according to the set size by taking the position of the difference pixel point as the center;
calculating corresponding pixel value difference values in the transverse direction and the longitudinal direction of the second graph block respectively to obtain the increasing and decreasing states of the pixel values in the second graph block;
determining whether there is a position shift or a linear scaling of pixel values between the graphic to be verified and the golden graphic based on a correlation between an increase or decrease state of pixel values within the first graphic block and an increase or decrease state of pixel values within the second graphic block;
if it is determined that the position translation or the pixel value linear scaling exists, whether the graphics to be verified are similar to the golden graphics or not is judged according to the position translation coefficient or the pixel value linear scaling coefficient.
9. A graphical interface verification apparatus, said apparatus comprising: a classification section, a mapping section, a verification section; wherein,,
the classifying part is configured to classify the graphics application program interface API to be verified according to the type of the output data to obtain the type corresponding to the graphics API to be verified;
the mapping part is configured to determine the verification case used for verifying the to-be-verified graphic API according to the type corresponding to the to-be-verified graphic API based on the mapping relation between the preset verification case and the output data type;
the verification section is configured to verify the graphics API to be verified according to the confirmed verification use case.
10. A computing device, the computing device comprising: a communication interface, a memory and a processor; the components are coupled together by a bus system;
the communication interface is used for receiving and transmitting signals in the process of receiving and transmitting information with other external network elements;
the memory is used for storing a computer program capable of running on the processor;
the processor being adapted to perform the steps of the method for verifying a graphical interface as defined in any one of claims 1 to 8 when the computer program is run.
11. A computer storage medium, characterized in that it stores a verification program of a graphical interface, which when executed by at least one processor implements the method steps of the method of verifying a graphical interface according to any of claims 1 to 8.
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)
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)
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)
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 |
-
2020
- 2020-01-08 CN CN202010016488.2A patent/CN111221734B/en active Active
Patent Citations (2)
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)
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 | |
CN112598579B (en) | Monitoring scene-oriented image super-resolution method, device and storage medium | |
CN110427946B (en) | Document image binarization method and device and computing equipment | |
CN113869138A (en) | Multi-scale target detection method and device and computer readable storage medium | |
CN110913219A (en) | Video frame prediction method and device and terminal equipment | |
CN114519858B (en) | Document image recognition method and device, storage medium and electronic equipment | |
CN111047496A (en) | Threshold determination method, watermark detection device and electronic equipment | |
CN112949477A (en) | Information identification method and device based on graph convolution neural network and storage medium | |
CN105427230A (en) | Reversible data hiding method | |
WO2024140568A1 (en) | Image processing method and apparatus, electronic device, and readable storage medium | |
CN117934254A (en) | Watermark processing model training method, watermark processing method, device and equipment | |
CN111008934A (en) | Scene construction method, device, equipment and storage medium | |
Luo et al. | Reversible adversarial steganography for security enhancement | |
CN114418882A (en) | Processing method, training method, device, electronic equipment and medium | |
US20210158103A1 (en) | Electronic apparatus and control method thereof | |
CN110830806A (en) | Video frame prediction method and device and terminal equipment | |
JP2019165434A (en) | Method and apparatus for generating hdr image with reduced clipped area | |
CN116309274B (en) | Method and device for detecting small target in image, computer equipment and storage medium | |
CN114638810B (en) | Document quality analysis method, device, computer equipment and storage medium | |
CN116501649B (en) | Tracker black box attack method and system based on priori information | |
CN117853513A (en) | Image processing method, device, electronic equipment and computer storage medium | |
US20240161445A1 (en) | Object detection apparatus, object detection system, object detection method, and recording medium | |
CN110276720B (en) | Image generation method and device | |
CN114612706B (en) | Image processing method, device, electronic equipment and readable storage medium | |
CN115965856B (en) | Image detection model construction method, device, computer equipment and storage medium |
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. |