CN110175302A - The method and device of webpage is embedded in document - Google Patents

The method and device of webpage is embedded in document Download PDF

Info

Publication number
CN110175302A
CN110175302A CN201910419567.5A CN201910419567A CN110175302A CN 110175302 A CN110175302 A CN 110175302A CN 201910419567 A CN201910419567 A CN 201910419567A CN 110175302 A CN110175302 A CN 110175302A
Authority
CN
China
Prior art keywords
webpage
content
current
document
link character
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201910419567.5A
Other languages
Chinese (zh)
Other versions
CN110175302B (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.)
Douyin Vision Co Ltd
Douyin Vision Beijing Co Ltd
Original Assignee
Beijing ByteDance Network Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing ByteDance Network Technology Co Ltd filed Critical Beijing ByteDance Network Technology Co Ltd
Priority to CN201910419567.5A priority Critical patent/CN110175302B/en
Publication of CN110175302A publication Critical patent/CN110175302A/en
Application granted granted Critical
Publication of CN110175302B publication Critical patent/CN110175302B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/955Retrieval from the web using information identifiers, e.g. uniform resource locators [URL]
    • G06F16/9558Details of hyperlinks; Management of linked annotations
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/958Organisation or management of web site content, e.g. publishing, maintaining pages or automatic linking
    • G06F16/972Access to data in other repository systems, e.g. legacy data or dynamic Web page generation

Landscapes

  • Engineering & Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The disclosure proposes the method and device that webpage is embedded in a kind of document, wherein method includes: that the preset instructions of input are received in current document, generates input interface;The first content of input is received in input interface, and after first content is concatenation character, parses concatenation character, and first content has first attribute of a configuration;Extract the webpage information for the target webpage that concatenation character is directed toward;The second content is generated according to webpage information, and the second content is loaded onto the designated position of current document, the second content has second attribute of a configuration.Thus, webpage embedded operation can directly be triggered by the instruction inputted, so as to directly generate embedded webpage according to web page interlinkage in current document, it effectively solves to realize that the mode that web page interlinkage is converted to webpage is excessively cumbersome and applicable elements are limited in a document at present, the poor problem of user experience.

Description

