CN114500505A - Text processing method and device and electronic equipment - Google Patents
Text processing method and device and electronic equipment Download PDFInfo
- Publication number
- CN114500505A CN114500505A CN202210062431.5A CN202210062431A CN114500505A CN 114500505 A CN114500505 A CN 114500505A CN 202210062431 A CN202210062431 A CN 202210062431A CN 114500505 A CN114500505 A CN 114500505A
- Authority
- CN
- China
- Prior art keywords
- rich text
- target
- text data
- rich
- data sequence
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
- 238000003672 processing method Methods 0.000 title claims abstract description 17
- 238000012545 processing Methods 0.000 claims abstract description 65
- 238000000034 method Methods 0.000 claims description 42
- 238000006243 chemical reaction Methods 0.000 claims description 22
- 230000008569 process Effects 0.000 claims description 20
- 238000004590 computer program Methods 0.000 claims description 11
- 230000011218 segmentation Effects 0.000 claims description 5
- 238000004458 analytical method Methods 0.000 claims description 2
- 238000004519 manufacturing process Methods 0.000 description 10
- 238000004891 communication Methods 0.000 description 8
- 238000010586 diagram Methods 0.000 description 5
- 230000009286 beneficial effect Effects 0.000 description 4
- 230000000694 effects Effects 0.000 description 4
- 230000006870 function Effects 0.000 description 3
- 230000004048 modification Effects 0.000 description 3
- 238000012986 modification Methods 0.000 description 3
- 230000003287 optical effect Effects 0.000 description 3
- 238000004364 calculation method Methods 0.000 description 2
- 238000001914 filtration Methods 0.000 description 2
- 230000003993 interaction Effects 0.000 description 2
- 238000003491 array Methods 0.000 description 1
- 238000013473 artificial intelligence Methods 0.000 description 1
- 230000001413 cellular effect Effects 0.000 description 1
- 238000010276 construction Methods 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 230000018109 developmental process Effects 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 230000006872 improvement Effects 0.000 description 1
- 239000004973 liquid crystal related substance Substances 0.000 description 1
- 238000010801 machine learning Methods 0.000 description 1
- 239000013307 optical fiber Substances 0.000 description 1
- 239000004065 semiconductor Substances 0.000 description 1
- 230000001953 sensory effect Effects 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
- 230000000007 visual effect Effects 0.000 description 1
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/06—Protocols specially adapted for file transfer, e.g. file transfer protocol [FTP]
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L69/00—Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
- H04L69/08—Protocols for interworking; Protocol conversion
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
- H04N21/20—Servers specifically adapted for the distribution of content, e.g. VOD servers; Operations thereof
- H04N21/23—Processing of content or additional data; Elementary server operations; Server middleware
- H04N21/231—Content storage operation, e.g. caching movies for short term storage, replicating data over plural servers, prioritizing data for deletion
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04N—PICTORIAL COMMUNICATION, e.g. TELEVISION
- H04N21/00—Selective content distribution, e.g. interactive television or video on demand [VOD]
- H04N21/40—Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
- H04N21/43—Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
- H04N21/433—Content storage operation, e.g. storage operation in response to a pause request, caching operations
Landscapes
- Engineering & Computer Science (AREA)
- Signal Processing (AREA)
- Computer Networks & Wireless Communication (AREA)
- Multimedia (AREA)
- Computer Security & Cryptography (AREA)
- Information Transfer Between Computers (AREA)
Abstract
The disclosure provides a text processing method and device and electronic equipment, relates to the field of data processing, and particularly relates to the field of rich text data processing. The specific implementation scheme is as follows: the text processing method comprises the following steps: acquiring a first rich text data sequence, wherein the first rich text data sequence comprises an initial storage address of multimedia content; downloading the multimedia content to a Content Delivery Network (CDN) of a target platform based on the initial storage address; performing target processing on the first rich text data sequence to obtain a processed target rich text, wherein the target processing at least comprises: updating the initial storage address in the first text-rich data sequence to be a target address, where the target address is a storage address of the multimedia content in the CDN. The present disclosure may improve controllability of the target platform over the imported external content.
Description
Technical Field
The present disclosure relates to the field of data processing, and more particularly to the field of rich text data processing. In particular to a text processing method and device and electronic equipment.
Background
With the development of internet technology, a large number of content production platforms are emerging in the prior art. In the content displayed by the existing content production platform, besides the content produced by the user of the platform, external high-quality content is generally required to be introduced, for example, the content introduced into other platforms, the content produced by external teams, the authoritative content produced by authorities, and the like. Currently, in the process of introducing external content into a content production platform, the external content generally needs to be preprocessed so as to align the external content with a free service protocol of the content production platform.
Disclosure of Invention
The disclosure provides a text processing method and device and electronic equipment.
According to a first aspect of the present disclosure, there is provided a text processing method including:
acquiring a first rich text data sequence, wherein the first rich text data sequence comprises an initial storage address of multimedia content;
downloading the multimedia content to a Content Delivery Network (CDN) of a target platform based on the initial storage address;
performing target processing on the first rich text data sequence to obtain a processed target rich text, wherein the target processing at least comprises: updating the initial storage address in the first text-rich data sequence to be a target address, where the target address is a storage address of the multimedia content in the CDN.
According to a second aspect of the present disclosure, there is provided a text processing apparatus including:
the device comprises a first acquisition module, a second acquisition module and a third acquisition module, wherein the first acquisition module is used for acquiring a first rich text data sequence which comprises an initial storage address of the multimedia content;
the downloading module is used for downloading the multimedia content to a Content Delivery Network (CDN) of a target platform based on the initial storage address;
a processing module, configured to perform target processing on the first rich text data sequence to obtain a processed target rich text, where the target processing at least includes: updating the initial storage address in the first text-rich data sequence to be a target address, where the target address is a storage address of the multimedia content in the CDN.
According to a third aspect of the present disclosure, there is provided an electronic device comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of the first aspect.
According to a fourth aspect of the present disclosure, there is provided a non-transitory computer readable storage medium having stored thereon computer instructions for causing the computer to perform the method of the first aspect.
According to a fifth aspect of the present disclosure, there is provided a computer program product comprising a computer program which, when executed by a processor, implements the method described in the first aspect.
In the embodiment of the disclosure, when the first text-rich data sequence is external content introduced from the outside to the target platform, the multimedia content in the first text-rich data sequence is downloaded to the CDN of the target platform, and an initial storage address of the multimedia content in the first text-rich data sequence is updated to a storage address of the multimedia content in the CDN. In this way, when the multimedia content stored in the external platform is modified, the multimedia content displayed by the target platform is not modified, thereby improving the controllability of the target platform on the introduced external content.
Drawings
The drawings are included to provide a better understanding of the present solution and are not to be construed as limiting the present disclosure. Wherein:
fig. 1 is a flowchart of a text processing method provided by an embodiment of the present disclosure;
FIG. 2 is a schematic structural diagram of a text processing apparatus according to an embodiment of the present disclosure;
fig. 3 is a block diagram of an electronic device for implementing a text processing method according to an embodiment of the present disclosure.
Detailed Description
Exemplary embodiments of the present disclosure are described below with reference to the accompanying drawings, in which various details of the embodiments of the disclosure are included to assist understanding, and which are to be considered as merely exemplary. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the present disclosure. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
Referring to fig. 1, fig. 1 is a flowchart of a text processing method according to an embodiment of the disclosure. As shown in fig. 1, the method comprises the steps of:
step S101, acquiring a first rich text data sequence, wherein the first rich text data sequence comprises an initial storage address of multimedia content;
step S102, downloading the multimedia Content to a Content Delivery Network (CDN) of a target platform based on the initial storage address;
step S103, performing target processing on the first rich text data sequence to obtain a processed target rich text, wherein the target processing at least comprises: updating the initial storage address in the first text-rich data sequence to be a target address, where the target address is a storage address of the multimedia content in the CDN.
The target platform is a common content production platform, and may be, for example, a short video production platform, an image-text content production platform, or the like. It is understood that the text processing method may be applied to the target platform, and particularly, may be applied to a process in which the target platform processes content introduced from the outside. The target platform may present content generated by a user of the target platform in addition to externally introduced content.
The first rich-text data sequence may be a data sequence of rich-text content introduced to the target platform from the outside. The first rich text data sequence may refer to a data sequence formed by parsing or format converting the rich text content, for example, the first rich text data sequence may be a Document Object Model (DOM) Object formed by parsing the rich text content through a DomDocument class. Alternatively, the first rich-text data sequence may also be a data sequence formed by converting the rich-text content into a JS Object Notation (JSON) format. By parsing or converting the rich text content into a rich text data sequence, further processing of the rich text content is facilitated.
The target process may update the storage address of the multimedia content, and may perform other processes on the data in the first rich text data sequence, for example, the font of the characters in the first rich text data sequence may be adjusted, or the related format that cannot be displayed on the target platform in the first rich text data sequence may be deleted.
The multimedia content may be video content, audio content, or picture content. The initial storage address of the multimedia content may refer to a storage address of the multimedia content on an external platform. Since the multimedia content in the first rich text data sequence is stored in the external platform, when the external platform modifies the multimedia content, the multimedia content displayed by the target platform will be modified accordingly, and the target platform will not control the content distributed by the target platform. In addition, when the multimedia content is stored in an external platform, the time taken for the target platform to read the multimedia content is relatively long, and the target platform cannot manage the white list of the multimedia content, resulting in a problem that the target platform is uncontrollable for users viewing the content distributed by the target platform.
In this embodiment, when the first text-rich data sequence is external content introduced from the outside to the target platform, the multimedia content in the first text-rich data sequence is downloaded to the CDN of the target platform, and the initial storage address of the multimedia content in the first text-rich data sequence is updated to the storage address of the multimedia content in the CDN. Therefore, when the multimedia content stored in the external platform is modified, the multimedia content displayed by the target platform cannot be modified, and meanwhile, the multimedia content is stored in the CDN of the target platform, so that the data reading speed can be improved. In addition, the multimedia content is stored in the CDN of the target platform, so that the white list of the multimedia content is managed, and the controllability of the target platform on the introduced external content is improved.
Optionally, in a case that the first rich text data sequence further includes a table, the target process further includes:
converting the table into a picture format to obtain a first picture;
and displaying the first picture in the target rich text according to a preset image display protocol.
Among them, since the display size of data in a table form in rich text content generally depends on the amount of data contained therein, when the amount of data contained in the table is large, the display size thereof is generally large. At this time, if the screen size of the display terminal of the user of the target platform is small, the table content may not be completely displayed, and the display effect of the data in the visible table form is often difficult to control. When a user views the data in the form of the table on the small-screen terminal, if the terminal cannot completely display the table content, the user can only slide the table left and right to view the complete table content, but cannot zoom the table data, so that the problem that the operation is inconvenient when the data in the form of the table is directly displayed can be seen.
Based on this, in the embodiment of the present disclosure, the first picture is obtained by converting the data in the table form into the picture format. Because the data in the picture format can support the user to zoom or move in various directions, the convenience of the user for operating the table data can be improved.
In addition, the first picture is displayed in the target rich text according to a preset image display protocol: the first picture may be displayed according to a preset size, for example, the display size of the first image obtained by converting the form may be set in advance in an image display protocol, so that the form can be completely displayed in display terminals of various sizes, thereby being beneficial to improving the display effect of the form.
In particular, a form-to-picture service may be accessed in the target platform, thereby facilitating conversion of a form in the first rich text data sequence into a first picture based on the form-to-picture service during processing of the first rich text data sequence.
In this embodiment, the table in the first rich text data sequence is converted into the first image, so that convenience of the user in operating the table data is improved. Meanwhile, the first picture is displayed in the target rich text according to a preset image display protocol, so that the display effect of the form is improved.
Optionally, in a case that the first rich-text data sequence further includes a rich-text protocol, the target process further includes:
under the condition that a conversion rule of the rich text protocol is obtained, converting the rich text protocol into a target protocol corresponding to the target platform based on the conversion rule;
updating the rich-text protocol in the first rich-text data sequence to the target protocol;
wherein the rich text protocol is used to present a target application or target multimedia content.
In particular, since a rich text protocol customized by a third party is also generally included in the rich text data, for example, the rich text protocol may be an applet developed by the third party, or an audio/video published by the third party, or the like. Wherein the third party is: a producer of the content other than the producer of the first rich text data sequence and the target platform. And the target platform may not want to drain its own user to the third party's platform. Therefore, in the embodiment of the disclosure, the rich text protocol customized by the third party can be converted, so that the rich text protocol customized by the third party is converted into the internal protocol of the target platform.
The rich text protocol may refer to a rich text protocol customized by a third party, and the target application may refer to an applet developed by the third party, for example, a voting applet or a game applet. The target multimedia content may refer to: and multimedia contents such as video contents and audio contents generated by a third party. The target protocol may refer to an internal protocol of the target platform.
The conversion rule of the rich text protocol needs to be acquired from the third party due to the need to convert the rich text protocol into the internal protocol of the target platform. The conversion rule may be obtained through negotiation with a third party or purchase. If the conversion rule can be successfully acquired, the rich text protocol can be converted into the internal protocol of the target platform according to the conversion rule, so that the integrity of the first rich text data sequence is favorably ensured.
In the embodiment, by obtaining the conversion rule of the rich text protocol and converting the rich text protocol into the target protocol corresponding to the target platform based on the conversion rule, the integrity of the first rich text data sequence can be ensured, and meanwhile, the rich text protocol can be displayed on the target platform, so that the problem that the rich text protocol needs to be displayed across platforms is solved.
Optionally, the target processing further includes:
deleting the rich text protocol in the first rich text data sequence if the conversion rule of the rich text protocol is not acquired.
In this embodiment, when the conversion rule of the rich text protocol cannot be obtained, the rich text protocol is deleted from the first rich text data sequence. Therefore, the uncontrollable content of the target platform is deleted, so that the controllability of the target platform on the published content is improved.
Optionally, before the obtaining the first rich-text data sequence, the method further includes:
acquiring an initial rich text;
analyzing the initial rich text into a Document Object Model (DOM) object;
deleting preset format information of the text in the DOM object to obtain a second rich text data sequence;
generating the first sequence of rich text data based on a second sequence of rich text data.
In particular, the initial rich text may be rich text content imported from an external platform in order to align the initial rich text content with a free service agreement of a target platform. The initial rich text may first be parsed into DOM objects. And then traversing the DOM object, and filtering external unnecessary special styles, namely deleting the preset format information from the DOM object. For example, when the target platform cannot display italicized text, the "italicized" format in the text may be deleted.
The generating of the first rich-text data sequence based on the second rich-text data sequence may refer to: determining the second rich text data sequence directly as the first rich text data sequence, or parsing or format converting the second rich text data to generate the first rich text data sequence.
In this embodiment, after the initial rich text is obtained, the initial rich text is parsed into DOM objects, so that the parsed DOM objects are transmitted to the downstream of the production flow, which is beneficial to understanding of the downstream production end on the content and is beneficial to classifying and sorting the content by the downstream production end. In addition, by traversing the DOM object, filtering particular nodes in the DOM object is facilitated, thereby facilitating alignment of the initial rich text content with a free-running business protocol of a target platform.
Optionally, the generating the first sequence of rich text data based on the second sequence of rich text data comprises:
converting the second rich text data sequence into a JavaScript Object Notation (JSON) format to obtain a converted third rich text data sequence;
and segmenting the third rich text data sequence according to a preset strategy to obtain the first rich text data sequence.
In the embodiment, the second rich text data sequence nested in multiple layers is converted into the streaming JSON format convenient for content parsing, so that the rich text content can be further parsed and processed.
Optionally, the third rich text data sequence includes at least two pieces of rich text data arranged in a row, and the segmenting the third rich text data sequence according to a preset policy to obtain the first rich text data sequence includes:
segmenting target data in the third rich text data sequence to obtain a fourth rich text data sequence, wherein any piece of rich text data in the fourth rich text data sequence comprises one type of data; the target data is data comprising at least two data types, wherein the data types at least comprise: text data, audio data, video data, image data, table data, and rich text protocol data;
setting a text type label for each piece of rich text data in the fourth rich text data sequence to obtain the first rich text data sequence;
the performing target processing on the first rich text data sequence to obtain a processed target rich text comprises:
and respectively carrying out the target processing on the rich text data of different data types in the first rich text data sequence based on the text type label to obtain a processed target rich text.
Wherein, the three rich text data sequences comprise at least two rich text data arranged in a row: it may be referred to that the at least two arranged rich text data are arranged line by line. Since at least two types of data may be included in one line of rich text data, for example, text data and picture data may be included at the same time, and different processing may be required for different types of rich text data in performing the target processing. Based on this, in the embodiment of the present disclosure, target data including at least two data types is segmented, so that any line of rich text data in the fourth rich text data sequence after segmentation includes only one data type. Therefore, different processing operations can be respectively performed on different types of rich text data in the target processing process.
Setting a text type tag for each piece of rich text data in the fourth rich text data sequence, specifically determining a corresponding tag according to the data type of the rich text data, for example, when the data type of the rich text data is text data, setting a "text" tag for the rich text data; when the data type of the rich text data is picture data, an 'image' label can be set for the picture data; when the data type of the rich text data is video data, a "video" tag or the like may be set thereto.
In this way, in the process of performing the target processing on the first rich text data sequence, the text type tag of each line of rich text data may be identified first to determine the data type of the line of rich text data, and different data processing means may be respectively adopted to respectively process different types of data, for example, a service for converting a table into a picture is invoked for data of a table type to process, and a downloading tool is invoked for data of a video type to download video content to the CDN of the target platform itself based on a video address.
In this embodiment, the third rich text data sequence is divided, and text type labels are respectively set for the divided rich text data, so that different types of data can be respectively processed by different data processing means.
Optionally, the performing target processing on the first rich text data sequence to obtain a processed target rich text includes:
performing the target processing on the first rich text data sequence to obtain a target rich text data sequence;
and splicing the target rich text data sequence according to a rich text splicing protocol of the target platform to obtain the target rich text.
In this embodiment, the initial rich text is converted into the first rich text data sequence, which is beneficial for a service processing end to perform target processing on the rich text, and after the target processing is completed to obtain the target rich text data sequence, the target rich text data sequence is spliced according to a rich text splicing protocol of the target platform to obtain the target rich text, so that the target platform can directly display the target rich text conveniently.
Referring to fig. 2, a schematic structural diagram of a text processing apparatus 200 according to an embodiment of the present disclosure is shown, where the text processing apparatus 200 includes:
a first obtaining module 201, configured to obtain a first rich text data sequence, where the first rich text data sequence includes an initial storage address of the multimedia content;
a downloading module 202, configured to download the multimedia content to a content delivery network CDN of a target platform based on the initial storage address;
a processing module 203, configured to perform target processing on the first rich text data sequence to obtain a processed target rich text, where the target processing at least includes: updating the initial storage address in the first text-rich data sequence to be a target address, where the target address is a storage address of the multimedia content in the CDN.
Optionally, in a case that the first rich text data sequence further includes a table, the target process further includes:
converting the table into a picture format to obtain a first picture;
and displaying the first picture in the target rich text according to a preset image display protocol.
Optionally, in a case that the first rich-text data sequence further includes a rich-text protocol, the target process further includes:
under the condition that a conversion rule of the rich text protocol is obtained, converting the rich text protocol into a target protocol corresponding to the target platform based on the conversion rule;
updating the rich-text protocol in the first rich-text data sequence to the target protocol;
wherein the rich text protocol is used to present a target application or target multimedia content.
Optionally, the target processing further includes:
deleting the rich text protocol in the first rich text data sequence if the conversion rule of the rich text protocol is not acquired.
Optionally, the apparatus further comprises:
the second acquisition module is used for acquiring the initial rich text;
the analysis module is used for analyzing the initial rich text into a Document Object Model (DOM) object;
the deleting module is used for deleting the preset format information of the text in the DOM object to obtain a second rich text data sequence;
a generating module for generating the first rich text data sequence based on the second rich text data sequence.
Optionally, the generating module includes:
the third conversion submodule is used for converting the second rich text data sequence into a JS object numbered musical notation format to obtain a converted third rich text data sequence;
and the segmentation submodule is used for segmenting the third rich text data sequence according to a preset strategy to obtain the first rich text data sequence.
Optionally, the third rich text data sequence includes at least two pieces of rich text data arranged in an array, and the segmentation sub-module includes:
a dividing unit, configured to divide target data in the third rich text data sequence to obtain a fourth rich text data sequence, where any piece of rich text data in the fourth rich text data sequence includes data of one type; the target data is data comprising at least two data types, wherein the data types at least comprise: text data, audio data, video data, image data, table data, and rich text protocol data;
a tag setting unit, configured to set a text type tag for each piece of rich text data in the fourth rich text data sequence, so as to obtain the first rich text data sequence;
the processing module 203 is configured to perform the target processing on the rich text data of different data types in the first rich text data sequence based on the text type tag, respectively, to obtain a processed target rich text.
Optionally, the processing module 203 includes:
the processing sub-module is used for carrying out the target processing on the first rich text data sequence to obtain a target rich text data sequence;
and the splicing submodule is used for splicing the target rich text data sequence according to the rich text splicing protocol of the target platform to obtain the target rich text.
It should be noted that the text processing apparatus 200 provided in this embodiment can implement all technical solutions of the foregoing text processing method embodiments, so that at least all technical effects can be achieved, and details are not described here.
In the technical scheme of the disclosure, the acquisition, storage, application and the like of the personal information of the related user all accord with the regulations of related laws and regulations, and do not violate the good customs of the public order.
The present disclosure also provides an electronic device, a readable storage medium, and a computer program product according to embodiments of the present disclosure.
FIG. 3 illustrates a schematic block diagram of an example electronic device 300 that can be used to implement embodiments of the present disclosure. Electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be examples only, and are not meant to limit implementations of the disclosure described and/or claimed herein.
As shown in fig. 3, the electronic device 300 includes a computing unit 301 that can perform various appropriate actions and processes according to a computer program stored in a Read Only Memory (ROM)302 or a computer program loaded from a storage unit 308 into a Random Access Memory (RAM) 303. In the RAM 303, various programs and data required for the operation of the device 300 can also be stored. The calculation unit 301, the ROM 302, and the RAM 303 are connected to each other via a bus 304. An input/output (I/O) interface 305 is also connected to bus 304.
A number of components in the electronic device 300 are connected to the I/O interface 305, including: an input unit 306 such as a keyboard, a mouse, or the like; an output unit 307 such as various types of displays, speakers, and the like; a storage unit 308 such as a magnetic disk, optical disk, or the like; and a communication unit 309 such as a network card, modem, wireless communication transceiver, etc. The communication unit 309 allows the device 300 to exchange information/data with other devices via a computer network such as the internet and/or various telecommunication networks.
The computing unit 301 may be a variety of general and/or special purpose processing components having processing and computing capabilities. Some examples of the computing unit 301 include, but are not limited to, a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), various dedicated Artificial Intelligence (AI) computing chips, various computing units running machine learning model algorithms, a Digital Signal Processor (DSP), and any suitable processor, controller, microcontroller, and so forth. The calculation unit 301 executes the respective methods and processes described above, such as a text processing method. For example, in some embodiments, the text processing method may be implemented as a computer software program tangibly embodied in a machine-readable medium, such as storage unit 308. In some embodiments, part or all of the computer program may be loaded and/or installed onto device 300 via ROM 302 and/or communication unit 309. When the computer program is loaded into the RAM 303 and executed by the computing unit 301, one or more steps of the text processing method described above are performed. Alternatively, in other embodiments, the computing unit 301 may be configured to perform the text processing method in any other suitable manner (e.g., by means of firmware).
Various implementations of the systems and techniques described here above may be implemented in digital electronic circuitry, integrated circuitry, Field Programmable Gate Arrays (FPGAs), Application Specific Integrated Circuits (ASICs), Application Specific Standard Products (ASSPs), system on a chip (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs that are executable and/or interpretable on a programmable system including at least one programmable processor, which may be special or general purpose, receiving data and instructions from, and transmitting data and instructions to, a storage system, at least one input device, and at least one output device.
Program code for implementing the methods of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general purpose computer, special purpose computer, or other programmable data processing apparatus, such that the program codes, when executed by the processor or controller, cause the functions/operations specified in the flowchart and/or block diagram to be performed. The program code may execute entirely on the machine, partly on the machine, as a stand-alone software package partly on the machine and partly on a remote machine or entirely on the remote machine or server.
In the context of this disclosure, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
To provide for interaction with a user, the systems and techniques described here can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and a pointing device (e.g., a mouse or a trackball) by which a user can provide input to the computer. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form, including acoustic, speech, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a back-end component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such back-end, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), Wide Area Networks (WANs), and the Internet.
The computer system may include clients and servers. A client and server are generally remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. The server may be a cloud server, a server of a distributed system, or a server with a combined blockchain.
It should be understood that various forms of the flows shown above may be used, with steps reordered, added, or deleted. For example, the steps described in the present disclosure may be executed in parallel or sequentially or in different orders, and are not limited herein as long as the desired results of the technical solutions disclosed in the present disclosure can be achieved.
The above detailed description should not be construed as limiting the scope of the disclosure. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may be made in accordance with design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present disclosure should be included in the scope of protection of the present disclosure.
Claims (19)
1. A text processing method, comprising:
acquiring a first rich text data sequence, wherein the first rich text data sequence comprises an initial storage address of multimedia content;
downloading the multimedia content to a Content Delivery Network (CDN) of a target platform based on the initial storage address;
performing target processing on the first rich text data sequence to obtain a processed target rich text, wherein the target processing at least comprises: updating the initial storage address in the first text-rich data sequence to be a target address, where the target address is a storage address of the multimedia content in the CDN.
2. The method of claim 1, wherein in the case where the first sequence of rich text data further comprises a table, the target process further comprises:
converting the table into a picture format to obtain a first picture;
and displaying the first picture in the target rich text according to a preset image display protocol.
3. The method of claim 1, wherein in the case that the first sequence of rich-text data further comprises a rich-text protocol, the target process further comprises:
under the condition that a conversion rule of the rich text protocol is obtained, converting the rich text protocol into a target protocol corresponding to the target platform based on the conversion rule;
updating the rich-text protocol in the first rich-text data sequence to the target protocol;
wherein the rich text protocol is used to present a target application or target multimedia content.
4. The method of claim 3, wherein the target process further comprises:
deleting the rich text protocol in the first rich text data sequence if the conversion rule of the rich text protocol is not acquired.
5. The method of claim 1, wherein prior to the obtaining the first sequence of rich text data, the method further comprises:
acquiring an initial rich text;
analyzing the initial rich text into a Document Object Model (DOM) object;
deleting preset format information of the text in the DOM object to obtain a second rich text data sequence;
generating the first sequence of rich text data based on a second sequence of rich text data.
6. The method of claim 5, wherein the generating the first sequence of rich text data based on the second sequence of rich text data comprises:
converting the second rich text data sequence into a JS object numbered musical notation format to obtain a converted third rich text data sequence;
and segmenting the third rich text data sequence according to a preset strategy to obtain the first rich text data sequence.
7. The method according to claim 6, wherein the third sequence of rich text data includes at least two pieces of rich text data arranged in an array, and the segmenting the third sequence of rich text data according to a preset strategy to obtain the first sequence of rich text data includes:
segmenting target data in the third rich text data sequence to obtain a fourth rich text data sequence, wherein any piece of rich text data in the fourth rich text data sequence comprises one type of data; the target data is data comprising at least two data types, wherein the data types at least comprise: text data, audio data, video data, image data, table data, and rich text protocol data;
setting a text type label for each piece of rich text data in the fourth rich text data sequence to obtain the first rich text data sequence;
the performing target processing on the first rich text data sequence to obtain a processed target rich text comprises:
and respectively performing the target processing on the rich text data of different data types in the first rich text data sequence based on the text type label to obtain a processed target rich text.
8. The method of claim 1, wherein the target processing the first rich text data sequence to obtain a processed target rich text comprises:
performing the target processing on the first rich text data sequence to obtain a target rich text data sequence;
and splicing the target rich text data sequence according to a rich text splicing protocol of the target platform to obtain the target rich text.
9. A text processing apparatus comprising:
the device comprises a first acquisition module, a second acquisition module and a third acquisition module, wherein the first acquisition module is used for acquiring a first rich text data sequence which comprises an initial storage address of the multimedia content;
the downloading module is used for downloading the multimedia content to a Content Delivery Network (CDN) of a target platform based on the initial storage address;
a processing module, configured to perform target processing on the first rich text data sequence to obtain a processed target rich text, where the target processing at least includes: updating the initial storage address in the first text-rich data sequence to be a target address, where the target address is a storage address of the multimedia content in the CDN.
10. The apparatus of claim 9, wherein in the case where the first sequence of rich text data further comprises a table, the target process further comprises:
converting the table into a picture format to obtain a first picture;
and displaying the first picture in the target rich text according to a preset image display protocol.
11. The apparatus of claim 9, wherein in the case that the first sequence of rich-text data further comprises a rich-text protocol, the target process further comprises:
under the condition that a conversion rule of the rich text protocol is obtained, converting the rich text protocol into a target protocol corresponding to the target platform based on the conversion rule;
updating the rich-text protocol in the first rich-text data sequence to the target protocol;
wherein the rich text protocol is used to present a target application or target multimedia content.
12. The apparatus of claim 11, wherein the target process further comprises:
deleting the rich text protocol in the first rich text data sequence if the conversion rule of the rich text protocol is not acquired.
13. The apparatus of claim 9, wherein the apparatus further comprises:
the second acquisition module is used for acquiring the initial rich text;
the analysis module is used for analyzing the initial rich text into a Document Object Model (DOM) object;
the deleting module is used for deleting the preset format information of the text in the DOM object to obtain a second rich text data sequence;
a generating module for generating the first rich text data sequence based on the second rich text data sequence.
14. The apparatus of claim 13, wherein the generating means comprises:
the third conversion submodule is used for converting the second rich text data sequence into a JS object numbered musical notation format to obtain a converted third rich text data sequence;
and the segmentation submodule is used for segmenting the third rich text data sequence according to a preset strategy to obtain the first rich text data sequence.
15. The apparatus of claim 14, wherein the third sequence of rich text data comprises at least two pieces of rich text data arranged in a permutation, the segmentation sub-module comprising:
a dividing unit, configured to divide target data in the third rich text data sequence to obtain a fourth rich text data sequence, where any piece of rich text data in the fourth rich text data sequence includes data of one type; the target data is data comprising at least two data types, wherein the data types at least comprise: text data, audio data, video data, image data, table data, and rich text protocol data;
a tag setting unit, configured to set a text type tag for each piece of rich text data in the fourth rich text data sequence, so as to obtain the first rich text data sequence;
and the processing module is used for respectively carrying out the target processing on the rich text data of different data types in the first rich text data sequence based on the text type label to obtain a processed target rich text.
16. The apparatus of claim 9, wherein the processing module comprises:
the processing submodule is used for carrying out the target processing on the first rich text data sequence to obtain a target rich text data sequence;
and the splicing submodule is used for splicing the target rich text data sequence according to the rich text splicing protocol of the target platform to obtain the target rich text.
17. An electronic device, comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein,
the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-8.
18. A non-transitory computer readable storage medium having stored thereon computer instructions for causing the computer to perform the method of any one of claims 1-8.
19. A computer program product comprising a computer program which, when executed by a processor, implements the method of any one of claims 1-8.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210062431.5A CN114500505B (en) | 2022-01-19 | 2022-01-19 | Text processing method and device and electronic equipment |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210062431.5A CN114500505B (en) | 2022-01-19 | 2022-01-19 | Text processing method and device and electronic equipment |
Publications (2)
Publication Number | Publication Date |
---|---|
CN114500505A true CN114500505A (en) | 2022-05-13 |
CN114500505B CN114500505B (en) | 2024-05-28 |
Family
ID=81471753
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202210062431.5A Active CN114500505B (en) | 2022-01-19 | 2022-01-19 | Text processing method and device and electronic equipment |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN114500505B (en) |
Citations (12)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20140059140A1 (en) * | 2012-08-21 | 2014-02-27 | International Business Machines Corporation | Formatting rich text data into a json array |
CN106897251A (en) * | 2016-07-01 | 2017-06-27 | 阿里巴巴集团控股有限公司 | Rich text methods of exhibiting and device |
CN106911794A (en) * | 2017-03-23 | 2017-06-30 | 福建天泉教育科技有限公司 | The method and system that a kind of picture is stored automatically |
CN111274760A (en) * | 2020-01-09 | 2020-06-12 | 北京字节跳动网络技术有限公司 | Rich text data processing method and device, electronic equipment and computer storage medium |
CN111309312A (en) * | 2018-12-10 | 2020-06-19 | 阿里巴巴集团控股有限公司 | Editing method and device of rich text object, terminal equipment and computer storage medium |
US20200348866A1 (en) * | 2019-04-30 | 2020-11-05 | EMC IP Holding Company LLC | Method, device and computer program product for raid type conversion |
CN111931100A (en) * | 2020-06-22 | 2020-11-13 | 北京旷视科技有限公司 | Request processing system, method, device, electronic equipment and computer readable medium |
CN112395848A (en) * | 2020-11-18 | 2021-02-23 | 平安普惠企业管理有限公司 | Rich text display method and device, computer equipment and storage medium |
CN112748928A (en) * | 2020-12-30 | 2021-05-04 | 平安普惠企业管理有限公司 | Rich text data processing method and device, computer equipment and storage medium |
CN113179261A (en) * | 2021-04-25 | 2021-07-27 | 深圳市商汤科技有限公司 | Video stream processing method and device, storage medium and platform server |
CN113873318A (en) * | 2021-09-26 | 2021-12-31 | 乐融致新电子科技(天津)有限公司 | Video playing method, device, equipment and storage medium |
CN113887178A (en) * | 2021-10-11 | 2022-01-04 | 中国电信股份有限公司 | Picture watermarking processing method and device based on rich text editor |
-
2022
- 2022-01-19 CN CN202210062431.5A patent/CN114500505B/en active Active
Patent Citations (12)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20140059140A1 (en) * | 2012-08-21 | 2014-02-27 | International Business Machines Corporation | Formatting rich text data into a json array |
CN106897251A (en) * | 2016-07-01 | 2017-06-27 | 阿里巴巴集团控股有限公司 | Rich text methods of exhibiting and device |
CN106911794A (en) * | 2017-03-23 | 2017-06-30 | 福建天泉教育科技有限公司 | The method and system that a kind of picture is stored automatically |
CN111309312A (en) * | 2018-12-10 | 2020-06-19 | 阿里巴巴集团控股有限公司 | Editing method and device of rich text object, terminal equipment and computer storage medium |
US20200348866A1 (en) * | 2019-04-30 | 2020-11-05 | EMC IP Holding Company LLC | Method, device and computer program product for raid type conversion |
CN111274760A (en) * | 2020-01-09 | 2020-06-12 | 北京字节跳动网络技术有限公司 | Rich text data processing method and device, electronic equipment and computer storage medium |
CN111931100A (en) * | 2020-06-22 | 2020-11-13 | 北京旷视科技有限公司 | Request processing system, method, device, electronic equipment and computer readable medium |
CN112395848A (en) * | 2020-11-18 | 2021-02-23 | 平安普惠企业管理有限公司 | Rich text display method and device, computer equipment and storage medium |
CN112748928A (en) * | 2020-12-30 | 2021-05-04 | 平安普惠企业管理有限公司 | Rich text data processing method and device, computer equipment and storage medium |
CN113179261A (en) * | 2021-04-25 | 2021-07-27 | 深圳市商汤科技有限公司 | Video stream processing method and device, storage medium and platform server |
CN113873318A (en) * | 2021-09-26 | 2021-12-31 | 乐融致新电子科技(天津)有限公司 | Video playing method, device, equipment and storage medium |
CN113887178A (en) * | 2021-10-11 | 2022-01-04 | 中国电信股份有限公司 | Picture watermarking processing method and device based on rich text editor |
Non-Patent Citations (3)
Title |
---|
SHI LI; INSHIL DOH; KIJOON CHAE: "An anonymous IP-based privacy protection routing mechanism for CDNi", 《2016 INTERNATIONAL CONFERENCE ON INFORMATION NETWORKING (ICOIN)》, 10 March 2016 (2016-03-10) * |
朱斐;: "一种结合结构化信息的富文本分类方法", 计算机应用与软件, no. 06, 15 June 2008 (2008-06-15) * |
杨晓蓉,王文生: "多媒体数据的存储与检索技术", 农业网络信息, no. 11 * |
Also Published As
Publication number | Publication date |
---|---|
CN114500505B (en) | 2024-05-28 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109947512B (en) | Text adaptive display method, device, server and storage medium | |
US11758088B2 (en) | Method and apparatus for aligning paragraph and video | |
CN113031946B (en) | Method and device for rendering page component | |
CN111625308B (en) | Information display method and device and electronic equipment | |
CN111294395A (en) | Terminal page transmission method, device, medium and electronic equipment | |
CN109062560B (en) | Method and apparatus for generating information | |
CN109545333A (en) | The method and device that Dicom image shows, handles | |
CN113722124A (en) | Content processing method, device, equipment and storage medium of cloud mobile phone | |
CN111046252B (en) | Information processing method, device, medium, electronic equipment and system | |
CN112818656A (en) | Data difference comparison method, device, equipment, medium and computer program product | |
US12079575B2 (en) | Character display method and apparatus, electronic device, and computer-readable storage medium | |
CN113553123B (en) | Data processing method, device, electronic equipment and storage medium | |
CN113342450B (en) | Page processing method, device, electronic equipment and computer readable medium | |
CN112486482A (en) | Page display method and device | |
CN115495175A (en) | Picture display method and device, terminal equipment and computer medium | |
CN115731319A (en) | Graph drawing method, device, equipment and storage medium | |
CN116233041A (en) | Information processing method and device and electronic equipment | |
CN114500505B (en) | Text processing method and device and electronic equipment | |
CN113905040B (en) | File transmission method, device, system, equipment and storage medium | |
CN113296771B (en) | Page display method, device, equipment and computer readable medium | |
CN114546343A (en) | Generation method and device of activity page | |
CN113849164A (en) | Data processing method and device, electronic equipment and memory | |
CN114816382A (en) | Method and device for processing page | |
CN112861504A (en) | Text interaction method, device, equipment, storage medium and program product | |
CN112579080A (en) | Method and device for generating user interface code |
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 |