CN110633197A - Method and device for detecting excessive drawing - Google Patents

Method and device for detecting excessive drawing Download PDF

Info

Publication number
CN110633197A
CN110633197A CN201810650883.9A CN201810650883A CN110633197A CN 110633197 A CN110633197 A CN 110633197A CN 201810650883 A CN201810650883 A CN 201810650883A CN 110633197 A CN110633197 A CN 110633197A
Authority
CN
China
Prior art keywords
attribute
layout file
label
sample layout
overdrawing
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201810650883.9A
Other languages
Chinese (zh)
Other versions
CN110633197B (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.)
Beijing Jingdong Century Trading Co Ltd
Beijing Jingdong Shangke Information Technology Co Ltd
Original Assignee
Beijing Jingdong Century Trading Co Ltd
Beijing Jingdong Shangke Information 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 Beijing Jingdong Century Trading Co Ltd, Beijing Jingdong Shangke Information Technology Co Ltd filed Critical Beijing Jingdong Century Trading Co Ltd
Priority to CN201810650883.9A priority Critical patent/CN110633197B/en
Publication of CN110633197A publication Critical patent/CN110633197A/en
Application granted granted Critical
Publication of CN110633197B publication Critical patent/CN110633197B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3604Software analysis for verifying properties of programs

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • User Interface Of Digital Computer (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention discloses a method and a device for detecting overdrawing, and relates to the technical field of computers. One embodiment of the method comprises: acquiring a layout file to be detected; detecting the layout file to be detected according to the trained detection model, and determining the over-drawing degree of the layout file to be detected; wherein, the detection model is obtained by the training of a recurrent neural network. According to the method, the detection model can be trained according to the history file, and then the layout file with unknown excessive drawing degree can be detected through the model in the development process, so that huge risks and costs of modifying a code structure after the development is completed are avoided, the test time order of magnitude cannot be changed due to the increase of the number of the scene pages, the effect of intelligent static detection is truly achieved, and the test and modification costs are reduced.

Description

Method and device for detecting excessive drawing
Technical Field
The invention relates to the technical field of computers, in particular to a method and a device for detecting overdrawing.
Background
The over-drawing refers to a situation that a certain pixel point on a screen is drawn more than once in one frame due to improper resource calling in a layout file in application development. Excessive drawing can cause a large amount of occupied and wasted CPU and GPU resources, and finally the application runs a time-varying card, the memory usage is increased, even the application runs fast, and bad experience is brought to users; at present, a detection method for overdrawing generally starts GPU overdrawing debugging in developer options, selects an option of starting and displaying an overdrawing area, opens an application to observe colors under each page to determine the degree of overdrawing, and further optimizes codes.
In the process of implementing the invention, the inventor finds that at least the following problems exist in the prior art:
1) under the condition that the number of application scene pages is large, testing personnel is relied on to test each page, and a large amount of testing resources are occupied.
2) Detecting that the page structure that needs to be optimized may already be complex and not well modified or may be costly to modify, results in a risk of delay-up of the application.
3) Detection can only be performed when the application development is complete and can be run.
Disclosure of Invention
In view of this, embodiments of the present invention provide a detection method and apparatus for overdrawing, which can train a detection model according to a history file, and further can detect a layout file with unknown overdrawing degree through the model in a development process, thereby avoiding a huge risk and cost of modifying a code structure after the development is completed, and an increase in the number of scene pages does not cause a change in the test time order, thereby truly achieving an effect of intelligent static detection, and reducing the test and modification costs.
To achieve the above object, according to an aspect of an embodiment of the present invention, there is provided a method of detecting overdraw, including:
acquiring a layout file to be detected;
detecting the layout file to be detected according to the trained detection model, and determining the over-drawing degree of the layout file to be detected;
wherein, the detection model is obtained by the training of a recurrent neural network.
Optionally, the training samples for training the detection model include: each sample layout file with known overdrawing degree and an overdrawing identifier of each sample layout file;
wherein the overdraw identification of the sample layout file is determined as follows: and taking the identifier corresponding to the maximum overdrawing degree in the page presented by the sample layout file as the overdrawing identifier.
Optionally, the method further comprises: determining a label vector and an attribute vector group corresponding to each sample layout file; and taking the label vector and the attribute vector group corresponding to each sample layout file as model input, taking the over-drawn identifier of each sample layout file as model output, and obtaining the detection model through recurrent neural network training.
Optionally, determining the tag vector and the attribute vector group corresponding to each sample layout file includes:
arranging label identifications corresponding to the labels according to the sequence of the labels in the sample layout file to obtain label vectors;
for each label in the sample layout file, arranging attribute values of each attribute in the label according to the attribute sequence in an attribute sequence table to obtain an attribute vector corresponding to the label; and arranging the attribute vector corresponding to each label according to the appearance sequence of each label in the sample layout file to obtain the attribute vector group.
Optionally, before the attribute values of the attributes in the tag are sequentially arranged according to the attributes in the attribute sequence table, the method further includes:
for each attribute in the tag, determining whether the attribute appears in an attribute order table; if yes, setting the attribute value of the attribute as a first preset value; if the attribute does not appear, setting the attribute value of the attribute as a second preset value; the first preset value and the second preset value are not equal.
According to still another aspect of an embodiment of the present invention, there is provided an overdraw detection apparatus including:
the data acquisition module is used for acquiring a layout file to be detected;
the detection module is used for detecting the layout file to be detected according to the trained detection model and determining the over-drawing degree of the layout file to be detected;
wherein, the detection model is obtained by the training of a recurrent neural network.
Optionally, the training samples for training the detection model include: each sample layout file with known overdrawing degree and an overdrawing identifier of each sample layout file;
the detection module is further configured to: and taking the identifier corresponding to the maximum overdrawing degree in the page presented by the sample layout file as the overdrawing identifier.
Optionally, the detection module is further configured to: determining a label vector and an attribute vector group corresponding to each sample layout file; and taking the label vector and the attribute vector group corresponding to each sample layout file as model input, taking the over-drawn identifier of each sample layout file as model output, and obtaining the detection model through recurrent neural network training.
Optionally, the determining, by the detection module, a tag vector and an attribute vector group corresponding to each sample layout file includes:
arranging label identifications corresponding to the labels according to the sequence of the labels in the sample layout file to obtain label vectors;
for each label in the sample layout file, arranging attribute values of each attribute in the label according to the attribute sequence in an attribute sequence table to obtain an attribute vector corresponding to the label; and arranging the attribute vector corresponding to each label according to the appearance sequence of each label in the sample layout file to obtain the attribute vector group.
Optionally, before the attribute values of the attributes in the tag are sequentially arranged according to the attributes in the attribute sequence table, the detection module is further configured to:
for each attribute in the tag, determining whether the attribute appears in an attribute order table; if yes, setting the attribute value of the attribute as a first preset value; if the attribute does not appear, setting the attribute value of the attribute as a second preset value; the first preset value and the second preset value are not equal.
According to another aspect of an embodiment of the present invention, there is provided an overdraw detection electronic device including:
one or more processors;
a storage device for storing one or more programs,
when the one or more programs are executed by the one or more processors, the one or more processors implement the method for detecting overdraw provided by the present invention.
According to still another aspect of an embodiment of the present invention, there is provided a computer-readable medium on which a computer program is stored, the program, when executed by a processor, implementing the method for detecting overdraw provided by the present invention.
One embodiment of the above invention has the following advantages or benefits: because the technical means of detecting the layout file to be detected according to the trained detection model is adopted, huge risks and costs of modifying a code structure after the development is completed are avoided, the technical effect that the layout file with unknown excessive drawing degree can be detected through the model in the development process is further achieved, the test time order of magnitude cannot be changed due to the increase of the number of the scene pages, the intelligent static detection effect is truly achieved, and the test and modification cost is reduced.
Further effects of the above-mentioned non-conventional alternatives will be described below in connection with the embodiments.
Drawings
The drawings are included to provide a better understanding of the invention and are not to be construed as unduly limiting the invention. Wherein:
FIG. 1 is a schematic diagram of a main flow of an overdraw detection method according to an embodiment of the present invention;
FIG. 2 is a schematic diagram of the major blocks of an over-drawn detection apparatus according to an embodiment of the present invention;
FIG. 3 is an exemplary system architecture diagram in which embodiments of the present invention may be employed;
fig. 4 is a schematic block diagram of a computer system suitable for use in implementing a terminal device or server of an embodiment of the invention.
Detailed Description
Exemplary embodiments of the present invention are described below with reference to the accompanying drawings, in which various details of embodiments of the invention are included to assist understanding, and which are to be considered as merely exemplary. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the invention. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
Fig. 1 is a schematic diagram of a main flow of an overdrawn detection method according to an embodiment of the present invention, as shown in fig. 1, including:
s101, obtaining a layout file to be detected;
s102, detecting the layout file to be detected according to the trained detection model, and determining the over-drawing degree of the layout file to be detected;
wherein, the detection model is obtained by the training of a recurrent neural network.
The layout file to be detected may be a complete XML (extensible markup language) code file after the development of an application (e.g., an Android application) is completed, or may be an XML code file that only contains tags and attribute structures during the development of the application.
The method and the device detect the layout file with unknown over-drawing degree according to the trained detection model, and further can detect the layout file when the application is not developed or cannot run, so that the huge risk of modifying the code structure after the development is finished is avoided, the order of magnitude of the test time is not changed due to the increase of the number of the scene pages, and the test and modification costs are reduced.
In some embodiments, training samples for training the detection model include: each sample layout file with known overdrawing degree and an overdrawing identifier of each sample layout file;
wherein the overdraw identification of the sample layout file is determined as follows: and taking the identifier corresponding to the maximum overdrawing degree in the page presented by the sample layout file as the overdrawing identifier.
The sample layout file may be an XML file in a tested development-ready executable application.
Taking an Android application as an example, the degree of overdrawing can be determined by starting GPU overdrawing debugging in developer options of an Android system, selecting to start and display an overdrawing area option, then opening the application, and observing the color of each area in an application page in operation;
the colors inherent in the Android system representing overdrawing and the degree of overdrawing corresponding to the colors include: the primary color represents that the current area is not over-drawn, the blue color represents that the current area is over-drawn for 1 time, the green color represents that the current area is over-drawn for 2 times, the pink color represents that the current area is over-drawn for 3 times, and the red color represents that the current area is over-drawn for 4 times or more;
the over-rendering flag may sequentially represent the primary colors blue, green, pink, red by N, B, G, P, R, or sequentially represent the primary colors blue, green, pink, red by 0, 1,2, 3, 4.
When a page presented by a layout file has multiple overdrawing degrees, the identifier corresponding to the maximum overdrawing degree in the page can be used as the overdrawing identifier;
and if the green area and the red area exist in the current page, the maximum overdrawing degree in the page is 4 times or more, and the overdrawing identifier of the layout file is represented by R or 4 corresponding to the red.
In some embodiments, when training the detection model, the label vector and the attribute vector group corresponding to each sample layout file may be determined first; and then, taking the label vector and the attribute vector group corresponding to each sample layout file as model input, taking the overdrawing identifier of each sample layout file as model output, and obtaining the detection model through recurrent neural network training.
The tags are in an XML language library, such as Linear layout, Relativelayout;
the label vector is determined according to labels in the sample layout files, and one label vector can be determined by one sample layout file;
the label vector may be determined according to the order in which the labels appear in the layout file;
the label vector can also be determined according to a preset sequence based on the labels in the layout file; wherein although the order of the labels is not arranged according to the order of the appearance of the labels, other methods can be adopted, such as converting the label vector into the order of appearance of the labels in the layout file again by training other models.
The attribute is in a language library of a development language, such as Background and height;
the attribute vectors are determined according to attributes in the tags, and one tag can correspond to one attribute vector; the set of attribute vectors may be determined from the attribute vectors corresponding to each tag in a layout file.
The attribute vector may be determined only from the attributes present in the current tag; if only the attribute Background exists in the current tag, the attribute vector of the tag may only include the attribute value representing the Background attribute;
the attribute vector can also be determined according to all attributes in the language library based on the attributes appearing in the current tag; if only the attribute Background exists in the current tag, the attribute vector of the tag may include all attribute information, where the Background may be represented by a preset numerical value, and the other attributes except Background may be represented by a value of 0.
The Recurrent Neural network may be RNN (Recurrent Neural Networks) or LSTM (Long Short-Term Memory, a special Recurrent Neural network).
In some embodiments, determining the label vector and the attribute vector group corresponding to each sample layout file includes:
arranging label identifications corresponding to the labels according to the sequence of the labels in the sample layout file to obtain label vectors;
for each label in the sample layout file, arranging attribute values of each attribute in the label according to the attribute sequence in an attribute sequence table to obtain an attribute vector corresponding to the label; and arranging the attribute vector corresponding to each label according to the appearance sequence of each label in the sample layout file to obtain the attribute vector group.
The attribute order table may be preset.
In some embodiments, before the attribute values of the attributes in the tag are sequentially arranged according to the attributes in the attribute sequence table, the method further includes:
for each attribute in the tag, determining whether the attribute appears in an attribute order table; if yes, setting the attribute value of the attribute as a first preset value; if the attribute does not appear, setting the attribute value of the attribute as a second preset value; the first preset value and the second preset value are not equal. The first preset value and the second preset value are both adjustable, such as: the first preset value is set to 1 and the second preset value is set to 0.
To facilitate understanding of the method for determining a tag vector and an attribute vector set according to the present invention, a specific embodiment is as follows:
for the subject content in the following layout file:
<Linearlayout background=”white”>
<Relativelayout background=”black”>
</Relativelayout>
</Linearlayout>;
determining label identifications corresponding to labels Linearlayout and Relativelayout which appear in the main body content in the layout file, such as: the label identification of Linearlayout can be determined to be 1, and the label identification of Relativelayout can be determined to be 2; further, tag identifiers corresponding to each tag are arranged according to the sequence of occurrence of each tag in the present embodiment, so that a tag vector can be obtained: [1,2 ];
determining attribute values of the attributes in each label, such as: the attribute value of the attribute background can be determined to be 7; further, for each tag in this specific embodiment, the attribute values of each attribute in the tag are arranged according to the attribute sequence in the attribute sequence table to obtain an attribute vector corresponding to the tag: the attribute vector corresponding to the tag with tag identifier 1 is: [7] and the attribute vector corresponding to the label with the label identifier of 2 is as follows: [7] (ii) a Wherein, the attribute vector corresponding to each label only has the attribute value of the attribute appearing in the label;
then, the attribute vector corresponding to each label is arranged according to the sequence of the labels in the embodiment to obtain the attribute vector group: [[7],[7]].
In the foregoing embodiment, for each tag, an attribute vector may also be determined according to whether each attribute in the tag appears in the attribute sequence table and an attribute sequence in the attribute sequence table, where: in this embodiment, only the attribute background appears in the tag with tag identifier 1, and querying the attribute value in the attribute sequence table can determine that the attribute value of background is 7 and background is ranked first, so that the attribute vector corresponding to the tag with tag identifier 1 can be obtained as follows: [7,0,0, … ]; similarly, the attribute vector corresponding to the tag with tag identification 2 is obtained as: [7,0,0, … ];
then, the attribute vector corresponding to each label is arranged according to the sequence of the labels in the embodiment to obtain the attribute vector group: [ [7,0,0, … ], [7,0,0, … ] ].
Fig. 2 is a schematic diagram of main blocks of an over-rendering detection apparatus according to an embodiment of the present invention, and as shown in fig. 2, an over-rendering detection 200 includes:
a data obtaining module 201, configured to obtain a layout file to be detected;
the detection module 202 is configured to detect the layout file to be detected according to the trained detection model, and determine an over-drawing degree of the layout file to be detected;
wherein, the detection model is obtained by the training of a recurrent neural network.
The layout file to be detected may be a complete XML (extensible markup language) code file after the development of an application (e.g., an Android application or an IOS application) is completed, or may be an XML code file that only contains tags and attribute structures during the development of the application.
The method and the device detect the layout file with unknown over-drawing degree according to the trained detection model, and further can detect the layout file when the application is not developed or cannot run, so that the huge risk of modifying the code structure after the development is finished is avoided, the order of magnitude of the test time is not changed due to the increase of the number of the scene pages, and the test and modification costs are reduced.
In some embodiments of the present invention, the,
the training samples for training the detection model include: each sample layout file with known overdrawing degree and an overdrawing identifier of each sample layout file;
the detection module 202 is further configured to: and taking the identifier corresponding to the maximum overdrawing degree in the page presented by the sample layout file as the overdrawing identifier.
The sample layout file may be an XML file in a tested development-ready executable application.
Taking an Android application as an example, the degree of overdrawing can be determined by starting GPU overdrawing debugging in developer options of an Android system, selecting to start and display an overdrawing area option, then opening the application, and observing the color of each area in an application page in operation;
the colors inherent in the Android system representing overdrawing and the degree of overdrawing corresponding to the colors include: the primary color represents that the current area is not over-drawn, the blue color represents that the current area is over-drawn for 1 time, the green color represents that the current area is over-drawn for 2 times, the pink color represents that the current area is over-drawn for 2 times, and the red color represents that the current area is over-drawn for 4 times or more;
the over-rendering flag may sequentially represent the primary colors blue, green, pink, red by N, B, G, P, R, or sequentially represent the primary colors blue, green, pink, red by 0, 1,2, 4.
When a page presented by a layout file has multiple overdrawing degrees, taking an identifier corresponding to the maximum overdrawing degree in the page as an overdrawing identifier;
and if the green area and the red area exist in the current page, the maximum overdrawing degree in the page is 4 times or more, and the overdrawing identifier of the layout file is represented by R or 4 corresponding to the red.
In some embodiments, when training the detection model, the detection module 202 may first determine a label vector and an attribute vector set corresponding to each sample layout file; and then, taking the label vector and the attribute vector group corresponding to each sample layout file as model input, taking the overdrawing identifier of each sample layout file as model output, and obtaining the detection model through recurrent neural network training.
The tags are in an XML language library, such as Linear layout, Relativelayout;
the label vector is determined according to labels in the sample layout files, and one label vector can be determined by one sample layout file;
the label vector may be determined according to the order in which the labels appear in the layout file;
the label vector can also be determined according to a preset sequence based on the labels in the layout file; wherein although the order of the labels is not arranged according to the order of the appearance of the labels, other methods can be adopted, such as converting the label vector into the order of appearance of the labels in the layout file again by training other models.
The attribute is in a language library of a development language, such as Background and height;
the attribute vectors are determined according to attributes in the tags, and one tag can correspond to one attribute vector; the set of attribute vectors may be determined from the attribute vectors corresponding to each tag in a layout file.
The attribute vector may be determined only from the attributes present in the current tag; if only the attribute Background exists in the current tag, the attribute vector of the tag may only include the attribute value representing the Background attribute;
the attribute vector can also be determined according to all attributes in the language library based on the attributes appearing in the current tag; if only the attribute Background exists in the current tag, the attribute vector of the tag may include all attribute information, where the Background may be represented by a preset numerical value, and the other attributes except Background may be represented by a value of 0.
The Recurrent Neural network may be RNN (Recurrent Neural Networks) or LSTM (Long Short-Term Memory, a special Recurrent Neural network).
In some embodiments, the determining module 202 determines the label vector and the attribute vector group corresponding to each sample layout file, including:
arranging label identifications corresponding to the labels according to the sequence of the labels in the sample layout file to obtain label vectors;
for each label in the sample layout file, arranging attribute values of each attribute in the label according to the attribute sequence in an attribute sequence table to obtain an attribute vector corresponding to the label; and arranging the attribute vector corresponding to each label according to the appearance sequence of each label in the sample layout file to obtain the attribute vector group.
The attribute order table may be preset.
In some embodiments, before the attribute values of the attributes in the tag are arranged according to the attribute order in the attribute order table, the detecting module 202 is further configured to:
for each attribute in the tag, determining whether the attribute appears in an attribute order table; if yes, setting the attribute value of the attribute as a first preset value; if the attribute does not appear, setting the attribute value of the attribute as a second preset value; the first preset value and the second preset value are not equal.
The first preset value and the second preset value are both adjustable, such as: the first preset value is set to 1 and the second preset value is set to 0.
Fig. 3 illustrates an exemplary system architecture 400 to which an over-drawn detection method or an over-drawn detection apparatus of an embodiment of the present invention may be applied.
Fig. 3 illustrates an exemplary system architecture 300 to which an over-drawn detection method or an over-drawn detection apparatus of an embodiment of the present invention may be applied.
As shown in fig. 3, the system architecture 300 may include terminal devices 301, 302, 303, a network 304, and a server 305. The network 304 serves as a medium for providing communication links between the terminal devices 301, 302, 303 and the server 305. Network 304 may include various connection types, such as wired, wireless communication links, or fiber optic cables, to name a few.
The user may use the terminal device 301, 302, 303 to interact with the server 305 via the network 304 to receive or send messages or the like. The terminal devices 301, 302, 303 may have various communication client applications installed thereon, such as shopping applications, web browser applications, search applications, instant messaging tools, mailbox clients, social platform software, and the like.
The terminal devices 301, 302, 303 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop portable computers, desktop computers, and the like.
The server 305 may be a server providing various services, such as a background management server providing support for shopping websites browsed by the user using the terminal devices 301, 302, 303. The background management server can analyze and process the received data such as the product information inquiry request and feed back the processing result to the terminal equipment.
It should be noted that the method for detecting overdrawing provided by the embodiment of the present invention is generally executed by the server 305, and accordingly, the detecting device for overdrawing is generally disposed in the server 305.
It should be understood that the number of terminal devices, networks, and servers in fig. 3 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
As shown in fig. 4, the computer system 400 includes a Central Processing Unit (CPU)401 that can perform various appropriate actions and processes in accordance with a program stored in a Read Only Memory (ROM)402 or a program loaded from a storage section 408 into a Random Access Memory (RAM) 403. In the RAM 403, various programs and data necessary for the operation of the system 400 are also stored. The CPU 401, ROM 402, and RAM 403 are connected to each other via a bus 404. An input/output (I/O) interface 405 is also connected to bus 404.
The following components are connected to the I/O interface 405: an input section 406 including a keyboard, a mouse, and the like; an output section 407 including a display device such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, and a speaker; a storage section 408 including a hard disk and the like; and a communication section 409 including a network interface card such as a LAN card, a modem, or the like. The communication section 409 performs communication processing via a network such as the internet. A driver 410 is also connected to the I/O interface 405 as needed. A removable medium 411 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 410 as necessary, so that a computer program read out therefrom is mounted into the storage section 408 as necessary.
In particular, according to the embodiments of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method illustrated in the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network through the communication section 409, and/or installed from the removable medium 411. The computer program performs the above-described functions defined in the system of the present invention when executed by a Central Processing Unit (CPU) 401.
It should be noted that the computer readable medium shown in the present invention can be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present invention, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In the present invention, however, a computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The modules described in the embodiments of the present invention may be implemented by software or hardware. The described modules may also be provided in a processor, which may be described as: a processor includes a data acquisition module and a detection module. The names of these modules do not form a limitation to the modules themselves in some cases, and for example, the acquiring module may also be described as a "unit that sends a file acquiring request to a connected server".
As another aspect, the present invention also provides a computer-readable medium that may be contained in the apparatus described in the above embodiments; or may be separate and not incorporated into the device. The computer readable medium carries one or more programs which, when executed by a device, cause the device to comprise: s101, obtaining a layout file to be detected; s102, detecting the layout file to be detected according to the trained detection model, and determining the over-drawing degree of the layout file to be detected; wherein, the detection model is obtained by the training of a recurrent neural network.
According to the technical scheme of the embodiment of the invention, as the technical means of detecting the layout file to be detected according to the trained detection model is adopted, the huge risk and cost of modifying the code structure after the development is finished are avoided, the technical effect that the layout file with unknown over-drawing degree can be detected through the model in the development process is further realized, the increase of the number of the scene pages can not cause the change of the test time order, the intelligent static detection effect is really achieved, and the test and modification cost is reduced.
The above-described embodiments should not be construed as limiting the scope of the invention. Those skilled in the art will appreciate that various modifications, combinations, sub-combinations, and substitutions can occur, depending on design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (12)