Method and device for embedding webpage in document
Technical Field
The present disclosure relates to the field of text processing technologies, and in particular, to a method and an apparatus for embedding a web page in a document.
Background
Currently, a user usually calls a specific website identifier through a toolbar menu or a "/", and then converts a webpage link into a webpage through the website identifier, so as to embed webpage content into a current document.
However, the toolbar menu is often embedded in the document and is too redundant as a placeholder resident on the document editor, which affects the user experience, especially for the user who does not need to use the function, and it is especially important that the "/" mode often only identifies a specific website, so that the identified type is limited, and the embedded webpage is limited. Therefore, the current method for converting the webpage link into the webpage in the document is too complicated, has a limited application range, and has poor user experience.
BRIEF SUMMARY OF THE PRESENT DISCLOSURE
The invention provides a method and a device for embedding a webpage in a document, which can solve the problems that the conventional method for converting webpage links into the webpage in the document is too complicated, the application range is limited, and the user experience is poor.
The embodiment of the first aspect of the disclosure provides a method for embedding a webpage in a document, which includes: receiving an input preset instruction in a current document, and generating an input interface; receiving input first content in the input interface, and analyzing a link character after the first content is the link character, wherein the first content has a first format attribute; extracting webpage information of a target webpage pointed by the link characters; and generating second content according to the webpage information, and loading the second content to the specified position of the current document, wherein the second content has a second format attribute.
In one embodiment of the present disclosure, after receiving the input first instruction in the current document, the method further includes: judging whether a user triggers a webpage embedded button or not; and if the webpage embedded button is triggered, generating an input interface, otherwise, not responding to the webpage embedded operation.
In one embodiment of the present disclosure, further comprising: acquiring current webpage information of the target webpage; and updating the second content of the specified position of the current document according to the current webpage information.
In one embodiment of the present disclosure, further comprising: the acquiring of the current webpage information of the target webpage comprises: receiving an updating instruction of a user, and acquiring the current webpage information according to the updating instruction; and/or, collecting the current webpage information after a preset time length; and/or, collecting the current webpage information when a user opens a document.
In an embodiment of the present disclosure, before collecting the current web page information of the target web page, the method further includes: judging whether the target webpage pointed by the link character is invalid or not; if the document is invalid, not updating the second content at the specified position of the current document; and if the current webpage information is valid, acquiring the current webpage information of the target webpage.
In one embodiment of the present disclosure, further comprising: judging whether the URL type of the link character meets a preset condition or not; if the preset condition is met, analyzing the link character; and if the preset condition is not met, prompting a danger warning.
In order to achieve the above object, an embodiment of a second aspect of the present disclosure provides an apparatus for embedding a web page in a document, including: the first generation module is used for receiving an input preset instruction in a current document and generating an input interface; the analysis module is used for receiving input first content in the input interface and analyzing the link character after the first content is the link character, wherein the first content has a first format attribute; the extraction module is used for extracting the webpage information of the target webpage pointed by the link character; and the second generating module is used for generating second content according to the webpage information and loading the second content to the specified position of the current document, wherein the second content has a second format attribute.
In one embodiment of the present disclosure, the identification module includes: the judging unit is used for judging whether a user triggers a webpage embedded button or not after the input character is a preset link character; and the receiving unit is used for receiving the webpage link when the webpage embedded button is triggered, or else, not responding to the webpage embedded operation.
In one embodiment of the present disclosure, the first generating module includes: the judging unit is used for judging whether a user triggers a webpage embedded button or not after the input character is a preset link character; and the receiving unit is used for generating an input interface when the webpage embedded button is triggered, or else, not responding to the webpage embedded operation.
In one embodiment of the present disclosure, further comprising: the acquisition module is used for acquiring the current webpage information of the target webpage; and the updating module is used for updating the second content of the specified position of the current document according to the current webpage information.
In one embodiment of the present disclosure, the acquisition module includes: the first acquisition unit is used for receiving an updating instruction of a user and acquiring the current webpage information according to the updating instruction; and/or the second acquisition unit is used for acquiring the current webpage information after a preset time length; and/or the third acquisition unit acquires the current webpage information when a user opens a document.
In one embodiment of the present disclosure, further comprising: the first judgment module is used for judging whether the target webpage pointed by the link character is invalid or not before acquiring the current webpage information of the target webpage; the non-updating module is used for not updating the second content at the specified position of the current document when the target webpage pointed by the link character is invalid; the acquisition module is used for acquiring the current webpage information of the target webpage when the target webpage pointed by the link character is effective.
In one embodiment of the present disclosure, further comprising: the second judgment module is used for judging whether the URL type of the link character meets a preset condition or not before analyzing the link character; the prompting module is used for prompting danger warning when the preset condition is not met; and the analysis module is used for analyzing the link character when the preset condition is met.
To achieve the above object, an embodiment of a third aspect of the present disclosure provides a computer-readable storage medium, having a computer program stored thereon, where the program is executed by a processor to: receiving an input preset instruction in a current document, and generating an input interface; receiving input first content in the input interface, and analyzing a link character after the first content is the link character, wherein the first content has a first format attribute; extracting webpage information of a target webpage pointed by the link characters; and generating second content according to the webpage information, and loading the second content to the specified position of the current document, wherein the second content has a second format attribute.
Additional aspects and advantages of the disclosure will be set forth in part in the description which follows and, in part, will be obvious from the description, or may be learned by practice of the disclosure.
Drawings
The foregoing and/or additional aspects and advantages of the present disclosure will become apparent and readily appreciated from the following description of the embodiments, taken in conjunction with the accompanying drawings of which:
FIG. 1 is a flowchart illustrating a method for embedding a web page in a document according to a first embodiment of the present disclosure;
FIG. 2 is a flowchart illustrating a method for embedding a web page in a document according to a second embodiment of the present disclosure;
FIG. 3 is a block diagram illustrating an apparatus for embedding a web page in a document according to a second embodiment of the present disclosure;
FIG. 4 is a schematic structural diagram of an apparatus for embedding a web page in a document according to a second embodiment of the present disclosure;
FIG. 5 is a schematic structural diagram of an apparatus for embedding a web page in a document according to a third embodiment of the present disclosure;
FIG. 6 is a schematic structural diagram of an apparatus for embedding a web page in a document according to a fourth embodiment of the present disclosure;
fig. 7 is a schematic structural diagram of an electronic device for a method of embedding a web page in a document according to an embodiment of the present disclosure.
Detailed Description
Reference will now be made in detail to the embodiments of the present disclosure, examples of which are illustrated in the accompanying drawings, wherein like or similar reference numerals refer to the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the drawings are exemplary and intended to be illustrative of the present disclosure, and should not be construed as limiting the present disclosure.
The following describes a method and an apparatus for embedding a web page in a document according to an embodiment of the present disclosure with reference to the drawings.
FIG. 1 is a flowchart illustrating a method for embedding a web page in a document according to an embodiment of the disclosure.
As shown in fig. 1, the method for embedding a web page in a document includes the following steps:
step 101, receiving an input preset instruction in a current document, and generating an input interface.
In practical application, when a user needs to embed webpage content into a current document, a specific website identifier is usually called up through a toolbar menu or a "/" mode, and then a webpage link is converted into a webpage through the website identifier, so that the webpage content is embedded into the current document. In order to solve the problems of complex embedded operation and poor user experience in the related technology, the preset instruction is input at the position where the current document needs to be embedded into the webpage content, so that the webpage embedded operation can be directly triggered by the input instruction, a specific website identifier does not need to be called through a toolbar to perform webpage embedded operation, the toolbar form in the document is effectively reduced, simplicity and convenience are realized, and the user experience is improved.
The preset instruction may be a character used for evoking an embedded button of a web page, for example, an "@" character, and of course, the user may also set the character used for evoking the embedded button of the web page according to a use habit, which is not specifically limited herein.
Use the '@' character as an example, when the user need imbed webpage content in current document, can directly input the '@' character in the position department that current document needs to imbed webpage content, and then when discernment input character is the '@' character, can judge that user operation is the embedded operation of webpage, then trigger embedded operation, and generate the input interface who is used for the input website, and need not to arouse specific website recognizer through the toolbar and carry out the embedded operation of webpage, effectively alleviate the toolbar form in the document, and is simple and convenient, promote user experience.
In the embodiment of the present disclosure, after receiving the input first instruction in the current document, the method further includes: judging whether a user triggers a webpage embedded button or not; and if the webpage embedded button is triggered, generating an input interface, otherwise, not responding to the webpage embedded operation.
In practical application, when a user needs to embed webpage content in a current document, firstly, the user can directly call a function panel after inputting a '@' character so as to further determine whether the user needs to embed a webpage, if the user selects a webpage embedded button, an input interface for inputting a website is generated, if the user does not select the webpage embedded button, no webpage embedded operation is responded, and if the input information of the user is '@ + website', the user can input the website.
It should be noted that, when the user needs to embed other content in the current document, the user can also directly call the function panel by inputting a preset instruction, that is, the function panel may include other buttons, such as a picture embedded button, a form embedded button, and the like, in addition to the webpage embedded button, so that the user can select a specific operation according to the actual use requirement. For example, the user needs to embed a form in the current document, and selects a form embedding button after calling up the function panel, thereby performing a form embedding operation. In addition, if the user needs to input the character itself, no operation may be selected.
For example, the function panel is invoked after the user inputs the "@" character, wherein the function panel may include various embedded buttons, and when the user needs to embed a web page in the current document, the user clicks the embedded button of the web page to generate an input interface for inputting a web address. Of course, the user can select other operation buttons on the panel according to actual operation requirements. In addition, if the user needs to enter the "@" character itself, the panel may be closed directly.
Step 102, receiving input first content in an input interface, and analyzing a link character after the first content is the link character, wherein the first content has a first format attribute.
Wherein, the link character is a character forming a website to link a webpage according to the link character; the first format attribute may be a web address attribute.
Specifically, after the first content is identified, it is necessary to further determine a format attribute that the first content has, and if the format attribute is not the first format attribute, no operation is responded; if the first format attribute is the first format attribute, for example, the first content has the attribute of being a web address, the first content may be determined as a link character, and the link character may be further parsed to link the web page through the link character.
Further, before parsing the link character, the method further includes: judging whether the URL type of the link character meets a preset condition or not; if the preset condition is met, analyzing the link character; and if the preset condition is not met, prompting a danger warning.
The technical personnel in the art can set the preset conditions according to the actual situation, which is not specifically limited herein, for example, regular expression technology can be adopted to judge whether the URL type is a safe URL type.
That is to say, the present disclosure can identify all safe web page links, and effectively solve the problem that a "/" mode in the related art invokes a specific web site identifier to perform web page embedding operation and can only identify a specific web site, after the present disclosure directly triggers web page embedding operation through link characters, if the link characters are unsafe links, the present disclosure directly reminds a user that the links are dangerous, and can warn the user that the links are dangerous through various modes, for example, the present disclosure can prompt the user that the links are unsafe through a pop-up window mode, and certainly, can prompt the user through other modes, and is not specifically limited herein.
For example, when the link character is judged to be an unsafe link, the user is prompted directly in a popup mode. The link is noticed to have danger, and the user selects whether to continue to operate according to the danger warning, so that when the link is judged to be unsafe, the user is reminded of unsafe connection, and the use experience of the user is improved.
Of course, if the link character is safe, the link character is analyzed, for example, the link character is converted into a corresponding Iframe HTML code, so that the applicability of link character recognition is effectively improved, and the user is promoted.
And 103, extracting webpage information of the target webpage pointed by the link character.
Specifically, after the link character is parsed and linked to the target webpage through the link character, webpage information of the target webpage, such as video, data table, map orientation, and the like, is extracted.
And 104, generating second content according to the webpage information, and loading the second content to the specified position of the current document, wherein the second content has a second format attribute.
The second format attribute may be a web page attribute.
Specifically, after the webpage information is extracted, second content is generated according to the webpage attribute, and the format attribute of the second content is further judged, if the format attribute is not the second format attribute, the second content is not loaded, and the user can regenerate according to the webpage information or regenerate after regenerating the webpage information; if the second format attribute is the second format attribute, for example, the second content has a web page attribute, that is, the second content is an embedded web page, the embedded web page is directly loaded into the current document, so that the content of the web page link in the document can be directly viewed without secondary skip, for example, the web page is viewed, the video is played, and the like, and further, the content form of the document can be enriched, and the user experience is improved.
The method for embedding the web page in the document is further described by a specific example.
In a first example of the present disclosure, the preset instruction takes an "@" character as an example, and specifically includes:
when the user need imbed webpage content in current document, at first, directly need imbed webpage content's position department input "@" character at current document, and then arouse the function panel through "@" to the user can directly trigger the embedded operation of webpage through "@" character, need not to arouse specific website recognizer through the toolbar and carry out the embedded operation of webpage, effectively alleviates the toolbar form in the document, and is simple convenient, promotes user's use and experiences. Then, the user clicks a webpage embedded button, then pastes the copied webpage link in a dialog box of the input interface, and clicks a "conform" button. Finally, the embedded webpage is generated, so that a user can directly view the webpage, play videos and the like in the document, then the user can directly load the embedded webpage into the current document, the content of the webpage link in the document can be directly viewed without secondary skip, the content form of the document is enriched, and the use experience of the user is improved.
In a second example of the present disclosure, the preset instruction takes an "@" character as an example, and specifically includes:
step a, monitoring a keyboard keydown event of an editor, and calling a response function when the input character is judged to be '@'.
And b, calculating the current cursor position, and displaying the URL input floating frame at the position.
Step c, after a user inputs a URL and clicks a confirmation button, judging whether the URL is a safe URL type by adopting a regular expression technology, and if so, executing an Iframe insertion program; if not, the danger warning is prompted.
And d, converting the URL character string into a corresponding Iframe HTML code.
Step e, calling a browser API execCommand ('InsertHTML'), and inserting the generated HTML code into the editor.
And f, rendering the browser to display the embedded webpage content.
According to the method for embedding the webpage in the document, which is provided by the embodiment of the disclosure, the webpage embedding operation can be directly triggered by an input instruction, so that the embedded webpage can be directly generated in the current document according to the webpage link, a specific website identifier does not need to be called through a toolbar to perform the webpage embedding operation, the toolbar form in the document is effectively reduced, the method is convenient and fast, all safe webpage links can be identified, the problem that the specific website can only be identified by a '/' mode in the related technology is effectively solved, the embedded webpage can be directly loaded into the current document, the content of the webpage link in the document can be directly checked without secondary skip, the content form of the document can be enriched, the user experience can be improved, and the method is simple and easy to implement.
Based on the previous embodiment, the embodiment of the present disclosure further provides another method for embedding a web page in a document, so as to explain how to update the embedded web page in real time.
As shown in fig. 2, an embodiment of the present disclosure further provides a method for embedding a web page in a document, including the following steps:
step 201, receiving an input preset instruction in a current document, and generating an input interface.
Step 202, receiving input first content in the input interface, and after the first content is a link character, analyzing the link character, wherein the first content has a first format attribute.
Step 203, extracting the webpage information of the target webpage pointed by the link character.
And 204, generating second content according to the webpage information, and loading the second content to the specified position of the current document, wherein the second content has a second format attribute.
The description of steps 201-204 can refer to the description of steps 101-104.
In practical applications, since the web page information is updated in real time, in order to ensure that the second content of the current document is not distorted, the second content may be updated in real time after the second content is loaded into the current document. And step 205 is performed before updating the second content.
Step 205, judging whether the target webpage pointed by the link character is invalid, if so, executing step 206; if so, step 207 is performed.
If the document is invalid, the second content at the specified position of the current document is not updated, step 206.
That is, if the target web page pointed to by the link character is invalid, for example, the target web page does not exist, the second content is not updated.
Step 207, if the current webpage information of the target webpage is valid, the current webpage information of the target webpage is collected.
That is, the second content may be updated while the target web page pointed to by the link character is valid. When the second content is updated, first, the current webpage information of the target webpage can be obtained according to the link character, and then the current webpage information of the target webpage is collected.
In the embodiment of the disclosure, an updating instruction of a user is received, and current webpage information is collected according to the updating instruction; and/or acquiring current webpage information after a preset time length; and/or, collecting current web page information when a user opens a document.
That is to say, when the second content is updated, there are many ways to trigger the current webpage information collection, and one or more ways described above may be adopted to collect the current webpage information, which is not limited herein.
The (1) user may send the update instruction by clicking an update button, or may send the update instruction by another method, which is not limited specifically herein. For example, the user needs to update the second content, and may directly click an update button on the second content, so that an update instruction may be sent to collect current web page information. (2) The preset time duration can be set to be half an hour, one hour and the like, and a person skilled in the art can specifically set the preset time duration according to the webpage updating rule, and the preset time duration is not specifically limited, so that the current webpage information is automatically acquired after the preset time is reached. It should be noted that, acquiring the current webpage information after the preset time duration means acquiring after the preset time duration after the second content is updated last time.
And step 208, updating the second content of the specified position of the current document according to the current webpage information.
Specifically, after the current webpage information is collected, the second content, namely the embedded webpage, is updated according to the current webpage information, so that real-time updating of the embedded webpage of the current document can be achieved, further, the embedded webpage content of the current document can be effectively guaranteed not to be distorted, and the use experience of a user is improved.
It should be noted that the updated second content may be automatically embedded into the current document, and the presentation form is automatically adjusted, so as to improve the user experience.
According to the method for embedding the webpage in the document provided by the embodiment of the disclosure, the webpage embedding operation can be directly triggered by the input instruction, so that the webpage can be directly generated in the current document according to the webpage link without calling a specific website identifier through a toolbar to perform the webpage embedding operation, the toolbar form in the document is effectively lightened, the method is convenient and quick, all safe webpage links can be identified, the problem that the specific website can only be identified by the '/' mode in the related technology is effectively solved, the embedded webpage can be directly loaded into the current document, the content of the webpage link in the document can be directly checked without secondary skip, the content form of the document is effectively enriched, the embedded webpage in the current document can be updated in real time, the embedded webpage content in the current document is effectively ensured not to be distorted, and the use experience of a user is effectively improved, the method is simple and easy to realize.
Next, an apparatus for embedding a web page in a document according to an embodiment of the present disclosure is described with reference to the drawings.
FIG. 3 is a block diagram of an apparatus for embedding a web page in a document according to an embodiment of the present disclosure.
As shown in fig. 3, the apparatus 300 for embedding a web page in a document includes: a first generation module 310, a parsing module 320, an extraction module 330, and a second generation module 340.
The first generating module 310 is configured to receive an input preset instruction in a current document, and generate an input interface. The parsing module 320 is configured to receive an input first content in the input interface, and parse the link character after the first content is the link character, where the first content has a first format attribute. The extracting module 330 is configured to extract webpage information of a target webpage pointed by the link character. The second generating module 340 is configured to generate second content according to the web page information, and load the second content to a specified location of the current document, where the second content has a second format attribute.
In one embodiment of the present disclosure, receiving a web page inline request, the identifying module 310 includes: a judging unit and a receiving unit.
The judging unit is used for judging whether the input character is a preset link character or not when receiving the webpage embedded request. The receiving unit is used for detecting whether a webpage embedded button is triggered or not when the input character is a preset link character so as to receive a webpage embedded request after triggering.
In one embodiment of the present disclosure, as shown in fig. 4, the apparatus 300 of the embodiment of the present disclosure further includes: an acquisition module 350 and an update module 360.
The collecting module 350 is configured to collect current web page information of the target web page. The updating module 360 is configured to update the second content at the specified location of the current document according to the current webpage information.
In one embodiment of the present disclosure, the acquisition module 350 includes: the device comprises a first acquisition unit, a second acquisition unit and a third acquisition unit.
The first acquisition unit receives an update instruction of a user and acquires current webpage information according to the update instruction. And/or the second acquisition unit is used for acquiring the current webpage information after the preset time length. And/or the third acquisition unit acquires current webpage information when a user opens the document.
In one embodiment of the present disclosure, as shown in fig. 5, the apparatus 300 of the embodiment of the present disclosure further includes: a first decision block 370 and a no update block 380.
The first determining module 370 is configured to determine whether the target webpage pointed by the link character is invalid or not before collecting the current webpage information of the target webpage. The non-update module 380 is configured to not update the second content at the specified location of the current document when the target webpage pointed by the link character fails. The collecting module 350 is configured to collect current webpage information of the target webpage when the target webpage pointed by the link character is valid.
In one embodiment of the present disclosure, as shown in fig. 6, the apparatus 300 of the embodiment of the present disclosure further includes: a second decision module 390 and a prompt module 3100.
The second determining module 390 is configured to determine whether the URL type of the link character meets a preset condition before the link character is parsed. The prompting module 3100 is configured to prompt a hazard warning when a preset condition is not satisfied. The parsing module 320 is configured to parse the link character when a preset condition is met.
It should be noted that the explanation of the embodiment of the method for embedding a web page in a document is also applicable to the apparatus for embedding a web page in a document of the embodiment, and is not repeated here.
According to the device for embedding the webpage in the document, the webpage embedding operation can be directly triggered by the link characters, so that the embedded webpage is generated according to the webpage link, a specific website identifier does not need to be called through a toolbar to perform the webpage embedding operation, the shape of the toolbar in the document is effectively reduced, the device is convenient and quick, all safe webpage links can be identified, the problem that the '/' mode in the related technology can only identify a specific website is effectively solved, the embedded webpage can be directly loaded into the current document, the content of the webpage link in the document can be directly checked without secondary skip, the content shape of the document is effectively enriched, the embedded webpage in the current document can be updated in real time, the embedded webpage content is effectively guaranteed not to be distorted, the use experience of a user is effectively improved, and the device is simple and easy to implement.
In order to implement the foregoing embodiments, the present disclosure also provides a computer device, including a memory, a processor, and a computer program stored on the memory and executable on the processor, where the processor executes the program to:
receiving an input preset instruction in a current document, and generating an input interface;
receiving input first content in an input interface, and analyzing a link character after the first content is the link character, wherein the first content has a first format attribute;
extracting webpage information of a target webpage pointed by the link characters; and
and generating second content according to the webpage information, and loading the second content to the specified position of the current document, wherein the second content has a second format attribute.
Referring now to fig. 7, a schematic diagram of an electronic device (e.g., a terminal device or server) 700 suitable for use in implementing embodiments of the present disclosure is shown. The terminal device in the embodiments of the present disclosure may include, but is not limited to, a mobile terminal such as a mobile phone, a notebook computer, a digital broadcast receiver, a PDA (personal digital assistant), a PAD (tablet computer), a PMP (portable multimedia player), a vehicle terminal (e.g., a car navigation terminal), and the like, and a stationary terminal such as a digital TV, a desktop computer, and the like. The electronic device shown in fig. 7 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present disclosure.
As shown in fig. 7, electronic device 700 may include a processing means (e.g., central processing unit, graphics processor, etc.) 701 that may perform various appropriate actions and processes in accordance with a program stored in a Read Only Memory (ROM)702 or a program loaded from storage 708 into a Random Access Memory (RAM) 703. In the RAM 703, various programs and data necessary for the operation of the electronic apparatus 700 are also stored. The processing device 701, the ROM 702, and the RAM 703 are connected to each other by a bus 704. An input/output (I/O) interface 705 is also connected to bus 704.
Generally, the following devices may be connected to the I/O interface 705: input devices 706 including, for example, a touch screen, touch pad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc.; output devices 708 including, for example, a Liquid Crystal Display (LCD), speakers, vibrators, and the like; storage 708 including, for example, magnetic tape, hard disk, etc.; and a communication device 709. The communication means 709 may allow the electronic device 700 to communicate wirelessly or by wire with other devices to exchange data. While fig. 7 illustrates an electronic device 700 having various means, it is to be understood that not all illustrated means are required to be implemented or provided. More or fewer devices may alternatively be implemented or provided.
In particular, according to an embodiment of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method illustrated in the flow chart. In such embodiments, the computer program may be downloaded and installed from a network via the communication means 709, or may be installed from the storage means 708, or may be installed from the ROM 702. The computer program, when executed by the processing device 701, performs the above-described functions defined in the methods of the embodiments of the present disclosure.
It should be noted that the computer readable medium in the present disclosure can be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present disclosure, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In contrast, in the present disclosure, a computer readable signal medium may comprise a propagated data signal with computer readable program code embodied therein, either in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: electrical wires, optical cables, RF (radio frequency), etc., or any suitable combination of the foregoing.
The computer readable medium may be embodied in the electronic device; or may exist separately without being assembled into the electronic device.
The computer readable medium carries one or more programs which, when executed by the electronic device, cause the electronic device to: receiving an input preset instruction in a current document, and generating an input interface; receiving input first content in an input interface, and analyzing a link character after the first content is the link character, wherein the first content has a first format attribute; extracting webpage information of a target webpage pointed by the link characters; and generating second content according to the webpage information, and loading the second content to the specified position of the current document, wherein the second content has a second format attribute.
Alternatively, the computer readable medium carries one or more programs which, when executed by the electronic device, cause the electronic device to: receiving an input preset instruction in a current document, and generating an input interface; receiving input first content in an input interface, and analyzing a link character after the first content is the link character, wherein the first content has a first format attribute; extracting webpage information of a target webpage pointed by the link characters; and generating second content according to the webpage information, and loading the second content to the specified position of the current document, wherein the second content has a second format attribute.
Alternatively, the computer readable medium carries one or more programs which, when executed by the electronic device, cause the electronic device to: receiving an input preset instruction in a current document, and generating an input interface; receiving input first content in an input interface, and analyzing a link character after the first content is the link character, wherein the first content has a first format attribute; extracting webpage information of a target webpage pointed by the link characters; and generating second content according to the webpage information, and loading the second content to the specified position of the current document, wherein the second content has a second format attribute.
Alternatively, the computer readable medium carries one or more programs which, when executed by the electronic device, cause the electronic device to: receiving an input preset instruction in a current document, and generating an input interface; receiving input first content in an input interface, and analyzing a link character after the first content is the link character, wherein the first content has a first format attribute; extracting webpage information of a target webpage pointed by the link characters; and generating second content according to the webpage information, and loading the second content to the specified position of the current document, wherein the second content has a second format attribute.
Computer program code for carrying out operations for aspects of the present disclosure may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, Smalltalk, C + +, and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code 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).
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 code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, 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.
The units described in the embodiments of the present disclosure may be implemented by software or hardware. Where the name of a unit does not in some cases constitute a limitation of the unit itself, for example, the first retrieving unit may also be described as a "unit for retrieving at least two internet protocol addresses".

