Detailed Description
The present application will be described in further detail with reference to the following drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the relevant invention and not restrictive of the invention. It should be noted that, for convenience of description, only the portions related to the related invention are shown in the drawings.
It should be noted that the embodiments and features of the embodiments in the present application may be combined with each other without conflict. The present application will be described in detail below with reference to the embodiments with reference to the attached drawings.
Fig. 1 illustrates anexemplary system architecture 100 to which embodiments of the pagefile generation method or pagefile generation apparatus of the present application may be applied.
As shown in fig. 1, thesystem architecture 100 may includeterminal devices 101, 102, 103, anetwork 104, and aserver 105. Thenetwork 104 serves as a medium for providing communication links between theterminal devices 101, 102, 103 and theserver 105.Network 104 may include various connection types, such as wired, wireless communication links, or fiber optic cables, to name a few.
The user may use theterminal devices 101, 102, 103 to interact with theserver 105 via thenetwork 104 to receive or send messages or the like. Theterminal devices 101, 102, 103 may have installed thereon various communication client applications, such as a web browser application, a file editing application, a shopping-like application, a search-like application, an instant messaging tool, a mailbox client, social platform software, and the like.
Theterminal devices 101, 102, 103 may be various electronic devices having a display screen and supporting page browsing, including but not limited to smart phones, tablet computers, e-book readers, MP3 players (Moving Picture experts Group Audio Layer III, mpeg compression standard Audio Layer 3), MP4 players (Moving Picture experts Group Audio Layer IV, mpeg compression standard Audio Layer 4), laptop portable computers, desktop computers, and the like.
Theserver 105 may be a server providing various services, such as a background web server providing support for web pages displayed on theterminal devices 101, 102, 103. The background web server may analyze and perform other processing on the received data such as the page file acquisition request, and feed back a processing result (e.g., the page file) to the terminal device.
It should be noted that the method for generating a pagefile provided by the embodiment of the present application is generally executed by theserver 105, and accordingly, the pagefile generating apparatus is generally disposed in theserver 105.
It should be understood that the number of terminal devices, networks, and servers in fig. 1 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
With continued reference to FIG. 2, aflow 200 of one embodiment of a pagefile generation method according to the present application is shown. The method for generating the page file comprises the following steps:
step 201, receiving a page file obtaining request sent by a client.
In this embodiment, an electronic device (for example, a server shown in fig. 1) on which the method for generating a pagefile operates may receive a pagefile acquisition request from a client (terminal device) with which a user performs page browsing in a wired connection manner or a wireless connection manner. The page file obtaining request comprises an identification of a page corresponding to the page file, a type of the client and a version number of an installed page display application of the client. The version number may be used to reflect the high and low of the version of the application.
A pagefile is a file that includes data to build a page. The data for constructing the page, that is, the data for configuring the page, may include data indicating a color of the page, data indicating a search template adopted by the page, data indicating a navigation bar in the page, and the like. The page file acquisition request is a request sent by the client to the electronic device to acquire the page file. The identification of the page corresponding to the page file is used for distinguishing and identifying the page, and different pages have different page identifications. When the page is represented in different forms, the adopted identifiers are consistent, namely, the same page can be represented in different forms (such as a native page and a hypertext markup language page), but the different forms of the page share the same page identifier. In addition, the page and the pagefile may share the same identifier. Here, the identification of the page may be an ID of the page. The type of the client is a type divided according to the operating environment of the client. For example, the client of the ios system for the tablet computer, the client of the ios system for the mobile phone, and the client of the Android system are provided. The client for the android system can be further subdivided into a client for the android system of the tablet computer, a client for the android system of the mobile phone, and the like. The page display application is an application capable of page display.
It should be noted that the wireless connection means may include, but is not limited to, a 3G/4G connection, a WiFi connection, a bluetooth connection, a WiMAX connection, a Zigbee connection, a uwb (ultra wideband) connection, and other wireless connection means now known or developed in the future. The page may include html format, xhtml format, asp format, php format, jsp format, shtml format, nsp format, xml format, or other future-developed format (as long as the page file in such format can be opened by the browser and the contents of pictures, animations, text, etc. contained therein can be viewed).
Step 202, according to the identification and the type, determining a target page file and a target lowest version number from the pre-stored page file and the lowest version number.
In this embodiment, the electronic device determines, according to the received identifier and type, a target pagefile and a target lowest version number corresponding to the identifier and type from pre-stored pagefiles and lowest version numbers. In particular, the pre-stored pagefile and lowest version number may be stored in a database or cache of the electronic device or other electronic devices with which it is communicatively coupled. The target page file refers to the determined page file corresponding to the identifier and the type. The lowest version number is the number of the lowest version of the page display application for displaying the native page corresponding to the page file, and the lowest version numbers of the page display applications installed on different types of clients are different. The target lowest version number is the lowest version number determined to correspond to the above-described identifier and type. A native page generally refers to a page that can be directly displayed.
Specifically, the pagefile with the identifier identical to the identifier in the pagefile acquisition request may be determined from the pre-stored pagefile and the lowest version number. And determining the lowest version number of the page display application which is the same as the identifier and is suitable for the type of the client.
In practice, a user may view a page presented by a page presentation application at a client. The native page is used for displaying, the display efficiency is high, and the page image quality is good. Therefore, the lowest version number of the application capable of showing the native page is stored on the electronic equipment for later use.
Step 203, based on the comparison between the version number of the installed page display application and the target lowest version number, generating a page file which is matched with the comparison result and corresponds to the target page file.
In this embodiment, the electronic device obtains a comparison result based on a comparison between the version number of the installed page display application and the target lowest version number. And then generating a page file which is matched with the comparison result and corresponds to the target page file. The comparison of the version numbers here obtains the height between the versions, that is, the comparison result is the height between the version of the page display application in the client and the version corresponding to the target lowest version number. And generating a page file corresponding to the target page file according to the obtained comparison result. The generated page file is a page file to be sent to a client for rendering. It may be a native page file, a hypertext markup language file (such as an HTML5 file), a mixed native and hypertext markup language file, and so on.
In practice, a match refers to a pagefile that corresponds to having a version that is higher (or lower) regardless of which of the two versions that results from the comparison is higher (or lower).
Comparing the high and low between the versions may be done in various ways. For example, the size of the version numbers may be compared. The comparison can also be performed according to a preset naming rule of the version number, that is, according to a preset corresponding relationship between the version number and the version height. For example, it may be preset that the smaller the version number, the higher the version. Characters other than numbers, such as letters, etc., may be added to make the numbering setting.
With continued reference to fig. 3, fig. 3 is a schematic diagram of an application scenario of the method for generating a page file according to the present embodiment. In the application scenario of fig. 3, a user first initiates a pagefile acquisition request 302 of a web page through aclient 301, where the page file acquisition request includes a client whose type is that an ios system for a mobile phone is located, an identifier wp12 of a page corresponding to a page file, and a version number 2.0 of an installed page display application at the client; thereafter,web server 305 may, based on the identity wp12 and the type of client: determining 1.9303 a target page file and a target lowest version number from prestored page files and lowest version numbers by a client side where an ios system for the mobile phone is located; then, based on the comparison between the version number 2.0 and the target lowest version number 1.9, theweb server 305 generates anative pagefile 304 corresponding to the target pagefile as shown in fig. 3, and sends the native pagefile to theclient 301.
The method provided by the embodiment of the application is based on the comparison between the version number of the installed page display application and the target lowest version number, and the target page file is used for generating a new page file, so that the problem that the page corresponding to the page file is incompatible with the version of the page display application and cannot be displayed is solved. In addition, the embodiment can also avoid the problems of poor page quality and low page display efficiency caused by frequent use of hypertext markup language pages by the client.
With further reference to FIG. 4, aflow 400 of yet another embodiment of a pagefile generation method is shown. Theprocess 400 of the method for generating a pagefile includes the following steps:
step 401, for each page area, determining a version number of the lowest version of the page display application displaying the page area according to the file of the page area, and obtaining at least one version number.
In this embodiment, the page file includes a file of at least one page area of a page corresponding to the page file. The server determines the lowest version number of some pagefiles. These pagefiles may be artificially defined or obtained from a collection of pagefiles. For each page area of the page corresponding to each of the page files, the server determines the version number of the lowest version of the page display application displaying the page area according to the file of the page area, and obtains one or more version numbers.
When creating a page, the technician will divide the page into a plurality of regions (and possibly the entire page is one region). The page area is an area in the page set by a person. Each page area has different functions and can display different contents. For example, a navigation bar area, a title area, etc. may be included in the page. Each page area has a file that includes its configuration data. The version number of the lowest version of the page showing application showing the page area can be determined by using the file. The resulting version numbers of the lowest versions of the respective page areas may be identical, and then a version number is finally obtained. If the obtained version numbers are not consistent, a plurality of version numbers can be obtained.
Step 402, selecting the largest version number of the at least one version number, and determining the largest version number as the lowest version number.
In this embodiment, the server selects the largest version number from the at least one obtained version number, and then determines the largest version number as the lowest version number. The lowest version number is a version number of a page presentation application that presents a page in which the page area is located, and the page in which the page area is located is also a page corresponding to the page file, that is, a page that can be constructed by the page file.
Because each page area in the page needs to be displayed when the page is displayed, if the maximum version number in the version numbers corresponding to each page area is not selected, the situation that the page area which can be loaded only by the page display application with the maximum version cannot be displayed occurs. Therefore, the largest version number needs to be selected. For example, if a page has four page areas, and the obtained version numbers are 1.0, 2.0, 3.0, and 2.0, respectively, 3.0 is selected as the lowest version number of the page display application displaying the page.
Step 403, receiving a page file acquisition request sent by the client.
In this embodiment, the server may receive a request for acquiring a page file from a client (terminal device) with which a user browses a page through a wired connection manner or a wireless connection manner. The page file obtaining request comprises an identification of a page corresponding to the page file, a type of the client and a version number of an installed page display application of the client. The version number may be used to reflect the high and low of the application version.
In response to determining that the target page file and the target version number do not exist in the cache region, step 404 stores the target page file and the lowest version numbers of the page display applications of the types displaying the target page file into the cache region.
In this embodiment, the pre-stored page file and version number are pre-stored in the cache. So that the server can quickly find the target page file. The server may perform an operation of determining a target pagefile and a target lowest version number in the cache. If the execution is unsuccessful, it may be determined that the target pagefile and the target version number are not present in the cache. The server then responds: and storing the target page file and the lowest version number of each type of page display application for displaying the original page corresponding to the target page file into a cache region.
Step 405, searching the pagefile indicated by the identifier from a plurality of prestored pagefiles, and determining the searched pagefile as a target pagefile.
In this embodiment, the server searches for a pagefile whose identifier is an identifier in the pagefile acquiring request from a plurality of pagefiles prestored in the cache region. And determining the searched page file as a target page file.
Step 406, determining the lowest version number of the page display application installed on the type of the client included in the page file acquisition request as the target lowest version number from the lowest version numbers of the page display applications installed on the types of the clients that display the native page corresponding to the target page file.
In this embodiment, a plurality of lowest version numbers corresponding to the target page file are stored in the cache region. Each lowest version number of the plurality of lowest version numbers is: and displaying the lowest version number of the page display application installed on each type of client of the original page corresponding to the target page file. And determining the lowest version number corresponding to the type of the received client as the target lowest version number. I.e., the lowest version number of the page showing application installed at the client of the type included in the pagefile acquiring request is determined as the target lowest version number.
Step 407, in response to determining that the version number of the installed page display application is greater than or equal to the target lowest version number, generating a native page file corresponding to the target page file.
In this embodiment, when determining that the version number of the installed page showing application is greater than or equal to the target lowest version number, the server responds: and generating a native page file corresponding to the target page file. Generally, the larger the version number is, the higher the representative version is, and the version number can be used to determine the version height. The version number of the client-installed page presentation application indicates that the version is capable of displaying the native page if it is greater than or equal to the target lowest version number. Therefore, the server generates a native page file corresponding to the target page file.
Step 408, in response to determining that the version number of the installed page presentation application is less than the target lowest version number, generating a hypertext markup language file corresponding to the target page file.
In this embodiment, if the version number of the page presentation application installed by the client is less than the target lowest version number, it indicates that the version cannot display the native page. The server generates a hypertext markup language file (e.g., HTML5 file) corresponding to the target page file. The generated hypertext markup language document can then be sent to the client to cause it to display a hypertext markup language page.
It should be noted thatstep 406 and step 407 may alternatively be performed.
Step 409, in response to receiving the page modification information, updating the page file in the cache region, and updating the lowest version number of the page display application that displays the native page corresponding to the updated page file.
In this embodiment, the server receives the page modification information, and responds: and updating the page file in the cache region according to the page modification information. And meanwhile, updating the lowest version number of the page display application for displaying the native page corresponding to the updated page file. The page modification information is information indicating modification of a page file corresponding to a page. And modifying the page file to change the page corresponding to the page file. Before, simultaneously with or after updating the page file, the server updates the lowest version number of the page presentation application which presents the page corresponding to the page file. The pagefile herein is a pagefile in which the page modification information indicates modification.
According to the embodiment, the page file and the lowest version number are determined from the cache region, so that the determination time can be effectively saved. And the content in the cache region can be updated, so that the accuracy of generating the page file corresponding to the target page file is ensured.
With further reference to fig. 5, as an implementation of the method shown in the above-mentioned figures, the present application provides an embodiment of a device for generating a page file, where the embodiment of the device corresponds to the embodiment of the method shown in fig. 2, and the device may be specifically applied to various electronic devices.
As shown in fig. 5, thepagefile generating apparatus 500 of the present embodiment includes: a receivingunit 501, a determiningunit 502 and agenerating unit 503. The receivingunit 501 is configured to receive a page file acquisition request sent by a client, where the page file acquisition request includes an identifier of a page corresponding to a page file, a type of the client, and a version number of an installed page display application of the client; a determiningunit 502 configured to determine, according to the identifier and the type, a target page file and a target lowest version number from pre-stored page files and lowest version numbers, where the lowest version number is a number of a lowest version of a page display application that displays a native page corresponding to the page file, and the lowest version numbers of page display applications installed on different types of clients are different; agenerating unit 503 configured to generate a pagefile matching the comparison result and corresponding to the target pagefile based on the comparison between the version number of the installed page showing application and the target lowest version number.
In this embodiment, the receivingunit 501 of thepagefile generating apparatus 500 may receive a pagefile acquisition request from a client (terminal device) with which a user performs page browsing by a wired connection manner or a wireless connection manner. The page file obtaining request comprises an identification of a page corresponding to the page file, a type of the client and a version number of an installed page display application of the client. The version number may be used to reflect the high and low of the version of the application.
In this embodiment, the determiningunit 502 determines the target pagefile and the target lowest version number corresponding to the received identifier and type from the pre-stored pagefile and lowest version number according to the received identifier and type. The target page file refers to the determined page file corresponding to the identifier and the type. The lowest version number is the number of the lowest version of the page display application for displaying the native page corresponding to the page file, and the lowest version numbers of the page display applications installed on different types of clients are different. The target lowest version number is the lowest version number determined to correspond to the above-described identifier and type. A native page generally refers to a page that can be directly displayed.
In this embodiment, thegeneration unit 503 obtains the comparison result based on the comparison between the version number of the installed page showing application and the target lowest version number. And then generating a page file which is matched with the comparison result and corresponds to the target page file. The comparison of the version numbers here obtains the height between the versions, that is, the comparison result is the height between the version of the page display application in the client and the version corresponding to the target lowest version number. And generating a page file corresponding to the target page file according to the obtained comparison result. The generated page file is a page file to be sent to a client for rendering. It may be a native page file, a hypertext markup language file (such as an HTML5 file), a mixed native and hypertext markup language file, and so on.
In some optional implementations of this embodiment, the generating unit includes: a first generation module (not shown) for generating a native pagefile corresponding to the target pagefile in response to determining that the version number of the installed page showing application is greater than or equal to the target lowest version number; or a second generation module (not shown) for generating the hypertext markup language file corresponding to the target page file in response to determining that the version number of the installed page presentation application is less than the target lowest version number.
In some optional implementation manners of this embodiment, the pre-stored page file and version number are pre-stored in the cache region; and the apparatus further comprises: and a storage unit (not shown) configured to store the target page file and the lowest version numbers of the respective types of page presentation applications presenting the target page file in the cache area in response to determining that the target page file and the target version numbers do not exist in the cache area.
In some optional implementations of this embodiment, the apparatus further includes: and an updating unit (not shown) configured to update the page file in the cache area in response to receiving the page modification information, and update the lowest version number of the page presentation application that presents the native page corresponding to the updated page file.
In some optional implementations of this embodiment, the pagefile includes a file of at least one page area of a page corresponding to the pagefile; and the apparatus further comprises: a version determining unit (not shown) configured to determine, for each page area, a version number of a lowest version of the page display application that displays the page area according to the file of the page area, to obtain at least one version number; and a selecting unit (not shown) configured to select a largest version number of the at least one version number and determine the largest version number as a lowest version number.
In some optional implementations of this embodiment, the determining unit includes: a searching module (not shown) configured to search the pagefile indicated by the identifier from a plurality of prestored pagefiles, and determine the searched pagefile as a target pagefile; and a determining module (not shown) configured to determine, from the lowest version numbers of the page showing applications installed in the clients of the respective types and showing the native pages corresponding to the target pagefile, the lowest version number of the page showing application installed in the client of the type included in the pagefile acquiring request as the target lowest version number.
Referring now to FIG. 6, shown is a block diagram of acomputer system 600 suitable for use in implementing the electronic device of an embodiment of the present application. The electronic device shown in fig. 6 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present application.
FIG. 6 illustrates a schematic structural diagram of a computer system suitable for use in implementing the electronic device of an embodiment of the present application. As shown in fig. 6, 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: an input 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. The driver 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 the drive 610 as necessary, so that a computer program read out therefrom is mounted in thestorage section 608 as necessary.
In particular, according to embodiments of the application, the processes described above with reference to the flow diagrams may be implemented as computer software programs. For example, embodiments of the present application 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 by 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 computer program performs the above-described functions defined in the method of the present application when executed by a Central Processing Unit (CPU) 601. It should be noted that the computer readable medium of the present application 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 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 and/or flowchart illustration, and combinations of blocks in the block diagrams and/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 server includes a receiving unit, a determining unit, and a generating unit. The names of these units do not in some cases constitute a limitation on the unit itself, and for example, the receiving unit may also be described as a "unit that receives a pagefile acquisition request sent by a client".
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 present separately and not assembled into the device. The computer readable medium carries one or more programs which, when executed by the apparatus, cause the apparatus to: receiving a page file acquisition request sent by a client, wherein the page file acquisition request comprises an identifier of a page corresponding to the page file, the type of the client and the version number of an installed page display application of the client; determining a target page file and a target lowest version number from prestored page files and lowest version numbers according to the identification and the type, wherein the lowest version number is the number of the lowest version of a page display application for displaying a primary page corresponding to the page file, and the lowest version numbers of the page display applications installed on different types of clients are different; and generating a page file which is matched with the comparison result and corresponds to the target page file based on the comparison of the version number of the installed page display application and the target lowest version number.
The above description is only a preferred embodiment of the application and is illustrative of the principles of the technology employed. It will be appreciated by those skilled in the art that the scope of the invention herein disclosed is not limited to the particular combination of features described above, but also encompasses other arrangements formed by any combination of the above features or their equivalents without departing from the spirit of the invention. For example, the above features may be replaced with (but not limited to) features having similar functions disclosed in the present application.