CN118210999A - Page file construction method, page display device, page file construction equipment and storage medium - Google Patents

Page file construction method, page display device, page file construction equipment and storage medium Download PDF

Info

Publication number
CN118210999A
CN118210999A CN202410160226.1A CN202410160226A CN118210999A CN 118210999 A CN118210999 A CN 118210999A CN 202410160226 A CN202410160226 A CN 202410160226A CN 118210999 A CN118210999 A CN 118210999A
Authority
CN
China
Prior art keywords
page
resource data
file
client
files
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.)
Pending
Application number
CN202410160226.1A
Other languages
Chinese (zh)
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.)
Uc Mobile Co ltd
Original Assignee
Uc Mobile 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 Uc Mobile Co ltd filed Critical Uc Mobile Co ltd
Priority to CN202410160226.1A priority Critical patent/CN118210999A/en
Publication of CN118210999A publication Critical patent/CN118210999A/en
Pending legal-status Critical Current

Links

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The embodiment of the application provides a page file construction method, a page display device, equipment and a storage medium. The method comprises the following steps: acquiring page resource data comprising public resource data and customized resource data corresponding to different client types; acquiring page entry files corresponding to the types of the clients, and determining associated resource data with association relation with the page entry files from page resource data; the associated resource data includes: associating common resource data and associating customized resource data; acquiring a packaging configuration file corresponding to each client type; and respectively packaging the corresponding page entry files and associated resource data with association relation with the page entry files based on the corresponding packaging configuration files for each client type to obtain page files corresponding to each client type. The scheme can improve the page construction efficiency and flexibility, improve the code multiplexing rate and reduce the maintenance cost.

Description

