CN112464618A - Method and device for paging document data, storage medium and electronic equipment - Google Patents

Method and device for paging document data, storage medium and electronic equipment Download PDF

Info

Publication number
CN112464618A
CN112464618A CN202011405702.XA CN202011405702A CN112464618A CN 112464618 A CN112464618 A CN 112464618A CN 202011405702 A CN202011405702 A CN 202011405702A CN 112464618 A CN112464618 A CN 112464618A
Authority
CN
China
Prior art keywords
data
data unit
document
page
data units
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202011405702.XA
Other languages
Chinese (zh)
Inventor
肖凯
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Mininglamp Software System Co ltd
Original Assignee
Beijing Mininglamp Software System 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 Mininglamp Software System Co ltd filed Critical Beijing Mininglamp Software System Co ltd
Priority to CN202011405702.XA priority Critical patent/CN112464618A/en
Publication of CN112464618A publication Critical patent/CN112464618A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/103Formatting, i.e. changing of presentation of documents
    • G06F40/114Pagination
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/103Formatting, i.e. changing of presentation of documents
    • G06F40/106Display of layout of documents; Previewing
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/12Use of codes for handling textual entities
    • G06F40/151Transformation
    • G06F40/154Tree transformation for tree-structured or markup documents, e.g. XSLT, XSL-FO or stylesheets

Abstract

The application provides a method and a device for paging document data, a storage medium and an electronic device, wherein the method comprises the following steps: acquiring page configuration information of the document data, wherein the page configuration information is used for indicating the page size of the paging page of the document data; determining a plurality of target data units corresponding to the document data, wherein each target data unit stores a document node of the document data; the target data unit is divided into a plurality of data unit groups according to the page size, wherein the target data unit is allowed to be divided into a plurality of data units, and each data unit group corresponds to one paging page of the document data.

Description

