CN110858252A - Text protection method and related device - Google Patents

Text protection method and related device Download PDF

Info

Publication number
CN110858252A
CN110858252A CN201810968430.0A CN201810968430A CN110858252A CN 110858252 A CN110858252 A CN 110858252A CN 201810968430 A CN201810968430 A CN 201810968430A CN 110858252 A CN110858252 A CN 110858252A
Authority
CN
China
Prior art keywords
text
webpage
interference
characters
tag
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201810968430.0A
Other languages
Chinese (zh)
Inventor
程俊彰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Sogou Technology Development Co Ltd
Original Assignee
Beijing Sogou Technology Development Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Sogou Technology Development Co Ltd filed Critical Beijing Sogou Technology Development Co Ltd
Priority to CN201810968430.0A priority Critical patent/CN110858252A/en
Publication of CN110858252A publication Critical patent/CN110858252A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/60Protecting data
    • G06F21/62Protecting access to data via a platform, e.g. using keys or access control rules
    • G06F21/6209Protecting access to data via a platform, e.g. using keys or access control rules to a single file or object, e.g. in a secure envelope, encrypted and accessed using a key, or with access control rules appended to the object itself

Abstract

The application provides a text protection method and a related device; the method comprises the following steps: generating interference information based on a webpage text to be protected; the webpage label is used for setting the font attribute of the first interference character string to enable the first interference character string not to be visible; and identifying intervals among the characters of the webpage text, and adding the interference information into the intervals among the characters of the webpage text to obtain a protected text. Therefore, in the embodiment of the invention, the text is protected by adding the interference information into the intervals between the characters of the web page text to be protected. The normal reading of the webpage text by the user is not influenced, and when the text is copied and protected, the copied text content comprises the first interference character string added between the intervals of the webpage text, so that the text is protected.

Description

