CN111444683A - Rich text processing method and device, computing equipment and computer storage medium - Google Patents

Rich text processing method and device, computing equipment and computer storage medium Download PDF

Info

Publication number
CN111444683A
CN111444683A CN201811620942.4A CN201811620942A CN111444683A CN 111444683 A CN111444683 A CN 111444683A CN 201811620942 A CN201811620942 A CN 201811620942A CN 111444683 A CN111444683 A CN 111444683A
Authority
CN
China
Prior art keywords
filter
rich text
text information
processing
text
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
CN201811620942.4A
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 Qihoo Technology Co Ltd
Original Assignee
Beijing Qihoo 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 Qihoo Technology Co Ltd filed Critical Beijing Qihoo Technology Co Ltd
Priority to CN201811620942.4A priority Critical patent/CN111444683A/en
Publication of CN111444683A publication Critical patent/CN111444683A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • User Interface Of Digital Computer (AREA)

Abstract

The invention discloses a rich text processing method, a rich text processing device, computing equipment and a computer storage medium, wherein the method comprises the following steps: acquiring text information to be processed, and determining a filter corresponding to the text information; the method comprises the following steps that filters are registered in a filter library in advance, and each filter registered in the filter library provides different style processing rules; calling a filter, and performing rich text processing on the text information by using a style processing rule provided by the filter to obtain rich text information with a corresponding style; and rendering and displaying the rich text information. Therefore, the scheme of the invention can carry out rich text processing on the text information to be processed by calling the filter in the filter library, realize the support of rich text processing and simultaneously keep good expansibility of rich text processing.

Description