Method and device for paging document data, storage medium and electronic equipment
Technical Field
The present application relates to the field of data processing, and in particular, to a method and an apparatus for paging document data, a storage medium, and an electronic device.
Background
As online documents are used more and more widely in enterprise wechat applications, the functional requirements for online documents are also higher and higher. The paging is a basic function of the document, and the document can be divided into a plurality of pages with standard sizes (such as A4) to facilitate text retrieval, text printing and other operations.
The existing online document paging mode is to use Dom (document object model) operation to complete paging on document division nodes based on the size of a document display page, when paging is performed on the whole segment of characters, normal reading and browsing are not affected, but under the condition that pictures, tables and the like need to be read as a whole, the existing paging mode cannot be used for splitting the whole into a plurality of pages, for example, after a table or a picture to be displayed is obtained in a webpage, because the existing online paging mode cannot split the whole structure of the table or the picture, the whole page can be placed at the lowest part or the highest part of the page as a whole, the problem that the height of the page where the picture or the table is placed is higher than that of other pages is caused, the page browsing comfort is low, and meanwhile, because the display page has the condition of exceeding the printing paper range of A4, resulting in a user's inability to print documents.
Therefore, the prior art has the problems that reasonable paging cannot be carried out on the part displayed as a whole in the page, and the flexibility is poor.
Disclosure of Invention
The application provides a document data paging method and device, a storage medium and electronic equipment, and aims to at least solve the problems that reasonable paging cannot be performed on a part displayed as a whole in a page in the related art, and flexibility is poor.
According to an aspect of an embodiment of the present application, there is provided a method for paging document data, including:
acquiring page configuration information of document data, wherein the page configuration information is used for indicating the page size of paging pages of the document data;
determining a plurality of target data units corresponding to the document data, wherein each target data unit stores one document node of the document data;
and splitting the target data unit into a plurality of data unit groups according to the page size, wherein the target data unit is allowed to be split into a plurality of data units, and each data unit group corresponds to one paging page of the document data.
According to another aspect of the embodiments of the present application, there is also provided a apparatus for paging document data, including:
the acquisition module is used for acquiring page configuration information of the document data, wherein the page configuration information is used for indicating the page size of the paging page of the document data;
a determining module, configured to determine a plurality of target data units corresponding to the document data, where each target data unit stores a document node of the document data;
a first splitting module, configured to split the target data units into a plurality of data unit groups according to the page size, where the target data unit is allowed to be split into a plurality of data units, and each data unit group corresponds to one paginated page of the document data.
Optionally, the determining module includes:
the conversion unit is used for converting the document nodes with the tree structures in the document data into document nodes with non-tree structures to obtain a plurality of document nodes;
and the storage unit is used for sequentially storing the document nodes into the target data units, wherein the document nodes correspond to the target data units one by one.
Optionally, the determining module includes:
an obtaining unit, configured to obtain a plurality of reference data units when the page configuration information is the adjusted configuration information, where the plurality of reference data units are data units obtained by splitting the plurality of target data units;
and the merging unit is used for merging the data units storing the same document node in the plurality of reference data units to obtain a plurality of target data units.
Optionally, the splitting module comprises:
and the determining unit is used for sequentially determining the data unit groups to which the target data units belong according to the sequence of the target data units to obtain a plurality of data unit groups, wherein the size of the data unit contained in each data unit group is smaller than or equal to the page size.
Optionally, the determining unit includes:
the selecting subunit is used for selecting a data unit to be grouped from the target data units according to the sequence of the target data units;
and the adding subunit is configured to add the data unit to be grouped into the current data unit group when the size of the data unit to be grouped is smaller than or equal to the remaining size of the current data unit group, where the remaining size of the current data unit group is a difference between the page size and a total size of existing data units in the current data unit group.
Optionally, the apparatus further comprises:
a second splitting module, configured to, after the data unit to be grouped is selected from the multiple target data units according to the order of the multiple target data units, split the data unit to be grouped into a first data unit and a second data unit when the size of the data unit to be grouped is larger than a remaining size of the current data unit group, where the size of the first data unit is smaller than or equal to the remaining size;
an adding module, configured to add the first data unit to the current data unit group, and add the second data unit to at least one data unit group subsequent to the current data group.
Optionally, the apparatus further comprises:
a rendering module, configured to render each data unit in a to-be-displayed data unit group as a page view node after the target data units are split into the data unit groups according to the page size, where the to-be-displayed data unit group is a data unit group corresponding to a target page to be displayed in the data unit groups;
and the display module is used for inserting the page view node into the page view of the target paging for display.
According to another aspect of the embodiments of the present application, there is also provided an electronic device, including a processor, a communication interface, a memory, and a communication bus, where the processor, the communication interface, and the memory communicate with each other through the communication bus; wherein the memory is used for storing the computer program; a processor for executing the paging step of the document data in any of the above embodiments by running the computer program stored on the memory.
According to still another aspect of the embodiments of the present application, there is further provided a computer-readable storage medium, in which a computer program is stored, wherein the computer program is configured to execute the paging step of the document data in any one of the above embodiments when running.
According to yet another aspect of an embodiment of the present application, there is also provided a computer program product or a computer program comprising computer instructions stored in a computer readable storage medium; the processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions to cause the computer device to perform the paging step of the document data in any of the above embodiments.
According to the embodiment of the application, the document data to be displayed is stored in the target data units, the target data units are divided into the data unit groups according to the page size, each data unit group corresponds to one paging page, all the document data can be displayed on the display page in a paging mode on the basis of not changing the page size, the paging function of the online document is optimized, and the page display flexibility is higher.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and together with the description, serve to explain the principles of the invention.
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, and it is obvious for those skilled in the art that other drawings can be obtained according to the drawings without inventive exercise.
FIG. 1 is a diagram illustrating a hardware environment of an alternative method for paging document data according to an embodiment of the present invention;
fig. 2 is a schematic flowchart of an optional method for paging document data according to an embodiment of the present application;
fig. 3 is a schematic overall flowchart of an optional method for paging document data according to an embodiment of the present application;
FIG. 4 is a block diagram of an alternative apparatus for paging document data according to an embodiment of the present application;
fig. 5 is a block diagram of an alternative electronic device according to an embodiment of the present disclosure.
Detailed Description
In order to make the technical solutions better understood by those skilled in the art, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only partial embodiments of the present application, but not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
It should be noted that the terms "first," "second," and the like in the description and claims of this application and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the application described herein are capable of operation in sequences other than those illustrated or described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
The embodiment of the application provides a document data paging method, which can be applied to online document paging scenes of web page versions such as enterprise WeChat. Alternatively, in the embodiment of the present application, the method for predicting product sales may be applied to a hardware environment as shown in fig. 1. As shown in fig. 1, the terminal 102 may include a memory 104, a processor 106, and a display 108 (optional components). The terminal 102 may be communicatively coupled to a server 112 via a network 110, the server 112 may be configured to provide services (e.g., gaming services, application services, etc.) to the terminal or to a consumer terminal installed on the terminal, and a database 114 may be provided on the server 112 or separate from the server 112 to provide data storage services to the server 112. Additionally, a processing engine 116 may be run in the server 112, and the processing engine 116 may be used to perform the steps performed by the server 112.
Alternatively, the terminal 102 may be, but is not limited to, a terminal capable of calculating data, such as a mobile terminal (e.g., a mobile phone, a tablet Computer), a notebook Computer, a PC (Personal Computer) Computer, and the like, and the network may include, but is not limited to, a wireless network or a wired network. Wherein, this wireless network includes: bluetooth, WIFI (Wireless Fidelity), and other networks that enable Wireless communication. Such wired networks may include, but are not limited to: wide area networks, metropolitan area networks, and local area networks. The server 112 may include, but is not limited to, any hardware device capable of performing computations.
In addition, in the present embodiment, the above method for paging document data can also be applied, but not limited, to an independent processing device with a relatively high processing capability without data interaction. For example, the processing device may be, but is not limited to, a terminal device with a high processing capability, that is, each operation in the above-described method for paging document data may be integrated into one independent processing device. The above is merely an example, and this is not limited in this embodiment.
Alternatively, in this embodiment, the above-mentioned method for paging document data may be executed by the server 112, the terminal 102, or both the server 112 and the terminal 102. The terminal 102 may execute the method for paging the document data according to the embodiment of the present application, or may execute the method by a consumer installed thereon.
Taking an example of the method running in a server, fig. 2 is a schematic flowchart of an optional method for paging document data according to an embodiment of the present application, and as shown in fig. 2, the method may include the following steps:
in step S201, page configuration information of document data is acquired, where the page configuration information is used to indicate a page size of a paginated page of the document data.
Optionally, in the embodiment of the present application, characters, pictures, tables, formulas, and the like that can be displayed on a page are used as document data, and then page configuration information showing the document data is set, for example, the page configuration information may include setting dimensions such as a page width and a page height.
In step S202, a plurality of target data units corresponding to the document data are determined, wherein each target data unit stores one document node of the document data.
Optionally, the document data is correspondingly stored in a plurality of target data units, each target data unit maps (i.e. stores) one document node of the document data, where all contents in the document data may be document nodes, such as: a certain label, a certain attribute, a certain piece of text, etc.
In step S203, the target data unit is divided into a plurality of data unit groups according to the page size, wherein the target data unit is allowed to be divided into a plurality of data units, each of the data unit groups corresponding to one paginated page of the document data.
Optionally, the server splits the document data into a plurality of data unit groups according to the page size set in advance, where the document data is stored in a plurality of target data units, for example, the currently displayed page size is a size of a4 paper, after document nodes in the document data to be displayed are stored in a plurality of target data units, respectively, and the widths and heights generated by the plurality of target data units are compared with the size of a4 paper, the target data unit can be split into a plurality of data unit groups, and each data unit group corresponds to one paginated page.
According to the embodiment of the application, the document data to be displayed is stored in the target data units, the target data units are divided into the data unit groups according to the page size, each data unit group corresponds to one paging page, all the document data can be displayed on the display page in a paging mode on the basis of not changing the page size, the paging function of the online document is optimized, and the page display flexibility is higher.
As an alternative embodiment, determining a plurality of target data units corresponding to the document data includes:
converting document nodes of a tree structure in document data into document nodes of a non-tree structure to obtain a plurality of document nodes;
and sequentially storing the plurality of document nodes into the plurality of target data units, wherein the plurality of document nodes correspond to the plurality of target data units one by one.
Optionally, a data middle layer is added to the logic of online document paging display, the data middle layer can convert document nodes of a tree structure in document data into document nodes of a non-tree structure, the non-tree structure can simplify complex operations, and the document nodes of the non-tree structure can meet operations such as data splitting.
The server stores the document nodes in a plurality of target data units in sequence, and meanwhile, the document nodes and the target data units are in one-to-one correspondence.
As an alternative embodiment, determining a plurality of target data units corresponding to the document data includes:
acquiring a plurality of reference data units under the condition that the page configuration information is the adjusted configuration information, wherein the plurality of reference data units are data units formed by splitting a plurality of target data units;
and merging the data units storing the same document node in the multiple reference data units to obtain multiple target data units.
Optionally, the user may adjust the page configuration information at will to implement initialization of the page, for example, the user changes the page size from the original a4 size to the A3 size, at this time, because the size of the displayed page becomes large, two a4 pages are needed to display the complete document data, after the displayed page is changed into A3 sheets, one displayed page may be sufficient, and at this time, in order to adapt to the page size changed by the user and meet the requirement of page display, in the embodiment of the present application, multiple reference data units obtained by splitting the target data unit are merged into the same target data unit, and the merged target data unit is split according to the page size by using the merged target data unit as the paging standard of the document node.
According to the document paging method and device, the tree-structure document nodes in the document data are converted into the non-tree-structure document nodes, the document nodes are sequentially stored in the target data units, and then the document data in the target data units are rendered, so that the online document paging function is achieved.
As an alternative embodiment, splitting the plurality of target data units into the plurality of groups of data units by page size comprises:
and sequentially determining the data unit groups to which the target data units belong according to the sequence of the target data units to obtain a plurality of data unit groups, wherein the size of the data unit contained in each data unit group is smaller than or equal to the page size.
Optionally, in the embodiment of the present application, the data units are sequentially stored in the multiple target data units according to the display order of the document data, and then the data unit groups to which the target data units belong are sequentially determined according to the order of the multiple target data units, because one data unit group corresponds to one page, and one data unit group may contain multiple data units, the size of the data unit contained in each data unit group is smaller than or equal to the page size, if the size of the data unit contained in each data unit group is larger than the page size, a paging situation occurs, and then the current data unit group is split.
As an alternative embodiment, sequentially determining the data unit groups to which the target data units belong according to the sequence of the target data units, and obtaining the data unit groups includes:
selecting a data unit to be grouped from a plurality of target data units according to the sequence of the target data units;
and adding the data unit to be grouped into the current data unit group under the condition that the size of the data unit to be grouped is smaller than or equal to the remaining size of the current data unit group, wherein the remaining size of the current data unit group is the difference between the page size and the total size of the existing data units in the current data unit group.
Optionally, in the embodiment of the present application, multiple target data units may be placed in a queue, where the queue may be understood as a memory for storing the target data units, and then the server sequentially stores the target data units in the queue according to the sequence of the multiple target data units, and then determines whether there are data units that have not been grouped in the queue (i.e., data units to be grouped).
And taking a unit to be grouped as a current data unit, judging whether the display height of the current data unit is smaller than or equal to the residual size of the current data unit group, adding the unit to be grouped into the current data unit group under the condition that the size of the unit to be grouped is smaller than or equal to the residual size of the current data unit group, and modifying the value of the residual size of the current data unit group, wherein the residual size of the current data unit group is the difference value between the page size and the total size of the existing data units in the current data unit group.
According to the embodiment of the application, the addition of the data unit to be grouped is completed by comparing the size of the data unit to be grouped with the remaining size of the current data unit group, and the paging efficiency is improved.
As an alternative embodiment, after the data unit to be grouped is selected from the plurality of target data units in the order of the plurality of target data units, the method further comprises:
under the condition that the size of the data unit to be grouped is larger than the residual size of the current data unit group, splitting the data unit to be grouped into a first data unit and a second data unit, wherein the size of the first data unit is smaller than or equal to the residual size;
the first data unit is added to a current group of data units and the second data unit is added to at least one group of data units following the current group of data units.
Optionally, when the size of the data unit to be grouped is larger than the remaining size of the current data unit group, it may be determined first whether the data unit to be grouped can be split, for example, when the document data stored in the data unit to be grouped is a formula or a picture that must be complete, the data unit to be grouped cannot be split, and if the document data stored in the data unit to be grouped is a table or a character, the data unit to be grouped may be split into two data units, and the two data units are sequentially added into the data unit group.
For example, a data unit to be grouped is split into a first data unit and a second data unit, wherein the size of the first data unit is smaller than or equal to the remaining size; and adding the first data unit into the current data unit group, newly building a data unit group when the residual size of the current data unit group is zero, and adding the second data unit into a newly built data unit group behind the current data group. It should be noted that, if the size of the second data unit is larger and one page cannot completely display the document data in the second data unit, the second data unit needs to be added to a plurality of data unit groups, and at this time, the second data unit should be added to at least one new data unit group after the current data group.
According to the embodiment of the application, when the data unit to be grouped is divided into the first data unit and the second data unit, the data unit group is increased in real time according to the sizes of the first data unit and the second data unit so as to achieve the purpose of displaying the complete document data.
As an alternative embodiment, after splitting the plurality of target data units into the plurality of groups of data units by page size, the method further comprises:
rendering each data unit in the data unit group to be displayed as a page view node, wherein the data unit group to be displayed is a data unit group corresponding to a target page to be displayed in the plurality of data unit groups;
and inserting the page view node into the page view of the target paging for displaying.
Optionally, the API rendering tool is used to render each data unit in the data unit group to be displayed into a page view node, where each data unit group corresponds to one paging page, and the data unit included in each data unit group stores document data to be displayed, so that the page view node can be rendered through the data unit, and then the rendered page view node is inserted into the display page.
According to the method and the device, the page view nodes are obtained by rendering the data units in the data unit group, and therefore the target pages to be displayed achieve the online document paging function.
As an alternative embodiment, as shown in fig. 3, fig. 3 is a schematic overall flow diagram of an alternative method for paging document data provided in an embodiment of the present application, and specifically includes:
step 1, in the process of initializing the online document, default page configuration is set (A4), and after the default page configuration is set, the application executes step 3.
And 2, the user can change the page configuration at any time in the process of using the online document, and the application executes the step 3 after the user modifies the page configuration.
Step 3, acquiring whether a data unit is split into a plurality of data units to be scattered in a plurality of groups in the last grouping process, if so, executing step 4 by the application; if not, the application will perform step 6.
And 4, acquiring data of how the data unit is split in the last grouping process.
And 5, restoring the plurality of split data units into one data unit according to the acquired split data.
And 6, grouping the data units according to the page configuration.
And 7, circularly traversing each group, and rendering the page view nodes according to the data units.
And 8, inserting the rendered view nodes into the page view for display.
It should be noted that, for simplicity of description, the above-mentioned method embodiments are described as a series of acts or combination of acts, but those skilled in the art will recognize that the present application is not limited by the order of acts described, as some steps may occur in other orders or concurrently depending on the application. Further, those skilled in the art should also appreciate that the embodiments described in the specification are preferred embodiments and that the acts and modules referred to are not necessarily required in this application.
Through the above description of the embodiments, those skilled in the art can clearly understand that the method according to the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but the former is a better implementation mode in many cases. Based on such understanding, the technical solutions of the present application may be embodied in the form of a software product, which is stored in a storage medium (e.g., a ROM (Read-Only Memory)/RAM (Random Access Memory), a magnetic disk, an optical disk) and includes several instructions for enabling a terminal device (e.g., a mobile phone, a computer, a server, or a network device) to execute the methods of the embodiments of the present application.
According to another aspect of the embodiments of the present application, there is also provided a document data paging device for implementing the above-described method for paging document data. Fig. 4 is a schematic diagram of an optional paging device for document data according to an embodiment of the present application, and as shown in fig. 4, the device may include:
an obtaining module 401, configured to obtain page configuration information of the document data, where the page configuration information is used to indicate a page size of a paginated page of the document data;
a determining module 402, configured to determine a plurality of target data units corresponding to the document data, where each target data unit stores a document node of the document data;
a first splitting module 403 is configured to split the target data units into a plurality of data unit groups according to the page size, wherein the target data unit is allowed to be split into a plurality of data units, and each data unit group corresponds to one paginated page of the document data.
It should be noted that the obtaining module 401 in this embodiment may be configured to execute the step S201, the determining module 402 in this embodiment may be configured to execute the step S202, and the first splitting module 403 in this embodiment may be configured to execute the step S203.
The document data to be displayed is stored in the target data units through the modules, the target data units are divided into the data unit groups according to the page size, each data unit group corresponds to one paging page, all the document data can be displayed on the display page in a paging mode on the basis of not changing the page size, the paging function of the online document is optimized, and the page display flexibility is higher.
As an alternative embodiment, the determining module includes:
the conversion unit is used for converting the document nodes with the tree structures in the document data into document nodes with non-tree structures to obtain a plurality of document nodes;
and the storage unit is used for sequentially storing the plurality of document nodes into the plurality of target data units, wherein the plurality of document nodes correspond to the plurality of target data units one by one.
As an alternative embodiment, the determining module includes:
the acquiring unit is used for acquiring a plurality of reference data units under the condition that the page configuration information is the adjusted configuration information, wherein the plurality of reference data units are data units formed by splitting a plurality of target data units;
and the merging unit is used for merging the data units storing the same document node in the multiple reference data units to obtain multiple target data units.
As an alternative embodiment, the splitting module comprises:
and the determining unit is used for sequentially determining the data unit groups to which the target data units belong according to the sequence of the target data units to obtain a plurality of data unit groups, wherein the size of the data unit contained in each data unit group is smaller than or equal to the page size.
As an alternative embodiment, the determining unit includes:
the selecting subunit is used for selecting the data unit to be grouped from the target data units according to the sequence of the target data units;
and the adding subunit is used for adding the data unit to be grouped into the current data unit group when the size of the data unit to be grouped is smaller than or equal to the remaining size of the current data unit group, wherein the remaining size of the current data unit group is the difference between the page size and the total size of the existing data units in the current data unit group.
As an alternative embodiment, the apparatus further comprises:
the second splitting module is used for splitting the data unit to be grouped into a first data unit and a second data unit under the condition that the size of the data unit to be grouped is larger than the residual size of the current data unit group after the data unit to be grouped is selected from the target data units according to the sequence of the target data units, wherein the size of the first data unit is smaller than or equal to the residual size;
and the adding module is used for adding the first data unit into the current data unit group and adding the second data unit into at least one data unit group behind the current data group.
As an alternative embodiment, the apparatus further comprises:
the rendering module is used for respectively rendering each data unit in the data unit groups to be displayed into page view nodes after the target data units are split into the data unit groups according to the page size, wherein the data unit groups to be displayed are the data unit groups corresponding to the target pages to be displayed in the data unit groups;
and the display module is used for inserting the page view nodes into the page views of the target paging for display.
It should be noted here that the modules described above are the same as the examples and application scenarios implemented by the corresponding steps, but are not limited to the disclosure of the above embodiments. It should be noted that the modules described above as a part of the apparatus may be operated in a hardware environment as shown in fig. 1, and may be implemented by software, or may be implemented by hardware, where the hardware environment includes a network environment.
According to still another aspect of the embodiments of the present application, there is also provided an electronic device for implementing the above method for paging of document data, which may be a server, a terminal, or a combination thereof.
Fig. 5 is a block diagram of an alternative electronic device according to an embodiment of the present application, as shown in fig. 5, including a processor 501, a communication interface 502, a memory 503, and a communication bus 504, where the processor 501, the communication interface 502, and the memory 503 are communicated with each other through the communication bus 504, where,
a memory 503 for storing a computer program;
the processor 501, when executing the computer program stored in the memory 503, implements the following steps:
s1, obtaining page configuration information of the document data, wherein the page configuration information is used for indicating the page size of the paginated pages of the document data;
s2, determining a plurality of target data units corresponding to the document data, wherein each target data unit stores one document node of the document data;
s3, splitting the plurality of target data units into a plurality of data unit groups by page size, wherein the target data unit is allowed to be split into the plurality of data units, each data unit group corresponding to one paginated page of the document data.
Alternatively, in this embodiment, the communication bus may be a PCI (Peripheral Component Interconnect) bus, an EISA (Extended Industry Standard Architecture) bus, or the like. The communication bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown in FIG. 5, but this is not intended to represent only one bus or type of bus.
The communication interface is used for communication between the electronic equipment and other equipment.
The memory may include RAM, and may also include non-volatile memory (non-volatile memory), such as at least one disk memory. Alternatively, the memory may be at least one memory device located remotely from the processor.
As an example, as shown in fig. 5, the memory 503 may include, but is not limited to, an obtaining module 401, a determining module 402, and a first splitting module 403 in a paging device that includes the document data. In addition, the document data may further include, but is not limited to, other module units in the above document data paging device, which is not described in this example again.
The processor may be a general-purpose processor, and may include but is not limited to: a CPU (Central Processing Unit), an NP (Network Processor), and the like; but also a DSP (Digital Signal Processing), an ASIC (Application Specific Integrated Circuit), an FPGA (Field Programmable Gate Array) or other Programmable logic device, discrete Gate or transistor logic device, discrete hardware component.
In addition, the electronic device further includes: and a display for displaying the paging result of the document data.
Optionally, the specific examples in this embodiment may refer to the examples described in the above embodiments, and this embodiment is not described herein again.
It can be understood by those skilled in the art that the structure shown in fig. 5 is only an illustration, and the device implementing the method for paging document data may be a terminal device, and the terminal device may be a terminal device such as a smart phone (e.g., an Android phone, an iOS phone, etc.), a tablet computer, a palm computer, a Mobile Internet Device (MID), a PAD, and the like. Fig. 5 is a diagram illustrating a structure of the electronic device. For example, the terminal device may also include more or fewer components (e.g., network interfaces, display devices, etc.) than shown in FIG. 5, or have a different configuration than shown in FIG. 5.
Those skilled in the art will appreciate that all or part of the steps in the methods of the above embodiments may be implemented by a program instructing hardware associated with the terminal device, where the program may be stored in a computer-readable storage medium, and the storage medium may include: flash disk, ROM, RAM, magnetic or optical disk, and the like.
According to still another aspect of an embodiment of the present application, there is also provided a storage medium. Alternatively, in the present embodiment, the storage medium described above may be used for a program code for executing a paging method of document data.
Optionally, in this embodiment, the storage medium may be located on at least one of a plurality of network devices in a network shown in the above embodiment.
Optionally, in this embodiment, the storage medium is configured to store program code for performing the following steps:
s1, obtaining page configuration information of the document data, wherein the page configuration information is used for indicating the page size of the paginated pages of the document data;
s2, determining a plurality of target data units corresponding to the document data, wherein each target data unit stores one document node of the document data;
s3, splitting the plurality of target data units into a plurality of data unit groups by page size, wherein the target data unit is allowed to be split into the plurality of data units, each data unit group corresponding to one paginated page of the document data.
Optionally, the specific example in this embodiment may refer to the example described in the above embodiment, which is not described again in this embodiment.
Optionally, in this embodiment, the storage medium may include, but is not limited to: various media capable of storing program codes, such as a U disk, a ROM, a RAM, a removable hard disk, a magnetic disk, or an optical disk.
According to yet another aspect of an embodiment of the present application, there is also provided a computer program product or a computer program comprising computer instructions stored in a computer readable storage medium; the processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions to cause the computer device to perform the paging method steps of the document data in any of the above embodiments.
The above-mentioned serial numbers of the embodiments of the present application are merely for description and do not represent the merits of the embodiments.
The integrated unit in the above embodiments, if implemented in the form of a software functional unit and sold or used as a separate product, may be stored in the above computer-readable storage medium. Based on such understanding, the technical solution of the present application may be substantially implemented or a part of or all or part of the technical solution may be embodied in the form of a software product stored in a storage medium, and including a plurality of instructions for causing one or more computer devices (which may be personal computers, servers, network devices, or the like) to execute all or part of the steps of the paging method of the document data of the embodiments of the present application.
In the above embodiments of the present application, the descriptions of the respective embodiments have respective emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to related descriptions of other embodiments.
In the several embodiments provided in the present application, it should be understood that the disclosed consumer terminal may be implemented in other ways. The above-described embodiments of the apparatus are merely illustrative, and for example, a division of a unit is merely a division of a logic function, and an actual implementation may have another division, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, units or modules, and may be in an electrical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, and may also be distributed on a plurality of network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution provided in the embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The foregoing is only a preferred embodiment of the present application and it should be noted that those skilled in the art can make several improvements and modifications without departing from the principle of the present application, and these improvements and modifications should also be considered as the protection scope of the present application.