Claims (10)

1. A method for embedding a webpage in a document, which is characterized by comprising the following steps:
receiving an input preset instruction in a current document, and generating an input interface;
receiving input first content in the input interface, and analyzing a link character after the first content is the link character, wherein the first content has a first format attribute;
extracting webpage information of a target webpage pointed by the link characters; and
and generating second content according to the webpage information, and loading the second content to the specified position of the current document, wherein the second content has a second format attribute.
2. The method of claim 1, further comprising:
acquiring current webpage information of the target webpage;
and updating the second content of the specified position of the current document according to the current webpage information.
3. The method of claim 2, wherein the collecting current web page information of the target web page comprises:
receiving an updating instruction of a user, and acquiring the current webpage information according to the updating instruction; and/or
Acquiring the current webpage information after a preset time length; and/or
And collecting the current webpage information when a user opens the document.
4. The method of claim 2 or 3, further comprising, before collecting current web page information of the target web page:
judging whether the target webpage pointed by the link character is invalid or not;
if the document is invalid, not updating the second content at the specified position of the current document;
and if the current webpage information is valid, acquiring the current webpage information of the target webpage.
5. The method of claim 1, further comprising, prior to parsing the link character:
judging whether the URL type of the link character meets a preset condition or not;
if the preset condition is met, analyzing the link character;
and if the preset condition is not met, prompting a danger warning.
6. An apparatus for embedding a web page in a document, comprising:
the first generation module is used for receiving an input preset instruction in a current document and generating an input interface;
the analysis module is used for receiving input first content in the input interface and analyzing the link character after the first content is the link character, wherein the first content has a first format attribute;
the extraction module is used for extracting the webpage information of the target webpage pointed by the link character; and
and the second generating module is used for generating second content according to the webpage information and loading the second content to the specified position of the current document, wherein the second content has a second format attribute.
7. The apparatus of claim 6, further comprising:
the acquisition module is used for acquiring the current webpage information of the target webpage;
the updating module is used for updating the second content of the specified position of the current document according to the current webpage information; wherein,
the acquisition module comprises:
the first acquisition unit is used for receiving an updating instruction of a user and acquiring the current webpage information according to the updating instruction; and/or
The second acquisition unit is used for acquiring the current webpage information after a preset time length; and/or
And the third acquisition unit is used for acquiring the current webpage information when a user opens a document.
8. The apparatus of claim 7, further comprising:
the first judgment module is used for judging whether the target webpage pointed by the link character is invalid or not before acquiring the current webpage information of the target webpage;
the non-updating module is used for not updating the second content at the specified position of the current document when the target webpage pointed by the link character is invalid;
the acquisition module is used for acquiring the current webpage information of the target webpage when the target webpage pointed by the link character is effective.
9. The apparatus of claim 6, further comprising:
the second judgment module is used for judging whether the URL type of the link character meets a preset condition or not before analyzing the link character;
the prompting module is used for prompting danger warning when the preset condition is not met;
and the analysis module is used for analyzing the link character when the preset condition is met.
10. A computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the method according to any one of claims 1-5.
CN201910419567.5A 2019-05-20 2019-05-20 Method and device for embedding webpage in document Active CN110175302B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910419567.5A CN110175302B (en) 2019-05-20 2019-05-20 Method and device for embedding webpage in document

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910419567.5A CN110175302B (en) 2019-05-20 2019-05-20 Method and device for embedding webpage in document