Text protection method and related device
Technical Field
The present application relates to the internet field, and in particular, to a text protection method and a related apparatus.
Background
With the rapid growth of web page information, it is becoming more and more important how to protect web page information and avoid the illegal copying of web page information from web pages or other carriers.
At present, since the right key function needs to be called for the copy operation, one way is to disable the right key function of the browser, so as to avoid copying the web page information on the web page.
However, this method not only makes the user unable to execute other operations corresponding to the right key function, and the user experience is poor, but also has many ways to recover the forbidding of the right key function, and the protection of the web page information cannot be effectively realized.
Disclosure of Invention
The technical problem to be solved by the application is to provide a text protection method and a related device, which do not need to disable a right key function of a browser, improve user experience, and effectively realize protection of webpage information.
Therefore, the technical scheme for solving the technical problem is as follows:
the embodiment of the invention provides a text protection method, which comprises the following steps:
generating interference information based on a webpage text to be protected; the webpage label is used for setting the font attribute of the first interference character string to enable the first interference character string not to be visible;
and identifying intervals among the characters of the webpage text, and adding the interference information into the intervals among the characters of the webpage text to obtain a protected text.
Optionally, the webpage label is configured to set a font size of the first interference string to 0 and/or set a font color of the first interference string to an invisible color.
Optionally, the web page tag includes a tag start symbol, a tag end symbol, and attribute setting information located between the tag start symbol and the tag end symbol; the first interfering string includes a plurality of characters other than the tag start character and the tag end character.
Optionally, after recognizing the intervals between the characters of the web page text, the method further includes:
identifying the tag start character and the tag end character in the webpage text;
and performing escape replacement on the identified label start character and label end character in the webpage text.
Optionally, the method further includes:
generating a second interfering string comprising a plurality of characters other than a tag reservation character;
and identifying a space in the webpage label, and adding the second interference character string at the space in the webpage label.
Optionally, before adding the interference information into the interval between the characters of the web page text, the method further includes:
obtaining a text to be converted in the webpage text;
acquiring picture coding information corresponding to the text to be converted;
and replacing the text to be converted in the webpage text by using the picture coding information.
Optionally, the method further includes:
performing webpage rendering on the protection text to obtain a rendering result;
and displaying the protection text according to the rendering result.
The embodiment of the application provides a text protection device, the device includes:
the generating module is used for generating interference information based on the webpage text to be protected; the webpage label is used for setting the font attribute of the first interference character string to enable the first interference character string not to be visible;
and the protection module is used for identifying intervals among the characters of the webpage text, and adding the interference information into the intervals among the characters of the webpage text to obtain a protection text.
Optionally, the webpage label is configured to set a font size of the first interference string to 0 and/or set a font color of the first interference string to an invisible color.
Optionally, the web page tag includes a tag start symbol, a tag end symbol, and attribute setting information located between the tag start symbol and the tag end symbol; the first interfering string includes a plurality of characters other than the tag start character and the tag end character.
Optionally, the method further includes:
the identification module is used for identifying the tag start character and the tag end character in the webpage text;
and the first replacing module is used for performing escape replacement on the identified label start character and the label end character in the webpage text.
Optionally, the method further includes: adding a module;
the generating module is further configured to generate a second interference character string, where the second interference character string includes a plurality of characters except for the tag reservation character;
the adding module is used for identifying a space in the webpage label and adding the second interference character string at the space in the webpage label.
Optionally, the method further includes:
the first obtaining module is used for obtaining a text to be converted in the webpage text;
the second obtaining module is used for obtaining picture coding information corresponding to the text to be converted;
and the second replacing module is used for replacing the text to be converted in the webpage text by using the picture coding information.
Optionally, the method further includes:
the rendering module is used for rendering the webpage of the protected text to obtain a rendering result;
and the display module is used for displaying the protection text according to the rendering result.
An apparatus for text protection is provided in an embodiment of the present application, comprising a memory, and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the one or more processors comprise instructions for:
generating interference information based on a webpage text to be protected; the webpage label is used for setting the font attribute of the first interference character string to enable the first interference character string not to be visible;
and identifying intervals among the characters of the webpage text, and adding the interference information into the intervals among the characters of the webpage text to obtain a protected text.
Embodiments of the present application provide a machine-readable medium having stored thereon instructions, which when executed by one or more processors, cause an apparatus to perform any of the above-described text protection methods.
According to the technical scheme, the interference information is generated based on the webpage text to be protected, the intervals among the characters of the webpage text are identified, and the interference information is added into the intervals among the characters of the webpage text to obtain the protected text. Therefore, in the embodiment of the invention, the text is protected by adding the interference information into the intervals between the characters of the web page text to be protected. The interference information comprises the webpage label and the first interference character string, and the webpage label is used for setting the font attribute of the first interference character string to make the first interference character string invisible, so that the normal reading of the webpage text by the user is not influenced. When the protected text after the interference information is added is copied, the copied text content comprises the first interference character string added between the intervals of the webpage text, so that the text is protected. In addition, the right key function of the browser does not need to be forbidden, so that the use of the right key function by a user is not influenced, and the method improves the user experience while protecting the text.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art according to the drawings.
Fig. 1 is a schematic flowchart of a text protection method according to an embodiment of the present application;
FIG. 2 is a schematic structural diagram of an embodiment of an apparatus according to an embodiment of the present disclosure;
FIG. 3 is a block diagram illustrating an apparatus 300 for text protection in accordance with an exemplary embodiment;
fig. 4 is a schematic structural diagram of a server in an embodiment of the present invention.
Detailed Description
Currently, web page information displayed on a web page or other carrier, such as a blog, a paper, etc., is easily copied through a copying operation or through web crawler technology. Therefore, how to avoid illegally copying the web page information from the web page or other carriers to protect the web page information is a technical problem to be solved urgently at present.
Since the right key function needs to be called for the copy operation, in order to solve the above problem, one way is to avoid copying the web page information on the web page by disabling the right key function of the browser. But the right key function provides other operations in addition to the copy operation. Therefore, the right key function of the browser is disabled, so that the user cannot perform other operations corresponding to the right key function, such as a webpage refreshing operation and the like, and therefore the user experience is poor, and the disabling of the right key function can be recovered in many ways, and the webpage information cannot be effectively protected.
In order to effectively protect the webpage text and not influence the user experience, the application provides a text protection method. The text protection method includes the steps of firstly generating interference information based on a webpage text to be protected, then identifying intervals among characters of the webpage text, and adding the interference information into the intervals among the characters of the webpage text to obtain the protected text. The interference information comprises a webpage label and a first interference character string. Wherein the first interference character string is invisible due to the webpage label being used for setting the font property of the first interference character string. When the protected text is displayed after webpage rendering, the first interference character string is invisible, and therefore normal reading of the webpage text by a user cannot be influenced. And if the webpage text is copied through the copying operation, the copied content comprises the webpage text and the first interference character string added in the interval between the characters of the webpage text, so that the webpage text cannot be screened out difficultly, and the webpage text is protected. In addition, the method does not need to forbid the right key function of the browser, so that the use of the right key function by a user is not influenced, and the user experience is improved while the text is protected.
In order to make those skilled in the art better understand the technical solution of the present invention, the technical solution in the embodiment of the present invention will be clearly and completely described below with reference to the drawings in the embodiment of the present invention, and it is obvious that the described embodiment is only a part of the embodiment of the present invention, and not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Referring to fig. 1, an embodiment of the present application provides a schematic flow chart of a text protection method, where the method includes:
s101: and generating interference information based on the webpage text to be protected.
Web page text refers to text for display on a web page or a carrier similar to a web page. For example, the web page text may be text encoded in a web page programming language. As examples, the web page programming Language may be Hypertext markup Language (English: Hypertext Makeup Language, abbreviation: HTML), cascading Style Sheets (English: Cascade Sheets, abbreviation: CSS), JavaScript, or the like. Web page text typically needs to be rendered via a web page before being displayed on a carrier such as a web page. For example, for web page text rendered by a browser, rendering may be performed by a browser rendering engine. The webpage text to be protected refers to the webpage text which needs to limit the use and propagation permission. By way of example, the web page text to be protected may be a web blog text displayed on a browser, may be a comment of a technical communication forum, may be a thesis summary searched by a academic search website, or may be a novel chapter content linked by an author on the literature website, and the like.
In this embodiment, after obtaining the web page text to be protected, interference information that can play an interference role when copying the web page text is generated. Specifically, the interference information may include a web tag and a first interference character string.
The web page tag refers to a tag inserted in a specific format in a web page text, and may be used to set attributes such as a font size and a font color of a character string. The web page tag may be specifically an HTML tag. Specifically, in this embodiment of the present application, the webpage label is configured to set a font property of the first interference string so that the first interference string is invisible. When the webpage rendering result is used for displaying the interference information, the first interference character string is invisible. For example, the font size of the first interference string may be set to 0; for another example, the font color of the first interference character string may be set to an invisible color, for example, consistent with the display background color of the web page text to be protected.
Optionally, the web page tags have a fixed format. For example, the web page tags may include: the label starting character, the label ending character and the attribute setting information between the label starting character and the label ending character. Taking the web page tag as an HTML tag as an example, the HTML tag may include: < span style ═ font-size: 0%; ">. Wherein, "<" is the tag start symbol, ">" is the tag end symbol, "span style ═ font-size: 0%; "sets information for an attribute and is located between a tag start" < "and a tag end" >. The HTML tag can set the font size of the corresponding first interference string to 0, thereby making the first interference string invisible. Which character string the web tag is set to may be determined according to predefined rules, for example, the web tag may set a character string located behind and connected to the web tag. The webpage label can comprise two parts: a start tag and an end tag, and thus the web tag can set a character string located between the start tag and the end tag. The start tag may include the tag start character, tag end character, and attribute setting information described above. The end tag may include a tag start, a tag end, and an end flag. For example, the start tag may include: < span style ═ font-size: 0%; ">, the end tag may include: where "span" is the end flag, the HTML tag can set < span style ═ font-size 0%; the font size of a string between "> and" span > is 0. It should be noted that the start tag and the end tag may be used in pair, or the start tag may be used alone, which is not limited in the embodiment of the present application.
The first interference string may include a plurality of characters such as letters (english, chinese, etc.), numbers, punctuation marks, etc. The first interference string may be generated according to a certain preset rule, or may be randomly generated. The type of some or all of the characters in the first interference string may be the same as the type of characters of the web page text to be protected. For example, the characters of the web page text to be protected are all Chinese characters, and the characters in the first interference character string are also composed of Chinese characters, so that the difficulty in distinguishing the web page text to be protected from the first interference character string is increased due to the fact that the character types are the same.
S102: and identifying intervals among the characters of the webpage text, and adding interference information into the intervals among the characters of the webpage text to obtain a protected text.
This step requires identifying the spacing between characters of the web page text to be protected. For example, the text of the web page to be protected is "N years for the item, make one summary" as an example, the character length of the text of the web page may be calculated. Starting at 0, each character in the recognized text is traversed up to the calculated character length, thereby recognizing the spacing between characters. For example, for the web page text "item has been made N years, and summarized", the character length of the web page text is calculated to be 11, and from 0 th character to 10 th character, each character in the web page text is identified by traversing, for example, the first character is identified: "item", the second character is recognized: the "eye" word, thereby identifying the first character: "term" and recognizing the second character: the interval between the words of "aim".
The web page text to be protected is typically composed of a plurality of characters. For the webpage text to be protected which is formed by a plurality of characters, the characters have consistency, so that the webpage text to be protected which is formed by each character has certain meaning. For example, the web page text to be protected is "N years of project, each summary" and, according to each character and its connection relationship in the web page text, the user can interpret the web page text and know the meaning of the web page text expression. The interference information has the function that a plurality of characters irrelevant to the meaning expressed by the webpage text are mixed in the intervals among the characters of the webpage text, and the consistency among the characters in the webpage text is interrupted. Thus making it impossible for the reader to recognize what the web page text expresses.
Optionally, the interference information may include a plurality of web tags and interference character strings corresponding to the plurality of web tags, where the interference character strings corresponding to the plurality of web tags form the first interference character string. Therefore, the interference character strings corresponding to the plurality of web tags and the plurality of web tags are added to a plurality of intervals between characters of the web text. Each webpage label and the interference character string corresponding to the webpage label are added into an interval between characters of the webpage text. In addition, the web page label and the interference character string corresponding to the web page label can be added to the starting position and/or the ending position of the web page text respectively. The webpage label can also set the font attribute of the interference character string corresponding to the webpage label so that the interference character string is invisible.
For ease of understanding, the following is exemplified. Assuming that the web page text to be protected is "item for N years, make a summary", adding the web page tags and randomly generated interference character strings corresponding to the web page tags to the interval between "item" and "item", the interval between the first "made" and "made", the interval between "and the second" made ", the interval between" number "and" total ", and the end position in the web page text to be protected respectively to obtain a protected text as follows:
the term < span style ═ font-size: 0%; "> U @ iA0d3 @? t $ U </span > mesh as < span style ═ font-size: 0%; "> TaAScvnYTYspan > N year, < span style ═ font-size: 0%; ">6+ ^ Ntomq $ span > making < span style ═ font-size 0%; "> sPSZAANRk # Vg </span > is summarized. < spanstyle ═ font-size: 0%; "> U.s () cNp' </span >
When the protected text is rendered and displayed, the webpage label therein makes the corresponding interference character string invisible, so that the displayed content is: "the project was done N years, and a summary was made". When the protected text is copied, the copied text content includes: "item U @ iA0d3 @? the t $ U mesh was made N years for TaAScvuNyTye, and 6+ ^ NtoMq $ was made for a summary of sPSZAANRk # Vg. U.s () cNp'
Therefore, in the embodiment of the invention, the text is protected by adding the interference information into the intervals between the characters of the web page text to be protected. The interference information comprises the webpage label and the first interference character string, and the webpage label is used for setting the font attribute of the first interference character string to make the first interference character string invisible, so that the normal reading of the webpage text by the user is not influenced. When the protected text after the interference information is added is copied, the copied text content comprises the first interference character string added between the intervals of the webpage text, so that the text is protected. In addition, the right key function of the browser does not need to be forbidden, so that the use of the right key function by a user is not influenced, and the method improves the user experience while protecting the text.
The text protection method provided in the foregoing embodiment, after S102, may further include:
s103: and performing webpage rendering on the protected text to obtain a rendering result.
For example, when the text publisher needs to display the protected text on a webpage of a browser, the browser rendering engine may be used to render the protected text, and a rendering result is obtained.
S104: and displaying the protection text according to a rendering result.
After the text is rendered through the webpage, and when the text is displayed according to the rendering result, the first interference character string can be invisible according to the setting of the webpage label. For example, the font size of the first interfering string is 0 and/or the font color of the first interfering string is an invisible color.
Since a web page tag typically identifies the beginning of the web page tag with a tag start symbol, the end of the web page tag is identified with a tag end symbol. In order to avoid that the first interference character string and/or the web page text to be protected interfere with the normal identification of the web page tag, the content of the first interference character string and/or the web page text to be protected may be limited. Specifically, the first interfering string includes a plurality of characters other than the tag start character and the tag end character. For example, a plurality of characters other than the tag start character "<" and the tag end character ">" are generated as the first interference character string. Specifically, the web page text to be protected includes text information other than the tag start character and the tag end character.
Or, in order to avoid that the text of the web page to be protected interferes with the normal identification of the web page tag, the label start symbol and the label end symbol in the web page tag may also be subjected to escape replacement, which is described in detail below. Since some characters of the web page tag have specific meanings. For example, the tag start "<" is used to identify the start of the web tag, and the tag end ">" is used to identify the end of the web tag. In order to display the characters with specific meanings, the characters are usually converted into other characters or character strings according to a predetermined rule, and the conversion process is an escape replacing process. The characters are converted into other characters or character strings according to a predetermined rule, and the characters are called escape characters. Therefore, in the embodiment of the present application, after the intervals between the characters of the web page text are identified, the tag start character and the tag end character in the web page text are identified, and the identified tag start character and tag end character in the web page text are subjected to escape replacement. For example, converting tag start characters "<" into escape characters "< ", convert the tag start" < "to an escape character: ">", in the specification of a sample ". Through the escape replacement, the webpage text can not include the label start symbol and the label end symbol any more, so that the interference effect on the normal identification of the webpage label is avoided. The process of escape replacement needs to be performed after the intervals between the characters of the web page text are identified, so that the interference information is prevented from being added in the intervals of the escape characters. Besides the escape replacement of the tag start character and the tag end character, other characters to be escaped in the webpage text can be identified, and the escape replacement of other characters to be escaped can be carried out.
In addition, the protection method is prevented from being cracked. For example, the regular expression is used for filtering and replacing the interference information, so that the interference information is screened out from the protected text, and the effect of protecting the webpage text is lost. Optionally, in this embodiment of the application, a second interference character string may also be added to the webpage label of the interference information. This will be explained in detail below.
Firstly, generating a second interference character string; secondly, identifying a space in the webpage label, and adding the second interference character string at the space in the webpage label. The second interference string may comprise a plurality of characters such as letters (english, chinese, etc.), numbers, punctuation marks, etc. The second interference string may be generated according to a certain preset rule, or may be randomly generated. In order to avoid that the second interference character string interferes with the normal identification of the webpage label, a plurality of characters except the label reserved character can be generated to be used as the second interference character string. The label reserved character refers to a symbol in the webpage label for playing a role of identification and/or a character string for playing a role of attribute setting. For example, the label reserved character may include a label start symbol "<", a label end symbol ">, a semicolon, a single quotation mark, a double quotation mark, and other symbols for identification, and may also include a character string for setting properties, such as" span "," size ", and other characters. By way of example, the identification of a web page tag: < span style ═ font-size: 0%; spaces between "span" and "style" in "> and spaces between double quotation marks (") and ">", a character string a and a character string B may be added at the above two spaces, respectively. After adding the character string A and the character string B, the webpage label is as follows: < span string assole ═ font-size: 0%; "character string B >. The second interference character string can be added into the random space position of the webpage label, so that the identification difficulty of the webpage label is increased, the interference information is prevented from being filtered and replaced by a regular expression, and the protection of the webpage text is further enhanced.
In the text protection method provided in the above embodiment, the web page text to be protected is not changed, and the web page text is protected only by adding the interference information in the interval between the characters of the web page text to be protected. According to the method and the device, partial texts in the webpage texts to be protected can be converted into pictures, and the protection of the texts is further enhanced.
Specifically, before adding the interference information into the interval between the characters of the web page text, the method may further include:
and A1, obtaining the text to be converted in the webpage text.
The text to be converted is a text which needs format conversion in the webpage text to be protected, and may be one or more characters in the webpage text, and the characters may be connected or separated characters. For example, if the webpage text to be protected is "N years for an item, make a summary", the target text may be any character or any combination of characters in the text. A plurality of characters can be extracted from the webpage text by a certain rule or randomly and serve as the text to be converted. The above approach is merely an exemplary way to obtain text to be converted. It can be understood that the text protection method provided in the embodiment of the present application may also obtain the text to be converted in other manners, and the manner of obtaining the text to be converted is not limited herein.
And A2, obtaining picture coding information corresponding to the text to be converted.
In this step, a graph-text mapping table can be obtained, and picture coding information corresponding to the text to be converted is obtained according to the corresponding relation between the text and the picture in the graph-text mapping table. The picture coding information refers to information obtained by coding a picture. For example, the picture coding information may be Base64 coding information. And rendering the picture coding information and displaying the rendered picture coding information as a picture corresponding to the text to be converted.
To facilitate understanding of the implementation of this step, the following example is given. The method comprises the steps of obtaining a text to be converted from a webpage text to be protected as 'permanent', obtaining Base64 encoding information corresponding to the text to be converted as 'permanent' by utilizing an image-text mapping table, wherein the Base64 encoding information is as follows:
iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAIAAAAC64paAAAAZElEQVR42q2T2woAIAhD9/8/XRBE4GXKco/RzDMN60OYN+NIfxlXetvcP8SMSHra3mwqog/se0HYs7mdIYB0W8IX5pA8NRtIPura3GW2YdKogyXhtdiolCVJkZLDl4X2GQd+1Qbj3eBKSdh44gAAAABJRU5ErkJggg==
the Base64 coded information is rendered and displayed as a picture corresponding to the 'permanent' word.
And A3, replacing the text to be converted in the webpage text with the picture coding information.
After the text to be converted in the webpage text is replaced by the picture coding information, the picture coding information is rendered and displayed as a picture corresponding to the text to be converted, so that the content of the displayed webpage text is not changed. However, when the text to be converted is copied by the copying operation, the copied content is not the text to be converted but picture coding information corresponding to the text to be converted, such as the above-mentioned lengthy Base64 coding information. By the method, on one hand, the text to be converted in the webpage text cannot be copied; on the other hand, the longer picture coding information can break the consistency among all characters in the webpage text, so that a reader cannot recognize the meaning expressed by the webpage text. The protection of the webpage text is further improved.
Corresponding to the above method embodiments, the present application further provides corresponding apparatus embodiments, which are specifically described below.
As shown in fig. 2, an embodiment of the present application provides a text protection device, where the text protection device includes: a generation module 201 and a protection module 202.
A generating module 201, configured to generate interference information based on a webpage text to be protected; the webpage label is used for setting the font attribute of the first interference character string to enable the first interference character string not to be visible;
the protection module 202 is configured to identify intervals between characters of the web page text, and add the interference information to the intervals between the characters of the web page text to obtain a protected text.
Optionally, the webpage label is configured to set a font size of the first interference string to 0 and/or set a font color of the first interference string to an invisible color.
Optionally, the web page tag includes a tag start symbol, a tag end symbol, and attribute setting information located between the tag start symbol and the tag end symbol; the first interfering string includes a plurality of characters other than the tag start character and the tag end character.
Optionally, the method further includes:
the identification module is used for identifying the tag start character and the tag end character in the webpage text;
and the first replacing module is used for performing escape replacement on the identified label start character and the label end character in the webpage text.
Optionally, the method further includes: adding a module;
the generating module is further configured to generate a second interference character string, where the second interference character string includes a plurality of characters except for the tag reservation character;
the adding module is used for identifying a space in the webpage label and adding the second interference character string at the space in the webpage label.
Optionally, the method further includes:
the first obtaining module is used for obtaining a text to be converted in the webpage text;
the second obtaining module is used for obtaining picture coding information corresponding to the text to be converted;
and the second replacing module is used for replacing the text to be converted in the webpage text by using the picture coding information.
Optionally, the method further includes:
the rendering module is used for rendering the webpage of the protected text to obtain a rendering result;
and the display module is used for displaying the protection text according to the rendering result.
With regard to the apparatus in the above-described embodiment, the specific manner in which each module performs the operation has been described in detail in the embodiment related to the method, and will not be elaborated here.
FIG. 3 is a block diagram illustrating an apparatus 300 for text protection according to an example embodiment. For example, the apparatus 300 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. 3, the apparatus 300 may include one or more of the following components: processing component 302, memory 304, power component 306, multimedia component 308, audio component 310, input/output (I/O) interface 312, sensor component 314, and communication component 316.
The processing component 302 generally controls overall operation of the device 300, such as operations associated with display, telephone calls, data communications, camera operations, and recording operations. The processing components 302 may include one or more processors 320 to execute instructions to perform all or a portion of the steps of the methods described above. Further, the processing component 302 can include one or more modules that facilitate interaction between the processing component 302 and other components. For example, the processing component 302 can include a multimedia module to facilitate interaction between the multimedia component 308 and the processing component 302.
The memory 304 is configured to store various types of data to support operations at the device 300. Examples of such data include instructions for any application or method operating on device 300, contact data, phonebook data, messages, pictures, videos, and so forth. The memory 304 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.
The power supply component 306 provides power to the various components of the device 300. The power components 306 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for the apparatus 300.
The multimedia component 308 includes a screen that provides an output interface between the device 300 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 308 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 300 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 310 is configured to output and/or input audio signals. For example, audio component 310 includes a Microphone (MIC) configured to receive external audio signals when apparatus 300 is in an operating 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 304 or transmitted via the communication component 316. In some embodiments, audio component 310 also includes a speaker for outputting audio signals.
The I/O interface 312 provides an interface between the processing component 302 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 314 includes one or more sensors for providing various aspects of status assessment for the device 300. For example, sensor assembly 314 may detect an open/closed state of device 300, the relative positioning of components, such as a display and keypad of apparatus 300, the change in position of apparatus 300 or a component of apparatus 300, the presence or absence of user contact with apparatus 300, the orientation or acceleration/deceleration of apparatus 300, and the change in temperature of apparatus 300. Sensor assembly 314 may include a proximity sensor configured to detect the presence of a nearby object without any physical contact. The sensor assembly 314 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 314 may also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
The communication component 316 is configured to facilitate wired or wireless communication between the apparatus 300 and other devices. The device 300 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 section 316 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 316 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 300 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 comprising instructions, such as the memory 304 comprising instructions, executable by the processor 320 of the apparatus 300 to perform the above-described method is also provided. For example, the non-transitory computer readable storage medium may be a ROM, a Random Access Memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, and the like.
A non-transitory computer readable storage medium having instructions therein, which when executed by a processor of a mobile terminal, enable the mobile terminal to perform a text protection method, the method comprising:
generating interference information based on a webpage text to be protected; the webpage label is used for setting the font attribute of the first interference character string to enable the first interference character string not to be visible;
and identifying intervals among the characters of the webpage text, and adding the interference information into the intervals among the characters of the webpage text to obtain a protected text.
Fig. 4 is a schematic structural diagram of a server in an embodiment of the present invention. The server 400 may vary significantly due to configuration or performance, and may include one or more Central Processing Units (CPUs) 422 (e.g., one or more processors) and memory 432, one or more storage media 430 (e.g., one or more mass storage devices) storing applications 442 or data 444. Wherein the memory 432 and storage medium 430 may be transient or persistent storage. The program stored on the storage medium 430 may include one or more modules (not shown), each of which may include a series of instruction operations for the server. Still further, the central processor 422 may be arranged to communicate with the storage medium 430, and execute a series of instruction operations in the storage medium 430 on the server 400.
The server 400 may also include one or more power supplies 426, one or more wired or wireless network interfaces 450, one or more input-output interfaces 458, one or more keyboards 456, and/or one or more operating systems 441, such as Windows Server, Mac OSXTM, UnixTM, LinuxTM, FreeBSDTM, and so forth.
Other embodiments of the invention will be apparent to those skilled in the art from consideration of the specification and practice of the invention disclosed herein. This invention is intended to cover any variations, uses, or adaptations of the invention following, in general, the principles of the invention and including such departures from the present disclosure as come within known or customary practice within the art to which the invention pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the invention being indicated by the following claims.
It will be understood that the invention is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the invention is only limited by the appended claims
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the invention, and any modifications, equivalents, improvements and the like that fall within the spirit and principle of the present invention are intended to be included therein.

Claims (10)

1. A method of text protection, the method comprising:
generating interference information based on a webpage text to be protected; the webpage label is used for setting the font attribute of the first interference character string to enable the first interference character string not to be visible;
and identifying intervals among the characters of the webpage text, and adding the interference information into the intervals among the characters of the webpage text to obtain a protected text.
2. The text protection method according to claim 1, wherein the webpage tag is configured to set a font size of the first interference string to 0 and/or set a font color of the first interference string to an invisible color.
3. The text protection method according to claim 1 or 2, wherein the web page tag comprises a tag start character, a tag end character and attribute setting information between the tag start character and the tag end character; the first interfering string includes a plurality of characters other than the tag start character and the tag end character.
4. The text protection method according to claim 1 or 2, after identifying the intervals between the characters of the web page text, further comprising:
identifying the tag start character and the tag end character in the webpage text;
and performing escape replacement on the identified label start character and label end character in the webpage text.
5. The text protection method according to claim 1 or 2, further comprising:
generating a second interfering string comprising a plurality of characters other than a tag reservation character;
and identifying a space in the webpage label, and adding the second interference character string at the space in the webpage label.
6. The text protection method according to claim 1 or 2, wherein before adding the interference information to the intervals between the characters of the web page text, further comprising:
obtaining a text to be converted in the webpage text;
acquiring picture coding information corresponding to the text to be converted;
and replacing the text to be converted in the webpage text by using the picture coding information.
7. The text protection method according to claim 1 or 2, further comprising:
performing webpage rendering on the protection text to obtain a rendering result;
and displaying the protection text according to the rendering result.
8. A text protection device, the device comprising:
the generating module is used for generating interference information based on the webpage text to be protected; the webpage label is used for setting the font attribute of the first interference character string to enable the first interference character string not to be visible;
and the protection module is used for identifying intervals among the characters of the webpage text, and adding the interference information into the intervals among the characters of the webpage text to obtain a protection text.
9. An apparatus for text protection, comprising a memory, and one or more programs, wherein the one or more programs are stored in the memory, and wherein execution of the one or more programs by one or more processors comprises instructions for:
generating interference information based on a webpage text to be protected; the webpage label is used for setting the font attribute of the first interference character string to enable the first interference character string not to be visible;
and identifying intervals among the characters of the webpage text, and adding the interference information into the intervals among the characters of the webpage text to obtain a protected text.
10. A machine-readable medium having stored thereon instructions, which when executed by one or more processors, cause an apparatus to perform a text protection method as recited in one or more of claims 1-7.
CN201810968430.0A 2018-08-23 2018-08-23 Text protection method and related device Pending CN110858252A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810968430.0A CN110858252A (en) 2018-08-23 2018-08-23 Text protection method and related device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810968430.0A CN110858252A (en) 2018-08-23 2018-08-23 Text protection method and related device

Publications (1)

Publication Number Publication Date
CN110858252A true CN110858252A (en) 2020-03-03

Family

ID=69636190

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810968430.0A Pending CN110858252A (en) 2018-08-23 2018-08-23 Text protection method and related device

Country Status (1)

Country Link
CN (1) CN110858252A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114189331A (en) * 2021-12-13 2022-03-15 中国农业银行股份有限公司 Key storage and reading method, device, equipment and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080201633A1 (en) * 2007-02-16 2008-08-21 Esobi Inc. Method and system for converting hypertext markup language web page to plain text
CN103473214A (en) * 2013-09-06 2013-12-25 百度在线网络技术(北京)有限公司 Method and device for displaying page characters
CN103955632A (en) * 2014-05-07 2014-07-30 百度在线网络技术(北京)有限公司 Encryption display method and device for webpage words
CN104050400A (en) * 2014-06-27 2014-09-17 西南交通大学 Webpage link protection method based on control character coding and steganography
CN107818108A (en) * 2016-09-13 2018-03-20 阿里巴巴集团控股有限公司 A kind of webpage rendering intent, apparatus and system

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080201633A1 (en) * 2007-02-16 2008-08-21 Esobi Inc. Method and system for converting hypertext markup language web page to plain text
CN103473214A (en) * 2013-09-06 2013-12-25 百度在线网络技术(北京)有限公司 Method and device for displaying page characters
CN103955632A (en) * 2014-05-07 2014-07-30 百度在线网络技术(北京)有限公司 Encryption display method and device for webpage words
CN104050400A (en) * 2014-06-27 2014-09-17 西南交通大学 Webpage link protection method based on control character coding and steganography
CN107818108A (en) * 2016-09-13 2018-03-20 阿里巴巴集团控股有限公司 A kind of webpage rendering intent, apparatus and system

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
翁超;周良;丁秋林;: "基于不可见字符的主副式网页信息隐藏算法", 计算机科学, no. 07 *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114189331A (en) * 2021-12-13 2022-03-15 中国农业银行股份有限公司 Key storage and reading method, device, equipment and storage medium

Similar Documents

Publication Publication Date Title
US11455069B2 (en) Auto-complete with persisted atomically linked entities
RU2602985C2 (en) Method and device for hiding privacy information
CN109005283B (en) Method, device, terminal and storage medium for displaying notification message
JP2009288856A (en) Peep prevention function-equipped mobile terminal
KR20190125376A (en) Text editing methods, devices and electronic devices
RU2610245C2 (en) Method and device for web page encode identification
US20170140254A1 (en) Method and device for adding font
WO2020042468A1 (en) Data processing method and device, and device for processing data
CN104951445B (en) Webpage processing method and device
CN108874758B (en) Note processing method and device, and device for note processing
CN105468606B (en) Webpage saving method and device
CN107784037B (en) Information processing method and device, and device for information processing
CN110858252A (en) Text protection method and related device
CN109783244A (en) Treating method and apparatus, the device for processing
CN109977424B (en) Training method and device for machine translation model
CN114466204B (en) Video bullet screen display method and device, electronic equipment and storage medium
CN111506848A (en) Webpage processing method, device, equipment and readable storage medium
CN108108356B (en) Character translation method, device and equipment
CN110929484B (en) Text processing method, device and storage medium
CN110147817B (en) Training data set generation method and device
CN105320707B (en) Hot word prompting method and device based on instant messaging
CN110580730B (en) Picture processing method and device
CN110147426B (en) Method for determining classification label of query text and related device
CN109753205B (en) Display method and device
CN110633399A (en) Data processing method and device and data processing device

Legal Events

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