Page file construction method, page display device, page file construction equipment and storage medium
Technical Field
The embodiment of the application relates to the technical field of computers, in particular to a page file construction method, a page display device, page display equipment and a storage medium.
Background
With the continuous updating of user terminal equipment, modern websites are adapted to various screen sizes and equipment, thereby providing better user experience. For example: for the top page of the same shopping website, when the user browses in different types of client devices, certain functional styles and page contents in the page may have certain differences in order to provide better browsing experience for the user through different client devices.
In the related art, page construction is generally performed by adopting a mode of independently developing a plurality of projects. Specifically: for the same page, page files corresponding to each client type are generally built for different client devices.
The page construction mode has the technical problems of low construction efficiency, high maintenance cost, low construction flexibility, low code multiplexing rate and the like.
Disclosure of Invention
In view of this, the embodiments of the present application provide a method for constructing a page file, a method for displaying a page, a device, equipment and a storage medium.
According to a first aspect of an embodiment of the present application, there is provided a method for constructing a page file, including:
Acquiring page resource data for constructing a page file; the page resource data includes: common resource data and customized resource data corresponding to different client types;
Respectively acquiring page entry files corresponding to the types of the clients, and determining associated resource data with association relation with each page entry file from the page resource data; the associated resource data includes: associating common resource data and associating customized resource data;
Acquiring a packaging configuration file corresponding to each client type;
and respectively packaging the corresponding page entry files and associated resource data with association relation with the page entry files based on the corresponding packaging configuration files for each client type to obtain page files corresponding to each client type.
According to a second aspect of the embodiment of the present application, there is provided a page display method, including:
Receiving a page request sent by a browser client, and analyzing the page request to obtain the type of the browser client;
Determining a target page file corresponding to the browser client type from a plurality of page files corresponding to different client types;
Performing page rendering based on the target page file to obtain a page rendering result;
Returning the page rendering result to the browser client to display the page at the browser client;
Wherein the pagefile is constructed according to the pagefile constructing method described in the first aspect.
According to a third aspect of an embodiment of the present application, there is provided a pagefile construction apparatus, including:
The resource data acquisition module is used for acquiring page resource data for constructing the page file; the page resource data includes: common resource data and customized resource data corresponding to different client types;
The associated resource data determining module is used for respectively acquiring page entry files corresponding to the types of the clients and determining associated resource data with association relation with the page entry files from the page resource data; the associated resource data includes: associating common resource data and associating customized resource data;
the configuration file acquisition module is used for acquiring the packaging configuration files corresponding to the types of the clients;
The construction module is used for respectively packing the corresponding page entry files and associated resource data with association relation with the page entry files based on the corresponding packing configuration files aiming at each client type to obtain page files corresponding to each client type.
According to a fourth aspect of an embodiment of the present application, there is provided a page display device, including:
the type determining module is used for receiving a page request sent by the browser client and analyzing the page request to obtain the type of the browser client;
The target page file determining module is used for determining target page files corresponding to the browser client types from a plurality of page files corresponding to different client types;
The rendering module is used for performing page rendering based on the target page file to obtain a page rendering result;
The result returning module is used for returning the page rendering result to the browser client so as to display the page on the browser client;
Wherein the pagefile is constructed according to the pagefile constructing method described in the first aspect.
According to a fifth aspect of an embodiment of the present application, there is provided an electronic apparatus including: the device comprises a processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface complete communication with each other through the communication bus; the memory is configured to store at least one executable instruction that causes the processor to perform operations corresponding to the method according to the first aspect or the second aspect.
According to a sixth aspect of embodiments of the present application, there is provided a computer storage medium having stored thereon a computer program which, when executed by a processor, implements the method according to the first or second aspect.
According to the page file construction scheme provided by the embodiment of the application, after the page resource data for constructing the page file are acquired, page entry files corresponding to different client types are respectively acquired, and associated resource data corresponding to each page entry file is determined from the page resource data; and then, based on the respective corresponding packaging configuration files of the client types, packaging the respective page entry files and the corresponding associated resource data, thereby obtaining the page files respectively corresponding to the different client types. According to the embodiment of the application, the page files aiming at a plurality of different client types can be simultaneously built in parallel in the same page file building project, so that the building efficiency is higher and the later maintenance cost is lower.
Moreover, the page files corresponding to different clients generally contain more reusable page resource data (common resource data), such as: reusable components, reusable logic code, and the like. Therefore, the page resource data is divided into the reusable public resource data and the customized resource data corresponding to each client type, and the parallel construction of the multi-type client page files is carried out in the same project based on the two types of page resource data, so that the resource data multiplexing rate among multi-type client scenes can be effectively improved.
In addition, the embodiment of the application can freely configure the type of the client to be subjected to the page file construction according to the actual situation, so that the construction flexibility is higher.
In summary, the embodiment of the application can effectively improve the construction efficiency and construction flexibility of the page file, improve the code multiplexing rate and reduce the later maintenance cost.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings that are required in the embodiments or the description of the prior art will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments described in the embodiments of the present application, and other drawings may be obtained according to these drawings for a person having ordinary skill in the art.
FIG. 1 is a flow chart of steps of a method for constructing a pagefile according to a first embodiment of the present application;
FIG. 2 is a schematic diagram of an example of a scenario in the embodiment shown in FIG. 1;
FIG. 3 is a schematic diagram of an exemplary system for applying a page presentation method of an embodiment of the present application;
FIG. 4 is a flowchart illustrating a page display method according to a second embodiment of the present application;
FIG. 5 is a schematic diagram of an example of a scenario in the embodiment shown in FIG. 4;
FIG. 6 is a block diagram showing a construction of a pagefile construction device according to a third embodiment of the present application;
FIG. 7 is a block diagram illustrating a page display device according to a fourth embodiment of the present application;
fig. 8 is a schematic structural diagram of an electronic device according to a fifth embodiment of the present application.
Detailed Description
In order to better understand the technical solutions in the embodiments of the present application, the following description will clearly and completely describe the technical solutions in the embodiments of the present application with reference to the accompanying drawings in the embodiments of the present application, and it is obvious that the described embodiments are only some embodiments of the present application, not all embodiments. All other embodiments, which are derived by a person skilled in the art based on the embodiments of the present application, shall fall within the scope of protection of the embodiments of the present application.
Example 1
Referring to fig. 1, fig. 1 is a flowchart illustrating steps of a method for constructing a page file according to a first embodiment of the present application. The method for constructing the page file provided by the embodiment of the application can comprise the following steps:
102, acquiring page resource data for constructing a page file; the page resource data includes: common resource data and customized resource data corresponding to different client types.
In particular, a particular netpage page file is typically built based on a variety of different page resource data. The specific page resource data may include at least one of: hypertext markup language files, cascading style sheets, and scripting language code. Wherein a hypertext markup language document is typically composed of tags, which can act as a carrier of specific page content; cascading style sheets are generally used to describe the style of page elements, as well as layout information between page elements, such as: style information such as color, size, font and the like of the text; scripting language code is commonly used for dynamic interactions between users and pages, such as: clicking on an icon, clicking on a drop down menu, etc. In the embodiment of the application, the specific content of the page resource data is not limited, and the user-defined configuration can be performed according to the actual page content display requirement.
In order to enable the web page to perform content adaptive display on different types of client devices, multiple types of page files applicable to different types of clients can be constructed for the same web page. Most of the page contents and the function styles are the same and reusable while there are a few function styles and differences in the page contents among the various page files. That is, the various page files typically contain more reusable page resource data (e.g., reusable components, reusable logic code, etc.). Therefore, in this step, from the viewpoint of whether or not it is reusable, page data is divided into: the common resource data that can be multiplexed, and the customized resource data that respectively correspond to different client types. Due to the customized resource data, a certain difference exists between the finally constructed page files in terms of functional styles and page contents.
In the embodiment of the application, the specific number of different client types, the specific form of each client type and the like are not limited, and the client type can be set by self-definition according to actual construction requirements.
Step 104, respectively obtaining page entry files corresponding to the client types, and determining associated resource data with association relation with each page entry file from page resource data; the associated resource data includes: associating common resource data and associating customized resource data.
The request for the page can be received by a certain file, and after the request is received, the file can forward the request to each function code corresponding to the page, and the file is the page entry file.
In the embodiment of the application, corresponding page entry files can be respectively constructed for each client type, and the page entry files are used for pointing to page resource data on which the page files corresponding to the client types are constructed, namely: the page entry file contains relevant information of page resource data required for constructing the corresponding page file, and the page resource data required for constructing the corresponding page file can also be called as associated resource data with an association relationship with the page entry file. For example: to construct a page-file a corresponding to client type a, a corresponding page-entry file 1 may be constructed; to build page file B corresponding to client type B, a corresponding page-entry file 2 may be built, wherein page-entry file 1 is used to point to the page-resource data M and N (here exemplified by M and N and not constituting a definition of the amount and content of page-resource data on which page file a is built), that is: the page entry file 1 is used for pointing to corresponding associated resource data M and N; the page-entry file 2 is used to point to the page-resource data P and Q on which the page file b is built, i.e.: the page-entry file 2 is used to point to the corresponding associated resource data P and Q.
When the page entry files of the client types are obtained, the associated resource data with the association relation with the page entry files can be determined according to the page entry files.
And 106, acquiring packaging configuration files corresponding to the types of the clients.
The obtained packaging configuration file in the embodiment of the application is a configuration file for guiding the subsequent resource data packaging operation. The packaging configuration file has the functions of: it is determined which format files to call for what compiling and converting operations, and which entries of the files, what the result of the last compiling is specifically called. That is, the package configuration file contains at least one of the following information: operation parameter information of file format information to be called, compiling, converting and other operations, file entry information and output result information. In addition, other custom configuration information can be added according to actual conditions. In the embodiment of the application, specific configuration information contained in the package configuration file is not limited.
Step 108, for each client type, packing the corresponding page entry file and the associated resource data having an association relationship with the page entry file based on the corresponding packing configuration file, respectively, to obtain the page file corresponding to each client type.
Specifically, after the package configuration file and the page file corresponding to each client type are obtained and the resource data is associated, the package operation may be performed respectively, so as to obtain the page file corresponding to each client type.
In the embodiment of the application, the method for packaging the data is not limited, and the data can be set in a self-defined manner according to actual conditions. For example: the packaging operation may be performed by means of a related packaging tool (such as webpack, etc.), which is a front-end resource packaging tool in the case of webpack, and may perform static analysis according to the association relationship (dependency relationship) between resource data, so as to generate a corresponding static resource according to the packaging rule specified by the packaging configuration file, that is: constructing a completed page file; the packing operation may also be performed by running a customized packing program, and so on.
Referring to fig. 2, fig. 2 is a schematic view of a corresponding scenario in an embodiment of the present application, and in the following, referring to the schematic view shown in fig. 2, an embodiment of the present application will be described with a specific scenario example:
Specifically, development and construction of page files applicable to different client types can be performed locally on a debugging device (any device with a debugging function) at the same time, and the construction process comprises the following steps: for each client type, respectively constructing corresponding configuration information, wherein the configuration information comprises: a corresponding page-entry file, and corresponding package configuration information. Specifically, configuration information corresponding to 3 different client types is exemplarily listed in fig. 2: configuration information corresponding to a mobile phone end, configuration information corresponding to a computer end and configuration information corresponding to other ends (such as a vehicle-mounted end); after the configuration information corresponding to each client type is constructed, the parallel construction operation of the multiple tasks can be performed based on the configuration information, so that the page files corresponding to each client type are obtained as products, and the multiple tasks in the process can be used for indicating the page file construction operation respectively executed on the multiple types of clients.
According to the page file construction method provided by the embodiment of the application, after the page resource data for constructing the page file are obtained, page entry files corresponding to different client types are respectively obtained, and associated resource data corresponding to each page entry file is determined from the page resource data; and then, based on the respective corresponding packaging configuration files of the client types, packaging the respective page entry files and the corresponding associated resource data, thereby obtaining the page files respectively corresponding to the different client types. According to the embodiment of the application, the page files aiming at a plurality of different client types can be simultaneously built in parallel in the same page file building project, so that the building efficiency is higher and the later maintenance cost is lower.
Moreover, the page files corresponding to different clients generally contain more reusable page resource data (common resource data), such as: reusable components, reusable logic code, and the like. Therefore, the page resource data is divided into the reusable public resource data and the customized resource data corresponding to each client type, and the parallel construction of the multi-type client page files is carried out in the same project based on the two types of page resource data, so that the resource data multiplexing rate among multi-type client scenes can be effectively improved.
In addition, the embodiment of the application can freely configure the type of the client to be subjected to the page file construction according to the actual situation, so that the construction flexibility is higher.
Optionally, in some embodiments, the process of determining the associated common resource data having an association relationship with each page entry file from the page resource data includes:
And determining associated public resource data with an association relation with each page entry file from a plurality of public resource data according to the resource name information of each public resource data and the page resource name information contained in each page file.
Specifically, as described above, the page-entry file is used to point to the page resource data on which the constructed page file depends, that is: the page-entry file contains information about the page-resource data required to construct the corresponding page-file, so that associated resource data can be determined from the page-resource data according to the page-entry file.
In the embodiment of the present application, the corresponding resource name may be set for each page resource data according to its function, so that the process of determining the associated resource data according to the page entry file may be: and comparing the page resource name (namely the resource name information of the associated resource data) contained in the page file with the resource name information of each page resource data, and further determining the associated resource data with the association relation with each page entry file from various page resource data.
Specifically, for the public resource data, the obtained resource name of each public resource data can be compared with the resource name of the associated resource data of the page file, so that the associated public resource data with the association relation with each page entry file can be determined from each public resource data. The method for determining the associated public resource data based on the resource name comparison is simple in implementation process and is beneficial to improving the efficiency of determining the associated public resource data.
Optionally, in some embodiments, the process of determining associated customized resource data having an association relationship with each page entry file from the page resource data includes:
Determining candidate associated customized resource data corresponding to each page entry file from a plurality of types of customized resource data according to the resource name information of each customized resource data and the page resource name information contained in each page file;
Determining associated customized resource data with an association relation with the page portal file from the candidate associated customized resource data according to the client type corresponding to the candidate associated customized resource data and the client type corresponding to the page portal file; the client type corresponding to the associated customized resource data is the same as the client type corresponding to the page entry file.
In particular, for common resource data, different common resource data is generally used for realizing different functions, that is, for common resource data, there is generally no case where a plurality of resource data have the same resource name. However, with respect to the customized resource data corresponding to different client types, there may be a case where a plurality of different customized resource data each for realizing the same function, where the plurality of different customized resource data have the same resource name. Namely: for customized resource data, there may be instances of homonymous resource data. For example: for the player components for realizing video playing, there may be player components suitable for mobile phone clients, player components suitable for computer clients, player components suitable for vehicle clients, and the like, where the player components corresponding to different client types are homonymous components.
When the same name component exists, in order to accurately determine the associated customized resource data corresponding to each page entry file, in the embodiment of the application, after determining a plurality of candidate associated customized resource data with the same name according to the page entry file, further, through the client type corresponding to each candidate associated customized resource data, the associated customized resource data with an association relationship with the page entry file is selected. Compared with the mode of selecting the associated customized resource data from the plurality of candidate associated customized resource data through the complex split-end judging logic, the mode can effectively improve the determination efficiency of the associated customized resource data and further improve the construction efficiency of the page file.
Further, in the embodiment of the present application, the specific implementation manner of determining the association customization resource data having the association relationship with the page portal file from the candidate association customization resource data according to the client type corresponding to the candidate association customization resource data and the client type corresponding to the page portal file is not limited.
For example: a suffix identification for characterizing a client type to which the resource data corresponds may be added after customizing the name of the data. Thus, after determining a plurality of candidate associated customized resource data with the same name, the associated customized resource data can be determined from the candidate associated customized resource data according to the suffix identification.
For example, assuming that the resource data names are index customized resource data, customized resource data corresponding to a computer client may be represented by "index. Pc.ts", and customized resource data corresponding to a mobile phone client may be represented by "index. Mobile.ts", where "pc" and "mobile" are suffix identifications corresponding to "computer end" and "mobile end", respectively. Thus, after determining two candidate customized resource data, i.e. "index.pc.ts" and "index.mobile.ts", according to the resource data name contained in the page entry file, the final associated customized resource data may be further selected from the two resource data according to the suffix identifier, specifically: for the page entry file corresponding to the computer side, the final associated customized resource data may be determined to be "index. Pc. Ts", while for the page entry file corresponding to the mobile phone side, the final associated customized resource data may be determined to be "index. Mobile. Ts".
Optionally, in some embodiments, for each client type, packaging, based on the corresponding packaging configuration file, the corresponding page entry file and associated resource data having an association relationship with the page entry file, to obtain a page file corresponding to each client type, including:
Creating a plurality of packing processes in parallel to obtain page files corresponding to each client type through the packing processes;
The packaging process corresponds to the client types one by one, and the single packaging process is used for packaging the page entry files and the associated resource data corresponding to the single client type based on the packaging configuration files corresponding to the single client type to obtain the page files corresponding to the single client type.
Specifically, in the embodiment of the present application, the specific type of packing is not limited, and any process capable of implementing the packing operation in step 108 may be used.
For example: the packaging process may be webpack process, and further, the page files corresponding to the client types may be obtained in parallel based on a parallel packaging process mechanism provided by the packaging tool webpack.
Referring to fig. 3, fig. 3 is a schematic diagram of an exemplary system to which the page display method according to the embodiment of the present application is applied, and for convenience of understanding, an application scenario of the page display method provided by the embodiment of the present application is first explained with reference to fig. 3.
As shown in fig. 3, the system 300 may include a server 302, a communication network 304, and/or one or more client devices (i.e., terminal devices) 306, which are illustrated in fig. 3 as a plurality of client devices.
The server 302 may be any suitable device for storing programs and/or any other suitable type of content, including but not limited to distributed storage system devices, server clusters, computing cloud server clusters, and the like. In some embodiments, server 302 may perform any suitable functions. For example, in some embodiments, after receiving a page request sent by the client device 306, the server 302 may determine a matching target page file according to a client type of the client device 306, and further perform page rendering based on the target page file, to obtain a page rendering result, and return the page rendering result to the client device 306.
In some embodiments, communication network 304 may be any suitable combination of one or more wired and/or wireless networks. For example, the communication network 304 can include any one or more of the following: the internet, an intranet, a wide area network (Wide Area Network, WAN), a local area network (Local Area Network, LAN), a wireless network, a digital subscriber line (Digital Subscriber Line, DSL) network, a frame relay network, an asynchronous transfer mode (Asynchronous Transfer Mode, ATM) network, a virtual private network (Virtual Private Network, VPN), and/or any other suitable communication network. Client device 306 can be coupled to communication network 304 via one or more communication links (e.g., communication link 312), and communication network 104 can be linked to server 302 via one or more communication links (e.g., communication link 314). The communication link may be any communication link suitable for transferring data between client device 306 and server 302, such as a network link, a dial-up link, a wireless link, a hardwired link, any other suitable communication link, or any suitable combination of such links.
Client device 306 may include any one or more user devices that install a browser. In some embodiments, client device 306 may include any suitable type of device. For example, in some embodiments, client device 306 may include a browser-mounted cell phone, a computer, a folding screen, and/or any other suitable type of user device.
Based on the above system, the embodiment of the application provides a page display method, and the following description is given by specific embodiments.
Example two
Referring to fig. 4, fig. 4 is a flowchart illustrating steps of a page display method according to a second embodiment of the present application. The page display method provided by the embodiment of the application can be executed by the client device 306 provided with the browser in the system shown in fig. 3. Specifically, the page display method provided by the embodiment includes the following steps:
Step 402, receiving a page request sent by a browser client, and analyzing the page request to obtain a browser client type.
Specifically, when the user wants to browse the web page, the relevant operation (such as a page clicking operation) may be performed on the browser client, and then the browser client may send a page request related to the operation to the server. In this step, when the server receives the page request sent by the browser client, the type information of the browser client may be obtained through an operation of parsing the page request.
Step 404, determining a target page file corresponding to the browser client type from a plurality of page files corresponding to different client types.
Wherein the above-mentioned various page files are constructed according to the method in the above-mentioned embodiment one.
Specifically, according to the method for constructing a page file provided in the first embodiment of the present application, page files applicable to different client types may be constructed in advance, and after a server receives a page request sent by a certain browser client, a target page file corresponding to the browser client type may be determined from the various different page files according to a browser client type obtained by parsing the request.
And step 406, performing page rendering based on the target page file to obtain a page rendering result.
Specifically, after the target page file is obtained in the step 404, the server may load the target page file to perform page rendering, so as to obtain a page rendering result: such as HTML (Hyper Text Markup Language ) files, etc.
Step 408, the page rendering result is returned to the browser client to display the page on the browser client.
Specifically, after the server side obtains the page rendering result, the result can be returned to the browser client side, and after the browser client side receives the rendering result, the result display can be performed in the browser for the user to browse.
Optionally, in some embodiments, the process of performing page rendering based on the target page file to obtain a page rendering result may include:
And loading a target page file in a target container which is pre-created and corresponds to the browser client type to perform page rendering, so as to obtain a page rendering result.
Specifically, for the server, page requests for the same page sent by different types of browser clients may be received at the same time (or in the same period of time), and thus, there may be a case where page files corresponding to different client types are loaded in parallel to obtain a rendering result. In the embodiment of the application, in order to improve the safety of different page file loading processes, independent running containers are respectively created in advance for each browser client type, so that the page file loading process is placed in the corresponding container to run, and thus, the page rendering processes of different client types can be isolated, and the safety of the page rendering process of multiple client types can be improved.
Referring to fig. 5, fig. 5 is a schematic view of a scene corresponding to the second embodiment of the present application, and in the following, referring to the schematic view shown in fig. 5, an embodiment of the present application will be described with a specific scene example:
The method comprises the steps that a server side obtains page requests which are sent by a plurality of browser clients and used for requesting the same page address; the server side analyzes the page requests, so that browser client side types corresponding to the page requests are obtained; the server executes a terminal type judging operation: FIG. 5 illustrates exemplary 3 different browser client types-computer side, cell phone side, and other sides (e.g., vehicle side); the method comprises the steps that a server side loads products (target page files) corresponding to the types of browser clients in a pre-established target container corresponding to the types of the browser clients in an isolated mode respectively so as to render pages; and finally, page rendering results corresponding to the types of the browser clients are obtained, and the rendering results are respectively returned to the corresponding browser clients for browsing by the users.
The page display method provided by the embodiment of the application comprises the following steps of: after obtaining page resource data for constructing page files, respectively obtaining page entry files corresponding to different client types, and determining associated resource data corresponding to each page entry file from the page resource data; and then, based on the respective corresponding packaging configuration files of the client types, packaging the respective page entry files and the corresponding associated resource data, thereby obtaining the page files respectively corresponding to the different client types. Therefore, the embodiment of the application can simultaneously construct the page files aiming at a plurality of different client types in parallel in the same page file construction project, so that the construction efficiency is higher and the later maintenance cost is lower.
Moreover, the page files corresponding to different clients generally contain more reusable page resource data (common resource data), such as: reusable components, reusable logic code, and the like. Therefore, the page resource data is divided into the reusable public resource data and the customized resource data corresponding to each client type, and the parallel construction of the multi-type client page files is carried out in the same project based on the two types of page resource data, so that the resource data multiplexing rate among multi-type client scenes can be effectively improved.
In addition, the embodiment of the application can freely configure the type of the client to be subjected to the page file construction according to the actual situation, so that the construction flexibility is higher.
Example III
Fig. 6 is a block diagram showing the construction of a pagefile construction device according to a third embodiment of the present application. The device for constructing the page file provided by the embodiment of the application can comprise the following steps:
A resource data acquisition module 602, configured to acquire page resource data for performing page file construction; the page resource data includes: common resource data and customized resource data corresponding to different client types;
An associated resource data determining module 604, configured to obtain page entry files corresponding to the types of the clients, and determine associated resource data having an association relationship with each page entry file from the page resource data; the associated resource data includes: associating common resource data and associating customized resource data;
a configuration file obtaining module 606, configured to obtain a package configuration file corresponding to each client type;
And the construction module 608 is configured to, for each client type, package the corresponding page entry file and associated resource data having an association relationship with the page entry file based on the corresponding package configuration file, to obtain a page file corresponding to each client type.
Optionally, in some embodiments, the association resource data determining module 604 is specifically configured to, when executing the step of determining, from the page resource data, association public resource data having an association relationship with each page entry file:
And determining associated public resource data with an association relation with each page entry file from a plurality of public resource data according to the resource name information of each public resource data and the page resource name information contained in each page file.
Optionally, in some embodiments, the association resource data determining module 604 is specifically configured to, when executing the step of determining, from the page resource data, association customized resource data having an association relationship with each page entry file:
Determining candidate associated customized resource data corresponding to each page entry file from a plurality of types of customized resource data according to the resource name information of each customized resource data and the page resource name information contained in each page file;
Determining associated customized resource data with an association relation with the page portal file from the candidate associated customized resource data according to the client type corresponding to the candidate associated customized resource data and the client type corresponding to the page portal file; the client type corresponding to the associated customized resource data is the same as the client type corresponding to the page entry file.
Optionally, in some embodiments, the building block 608 is specifically configured to:
Creating a plurality of packing processes in parallel to obtain page files corresponding to each client type through the packing processes;
The packaging process corresponds to the client types one by one, and the single packaging process is used for packaging the page entry files and the associated resource data corresponding to the single client type based on the packaging configuration files corresponding to the single client type to obtain the page files corresponding to the single client type.
Creating a plurality of packing processes in parallel to obtain page files corresponding to each client type through the packing processes;
The packaging process corresponds to the client types one by one, and the single packaging process is used for packaging the page entry files and the associated resource data corresponding to the single client type based on the packaging configuration files corresponding to the single client type to obtain the page files corresponding to the single client type.
The page file construction device of the present embodiment is used for implementing the corresponding page file construction method in the first embodiment, and has the beneficial effects of the corresponding method embodiment, which is not described herein again. In addition, the functional implementation of each module in the pagefile building apparatus of this embodiment may refer to the description of the corresponding portion in the foregoing method embodiment, which is not repeated herein.
Example IV
Fig. 7 is a block diagram of a page display device according to a fourth embodiment of the present application. The page display device provided by the embodiment of the application can be applied to the server side 302 in the system shown in fig. 3. The page display device provided by the embodiment of the application comprises:
The type determining module 702 is configured to receive a page request sent by a browser client, and parse the page request to obtain a browser client type;
a target page file determining module 704, configured to determine a target page file corresponding to a browser client type from multiple page files corresponding to different client types; wherein the page file is constructed according to the method of embodiment one;
the rendering module 706 is configured to perform page rendering based on the target page file to obtain a page rendering result;
The result returning module 708 is configured to return the page rendering result to the browser client, so as to perform page display on the browser client.
Optionally, in some examples, the rendering module 706 is specifically configured to:
And loading a target page file in a target container which is pre-created and corresponds to the browser client type to perform page rendering, so as to obtain a page rendering result.
The page display device in this embodiment is used to implement the corresponding page display method in the second embodiment, and has the beneficial effects of the corresponding method embodiment, which is not described herein again. In addition, the functional implementation of each module in the page display device of this embodiment may refer to the description of the corresponding portion in the foregoing method embodiment, which is not repeated herein.
Example five
Referring to fig. 8, a schematic structural diagram of an electronic device according to a fifth embodiment of the present application is shown, and the specific embodiment of the present application is not limited to the specific implementation of the electronic device.
As shown in fig. 8, the electronic device may include: a processor (processor) 802, a communication interface (Communications Interface) 804, a memory (memory) 806, and a communication bus 808.
Wherein:
Processor 802, communication interface 804, and memory 806 communicate with each other via a communication bus 808.
A communication interface 804 for communicating with other electronic devices.
The processor 802 is configured to execute the program 810, and may specifically perform relevant steps in the above-described embodiments of the page file building method or the page presentation method.
In particular, program 810 may include program code including computer operating instructions.
The processor 802 may be a CPU, or an Application-specific integrated Circuit ASIC (Application SPECIFIC INTEGRATED circuits), or one or more integrated circuits configured to implement embodiments of the present application. The one or more processors comprised by the smart device may be the same type of processor, such as one or more CPUs; but may also be different types of processors such as one or more CPUs and one or more ASICs.
Memory 806 for storing a program 810. The memory 806 may include high-speed RAM memory or may also include non-volatile memory (non-volatile memory), such as at least one disk memory.
The program 810 may include a plurality of computer instructions, and the program 810 may specifically enable the processor 802 to perform operations corresponding to the pagefile construction method or the page presentation method described in any one of the foregoing method embodiments.
The specific implementation of each step in the program 810 may refer to the corresponding steps and corresponding descriptions in the units in the above method embodiments, and have corresponding beneficial effects, which are not described herein. It will be clear to those skilled in the art that, for convenience and brevity of description, specific working procedures of the apparatus and modules described above may refer to corresponding procedure descriptions in the foregoing method embodiments, which are not repeated herein.
The present application also provides a computer storage medium having stored thereon a computer program which, when executed by a processor, implements the method described in any of the preceding method embodiments. The computer storage media includes, but is not limited to: a compact disk read Only (Compact Disc Read-Only Memory, CD-ROM), random access Memory (Random Access Memory, RAM), floppy disk, hard disk, magneto-optical disk, or the like.
Embodiments of the present application also provide a computer program product comprising computer instructions that instruct a computing device to perform operations corresponding to any one of the above-described method embodiments.
In addition, it should be noted that, the information related to the user (including, but not limited to, user equipment information, user personal information, etc.) and the data related to the embodiment of the present application (including, but not limited to, sample data for training the model, data for analyzing, stored data, presented data, etc.) are information and data authorized by the user or sufficiently authorized by each party, and the collection, use and processing of the related data need to comply with the related laws and regulations and standards of the related country and region, and provide a corresponding operation entry for the user to select authorization or rejection.
It should be noted that, according to implementation requirements, each component/step described in the embodiments of the present application may be split into more components/steps, or two or more components/steps or part of operations of the components/steps may be combined into new components/steps, so as to achieve the objects of the embodiments of the present application.
The methods according to embodiments of the present application described above may be implemented in hardware, firmware, or as software or computer code storable in a recording medium such as a CD-ROM, RAM, floppy disk, hard disk, or magneto-optical disk, or as computer code originally stored in a remote recording medium or a non-transitory machine-readable medium and to be stored in a local recording medium downloaded through a network, so that the methods described herein may be processed by such software on a recording medium using a general purpose computer, a special purpose processor, or programmable or dedicated hardware such as an Application SPECIFIC INTEGRATED Circuit (ASIC), or field programmable gate array (Field Programmable GATE ARRAY, FPGA). It is understood that a computer, processor, microprocessor controller, or programmable hardware includes a Memory component (e.g., random access Memory (Random Access Memory, RAM), read-Only Memory (ROM), flash Memory, etc.) that can store or receive software or computer code that, when accessed and executed by the computer, processor, or hardware, performs the methods described herein. Furthermore, when a general purpose computer accesses code for implementing the methods illustrated herein, execution of the code converts the general purpose computer into a special purpose computer for performing the methods illustrated herein.
Those of ordinary skill in the art will appreciate that the elements and method steps of the examples described in connection with the embodiments disclosed herein can be implemented as electronic hardware, or as a combination of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the solution. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the embodiments of the present application.
The above embodiments are only for illustrating the embodiments of the present application, but not for limiting the embodiments of the present application, and various changes and modifications may be made by one skilled in the relevant art without departing from the spirit and scope of the embodiments of the present application, so that all equivalent technical solutions also fall within the scope of the embodiments of the present application, and the scope of the embodiments of the present application should be defined by the claims.

