Data processing method, data processing system, storage medium and program product

By embedding and loading resources of non-same-original pages in the first page, monitoring and completing the resource loading progress, screenshot processing and transmission are solved, and screenshot processing and transmission are achieved without occupying server resources. The function of screenshotting in case of situations.

CN118963631APending Publication Date: 2024-11-15KE COM (BEIJING) TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411139261.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-08-19
Publication Date
2024-11-15

Smart Images

  • Figure CN118963631A_ABST
    Figure CN118963631A_ABST
Patent Text Reader

Abstract

The invention provides a data processing method, a data processing system, a storage medium and a computer program product. The data processing method comprises the steps that in a first page, a second page is embedded, resources of the second page are loaded, and the first page and the second page are non-homologous pages; monitoring the resource loading progress of the second page to obtain a monitoring result; under the condition that the monitoring result is the first result, performing screenshot processing on at least partial region of the second page to obtain a target screenshot, and storing the target screenshot in a picture container of the second page; in the picture container, encoding the target screenshot into a character string format to obtain target data; transmitting the target data to the first page; decoding the target data on the first page to obtain a target screenshot; the first result represents that resource loading of the second page is completed.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of computer technology, and in particular to a data processing method, a data processing system, a storage medium, and a computer program product. Background Art

[0002] At present, most terminal devices have screenshot technology, which can capture any area in the current display screen to generate an image. In the environment of browsing web pages with a browser, you can take a screenshot of any content on the current page. However, in some relatively complex application scenarios, it is necessary to take a screenshot of website B on website A, and use the screenshot information on website A, where website A and website B are non-homologous pages. In this case, the server-side screenshot solution is usually adopted. However, on the one hand, this solution needs to occupy server-side resources, and on the other hand, screenshots on the server require anonymous access to the website, and server-side screenshots have upstream and downstream traffic costs. In the case of weak pressure-bearing capacity and high concurrency on the server, the screenshot service is often unavailable. Summary of the invention

[0003] In order to solve one of the above technical problems, the present disclosure provides a data processing method, a data processing system, a storage medium and a computer program product.

[0004] A first aspect of the present disclosure provides a data processing method, including: in a first page, embedding a second page and loading resources of the second page, the first page and the second page are non-homologous pages; monitoring the resource loading progress of the second page to obtain a monitoring result; when the monitoring result is a first result, taking a screenshot of at least a portion of the second page to obtain a target screenshot, and storing the target screenshot in a picture container of the second page; in the picture container, encoding the target screenshot into a string format to obtain target data; transmitting the target data to the first page; and decoding the target data on the first page to obtain the target screenshot; wherein the first result indicates that the resource loading of the second page has been completed.

[0005] In an optional implementation, the resource loading progress includes the progress of building the document structure of the second page, and the first result includes a first sub-result; monitoring the progress of building the document structure of the second page includes: monitoring whether the node tree of the document object model of the second page changes; and when the node tree of the document object model of the second page does not change, obtaining the first sub-result, the first sub-result indicating that the document structure construction has been completed.

[0006] In an optional implementation, the resource loading progress includes the processing progress of each asynchronous request of the second page, and the first result includes a second sub-result; monitoring the processing progress of each asynchronous request of the second page includes: monitoring the data of each interface of the asynchronous request; and within a first predetermined time after the interface of the asynchronous request that last sent data sent data, if no new interface of the asynchronous request is monitored to send data, then when all existing interfaces of the asynchronous request receive data return results, a second sub-result is obtained, and the second sub-result indicates that the processing of the asynchronous request has been completed.

[0007] In an optional implementation, the resource loading progress includes the rendering progress of the picture elements of the second page, and the first result includes a third sub-result; monitoring the rendering progress of the picture elements includes: monitoring the change in the number of picture tags in the second page; and within a second predetermined time after the number of picture tags changes, if the number of picture tags no longer changes, obtaining a third sub-result, and the third sub-result indicates that the rendering of the picture elements has been completed.

[0008] In an optional implementation, when the monitoring result is the first result, a screenshot is taken of at least a portion of the second page to obtain a target screenshot, and the target screenshot is stored in a picture container of the second page, including: when loading the second page, based on the uniform resource locator corresponding to the second page, determining a target element in the picture elements of the second page; and rendering at least a portion of the target element into the picture container to obtain the target screenshot.

[0009] In an optional implementation, in a first page, embedding a second page and loading resources of the second page include: in the first page, embedding the second page via an embedding component, and loading the second page in a partial area of ​​the first page; transferring the target data to the first page includes: transferring the target data to the embedding component, and transferring the target data to the first page via the embedding component.

