CN109962958B - Document processing method and device - Google Patents

Document processing method and device Download PDF

Info

Publication number
CN109962958B
CN109962958B CN201711431093.3A CN201711431093A CN109962958B CN 109962958 B CN109962958 B CN 109962958B CN 201711431093 A CN201711431093 A CN 201711431093A CN 109962958 B CN109962958 B CN 109962958B
Authority
CN
China
Prior art keywords
text document
rich text
document
decompressed
rich
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201711431093.3A
Other languages
Chinese (zh)
Other versions
CN109962958A (en
Inventor
王涛
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Alibaba China Co Ltd
Original Assignee
Alibaba China 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 Alibaba China Co Ltd filed Critical Alibaba China Co Ltd
Priority to CN201711431093.3A priority Critical patent/CN109962958B/en
Publication of CN109962958A publication Critical patent/CN109962958A/en
Application granted granted Critical
Publication of CN109962958B publication Critical patent/CN109962958B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/06Protocols specially adapted for file transfer, e.g. file transfer protocol [FTP]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/50Network services
    • H04L67/56Provisioning of proxy services
    • H04L67/565Conversion or adaptation of application format or content
    • H04L67/5651Reducing the amount or size of exchanged application data
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/04Protocols for data compression, e.g. ROHC

Abstract

The disclosure relates to a document processing method and device. The method comprises the following steps: acquiring a rich text document to be uploaded to a network platform, wherein the rich text document comprises characters and/or pictures; compressing the rich text document; and sending the compressed rich text document to a server of the network platform, and decompressing and storing the compressed rich text document by the server. The document processing method and the device provided by the embodiment of the disclosure compress the rich text document to be uploaded to the network platform and then send the compressed rich text document to the server of the network platform, so that the server decompresses and stores the compressed rich text document, the size of the uploaded rich text document can be expanded, the bandwidth is saved, and the waiting time of a user is reduced.

Description

Document processing method and device
Technical Field
The present disclosure relates to the field of computer technologies, and in particular, to a method and an apparatus for processing a document.
Background
With the continuous development of networks, users can issue contents such as characters, pictures and the like through various network platforms. In the related art, a user may edit a document in a Rich Text Format (RTE) through a Rich Text Editor (RTE), and upload the document to a network platform after the editing is finished. However, the user has a long time waiting for uploading the document, which is difficult to meet the user's requirement.
Disclosure of Invention
In view of this, the present disclosure provides a document processing method and apparatus, so as to solve the problem that a user has a long time to wait for uploading a document and is difficult to meet a user's requirement.
According to a first aspect of the present disclosure, a document processing method is provided, which is applied to a terminal device, and includes:
acquiring a rich text document to be uploaded to a network platform, wherein the rich text document comprises characters and/or pictures;
compressing the rich text document;
and sending the compressed rich text document to a server of the network platform, wherein the compressed rich text document is decompressed by the server and then stored.
For the above method, in one possible implementation, compressing the rich text document includes:
judging whether the rich text document meets an uploading condition;
and compressing the rich text document under the condition that the uploading condition is met.
For the above method, in one possible implementation, compressing the rich text document includes:
optimizing the content of the rich text document to obtain an optimized rich text document;
and compressing the optimized rich text document.
According to a second aspect of the present disclosure, there is provided another document processing method, applied to a server, including:
receiving a compressed rich text document uploaded by a terminal device, wherein the rich text document comprises characters and/or pictures;
decompressing the compressed rich text document to obtain a decompressed rich text document;
and saving the decompressed rich text document.
For the above method, in a possible implementation manner, the method further includes:
screening the decompressed rich text document;
and replacing the saved decompressed rich text document with the screened rich text document.
For the above method, in one possible implementation manner, screening the decompressed rich-text document includes:
dividing the decompressed rich text document into a plurality of queues;
and respectively screening the queues.
For the above method, in one possible implementation manner, screening the decompressed rich-text document includes:
screening specified characters in the decompressed rich text document based on a specified character library comprising the specified characters;
and shielding the specified characters in the decompressed rich text document.
For the above method, in a possible implementation manner, the method further includes:
acquiring the picture according to the picture source corresponding to the picture in the decompressed rich text document, and storing the acquired picture into a picture library corresponding to a server;
and replacing the picture source corresponding to the picture in the decompressed rich text document with the storage position of the picture in the picture library.
According to a third aspect of the present disclosure, there is provided a document processing apparatus comprising:
the system comprises a document acquisition module, a document processing module and a document processing module, wherein the document acquisition module is used for acquiring a rich text document to be uploaded to a network platform, and the rich text document comprises characters and/or pictures;
the document compression module compresses the rich text document;
and the document uploading module is used for sending the compressed rich text document to a server of the network platform, and the compressed rich text document is decompressed by the server and then is stored.
For the apparatus, in a possible implementation manner, the document compression module includes:
the judgment sub-module is used for judging whether the rich text document meets the uploading condition or not;
and the first compression sub-module compresses the rich text document under the condition that the uploading condition is met.
For the apparatus, in a possible implementation manner, the document compression module includes:
the optimization submodule is used for optimizing the content of the rich text document to obtain the optimized rich text document;
and the second compression submodule compresses the optimized rich text document.
According to a fourth aspect of the present disclosure, there is provided another document processing apparatus including: the document receiving module is used for receiving a compressed rich text document uploaded by the terminal equipment, wherein the rich text document comprises characters and/or pictures;
the decompression module is used for decompressing the compressed rich text document to obtain a decompressed rich text document;
and the document storage module stores the decompressed rich text document.
For the above apparatus, in a possible implementation manner, the method further includes:
the document screening module is used for screening the decompressed rich text document;
and the document replacing module is used for replacing the saved decompressed rich text document with the screened rich text document.
For the apparatus described above, in one possible implementation, the document screening module includes:
the queue dividing submodule is used for dividing the decompressed rich text document into a plurality of queues;
and the queue screening submodule is used for screening the plurality of queues respectively.
For the apparatus described above, in one possible implementation, the document screening module includes:
the character screening sub-module screens specified characters in the decompressed rich text document based on a specified character library comprising the specified characters;
and the character shielding submodule shields the appointed characters in the decompressed rich text document.
For the above apparatus, in a possible implementation manner, the method further includes:
the image acquisition module acquires the image according to the image source corresponding to the image in the decompressed rich text document and stores the acquired image into an image library corresponding to a server;
and the picture storage module is used for replacing the picture source corresponding to the picture in the decompressed rich text document with the storage position of the picture in the picture library.
According to a fifth aspect of the present disclosure, there is provided a document processing apparatus comprising: a processor; a memory for storing processor-executable instructions; wherein the processor is configured to perform the document processing method described above.
According to a sixth aspect of the present disclosure, there is provided a non-transitory computer readable storage medium having stored thereon computer program instructions, wherein the computer program instructions, when executed by a processor, implement the above-described document processing method.
According to a seventh aspect of the present disclosure, there is provided a document processing apparatus comprising: a processor; a memory for storing processor-executable instructions; wherein the processor is configured to perform the another document processing method described above.
According to an eighth aspect of the present disclosure, there is provided a non-transitory computer readable storage medium having stored thereon computer program instructions, wherein the computer program instructions, when executed by a processor, implement the above-mentioned another document processing method.
The document processing method and the device provided by the embodiment of the disclosure compress the rich text document to be uploaded to the network platform and then send the compressed rich text document to the server of the network platform, so that the server decompresses and stores the compressed rich text document, the size of the uploaded rich text document can be expanded, the bandwidth is saved, and the waiting time of a user is reduced.
Other features and aspects of the present disclosure will become apparent from the following detailed description of exemplary embodiments, which proceeds with reference to the accompanying drawings.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate exemplary embodiments, features, and aspects of the disclosure and, together with the description, serve to explain the principles of the disclosure.
FIG. 1 shows a flow diagram of a document processing method according to an embodiment of the present disclosure;
FIG. 2 shows a flowchart of step S12 in a document processing method according to one embodiment of the present disclosure;
FIG. 3 shows a flowchart of step S12 in a document processing method according to an embodiment of the present disclosure;
FIG. 4 illustrates a flow diagram of a document processing method according to an embodiment of the present disclosure;
FIG. 5 illustrates a flow diagram of a document processing method according to an embodiment of the present disclosure;
FIG. 6 shows a flowchart of step S24 in a document processing method according to an embodiment of the present disclosure;
FIG. 7 shows a flowchart of step S24 in a document processing method according to an embodiment of the present disclosure;
FIG. 8 shows a flow diagram of a document processing method according to an embodiment of the present disclosure;
FIG. 9 is a diagram illustrating an application scenario of a document processing method according to an embodiment of the present disclosure;
FIG. 10 shows a block diagram of a document processing device according to an embodiment of the present disclosure;
FIG. 11 shows a block diagram of a document processing device according to an embodiment of the present disclosure;
FIG. 12 shows a block diagram of a document processing device according to an embodiment of the present disclosure;
FIG. 13 shows a block diagram of a document processing device according to an embodiment of the present disclosure;
FIG. 14 shows a block diagram of a document processing device according to an embodiment of the present disclosure;
FIG. 15 shows a block diagram of a document processing device according to an embodiment of the present disclosure.
Detailed Description
Various exemplary embodiments, features and aspects of the present disclosure will be described in detail below with reference to the accompanying drawings. In the drawings, like reference numbers can indicate functionally identical or similar elements. While the various aspects of the embodiments are presented in drawings, the drawings are not necessarily drawn to scale unless specifically indicated.
The word "exemplary" is used exclusively herein to mean "serving as an example, embodiment, or illustration. Any embodiment described herein as "exemplary" is not necessarily to be construed as preferred or advantageous over other embodiments.
Furthermore, in the following detailed description, numerous specific details are set forth in order to provide a better understanding of the present disclosure. It will be understood by those skilled in the art that the present disclosure may be practiced without some of these specific details. In some instances, methods, means, elements and circuits that are well known to those skilled in the art have not been described in detail so as not to obscure the present disclosure.
FIG. 1 shows a flow diagram of a document processing method according to an embodiment of the present disclosure. As shown in fig. 1, the method can be applied to terminal devices such as mobile phones, tablet computers, and the like. The document processing method may include steps S11 through S13.
In step S11, a rich text document to be uploaded to the network platform is obtained, and the rich text document may include words and/or pictures.
In this embodiment, a user may be provided with an entry for editing a rich text document uploaded to the network platform, for example, a rich text document editing window. Enabling a user to edit the rich text document in the provided rich text document editing window via the rich text editor.
In step S12, the rich text document is compressed.
In this embodiment, rich text documents may be compressed by compression means such as LZMA (Lempel-Ziv-Markov chain-Algorithm), gzip (GNUzip), and the like. The compression mode of compressing the rich text document can be set by those skilled in the art according to actual needs, and the disclosure does not limit this. The compressed rich text document is uploaded to a server of a network platform, so that the bandwidth can be saved, and the time for a user to wait for uploading is reduced. And because the rich text document is uploaded after being compressed, the size of the rich text document to be uploaded can be expanded, and the character length of the rich text document can be increased.
In step S13, the compressed rich text document is sent to the server of the network platform, and the compressed rich text document is decompressed and stored by the server.
In this embodiment, an upload success prompt may also be generated and sent according to a save success signal sent by the server of the network platform after the decompressed rich text document is successfully saved, so that the user determines that the rich text document has been successfully uploaded. The uploading success prompt can be sent in the form of voice, text, picture, etc., and the disclosure does not limit this.
In this embodiment, according to an instruction operation performed by the user on the terminal device, the decompressed rich-text document may be saved as a draft so as to be modified by the user. The decompressed rich-text document may also be published to enable other users to view the decompressed rich-text document based on a network platform, which is not limited by this disclosure.
The document processing method provided by the embodiment of the disclosure compresses the rich text document to be uploaded to the network platform and then sends the compressed rich text document to the server of the network platform, so that the server decompresses and stores the compressed rich text document, the size of the uploaded rich text document can be expanded, the bandwidth is saved, and the waiting time of a user is reduced.
Fig. 2 shows a flowchart of step S12 in the document processing method according to an embodiment of the present disclosure.
In one possible implementation, as shown in fig. 2, step S12 may include step S121 and step S122.
In step S121, it is determined whether the rich text document satisfies the upload condition.
In this implementation manner, whether the rich text document meets the uploading condition may be determined according to information related to the rich text document, such as the length of characters in the rich text document, the number of pictures, and the size and the dimension of the pictures. The upload conditions may include the length of characters in the rich-text document being less than or equal to a length threshold, the number of pictures in the rich-text document being less than or equal to a number threshold, and so on. The length threshold and the number threshold can be set by those skilled in the art according to practical needs, and the disclosure does not limit this.
In step S122, in the case where the upload condition is satisfied, the rich text document is compressed.
In the implementation mode, when the rich text document does not meet the uploading condition, an uploading failure prompt can be sent, the uploading failure prompt can include reasons of uploading failure and suggested solutions of uploading failure problems, and the like, so that a user can perform corresponding processing according to the uploading failure prompt.
Therefore, the transmission speed of the uploaded compressed rich text document can be improved, and the waiting time of a user is reduced.
Fig. 3 shows a flowchart of step S12 in the document processing method according to an embodiment of the present disclosure.
In one possible implementation, as shown in fig. 3, step S12 may include step S123 and step S124.
In step S123, the content of the rich text document is optimized to obtain an optimized rich text document.
In this implementation, the optimization of the rich text document may include optimizing an HTML (HyperText Markup Language) tag in the rich text document, for example, an HTML tag that deletes copied content to reduce the size of the rich text document. Optimization may also include deleting external links and iframes (iframes are HTML tags that act as documents in a document, or FRAMEs that Float (FRAME) that are not in the white list in a rich text document. The optimization process may also include deleting JavaScript code in the rich text document to prevent Cross Site Scripting (XSS) security injection. The optimization process can be set by those skilled in the art according to actual needs, and the disclosure does not limit this.
In step S124, the optimized rich text document is compressed.
Therefore, the compression ratio of the rich text document can be improved, the bandwidth of the compressed rich text document is saved, and the waiting time of a user is reduced.
It should be noted that, although the document processing method is described above by taking the above-described embodiment as an example, those skilled in the art will understand that the present disclosure should not be limited thereto. In fact, the user can flexibly set each step according to personal preference and/or actual application scene, as long as the technical scheme of the disclosure is met.
FIG. 4 shows a flow diagram of a document processing method according to an embodiment of the present disclosure. As shown in fig. 4, the method may be applied to a server belonging to a network platform where users upload rich text documents. The document processing method may include steps S21 through S23.
In step S21, a compressed rich text document uploaded by the terminal device is received, and the rich text document may include words and/or pictures.
In this embodiment, the compressed rich text document may be sent by a terminal device such as a mobile phone or a tablet computer. The terminal equipment can acquire the rich text document to be uploaded to the network platform, which is input by the user, then compress the rich text document, and upload the acquired compressed rich text document to the server.
In step S22, the compressed rich-text document is decompressed to obtain a decompressed rich-text document.
In the present embodiment, the compressed rich-text document is decompressed according to the decompression manner corresponding to the received compressed rich-text document. The decompression mode can be set by those skilled in the art according to actual needs, and the present disclosure does not limit this.
In step S23, the decompressed rich-text document is saved.
In this embodiment, after the decompressed rich-text document is successfully saved, a save success signal may also be sent to the terminal device, so that the terminal device determines that the compressed rich-text document has been successfully uploaded, which is not limited by this disclosure.
In this embodiment, the saved decompressed rich text document may be stored as a draft according to an instruction sent by the user through the terminal device for the decompressed rich text document, so that the user may modify it subsequently. The decompressed rich text document can be published through the network platform according to the instruction, so that other users can view the document through the network platform.
The document processing method provided by the embodiment of the disclosure decompresses the received compressed rich text document, and stores the decompressed rich text document. The size of the rich text document to be uploaded is expanded, the bandwidth is saved, and the waiting time of a user is reduced.
FIG. 5 shows a flow diagram of a document processing method according to an embodiment of the present disclosure. As shown in fig. 5, the method may further include step S24 and step S25.
In step S24, the decompressed rich text document is screened.
In this embodiment, the screening of the decompressed rich-text document may include text screening and picture screening. The image screening includes screening the decompressed rich text document based on the relevant network specifications, and performing corresponding processing on the images that do not meet the relevant network specifications, for example, deleting, blurring, and the like on the decompressed rich text document. The word screening includes screening words in the decompressed rich text document based on the relevant network expression specification, and performing corresponding processing on words which do not conform to the network expression specification, for example, deleting non-standard or non-civilized words in the decompressed rich text document. It should be understood that the screening of the decompressed rich-text document can be set by those skilled in the art according to actual needs, and the disclosure is not limited thereto.
In step S25, the saved decompressed rich text document is replaced with the screened rich text document.
Therefore, the screened rich text document is stored, so that the rich text document can be conveniently checked by a user, a healthy network environment can be created, screening and replacement are performed after storage, and the time for the user to wait for the server to screen the decompressed rich text document is saved. The decompressed rich text document can be screened before being stored, so that the screened rich text document can be directly stored, and the processing process of the server is simplified.
Fig. 6 shows a flowchart of step S24 in the document processing method according to an embodiment of the present disclosure.
In one possible implementation, as shown in fig. 6, step S24 may include step S241 and step S242.
In step S241, the decompressed rich-text document is divided into a plurality of queues.
In this implementation, the decompressed rich text document may be divided into a plurality of queues according to its size, content, and the like, so as to screen the decompressed rich text document by queue. The queues can be set by those skilled in the art according to actual needs, and the present disclosure is not limited thereto.
In step S242, the plurality of queues are screened respectively.
In this implementation, multiple queues may be screened in an asynchronous manner. Therefore, the screening speed can be improved, and the screening time can be saved.
Fig. 7 shows a flowchart of step S24 in the document processing method according to an embodiment of the present disclosure.
In one possible implementation, as shown in fig. 7, step S24 may include step S243 and step S244.
In step S243, the decompressed rich text document is screened for the specified words based on the specified word library including the specified words.
In this implementation, the specified words in the specified word library may be set according to a network expression specification or the like, for example, the non-civilized words are set as the specified words. The person skilled in the art can set the specified characters in the specified character library according to actual needs, and the disclosure does not limit this.
In step S244, the specified words in the decompressed rich-text document are masked.
In this implementation manner, the specified characters in the decompressed rich text document may also be subjected to blurring, substitution, and the like, which is not limited by this disclosure.
FIG. 8 shows a flow diagram of a document processing method according to an embodiment of the present disclosure. As shown in fig. 8, the method may further include steps S26 and S27, and the picture saving process is performed on the decompressed rich-text document.
In step S26, a picture is obtained according to the picture source corresponding to the picture in the decompressed rich text document, and the obtained picture is stored in the picture library corresponding to the server.
In this embodiment, in the case that the decompressed rich-text document includes a picture, since the picture source of the picture may be an external link unrelated to the network platform, after the picture source is deleted or masked, the user cannot view the picture in the saved decompressed rich-text document through the network platform. Therefore, the decompressed rich text document is subjected to picture storage processing, a picture source of a picture in the decompressed rich text document is determined, the picture is obtained according to the picture source, and the obtained picture is stored in a picture library corresponding to the server to be used as a picture resource of the network platform.
In step S27, the picture source corresponding to the picture in the decompressed rich text document is replaced with the storage location of the picture in the picture library.
In this embodiment, after the picture is saved in the picture library, the decompressed rich text document is modified, and the picture source corresponding to the picture therein is replaced with the storage location of the picture in the picture library, so that the user can view the picture through the network platform based on the storage location of the picture in the picture library, and the influence of deletion or shielding of the picture source of the picture in the decompressed rich text document is avoided.
It should be noted that, although the document processing method is described above by taking the above-described embodiment as an example, those skilled in the art will understand that the present disclosure should not be limited thereto. In fact, the user can flexibly set each step according to personal preference and/or actual application scene, as long as the technical scheme of the disclosure is met.
Application example
An application example according to the embodiment of the present disclosure is given below in conjunction with "user uploads rich text document a" as an exemplary application scenario to facilitate understanding of the flow of the document processing method. It is to be understood by those skilled in the art that the following application examples are for the purpose of facilitating understanding of the embodiments of the present disclosure only and are not to be construed as limiting the embodiments of the present disclosure.
Fig. 9 illustrates a schematic diagram of an application scenario of a document processing method according to an embodiment of the present disclosure. As shown in fig. 9, uploading of the rich text document a by the user needs to be completed through cooperation of the terminal device and the server of the network platform.
In the terminal device 1: the terminal device 1 acquires the rich text document a input by the user, and judges whether the rich text document a satisfies the uploading condition. And under the condition of meeting the uploading condition, optimizing the rich text document A to obtain an optimized rich text document A-1. And compressing the optimized rich text document A-1 based on an lzma or gzip compression algorithm and the like to obtain a compressed rich text document A-2. And uploading the compressed rich text document A-2 to a server 2 of the network platform.
In the server 2: and after receiving the compressed rich text document A-2, the server 2 decompresses the compressed rich text document A-2 to obtain a decompressed rich text document A-3, and then stores the decompressed rich text document A-3. And then, character screening and picture screening are carried out on the decompressed rich text document A-3 to obtain a screened rich text document A-4, then picture preservation processing is carried out on the screened rich text document A-4, and the stored decompressed rich text document A-3 is replaced by the screened rich text document A-4 which is subjected to picture preservation processing.
Therefore, the size of the uploaded rich text document can be expanded, the bandwidth is saved, and the waiting time of a user is reduced.
FIG. 10 shows a block diagram of a document processing device according to an embodiment of the present disclosure. As shown in fig. 10, the apparatus may be applied to a terminal device, and may include a document acquisition module 51, a document compression module 52, and a document upload module 53. The document acquisition module 51 is configured to acquire a rich text document to be uploaded to a network platform, the rich text document including words and/or pictures. The document compression module 52 is configured to compress rich text documents. The document uploading module 53 is configured to send the compressed rich text document to the server of the network platform, and the compressed rich text document is decompressed and stored by the server.
FIG. 11 shows a block diagram of a document processing device according to an embodiment of the present disclosure.
In one possible implementation, as shown in FIG. 11, the document compression module 52 may include a determination submodule 521 and a first compression submodule 522. The determination submodule 521 is configured to determine whether the rich text document satisfies the upload condition. The first compression submodule 522 is configured to compress the rich text document if the upload condition is satisfied.
In one possible implementation, as shown in FIG. 11, the document compression module 52 may include an optimization submodule 523 and a second compression submodule 524. The optimization submodule 523 is configured to perform optimization processing on the content of the rich text document to obtain an optimized rich text document. The second compression submodule 524 is configured to compress the optimized rich text document.
It should be noted that, although the document processing apparatus is described above by taking the above-described embodiment as an example, those skilled in the art will understand that the present disclosure should not be limited thereto. In fact, the user can flexibly set each module according to personal preference and/or actual application scene, as long as the technical scheme of the disclosure is met.
The document processing device provided by the embodiment of the disclosure compresses the rich text document to be uploaded to the network platform and then sends the compressed rich text document to the server of the network platform, so that the server decompresses and stores the compressed rich text document, the size of the uploaded rich text document can be expanded, the bandwidth is saved, and the waiting time of a user is reduced.
FIG. 12 shows a block diagram of a document processing device according to an embodiment of the present disclosure. As shown in fig. 12, the apparatus may be applied to a server. The apparatus may include a document receiving module 61, a decompression module 62, and a document saving module 63. The document receiving module 61 is configured to receive a compressed rich text document uploaded by a terminal device, and the rich text document may include words and/or pictures. The decompression module 62 is configured to decompress the compressed rich-text document to obtain a decompressed rich-text document. The document saving module 63 is configured to save the decompressed rich-text document.
FIG. 13 shows a block diagram of a document processing device according to an embodiment of the present disclosure.
In one possible implementation, as shown in FIG. 13, the apparatus may also include a document screening module 64 and a document replacement module 65. The document screening module 64 is configured to screen the decompressed rich text document. The document replacement module 65 is configured to replace the saved decompressed rich text document with the screened rich text document.
In one possible implementation, as shown in FIG. 13, document screening module 64 may include a queue partitioning sub-module 641 and a queue screening sub-module 642. The queue partition submodule 641 is configured to partition the decompressed rich text document into a plurality of queues. The queue screening sub-module 642 is configured to screen a plurality of queues, respectively.
In one possible implementation, as shown in FIG. 13, document screening module 64 may include a text screening sub-module 643 and a text masking sub-module 644. The word screening sub-module 643 is configured to screen the decompressed rich text document for specified words based on a specified word library that includes the specified words. The word masking submodule 644 is configured to mask specified words in the decompressed rich text document.
In one possible implementation, as shown in fig. 13, the apparatus may further include a picture taking module 66 and a picture saving module 67. The picture obtaining module 66 is configured to obtain the picture according to the picture source corresponding to the picture in the decompressed rich text document, and store the obtained picture in the picture library corresponding to the server. The picture saving module 67 is configured to replace the picture source corresponding to the picture in the decompressed rich text document with the storage location of the picture in the picture library.
It should be noted that, although the document processing apparatus is described above by taking the above-described embodiment as an example, those skilled in the art will understand that the present disclosure should not be limited thereto. In fact, the user can flexibly set each module according to personal preference and/or actual application scene, as long as the technical scheme of the disclosure is met.
Another document processing apparatus provided in the embodiment of the present disclosure decompresses a received compressed rich text document, and stores the decompressed rich text document. The size of the rich text document to be uploaded is expanded, the bandwidth is saved, and the waiting time of a user is reduced.
FIG. 14 shows a block diagram of a document processing device according to an embodiment of the present disclosure. For example, the apparatus 800 may be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, an exercise device, a personal digital assistant, and the like.
Referring to fig. 14, the apparatus 800 may include one or more of the following components: processing component 802, memory 804, power component 806, multimedia component 808, audio component 810, input/output (I/O) interface 812, sensor component 814, and communication component 816.
The processing component 802 generally controls overall operation of the device 800, such as operations associated with display, telephone calls, data communications, camera operations, and recording operations. The processing components 802 may include one or more processors 820 to execute instructions to perform all or a portion of the steps of the methods described above. Further, the processing component 802 can include one or more modules that facilitate interaction between the processing component 802 and other components. For example, the processing component 802 can include a multimedia module to facilitate interaction between the multimedia component 808 and the processing component 802.
The memory 804 is configured to store various types of data to support operations at the apparatus 800. Examples of such data include instructions for any application or method operating on device 800, contact data, phonebook data, messages, pictures, videos, and so forth. The memory 804 may be implemented by any type or combination of volatile or non-volatile memory devices such as Static Random Access Memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic or optical disks.
Power components 806 provide power to the various components of device 800. The power components 806 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for the apparatus 800.
The multimedia component 808 includes a screen that provides an output interface between the device 800 and a user. In some embodiments, the screen may include a Liquid Crystal Display (LCD) and a Touch Panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive an input signal from a user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundary of a touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 808 includes a front facing camera and/or a rear facing camera. The front camera and/or the rear camera may receive external multimedia data when the device 800 is in an operating mode, such as a shooting mode or a video mode. Each front camera and rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.
The audio component 810 is configured to output and/or input audio signals. For example, the audio component 810 includes a Microphone (MIC) configured to receive external audio signals when the apparatus 800 is in an operational mode, such as a call mode, a recording mode, and a voice recognition mode. The received audio signals may further be stored in the memory 804 or transmitted via the communication component 816. In some embodiments, audio component 810 also includes a speaker for outputting audio signals.
The I/O interface 812 provides an interface between the processing component 802 and peripheral interface modules, which may be keyboards, click wheels, buttons, etc. These buttons may include, but are not limited to: a home button, a volume button, a start button, and a lock button.
The sensor assembly 814 includes one or more sensors for providing various aspects of state assessment for the device 800. For example, the sensor assembly 814 may detect the open/closed status of the device 800, the relative positioning of components, such as a display and keypad of the device 800, the sensor assembly 814 may also detect a change in the position of the device 800 or a component of the device 800, the presence or absence of user contact with the device 800, the orientation or acceleration/deceleration of the device 800, and a change in the temperature of the device 800. Sensor assembly 814 may include a proximity sensor configured to detect the presence of a nearby object without any physical contact. The sensor assembly 814 may also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, the sensor assembly 814 may also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
The communication component 816 is configured to facilitate communications between the apparatus 800 and other devices in a wired or wireless manner. The device 800 may access a wireless network based on a communication standard, such as WiFi, 2G or 3G, or a combination thereof. In an exemplary embodiment, the communication component 816 receives a broadcast signal or broadcast related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 816 further includes a Near Field Communication (NFC) module to facilitate short-range communications. For example, the NFC module may be implemented based on Radio Frequency Identification (RFID) technology, infrared data association (IrDA) technology, Ultra Wideband (UWB) technology, Bluetooth (BT) technology, and other technologies.
In an exemplary embodiment, the apparatus 800 may be implemented by one or more Application Specific Integrated Circuits (ASICs), Digital Signal Processors (DSPs), Digital Signal Processing Devices (DSPDs), Programmable Logic Devices (PLDs), Field Programmable Gate Arrays (FPGAs), controllers, micro-controllers, microprocessors or other electronic components for performing the above-described methods.
In an exemplary embodiment, a non-transitory computer-readable storage medium, such as the memory 804, is also provided that includes computer program instructions executable by the processor 820 of the device 800 to perform the above-described methods.
FIG. 15 shows a block diagram of a document processing device according to an embodiment of the present disclosure. For example, the apparatus 1900 may be provided as a server. Referring to FIG. 15, the device 1900 includes a processing component 1922 further including one or more processors and memory resources, represented by memory 1932, for storing instructions, e.g., applications, executable by the processing component 1922. The application programs stored in memory 1932 may include one or more modules that each correspond to a set of instructions. Further, the processing component 1922 is configured to execute instructions to perform the above-described method.
The device 1900 may also include a power component 1926 configured to perform power management of the device 1900, a wired or wireless network interface 1950 configured to connect the device 1900 to a network, and an input/output (I/O) interface 1958. The device 1900 may operate based on an operating system stored in memory 1932, such as Windows Server, Mac OS XTM, UnixTM, LinuxTM, FreeBSDTM, or the like.
In an exemplary embodiment, a non-transitory computer readable storage medium, such as the memory 1932, is also provided that includes computer program instructions executable by the processing component 1922 of the apparatus 1900 to perform the above-described methods.
The present disclosure may be systems, methods, and/or computer program products. The computer program product may include a computer-readable storage medium having computer-readable program instructions embodied thereon for causing a processor to implement various aspects of the present disclosure.
The computer readable storage medium may be a tangible device that can hold and store the instructions for use by the instruction execution device. The computer readable storage medium may be, for example, but not limited to, an electronic memory device, a magnetic memory device, an optical memory device, an electromagnetic memory device, a semiconductor memory device, or any suitable combination of the foregoing. More specific examples (a non-exhaustive list) of the computer readable storage medium would include the following: 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), a Static Random Access Memory (SRAM), a portable compact disc read-only memory (CD-ROM), a Digital Versatile Disc (DVD), a memory stick, a floppy disk, a mechanical coding device, such as punch cards or in-groove projection structures having instructions stored thereon, and any suitable combination of the foregoing. Computer-readable storage media as used herein is not to be construed as transitory signals per se, such as radio waves or other freely propagating electromagnetic waves, electromagnetic waves propagating through a waveguide or other transmission medium (e.g., optical pulses through a fiber optic cable), or electrical signals transmitted through electrical wires.
The computer-readable program instructions described herein may be downloaded from a computer-readable storage medium to a respective computing/processing device, or to an external computer or external storage device via a network, such as the internet, a local area network, a wide area network, and/or a wireless network. The network may include copper transmission cables, fiber optic transmission, wireless transmission, routers, firewalls, switches, gateway computers and/or edge servers. The network adapter card or network interface in each computing/processing device receives computer-readable program instructions from the network and forwards the computer-readable program instructions for storage in a computer-readable storage medium in the respective computing/processing device.
The computer program instructions for carrying out operations of the present disclosure may be assembler instructions, Instruction Set Architecture (ISA) instructions, machine-related instructions, microcode, firmware instructions, state setting data, or source or object code written in any combination of one or more programming languages, including an object oriented programming language such as Smalltalk, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The computer-readable program instructions may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider). In some embodiments, the electronic circuitry that can execute the computer-readable program instructions implements aspects of the present disclosure by utilizing the state information of the computer-readable program instructions to personalize the electronic circuitry, such as a programmable logic circuit, a Field Programmable Gate Array (FPGA), or a Programmable Logic Array (PLA).
Various aspects of the present disclosure are described herein with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the disclosure. It will be understood that each block of the flowchart illustrations and/or block diagrams, and combinations of blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer-readable program instructions.
These computer-readable program instructions may be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions/acts specified in the flowchart and/or block diagram block or blocks. These computer-readable program instructions may also be stored in a computer-readable storage medium that can direct a computer, programmable data processing apparatus, and/or other devices to function in a particular manner, such that the computer-readable medium storing the instructions comprises an article of manufacture including instructions which implement the function/act specified in the flowchart and/or block diagram block or blocks.
The computer readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other devices to cause a series of operational steps to be performed on the computer, other programmable apparatus or other devices to produce a computer implemented process such that the instructions which execute on the computer, other programmable apparatus or other devices implement the functions/acts specified in the flowchart and/or block diagram block or blocks.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of instructions, which comprises one or more executable instructions for implementing the specified logical function(s). In some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
Having described embodiments of the present disclosure, the foregoing description is intended to be exemplary, not exhaustive, and not limited to the disclosed embodiments. Many modifications and variations will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described embodiments. The terms used herein were chosen in order to best explain the principles of the embodiments, the practical application, or technical improvements to the techniques in the marketplace, or to enable others of ordinary skill in the art to understand the embodiments disclosed herein.

