CN112818270B - Data cross-domain transfer method and device and computer equipment - Google Patents

Data cross-domain transfer method and device and computer equipment Download PDF

Info

Publication number
CN112818270B
CN112818270B CN202110099074.5A CN202110099074A CN112818270B CN 112818270 B CN112818270 B CN 112818270B CN 202110099074 A CN202110099074 A CN 202110099074A CN 112818270 B CN112818270 B CN 112818270B
Authority
CN
China
Prior art keywords
page
inline frame
website
blank
display
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202110099074.5A
Other languages
Chinese (zh)
Other versions
CN112818270A (en
Inventor
梁勇
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shanghai Bilibili Technology Co Ltd
Original Assignee
Shanghai Bilibili Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shanghai Bilibili Technology Co Ltd filed Critical Shanghai Bilibili Technology Co Ltd
Priority to CN202110099074.5A priority Critical patent/CN112818270B/en
Publication of CN112818270A publication Critical patent/CN112818270A/en
Application granted granted Critical
Publication of CN112818270B publication Critical patent/CN112818270B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/957Browsing optimisation, e.g. caching or content distillation
    • 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
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/958Organisation or management of web site content, e.g. publishing, maintaining pages or automatic linking
    • G06F16/972Access to data in other repository systems, e.g. legacy data or dynamic Web page generation

Abstract

The application discloses a data cross-domain transfer method, a device and computer equipment, wherein the method comprises the following steps: receiving a display request of a second page which is triggered by a first page of a first website and points to a second website, wherein the first website and the second website are websites in different domains; acquiring display configuration parameters in a display request of the second page and a resource address of the second page; creating a blank inline frame according to the display configuration parameters; acquiring second page content corresponding to the second page according to the resource address of the second page; loading the second page content to the blank inline frame to obtain an embedded page; and displaying the embedded page in an embedded manner to the first page. The present application also provides a computer-readable storage medium. According to the method and the device, cross-domain data transmission is carried out through the inline frame of the front-end page, so that time for cross-domain data transmission is effectively saved, cross-domain data interaction is more convenient and efficient, and user experience is improved.

Description

Data cross-domain transfer method and device and computer equipment
Technical Field
The present disclosure relates to the field of internet technologies, and in particular, to a data cross-domain transfer method, apparatus, and computer device.
Background
Currently, in view of security level and the like, web page jumping and calling of a web site using a javascript language programming framework all follow a homologous strategy. The homology strategy is to prevent the javascript script of one domain from interacting with the content of another domain, and means that two pages based on the same protocol, host and port number are homologous pages, and interaction can be performed between the homologous pages; for two pages of different origin, no interaction can be performed.
Of course, in the prior art, the interaction problem of two pages with different sources is usually solved by using a Web proxy mode. The mode of the Web proxy, namely, the cross-domain access request to the B website generated when the user accesses the A website is submitted to the appointed page of the A website, and the page replaces the user page to complete interaction, so that a proper result is returned. However, the existing data cross-domain transfer mode has complicated execution process, long time consumption and poor execution efficiency.
Disclosure of Invention
The application provides a data cross-domain transfer method, a data cross-domain transfer device and computer equipment, which can solve the problems of complicated process, long time consumption and poor execution efficiency in the data cross-domain transfer process in the prior art.
First, to achieve the above object, the present application provides a data cross-domain transfer method, which includes:
receiving a display request of a second page which is triggered by a first page of a first website and points to a second website, wherein the first website and the second website are websites in different domains; acquiring display configuration parameters in a display request of the second page and a resource address of the second page; creating a blank inline frame according to the display configuration parameters; acquiring second page content corresponding to the second page according to the resource address of the second page; loading the second page content to the blank inline frame to obtain an embedded page; and displaying the embedded page in an embedded manner to the first page.
In one example, the method further comprises: receiving a display request of a third page which is triggered from the embedded page of the first page and points to the second website; acquiring third page content corresponding to the third page according to a resource address of the third page in the display request of the third page; and loading the third page content to the inline frame of the embedded page to replace the second page content.
In one example, the display configuration parameters include size information and presentation information including navigation bars and menu items of whether to present the second page.
In one example, the creating a blank inline frame from the display configuration parameters includes: and creating a blank inline frame with a corresponding size according to the size information.
In one example, the loading the second page content into the blank inline frame includes: adjusting navigation bars and menu items of the second page content according to the display information to obtain adjusted second page content; and loading the adjusted second page content to the blank inline frame.
In one example, the obtaining, according to the resource address of the second page, the second page content corresponding to the second page includes: sending an access request of second page content corresponding to the second page to a corresponding data server according to the resource address of the second page; and receiving the second page content returned by the data server.
In one example, before the sending, to the corresponding data server, the access request of the second page content corresponding to the second page, the method further includes: judging whether the resource address of the second page is in a preset white list or not; and if the resource address of the second page is not in the white list, rejecting the access request of the second page content and reporting errors.
In one example, before the creating of the blank inline frame according to the display configuration parameters, the method further comprises: acquiring a universal unique identification code of a self terminal and receiving time for receiving a display request of the second page; and generating an authentication token according to the universal unique identification code and the receiving time.
In one example, the method further comprises: binding the authentication token to the inline frame after creating the blank inline frame; writing the authentication token into an access request of the second page content and sending the access request to the data server; receiving the second page content returned by the data server, and judging whether the second page content contains the authentication token or not; if the second page content contains the authentication token, loading the second page content into the blank inline frame; otherwise, the step of writing the authentication token into the access request of the second page and sending the access request to the data server is re-executed.
In addition, to achieve the above object, the present application further provides a data cross-domain transfer device, which includes:
the receiving module is used for receiving a display request of a second page which is triggered by a first page of a first website and points to a second website, wherein the first website and the second website are websites in different domains; the acquisition module is used for acquiring the display configuration parameters in the display request of the second page and the resource address of the second page; the loading module is used for creating a blank inline frame according to the display configuration parameters; the acquisition module is further used for acquiring second page contents corresponding to the second page according to the resource address of the second page; the loading module is further configured to load the second page content to the blank inline frame to obtain an embedded page; and the display module is used for displaying the embedded page to the first page in an embedded way.
Further, the application also proposes a computer device, which comprises a memory and a processor, wherein the memory stores a computer program which can be run on the processor, and the computer program is executed by the processor to implement the steps of the data cross-domain transfer method.
Further, to achieve the above object, the present application further provides a computer readable storage medium storing a computer program executable by at least one processor to cause the at least one processor to perform the steps of the data cross-domain transfer method as described above.
Compared with the prior art, the data cross-domain transfer method, the data cross-domain transfer device, the computer equipment and the computer readable storage medium can be used for triggering a display request of a second page pointing to a second website by a first page of a first website, wherein the first website and the second website are websites in different domains; acquiring display configuration parameters in a display request of the second page and a resource address of the second page; creating a blank inline frame according to the display configuration parameters; acquiring second page content corresponding to the second page according to the resource address of the second page; loading the second page content to the blank inline frame to obtain an embedded page; and displaying the embedded page in an embedded manner to the first page. The cross-domain data transmission is carried out through the inline frame of the front-end page, so that the time for cross-domain data transmission is effectively saved, the cross-domain data interaction is more convenient and efficient, and the user experience is improved.
Drawings
FIG. 1 is a schematic view of an application environment according to an embodiment of the present application;
FIG. 2 is a flow chart of an embodiment of a data cross-domain transfer method of the present application;
FIG. 3 is a frame effect diagram of a station in a data page connecting two domains through a data cross-domain delivery SDK in an illustrative example of the present application;
FIG. 4 is a flow effect diagram of cross-domain display of a picture page based on the business page of FIG. 3;
FIG. 5 is a flowchart illustrating an exemplary process for invoking second page content based on a display request;
FIG. 6 is a schematic diagram illustrating a program module of an embodiment of a data cross-domain transfer device according to the present application;
FIG. 7 is a schematic diagram of an alternative hardware architecture of the computer device of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application will be further described in detail with reference to the accompanying drawings and examples. It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the present application. All other embodiments, which can be made by one of ordinary skill in the art without undue burden from the present disclosure, are within the scope of the present disclosure.
It should be noted that the description herein of "first," "second," etc. is for descriptive purposes only and is not to be construed as indicating or implying a relative importance or implying an indication of the number of technical features being indicated. Thus, a feature defining "a first" or "a second" may explicitly or implicitly include at least one such feature. In addition, the technical solutions of the embodiments may be combined with each other, but it is necessary to base that the technical solutions can be realized by those skilled in the art, and when the technical solutions are contradictory or cannot be realized, the combination of the technical solutions should be regarded as not exist and not within the protection scope of the present application.
FIG. 1 is a schematic view of an application environment according to an embodiment of the present application. Referring to fig. 1, the computer device 1 is connected to a data server 2 and a data server 3, and the data server 2 and the data server 3 belong to different domains. The computer device 1 may send a resource request of a first page to the data server 2, i.e. the first website, then receive the data resource of the first page sent by the data server 2, and display the first page on the Web browser. Then, the computer device 1 may receive a display request of a second page, which is triggered by a user from a first page and points to a second website, through a preset data cross-domain transfer device, where the first website and the second website are websites in different domains, acquire a display configuration parameter in the display request of the second page and a resource address of the second page, and create a blank inline frame according to the display configuration parameter; sending a resource request to the data server 3 according to the resource address of the second page, and receiving second page content corresponding to the second page from the data server 3; loading the second page content to the blank inline frame to obtain an embedded page; and finally, embedding and displaying the embedded page to the first page. In this embodiment, the computer device 1 may be a mobile phone, a tablet, a portable device, a PC, or other electronic devices with display functions; the data server 2 and the data server 3 may be a mobile phone, a tablet, a portable device, a PC or a server. The data cross-domain transfer device is a software package which is built in the computer device 1 and realizes a specific function, and specifically, the data cross-domain transfer device may be an SDK (Software Development Kit ) which is set in a Web browser and realizes a data cross-domain transfer function.
Example 1
FIG. 2 is a flow chart of an embodiment of a data cross-domain transfer method of the present application. It will be appreciated that the flow charts in the method embodiments are not intended to limit the order in which the steps are performed. An exemplary description will be made below with the computer apparatus 1 as an execution subject.
As shown in fig. 2, the data cross-domain transfer method may include steps S200 to S210.
Step S200, receiving a display request of a second page, which is triggered by a first page of a first website and points to a second website, wherein the first website and the second website are websites with different domains.
Step S202, obtaining a display configuration parameter in the display request of the second page and a resource address of the second page.
And step S204, creating a blank inline frame according to the display configuration parameters.
Specifically, in the process that the computer device 1 displays the first page of the first website on the Web browser, when the user triggers a resource request of other websites, that is, the second website, on the first page, for example, the first page is linked with a page resource of other domains, and when the user triggers a link corresponding to the second page by clicking, touching or inputting an instruction, the computer device 1 may receive the display request of the second page.
Then, the computer device 1 obtains a display configuration parameter in the display request of the second page and a resource address of the second page, and creates a blank inline frame according to the display configuration parameter. Specifically, the display request of the second page includes a display configuration parameter and a resource address of the second page, where the resource address of the second page is a URL (Uniform Resource Locator ) of a second page content corresponding to the second page. The display configuration parameters include size information and presentation information including navigation bars and menu items of whether to present the second page. The computer device 1 creating a blank inline frame according to the display configuration parameters comprises: and creating a blank inline frame with a corresponding size according to the size information. Since the inline frame is disposed in the first page, the size information includes a size smaller than the size of the first page, for example, the size of the first page is 48cm by 40cm, and the size of the inline frame may be 38cm by 30cm; in summary, the inline frame is a display range occupying a part of the first page, and thus the size information includes a size not larger than the size of the first page.
Step S206, obtaining second page content corresponding to the second page according to the resource address of the second page.
And step S208, loading the second page content to the blank inline frame to obtain an embedded page.
After the computer device 1 creates the blank inline frame, the second page content corresponding to the second page is further obtained according to the resource address of the second page. In this embodiment, the obtaining, by the computer device 1, the second page content corresponding to the second page according to the resource address of the second page includes: sending an access request of second page content corresponding to the second page to a corresponding data server according to the resource address of the second page; and receiving the second page content returned by the data server. For example, the resource address of the second page is a URL, so the computer device 1 sends an access request of the second page content to a corresponding data server, that is, a website corresponding to the URL, according to the URL; the data server then sends the second page content to the computer device 1 according to the access request for the second page content.
Of course, in a specific embodiment, before the computer device 1 sends the access request of the second page content corresponding to the second page to the corresponding data server, the method further includes: judging whether the resource address of the second page is in a preset white list or not; and if the resource address of the second page is not in the white list, rejecting the access request of the second page content and reporting errors. Since many websites may have data security implications, the computer device 1 presets a whitelist of websites to which the first page is allowed to link. After receiving the display request of the second page triggered by the first page, the computer device 1 obtains the resource address of the second page corresponding to the display request of the second page and judges whether the resource address of the second page exists in the white list; and when judging that the resource address of the second page does not exist in the white list, rejecting the access request of the second page content and reporting errors.
After the computer device 1 acquires the second page content, loading the second page content into the blank inline frame further includes: adjusting navigation bars and menu items of the second page content according to the display information to obtain adjusted second page content; and loading the adjusted second page content to the blank inline frame. In this embodiment, the computer device 1 obtains, according to the display request of the second page, display configuration parameters for the second page content, including display information, that is, a display manner in which the second page content is displayed on the first page: whether to display a navigation bar, whether to display a left menu item, etc. Then, the computer equipment 1 adjusts the second page content according to the display information to obtain corresponding adjusted second page content; and finally, loading the adjusted second page content to the blank inline frame, so as to generate a corresponding embedded page.
Step S210, displaying the embedded page embedded into the first page.
In this embodiment, the computer device 1 implements cross-domain communication processing on the received second page content through the PostMessage application interface technology on the Web browser, including compatible processing in terms of protocols, ports and hosts, so that the second page content may be compatible with the first page and displayed on the first page.
In another specific embodiment, before the creating a blank inline frame according to the display configuration parameters, the computer device 1 further performs the following steps, specifically including: acquiring a universal unique identification code of a self terminal and receiving time for receiving a display request of the second page; and generating an authentication token according to the universal unique identification code and the receiving time.
Therefore, the computer device 1 can realize that the first page can accurately call the second page content one to one through the authentication token, which specifically includes: binding the authentication token to the inline frame after creating the blank inline frame; writing the authentication token into an access request of the second page content and sending the access request to the data server; receiving the second page content returned by the data server, and judging whether the second page content contains the authentication token or not; if the second page content contains the authentication token, loading the second page content into the blank inline frame; otherwise, the step of writing the authentication token into the access request of the second page and sending the access request to the data server is re-executed.
The computer device 1 establishes an authentication token according to the universal unique identification code of the device and the receiving time of the display request of the second page, so that the inline frame can be well identified. Of course, the computer device 1 may also add a fixed value, such as a code number for identifying the Web browser, and generate an authentication token together with the universal unique identifier and the receiving time, so as to represent a process of opening a page of the Web browser with other domains embedded therein. Therefore, the computer device 1 can open a plurality of Web browser pages at the same time, then execute the Web browser pages to load pages of other domains at the same time, ensure that the respective cross-domain page loading processes can not interfere with each other according to different authentication tokens, and can run in parallel, thereby improving the efficiency.
In addition, after loading the second page content into the inline frame to obtain an embedded page and displaying the embedded page on the first page, when the user triggers a display request of a third page based on the embedded page, the computer device 1 further performs the steps including: receiving a display request of a third page which is triggered from the embedded page of the first page and points to the second website, wherein the third page is an upper/lower page of the second page; acquiring third page content corresponding to the third page according to a resource address of the third page in the display request of the third page; and loading the third page content to the inline frame of the embedded page to replace the second page content.
As shown in fig. 3, fig. 3 is a frame effect diagram of a station in a data page in which two domains are connected through a data cross-domain delivery SDK according to an exemplary example of the present application.
In this embodiment, the computer device 1 obtains service page data from a service center through a Web browser page, displays the service page data, and presets a data cross-domain transfer SDK in the Web browser; when a user triggers a first display request of a picture page based on the service page, the data cross-domain transfer SDK is connected to a picture middle platform according to the first display request, the picture middle platform at least comprises picture pages with functions of picture synthesis, picture uploading, picture editing and the like, corresponding to the picture page 1, the picture page 2 and the picture page 3, page data of the corresponding picture pages are obtained, and then the page data are transferred to the service middle platform for embedded display to the service page. When a user triggers a second display request of other picture pages based on the embedded picture page on the service page, the data cross-domain transfer SDK is connected to a picture middle station again according to the second display request, acquires page data of the corresponding picture page, and then transfers the page data to the service middle station for embedded display to the service page to replace original picture page data.
As shown in fig. 4, fig. 4 is a flowchart of the effect of displaying a picture page across domains based on the service page of fig. 3.
In the present embodiment, the computer device 1 first performs self-instantiation of the data cross-domain delivery SDK; then the data cross-domain transfer SDK receives a display request of a picture page of a user based on the service page; acquiring configuration parameters in the display request, and initializing an inline frame according to the configuration parameters; then, the data cross-domain transfer SDK requests a picture page corresponding to the display request to a picture middle platform, receives the picture page returned by the picture middle platform through PostMessage and embeds and mounts the picture page on a Dom (Document Object Model ) of a service page; finally, displaying the Dom to the service page; when the data cross-domain transfer SDK receives a request of a user for displaying other picture pages based on the embedded picture pages in the service page, the corresponding picture pages are requested to a picture center station according to the display request of the embedded picture pages and used for replacing the original picture pages in the embedded pages.
As shown in fig. 5, fig. 5 is a flowchart illustrating an exemplary process of calling the second page content according to the display request according to an exemplary embodiment of the present application.
In this embodiment, the computer device 1 receives a display request of a second page triggered by the first page; then, whether the configuration parameters in the display request are legal or not is obtained, and whether the resource address of the second page in the configuration parameters is in a preset white list or not is included; when the configuration parameters are legal, a blank inline frame is further created according to the size information in the configuration parameters; when the configuration parameters are illegal, reporting errors directly; then, the computer device 1 generates an authentication token according to the received time of the display request and the universal unique identification code of the computer device 1 itself and binds the authentication token to the inline frame; requesting the content of the second page from the corresponding data server according to the resource address of the second page; then receiving second page content sent by the data server through a message channel of a PostMessage application interface; wherein the computer device 1 also determines whether the process of receiving the second page content is time-out; when the receiving process is overtime, executing network abnormity alarm; otherwise, further judging whether the received second page content contains the authentication token; when the second page content contains the authentication token, generating an embedded page according to the second page content and the configuration parameters and notifying the embedded page to a first page; otherwise, ignoring, and not responding to the received second page content.
In summary, the data cross-domain transfer method provided in this embodiment may be a display request of a second page directed to a second website triggered by a first page of a first website, where the first website and the second website are websites in different domains; acquiring display configuration parameters in a display request of the second page and a resource address of the second page; creating a blank inline frame according to the display configuration parameters; acquiring second page content corresponding to the second page according to the resource address of the second page; loading the second page content to the blank inline frame to obtain an embedded page; and displaying the embedded page in an embedded manner to the first page. The cross-domain data transmission is carried out through the inline frame of the front-end page, so that the time for cross-domain data transmission is effectively saved, the cross-domain data interaction is more convenient and efficient, and the user experience is improved.
Example two
Fig. 6 schematically illustrates a block diagram of a data cross-domain transfer device according to a second embodiment of the present application, which may be divided into one or more program modules, which are stored in a storage medium and executed by one or more processors to complete the embodiments of the present application. Program modules in the embodiments of the present application refer to a series of computer program instruction segments capable of implementing specific functions, and the following description specifically describes the functions of each program module in the embodiment.
As shown in fig. 6, the data cross-domain transferring apparatus 400 may include a receiving module 410, an acquiring module 420, a loading module 430, and a displaying module 440, wherein:
the receiving module 410 is configured to receive a display request of a second page that is triggered by a first page of a first website and points to a second website, where the first website and the second website are websites of different domains.
And the obtaining module 420 is configured to obtain a display configuration parameter in the display request of the second page and a resource address of the second page. The display configuration parameters include size information and presentation information including navigation bars and menu items of whether to present the second page.
And a loading module 430, configured to create a blank inline frame according to the display configuration parameters. Comprising the following steps: and creating a blank inline frame with a corresponding size according to the size information.
The obtaining module 420 is further configured to obtain second page content corresponding to the second page according to the resource address of the second page.
The loading module 430 is further configured to load the second page content to the blank inline frame, to obtain an embedded page.
And the display module 440 is used for displaying the embedded page to the first page in an embedded way.
In an exemplary embodiment, the receiving module 410 is further configured to receive a display request that is triggered from the embedded page of the first page and points to a third page of the second website; the obtaining module 420 is further configured to obtain a third page content corresponding to the third page according to a resource address of the third page in the display request of the third page; the loading module 430 is further configured to load the third page content onto the inline frame of the embedded page to replace the second page content.
In an exemplary embodiment, the loading module 430 is further configured to adjust navigation bars and menu items of the second page content according to the display information, so as to obtain adjusted second page content; and loading the adjusted second page content to the blank inline frame.
In an exemplary embodiment, the obtaining module 420 is further configured to send, to a corresponding data server, an access request of a second page content corresponding to the second page according to the resource address of the second page; and receiving the second page content returned by the data server. Judging whether the resource address of the second page is in a preset white list or not; and if the resource address of the second page is not in the white list, rejecting the access request of the second page content and reporting errors.
In an exemplary embodiment, the loading module 430 is further configured to: acquiring a universal unique identification code of a self terminal and receiving time for receiving a display request of the second page; generating an authentication token according to the universal unique identification code and the receiving time; the authentication token is bound to the inline frame after the blank inline frame is created. The obtaining module 420 is further configured to: writing the authentication token into an access request of the second page content and sending the access request to the data server; receiving the second page content returned by the data server, and judging whether the second page content contains the authentication token or not; if the second page content contains the authentication token, loading the second page content into the blank inline frame; otherwise, the step of writing the authentication token into the access request of the second page and sending the access request to the data server is re-executed.
Example III
Fig. 7 schematically shows a hardware architecture diagram of a computer device 1 adapted to implement a data cross-domain transfer method according to a third embodiment of the present application. In the present embodiment, the computer apparatus 1 is an apparatus capable of automatically performing numerical calculation and/or information processing in accordance with an instruction set or stored in advance. For example, the server may be a rack server, a blade server, a tower server, or a rack server (including a stand-alone server or a server cluster formed by a plurality of servers) with a gateway function, or the like. As shown in fig. 7, the computer device 1 includes at least, but is not limited to: the memory 510, processor 520, and network interface 530 may be communicatively linked to each other by a system bus. Wherein:
the memory 510 includes at least one type of computer-readable storage medium including flash memory, hard disk, multimedia card, card memory (e.g., SD or DX memory, etc.), random Access Memory (RAM), static Random Access Memory (SRAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), programmable read-only memory (PROM), magnetic memory, magnetic disk, optical disk, etc. In some embodiments, the memory 510 may be an internal storage module of the computer device 1, such as a hard disk or memory of the computer device 1. In other embodiments, the memory 510 may also be an external storage device of the computer device 1, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash Card (Flash Card) or the like, which are provided on the computer device 1. Of course, the memory 510 may also include both internal memory modules of the computer device 1 and external memory devices. In this embodiment, the memory 510 is typically used for storing an operating system and various types of application software installed on the computer device 1, such as program codes of a data cross-domain transfer method, and the like. In addition, the memory 510 may also be used to temporarily store various types of data that have been output or are to be output.
Processor 520 may be a central processing unit (Central Processing Unit, simply CPU), controller, microcontroller, microprocessor, or other data processing chip in some embodiments. The processor 520 is generally used to control the overall operation of the computer device 1, such as performing control and processing related to data interaction or communication with the computer device 1, and the like. In this embodiment, the processor 520 is configured to execute program codes or process data stored in the memory 510.
The network interface 530 may comprise a wireless network interface or a wired network interface, which network interface 530 is typically used to establish a communication link between the computer device 1 and other computer devices. For example, the network interface 530 is used to connect the computer device 1 to an external terminal through a network, establish a data transmission channel and a communication link between the computer device 1 and the external terminal, and the like. The network may be a wireless or wired network such as an Intranet (Intranet), the Internet (Internet), a global system for mobile communications (Global System of Mobile communication, abbreviated as GSM), wideband code division multiple access (Wideband Code Division Multiple Access, abbreviated as WCDMA), a 4G network, a 5G network, bluetooth (Bluetooth), wi-Fi, etc.
It should be noted that fig. 7 only shows a computer device having components 510-530, but it should be understood that not all of the illustrated components are required to be implemented, and that more or fewer components may be implemented instead.
In this embodiment, the program code of the data cross-domain transfer method stored in the memory 510 may also be divided into one or more program modules and executed by one or more processors (the processor 520 in this embodiment) to complete the embodiments of the present application.
Example IV
The present embodiment also provides a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, performs the steps of:
receiving a display request of a second page which is triggered by a first page of a first website and points to a second website, wherein the first website and the second website are websites in different domains; acquiring display configuration parameters in a display request of the second page and a resource address of the second page; creating a blank inline frame according to the display configuration parameters; acquiring second page content corresponding to the second page according to the resource address of the second page; loading the second page content to the blank inline frame to obtain an embedded page; and displaying the embedded page in an embedded manner to the first page.
In this embodiment, the computer-readable storage medium includes a flash memory, a hard disk, a multimedia card, a card memory (e.g., SD or DX memory, etc.), a Random Access Memory (RAM), a Static Random Access Memory (SRAM), a read-only memory (ROM), an electrically erasable programmable read-only memory (EEPROM), a programmable read-only memory (PROM), a magnetic memory, a magnetic disk, an optical disk, and the like. In some embodiments, the computer readable storage medium may be an internal storage unit of a computer device, such as a hard disk or a memory of the computer device. In other embodiments, the computer readable storage medium may also be an external storage device of a computer device, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash Card (Flash Card), etc. that are provided on the computer device. Of course, the computer-readable storage medium may also include both internal storage units of a computer device and external storage devices. In this embodiment, the computer readable storage medium is typically used to store an operating system and various types of application software installed on a computer device, such as program codes of a data cross-domain transfer method in the embodiment, and the like. Furthermore, the computer-readable storage medium may also be used to temporarily store various types of data that have been output or are to be output.
It will be apparent to those skilled in the art that the modules or steps of the embodiments of the application described above may be implemented in a general purpose computing device, they may be concentrated on a single computing device, or distributed across a network of computing devices, they may alternatively be implemented in program code executable by computing devices, so that they may be stored in a storage device for execution by computing devices, and in some cases, the steps shown or described may be performed in a different order than what is shown or described, or they may be separately fabricated into individual integrated circuit modules, or multiple modules or steps of them may be fabricated into a single integrated circuit module. Thus, embodiments of the present application are not limited to any specific combination of hardware and software.
The foregoing is only the preferred embodiments of the present application, and is not intended to limit the scope of the embodiments of the present application, and all equivalent structures or equivalent processes using the descriptions of the embodiments of the present application and the contents of the drawings, or directly or indirectly applied to other related technical fields, are included in the scope of the embodiments of the present application.

Claims (12)

1. A method of data cross-domain delivery, the method comprising:
receiving a display request of a second page which is triggered by a first page of a first website and points to a second website, wherein the first website and the second website are websites in different domains;
acquiring display configuration parameters in a display request of the second page and a resource address of the second page, wherein the display configuration parameters comprise size information of an inline frame;
creating a blank inline frame according to the display configuration parameters;
acquiring second page content corresponding to the second page according to the resource address of the second page;
loading the second page content to the blank inline frame to obtain an embedded page;
and displaying the embedded page in an embedded manner to the first page.
2. The data cross-domain delivery method of claim 1, wherein the method further comprises:
receiving a display request of a third page which is triggered from the embedded page of the first page and points to the second website;
acquiring third page content corresponding to the third page according to a resource address of the third page in the display request of the third page;
and loading the third page content to the inline frame of the embedded page to replace the second page content.
3. The data cross-domain delivery method of claim 1, wherein the display configuration parameters include size information and presentation information including navigation bars and menu items of whether to present the second page.
4. The data cross-domain delivery method as claimed in claim 3, wherein said creating a blank inline frame from the display configuration parameters comprises:
and creating a blank inline frame with a corresponding size according to the size information.
5. The data cross-domain delivery method as claimed in claim 3 wherein said loading said second page content into said blank inline frame comprises:
adjusting navigation bars and menu items of the second page content according to the display information to obtain adjusted second page content;
and loading the adjusted second page content to the blank inline frame.
6. The method of claim 1, wherein the obtaining the second page content corresponding to the second page according to the resource address of the second page comprises:
sending an access request of second page content corresponding to the second page to a corresponding data server according to the resource address of the second page;
and receiving the second page content returned by the data server.
7. The method for cross-domain delivery of data according to claim 6, wherein before sending the access request of the second page content corresponding to the second page to the corresponding data server, the method further comprises:
judging whether the resource address of the second page is in a preset white list or not;
and if the resource address of the second page is not in the white list, rejecting the access request of the second page content and reporting errors.
8. The data cross-domain delivery method of any one of claims 6 or 7, wherein prior to said creating a blank inline frame from the display configuration parameters, the method further comprises:
acquiring a universal unique identification code of a self terminal and receiving time for receiving a display request of the second page;
and generating an authentication token according to the universal unique identification code and the receiving time.
9. The data cross-domain delivery method of claim 8, wherein the method further comprises:
binding the authentication token to the inline frame after creating the blank inline frame;
writing the authentication token into an access request of the second page content and sending the access request to the data server; and
receiving the second page content returned by the data server, and judging whether the second page content contains the authentication token or not;
if the second page content contains the authentication token, loading the second page content into the blank inline frame; otherwise, the step of writing the authentication token into the access request of the second page and sending the access request to the data server is re-executed.
10. A data cross-domain transfer device, the device comprising:
the receiving module is used for receiving a display request of a second page which is triggered by a first page of a first website and points to a second website, wherein the first website and the second website are websites in different domains;
the acquisition module is used for acquiring display configuration parameters in the display request of the second page and the resource address of the second page, wherein the display configuration parameters comprise size information of an inline frame;
the loading module is used for creating a blank inline frame according to the display configuration parameters;
the acquisition module is further used for acquiring second page contents corresponding to the second page according to the resource address of the second page;
the loading module is further configured to load the second page content to the blank inline frame to obtain an embedded page;
and the display module is used for displaying the embedded page to the first page in an embedded way.
11. A computer device, characterized in that it comprises a memory, a processor, on which a computer program is stored which is executable on the processor, the computer program, when being executed by the processor, implementing the steps of the data cross-domain transfer method according to any of claims 1-9.
12. A computer readable storage medium, characterized in that the computer readable storage medium stores a computer program executable by at least one processor to cause the at least one processor to perform the steps of the data cross-domain transfer method according to any one of claims 1-9.
CN202110099074.5A 2021-01-25 2021-01-25 Data cross-domain transfer method and device and computer equipment Active CN112818270B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110099074.5A CN112818270B (en) 2021-01-25 2021-01-25 Data cross-domain transfer method and device and computer equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110099074.5A CN112818270B (en) 2021-01-25 2021-01-25 Data cross-domain transfer method and device and computer equipment

Publications (2)

Publication Number Publication Date
CN112818270A CN112818270A (en) 2021-05-18
CN112818270B true CN112818270B (en) 2023-07-25

Family

ID=75859144

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110099074.5A Active CN112818270B (en) 2021-01-25 2021-01-25 Data cross-domain transfer method and device and computer equipment

Country Status (1)

Country Link
CN (1) CN112818270B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113296762B (en) * 2021-06-21 2023-07-21 北京有竹居网络技术有限公司 Page embedding method and device, storage medium and electronic equipment
CN113382453B (en) * 2021-08-12 2021-10-29 北京小鸟科技股份有限公司 Cross-domain graph transmission method and system based on enhanced static routing calculation and source return

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102184220A (en) * 2011-05-06 2011-09-14 中兴通讯股份有限公司 Cross-domain page display control method and device
CN102402580A (en) * 2010-09-30 2012-04-04 微软公司 Securely rendering online ads in a host page
CN103095762A (en) * 2011-11-02 2013-05-08 腾讯科技(深圳)有限公司 Web page cross-domain communication method and device
CN103246667A (en) * 2012-02-08 2013-08-14 腾讯科技(深圳)有限公司 Method and device for cross-domain transfer of data
CN104301379A (en) * 2014-08-28 2015-01-21 北京奇虎科技有限公司 Web page cross-domain communication method and device
CN104423910A (en) * 2013-08-27 2015-03-18 腾讯科技(深圳)有限公司 Cross-domain page display method, device and terminal equipment
CN104965690A (en) * 2014-04-18 2015-10-07 腾讯科技(深圳)有限公司 Method and apparatus for processing data
CN110300133A (en) * 2018-03-22 2019-10-01 财付通支付科技有限公司 Cross-domain data transmission method, apparatus, equipment and storage medium
CN111435380A (en) * 2019-01-14 2020-07-21 顺丰科技有限公司 Page cross-domain interaction method, system, device and storage device
CN112261111A (en) * 2020-10-16 2021-01-22 蜂助手股份有限公司 Method and system for realizing cross-domain access of browser in application program

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102402580A (en) * 2010-09-30 2012-04-04 微软公司 Securely rendering online ads in a host page
CN102184220A (en) * 2011-05-06 2011-09-14 中兴通讯股份有限公司 Cross-domain page display control method and device
CN103095762A (en) * 2011-11-02 2013-05-08 腾讯科技(深圳)有限公司 Web page cross-domain communication method and device
CN103246667A (en) * 2012-02-08 2013-08-14 腾讯科技(深圳)有限公司 Method and device for cross-domain transfer of data
CN104423910A (en) * 2013-08-27 2015-03-18 腾讯科技(深圳)有限公司 Cross-domain page display method, device and terminal equipment
CN104965690A (en) * 2014-04-18 2015-10-07 腾讯科技(深圳)有限公司 Method and apparatus for processing data
CN104301379A (en) * 2014-08-28 2015-01-21 北京奇虎科技有限公司 Web page cross-domain communication method and device
CN110300133A (en) * 2018-03-22 2019-10-01 财付通支付科技有限公司 Cross-domain data transmission method, apparatus, equipment and storage medium
CN111435380A (en) * 2019-01-14 2020-07-21 顺丰科技有限公司 Page cross-domain interaction method, system, device and storage device
CN112261111A (en) * 2020-10-16 2021-01-22 蜂助手股份有限公司 Method and system for realizing cross-domain access of browser in application program

Also Published As

Publication number Publication date
CN112818270A (en) 2021-05-18

Similar Documents

Publication Publication Date Title
US11928551B2 (en) Computer configured to display multimedia content
CN111756674B (en) Network communication method, system, device and computer readable storage medium
US20160269433A1 (en) Method and system for checking security of url for mobile terminal
CN109462601B (en) Multi-platform access method and device based on eSIM
CN103942225A (en) Method and system for invoking resources of Hybrid App client and client
US8495617B2 (en) Interworking system between user terminal and smart card for executing widget, and method thereof
CN110730208A (en) Local device calling method and device, storage medium and device
CN112818270B (en) Data cross-domain transfer method and device and computer equipment
CN104584011A (en) Methods and systems for secure in-network insertion of WEB content and WEB services
CN108255701B (en) Scene testing method and mobile terminal
CN107798064B (en) Page processing method, electronic device and computer readable storage medium
CN107274222B (en) Advertisement putting method and device
US8972968B1 (en) Alternate service for applications
US20190333040A1 (en) Method of accessing payment terminal, terminal and non-volatile readable storage medium
CN112416458A (en) Preloading method and device based on ReactNative, computer equipment and storage medium
CN112422450B (en) Computer equipment, and flow control method and device for service request
US9755844B2 (en) Techniques to transform network resource requests to zero rated network requests
CN107979577B (en) Terminal authentication method and device
CN112468550A (en) File downloading method and device and electronic equipment
WO2015003570A1 (en) Data downloading method,device and system thereof
CN110633432A (en) Method, device, terminal equipment and medium for acquiring data
CN116304403A (en) Webpage access method and device, computer equipment and storage medium
CN111756916A (en) Application processing method and device, electronic equipment and computer storage medium
CN112672187B (en) Page generation method and device, computer equipment and readable storage medium
US20240031166A1 (en) Web-side data signature method and apparatus and computer device

Legal Events

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