[0010] In an optional embodiment, the target data is transferred to the embedded component, and the target data is transferred to the first page through the embedded component, including: when the target data is transferred to the embedded component, a communication signal is sent to the first page; when the first page receives the communication signal, an extraction request is sent to the embedded component; and when the embedded component receives the extraction request, the target data is transferred to the first page.

[0011] A second aspect of the present disclosure provides a data processing system, which includes a processor memory, the memory storing a computer program, and when the computer program is executed by the processor, the processor and the computer program execute the data processing method of any embodiment of the present disclosure.

[0012] A third aspect of the present disclosure provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the data processing method of any embodiment of the present disclosure is executed.

[0013] A fourth aspect of the present disclosure provides a computer program product, which includes a computer program. When the computer program is executed by a processor, the data processing method of any embodiment of the present disclosure is executed. BRIEF DESCRIPTION OF THE DRAWINGS

[0014] The accompanying drawings illustrate exemplary embodiments of the present disclosure and together with the description serve to explain the principles of the present disclosure. These drawings are included to provide a further understanding of the present disclosure and are incorporated in and constitute a part of this specification.

[0015] Figure 1 It is a schematic diagram of a scenario in which a data processing system of some embodiments of the present disclosure performs data processing.

[0016] Figure 2 It is a schematic diagram of the structure of a data processing system of some embodiments of the present disclosure.

[0017] Figure 3 It is a flowchart of a data processing method according to some embodiments of the present disclosure.

[0018] Figure 4 It is a flowchart of a data processing method according to some embodiments of the present disclosure.

[0019] Figure 5 It is a flowchart of a data processing method according to some embodiments of the present disclosure. DETAILED DESCRIPTION

[0020] The present disclosure is further described in detail below in conjunction with the accompanying drawings and implementations. It is understood that the specific implementations described herein are only used to explain the relevant content, rather than to limit the present disclosure. It should also be noted that, for ease of description, only the parts related to the present disclosure are shown in the accompanying drawings.

[0021] It should be noted that, in the absence of conflict, the embodiments and features of the embodiments in the present disclosure can be combined with each other. The technical solution of the present disclosure will be described in detail below with reference to the accompanying drawings and in combination with the embodiments.

[0022] Unless otherwise specified, the exemplary embodiments / embodiments shown will be understood as providing exemplary features of various details of some ways in which the technical concept of the present disclosure can be implemented in practice. Therefore, unless otherwise specified, the features of the various embodiments / embodiments can be combined, separated, interchanged and / or rearranged without departing from the technical concept of the present disclosure.

[0023] The use of cross-hatching and / or shading in the accompanying drawings is generally used to make the boundaries between adjacent components clear. As such, unless otherwise specified, the presence or absence of cross-hatching or shading does not convey or indicate any preference or requirement for the specific materials, material properties, dimensions, proportions, commonalities between the components shown, and / or any other characteristics, attributes, properties, etc. of the components. In addition, in the accompanying drawings, the sizes and relative sizes of the components may be exaggerated for clarity and / or descriptive purposes. When the exemplary embodiments can be implemented differently, the specific process sequence can be performed in a different order than described. For example, two successively described processes can be performed substantially simultaneously or in an order opposite to the described order. In addition, the same figure numbers represent the same components.

[0024] When a component is referred to as being "on" or "over," "connected to," or "coupled to" another component, the component may be directly on, directly connected to, or directly coupled to the other component, or intervening components may be present. However, when a component is referred to as being "directly on," "directly connected to," or "directly coupled to" another component, there are no intervening components. For this purpose, the term "connected" may refer to a physical connection, an electrical connection, etc., with or without intervening components.

[0025] The terms used herein are for the purpose of describing specific embodiments, and are not intended to be restrictive. As used herein, unless the context clearly indicates otherwise, the singular forms "one (kind, person)" and "(the)" are also intended to include plural forms. In addition, when the terms "comprise" and / or "include" and their variations are used in this specification, it is explained that there are stated features, integral bodies, steps, operations, parts, assemblies and / or their groups, but one or more other features, integral bodies, steps, operations, parts, assemblies and / or their groups are not excluded from existence or addition. It should also be noted that, as used herein, the terms "substantially", "approximately" and other similar terms are used as approximate terms and not as degree terms, so that they are used to explain the inherent deviations of the measured values, calculated values ​​and / or the values ​​provided that will be recognized by those of ordinary skill in the art.

