CN110989892B - Text display method and device, electronic equipment and storage medium - Google Patents

Text display method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN110989892B
CN110989892B CN201911080981.4A CN201911080981A CN110989892B CN 110989892 B CN110989892 B CN 110989892B CN 201911080981 A CN201911080981 A CN 201911080981A CN 110989892 B CN110989892 B CN 110989892B
Authority
CN
China
Prior art keywords
text
text data
target
target object
position information
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
CN201911080981.4A
Other languages
Chinese (zh)
Other versions
CN110989892A (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 QIYI Century Science and Technology Co Ltd
Original Assignee
Beijing QIYI Century 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 QIYI Century Science and Technology Co Ltd filed Critical Beijing QIYI Century Science and Technology Co Ltd
Priority to CN201911080981.4A priority Critical patent/CN110989892B/en
Publication of CN110989892A publication Critical patent/CN110989892A/en
Application granted granted Critical
Publication of CN110989892B publication Critical patent/CN110989892B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/048Interaction techniques based on graphical user interfaces [GUI]
    • G06F3/0481Interaction techniques based on graphical user interfaces [GUI] based on specific properties of the displayed interaction object or a metaphor-based environment, e.g. interaction with desktop elements like windows or icons, or assisted by a cursor's changing behaviour or appearance
    • G06F3/0483Interaction with page-structured environments, e.g. book metaphor
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/451Execution arrangements for user interfaces

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Human Computer Interaction (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • User Interface Of Digital Computer (AREA)

Abstract

The embodiment of the invention relates to a text display method, a text display device, electronic equipment and a storage medium, wherein the method comprises the following steps: obtaining a configuration file of a target object from a server, wherein the configuration file comprises: a relation table corresponding to the target object and the target text; acquiring first text data to be displayed, determining a set text corresponding to a target text appearing in the first text data, and position information of the set text in the first text data; calling a relation table in the configuration file to add a target object at a preset position corresponding to the position information to generate second text data; rendering second text data containing the target object on the bitmap image; the rendered bitmap image is displayed on a display interface, partial text in the electronic book is displayed to a user in a picture mode, and compared with simple characters, the picture mode can attract the attention of the user, the interest of the user in reading is increased, and the reading experience of the user is improved.

Description

Text display method and device, electronic equipment and storage medium
Technical Field
The embodiment of the invention relates to the field of character image processing, in particular to a text display method and device, electronic equipment and a storage medium.
Background
With the development of network technology, paper books are shifted to the form of electronic books (digital books), in which books such as printed magazines, published by publishers, are digitized so that they can be browsed in electronic devices such as Personal Computers (PCs) and cellular phones. Electronic books have the advantage that publishers can provide book content to readers at a lower cost than if printed matter were provided, and are therefore becoming increasingly popular.
For example, when browsing such electronic books on a display device, the content of the electronic books is usually in the form of plain text, and when a user reads the electronic books in the form of plain text, the form is monotonous and boring, and the reading experience of the user is not high.
Disclosure of Invention
In view of the above, embodiments of the present invention provide a text display method, a text display apparatus, an electronic device, and a storage medium to solve the above technical problems or some technical problems.
In a first aspect, an embodiment of the present invention provides a text display method, including:
obtaining a configuration file of a target object from a server, wherein the configuration file comprises: a relation table corresponding to the target object and the target text;
acquiring first text data to be displayed, and determining a set text corresponding to the target text appearing in the first text data and position information of the set text in the first text data;
calling the relation table in the configuration file to add the target object at a preset position corresponding to the position information to generate second text data;
rendering the second text data containing the target object on a bitmap image;
and displaying the rendered bitmap image on the display interface.
In a possible embodiment, the invoking the relationship table in the configuration file adds the target object at a preset position corresponding to the position information to generate second text data, including:
adding a loading frame at a preset position of the position information in the first text data;
determining the identification parameters of the target object corresponding to the set text according to the relation table;
setting the identification parameter in the loading frame;
sequentially detecting the identification parameters from the initial position to the end position of the first text data;
if the identification parameters are detected, calling corresponding target objects according to the relation table and loading the target objects into the corresponding loading frames;
generating the second text data including the target object when the termination position is detected.
In one possible embodiment, the determining the set text corresponding to the target text appearing in the first text data and the position information of the set text in the first text data includes:
performing word segmentation processing on the first text data;
matching the target text in the relation table with the first text data after word segmentation;
and if the set text corresponding to the target text is matched, determining the position information of the set text in the first text data, and counting the occurrence times of the set text.
In one possible embodiment, the method further comprises:
if the total number of times of all the set texts is greater than a preset number threshold, determining the number of times of each type of the set texts;
and selecting the setting texts with partial types as the setting texts corresponding to the newly added target objects in the first text data according to the occurrence frequency of each type of the setting texts.
In one possible embodiment, the target object includes: a still picture or a moving picture;
the target text includes: target words or target punctuation.
In a second aspect, an embodiment of the present invention provides a text display apparatus, including:
an obtaining module, configured to obtain a configuration file of a target object from a server, where the configuration file includes: a relation table corresponding to the target object and the target text;
the determining module is used for acquiring first text data to be displayed, determining a set text which appears in the first text data and corresponds to the target text, and determining position information of the set text in the first text data;
the generating module is used for calling the relation table in the configuration file to add the target object at a preset position corresponding to the position information to generate second text data;
a rendering module for rendering the second text data containing the target object on a bitmap image;
and the display module is used for displaying the rendered bitmap image on the display interface.
In a possible implementation manner, the generating module is specifically configured to add a loading box at a preset position of the position information in the first text data; determining the identification parameters of the target object corresponding to the set text according to the relation table; setting the identification parameter in the loading frame; sequentially detecting the identification parameters from the initial position to the end position of the first text data; if the identification parameters are detected, calling corresponding target objects according to the relation table and loading the target objects into the corresponding loading frames; generating the second text data including the target object when the termination position is detected.
In a possible implementation manner, the determining module is specifically configured to perform word segmentation processing on the first text data; performing set text matching according to the set text in the relation table and the first text data after word segmentation; and if the set text is matched, determining the position information of the set text in the first text data, and counting the occurrence times of the set text.
In a third aspect, an embodiment of the present invention provides an electronic device, including a processor, a communication interface, a memory, and a communication bus, where the processor and the communication interface complete communication between the memory and the processor through the communication bus;
a memory for storing a computer program;
a processor for implementing the text display method steps of any of the first aspects described above when executing a program stored in the memory.
In a fourth aspect, an embodiment of the present invention provides a storage medium, on which a computer program is stored, where the computer program is executed by a processor to implement the text display method according to any one of the first aspect.
In a fifth aspect, an embodiment of the present invention provides a computer-readable storage medium, where instructions are stored, and when the instructions are executed on a computer, the instructions cause the computer to execute the text display method according to any one of the first aspect.
In a sixth aspect, an embodiment of the present invention provides a computer program product containing instructions, which when run on a computer, causes the computer to execute the text display method according to any one of the first aspect.
According to the text display scheme provided by the embodiment of the invention, the configuration file of the target object is acquired from the server, wherein the configuration file comprises: a relation table corresponding to the target object and the target text; acquiring first text data to be displayed, and determining a set text corresponding to the target text appearing in the first text data and position information of the set text in the first text data; calling the relation table in the configuration file to add the target object at a preset position corresponding to the position information to generate second text data; rendering the second text data containing the target object on a bitmap image; the rendered bitmap image is displayed on the display interface, partial text in the electronic book is displayed to a user in a picture mode, and compared with simple characters, the picture mode can attract the attention of the user, the interest of the user in reading is increased, and the reading experience of the user is improved.
Drawings
Fig. 1 is a schematic flowchart of a text display method according to an embodiment of the present invention;
FIG. 2 is a schematic flow chart illustrating a process of detecting a configuration file according to an embodiment of the present invention;
fig. 3 is a schematic flow chart illustrating a process of determining a set text corresponding to the target text appearing in the first text data and a position information of the set text in the first text data according to the embodiment of the present invention;
fig. 4 is a schematic flow chart illustrating a process of calling the relationship table in the configuration file to add the target object at a preset position corresponding to the position information to generate second text data according to the embodiment of the present invention;
FIG. 5 is a schematic diagram illustrating a text display in accordance with an embodiment of the present invention;
FIG. 6 is a schematic structural diagram of a text display device according to an embodiment of the present invention;
fig. 7 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, but not all, embodiments of the present invention. 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 invention.
For the convenience of understanding of the embodiments of the present invention, the following description will be further explained with reference to specific embodiments, which are not to be construed as limiting the embodiments of the present invention.
Fig. 1 is a schematic flowchart of a text display method according to an embodiment of the present invention, and as shown in fig. 1, the method specifically includes:
s11, obtaining the configuration file of the target object from the server, wherein the configuration file comprises: and the target object and the target text correspond to a relation table.
The text display method provided by the embodiment is applied to the electronic device to display the electronic book, and the electronic device may be: including mobile terminals such as cell phones, tablet computers, notebook computers, palmtop computers, Personal Digital Assistants (PDAs), and fixed terminals such as Digital TVs, desktop computers, and the like.
The server configures a target object loaded in the electronic book in advance, and generates a configuration file of the target object, wherein the configuration file comprises: the relation table of the target object corresponding to the target text may further include, in addition to the corresponding relation of the target object to the target text, an identification parameter of the target object corresponding to the target text, where the identification parameter may represent a unique target object or target text.
The target text can be a target word or a target punctuation mark, and the target object can be a dynamic picture or a static picture related to the meaning of the target text.
The electronic equipment acquires the configuration file of the target object from the server and stores the configuration file in the local electronic equipment so as to display the first text data to be displayed after processing the first text data based on the configuration file.
S12, acquiring first text data to be displayed, and determining a set text corresponding to the target text appearing in the first text data and position information of the set text in the first text data.
The electronic equipment downloads the first text data from the server and stores the first text data in a cache (the cache can be performed according to the sequence of the sections of the electronic book), and before the first text data in the cache is displayed, the target object is added to the corresponding position of the first text data.
In an alternative of the embodiment of the present invention, the electronic device may further obtain the first text data from the mobile terminal, for example, the mobile terminal device of the user a pushes the downloaded first text data to the electronic device, and the electronic device locally stores the first text data.
In an alternative of the embodiment of the present invention, the electronic device may further obtain the first text data from the storage medium, for example, copy the first text data from the memory card to the electronic device.
Further, according to the target text contained in the relation table in the configuration file, the first text data is matched, whether the set text corresponding to the target text appears in the first text data or not is determined, and the position information of the set text appearing in the first text data is determined.
In this embodiment, the target text is a text preset in the configuration file, the set text is a text corresponding to the target text appearing in the first text data, the target text includes a plurality of texts, the set text includes a plurality of texts, and the set text is a part of or all of the texts in the target text.
The target words in the target text may be: chinese words or words of other languages (e.g., English, Korean, Japanese, etc.), and the target punctuation may be: exclamation marks, ellipses, etc.
The position information may be page number information, paragraph information, line number information, or the like appearing in the first text data.
S13, calling the relation table in the configuration file to add the target object at a preset position corresponding to the position information, and generating second text data.
In this embodiment, after determining the target word of the first text data and the position information of the target word, a relationship table in the configuration file is called, and a corresponding target object is added to a preset position of a set text appearing in the first text data according to the position information based on the relationship table, so as to generate second text data including the target object.
For example, the text is set as: the positions appearing in the first text data of the fancy carp and the fancy carp comprise: setting target objects corresponding to texts as follows, wherein the target objects are on page 1, section 3, line 4 and page 3, section 1, line 2: "picture of koi"; the method comprises the steps of determining a set text 'koi' on the page 1, the section 3, the line 4 in the first text data, adding a target object 'picture of koi' behind the text ', determining a set text' koi 'on the page 3, the section 1, the line 2 in the page 3, adding a target object' picture of koi 'behind the text', and generating second text data based on the first text data with the target object added.
S14, rendering the second text data containing the target object on a bitmap image.
And S15, displaying the rendered bitmap image on the display interface.
When receiving an operation of a user for displaying the first text data, calling second text data containing a target object, and rendering the second text data on a bitmap image, wherein the size of the bitmap image is the same as the size of an interface of the electronic book displayed by the electronic equipment.
Further, rendering is performed on the bitmap image in the order of the second text, and when the target object is rendered, the height of the target object on the bitmap image may be the same as or smaller than the line spacing in the first text data.
In an alternative of the embodiment of the present invention, a step of detecting the configuration file may be further included before S11.
Fig. 2 is a schematic flowchart of a process of detecting a configuration file according to an embodiment of the present invention, as shown in fig. 2, specifically including:
and S21, determining that the application program displaying the electronic book in the electronic equipment is in the starting state.
S22, judging whether the configuration file of the target object is stored locally.
The electronic equipment monitors whether an application program displaying the electronic book is triggered to start in real time, and if the fact that the application program is started through triggering operation by a user is detected, whether the configuration file of the target object is stored locally in the electronic equipment is judged.
Further, the configuration text may include: a relation table of the target object and the target text, a file package of the target object, configuration information of the target object and the like.
The relationship table may include: the target object, the target text, the identification parameters and the corresponding relation of the target object, the target text and the identification parameters; the target text may include: the target words can be classified into multiple categories (such as language words, names, verbs, popular words, etc.), and the target punctuations can be: exclamation marks, ellipses, etc.; the target object may include: the target object can also be understood as representing a target text in the form of a graph; the identification parameters may be: a string of numbers or letters.
For example: the target words are: the target words are: popular words (anger, polygonum, cricket, hard stone, miss, koi, thick stick, C position, etc.); the target object is a picture corresponding to the koi; the identification parameters are: 001.
the file packet of the target object is a data packet containing a plurality of dynamic pictures and/or static pictures, such as: pictures in PNG, JPG, WEBP format.
The configuration information of the target object may include: the method comprises the steps of obtaining the appearance position information of a target object, the appearance frequency information of the target object, the priority information of the target object and the like, wherein the configuration information can be stored locally in the electronic equipment in a hash table (hash map) form.
For example, the appearance position information of the target object may be: setting the target object to only appear in the text part of the electronic book, wherein the information of the number of times of appearance of the target object may be: the total number of times that the target object appears in each chapter of the electronic book does not exceed 50 times, and the priority information of the target object may be: and sorting the target objects according to the occurrence times of the target objects.
If the electronic device does not locally store the configuration file, executing S23; if the electronic device stores the configuration file locally, S24 is executed.
And S23, if the configuration file is not stored locally, executing the step of acquiring the configuration file.
If the electronic equipment does not have the configuration file locally, the electronic equipment sends a configuration file acquisition request to the server so as to acquire the configuration file of the target object from the server.
And S24, if the configuration file is stored locally, determining whether the configuration file is a valid file.
And S25, if the configuration file is a valid file, executing the step of matching the setting text from the first text data.
S26, if the configuration file is a non-valid file, executing the step of the configuration file.
In order to ensure that the configuration file locally stored in the electronic equipment is the latest version, the validity of the locally stored configuration text is verified, and the configuration file can be verified by adopting the version number.
Specifically, the electronic device acquires a first version number of a locally stored configuration file, requests the server to acquire a second version number of a configuration text of a latest version, compares the first version number with the second version number, and if the first version number and the second version number are consistent, the locally stored configuration file is the latest version; if the two are not consistent, the configuration file stored locally is not the latest version, and the configuration file of the latest version is continuously acquired from the server.
In an alternative of the embodiment of the present invention, fig. 3 is a schematic flow chart of determining a set text corresponding to the target text appearing in the first text data and a position information of the set text in the first text data according to the embodiment of the present invention, as shown in fig. 3, specifically including:
and S121, performing word segmentation processing on the first text data.
In this embodiment, a word segmentation tool (e.g., a Chinese lexical analysis toolkit (THU lexical analyzer for Chinese), may be used to perform text word segmentation on the first text data; adopting NLPIR Chinese word segmentation technology for the Chinese text related in the first text data, and adopting space word segmentation for the English text; and after the word segmentation is finished, the word segmentation is filtered through the accumulated stop word library to remove stop words.
Because the number of the set texts in the first text data is relatively small, the word segmentation processing is carried out on the first text data, so that the workload of subsequent set text matching is reduced, and the efficiency is improved.
And S122, matching the target text with the first text data after word segmentation according to the target text in the relation table.
S123, if the set text corresponding to the target text is matched, determining the position information of the set text in the first text data, and counting the occurrence times of the set text.
And finally, carrying out classification statistics according to the type of the set texts to obtain the frequency of each type of set texts appearing in the first text data and corresponding position information.
In an alternative scheme of the embodiment of the present invention, in order to ensure that a target object has a relatively reasonable occupancy in first text data (to avoid an excessive number of target objects on the whole interface), a maximum preset number threshold is set for setting a text appearing in the first text data, and if the total number of occurrences of all the set texts is greater than the preset number threshold, the number of occurrences of each type of the set text is determined; and selecting the setting texts with partial types as the setting texts corresponding to the newly added target objects in the first text data according to the occurrence frequency of each type of the setting texts.
For example, if the total number of times that the text appears in the first text data is set to 150, the threshold number of times is set to 100, the set number of times that the text of type a appears is 60, the set number of times that the text of type B appears is 30, the set number of times that the text of type C appears is 40, and the set number of times that the text of type D appears is 10, the priority level of the text is set to: the type A, the type C, the type B and the type D are selected, and the type A and the type C are further selected as set texts for adding target objects in the first text data.
In an alternative of the embodiment of the present invention, fig. 4 is a schematic flowchart of a process of calling the relationship table in the configuration file to add the target object at a preset position corresponding to the position information to generate second text data according to the embodiment of the present invention, and as shown in fig. 4, the process specifically includes:
s131, adding a loading box at a preset position of the position information in the first text data.
Typesetting the first text data, and adding a loading frame at a preset position of the position information based on the position information of the set text, wherein the preset position at least comprises one of the following positions: the position information is arranged above the position corresponding to the position information, below the position corresponding to the position information, behind the position corresponding to the position information and in front of the position corresponding to the position information; the length of the loading frame can be determined according to the length of the target object to be inserted, and the height of the loading frame is less than or equal to the line spacing corresponding to the set text (for example, the height is the height of the text in the line or the line spacing between two lines of characters), that is, the reading of the text in the upper line and the text in the lower line is not affected after the target object is inserted.
It should be noted that: in order to ensure the completeness of reading, when the text is set to appear at the end of a sentence (the line has no remaining space), the loading frame is not added any more, the text moves backwards due to the addition of the loading frame, and the line typesetting space is added in the line.
S132, determining the identification parameters of the target object corresponding to the set text according to the relation table.
S133, setting the identification parameters in the loading frame.
And determining the corresponding identification parameters of the set text according to the set text lookup relation table, writing the identification parameters into the corresponding loading frames, adding the loading frames in the first text data according to the set text, and writing the corresponding identification parameters into the loading frames.
And S134, sequentially detecting the identification parameters from the initial position to the final position of the first text data.
And S135, if the identification parameters are detected, calling the corresponding target object according to the relation table and loading the target object into the corresponding loading frame.
It should be noted that: in this embodiment, the first text data is typeset by adding a new loading box, instead of directly adding a new target object at a set position, and the processing method is as follows: compared with the method of directly adding the target object, the method has the advantages that the newly added loading frame (the loading frame is actually the space area), the processing workload of the inner core of the electronic equipment is less, the processing speed is higher, the text data of the whole chapter can be quickly processed in a short time, and the processing efficiency of the text is improved. And S136, generating the second text data containing the target object when the termination position is detected.
And sequentially detecting the identification parameters from the initial position of the first text data, when the identification parameters are detected, searching the relation table to determine a corresponding target object, calling the target object from a file package of the target object, loading the target object into the corresponding loading frame, and accordingly, detecting the first text data to the end position to generate second text data containing the target object.
In an alternative of the embodiment of the present invention, in addition to adding a new target object at a preset position corresponding to the position information where the set text appears, the target object may be added in an alternative form, and the set text is directly replaced with a corresponding target object, where the size of the target object may be the same as the size of the set text (e.g., the length or the width of the set text is the same), or the size of the target object may be set to be larger or smaller than the size of the set text according to actual requirements.
Fig. 5 is a schematic diagram of a text display according to an embodiment of the present invention, in which "dark love" and "dementia seed" in the first text data are set texts, and then corresponding pictures are target objects.
The text display method provided by the embodiment of the invention obtains the configuration file of the target object from the server, wherein the configuration file comprises the following steps: a relation table corresponding to the target object and the target text; acquiring first text data to be displayed, and determining a set text which appears in the first text data and corresponds to a target text and position information of the set text in the first text data; calling the relation table in the configuration file to add the target object at a preset position corresponding to the position information to generate second text data; rendering the second text data containing the target object on a bitmap image; the rendered bitmap image is displayed on the display interface, partial text in the electronic book is displayed to a user in a picture mode, and compared with simple characters, the picture mode can attract the attention of the user, the interest of the user in reading is increased, and the reading experience of the user is improved.
Fig. 6 is a schematic structural diagram of a text display device according to an embodiment of the present invention, and as shown in fig. 6, the text display device specifically includes:
an obtaining module 61, configured to obtain a configuration file of a target object from a server, where the configuration file includes: a relation table corresponding to the target object and the target text;
a determining module 62, configured to acquire first text data to be displayed, and determine a set text that appears in the first text data and corresponds to the target text, and position information of the set text in the first text data;
a generating module 63, configured to call the relationship table in the configuration file, add the target object at a preset position corresponding to the position information, and generate second text data;
a rendering module 64, configured to render the second text data containing the target object on a bitmap image;
and a display module 65, configured to display the rendered bitmap image on the display interface.
Optionally, the generating module 63 is specifically configured to add a loading frame at a preset position of the position information in the first text data; determining the identification parameters of the target object corresponding to the set text according to the relation table; setting the identification parameter in the loading frame; sequentially detecting the identification parameters from the initial position to the end position of the first text data; if the identification parameters are detected, calling corresponding target objects according to the relation table and loading the target objects into the corresponding loading frames; generating the second text data including the target object when the termination position is detected.
Optionally, the preset position includes at least one of: the position information is arranged above the position corresponding to the position information, below the position corresponding to the position information, behind the position corresponding to the position information and in front of the position corresponding to the position information; and the height of the loading box is less than or equal to the line spacing corresponding to the target text.
Optionally, the determining module 62 is specifically configured to perform word segmentation processing on the first text data; performing target text matching according to the target text in the relation table and the first text data after word segmentation; and if the set text corresponding to the target text is matched, determining the position information of the set text in the first text data, and counting the occurrence times of the set text.
Optionally, the apparatus further comprises: the processing module 66 is configured to determine the occurrence frequency of each type of the setting text if the total occurrence frequency of all the setting texts is greater than a preset frequency threshold; and selecting the setting texts with partial types as the setting texts corresponding to the newly added target objects in the first text data according to the occurrence frequency of each type of the setting texts.
Optionally, the processing module 66 is further configured to determine whether the configuration file of the target object is stored locally; if the configuration file is not stored locally, executing the step of acquiring the configuration file; if the configuration file is stored locally, determining whether the configuration file is a valid file; if the configuration file is a valid file, executing a step of matching the target text from the first text data; and if the configuration file is a non-valid file, executing the configuration file.
Optionally, the target object includes: a still picture or a moving picture; the target text includes: target words or target punctuation.
The text display device provided in this embodiment may be the text display device shown in fig. 6, and may perform all the steps of the text display method shown in fig. 1 to 4, so as to achieve the technical effect of the text display method shown in fig. 1 to 4, and for brevity, reference is specifically made to the description related to fig. 1 to 4, which is not repeated herein.
Fig. 7 is a schematic structural diagram of an electronic device according to an embodiment of the present invention, as shown in fig. 7, including a processor 701, a communication interface 702, a memory 703 and a communication bus 704, where the processor 701, the communication interface 702, and the memory 703 complete mutual communication through the communication bus 704,
a memory 703 for storing a computer program;
the processor 701 is configured to implement the following steps when executing the program stored in the memory 703:
obtaining a configuration file of a target object from a server, wherein the configuration file comprises: a relation table corresponding to the target object and the target text; acquiring first text data to be displayed, and determining a set text corresponding to the target text appearing in the first text data and position information of the set text in the first text data; calling the relation table in the configuration file to add the target object at a preset position corresponding to the position information to generate second text data; rendering the second text data containing the target object on a bitmap image; and displaying the rendered bitmap image on the display interface.
Optionally, adding a loading box at a preset position of the position information in the first text data; determining the identification parameters of the target object corresponding to the set text according to the relation table; setting the identification parameter in the loading frame; sequentially detecting the identification parameters from the initial position to the end position of the first text data; if the identification parameters are detected, calling corresponding target objects according to the relation table and loading the target objects into the corresponding loading frames; generating the second text data including the target object when the termination position is detected.
Optionally, the preset position includes at least one of: the position information is arranged above the position corresponding to the position information, below the position corresponding to the position information, behind the position corresponding to the position information and in front of the position corresponding to the position information; and the height of the loading box is less than or equal to the line spacing corresponding to the set text.
Optionally, performing word segmentation processing on the first text data; matching the target text in the relation table with the first text data after word segmentation; and if the set text matched with the target text is matched, determining the position information of the set text in the first text data, and counting the occurrence times of the set text.
Optionally, if the total number of occurrences of all the set texts is greater than a preset number threshold, determining the number of occurrences of each type of the set texts; and selecting the setting texts with partial types as the setting texts corresponding to the newly added target objects in the first text data according to the occurrence frequency of each type of the setting texts.
Optionally, judging whether the configuration file of the target object is stored locally; if the configuration file is not stored locally, executing the step of acquiring the configuration file; if the configuration file is stored locally, determining whether the configuration file is a valid file; if the configuration file is a valid file, executing the step of matching the set text from the first text data; and if the configuration file is a non-valid file, executing the configuration file.
Optionally, the target object includes: a still picture or a moving picture; the target text includes: target words or target punctuation.
The communication bus mentioned in the above terminal may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) 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, but this does not mean that there is only one bus or one type of bus.
The communication interface is used for communication between the terminal and other equipment.
The Memory may include a Random Access Memory (RAM) or a non-volatile Memory (non-volatile Memory), such as at least one disk Memory. Optionally, the memory may also be at least one memory device located remotely from the processor.
The Processor may be a general-purpose Processor, and includes a Central Processing Unit (CPU), a Network Processor (NP), and the like; the Integrated Circuit may also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other Programmable logic device, a discrete Gate or transistor logic device, or a discrete hardware component.
The electronic device provided in this embodiment may be the electronic device shown in fig. 7, and may perform all the steps of the text display method shown in fig. 1 to 4, so as to achieve the technical effect of the text display method shown in fig. 1 to 4, and for brevity, it is described with reference to fig. 1 to 4, which is not described herein again.
In another embodiment of the present invention, a storage medium is further provided, where instructions are stored, and when the storage medium runs on a computer, the storage medium causes the computer to execute the text display method in any one of the above embodiments.
In yet another embodiment of the present invention, there is also provided a computer program product containing instructions which, when run on a computer, cause the computer to perform the text display method of any of the above embodiments.
In the above embodiments, the implementation may be wholly or partially realized by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When loaded and executed on a computer, cause the processes or functions described in accordance with the embodiments of the invention to occur, in whole or in part. The computer may be a general purpose computer, a special purpose computer, a network of computers, or other programmable device. The computer instructions may be stored on a storage medium or transmitted from one storage medium to another, for example, from one website, computer, server, or data center to another website, computer, server, or data center via wire (e.g., coaxial cable, fiber optic, Digital Subscriber Line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.). The storage medium may be any available medium that can be accessed by a computer or a data storage device including one or more available media integrated servers, data centers, and the like. The usable medium may be a magnetic medium (e.g., floppy Disk, hard Disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., Solid State Disk (SSD)), among others.
It is noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
All the embodiments in the present specification are described in a related manner, and the same and similar parts among the embodiments may be referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, for the system embodiment, since it is substantially similar to the method embodiment, the description is simple, and for the relevant points, reference may be made to the partial description of the method embodiment.
The above description is only for the preferred embodiment of the present invention, and is not intended to limit the scope of the present invention. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention shall fall within the protection scope of the present invention.

Claims (8)

1. A text display method, comprising:
obtaining a configuration file of a target object from a server, wherein the configuration file comprises: a relation table corresponding to the target object and the target text;
acquiring first text data to be displayed, and determining a set text corresponding to the target text appearing in the first text data and position information of the set text in the first text data;
calling the relation table in the configuration file to add the target object at a preset position corresponding to the position information to generate second text data;
rendering the second text data containing the target object on a bitmap image;
displaying the rendered bitmap image on a display interface;
the invoking the relationship table in the configuration file adds the target object at a preset position corresponding to the position information to generate second text data, including:
typesetting first text data, and adding a loading frame at a preset position of the position information based on the position information of the set text, wherein the preset position at least comprises one of the following positions: the position information is arranged above the position corresponding to the position information, below the position corresponding to the position information, behind the position corresponding to the position information or in front of the position corresponding to the position information; the length of the loading frame is determined according to the length of a target object to be inserted, and the height of the loading frame is smaller than or equal to the line spacing corresponding to the set text; determining the identification parameters of the target object corresponding to the set text according to the relation table;
setting the identification parameter in the loading frame;
sequentially detecting the identification parameters from the initial position to the end position of the first text data;
if the identification parameters are detected, calling corresponding target objects according to the relation table and loading the target objects into the corresponding loading frames;
generating the second text data including the target object when the termination position is detected.
2. The method according to claim 1, wherein the determining that the set text corresponding to the target text appears in the first text data and the set text is in the position information of the first text data comprises:
performing word segmentation processing on the first text data;
matching the target text in the relation table with the first text data after word segmentation;
and if the set text corresponding to the target text is matched, determining the position information of the set text in the first text data, and counting the occurrence times of the set text.
3. The method of claim 2, further comprising:
if the total number of times of all the set texts is greater than a preset number threshold, determining the number of times of each type of the set texts;
and selecting the setting texts with partial types as the setting texts corresponding to the newly added target objects in the first text data according to the occurrence frequency of each type of the setting texts.
4. The method of any one of claims 1-3, wherein the target object comprises: a still picture or a moving picture;
the target text includes: target words or target punctuation.
5. A text display apparatus, comprising:
an obtaining module, configured to obtain a configuration file of a target object from a server, where the configuration file includes: a relation table corresponding to the target object and the target text;
the determining module is used for acquiring first text data to be displayed, determining a set text which appears in the first text data and corresponds to the target text, and determining position information of the set text in the first text data;
the generating module is used for calling the relation table in the configuration file to add the target object at a preset position corresponding to the position information to generate second text data;
a rendering module for rendering the second text data containing the target object on a bitmap image;
the display module is used for displaying the rendered bitmap image on a display interface;
the generating module is specifically configured to type a first text datum, add a loading frame at a preset position of the position information based on the position information where the set text appears, where the preset position at least includes one of the following positions: the position information is arranged above the position corresponding to the position information, below the position corresponding to the position information, behind the position corresponding to the position information or in front of the position corresponding to the position information; the length of the loading frame is determined according to the length of a target object to be inserted, and the height of the loading frame is smaller than or equal to the line spacing corresponding to the set text; determining the identification parameters of the target object corresponding to the set text according to the relation table; setting the identification parameter in the loading frame; sequentially detecting the identification parameters from the initial position to the end position of the first text data; if the identification parameters are detected, calling corresponding target objects according to the relation table and loading the target objects into the corresponding loading frames; generating the second text data including the target object when the termination position is detected.
6. The apparatus according to claim 5, wherein the determining module is specifically configured to perform word segmentation processing on the first text data; performing set text matching according to the set text in the relation table and the first text data after word segmentation; and if the set text is matched, determining the position information of the set text in the first text data, and counting the occurrence times of the set text.
7. An electronic device is characterized by comprising a processor, a communication interface, a memory and a communication bus, wherein the processor and the communication interface are used for realizing mutual communication by the memory through the communication bus;
a memory for storing a computer program;
a processor for implementing the text display method steps according to any one of claims 1 to 4 when executing a program stored in the memory.
8. A storage medium on which a computer program is stored, which program, when being executed by a processor, carries out a text display method according to any one of claims 1 to 4.
CN201911080981.4A 2019-11-06 2019-11-06 Text display method and device, electronic equipment and storage medium Active CN110989892B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911080981.4A CN110989892B (en) 2019-11-06 2019-11-06 Text display method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911080981.4A CN110989892B (en) 2019-11-06 2019-11-06 Text display method and device, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN110989892A CN110989892A (en) 2020-04-10
CN110989892B true CN110989892B (en) 2022-01-11

Family

ID=70083335

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911080981.4A Active CN110989892B (en) 2019-11-06 2019-11-06 Text display method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN110989892B (en)

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109460276A (en) * 2018-10-25 2019-03-12 北京字节跳动网络技术有限公司 The page and page configuration document generating method, device, terminal device and medium

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP5467123B2 (en) * 2012-05-30 2014-04-09 株式会社ソニー・コンピュータエンタテインメント Information processing apparatus and information processing method
CN105335421A (en) * 2014-08-06 2016-02-17 阿里巴巴集团控股有限公司 Method and apparatus for making and displaying e-book expansion content
US10768772B2 (en) * 2015-11-19 2020-09-08 Microsoft Technology Licensing, Llc Context-aware recommendations of relevant presentation content displayed in mixed environments
US10223067B2 (en) * 2016-07-15 2019-03-05 Microsoft Technology Licensing, Llc Leveraging environmental context for enhanced communication throughput
CN107633029A (en) * 2017-09-04 2018-01-26 上海渔阳网络技术有限公司 A kind of method and device for showing electronic document
CN107992250A (en) * 2017-12-20 2018-05-04 维沃移动通信有限公司 A kind of display methods of electronic book documentary content, mobile terminal
CN110347302B (en) * 2018-04-04 2022-09-06 阿里巴巴(中国)有限公司 Electronic book display method and device

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109460276A (en) * 2018-10-25 2019-03-12 北京字节跳动网络技术有限公司 The page and page configuration document generating method, device, terminal device and medium

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
From the perspective of editing design to explore design modes of interactive e-books;Ming-Yu Shao;《 2016 International Conference on Advanced Materials for Science and Engineering (ICAMSE)》;20161230;第6036-639页 *
电子书显示技术的研究进展;韩玄武;《中国印刷与包装研究》;20091230;第8-13页 *

Also Published As

Publication number Publication date
CN110989892A (en) 2020-04-10

Similar Documents

Publication Publication Date Title
CN107111618B (en) Linking thumbnails of images to web pages
CN107885449B (en) Photographing search method and device, terminal equipment and storage medium
CN110489032B (en) Dictionary query method for electronic book and electronic equipment
WO2017211202A1 (en) Method, device, and terminal device for extracting data
CN110750958A (en) Text display method and device, electronic equipment and medium
CN114297143A (en) File searching method, file displaying device and mobile terminal
JP5199768B2 (en) Tagging support method and apparatus, program, and recording medium
CN111046627A (en) Chinese character display method and system
CN110989892B (en) Text display method and device, electronic equipment and storage medium
CN113051235A (en) Document loading method and device, terminal and storage medium
CN111208955B (en) Printing method, device and server
CN111367606A (en) Application page display method, device, terminal and medium
CN111507067A (en) Acquisition method for displaying formula picture, and method and device for transferring formula picture
CN110889279B (en) Method and device for displaying display information in document
CN107463573B (en) Content information providing method, device, browser, electronic device and server
CN111062377B (en) Question number detection method, system, storage medium and electronic equipment
CN113625919A (en) Method for translating book contents, computing device and computer storage medium
CN110083576B (en) Cache directory identification method and device
CN109947947B (en) Text classification method and device and computer readable storage medium
CN110929048A (en) Bookmark generation method and device, electronic equipment and storage medium
CN107608947B (en) HTML file processing method and device and electronic equipment
CN112783840B (en) Method and device for storing document, electronic equipment and storage medium
CN111050194A (en) Video sequence processing method, video sequence processing device, electronic equipment and computer readable storage medium
CN111143719A (en) Online publication method, device and equipment of thesis and computer-readable storage medium
CN112001988A (en) Animation effect generation method and device

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