CN113642295A - Page layout method, page layout device and computer program product - Google Patents

Page layout method, page layout device and computer program product Download PDF

Info

Publication number
CN113642295A
CN113642295A CN202110974146.6A CN202110974146A CN113642295A CN 113642295 A CN113642295 A CN 113642295A CN 202110974146 A CN202110974146 A CN 202110974146A CN 113642295 A CN113642295 A CN 113642295A
Authority
CN
China
Prior art keywords
data
typeset
typesetting
component
dynamic library
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202110974146.6A
Other languages
Chinese (zh)
Other versions
CN113642295B (en
Inventor
王同龙
王素燕
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Baidu Netcom Science and Technology Co Ltd
Original Assignee
Beijing Baidu Netcom Science and Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Baidu Netcom Science and Technology Co Ltd filed Critical Beijing Baidu Netcom Science and Technology Co Ltd
Priority to CN202110974146.6A priority Critical patent/CN113642295B/en
Publication of CN113642295A publication Critical patent/CN113642295A/en
Application granted granted Critical
Publication of CN113642295B publication Critical patent/CN113642295B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/166Editing, e.g. inserting or deleting
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/166Editing, e.g. inserting or deleting
    • G06F40/186Templates

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Health & Medical Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Computational Linguistics (AREA)
  • General Health & Medical Sciences (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Processing Or Creating Images (AREA)

Abstract

The disclosure provides a page layout method, a page layout device, electronic equipment, a storage medium and a computer program product, relates to the technical field of computers, in particular to application program technology, and can be used in a page display scene. The specific implementation scheme is as follows: acquiring data to be typeset; analyzing the data to be typeset to obtain a node structure tree representing the association information between the data of each type in the data to be typeset; and obtaining typeset data of the data to be typeset through a typesetting component in the preset program based on the node structure tree, wherein the typesetting component is loaded into the preset program based on a dynamic library mechanism. The method and the device improve the typesetting performance of the preset program and the efficiency of publishing the new version of the typesetting component.

Description

Page layout method, page layout device and computer program product
Technical Field
The present disclosure relates to the field of computer technologies, and in particular, to a page composition method, an apparatus, an electronic device, a storage medium, and a computer program product, which may be used in a page display scenario.
Background
At present, the data patterns in the libraries for online sharing of documents by net friends are complex, and the libraries need rich typesetting capability. The prior art mainly implements the relevant page layout by the rich text component rich-text of the applet, or by other native components view or text of the applet.
Disclosure of Invention
The disclosure provides a page composition method, a page composition device, an electronic device, a storage medium and a computer program product.
According to a first aspect, there is provided a page layout method, comprising: acquiring data to be typeset; analyzing the data to be typeset to obtain a node structure tree representing the association information between the data of each type in the data to be typeset; and obtaining typeset data of the data to be typeset through a typesetting component in the preset program based on the node structure tree, wherein the typesetting component is loaded into the preset program based on a dynamic library mechanism.
According to a second aspect, there is provided a page layout apparatus comprising: a first acquisition unit configured to acquire data to be laid out; the analysis unit is configured to analyze the data to be typeset to obtain a node structure tree representing the association information among the data of each type in the data to be typeset; and the typesetting unit is configured to obtain typeset data of the data to be typeset through a typesetting assembly in the preset program based on the node structure tree, wherein the typesetting assembly is loaded into the preset program based on a dynamic library mechanism.
According to a third aspect, there is provided an electronic device comprising: at least one processor; and a memory communicatively coupled to the at least one processor; wherein the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method as described in any one of the implementations of the first aspect.
According to a fourth aspect, there is provided a non-transitory computer readable storage medium having stored thereon computer instructions for causing a computer to perform a method as described in any one of the implementations of the first aspect.
According to a fifth aspect, there is provided a computer program product comprising: computer program which, when being executed by a processor, carries out the method as described in any of the implementations of the first aspect.
According to the technology disclosed by the invention, the typesetting component loaded into the preset program based on the dynamic library mechanism is adopted to execute the data to be typeset loaded by the preset program, so that the typesetting performance of the preset program is improved, and the efficiency of publishing the new version of the typesetting component is improved.
It should be understood that the statements in this section do not necessarily identify key or critical features of the embodiments of the present disclosure, nor do they limit the scope of the present disclosure. Other features of the present disclosure will become apparent from the following description.
Drawings
The drawings are included to provide a better understanding of the present solution and are not to be construed as limiting the present disclosure. Wherein:
FIG. 1 is an exemplary system architecture diagram in which one embodiment according to the present disclosure may be applied;
FIG. 2 is a flow diagram of one embodiment of a page layout method according to the present disclosure;
FIG. 3 is a diagram illustrating an application scenario of the page layout method according to the present embodiment;
FIG. 4 is a flow diagram of yet another embodiment of a page layout method according to the present disclosure;
FIG. 5 is a block diagram of one embodiment of a page layout apparatus according to the present disclosure;
FIG. 6 is a schematic block diagram of a computer system suitable for use in implementing embodiments of the present disclosure.
Detailed Description
Exemplary embodiments of the present disclosure are described below with reference to the accompanying drawings, in which various details of the embodiments of the disclosure are included to assist understanding, and which are to be considered as merely exemplary. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the present disclosure. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
In the technical scheme of the disclosure, the acquisition, storage, application and the like of the personal information of the related user all accord with the regulations of related laws and regulations, and do not violate the good customs of the public order.
Fig. 1 illustrates an exemplary architecture 100 to which the page layout method and apparatus of the present disclosure may be applied.
As shown in fig. 1, the system architecture 100 may include terminal devices 101, 102, 103, a network 104, and a server 105. The communication connections between the terminal devices 101, 102, 103 form a topological network, and the network 104 serves to provide a medium for communication links between the terminal devices 101, 102, 103 and the server 105. Network 104 may include various connection types, such as wired, wireless communication links, or fiber optic cables, to name a few.
The terminal devices 101, 102, 103 may be hardware devices or software that support network connections for data interaction and data processing. When the terminal devices 101, 102, and 103 are hardware, they may be various electronic devices supporting network connection, information acquisition, interaction, display, processing, and other functions, including but not limited to vehicle-mounted smart devices, monitoring devices, smart phones, tablet computers, e-book readers, laptop portable computers, desktop computers, and the like. When the terminal apparatuses 101, 102, 103 are software, they can be installed in the electronic apparatuses listed above. It may be implemented, for example, as multiple software or software modules to provide distributed services, or as a single software or software module. And is not particularly limited herein.
The server 105 may be a server providing various services, for example, a server receiving request information sent by a user through the terminal devices 101, 102, and 103, and performing data layout on a page by using a layout component in a preset program to show a target page to the user. And loading the typesetting component into a preset program based on a dynamic library mechanism. As an example, the server 105 may be a cloud server.
The server may be hardware or software. When the server is hardware, it may be implemented as a distributed server cluster formed by multiple servers, or may be implemented as a single server. When the server is software, it may be implemented as multiple pieces of software or software modules (e.g., software or software modules used to provide distributed services), or as a single piece of software or software module. And is not particularly limited herein.
It should be further noted that the page layout method provided by the embodiment of the present disclosure may be executed by a server, may also be executed by a terminal device, and may also be executed by the server and the terminal device in cooperation with each other. Accordingly, each part (for example, each unit) included in the page composition device may be completely disposed in the server, may be completely disposed in the terminal device, and may be separately disposed in the server and the terminal device.
It should be understood that the number of terminal devices, networks, and servers in fig. 1 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation. When the electronic device on which the page layout method operates does not need to perform data transmission with other electronic devices, the system architecture may only include the electronic device (e.g., a server or a terminal device) on which the page layout method operates.
Referring to fig. 2, fig. 2 is a flowchart of a page layout method according to an embodiment of the disclosure, where the process 200 includes the following steps:
step 201, obtaining data to be typeset.
In this embodiment, an execution subject of the page layout method (for example, the terminal device or the server in fig. 1) may obtain the data to be laid out from a remote location or a local location through a wired network connection manner or a wireless network connection manner.
The data to be typeset is JSON (JSON Object Notation) data related to a target page to be displayed to the user, and includes data of types such as text, picture, table, display style, and the like.
Step 202, analyzing the data to be typeset to obtain a node structure tree representing the association information between each type of data in the data to be typeset.
In this embodiment, the execution main body may analyze the data to be typeset to obtain a node structure tree representing association information between types of data in the data to be typeset.
The method comprises the steps that associated information exists among various types of data such as text data, picture data, table data and style data included in data to be typeset of the same target page, the associated information among the various types of data is converted into relationships such as father and son, brothers and the like among nodes corresponding to the types of data in a node structure tree, and the node structure tree representing the associated information among the various types of data in the data to be typeset can be obtained.
In some optional implementations of this embodiment, the executing main body may execute the step 202 by:
firstly, analyzing data to be typeset, and determining nodes corresponding to various types of data in the data to be typeset.
As an example, the execution agent may parse the data to be laid out through the data parser, and determine a node corresponding to each type of data in the data to be laid out.
Then, the association information between the determined nodes is determined, and a node structure tree is generated.
In this implementation, the association information between the nodes is represented in the node relationship tree as the relationships between parents and children, brothers, and the like.
In this implementation, the execution main body is based on a node structure tree generation method that determines the nodes corresponding to each type of data first and then determines the association information between the nodes, thereby improving the generation efficiency of the node structure tree.
And step 203, obtaining the typeset data of the data to be typeset through the typesetting assembly in the preset program based on the node structure tree.
In this embodiment, the execution main body may obtain the typeset data of the data to be typeset through the typesetting component in the preset program based on the node structure tree. And loading the typesetting component into a preset program based on a dynamic library mechanism.
The preset program may be any program related to the layout function of the page. Such as various applications. In some optional implementations of this embodiment, the preset program is an applet. The applet is an application which can be used without downloading and installing, and the user can open the application by scanning bar code information triggering the applet or searching the applet name. As an example, the applet may be a hundred degree library applet for displaying data in a hundred degree library.
Existing components are typically loaded into the target program based on a static library mechanism. The static library has an extension of either a or lib. The static library is directly integrated into the target program during compiling, so that an executable file compiled by using the static library is large. The executable file successfully compiled based on the static library can be independently operated without requiring to read the content of the static library to the outside; however, from the viewpoint of the difficulty of upgrading, if the static library is updated, the object program needs to be recompiled, and the update of the static library cannot cover all users of the object program.
Unlike static libraries, which are integrated entirely into the target program, dynamic libraries typically have a "point" to the location of the dynamic library in the applet at compile time, and the applet will read the dynamic library for use when the applet's executable file needs to use the dynamic library mechanism. That is, the executable file of the applet cannot be run alone, and must be combined with the dynamic library to run. Therefore, from the aspect of product function upgrading, the dynamic library mechanism is adopted to facilitate component upgrading, only the corresponding dynamic library is replaced and adjusted, and the whole executable file of the target program does not need to be compiled again.
In this embodiment, the nodes in the node structure tree are read through the composition component in the applet in the order from top to bottom and from left to right, and are sequentially stored on a virtual conveyor belt. The "boxes" on the carousel are nodes, and the flowing carousel is the document stream. If the read node a is a child node under another node B, the "box" corresponding to the node a is placed inside the "box" corresponding to the node B in order when the carousel is placed. If the child nodes are still under the child nodes, the child nodes are continuously nested inside the sub-level box on the conveyor belt. There is no limitation on the levels that can be nested, depending on the structure of the nodes on the node structure tree. After the document is arranged, CSS (Cascading Style Sheets) attributes such as coordinates and sizes of nodes are determined as a package description of "box". And finally, placing the boxes one by one in a warehouse to lay the nodes to the target page to obtain the typeset data of the data to be typeset.
It should be noted that, in the above process of determining the typeset data, only the position of each node on the target page is determined, but the target page is not visualized.
In some optional implementations of this embodiment, the executing main body may execute the step 203 by: and for each node in the node structure tree, determining the typesetting information of the node through a parser corresponding to the node in the typesetting component so as to obtain the typesetted data of the data to be typeset.
In this implementation manner, the composition component is provided with a plurality of parsers, including but not limited to a text parser, a picture parser, a table parser, a formula parser, an iframe parser, and the like. The nodes corresponding to the data of each type such as the text data, the picture data, the table data, the style data and the like are analyzed through the analyzer corresponding to the data type of the nodes to obtain the typesetting information of the nodes, so that the typesetted data of the data to be typeset is obtained according to the typesetting information of the nodes. In the implementation mode, the analysis is performed based on the analyzer corresponding to the node, and the analysis efficiency is improved.
In some optional implementation manners of this embodiment, before the executing agent performs the step 203, first, a dynamic library of the composition component is constructed according to the received dynamic library development operation; and then, loading the dynamic library into a preset program.
The execution main body supports development of a dynamic library, receives dynamic library development operation of technicians and constructs the dynamic library of the typesetting assembly. After the development of the dynamic library is completed, when the dynamic library is compiled, the position of the dynamic library is pointed in the small program, and when the executable file of the small program needs to use the mechanism of the dynamic library, the small program reads the dynamic library according to the position of the dynamic library for use. In this implementation, the execution body has a development function of the dynamic library, and can flexibly develop the dynamic library of the composition component according to the development operation of the dynamic library, thereby improving the composition capability of the composition component.
In some optional implementation manners of this embodiment, in an application process of the dynamic library, the execution subject may update the dynamic library according to the received dynamic library update operation, so that the preset program performs a subsequent typesetting operation through the updated typesetting component.
The dynamic library update operation includes, but is not limited to, adding a function of the dynamic library, deleting a function of the dynamic library, and adjusting an existing function in the dynamic library. Based on the update operation of the dynamic library of the technical personnel, the execution main body can flexibly update the version of the dynamic library. Furthermore, by means of a dynamic library mechanism of the typesetting components, the efficiency of publishing the new edition of the typesetting components can be improved.
In some optional implementation manners of this embodiment, after obtaining the typeset data of the data to be typeset, the execution main body may render the typeset data, and generate and display a target page representing the typeset data.
As an example, the execution subject may present the target page through the applet in the terminal device that requests the applet. The excellent typesetting capability of the typesetting component based on the dynamic library mechanism improves the display effect of the target page and improves the experience of the user.
In order to further improve the display effect of the target page and improve the experience of the user, in some optional implementation manners of this embodiment, the execution main body receives an interactive operation for the target page; and executing interactive operation through the typesetting component.
Specifically, the receiving terminal device of the applet has a function of transferring a page event, and the typesetting component can perform a displatchevent interactive operation on the rendered target page. And the interactive operation represents the interaction between the user and the display content in the target page. As an example, the interactive operation includes a zoom operation, a select operation for a picture, a table, a text.
In some optional implementation manners of this embodiment, the execution main body may further obtain preset index information in the process of obtaining the typeset data; and generating monitoring information for the process of obtaining the typeset data according to the preset index information.
The preset index information is index information in a life cycle of the typesetting process of the typesetting component, and includes but is not limited to typesetting start time, typesetting end time, typesetting time and the like. Through the monitoring of the typesetting process, the whole typesetting process can be known in detail, and a data basis is provided for data analysis (for example, whether the specific functions of the typesetting components are improved or not) aiming at the typesetting process.
With continued reference to fig. 3, fig. 3 is a schematic diagram 300 of an application scenario of the page layout method according to the present embodiment. In the application scenario of fig. 3, a user 301 requests a preset program from a server 303 through a terminal device 302 to view data in a hundred-degree library. Firstly, data to be typeset of data to be checked are obtained. And then analyzing the data to be typeset to obtain a node structure tree representing the association information between the data of each type in the data to be typeset. And finally, obtaining the typeset data of the data to be typeset through the typesetting component in the preset program based on the node structure tree. And loading the typesetting component into a preset program based on a dynamic library mechanism.
In the embodiment, the typesetting component loaded into the preset program based on the dynamic library mechanism is adopted to execute the data to be typeset loaded by the preset program, so that the typesetting performance of the preset program is improved, and the efficiency of publishing the new version of the typesetting component is improved.
With continued reference to FIG. 4, an exemplary flow 400 of one embodiment of a page layout method in accordance with the methods of the present disclosure is shown, including the steps of:
step 401, constructing a dynamic library of the typesetting component according to the received dynamic library development operation.
Step 402, load dynamic library into applet.
And step 403, acquiring data to be typeset.
Step 404, analyzing the data to be typeset, and determining nodes corresponding to each type of data in the data to be typeset.
Step 405, determining the association information between the determined nodes, and generating a node structure tree.
Step 406, for each node in the node structure tree, determining the typesetting information of the node through the parser corresponding to the node in the typesetting component, so as to obtain the typesetted data of the data to be typeset.
And step 407, rendering the typeset data, and generating and displaying a target page representing the typeset data.
As can be seen from this embodiment, compared with the embodiment corresponding to fig. 2, the process 400 of the page layout method in this embodiment specifically illustrates a development process of the dynamic library, an obtaining process of data to be laid out, and a rendering process of the target page, and the dynamic library of the layout component is flexibly developed based on the development operation of the dynamic library, so that the layout performance of the applet loading the layout component, the efficiency of releasing the new version of the layout component, and the display effect of the target page are improved.
With continuing reference to fig. 5, as an implementation of the method shown in the above-mentioned figures, the present disclosure provides an embodiment of a page layout apparatus, which corresponds to the embodiment of the method shown in fig. 2, and which can be applied to various electronic devices.
As shown in fig. 5, the page layout apparatus includes: a first obtaining unit 501 configured to obtain data to be typeset; the parsing unit 502 is configured to parse the data to be typeset to obtain a node structure tree representing association information between each type of data in the data to be typeset; the typesetting unit 503 is configured to obtain the typeset data of the data to be typeset through the typesetting components in the preset program based on the node structure tree, where the typesetting components are loaded into the preset program based on the dynamic library mechanism.
In some optional implementations of this embodiment, the parsing unit 502 is further configured to: analyzing the data to be typeset, and determining nodes corresponding to various types of data in the data to be typeset; and determining the determined association information among the nodes, and generating a node structure tree.
In some optional implementations of the present embodiment, the layout unit 503 is further configured to: and for each node in the node structure tree, determining the typesetting information of the node through a parser corresponding to the node in the typesetting component so as to obtain the typesetted data of the data to be typeset.
In some optional implementations of this embodiment, the apparatus further includes: a construction unit (not shown in the figure) configured to construct a dynamic library of the composition component according to the received dynamic library development operation; and a loading unit (not shown) configured to load the dynamic library into a preset program.
In some optional implementations of this embodiment, the apparatus further includes: and an updating unit (not shown) configured to update the dynamic library according to the received dynamic library updating operation, so that the preset program performs the subsequent typesetting operation through the updated typesetting component.
In some optional implementations of this embodiment, the apparatus further includes: and the rendering and displaying unit (not shown in the figure) is configured to render the typeset data, and generate and display a target page representing the typeset data.
In some optional implementations of this embodiment, the apparatus further includes: a receiving unit (not shown in the figure) configured to receive an interactive operation for a target page; and an interaction unit (not shown in the figure) configured to perform an interaction operation through the composition component.
In some optional implementations of this embodiment, the apparatus further includes: a second obtaining unit (not shown in the figure) configured to obtain preset index information in the process of obtaining the typeset data; and a monitoring unit (not shown in the figure) configured to generate monitoring information for the process of obtaining the typeset data according to the preset index information.
In some optional implementations of this embodiment, the preset program is an applet.
In the embodiment, the typesetting component loaded into the preset program based on the dynamic library mechanism is adopted to execute the data to be typeset loaded by the preset program, so that the typesetting performance of the preset program is improved, and the efficiency of publishing the new version of the typesetting component is improved.
According to an embodiment of the present disclosure, the present disclosure also provides an electronic device including: at least one processor; and a memory communicatively coupled to the at least one processor; the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor, so that the at least one processor can implement the page composition method described in any of the above embodiments when executing the instructions.
According to an embodiment of the present disclosure, a readable storage medium is further provided, where the readable storage medium stores computer instructions, and the computer instructions are used to enable a computer to implement the page layout method described in any of the above embodiments when executed.
The embodiments of the present disclosure provide a computer program product, which when executed by a processor can implement the page layout method described in any of the above embodiments.
FIG. 6 illustrates a schematic block diagram of an example electronic device 600 that can be used to implement embodiments of the present disclosure. Electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. The electronic device may 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 meant to be examples only, and are not meant to limit implementations of the disclosure described and/or claimed herein.
As shown in fig. 6, the apparatus 600 includes a computing unit 601, which can perform various appropriate actions and processes according to a computer program stored in a Read Only Memory (ROM)602 or a computer program loaded from a storage unit 608 into a Random Access Memory (RAM) 603. In the RAM 603, various programs and data required for the operation of the device 600 can also be stored. The calculation unit 601, the ROM 602, and the RAM 603 are connected to each other via a bus 604. An input/output (I/O) interface 605 is also connected to bus 604.
A number of components in the device 600 are connected to the I/O interface 605, including: an input unit 606 such as a keyboard, a mouse, or the like; an output unit 607 such as various types of displays, speakers, and the like; a storage unit 608, such as a magnetic disk, optical disk, or the like; and a communication unit 609 such as a network card, modem, wireless communication transceiver, etc. The communication unit 609 allows the device 600 to exchange information/data with other devices via a computer network such as the internet and/or various telecommunication networks.
The computing unit 601 may be a variety of general and/or special purpose processing components having processing and computing capabilities. Some examples of the computing unit 601 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, a Digital Signal Processor (DSP), and any suitable processor, controller, microcontroller, and so forth. The calculation unit 601 performs the respective methods and processes described above, such as the page layout method. For example, in some embodiments, the page layout method may be implemented as a computer software program tangibly embodied in a machine-readable medium, such as storage unit 608. In some embodiments, part or all of the computer program may be loaded and/or installed onto the device 600 via the ROM 602 and/or the communication unit 609. When the computer program is loaded into the RAM 603 and executed by the computing unit 601, one or more steps of the page layout method described above may be performed. Alternatively, in other embodiments, the computing unit 601 may be configured to perform the page layout method in any other suitable manner (e.g., by means of firmware).
Various implementations of the systems and techniques described here above may be implemented in digital electronic circuitry, integrated circuitry, Field Programmable Gate Arrays (FPGAs), Application Specific Integrated Circuits (ASICs), Application Specific Standard Products (ASSPs), system on a chip (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs that are executable and/or interpretable on a programmable system including at least one programmable processor, which may be special or general purpose, receiving data and instructions from, and transmitting data and instructions to, a storage system, at least one input device, and at least one output device.
Program code for implementing the methods 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, special purpose computer, or other programmable data processing apparatus, such that the program codes, when executed by the processor or controller, cause the functions/operations specified in the flowchart and/or block diagram to be performed. The program code may execute entirely on the machine, partly on the machine, as a stand-alone software package partly on the machine and partly on a remote machine or entirely on the remote machine or server.
In the context of this disclosure, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The 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, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
To provide for interaction with a user, the systems and techniques described here 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 a user; and a keyboard and a pointing device (e.g., a mouse or a trackball) by which a user can provide input to the computer. Other kinds of devices may also be used to provide for interaction with a user; for example, 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 may be received in any form, including acoustic, speech, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a back-end component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such back-end, middleware, or front-end 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: local Area Networks (LANs), Wide Area Networks (WANs), and the Internet.
The computer system may include clients and servers. A client and server are generally remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. The Server can be a cloud Server, also called a cloud computing Server or a cloud host, and is a host product in a cloud computing service system, so as to solve the defects of large management difficulty and weak service expansibility existing in the traditional physical host and Virtual Private Server (VPS) service; it may also be a server of a distributed system, or a server incorporating a blockchain.
According to the technical scheme of the embodiment of the disclosure, the typesetting component loaded into the preset program based on the dynamic library mechanism is adopted to execute the data to be typeset loaded by the preset program, so that the typesetting performance of the preset program is improved, and the efficiency of publishing the new version of the typesetting component is improved.
It should be understood that various forms of the flows shown above may be used, with steps reordered, added, or deleted. For example, the steps described in this disclosure may be performed in parallel, sequentially, or in a different order, as long as the desired results of the technical solutions provided by this disclosure can be achieved, and are not limited herein.
The above detailed description should not be construed as limiting the scope of the disclosure. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may be made in accordance with design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present disclosure should be included in the scope of protection of the present disclosure.

Claims (21)

1. A page layout method comprises the following steps:
acquiring data to be typeset;
analyzing the data to be typeset to obtain a node structure tree representing the association information between the data of each type in the data to be typeset;
and obtaining the typeset data of the data to be typeset through a typesetting component in a preset program based on the node structure tree, wherein the typesetting component is loaded into the preset program based on a dynamic library mechanism.
2. The method according to claim 1, wherein the parsing the data to be typeset to obtain a node structure tree representing association information between types of data in the data to be typeset comprises:
analyzing the data to be typeset, and determining nodes corresponding to various types of data in the data to be typeset;
and determining the determined association information among the nodes, and generating the node structure tree.
3. The method according to claim 1, wherein obtaining the typeset data of the data to be typeset through a typesetting component in a preset program based on the node structure tree comprises:
and for each node in the node structure tree, determining the typesetting information of the node through a parser corresponding to the node in the typesetting component so as to obtain the typesetted data of the data to be typeset.
4. The method according to claim 1, wherein before obtaining the typeset data of the data to be typeset through a typesetting component in a preset program based on the node structure tree, the method further comprises:
constructing a dynamic library of the typesetting assembly according to the received dynamic library development operation;
and loading the dynamic library into the preset program.
5. The method of claim 1, further comprising:
and updating the dynamic library according to the received dynamic library updating operation, so that the preset program executes subsequent typesetting operation through the updated typesetting component.
6. The method according to any one of claims 1 to 5, wherein after obtaining the typeset data of the data to be typeset through a typesetting component in a preset program based on the node structure tree, the method further comprises:
rendering the typeset data, and generating and displaying a target page representing the typeset data.
7. The method of claim 6, further comprising:
receiving interactive operation aiming at the target page;
and executing the interactive operation through the typesetting component.
8. The method of claim 1, further comprising:
acquiring preset index information in the process of obtaining the typeset data;
and generating monitoring information for the process of obtaining the typeset data according to the preset index information.
9. The method of any of claims 1-8, wherein the pre-set program is a applet.
10. A page composition apparatus comprising:
a first acquisition unit configured to acquire data to be laid out;
the analysis unit is configured to analyze the data to be typeset to obtain a node structure tree representing the association information among the data of each type in the data to be typeset;
and the typesetting unit is configured to obtain typeset data of the data to be typeset through a typesetting assembly in a preset program based on the node structure tree, wherein the typesetting assembly is loaded into the preset program based on a dynamic library mechanism.
11. The apparatus of claim 10, wherein the parsing unit is further configured to:
analyzing the data to be typeset, and determining nodes corresponding to various types of data in the data to be typeset; and determining the determined association information among the nodes, and generating the node structure tree.
12. The apparatus of claim 10, wherein the composition unit is further configured to:
and for each node in the node structure tree, determining the typesetting information of the node through a parser corresponding to the node in the typesetting component so as to obtain the typesetted data of the data to be typeset.
13. The apparatus of claim 10, further comprising:
a building unit configured to build the dynamic library of the composition component according to the received dynamic library development operation;
a loading unit configured to load the dynamic library into the preset program.
14. The apparatus of claim 10, further comprising:
and the updating unit is configured to update the dynamic library according to the received dynamic library updating operation, so that the preset program can execute subsequent typesetting operation through the updated typesetting component.
15. The apparatus of any of claims 10-14, further comprising:
and the rendering display unit is configured to render the typeset data, and generate and display a target page representing the typeset data.
16. The apparatus of claim 15, further comprising:
a receiving unit configured to receive an interactive operation for the target page;
and the interaction unit is configured to execute the interaction operation through the typesetting component.
17. The apparatus of claim 10, further comprising:
the second acquisition unit is configured to acquire preset index information in the process of obtaining the typeset data;
and the monitoring unit is configured to generate monitoring information for the process of obtaining the typeset data according to the preset index information.
18. The apparatus of any one of claims 10-17, wherein the preset program is an applet.
19. An electronic device, comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-9.
20. A non-transitory computer readable storage medium having stored thereon computer instructions for causing the computer to perform the method of any one of claims 1-9.
21. A computer program product, comprising: computer program which, when being executed by a processor, carries out the method according to any one of claims 1-9.
CN202110974146.6A 2021-08-24 2021-08-24 Page typesetting method, device and computer program product Active CN113642295B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110974146.6A CN113642295B (en) 2021-08-24 2021-08-24 Page typesetting method, device and computer program product

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110974146.6A CN113642295B (en) 2021-08-24 2021-08-24 Page typesetting method, device and computer program product

Publications (2)

Publication Number Publication Date
CN113642295A true CN113642295A (en) 2021-11-12
CN113642295B CN113642295B (en) 2023-10-20

Family

ID=78423622

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110974146.6A Active CN113642295B (en) 2021-08-24 2021-08-24 Page typesetting method, device and computer program product

Country Status (1)

Country Link
CN (1) CN113642295B (en)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102622215A (en) * 2011-01-27 2012-08-01 腾讯科技(深圳)有限公司 Method for editing image-text units based on script
US20140244577A1 (en) * 2012-09-13 2014-08-28 Kip Cr P1 Lp System, method and computer program product for partially synchronous and partially asynchronous mounts/unmounts in a media library
CN106708958A (en) * 2016-11-30 2017-05-24 北京小米移动软件有限公司 Typesetting structure display method and device for rendering engine
CN108415702A (en) * 2018-01-22 2018-08-17 北京奇艺世纪科技有限公司 A kind of mobile terminal application interface dynamic rendering intent and device
CN110908738A (en) * 2019-11-29 2020-03-24 百度在线网络技术(北京)有限公司 Method and device for running small program
US20210089706A1 (en) * 2019-09-23 2021-03-25 Scott Kellum Dynamic typesetting
CN112948018A (en) * 2021-03-01 2021-06-11 北京百度网讯科技有限公司 Dynamic library loading method, device, equipment and medium for small program

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102622215A (en) * 2011-01-27 2012-08-01 腾讯科技(深圳)有限公司 Method for editing image-text units based on script
US20140244577A1 (en) * 2012-09-13 2014-08-28 Kip Cr P1 Lp System, method and computer program product for partially synchronous and partially asynchronous mounts/unmounts in a media library
CN106708958A (en) * 2016-11-30 2017-05-24 北京小米移动软件有限公司 Typesetting structure display method and device for rendering engine
CN108415702A (en) * 2018-01-22 2018-08-17 北京奇艺世纪科技有限公司 A kind of mobile terminal application interface dynamic rendering intent and device
US20210089706A1 (en) * 2019-09-23 2021-03-25 Scott Kellum Dynamic typesetting
CN110908738A (en) * 2019-11-29 2020-03-24 百度在线网络技术(北京)有限公司 Method and device for running small program
CN112948018A (en) * 2021-03-01 2021-06-11 北京百度网讯科技有限公司 Dynamic library loading method, device, equipment and medium for small program

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
匿名: "百度智能小程序 使用动态库_w3cschool", HTTPS://WWW.W3CSCHOOL.CN/BAIDUAPP/BAIDUAPP-V61T397U.HTML *
曾凯;刘坤;陈宏君;周磊;谭林丰;顾熹;: "PCS-Studio可视化集成软件设计与实现", 工业控制计算机, no. 06 *
陈志泊;林健;: "基于DirectUI可扩展应用程序架构的设计与实现", 计算机科学, no. 3 *

Also Published As

Publication number Publication date
CN113642295B (en) 2023-10-20

Similar Documents

Publication Publication Date Title
CN110858172A (en) Automatic test code generation method and device
CN111324833A (en) Page display method, device, electronic design and computer readable medium
CN113010827A (en) Page rendering method and device, electronic equipment and storage medium
CN112527281B (en) Operator upgrading method and device based on artificial intelligence, electronic equipment and medium
US20220114822A1 (en) Method, apparatus, device, storage medium and program product of performing text matching
CN112860356A (en) API call control method and device, electronic equipment and storage medium
CN112835579A (en) Method and device for determining interface code, electronic equipment and storage medium
CN114115681A (en) Page generation method and device, electronic equipment and medium
CN113760769A (en) Test case processing method and device, electronic equipment and storage medium
CN114398023A (en) File generation method and page configuration method and device
CN108845864A (en) A kind of JVM rubbish recovering method and device based on spring frame
CN112784588A (en) Method, device, equipment and storage medium for marking text
EP4246365A1 (en) Webpage identification method and apparatus, electronic device, and medium
CN113642295B (en) Page typesetting method, device and computer program product
CN110262841A (en) The method and apparatus that a kind of pair of bytecode is enhanced
CN114968235A (en) Page form generation method and device, computer equipment and storage medium
CN113869042A (en) Text title generation method and device, electronic equipment and storage medium
CN114741294A (en) Page debugging method, device, equipment and storage medium
CN113656533A (en) Tree control processing method and device and electronic equipment
CN112947941A (en) Method and device for adding exception handling code
CN113138767A (en) Code language conversion method, device, electronic equipment and storage medium
US20230084438A1 (en) Method of generating text, method of training model, electronic device, and medium
CN112632293B (en) Industry map construction method and device, electronic equipment and storage medium
CN111324351B (en) File processing method, device, computer readable medium and electronic equipment
CN115687141A (en) Application program testing method and device, electronic 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
GR01 Patent grant
GR01 Patent grant