[0026] At present, most terminal devices have screenshot technology, which can capture any area in the current display screen to generate an image. For example, in the environment of browsing web pages with a browser, the screenshot technology of the terminal device can be used to take a screenshot of any content of the current page. However, in some relatively complex application scenarios, it is necessary to take a screenshot of website B on website A and use the screenshot information on website A, where website A and website B are non-homologous pages. In this case, if the server-side screenshot solution is adopted, the website needs to allow anonymous access. In addition, since there are upstream and downstream traffic costs for server-side screenshots, it is easy to cause the screenshot service to be unavailable when the server's pressure-bearing capacity is weak and the concurrency is high.

[0027] Based on the above problems, the present disclosure provides a data processing system. Figure 1 A schematic diagram of a scenario in which a data processing system of an embodiment of the present disclosure performs data processing is shown. The data processing system embeds a page of a non-homologous website B in a page of a website A that is running normally in a browser environment and loads resources of the page of website B. Non-homologous means that the page of website A cannot directly access the page of website B.

[0028] When the resources of the page of website B are loaded, the data processing system monitors the progress of resource loading of the page of website B to determine whether the images in the page of website B have been rendered, so as to avoid errors caused by taking screenshots when the images have not been rendered. The data monitoring of the page of website B includes monitoring the progress of document structure construction of website B, the progress of processing asynchronous requests, and the progress of image rendering to obtain monitoring results. When the progress of document structure construction of website B is completed, the progress of processing asynchronous requests is completed, and the progress of image rendering is completed, it indicates that the currently loadable images of website B have been loaded, and there will be no subsequent information changes that will cause changes in the loaded images, ensuring that no errors will occur when taking screenshots in this case.

[0029] When the monitoring result of data monitoring of the page of website B indicates that the currently loadable images in the page of website B have been loaded and there will be no subsequent information changes, a screenshot can be taken of any loaded image in the page of website B. The screenshot method can use a screenshot program of a terminal device or a screenshot program of the page of website A, and there is no limitation here. The page of website B uses a corresponding image container to store the screenshot, and converts the screenshot code into target data in string format for transmission.

[0030] After receiving the target data, the page of website A decodes the target data, and obtains the screenshot captured from the page of website B on the page of website A, so that the screenshot can be applied to the page of website A.

[0031] In summary, the data processing system disclosed in the present invention can realize the screenshot of another page of a non-homologous page on one page and apply the screenshot information without occupying server-side resources. In this way, the defect that the screenshot function between non-homologous pages cannot be used normally due to excessive server pressure can be avoided.

[0032] Figure 2 The structural diagram of the data processing system of the embodiment of the present disclosure is shown. The data processing system 100 includes a processor 10 and a memory 20, and the memory 20 stores a computer program. The present disclosure provides a data processing method M100. When the computer program is executed by the processor 10, the processor 10 and the computer program perform the following processes in the data processing method M100:

[0033] S110: embedding a second page in the first page and loading resources of the second page, wherein the first page and the second page are non-same-origin pages. This step can be achieved by opening a module.

[0034] S120: Monitor the resource loading progress of the second page and obtain monitoring results. This step can be implemented by a monitoring module.

[0035] S130: When the monitoring result is the first result, a screenshot is taken of at least a portion of the second page to obtain a target screenshot, which is stored in a picture container of the second page. This step can be implemented by a screenshot module.

[0036] S140: In the image container, encode the target screenshot into a string format to obtain target data. This step can be implemented by an encoding module.

[0037] S150: Transmitting the target data to the first page. This step can be implemented by a transmission module.

[0038] S160: Decode the target data on the first page to obtain a target screenshot. This step can be implemented by a decoding module.

[0039] In step S110, the first page and the second page are pages originating from two different websites. A non-homologous page is a page that does not meet the homologous page condition. Two pages are called homologous pages when they meet the following three conditions: the same protocol, the same domain name, and the same port. Relatively speaking, if any one of the protocols, domain names, and ports of the two pages is different, the two pages are non-homologous pages. For example, the first page and the second page are non-homologous pages, which means that one or more of the protocols, domain names, and ports of the first page and the second page are different, resulting in the inability to directly access the second page from the first page, and the inability to directly access the first page from the second page.

[0040] Embedding the second page in the first page and loading the resources of the second page means that in a browser environment, based on the currently displayed page being the first page, no jump to the second page is performed, but the content contained in the second page is embedded in a certain area of ​​the first page, and the displayable content of the second page is loaded, so as to achieve the effect of embedding the content of the second page in the first page for display.