Claims (10)

1. A method for paging document data, the method comprising:
acquiring page configuration information of document data, wherein the page configuration information is used for indicating the page size of paging pages of the document data;
determining a plurality of target data units corresponding to the document data, wherein each target data unit stores one document node of the document data;
and splitting the target data unit into a plurality of data unit groups according to the page size, wherein the target data unit is allowed to be split into a plurality of data units, and each data unit group corresponds to one paging page of the document data.
2. The method according to claim 1, wherein the determining a plurality of target data units corresponding to the document data comprises:
converting document nodes of a tree structure in the document data into document nodes of a non-tree structure to obtain a plurality of document nodes;
and sequentially storing the document nodes into the target data units, wherein the document nodes correspond to the target data units one by one.
3. The method according to claim 1, wherein the determining a plurality of target data units corresponding to the document data comprises:
acquiring a plurality of reference data units under the condition that the page configuration information is the adjusted configuration information, wherein the plurality of reference data units are data units formed by splitting a plurality of target data units;
and merging the data units storing the same document node in the plurality of reference data units to obtain a plurality of target data units.
4. The method of claim 1, wherein the splitting the plurality of target data units into the plurality of groups of data units according to the page size comprises:
and sequentially determining the data unit groups to which the target data units belong according to the sequence of the target data units to obtain a plurality of data unit groups, wherein the size of the data unit contained in each data unit group is smaller than or equal to the page size.
5. The method of claim 4, wherein the sequentially determining the group of data units to which each target data unit belongs according to the sequence of the target data units, and obtaining the plurality of groups of data units comprises:
selecting a data unit to be grouped from the target data units according to the sequence of the target data units;
and adding the data unit to be grouped into the current data unit group when the size of the data unit to be grouped is smaller than or equal to the remaining size of the current data unit group, wherein the remaining size of the current data unit group is the difference between the page size and the total size of the existing data units in the current data unit group.
6. The method of claim 5, wherein after said selecting a data unit to be grouped from a plurality of said target data units in an order of said plurality of said target data units, said method further comprises:
when the size of the data unit to be grouped is larger than the residual size of the current data unit group, splitting the data unit to be grouped into a first data unit and a second data unit, wherein the size of the first data unit is smaller than or equal to the residual size;
adding the first data unit to the current group of data units and adding the second data unit to at least one group of data units subsequent to the current group of data units.
7. The method of any of claims 1-6, wherein after the splitting the plurality of target data units into the plurality of groups of data units by the page size, the method further comprises:
rendering each data unit in a data unit group to be displayed as a page view node, wherein the data unit group to be displayed is a data unit group corresponding to a target page to be displayed in a plurality of data unit groups;
and inserting the page view node into the page view of the target paging for displaying.
8. A device for paging document data, the device comprising:
the acquisition module is used for acquiring page configuration information of the document data, wherein the page configuration information is used for indicating the page size of the paging page of the document data;
a determining module, configured to determine a plurality of target data units corresponding to the document data, where each target data unit stores a document node of the document data;
a first splitting module, configured to split the target data units into a plurality of data unit groups according to the page size, where the target data unit is allowed to be split into a plurality of data units, and each data unit group corresponds to one paginated page of the document data.
9. An electronic device comprising a processor, a communication interface, a memory and a communication bus, wherein said processor, said communication interface and said memory communicate with each other via said communication bus,
the memory for storing a computer program;
the processor for executing the paging method steps of document data according to any one of claims 1 to 7 by running the computer program stored on the memory.
10. A storage medium readable by a computer, in which a computer program is stored, wherein the computer program is arranged to execute the method steps of paging of document data according to any one of claims 1 to 7 when running.
CN202011405702.XA 2020-12-03 2020-12-03 Method and device for paging document data, storage medium and electronic equipment Pending CN112464618A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011405702.XA CN112464618A (en) 2020-12-03 2020-12-03 Method and device for paging document data, storage medium and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011405702.XA CN112464618A (en) 2020-12-03 2020-12-03 Method and device for paging document data, storage medium and electronic equipment