1. A method for detecting overdraw, comprising:
acquiring a layout file to be detected;
detecting the layout file to be detected according to the trained detection model, and determining the over-drawing degree of the layout file to be detected;
wherein, the detection model is obtained by the training of a recurrent neural network.
2. The method of claim 1, wherein training samples for training the detection model comprise: each sample layout file with known overdrawing degree and an overdrawing identifier of each sample layout file;
wherein the overdraw identification of the sample layout file is determined as follows: and taking the identifier corresponding to the maximum overdrawing degree in the page presented by the sample layout file as the overdrawing identifier.
3. The method of claim 2, further comprising: determining a label vector and an attribute vector group corresponding to each sample layout file; and taking the label vector and the attribute vector group corresponding to each sample layout file as model input, taking the over-drawn identifier of each sample layout file as model output, and obtaining the detection model through recurrent neural network training.
4. The method of claim 3, wherein determining the set of label vectors and attribute vectors for each sample layout file comprises:
arranging label identifications corresponding to the labels according to the sequence of the labels in the sample layout file to obtain label vectors;
for each label in the sample layout file, arranging attribute values of each attribute in the label according to the attribute sequence in an attribute sequence table to obtain an attribute vector corresponding to the label; and arranging the attribute vector corresponding to each label according to the appearance sequence of each label in the sample layout file to obtain the attribute vector group.
5. The method of claim 4, wherein before sequentially arranging the attribute values of the attributes in the tag according to the attributes in the attribute order table, the method further comprises:
for each attribute in the tag, determining whether the attribute appears in an attribute order table; if yes, setting the attribute value of the attribute as a first preset value; if the attribute does not appear, setting the attribute value of the attribute as a second preset value; the first preset value and the second preset value are not equal.
6. An overdraw detection apparatus, comprising:
the data acquisition module is used for acquiring a layout file to be detected;
the detection module is used for detecting the layout file to be detected according to the trained detection model and determining the over-drawing degree of the layout file to be detected;
wherein, the detection model is obtained by the training of a recurrent neural network.
7. The apparatus of claim 6, wherein training samples for training the detection model comprise: each sample layout file with known overdrawing degree and an overdrawing identifier of each sample layout file;
the detection module is further configured to: and taking the identifier corresponding to the maximum overdrawing degree in the page presented by the sample layout file as the overdrawing identifier.
8. The apparatus of claim 7, wherein the detection module is further configured to: determining a label vector and an attribute vector group corresponding to each sample layout file; and taking the label vector and the attribute vector group corresponding to each sample layout file as model input, taking the over-drawn identifier of each sample layout file as model output, and obtaining the detection model through recurrent neural network training.
9. The apparatus of claim 8, wherein the detection module determines the label vector and the set of attribute vectors corresponding to each sample layout file, comprising:
arranging label identifications corresponding to the labels according to the sequence of the labels in the sample layout file to obtain label vectors;
for each label in the sample layout file, arranging attribute values of each attribute in the label according to the attribute sequence in an attribute sequence table to obtain an attribute vector corresponding to the label; and arranging the attribute vector corresponding to each label according to the appearance sequence of each label in the sample layout file to obtain the attribute vector group.
10. The apparatus of claim 9, wherein before the attribute values of the attributes in the tag are arranged according to the attribute order in the attribute order table, the detection module is further configured to:
for each attribute in the tag, determining whether the attribute appears in an attribute order table; if yes, setting the attribute value of the attribute as a first preset value; if the attribute does not appear, setting the attribute value of the attribute as a second preset value; the first preset value and the second preset value are not equal.
11. An overdraw detection electronic device, comprising:
one or more processors;
a storage device for storing one or more programs,
when executed by the one or more processors, cause the one or more processors to implement the method of any one of claims 1-5.
12. A computer-readable medium, on which a computer program is stored, which, when being executed by a processor, carries out the method according to any one of claims 1-5.
CN201810650883.9A 2018-06-22 2018-06-22 Method and device for detecting excessive drawing Active CN110633197B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810650883.9A CN110633197B (en) 2018-06-22 2018-06-22 Method and device for detecting excessive drawing

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810650883.9A CN110633197B (en) 2018-06-22 2018-06-22 Method and device for detecting excessive drawing