[0041] In one example, the HTML <iframe>" tag realizes the function of opening the second page in the first page in an embedded form.

[0042] In step S120, document structure construction refers to the method and attributes of operating page elements when loading an HTML page, building a web page into a document composed of a node hierarchy, so that the HTML page can be linked to a script and a programming language. The node hierarchy includes nodes of types such as document nodes, element nodes, attribute nodes, and text nodes. The document node is used to present the entire page. The element node is used as the starting point when accessed by a program. For example, when a program accesses a node in the node hierarchy, it is necessary to start by searching for an element. Once the required element is found, the text node and attribute node under the element node corresponding to the element can be accessed as needed. The attribute node can be read and can be modified to change the attributes of its corresponding element. The text node is used to allow the program to access the text inside the corresponding element when accessed by the program.

[0043] Monitoring the progress of the document structure construction of the second page refers to monitoring whether the document structure construction of the second page is completed. In one example, when the document structure of the second page no longer changes, the progress of the document structure construction of the second page is determined to be completed. Otherwise, if the document structure of the second page is still changing, the progress of the document structure construction of the second page is determined to be incomplete.

[0044] Asynchronous request means that after a sending end (such as a browser end) sends a request to a receiving end (such as a server end), the sending end does not wait for the response result of the receiving end, but immediately continues to execute the subsequent code task without blocking or pausing the execution of the current thread or process. In one example, when the receiving end has completed the processing and prepared the response data, the sending end is notified through a predefined callback function, Promise object, async / await syntax, etc. to process the response data.

[0045] Monitoring the processing progress of the asynchronous request of the second page refers to monitoring whether each asynchronous request of the second page has received a corresponding return result. In one example, when each asynchronous request of the second page has received a corresponding return result, the processing progress of the asynchronous request of the second page is determined to be completed. Otherwise, if some asynchronous requests of the second page have not received a corresponding return result, the processing progress of the asynchronous request of the second page is determined to be incomplete. The picture element of the second page refers to a displayable picture contained in the resources of the second page. In one example, the picture element can be a picture contained in the url (uniform resource locator, abbreviated as url) directed to the second page when the second page is opened.Monitoring the rendering progress of the picture element of the second page refers to monitoring whether the rendering of the picture element of the second page is completed. In one example, when the rendering of the picture element of the second page is completed, the rendering progress of the picture element of the second page is determined to be completed. Otherwise, if the picture element of the second page has not yet completed rendering, the rendering progress of the picture element of the second page is determined to be incomplete.

[0048] In step S130, the monitoring result is the first result, indicating that the resource loading of the second page has been completed. For example, when the document structure of the second page has been constructed, the processing of the asynchronous request has been completed, and the rendering of the picture element has been completed, it is considered that the resource loading of the second page has been completed. Screenshot processing is performed on at least a portion of the area of ​​the second page to obtain a target screenshot; it refers to the range of the area displayed on the second page to be screenshotted, which can be the entire area displayed on the second page, or it can be a partial area of ​​the second page displayed in an arbitrary shape, such as intercepting a partial area of ​​the second page displayed in a circle of a certain size, intercepting a partial area of ​​the second page displayed in a rectangle of a certain size, etc., without limitation here.

[0049] The image container of the second page is an HTML element for wrapping and controlling the layout, size and style of the target screenshot. In one example, the image container of the second page is an SVG (Scalable Vector Graphics, abbreviated as: SVG) element, and the target screenshot is stored in the SVG element of the second page in an embedded form. Specifically, in one example, the image container of the second page uses the "<foreignObject> "Label."<foreignObject> "The tag allows external objects (such as HTML or XML snippets) to be embedded into an SVG image."<foreignObject> The attributes of the " tag can define the coordinates and size of the embedded area, and can store the target screenshot with the configured coordinates and size.

[0050] In step S140, the target screenshot is encoded into a string format to obtain target data; it refers to converting the binary data of the target screenshot file into a text string encoding method to obtain the target data. In this way, the target data obtained after the encoding conversion can be easily transmitted and stored. Correspondingly, in step S160, the target data is decoded on the first page to obtain the target screenshot; it refers to converting the target data in the text string format into the binary data of the picture file to obtain the target screenshot on the first page.

[0051] In one example, the target data is in Base64 format, and can be obtained by encoding the target screenshot using a Base64 algorithm. In summary , the processor 10 of the data processing system 100 and the computer program perform the above-mentioned steps S110, S120, S130, S140, S150 and S160, and can realize taking a screenshot of the second page of non-homologous source on the first page, and obtain the screenshot on the first page. In this process, there is no need for the server to participate in the screenshot, which can save server resources and avoid the problem that the screenshot function cannot be used due to the server being unable to access the site corresponding to the page and the large server flow pressure.