Publications (1)

Publication Number Publication Date
CN112464618A true CN112464618A (en) 2021-03-09

Family

ID=74806601

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011405702.XA Pending CN112464618A (en) 2020-12-03 2020-12-03 Method and device for paging document data, storage medium and electronic equipment

Country Status (1)

Country Link
CN (1) CN112464618A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115827947A (en) * 2023-02-03 2023-03-21 北京匠数科技有限公司 Method and device for collecting paging website data and electronic equipment

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060026512A1 (en) * 2004-07-30 2006-02-02 Microsoft Corporation Systems and methods for pagination using variable page dimensions
CN103176952A (en) * 2011-12-20 2013-06-26 北大方正集团有限公司 Document display method and document display device
CN109408752A (en) * 2018-10-17 2019-03-01 天津字节跳动科技有限公司 Online document methods of exhibiting, device and electronic equipment

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060026512A1 (en) * 2004-07-30 2006-02-02 Microsoft Corporation Systems and methods for pagination using variable page dimensions
CN103176952A (en) * 2011-12-20 2013-06-26 北大方正集团有限公司 Document display method and document display device
CN109408752A (en) * 2018-10-17 2019-03-01 天津字节跳动科技有限公司 Online document methods of exhibiting, device and electronic equipment

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115827947A (en) * 2023-02-03 2023-03-21 北京匠数科技有限公司 Method and device for collecting paging website data and electronic equipment