Claims (18)

1. A document processing method is applied to a terminal device and comprises the following steps:
acquiring a rich text document to be uploaded to a network platform, wherein the rich text document comprises characters and/or pictures;
compressing the rich-text document, the compressing the rich-text document comprising: optimizing the content of the rich text document, wherein the optimizing includes optimizing an HTML tag in the rich text document and compressing the optimized rich text document;
and sending the compressed rich text document to a server of the network platform, wherein the compressed rich text document is decompressed by the server and then stored.
2. The method of claim 1, wherein compressing the rich text document comprises:
judging whether the rich text document meets an uploading condition;
and compressing the rich text document under the condition that the uploading condition is met.
3. A document processing method applied to a server includes:
receiving an optimized and compressed rich text document uploaded by a terminal device, wherein the optimization comprises an HTML (hypertext markup language) tag in the optimized rich text document, and the rich text document comprises characters and/or pictures;
decompressing the compressed rich text document to obtain a decompressed rich text document;
and saving the decompressed rich text document.
4. The method of claim 3, further comprising:
screening the decompressed rich text document;
and replacing the saved decompressed rich text document with the screened rich text document.
5. The method of claim 4, wherein screening the decompressed rich-text document comprises:
dividing the decompressed rich text document into a plurality of queues;
and respectively screening the queues.
6. The method of claim 4, wherein screening the decompressed rich-text document comprises:
screening specified characters in the decompressed rich text document based on a specified character library comprising the specified characters;
and shielding the specified characters in the decompressed rich text document.
7. The method of claim 3, further comprising:
acquiring the picture according to the picture source corresponding to the picture in the decompressed rich text document, and storing the acquired picture into a picture library corresponding to a server;
and replacing the picture source corresponding to the picture in the decompressed rich text document with the storage position of the picture in the picture library.
8. A document processing apparatus applied to a terminal device, the apparatus comprising:
the system comprises a document acquisition module, a document processing module and a document processing module, wherein the document acquisition module is used for acquiring a rich text document to be uploaded to a network platform, and the rich text document comprises characters and/or pictures;
a document compression module that compresses the rich text document, wherein the compressing the rich text document comprises: optimizing the content of the rich text document, wherein the optimizing includes optimizing an HTML tag in the rich text document and compressing the optimized rich text document;
and the document uploading module is used for sending the compressed rich text document to a server of the network platform, and the compressed rich text document is decompressed by the server and then is stored.
9. The apparatus of claim 8, wherein the document compression module comprises:
the judgment sub-module is used for judging whether the rich text document meets the uploading condition or not;
and the first compression sub-module compresses the rich text document under the condition that the uploading condition is met.
10. A document processing apparatus applied to a server, the apparatus comprising:
the document receiving module is used for receiving the optimized and compressed rich text document uploaded by the terminal equipment, wherein the optimization comprises optimizing an HTML (hypertext markup language) tag in the rich text document, and the rich text document comprises characters and/or pictures;
the decompression module is used for decompressing the compressed rich text document to obtain a decompressed rich text document;
and the document storage module stores the decompressed rich text document.
11. The apparatus of claim 10, further comprising:
the document screening module is used for screening the decompressed rich text document;
and the document replacing module is used for replacing the saved decompressed rich text document with the screened rich text document.
12. The apparatus of claim 11, wherein the document screening module comprises:
the queue dividing submodule is used for dividing the decompressed rich text document into a plurality of queues;
and the queue screening submodule is used for screening the plurality of queues respectively.
13. The apparatus of claim 11, wherein the document screening module comprises:
the character screening sub-module screens specified characters in the decompressed rich text document based on a specified character library comprising the specified characters;
and the character shielding submodule shields the appointed characters in the decompressed rich text document.
14. The apparatus of claim 11, further comprising:
the image acquisition module acquires the image according to the image source corresponding to the image in the decompressed rich text document and stores the acquired image into an image library corresponding to a server;
and the picture storage module is used for replacing the picture source corresponding to the picture in the decompressed rich text document with the storage position of the picture in the picture library.
15. A document processing apparatus, comprising:
a processor;
a memory for storing processor-executable instructions;
wherein the processor is configured to perform the method of any of claims 1 to 3.
16. A non-transitory computer readable storage medium having computer program instructions stored thereon, wherein the computer program instructions, when executed by a processor, implement the method of any of claims 1 to 2.
17. A document processing apparatus, comprising:
a processor;
a memory for storing processor-executable instructions;
wherein the processor is configured to perform the method of any of claims 3 to 7.
18. A non-transitory computer readable storage medium having stored thereon computer program instructions, wherein the computer program instructions, when executed by a processor, implement the method of any of claims 3 to 7.
CN201711431093.3A 2017-12-26 2017-12-26 Document processing method and device Active CN109962958B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201711431093.3A CN109962958B (en) 2017-12-26 2017-12-26 Document processing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201711431093.3A CN109962958B (en) 2017-12-26 2017-12-26 Document processing method and device