[0053] In some implementations, the resource loading progress includes the document structure construction progress of the second page, and the first result includes the first sub-result; in step S120, monitoring the document structure construction progress of the second page includes step S121 and step S122.

[0054] S121: Monitor whether the node tree of the document object model of the second page changes.

[0055] S122: When the node tree of the document object model of the second page does not change, a first sub-result is obtained, and the first sub-result indicates that the document structure construction has been completed.

[0056] The document object model refers to DOM (Document Object Model, abbreviated as: DOM). The node tree of the document object model of the second page is a model structure used to create the second page when the browser loads the second page, and is composed of multiple different types of nodes. For example, the node tree of the document object model may include document nodes, element nodes, attribute nodes, text nodes, and other types of nodes, which are not listed here one by one.

[0057] Monitoring whether the node tree of the document object model of the second page changes refers to monitoring whether the nodes in the node tree of the document object model of the second page are increased, decreased, or modified. When the nodes in the node tree of the document object model of the second page no longer increase, decrease, or modify, it is considered that the node tree of the document object model of the second page does not change, and a first sub-result is obtained. Otherwise, when the nodes in the node tree of the document object model of the second page increase, decrease, or modify, it is considered that the node tree of the document object model of the second page is still changing.

[0058] In some embodiments, the resource loading progress includes the processing progress of each asynchronous request of the second page, and the first result includes the second sub-result; in step S120, the processing progress of each asynchronous request of the second page is monitored, including step S123 and step S124.

[0059] S123: Monitor the data of the interfaces of each asynchronous request.

[0060] S124: If no new asynchronous request interface is monitored to send data within the first predetermined time after the interface of the asynchronous request that sent data most recently sends data, then when all the existing asynchronous request interfaces receive data return results, a second sub-result is obtained, and the second sub-result indicates that the processing of the asynchronous request has been completed.

[0061] In one example, the asynchronous request may be an AJAX (Asynchronous JavaScript and XML, abbreviated as: AJAX) request. The AJAX request is issued by its corresponding interface.

[0062] In an example, assuming that the first predetermined time is 20 seconds, the existing asynchronous request interface includes a first interface and a second interface, and the interface that sent data most recently is the second interface. If no updated asynchronous request sends data through the interface within 20 seconds after the second interface sends data, then when the existing first interface and the second interface both receive the data return result, the second sub-result is obtained. Otherwise, if an updated asynchronous request interface sends data within 20 seconds after the second interface sends data, then the time when the new asynchronous request interface sends data is used as the starting time to re-monitor whether there is a new asynchronous request interface sending data within 20 seconds.

[0063] In some embodiments, the resource loading progress includes the rendering progress of the picture element of the second page, and the first result includes the third sub-result; in step S120, the rendering progress of the picture element is monitored, including step S125 and step S126.

[0064] S125: Monitor the change in the number of picture tags in the second page.

[0065] S126: within a second predetermined time after the number of picture tags changes, if the number of picture tags no longer changes, a third sub-result is obtained, and the third sub-result indicates that the rendering of the picture element has been completed. In one example , the picture tag in the second page is " " tag, which is used to embed an image in a web page.Each time there is an image tag, it indicates that an image is successfully loaded in the second page. The number of image tags in the second page does not change, indicating that all image elements contained in the resources of the second page have been rendered. In one example, assuming that the second predetermined time is 5 seconds , and the number of picture tags in the second page monitored at the current moment is 5. If the number of picture tags in the second page is still 5 after 5 seconds from the current moment, the third sub-result is obtained. Otherwise, if the number of picture tags in the second page becomes 6 within 5 seconds from the current moment, the number of picture tags in the second page is re-monitored within 5 seconds to see if there is a change, taking the moment when the number of picture tags becomes 6 as the starting moment.

[0068] Based on the above steps S121, S122, S123, S124, S125 and S126, the first result is obtained when the first sub-result, the second sub-result and the third sub-result are obtained respectively. If any of the first sub-result, the second sub-result and the third sub-result is not obtained, the first result cannot be obtained.

[0069] In some embodiments, step S130 includes step S131 and step S132.

[0070] S131: When loading the second page, based on the uniform resource locator corresponding to the second page, determine the target element in the picture elements of the second page.