Similar Documents

Publication Publication Date Title
CN105975576B (en) Terminal content adaptive display method and device and terminal
CN106649543B (en) Method, device and terminal for recording reading progress
CN108334508B (en) Webpage information extraction method and device
CN108549532A (en) Webpage construction method, device, electronic equipment and storage medium
CN109783757B (en) Method, device and system for rendering webpage, storage medium and electronic device
CN105488125A (en) Page access method and apparatus
CN109948518B (en) Neural network-based PDF document content text paragraph aggregation method
CN106294480A (en) A kind of file layout change-over method, device and examination question import system
CN109710224B (en) Page processing method, device, equipment and storage medium
CN113032580B (en) Associated file recommendation method and system and electronic equipment
CN112464618A (en) Method and device for paging document data, storage medium and electronic equipment
CN105404672B (en) The system and method for web data storage and operation
CN109697281A (en) The online method, apparatus and electronic equipment for merging document
CN110427496B (en) Knowledge graph expansion method and device for text processing
CN103034468B (en) A kind of method and device showing text
CN115935909A (en) File generation method and device and electronic equipment
CN111222065B (en) Information display method and device, electronic equipment and medium
CN110321125B (en) Data configuration method and device for cells and readable storage medium
CN105589870B (en) Method and system for filtering webpage advertisements
CN114861614A (en) Method and device for filling data, electronic equipment and medium
CN111079399B (en) Image-text data processing method, image-text data processing device, computer equipment and storage medium
CN112835577A (en) Data processing method, data processing device, computer equipment and readable storage medium
CN109948123B (en) Image merging method and device
CN111259276A (en) Method and device for displaying title content, electronic equipment and storage medium
CN112597760A (en) Method and device for extracting domain words in document

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