Claims (11)

1. A method of page file construction, comprising:
Acquiring page resource data for constructing a page file; the page resource data includes: common resource data and customized resource data corresponding to different client types;
Respectively acquiring page entry files corresponding to the types of the clients, and determining associated resource data with association relation with each page entry file from the page resource data; the associated resource data includes: associating common resource data and associating customized resource data;
Acquiring a packaging configuration file corresponding to each client type;
and respectively packaging the corresponding page entry files and associated resource data with association relation with the page entry files based on the corresponding packaging configuration files for each client type to obtain page files corresponding to each client type.
2. The method of claim 1, wherein determining associated common resource data having an association with each page-entry file from the page resource data comprises:
And determining associated public resource data with an association relation with each page entry file from a plurality of public resource data according to the resource name information of each public resource data and the page resource name information contained in each page file.
3. The method of claim 1, wherein determining associated customized resource data having an association with each page-entry file from the page resource data comprises:
Determining candidate associated customized resource data corresponding to each page entry file from a plurality of types of customized resource data according to the resource name information of each customized resource data and the page resource name information contained in each page file;
Determining associated customized resource data with an association relation with the page portal file from the candidate associated customized resource data according to the client type corresponding to the candidate associated customized resource data and the client type corresponding to the page portal file; and the client type corresponding to the associated customized resource data is the same as the client type corresponding to the page entry file.
4. The method of claim 1, wherein the packaging the corresponding page entry file and the associated resource data having an association with the page entry file based on the corresponding packaging configuration file for each client type, respectively, to obtain the page file corresponding to each client type includes:
Creating a plurality of packaging processes in parallel to obtain page files corresponding to each client type through the plurality of packaging processes;
The packaging process corresponds to the client types one by one, and the single packaging process is used for packaging the page entry files and the associated resource data corresponding to the single client type based on the packaging configuration files corresponding to the single client type to obtain the page files corresponding to the single client type.
5. A page presentation method, comprising:
Receiving a page request sent by a browser client, and analyzing the page request to obtain the type of the browser client;
Determining a target page file corresponding to the browser client type from a plurality of page files corresponding to different client types;
Performing page rendering based on the target page file to obtain a page rendering result;
Returning the page rendering result to the browser client to display the page at the browser client;
Wherein the pagefile is constructed according to the method of any one of claims 1 to 4.
6. The method of claim 5, wherein the performing page rendering based on the target page file to obtain a page rendering result comprises:
and loading the target page file in a target container which is pre-created and corresponds to the browser client type to perform page rendering, so as to obtain a page rendering result.
7. A page file construction apparatus comprising:
The resource data acquisition module is used for acquiring page resource data for constructing the page file; the page resource data includes: common resource data and customized resource data corresponding to different client types;
The associated resource data determining module is used for respectively acquiring page entry files corresponding to the types of the clients and determining associated resource data with association relation with the page entry files from the page resource data; the associated resource data includes: associating common resource data and associating customized resource data;
the configuration file acquisition module is used for acquiring the packaging configuration files corresponding to the types of the clients;
The construction module is used for respectively packing the corresponding page entry files and associated resource data with association relation with the page entry files based on the corresponding packing configuration files aiming at each client type to obtain page files corresponding to each client type.
8. A page display device, comprising:
the type determining module is used for receiving a page request sent by the browser client and analyzing the page request to obtain the type of the browser client;
The target page file determining module is used for determining target page files corresponding to the browser client types from a plurality of page files corresponding to different client types;
The rendering module is used for performing page rendering based on the target page file to obtain a page rendering result;
The result returning module is used for returning the page rendering result to the browser client so as to display the page on the browser client;
Wherein the pagefile is constructed according to the method of any one of claims 1 to 4.
9. An electronic device, comprising: the device comprises a processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface complete communication with each other through the communication bus;
the memory is configured to store at least one executable instruction that causes the processor to perform operations corresponding to the method of any one of claims 1-6.
10. A computer storage medium having stored thereon a computer program which, when executed by a processor, implements the method of any of claims 1-6.
11. A computer program product comprising computer instructions that instruct a computing device to perform operations corresponding to the method of any one of claims 1-6.
CN202410160226.1A 2024-02-04 2024-02-04 Page file construction method, page display device, page file construction equipment and storage medium Pending CN118210999A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202410160226.1A CN118210999A (en) 2024-02-04 2024-02-04 Page file construction method, page display device, page file construction equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202410160226.1A CN118210999A (en) 2024-02-04 2024-02-04 Page file construction method, page display device, page file construction equipment and storage medium

Publications (1)

Publication Number Publication Date
CN118210999A true CN118210999A (en) 2024-06-18

Family

ID=91449793

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202410160226.1A Pending CN118210999A (en) 2024-02-04 2024-02-04 Page file construction method, page display device, page file construction equipment and storage medium

Country Status (1)

Country Link
CN (1) CN118210999A (en)

Similar Documents

Publication Publication Date Title
CN103605688B (en) Intercept method and intercept device for homepage advertisements and browser
US7853593B2 (en) Content markup transformation
US10853319B2 (en) System and method for display of document comparisons on a remote device
EP1641211A2 (en) Web server and method for dynamic content.
CN108717437B (en) Search result display method and device and storage medium
CN110083383A (en) Browser style compatibility method, device, computer equipment and storage medium
CN108874922B (en) Client device, webpage rendering method based on single page application and storage medium
EP4198773A1 (en) Image processing method and apparatus, and computer readable storage medium
CN113382083B (en) Webpage screenshot method and device
CN107229760B (en) Storage medium, electronic device, the display methods of web page contents and device
CN110990732A (en) Loading method, device and equipment based on webpage and storage medium
CN112612982A (en) Webpage preloading method and device and computer equipment
CN111310005B (en) Processing method and device of network request, server and storage medium
CN113536185A (en) Application page loading method, storage medium and related equipment thereof
WO2008132706A1 (en) A web browsing method and system
US7640498B2 (en) Method and system for maintaining font sizes on different platforms
Pavić et al. Methods of Improving and Optimizing React Web-applications
CN113050921A (en) Webpage conversion method, device, storage medium and computer equipment
CN111723314A (en) Webpage display method and device, electronic equipment and computer readable storage medium
CN111460348B (en) File processing method and device
CN112947900B (en) Web application development method and device, server and development terminal
CN112818270A (en) Data cross-domain transfer method and device and computer equipment
CN110321506A (en) Webpage data loading method, device, computer equipment and storage medium
CN114461960B (en) Page generation method, page display method and page display device
CN118210999A (en) Page file construction method, page display device, page file construction equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination