CN110554872B - Data processing method based on reader SDK and reader SDK - Google Patents

Data processing method based on reader SDK and reader SDK Download PDF

Info

Publication number
CN110554872B
CN110554872B CN201910730675.4A CN201910730675A CN110554872B CN 110554872 B CN110554872 B CN 110554872B CN 201910730675 A CN201910730675 A CN 201910730675A CN 110554872 B CN110554872 B CN 110554872B
Authority
CN
China
Prior art keywords
electronic book
data
page
book file
files
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201910730675.4A
Other languages
Chinese (zh)
Other versions
CN110554872A (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 Qutian Technology Co ltd
Original Assignee
Beijing Qutian 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 Qutian Technology Co ltd filed Critical Beijing Qutian Technology Co ltd
Priority to CN201910730675.4A priority Critical patent/CN110554872B/en
Publication of CN110554872A publication Critical patent/CN110554872A/en
Application granted granted Critical
Publication of CN110554872B publication Critical patent/CN110554872B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/38Creation or generation of source code for implementing user interfaces
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation
    • G06F8/42Syntactic analysis
    • G06F8/427Parsing

Abstract

The invention discloses a data processing method based on a reader SDK and the reader SDK, wherein the data processing method comprises the following steps: reading an electronic book file; grouping the electronic book files according to a preset rule; starting a plurality of threads to respectively perform asynchronous analysis on each group of electronic book files, and obtaining analysis results corresponding to each group of electronic book files; merging the analysis results corresponding to all the grouped electronic book files to obtain analyzed electronic book files; paging the parsed electronic book file according to the page size and the page margin of a preset display interface; asynchronous data drawing is carried out on each page of electronic book file subjected to paging processing, wherein the data drawing is to draw each page of electronic book file on at least one picture, and finally the at least one picture is displayed on a display interface. The invention can increase the processing speed of the SDK of the reader and provides great convenience for a developer in developing a new reader.

Description

Data processing method based on reader SDK and reader SDK
Technical Field
The invention relates to the technical field of reader SDKs, in particular to a data processing method based on a reader SDK and the reader SDK.
Background
A software development kit (Software Development Kit, SDK) is a collection of development tools, including a series of header files, library files, documents, etc., for a particular software package, software framework, hardware platform, operating system, etc., when building application software. The software development kit may facilitate the development of relevant documents, examples, and tools for a piece of software. The developer can realize the expected functions only by using the corresponding external development interface according to the description document, so that the application development flow is simplified, the application development speed is improved, and the development quality of the application is ensured to a certain extent.
Currently, many developers do APP with the function of a reader, however, if developing a set of readers by themselves, the cost of manpower is high.
In the face of the development demands of increasingly-growing reader-related applications, developers mostly carry out subsequent development on the existing reader-related SDKs, but the existing reader SDKs have the defect of low processing speed, so that the readers developed by the developers have great defects.
Disclosure of Invention
The invention aims to provide a data processing method based on a reader SDK and the reader SDK, which are used for solving the problems existing in the prior art.
In order to achieve the above purpose, the technical scheme of the invention is as follows:
a data processing method based on a reader SDK, the data processing method comprising:
reading an electronic book file;
grouping the electronic book files according to a preset rule;
starting a plurality of threads to respectively perform asynchronous analysis on each group of electronic book files, and obtaining analysis results corresponding to each group of electronic book files;
merging the analysis results corresponding to all the grouped electronic book files to obtain analyzed electronic book files;
paging the parsed electronic book file according to the page size and the page margin of a preset display interface;
asynchronous data drawing is carried out on each page of electronic book file subjected to paging processing, wherein the data drawing is to draw each page of electronic book file on at least one picture, and finally the at least one picture is displayed on a display interface.
According to the technical scheme, the electronic book files are read at first, then the electronic book files are grouped according to preset rules, a plurality of threads are started to respectively perform asynchronous analysis on each group of the electronic book files, the speed of analyzing the electronic book files is increased, analysis results corresponding to each group of the electronic book files are obtained in the fastest time, analysis results corresponding to all groups of the electronic book files are combined, analyzed electronic book files are obtained rapidly, the page number of the electronic book files is obtained according to the page size and the page margin of a preset display interface, and asynchronous data of each page of the electronic book files subjected to paging processing are drawn into a picture format and displayed on the display interface.
The preset rule may be to divide the electronic book files into several groups according to the number of pages; the preset rule may be to divide the electronic book file into several groups in paragraphs; the preset rule may be to divide the electronic book files into several groups in chapters.
Preferably, when a plurality of threads are started to asynchronously analyze each group of electronic book files, the analysis result corresponding to each group of electronic book files is obtained as follows:
and positioning the starting position and the ending position of the current page of the electronic book file before analysis and the position information of each data in the electronic book file before analysis.
Preferably, after asynchronous data drawing is performed on each page of electronic book file subjected to paging processing, the data processing method further includes:
receiving an operation instruction input by a user;
according to the operation instruction, re-paging processing is carried out according to a preset data pattern;
and drawing the data of each page of electronic book file subjected to paging processing again, and displaying the data on a display interface.
Preferably, the data pattern at least includes one or more of the following: text font, font color, line height, and background color of the display interface.
Preferably, before the paging processing is performed on the parsed electronic book file according to the page size and the page margin of the preset display interface, the data processing method further includes:
and the analyzed electronic book file is adjusted according to a preset format, and the adjusted electronic book file is obtained.
A reader SDK, the reader SDK comprising:
the reading unit is used for reading the electronic book file;
a grouping unit, configured to perform grouping processing on the electronic book files according to a preset rule;
the analysis unit is used for carrying out asynchronous analysis on each group of electronic book files and obtaining analysis results corresponding to each group of electronic book files;
the merging unit is used for merging the analysis results corresponding to all the grouped electronic book files to obtain analyzed electronic book files;
the paging unit is used for paging the parsed electronic book file according to the page size and the page margin of a preset display interface;
and the data drawing unit is used for carrying out asynchronous data drawing on each page of electronic book file subjected to paging processing, so that the electronic book file is finally displayed on the display interface.
Preferably, the data drawing unit draws each page of electronic book file on at least one picture when asynchronous data is drawn, and finally displays the at least one picture on a display interface.
Preferably, when the parsing unit performs asynchronous parsing on each group of electronic book files, the parsing result corresponding to each group of electronic book files is obtained as follows: and positioning the starting position and the ending position of the current page of the electronic book file before analysis and the position information of each data in the electronic book file before analysis.
Preferably, the reader SDK further includes: the receiving unit is used for receiving an operation instruction input by a user, and re-paging processing is carried out according to a preset data pattern and the paging unit;
and carrying out data drawing on each page of electronic book file subjected to paging processing again through the paging unit according to the data drawing unit, and displaying the data drawing on a display interface.
The method of the invention has the following advantages: according to the method, the electronic book files are grouped according to the preset rule, a plurality of threads are started to asynchronously analyze each group of the electronic book files, the speed of analyzing the electronic book files is increased, analysis results corresponding to each group of the electronic book files are obtained in the fastest time, analysis results corresponding to all the grouped electronic book files are combined, the analyzed electronic book files are obtained rapidly, the processing speed of the SDK of the reader is increased, and great convenience is provided for a developer in developing a new reader.
Drawings
Fig. 1 is a flow chart of a data processing method based on the reader SDK.
Fig. 2 is a schematic diagram of the structure of the reader SDK.
Detailed Description
The following examples are illustrative of the invention and are not intended to limit the scope of the invention.
In the following description, for purposes of explanation and not limitation, specific details are set forth such as the particular system architecture, interfaces, techniques, etc., in order to provide a thorough understanding of the present invention. It will be apparent, however, to one skilled in the art that the present invention may be practiced in other embodiments that depart from these specific details. In other instances, detailed descriptions of well-known devices, circuits, and methods are omitted so as not to obscure the description of the present invention with unnecessary detail.
Example 1
Fig. 1 is a data processing method based on the reader SDK. As shown in fig. 1, the method includes:
step 101, reading an electronic book file.
Specifically, the electronic book file is read to prepare for the processing of the subsequent data.
And 102, grouping the electronic book files according to a preset rule.
Specifically, the preset rule may be to divide the electronic book files into several groups by the number of pages; the preset rule may be to divide the electronic book file into several groups in paragraphs; the preset rule may be to divide the electronic book files into several groups in chapters.
Step 103, starting a plurality of threads to respectively perform asynchronous analysis on each group of electronic book files, and obtaining analysis results corresponding to each group of electronic book files.
Specifically, when a plurality of threads are started to asynchronously analyze each group of electronic book files, an analysis result corresponding to each group of electronic book files is obtained as follows: and positioning the starting position and the ending position of the current page of the electronic book file before analysis and the position information of each data in the electronic book file before analysis.
Starting a plurality of threads to asynchronously analyze each group of electronic book files, accelerating the speed of analyzing the electronic book files, and obtaining the analysis result corresponding to each group of electronic book files in the fastest time.
For example, the electronic book file is divided into 10 parts before analysis, and 10 threads are started for simultaneous processing, so that the process of processing data is greatly reduced.
And 104, merging analysis results corresponding to all the grouped electronic book files to obtain analyzed electronic book files.
Specifically, the analysis results corresponding to all the grouped electronic book files are combined in sequence to obtain the analyzed electronic book files.
Step 105, the parsed e-book file is adjusted according to a preset format, and the adjusted e-book file is obtained.
Specifically, the preset format is a paragraph format of the electronic book file before analysis, and when typesetting errors such as spaces, blank lines and the like occur during analysis, the format of the electronic book file after analysis is adjusted according to the format set by the electronic book file before analysis.
And 106, paging the parsed electronic book file according to the preset page size and page margin of the display interface.
Specifically, the number of pages of the electronic book file after analysis is obtained according to the preset page size and page margin of the display interface, and the electronic book file is displayed at the calculated corresponding position in the later period, so that readers can conveniently know the total number of pages of the electronic book and the current number of pages for reading.
And 107, asynchronous data drawing is carried out on each page of electronic book file subjected to paging processing, and finally the at least one picture is displayed on a display interface.
Specifically, the data drawing is to draw each page of electronic book file on one or two pictures, and finally display one or two pictures on the display interface.
When the user needs to change the setting of the reader, after step 106, the data processing method based on the reader SDK further includes:
receiving an operation instruction input by a user;
according to the operation instruction, re-paging processing is carried out according to a preset data pattern;
and drawing the data of each page of electronic book file subjected to paging processing again, and displaying the data on a display interface.
Specifically, the data pattern includes at least one or more of the following: text font, font color, line height, and background color of the display interface.
Correspondingly, the embodiment of the invention also provides a schematic structure diagram of the reader SDK. Fig. 2 is a schematic structural diagram of a reader SDK according to an embodiment of the present invention. As shown in fig. 2, the apparatus includes: a reading unit 201, a grouping unit 202, a parsing unit 203, a merging unit 204, a paging unit 205, a data drawing unit 206, and a receiving unit 207.
A reading unit 201 for reading an electronic book file;
a grouping unit 202, configured to perform grouping processing on the electronic book files according to a preset rule;
an parsing unit 203, configured to asynchronously parse each group of electronic book files, and obtain a parsing result corresponding to each group of electronic book files;
specifically, when the parsing unit 203 performs asynchronous parsing on each group of electronic book files, the parsing result corresponding to each group of electronic book files is obtained as follows: and positioning the starting position and the ending position of the current page of the electronic book file before analysis and the position information of each data in the electronic book file before analysis.
A merging unit 204, configured to merge analysis results corresponding to all the grouped electronic book files to obtain parsed electronic book files;
a paging unit 205, configured to perform paging processing on the parsed electronic book file according to a preset page size and margin of a display interface;
the data drawing unit 206 is configured to perform asynchronous data drawing on each page of the electronic book file subjected to the paging processing, so that the electronic book file is finally displayed on the display interface.
Specifically, the data drawing unit 206 draws each page of electronic book file on one or two pictures during asynchronous data drawing, and finally displays the one or two pictures on the display interface.
A receiving unit 207, configured to receive an operation instruction input by a user, and re-perform paging processing according to a preset data pattern and the paging unit 205;
each electronic book file subjected to the paging processing by the paging unit 205 is subjected to data drawing according to the data drawing unit 206 and displayed on a display interface.
While the invention has been described in detail in the foregoing general description and specific examples, it will be apparent to those skilled in the art that modifications and improvements can be made thereto. Accordingly, such modifications or improvements may be made without departing from the spirit of the invention and are intended to be within the scope of the invention as claimed.

Claims (9)

1. A data processing method based on a reader SDK, the data processing method comprising:
reading an electronic book file;
grouping the electronic book files according to a preset rule;
starting a plurality of threads to respectively perform asynchronous analysis on each group of electronic book files, and obtaining analysis results corresponding to each group of electronic book files;
merging the analysis results corresponding to all the grouped electronic book files to obtain analyzed electronic book files;
paging the parsed electronic book file according to the page size and the page margin of a preset display interface;
asynchronous data drawing is carried out on each page of electronic book file subjected to paging processing, wherein the data drawing is to draw each page of electronic book file on at least one picture, and finally the at least one picture is displayed on a display interface.
2. The method for processing data based on the reader SDK according to claim 1, wherein when a plurality of threads are started to asynchronously parse each group of electronic book files, obtaining a parsing result corresponding to each group of electronic book files is:
and positioning the starting position and the ending position of the current page of the electronic book file before analysis and the position information of each data in the electronic book file before analysis.
3. The method for processing data based on the SDK of claim 1, wherein after asynchronous data rendering is performed on each page of the electronic book file subjected to the paging processing, the method for processing data further comprises:
receiving an operation instruction input by a user;
according to the operation instruction, re-paging processing is carried out according to a preset data pattern;
and drawing the data of each page of electronic book file subjected to paging processing again, and displaying the data on a display interface.
4. A data processing method based on a reader SDK according to claim 3, wherein the data pattern comprises at least one or more of the following: text font, font color, line height, and background color of the display interface.
5. The data processing method based on the SDK of claim 1, wherein before performing the paging processing on the parsed electronic book file according to the page size and the page margin of the preset display interface, the data processing method further includes:
and the analyzed electronic book file is adjusted according to a preset format, and the adjusted electronic book file is obtained.
6. A reader SDK, the reader SDK comprising:
the reading unit is used for reading the electronic book file;
a grouping unit, configured to perform grouping processing on the electronic book files according to a preset rule;
the analysis unit is used for carrying out asynchronous analysis on each group of electronic book files and obtaining analysis results corresponding to each group of electronic book files;
the merging unit is used for merging the analysis results corresponding to all the grouped electronic book files to obtain analyzed electronic book files;
the paging unit is used for paging the parsed electronic book file according to the page size and the page margin of a preset display interface;
and the data drawing unit is used for carrying out asynchronous data drawing on each page of electronic book file subjected to paging processing, so that the electronic book file is finally displayed on the display interface.
7. The reader SDK according to claim 6, wherein the data drawing unit draws each page of the electronic book file on at least one picture at the time of asynchronous data drawing, and finally displays the at least one picture on a display interface.
8. The reader SDK of claim 6, wherein when the parsing unit performs asynchronous parsing on each set of electronic book files, the parsing result corresponding to each set of electronic book files is obtained as follows: and positioning the starting position and the ending position of the current page of the electronic book file before analysis and the position information of each data in the electronic book file before analysis.
9. The reader SDK of claim 6, wherein the reader SDK further comprises:
the receiving unit is used for receiving an operation instruction input by a user, and re-paging processing is carried out according to a preset data pattern and the paging unit;
and carrying out data drawing on each page of electronic book file subjected to paging processing again through the paging unit according to the data drawing unit, and displaying the data drawing on a display interface.
CN201910730675.4A 2019-08-08 2019-08-08 Data processing method based on reader SDK and reader SDK Active CN110554872B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910730675.4A CN110554872B (en) 2019-08-08 2019-08-08 Data processing method based on reader SDK and reader SDK

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910730675.4A CN110554872B (en) 2019-08-08 2019-08-08 Data processing method based on reader SDK and reader SDK

Publications (2)

Publication Number Publication Date
CN110554872A CN110554872A (en) 2019-12-10
CN110554872B true CN110554872B (en) 2023-10-10

Family

ID=68737235

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910730675.4A Active CN110554872B (en) 2019-08-08 2019-08-08 Data processing method based on reader SDK and reader SDK

Country Status (1)

Country Link
CN (1) CN110554872B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112600988B (en) * 2020-12-03 2023-04-25 珠海奔图电子有限公司 Image forming apparatus and scanning method

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1794218A (en) * 2005-12-31 2006-06-28 无锡永中科技有限公司 Generating method of computer format document and opening method
CN101763407A (en) * 2009-11-19 2010-06-30 青岛海信移动通信技术股份有限公司 Txt file reading method based on brew platform and reader thereof
CN103136175A (en) * 2011-11-25 2013-06-05 上海盛轩网络科技有限公司 Page dividing method of reading materials of electronic publication (Epub) form and system using the same
KR20130105509A (en) * 2012-03-14 2013-09-25 주식회사 북잼 Method and apparatus e-book providing
CN104978169A (en) * 2014-04-02 2015-10-14 北京大学 SDK processing method and SDK processing device for periodical reading application

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1794218A (en) * 2005-12-31 2006-06-28 无锡永中科技有限公司 Generating method of computer format document and opening method
CN101763407A (en) * 2009-11-19 2010-06-30 青岛海信移动通信技术股份有限公司 Txt file reading method based on brew platform and reader thereof
CN103136175A (en) * 2011-11-25 2013-06-05 上海盛轩网络科技有限公司 Page dividing method of reading materials of electronic publication (Epub) form and system using the same
KR20130105509A (en) * 2012-03-14 2013-09-25 주식회사 북잼 Method and apparatus e-book providing
CN104978169A (en) * 2014-04-02 2015-10-14 北京大学 SDK processing method and SDK processing device for periodical reading application

Also Published As

Publication number Publication date
CN110554872A (en) 2019-12-10

Similar Documents

Publication Publication Date Title
US8379027B2 (en) Rendering engine test system
CN100440222C (en) System and method for text legibility enhancement
CN111310693B (en) Intelligent labeling method, device and storage medium for text in image
JP2002526862A (en) Conversion of data representing documents into other formats for manipulation and display
CN113963770A (en) Report file generation method and device, computer equipment and storage medium thereof
CN111708535A (en) Image-text display control method and device and electronic equipment
CN110554872B (en) Data processing method based on reader SDK and reader SDK
EP3913533A2 (en) Method and apparatus of processing image device and medium
US8656371B2 (en) System and method of report representation
CN110852131B (en) Examination card information acquisition method, system and terminal
CN114817043A (en) Method, device and medium for extracting product test data
CN114339208A (en) Video testing method and device, electronic equipment and computer storage medium
CN114281761A (en) Data file loading method and device, computer equipment and storage medium
CN114115831A (en) Data processing method, device, equipment and storage medium
CN105512100A (en) Layout analysis method and device
CN113657279A (en) Bill image layout analysis method and device
CN112965772A (en) Web page display method and device and electronic equipment
CN107492354B (en) Dot matrix liquid crystal generator set controller-based multi-language implementation method
CN112052644A (en) Document editing method and device, computer storage medium and terminal
CN111046096B (en) Method and device for generating graphic structured information
CN112232320B (en) Printed matter text proofreading method and related equipment
CN113704650A (en) Information display method, device, system, equipment and storage medium
CN115510405A (en) Watermark text processing method and device
CN113761833A (en) Method, device and equipment for displaying document content
CN117610549A (en) Document processing method, document processing device, document content generating device, document processing device, content generating device and electronic equipment

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