Publications (2)

Publication Number Publication Date
CN110175302A true CN110175302A (en) 2019-08-27
CN110175302B CN110175302B (en) 2021-04-23

Family

ID=67691736

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910419567.5A Active CN110175302B (en) 2019-05-20 2019-05-20 Method and device for embedding webpage in document

Country Status (1)

Country Link
CN (1) CN110175302B (en)

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103353878A (en) * 2013-06-14 2013-10-16 陆昀 Method for displaying files of different file formats in webpage
CN103530574A (en) * 2013-09-23 2014-01-22 中山大学 Method for inserting and extracting hidden information based on English PDF document
CN104361071A (en) * 2014-11-12 2015-02-18 沈文策 Page preloading method and device
CN104750679A (en) * 2013-12-25 2015-07-01 明博教育科技有限公司 Resource loading method in webpage document editor
CN104978325A (en) * 2014-04-03 2015-10-14 腾讯科技(深圳)有限公司 Webpage processing method and device, and user terminal
CN106131109A (en) * 2016-06-08 2016-11-16 北京京东尚科信息技术有限公司 The method and apparatus of any cost caching in the embedded webpage of APP is realized based on http protocol
CN107168980A (en) * 2016-03-08 2017-09-15 阿里巴巴集团控股有限公司 Page display method and device
CN109739725A (en) * 2018-12-29 2019-05-10 云智慧(北京)科技有限公司 Monitoring method, device and system based on browser and storage medium

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103353878A (en) * 2013-06-14 2013-10-16 陆昀 Method for displaying files of different file formats in webpage
CN103530574A (en) * 2013-09-23 2014-01-22 中山大学 Method for inserting and extracting hidden information based on English PDF document
CN104750679A (en) * 2013-12-25 2015-07-01 明博教育科技有限公司 Resource loading method in webpage document editor
CN104978325A (en) * 2014-04-03 2015-10-14 腾讯科技(深圳)有限公司 Webpage processing method and device, and user terminal
CN104361071A (en) * 2014-11-12 2015-02-18 沈文策 Page preloading method and device
CN107168980A (en) * 2016-03-08 2017-09-15 阿里巴巴集团控股有限公司 Page display method and device
CN106131109A (en) * 2016-06-08 2016-11-16 北京京东尚科信息技术有限公司 The method and apparatus of any cost caching in the embedded webpage of APP is realized based on http protocol
CN109739725A (en) * 2018-12-29 2019-05-10 云智慧(北京)科技有限公司 Monitoring method, device and system based on browser and storage medium