Rich text processing method and device, computing equipment and computer storage medium
Technical Field
The invention relates to the technical field of computers, in particular to a rich text processing method, a rich text processing device, computing equipment and a computer storage medium.
Background
At present, mainstream instant messaging applications contain rich text information of pictures and texts when displaying messages, so that the display style of chat contents is enriched, and the chat pleasure is improved. The main implementations of rich text presentation in the prior art include the following two: one is implemented in combination with JS code, and the other is implemented by extending the text component of android (TextView).
However, the implementation in the prior art can only realize the presentation of a fixed pattern, for example, only can process the words into the corresponding pictures, and cannot realize the extension of the processing pattern.
Disclosure of Invention
In view of the above, the present invention has been made to provide a rich text processing method, apparatus, computing device and computer storage medium that overcome or at least partially address the above-mentioned problems.
According to an aspect of the present invention, there is provided a rich text processing method, including:
acquiring text information to be processed, and determining a filter corresponding to the text information; the filters are pre-registered to a filter library, each filter registered in the filter library providing different style processing rules;
calling the filter, and performing rich text processing on the text information by using the style processing rule provided by the filter to obtain rich text information with a corresponding style;
and rendering and displaying the rich text information.
According to another aspect of the present invention, there is provided a rich text processing apparatus including:
the determining module is suitable for acquiring text information to be processed and determining a filter corresponding to the text information; the filters are pre-registered to a filter library, each filter registered in the filter library providing different style processing rules;
the processing module is suitable for calling the filter and carrying out rich text processing on the text information by using the style processing rule provided by the filter to obtain rich text information with a corresponding style;
and the display module is suitable for rendering and displaying the rich text information.
According to yet another aspect of the present invention, there is provided a computing device comprising: the system comprises a processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface complete mutual communication through the communication bus;
the memory is used for storing at least one executable instruction, and the executable instruction enables the processor to execute the operation corresponding to the rich text processing method.
According to still another aspect of the present invention, a computer storage medium is provided, in which at least one executable instruction is stored, and the executable instruction causes a processor to execute operations corresponding to the rich text processing method.
According to the rich text processing method, the rich text processing device, the computing equipment and the computer storage medium, filters providing different style processing rules are registered in the filter library, and the filters are pre-registered in the filter library according to processing requirements, so that different filters are called to realize the presentation of rich text information of different styles, and the expandability of rich text processing is enhanced; and after the text information to be processed is acquired, rich text processing is performed on the text information by determining the corresponding filter and utilizing the style processing rule provided by the filter, and finally the text information is displayed in a required style, so that the rich text processing process can be more flexible. Therefore, the scheme of the embodiment can quickly realize the support of rich text, has good expansibility, and does not need to change the whole set of codes according to the new style requirement; and the idea of the filter is combined, the complicated business is divided, the stability and the safety of the assembly are ensured, and the influence on other styles when a user modifies one style is avoided.
The foregoing description is only an overview of the technical solutions of the present invention, and the embodiments of the present invention are described below in order to make the technical means of the present invention more clearly understood and to make the above and other objects, features, and advantages of the present invention more clearly understandable.
Drawings
Various other advantages and benefits will become apparent to those of ordinary skill in the art upon reading the following detailed description of the preferred embodiments. The drawings are only for purposes of illustrating the preferred embodiments and are not to be construed as limiting the invention. Also, like reference numerals are used to refer to like parts throughout the drawings. In the drawings:
FIG. 1 shows a flow diagram of a rich text processing method according to one embodiment of the invention;
FIG. 2 shows a flow diagram of a rich text processing method according to another embodiment of the invention;
FIG. 3 shows a functional block diagram of a rich text processing apparatus according to one embodiment of the present invention;
FIG. 4 shows a schematic structural diagram of a computing device according to an embodiment of the invention.
Detailed Description
Exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be embodied in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.
FIG. 1 shows a flow diagram of a rich text processing method according to one embodiment of the invention. As shown in fig. 1, the method includes:
step S101: acquiring text information to be processed, and determining a filter corresponding to the text information; the filters are pre-registered to a filter library, each filter registered in the filter library providing different style processing rules.
The text information to be processed refers to the text information to be displayed in a rich text form.
Specifically, a filter for rich text processing of text information is determined, and in the present invention, a specific determination manner is not limited, and in specific implementation, the determination may be performed according to information reflecting a style requirement of processing. Optionally, the matched filter is determined according to a text format of the text message.
And, in the present invention, a filter library is provided in which filters providing different style processing rules, for example, a filter for processing emoji expressions, a filter for processing kinetic diagrams, etc., are registered, that is, a filter can process a rich text style. And the filters are managed in a unified way through the filter library, including registration (namely addition) and deletion of the filters, so that the filters in the filter library can realize flexible processing and display of various rich text styles, and the expandability of rich text processing is enhanced.
Step S102: and calling a filter, and performing rich text processing on the text information by using the style processing rule provided by the filter to obtain rich text information with a corresponding style.
Specifically, after a filter corresponding to the text information is determined, the filter is called to perform rich text processing, that is: and processing the text information into information meeting the style requirement through the style processing rule.
For example, the user inputs "extraordinary bar" in the dialog box, and the filter corresponding to the "extraordinary bar" is determined to be the filter for processing the emoji expression through text content matching; and performing rich text processing by using the expression processing rule provided by the filter to obtain rich text information of praise expressions.
Step S103: and rendering and displaying the rich text information.
According to the rich text processing method provided by the embodiment, filters providing different style processing rules are registered in the filter library, and the filters are pre-registered in the filter library according to processing requirements, so that different filters are called to realize the presentation of rich text information of different styles, and the expandability of rich text processing is enhanced; and after the text information to be processed is acquired, rich text processing is performed on the text information by determining the corresponding filter and utilizing the style processing rule provided by the filter, and finally the text information is displayed in a required style, so that the rich text processing process can be more flexible. Therefore, the scheme of the embodiment can quickly realize the support of rich text, has good expansibility, and does not need to change the whole set of codes according to the new style requirement; and the idea of the filter is combined, the complicated business is divided, the stability and the safety of the assembly are ensured, and the influence on other styles when a user modifies one style is avoided.
And the technical effect of the embodiment enables that when a new rich text processing requirement exists, a filter for realizing the processing requirement can be independently registered without changing the way for realizing other processing requirements, thereby not only realizing the function expansion, but also ensuring the independence of various functions without mutual interference. For example, when a function related to stocks is added to the application, some stock codes are input by a user, and some business processes such as highlighting or animation can be performed on the stock codes, and at this time, only the filter needs to be registered in the filter library.
Fig. 2 shows a flow diagram of a rich text processing method according to another embodiment of the invention. As shown in fig. 2, the method includes:
step S201: receiving a registration request of a filter; the filter is registered in the filter repository according to the registration request.
The registration request may be initiated according to a requirement of a newly generated rich text style, for example, during a new year, after a user issues a greeting of the new year, for example, happy, and good in the new year, a plurality of lanterns may be flown in the dialog window, and the registration request may be initiated for the rich text style in which the plurality of lanterns are flown.
Specifically, a registration request is received, wherein the registration request at least comprises style information of rich text styles which can be processed by a filter, so that the on-off state of each filter is controlled in a filter library according to the style information; or, the registration request further includes a style processing rule provided by the filter, wherein the style processing rule refers to a specific process from the text information to the rich text style to adapt to the requirement of the newly generated rich text style, so as to perform an audit in the registration process, for example, determine whether the filter with the same function already exists in the filter library.
In this embodiment, the filters are registered in the filter library, that is, a plurality of filters for processing a plurality of rich text styles are integrated in the filter library, and by controlling the on/off states of a plurality of controllers, the rich text style processing function provided by the corresponding filter can be turned on or off.
Step S202: acquiring text information to be processed, and determining a filter corresponding to the text information;
after a user inputs dialog content in a dialog box, text information to be processed corresponding to the dialog content can be acquired, wherein the dialog content includes but is not limited to characters, expressions and/or pictures.
Specifically, the manner of determining the filter corresponding to the text information is divided into the following two types:
in a first manner, a filter specified by the user is determined. The user-specified mode is suitable for the situation that the user selects the content of the rich text style for inputting, for example, the user selects the emoji expression provided by the application for inputting, and at this time, it can be determined that the current requirement is to send the emoji expression selected by the user to the other side, namely, the emoji expression is specified as a filter for processing to obtain the emoji expression. In other words, the filter specified by the user may be determined according to the specific type of dialog content entered by the user. The specific type includes content types with rich format information, such as expressions, motion pictures, and/or special effect texts.
And secondly, traversing the filters in the filter library according to the text format and/or the text content of the text information, and determining the filter with the style processing rule matched with the text format and/or the text content, wherein the text format and/or the text content can reflect the content composition of the text information, and optionally can reflect the text length, the character type contained in the text and/or the specific content of the text. The style processing rule corresponding to each filter in the filter library comprises the rich text style which can be processed and the applicable processing object thereof. For example, the style processing rule provided by the filter 1 is that every time a numeral 8 appears in the dialog content, the numeral 8 is displayed as a shoe-shaped picture, i.e., the processing object to which the filter 1 is applied is the numeral 8. Based on this, the filters in the filter library are traversed, the conditions of the processing objects to which the filters are applicable are matched with the text format and/or the text content, and then the filters which can be used for processing the current text information are determined according to the matching result.
For the second mode, the identification number is taken as an example for explanation: if the filter library comprises a filter 2 for displaying the identification number in the form of an identification icon, when a user inputs a character string of 18 digits or a character string of 17 digits plus 1 digit letters, whether the character string is the identification number is determined according to the recognition result of each digit character in the character string, and if so, the matched character is determined to be the filter 2.
Step S203: judging whether rich text resources related to the text information are stored in the cache; if yes, go to step S204; if not, go to step S205.
The rich text resource corresponding to the text information refers to a resource which is required to be depended on when the rich text of the corresponding style is displayed. Moreover, when the rich text is the content of the static effect, the resource may be the rich text itself, for example, when the rich text is a static picture, an expression or a character, the resource is the static picture, the expression or the character itself; or, when the rich text is a content of a dynamic effect, the resource is a static content constituting the rich text, for example, the rich text is a moving picture, and the resource is each frame of a static picture constituting the moving picture.
In this embodiment, before performing rich text processing on the text information, it is first determined whether a rich text resource related to the text information is stored in the cache, so as to determine whether the rich text resource can be obtained without performing the rich text processing according to the determination result, and display the corresponding style.
Specifically, when it is determined that the rich text resource related to the text information is stored in the cache, step S204 is executed to directly perform rich text processing by using the rich text resource; when it is determined that the rich text resource related to the text information is not stored in the cache, step S205 is executed to implement rich text display through rich text processing.
It should be noted that, when the execution sequence of the above steps S202 and S203 is not limited to fig. 2, in a specific implementation, after it is determined in step S203 that the rich text resource related to the text information is not stored in the cache, the process of determining the filter corresponding to the text information in step S202 may be executed to reduce the number of unnecessary filter determination times.
Step S204: and obtaining rich text information corresponding to the text information by utilizing the rich text resource.
The rich text information corresponding to the text information refers to content information of the displayed rich text. The rich text information may be a rich text resource itself, for example, the rich text information is the same as the rich text resource, and is a static picture, an expression or a character; or the rich text information is information composed of rich text resources according to a preset rule, where the preset rule includes a rule defining a composition order and/or a composition interval, for example, if the rich text information is a dynamic picture composed of a plurality of static pictures, the preset rule includes a splicing order of the plurality of static pictures in the motion picture and a display duration of the plurality of static pictures.
Specifically, when it is determined that rich text resources related to the text information are stored in the cache, the rich text resources are directly utilized to obtain the rich text information corresponding to the text information, and it is not necessary to perform rich text processing on the text information once again, and it is not necessary to repeatedly store multiple rich text resources corresponding to the same text information in the cache again. In other words, for the same text information, only one rich text resource is stored in the cache, and then the rich text information of each same text information is obtained in a clone mapping manner, so as to save the storage resource.
Step S205: and calling a filter, and performing rich text processing on the text information by using the style processing rule provided by the filter to obtain rich text information with a corresponding style.
Specifically, when it is determined that the rich text resource related to the text information is not stored in the cache, it indicates that there is no available rich text resource for multiplexing, and at this time, rich text processing is required to obtain the rich text information of the text information. Further, the rich text processing comprises determining corresponding rich text resources according to the text information, and obtaining the rich text information according to the rich text resources.
Among the rich text information of various styles, the dynamic graph becomes a rich text presentation style which is extremely popular in instant messaging applications due to the dynamic effect, and based on this, in some optional embodiments, a filter for processing the dynamic graph is registered in a filter library. The process of performing rich text processing by using the filter for processing the dynamic graph specifically includes the following steps: if the filter is used for processing the dynamic graph, acquiring the dynamic graph corresponding to the text information; the dynamic graph corresponding to the text information may be preset, or may be obtained by performing semantic analysis on the text information and then performing matching. Then, decomposing the dynamic graph to obtain a plurality of static graphs, setting a display parameter of each static graph, and specifically, allocating a static constant to each static graph to ensure the survival time of the static graphs and facilitate the multiplexing of rich text resources; and the display parameters comprise the display sequence of the plurality of static graphs and the display time of each static graph. And placing a plurality of static pictures into a container, and setting a monitoring function and a marking function for the container, wherein the container can control each static picture to be displayed according to the corresponding display parameter, further monitor the static picture to be displayed at the current time by using the monitoring function, and mark the display state and/or display time of each static picture by using the marking function. Further, after a plurality of static graphs are obtained, format conversion processing is performed on the plurality of static graphs to obtain a plurality of static graphs in a preset format, wherein the preset format is a picture format occupying a small amount of memory to control storage resources occupied by the plurality of static graphs, and optionally, the preset format is a drawable format.
Taking rich text information for converting the APng picture into the animation style as an example, assume that the filter p is used for processing to obtain the animation style corresponding to the APng picture. Since the APng picture is not a moving picture, the APng picture needs to be firstly analyzed, then a series of static pictures are generated by the APng picture, and each static picture is converted into a drawable format. And aiming at each drawable, putting the drawable as an object into a container, and customizing the display parameters of the animation style, wherein the display parameters comprise the switching sequence and the switching time of each static graph. Through the container, each static graph can be controlled to be displayed according to the display parameters, namely, the APng pictures are converted into animation styles to be presented in a mode of switching display of the static graphs.
In addition, considering that filters in a filter library are registered according to style effects under different requirements, and the requirements generally change along with factors such as time, for example, for a filter registered for a specific festival, there is a corresponding requirement only during the festival, based on this, in some optional embodiments of the present invention, states of a plurality of filters in the filter library are controlled by a cloud rule, and before invoking the filters to perform rich text processing, a configuration file issued by a cloud is received, wherein the configuration file is provided with switching conditions of each filter; setting the on-off state of each filter in the filter library according to the configuration file so as to enable the available condition of each filter to be in accordance with the applicable scene; then, after determining the filter corresponding to the current text information, judging whether the on-off state of the filter is the on-off state, and if so, calling the filter specifically as follows: and if the switch state of the filter is judged to be the opening state, calling the filter. By the cloud rule control mode, the on-off state of each filter can be flexibly controlled according to the application scene of each filter, and inaccurate rich text display caused by chaos of the use of the filters is avoided.
Step S206: and storing the rich text resource generated in the rich text processing into a cache.
Specifically, when the text information is subjected to first rich text processing, rich text resources generated in the processing process are stored in the cache, so that when the demand of displaying the rich text information of the same text information exists, the cached rich text resources are directly utilized to obtain the rich text information, the cache resources do not need to be allocated again to store the rich text resources in each processing process, the storage space is saved, and particularly when the rich text resources are pictures, the cache occupancy rate can be greatly reduced.
And releasing the rich text resource stored in the cache when the preset condition is met. The preset condition is a limiting condition of the use requirement of the rich text resource of the corresponding style, and the use requirement refers to the requirement of obtaining the rich text information by using the use requirement. Optionally, for each rich text resource, after the dialog box is closed, no use requirement exists, and at this time, it is determined that the preset condition is met; or for each rich text resource, after the rich text information corresponding to the rich text resource is moved out of the screen, the use requirement does not exist, and at this time, the preset condition is determined to be met. For example, in an instant messaging application, as the dialog continues, the historical dialog content gradually moves out of the screen, and when it is detected that the corresponding rich text message moves out of the screen, the corresponding cache is released.
Step S207: and rendering and displaying the rich text information.
Specifically, after the rich text information is obtained through step S204 or step S205, the rich text information is rendered and displayed. In some optional embodiments, for the display of the dynamic graph, the monitoring function and the marking function of the container are utilized, and a plurality of static graphs are sequentially rendered and displayed in an alternative mode according to the display parameters of each static graph.
According to the rich text processing method provided by the embodiment, firstly, filters used for processing rich text information of different styles are registered in a filter library, different processing requirements can be met by increasing or decreasing the filters in the filter library, and the rich text display style can be conveniently expanded; moreover, the on-off state of each filter can be controlled through the cloud rules, so that rich text processing can be carried out by using different filters in different scenes, and the flexible control of the available state of each filter can be further realized; when the text information to be processed is obtained, determining a filter which is specified by a user or is obtained by matching and used for processing the text information, judging whether rich text resources related to the text information are stored in a cache, and if the rich text resources do not exist, performing rich text processing by using the filter to obtain the rich text information; if the rich text resource exists, the rich text information is obtained by directly utilizing the rich text resource in the cache, the rich text processing is not needed again, and the cache is distributed for the text information to store the rich text resource, so that the aim of saving the cache resource is fulfilled.
Fig. 3 shows a functional block diagram of a rich text processing apparatus according to an embodiment of the present invention. As shown in fig. 3, the apparatus includes:
the determining module 301 is adapted to obtain text information to be processed and determine a filter corresponding to the text information; the filters are pre-registered to a filter library, each filter registered in the filter library providing different style processing rules;
the processing module 302 is adapted to invoke the filter, and perform rich text processing on the text information by using the style processing rule provided by the filter to obtain rich text information with a corresponding style;
and the display module 303 is adapted to render and display the rich text information.
In an alternative embodiment, the apparatus further comprises:
a registration module 304 adapted to receive a registration request for a filter; and registering the filter into a filter library according to the registration request.
In an alternative embodiment, the determining module 301 is further adapted to:
determining a filter specified by a user;
or traversing the filters in the filter library according to the text format and/or the text content of the text information, and determining the filter of which the style processing rule is matched with the text format and/or the text content.
In an alternative embodiment, the apparatus further comprises:
a first judging module 305, adapted to judge whether a rich text resource related to the text information is stored in a cache;
the obtaining module 306 is adapted to obtain rich text information corresponding to the text information by using the rich text resource if the rich text resource related to the text information is stored in the cache;
the storage module 307 is adapted to store the rich text resource generated during the rich text processing into the cache.
The processing module 302 is further adapted to:
if the rich text resources related to the text information are not stored in the cache, calling the filter, and performing rich text processing on the text information by using a style processing rule provided by the filter to obtain rich text information with a corresponding style;
in an alternative embodiment, the apparatus further comprises: and the releasing module 308 is adapted to release the rich text resource stored in the cache when a preset condition is met.
In an alternative embodiment, the apparatus further comprises:
the configuration module 309 is adapted to receive a configuration file issued by a cloud; and setting the switch state of each filter in the filter library according to the configuration file.
In an alternative embodiment, the apparatus further comprises: a second determining module 310, adapted to determine whether the on-off state of the filter is an on state;
the processing module 302 is further adapted to: and if the switch state of the filter is judged to be the opening state, calling the filter.
In an alternative embodiment, the processing module 302 is further adapted to:
if the filter is used for processing the dynamic graph, acquiring the dynamic graph corresponding to the text information, decomposing the dynamic graph to obtain a plurality of static graphs, and setting the display parameters of each static graph;
placing the static images into a container, and setting a monitoring function and a marking function for the container;
the display module 303 is further adapted to: and rendering and displaying the plurality of static graphs in turn in an alternative mode according to the display parameters of each static graph by utilizing the monitoring function and the marking function of the container.
In an alternative embodiment, the apparatus further comprises: the converting module 311 is adapted to perform format conversion processing on the multiple static graphs to obtain multiple static graphs in a preset format.
The embodiment of the application provides a non-volatile computer storage medium, wherein the computer storage medium stores at least one executable instruction, and the computer executable instruction can execute the rich text processing method in any method embodiment.
Fig. 4 is a schematic structural diagram of a computing device according to an embodiment of the present invention, and the specific embodiment of the present invention does not limit the specific implementation of the computing device.
As shown in fig. 4, the computing device may include: a processor (processor)402, a Communications Interface 404, a memory 406, and a Communications bus 408.
Wherein:
the processor 402, communication interface 404, and memory 406 communicate with each other via a communication bus 408.
A communication interface 404 for communicating with network elements of other devices, such as clients or other servers.
The processor 402 is configured to execute the program 410, and may specifically perform relevant steps in the rich text processing method embodiment described above.
In particular, program 410 may include program code comprising computer operating instructions.
The processor 402 may be a central processing unit CPU, or an application specific Integrated circuit asic, or one or more Integrated circuits configured to implement an embodiment of the present invention. The computing device includes one or more processors, which may be the same type of processor, such as one or more CPUs; or may be different types of processors such as one or more CPUs and one or more ASICs.
And a memory 406 for storing a program 410. Memory 406 may comprise high-speed RAM memory, and may also include non-volatile memory (non-volatile memory), such as at least one disk memory.
The program 410 may specifically be configured to cause the processor 402 to perform the following operations:
acquiring text information to be processed, and determining a filter corresponding to the text information; the filters are pre-registered to a filter library, each filter registered in the filter library providing different style processing rules;
calling the filter, and performing rich text processing on the text information by using the style processing rule provided by the filter to obtain rich text information with a corresponding style;
and rendering and displaying the rich text information.
In an alternative embodiment, the program 410 may be specifically configured to further cause the processor 402 to perform the following operations: receiving a registration request of a filter;
and registering the filter into a filter library according to the registration request.
In an alternative embodiment, the program 410 may be specifically configured to further cause the processor 402 to perform the following operations: determining a filter specified by a user;
or traversing the filters in the filter library according to the text format and/or the text content of the text information, and determining the filter of which the style processing rule is matched with the text format and/or the text content.
In an alternative embodiment, the program 410 may be specifically configured to further cause the processor 402 to perform the following operations: judging whether rich text resources related to the text information are stored in a cache; if yes, obtaining rich text information corresponding to the text information by using the rich text resource;
if the rich text resources related to the text information are not stored in the cache, calling the filter, and performing rich text processing on the text information by using a style processing rule provided by the filter to obtain rich text information with a corresponding style;
and storing the rich text resource generated during the rich text processing into a cache.
In an alternative embodiment, the program 410 may be specifically configured to further cause the processor 402 to perform the following operations: and releasing the rich text resource stored in the cache when a preset condition is met.
In an alternative embodiment, the program 410 may be specifically configured to further cause the processor 402 to perform the following operations: receiving a configuration file issued by a cloud;
and setting the switch state of each filter in the filter library according to the configuration file.
In an alternative embodiment, the program 410 may be specifically configured to further cause the processor 402 to perform the following operations: judging whether the on-off state of the filter is an on state or not;
and if the switch state of the filter is judged to be the opening state, calling the filter.
In an alternative embodiment, the program 410 may be specifically configured to further cause the processor 402 to perform the following operations:
if the filter is used for processing the dynamic graph, acquiring the dynamic graph corresponding to the text information, decomposing the dynamic graph to obtain a plurality of static graphs, and setting the display parameters of each static graph;
placing the static images into a container, and setting a monitoring function and a marking function for the container;
and rendering and displaying the plurality of static graphs in turn in an alternative mode according to the display parameters of each static graph by utilizing the monitoring function and the marking function of the container.
In an alternative embodiment, the program 410 may be specifically configured to further cause the processor 402 to perform the following operations: and carrying out format conversion processing on the static images to obtain static images with a plurality of preset formats.
The algorithms and displays presented herein are not inherently related to any particular computer, virtual machine, or other apparatus. Various general purpose systems may also be used with the teachings herein. The required structure for constructing such a system will be apparent from the description above. Moreover, the present invention is not directed to any particular programming language. It is appreciated that a variety of programming languages may be used to implement the teachings of the present invention as described herein, and any descriptions of specific languages are provided above to disclose the best mode of the invention.
In the description provided herein, numerous specific details are set forth. It is understood, however, that embodiments of the invention may be practiced without these specific details. In some instances, well-known methods, structures and techniques have not been shown in detail in order not to obscure an understanding of this description.
Similarly, it should be appreciated that in the foregoing description of exemplary embodiments of the invention, various features of the invention are sometimes grouped together in a single embodiment, figure, or description thereof for the purpose of streamlining the disclosure and aiding in the understanding of one or more of the various inventive aspects. However, the disclosed method should not be interpreted as reflecting an intention that: that the invention as claimed requires more features than are expressly recited in each claim. Rather, as the following claims reflect, inventive aspects lie in less than all features of a single foregoing disclosed embodiment. Thus, the claims following the detailed description are hereby expressly incorporated into this detailed description, with each claim standing on its own as a separate embodiment of this invention.
Those skilled in the art will appreciate that the modules in the device in an embodiment may be adaptively changed and disposed in one or more devices different from the embodiment. The modules or units or components of the embodiments may be combined into one module or unit or component, and furthermore they may be divided into a plurality of sub-modules or sub-units or sub-components. All of the features disclosed in this specification (including any accompanying claims, abstract and drawings), and all of the processes or elements of any method or apparatus so disclosed, may be combined in any combination, except combinations where at least some of such features and/or processes or elements are mutually exclusive. Each feature disclosed in this specification (including any accompanying claims, abstract and drawings) may be replaced by alternative features serving the same, equivalent or similar purpose, unless expressly stated otherwise.
Furthermore, those skilled in the art will appreciate that while some embodiments described herein include some features included in other embodiments, rather than other features, combinations of features of different embodiments are meant to be within the scope of the invention and form different embodiments. For example, in the following claims, any of the claimed embodiments may be used in any combination.
The various component embodiments of the invention may be implemented in hardware, or in software modules running on one or more processors, or in a combination thereof. Those skilled in the art will appreciate that a microprocessor or Digital Signal Processor (DSP) may be used in practice to implement some or all of the functionality of some or all of the components in a rich text processing apparatus according to embodiments of the present invention. The present invention may also be embodied as apparatus or device programs (e.g., computer programs and computer program products) for performing a portion or all of the methods described herein. Such programs implementing the present invention may be stored on computer-readable media or may be in the form of one or more signals. Such a signal may be downloaded from an internet website or provided on a carrier signal or in any other form.
It should be noted that the above-mentioned embodiments illustrate rather than limit the invention, and that those skilled in the art will be able to design alternative embodiments without departing from the scope of the appended claims. In the claims, any reference signs placed between parentheses shall not be construed as limiting the claim. The word "comprising" does not exclude the presence of elements or steps not listed in a claim. The word "a" or "an" preceding an element does not exclude the presence of a plurality of such elements. The invention may be implemented by means of hardware comprising several distinct elements, and by means of a suitably programmed computer. In the unit claims enumerating several means, several of these means may be embodied by one and the same item of hardware. The usage of the words first, second and third, etcetera do not indicate any ordering. These words may be interpreted as names.
The invention discloses: A1. a rich text processing method, comprising:
acquiring text information to be processed, and determining a filter corresponding to the text information; the filters are pre-registered to a filter library, each filter registered in the filter library providing different style processing rules;
calling the filter, and performing rich text processing on the text information by using the style processing rule provided by the filter to obtain rich text information with a corresponding style;
and rendering and displaying the rich text information.
A2. The method of a1, wherein the method further comprises:
receiving a registration request of a filter;
and registering the filter into a filter library according to the registration request.
A3. The method of A1 or A2, wherein the determining the filter to which the textual information corresponds further comprises:
determining a filter specified by a user;
or traversing the filters in the filter library according to the text format and/or the text content of the text information, and determining the filter of which the style processing rule is matched with the text format and/or the text content.
A4. The method of any of A1-A3, wherein, after the determining the filter to which the textual information corresponds, the method further comprises:
judging whether rich text resources related to the text information are stored in a cache; if yes, obtaining rich text information corresponding to the text information by using the rich text resource;
the invoking the filter, performing rich text processing on the text information by using the style processing rule provided by the filter, and obtaining rich text information with a corresponding style further comprises:
if the rich text resources related to the text information are not stored in the cache, calling the filter, and performing rich text processing on the text information by using a style processing rule provided by the filter to obtain rich text information with a corresponding style;
and storing the rich text resource generated during the rich text processing into a cache.
A5. The method of a4, wherein the method further comprises: and releasing the rich text resource stored in the cache when a preset condition is met.
A6. The method of any one of a1-a5, wherein the method further comprises:
receiving a configuration file issued by a cloud;
and setting the switch state of each filter in the filter library according to the configuration file.
A7. The method of A1 or A6, wherein, prior to the invoking of a filter, the method further comprises: judging whether the on-off state of the filter is an on state or not;
the calling filter is specifically as follows: and if the switch state of the filter is judged to be the opening state, calling the filter.
A8. The method of any of a1-a7, wherein the rich text processing of the text information using the style processing rules provided by the filter, resulting in rich text information with a corresponding style further comprises:
if the filter is used for processing the dynamic graph, acquiring the dynamic graph corresponding to the text information, decomposing the dynamic graph to obtain a plurality of static graphs, and setting the display parameters of each static graph;
placing the static images into a container, and setting a monitoring function and a marking function for the container;
the rendering and displaying the rich text information further comprises: and rendering and displaying the plurality of static graphs in turn in an alternative mode according to the display parameters of each static graph by utilizing the monitoring function and the marking function of the container.
A9. The method of A8, wherein after the obtaining the plurality of static maps, the method further comprises: and carrying out format conversion processing on the static images to obtain static images with a plurality of preset formats.
The invention also discloses: B10. a rich text processing apparatus comprising:
the determining module is suitable for acquiring text information to be processed and determining a filter corresponding to the text information; the filters are pre-registered to a filter library, each filter registered in the filter library providing different style processing rules;
the processing module is suitable for calling the filter and carrying out rich text processing on the text information by using the style processing rule provided by the filter to obtain rich text information with a corresponding style;
and the display module is suitable for rendering and displaying the rich text information.
B11. The apparatus of B10, wherein the apparatus further comprises:
a registration module adapted to receive a registration request for a filter; and registering the filter into a filter library according to the registration request.
B12. The apparatus of B10 or B11, wherein the determination module is further adapted to:
determining a filter specified by a user;
or traversing the filters in the filter library according to the text format and/or the text content of the text information, and determining the filter of which the style processing rule is matched with the text format and/or the text content.
B13. The apparatus of any one of B10-B12, wherein the apparatus further comprises:
the first judgment module is suitable for judging whether rich text resources related to the text information are stored in a cache or not;
the acquisition module is suitable for acquiring rich text information corresponding to the text information by using the rich text resource if the rich text resource related to the text information is stored in the cache;
and the storage module is suitable for storing the rich text resource generated in the rich text processing into a cache.
The processing module is further adapted to:
if the rich text resources related to the text information are not stored in the cache, calling the filter, and performing rich text processing on the text information by using a style processing rule provided by the filter to obtain rich text information with a corresponding style;
B14. the apparatus of B13, wherein the apparatus further comprises: and the releasing module is suitable for releasing the rich text resources stored in the cache when a preset condition is met.
B15. The apparatus of any one of B10-B14, wherein the apparatus further comprises:
the configuration module is suitable for receiving a configuration file issued by the cloud; and setting the switch state of each filter in the filter library according to the configuration file.
B16. The apparatus of B10 or B15, wherein the apparatus further comprises: the second judgment module is suitable for judging whether the switch state of the filter is an opening state or not;
the processing module is further adapted to: and if the switch state of the filter is judged to be the opening state, calling the filter.
B17. The apparatus of any one of B10-B16, wherein the processing module is further adapted to:
if the filter is used for processing the dynamic graph, acquiring the dynamic graph corresponding to the text information, decomposing the dynamic graph to obtain a plurality of static graphs, and setting the display parameters of each static graph;
placing the static images into a container, and setting a monitoring function and a marking function for the container;
the display module is further adapted to: and rendering and displaying the plurality of static graphs in turn in an alternative mode according to the display parameters of each static graph by utilizing the monitoring function and the marking function of the container.
B18. The apparatus of B17, wherein the apparatus further comprises: and the conversion module is suitable for carrying out format conversion processing on the plurality of static graphs to obtain a plurality of static graphs in preset formats.
The invention also discloses: C19. a computing device, comprising: the system comprises a processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface complete mutual communication through the communication bus;
the memory is for storing at least one executable instruction that causes the processor to perform operations corresponding to the rich text processing method of any one of A1-A9.
The invention also discloses: D20. a computer storage medium having stored therein at least one executable instruction that causes a processor to perform operations corresponding to the rich text processing method of any one of a1-a 9.