[0071] S132: Rendering at least a partial area of ​​the target element into a picture container to obtain a target screenshot.

[0072] The uniform resource locator corresponding to the second page, that is, the URL corresponding to the second page. The target element refers to the image element waiting to be screenshotted. The query information of the target element can be obtained from the URL parameter carried by the second page when the second page is opened.

[0073] After determining the target element, at least a portion of the target element is rendered into a picture container. In one example, the picture container of the second page uses the "<foreignObject> " tag, after determining the target element, render at least part of the target element to "<foreignObject> " tag, the area of ​​the target element to be rendered can be specified by the url parameter corresponding to the second page.

[0074] In some embodiments, step S110 includes step S111.

[0075] S111: In the first page, embed the second page by embedding the component, and load the second page in a partial area of ​​the first page.

[0076] Wherein, the embed component is a tag used to embed a web page into another web page. In one example, the embed component can be used<iframe> "Tag to achieve its function. For example, in the first page load "<iframe> " tag, and use the "<iframe> " tag is embedded in the first page and the second page is based on the "<iframe> " tag configuration, load the second page in the area of ​​specific coordinates and size in the first page.

[0077] "<iframe> "The tag has the ability to transfer data across domains. The target data obtained by encoding conversion on the second page can be obtained through "<iframe> " tag is transferred back to the first page.

[0078] Accordingly, in some embodiments, step S150 includes step S151.

[0079] S151: The target data is transferred to the embedded component, and the target data is transferred to the first page through the embedded component. Specifically , when using "<iframe> "When the tag is used as an embedded component, you can use the "<iframe> "The communication function of the tag is used to transmit data.

[0081] Accordingly, in some embodiments, step S151 includes step S1511, step S1512 and step S1513.

[0082] S1511: When the target data is transferred to the embedded component, a communication signal is sent to the first page.

[0083] S1512: When the first page receives the communication signal, an extraction request is sent to the embedded component.

[0084] S1513: When the embedded component receives the extraction request, the target data is transferred to the first page.

[0085] The communication signal is used to help the first page determine whether the screenshot action is completed. When the first page receives the communication signal, it can be determined that the screenshot action on the second page has been completed, and the screenshot data can be transmitted. In this way, when the first page receives the communication signal, an extraction request is sent to the embedded component, and when the embedded component receives the extraction request, the target data is transmitted to the first page to complete the transmission of the target data.

[0086] Based on the same inventive concept, embodiments of the present disclosure also provide a data processing method corresponding to the data processing system 100. Since the principle of solving problems by the data processing method in the embodiments of the present disclosure is similar to that of the above-mentioned data processing system 100 in the embodiments of the present disclosure, the implementation of the method can refer to the implementation of the data processing system, and the repeated parts will not be elaborated.

[0087] Figure 3 is a schematic flowchart of a data processing method M100 according to some embodiments of the present disclosure. Please refer to Figure 3. The data processing method M100 provided by the present disclosure may include step S110, step S120, step S130, step S140, step S150, and step S160.

[0088] S110: Embed a second page in the first page and load the resources of the second page, where the first page and the second page are non-homologous pages. This step can be implemented by an opening module.

[0089] S120: Monitor the resource loading progress of the second page to obtain a monitoring result. This step can be implemented by a monitoring module.

[0090] S130: In the case where the monitoring result is a first result, perform a screenshot process on at least a part of the second page to obtain a target screenshot, and the target screenshot is stored in an image container of the second page. This step can be implemented by a screenshot module.

[0091] S140: Encode the target screenshot into a string format in the image container to obtain target data. This step can be implemented by an encoding module.

[0092] S150: Transmit the target data to the first page. This step can be implemented by a transmission module.

[0093] S160: Decode the target data on the first page to obtain the target screenshot. This step can be implemented by a decoding module.

[0094] Please refer to Figure 4. In some embodiments, in step S120, monitoring the progress of the document structure construction of the second page includes step S121 and step S122.

[0095] S121: Monitoring whether the node tree of the document object model of the second page has changed.

[0096] S122: In the case where the node tree of the document object model of the second page does not change, obtaining a first sub-result, where the first sub-result indicates that the document structure construction has been completed.

[0097] Please refer to Figure 4. In some embodiments, in step S120, monitoring the progress of the asynchronous request processing of the second page includes step S123 and step S124.

[0098] S123: Monitoring the data of the interfaces of each asynchronous request.

