Disclosure of Invention
In view of the above, the present invention provides a method, an apparatus, a computer device and a readable storage medium for determining a bottom file of a web page container, which can effectively control the size and quantity of the bottom file of the web page container, such as an advertisement space, and thereby reduce the maintenance cost thereof.
Additional features and advantages of the invention will be set forth in the detailed description which follows, or may be learned by practice of the invention.
According to one aspect of the invention, a method for determining a bottom file of a webpage container is disclosed, which comprises the following steps: acquiring a first reference size from a plurality of reference sizes; determining a first contrast value according to the height, the width and the diagonal line in the first reference dimension and the height, the width and the diagonal line of the current webpage container; comparing the first contrast value with a preset contrast value threshold; and when the first contrast value is smaller than the contrast value threshold value, determining that the size of the webpage container bottom supporting file of the webpage container is a first reference size.
According to an embodiment of the present invention, determining the first contrast value according to the height, the width and the diagonal line in the first reference size and the height, the width and the diagonal line of the current webpage container includes: calculating a first contrast ratio according to the following formula:
wherein C is a first contrast ratio, W1、H1、D1Height, width and diagonal, W, of the web page container, respectively2、H2、D2Respectively, the height, width and diagonal in the first reference dimension, and a is a constant.
According to an embodiment of the invention, the method further comprises: when the first contrast value is larger than or equal to the contrast value threshold value, acquiring a second reference size from the plurality of reference sizes; determining a second contrast value according to the height, the width and the diagonal in the second reference dimension and the height, the width and the diagonal of the webpage container; comparing the second contrast value with a contrast value threshold; and when the second contrast value is smaller than the contrast value threshold value, determining that the size of the webpage container bottom supporting file of the webpage container is a second reference size.
According to an embodiment of the present invention, the plurality of reference sizes are arranged in a queue or a linked list, and the second reference size is a next reference size to the first reference size among the plurality of reference sizes.
According to an embodiment of the invention, the method further comprises: and when no content in the webpage container returns or the connection of a content server providing the content to be presented for the webpage container is timed out, displaying the bottom supporting file of the webpage container in the webpage container.
According to an embodiment of the present invention, the type of the web page container backing file is a picture format.
According to another aspect of the present invention, there is disclosed a web page container backing file determining apparatus, comprising: a reference size acquiring module for acquiring a first reference size from a plurality of reference sizes; the comparison value determining module is used for determining a first comparison value according to the height, the width and the diagonal line in the first reference dimension and the height, the width and the diagonal line of the current webpage container; the comparison value comparison module is used for comparing the first comparison value with a preset comparison value threshold; and the file size determining module is used for determining the size of the bottom supporting file of the webpage container as a first reference size when the first contrast value is smaller than the contrast value threshold.
According to an embodiment of the present invention, the contrast value determination module includes: a comparison value calculation submodule for calculating a first comparison value according to the following formula:
wherein C is a first contrast ratio, W1、H1、D1Height, width and diagonal, W, of the web page container, respectively2、H2、D2Respectively, the height, width and diagonal in the first reference dimension, and a is a constant.
According to an embodiment of the present invention, the type of the web page container backing file is a picture format.
According to another aspect of the present invention, there is disclosed a computer apparatus comprising: one or more processors; and storage means for storing one or more programs; wherein the one or more programs, when executed by the one or more processors, cause the one or more processors to implement any of the web page container hosted file determination methods described above.
According to yet another aspect of the present invention, a computer-readable storage medium is disclosed, having stored thereon computer-executable instructions, which when executed by a processor, implement any of the above-described methods for determining a web page container claim.
According to the method for determining the bottom supporting file of the webpage container, the size of the webpage container is compared with the reference size, and the reference size which is the same as or closest to the size of the webpage container is selected as the size of the bottom supporting file of the webpage container, so that only the reference size with a proper number can be maintained, one bottom supporting file size does not need to be set for each webpage container, and the maintenance workload of the bottom supporting file of the webpage container is effectively reduced.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the invention, as claimed.
Detailed Description
Example embodiments will now be described more fully with reference to the accompanying drawings. Example embodiments may, however, be embodied in many different forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the concept of example embodiments to those skilled in the art. The drawings are merely schematic illustrations of the invention and are not necessarily drawn to scale. The same reference numerals in the drawings denote the same or similar parts, and thus their repetitive description will be omitted.
Furthermore, the described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments. In the following description, numerous specific details are provided to provide a thorough understanding of embodiments of the invention. One skilled in the relevant art will recognize, however, that the invention may be practiced without one or more of the specific details, or with other methods, components, devices, steps, and so forth. In other instances, well-known structures, methods, devices, implementations, or operations are not shown or described in detail to avoid obscuring aspects of the invention.
The method for determining the bottom-supported file of the webpage container can be applied to a background webpage server and is executed by the background webpage server. The background web server can be a single server or a distributed server system. Accordingly, the device for determining the bottom-supported file of the webpage container in the embodiment of the invention is generally arranged in the background webpage server.
The web page container in the embodiment of the present invention may be, for example, an advertisement slot in a web page, or may be another container reserved in the web page, and is used to display and/or play related content acquired from a corresponding content server (e.g., an advertisement server), which is not limited in this respect.
Fig. 1 is a flowchart illustrating a method for determining a bottom file of a web page container according to an exemplary embodiment. As shown in fig. 1, themethod 10 for determining a bottom file of a web page container includes:
in step S102, a reference size is acquired from a plurality of reference sizes.
The multiple reference sizes may be, for example, sizes with a high multiplexing rate in practical application, and the reference sizes are extracted to determine the size of the bottom-supported file of the web page container, so that the adaptation degree of the size of the bottom-supported file of the web page container can be enhanced, and the complexity of comparison calculation can be reduced.
In step S104, a contrast value is determined according to the acquired height, width and diagonal line in the reference size and the height, width and diagonal line of the current web page container.
The comparison value is used to determine a difference between the base size and the size of the webpage container.
The height, width and diagonal line in the reference size and the height, width and diagonal line of the current web page container may be, for example, a pixel (pixel).
In addition, the height, width, and diagonal of the current webpage container may be obtained from the tag (e.g., DIV tag) information of the webpage.
In step S106, the comparison value is compared with a preset comparison value threshold.
The preset contrast threshold may be a fixed value, which is used to measure the difference between the reference size and the size of the web page container, and the value of the preset contrast threshold may be set according to actual requirements in actual applications, for example, if the acceptable difference is larger, the threshold may be set to a larger value in the applications, and if the acceptable difference is smaller, the threshold may be set to a smaller value in the applications. The invention is not limited to this setting of the threshold.
In step S108, when the comparison value is smaller than the comparison value threshold, the size of the web page container bottom file of the web page container is determined as the reference size.
That is, if the degree of difference between the reference size and the size of the web page container is smaller than the ratio threshold, the reference size may be used as the size of the web page container bottom file of the web page container.
According to the method for determining the bottom supporting file of the webpage container, the size of the webpage container is compared with the reference size, and the reference size which is the same as or closest to the size of the webpage container is selected as the size of the bottom supporting file of the webpage container, so that only the reference size with a proper number can be maintained, one bottom supporting file size does not need to be set for each webpage container, and the maintenance workload of the bottom supporting file of the webpage container is effectively reduced.
It should be clearly understood that the present disclosure describes how to make and use particular examples, but the principles of the present disclosure are not limited to any details of these examples. Rather, these principles can be applied to many other embodiments based on the teachings of the present disclosure.
Fig. 2 is a flowchart illustrating another method for determining a web page container backing file according to an example embodiment. As shown in fig. 2, themethod 20 for determining the bottom file of the web page container includes:
in step S202, a reference size is acquired from a plurality of reference sizes.
The multiple reference sizes may be, for example, sizes with a high multiplexing rate in practical application, and the reference sizes are extracted to determine the size of the bottom-supported file of the web page container, so that the adaptation degree of the size of the bottom-supported file of the web page container can be enhanced, and the complexity of comparison calculation can be reduced.
In some embodiments, the plurality of base sizes may be arranged in a queue or linked list, for example. In addition, the number of the plurality of reference sizes can be, for example, between 100 and 200. The number of the reference sizes is maintained between 100 and 200, so that on one hand, the high adaptability of the selected webpage container bottom supporting file according to the reference sizes can be ensured, and on the other hand, the maintenance workload of the reference sizes is not large.
In step S204, a contrast value is determined according to the acquired height, width and diagonal line in the reference size and the height, width and diagonal line of the current web page container.
The comparison value is used to determine a difference between the base size and the size of the webpage container.
The height, width and diagonal line in the reference size and the height, width and diagonal line of the current web page container may be, for example, a pixel (pixel).
In addition, the height, width, and diagonal of the current webpage container may be obtained from the tag (e.g., DIV tag) information of the webpage.
In some embodiments, the contrast value may be calculated according to the following formula.
Wherein C is the contrast value, W1、H1、D1Height, width and diagonal, W, of the web page container, respectively2、H2、D2Respectively, the height, width and diagonal in the reference dimension, and a is a constant. The value of a may be set according to actual requirements, and in an embodiment, a may be set to 10, for example.
In step S206, it is determined whether the contrast is smaller than a preset contrast threshold, and if so, the process goes to step S208; otherwise, return to step S202.
The preset contrast threshold may be a fixed value, which is used to measure the difference between the reference size and the size of the web page container, and the value of the preset contrast threshold may be set according to actual requirements in actual applications, for example, if the acceptable difference is larger, the threshold may be set to a larger value in the applications, and if the acceptable difference is smaller, the threshold may be set to a smaller value in the applications. The invention is not limited to this setting of the threshold.
In step S208, the size of the web page container bottom file of the web page container is determined as the reference size.
That is, if the degree of difference between the reference size and the size of the web page container is smaller than the ratio threshold, the reference size may be used as the size of the web page container bottom file of the web page container.
Otherwise, returning to step S202, a new reference size is obtained from the plurality of reference sizes. In some embodiments, when multiple reference sizes are arranged in a queue or linked list, the newly acquired reference size is the next reference size in the queue or linked list of the previously acquired reference sizes. That is, the size of the bottom file of the web page container is determined by searching the reference size closest to the size of the web page container in a mode of traversing the queue or the linked list.
In step S210, when there is no content returned from the web page container or the connection time of the background content server providing the content to be presented for the web page container is expired, the web page container background file is displayed in the web page container.
In some embodiments, the type of the bottom-supported file of the web page container may be, for example, a picture, such as jpg, tiff, gif, or the like, and may also be in a flash format or an html format, which is not limited herein.
Those skilled in the art will appreciate that all or part of the steps implementing the above embodiments are implemented as computer programs executed by a CPU. The computer program, when executed by the CPU, performs the functions defined by the method provided by the present invention. The program of (a) may be stored in a computer readable storage medium, which may be a read-only memory, a magnetic or optical disk, or the like.
Furthermore, it should be noted that the above-mentioned figures are only schematic illustrations of the processes involved in the method according to exemplary embodiments of the invention, and are not intended to be limiting. It will be readily understood that the processes shown in the above figures are not intended to indicate or limit the chronological order of the processes. In addition, it is also readily understood that these processes may be performed synchronously or asynchronously, e.g., in multiple modules.
The following are embodiments of the apparatus of the present invention that may be used to perform embodiments of the method of the present invention. For details which are not disclosed in the embodiments of the apparatus of the present invention, reference is made to the embodiments of the method of the present invention.
Fig. 3 is a block diagram illustrating an apparatus for determining a web page container claim document according to an exemplary embodiment. As shown in fig. 3, the web page container bottomfile determining apparatus 30 includes: a referencesize acquisition module 302, a contrastvalue determination module 304, a contrastvalue comparison module 306, and a filesize determination module 308.
The referencesize obtaining module 302 is configured to obtain a first reference size from a plurality of reference sizes.
The contrastvalue determination module 304 is configured to determine a first contrast value according to the height, the width, and the diagonal of the first reference size and the height, the width, and the diagonal of the current webpage container.
In some embodiments, the contrastvalue determination module 304 includes; a contrast value calculating submodule 3042 for calculating a first contrast value according to the following formula:
wherein C is a first contrast ratio, W1、H1、D1Height, width and diagonal, W, of the web page container, respectively2、H2、D2Respectively, the height, width and diagonal in the first reference dimension, and a is a constant. The value of a may be set according to actual requirements, and in an embodiment, a may be set to 10, for example.
Thecontrast comparison module 306 is configured to compare the first contrast ratio with a preset contrast threshold.
The filesize determining module 308 is configured to determine the size of the web page container bottom file of the web page container as a first reference size when the first contrast value is smaller than the contrast value threshold.
In some embodiments, the type of the bottom-supported file of the web page container may be, for example, a picture, such as jpg, tiff, gif, or the like, and may also be in a flash format or an html format, which is not limited herein.
According to the web page container bottom file determining device, the size of the web page container is compared with the reference size, and the reference size which is the same as or closest to the size of the web page container is selected as the size of the web page container bottom file of the web page container, so that only the reference size with a proper number can be maintained, one bottom file size does not need to be set for each web page container, and the maintenance workload of the web page container bottom file is effectively reduced.
It is noted that the block diagrams shown in the above figures are functional entities and do not necessarily correspond to physically or logically separate entities. These functional entities may be implemented in the form of software, or in one or more hardware modules or integrated circuits, or in different networks and/or processor devices and/or microcontroller devices.
FIG. 4 is a block diagram illustrating a computer system in accordance with an exemplary embodiment. It should be noted that the computer system shown in fig. 4 is only an example, and should not bring any limitation to the functions and the scope of the application of the embodiments.
As shown in fig. 4, thecomputer system 600 includes a Central Processing Unit (CPU)601 that can perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM)602 or a program loaded from astorage section 608 into a Random Access Memory (RAM) 603. In theRAM 603, various programs and data necessary for the operation of thesystem 600 are also stored. The CPU601,ROM 602, andRAM 603 are connected to each other via abus 604. An input/output (I/O)interface 605 is also connected tobus 604.
The following components are connected to the I/O interface 605: aninput portion 606 including a keyboard, a mouse, and the like; anoutput portion 607 including a display such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, and a speaker; astorage section 608 including a hard disk and the like; and acommunication section 609 including a network interface card such as a LAN card, a modem, or the like. Thecommunication section 609 performs communication processing via a network such as the internet. Thedriver 610 is also connected to the I/O interface 605 as needed. Aremovable medium 611 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on thedrive 610 as necessary, so that a computer program read out therefrom is mounted in thestorage section 608 as necessary.
In particular, according to an embodiment 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 thecommunication section 609, and/or installed from theremovable medium 611. The above-described functions defined in the system of the present application are executed when the computer program is executed by the Central Processing Unit (CPU) 601.
It should be noted that the computer readable medium shown in the present application may 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 application, 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 this application, 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 application. 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 units described in the embodiments of the present application may be implemented by software or hardware. The described units may also be provided in a processor, and may be described as: a processor includes a transmitting unit, an obtaining unit, a determining unit, and a first processing unit. The names of these units do not in some cases constitute a limitation to the unit itself, and for example, the sending unit may also be described as a "unit sending a picture acquisition request to a connected server".
As another aspect, the present application also provides a computer-readable medium, which 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:
acquiring a first reference size from a plurality of reference sizes;
determining a first contrast value according to the height, the width and the diagonal line in the first reference dimension and the height, the width and the diagonal line of the current webpage container;
comparing the first contrast value with a preset contrast value threshold; and
and when the first contrast value is smaller than the contrast value threshold value, determining that the size of the webpage container bottom supporting file of the webpage container is a first reference size.
Exemplary embodiments of the present invention are specifically illustrated and described above. It is to be understood that the invention is not limited to the precise construction, arrangements, or instrumentalities described herein; on the contrary, the invention is intended to cover various modifications and equivalent arrangements included within the spirit and scope of the appended claims.