Claims (10)

1. A rich text processing method, comprising:
acquiring text information to be processed, and determining a filter corresponding to the text information; the filters are pre-registered to a filter library, each filter registered in the filter library providing different style processing rules;
calling the filter, and performing rich text processing on the text information by using the style processing rule provided by the filter to obtain rich text information with a corresponding style;
and rendering and displaying the rich text information.
2. The method of claim 1, wherein the method further comprises:
receiving a registration request of a filter;
and registering the filter into a filter library according to the registration request.
3. The method of claim 1 or 2, wherein the determining the filter to which the textual information corresponds further comprises:
determining a filter specified by a user;
or traversing the filters in the filter library according to the text format and/or the text content of the text information, and determining the filter of which the style processing rule is matched with the text format and/or the text content.
4. The method of any of claims 1-3, wherein after the determining the filter to which the textual information corresponds, the method further comprises:
judging whether rich text resources related to the text information are stored in a cache; if yes, obtaining rich text information corresponding to the text information by using the rich text resource;
the invoking the filter, performing rich text processing on the text information by using the style processing rule provided by the filter, and obtaining rich text information with a corresponding style further comprises:
if the rich text resources related to the text information are not stored in the cache, calling the filter, and performing rich text processing on the text information by using a style processing rule provided by the filter to obtain rich text information with a corresponding style;
and storing the rich text resource generated during the rich text processing into a cache.
5. The method of claim 4, wherein the method further comprises: and releasing the rich text resource stored in the cache when a preset condition is met.
6. The method according to any one of claims 1-5, wherein the method further comprises:
receiving a configuration file issued by a cloud;
and setting the switch state of each filter in the filter library according to the configuration file.
7. The method of claim 1 or 6, wherein prior to said invoking a filter, the method further comprises: judging whether the on-off state of the filter is an on state or not;
the calling filter is specifically as follows: and if the switch state of the filter is judged to be the opening state, calling the filter.
8. A rich text processing apparatus comprising:
the determining module is suitable for acquiring text information to be processed and determining a filter corresponding to the text information; the filters are pre-registered to a filter library, each filter registered in the filter library providing different style processing rules;
the processing module is suitable for calling the filter and carrying out rich text processing on the text information by using the style processing rule provided by the filter to obtain rich text information with a corresponding style;
and the display module is suitable for rendering and displaying the rich text information.
9. A computing device, comprising: the system comprises a processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface complete mutual communication through the communication bus;
the memory is used for storing at least one executable instruction which causes the processor to execute the operation corresponding to the rich text processing method according to any one of claims 1-7.
10. A computer storage medium having stored therein at least one executable instruction that causes a processor to perform operations corresponding to the rich text processing method of any one of claims 1-7.
CN201811620942.4A 2018-12-28 2018-12-28 Rich text processing method and device, computing equipment and computer storage medium Pending CN111444683A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811620942.4A CN111444683A (en) 2018-12-28 2018-12-28 Rich text processing method and device, computing equipment and computer storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811620942.4A CN111444683A (en) 2018-12-28 2018-12-28 Rich text processing method and device, computing equipment and computer storage medium