[0099] S124: If no new asynchronous request interface sends data within the first predetermined time after the interface of the asynchronous request that sent data most recently sends data, then when the data return results are received by the interfaces of all existing asynchronous requests, obtaining a second sub-result, where the second sub-result indicates that the asynchronous request processing has been completed.

[0100] Please refer to Figure 4. In some embodiments, in step S120, monitoring the rendering progress of the picture element includes step S125 and step S126.

[0101] S125: Monitoring the change in the number of picture tags in the second page.

[0102] S126: Within a second predetermined time after the number of picture tags changes, if the number of picture tags no longer changes, a third sub-result is obtained, and the third sub-result indicates that the rendering of the picture elements is completed.

[0103] Please refer to Figure 5. In some embodiments, step S130 includes step S131 and step S132.

[0104] S131: When loading the second page, based on the uniform resource locator corresponding to the second page, determine a target element among the picture elements of the second page.

[0105] S132: Render at least a partial area of the target element into the picture container to obtain a target screenshot.

[0106] In some embodiments, step S110 includes step S111.

[0107] S111: In the first page, embed the second page through an embedding component and load the second page in a partial area of the first page.

[0108] In some embodiments, step S150 includes step S151.

[0109] S151: Transmit the target data to the embedding component, and the embedding component transmits the target data to the first page.

[0110] Specifically, when using the "<iframe>" tag as the embedding component, the communication function of the "<iframe>" tag can be utilized for data transmission.

[0111] Correspondingly, in some embodiments, step S151 includes step S1511, step S1512, and step S1513.

[0112] S1511: When the target data is transmitted to the embedding component, send a communication signal to the first page.

[0113] S1512: When the first page receives the communication signal, send an extraction request to the embedding component.

[0114] S1513: When the embedding component receives the extraction request, transmit the target data to the first page.

[0115] The disclosed embodiment also provides a computer-readable storage medium, in which execution instructions are stored, and when the execution instructions are executed by the processor 10, they are used to implement the above method. "Readable storage medium" can be any device that can contain, store, communicate, propagate or transmit programs for use with an instruction execution system, device or equipment or in combination with these instruction execution systems, devices or equipment. More specific examples of readable storage media include the following: an electrical connection portion (electronic device) with one or more wirings, a portable computer disk box (magnetic device), a random access memory 20 (RAM), a read-only memory 20 (ROM), an erasable and editable read-only memory 20 (EPROM or flash memory 20), an optical fiber device, and a portable read-only memory 20 (CDROM), etc.

[0116] The embodiments of the present disclosure also provide a computer program product, including a computer program / instruction, which, when the computer program / instruction processor 10 is executed, implements the question answering method provided in each embodiment of the present disclosure.

[0117] The method in the disclosed embodiment can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer programs or instructions. When the computer program or instruction is loaded and executed on a computer, the process or function of the present application is executed in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, a network device, a user device, a core network device, an OAM or other programmable device.

[0118] The computer program or instruction may be stored in a computer-readable storage medium, or may be transmitted from one computer-readable storage medium to another computer-readable storage medium, for example, the computer program or instruction may be transmitted from one website, computer, server or data center to another website, computer, server or data center by wired or wireless means. The computer-readable storage medium may be any available medium that a computer can access or a data storage device such as a server or data center that integrates one or more available media. Available media may be magnetic media, for example, a floppy disk, a hard disk, or a magnetic tape; may also be optical media, for example, a digital video disc; may also be semiconductor media, for example, a solid state drive. The computer-readable storage medium may be a volatile or non-volatile storage medium, or may include both volatile and non-volatile types of storage media.

[0119] Those skilled in the art should understand that the embodiments of the present disclosure may be provided as methods, systems, or computer program products.Therefore, the present disclosure may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware. Moreover, the present disclosure may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program codes. In the description of this specification sheet , the description of reference term "an embodiment / mode", "some embodiments / modes", "example", "specific example" or "some examples" etc. means that the specific features, structure, material or characteristics described in conjunction with this embodiment / mode or example are included in at least one embodiment / mode or example of the present application. In this specification sheet, the schematic representation of the above-mentioned terms is not necessarily the same embodiment / mode or example. Moreover, the specific features, structure, material or characteristics described can be combined in any one or more embodiments / modes or examples in a suitable manner. In addition, those skilled in the art can combine and combine the different embodiments / modes or examples described in this specification sheet and the features of the different embodiments / modes or examples without contradicting each other. In addition, the terms "first", "second" are only used for description purposes, and cannot be interpreted as indicating or suggesting relative importance or implicitly indicating the quantity of indicated technical features. Thus, the feature defined as "first", "second" can expressly or implicitly include at least one of these features. In the description of the application, the meaning of "plurality" is at least two, such as two, three, etc., unless otherwise clearly and specifically limited.

