WO2021082661A1 - Webpage screenshot capturing method, apparatus and device - Google Patents

Webpage screenshot capturing method, apparatus and device Download PDF

Info

Publication number
WO2021082661A1
WO2021082661A1 PCT/CN2020/110733 CN2020110733W WO2021082661A1 WO 2021082661 A1 WO2021082661 A1 WO 2021082661A1 CN 2020110733 W CN2020110733 W CN 2020110733W WO 2021082661 A1 WO2021082661 A1 WO 2021082661A1
Authority
WO
WIPO (PCT)
Prior art keywords
screenshot
webpage
target
blockchain network
browser
Prior art date
Application number
PCT/CN2020/110733
Other languages
French (fr)
Chinese (zh)
Inventor
韩喆
Original Assignee
支付宝(杭州)信息技术有限公司
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 支付宝(杭州)信息技术有限公司 filed Critical 支付宝(杭州)信息技术有限公司
Publication of WO2021082661A1 publication Critical patent/WO2021082661A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/451Execution arrangements for user interfaces
    • 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/9566URL specific, e.g. using aliases, detecting broken or misspelled links
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/50Monitoring users, programs or devices to maintain the integrity of platforms, e.g. of processors, firmware or operating systems
    • G06F21/52Monitoring users, programs or devices to maintain the integrity of platforms, e.g. of processors, firmware or operating systems during program execution, e.g. stack integrity ; Preventing unwanted data erasure; Buffer overflow
    • G06F21/53Monitoring users, programs or devices to maintain the integrity of platforms, e.g. of processors, firmware or operating systems during program execution, e.g. stack integrity ; Preventing unwanted data erasure; Buffer overflow by executing in a restricted environment, e.g. sandbox or secure virtual machine