Publications (2)

Publication Number Publication Date
CN110633197A true CN110633197A (en) 2019-12-31
CN110633197B CN110633197B (en) 2024-04-12

Family

ID=68967618

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810650883.9A Active CN110633197B (en) 2018-06-22 2018-06-22 Method and device for detecting excessive drawing

Country Status (1)

Country Link
CN (1) CN110633197B (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111538657A (en) * 2020-04-17 2020-08-14 北京字节跳动网络技术有限公司 Page over-drawing detection method and device, electronic equipment and readable medium

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104866318A (en) * 2015-06-05 2015-08-26 北京金山安全软件有限公司 Method and device for displaying label pages in multiple windows
CN104866554A (en) * 2015-05-15 2015-08-26 大连理工大学 Personalized searching method and system on basis of social annotation
CN105205396A (en) * 2015-10-15 2015-12-30 上海交通大学 Detecting system for Android malicious code based on deep learning and method thereof
CN106203103A (en) * 2016-06-23 2016-12-07 百度在线网络技术(北京)有限公司 The method for detecting virus of file and device
CN106227649A (en) * 2016-07-08 2016-12-14 北京奇虎科技有限公司 A kind of test the application method and apparatus that excessively renders of the page
JP2017073046A (en) * 2015-10-09 2017-04-13 富士通株式会社 Layout verification method, layout verification device and program
CN106959966A (en) * 2016-01-12 2017-07-18 腾讯科技(深圳)有限公司 A kind of information recommendation method and system
CN106971154A (en) * 2017-03-16 2017-07-21 天津大学 Pedestrian's attribute forecast method based on length memory-type recurrent neural network
CN107437417A (en) * 2017-08-02 2017-12-05 中国科学院自动化研究所 Based on speech data Enhancement Method and device in Recognition with Recurrent Neural Network speech recognition
CN107545241A (en) * 2017-07-19 2018-01-05 百度在线网络技术(北京)有限公司 Neural network model is trained and biopsy method, device and storage medium

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104866554A (en) * 2015-05-15 2015-08-26 大连理工大学 Personalized searching method and system on basis of social annotation
CN104866318A (en) * 2015-06-05 2015-08-26 北京金山安全软件有限公司 Method and device for displaying label pages in multiple windows
JP2017073046A (en) * 2015-10-09 2017-04-13 富士通株式会社 Layout verification method, layout verification device and program
CN105205396A (en) * 2015-10-15 2015-12-30 上海交通大学 Detecting system for Android malicious code based on deep learning and method thereof
CN106959966A (en) * 2016-01-12 2017-07-18 腾讯科技(深圳)有限公司 A kind of information recommendation method and system
CN106203103A (en) * 2016-06-23 2016-12-07 百度在线网络技术(北京)有限公司 The method for detecting virus of file and device
CN106227649A (en) * 2016-07-08 2016-12-14 北京奇虎科技有限公司 A kind of test the application method and apparatus that excessively renders of the page
CN106971154A (en) * 2017-03-16 2017-07-21 天津大学 Pedestrian's attribute forecast method based on length memory-type recurrent neural network
CN107545241A (en) * 2017-07-19 2018-01-05 百度在线网络技术(北京)有限公司 Neural network model is trained and biopsy method, device and storage medium
CN107437417A (en) * 2017-08-02 2017-12-05 中国科学院自动化研究所 Based on speech data Enhancement Method and device in Recognition with Recurrent Neural Network speech recognition

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111538657A (en) * 2020-04-17 2020-08-14 北京字节跳动网络技术有限公司 Page over-drawing detection method and device, electronic equipment and readable medium
CN111538657B (en) * 2020-04-17 2023-05-12 抖音视界有限公司 Page overdrawing detection method and device, electronic equipment and readable medium

Also Published As

Publication number Publication date
CN110633197B (en) 2024-04-12

Similar Documents

Publication Publication Date Title
CN110708346B (en) Information processing system and method
US20200057550A1 (en) Method and apparatus for generating customized visualization component
CN109359194B (en) Method and apparatus for predicting information categories
CN106896937A (en) Method and apparatus for being input into information
CN113031946A (en) Method and device for rendering page component
CN107330087B (en) Page file generation method and device
JP7261732B2 (en) Method and apparatus for determining character color
CN113190152A (en) Method and device for switching application program theme
CN109582317A (en) Method and apparatus for debugging boarding application
CN113553123B (en) Data processing method, device, electronic equipment and storage medium
CN112486482A (en) Page display method and device
CN113282444A (en) Visualization method and device for business process debugging
CN113923474A (en) Video frame processing method and device, electronic equipment and storage medium
CN109597912A (en) Method for handling picture
CN110633197B (en) Method and device for detecting excessive drawing
CN112947918A (en) Data display method and device
CN112433713A (en) Application program design graph processing method and device
CN110069186B (en) Method and equipment for displaying operation interface of application
CN108664610B (en) Method and apparatus for processing data
CN112860538A (en) Method and device for performing interface regression test based on online log
CN110647327A (en) Method and device for dynamic control of user interface based on card
CN113296771B (en) Page display method, device, equipment and computer readable medium
CN113626301B (en) Method and device for generating test script
CN111125501B (en) Method and device for processing information
CN113655942A (en) Chart data display method and device

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