Publications (1)

Publication Number Publication Date
CN111444683A true CN111444683A (en) 2020-07-24

Family

ID=71648413

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811620942.4A Pending CN111444683A (en) 2018-12-28 2018-12-28 Rich text processing method and device, computing equipment and computer storage medium

Country Status (1)

Country Link
CN (1) CN111444683A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112966265A (en) * 2021-03-01 2021-06-15 京东数字科技控股股份有限公司 Rich text security processing method and device, electronic equipment and storage medium

Citations (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2012039392A (en) * 2010-08-06 2012-02-23 Canon Inc Setting device, setting method, and program
CN102916963A (en) * 2012-10-26 2013-02-06 中国人民解放军信息工程大学 Safe data exchange method, device, nodes and safe data exchange system
CN103034622A (en) * 2012-12-05 2013-04-10 北京奇虎科技有限公司 Rich text content processing method and server
CN103034700A (en) * 2012-12-05 2013-04-10 北京奇虎科技有限公司 Rich text content processing method and system
CN103607427A (en) * 2013-10-30 2014-02-26 小米科技有限责任公司 Method and device for information display
US20140250369A1 (en) * 2005-04-29 2014-09-04 Macromedia, Inc. Interactive special paste
GB201417856D0 (en) * 2014-10-09 2014-11-26 Bigears Digital Services Ltd Methods for identifying and monitoring use of audio entities
CN105183733A (en) * 2014-06-05 2015-12-23 阿里巴巴集团控股有限公司 Methods for matching text information and pushing business object, and devices for matching text information and pushing business object
CN106095743A (en) * 2016-06-21 2016-11-09 武汉斗鱼网络科技有限公司 A kind of RichText Edition method and device
CN106911794A (en) * 2017-03-23 2017-06-30 福建天泉教育科技有限公司 The method and system that a kind of picture is stored automatically
CN107229626A (en) * 2016-03-23 2017-10-03 阿里巴巴集团控股有限公司 A kind of method and system for inserting and checking dynamic content
CN108073647A (en) * 2016-11-14 2018-05-25 腾讯科技(深圳)有限公司 Webpage display process and device
CN108280227A (en) * 2018-01-26 2018-07-13 北京奇虎科技有限公司 Data information processing method based on caching and device
CN108389244A (en) * 2018-02-14 2018-08-10 上海钦文信息科技有限公司 A kind of implementation method rendering flash rich texts according to designated character rule
CN108959392A (en) * 2018-05-31 2018-12-07 阿里巴巴集团控股有限公司 The method, device and equipment of rich text is shown on 3D model

Patent Citations (15)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20140250369A1 (en) * 2005-04-29 2014-09-04 Macromedia, Inc. Interactive special paste
JP2012039392A (en) * 2010-08-06 2012-02-23 Canon Inc Setting device, setting method, and program
CN102916963A (en) * 2012-10-26 2013-02-06 中国人民解放军信息工程大学 Safe data exchange method, device, nodes and safe data exchange system
CN103034622A (en) * 2012-12-05 2013-04-10 北京奇虎科技有限公司 Rich text content processing method and server
CN103034700A (en) * 2012-12-05 2013-04-10 北京奇虎科技有限公司 Rich text content processing method and system
CN103607427A (en) * 2013-10-30 2014-02-26 小米科技有限责任公司 Method and device for information display
CN105183733A (en) * 2014-06-05 2015-12-23 阿里巴巴集团控股有限公司 Methods for matching text information and pushing business object, and devices for matching text information and pushing business object
GB201417856D0 (en) * 2014-10-09 2014-11-26 Bigears Digital Services Ltd Methods for identifying and monitoring use of audio entities
CN107229626A (en) * 2016-03-23 2017-10-03 阿里巴巴集团控股有限公司 A kind of method and system for inserting and checking dynamic content
CN106095743A (en) * 2016-06-21 2016-11-09 武汉斗鱼网络科技有限公司 A kind of RichText Edition method and device
CN108073647A (en) * 2016-11-14 2018-05-25 腾讯科技(深圳)有限公司 Webpage display process and device
CN106911794A (en) * 2017-03-23 2017-06-30 福建天泉教育科技有限公司 The method and system that a kind of picture is stored automatically
CN108280227A (en) * 2018-01-26 2018-07-13 北京奇虎科技有限公司 Data information processing method based on caching and device
CN108389244A (en) * 2018-02-14 2018-08-10 上海钦文信息科技有限公司 A kind of implementation method rendering flash rich texts according to designated character rule
CN108959392A (en) * 2018-05-31 2018-12-07 阿里巴巴集团控股有限公司 The method, device and equipment of rich text is shown on 3D model

Non-Patent Citations (4)

* Cited by examiner, † Cited by third party
Title
B. SENTHIL KUMAR ET AL: "Classification of Mobile Applications with rich information", 《2015 INTERNATIONAL CONFERENCE ON SOFT-COMPUTING AND NETWORKS SECURITY (ICSNS)》, 8 October 2015 (2015-10-08), pages 1 - 7 *
佟伟: "基于富文本格式的剪贴板的实现", 《中国优秀硕士学位论文全文数据库信息科技辑》, no. 4, 15 December 2004 (2004-12-15), pages 138 - 230 *
刘浩: "运动图像中的文字识取研究", 《中国优秀硕士学位论文全文数据库信息科技辑》, no. 2, 15 December 2013 (2013-12-15), pages 138 - 1447 *
王军: "基于Web的教学资源在线编辑技术研究与实现", 《中国优秀硕士学位论文全文数据库信息科技辑》, no. 8, 15 August 2012 (2012-08-15), pages 138 - 496 *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112966265A (en) * 2021-03-01 2021-06-15 京东数字科技控股股份有限公司 Rich text security processing method and device, electronic equipment and storage medium

Similar Documents

Publication Publication Date Title
CN107707452B (en) Information display method and device for expressions and electronic equipment
CN106250104B (en) A kind of remote operating system for server, method and device
CN108876887B (en) Rendering method and device
US10515464B2 (en) Dynamic color customization of standardized (emoji) image characters
CN107633541B (en) Method and device for generating image special effect
CN111259644B (en) Rich text processing method, editor, equipment and storage medium
KR102229742B1 (en) Method and device for previewing a dynamic image, and method and device for displaying a presentation package
CN110471700B (en) Graphic processing method, apparatus, storage medium and electronic device
CN111367518B (en) Page layout method, page layout device, computing equipment and computer storage medium
US20160255135A1 (en) Method and apparatus for displaying processing status
CN111444683A (en) Rich text processing method and device, computing equipment and computer storage medium
CN107977410B (en) Bookshelf management method based on electronic book application and electronic equipment
CN109558159A (en) The update method and device of user interface in game
CN110908646B (en) Building block type callback function block construction method and device, storage medium and processor
CN110941464B (en) Light exposure method, device, system and storage medium
CN109885318B (en) Method and device for updating desktop icon of web application
CN110018812B (en) Graph drawing method and device
CN114090925A (en) Switching method and device of visual theme, electronic equipment and storage medium
CN110989982B (en) Building block construction method and device with return value function, storage medium and processor
CN115170700A (en) Method for realizing CSS animation based on Flutter framework, computer equipment and storage medium
CN113688100A (en) Meteorological data processing method, device, terminal and storage medium
CN114594945A (en) Method, device, system, equipment and medium for generating advanced popup selection frame
CN111240676A (en) Method and device for generating code of skeleton screen
CN112068828A (en) Title control generation method, device, system, equipment and medium
CN111292392A (en) Unity-based image display method, apparatus, device and medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination