Method, device, equipment and storage medium for generating page description file
By receiving page storage requests and preprocessing based on the attribute information of the page content, the attribute information of page elements is determined, and the page description file is generated, which solves the problem of inconsistent rendering of different browsers, achieves consistency of page display effects and reduces costs.
Patent Information
- Application Number
- CN202111045752.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-09-07
- Publication Date
- 2025-04-15
- Estimated Expiration
- 2041-09-07
AI Technical Summary
In the prior art, when rendering pages, due to the different rendering methods of browsers of each platform, the pages generated by the same page description file may be inconsistent after rendering in different browsers, and the method to solve this problem is complex and costly.
By receiving the page storage request, preprocessing is performed based on the first attribute information of the page content, the page element and its corresponding second attribute information are determined, and the attribute information between adjacent page elements is different, thereby generating a page description file.
This enables different browsers to render the pages generated based on the same page description file and reduces the cost and difficulty of the page description file.
Smart Images

Figure CN113836462B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer technology, and in particular to a method, device, equipment and storage medium for generating a page description file. Background Art
[0002] Currently, when rendering a page, the description file corresponding to the page is usually directly loaded, and then the description file is parsed to determine the page elements and corresponding display effects in the page, and then the page is rendered. However, the rendering methods of browsers on different platforms may be different. For the same page description file, the pages generated after rendering may be inconsistent.
[0003] In the related art, different page files are usually provided for browsers on different platforms to solve the problem that the same page content has different display effects in different browsers. However, this method is not only complicated, but also consumes a lot of costs. Summary of the invention
[0004] The present disclosure provides a method, apparatus, device and storage medium for generating a page description file.
[0005] According to one aspect of the present disclosure, a method for generating a page description file is provided, comprising:
[0006] Receiving a page storage request, wherein the storage request includes page editing data to be stored, wherein the page editing data includes page content and first attribute information corresponding to the page content;
[0007] Based on the first attribute information corresponding to the page content, preprocessing the page content to determine the page elements contained in the page editing data and the second attribute information corresponding to the page elements, wherein the attribute information between adjacent page elements is different;
[0008] A page description file is generated according to the page elements contained in the page editing data and the second attribute information corresponding to the page elements.
[0009] According to another aspect of the present disclosure, there is provided a device for generating a page description file, comprising:
[0010] A first receiving module, configured to receive a page storage request, wherein the storage request includes page editing data to be stored, wherein the page editing data includes page content and first attribute information corresponding to the page content;
[0011] a determination module, configured to pre-process the page content based on the first attribute information corresponding to the page content, so as to determine the page elements contained in the page editing data and the second attribute information corresponding to the page elements, wherein the attribute information between adjacent page elements is different;
[0012] The generating module is used to generate a page description file according to the page elements contained in the page editing data and the second attribute information corresponding to the page elements.
[0013] Optionally, the determining module is specifically used to:
[0014] Determine the difference between the first attribute information corresponding to two adjacent page contents;
[0015] If the difference between the first attribute information respectively corresponding to any two adjacent page contents meets a preset condition, determining the any two adjacent page contents as different page elements;
[0016] The second attribute information corresponding to each of the page elements is determined according to the first attribute information respectively corresponding to any two adjacent page contents and the display position of each of the page contents.
[0017] Optionally, the preset condition includes any one of the following: different types of page content, different display styles of page content, and different rows where the page content is located.
[0018] Optionally, the determining module is specifically used to:
[0019] A preset page rendering service is called based on the page editing data to pre-render the page content, so as to determine each page element contained in the page editing data and the second attribute information of each of the page elements.
[0020] Optionally, the device further includes:
[0021] A second receiving module is used to receive a page loading request sent by any browser, wherein the loading request includes an identifier of a target page;
[0022] The sending module is used to send the page description file corresponding to the identifier of the target page to any of the browsers.
[0023] The third aspect embodiment of the present disclosure proposes a computer device, including: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the method proposed in the first aspect embodiment of the present application is implemented.
[0024] The fourth aspect embodiment of the present disclosure proposes a non-temporary computer-readable storage medium storing a computer program, which, when executed by a processor, implements the method proposed in the first aspect embodiment of the present application.
[0025] The fifth aspect of the present disclosure provides a computer program product. When an instruction processor in the computer program product executes, the method provided in the first aspect of the present disclosure is executed.
[0026] In the disclosed embodiment, a page storage request is first received, wherein the storage request includes page editing data to be stored, wherein the page editing data includes page content and first attribute information corresponding to the page content, and then based on the first attribute information corresponding to the page content, the page content is preprocessed to determine the page elements contained in the page editing data and second attribute information corresponding to the page elements, wherein the attribute information between adjacent page elements is different, and finally a page description file is generated based on the page elements contained in the page editing data and the second attribute information corresponding to the page elements. Thus, by determining page contents with different attribute information as different page elements, and then generating corresponding page description files, different browsers can render the generated pages based on the same page description file with the same display effect, thereby reducing the cost and difficulty of the page description file.
[0027] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present disclosure, nor is it intended to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0028] The accompanying drawings are used to better understand the present solution and do not constitute a limitation of the present disclosure.
[0029] Figure 1 A schematic diagram of a flow chart of a method for generating a page description file provided in an embodiment of the present disclosure;
[0030] Figure 2 A schematic diagram of a flow chart of a method for generating a page description file provided by another embodiment of the present disclosure;
[0031] Figure 3 A structural block diagram of a device for generating a page description file provided in an embodiment of the present disclosure;
[0032] Figure 4 It is a block diagram of an electronic device used to implement the method for generating a page description file according to an embodiment of the present disclosure. DETAILED DESCRIPTION
[0033] The following is a description of exemplary embodiments of the present disclosure in conjunction with the accompanying drawings, including various details of the embodiments of the present disclosure to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present disclosure. Similarly, for the sake of clarity and conciseness, descriptions of well-known functions and structures are omitted in the following description.
[0034] The present disclosure provides a method for generating a page description file. The method can be executed by a device for generating a page description file provided by the present disclosure, or can be executed by an electronic device provided by the present disclosure, wherein the electronic device can be a terminal device, such as a user device, a mobile device, a user terminal, a terminal, a cellular phone, a cordless phone, a personal digital assistant, a handheld device, a computing device, a vehicle-mounted device, a wearable device, etc., which is not limited here, and can also be a server.
[0035] A method for generating a page description file provided by the present disclosure is executed below using a server provided by the present disclosure, wherein the server can provide a page generation service.
[0036] In the related art, when dividing page elements, adjacent contents of the same type are usually determined as a page element. For example, in a text page, each text paragraph is determined as a page element, and each page element corresponds to an attribute information. Thus, each browser can render the page based on the attribute information corresponding to each page element. In the actual rendering process, if different browsers define different character widths or spacings, the same page will be displayed differently in different browsers. For example, browser A can display 9 characters in a row, while browser B can display 10 characters in a row, and so on. In order to avoid different display effects of the same page in different browsers, it is necessary to generate different page description files for different browsers according to the rendering characteristics of different browsers.
[0037] In view of the above problems, in the present disclosure, when dividing page elements, adjacent page contents, even if of the same type, will be divided into different page elements as long as the attribute information is not completely the same. That is, in the present disclosure, by dividing the page elements into smaller granularities, and the attribute information corresponding to the page elements includes the position information of the page elements, so that the positions of the page elements in the pages rendered and generated by different browsers according to the attribute information of each page element are the same.
[0038] The following describes in detail the method, apparatus, computer device and storage medium for generating a page description file provided by the present disclosure in conjunction with the accompanying drawings.
[0039] Figure 1It is a flowchart of a method for generating a page description file according to an embodiment of the present disclosure.
[0040] like Figure 1 As shown, the method for generating the page description file may include the following steps:
[0041] Step 101: receiving a page storage request, wherein the page storage request includes page editing data to be stored, wherein the page editing data includes page content and first attribute information corresponding to the page content.
[0042] The page storage request may be manually triggered by a user or automatically triggered by a server. Optionally, the page storage request may be triggered during the page editing process or after the page editing is completed, which is not limited in the present disclosure.
[0043] The page editing data can be any page content data edited by the user based on the editing canvas, that is, the page content can be any content such as pictures, texts, videos, links, etc.
[0044] Among them, the first attribute information is determined during the page editing process, and it may include any attribute information that can be used to characterize the page content. For example, the first attribute information may include the type (type), position (position), size (size), font size (fontSize), color (color), etc. of the page content, which is not limited here.
[0045] It is understandable that the first attribute information corresponding to different page contents may be the same or different, and the first attribute information corresponding to the page content should include all descriptive information about the current page content as much as possible.
[0046] In the disclosed embodiment, the server may receive a page storage request during the page editing process and after the page editing is completed. After receiving the page storage request, the server may obtain the page content contained therein and the first attribute information corresponding to the page content.
[0047] Optionally, the server may store the page editing data in real time during the page editing process, and then when a page storage request is obtained, the server obtains the corresponding page editing data according to the page identifier to be stored.
[0048] Step 102, pre-processing the page content based on the first attribute information corresponding to the page content to determine the page elements contained in the page editing data and the second attribute information corresponding to the page elements, wherein the attribute information between adjacent page elements is different.
[0049] It should be noted that, during the preprocessing process, the page elements contained in the page editing data and the attribute information corresponding to the page elements, i.e., the second attribute information, can be determined based on the first attribute information of the page content. By performing preprocessing, the page editing data can be divided more finely, i.e., the page content can be divided into more specific page elements. Therefore, the second attribute information can be attribute information determined based on small-grained page elements, such as font, type, size, etc., which is not limited here.
[0050] It should be noted that, for each page content in the page editing data, the present disclosure can pre-process the page data to determine each page element contained in the current page editing data. In the present disclosure, the page content is divided into page elements of smaller granularity as much as possible, so that when each browser renders the page based on the small-granularity page elements, the generated page display effect is the same.
[0051] For example, if a certain text content in the current page consists of "Text 1" + "Text 2" + "Text 3", and the Chinese character font type and size corresponding to "Text 1" and "Text 3" are the same, and the Chinese character font type corresponding to Text 2 is different from that of "Text 1" and "Text 3", that is, the second attribute information corresponding to "Text 1" and "Text 2" is different, and the second attribute information corresponding to "Text 2" and "Text 3" is also different, so "Text 1", "Text 2" and "Text 3" are different page elements.
[0052] It should be noted that the above example is only an illustrative description and is not limited to this disclosure.
[0053] The second attribute information may include position information and style information corresponding to the current page element, such as size, color, font, etc., which are not limited here.
[0054] After the page editing data is determined, the current page editing data may be preprocessed, such as prerendered, to determine each page element in the current page and each second attribute information corresponding to the page element.
[0055] Specifically, the page editing data may be sent to a rendering service, and the rendering service may perform pre-rendering processing on the page content based on the first attribute information corresponding to the page content to determine each page element included in the page editing data and the corresponding second attribute information.
[0056] In one possible implementation, the server may call a preset page rendering service based on the page editing data to pre-render the corresponding page content to determine each page element contained in the page editing data and the second attribute information of each page element.
[0057] Optionally, the preset page rendering service may be a page rendering service of the server itself, or may be a service provided by other systems, which is not limited in the present disclosure.
[0058] Step 103: Generate a page description file according to the page elements contained in the page editing data and the second attribute information corresponding to the page elements.
[0059] Specifically, the server may generate a page description file according to the page elements and the second attribute information returned by the page rendering service.
[0060] The page description file may be a file containing each page element in the currently edited page and description information corresponding to each page element.
[0061] It should be noted that after the page description file is generated, different browsers can render the page based on the same page description file when displaying the page, and the generated page display effect is the same, thereby reducing the complexity and cost of the page description file generation process.
[0062] In the disclosed embodiment, a page storage request is first received, wherein the storage request includes page editing data to be stored, wherein the page editing data includes page content and first attribute information corresponding to the page content, and then based on the first attribute information corresponding to the page content, the page content is preprocessed to determine the page elements contained in the page editing data and second attribute information corresponding to the page elements, wherein the attribute information between adjacent page elements is different, and finally a page description file is generated based on the page elements contained in the page editing data and the second attribute information corresponding to the page elements. Thus, by determining page contents with different attribute information as different page elements, and then generating corresponding page description files, different browsers can render the generated pages based on the same page description file with the same display effect, thereby reducing the cost and difficulty of the page description file.
[0063] Figure 2 It is a flowchart of a method for generating a page description file according to another embodiment of the present disclosure.
[0064] like Figure 2 As shown, the method for generating the page description file may include the following steps:
[0065] Step 201: receiving a page storage request, wherein the storage request includes page editing data to be stored, wherein the page editing data includes page content and first attribute information corresponding to the page content.
[0066] It should be noted that the specific implementation of step 201 can refer to the above embodiment and will not be described in detail here.
[0067] Step 202: Determine the difference between the first attribute information corresponding to two adjacent page contents.
[0068] It should be noted that the first attribute information corresponding to two adjacent page contents may be different, such as different types, different styles, etc. The server can determine the difference between the first attribute information corresponding to two adjacent page contents by comparing the first attribute information of each adjacent page content.
[0069] Step 203: When the difference between the first attribute information corresponding to any two adjacent page contents respectively meets a preset condition, any two adjacent page contents are determined as different page elements.
[0070] Specifically, if the difference between the first attribute information corresponding to any two adjacent page contents meets the preset conditions, any two adjacent page contents can be determined as different page elements; if the difference between the first attribute information corresponding to any two adjacent page contents does not meet the preset conditions, any two adjacent page contents can be determined as the same page element.
[0071] Optionally, the preset condition may be any one of the following: different types of page content, different display styles of page content, and different rows where the page content is located.
[0072] For example, if any two adjacent pages contain two sentences, "Sentence 1" and "Sentence 2", and the font color corresponding to "Sentence 1" is blue and the font color corresponding to "Sentence 2" is red, it can be considered that the display styles of current sentences 1 and 2 are different, and thus they are determined to be different page elements.
[0073] Alternatively, if "Sentence 1" and "Sentence 2" are located in two different lines, that is, they are in different lines, it can also be considered that "Sentence 1" and "Sentence 2" meet the preset conditions, and thus they are determined as different page elements, which is not limited in the present disclosure.
[0074] Step 204 : determining second attribute information corresponding to each page element according to the first attribute information respectively corresponding to any two adjacent page contents and the display position of each page content.
[0075] The second attribute information may include the position information and style corresponding to the current page element, such as size, color, font, etc., which are not limited here.
[0076] It should be noted that, for any page content, in the present disclosure, after determining that the difference between any two adjacent page contents meets the preset conditions, the two adjacent page contents can be respectively determined as different page elements, and the second attribute information corresponding to each page element can be determined according to the display position and the first attribute information of each page content. That is, in the present disclosure, as long as the page content with different attribute information is determined as an independent page element, and its corresponding second attribute information is determined.
[0077] Step 205: Generate a page description file according to the page elements contained in the page editing data and the second attribute information corresponding to the page elements.
[0078] It should be noted that the specific implementation of step 205 can refer to the above embodiment and will not be described in detail here.
[0079] It is understandable that after the page description file corresponding to the page is generated, the page description file and the page identifier can be associated and stored.
[0080] Step 206: receiving a page loading request sent by any browser, wherein the loading request includes an identifier of the target page.
[0081] It should be noted that after receiving a page loading request sent by any browser, the server can parse the target page identifier contained in the page loading request, such as the domain name, and can query the page description file corresponding to the target page based on the target page identifier.
[0082] Step 207: Send the page description file corresponding to the identifier of the target page to any browser.
[0083] After determining the target page identifier, the server can determine the page description file corresponding to the current target page identifier, and then send the page description file to any browser. It is understandable that the browser can perform page rendering according to the current page description file to generate a page to be displayed.
[0084] In the disclosed embodiment, a page storage request is first received, and then the difference between the first attribute information corresponding to two adjacent page contents is determined. After that, when the difference between the first attribute information corresponding to any two adjacent page contents satisfies a preset condition, any two adjacent page contents are determined as different page elements, and the second attribute information corresponding to each page element is determined according to the first attribute information corresponding to any two adjacent page contents and the display position of each page content. After that, a page description file is generated according to the page elements contained in the page editing data and the second attribute information corresponding to the page elements. Then, when a page loading request sent by any browser is received, the page description file corresponding to the identifier of the target page can be sent to any browser. Thus, by dividing adjacent page contents with different attribute information into different page elements to generate a page description file, different browsers can render and generate pages with the same display effect based on the same page description file, which not only reduces the cost and complexity of generating page description files, but also improves the consistency of page display effects.
[0085] In order to implement the above embodiment, the present disclosure also proposes a device for generating a page description file.
[0086] Figure 3 A schematic diagram of the structure of a device for generating a page description file provided in an embodiment of the present disclosure.
[0087] like Figure 3 As shown, the device 300 for generating a page description file includes a first receiving module 310 , a determining module 320 and a generating module 330 .
[0088] A first receiving module 310 is configured to receive a page storage request, wherein the storage request includes page editing data to be stored, wherein the page editing data includes page content and first attribute information corresponding to the page content;
[0089] A determination module 320, configured to pre-process the page content based on the first attribute information corresponding to the page content, so as to determine the page elements included in the page editing data and the second attribute information corresponding to the page elements, wherein the attribute information between adjacent page elements is different;
[0090] The generating module 330 is used to generate a page description file according to the page elements contained in the page editing data and the second attribute information corresponding to the page elements.
[0091] Optionally, the determining module is specifically used to:
[0092] Determine the difference between the first attribute information corresponding to two adjacent page contents;
[0093] If the difference between the first attribute information respectively corresponding to any two adjacent page contents meets a preset condition, determining the any two adjacent page contents as different page elements;
[0094] The second attribute information corresponding to each of the page elements is determined according to the first attribute information respectively corresponding to any two adjacent page contents and the display position of each of the page contents.
[0095] Optionally, the preset condition includes any one of the following: different types of page content, different display styles of page content, and different rows where the page content is located.
[0096] Optionally, the determining module is specifically used to:
[0097] A preset page rendering service is called based on the page editing data to pre-render the page content, so as to determine each page element contained in the page editing data and the second attribute information of each of the page elements.
[0098] Optionally, the device further includes:
[0099] A second receiving module is used to receive a page loading request sent by any browser, wherein the loading request includes an identifier of a target page;
[0100] The sending module is used to send the page description file corresponding to the identifier of the target page to any of the browsers.
[0101] In the disclosed embodiment, a page storage request is first received, wherein the storage request includes page editing data to be stored, wherein the page editing data includes page content and first attribute information corresponding to the page content, and then based on the first attribute information corresponding to the page content, the page content is preprocessed to determine the page elements contained in the page editing data and second attribute information corresponding to the page elements, wherein the attribute information between adjacent page elements is different, and finally a page description file is generated based on the page elements contained in the page editing data and the second attribute information corresponding to the page elements. Thus, by determining page contents with different attribute information as different page elements, and then generating corresponding page description files, different browsers can render the generated pages based on the same page description file with the same display effect, thereby reducing the cost and difficulty of the page description file.
[0102] According to an embodiment of the present disclosure, the present disclosure also provides an electronic device, a readable storage medium and a computer program product.
[0103] Figure 4A schematic block diagram of an example electronic device 400 that can be used to implement an embodiment of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present disclosure described and / or required herein.
[0104] like Figure 4 As shown, the device 400 includes a computing unit 401, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 402 or a computer program loaded from a storage unit 408 into a random access memory (RAM) 403. In the RAM 403, various programs and data required for the operation of the device 400 can also be stored. The computing unit 401, the ROM 402, and the RAM 403 are connected to each other via a bus 404. An input / output (I / O) interface 405 is also connected to the bus 404.
[0105] A number of components in the device 400 are connected to the I / O interface 405, including: an input unit 406, such as a keyboard, a mouse, etc.; an output unit 407, such as various types of displays, speakers, etc.; a storage unit 408, such as a disk, an optical disk, etc.; and a communication unit 409, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 409 allows the device 400 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0106] The computing unit 401 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 401 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The computing unit 401 performs the various methods and processes described above, such as the generation method of the page description file. For example, in some embodiments, the generation method of the page description file may be implemented as a computer software program, which is tangibly contained in a machine-readable medium, such as a storage unit 408. In some embodiments, part or all of the computer program may be loaded and / or installed on the device 400 via ROM 402 and / or communication unit 409. When the computer program is loaded into RAM 403 and executed by the computing unit 401, one or more steps of the generation method of the page description file described above may be performed. Alternatively, in other embodiments, the computing unit 401 may be configured to perform the generation method of the page description file by any other appropriate means (e.g., by means of firmware).
[0107] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0108] The program code for implementing the method of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that the program code, when executed by the processor or controller, enables the functions / operations specified in the flow chart and / or block diagram to be implemented. The program code may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.
[0109] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, 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 disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0110] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).
[0111] The systems and techniques described herein can be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), the Internet, and a blockchain network.
[0112] A computer system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The relationship between the client and the server is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services ("Virtual Private Server", or "VPS" for short). The server may also be a server of a distributed system, or a server combined with a blockchain.
[0113] In the disclosed embodiment, a page storage request is first received, wherein the storage request includes page editing data to be stored, wherein the page editing data includes page content and first attribute information corresponding to the page content, and then based on the first attribute information corresponding to the page content, the page content is preprocessed to determine the page elements contained in the page editing data and second attribute information corresponding to the page elements, wherein the attribute information between adjacent page elements is different, and finally a page description file is generated based on the page elements contained in the page editing data and the second attribute information corresponding to the page elements. Thus, by determining page contents with different attribute information as different page elements, and then generating corresponding page description files, different browsers can render the generated pages based on the same page description file with the same display effect, thereby reducing the cost and difficulty of the page description file.
[0114] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps recorded in this disclosure can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved, and this document does not limit this.
[0115] The above specific implementations do not constitute a limitation on the protection scope of the present disclosure. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present disclosure shall be included in the protection scope of the present disclosure.
Claims
1. A method for generating a page description file, characterized in that: include: Receiving a page storage request, wherein the storage request includes page editing data to be stored, wherein the page editing data includes page content and first attribute information corresponding to the page content; Based on the first attribute information corresponding to the page content, preprocessing the page content to determine the page elements contained in the page editing data and the second attribute information corresponding to the page elements, wherein the attribute information between adjacent page elements is different, and the second attribute information includes the position information and style information corresponding to the page elements; Generate a page description file according to the page elements contained in the page editing data and the second attribute information corresponding to the page elements; The preprocessing of the page content based on the first attribute information corresponding to the page content to determine the page elements included in the page editing data and the second attribute information corresponding to the page elements includes: Determine the difference between the first attribute information corresponding to two adjacent page contents; If the difference between the first attribute information respectively corresponding to any two adjacent page contents meets a preset condition, determining the any two adjacent page contents as different page elements; The second attribute information corresponding to each of the page elements is determined according to the first attribute information respectively corresponding to any two adjacent page contents and the display position of each of the page contents.
2. The method according to claim 1, characterized in that The preset condition includes any one of the following: different types of page content, different display styles of page content, and different rows where page content is located.
3. The method according to claim 1, characterized in that The preprocessing of the page content based on the first attribute information corresponding to the page content to determine each page element contained in the page editing data and second attribute information of each of the page elements includes: A preset page rendering service is called based on the page editing data to pre-render the page content to determine each page element contained in the page editing data and second attribute information of each page element.
4. The method according to any one of claims 1 to 3, characterized in that: Also includes: Receiving a page loading request sent by any browser, wherein the loading request includes an identifier of a target page; The page description file corresponding to the identifier of the target page is sent to any one of the browsers.
5. A device for generating a page description file, characterized in that: include: A first receiving module, configured to receive a page storage request, wherein the storage request includes page editing data to be stored, wherein the page editing data includes page content and first attribute information corresponding to the page content; a determination module, configured to pre-process the page content based on the first attribute information corresponding to the page content, so as to determine the page elements contained in the page editing data and the second attribute information corresponding to the page elements, wherein the attribute information between adjacent page elements is different, and the second attribute information includes the position information and style information corresponding to the page elements; A generating module, used for generating a page description file according to the page elements contained in the page editing data and the second attribute information corresponding to the page elements; The determination module is specifically used for: Determine the difference between the first attribute information corresponding to two adjacent page contents; If the difference between the first attribute information respectively corresponding to any two adjacent page contents meets a preset condition, determining the any two adjacent page contents as different page elements; The second attribute information corresponding to each of the page elements is determined according to the first attribute information respectively corresponding to any two adjacent page contents and the display position of each of the page contents.
6. The device according to claim 5, characterized in that The preset condition includes any one of the following: different types of page content, different display styles of page content, and different rows where page content is located.
7. The device according to claim 5, characterized in that The determination module is specifically used for: A preset page rendering service is called based on the page editing data to pre-render the page content, so as to determine each page element contained in the page editing data and the second attribute information of each of the page elements.
8. The device according to any one of claims 5 to 7, characterized in that: Also includes: A second receiving module is used to receive a page loading request sent by any browser, wherein the loading request includes an identifier of a target page; The sending module is used to send the page description file corresponding to the identifier of the target page to any of the browsers.
9. An electronic device, comprising: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 4.
10. A non-transitory computer-readable storage medium storing computer instructions, wherein: The computer instructions are used to cause the computer to execute the method according to any one of claims 1-4.
11. A computer program product, comprising a computer program, which, when executed by a processor, implements the method according to any one of claims 1 to 4.
Citation Information
Patent Citations
Visual restoration method and device for application, storage medium and terminal
CN108897541A