Publications (2)

Publication Number Publication Date
CN109962958A CN109962958A (en) 2019-07-02
CN109962958B true CN109962958B (en) 2022-05-03

Family

ID=67021992

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201711431093.3A Active CN109962958B (en) 2017-12-26 2017-12-26 Document processing method and device

Country Status (1)

Country Link
CN (1) CN109962958B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112291300B (en) * 2020-09-24 2022-12-06 南阳柯丽尔科技有限公司 Method and device for uploading rich text file
CN112769925B (en) * 2020-12-31 2023-12-15 南威软件股份有限公司 Picture uploading method, system, terminal and medium based on rich text editor
CN114222011A (en) * 2021-11-18 2022-03-22 中国长城科技集团股份有限公司 Binary protocol legend generating method, device, electronic equipment and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101729075A (en) * 2008-10-10 2010-06-09 英华达(上海)电子有限公司 Data compression method, data compression device, data decompression method and data decompression device
CN103870826A (en) * 2014-03-31 2014-06-18 深圳市远行科技有限公司 Electronic archive scanning, recognizing and filing method and system
CN105183761A (en) * 2015-07-27 2015-12-23 网易传媒科技(北京)有限公司 Sensitive word replacement method and apparatus
CN106713689A (en) * 2015-11-13 2017-05-24 北京奇虎科技有限公司 Picture uploading method and device
CN106911794A (en) * 2017-03-23 2017-06-30 福建天泉教育科技有限公司 The method and system that a kind of picture is stored automatically

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP5570202B2 (en) * 2009-12-16 2014-08-13 キヤノン株式会社 Structured document analysis apparatus, structured document analysis method, and computer program
JP6145414B2 (en) * 2014-02-21 2017-06-14 東芝テック株式会社 Document distribution server and document distribution server program

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101729075A (en) * 2008-10-10 2010-06-09 英华达(上海)电子有限公司 Data compression method, data compression device, data decompression method and data decompression device
CN103870826A (en) * 2014-03-31 2014-06-18 深圳市远行科技有限公司 Electronic archive scanning, recognizing and filing method and system
CN105183761A (en) * 2015-07-27 2015-12-23 网易传媒科技(北京)有限公司 Sensitive word replacement method and apparatus
CN106713689A (en) * 2015-11-13 2017-05-24 北京奇虎科技有限公司 Picture uploading method and device
CN106911794A (en) * 2017-03-23 2017-06-30 福建天泉教育科技有限公司 The method and system that a kind of picture is stored automatically

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
JSP技术实现上传压缩文件及文件相关信息并解压;韩银锋;《软件研发与应用》;20150430;全文 *

