CN105045887B - The system and method for mixed mode cross-domain data interaction - Google Patents
The system and method for mixed mode cross-domain data interaction Download PDFInfo
- Publication number
- CN105045887B CN105045887B CN201510443616.0A CN201510443616A CN105045887B CN 105045887 B CN105045887 B CN 105045887B CN 201510443616 A CN201510443616 A CN 201510443616A CN 105045887 B CN105045887 B CN 105045887B
- Authority
- CN
- China
- Prior art keywords
- domain data
- browser
- cross
- webpage
- data interaction
- 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.)
- Expired - Fee Related
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/90—Details of database functions independent of the retrieved data types
- G06F16/95—Retrieval from the web
- G06F16/958—Organisation or management of web site content, e.g. publishing, maintaining pages or automatic linking
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/02—Protocols based on web technology, e.g. hypertext transfer protocol [HTTP]
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/50—Network services
- H04L67/56—Provisioning of proxy services
- H04L67/568—Storing data temporarily at an intermediate stage, e.g. caching
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Databases & Information Systems (AREA)
- Theoretical Computer Science (AREA)
- Data Mining & Analysis (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Information Transfer Between Computers (AREA)
Abstract
本发明涉及混合模式跨域数据交互的系统及方法,包含Web服务器、网页自动适配模块、本地缓存管理器、浏览器容器和跨域数据交互代理模块;Web服务器将网页资源进行整理,压缩打包,本地缓存管理器将打包文件下载,解压缩,形成本地资源结构;网页自动适配模块判断当前工作状态,如为在线工作状态,采用Ajax方式与Web服务器交互,如为本地缓存工作状态,采用跨域数据交互代理模块进行数据通讯;浏览器容器接口获取网页自动适配模块提交的数据,根据数据交互类型,模拟浏览器向Web服务器发起数据读写请求,将Web服务器返回的数据通过回调返回给调用网页。解决了同源策略限制,实现客户端本地网页资源跨域与服务端数据交互。
The present invention relates to a system and method for cross-domain data interaction in a mixed mode, including a Web server, a web page automatic adaptation module, a local cache manager, a browser container, and a cross-domain data interaction proxy module; the Web server organizes web page resources, compresses and packages them , the local cache manager downloads and decompresses the packaged files to form a local resource structure; the webpage automatic adaptation module judges the current working status, if it is an online working status, it uses Ajax to interact with the Web server, if it is a local cache working status, it uses The cross-domain data interaction agent module performs data communication; the browser container interface obtains the data submitted by the webpage automatic adaptation module, and according to the data interaction type, simulates the browser to initiate a data read and write request to the web server, and returns the data returned by the web server through a callback to call the web page. It solves the limitation of the same-origin policy, and realizes the data interaction between the client's local webpage resources and the server's data across domains.
Description
技术领域technical field
本发明涉及一种混合模式跨域数据交互的系统及其方法。The invention relates to a mixed-mode cross-domain data interaction system and method thereof.
背景技术Background technique
移动互联网高速发展,由苹果开发的iOS系统和谷歌开发的Android系统占据了移动终端的大部分操作系统。两种移动操作系统都提供SDK(软件开发工具包,SoftwareDevelopment Kit),软件公司都可以基于系统的SDK进行应用开发。With the rapid development of the mobile Internet, the iOS system developed by Apple and the Android system developed by Google occupy most of the operating systems of mobile terminals. Both mobile operating systems provide an SDK (Software Development Kit, Software Development Kit), and software companies can develop applications based on the system's SDK.
应用开发出现三种模式:第一种,全部基于SDK的本地化(Native)开发;第二种,基于HTML技术的开发的手机Web网页;第三种,结合本地化开发和HTML Web开发的混合(Hybrid)模式,混合模式通过使用成熟的HTML Web开发技术,可以提高应用开发效率,通过使用浏览器容器,进行界面展现和交互。There are three modes of application development: the first, all SDK-based localization (Native) development; the second, mobile web pages developed based on HTML technology; the third, a combination of localization development and HTML Web development (Hybrid) mode, the hybrid mode can improve the efficiency of application development by using mature HTML Web development technology, and use the browser container to display and interact with the interface.
移动应用混合模式实现过程是:将网页内容打包下载到移动设备(包括手机、平板电脑、手持设备等),在移动设备上通过移动浏览器容器运行和渲染展示网页内容,并进行人机交互。这种方式一般的实现方法带来的问题是,因为浏览器同源策略限制,数据无法直接提交到服务器。所谓同源策略是由Netscape提出的一个著名的安全策略,同源策略是客户端脚本(指的是JavaScript)的重要的安全度量标准。最早出自Netscape Navigator2.0,其目的是防止某个文档或脚本从多个不同源装载。现在所有支持JavaScript的浏览器都会使用这个策略。所谓同源是指域名、协议、端口相同。The implementation process of mobile application hybrid mode is: package and download webpage content to mobile devices (including mobile phones, tablet computers, handheld devices, etc.), run and render webpage content on mobile devices through mobile browser containers, and perform human-computer interaction. The problem caused by this general implementation method is that due to the restriction of the same-origin policy of the browser, the data cannot be directly submitted to the server. The so-called same-origin policy is a well-known security policy proposed by Netscape, and the same-origin policy is an important security metric for client-side scripts (referring to JavaScript). Originally from Netscape Navigator2.0, its purpose is to prevent a document or script from being loaded from multiple different sources. All browsers that support JavaScript now use this strategy. The so-called same origin refers to the same domain name, protocol, and port.
发明内容Contents of the invention
本发明的目的是克服现有技术存在的不足,提供一种混合模式跨域数据交互的系统及其方法,旨在解决“同源策略”限制,实现跨域的客户端和服务端数据交互。The purpose of the present invention is to overcome the deficiencies in the prior art, and provide a mixed-mode cross-domain data interaction system and method thereof, aiming to solve the limitation of "same origin policy" and realize cross-domain client and server data interaction.
本发明的目的通过以下技术方案来实现:The purpose of the present invention is achieved through the following technical solutions:
混合模式跨域数据交互的系统,特点是:包含Web服务器、网页自动适配模块、本地缓存管理器、浏览器容器和跨域数据交互代理模块,所述Web服务器,为浏览器或客户端提供网络服务,采用HTTP方式提供HTML网页输出,并响应网页交互请求;The mixed-mode cross-domain data interaction system is characterized by: including a Web server, a web page automatic adaptation module, a local cache manager, a browser container, and a cross-domain data interaction proxy module. The Web server provides browsers or clients with Web service, using HTTP to provide HTML web page output and respond to web page interaction requests;
所述网页自动适配模块,包含有自动判断网页运行状态的代码模块,以JavaScript程序的方式在HTML网页内运行,含有JavaScript程序的HTML网页文件从Web服务器通过网络传送至客户端;The webpage automatic adaptation module includes a code module for automatically judging the running state of the webpage, and runs in the HTML webpage in the form of a JavaScript program, and the HTML webpage file containing the JavaScript program is transmitted from the Web server to the client through the network;
所述本地缓存管理器,创建和管理本地缓存,对应用程序的缓存内容管理,下载Web服务器上的网页资源文件压缩包,解压缩,建立本地资源结构,形成本地缓存环境,定期更新本地缓存内容;The local cache manager creates and manages the local cache, manages the cache content of the application program, downloads the web page resource file compression package on the Web server, decompresses it, establishes the local resource structure, forms a local cache environment, and regularly updates the local cache content ;
所述浏览器容器,嵌入于应用程序的浏览器,作为网页运行的容器;浏览器容器截获浏览器内的指定交互动作,并在本地代码中做出操作响应;The browser container is embedded in the browser of the application program as a container running on the webpage; the browser container intercepts the specified interactive action in the browser, and makes an operation response in the local code;
所述跨域数据交互代理模块,运行于浏览器容器底层的应用程序代码,将截获的浏览器容器内运行的HTML网页的数据交互,通过跨域数据交互代理模块向Web服务器提交,然后获取Web服务器的数据响应,通过跨域数据交互代理模块避免浏览器同源策略的限制,使下载到本地的网页代码可进行数据交互。The cross-domain data interaction proxy module runs on the application program code at the bottom of the browser container, interacts the data of the HTML webpage running in the browser container that is intercepted, submits it to the Web server through the cross-domain data interaction proxy module, and then obtains the Web The server's data response, through the cross-domain data interaction proxy module, avoids the restrictions of the browser's same-origin policy, so that the downloaded webpage code can perform data interaction.
进一步地,上述的混合模式跨域数据交互的系统,其中,所述Web服务器为微软IIS服务器或者Apache HTTP Server网页服务器。Further, in the above mixed-mode cross-domain data interaction system, wherein the web server is a Microsoft IIS server or an Apache HTTP Server web server.
更进一步地,上述的混合模式跨域数据交互的系统,其中,所述网页自动适配模块为网页含有自动判断网页运行状态的代码模块。Furthermore, in the above mixed-mode cross-domain data interaction system, the web page automatic adaptation module is a code module that automatically determines the running state of the web page.
更进一步地,上述的混合模式跨域数据交互的系统,其中,所述浏览器容器是在应用程序内置的浏览器控件;浏览器控件是操作系统的功能组件,功能组件具有HTML网页浏览的功能。Furthermore, in the above mixed-mode cross-domain data interaction system, wherein, the browser container is a browser control built into the application program; the browser control is a functional component of the operating system, and the functional component has the function of browsing HTML web pages .
更进一步地,上述的混合模式跨域数据交互的系统,其中,所述浏览器是在移动设备或计算机上显示网页服务器或文件系统的HTML文件并提供用户与文件交互的软件。Furthermore, in the above mixed-mode cross-domain data interaction system, the browser is software that displays HTML files of the web server or file system on the mobile device or computer and provides users with interaction with the files.
更进一步地,上述的混合模式跨域数据交互的系统,其中,所述网页自动适配模块检测网页运行状态,判断是否为在线工作状态或本地缓存工作状态。Furthermore, in the above mixed-mode cross-domain data interaction system, wherein the automatic web page adaptation module detects the running state of the web page, and determines whether it is an online working state or a local cache working state.
本发明混合模式跨域数据交互的方法,包括以下步骤:The mixed-mode cross-domain data interaction method of the present invention includes the following steps:
首先,Web服务器将网页资源进行整理,压缩打包,本地缓存管理器将打包文件下载,解压缩,形成本地资源结构;First, the web server organizes, compresses and packages the web page resources, and the local cache manager downloads and decompresses the packaged files to form a local resource structure;
然后,网页内代码使用document.url参数,网页自动适配模块判断当前工作状态,当前工作状态有两种,一种是协议为http://的在线工作状态,另一种为file://的本地缓存工作状态,如果为在线工作状态,则采用Ajax方式与Web服务器进行交互,如果为本地缓存工作状态,则采用跨域数据交互代理模块进行数据通讯;Then, the code in the webpage uses the document.url parameter, and the webpage automatic adaptation module judges the current working status. There are two current working statuses, one is the online working status with the protocol http://, and the other is the file:// The local cache working status, if it is online working status, use Ajax method to interact with the web server, if it is local cache working status, use cross-domain data interaction proxy module for data communication;
继而,使用移动操作系统的浏览器容器接口,获取网页自动适配模块提交的数据,根据数据的交互类型即Get类或Post类,跨域数据交互代理模块模拟浏览器向Web服务器发起数据读写请求,并将Web服务器返回的数据通过回调返回给调用网页。Then, use the browser container interface of the mobile operating system to obtain the data submitted by the webpage automatic adaptation module, and according to the interaction type of the data, that is, the Get class or the Post class, the cross-domain data interaction proxy module simulates the browser to initiate data reading and writing to the Web server Request, and return the data returned by the web server to the calling web page through the callback.
再进一步地,上述的混合模式跨域数据交互的方法,其中,所述本地缓存管理器进行目录清理,根据Web服务端的指令清空本地资源,重新下载更新。所述跨域数据交互代理模块实现跨域数据交互,排除同源策略的限制。Still further, in the above mixed-mode cross-domain data interaction method, the local cache manager cleans up the directory, clears the local resources according to the instructions of the web server, and re-downloads and updates. The cross-domain data interaction proxy module realizes cross-domain data interaction, eliminating the restriction of the same-origin policy.
本发明技术方案突出的实质性特点和显著的进步主要体现在:The outstanding substantive features and remarkable progress of the technical solution of the present invention are mainly reflected in:
①本发明解决了同源策略限制,实现跨域的客户端和服务端数据交互;网页自动适配模块自动判断网页是在线工作状态还是本地缓存工作状态,与通用浏览器的判断方式不同点在于,本地缓存是自主控制,不是系统浏览器默认控制;①The present invention solves the limitation of same-origin policy and realizes cross-domain client and server data interaction; the webpage automatic adaptation module automatically judges whether the webpage is in the online working state or the local cache working state, which is different from the judgment method of general browsers in that , the local cache is controlled independently, not the default control of the system browser;
②跨域数据交互代理模块解决了移动应用混合开发下载的网页和服务端数据交互的“同源策略限制”,结合网页自动适配模块实现自动判断运行环境,自动选择数据交互方式;②The cross-domain data interaction agent module solves the "same-origin policy restriction" of the data interaction between the webpage downloaded by the mobile application hybrid development and the server, and combines with the webpage automatic adaptation module to automatically judge the operating environment and automatically select the data interaction mode;
③本地缓存管理器通过将网站网页打包下载的方式,在移动设备端建立网页运行环境,在操作系统提供的浏览器容器内实现界面展现和交互;③The local cache manager builds a webpage operating environment on the mobile device side by packaging and downloading the webpages of the website, and realizes interface display and interaction in the browser container provided by the operating system;
④解决了移动应用开发,混合模式状态下,移动端App和服务器端交互的跨域问题;普通网页添加采用“自适应网页结构”,即可实现网页下载后在浏览器容器内与服务端数据交互。④Solve the cross-domain problem of mobile app development and the interaction between the mobile app and the server in the mixed mode state; the addition of ordinary web pages adopts the "adaptive web page structure", which can realize the connection between the browser container and the server data after the web page is downloaded interact.
附图说明Description of drawings
下面结合附图对本发明技术方案作进一步说明:Below in conjunction with accompanying drawing, technical solution of the present invention will be further described:
图1:本发明的系统架构示意图;Figure 1: a schematic diagram of the system architecture of the present invention;
图2:本发明的流程示意图。Figure 2: Schematic flow chart of the present invention.
具体实施方式Detailed ways
如图1所示,混合模式跨域数据交互的系统,包含Web服务器1、网页自动适配模块2、本地缓存管理器3、浏览器容器4和跨域数据交互代理模块5;As shown in Figure 1, the mixed-mode cross-domain data interaction system includes a Web server 1, a webpage automatic adaptation module 2, a local cache manager 3, a browser container 4 and a cross-domain data interaction proxy module 5;
Web服务器1,为浏览器或客户端提供网络服务,采用HTTP方式提供HTML网页输出,并响应网页交互请求;其中,Web服务器1为微软IIS服务器或者Apache HTTP Server网页服务器;浏览器是在手机或电脑上显示网页服务器或文件系统的HTML文件并提供用户与文件交互的软件,比如:IE、Safari、Chrome等;客户端是在手机或电脑上运行、完成一种或一组功能的应用软件。Web server 1 provides web services for browsers or clients, uses HTTP to provide HTML web page output, and responds to web page interaction requests; wherein, Web server 1 is a Microsoft IIS server or Apache HTTP Server web server; the browser is on a mobile phone or The computer displays the HTML files of the web server or the file system and provides software for users to interact with the files, such as: IE, Safari, Chrome, etc.; the client is the application software that runs on the mobile phone or computer and completes one or a group of functions.
网页自动适配模块2,包含有自动判断网页运行状态的代码模块,以JavaScript程序的方式在HTML网页内运行,含有JavaScript程序的HTML网页文件从Web服务器1通过网络传送至客户端;其中,网页自动适配模块2为网页含有自动判断网页运行状态的代码模块;网页自动适配模块2检测网页运行状态,判断是否为在线工作状态或本地缓存工作状态。The web page automatic adaptation module 2 includes a code module for automatically judging the running state of the web page, and runs in the HTML web page in the form of a JavaScript program, and the HTML web page file containing the JavaScript program is transmitted from the Web server 1 to the client through the network; wherein, the web page The automatic adaptation module 2 is a code module for the webpage to automatically determine the running state of the webpage; the automatic webpage adaptation module 2 detects the running state of the webpage, and judges whether it is an online working state or a local cache working state.
本地缓存管理器3,创建和管理本地缓存,对应用程序的缓存内容管理,下载Web服务器1上的网页资源文件压缩包,解压缩,建立目录结构,形成本地缓存环境,定期更新本地缓存内容;本地缓存管理器3进行目录清理,根据Web服务端1的指令清空本地资源,重新下载更新The local cache manager 3, creates and manages the local cache, manages the cache content of the application program, downloads the web page resource file compression package on the Web server 1, decompresses it, establishes a directory structure, forms a local cache environment, and regularly updates the local cache content; The local cache manager 3 cleans up the directory, clears the local resources according to the instructions of the web server 1, and re-downloads the update
浏览器容器4,嵌入于应用程序的浏览器,作为网页运行的容器;浏览器容器4截获浏览器内的指定交互动作,并在本地代码中做出操作响应;其中,浏览器容器4是在应用程序内置的浏览器控件,浏览器控件是操作系统的功能组件,功能组件具有HTML网页浏览的功能。Browser container 4, a browser embedded in an application program, is a container running as a web page; browser container 4 intercepts specified interactive actions in the browser, and makes an operation response in the local code; wherein, browser container 4 is in The built-in browser control of the application program is a functional component of the operating system, and the functional component has a function of browsing HTML webpages.
跨域数据交互代理模块5,运行于浏览器容器底层的应用程序代码,将截获的浏览器容器4内运行的HTML网页的数据交互,通过跨域数据交互代理模块5向Web服务器1提交,然后获取Web服务器1的数据响应,通过跨域数据交互代理模块5避免浏览器同源策略的限制,使下载到本地的网页代码可进行数据交互。跨域数据交互代理模块5实现跨域数据交互,排除同源策略的限制。The cross-domain data interaction proxy module 5, running on the application program code at the bottom of the browser container, interacts the data of the HTML webpage running in the browser container 4 that is intercepted, and submits it to the Web server 1 through the cross-domain data interaction proxy module 5, and then Obtain the data response from the Web server 1, and avoid the restriction of the same-origin policy of the browser through the cross-domain data interaction proxy module 5, so that the code downloaded to the local webpage can perform data interaction. The cross-domain data interaction proxy module 5 realizes cross-domain data interaction and eliminates the restriction of the same-origin policy.
浏览器可以显示网页服务器或者文件系统的HTML文件(标准通用标记语言的一个应用)内容,并让用户与这些文件交互。浏览器用来显示在万维网或局域网等内的文字、图像及其他信息。这些文字或图像信息,可以是连接其他网址的超链接,用户可迅速及轻易地浏览各种信息。大部分网页为HTML格式。移动设备和计算机上常见的网页浏览器有:QQ浏览器、Internet Explorer、Safari、Opera、Google Chrome、360浏览器、UC浏览器等,浏览器是最经常使用到的客户端程序。A browser can display the content of HTML documents (an application of the standard Universal Markup Language) on a web server or file system and allow users to interact with these documents. A browser is used to display text, images, and other information on the World Wide Web or a local area network, etc. These text or image information can be hyperlinks to other websites, and users can quickly and easily browse various information. Most web pages are in HTML format. Common web browsers on mobile devices and computers include: QQ browser, Internet Explorer, Safari, Opera, Google Chrome, 360 browser, UC browser, etc. The browser is the most frequently used client program.
客户端(Client)或称为用户端,与服务器相对应,为客户提供本地服务的程序。除了一些只在本地运行的应用程序之外,一般安装在普通的客户机上,需要与服务端互相配合运行。因特网发展以后,较常用的用户端包括如万维网使用的网页浏览器、收寄电子邮件时的电子邮件客户端、以及即时通讯的客户端软件等。对于这一类应用程序,需要网络中有相应的服务器和服务程序来提供相应的服务,如数据库服务、电子邮件服务等等,这样在客户机和服务器端,需要建立特定的通信连接,来保证应用程序的正常运行。Client (Client), or called client, corresponds to the server and is a program that provides local services for clients. Except for some applications that only run locally, they are generally installed on ordinary client computers and need to cooperate with the server to run. After the development of the Internet, more commonly used client terminals include web browsers used on the World Wide Web, e-mail clients when receiving and sending e-mails, and client software for instant messaging. For this type of application, it is necessary to have corresponding servers and service programs in the network to provide corresponding services, such as database services, e-mail services, etc., so that a specific communication connection needs to be established between the client and server to ensure normal operation of the application.
本发明在移动设备软件内封装本地的浏览器容器,在浏览器容器底层实现跨域数据交互代理,网页数据交互通过跨域数据交互代理和服务端进行数据交互,网页实现自动判断网页是“在线运行”还是“本地缓存运行”,如果是“在线运行”就使用普通的网页交互方式,如果是“本地缓存运行”就使用“数据交互代理”与服务端进行交互,并通过回调将服务器端返回结果返回给网页。如图2所示,具体步骤为:The present invention encapsulates the local browser container in the mobile device software, realizes the cross-domain data interaction agent at the bottom layer of the browser container, and performs data interaction through the cross-domain data interaction agent and the server for webpage data interaction, and the webpage realizes automatic judgment that the webpage is "online" Running" or "running in local cache", if it is "running online", use the ordinary web page interaction method, if it is "running in local cache", use "data interaction agent" to interact with the server, and return the server through the callback The results are returned to the web page. As shown in Figure 2, the specific steps are:
首先,Web服务器1将网页资源进行整理,压缩打包,本地缓存管理器3将打包文件下载,解压缩,形成本地资源结构;First, the web server 1 arranges the web page resources, compresses and packages them, and the local cache manager 3 downloads and decompresses the packaged files to form a local resource structure;
然后,网页内代码使用document.url参数,网页自动适配模块2判断当前工作状态,当前工作状态有两种,一种是协议为http://的在线工作状态,另一种为file://的本地缓存工作状态,如果为在线工作状态,则采用Ajax方式与Web服务器1进行交互,如果为本地缓存工作状态,则采用跨域数据交互代理模块5进行数据通讯;所谓AJAX是指“Asynchronous JavaScript And XML”(异步JavaScript和XML),是一种创建交互式网页应用的网页开发技术,通过在后台与服务器进行少量数据交换,AJAX可以使网页实现异步更新。可以在不重新加载整个网页的情况下,对网页的某部分进行更新。Then, the code in the webpage uses the document.url parameter, and the webpage automatic adaptation module 2 judges the current working status. There are two current working statuses, one is the online working status with the protocol http://, and the other is the file:/ /'s local cache working status, if it is an online working status, then use the Ajax method to interact with the Web server 1, if it is a local cache working status, then use the cross-domain data interaction proxy module 5 for data communication; the so-called AJAX refers to "Asynchronous JavaScript And XML" (asynchronous JavaScript and XML) is a web development technology for creating interactive web applications. By exchanging a small amount of data with the server in the background, AJAX can make web pages update asynchronously. Parts of a web page can be updated without reloading the entire web page.
继而,使用移动操作系统的浏览器容器4接口,获取网页自动适配模块2提交的数据,根据数据的交互类型即Get类或Post类,跨域数据交互代理模块5模拟浏览器向Web服务器1发起数据读写请求,并将Web服务器1返回的数据通过回调返回给调用网页。Then, use the browser container 4 interface of the mobile operating system to obtain the data submitted by the webpage automatic adaptation module 2, and according to the interaction type of the data, that is, the Get class or the Post class, the cross-domain data interaction proxy module 5 simulates the browser to send data to the Web server 1. Initiate a data read and write request, and return the data returned by Web server 1 to the calling web page through a callback.
综上所述,网页自动适配模块(自适应的网页结构)自动判断网页是“在线工作状态”还是“本地缓存工作状态”,与通用浏览器的判断方式不同点在于,本地缓存是自主控制,不是系统浏览器默认控制。To sum up, the web page automatic adaptation module (adaptive web page structure) automatically judges whether the web page is "online working status" or "local cache working status". , not the system browser default control.
跨域数据交互代理模块解决了移动应用混合开发下载的网页和服务端数据交互的“同源策略限制”,结合网页自动适配模块实现自动判断运行环境,自动选择数据交互方式。The cross-domain data interaction proxy module solves the "same-origin policy restriction" of the data interaction between the webpage downloaded by the mobile application hybrid development and the server. Combined with the webpage automatic adaptation module, it realizes automatic judgment of the operating environment and automatic selection of the data interaction method.
本地缓存管理器,通过将网站网页打包下载的方式,在移动设备端建立网页运行环境,在操作系统提供的浏览器容器内实现界面展现和交互。The local cache manager establishes a webpage operating environment on the mobile device side by packaging and downloading website webpages, and realizes interface display and interaction in the browser container provided by the operating system.
本发明解决了移动应用开发,混合模式状态下,移动端App和服务器端交互的跨域问题。普通网页添加采用“自适应网页结构”,即可实现网页下载后在浏览器容器内与服务端数据交互。The invention solves the cross-domain problem of mobile application development and interaction between mobile terminal App and server terminal under mixed mode state. The addition of ordinary web pages adopts the "adaptive web page structure", which can realize the data interaction with the server in the browser container after the web page is downloaded.
需要理解到的是:以上所述仅是本发明的优选实施方式,对于本技术领域的普通技术人员来说,在不脱离本发明原理的前提下,还可以作出若干改进和润饰,这些改进和润饰也应视为本发明的保护范围。It should be understood that: the above is only a preferred embodiment of the present invention, for those of ordinary skill in the art, without departing from the principle of the present invention, some improvements and modifications can also be made, these improvements and Retouching should also be regarded as the protection scope of the present invention.
Claims (10)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201510443616.0A CN105045887B (en) | 2015-07-24 | 2015-07-24 | The system and method for mixed mode cross-domain data interaction |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201510443616.0A CN105045887B (en) | 2015-07-24 | 2015-07-24 | The system and method for mixed mode cross-domain data interaction |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| CN105045887A CN105045887A (en) | 2015-11-11 |
| CN105045887B true CN105045887B (en) | 2018-06-22 |
Family
ID=54452434
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN201510443616.0A Expired - Fee Related CN105045887B (en) | 2015-07-24 | 2015-07-24 | The system and method for mixed mode cross-domain data interaction |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN105045887B (en) |
Families Citing this family (16)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN106095598B (en) * | 2016-05-31 | 2021-04-06 | 腾讯科技(深圳)有限公司 | Data processing method and client |
| CN106254420B (en) * | 2016-07-18 | 2019-10-22 | 中国农业银行股份有限公司 | A kind of cross-domain communication method and device |
| CN107070870B (en) * | 2017-01-09 | 2020-04-14 | 阿里巴巴集团控股有限公司 | Data acquisition method and device |
| CN108667863B (en) * | 2017-03-29 | 2020-04-14 | 中国科学院声学研究所 | A kind of WEB business adaptation system and method based on local agent |
| CN107315784B (en) * | 2017-06-07 | 2020-01-31 | 北京奇艺世纪科技有限公司 | data access method and browser |
| CN109391649A (en) * | 2017-08-04 | 2019-02-26 | 阿里巴巴集团控股有限公司 | The methods, devices and systems of page load |
| CN107547557A (en) * | 2017-09-14 | 2018-01-05 | 广州帕克西软件开发有限公司 | A kind of interactive system and method for drawing cross-domain image |
| CN108170745B (en) * | 2017-12-20 | 2020-09-25 | 福建网龙计算机网络信息技术有限公司 | Method and terminal for accessing cache data of web terminal |
| CN110247939A (en) * | 2018-03-08 | 2019-09-17 | 上海秦苍信息科技有限公司 | The high-performance combination frame realized using multi-level buffer technology |
| CN108769189B (en) * | 2018-05-28 | 2020-01-03 | 上海恺英网络科技有限公司 | Cross-network-domain resource access method and device |
| CN109150984B (en) * | 2018-07-27 | 2021-11-02 | 平安科技(深圳)有限公司 | Method and device for acquiring data resources |
| CN110069299A (en) * | 2019-03-12 | 2019-07-30 | 深圳壹账通智能科技有限公司 | Realize method, server and the storage medium of the operation control of APP program |
| CN110691136B (en) * | 2019-09-29 | 2022-01-21 | 广州华多网络科技有限公司 | Data interaction method and device, electronic equipment and storage medium |
| CN111327690B (en) * | 2020-01-23 | 2022-10-21 | 湖南快乐阳光互动娱乐传媒有限公司 | Cross-domain file downloading method and device |
| CN111556170A (en) * | 2020-05-25 | 2020-08-18 | 郑州大学 | Method for realizing rapid transmission of B3dm model network |
| CN114090933B (en) * | 2021-11-16 | 2024-05-10 | 浪潮卓数大数据产业发展有限公司 | Cross-domain information interaction method, device and medium |
Citations (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN102984179A (en) * | 2011-09-02 | 2013-03-20 | 广东电子工业研究院有限公司 | A Method for Cross-Domain Access of Web Services for Cloud Computing Operating System |
| CN104301379A (en) * | 2014-08-28 | 2015-01-21 | 北京奇虎科技有限公司 | A webpage cross-domain communication method and device |
-
2015
- 2015-07-24 CN CN201510443616.0A patent/CN105045887B/en not_active Expired - Fee Related
Patent Citations (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN102984179A (en) * | 2011-09-02 | 2013-03-20 | 广东电子工业研究院有限公司 | A Method for Cross-Domain Access of Web Services for Cloud Computing Operating System |
| CN104301379A (en) * | 2014-08-28 | 2015-01-21 | 北京奇虎科技有限公司 | A webpage cross-domain communication method and device |
Also Published As
| Publication number | Publication date |
|---|---|
| CN105045887A (en) | 2015-11-11 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN105045887B (en) | The system and method for mixed mode cross-domain data interaction | |
| US10015226B2 (en) | Methods for making AJAX web applications bookmarkable and crawlable and devices thereof | |
| CN104102537B (en) | A kind of application call method and user terminal | |
| US8190703B2 (en) | Extensible browser platform for web applications | |
| US11720699B2 (en) | Inline file download controls in remote browser isolation system | |
| CN103970760B (en) | A kind of web-page requests processing method and processing device | |
| US9143378B2 (en) | Rendering components within different browser environments | |
| CN102065108A (en) | Method, wireless communication terminal and client browser for realizing pre-download | |
| US20140245124A1 (en) | System and method thereof for browser agnostic extension models | |
| CN112468611B (en) | Application program starting method, terminal device and computer storage medium | |
| CN112764746B (en) | Data processing method, device, electronic equipment and storage medium | |
| CN106933623B (en) | Operation method, device and system of installation-free application | |
| CN105677688B (en) | Page data loading method and system | |
| CN103905477A (en) | HTTP request processing method and server | |
| CN110347945A (en) | The method and apparatus for obtaining the data of the page | |
| CN102629943A (en) | Mobile broadband device and method for processing mobile broadband business thereof | |
| CN108319420A (en) | A kind of picture loading method and device | |
| CN103347038A (en) | Method of WEB server for processing http messages | |
| CN114500484A (en) | Page rendering method, apparatus, electronic device and readable medium | |
| Singh et al. | Enhancing Interaction between Smartphones and Web services on Cloud for improved Bandwidth and latency | |
| CN119342052B (en) | Network resource loading method, system, electronic equipment and storage medium | |
| CN110224973B (en) | Multi-server parallel implementation method based on programming game, electronic equipment and medium | |
| CN115391691A (en) | Page management method, device, electronic device and storage medium | |
| CN115914329A (en) | Information push method, device, electronic device and readable storage medium | |
| CN115714759A (en) | Method and device for updating plug-in page, electronic equipment and storage medium |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| C06 | Publication | ||
| PB01 | Publication | ||
| C10 | Entry into substantive examination | ||
| SE01 | Entry into force of request for substantive examination | ||
| GR01 | Patent grant | ||
| GR01 | Patent grant | ||
| CF01 | Termination of patent right due to non-payment of annual fee | ||
| CF01 | Termination of patent right due to non-payment of annual fee |
Granted publication date: 20180622 |