CN105516333B - A kind of web-based exchange method and system - Google Patents
A kind of web-based exchange method and system Download PDFInfo
- Publication number
- CN105516333B CN105516333B CN201510982487.2A CN201510982487A CN105516333B CN 105516333 B CN105516333 B CN 105516333B CN 201510982487 A CN201510982487 A CN 201510982487A CN 105516333 B CN105516333 B CN 105516333B
- Authority
- CN
- China
- Prior art keywords
- interface element
- webpage
- server
- module
- loading
- 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
Links
Classifications
-
- 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/75—Indicating network or usage conditions on the user display
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Information Transfer Between Computers (AREA)
Abstract
Description
技术领域technical field
本发明涉及通信技术领域,特别是涉及一种基于网页的交互方法和一种基于网页的交互系统。The invention relates to the field of communication technology, in particular to a webpage-based interactive method and a webpage-based interactive system.
背景技术Background technique
网络的迅猛发展将人们带入了信息社会和网络经济时代,对企业的发展和个人生活都产生了深刻的影响。The rapid development of the network has brought people into the era of information society and network economy, and has had a profound impact on the development of enterprises and personal life.
为了能高效处理网络海量的数据,在数据处理过程中产生了模块化,即是一种将复杂对象进行分解的一种规范,比如,将一个网页分解为多个小区块,这个行为就是模块化。In order to efficiently process massive amounts of data on the network, modularization is created in the data processing process, which is a specification for decomposing complex objects. For example, decomposing a web page into multiple small blocks, this behavior is modularization .
每个模块完成一个特定的子功能,所有的模块按某种方法组装起来,成为一个整体,完成整个系统所要求的功能。Each module completes a specific sub-function, and all modules are assembled in a certain way to form a whole to complete the functions required by the entire system.
模块具有一下几种基本属性:接口、功能、逻辑、状态,功能、状态与接口反映模块的外部特性,逻辑反映它的内部特性。A module has the following basic attributes: interface, function, logic, and state. Function, state, and interface reflect the external characteristics of the module, and logic reflects its internal characteristics.
但是,网站经常面向用户退出许多活动,增加与用户的互动,为了吸引用户,活动一般不会重新,因此,频繁的更新活动使得网页的模块需要频繁进行更新,工作量很大。However, the website often exits many activities for users to increase the interaction with users. In order to attract users, activities are generally not restarted. Therefore, frequent update activities make the modules of the webpage need to be updated frequently, and the workload is heavy.
发明内容Contents of the invention
鉴于上述问题,提出了本发明以便提供一种克服上述问题或者至少部分地解决上述问题的一种基于网页的交互方法和相应的一种基于网页的交互系统。In view of the above problems, the present invention is proposed to provide a webpage-based interaction method and a corresponding webpage-based interaction system that overcome the above-mentioned problems or at least partially solve the above-mentioned problems.
依据本发明的一个方面,提供了一种基于网页的交互方法,包括:According to one aspect of the present invention, a webpage-based interaction method is provided, including:
在客户端中采用网页文档加载网页;Loading a webpage with a webpage document in the client;
当从所述网页文档读取到界面元素标识时,向服务器请求所述界面元素标识对应的界面元素;When the interface element identifier is read from the webpage document, requesting the interface element corresponding to the interface element identifier from the server;
在所述网页中加载所述界面元素;loading the interface element in the webpage;
在所述界面元素上检测到操作事件时,按照所述操作事件生成一操作请求;When an operation event is detected on the interface element, an operation request is generated according to the operation event;
调用业务组件的接口,将所述操作请求发送至服务器的业务组件进行业务处理。The interface of the business component is called, and the operation request is sent to the business component of the server for business processing.
可选地,所述界面元素标识包括界面元素框架标识和界面元素内容标识;Optionally, the interface element identifier includes an interface element frame identifier and an interface element content identifier;
所述向服务器请求所述界面元素标识对应的界面元素的步骤包括:The step of requesting the server for the interface element corresponding to the interface element identifier includes:
向服务器请求所述界面元素框架标识对应的界面元素框架;Requesting the interface element frame corresponding to the interface element frame identifier from the server;
向服务器请求所述界面元素内容标识对应的界面元素内容。Requesting the interface element content corresponding to the interface element content identifier from the server.
可选地,所述在所述网页中加载所述界面元素的步骤包括:Optionally, the step of loading the interface element in the webpage includes:
在所述网页中的指定位置加载所述界面元素框架;loading the interface element frame at a specified location in the webpage;
在所述界面元素框架中加载所述界面元素内容。Load the interface element content in the interface element frame.
可选地,还包括:Optionally, also include:
在服务器中确定触发所述操作请求的网页;determining in the server the webpage that triggers the operation request;
查询所述网页对应的配置参数;Querying configuration parameters corresponding to the webpage;
调用所述接口对应的业务组件,按照所述配置参数进行业务处理。Call the business component corresponding to the interface, and perform business processing according to the configuration parameters.
可选地,还包括:Optionally, also include:
将业务处理的结果返回客户端。Return the result of business processing to the client.
可选地,还包括:Optionally, also include:
在客户端中查询业务处理的结果对应的加载方式;Query the loading method corresponding to the result of business processing in the client;
按照所述加载方式加载业务处理的结果。Load the result of business processing according to the loading method.
根据本发明的另一方面,提供了一种基于网页的交互系统,所述系统包括客户端,所述客户端包括:According to another aspect of the present invention, a webpage-based interactive system is provided, the system includes a client, and the client includes:
网页加载模块,适于采用网页文档加载网页;A webpage loading module, suitable for loading a webpage by using a webpage document;
界面元素请求模块,适于在从所述网页文档读取到界面元素标识时,向服务器请求所述界面元素标识对应的界面元素;The interface element request module is adapted to request the server for the interface element corresponding to the interface element identifier when the interface element identifier is read from the webpage document;
界面元素加载模块,适于在所述网页中加载所述界面元素;an interface element loading module, adapted to load the interface element in the webpage;
操作请求生成模块,适于在所述界面元素上检测到操作事件时,按照所述操作事件生成一操作请求;An operation request generation module, adapted to generate an operation request according to the operation event when an operation event is detected on the interface element;
接口调用模块,适于调用业务组件的接口,将所述操作请求发送至服务器的业务组件进行业务处理。The interface calling module is adapted to call the interface of the business component, and send the operation request to the business component of the server for business processing.
可选地,所述界面元素标识包括界面元素框架标识和界面元素内容标识;Optionally, the interface element identifier includes an interface element frame identifier and an interface element content identifier;
所述界面元素请求模块还适于:The interface element request module is also adapted to:
向服务器请求所述界面元素框架标识对应的界面元素框架;Requesting the interface element frame corresponding to the interface element frame identifier from the server;
向服务器请求所述界面元素内容标识对应的界面元素内容。Requesting the interface element content corresponding to the interface element content identifier from the server.
可选地,所述界面元素加载模块还适于:Optionally, the interface element loading module is also suitable for:
在所述网页中的指定位置加载所述界面元素框架;loading the interface element frame at a specified location in the webpage;
在所述界面元素框架中加载所述界面元素内容。Load the interface element content in the interface element frame.
可选地,所述系统还包括服务器,所述服务器包括:Optionally, the system also includes a server, and the server includes:
网页确定模块,适于确定触发所述操作请求的网页;A web page determining module, adapted to determine the web page that triggers the operation request;
配置参数查询模块,适于查询所述网页对应的配置参数;A configuration parameter query module, adapted to query configuration parameters corresponding to the webpage;
业务组件调用模块,适于调用所述接口对应的业务组件,按照所述配置参数进行业务处理。The business component calling module is adapted to call the business component corresponding to the interface, and perform business processing according to the configuration parameters.
可选地,所述服务器还包括:Optionally, the server also includes:
结果返回模块,适于将业务处理的结果返回客户端。The result returning module is suitable for returning the result of business processing to the client.
可选地,所述客户度还包括:Optionally, the customer degree also includes:
加载方式查询模块,适于在客户端中查询业务处理的结果对应的加载方式;The loading method query module is suitable for querying the loading method corresponding to the result of business processing in the client;
结果加载模块,适于按照所述加载方式加载业务处理的结果。The result loading module is adapted to load the result of business processing according to the loading method.
本发明实施例采用前后端分离的方式,将模块的形式和模块的功能分离开来,在前端进行界面元素的加载,通过业务组件的接口,将操作请求转移到后端进行业务处理,实现了模块的细颗粒度的复用,通过配置实现了模块,大大提高了更新模块的简便性,大大减少了更新模块的工作量。The embodiment of the present invention adopts the method of separating the front and back ends, separates the form of the module from the function of the module, loads the interface elements at the front end, and transfers the operation request to the back end for business processing through the interface of the business component, realizing The fine-grained multiplexing of modules realizes modules through configuration, which greatly improves the simplicity of updating modules and greatly reduces the workload of updating modules.
本发明实施例通过配置参数的方式,控制模块的功能实现,在保证了通信的安全性的同时,进一步提高了更新模块的简便性,减少了更新模块的工作量。In the embodiment of the present invention, the function of the control module is realized by configuring parameters, which further improves the simplicity of updating the module and reduces the workload of the updating module while ensuring the security of communication.
上述说明仅是本发明技术方案的概述,为了能够更清楚了解本发明的技术手段,而可依照说明书的内容予以实施,并且为了让本发明的上述和其它目的、特征和优点能够更明显易懂,以下特举本发明的具体实施方式。The above description is only an overview of the technical solution of the present invention. In order to better understand the technical means of the present invention, it can be implemented according to the contents of the description, and in order to make the above and other purposes, features and advantages of the present invention more obvious and understandable , the specific embodiments of the present invention are enumerated below.
附图说明Description of drawings
通过阅读下文优选实施方式的详细描述,各种其他的优点和益处对于本领域普通技术人员将变得清楚明了。附图仅用于示出优选实施方式的目的,而并不认为是对本发明的限制。而且在整个附图中,用相同的参考符号表示相同的部件。在附图中:Various other advantages and benefits will become apparent to those of ordinary skill in the art upon reading the following detailed description of the preferred embodiment. The drawings are only for the purpose of illustrating a preferred embodiment and are not to be considered as limiting the invention. Also throughout the drawings, the same reference numerals are used to designate the same parts. In the attached picture:
图1示出了根据本发明一个实施例的一种基于网页的交互方法实施例1的步骤流程图;FIG. 1 shows a flow chart of steps in Embodiment 1 of a webpage-based interaction method according to an embodiment of the present invention;
图2示出了根据本发明一个实施例的一种基于网页的交互方法实施例2的步骤流程图;以及FIG. 2 shows a flow chart of steps in Embodiment 2 of a webpage-based interaction method according to an embodiment of the present invention; and
图3示出了根据本发明一个实施例的一种基于网页的交互系统实施例的结构框图。Fig. 3 shows a structural block diagram of an embodiment of a webpage-based interactive system according to an embodiment of the present invention.
具体实施方式Detailed ways
下面将参照附图更详细地描述本公开的示例性实施例。虽然附图中显示了本公开的示例性实施例,然而应当理解,可以以各种形式实现本公开而不应被这里阐述的实施例所限制。相反,提供这些实施例是为了能够更透彻地理解本公开,并且能够将本公开的范围完整的传达给本领域的技术人员。Exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be embodied in various forms and should not be limited by the embodiments set forth herein. Rather, these embodiments are provided for more thorough understanding of the present disclosure and to fully convey the scope of the present disclosure to those skilled in the art.
参照图1,示出了根据本发明一个实施例的一种基于网页的交互方法实施例1的步骤流程图,具体可以包括如下步骤:Referring to FIG. 1 , it shows a flow chart of the steps of Embodiment 1 of a webpage-based interactive method according to an embodiment of the present invention, which may specifically include the following steps:
步骤101,在客户端中采用网页文档加载网页;Step 101, using a webpage document to load a webpage in the client;
在具体实现中,客户端可以向服务器发送页面的网页请求,以加载相应的网页。In a specific implementation, the client may send a web page request to the server to load the corresponding web page.
页面的加载请求可以是指客户端发出的加载某个页面的指示。The page loading request may refer to an instruction sent by the client to load a certain page.
例如,用户可以在浏览器中通过点击某链接请求加载一个网页,或者,启动游戏客户端、打开主页等等。For example, a user may request to load a web page by clicking a link in a browser, or start a game client, open a home page, and so on.
当用户点击某链接时,就相当于接收到了网页的加载请求;同样,启动时游戏客户端,也相当于接收到了加载网页的加载请求。When a user clicks on a link, it is equivalent to receiving a loading request for a web page; similarly, when the game client is started, it is equivalent to receiving a loading request for loading a web page.
其中,加载请求的内容可以包括用户请求加载的网页的标识和/或网页的特征。Wherein, the content of the loading request may include the identification of the webpage that the user requests to load and/or the characteristics of the webpage.
网页标识可以是能够代表一个唯一确定的网页的信息,例如统一资源标识符(Uniform Resource Identifier,URI),统一资源标识符又具体可以包括统一资源定位符(Uniform Resource Locator,URL),或者统一资源名称(Uniform Resource Name,URN)等等。The webpage identifier can be information that can represent a uniquely determined webpage, such as a Uniform Resource Identifier (Uniform Resource Identifier, URI), and the Uniform Resource Identifier can specifically include a Uniform Resource Locator (Uniform Resource Locator, URL), or a Uniform Resource Identifier. Name (Uniform Resource Name, URN) and so on.
客户端通过DNS(Domain Name System,域名解析系统)解析查找该网页URL中的域名(Domain Name)所映射的IP(Internet Protocol,网络之间互连的协议)地址。The client uses DNS (Domain Name System, Domain Name Resolution System) to resolve and find the IP (Internet Protocol, a protocol for interconnection between networks) address mapped to the domain name (Domain Name) in the URL of the webpage.
在获取IP地址成功之后,客户端可以向该IP地址所在的服务器请求连接。在成功连接该IP地址所在的服务器之后,客户端可以将请求头信息通过HTTP(Hypertexttransfer protocol,超文本传送协议)协议向此IP地址所在的服务器发起网页加载的请求。After successfully obtaining the IP address, the client can request a connection to the server where the IP address is located. After successfully connecting to the server with the IP address, the client can initiate a web page loading request to the server with the IP address through the HTTP (Hypertexttransfer protocol, Hypertext Transfer Protocol) protocol.
该服务器接收到该请求之后等待处理,最后向客户端返回响应。After receiving the request, the server waits for processing, and finally returns a response to the client.
此时,在HTTP协议下,客户端可以从服务器接收到HTML(Hypertext MarkupLanguage,超文本标记语言)类型的文档。At this time, under the HTTP protocol, the client may receive an HTML (Hypertext MarkupLanguage, Hypertext Markup Language) type document from the server.
客户端可以解析HTML文档,生成树状结构的对象,即DOM(Document ObjectModel,文件对象模型),每个对象是DOM上的一个结点,而这些对象可以代表文字、图片等网页资源。The client can parse HTML documents to generate tree-structured objects, that is, DOM (Document Object Model, Document Object Model). Each object is a node on the DOM, and these objects can represent web resources such as text and pictures.
客户端可以开始显示此HTML文档,并获取其中内嵌的页面资源的地址,然后客户端再向服务器发起请求来获取这些页面资源,并在客户端的HTML文档中显示。The client can start to display this HTML document and obtain the addresses of the embedded page resources, and then the client initiates a request to the server to obtain these page resources and display them in the client's HTML document.
步骤102,当从所述网页文档读取到界面元素标识时,向服务器请求所述界面元素标识对应的界面元素;Step 102, when the interface element identifier is read from the webpage document, request the server for the interface element corresponding to the interface element identifier;
在本发明实施例中,可以应用前后端分离的方式加载模块,即前端展示UI(UserInterface,用户界面)元素、后端进行业务处理。In the embodiment of the present invention, the module may be loaded in a manner of separating the front and back ends, that is, the front end displays UI (User Interface, user interface) elements, and the back end performs business processing.
在网页文档中,可以预先写入模块的界面元素标识,当读取到界面元素标识时,可以向服务器请求所述界面元素标识对应的界面元素。In the webpage document, the interface element identifier of the module can be written in advance, and when the interface element identifier is read, a request can be made to the server for the interface element corresponding to the interface element identifier.
其中,界面元素标识可以是能够代表一个唯一确定的界面元素的信息,例如,界面元素ID。Wherein, the interface element identifier may be information that can represent a uniquely determined interface element, for example, an interface element ID.
在一种请求方式中,界面元素为一个整体,则可以直接进行请求整个界面元素。In one request mode, the interface element is a whole, and the entire interface element can be directly requested.
在另一种请求方式中,界面元素为一个组合,即拆分为界面元素框架和界面元素内容。In another request method, the interface element is a combination, that is, split into interface element frame and interface element content.
具体而言,界面元素标识可以包括界面元素框架标识和界面元素内容标识。Specifically, the interface element identifier may include an interface element frame identifier and an interface element content identifier.
其中,界面元素框架标识可以是能够代表一个唯一确定的界面元素框架的信息,例如,界面元素框架ID。Wherein, the interface element frame identifier may be information that can represent a uniquely determined interface element frame, for example, an interface element frame ID.
界面元素内容标识可以是能够代表一个唯一确定的界面元素内容的信息,例如,界面元素内容ID。The interface element content identifier may be information that can represent a uniquely determined interface element content, for example, an interface element content ID.
因此,在加载时,可以向服务器请求界面元素框架标识对应的界面元素框架,及向服务器请求界面元素内容标识对应的界面元素内容。Therefore, during loading, the interface element frame corresponding to the interface element frame identifier may be requested from the server, and the interface element content corresponding to the interface element content identifier may be requested from the server.
以抽奖模块为例,可以在前端展示抽奖的界面,在后端部署抽奖的逻辑。Taking the lottery module as an example, the interface of the lottery can be displayed on the front end, and the logic of the lottery can be deployed on the back end.
其中,在前端展示时,可以以抽奖的样式,如转盘的形状(如方形、圆形等)、抽奖按钮等,作为界面元素框架,可以以抽奖的奖品,如奖品的图片,作为界面元素内容。Among them, when displaying on the front end, the style of the lottery can be used, such as the shape of the turntable (such as square, round, etc.), the lottery button, etc., as the frame of the interface element, and the prize of the lottery, such as the picture of the prize, can be used as the content of the interface element .
在实际应用时,可以基于Ajax(Asynchronous Javascript And XML,异步JavaScript和XML(标准通用标记语言的子集))向服务器请求界面元素。In actual application, interface elements can be requested to the server based on Ajax (Asynchronous Javascript And XML, asynchronous JavaScript and XML (subset of standard general markup language)).
Ajax就是对浏览器本身的特性(IE5.6浏览器为ActiveXObject,其他浏览器为XMLHttpRequest)做的封装,成为一个方法,目标是发送一个HTTP(Hypertext transferprotocol,超文本传送协议)请求,一般包含几个部分:Ajax is the encapsulation of the browser's own characteristics (IE5.6 browser is ActiveXObject, other browsers are XMLHttpRequest), and it becomes a method. The goal is to send an HTTP (Hypertext transfer protocol, hypertext transfer protocol) request, which generally includes several sections:
url:请求的URL(Uniform Resource Locator,统一资源定位符);url: Requested URL (Uniform Resource Locator, Uniform Resource Locator);
data:请求的参数,如JobID;data: request parameters, such as JobID;
timeout:超时时间,即距收到服务器响应的最大等待时间,超时则放弃该请求;timeout: the timeout time, that is, the maximum waiting time from receiving the server response, and the request will be abandoned if the timeout timeout;
success:成功收到响应数据的处理函数;success: The processing function that successfully receives the response data;
error:请求各种异常的处理函数。error: Request various exception handling functions.
步骤103,在所述网页中加载所述界面元素;Step 103, loading the interface elements in the webpage;
在一种加载方式中,界面元素为一个整体,则可以直接进行加载整个界面元素。In one loading method, the interface element is a whole, and the entire interface element can be directly loaded.
在另一种加载方式中,界面元素为一个组合,则可以在网页中的指定位置加载界面元素框架,在界面元素框架中加载界面元素内容,实现界面元素的整体加载。In another loading method, the interface element is a combination, then the interface element frame can be loaded at a specified position in the web page, and the interface element content can be loaded in the interface element frame, so as to realize the overall loading of the interface elements.
需要说明的是,由于是通过接口返回界面元素,返回的数据结构基本是固定的,那么,在前端需要支持这个接口返回的数据,进行不同的展现,具体以何种方式进行展示,可以由本领域技术人员按照实际情况进行设定,只要支持展示即可,本发明实施例对此不加以限制。It should be noted that since the interface elements are returned through the interface, the returned data structure is basically fixed, so the front end needs to support the data returned by this interface for different presentations, and the specific display method can be determined by the field The technicians make settings according to the actual situation, as long as the display is supported, which is not limited in the embodiment of the present invention.
以抽奖接口为例,后端接口中有一个是奖品信息接口,返回数据结构是固定的,那么前端就要持这个接口,那么前端如何安排样式都是可以的,比如圆盘、方盘或者更复杂的HTML 5游戏结果等,形式可以多样化。Taking the lottery interface as an example, one of the back-end interfaces is the prize information interface, and the returned data structure is fixed, so the front-end must support this interface, so the front-end can be arranged in any style, such as a disc, a square or something more Complicated HTML 5 game results, etc., in various forms.
步骤104,在所述界面元素上检测到操作事件时,按照所述操作事件生成一操作请求;Step 104, when an operation event is detected on the interface element, generate an operation request according to the operation event;
在网页显示界面元素之后,用户可以通过点击等方式在界面元素上进行操作,产生点击等操作事件。After the interface element is displayed on the web page, the user can perform operations on the interface element by clicking or other means to generate operation events such as clicking.
客户端在检测到界面元素上的操作事件时,按照界面元素的性质,生成操作请求。When the client detects an operation event on the interface element, it generates an operation request according to the nature of the interface element.
以抽奖为例,在网页显示抽奖的界面之后,用户可以点击其中的“抽奖”按键,客户端则可以生成抽奖的操作请求。Taking the lottery drawing as an example, after the web page displays the lottery drawing interface, the user can click the "lottery draw" button, and the client can generate a lottery drawing operation request.
步骤105,调用业务组件的接口,将所述操作请求发送至服务器的业务组件进行业务处理。Step 105, call the interface of the business component, and send the operation request to the business component of the server for business processing.
在网页文档中,可以预先写入模块的业务组件的接口,通过该接口将操作请求发送至服务器,调用业务组件,按照其定义的逻辑进行业务处理。In the webpage document, the interface of the business component of the module can be written in advance, and the operation request is sent to the server through the interface, and the business component is called to perform business processing according to the logic defined by it.
以抽奖为例,客户端调用负责抽奖的组件的接口,将抽奖的操作请求发送至服务器,服务器调用该组件进行抽奖。Taking lottery drawing as an example, the client calls the interface of the component responsible for lottery drawing, sends the operation request of lottery drawing to the server, and the server calls the component to perform lottery drawing.
在实际应用时,可以基于Ajax(Asynchronous Javascript And XML,异步JavaScript和XML(标准通用标记语言的子集))向服务器请求界面元素。In actual application, interface elements can be requested to the server based on Ajax (Asynchronous Javascript And XML, asynchronous JavaScript and XML (subset of standard general markup language)).
本发明实施例采用前后端分离的方式,将模块的形式和模块的功能分离开来,在前端进行界面元素的加载,通过业务组件的接口,将操作请求转移到后端进行业务处理,实现了模块的细颗粒度的复用,通过配置实现了模块,大大提高了更新模块的简便性,大大减少了更新模块的工作量。The embodiment of the present invention adopts the method of separating the front and back ends, separates the form of the module from the function of the module, loads the interface elements at the front end, and transfers the operation request to the back end for business processing through the interface of the business component, realizing The fine-grained multiplexing of modules realizes modules through configuration, which greatly improves the simplicity of updating modules and greatly reduces the workload of updating modules.
参照图2,示出了根据本发明一个实施例的一种基于网页的交互方法实施例2的步骤流程图,具体可以包括如下步骤:Referring to FIG. 2 , it shows a flow chart of the steps of Embodiment 2 of a webpage-based interaction method according to an embodiment of the present invention, which may specifically include the following steps:
步骤201,在客户端中采用网页文档加载网页;Step 201, using a webpage document to load a webpage in the client;
步骤202,当从所述网页文档读取到界面元素标识时,向服务器请求所述界面元素标识对应的界面元素;Step 202, when the interface element identifier is read from the webpage document, request the server for the interface element corresponding to the interface element identifier;
步骤203,在所述网页中加载所述界面元素;Step 203, loading the interface elements in the webpage;
步骤204,在所述界面元素上检测到操作事件时,按照所述操作事件生成一操作请求;Step 204, when an operation event is detected on the interface element, generate an operation request according to the operation event;
步骤205,调用业务组件的接口,将所述操作请求发送至服务器的业务组件;Step 205, call the interface of the business component, and send the operation request to the business component of the server;
步骤206,在服务器中确定触发所述操作请求的网页;Step 206, determining the webpage that triggers the operation request in the server;
步骤207,查询所述网页对应的配置参数;Step 207, querying the configuration parameters corresponding to the webpage;
步骤208,调用所述接口对应的业务组件,按照所述配置参数进行业务处理;Step 208, call the business component corresponding to the interface, and perform business processing according to the configuration parameters;
由于模块的前后端分离,为防止通信被拦截造成破解,因此,在操作请求中不设置配置参数,保留网页URL、用户ID等基本信息。Due to the separation of the front and back ends of the module, in order to prevent the communication from being intercepted and cracked, no configuration parameters are set in the operation request, and basic information such as the web page URL and user ID are reserved.
服务器在接收到操作请求之后,在配置清单中查找操作请求中网页URL对应的配置参数,按照该配置参数调用业务组件进行业务处理。After receiving the operation request, the server searches the configuration list for configuration parameters corresponding to the URL of the web page in the operation request, and invokes the business component to perform business processing according to the configuration parameters.
以抽奖为例,在配置清单中设置哪个网页(以URL表征)设置了哪个活动,该活动需要哪些配置参数,如抽奖池(奖品的数据)、抽奖概率等等。Taking the lottery as an example, which webpage (characterized by URL) is set which activity is set in the configuration list, and which configuration parameters are required for this activity, such as lottery pool (prize data), lottery probability, etc.
调用业务组件按照该配置参数进行抽奖(业务处理)。Call the business component to perform lottery drawing (business processing) according to the configuration parameters.
步骤209,将业务处理的结果返回客户端;Step 209, return the result of business processing to the client;
服务器在业务处理完成之后,将业务组件的处理结果返回给客户端。After the business processing is completed, the server returns the processing result of the business component to the client.
步骤210,在客户端中查询业务处理的结果对应的加载方式;Step 210, query the loading method corresponding to the result of business processing in the client;
步骤211,按照所述加载方式加载业务处理的结果。Step 211, load the result of business processing according to the loading method.
在本发明实施例中,可以预先在配置清单中定义结果的加载方式,在接收到业务处理的结果之后,可以按照该加载方式进行显示。In the embodiment of the present invention, the loading mode of the result can be defined in the configuration list in advance, and after receiving the result of the business processing, it can be displayed according to the loading mode.
以抽奖为例,若用户抽到实物,则可以加载一弹窗,让用户填写收件人、收件地址、联系手机等资料;若用户抽到虚拟物品,则可以直接展示所抽到的虚拟物品。Taking the lottery as an example, if the user wins a real item, a pop-up window can be loaded to allow the user to fill in information such as the recipient, recipient address, and contact phone number; if the user wins a virtual item, the drawn virtual item can be displayed directly. thing.
本发明实施例通过配置参数的方式,控制模块的功能实现,在保证了通信的安全性的同时,进一步提高了更新模块的简便性,减少了更新模块的工作量。In the embodiment of the present invention, the function of the control module is realized by configuring parameters, which further improves the simplicity of updating the module and reduces the workload of the updating module while ensuring the security of communication.
对于方法实施例,为了简单描述,故将其都表述为一系列的动作组合,但是本领域技术人员应该知悉,本发明实施例并不受所描述的动作顺序的限制,因为依据本发明实施例,某些步骤可以采用其他顺序或者同时进行。其次,本领域技术人员也应该知悉,说明书中所描述的实施例均属于优选实施例,所涉及的动作并不一定是本发明实施例所必须的。For the method embodiment, for the sake of simple description, it is expressed as a series of action combinations, but those skilled in the art should know that the embodiment of the present invention is not limited by the described action order, because according to the embodiment of the present invention , certain steps may be performed in other order or simultaneously. Secondly, those skilled in the art should also know that the embodiments described in the specification belong to preferred embodiments, and the actions involved are not necessarily required by the embodiments of the present invention.
参照图3,示出了根据本发明一个实施例的一种基于网页的交互系统实施例的结构框图,所述系统包括客户端,所述客户端具体可以包括如下模块:Referring to FIG. 3 , it shows a structural block diagram of an embodiment of a webpage-based interactive system according to an embodiment of the present invention. The system includes a client, and the client may specifically include the following modules:
网页加载模块301,适于采用网页文档加载网页;The webpage loading module 301 is suitable for loading a webpage by using a webpage document;
界面元素请求模块302,适于在从所述网页文档读取到界面元素标识时,向服务器请求所述界面元素标识对应的界面元素;The interface element request module 302 is adapted to request the server for an interface element corresponding to the interface element identifier when the interface element identifier is read from the webpage document;
界面元素加载模块303,适于在所述网页中加载所述界面元素;An interface element loading module 303, adapted to load the interface element in the webpage;
操作请求生成模块304,适于在所述界面元素上检测到操作事件时,按照所述操作事件生成一操作请求;An operation request generation module 304, adapted to generate an operation request according to the operation event when an operation event is detected on the interface element;
接口调用模块305,适于调用业务组件的接口,将所述操作请求发送至服务器的业务组件进行业务处理。The interface calling module 305 is adapted to call the interface of the business component, and send the operation request to the business component of the server for business processing.
在本发明的一种可选实施例中,所述界面元素标识包括界面元素框架标识和界面元素内容标识;In an optional embodiment of the present invention, the interface element identifier includes an interface element frame identifier and an interface element content identifier;
所述界面元素请求模块302还可以适于:The interface element request module 302 may also be adapted to:
向服务器请求所述界面元素框架标识对应的界面元素框架;Requesting the interface element frame corresponding to the interface element frame identifier from the server;
向服务器请求所述界面元素内容标识对应的界面元素内容。Requesting the interface element content corresponding to the interface element content identifier from the server.
在本发明的一种可选实施例中,所述界面元素加载模块303还可以适于:In an optional embodiment of the present invention, the interface element loading module 303 may also be adapted to:
在所述网页中的指定位置加载所述界面元素框架;loading the interface element frame at a specified location in the webpage;
在所述界面元素框架中加载所述界面元素内容。Load the interface element content in the interface element frame.
在本发明的一种可选实施例中,所述系统还可以包括服务器,所述服务器具体可以包括如下模块:In an optional embodiment of the present invention, the system may also include a server, and the server may specifically include the following modules:
网页确定模块,适于确定触发所述操作请求的网页;A web page determining module, adapted to determine the web page that triggers the operation request;
配置参数查询模块,适于查询所述网页对应的配置参数;A configuration parameter query module, adapted to query configuration parameters corresponding to the webpage;
业务组件调用模块,适于调用所述接口对应的业务组件,按照所述配置参数进行业务处理。The business component calling module is adapted to call the business component corresponding to the interface, and perform business processing according to the configuration parameters.
在本发明的一种可选实施例中,所述服务器还可以包括如下模块:In an optional embodiment of the present invention, the server may also include the following modules:
结果返回模块,适于将业务处理的结果返回客户端。The result returning module is suitable for returning the result of business processing to the client.
在本发明的一种可选实施例中,所述客户度还可以包括如下模块:In an optional embodiment of the present invention, the customer degree may also include the following modules:
加载方式查询模块,适于在客户端中查询业务处理的结果对应的加载方式;The loading method query module is suitable for querying the loading method corresponding to the result of business processing in the client;
结果加载模块,适于按照所述加载方式加载业务处理的结果。The result loading module is adapted to load the result of business processing according to the loading method.
对于系统实施例而言,由于其与方法实施例基本相似,所以描述的比较简单,相关之处参见方法实施例的部分说明即可。As for the system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and for the related parts, please refer to the part of the description of the method embodiment.
在此提供的算法和显示不与任何特定计算机、虚拟系统或者其它设备固有相关。各种通用系统也可以与基于在此的示教一起使用。根据上面的描述,构造这类系统所要求的结构是显而易见的。此外,本发明也不针对任何特定编程语言。应当明白,可以利用各种编程语言实现在此描述的本发明的内容,并且上面对特定语言所做的描述是为了披露本发明的最佳实施方式。The algorithms and displays presented herein are not inherently related to any particular computer, virtual system, or other device. Various generic systems can also be used with the teachings based on this. The structure required to construct such a system is apparent from the above description. Furthermore, the present invention is not specific to any particular programming language. It should be understood that various programming languages can be used to implement the content of the present invention described herein, and the above description of specific languages is for disclosing the best mode of the present invention.
在此处所提供的说明书中,说明了大量具体细节。然而,能够理解,本发明的实施例可以在没有这些具体细节的情况下实践。在一些实例中,并未详细示出公知的方法、结构和技术,以便不模糊对本说明书的理解。In the description provided herein, numerous specific details are set forth. However, it is understood that embodiments of the invention may be practiced without these specific details. In some instances, well-known methods, structures and techniques have not been shown in detail in order not to obscure the understanding of this description.
类似地,应当理解,为了精简本公开并帮助理解各个发明方面中的一个或多个,在上面对本发明的示例性实施例的描述中,本发明的各个特征有时被一起分组到单个实施例、图、或者对其的描述中。然而,并不应将该公开的方法解释成反映如下意图:即所要求保护的本发明要求比在每个权利要求中所明确记载的特征更多的特征。更确切地说,如下面的权利要求书所反映的那样,发明方面在于少于前面公开的单个实施例的所有特征。因此,遵循具体实施方式的权利要求书由此明确地并入该具体实施方式,其中每个权利要求本身都作为本发明的单独实施例。Similarly, it should be appreciated that in the foregoing description of exemplary embodiments of the invention, in order to streamline this disclosure and to facilitate an understanding of one or more of the various inventive aspects, various features of the invention are sometimes grouped together in a single embodiment, figure, or its description. This method of disclosure, however, is not to be interpreted as reflecting an intention that the claimed invention requires more features than are expressly recited in each claim. Rather, as the following claims reflect, inventive aspects lie in less than all features of a single foregoing disclosed embodiment. Thus, the claims following the Detailed Description are hereby expressly incorporated into this Detailed Description, with each claim standing on its own as a separate embodiment of this invention.
本领域那些技术人员可以理解,可以对实施例中的设备中的模块进行自适应性地改变并且把它们设置在与该实施例不同的一个或多个设备中。可以把实施例中的模块或单元或组件组合成一个模块或单元或组件,以及此外可以把它们分成多个子模块或子单元或子组件。除了这样的特征和/或过程或者单元中的至少一些是相互排斥之外,可以采用任何组合对本说明书(包括伴随的权利要求、摘要和附图)中公开的所有特征以及如此公开的任何方法或者设备的所有过程或单元进行组合。除非另外明确陈述,本说明书(包括伴随的权利要求、摘要和附图)中公开的每个特征可以由提供相同、等同或相似目的的替代特征来代替。Those skilled in the art can understand that the modules in the device in the embodiment can be adaptively changed and arranged in one or more devices different from the embodiment. Modules or units or components in the embodiments may be combined into one module or unit or component, and furthermore may be divided into a plurality of sub-modules or sub-units or sub-assemblies. All features disclosed in this specification (including accompanying claims, abstract and drawings) and any method or method so disclosed may be used in any combination, except that at least some of such features and/or processes or units are mutually exclusive. All processes or units of equipment are combined. Each feature disclosed in this specification (including accompanying claims, abstract and drawings) may be replaced by alternative features serving the same, equivalent or similar purpose, unless expressly stated otherwise.
此外,本领域的技术人员能够理解,尽管在此所述的一些实施例包括其它实施例中所包括的某些特征而不是其它特征,但是不同实施例的特征的组合意味着处于本发明的范围之内并且形成不同的实施例。例如,在下面的权利要求书中,所要求保护的实施例的任意之一都可以以任意的组合方式来使用。Furthermore, those skilled in the art will understand that although some embodiments described herein include some features included in other embodiments but not others, combinations of features from different embodiments are meant to be within the scope of the invention. and form different embodiments. For example, in the following claims, any of the claimed embodiments may be used in any combination.
本发明的各个部件实施例可以以硬件实现,或者以在一个或者多个处理器上运行的软件模块实现,或者以它们的组合实现。本领域的技术人员应当理解,可以在实践中使用微处理器或者数字信号处理器(DSP)来实现根据本发明实施例的基于网页的交互设备中的一些或者全部部件的一些或者全部功能。本发明还可以实现为用于执行这里所描述的方法的一部分或者全部的设备或者装置程序(例如,计算机程序和计算机程序产品)。这样的实现本发明的程序可以存储在计算机可读介质上,或者可以具有一个或者多个信号的形式。这样的信号可以从因特网网站上下载得到,或者在载体信号上提供,或者以任何其他形式提供。The various component embodiments of the present invention may be implemented in hardware, or in software modules running on one or more processors, or in a combination thereof. Those skilled in the art should understand that a microprocessor or a digital signal processor (DSP) may be used in practice to implement some or all functions of some or all components in the webpage-based interactive device according to the embodiment of the present invention. The present invention can also be implemented as an apparatus or an apparatus program (for example, a computer program and a computer program product) for performing a part or all of the methods described herein. Such a program for realizing the present invention may be stored on a computer-readable medium, or may be in the form of one or more signals. Such a signal may be downloaded from an Internet site, or provided on a carrier signal, or provided in any other form.
应该注意的是上述实施例对本发明进行说明而不是对本发明进行限制,并且本领域技术人员在不脱离所附权利要求的范围的情况下可设计出替换实施例。在权利要求中,不应将位于括号之间的任何参考符号构造成对权利要求的限制。单词“包含”不排除存在未列在权利要求中的元件或步骤。位于元件之前的单词“一”或“一个”不排除存在多个这样的元件。本发明可以借助于包括有若干不同元件的硬件以及借助于适当编程的计算机来实现。在列举了若干装置的单元权利要求中,这些装置中的若干个可以是通过同一个硬件项来具体体现。单词第一、第二、以及第三等的使用不表示任何顺序。可将这些单词解释为名称。It should be noted that the above-mentioned embodiments illustrate rather than limit the invention, and that those skilled in the art will be able to design alternative embodiments without departing from the scope of the appended claims. In the claims, any reference signs placed between parentheses shall not be construed as limiting the claim. The word "comprising" does not exclude the presence of elements or steps not listed in a claim. The word "a" or "an" preceding an element does not exclude the presence of a plurality of such elements. The invention can be implemented by means of hardware comprising several distinct elements, and by means of a suitably programmed computer. In a unit claim enumerating several means, several of these means can be embodied by one and the same item of hardware. The use of the words first, second, and third, etc. does not indicate any order. These words can be interpreted as names.
Claims (10)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201510982487.2A CN105516333B (en) | 2015-12-23 | 2015-12-23 | A kind of web-based exchange method and system |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201510982487.2A CN105516333B (en) | 2015-12-23 | 2015-12-23 | A kind of web-based exchange method and system |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| CN105516333A CN105516333A (en) | 2016-04-20 |
| CN105516333B true CN105516333B (en) | 2018-10-23 |
Family
ID=55723963
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN201510982487.2A Active CN105516333B (en) | 2015-12-23 | 2015-12-23 | A kind of web-based exchange method and system |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN105516333B (en) |
Families Citing this family (6)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN108073605B (en) * | 2016-11-10 | 2022-04-12 | 阿里巴巴集团控股有限公司 | Method and device for loading and pushing service data and generating interactive information |
| CN108319474B (en) * | 2017-01-16 | 2021-10-15 | 腾讯科技(深圳)有限公司 | Page information generation method, device and equipment |
| CN111625303B (en) * | 2019-02-27 | 2023-06-09 | 阿里巴巴集团控股有限公司 | Event processing method, device, equipment and readable storage medium |
| CN111078339B (en) * | 2019-11-29 | 2022-11-11 | 苏宁云计算有限公司 | Interface element positioning method and device, computer equipment and storage medium |
| CN111753240A (en) * | 2020-06-30 | 2020-10-09 | 上海二三四五网络科技有限公司 | Control method and device for automatically providing matching information based on H5 page |
| CN112685111B (en) * | 2020-12-25 | 2024-08-02 | 百果园技术(新加坡)有限公司 | Control data processing method and related equipment |
Citations (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN102510377A (en) * | 2011-10-31 | 2012-06-20 | 北京锐安科技有限公司 | Webpage interaction accelerating asynchronous data processing method and system |
| CN103544320A (en) * | 2013-11-05 | 2014-01-29 | 从兴技术有限公司 | Webpage generation method and device |
| CN103605449A (en) * | 2013-11-08 | 2014-02-26 | 深圳Tcl新技术有限公司 | Static page interaction method and device |
| CN104573025A (en) * | 2015-01-12 | 2015-04-29 | 北京京东尚科信息技术有限公司 | Method and system for increasing page loading rate |
| CN104750793A (en) * | 2015-03-12 | 2015-07-01 | 小米科技有限责任公司 | Method and device for generating page tables |
Family Cites Families (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US9779176B2 (en) * | 2008-04-02 | 2017-10-03 | International Business Machines Corporation | Accessing external functionality within a component-based web application |
-
2015
- 2015-12-23 CN CN201510982487.2A patent/CN105516333B/en active Active
Patent Citations (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN102510377A (en) * | 2011-10-31 | 2012-06-20 | 北京锐安科技有限公司 | Webpage interaction accelerating asynchronous data processing method and system |
| CN103544320A (en) * | 2013-11-05 | 2014-01-29 | 从兴技术有限公司 | Webpage generation method and device |
| CN103605449A (en) * | 2013-11-08 | 2014-02-26 | 深圳Tcl新技术有限公司 | Static page interaction method and device |
| CN104573025A (en) * | 2015-01-12 | 2015-04-29 | 北京京东尚科信息技术有限公司 | Method and system for increasing page loading rate |
| CN104750793A (en) * | 2015-03-12 | 2015-07-01 | 小米科技有限责任公司 | Method and device for generating page tables |
Also Published As
| Publication number | Publication date |
|---|---|
| CN105516333A (en) | 2016-04-20 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN105516333B (en) | A kind of web-based exchange method and system | |
| US9961129B2 (en) | Business transaction correlation with client request monitoring data | |
| EP2724251B1 (en) | Methods for making ajax web applications bookmarkable and crawlable and devices thereof | |
| CN102917059B (en) | A kind of client and the method downloading application thereof | |
| CN104065632B (en) | The processing method of sharing contents, server, client and system | |
| CN104584011B (en) | Method and system for being inserted into the secure network of WEB content and WEB service | |
| CN101005501B (en) | Method and apparatus for storing and restoring state information of a remote user interface | |
| WO2013143403A1 (en) | Method and system for accessing website | |
| CN106897336A (en) | Web page files sending method, webpage rendering intent and device, webpage rendering system | |
| CN109428877B (en) | Method and device for accessing service system through user equipment | |
| CN104348919A (en) | Method and device for downloading file and browser | |
| CN104021154B (en) | A kind of method and apparatus scanned in a browser | |
| EP2449481A1 (en) | System and method for enhancing digital content | |
| CN104484386A (en) | Information sharing method and browser client | |
| CN102932471B (en) | Browser logon server and realize browser log in method and system | |
| CN105095220B (en) | A browser implementation method, terminal and virtualized proxy device | |
| US10021210B1 (en) | Providing faster data access using multiple caching servers | |
| CN104166665B (en) | Information processor and its control method | |
| CN103605676A (en) | Search based terminal fault solution, client and system | |
| US8166400B2 (en) | Notifying blind users of live region updates | |
| AU2018390863B2 (en) | Computer system and method for extracting dynamic content from websites | |
| US8321535B2 (en) | Web services integration systems and methods | |
| CN107391132B (en) | Method, device and equipment for target App to execute preset action | |
| TWI641969B (en) | Electronic device and operation method thereof and server host device | |
| CN105721251A (en) | Reconfigurable testing pile service method and system |
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 | ||
| TR01 | Transfer of patent right |
Effective date of registration: 20220728 Address after: Room 801, 8th floor, No. 104, floors 1-19, building 2, yard 6, Jiuxianqiao Road, Chaoyang District, Beijing 100015 Patentee after: BEIJING QIHOO TECHNOLOGY Co.,Ltd. Address before: 100088 room 112, block D, 28 new street, new street, Xicheng District, Beijing (Desheng Park) Patentee before: BEIJING QIHOO TECHNOLOGY Co.,Ltd. Patentee before: Qizhi software (Beijing) Co.,Ltd. |
|
| TR01 | Transfer of patent right |