Also Published As

Publication number Publication date
CN109962958A (en) 2019-07-02

Similar Documents

Publication Publication Date Title
CN112465843A (en) Image segmentation method and device, electronic equipment and storage medium
CN110858924B (en) Video background music generation method and device and storage medium
CN109962958B (en) Document processing method and device
CN107508573B (en) Crystal oscillator oscillation frequency correction method and device
CN106991018B (en) Interface skin changing method and device
CN111294850B (en) Measurement reporting method and device, and terminal equipment information acquisition method and device
CN106782576B (en) Audio mixing method and device
CN110750961A (en) File format conversion method and device, computer equipment and storage medium
CN109992754B (en) Document processing method and device
CN110753106A (en) File uploading method and device and electronic equipment
CN109756783B (en) Poster generation method and device
CN110955800A (en) Video retrieval method and device
CN108574860B (en) Multimedia resource playing method and device
CN109189822B (en) Data processing method and device
CN110460873B (en) Method and device for generating video on demand
CN111290843A (en) Process management method and device
CN108469991B (en) Multimedia data processing method and device
CN110858921A (en) Program video processing method and device
CN110969569A (en) Method and device for generating test-mirror video
CN106791925B (en) Video generation method and device
CN105607958B (en) Information input method and device
CN110493298B (en) Information synchronization method and device
CN110896492B (en) Image processing method, device and storage medium
CN112989934A (en) Video analysis method, device and system
CN111522787B (en) Data processing method and device of distributed system and storage 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
TA01 Transfer of patent application right

Effective date of registration: 20200430

Address after: 310052 room 508, floor 5, building 4, No. 699, Wangshang Road, Changhe street, Binjiang District, Hangzhou City, Zhejiang Province

Applicant after: Alibaba (China) Co.,Ltd.

Address before: 200241 room 1162, building 555, Dongchuan Road, Shanghai, Minhang District

Applicant before: SHANGHAI QUANTUDOU CULTURE COMMUNICATION Co.,Ltd.

TA01 Transfer of patent application right
GR01 Patent grant
GR01 Patent grant