Also Published As

Publication number Publication date
CN110175302B (en) 2021-04-23

Similar Documents

Publication Publication Date Title
CN109460233B (en) Method, device, terminal equipment and medium for updating native interface display of page
CN106358059B (en) Multimedia information processing method, equipment and system
EP4149108A1 (en) Method and apparatus for composite video filming, electronic device, and computer readable medium
CN111813641B (en) Method, device, medium and equipment for collecting crash information
CN108763297B (en) Webpage resource processing method and device and mobile terminal
CN110704102A (en) Page jump protocol interface document generation method, system, medium and electronic device
CN109510881A (en) Method, apparatus, electronic equipment and the readable storage medium storing program for executing of sharing files
CN113032172B (en) Abnormality detection method and device and electronic equipment
CN111177634A (en) Multi-language supporting file content loading method, device, equipment and medium
CN109902726B (en) Resume information processing method and device
CN111984888B (en) Page rendering method, device, electronic equipment and computer readable medium
CN109814915B (en) Parameter configuration method, device, medium and electronic equipment based on lua
CN109491908B (en) Page detection method and device, electronic equipment and storage medium
CN111818279A (en) Subtitle generating method, display method and interaction method
CN111382039A (en) Method, device, electronic equipment and storage medium for reporting user behavior event
CN113420159A (en) Target customer intelligent identification method and device and electronic equipment
CN110442806B (en) Method and apparatus for recognizing image
CN109992698B (en) Data processing method and device, electronic equipment and readable storage medium
CN110147283B (en) Display content switching display method, device, equipment and medium
CN110879975B (en) Personnel flow detection method and device and electronic equipment
CN110069186B (en) Method and equipment for displaying operation interface of application
CN110175302B (en) Method and device for embedding webpage in document
CN111124627B (en) Method and device for determining call initiator of application program, terminal and storage medium
CN111064844A (en) Message prompting method and device, electronic equipment and computer readable medium
CN111324835A (en) Method and device for rendering user interface component, electronic equipment 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
GR01 Patent grant
GR01 Patent grant
CP01 Change in the name or title of a patent holder
CP01 Change in the name or title of a patent holder

Address after: 100041 B-0035, 2 floor, 3 building, 30 Shixing street, Shijingshan District, Beijing.

Patentee after: Douyin Vision Co.,Ltd.

Address before: 100041 B-0035, 2 floor, 3 building, 30 Shixing street, Shijingshan District, Beijing.

Patentee before: Tiktok vision (Beijing) Co.,Ltd.

CP03 Change of name, title or address
CP03 Change of name, title or address

Address after: 100041 B-0035, 2 floor, 3 building, 30 Shixing street, Shijingshan District, Beijing.

Patentee after: Tiktok vision (Beijing) Co.,Ltd.

Address before: Room B0035, 2nd floor, No. 3 Courtyard, 30 Shixing Street, Shijingshan District, Beijing, 100041

Patentee before: BEIJING BYTEDANCE NETWORK TECHNOLOGY Co.,Ltd.