[0122] It should be understood by those skilled in the art that the above-mentioned embodiments are only for the purpose of clearly illustrating the present disclosure, and are used to illustrate the technical solutions of the present disclosure, rather than to limit them. The protection scope of the present disclosure is not limited thereto. Although the present disclosure is described in detail with reference to the aforementioned embodiments, it should be understood by those skilled in the art that any person familiar with the technical field can still modify the technical solutions recorded in the aforementioned embodiments within the technical scope disclosed in the present disclosure, or can easily think of changes, or replace some of the technical features therein with equivalents; and these modifications, changes or replacements do not make the essence of the corresponding technical solutions depart from the spirit and scope of the technical solutions of the embodiments of the present disclosure, and should be included in the protection scope of the present disclosure. Therefore, the protection scope of the present disclosure should be based on the protection scope of the claims.< / iframe>

Claims

1. A data processing method, characterized in that: include: In a first page, embed a second page and load resources of the second page, wherein the first page and the second page are non-same-origin pages; Monitoring the resource loading progress of the second page to obtain monitoring results; When the monitoring result is the first result, taking a screenshot of at least a portion of the second page to obtain a target screenshot, wherein the target screenshot is stored in a picture container of the second page; In the picture container, the target screenshot is encoded into a string format to obtain target data; transferring the target data to the first page; as well as The target data is decoded on the first page to obtain the target screenshot; wherein the first result indicates that resource loading of the second page has been completed.

2. The data processing system according to claim 1, characterized in that The resource loading progress includes the document structure construction progress of the second page, and the first result includes the first sub-result; Monitoring the progress of constructing the document structure of the second page, including: Monitoring whether a node tree of a document object model of the second page changes; as well as When the node tree of the document object model of the second page does not change, a first sub-result is obtained, and the first sub-result indicates that the document structure construction has been completed.

3. The data processing system according to claim 1, characterized in that: The resource loading progress includes the processing progress of each asynchronous request of the second page, and the first result includes the second sub-result; Monitoring the processing progress of each asynchronous request of the second page includes: Monitoring the data of each of the interfaces of the asynchronous request; and If no new data is monitored from the interface of the asynchronous request within the first predetermined time after the interface of the asynchronous request that last sent data sent data, a second sub-result is obtained when all the existing interfaces of the asynchronous request receive data return results, and the second sub-result indicates that the processing of the asynchronous request has been completed.

4. The data processing system according to claim 1, characterized in that: The resource loading progress includes the rendering progress of the image element of the second page, and the first result includes the third sub-result; Monitor the rendering progress of image elements, including: Monitoring the change in the number of image tags in the second page; as well as Within a second predetermined time after the number of the picture tags changes, if the number of the picture tags no longer changes, a third sub-result is obtained, and the third sub-result indicates that the rendering of the picture element has been completed.

5. The data processing system according to claim 1, characterized in that: When the monitoring result is the first result, taking a screenshot of at least a portion of the second page to obtain a target screenshot, wherein the target screenshot is stored in a picture container of the second page, includes: When loading the second page, determining a target element in the image element of the second page based on the uniform resource locator corresponding to the second page; and Rendering at least a partial area of ​​the target element into the image container to obtain the target screenshot.

6. The data processing system according to claim 1, characterized in that In a first page, embedding a second page and loading resources of the second page include: In the first page, embed the second page through an embedding component, and load the second page in a partial area of ​​the first page; The step of transmitting the target data to the first page includes: The target data is transferred to the embedded component, and the target data is transferred to the first page through the embedded component.

7. The data processing system according to claim 1, characterized in that The step of transferring the target data to the embedded component and transferring the target data to the first page through the embedded component includes: When the target data is transferred to the embedded component, communicating a signal to the first page; When the first page receives the communication signal, sending an extraction request to the embedded component; and When the embedded component receives the extraction request, the target data is transferred to the first page.

8. A data processing system, characterized in that: The invention comprises a processor and a memory, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor and the computer program execute the data processing method according to any one of claims 1 to 7.

9. A readable storage medium, characterized in that: The readable storage medium stores a computer program, and when the computer program is executed by a processor, it is used to implement the data processing method according to any one of claims 1 to 7.

10. A computer program product, characterized in that The computer program product comprises a computer program, and when the computer program is executed by a processor, the computer program is used to implement at least the data processing method according to any one of claims 1 to 7.