WO2011079619A1 - Method and system for aggregating data - Google Patents
Method and system for aggregating data Download PDFInfo
- Publication number
- WO2011079619A1 WO2011079619A1 PCT/CN2010/076210 CN2010076210W WO2011079619A1 WO 2011079619 A1 WO2011079619 A1 WO 2011079619A1 CN 2010076210 W CN2010076210 W CN 2010076210W WO 2011079619 A1 WO2011079619 A1 WO 2011079619A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- widget
- output
- input
- user
- aggregation
- 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.)
- Ceased
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/30—Creation or generation of source code
- G06F8/36—Software reuse
Definitions
- the present invention relates to data aggregation techniques in web applications, and more particularly to a method and system for aggregating Widget data content. Background technique
- Widgets are client-side applications that allow developers to embed content into Web files using Web standards. Widgets generally provide certain configuration features that allow users to customize. Because the function of the Widget is more specific, the degree of reusability is relatively high. Widgets are generally built on a platform that manages widgets. At the same time, the platform provides a set of APIs for Widgets. Third parties can develop their own widgets and run on the platform based on the development specifications provided by this platform. In general, Widgets can be divided into three categories according to the operating platform: desktop widgets (desktop Widgets), mobile widgets (Mobile Widgets), and Web Widgets.
- FIG 1 shows the structure of an existing Widget.
- the Widget consists of User Input and Processing Logic.
- the Widget provides an interface to receive user input, and the processing logic outputs the output based on this input.
- the processing logic is written in the language standard JavaScript of the Web, and the output is presented to the user by embedding JavaScript in Hypertext Markup Language (HTML).
- HTML Hypertext Markup Language
- FIG. 2 shows the existing Widge running system. As shown in Figure 2, the functions performed by the Widget are more specific and single. The multiple Widgets run independently, without forming communication specifications and standards, and no Widget output. Define standard interfaces, and the parameters between Widgets can't be passed directly. Therefore, Widgets can't interact and form aggregates. Summary of the invention
- the main object of the present invention is to provide a method and system for aggregating Widget data content, which enables Widgets to exchange and aggregate data content to meet the personalized needs of users.
- the present invention provides a method of aggregating data content, including:
- Analyze the input Widget source code create an aggregation template based on the user's choice to establish an input/output mapping relationship between the Widgets;
- the Widget engine runs the Widget and the Widget source code, and the Widget reads an output variable from a Widget engine storage area as a Widget input other than itself.
- the Widget source code of the analysis input is: acquiring the Widget source code; analyzing the input of the Widget and the output of the Widget; and transmitting the variable name of the input Widget and the variable name of the output of the Widget to the converter.
- the input of the analysis widget is: the widget uses an interface that receives a user input, analyzes and searches for a specific tag used to define a user input in the widget, and obtains an input of the widget.
- the output of the analysis widget is:
- the logic of the Widget obtains the output of the widget according to the law of the JavaScript output.
- the mapping between the input and output of the Widget is established, and the generated aggregation template is: obtaining the analyzed input of the Widget and the output of the Widget, and the user selects the Widget to be aggregated; receiving the change item selected by the user, if The user selects the input that needs to aggregate the Widget, displays the stored Widget output variable name, and receives the stored output variable name; if the user selects the output that needs to aggregate the Widget, then receives the output variable name to be stored, and root A unique storage identifier is generated according to the Widget name and the output variable name; determining whether the user completes all the changed items to be received, and if yes, generating an aggregation template according to the mapping relationship; if not, continuing to determine the user selection.
- the generating the aggregation template is: the user generates the aggregation template according to a certain rule or a convention, or the aggregation template automatically generates the aggregation template after being selected by the user interface.
- the storage area stores the output variable of the widget and provides parameters for the widget that needs to be input.
- the present invention also provides a system for aggregating data content, including: an aggregation preprocessor, a Widget engine;
- An aggregation preprocessor for analyzing the input Widget source code, and establishing an input/output mapping relationship between the Widgets according to the user's selection, generating an aggregation template; generating a Widget code according to the aggregation template, and inserting the generated Widget code into the Widget source code;
- the Widget engine further includes: a storage area, a Wdiget;
- Widget engine used to run Widget and Widget source code, and provide storage area for Widget output
- a storage area for storing the output of the widget, providing the required variables for the widgets that need to be input;
- Widget used to provide an interface to receive user input, get output according to user input, and output variables to the storage area of the Widget engine.
- the aggregation preprocessor further includes: an analysis module, a template generation module, and a code generation module; wherein
- An analysis module configured to receive the Widget source code and the aggregation template sent by the Widget engine, and analyze the input of the Widget and the output of the Widget, and transmit the variable name of the input of the Widget and the variable name of the output of the Widget to the converter; a template generating module, configured to send a response to the user after obtaining the input of the analyzed Widget and the output of the Widget, selecting a Widget to be aggregated, and receiving a change item selected by the user; when the user selects an input that needs to aggregate the Widget, displaying The stored Widget output variable name is selected by the user.
- the output variable name to be stored is received; the stored output variable name selected by the user for the input variable is received, and the name is based on the Widget name and the output variable.
- the output variable generates a unique storage identifier, generates an aggregation template according to the mapping relationship, and generates a template for analyzing the generated aggregation template, storing the variable in the Widget code, and reading the storage variable in the Widget code;
- the Widget output Widget code is inserted into the Widget source code.
- the method and system for synthesizing Widget data content analyzes the input Widget source code, establishes a mapping relationship between input and output of the Widget according to the user selection, and uses the storage area to store the output variable, and the Widget source code after the aggregation preprocessing
- the variables can be read from the storage area, thereby realizing the interaction and aggregation of data content between the Widgets.
- the user can use multiple Widgets to implement the customized application of the user, thereby achieving the effect of satisfying the personalized needs of the user and improving the user experience. .
- Figure 1 is an internal structure diagram of an existing Widget
- FIG. 2 is a schematic diagram of a system in which an existing Widget is running
- FIG. 3 is a schematic overall flow chart of a method for implementing aggregated Widget data content according to the present invention
- FIG. 4 is a schematic flow chart of a method for implementing an aggregate preprocessor to analyze Widget source code according to the present invention
- FIG. 5 is a schematic flowchart of a method for generating an aggregation template by establishing an input and output mapping pair according to a user selection by the aggregation preprocessor according to the present invention
- FIG. 6 is a schematic flowchart of a method for implementing an aggregation preprocessor to generate Widget code and insert code into a Widget source code according to the present invention
- FIG. 7 is a schematic flowchart of a method for implementing a Widget engine and a Widget source code according to the present invention
- FIG. 8 is a schematic diagram of an internal structure of a system for implementing aggregated Widget data content according to the present invention
- FIG. 9 is a schematic diagram of an effect of implementing Widget data content aggregation according to an embodiment of the present invention.
- the basic idea of the present invention is: analyzing the input Widget source code, according to the user's selection.
- the mapping between the input and output of the Widget, and the storage area is used to store the output variables, so that the input and output between the Widgets can be exchanged through the storage area.
- the aggregation preprocessor can be used as a separate module, the input is the Widget source code, and the output is the processed Widget source code. Therefore, the Widget engine calls the aggregation preprocessor to process the Widget source code before deploying the Widget source code, in the Widget. When the engine runs the Widget source code, the Widget source code processed by the aggregation preprocessor can realize the interaction and aggregation of the data content.
- the method for aggregating Widget data content provided by the present invention is as shown in FIG. 3, and the method comprises the following steps:
- Step 301 analyzing the input Widget source code
- Step 302 Create an input/output mapping relationship between the Widgets according to the user's selection, and generate an aggregation template.
- Step 303 Generate a Widget code according to the aggregation template, and insert the generated Widget code into the Widget source code.
- Step 304 The Widget engine runs the Widget and Widget source code, and the Widget reads the output variable from the storage area in the Widget engine as a Widget input other than itself.
- Step 401 Receive a Widget source code and an aggregation template sent by a Widget engine;
- the Widget code is generally an Extensible Markup Language (XML) code containing JavaScript code.
- XML Extensible Markup Language
- Step 402 analyzing the input of the widget
- the Widget utilizes an interface that receives user input, such as:
- Some Widgets use a specific tag, such as a ⁇ 1 ⁇ 6 £> tag to define the user's input, so that the aggregation preprocessor is used to define the Widget through analysis and lookup.
- the specific tag entered by the user to get the input of the Widget.
- Step 403 analyzing the output of the widget
- the Widget does not set an interface for the output code, but the logic of the Widget passes.
- JavaScript is implemented, so the output of the widget is obtained according to the rules of the JavaScript output.
- JavaScript uses the document. write(), innerText(), innerHTMLO methods to dynamically output the contents of the widget. You can look up these flags to analyze and get the output of the widget.
- Step 404 the variable name of the input of the analyzed Widget and the variable name of the output of the Widget are transmitted to the converter.
- the converter is used to convert the variable name of the input of the Widget and the variable name of the output of the Widget into a format required by the Widget, and the variable name of the input of the Widget converted by the converter and the variable name of the output of the Widget can be next. Step utilization.
- step 302 in FIG. 3 is a specific implementation method of step 302 in FIG. 3, which is a flowchart of a method for generating an aggregation template by establishing an aggregation and output mapping relationship between the Widgets according to the user's selection by the aggregation preprocessor of the present invention, as shown in FIG. 5,
- the method includes the following steps:
- Step 501 After obtaining the input of the analyzed Widget and the output of the Widget, sending a response to the user by using a file or a graphical interface, and selecting a Widget to be aggregated according to the response sent by the aggregation preprocessor.
- Step 502 Receive a change item selected by the user. If the user selects an input that needs to aggregate the Widget, step 503 is performed; if the user selects an output of the Widget to be aggregated, step 504 is performed.
- the change item includes: an input of a widget that needs to be aggregated and an output of a widget that needs to be aggregated.
- Step 503 displaying the stored Widget output variable name for the user to select
- Widget output variable names are taken as 01, 02... On in Figure 7.
- Step 504 Receive an output variable name selected by the user to be stored.
- Step 505 Receive a stored output variable name selected by the user for the input variable.
- the input variable selected by the user is i2 in Figure 7, and the output variable is 01 in Figure 7.
- Step 506 generating a unique storage identifier for the output variable in step 404 according to the widget name and the output variable name.
- the Widget name is a name of a Widget in the Widget engine defined by the user according to the requirement, and is used to distinguish multiple Widgets in the Widget engine.
- Step 507 Determine whether the user completes all the changed items to be received. If all the changed items are completed, step 508 is performed; if not, return to step 502 to continue to determine whether the changed item selected by the user is a widget input or a widget output.
- Step 508 Generate an aggregation template according to the mapping relationship.
- Widgetl ( zipcode — map )
- the output of Widgetl ( zipcode map ) is cityname
- the input of Widget 2 ( Real — estate — info ) is city
- Widget2 Real The output of the estate_info is real- estate.
- the user wants to aggregate the data content of Widget1 and Widget2, that is, the output cityname of Widget1 is used as the input of Widget2.
- the user can write the file to generate the aggregation template according to certain rules or conventions. , or by the user interface, after the selection by the aggregation
- the processor automatically generates an aggregation template.
- the aggregation template represents an aggregation between widgets, and the aggregation template may be defined in the following format:
- the aggregation of the above-mentioned postal code Widget and property information Widget can be represented by the following aggregation template:
- step 303 in FIG. 3 is a specific implementation method of step 303 in FIG. 3, which is a flowchart of a method for generating a Widget code according to an aggregation template and inserting the generated Widget code into a Widget source code.
- the method includes the following steps: Step 601: Analyze the aggregation template generated in step 508.
- Step 602 The variable name of the output tag ⁇ output> in the aggregation template is stored in the Widget code according to the ⁇ widget-01_1> tag in the aggregation template.
- the code for inserting the output ( 01 ) cityname variable storing the Widgetl is setCookie ( "acityname” , city.name)habit
- the input label in the aggregation template ⁇ input> ⁇ The name of the variable to be read, and the storage variable is read in the Widget code according to the ⁇ widget_11> tag in the aggregate template.
- Step 604 Insert the acquired Widget code of all the widgets into the Widget source code.
- the insertion may be that the user writes the code output by all the widgets into the Widget engine through the editing interface writing program.
- FIG. 7 is a specific implementation method of step 304 in FIG. 3, which is a Widget engine running according to the present invention.
- Widget and Widget source code method flow chart as shown in Figure 7, the method includes the following steps: Widgetl provides an interface to receive user input il, the processing logic in the Widget obtains the output result 01, 02 according to the user input; Widgetl according to the input The output 01 is obtained, and the output variable 01 obtained at the same time is output to the storage area in the Widget engine; when the Widget source code processed by the aggregation preprocessor is run on the Widget engine, the Widget can read the variable from the storage area, so the Widget 2 The output variable 01 of Widget1 can be read from the storage area as its own input; then Widget2 outputs 02 and outputs variable 02 to the storage area in the Widget engine, and so on, to realize the aggregation of the data content between the Widgets.
- the storage area in the Widget engine stores the output variables 01, 02... On of the Widget, and provides parameters for the Widgets that need to be input, so the input and output between the Widgets can utilize the The storage area implements the interaction of the Widget data content.
- the user can change the number of Widgets in the Widget engine as needed, and the user can also select the media as the storage area according to the requirements.
- the present invention further provides a system for aggregating Widget data content.
- the system includes: an aggregation preprocessor 81, a Widget engine 82;
- the aggregation preprocessor 81 is configured to analyze the input Widget source code, and establish an input/output mapping relationship between the Widgets according to the user's selection, to generate an aggregation template; generate a Widget code according to the aggregation template, and insert the generated Widget code into the Widget.
- Source code ;
- the aggregation preprocessor 81 further includes: an analysis module 811, a template generation module 812, and a code generation module 813;
- the analysis module 811 is configured to receive the Widget source code and the aggregation template sent by the Widget engine, analyze the input of the Widget and the output of the Widget, and finally transmit the variable name of the input of the Widget and the variable name of the output of the Widget to the converter.
- the converter is configured to convert the input of the Widget and the variable name of the output of the Widger into a format required by the Widget in the template generation module 812, and the variable name of the input of the Widget converted by the converter and the variable name output by the Widget may be generated by the template.
- Module 812 is utilized.
- the template generating module 812 is configured to send a response to the user by using a file or a graphical interface after obtaining the input and output of the analyzed Widget, and the user selects a Widget to be aggregated according to the response sent by the aggregation preprocessor, and receives the user selection.
- Change item when the user selects the input that needs to aggregate the Widget, it displays the already stored Widget output variable name for the user to select; when the user selects the output that needs to aggregate the Widget, it receives the output variable name selected by the user to be stored; The stored output variable name selected by the user for the input variable; generates a unique storage identifier according to the Widget name and the output variable name output variable, and finally generates an aggregation template according to the mapping relationship.
- the Widget name is a name of a Widget in the Widget engine defined by the user according to the requirement, and is used to distinguish multiple Widgets in the Widget engine.
- the code generation template 813 is configured to analyze the generated aggregation template, and the variable name corresponding to the output label in the aggregation template, according to the aggregation template wi ⁇ widget-01«> tag, store the variable in the Widget code; input the label in the aggregation template Corresponding variable name, according to the aggregation template ⁇ ⁇ widget _in> tag, read the storage variable in the Widget code; finally, the code of all the obtained Widget output is inserted into the Widget source code.
- the Widget engine 82 is configured to run the Widget and Widget source code, and provide a storage area for the output of the Widget;
- the Widget engine further includes: a storage area 821, a Widget; wherein
- a storage area 821 for storing the output of the widget, and providing a required variable for the widget that needs to be input;
- the input and output between the widgets can utilize the storage area to implement the intersection of the Widget data content; the user can select the medium as the storage area according to the requirement.
- the cookie is selected as the output variable of the storage area medium storage widget.
- a widget for providing an interface to receive user input, processing logic in the widget obtaining an output result according to the user input, and outputting the variable to a storage area of the Widget engine;
- the user can change the number of widgets in the widget engine as needed.
- FIG. 9 is a specific embodiment of the aggregated Widget data content. As shown in FIG. 9, three Widgets are processed by an aggregation preprocessor to generate a new Mashup application, which implements data aggregation between Widgets.
- Figure 9 is the input box Widget, the map Widget and the property information Widget from left to right.
- the function of the input box Widget is to display the post on the Widget interface after inputting the postal code. Coding, the function of the map Widget is to display the map and the weather situation of the geographic location corresponding to the postal code on the interface of the Widget after inputting the postal code.
- the function of the property information Widget is to display the interface of the Widget after inputting the name of the city. Show information about the property in the city.
- the three Widgets implement the aggregation of the data content.
- the function realized after the aggregation is to input the zip code in the input box Widget, the zip code is displayed on the Widget interface, and the zip code is displayed on the map Widget.
- the map of the corresponding geographic location and the weather forecast, the property information Widget shows a list of real estate information for the corresponding city in the geographic location.
- the aggregation preprocessor analyzes the input and output of the Widget; the input box Widget, the map Widget, and the property information Widget input and output analysis results are as follows:
- Widget name Input initial input: zipcode output: zipcode
- Widget name Weather Map input:zipcode map output:cityname
- Widget name Real Estate input:city output: real estate infolist
- the aggregation preprocessor selects the input and output mapping relationships according to the Widget input and output of the first step to generate an aggregation template.
- the output zip code of the Widget (Input-initial) is used as the input zip code map of the map Widget (Weather Map), and the output city name of the map Widget (Weather Map).
- cityname As the input city name (city ) of the property information list Widget, use the following aggregation template to represent the data content aggregation relationship between the three:
- the aggregation preprocessor In the third step, the aggregation preprocessor generates Widget code according to the aggregation template formed in the second step, and inserts the code into the Widget source code.
Landscapes
- Engineering & Computer Science (AREA)
- Software Systems (AREA)
- General Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Stored Programmes (AREA)
Abstract
Description
一种聚合数据内容的方法和系统 技术领域 Method and system for aggregating data content
本发明涉及 Web 应用中的数据聚合技术, 尤其涉及一种聚合 Widget 数据内容的方法和系统。 背景技术 The present invention relates to data aggregation techniques in web applications, and more particularly to a method and system for aggregating Widget data content. Background technique
Widget是一种客户端的应用程序, 它允许开发者使用 Web标准将内容 嵌入 Web文件。 Widget—般提供一定的配置功能, 允许用户进行自定义。 由于 Widget的功能比较具体, 可复用的程度比较高。 Widget—般构建在某 种平台之上, 由平台负责对 Widget进行管理, 与此同时, 平台会提供一系 列的应用程序接口( API, Application Programming Internet )供 Widget使用。 第三方可根据此平台提供的开发规范, 开发自身的窗口小部件, 并运行在 该平台上。通常, Widget可按照运行平台分成三类:桌面窗口 Widget( desktop Widget )、 移动 Widget ( Mobile Widget )和 Web Widget„ Widgets are client-side applications that allow developers to embed content into Web files using Web standards. Widgets generally provide certain configuration features that allow users to customize. Because the function of the Widget is more specific, the degree of reusability is relatively high. Widgets are generally built on a platform that manages widgets. At the same time, the platform provides a set of APIs for Widgets. Third parties can develop their own widgets and run on the platform based on the development specifications provided by this platform. In general, Widgets can be divided into three categories according to the operating platform: desktop widgets (desktop Widgets), mobile widgets (Mobile Widgets), and Web Widgets.
图 1示出了现有的 Widget的结构,如图 1所示, Widget由用户输入( User Input )和处理逻辑( Logic )组成, Widget提供一个接口来接收用户输入, 处理逻辑根据这个输入得到输出结果, 处理逻辑釆用 Web 标准的语言 JavaScript 编写, 通过在超文本标记语言 (HTML , Hyper Text Mark-up Language ) 中嵌入 JavaScript来向用户展示输出。 Figure 1 shows the structure of an existing Widget. As shown in Figure 1, the Widget consists of User Input and Processing Logic. The Widget provides an interface to receive user input, and the processing logic outputs the output based on this input. As a result, the processing logic is written in the language standard JavaScript of the Web, and the output is presented to the user by embedding JavaScript in Hypertext Markup Language (HTML).
图 2示出了现有的 Widge运行的系统, 如图 2所示, Widget所完成的 功能比较具体和单一, 多个 Widget之间运行独立, 没有形成通信的规范和 标准,也没有为 Widget输出定义标准的接口, 而且 Widget之间的参数也不 能直接传递, 因此, Widget之间不能交互和形成聚合。 发明内容 Figure 2 shows the existing Widge running system. As shown in Figure 2, the functions performed by the Widget are more specific and single. The multiple Widgets run independently, without forming communication specifications and standards, and no Widget output. Define standard interfaces, and the parameters between Widgets can't be passed directly. Therefore, Widgets can't interact and form aggregates. Summary of the invention
有鉴于此, 本发明的主要目的在于提供一种聚合 Widget数据内容的方 法和系统, 能使 Widget之间进行数据内容的交互和聚合, 满足用户的个性 化需求。 In view of this, the main object of the present invention is to provide a method and system for aggregating Widget data content, which enables Widgets to exchange and aggregate data content to meet the personalized needs of users.
为达到上述目的, 本发明的技术方案是这样实现的: In order to achieve the above object, the technical solution of the present invention is achieved as follows:
本发明提供了一种聚合数据内容的方法, 包括: The present invention provides a method of aggregating data content, including:
分析输入的 Widget源码;才艮据用户的选择建立一个以上 Widget间输入 输出映射关系, 生成聚合模板; Analyze the input Widget source code; create an aggregation template based on the user's choice to establish an input/output mapping relationship between the Widgets;
根据所述聚合模板生成 Widget代码,将所生成的 Widget代码插入所述 Widget源码; Generating a Widget code according to the aggregation template, and inserting the generated Widget code into the Widget source code;
所述 Widget引擎运行所述 Widget和所述 Widget源码,所述 Widget从 Widget引擎的存储区中读取输出变量作为自身之外的 Widget输入。 The Widget engine runs the Widget and the Widget source code, and the Widget reads an output variable from a Widget engine storage area as a Widget input other than itself.
其中, 所述分析输入的 Widget源码为: 获取所述 Widget源码; 分析 Widget的输入和 Widget的输出; 并将分析得到的 Widget的输入的变量名 和 Widget的输出的变量名传送给转换器。 The Widget source code of the analysis input is: acquiring the Widget source code; analyzing the input of the Widget and the output of the Widget; and transmitting the variable name of the input Widget and the variable name of the output of the Widget to the converter.
上述方案中, 所述分析 Widget的输入为: 所述 Widget利用接收用户输 入的接口, 分析和查找用来定义所述 Widget中用户输入的特定标签, 获得 所述 Widget的输入。 In the above solution, the input of the analysis widget is: the widget uses an interface that receives a user input, analyzes and searches for a specific tag used to define a user input in the widget, and obtains an input of the widget.
上述方案中, 所述分析 Widget的输出为: Widget的逻辑根据 JavaScript 输出的规律获得 Widget的输出。 In the above solution, the output of the analysis widget is: The logic of the Widget obtains the output of the widget according to the law of the JavaScript output.
上述方案中, 所述建立一个以上 Widget间输入输出映射关系, 生成聚 合模板为: 获得分析过的所述 Widget的输入和 Widget的输出,用户选择需 要聚合的 Widget; 接收用户选择的更改项, 如果用户选择需要聚合 Widget 的输入,则显示已存储的 Widget输出变量名,并接收已存储的输出变量名; 如果用户选择需要聚合 Widget的输出, 则接收要存储的输出变量名, 并根 据 Widget名和输出变量名生成唯一的存储标识; 判断用户是否完成要接收 的所有更改项, 如果完成, 则根据映射关系生成聚合模板; 如果未完成, 则继续判断用户选择。 In the above solution, the mapping between the input and output of the Widget is established, and the generated aggregation template is: obtaining the analyzed input of the Widget and the output of the Widget, and the user selects the Widget to be aggregated; receiving the change item selected by the user, if The user selects the input that needs to aggregate the Widget, displays the stored Widget output variable name, and receives the stored output variable name; if the user selects the output that needs to aggregate the Widget, then receives the output variable name to be stored, and root A unique storage identifier is generated according to the Widget name and the output variable name; determining whether the user completes all the changed items to be received, and if yes, generating an aggregation template according to the mapping relationship; if not, continuing to determine the user selection.
上述方案中, 所述生成聚合模板为: 用户按照一定的规则或约定写文 件生成所述聚合模板, 或者通过用户界面选择后由聚合预处理器自动生成 所述聚合模板。 In the above solution, the generating the aggregation template is: the user generates the aggregation template according to a certain rule or a convention, or the aggregation template automatically generates the aggregation template after being selected by the user interface.
上述方案中, 所述存储区存储 Widget 的输出变量, 并为需要输入的 Widget提供参数。 In the above solution, the storage area stores the output variable of the widget and provides parameters for the widget that needs to be input.
本发明还提供了一种一种聚合数据内容的系统,包括: 聚合预处理器、 Widget引擎; 其中, The present invention also provides a system for aggregating data content, including: an aggregation preprocessor, a Widget engine;
聚合预处理器, 用于分析输入的 Widget源码, 并根据用户的选择建立 一个以上 Widget间输入输出映射关系, 生成聚合模板; 根据所述聚合模板 生成 Widget代码, 将所生成的 Widget代码插入所述 Widget源码; An aggregation preprocessor for analyzing the input Widget source code, and establishing an input/output mapping relationship between the Widgets according to the user's selection, generating an aggregation template; generating a Widget code according to the aggregation template, and inserting the generated Widget code into the Widget source code;
Widget引擎进一步包括: 存储区、 Wdiget; The Widget engine further includes: a storage area, a Wdiget;
Widget引擎, 用于运行 Widget和 Widget源码, 并为 Widget的输出提 供存储区; Widget engine, used to run Widget and Widget source code, and provide storage area for Widget output;
存储区, 用于存储 Widget的输出, 为需要输入的 Widget提供所需的变 量; a storage area for storing the output of the widget, providing the required variables for the widgets that need to be input;
Widget, 用于提供接口接收用户输入, 根据用户输入得到输出结果, 并输出变量到 Widget引擎的存储区。 Widget, used to provide an interface to receive user input, get output according to user input, and output variables to the storage area of the Widget engine.
其中, 所述聚合预处理器进一步包括: 分析模块、 模板生成模块、 代 码生成模块; 其中, The aggregation preprocessor further includes: an analysis module, a template generation module, and a code generation module; wherein
分析模块,用于接收所述 Widget引擎发送的所述 Widget源码和聚合模 板, 并分析 Widget的输入和 Widget的输出, 将所述 Widget的输入的变量 名和 Widget的输出的变量名传送给转换器; 模板生成模块,用于在获得分析过的 Widget的输入和 Widget的输出后, 向用户发送响应, 选择需要聚合的 Widget, 并接收用户选择的更改项; 当 用户选择需要聚合 Widget的输入时,显示已经存储的 Widget输出变量名供 用户选择,用户选择需要聚合 Widget的输出时,接收要存储的输出变量名; 接收用户为输入变量选择的已存储的输出变量名, 并根据 Widget名和输出 变量名为输出变量生成唯一的存储标识, 根据映射关系生成聚合模板; 代码生成模板, 用于分析生成的所述聚合模板, 在 Widget代码存储变 量并在所述 Widget代码中读取存储变量; 将获取的全部 Widget输出的 Widget代码插入到所述 Widget源码中。 An analysis module, configured to receive the Widget source code and the aggregation template sent by the Widget engine, and analyze the input of the Widget and the output of the Widget, and transmit the variable name of the input of the Widget and the variable name of the output of the Widget to the converter; a template generating module, configured to send a response to the user after obtaining the input of the analyzed Widget and the output of the Widget, selecting a Widget to be aggregated, and receiving a change item selected by the user; when the user selects an input that needs to aggregate the Widget, displaying The stored Widget output variable name is selected by the user. When the user selects the output of the Widget to be aggregated, the output variable name to be stored is received; the stored output variable name selected by the user for the input variable is received, and the name is based on the Widget name and the output variable. The output variable generates a unique storage identifier, generates an aggregation template according to the mapping relationship, and generates a template for analyzing the generated aggregation template, storing the variable in the Widget code, and reading the storage variable in the Widget code; The Widget output Widget code is inserted into the Widget source code.
本发明所提供的聚合 Widget 数据内容的方法和系统, 分析输入的 Widget源码, 根据用户选择建立 Widget间的输入和输出的映射关系, 并利 用存储区存储输出变量,经过聚合预处理后的 Widget源码在 Widget引擎上 运行时能够从存储区读取变量,从而实现 Widget间的数据内容交互和聚合, 用户可以利用多个 Widget实现用户的定制应用, 达到满足用户个性化需求 的效果, 提升用户的体验。 附图说明 The method and system for synthesizing Widget data content provided by the invention analyzes the input Widget source code, establishes a mapping relationship between input and output of the Widget according to the user selection, and uses the storage area to store the output variable, and the Widget source code after the aggregation preprocessing When running on the Widget engine, the variables can be read from the storage area, thereby realizing the interaction and aggregation of data content between the Widgets. The user can use multiple Widgets to implement the customized application of the user, thereby achieving the effect of satisfying the personalized needs of the user and improving the user experience. . DRAWINGS
图 1为现有 Widget的内部结构图; Figure 1 is an internal structure diagram of an existing Widget;
图 2为现有 Widget运行时的系统的示意图; 2 is a schematic diagram of a system in which an existing Widget is running;
图 3为本发明实现聚合 Widget数据内容的方法的整体流程示意图; 图 4 为本发明实现聚合预处理器分析 Widget 源码的方法的流程示意 图; 3 is a schematic overall flow chart of a method for implementing aggregated Widget data content according to the present invention; FIG. 4 is a schematic flow chart of a method for implementing an aggregate preprocessor to analyze Widget source code according to the present invention;
图 5 为本发明实现聚合预处理器根据用户的选择建立输入、 输出映射 对, 生成聚合模板的方法的流程示意图; FIG. 5 is a schematic flowchart of a method for generating an aggregation template by establishing an input and output mapping pair according to a user selection by the aggregation preprocessor according to the present invention;
图 6为本发明实现聚合预处理器生成 Widget代码并将代码插入 Widget 源码的方法的流程示意图; 图 7为本发明实现 Widget引擎运行 Widget和 Widget源码时的方法的 流程示意图; 6 is a schematic flowchart of a method for implementing an aggregation preprocessor to generate Widget code and insert code into a Widget source code according to the present invention; FIG. 7 is a schematic flowchart of a method for implementing a Widget engine and a Widget source code according to the present invention;
图 8为本发明实现聚合 Widget数据内容的系统的内部结构的示意图; 图 9为本发明一实施例实现 Widget数据内容聚合的效果示意图。 具体实施方式 FIG. 8 is a schematic diagram of an internal structure of a system for implementing aggregated Widget data content according to the present invention; FIG. 9 is a schematic diagram of an effect of implementing Widget data content aggregation according to an embodiment of the present invention. detailed description
为了实现 Widget间的数据内容聚合和交互, 需要获得 Widget的输出, 并将这个输出作为参数传递给其他 Widget作为输入;本发明的基本思想是: 分析输入的 Widget源码,才艮据用户的选择建立 Widget间输入和输出的映射 关系, 并釆用存储区存储输出变量, 使得 Widget间的输入和输出能够通过 存 ^诸区进行交互。 In order to realize the data content aggregation and interaction between the Widgets, it is necessary to obtain the output of the Widget, and pass the output as a parameter to other Widgets as input; the basic idea of the present invention is: analyzing the input Widget source code, according to the user's selection. The mapping between the input and output of the Widget, and the storage area is used to store the output variables, so that the input and output between the Widgets can be exchanged through the storage area.
具体的,聚合预处理器可作为一个独立的模块,输入的是 Widget源码, 输出的是经过处理后的 Widget源码, 因此, Widget引擎在部署 Widget源 码前调用聚合预处理器处理 Widget源码, 在 Widget引擎运行 Widget源码 时,经过聚合预处理器处理过的 Widget源码能实现数据内容的交互和聚合。 Specifically, the aggregation preprocessor can be used as a separate module, the input is the Widget source code, and the output is the processed Widget source code. Therefore, the Widget engine calls the aggregation preprocessor to process the Widget source code before deploying the Widget source code, in the Widget. When the engine runs the Widget source code, the Widget source code processed by the aggregation preprocessor can realize the interaction and aggregation of the data content.
下面通过附图及具体实施例对本发明再做进一步的详细说明。 The invention will be further described in detail below with reference to the drawings and specific embodiments.
本发明提供的聚合 Widget数据内容的方法, 如图 3所示, 该方法包括 以下步骤: The method for aggregating Widget data content provided by the present invention is as shown in FIG. 3, and the method comprises the following steps:
步骤 301 , 分析输入的 Widget源码; Step 301, analyzing the input Widget source code;
步骤 302,根据用户的选择建立一个以上 Widget间输入输出映射关系, 生成聚合模板; Step 302: Create an input/output mapping relationship between the Widgets according to the user's selection, and generate an aggregation template.
步骤 303 , 根据聚合模板生成 Widget代码, 将所生成的 Widget代码插 入 Widget源码; Step 303: Generate a Widget code according to the aggregation template, and insert the generated Widget code into the Widget source code.
步骤 304, Widget引擎运行 Widget和 Widget源码, Widget从 Widget 引擎里的存储区中读取输出变量作为自身之外的 Widget输入。 Step 304: The Widget engine runs the Widget and Widget source code, and the Widget reads the output variable from the storage area in the Widget engine as a Widget input other than itself.
图 4是图 3中实现步骤 301的具体方法, 是本发明聚合预处理器分析 输入的 Widget源码的方法流程图, 如图 4所示, 该方法包括以下步骤: 步骤 401 , 接收 Widget引擎发送的 Widget源码和聚合模板; 4 is a specific method for implementing step 301 in FIG. 3, which is an analysis of the polymerization preprocessor of the present invention. A method flowchart of the input Widget source code, as shown in FIG. 4, the method includes the following steps: Step 401: Receive a Widget source code and an aggregation template sent by a Widget engine;
其中, Widget代码一般是可扩展标记语言 (XML, Extensible Markup Language )代码中包含 JavaScript代码。 Among them, the Widget code is generally an Extensible Markup Language (XML) code containing JavaScript code.
步骤 402, 分析 Widget的输入; Step 402, analyzing the input of the widget;
具体的, Widget利用接收用户输入的接口, 比如: 有些 Widget中使用 特定的标签, 如<1^6 £>标签来定义用户的输入, 这样, 聚合预处理器通 过分析和查找用来定义 Widget中用户输入的特定的标签,获得 Widget的输 入。 Specifically, the Widget utilizes an interface that receives user input, such as: Some Widgets use a specific tag, such as a <1^6 £> tag to define the user's input, so that the aggregation preprocessor is used to define the Widget through analysis and lookup. The specific tag entered by the user to get the input of the Widget.
步骤 403 , 分析 Widget的输出; Step 403, analyzing the output of the widget;
具体的, Widget没有为输出代码设定接口, 但是 Widget 的逻辑通过 Specifically, the Widget does not set an interface for the output code, but the logic of the Widget passes.
JavaScript来实现, 所以, 根据 JavaScript输出的规律获得 Widget的输出。 比^口, JavaScript会使用 document. write(), innerText(), innerHTMLO方法来动 态输出 widget的内容, 可通过寻找这些标志来分析和获得 Widget的输出。 JavaScript is implemented, so the output of the widget is obtained according to the rules of the JavaScript output. In contrast to JavaScript, JavaScript uses the document. write(), innerText(), innerHTMLO methods to dynamically output the contents of the widget. You can look up these flags to analyze and get the output of the widget.
步骤 404, 将分析得到的 Widget的输入的变量名和 Widget的输出的变 量名传送给转换器。 Step 404, the variable name of the input of the analyzed Widget and the variable name of the output of the Widget are transmitted to the converter.
这里,所述转换器是用于将 Widget的输入的变量名和 Widget的输出的 变量名转换成 Widget需要的格式,经过转换器转换的 Widget的输入的变量 名和 Widget的输出的变量名可以被下一个步骤利用。 Here, the converter is used to convert the variable name of the input of the Widget and the variable name of the output of the Widget into a format required by the Widget, and the variable name of the input of the Widget converted by the converter and the variable name of the output of the Widget can be next. Step utilization.
图 5是图 3中步骤 302的具体实现方法, 是本发明聚合预处理器根据 用户的选择建立一个以上 Widget间输入输出映射关系, 生成聚合模板的方 法的流程图, 如图 5所示, 该方法包括以下步骤: 5 is a specific implementation method of step 302 in FIG. 3, which is a flowchart of a method for generating an aggregation template by establishing an aggregation and output mapping relationship between the Widgets according to the user's selection by the aggregation preprocessor of the present invention, as shown in FIG. 5, The method includes the following steps:
步骤 501 , 在获得分析过的 Widget的输入和 Widget的输出后, 通过文 件或图形界面的方式向用户发送响应, 用户根据聚合预处理器发送的响应 选择需要聚合的 Widget。 步骤 502 , 接收用户选择的更改项, 如果用户选择需要聚合 Widget的 输入, 则执行步骤 503 ; 如果用户选择需要聚合的 Widget的输出, 则执行 步骤 504。 Step 501: After obtaining the input of the analyzed Widget and the output of the Widget, sending a response to the user by using a file or a graphical interface, and selecting a Widget to be aggregated according to the response sent by the aggregation preprocessor. Step 502: Receive a change item selected by the user. If the user selects an input that needs to aggregate the Widget, step 503 is performed; if the user selects an output of the Widget to be aggregated, step 504 is performed.
其中,所述更改项包括:需要聚合的 Widget的输入和需要聚合的 Widget 的输出。 The change item includes: an input of a widget that needs to be aggregated and an output of a widget that needs to be aggregated.
步骤 503 , 显示已经存储的 Widget输出变量名供用户选择; Step 503, displaying the stored Widget output variable name for the user to select;
以下 Widget输出变量名以图 7中的 01、 02... On为例。 The following Widget output variable names are taken as 01, 02... On in Figure 7.
步骤 504, 接收用户选择的要存储的输出变量名; Step 504: Receive an output variable name selected by the user to be stored.
假设用户选择的 Widget输出变量名以 01为例。 Suppose the user selects the Widget output variable name as 01.
步骤 505 , 接收用户为输入变量选择的已存储的输出变量名; Step 505: Receive a stored output variable name selected by the user for the input variable.
例如: 用户选择的输入变量为图 7中 i2 , 输出变量为图 7中 01。 For example: The input variable selected by the user is i2 in Figure 7, and the output variable is 01 in Figure 7.
步骤 506, 根据 Widget名和输出变量名, 为步骤 404中的输出变量生 成唯一的存储标识。 Step 506, generating a unique storage identifier for the output variable in step 404 according to the widget name and the output variable name.
这里, 所述 Widget名是用户根据需求定义的 Widget引擎中 Widget的 名字, 用于区别 Widget引擎中的多个 Widget。 Here, the Widget name is a name of a Widget in the Widget engine defined by the user according to the requirement, and is used to distinguish multiple Widgets in the Widget engine.
步骤 507, 判断用户是否完成要接收的所有更改项, 如果完成所有更改 项, 则执行步骤 508; 如果未完成, 则返回到步骤 502 , 继续判断用户选择 的更改项是 Widget输入还是 Widget输出。 Step 507: Determine whether the user completes all the changed items to be received. If all the changed items are completed, step 508 is performed; if not, return to step 502 to continue to determine whether the changed item selected by the user is a widget input or a widget output.
步骤 508, 根据映射关系生成聚合模板。 Step 508: Generate an aggregation template according to the mapping relationship.
假如: 通过聚合预处理器的处理获得 Widgetl ( zipcode— map ) 的输入 input为 zipcode , Widgetl ( zipcode map )的输出 output为 cityname; Widget2 ( Real— estate— info ) 的输入 input为 city, Widget2 ( Real— estate— info ) 的输 出 output为 real— estate, 则用户希望聚合 Widgetl和 Widget2的数据内容, 即: 将 Widgetl的输出 cityname作为 Widget2的输入, 用户可按照一定的 规则或约定来写文件生成聚合模板, 或者通过用户界面选择后由聚合预处 理器自动生成聚合模板。 If: through the processing of the aggregation preprocessor, the input input of Widgetl ( zipcode — map ) is zipcode , the output of Widgetl ( zipcode map ) is cityname; the input of Widget 2 ( Real — estate — info ) is city, Widget2 ( Real The output of the estate_info is real- estate. The user wants to aggregate the data content of Widget1 and Widget2, that is, the output cityname of Widget1 is used as the input of Widget2. The user can write the file to generate the aggregation template according to certain rules or conventions. , or by the user interface, after the selection by the aggregation The processor automatically generates an aggregation template.
其中, 所述聚合模板表示 Widget间的聚合, 可按照以下格式定义聚合 模板: The aggregation template represents an aggregation between widgets, and the aggregation template may be defined in the following format:
<mashup> <mashup>
<widget_out name:〉 <widget_out name:〉
<output name:〉 <output name:〉
</output> </output>
</widget_out> </widget_out>
<widget_in name:〉 <widget_in name:〉
<input name:> <input name:>
</input> </input>
</widget_in> </widget_in>
<mashup> <mashup>
比如: 上述邮政编码 Widget和房产信息 Widget的聚合, 可由如下的聚 合模板来表示: For example: The aggregation of the above-mentioned postal code Widget and property information Widget can be represented by the following aggregation template:
<mashup> <mashup>
<widget_out name: zipcode_map> <widget_out name: zipcode_map>
<out ut name :cityname> <out ut name :cityname>
</widget_out> </widget_out>
<widget_in name: Real— estate— info > <widget_in name: Real- estate_ info >
<input name:city> <input name:city>
</input> </input>
</widget_in> </widget_in>
<mashup> <mashup>
图 6是图 3中步骤 303的具体实现方法, 是本发明根据聚合模板生成 Widget代码, 将所生成的 Widget代码插入 Widget源码的方法流程图, 如 图 6所示, 该方法包括以下步骤: 步骤 601 , 分析在步骤 508中生成的聚合模板。 6 is a specific implementation method of step 303 in FIG. 3, which is a flowchart of a method for generating a Widget code according to an aggregation template and inserting the generated Widget code into a Widget source code. As shown in FIG. 6, the method includes the following steps: Step 601: Analyze the aggregation template generated in step 508.
步骤 602, 对聚合模板中的输出标签 <output>^应的变量名, 根据聚合 模板中 <widget— 01«>标签在 Widget代码存储变量。 Step 602: The variable name of the output tag <output> in the aggregation template is stored in the Widget code according to the <widget-01_1> tag in the aggregation template.
比如: 对于步骤 508中的聚合模板, 插入存储 Widgetl ( zipcode— map ) 的 output ( 01 ) cityname变量的代码为 setCookie( "acityname" ,city.name)„ 步骤 603中, 对聚合模板中的输入标签 <input>^应的变量名, 根据聚 合模板中<widget—11>标签在 Widget代码中读取存储变量。 For example: For the aggregation template in step 508, the code for inserting the output ( 01 ) cityname variable storing the Widgetl ( zipcode — map ) is setCookie ( "acityname" , city.name) „ In step 603, the input label in the aggregation template <input>^ The name of the variable to be read, and the storage variable is read in the Widget code according to the <widget_11> tag in the aggregate template.
比如: 对于步骤 508中的聚合模板, 为 Widget2 ( Real— estate— info ) 的 Input ( il ) city读取 01的代码为 var cityname=getCookieByName(cookieObj , "cityname" )。 For example: For the aggregation template in step 508, the code for reading 01 for the Input ( il ) city of Widget 2 ( Real- estate_ info ) is var cityname=getCookieByName(cookieObj , "cityname" ).
步骤 604, 将获取的全部 Widget输出的 Widget代码插入到 Widget源 码。 Step 604: Insert the acquired Widget code of all the widgets into the Widget source code.
这里, 所述插入可以是用户通过编辑界面编写程序将全部 Widget输出 的代码写进 Widget引擎。 Here, the insertion may be that the user writes the code output by all the widgets into the Widget engine through the editing interface writing program.
图 7是图 3 中步骤 304的具体实现方法, 是本发明 Widget引擎运行 FIG. 7 is a specific implementation method of step 304 in FIG. 3, which is a Widget engine running according to the present invention.
Widget和 Widget源码的方法流程图, 如图 7所示, 该方法包括以下步骤: Widgetl提供接口来接收用户输入 il , Widget中的处理逻辑根据这个用 户输入得到输出结果 01、 02等; Widgetl根据输入得到输出 01 , 并将同 时得到的输出变量 01输出到 Widget引擎中的存储区; 经过聚合预处理器 处理后的 Widget源码在 Widget引擎上运行时, 使得 Widget能够从存储区 读取变量, 因此 Widget2能够从存储区中读取 Widgetl的输出变量 01作为 自身的输入;然后 Widget2输出 02并输出变量 02到 Widget引擎中的存储 区, 以此类推, 实现 Widget之间数据内容的聚合。 Widget and Widget source code method flow chart, as shown in Figure 7, the method includes the following steps: Widgetl provides an interface to receive user input il, the processing logic in the Widget obtains the output result 01, 02 according to the user input; Widgetl according to the input The output 01 is obtained, and the output variable 01 obtained at the same time is output to the storage area in the Widget engine; when the Widget source code processed by the aggregation preprocessor is run on the Widget engine, the Widget can read the variable from the storage area, so the Widget 2 The output variable 01 of Widget1 can be read from the storage area as its own input; then Widget2 outputs 02 and outputs variable 02 to the storage area in the Widget engine, and so on, to realize the aggregation of the data content between the Widgets.
Widget引擎中的存储区存储有 Widget的输出变量 01、 02... On, 并为 需要输入的 Widget提供参数, 因此, Widget间的输入和输出能够利用所述 存储区实现 Widget数据内容的交互。用户可以根据需要改变 Widget引擎中 的 Widget数量, 用户也可以根据要求来选择作为存储区的介质。 The storage area in the Widget engine stores the output variables 01, 02... On of the Widget, and provides parameters for the Widgets that need to be input, so the input and output between the Widgets can utilize the The storage area implements the interaction of the Widget data content. The user can change the number of Widgets in the Widget engine as needed, and the user can also select the media as the storage area according to the requirements.
为实现上述方法, 本发明还提供了一种聚合 Widget数据内容的系统, 如图 8所示, 该系统包括: 聚合预处理器 81、 Widget引擎 82; 其中, In order to implement the above method, the present invention further provides a system for aggregating Widget data content. As shown in FIG. 8, the system includes: an aggregation preprocessor 81, a Widget engine 82;
聚合预处理器 81 , 用于分析输入的 Widget源码, 并根据用户的选择建 立一个以上 Widget间输入输出映射关系, 生成聚合模板; 根据所述聚合模 板生成 Widget代码, 将所生成的 Widget代码插入 Widget源码; The aggregation preprocessor 81 is configured to analyze the input Widget source code, and establish an input/output mapping relationship between the Widgets according to the user's selection, to generate an aggregation template; generate a Widget code according to the aggregation template, and insert the generated Widget code into the Widget. Source code;
所述聚合预处理器 81进一步包括: 分析模块 811、 模板生成模块 812、 代码生成模块 813; 其中, The aggregation preprocessor 81 further includes: an analysis module 811, a template generation module 812, and a code generation module 813;
分析模块 811 , 用于接收 Widget引擎发送的 Widget源码和聚合模板, 并分析 Widget的输入和 Widget的输出, 最后将 Widget的输入的变量名和 Widget的输出的变量名传送给转换器。 The analysis module 811 is configured to receive the Widget source code and the aggregation template sent by the Widget engine, analyze the input of the Widget and the output of the Widget, and finally transmit the variable name of the input of the Widget and the variable name of the output of the Widget to the converter.
这里,所述转换器用于将 Widget的输入和 Widget的输出的变量名转换 成模板生成模块 812中 Widget需要的格式,经过转换器转换的 Widget的输 入的变量名和 Widget输出的变量名可以被模板生成模块 812利用。 Here, the converter is configured to convert the input of the Widget and the variable name of the output of the Widger into a format required by the Widget in the template generation module 812, and the variable name of the input of the Widget converted by the converter and the variable name output by the Widget may be generated by the template. Module 812 is utilized.
模板生成模块 812, 用于在获得分析过的 Widget的输入、 输出后, 通 过文件或者图形界面的方式向用户发送响应, 用户根据聚合预处理器发送 的响应选择需要聚合的 Widget, 并接收用户选择的更改项, 当用户选择需 要聚合 Widget的输入时,则显示已经存储的 Widget输出变量名供用户选择; 当用户选择需要聚合 Widget的输出时, 则接收用户选择的要存储的输出变 量名; 接收用户为输入变量选择的已存储的输出变量名; 根据 Widget名和 输出变量名为输出变量生成唯一的存储标识, 最后根据映射关系生成聚合 模板。 The template generating module 812 is configured to send a response to the user by using a file or a graphical interface after obtaining the input and output of the analyzed Widget, and the user selects a Widget to be aggregated according to the response sent by the aggregation preprocessor, and receives the user selection. Change item, when the user selects the input that needs to aggregate the Widget, it displays the already stored Widget output variable name for the user to select; when the user selects the output that needs to aggregate the Widget, it receives the output variable name selected by the user to be stored; The stored output variable name selected by the user for the input variable; generates a unique storage identifier according to the Widget name and the output variable name output variable, and finally generates an aggregation template according to the mapping relationship.
其中, 所述 Widget名是用户根据需求定义的 Widget引擎中 Widget的 名字, 用于区别 Widget引擎中的多个 Widget。 代码生成模板 813 , 用于分析生成的聚合模板,对聚合模板中的输出标 签对应的变量名, 根据聚合模板†<widget— 01«>标签, 在 Widget代码存储 变量;对聚合模板中的输入标签对应的变量名,根据聚合模板†<widget _in> 标签,在 Widget代码中读取存储变量; 最后将获取的全部 Widget输出的代 码, 插入到 Widget源码。 The Widget name is a name of a Widget in the Widget engine defined by the user according to the requirement, and is used to distinguish multiple Widgets in the Widget engine. The code generation template 813 is configured to analyze the generated aggregation template, and the variable name corresponding to the output label in the aggregation template, according to the aggregation template wi<widget-01«> tag, store the variable in the Widget code; input the label in the aggregation template Corresponding variable name, according to the aggregation template † <widget _in> tag, read the storage variable in the Widget code; finally, the code of all the obtained Widget output is inserted into the Widget source code.
所述 Widget引擎 82, 用于运行 Widget和 Widget源码, 并为 Widget 的输出提供存储区; The Widget engine 82 is configured to run the Widget and Widget source code, and provide a storage area for the output of the Widget;
Widget引擎进一步包括: 存储区 821、 Widget; 其中, The Widget engine further includes: a storage area 821, a Widget; wherein
存储区 821 , 用于存储 Widget的输出, 为需要输入的 Widget提供所需 变量; a storage area 821 for storing the output of the widget, and providing a required variable for the widget that needs to be input;
这里, Widget间的输入和输出能够利用所述存储区, 实现 Widget数据 内容的交; 用户可以根据需求来选择作为存储区的介质, 本实施例中选取 Cookie作为存储区介质存储 Widget的输出变量。 Here, the input and output between the widgets can utilize the storage area to implement the intersection of the Widget data content; the user can select the medium as the storage area according to the requirement. In this embodiment, the cookie is selected as the output variable of the storage area medium storage widget.
Widget, 用于提供接口来接收用户输入, Widget 中的处理逻辑根据该 用户输入得到输出结果, 并输出变量到 Widget引擎的存储区; a widget for providing an interface to receive user input, processing logic in the widget obtaining an output result according to the user input, and outputting the variable to a storage area of the Widget engine;
这里, 用户可以根据需要改变 Widget引擎中的 Widget数量。 Here, the user can change the number of widgets in the widget engine as needed.
下面结合附图来说明本发明的一个具体实施例的详细实现过程。 A detailed implementation process of a specific embodiment of the present invention will be described below with reference to the accompanying drawings.
图 9是一个聚合 Widget数据内容的具体实施例, 如图 9所示, 三个 Widget经过聚合预处理器处理后生成一个新的 Mashup应用程序, 实现了 Widget间的数据聚合。 FIG. 9 is a specific embodiment of the aggregated Widget data content. As shown in FIG. 9, three Widgets are processed by an aggregation preprocessor to generate a new Mashup application, which implements data aggregation between Widgets.
图 9中的三个 Widget是互相独立的 Widget, 图 9从左往右依次为输入 框 Widget、 地图 Widget和房产信息 Widget, 输入框 Widget的功能是输入 邮政编码后在 Widget的界面上显示该邮政编码,地图 Widget的功能是输入 邮政编码后在该 Widget的界面上显示与邮政编码相对应的地理位置的地图 和天气情况,房产信息 Widget的功能是输入城市名后该 Widget的界面上显 示该城市的房产相关信息。 The three Widgets in Figure 9 are independent Widgets. Figure 9 is the input box Widget, the map Widget and the property information Widget from left to right. The function of the input box Widget is to display the post on the Widget interface after inputting the postal code. Coding, the function of the map Widget is to display the map and the weather situation of the geographic location corresponding to the postal code on the interface of the Widget after inputting the postal code. The function of the property information Widget is to display the interface of the Widget after inputting the name of the city. Show information about the property in the city.
经过聚合预处理器处理后, 三个 Widget实现了数据内容的聚合, 聚合 后实现的功能是在输入框 Widget中输入邮政编码,该 Widget界面上显示邮 政编码, 同时地图 Widget上显示和该邮政编码相应的地理位置的地图和天 气预报, 房产信息 Widget上显示该地理位置相应城市的房产信息列表。 After being processed by the aggregation preprocessor, the three Widgets implement the aggregation of the data content. The function realized after the aggregation is to input the zip code in the input box Widget, the zip code is displayed on the Widget interface, and the zip code is displayed on the map Widget. The map of the corresponding geographic location and the weather forecast, the property information Widget shows a list of real estate information for the corresponding city in the geographic location.
下面按步骤描述聚合预处理器是如何处理这三个 Widget代码的, 具体 的, The following steps describe how the aggregation preprocessor handles these three widgets. Specifically,
第一步, 聚合预处理器分析 Widget的输入、 输出; 输入框 Widget、 地 图 Widget和房产信息 Widget的输入、 输出分析结果如下: In the first step, the aggregation preprocessor analyzes the input and output of the Widget; the input box Widget, the map Widget, and the property information Widget input and output analysis results are as follows:
Widget name: Input initial input:zipcode output:zipcode Widget name: Input initial input: zipcode output: zipcode
Widget name: Weather Map input:zipcode map output:cityname Widget name: Weather Map input:zipcode map output:cityname
Widget name:Real Estate input:city output: real estate infolist Widget name:Real Estate input:city output: real estate infolist
第二步, 聚合预处理器根据第一步的 Widget输入、 输出, 选择建立输 入、 输出映射关系, 生成聚合模板。 In the second step, the aggregation preprocessor selects the input and output mapping relationships according to the Widget input and output of the first step to generate an aggregation template.
本实施例中, 用户选择 Widget输入时, Widget ( Input— initial ) 的输出 邮政编码 ( zipcode ) 作为地图 Widget ( Weather Map ) 的输入邮政编码 ( zipcode map ), 地图 Widget ( Weather Map ) 的输出城市名 ( cityname ) 作为房产信息列表 Widget的输入城市名 (city ), 使用下面的聚合模板来表 示三者之间的数据内容聚合关系: In this embodiment, when the user selects the Widget input, the output zip code of the Widget (Input-initial) is used as the input zip code map of the map Widget (Weather Map), and the output city name of the map Widget (Weather Map). ( cityname ) As the input city name (city ) of the property information list Widget, use the following aggregation template to represent the data content aggregation relationship between the three:
<mashup> <mashup>
<widget_out name=Input_initial> <widget_out name=Input_initial>
<output name=zipcode> <output name=zipcode>
</output> </output>
</widget_out> </widget_out>
<widget in name= Weather Map> <widget in name= Weather Map>
<input name=zipcode_map> <input name=zipcode_map>
</input> </widget_in> </input> </widget_in>
</mashup> </mashup>
<mashup> <mashup>
<widget_out name= Weather Map> <widget_out name= Weather Map>
<output name=cityname> <output name=cityname>
</output> </output>
</widget_out> </widget_out>
<widget_in name=Real Estate> <widget_in name=Real Estate>
<input name=city> <input name=city>
</input> </input>
<widget_in> <widget_in>
</mashup> </mashup>
第三步,聚合预处理器根据第二步中形成的聚合模板生成 Widget代码, 并将代码插入 Widget源码。 In the third step, the aggregation preprocessor generates Widget code according to the aggregation template formed in the second step, and inserts the code into the Widget source code.
以上所述, 仅为本发明的较佳实施例而已, 并非用于限定本发明的保 护范围, 凡在本发明的精神和原则之内所作的任何修改、 等同替换和改进 等, 均应包含在本发明的保护范围之内。 The above description is only for the preferred embodiment of the present invention, and is not intended to limit the scope of the present invention. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included. Within the scope of protection of the present invention.
Claims
Applications Claiming Priority (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201010001201.5 | 2010-01-04 | ||
| CN201010001201.5A CN101794240B (en) | 2010-01-04 | 2010-01-04 | Method and system for aggregating data content |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| WO2011079619A1 true WO2011079619A1 (en) | 2011-07-07 |
Family
ID=42586950
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| PCT/CN2010/076210 Ceased WO2011079619A1 (en) | 2010-01-04 | 2010-08-20 | Method and system for aggregating data |
Country Status (2)
| Country | Link |
|---|---|
| CN (1) | CN101794240B (en) |
| WO (1) | WO2011079619A1 (en) |
Families Citing this family (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN101794240B (en) * | 2010-01-04 | 2015-01-28 | 中兴通讯股份有限公司 | Method and system for aggregating data content |
| CN103092582B (en) * | 2011-10-31 | 2016-01-20 | 国际商业机器公司 | For the treatment of the method and system of the event of issue with the event of subscription |
| CN103455459A (en) * | 2012-05-31 | 2013-12-18 | 国际商业机器公司 | Method and system for transmitting payload data to iWidget |
| CN102866911B (en) * | 2012-09-12 | 2015-03-25 | 北京航空航天大学 | Mashup application establishing method and device |
| CN110874216B (en) * | 2018-08-31 | 2023-07-28 | 广州虎牙信息科技有限公司 | Complete code generation method, device, equipment and storage medium |
Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20080168382A1 (en) * | 2007-01-07 | 2008-07-10 | Louch John O | Dashboards, Widgets and Devices |
| US20090100329A1 (en) * | 2007-10-04 | 2009-04-16 | Danny Javier Espinoza | Method of Deploying a Web Widget In a Desktop Widget Platform |
| CN101533410A (en) * | 2009-04-13 | 2009-09-16 | 浙江大学 | Widget content buffering method facing mobile terminal |
| CN101794240A (en) * | 2010-01-04 | 2010-08-04 | 中兴通讯股份有限公司 | Method and system for aggregating data content |
-
2010
- 2010-01-04 CN CN201010001201.5A patent/CN101794240B/en active Active
- 2010-08-20 WO PCT/CN2010/076210 patent/WO2011079619A1/en not_active Ceased
Patent Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20080168382A1 (en) * | 2007-01-07 | 2008-07-10 | Louch John O | Dashboards, Widgets and Devices |
| US20090100329A1 (en) * | 2007-10-04 | 2009-04-16 | Danny Javier Espinoza | Method of Deploying a Web Widget In a Desktop Widget Platform |
| CN101533410A (en) * | 2009-04-13 | 2009-09-16 | 浙江大学 | Widget content buffering method facing mobile terminal |
| CN101794240A (en) * | 2010-01-04 | 2010-08-04 | 中兴通讯股份有限公司 | Method and system for aggregating data content |
Also Published As
| Publication number | Publication date |
|---|---|
| CN101794240A (en) | 2010-08-04 |
| CN101794240B (en) | 2015-01-28 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US10462222B2 (en) | Cloud storage methods and systems | |
| CN104216691B (en) | A kind of method and device for creating application | |
| KR101409673B1 (en) | Persistent saving portal | |
| CN104484216B (en) | Service interface document and on-line testing instrument generation method, device | |
| JP2020194567A (en) | Methods and systems for web content generation | |
| CN103077185B (en) | A kind of method of object-based self-defined extension information | |
| US20170212737A1 (en) | Methods and systems for generating application programming interfaces | |
| US20190129734A1 (en) | Data collection workflow extension | |
| US8209355B2 (en) | Automatic user interface generation for entity interaction | |
| US20100211580A1 (en) | Semantics-based data transformation over a wire in mashups | |
| US20160124914A1 (en) | Page Processing for Mobile App | |
| CN104424232B (en) | A kind of webpage label method and apparatus | |
| CN101946248A (en) | Method and apparatus for providing API service and making API mash-up, and computer readable recording medium thereof | |
| CN103617505B (en) | The dynamic analysis and display systems and method of corporate process figure | |
| JP2009543166A (en) | Computer-implemented method, computer program, and data processing system for defining page layout by page | |
| JP2009543167A (en) | Computer-implemented method, computer program, and data processing system for inheriting page layout for a page | |
| CN104025078A (en) | Mobile solution for signing and retaining third-party documents | |
| CN116980371A (en) | interactive information interface | |
| CN102385580A (en) | Method and device for customizing webpage contents | |
| US20150074127A1 (en) | Creating Visualizations from Data in Electronic Documents | |
| JP2009054151A (en) | Communication message instance input method, data instance input method, communication message instance input device, and computer-readable medium | |
| CN102693127A (en) | Data-driven schema for describing and executing management tasks in a graphical user interface | |
| WO2011079619A1 (en) | Method and system for aggregating data | |
| CN115131470A (en) | A kind of graphic material synthesis method, device, electronic device and storage medium | |
| US9262550B2 (en) | Processing semi-structured data |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| 121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 10840408 Country of ref document: EP Kind code of ref document: A1 |
|
| NENP | Non-entry into the national phase |
Ref country code: DE |
|
| 122 | Ep: pct application non-entry in european phase |
Ref document number: 10840408 Country of ref document: EP Kind code of ref document: A1 |