Definitions

  • One or more embodiments of this specification relate to the field of computer technology, and in particular to a method, device, and device for screenshotting a webpage.
  • the process of obtaining a screenshot of a webpage of a website may be as follows: first load the webpage based on the browser, and then directly transfer the loaded webpage as a picture.
  • the loading of a webpage is usually affected by many factors, when a screenshot of a webpage is obtained based on a traditional method, there will be a problem of inconsistent webpage screenshots. For example, when visiting the same webpage in different geographic locations, the webpages loaded by the browser may be inconsistent, resulting in inconsistent webpage screenshots. For another example, the loading of web pages will also be affected by the historical environment and so on.
  • One or more embodiments of this specification describe a method, device, and device for screenshots of webpages, which can ensure the accuracy of screenshots of webpages.
  • a webpage screenshot method including: a webpage screenshot server receives a user’s webpage screenshot request; the webpage screenshot request includes at least the URL address of the webpage to be screenshotted; the webpage screenshot server runs a mirror file of a sandbox environment to Start the first instance in the sandbox environment, and run the first browser in the first instance; wherein the first browser is encapsulated in the image file; the first browser after running In, the webpage screenshot server loads the webpage to be screenshot based on the URL address; the webpage screenshot server takes screenshots of the webpage to be screenshotted to obtain the target screenshot; the webpage screenshot server at least stores the target screenshot in the blockchain network .
  • a webpage screenshot device which includes: a receiving unit for receiving a webpage screenshot request from a user; the webpage screenshot request includes at least the URL address of the webpage to be screenshotted; an operating unit for running a sandbox environment Image file to start the first instance in the sandbox environment and run the first browser in the first instance; wherein the first browser is encapsulated in the image file; the loading unit is used to In the first browser after the running unit runs, load the webpage to be screenshot based on the URL address; the screenshot unit is used to screenshot the webpage to be screenshot loaded by the loading unit to obtain the target Screenshot; a storage unit for storing at least the target screenshot obtained by the screenshot unit by the screenshot unit in the blockchain network.
  • a web page screenshot device including: a memory; one or more processors; and one or more programs, wherein the one or more programs are stored in the memory and configured to be
  • the one or more processors execute, and when the program is executed by the processor, the following steps are implemented: receiving a user's web page screenshot request; the web page screenshot request includes at least the URL address of the web page to be screenshot; Image file to start the first instance in the sandbox environment, and run the first browser in the first instance; wherein, the first browser is encapsulated in the image file; In the first browser, load the webpage to be screenshot based on the URL address; take a screenshot of the webpage to be screenshot to obtain a target screenshot; at least store the target screenshot in a blockchain network.
  • a webpage screenshot system including: a plurality of webpage screenshot servers and blockchain networks as described in the first aspect.
  • the webpage screenshot device and device provided in one or more embodiments of this specification receive a user's webpage screenshot request, and the webpage screenshot request includes at least the URL address of the webpage to be screenshotted.
  • Run the image file of the sandbox environment to start the first instance in the sandbox environment, and run the first browser in the first instance.
  • the first browser is encapsulated in the image file.
  • load the webpage to be screenshot based on the URL address.
  • Figure 1 is a schematic diagram of the webpage screenshot system provided in this manual
  • Fig. 2 is a flowchart of a webpage screenshot method provided by an embodiment of this specification
  • FIG. 3 is a flowchart of a data storage method based on a blockchain network provided by an embodiment of this specification
  • Fig. 4 is a schematic diagram of a webpage screenshot device provided by an embodiment of this specification.
  • FIG. 5 is a schematic diagram of a data storage device based on a blockchain network provided by an embodiment of this specification
  • Figure 6 is a schematic diagram of a webpage screenshot device provided by an embodiment of this specification.
  • FIG. 7 is a schematic diagram of a data storage device based on a blockchain network provided by an embodiment of this specification.
  • the applicant In order to prevent the loading of web pages from being affected by the historical environment, the applicant considers to start the instance in the sandbox environment first. Examples here can include but are not limited to Docker containers or virtual machines, etc., and then run the specified browser in the launched instance. Load the web page to be screenshot.
  • the above-mentioned Docker container is started by developers who package the application and program dependencies into a portable Docker image file through the container (Docker) (an open source application container engine), and then run the Docker image file.
  • the application can run normally as if it were on a real physical machine.
  • it also has an isolation type.
  • the target screenshot obtained based on the above screenshot method may be at risk of being tampered with. Therefore, preventing the target screenshot from being tampered with has also become a problem to be solved.
  • Blockchain technology is an Internet database technology, which is characterized by decentralization, openness and transparency, immutability and trustworthiness. Therefore, this solution can introduce blockchain technology.
  • the webpage screenshot server may send the target screenshot to any first node among the multiple nodes of the blockchain network, so that the first node can verify the authenticity of the target screenshot.
  • the target screenshot is stored. It also makes the first node broadcast the target screenshot to other nodes in the blockchain network. As a result, the storage of the target screenshot in the blockchain network is realized, thereby avoiding the risk of tampering with the target screenshot.
  • Figure 1 is a schematic diagram of the webpage screenshot system provided in this manual.
  • the system can include a webpage screenshot server and a blockchain network.
  • the webpage screenshot server can receive the user's webpage screenshot request. After receiving the request, the webpage screenshot server can start the Docker container or virtual machine first, and then run the specified browser in the started Docker container or virtual machine to load the webpage to be screenshotted, and take a screenshot of the screenshot webpage to get Target screenshot. After obtaining the target screenshot, the web page screenshot server can store the target screenshot in the blockchain network.
  • the blockchain network in Fig. 1 may include multiple nodes, and any node can receive the above-mentioned target screenshot. After receiving the target screenshot, the node can verify its authenticity and store it when the verification passes. In addition, the node can also broadcast the target screenshot to other nodes in the blockchain network, so that other nodes can store the target node after the authenticity verification of the target node is passed, thereby achieving the target screenshot in Storage in the blockchain network.
  • the number of webpage screenshot servers in FIG. 1 may also be multiple. When there are more than one, the user can randomly select one of them to send a web page screenshot request. It is understandable that multiple web page screenshot servers can greatly increase the load of the web page screenshot system.
  • Fig. 2 is a flowchart of a webpage screenshot method provided by an embodiment of this specification.
  • the execution subject of the method may be a device with processing capability: a server or a system or a device, for example, it may be the webpage screenshot server in FIG. 1.
  • the method may specifically include steps 202 to 210.
  • Step 202 Receive a web page screenshot request from the user.
  • the webpage screenshot request may at least include the URL address of the webpage to be screenshotted.
  • it can also include user-defined screenshot rules.
  • the screenshot rule may at least include a target operation that needs to be performed on the webpage to be screenshot.
  • the target operation here may include, but is not limited to, a click operation, a close operation, a sliding operation, and so on.
  • it may also include a clipping area or a clipping pixel range, and so on.
  • the corresponding click operation can be defined in the screenshot rule.
  • the click operation can be specifically used to click a button in the webpage for loading the full text so that the bottom content of the webpage can be loaded.
  • the screenshot rule can also define the interception area: the bottom area and so on.
  • Step 204 Run the image file of the sandbox environment to start the first instance in the sandbox environment, and run the first browser in the first instance.
  • the first example may include, but is not limited to, a Docker container or a virtual machine.
  • the image file of the aforementioned sandbox environment can refer to a Docker image file, which can be pre-downloaded from the Docker image warehouse, for example, it can be a public image from Docker Hub The source is pre-downloaded.
  • a Docker image file which can be pre-downloaded from the Docker image warehouse, for example, it can be a public image from Docker Hub The source is pre-downloaded.
  • multiple Docker containers can usually be started, and the multiple Docker containers are isolated from each other.
  • the first browser and dependent packages may also be packaged in the Docker image file, that is, the first browser may be packaged in the Docker image file.
  • the first browser here can refer to any browser, for example, it can be a Chrome browser or a Safari browser.
  • other software such as puzzle software, can also be encapsulated in the above-mentioned Docker image file.
  • the image file of the virtual machine may also be encapsulated with the first browser and other software, which will not be repeated in this specification.
  • a Docker container can be started. In the started Docker container, you can run the browser or other software packaged in the Docker image. The browser or other software runs in a Docker container, just like it runs on a real physical machine.
  • a virtual machine when the image file of the virtual machine is running, a virtual machine can be started. In the started virtual machine, a browser or other software packaged in the image file of the virtual machine can also be run.
  • Step 206 Load the web page to be screenshot based on the URL address in the first browser after running.
  • the page content of the web page to be captured is rendered.
  • the screenshot rule can include the target operation that needs to be performed on the web page to be screenshot, then after loading the web page to be screenshot based on the URL address, you can also determine The target webpage after the target operation is performed on the webpage to be screenshotted, and in the first browser, the target webpage is used to replace the initially loaded webpage to be screenshotted.
  • the default screenshot rule may include operations that need to be performed for the webpage to be screenshotted. In addition, it may also include a clipping area or a clipping pixel range, and so on.
  • Step 208 Take a screenshot of the webpage to be screenshot to obtain a target screenshot.
  • the target webpage may be screenshotted here to obtain the target screenshot.
  • the first browser when the first browser is running in the Dcoker container, since the Dcoker container does not have a corresponding UI interface, it can directly take a screenshot of the webpage to be screenshot or the target webpage based on the screenshot function built in the first browser.
  • the first browser runs in a virtual machine
  • the virtual machine since the virtual machine has a corresponding UI interface, it is possible to take screenshots of the webpage to be screenshot or the target webpage based on the screenshot function built in the first browser. It can also be based on independent screenshot software to take screenshots of the webpage to be screenshot or the target webpage. It is understandable that when a screenshot is taken of the webpage to be screenshot or the target webpage through the independent screenshot software, the independent screenshot software can be encapsulated in the image file of the virtual machine.
  • the process of taking the screenshot of the webpage to be screenshot or the target webpage in this step can be: based on the interception area or the interception pixel range, perform the screenshot for the webpage or the target webpage. Take a screenshot to get the target screenshot.
  • step 210 at least the target screenshot is stored in the blockchain network.
  • the storage process may specifically be: sending the target screenshot to any first node among the multiple nodes of the blockchain network, so that the first node stores the target screenshot after passing the authenticity verification of the target screenshot. It also makes the first node broadcast the target screenshot to other nodes in the blockchain network. After receiving the target screenshot, other nodes can also verify the authenticity of the target screenshot, and store the target screenshot when the verification passes.
  • the authenticity verification process can be: The public key is used to verify the digitally signed target screenshot.
  • the authenticity verification process can be: sending a screenshot query request to the web screenshot server, and the screenshot query The request is used to instruct the webpage screenshot server to find the target screenshot from the corresponding cache record.
  • the query result indicating that the target screenshot is found is received, the authenticity verification of the target screenshot is passed.
  • the first node when it stores the target screenshot locally, it will generate a corresponding hash value for the target screenshot to identify the target screenshot. After the hash value of the target screenshot is generated, the first node may return the hash value to the user through the web page screenshot server, so that the user can extract the above-mentioned target screenshot based on the hash value.
  • the hash value corresponding to the block body is generated.
  • the hash value is the hash value corresponding to the target screenshot.
  • PreHash hash value of the previous block body
  • Hash hash value of this block body
  • TimeStamp time stamp
  • the storage of target screenshots can also be realized based on smart contracts.
  • a smart contract for realizing the target screenshot storage function can be pre-written, and then the first node can call the smart contract.
  • the incoming parameter of this call can be the image data of the target screenshot.
  • the corresponding hash value can be generated for the target screenshot.
  • the calling process of the smart contract by the first node can be recorded as a transaction.
  • the transaction record here can contain the above hash value. Therefore, the first node can store the transaction in the corresponding block. After that, the user can extract the target screenshot based on the transaction record and the hash value in it.
  • the above process of extracting the target screenshot by the user may specifically be as follows: the first node receives the user's screenshot extraction request, and the screenshot extraction request includes at least the hash value of the target screenshot. Based on the hash value, find the target screenshot. Return the target screenshot to the user.
  • the user can send a screenshot extraction request to each node in the blockchain network; after that, if more than half of the nodes can find the target screenshot, then the target screenshot can be real Credible.
  • the loading of a webpage may also be affected by the loading time, that is to say, for the same webpage, the corresponding loading results may be inconsistent at different times. Therefore, in this solution, after taking a screenshot of the webpage to be screenshot or the target webpage, the screenshot time when the screenshot operation is performed can also be obtained. After that, the target screenshot and the screenshot time are stored together in the blockchain network. The stored procedures of the two are similar to those of the target screenshot, so I won’t repeat them here.
  • the solution provided by the embodiment of this specification is not only applicable to the scene of webpage screenshots, but theoretically, it can be applicable as long as it has a credible but unstable third-party service.
  • it can be applied to the scenario of electronic voucher storage.
  • the electronic vouchers here can include but are not limited to video streams and so on.
  • the embodiment of this specification can ensure that the rendering of the webpage will not be affected by the loading of the webpage before and after by starting the example. That is, it can ensure that the mutual influence between tasks is reduced, and processor resources can be reused at the same time.
  • the screenshot process can be decoupled from the stored procedure, so that the screenshot resource can be dynamically expanded.
  • the results of the screenshot of the web page can be kept fresh and the content obtained can be trusted.
  • Fig. 3 is a flowchart of a data storage method based on a blockchain network provided by an embodiment of this specification.
  • the execution subject of the method may be any first node among multiple nodes in the blockchain network of FIG. 1.
  • the method may specifically include steps 302 to 308.
  • Step 302 Receive the target screenshot sent by the webpage screenshot server.
  • the target screenshot here is the target screenshot mentioned in the above embodiment, which will not be repeated in this specification.
  • Step 304 Perform authenticity verification on the target screenshot.
  • the authenticity verification process can be: The public key is used to verify the digitally signed target screenshot.
  • the authenticity verification process can be: sending a screenshot query request to the web screenshot server, and the screenshot query The request is used to instruct the webpage screenshot server to find the target screenshot from the corresponding cache record.
  • the query result indicating that the target screenshot is found is received, the authenticity verification of the target screenshot passes.
  • Step 306 After the verification is passed, the target screenshot is stored.
  • Step 308 Send the target screenshot to other nodes among the multiple nodes, so that the other nodes store the target screenshot.
  • other nodes may also verify the authenticity of the target screenshot first, and store the target screenshot after the verification is passed.
  • the first node when it stores the target screenshot locally, it will generate a corresponding hash value for the target screenshot to identify the target screenshot. After generating the hash value of the target screenshot, the first node can return the hash value to the user through the web page screenshot server, so that the user can extract the target screenshot based on the hash value.
  • the above process of extracting the target screenshot by the user may specifically be as follows: the first node receives the user's screenshot extraction request, and the screenshot extraction request includes at least the hash value of the target screenshot. Based on the hash value, find the target screenshot. Return the target screenshot to the user.
  • the user can send a screenshot extraction request to each node in the blockchain network; after that, if more than half of the nodes can find the target screenshot, then the target screenshot can be real Credible.
  • blockchain network-based data storage method provided in the embodiments of this specification is not only applicable to scenarios where webpage screenshots are stored, but also scenarios where electronic vouchers such as video streams are stored, which is not limited in this specification.
  • the data storage method based on the blockchain network provided by the embodiments of this specification can ensure the authenticity and long-term fidelity of the stored data.
  • an embodiment of this specification also provides a webpage screenshot device.
  • the device may include:
  • the receiving unit 402 is configured to receive a web page screenshot request from the user.
  • the webpage screenshot request includes at least the URL address of the webpage to be screenshotted.
  • the running unit 404 is configured to run the image file of the sandbox environment to start the first instance in the sandbox environment, and run the first browser in the first instance.
  • the first browser is encapsulated in the above-mentioned image file.
  • the first instance here may include any of the following: Docker container and virtual machine.
  • the loading unit 406 is configured to load the webpage to be screenshot based on the URL address in the first browser after the running unit 404 runs.
  • the screenshot unit 408 is used to screenshot the webpage to be screenshot loaded by the loading unit 406 to obtain a target screenshot.
  • the storage unit 410 is configured to store at least the target screenshot obtained by the screenshot by the screenshot unit 408 in the blockchain network.
  • the blockchain network may include multiple nodes.
  • the storage unit 410 may be specifically configured to send the target screenshot to any first node among the multiple nodes of the blockchain network, so that the first node stores the target screenshot after the authenticity of the target screenshot is verified. It also makes the first node broadcast the target screenshot to other nodes in the blockchain network.
  • the storage unit 410 may also be specifically used to: use a pre-stored signature private key to digitally sign the target screenshot. Send a digitally signed target screenshot to any first node among multiple nodes in the blockchain network.
  • the webpage screenshot request may also include a user-defined screenshot rule, and the screenshot rule may at least include a target operation that needs to be performed on the webpage to be screenshotted.
  • the screenshot unit 408 may be specifically used to determine the target webpage after the target operation is performed on the webpage to be screenshotted. Take a screenshot of the target webpage to get the target screenshot.
  • the above-mentioned screenshot rule may also include an intercepted area or an intercepted pixel range.
  • the screenshot unit 408 may also be specifically used to: take a screenshot of the target webpage based on the intercepted area or the intercepted pixel range to obtain the target screenshot.
  • the device may further include: an acquiring unit (not shown in the figure), configured to acquire the screenshot time when the webpage to be screenshot is screenshotd.
  • an acquiring unit (not shown in the figure), configured to acquire the screenshot time when the webpage to be screenshot is screenshotd.
  • the storage unit 410 may be specifically used to store the target screenshot and the screenshot time in the blockchain network.
  • the receiving unit 402 receives a user's webpage screenshot request.
  • the webpage screenshot request includes at least the URL address of the webpage to be screenshotted.
  • the running unit 404 runs the image file of the sandbox environment to start the first instance in the sandbox environment and run the first browser in the first instance. Wherein, the first browser is encapsulated in the above-mentioned image file.
  • the loading unit 406 loads the web page to be captured based on the URL address in the first browser after running.
  • the screenshot unit 408 performs a screenshot of the webpage to be screenshot to obtain a target screenshot.
  • the storage unit 410 at least stores the target screenshot in the blockchain network. As a result, the accuracy of web page screenshots can be ensured. In addition, it can also ensure the reliability of web page screenshot results storage.
  • the webpage screenshot device provided in an embodiment of this specification may be a module or unit of the webpage screenshot server in FIG. 1.
  • an embodiment of this specification also provides a data storage device based on the blockchain network.
  • the device may include: a receiving unit 502, To receive the target screenshot sent by the web screenshot server.
  • the target screenshot is obtained by the webpage screenshot server by taking a screenshot of the webpage to be screenshot loaded based on the first browser, where the first browser runs in the first instance started by the webpage screenshot server in the sandbox environment.
  • the verification unit 504 is used to verify the authenticity of the target screenshot.
  • the storage unit 506 is configured to store the target screenshot after the verification by the verification unit 504 is passed.
  • the sending unit 508 is configured to send the target screenshot to other nodes, so that other nodes can store the target screenshot.
  • the above-mentioned target screenshot is digitally signed via the webpage screenshot server using a pre-stored signature private key.
  • the verification unit 504 may be specifically used to verify the signature of the target screenshot through the pre-stored public key corresponding to the signature private key.
  • the target screenshot is stored.
  • the verification unit 504 may also be specifically configured to send a screenshot query request to the web page screenshot server, where the screenshot query request is used to instruct the web page screenshot server to find the target screenshot from the corresponding cache record.
  • the device may further include: a search unit (not shown in the figure).
  • a search unit (not shown in the figure).
  • the receiving unit 502 is also configured to receive a screenshot extraction request from the user, where the screenshot extraction request includes at least the hash value of the target screenshot.
  • the hash value is generated by the first node in the process of storing the target screenshot.
  • the search unit is used to find the target screenshot based on the hash value.
  • the sending unit 508 is also used to return the target screenshot to the user.
  • the data storage device based on the blockchain network provided in an embodiment of this specification can ensure the authenticity and long-term fidelity of the stored data.
  • the data storage device based on the blockchain network provided in an embodiment of this specification may be a module or unit in any node in the blockchain network of FIG. 1.
  • the embodiment of this specification also provides a webpage screenshot device.
  • the device may include: a memory 602, one or more processors 604, and one or more programs.
  • the one or more programs are stored in the memory 602 and are configured to be executed by one or more processors 604.
  • the programs are executed by the processor 604, the following steps are implemented: receiving a user's webpage screenshot request, and the webpage screenshot The request includes at least the URL address of the web page to be screenshot; the mirror file of the sandbox environment is run to start the first instance in the sandbox environment, and the first browser is run in the first instance.
  • the first browser is encapsulated in the above image file; in the first browser after running, load the webpage to be screenshot based on the URL address; take screenshots of the webpage to be screenshotted to obtain the target screenshot; at least store the target screenshot in the block Chain network.
  • the webpage screenshot device provided in an embodiment of this specification can ensure the accuracy of webpage screenshots.
  • the embodiment of this specification also provides a data storage device based on the blockchain network.
  • the device may include: a memory 702, one or more A processor 704 and one or more programs.
  • the one or more programs are stored in the memory 702 and are configured to be executed by one or more processors 704.
  • the programs are executed by the processor 704, the following steps are implemented: receiving a target screenshot sent by a webpage screenshot server.
  • the target screenshot is obtained by the webpage screenshot server by taking a screenshot of the webpage to be screenshot loaded based on the first browser.
  • the first browser runs in the first instance started in the sandbox environment by the webpage screenshot server.
  • the target screenshot is stored.
  • the data storage device of the blockchain network provided in an embodiment of this specification can ensure the authenticity and long-term fidelity of the stored data.
  • the steps of the method or algorithm described in combination with the disclosure of this specification may be implemented in a hardware manner, or may be implemented in a manner in which a processor executes software instructions.
  • Software instructions can be composed of corresponding software modules, which can be stored in RAM memory, flash memory, ROM memory, EPROM memory, EEPROM memory, registers, hard disk, mobile hard disk, CD-ROM or any other form of storage known in the art Medium.
  • An exemplary storage medium is coupled to the processor, so that the processor can read information from the storage medium and write information to the storage medium.
  • the storage medium may also be an integral part of the processor.
  • the processor and the storage medium may be located in the ASIC.
  • the ASIC may be located in the server.
  • the processor and the storage medium may also exist as discrete components in the server.
  • the functions described in the present invention can be implemented by hardware, software, firmware, or any combination thereof.
  • these functions can be stored in a computer-readable medium or transmitted as one or more instructions or codes on the computer-readable medium.
  • the computer-readable medium includes a computer storage medium and a communication medium, where the communication medium includes any medium that facilitates the transfer of a computer program from one place to another.
  • the storage medium may be any available medium that can be accessed by a general-purpose or special-purpose computer.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Security & Cryptography (AREA)
  • Databases & Information Systems (AREA)
  • Human Computer Interaction (AREA)
  • Computer Hardware Design (AREA)
  • Data Mining & Analysis (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

Provided are a webpage screenshot capturing method, apparatus and device. The webpage screenshot capturing method comprises: receiving a webpage screenshot capturing request from a user, wherein the webpage screenshot capturing request at least comprises a URL address of a webpage to be subjected to screenshot capturing; running a mirror image file of a sandbox environment to start a first instance in the sandbox environment, and running a first browser in the first instance, wherein the first browser is encapsulated in the mirror image file; in the run first browser, loading said webpage on the basis of a URL address; performing screenshot capturing on said webpage so as to obtain a target screenshot; and at least storing the target screenshot in a blockchain network.

Description

网页截图方法、装置及设备Webpage screenshot method, device and equipment 技术领域Technical field
本说明书一个或多个实施例涉及计算机技术领域,尤其涉及一种网页截图方法、装置以及设备。One or more embodiments of this specification relate to the field of computer technology, and in particular to a method, device, and device for screenshotting a webpage.
背景技术Background technique
目前以文本、图片为主的版权保护领域,网站侵权是最常见的现象。而在针对网站侵权进行诉讼时,最大的诉求就是侵权证据的获取。这里的侵权证据可以是指对侵权网站的网页截图。At present, in the field of copyright protection where texts and pictures are the mainstay, website infringement is the most common phenomenon. In litigation against website infringement, the biggest appeal is to obtain evidence of infringement. The evidence of infringement here can refer to a screenshot of the webpage of the infringing website.
传统技术中,网站的网页截图的获取过程可以为:先基于浏览器加载网页,然后直接将加载后的网页转存为图片。然而由于网页的加载通常会受多方面因素的影响,因此,在基于传统的方法获取网页截图时,会存在网页截图不一致的问题。比如,当在不同的地理位置,访问同一网页时,浏览器加载的网页可能会不一致,从而导致获取的网页截图也不一致。再比如,网页的加载还会受到历史环境的影响等等。In traditional technology, the process of obtaining a screenshot of a webpage of a website may be as follows: first load the webpage based on the browser, and then directly transfer the loaded webpage as a picture. However, since the loading of a webpage is usually affected by many factors, when a screenshot of a webpage is obtained based on a traditional method, there will be a problem of inconsistent webpage screenshots. For example, when visiting the same webpage in different geographic locations, the webpages loaded by the browser may be inconsistent, resulting in inconsistent webpage screenshots. For another example, the loading of web pages will also be affected by the historical environment and so on.
因此,需要提供一种更可靠的网页截图方法。Therefore, it is necessary to provide a more reliable method for taking screenshots of web pages.
发明内容Summary of the invention
本说明书一个或多个实施例描述了一种网页截图方法、装置以及设备,可以确保网页截图的准确性。One or more embodiments of this specification describe a method, device, and device for screenshots of webpages, which can ensure the accuracy of screenshots of webpages.
第一方面,提供了一种网页截图方法,包括:网页截图服务器接收用户的网页截图请求;所述网页截图请求至少包括待截图网页的URL地址;网页截图服务器运行沙箱环境的镜像文件,以在沙箱环境中启动第一实例,并在所述第一实例中运行第一浏览器;其中,所述镜像文件中封装有所述第一浏览器;在运行后的所述第一浏览器中,网页截图服务器基于所述URL地址加载所述待截图网页;网页截图服务器对所述待截图网页进行截图,以得到目标截图;网页截图服务器至少将所述目标截图存储到区块链网络中。In the first aspect, a webpage screenshot method is provided, including: a webpage screenshot server receives a user’s webpage screenshot request; the webpage screenshot request includes at least the URL address of the webpage to be screenshotted; the webpage screenshot server runs a mirror file of a sandbox environment to Start the first instance in the sandbox environment, and run the first browser in the first instance; wherein the first browser is encapsulated in the image file; the first browser after running In, the webpage screenshot server loads the webpage to be screenshot based on the URL address; the webpage screenshot server takes screenshots of the webpage to be screenshotted to obtain the target screenshot; the webpage screenshot server at least stores the target screenshot in the blockchain network .
第二方面,提供了一种网页截图装置,包括:接收单元,用于接收用户的网页截图请求;所述网页截图请求至少包括待截图网页的URL地址;运行单元,用于运行沙箱环境的镜像文件,以在沙箱环境中启动第一实例,并在所述第一实例中运行第一浏览器; 其中,所述镜像文件中封装有所述第一浏览器;加载单元,用于在所述运行单元运行后的所述第一浏览器中,基于所述URL地址加载所述待截图网页;截图单元,用于对所述加载单元加载的所述待截图网页进行截图,以得到目标截图;存储单元,用于至少将所述截图单元截图得到的所述目标截图存储到区块链网络中。In a second aspect, a webpage screenshot device is provided, which includes: a receiving unit for receiving a webpage screenshot request from a user; the webpage screenshot request includes at least the URL address of the webpage to be screenshotted; an operating unit for running a sandbox environment Image file to start the first instance in the sandbox environment and run the first browser in the first instance; wherein the first browser is encapsulated in the image file; the loading unit is used to In the first browser after the running unit runs, load the webpage to be screenshot based on the URL address; the screenshot unit is used to screenshot the webpage to be screenshot loaded by the loading unit to obtain the target Screenshot; a storage unit for storing at least the target screenshot obtained by the screenshot unit by the screenshot unit in the blockchain network.
第三方面,提供了一种网页截图设备,包括:存储器;一个或多个处理器;以及一个或多个程序,其中所述一个或多个程序存储在所述存储器中,并且被配置成由所述一个或多个处理器执行,所述程序被所述处理器执行时实现以下步骤:接收用户的网页截图请求;所述网页截图请求至少包括待截图网页的URL地址;运行沙箱环境的镜像文件,以在沙箱环境中启动第一实例,并在所述第一实例中运行第一浏览器;其中,所述镜像文件中封装有所述第一浏览器;在运行后的所述第一浏览器中,基于所述URL地址加载所述待截图网页;对所述待截图网页进行截图,以得到目标截图;至少将所述目标截图存储到区块链网络中。In a third aspect, a web page screenshot device is provided, including: a memory; one or more processors; and one or more programs, wherein the one or more programs are stored in the memory and configured to be The one or more processors execute, and when the program is executed by the processor, the following steps are implemented: receiving a user's web page screenshot request; the web page screenshot request includes at least the URL address of the web page to be screenshot; Image file to start the first instance in the sandbox environment, and run the first browser in the first instance; wherein, the first browser is encapsulated in the image file; In the first browser, load the webpage to be screenshot based on the URL address; take a screenshot of the webpage to be screenshot to obtain a target screenshot; at least store the target screenshot in a blockchain network.
第四方面,提供了一种网页截图***,包括:多个如上述第一方面所述的网页截图服务器以及区块链网络。In a fourth aspect, a webpage screenshot system is provided, including: a plurality of webpage screenshot servers and blockchain networks as described in the first aspect.
本说明书一个或多个实施例提供的网页截图装置以及设备,接收用户的网页截图请求,该网页截图请求至少包括待截图网页的URL地址。运行沙箱环境的镜像文件,以在沙箱环境中启动第一实例,并在第一实例中运行第一浏览器。其中,镜像文件中封装有第一浏览器。在运行后的第一浏览器中,基于URL地址加载待截图网页。对待截图网页进行截图,以得到目标截图。至少将目标截图存储到区块链网络中。也即在本说明书提供的方案中,先启动第一实例,之后在启动的第一实例中,运行指定浏览器来加载待截图网页。由于第一实例是在沙箱环境中启动的,由此可以确保待截图网页不受历史环境的影响,进而可以确保网页截图的准确性。The webpage screenshot device and device provided in one or more embodiments of this specification receive a user's webpage screenshot request, and the webpage screenshot request includes at least the URL address of the webpage to be screenshotted. Run the image file of the sandbox environment to start the first instance in the sandbox environment, and run the first browser in the first instance. Wherein, the first browser is encapsulated in the image file. In the first browser after running, load the webpage to be screenshot based on the URL address. Take a screenshot of the webpage to be screenshotted to obtain the target screenshot. At least store the target screenshot in the blockchain network. That is, in the solution provided in this specification, the first instance is started first, and then in the first instance started, the designated browser is run to load the webpage to be screenshotted. Since the first instance is started in a sandbox environment, it can be ensured that the webpage to be screenshot is not affected by the historical environment, and thus the accuracy of the screenshot of the webpage can be ensured.
附图说明Description of the drawings
为了更清楚地说明本说明书实施例的技术方案,下面将对实施例描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本说明书的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其它的附图。In order to explain the technical solutions of the embodiments of this specification more clearly, the following will briefly introduce the drawings needed in the description of the embodiments. Obviously, the drawings in the following description are only some embodiments of the specification. For those of ordinary skill in the art, without creative work, other drawings can be obtained from these drawings.
图1为本说明书提供的网页截图***示意图;Figure 1 is a schematic diagram of the webpage screenshot system provided in this manual;
图2为本说明书一个实施例提供的网页截图方法流程图;Fig. 2 is a flowchart of a webpage screenshot method provided by an embodiment of this specification;
图3为本说明书一个实施例提供的基于区块链网络的数据存储方法流程图;FIG. 3 is a flowchart of a data storage method based on a blockchain network provided by an embodiment of this specification;
图4为本说明书一个实施例提供的网页截图装置示意图;Fig. 4 is a schematic diagram of a webpage screenshot device provided by an embodiment of this specification;
图5为本说明书一个实施例提供的基于区块链网络的数据存储装置示意图;FIG. 5 is a schematic diagram of a data storage device based on a blockchain network provided by an embodiment of this specification;
图6为本说明书一个实施例提供的网页截图设备示意图;Figure 6 is a schematic diagram of a webpage screenshot device provided by an embodiment of this specification;
图7为本说明书一个实施例提供的基于区块链网络的数据存储设备示意图。FIG. 7 is a schematic diagram of a data storage device based on a blockchain network provided by an embodiment of this specification.
具体实施方式Detailed ways
下面结合附图,对本说明书提供的方案进行描述。The following describes the solutions provided in this specification with reference to the accompanying drawings.
在描述本说明书提供的方案之前,先对本方案的发明构思作以下说明。Before describing the solution provided in this specification, the following description of the inventive concept of this solution is made.
为了避免网页的加载受历史环境的影响,申请人考虑先在沙箱环境中启动实例,这里的实例可以包括但不限于Docker容器或者虚拟机等,之后在启动的实例中,运行指定浏览器来加载待截图网页。In order to prevent the loading of web pages from being affected by the historical environment, the applicant considers to start the instance in the sandbox environment first. Examples here can include but are not limited to Docker containers or virtual machines, etc., and then run the specified browser in the launched instance. Load the web page to be screenshot.
上述Docker容器是由开发者通过集装箱(Docker)(一个开源的应用容器引擎)将应用程序以及程序的依赖包打包到一个可移植的Docker镜像文件中,之后运行这个Docker镜像文件所启动的。在该Docker容器中,应用程序可以像在真实的物理机上一样正常运行。基于Docker镜像所启动的多个Docker容器之间不会有任何接口,也即Docker容器之间是相互隔离的。另外,对于虚拟机,其也具有隔离型。The above-mentioned Docker container is started by developers who package the application and program dependencies into a portable Docker image file through the container (Docker) (an open source application container engine), and then run the Docker image file. In this Docker container, the application can run normally as if it were on a real physical machine. There will be no interface between multiple Docker containers started based on the Docker image, that is, the Docker containers are isolated from each other. In addition, for virtual machines, it also has an isolation type.
需要说明的是,Docker容器(或者虚拟机)的隔离性,可以确保网页的加载不受历史环境的影响。此外,通过指定浏览器来加载待截图网页,可以避免由于浏览器的不同,而导致的所加载网页的不同。It should be noted that the isolation of Docker containers (or virtual machines) can ensure that the loading of web pages is not affected by the historical environment. In addition, by specifying the browser to load the web page to be screenshotted, the difference in the loaded web page due to the difference of the browser can be avoided.
此外,基于上述截图方法所获得的目标截图可能会存在被篡改的风险。因此,避免目标截图被篡改也成为要解决的问题。In addition, the target screenshot obtained based on the above screenshot method may be at risk of being tampered with. Therefore, preventing the target screenshot from being tampered with has also become a problem to be solved.
区块链技术是一种互联网数据库技术,其特点是去中心化、公开透明、不可篡改以及可信任。因此,本方案可以引入区块链技术。具体地,网页截图服务器在获取到目标截图之后,可以向区块链网络的多个节点中任意的第一节点发送目标截图,以使第一节点在对目标截图的真实性验证通过后,对目标截图进行存储。还使第一节点向区块链网络中的其它节点广播目标截图。由此,实现了目标截图在区块链网络中的存储,从而 可以避免目标截图被篡改的风险。Blockchain technology is an Internet database technology, which is characterized by decentralization, openness and transparency, immutability and trustworthiness. Therefore, this solution can introduce blockchain technology. Specifically, after obtaining the target screenshot, the webpage screenshot server may send the target screenshot to any first node among the multiple nodes of the blockchain network, so that the first node can verify the authenticity of the target screenshot. The target screenshot is stored. It also makes the first node broadcast the target screenshot to other nodes in the blockchain network. As a result, the storage of the target screenshot in the blockchain network is realized, thereby avoiding the risk of tampering with the target screenshot.
以上就是本说明书提供的发明构思,基于该发明构思就可以得到本技术方案。以下对本方案进行详细阐述。The above is the inventive concept provided in this specification, and the technical solution can be obtained based on the inventive concept. The following describes this scheme in detail.
图1为本说明书提供的网页截图***示意图。图1中,该***可以包括网页截图服务器以及区块链网络。其中,网页截图服务器可以接收用户的网页截图请求。在接收到该请求之后,网页截图服务器可以先启动Docker容器或者虚拟机,之后在启动的Docker容器或者虚拟机中,运行指定浏览器来加载待截图网页,并对该截图网页进行截图,以得到目标截图。在获取到该目标截图之后,网页截图服务器可以将目标截图存储到区块链网络中。Figure 1 is a schematic diagram of the webpage screenshot system provided in this manual. In Figure 1, the system can include a webpage screenshot server and a blockchain network. Among them, the webpage screenshot server can receive the user's webpage screenshot request. After receiving the request, the webpage screenshot server can start the Docker container or virtual machine first, and then run the specified browser in the started Docker container or virtual machine to load the webpage to be screenshotted, and take a screenshot of the screenshot webpage to get Target screenshot. After obtaining the target screenshot, the web page screenshot server can store the target screenshot in the blockchain network.
图1中的区块链网络可以包括多个节点,其中,任一节点均可以接收上述目标截图。在接收到目标截图之后,该节点可以对其真实性进行验证,并在验证通过时,对其进行存储。此外,该节点还可以向区块链网络中的其它节点广播该目标截图,以使得其它节点在对该目标节点的真实性验证通过后,对其进行存储,由此,就实现了目标截图在区块链网络中的存储。The blockchain network in Fig. 1 may include multiple nodes, and any node can receive the above-mentioned target screenshot. After receiving the target screenshot, the node can verify its authenticity and store it when the verification passes. In addition, the node can also broadcast the target screenshot to other nodes in the blockchain network, so that other nodes can store the target node after the authenticity verification of the target node is passed, thereby achieving the target screenshot in Storage in the blockchain network.
应理解,在实际应用中,图1中的网页截图服务器的个数也可以为多个。当为多个时,用户可以随机选择其中一个来发送网页截图请求。可以理解的是,多个网页截图服务器可以大大提升网页截图***的负载。It should be understood that, in actual applications, the number of webpage screenshot servers in FIG. 1 may also be multiple. When there are more than one, the user can randomly select one of them to send a web page screenshot request. It is understandable that multiple web page screenshot servers can greatly increase the load of the web page screenshot system.
图2为本说明书一个实施例提供的网页截图方法流程图。所述方法的执行主体可以为具有处理能力的设备:服务器或者***或者装置,如,可以为图1中的网页截图服务器。如图2所示,该方法具体可以包括步骤202至210。Fig. 2 is a flowchart of a webpage screenshot method provided by an embodiment of this specification. The execution subject of the method may be a device with processing capability: a server or a system or a device, for example, it may be the webpage screenshot server in FIG. 1. As shown in FIG. 2, the method may specifically include steps 202 to 210.
步骤202,接收用户的网页截图请求。Step 202: Receive a web page screenshot request from the user.
该网页截图请求至少可以包括待截图网页的URL地址。此外,还可以包括用户自定义的截图规则。该截图规则至少可以包括针对待截图网页所需执行的目标操作。这里的目标操作可以包括但不限于点击操作、关闭操作以及滑动操作等等。此外,还可以包括截取区域或者截取像素范围等等。The webpage screenshot request may at least include the URL address of the webpage to be screenshotted. In addition, it can also include user-defined screenshot rules. The screenshot rule may at least include a target operation that needs to be performed on the webpage to be screenshot. The target operation here may include, but is not limited to, a click operation, a close operation, a sliding operation, and so on. In addition, it may also include a clipping area or a clipping pixel range, and so on.
举例来说,当用户需要针对网页底部内容区域进行截图时,该截图规则中可以定义相应的点击操作。该点击操作具体可用于点击网页中的用于表示加载全文的按钮,以便可以加载网页的底部内容。此外,该截图规则中还可以定义截取区域:底部区域等等。For example, when a user needs to take a screenshot of the content area at the bottom of a webpage, the corresponding click operation can be defined in the screenshot rule. The click operation can be specifically used to click a button in the webpage for loading the full text so that the bottom content of the webpage can be loaded. In addition, the screenshot rule can also define the interception area: the bottom area and so on.
步骤204,运行沙箱环境的镜像文件,以在沙箱环境中启动第一实例,并在第一实 例中运行第一浏览器。Step 204: Run the image file of the sandbox environment to start the first instance in the sandbox environment, and run the first browser in the first instance.
在本说明书中,第一实例可以包括但不限于Docker容器或者虚拟机等。In this specification, the first example may include, but is not limited to, a Docker container or a virtual machine.
以第一实例为Docker容器为例来说,上述沙箱环境的镜像文件可以是指Docker镜像文件,该Docker镜像文件可以是从Docker镜像仓库中预先下载的,如,可以是从Docker Hub公共镜像源预先下载的。需要说明的是,基于Docker镜像文件,通常可以启动多个Docker容器,该多个Docker容器之间是相互隔离的。此外,Docker镜像文件中还可以打包有第一浏览器以及依赖包,也即其中可以封装有第一浏览器。这里的第一浏览器可以是指任一浏览器,如,可以为Chrome浏览器或者Safari浏览器等等。当然,在实际应用中,上述Docker镜像文件中还可以封装有其它软件,如,拼图软件等等。Taking the first instance as a Docker container as an example, the image file of the aforementioned sandbox environment can refer to a Docker image file, which can be pre-downloaded from the Docker image warehouse, for example, it can be a public image from Docker Hub The source is pre-downloaded. It should be noted that based on the Docker image file, multiple Docker containers can usually be started, and the multiple Docker containers are isolated from each other. In addition, the first browser and dependent packages may also be packaged in the Docker image file, that is, the first browser may be packaged in the Docker image file. The first browser here can refer to any browser, for example, it can be a Chrome browser or a Safari browser. Of course, in practical applications, other software, such as puzzle software, can also be encapsulated in the above-mentioned Docker image file.
应理解,在第一实例为虚拟机时,虚拟机的镜像文件中也可以封装有第一浏览器以及其它软件等等,本说明书对此不作赘述。It should be understood that when the first instance is a virtual machine, the image file of the virtual machine may also be encapsulated with the first browser and other software, which will not be repeated in this specification.
此外,对于上述Docker镜像文件,当运行该Docker镜像文件时,可以启动一个Docker容器。在启动的Docker容器中,可以运行Docker镜像中封装的浏览器或者其它软件。浏览器或者其它软件在Docker容器中运行,就像在真实的物理机上运行一样。另外,对于虚拟机的镜像文件,当运行该虚拟机的镜像文件时,可以启动一台虚拟机。在启动的虚拟机中,也可以运行虚拟机的镜像文件中封装的浏览器或者其它软件。In addition, for the aforementioned Docker image file, when the Docker image file is run, a Docker container can be started. In the started Docker container, you can run the browser or other software packaged in the Docker image. The browser or other software runs in a Docker container, just like it runs on a real physical machine. In addition, for the image file of the virtual machine, when the image file of the virtual machine is running, a virtual machine can be started. In the started virtual machine, a browser or other software packaged in the image file of the virtual machine can also be run.
步骤206,在运行后的第一浏览器中,基于URL地址加载待截图网页。Step 206: Load the web page to be screenshot based on the URL address in the first browser after running.
也即在运行后的第一浏览器中,对待截图网页的页面内容进行渲染。That is, in the first browser after running, the page content of the web page to be captured is rendered.
需要说明的是,如果上述网页截图请求还包括用户自定义的截图规则,且该截图规则可以包括针对待截图网页所需执行的目标操作,那么在基于URL地址加载待截图网页之后,还可以确定在对待截图网页执行上述目标操作后的目标网页,并在上述第一浏览器中,通过目标网页代替最初加载的待截图网页。It should be noted that if the above web page screenshot request also includes user-defined screenshot rules, and the screenshot rule can include the target operation that needs to be performed on the web page to be screenshot, then after loading the web page to be screenshot based on the URL address, you can also determine The target webpage after the target operation is performed on the webpage to be screenshotted, and in the first browser, the target webpage is used to replace the initially loaded webpage to be screenshotted.
另外,如果获取不到上述用户自定义的截图规则,那么也可以基于默认的截图规则,来对待截图网页执行相应的操作。这里的默认的截图规则可以包括针对待截图网页所需执行的操作。此外,还可以包括截取区域或者截取像素范围等等。In addition, if the aforementioned user-defined screenshot rules cannot be obtained, then the corresponding operations can be performed on the screenshot webpage based on the default screenshot rules. The default screenshot rule here may include operations that need to be performed for the webpage to be screenshotted. In addition, it may also include a clipping area or a clipping pixel range, and so on.
当然,如果既获取不到用户自定义的截图规则,也没有默认的截图规则,那么也可以不对待截图网页执行任何操作。Of course, if neither user-defined screenshot rules nor default screenshot rules can be obtained, then no operation can be performed on the screenshot webpage.
步骤208,对待截图网页进行截图,以得到目标截图。Step 208: Take a screenshot of the webpage to be screenshot to obtain a target screenshot.
应理解,如果第一浏览器中的待截图网页被目标网页替代,那么这里可以是对目标网页进行截图,以得到目标截图。It should be understood that if the webpage to be screenshot is replaced by the target webpage in the first browser, then the target webpage may be screenshotted here to obtain the target screenshot.
对于待截图网页或者目标网页的截图过程,分如下两种情况进行讨论。For the screenshot process of the webpage to be screenshot or the target webpage, the discussion is divided into the following two situations.
第一种,当第一浏览器运行在Dcoker容器中时,由于Dcoker容器没有对应的UI界面,因此,可以直接基于第一浏览器内置的截图功能,对待截图网页或者目标网页进行截图。First, when the first browser is running in the Dcoker container, since the Dcoker container does not have a corresponding UI interface, it can directly take a screenshot of the webpage to be screenshot or the target webpage based on the screenshot function built in the first browser.
第二种,当第一浏览器运行在虚拟机中时,由于虚拟机具有对应的UI界面,因此,既可以基于第一浏览器内置的截图功能,对待截图网页或者目标网页进行截图。也可以基于独立的截图软件,对待截图网页或者目标网页进行截图。可以理解的是,当通过独立的截图软件,对待截图网页或者目标网页进行截图时,该独立的截图软件可以封装在虚拟机的镜像文件中。Second, when the first browser runs in a virtual machine, since the virtual machine has a corresponding UI interface, it is possible to take screenshots of the webpage to be screenshot or the target webpage based on the screenshot function built in the first browser. It can also be based on independent screenshot software to take screenshots of the webpage to be screenshot or the target webpage. It is understandable that when a screenshot is taken of the webpage to be screenshot or the target webpage through the independent screenshot software, the independent screenshot software can be encapsulated in the image file of the virtual machine.
需要说明的是,当上述截图规则还包括截取区域或者截取像素范围时,该步骤中对待截图网页或者目标网页进行截图的过程可以为:基于截取区域或者截取像素范围,对待截图网页或者目标网页进行截图,以得到目标截图。It should be noted that, when the above screenshot rule also includes the interception area or the interception pixel range, the process of taking the screenshot of the webpage to be screenshot or the target webpage in this step can be: based on the interception area or the interception pixel range, perform the screenshot for the webpage or the target webpage. Take a screenshot to get the target screenshot.
当然,如果截图规则中没有定义截取区域或者截取像素范围,那么可以默认对全部的网页页面进行截图等等,本说明书不作限定。Of course, if the screenshot rule does not define the interception area or the interception pixel range, then all web pages can be screenshots by default, etc., which is not limited in this manual.
步骤210,至少将目标截图存储到区块链网络中。In step 210, at least the target screenshot is stored in the blockchain network.
该存储过程具体可以为:向区块链网络的多个节点中任意的第一节点发送目标截图,以使第一节点在对目标截图的真实性验证通过后,对目标截图进行存储。还使第一节点向区块链网络中的其它节点广播目标截图。其它节点在接收到目标截图之后,也可以对目标截图的真实性进行验证,并在验证通过时,对目标截图进行存储。The storage process may specifically be: sending the target screenshot to any first node among the multiple nodes of the blockchain network, so that the first node stores the target screenshot after passing the authenticity verification of the target screenshot. It also makes the first node broadcast the target screenshot to other nodes in the blockchain network. After receiving the target screenshot, other nodes can also verify the authenticity of the target screenshot, and store the target screenshot when the verification passes.
关于上述对目标截图的真实性进行验证的过程,分如下两种情况进行讨论。Regarding the above process of verifying the authenticity of the target screenshot, the discussion will be divided into the following two situations.
第一,如果目标截图经由网页截图服务器使用预先存储的签名私钥进行了数字签名,且第一节点在本地预先存储了与上述签名私钥对应的公钥,那么上述真实性验证过程可以为:通过该公钥,对数字签名后的目标截图进行验签。First, if the target screenshot is digitally signed by the web screenshot server using the pre-stored signature private key, and the first node locally pre-stores the public key corresponding to the signature private key, then the authenticity verification process can be: The public key is used to verify the digitally signed target screenshot.
第二,如果目标截图未经过数字签名,或者第一节点在本地未存储与上述签名私钥对应的公钥,那么上述真实性验证过程可以为:向网页截图服务器发送截图查询请求,该截图查询请求用于指示网页截图服务器从相应的缓存记录中查找目标截图。当接收到 用于指示查找到目标截图的查询结果时,目标截图的真实性验证通过。Second, if the target screenshot is not digitally signed, or the first node does not store the public key corresponding to the signature private key locally, the authenticity verification process can be: sending a screenshot query request to the web screenshot server, and the screenshot query The request is used to instruct the webpage screenshot server to find the target screenshot from the corresponding cache record. When the query result indicating that the target screenshot is found is received, the authenticity verification of the target screenshot is passed.
需要说明的是,第一节点在本地存储目标截图时,会针对该目标截图,生成对应的hash值,以用于标识该目标截图。在生成目标截图的hash值之后,第一节点可以通过网页截图服务器向用户返回该hash值,以便于用户可以基于该hash值,来提取上述目标截图。It should be noted that when the first node stores the target screenshot locally, it will generate a corresponding hash value for the target screenshot to identify the target screenshot. After the hash value of the target screenshot is generated, the first node may return the hash value to the user through the web page screenshot server, so that the user can extract the above-mentioned target screenshot based on the hash value.
以下具体说明下第一节点对目标截图的存储过程:创建与目标截图对应的新区块,该新区块包括区块头和区块体。向区块体中写入目标截图的图像数据。之后,生成与本区块体对应的hash值。该hash值即为与目标截图对应的hash值。向区块头中写入上一个区块体的哈希值(PreHash),本区块体的哈希值(Hash),以及时间戳(TimeStamp)。由此,就实现了目标截图在第一节点的本地存储。The following specifically describes the storage process of the first node on the target screenshot: creating a new block corresponding to the target screenshot, and the new block includes a block header and a block body. Write the image data of the target screenshot into the block body. After that, the hash value corresponding to the block body is generated. The hash value is the hash value corresponding to the target screenshot. Write the hash value of the previous block body (PreHash), the hash value of this block body (Hash), and the time stamp (TimeStamp) into the block header. As a result, the local storage of the target screenshot in the first node is achieved.
当然,在实际应用中,也可以基于智能合约来实现目标截图的存储。如,可以预先编写用于实现目标截图存储功能的智能合约,之后第一节点可以调用该智能合约。其中,该次调用的传入参数可以为目标截图的图像数据。需要说明的是,在智能合约实现目标截图存储的过程中,可以为目标截图生成相应的hash值。此外,在上述调用过程结束之后,第一节点对智能合约的调用过程可以作为一笔交易被记录下来。这里的交易记录可以包含上述hash值。从而第一节点可以将该笔交易存储到对应的区块中。之后,用户可以基于上述交易记录以及其中的hash值,来提取目标截图。Of course, in practical applications, the storage of target screenshots can also be realized based on smart contracts. For example, a smart contract for realizing the target screenshot storage function can be pre-written, and then the first node can call the smart contract. Among them, the incoming parameter of this call can be the image data of the target screenshot. It should be noted that in the process of storing the target screenshot by the smart contract, the corresponding hash value can be generated for the target screenshot. In addition, after the above-mentioned calling process ends, the calling process of the smart contract by the first node can be recorded as a transaction. The transaction record here can contain the above hash value. Therefore, the first node can store the transaction in the corresponding block. After that, the user can extract the target screenshot based on the transaction record and the hash value in it.
上述用户提取目标截图的过程具体可以为:第一节点接收用户的截图提取请求,该截图提取请求至少包括目标截图的hash值。基于hash值,查找目标截图。向用户返回目标截图。The above process of extracting the target screenshot by the user may specifically be as follows: the first node receives the user's screenshot extraction request, and the screenshot extraction request includes at least the hash value of the target screenshot. Based on the hash value, find the target screenshot. Return the target screenshot to the user.
为了确保用户所获取的目标截图的真实性,用户可以向区块链网络中的各节点发送截图提取请求;之后,如果超过一半的节点可以查找到该目标截图,那么就可以该目标截图是真实可信的。In order to ensure the authenticity of the target screenshot obtained by the user, the user can send a screenshot extraction request to each node in the blockchain network; after that, if more than half of the nodes can find the target screenshot, then the target screenshot can be real Credible.
还需要说明的是,由于网页的加载还可以受到加载时间的影响,也就是说明,针对同一网页,在不同的时间,其对应的加载结果可能不一致。因此,本方案中,在针对待截图网页或者目标网页进行截图之后,还可以获取执行截图操作时的截图时间。之后将目标截图和截图时间共同存储到区块链网络中。该两者的存储过程与目标截图的存储过程类似,在此不复赘述。It should also be noted that, since the loading of a webpage may also be affected by the loading time, that is to say, for the same webpage, the corresponding loading results may be inconsistent at different times. Therefore, in this solution, after taking a screenshot of the webpage to be screenshot or the target webpage, the screenshot time when the screenshot operation is performed can also be obtained. After that, the target screenshot and the screenshot time are stored together in the blockchain network. The stored procedures of the two are similar to those of the target screenshot, so I won’t repeat them here.
此外,应理解,本说明书实施例提供的方案不仅适用于网页截图的场景,理论上, 只要是拥有可信、但是不稳定的第三方服务的场景都可以适用。如,可以适用于电子凭证存储的场景。这里的电子凭证可以包括但不限于视频流等等。In addition, it should be understood that the solution provided by the embodiment of this specification is not only applicable to the scene of webpage screenshots, but theoretically, it can be applicable as long as it has a credible but unstable third-party service. For example, it can be applied to the scenario of electronic voucher storage. The electronic vouchers here can include but are not limited to video streams and so on.
综上,本说明书实施例通过启动实例,可以保证网页渲染不会受之前、之后网页加载的影响。也即可以保证任务之间相互影响降低,同时可以复用处理器资源。此外,还可以将截图过程与存储过程解耦,使得截图资源可以动态扩容。最后,网页截图后直接接入区块链网络,可以保证网页截图结果保鲜,使得取到的内容可信。In summary, the embodiment of this specification can ensure that the rendering of the webpage will not be affected by the loading of the webpage before and after by starting the example. That is, it can ensure that the mutual influence between tasks is reduced, and processor resources can be reused at the same time. In addition, the screenshot process can be decoupled from the stored procedure, so that the screenshot resource can be dynamically expanded. Finally, after the screenshot of the web page is directly connected to the blockchain network, the results of the screenshot of the web page can be kept fresh and the content obtained can be trusted.
图3为本说明书一个实施例提供的基于区块链网络的数据存储方法流程图。所述方法的执行主体可以为图1的区块链网络中多个节点中任意的第一节点。如图3所示,该方法具体可以包括步骤302至308。Fig. 3 is a flowchart of a data storage method based on a blockchain network provided by an embodiment of this specification. The execution subject of the method may be any first node among multiple nodes in the blockchain network of FIG. 1. As shown in FIG. 3, the method may specifically include steps 302 to 308.
步骤302,接收网页截图服务器发送的目标截图。Step 302: Receive the target screenshot sent by the webpage screenshot server.
这里的目标截图即为上述实施例中所提到的目标截图,本说明书对此不复赘述。The target screenshot here is the target screenshot mentioned in the above embodiment, which will not be repeated in this specification.
步骤304,对目标截图进行真实性验证。Step 304: Perform authenticity verification on the target screenshot.
关于上述对目标截图的真实性进行验证的过程,分如下两种情况进行讨论。Regarding the above process of verifying the authenticity of the target screenshot, the discussion will be divided into the following two situations.
第一,如果目标截图经由网页截图服务器使用预先存储的签名私钥进行了数字签名,且第一节点在本地预先存储了与上述签名私钥对应的公钥,那么上述真实性验证过程可以为:通过该公钥,对数字签名后的目标截图进行验签。First, if the target screenshot is digitally signed by the web screenshot server using the pre-stored signature private key, and the first node locally pre-stores the public key corresponding to the signature private key, then the authenticity verification process can be: The public key is used to verify the digitally signed target screenshot.
第二,如果目标截图未经过数字签名,或者第一节点在本地未存储与上述签名私钥对应的公钥,那么上述真实性验证过程可以为:向网页截图服务器发送截图查询请求,该截图查询请求用于指示网页截图服务器从相应的缓存记录中查找目标截图。当接收到用于指示查找到目标截图的查询结果时,目标截图的真实性验证通过。Second, if the target screenshot is not digitally signed, or the first node does not store the public key corresponding to the signature private key locally, the authenticity verification process can be: sending a screenshot query request to the web screenshot server, and the screenshot query The request is used to instruct the webpage screenshot server to find the target screenshot from the corresponding cache record. When the query result indicating that the target screenshot is found is received, the authenticity verification of the target screenshot passes.
步骤306,在验证通过后,对目标截图进行存储。Step 306: After the verification is passed, the target screenshot is stored.
步骤308,向多个节点中的其它节点发送目标截图,以使其它节点对目标截图进行存储。Step 308: Send the target screenshot to other nodes among the multiple nodes, so that the other nodes store the target screenshot.
需要说明的是,其它节点在接收到目标截图之后,也可以先对目标截图的真实性进行验证,并在验证通过之后,对目标截图进行存储。It should be noted that after receiving the target screenshot, other nodes may also verify the authenticity of the target screenshot first, and store the target screenshot after the verification is passed.
需要说明的是,第一节点在本地存储目标截图时,会针对该目标截图,生成对应的hash值,以用于标识该目标截图。在生成目标截图的hash值之后,第一节点可以通过网页截图服务器向用户返回该hash值,以便于用户可以基于该hash值,来提取上述目 标截图。It should be noted that when the first node stores the target screenshot locally, it will generate a corresponding hash value for the target screenshot to identify the target screenshot. After generating the hash value of the target screenshot, the first node can return the hash value to the user through the web page screenshot server, so that the user can extract the target screenshot based on the hash value.
上述用户提取目标截图的过程具体可以为:第一节点接收用户的截图提取请求,该截图提取请求至少包括目标截图的hash值。基于hash值,查找目标截图。向用户返回目标截图。The above process of extracting the target screenshot by the user may specifically be as follows: the first node receives the user's screenshot extraction request, and the screenshot extraction request includes at least the hash value of the target screenshot. Based on the hash value, find the target screenshot. Return the target screenshot to the user.
为了确保用户所获取的目标截图的真实性,用户可以向区块链网络中的各节点发送截图提取请求;之后,如果超过一半的节点可以查找到该目标截图,那么就可以该目标截图是真实可信的。In order to ensure the authenticity of the target screenshot obtained by the user, the user can send a screenshot extraction request to each node in the blockchain network; after that, if more than half of the nodes can find the target screenshot, then the target screenshot can be real Credible.
需要说明的是,本说明书实施例提供的基于区块链网络的数据存储方法不仅可以适用于网页截图存储的场景,此外,还可以视频流等电子凭证存储的场景,本说明书对此不作限定。It should be noted that the blockchain network-based data storage method provided in the embodiments of this specification is not only applicable to scenarios where webpage screenshots are stored, but also scenarios where electronic vouchers such as video streams are stored, which is not limited in this specification.
综上,本说明书实施例提供的基于区块链网络的数据存储方法可以确保所存储数据的真实性和长期保真。In summary, the data storage method based on the blockchain network provided by the embodiments of this specification can ensure the authenticity and long-term fidelity of the stored data.
与上述网页截图方法对应地,本说明书一个实施例还提供的一种网页截图装置,如图4所示,该装置可以包括:Corresponding to the above webpage screenshot method, an embodiment of this specification also provides a webpage screenshot device. As shown in FIG. 4, the device may include:
接收单元402,用于接收用户的网页截图请求。该网页截图请求至少包括待截图网页的URL地址。The receiving unit 402 is configured to receive a web page screenshot request from the user. The webpage screenshot request includes at least the URL address of the webpage to be screenshotted.
运行单元404,用于运行沙箱环境的镜像文件,以在沙箱环境中启动第一实例,并在第一实例中运行第一浏览器。其中,上述镜像文件中封装有第一浏览器。The running unit 404 is configured to run the image file of the sandbox environment to start the first instance in the sandbox environment, and run the first browser in the first instance. Wherein, the first browser is encapsulated in the above-mentioned image file.
这里的第一实例可以包括以下任一种:Docker容器以及虚拟机。The first instance here may include any of the following: Docker container and virtual machine.
加载单元406,用于在运行单元404运行后的第一浏览器中,基于URL地址加载待截图网页。The loading unit 406 is configured to load the webpage to be screenshot based on the URL address in the first browser after the running unit 404 runs.
截图单元408,用于对加载单元406加载的待截图网页进行截图,以得到目标截图。The screenshot unit 408 is used to screenshot the webpage to be screenshot loaded by the loading unit 406 to obtain a target screenshot.
存储单元410,用于至少将截图单元408截图得到的目标截图存储到区块链网络中。The storage unit 410 is configured to store at least the target screenshot obtained by the screenshot by the screenshot unit 408 in the blockchain network.
该区块链网络可以包括多个节点。存储单元410具体可以用于:向区块链网络的多个节点中任意的第一节点发送目标截图,以使第一节点在对目标截图的真实性验证通过后,对目标截图进行存储。还使第一节点向区块链网络中的其它节点广播目标截图。The blockchain network may include multiple nodes. The storage unit 410 may be specifically configured to send the target screenshot to any first node among the multiple nodes of the blockchain network, so that the first node stores the target screenshot after the authenticity of the target screenshot is verified. It also makes the first node broadcast the target screenshot to other nodes in the blockchain network.
存储单元410还具体可以用于:使用预先存储的签名私钥,对目标截图进行数字签名。向区块链网络的多个节点中任意的第一节点发送数字签名后的目标截图。The storage unit 410 may also be specifically used to: use a pre-stored signature private key to digitally sign the target screenshot. Send a digitally signed target screenshot to any first node among multiple nodes in the blockchain network.
可选地,上述网页截图请求还可以包括用户自定义的截图规则,该截图规则至少可以包括针对待截图网页所需执行的目标操作。Optionally, the webpage screenshot request may also include a user-defined screenshot rule, and the screenshot rule may at least include a target operation that needs to be performed on the webpage to be screenshotted.
截图单元408具体可以用于:确定在对待截图网页执行目标操作后的目标网页。对目标网页进行截图,以得到目标截图。The screenshot unit 408 may be specifically used to determine the target webpage after the target operation is performed on the webpage to be screenshotted. Take a screenshot of the target webpage to get the target screenshot.
可选地,上述截图规则还可以包括截取区域或者截取像素范围。Optionally, the above-mentioned screenshot rule may also include an intercepted area or an intercepted pixel range.
截图单元408还具体可以用于:基于截取区域或者截取像素范围,对目标网页进行截图,以得到目标截图。The screenshot unit 408 may also be specifically used to: take a screenshot of the target webpage based on the intercepted area or the intercepted pixel range to obtain the target screenshot.
可选地,该装置还可以包括:获取单元(图中未示出),用于获取对待截图网页进行截图时的截图时间。Optionally, the device may further include: an acquiring unit (not shown in the figure), configured to acquire the screenshot time when the webpage to be screenshot is screenshotd.
存储单元410具体可以用于:将目标截图以及截图时间存储到区块链网络中。The storage unit 410 may be specifically used to store the target screenshot and the screenshot time in the blockchain network.
本说明书上述实施例装置的各功能模块的功能,可以通过上述方法实施例的各步骤来实现,因此,本说明书一个实施例提供的装置的具体工作过程,在此不复赘述。The function of each functional module of the device in the above-mentioned embodiment of this specification can be realized by the steps of the above-mentioned method embodiment. Therefore, the specific working process of the device provided in an embodiment of this specification will not be repeated here.
本说明书一个实施例提供的网页截图装置,接收单元402接收用户的网页截图请求。该网页截图请求至少包括待截图网页的URL地址。运行单元404运行沙箱环境的镜像文件,以在沙箱环境中启动第一实例,并在第一实例中运行第一浏览器。其中,上述镜像文件中封装有第一浏览器。加载单元406在运行后的第一浏览器中,基于URL地址加载待截图网页。截图单元408对待截图网页进行截图,以得到目标截图。存储单元410至少将目标截图存储到区块链网络中。由此,可以确保网页截图的准确性。此外,还可以确保网页截图结果存储的可靠性。In the webpage screenshot device provided in an embodiment of this specification, the receiving unit 402 receives a user's webpage screenshot request. The webpage screenshot request includes at least the URL address of the webpage to be screenshotted. The running unit 404 runs the image file of the sandbox environment to start the first instance in the sandbox environment and run the first browser in the first instance. Wherein, the first browser is encapsulated in the above-mentioned image file. The loading unit 406 loads the web page to be captured based on the URL address in the first browser after running. The screenshot unit 408 performs a screenshot of the webpage to be screenshot to obtain a target screenshot. The storage unit 410 at least stores the target screenshot in the blockchain network. As a result, the accuracy of web page screenshots can be ensured. In addition, it can also ensure the reliability of web page screenshot results storage.
本说明书一个实施例提供的网页截图装置可以为图1中网页截图服务器的一个模块或者单元。The webpage screenshot device provided in an embodiment of this specification may be a module or unit of the webpage screenshot server in FIG. 1.
与上述基于区块链网络的数据存储方法对应地,本说明书一个实施例还提供的一种基于区块链网络的数据存储装置,如图5所示,该装置可以包括:接收单元502,用于接收网页截图服务器发送的目标截图。该目标截图是由网页截图服务器通过对基于第一浏览器加载的待截图网页进行截图后得到,其中,第一浏览器运行在由网页截图服务器在沙箱环境中启动的第一实例中。Corresponding to the above-mentioned data storage method based on the blockchain network, an embodiment of this specification also provides a data storage device based on the blockchain network. As shown in FIG. 5, the device may include: a receiving unit 502, To receive the target screenshot sent by the web screenshot server. The target screenshot is obtained by the webpage screenshot server by taking a screenshot of the webpage to be screenshot loaded based on the first browser, where the first browser runs in the first instance started by the webpage screenshot server in the sandbox environment.
验证单元504,用于对目标截图进行真实性验证。The verification unit 504 is used to verify the authenticity of the target screenshot.
存储单元506,用于在验证单元504验证通过后,对目标截图进行存储。The storage unit 506 is configured to store the target screenshot after the verification by the verification unit 504 is passed.
发送单元508,用于向其它节点发送目标截图,以使其它节点对目标截图进行存储。The sending unit 508 is configured to send the target screenshot to other nodes, so that other nodes can store the target screenshot.
可选地,上述目标截图经由网页截图服务器使用预先存储的签名私钥进行了数字签名。Optionally, the above-mentioned target screenshot is digitally signed via the webpage screenshot server using a pre-stored signature private key.
验证单元504具体可以用于:通过预先存储的、与签名私钥对应的公钥,对目标截图进行验签。The verification unit 504 may be specifically used to verify the signature of the target screenshot through the pre-stored public key corresponding to the signature private key.
当验签通过时,对目标截图进行存储。When the verification is passed, the target screenshot is stored.
验证单元504还具体可以用于:向网页截图服务器发送截图查询请求,该截图查询请求用于指示网页截图服务器从相应的缓存记录中查找目标截图。The verification unit 504 may also be specifically configured to send a screenshot query request to the web page screenshot server, where the screenshot query request is used to instruct the web page screenshot server to find the target screenshot from the corresponding cache record.
当接收到用于指示查找到目标截图的查询结果时,目标截图的真实性验证通过。When the query result indicating that the target screenshot is found is received, the authenticity verification of the target screenshot passes.
可选地,该装置还可以包括:查找单元(图中未示出)。Optionally, the device may further include: a search unit (not shown in the figure).
接收单元502,还用于接收用户的截图提取请求,该截图提取请求至少包括目标截图的hash值。该hash值是由第一节点在对目标截图进行存储的过程中生成的。The receiving unit 502 is also configured to receive a screenshot extraction request from the user, where the screenshot extraction request includes at least the hash value of the target screenshot. The hash value is generated by the first node in the process of storing the target screenshot.
查找单元,用于基于hash值,查找目标截图。The search unit is used to find the target screenshot based on the hash value.
发送单元508,还用于向用户返回目标截图。The sending unit 508 is also used to return the target screenshot to the user.
本说明书上述实施例装置的各功能模块的功能,可以通过上述方法实施例的各步骤来实现,因此,本说明书一个实施例提供的装置的具体工作过程,在此不复赘述。The function of each functional module of the device in the above-mentioned embodiment of this specification can be realized by the steps of the above-mentioned method embodiment. Therefore, the specific working process of the device provided in an embodiment of this specification will not be repeated here.
本说明书一个实施例提供的基于区块链网络的数据存储装置,可以确保所存储数据的真实性和长期保真。The data storage device based on the blockchain network provided in an embodiment of this specification can ensure the authenticity and long-term fidelity of the stored data.
本说明书一个实施例提供的基于区块链网络的数据存储装置可以为图1的区块链网络中任一节点中的一个模块或者单元。The data storage device based on the blockchain network provided in an embodiment of this specification may be a module or unit in any node in the blockchain network of FIG. 1.
与上述网页截图方法对应地,本说明书实施例还提供了一种网页截图设备,如图6所示,该设备可以包括:存储器602、一个或多个处理器604以及一个或多个程序。其中,该一个或多个程序存储在存储器602中,并且被配置成由一个或多个处理器604执行,该程序被处理器604执行时实现以下步骤:接收用户的网页截图请求,该网页截图请求至少包括待截图网页的URL地址;运行沙箱环境的镜像文件,以在沙箱环境中启动第一实例,并在第一实例中运行第一浏览器。其中,上述镜像文件中封装有第一浏览器;在运行后的第一浏览器中,基于URL地址加载待截图网页;对待截图网页进行 截图,以得到目标截图;至少将目标截图存储到区块链网络中。Corresponding to the above webpage screenshot method, the embodiment of this specification also provides a webpage screenshot device. As shown in FIG. 6, the device may include: a memory 602, one or more processors 604, and one or more programs. Wherein, the one or more programs are stored in the memory 602 and are configured to be executed by one or more processors 604. When the programs are executed by the processor 604, the following steps are implemented: receiving a user's webpage screenshot request, and the webpage screenshot The request includes at least the URL address of the web page to be screenshot; the mirror file of the sandbox environment is run to start the first instance in the sandbox environment, and the first browser is run in the first instance. Among them, the first browser is encapsulated in the above image file; in the first browser after running, load the webpage to be screenshot based on the URL address; take screenshots of the webpage to be screenshotted to obtain the target screenshot; at least store the target screenshot in the block Chain network.
本说明书一个实施例提供的网页截图设备,可以确保网页截图的准确性。The webpage screenshot device provided in an embodiment of this specification can ensure the accuracy of webpage screenshots.
与上述基于区块链网络的数据存储方法对应地,本说明书实施例还提供了一种基于区块链网络的数据存储设备,如图7所示,该设备可以包括:存储器702、一个或多个处理器704以及一个或多个程序。其中,该一个或多个程序存储在存储器702中,并且被配置成由一个或多个处理器704执行,该程序被处理器704执行时实现以下步骤:接收网页截图服务器发送的目标截图。该目标截图是由网页截图服务器通过对基于第一浏览器加载的待截图网页进行截图后得到。其中,第一浏览器运行在由网页截图服务器在沙箱环境中启动的第一实例中。Corresponding to the above-mentioned data storage method based on the blockchain network, the embodiment of this specification also provides a data storage device based on the blockchain network. As shown in FIG. 7, the device may include: a memory 702, one or more A processor 704 and one or more programs. The one or more programs are stored in the memory 702 and are configured to be executed by one or more processors 704. When the programs are executed by the processor 704, the following steps are implemented: receiving a target screenshot sent by a webpage screenshot server. The target screenshot is obtained by the webpage screenshot server by taking a screenshot of the webpage to be screenshot loaded based on the first browser. Wherein, the first browser runs in the first instance started in the sandbox environment by the webpage screenshot server.
对目标截图进行真实性验证。Verify the authenticity of the target screenshot.
在验证通过后,对目标截图进行存储。After the verification is passed, the target screenshot is stored.
向多个节点中的其它节点发送目标截图,以使其它节点对目标截图进行存储。Send the target screenshot to other nodes among multiple nodes so that other nodes can store the target screenshot.
本说明书一个实施例提供的区块链网络的数据存储设备,可以确保所存储数据的真实性和长期保真。The data storage device of the blockchain network provided in an embodiment of this specification can ensure the authenticity and long-term fidelity of the stored data.
本说明书中的各个实施例均采用递进的方式描述,各个实施例之间相同相似的部分互相参见即可,每个实施例重点说明的都是与其他实施例的不同之处。尤其,对于设备实施例而言,由于其基本相似于方法实施例,所以描述的比较简单,相关之处参见方法实施例的部分说明即可。The various embodiments in this specification are described in a progressive manner, and the same or similar parts between the various embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, as for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and for related parts, please refer to the part of the description of the method embodiment.
结合本说明书公开内容所描述的方法或者算法的步骤可以硬件的方式来实现,也可以是由处理器执行软件指令的方式来实现。软件指令可以由相应的软件模块组成,软件模块可以被存放于RAM存储器、闪存、ROM存储器、EPROM存储器、EEPROM存储器、寄存器、硬盘、移动硬盘、CD-ROM或者本领域熟知的任何其它形式的存储介质中。一种示例性的存储介质耦合至处理器,从而使处理器能够从该存储介质读取信息,且可向该存储介质写入信息。当然,存储介质也可以是处理器的组成部分。处理器和存储介质可以位于ASIC中。另外,该ASIC可以位于服务器中。当然,处理器和存储介质也可以作为分立组件存在于服务器中。The steps of the method or algorithm described in combination with the disclosure of this specification may be implemented in a hardware manner, or may be implemented in a manner in which a processor executes software instructions. Software instructions can be composed of corresponding software modules, which can be stored in RAM memory, flash memory, ROM memory, EPROM memory, EEPROM memory, registers, hard disk, mobile hard disk, CD-ROM or any other form of storage known in the art Medium. An exemplary storage medium is coupled to the processor, so that the processor can read information from the storage medium and write information to the storage medium. Of course, the storage medium may also be an integral part of the processor. The processor and the storage medium may be located in the ASIC. In addition, the ASIC may be located in the server. Of course, the processor and the storage medium may also exist as discrete components in the server.
本领域技术人员应该可以意识到,在上述一个或多个示例中,本发明所描述的功能可以用硬件、软件、固件或它们的任意组合来实现。当使用软件实现时,可以将这些功能存储在计算机可读介质中或者作为计算机可读介质上的一个或多个指令或代码 进行传输。计算机可读介质包括计算机存储介质和通信介质,其中通信介质包括便于从一个地方向另一个地方传送计算机程序的任何介质。存储介质可以是通用或专用计算机能够存取的任何可用介质。Those skilled in the art should be aware that, in one or more of the foregoing examples, the functions described in the present invention can be implemented by hardware, software, firmware, or any combination thereof. When implemented by software, these functions can be stored in a computer-readable medium or transmitted as one or more instructions or codes on the computer-readable medium. The computer-readable medium includes a computer storage medium and a communication medium, where the communication medium includes any medium that facilitates the transfer of a computer program from one place to another. The storage medium may be any available medium that can be accessed by a general-purpose or special-purpose computer.
上述对本说明书特定实施例进行了描述。其它实施例在所附权利要求书的范围内。在一些情况下,在权利要求书中记载的动作或步骤可以按照不同于实施例中的顺序来执行并且仍然可以实现期望的结果。另外,在附图中描绘的过程不一定要求示出的特定顺序或者连续顺序才能实现期望的结果。在某些实施方式中,多任务处理和并行处理也是可以的或者可能是有利的。The foregoing describes specific embodiments of this specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps described in the claims may be performed in a different order than in the embodiments and still achieve desired results. In addition, the processes depicted in the drawings do not necessarily require the specific order or sequential order shown in order to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
以上所述的具体实施方式,对本说明书的目的、技术方案和有益效果进行了进一步详细说明,所应理解的是,以上所述仅为本说明书的具体实施方式而已,并不用于限定本说明书的保护范围,凡在本说明书的技术方案的基础之上,所做的任何修改、等同替换、改进等,均应包括在本说明书的保护范围之内。The specific implementations described above further describe the purpose, technical solutions and beneficial effects of this specification. It should be understood that the above are only specific implementations of this specification and are not intended to limit the description of this specification. The scope of protection, any modification, equivalent replacement, improvement, etc. made on the basis of the technical solution of this specification shall be included in the scope of protection of this specification.

Claims (16)

  1. 一种网页截图方法,通过网页截图服务器执行,所述方法包括:A webpage screenshot method, executed by a webpage screenshot server, the method includes:
    接收用户的网页截图请求;所述网页截图请求至少包括待截图网页的URL地址;Receiving a webpage screenshot request from the user; the webpage screenshot request includes at least the URL address of the webpage to be screenshotted;
    运行沙箱环境的镜像文件,以在沙箱环境中启动第一实例,并在所述第一实例中运行第一浏览器;其中,所述镜像文件中封装有所述第一浏览器;Run the image file of the sandbox environment to start the first instance in the sandbox environment and run the first browser in the first instance; wherein the first browser is encapsulated in the image file;
    在运行后的所述第一浏览器中,基于所述URL地址加载所述待截图网页;In the first browser after running, load the webpage to be screenshot based on the URL address;
    对所述待截图网页进行截图,以得到目标截图;Take a screenshot of the webpage to be screenshot to obtain a target screenshot;
    至少将所述目标截图存储到区块链网络中。At least the target screenshot is stored in the blockchain network.
  2. 根据权利要求1所述的方法,所述第一实例包括以下任一种:Docker容器以及虚拟机。The method according to claim 1, wherein the first instance includes any one of the following: a Docker container and a virtual machine.
  3. 根据权利要求1所述的方法,所述网页截图请求还包括用户自定义的截图规则,所述截图规则至少包括针对待截图网页所需执行的目标操作;The method according to claim 1, wherein the web page screenshot request further includes a user-defined screenshot rule, and the screenshot rule includes at least a target operation that needs to be performed for the web page to be screenshotted;
    所述对所述待截图网页进行截图,以得到目标截图,包括:The screenshot of the webpage to be screenshotted to obtain the target screenshot includes:
    确定在对所述待截图网页执行所述目标操作后的目标网页;Determining the target webpage after the target operation is performed on the webpage to be screenshotted;
    对所述目标网页进行截图,以得到目标截图。Take a screenshot of the target webpage to obtain a target screenshot.
  4. 根据权利要求3所述的方法,所述截图规则还包括截取区域或者截取像素范围;According to the method according to claim 3, the screenshot rule further includes an intercepted area or an intercepted pixel range;
    所述对所述目标网页进行截图,以得到目标截图,包括:The screenshot of the target webpage to obtain the target screenshot includes:
    基于所述截取区域或者截取像素范围,对所述目标网页进行截图,以得到目标截图。Based on the intercepted area or the intercepted pixel range, a screenshot of the target webpage is taken to obtain a target screenshot.
  5. 根据权利要求1所述的方法,在所述至少将所述目标截图存储到区块链网络中之前,还包括:The method according to claim 1, before storing at least the target screenshot in a blockchain network, further comprising:
    获取对所述待截图网页进行截图时的截图时间;Acquiring the screenshot time when the webpage to be screenshot is captured;
    所述至少将所述目标截图存储到区块链网络中,包括:The storing at least the target screenshot in a blockchain network includes:
    将所述目标截图以及截图时间存储到区块链网络中。The target screenshot and the screenshot time are stored in the blockchain network.
  6. 根据权利要求1所述的方法,所述区块链网络包括多个节点;The method according to claim 1, wherein the blockchain network includes a plurality of nodes;
    所述至少将所述目标截图存储到区块链网络中,包括:The storing at least the target screenshot in a blockchain network includes:
    向所述区块链网络的多个节点中任意的第一节点发送所述目标截图,以使所述第一节点在对所述目标截图的真实性验证通过后,对所述目标截图进行存储;还使所述第一节点向所述区块链网络中的其它节点广播所述目标截图。Send the target screenshot to any first node among the multiple nodes of the blockchain network, so that the first node stores the target screenshot after passing the authenticity verification of the target screenshot ; It also enables the first node to broadcast the target screenshot to other nodes in the blockchain network.
  7. 根据权利要求6所述的方法,所述向所述区块链网络的多个节点中任意的第一节点发送所述目标截图,包括:The method according to claim 6, wherein the sending the target screenshot to any first node among the multiple nodes of the blockchain network comprises:
    使用预先存储的签名私钥,对所述目标截图进行数字签名;Use the pre-stored signature private key to digitally sign the target screenshot;
    向所述区块链网络的多个节点中任意的第一节点发送数字签名后的目标截图。Send a digitally signed target screenshot to any first node among the multiple nodes of the blockchain network.
  8. 一种网页截图***,包括:多个如权利要求1-7任一项所述的网页截图服务器以及区块链网络。A webpage screenshot system, comprising: a plurality of webpage screenshot servers according to any one of claims 1-7 and a blockchain network.
  9. 一种网页截图装置,包括:A webpage screenshot device, including:
    接收单元,用于接收用户的网页截图请求;所述网页截图请求至少包括待截图网页的URL地址;The receiving unit is configured to receive a webpage screenshot request from the user; the webpage screenshot request includes at least the URL address of the webpage to be screenshotted;
    运行单元,用于运行沙箱环境的镜像文件,以在沙箱环境中启动第一实例,并在所述第一实例中运行第一浏览器;其中,所述镜像文件中封装有所述第一浏览器;The running unit is used to run the image file of the sandbox environment to start the first instance in the sandbox environment and run the first browser in the first instance; wherein, the image file encapsulates the first instance A browser;
    加载单元,用于在所述运行单元运行后的所述第一浏览器中,基于所述URL地址加载所述待截图网页;A loading unit, configured to load the webpage to be screenshot based on the URL address in the first browser after the running unit is running;
    截图单元,用于对所述加载单元加载的所述待截图网页进行截图,以得到目标截图;A screenshot unit, configured to take a screenshot of the webpage to be screenshot loaded by the loading unit to obtain a target screenshot;
    存储单元,用于至少将所述截图单元截图得到的所述目标截图存储到区块链网络中。The storage unit is used to store at least the target screenshot obtained by the screenshot unit by the screenshot unit in the blockchain network.
  10. 根据权利要求9所述的装置,所述第一实例包括以下任一种:Docker容器以及虚拟机。The apparatus according to claim 9, wherein the first instance includes any one of the following: a Docker container and a virtual machine.
  11. 根据权利要求9所述的装置,所述网页截图请求还包括用户自定义的截图规则,所述截图规则至少包括针对待截图网页所需执行的目标操作;The device according to claim 9, wherein the web page screenshot request further includes user-defined screenshot rules, and the screenshot rules include at least a target operation that needs to be performed for the web page to be screenshotted;
    所述截图单元具体用于:The screenshot unit is specifically used for:
    确定在对所述待截图网页执行所述目标操作后的目标网页;Determining the target webpage after the target operation is performed on the webpage to be screenshotted;
    对所述目标网页进行截图,以得到目标截图。Take a screenshot of the target webpage to obtain a target screenshot.
  12. 根据权利要求11所述的装置,所述截图规则还包括截取区域或者截取像素范围;The device according to claim 11, wherein the screenshot rule further includes an intercepted area or an intercepted pixel range;
    所述截图单元还具体用于:The screenshot unit is also specifically used for:
    基于所述截取区域或者截取像素范围,对所述目标网页进行截图,以得到目标截图。Based on the intercepted area or the intercepted pixel range, a screenshot of the target webpage is taken to obtain a target screenshot.
  13. 根据权利要求9所述的装置,还包括:The device according to claim 9, further comprising:
    获取单元,用于获取对所述待截图网页进行截图时的截图时间;The acquiring unit is used to acquire the screenshot time when the webpage to be screenshot is screenshotted;
    所述存储单元具体用于:The storage unit is specifically used for:
    将所述目标截图以及截图时间存储到区块链网络中。The target screenshot and the screenshot time are stored in the blockchain network.
  14. 根据权利要求9所述的装置,所述区块链网络包括多个节点;The device according to claim 9, wherein the blockchain network includes a plurality of nodes;
    所述存储单元具体用于:The storage unit is specifically used for:
    向所述区块链网络的多个节点中任意的第一节点发送所述目标截图,以使所述第一节点在对所述目标截图的真实性验证通过后,对所述目标截图进行存储;还使所述第一 节点向所述区块链网络中的其它节点广播所述目标截图。Send the target screenshot to any first node among the multiple nodes of the blockchain network, so that the first node stores the target screenshot after passing the authenticity verification of the target screenshot ; It also enables the first node to broadcast the target screenshot to other nodes in the blockchain network.
  15. 根据权利要求14所述的装置,所述存储单元具体用于:The device according to claim 14, wherein the storage unit is specifically configured to:
    使用预先存储的签名私钥,对所述目标截图进行数字签名;Use the pre-stored signature private key to digitally sign the target screenshot;
    向所述区块链网络的多个节点中任意的第一节点发送数字签名后的目标截图。Send a digitally signed target screenshot to any first node among the multiple nodes of the blockchain network.
  16. 一种网页截图设备,包括:A webpage screenshot device, including:
    存储器;Memory
    一个或多个处理器;以及One or more processors; and
    一个或多个程序,其中所述一个或多个程序存储在所述存储器中,并且被配置成由所述一个或多个处理器执行,所述程序被所述处理器执行时实现以下步骤:One or more programs, wherein the one or more programs are stored in the memory and are configured to be executed by the one or more processors, and the following steps are implemented when the programs are executed by the processor:
    接收用户的网页截图请求;所述网页截图请求至少包括待截图网页的URL地址;Receiving a webpage screenshot request from the user; the webpage screenshot request includes at least the URL address of the webpage to be screenshotted;
    运行沙箱环境的镜像文件,以在沙箱环境中启动第一实例,并在所述第一实例中运行第一浏览器;其中,所述镜像文件中封装有所述第一浏览器;Run the image file of the sandbox environment to start the first instance in the sandbox environment and run the first browser in the first instance; wherein the first browser is encapsulated in the image file;
    在运行后的所述第一浏览器中,基于所述URL地址加载所述待截图网页;In the first browser after running, load the webpage to be screenshot based on the URL address;
    对所述待截图网页进行截图,以得到目标截图;Take a screenshot of the webpage to be screenshot to obtain a target screenshot;
    至少将所述目标截图存储到区块链网络中。At least the target screenshot is stored in the blockchain network.
PCT/CN2020/110733 2019-10-30 2020-08-24 Webpage screenshot capturing method, apparatus and device WO2021082661A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201911047830.9 2019-10-30
CN201911047830.9A CN110806913A (en) 2019-10-30 2019-10-30 Webpage screenshot method, device and equipment

Publications (1)

Publication Number Publication Date
WO2021082661A1 true WO2021082661A1 (en) 2021-05-06

Family

ID=69489721

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2020/110733 WO2021082661A1 (en) 2019-10-30 2020-08-24 Webpage screenshot capturing method, apparatus and device

Country Status (2)

Country Link
CN (1) CN110806913A (en)
WO (1) WO2021082661A1 (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110806913A (en) * 2019-10-30 2020-02-18 支付宝(杭州)信息技术有限公司 Webpage screenshot method, device and equipment
CN111399732B (en) * 2020-03-13 2021-02-19 深圳市珍爱云信息技术有限公司 Webpage screenshot method and device, computer equipment and storage medium
CN112202958B (en) * 2020-08-31 2021-07-23 维沃移动通信有限公司 Screenshot method and device and electronic equipment

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103095700A (en) * 2013-01-10 2013-05-08 公安部第三研究所 Electronic data forensics system and forensics control method based on virtual desktop
JP2017060154A (en) * 2015-09-17 2017-03-23 株式会社くまなんピーシーネット Digital evidence creation device, digital evidence creation program, and digital evidence creation method
CN108595240A (en) * 2018-04-20 2018-09-28 北京天融信网络安全技术有限公司 Grasping means, device, equipment and the readable storage medium storing program for executing of Snipping Tool
CN110135201A (en) * 2019-04-28 2019-08-16 阿里巴巴集团控股有限公司 A kind of webpage evidence collecting method and device based on independent operating environment
CN110263583A (en) * 2019-05-17 2019-09-20 阿里巴巴集团控股有限公司 Card method, apparatus and electronic equipment are deposited in a kind of infringement based on block chain
CN110806913A (en) * 2019-10-30 2020-02-18 支付宝(杭州)信息技术有限公司 Webpage screenshot method, device and equipment
CN111143883A (en) * 2019-12-31 2020-05-12 支付宝(杭州)信息技术有限公司 Digital content evidence obtaining method, device and equipment based on block chain

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20160321435A1 (en) * 2015-05-01 2016-11-03 Monegraph, Inc. Managing digital content via block chain registers
CN108629038A (en) * 2018-05-11 2018-10-09 北京奇虎科技有限公司 Webpage based on block chain deposits card method and system
CN108959416B (en) * 2018-06-08 2020-01-10 浙江数秦科技有限公司 Webpage data automatic evidence obtaining and storing method based on block chain
CN109582885B (en) * 2018-10-31 2020-06-12 阿里巴巴集团控股有限公司 Method and device for carrying out block link evidence storage on webpage through webpage monitoring
CN109614766B (en) * 2018-10-31 2021-01-22 创新先进技术有限公司 Method and device for carrying out block chaining and evidence saving on webpage through file acquisition

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103095700A (en) * 2013-01-10 2013-05-08 公安部第三研究所 Electronic data forensics system and forensics control method based on virtual desktop
JP2017060154A (en) * 2015-09-17 2017-03-23 株式会社くまなんピーシーネット Digital evidence creation device, digital evidence creation program, and digital evidence creation method
CN108595240A (en) * 2018-04-20 2018-09-28 北京天融信网络安全技术有限公司 Grasping means, device, equipment and the readable storage medium storing program for executing of Snipping Tool
CN110135201A (en) * 2019-04-28 2019-08-16 阿里巴巴集团控股有限公司 A kind of webpage evidence collecting method and device based on independent operating environment
CN110263583A (en) * 2019-05-17 2019-09-20 阿里巴巴集团控股有限公司 Card method, apparatus and electronic equipment are deposited in a kind of infringement based on block chain
CN110806913A (en) * 2019-10-30 2020-02-18 支付宝(杭州)信息技术有限公司 Webpage screenshot method, device and equipment
CN111143883A (en) * 2019-12-31 2020-05-12 支付宝(杭州)信息技术有限公司 Digital content evidence obtaining method, device and equipment based on block chain

Also Published As

Publication number Publication date
CN110806913A (en) 2020-02-18

Similar Documents

Publication Publication Date Title
TWI753228B (en) Blockchain-based data verification method and device, and electronic equipment
WO2021082661A1 (en) Webpage screenshot capturing method, apparatus and device
CN110263583B (en) Method and device for infringement and evidence preservation based on block chain and electronic equipment
CN109032691B (en) Applet running method and device and storage medium
CN107729352B (en) Page resource loading method and terminal equipment
CN110490773B (en) Block chain-based screen recording evidence obtaining method and device and electronic equipment
US9578044B1 (en) Detection of anomalous advertising content
US11290256B2 (en) Blockchain-based advertisement monitoring method and apparatus, and electronic device
JP2019520647A (en) Automation of image validation
CN111385316B (en) Resource refreshing method, access method and device
US20190379545A1 (en) System and method for decentralized digital structured data storage, management, and authentication using blockchain
CN111143883A (en) Digital content evidence obtaining method, device and equipment based on block chain
CN107733883B (en) Method and device for detecting account numbers registered in batches
CN114266680A (en) Block chain-based electronic contract signing method, device and system
CN110309669A (en) A kind of data mask method, device and equipment
CN111722994A (en) Task request response method and device
CN108710658B (en) Data record storage method and device
CN108632348B (en) Service checking method and device
CN115129275A (en) Digital file printing method and device, electronic equipment and storage medium
US20180088930A1 (en) Updating code within an application
CN114443306A (en) Resource processing method and device, electronic equipment and computer readable storage medium
CN113420288A (en) Container mirror image sensitive information detection system and method
CN112487497A (en) Method and device for managing off-link files based on intelligent contracts and electronic equipment
CN110781523A (en) Method and apparatus for processing information
CN116233157A (en) Electronic contract signing method, device and system

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 20881225

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 20881225

Country of ref document: EP

Kind code of ref document: A1