WO2018176814A1 - Personalized component implementation method and device - Google Patents

Personalized component implementation method and device Download PDF

Info

Publication number
WO2018176814A1
WO2018176814A1 PCT/CN2017/107053 CN2017107053W WO2018176814A1 WO 2018176814 A1 WO2018176814 A1 WO 2018176814A1 CN 2017107053 W CN2017107053 W CN 2017107053W WO 2018176814 A1 WO2018176814 A1 WO 2018176814A1
Authority
WO
WIPO (PCT)
Prior art keywords
component
code
interface
personalized
user
Prior art date
Application number
PCT/CN2017/107053
Other languages
French (fr)
Chinese (zh)
Inventor
刘富龙
陈少杰
张文明
Original Assignee
武汉斗鱼网络科技有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 武汉斗鱼网络科技有限公司 filed Critical 武汉斗鱼网络科技有限公司
Publication of WO2018176814A1 publication Critical patent/WO2018176814A1/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/38Creation or generation of source code for implementing user interfaces

Definitions

  • the present invention relates to the field of Internet technologies, and in particular, to a method and an apparatus for implementing a personalized component.
  • the present invention has been made in order to provide a method and apparatus for implementing a personalized component that overcomes the above problems or at least partially solves the above problems.
  • a personalized component implementation method including: customizing a component interface, and providing a personalized component interface to a user by exposing an API; and receiving a user input component through a personalized component interface Content code; compiles the component content code to obtain a personalized component corresponding to the component content code input by the user.
  • the personalized component interface includes one or more of an HTML interface, a CSS interface, and a Javascript interface; the component content code includes one or more of HTML code, CSS code, and Javascript code.
  • the method further comprises: scrambling the component content code input by the user into an unordered character string, thereby performing confusion confusion on the component content code; and using an encoding algorithm to perform encoding operation on the obfuscated data.
  • the method further comprises: storing the encoded data into a database, and, when generating the page, extracting the data content from the database and performing decoding processing.
  • the method further comprises: performing an exception capture on the component content code input by the user; and removing the code having the exception from the component content code.
  • a personalized component implementing apparatus including: a personalized component interface unit, configured to customize a personalized component interface, and provide a personalized component interface to the user by exposing an API;
  • the code obtaining unit is configured to receive the component content code input by the user through the personalized component interface, and the encoding processing unit is configured to compile the component content code to obtain a personalized component corresponding to the component content code input by the user.
  • the personalized component interface includes one or more of an HTML interface, a CSS interface, and a Javascript interface; the component content code includes one or more of HTML code, CSS code, and Javascript code.
  • the device further includes: a confusion scrambling processing unit, scrambling the component content code input by the user into an unordered character string, thereby performing confusion confusion on the component content code; wherein the encoding processing unit is configured to Confusing the disturbed data using an encoding algorithm for encoding operations.
  • a confusion scrambling processing unit scrambling the component content code input by the user into an unordered character string, thereby performing confusion confusion on the component content code
  • the encoding processing unit is configured to Confusing the disturbed data using an encoding algorithm for encoding operations.
  • the device further includes: the decoding processing unit is configured to: when generating the page, extract the data content from the database pre-stored with the encoded data and perform decoding processing.
  • the decoding processing unit is configured to: when generating the page, extract the data content from the database pre-stored with the encoded data and perform decoding processing.
  • the device further comprises: an exception capture unit configured to perform an exception capture on the component content code input by the user; and, culling the code having the exception from the component content code.
  • an exception capture unit configured to perform an exception capture on the component content code input by the user; and, culling the code having the exception from the component content code.
  • the embodiment of the present invention implements a solution by using a personalized component, which enables a page developer to directly input component code, and create a new personalized component (that is, a general abstract component that the platform cannot provide) anytime and anywhere, which can effectively reduce the developer's
  • a personalized component that is, a general abstract component that the platform cannot provide
  • FIG. 1 is a flowchart of a personalized page generation method according to an embodiment of the present invention
  • FIG. 2 is a schematic diagram of a method for generating a personalized page according to an embodiment of the present invention
  • FIG. 3 is a flowchart of a method for implementing a personalized component according to an embodiment of the present invention
  • FIG. 4 is a schematic structural diagram of a personalized page generating apparatus according to an embodiment of the present invention.
  • FIG. 5 is a schematic structural diagram of a personalized component implementing apparatus according to an embodiment of the present invention.
  • the present invention provides a personalized page generation method, which can effectively reduce the communication cost between developers and enhance self-service.
  • the construction efficiency of the platform is a personalized page generation method, which can effectively reduce the communication cost between developers and enhance self-service.
  • FIG. 1 is a flowchart of a method for generating a personalized page according to an embodiment of the present invention, where the method includes steps S101-S104.
  • S101 Providing a personalized component interface to the user, and receiving the component content code input by the user through the personalized component interface.
  • HTML Hyper Text Markup Language, hypertext markup language
  • CSS CSS
  • Javascript used to write the behavior of components.
  • the personalization component interface includes one or more of an HTML interface, a CSS interface, and a Javascript interface; the component content code includes one or more of HTML code, CSS code, and Javascript code.
  • the personalized component provided can enable the user (page developer) to arbitrarily input HTML, CSS, and JavaScript.
  • the page developer can use any of the personalized components provided by the present invention to perform any function development, and is not limited to the existing components of the self-service website platform.
  • the present invention aims to provide other functional components while the self-service platform is provided, and only needs to provide a personalized component (custom component), the content of the component (ie, the HTML code of the input component, CSS code). , JavaScript code) are written by the activity topic page developers, you can temporarily complete a custom personalized component. Because of the non-reusability of personalized components, component developers are not required to re-develop personalized components, and only the active topic page developers use custom code to customize the individual requirements.
  • Providing a personalized component interface to the user can be achieved by exposing the API, for example, exposing three interfaces that are custom input and configured by the active feature page developer; in one specific example, three available feature pages
  • the interfaces configured by the developer are: HTML interface, CSS interface, and JavaScript interface. Because each platform exposes component API interfaces in different ways, this article does not specifically limit this.
  • the component content code may be abnormally captured, and the abnormal code may be culled, thereby improving the accuracy of the code subsequent processing.
  • try ⁇ catch(e) ⁇ method provided by all major browser vendors to render the code input by the developer to try ⁇
  • the browser will intercept it and input the error message into catch(e) ⁇ error message ⁇ .
  • the following code can be used to achieve exception capture.
  • S102 Encode the component content code, and store the processed data content into a database.
  • the component content code input by the user may be scrambled into an unordered string to confuse the component content code; and the encoding algorithm is used to confuse the scrambled data. Perform the encoding operation.
  • SetState is a general method provided by JavaScript to save to the database.
  • htmlStr Here is the html code entered by the user.
  • S104 Render the decoded data content to the page to obtain a personalized page corresponding to the component content code input by the user.
  • Rendering the decompiled data content to the page presents a custom effect of the code entered by the developer.
  • FIG. 2 it is a schematic diagram corresponding to an example of the method of FIG. 1.
  • the user is first provided with a personalized component interface by exposing the API; then, the component content code input by the user is received through the personalized component interface, ie, the HTML code, the CSS code, and/or the JavaScript code are obtained; and then, the HTML is The code, CSS code, and/or JavaScript code are encoded and stored in the database; when the page is to be generated, the HTML code, CSS code, and/or JavaScript code are taken out for pre-rendering, and the fetched code is decoded; finally, the code is decoded The rendered data is rendered to the page to present a personalized page.
  • a typical application scenario of the solution of the present invention is: when a web developer uses a self-service website to build a platform, a simple topic page can be quickly constructed, but when it is encountered with more complicated or with the background In order to interact with some activity topic pages of data, the general self-service platform can't solve this problem.
  • page developers and platform developers need to negotiate. How to provide platform developers with a special component to complete the construction of complex topic pages is a technical requirement.
  • a special component cannot be abstracted and universally used, that is, it cannot be reused to other functions, and during the development, some communication costs, development costs of the platform developer, unnecessary operating costs, and the like are generated.
  • the platform developer provides a personalized component such as the one provided by the present invention
  • a personalized component such as the one provided by the present invention
  • the personalized page generation solution can enable the page developer to directly input the component code, and create a new personalized component (that is, a general abstract component that the platform cannot provide) anytime and anywhere, which can effectively reduce the developer's
  • the cost of communication between the two can increase the efficiency of building a self-service platform.
  • the embodiment of the invention further provides a method for implementing a personalized component.
  • a flowchart of a method for implementing a personalized component according to an embodiment of the present invention includes steps S301-S303.
  • S301 Customize the component interface and provide a personalized component interface to the user by exposing the API.
  • any functional component is composed of HTML, CSS, and JavaScript.
  • HTML Hyper Text Markup Language
  • CSS CSS
  • Javascript The behavior of writing components.
  • the personalization component interface includes one or more of an HTML interface, a CSS interface, and a Javascript interface; the component content code includes one or more of HTML code, CSS code, and Javascript code.
  • the personalized component provided can enable the user (page developer) to arbitrarily input HTML, CSS, and JavaScript.
  • the page developer can use any of the personalized components provided by the present invention to perform any function development, and is not limited to the existing components of the self-service website platform.
  • the present invention aims to provide the same functional components of the self-service platform.
  • the content of the component (that is, the HTML code of the input component, CSS code, JavaScript code) is written by the activity profile page developer, which can be temporarily fast.
  • Complete a custom personalized component Because of the non-reusability of personalized components, component developers are not required to re-develop personalized components, and only the active topic page developers use custom code to customize the individual requirements.
  • Providing a personalized component interface to the user can be achieved by exposing the API, for example, exposing three interfaces that are custom input and configured by the active feature page developer; in one specific example, three available feature pages
  • the interfaces configured by the developer are: HTML interface, CSS interface, and JavaScript interface. Because each platform exposes component API interfaces in different ways, this article does not specifically limit this.
  • S302 Receive a component content code input by a user through a personalized component interface
  • the component content code may be abnormally captured, and the abnormal code may be culled, thereby improving the accuracy of the code subsequent processing.
  • try ⁇ catch(e) ⁇ method provided by all major browser vendors to render the code input by the developer to try ⁇
  • the browser will intercept it and input the error message into catch(e) ⁇ error message ⁇ .
  • the following code can be used to achieve exception capture.
  • S303 Compile and process the component content code to obtain a personalized component corresponding to the component content code input by the user.
  • the component content code input by the user may be scrambled into an unordered string to confuse the component content code; and the encoding algorithm is used to confuse the scrambled data. Perform the encoding operation.
  • SetState is a general method provided by JavaScript to save to the database.
  • htmlStr Here is the html code entered by the user.
  • the method further comprises: storing the encoded data into the database, and, when generating the page, extracting and decoding the data content from the database. deal with.
  • the decoded data content is rendered to the page, resulting in a personalized page corresponding to the component content code entered by the user. Rendering the decompiled data content to the page presents a custom effect of the code entered by the developer.
  • the present invention also provides a personalized page generating apparatus.
  • FIG. 4 it is a schematic structural diagram of a personalized page generating apparatus.
  • the device includes:
  • the code obtaining unit 401 is configured to provide a personalized component interface to the user, and receive the component content code input by the user through the personalized component interface;
  • the encoding processing unit 402 is configured to perform encoding processing on the component content code, and store the processed data content into a database;
  • a decoding processing unit 403 configured to take out data content from a database, and perform decoding processing
  • the rendering unit 404 is configured to render the decoded data content to the page to obtain a personalized page corresponding to the component content code input by the user.
  • the personalized component interface includes one or more of an HTML interface, a CSS interface, and a Javascript interface; the component content code includes one or more of HTML code, CSS code, and Javascript code.
  • the apparatus further includes: a confusion scrambling processing unit 405, scrambling the component content code input by the user into an unordered character string, thereby performing confusion confusion on the component content code; wherein the encoding processing unit 402 is configured to: The encoding algorithm is used to encode the data after the confusion is disturbed.
  • the decoding processing unit 403 is specifically configured to perform a decoding operation on the data content extracted from the database by using a decoding algorithm corresponding to the encoding algorithm.
  • the apparatus further includes: an exception capture unit 406 for performing an exception capture on the component content code input by the user; and removing the code having the exception from the component content code.
  • an exception capture unit 406 for performing an exception capture on the component content code input by the user; and removing the code having the exception from the component content code.
  • the present invention also provides a personalized component implementing apparatus.
  • FIG. 5 a structural diagram of a device for implementing a personalized component is shown.
  • the device includes:
  • the personalization component interface unit 501 is configured to customize the personalized component interface, and provide a personalized component interface to the user by exposing the API;
  • the code obtaining unit 502 is configured to receive, by using the personalized component interface, a component content code input by the user;
  • the encoding processing unit 503 is configured to perform a compiling process on the component content code to obtain a personalized component corresponding to the component content code input by the user.
  • the personalized component interface includes one or more of an HTML interface, a CSS interface, and a Javascript interface; the component content code includes one or more of HTML code, CSS code, and Javascript code.
  • the apparatus further includes: a confusion scrambling processing unit 504, scrambling the component content code input by the user into an unordered character string, thereby performing confusion confusion on the component content code; wherein the encoding processing unit 503 is configured to: The encoding algorithm is used to encode the data after the confusion is disturbed.
  • the decoding processing unit 505 is specifically configured to: when generating the page, extract the data content from the database pre-stored with the encoded data and perform decoding processing.
  • the device further comprises: an exception capture unit 506 for performing an exception capture on the component content code input by the user; and removing the code with the exception from the component content code.
  • an exception capture unit 506 for performing an exception capture on the component content code input by the user; and removing the code with the exception from the component content code.
  • the various component embodiments of the present invention may be implemented in hardware, or in a software module running on one or more processors, or in a combination thereof.
  • a microprocessor or digital signal processor may be used in practice to implement some or all of the functionality of some or all of the components of the user morphing control system in accordance with embodiments of the present invention.
  • the invention can also be implemented as a device or device program (e.g., a computer program and a computer program product) for performing some or all of the methods described herein.
  • a program implementing the invention may be stored on a computer readable medium or may be in the form of one or more signals. Such signals may be downloaded from an Internet website, provided on a carrier signal, or provided in any other form.

Abstract

A personalized component implementation method and device. The method comprises: customizing a personalized component interface, and providing the personalized component interface for a user by exposing an API (S301); receiving, by means of the personalized component interface, a component content code input by the user (S302); and performing compiling processing on the component content code to obtain a personalized component corresponding to the component content code input by the user (S303). The method and device can improve the efficiency of constructing a personalized page and website.

Description

个性化组件实现方法及装置Personalized component realization method and device 技术领域Technical field
本发明涉及互联网技术领域,具体涉及一种个性化组件实现方法及装置。The present invention relates to the field of Internet technologies, and in particular, to a method and an apparatus for implementing a personalized component.
背景技术Background technique
随着互联网的发展,门户网站、电子商务网站、直播网站等各类网站层出不穷,各类公司业务的迅速发展,随之产生了大量活动专题页面的需求用于吸引公司用户,许多公司提出了自助式的建站平台。在自助式建站平台中,组件开发人员向平台提供工具(模板或组件)。活动专题页开发人员可根据提供的工具(模板或组件),快速的开发出质量较高的活动专题页。With the development of the Internet, various websites such as portal websites, e-commerce websites, and live broadcast websites have emerged in an endless stream. The rapid development of various types of company business has resulted in a large number of activity topic pages for attracting corporate users. Many companies have proposed self-help. Construction platform. In a self-service platform, component developers provide tools (templates or components) to the platform. Activity profile page developers can quickly develop high-quality event profiles based on the tools (templates or components) provided.
但是由于业务需求较灵活,而平台所提供的组件都是基于已有的组件库及可通用的抽象组件,从而导致无法搭建个性化的页面。However, because the business requirements are more flexible, the components provided by the platform are based on the existing component libraries and common abstract components, which makes it impossible to build personalized pages.
如果要搭建个性化页面,需要平台开发人员调研并开发。针对个性化的需求,不能够抽象为普通组件时,需要组件开发人员开发一种个性化组件。而个性化组件,通常又不能复用于其他需求或个性化需求。开发时间成本较高,并导致建站平台的灵活性较差。If you want to build a personalized page, you need to research and develop it. Component developers need to develop a personalized component when it is not abstracted into common components for individual needs. Personalized components are often not reused for other needs or individual needs. The development time is high and the flexibility of the platform is poor.
发明内容Summary of the invention
鉴于上述问题,提出了本发明以便提供一种克服上述问题或者至少部分地解决上述问题的个性化组件实现方法及装置。In view of the above problems, the present invention has been made in order to provide a method and apparatus for implementing a personalized component that overcomes the above problems or at least partially solves the above problems.
依据本发明的一个方面,提供一种个性化组件实现方法,包括:自定义个性化组件接口,并通过暴露API的方式,向用户提供个性化组件接口;通过个性化组件接口接收用户输入的组件内容代码;对组件内容代码进行编译处理,得到与用户输入的组件内容代码对应的个性化组件。According to an aspect of the present invention, a personalized component implementation method is provided, including: customizing a component interface, and providing a personalized component interface to a user by exposing an API; and receiving a user input component through a personalized component interface Content code; compiles the component content code to obtain a personalized component corresponding to the component content code input by the user.
优选的,所述个性化组件接口包括HTML接口、CSS接口和Javascript接口中的一个或多个;所述组件内容代码包括HTML代码、CSS代码和Javascript代码中的一种或多种。 Preferably, the personalized component interface includes one or more of an HTML interface, a CSS interface, and a Javascript interface; the component content code includes one or more of HTML code, CSS code, and Javascript code.
优选的,还包括:将用户输入的组件内容代码打乱成无序的字符串,从而对组件内容代码进行混淆扰乱;对混淆扰乱后的数据采用编码算法进行编码操作。Preferably, the method further comprises: scrambling the component content code input by the user into an unordered character string, thereby performing confusion confusion on the component content code; and using an encoding algorithm to perform encoding operation on the obfuscated data.
优选的,还包括:将编码的的数据存入到数据库中,以及,在生成页面时,从数据库中取出数据内容并进行解码处理。Preferably, the method further comprises: storing the encoded data into a database, and, when generating the page, extracting the data content from the database and performing decoding processing.
优选的,所述方法还包括:对用户输入的组件内容代码进行异常捕获;从所述组件内容代码中剔除有异常的代码。Preferably, the method further comprises: performing an exception capture on the component content code input by the user; and removing the code having the exception from the component content code.
依据本发明的另一方面,还提供一种个性化组件实现装置,包括:个性化组件接口单元,用于自定义个性化组件接口,并通过暴露API的方式,向用户提供个性化组件接口;代码获取单元,用于通过个性化组件接口接收用户输入的组件内容代码;编码处理单元,用于对组件内容代码进行编译处理,得到与用户输入的组件内容代码对应的个性化组件。According to another aspect of the present invention, a personalized component implementing apparatus is further provided, including: a personalized component interface unit, configured to customize a personalized component interface, and provide a personalized component interface to the user by exposing an API; The code obtaining unit is configured to receive the component content code input by the user through the personalized component interface, and the encoding processing unit is configured to compile the component content code to obtain a personalized component corresponding to the component content code input by the user.
优选的,所述个性化组件接口包括HTML接口、CSS接口和Javascript接口中的一个或多个;所述组件内容代码包括HTML代码、CSS代码和Javascript代码中的一种或多种。Preferably, the personalized component interface includes one or more of an HTML interface, a CSS interface, and a Javascript interface; the component content code includes one or more of HTML code, CSS code, and Javascript code.
优选的,所述装置还包括:混淆扰乱处理单元,将用户输入的组件内容代码打乱成无序的字符串,从而对组件内容代码进行混淆扰乱;其中,所述编码处理单元,用于对混淆扰乱后的数据采用编码算法进行编码操作。Preferably, the device further includes: a confusion scrambling processing unit, scrambling the component content code input by the user into an unordered character string, thereby performing confusion confusion on the component content code; wherein the encoding processing unit is configured to Confusing the disturbed data using an encoding algorithm for encoding operations.
优选的,所述装置还包括:所述解码处理单元具体用于,在生成页面时,从预先存入编码数据的数据库中取出数据内容并进行解码处理。Preferably, the device further includes: the decoding processing unit is configured to: when generating the page, extract the data content from the database pre-stored with the encoded data and perform decoding processing.
优选的,所述装置还包括:异常捕获单元,用于对用户输入的组件内容代码进行异常捕获;以及,从组件内容代码中剔除有异常的代码。Preferably, the device further comprises: an exception capture unit configured to perform an exception capture on the component content code input by the user; and, culling the code having the exception from the component content code.
可见,本发明实施例通过个性化组件实现方案,可以使得页面开发人员直接输入组件代码,随时随地的创建新个性化组件(即平台无法提供的通用抽象组件),不但能够有效的降低开发人员之间的沟通成本,并且可以提升自助式建站平台的构建效率。It can be seen that the embodiment of the present invention implements a solution by using a personalized component, which enables a page developer to directly input component code, and create a new personalized component (that is, a general abstract component that the platform cannot provide) anytime and anywhere, which can effectively reduce the developer's The cost of communication between the two can increase the efficiency of building a self-service platform.
上述说明仅是本发明技术方案的概述,为了能够更清楚了解本发明的技术手段,而可依照说明书的内容予以实施,并且为了让本发明的上述和其它目的、 特征和优点能够更明显易懂,以下特举本发明的具体实施方式。The above description is merely an overview of the technical solutions of the present invention, and can be implemented in accordance with the contents of the specification in order to more clearly understand the technical means of the present invention, and in order to achieve the above and other objects of the present invention, The features and advantages are more apparent and understood, and specific embodiments of the invention are described below.
附图说明DRAWINGS
通过阅读下文优选实施方式的详细描述,各种其他的优点和益处对于本领域普通技术人员将变得清楚明了。附图仅用于示出优选实施方式的目的,而并不认为是对本发明的限制。而且在整个附图中,用相同的参考符号表示相同的部件。在附图中:Various other advantages and benefits will become apparent to those skilled in the art from a The drawings are only for the purpose of illustrating the preferred embodiments and are not to be construed as limiting. Throughout the drawings, the same reference numerals are used to refer to the same parts. In the drawing:
图1示出了根据本发明的一个实施例提供的个性化页面生成方法流程图;FIG. 1 is a flowchart of a personalized page generation method according to an embodiment of the present invention;
图2示出了根据本发明一个实施例提供的个性化页面生成方法示意图;FIG. 2 is a schematic diagram of a method for generating a personalized page according to an embodiment of the present invention; FIG.
图3示出了根据本发明的一个实施例提供的个性化组件实现方法流程图;FIG. 3 is a flowchart of a method for implementing a personalized component according to an embodiment of the present invention;
图4示出了根据本发明的一个实施例提供的个性化页面生成装置结构示意图;FIG. 4 is a schematic structural diagram of a personalized page generating apparatus according to an embodiment of the present invention;
图5示出了根据本发明的一个实施例提供的个性化组件实现装置结构示意图。FIG. 5 is a schematic structural diagram of a personalized component implementing apparatus according to an embodiment of the present invention.
具体实施方式detailed description
下面将参照附图更详细地描述本公开的示例性实施例。虽然附图中显示了本公开的示例性实施例,然而应当理解,可以以各种形式实现本公开而不应被这里阐述的实施例所限制。相反,提供这些实施例是为了能够更透彻地理解本公开,并且能够将本公开的范围完整的传达给本领域的技术人员。Exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While the embodiments of the present invention have been shown in the drawings, the embodiments Rather, these embodiments are provided so that this disclosure will be more fully understood and the scope of the disclosure will be fully disclosed.
为了解决现有的自助式建站平台中,当遇到个性化需求无法快速搭建页面的问题,本发明提供一种个性化页面生成方法,能够有效的降低开发人员之间的沟通成本,提升自助式建站平台的构建效率。In order to solve the problem that the existing self-service website platform cannot meet the requirements of individualization, the present invention provides a personalized page generation method, which can effectively reduce the communication cost between developers and enhance self-service. The construction efficiency of the platform.
参见图1,为本发明实施例提供的一种个性化页面生成方法流程图,该方法包括步骤S101-S104。FIG. 1 is a flowchart of a method for generating a personalized page according to an embodiment of the present invention, where the method includes steps S101-S104.
S101:向用户提供个性化组件接口,并通过个性化组件接口接收用户输入的组件内容代码。S101: Providing a personalized component interface to the user, and receiving the component content code input by the user through the personalized component interface.
本领域技术人员了解,任何功能组件都是由HTML,CSS,JavaScript构成。其中,具体可以针对不同代码编写组件的不同内容:HTML(Hyper Text Markup  Language,超文本标记语言):用于编写组件的结构;CSS(Cascading Style Sheets):用于编写组件的样式;Javascript:用于编写组件的行为。Those skilled in the art understand that any functional component is composed of HTML, CSS, and JavaScript. Among them, you can write different content of components for different code: HTML (Hyper Text Markup Language, hypertext markup language): used to write the structure of components; CSS (Cascading Style Sheets): used to write the style of components; Javascript: used to write the behavior of components.
因此,在一种优选方式中,个性化组件接口包括HTML接口、CSS接口和Javascript接口中的一个或多个;组件内容代码包括HTML代码、CSS代码和Javascript代码中的一种或多种。可见,本发明方案中,提供的个性化组件可以使得用户(页面开发者)任意输入HTML、CSS、JavaScript。页面开发者使用本发明提供的个性化组件,可以完成任意功能开发,不受限于自助式建站平台的现有组件。Accordingly, in a preferred form, the personalization component interface includes one or more of an HTML interface, a CSS interface, and a Javascript interface; the component content code includes one or more of HTML code, CSS code, and Javascript code. It can be seen that, in the solution of the present invention, the personalized component provided can enable the user (page developer) to arbitrarily input HTML, CSS, and JavaScript. The page developer can use any of the personalized components provided by the present invention to perform any function development, and is not limited to the existing components of the self-service website platform.
基于此种方案下,本发明旨在自助式建站平台提供了其他功能组件的同时,只需另外提供一种个性化组件(自定义组件),组件的内容(即输入组件的HTML代码、CSS代码、JavaScript代码)皆由活动专题页开发人员自行配置编写,即可临时的快速的完成一个自定义的个性化组件。因为个性化组件的不可复用性,无须组件开发人员进行重新开发个性化组件,只需要活动专题页开发人员使用自定义代码,即可完成个性化需求的定制。Based on such a scheme, the present invention aims to provide other functional components while the self-service platform is provided, and only needs to provide a personalized component (custom component), the content of the component (ie, the HTML code of the input component, CSS code). , JavaScript code) are written by the activity topic page developers, you can temporarily complete a custom personalized component. Because of the non-reusability of personalized components, component developers are not required to re-develop personalized components, and only the active topic page developers use custom code to customize the individual requirements.
向用户提供个性化组件接口,可通过暴露API的方式实现,例如,暴露出三个接口,接口由活动专题页开发人员自定义输入并配置;在一个具体例子中,三个可供活动专题页开发人员配置的接口分别为:HTML接口,CSS接口,JavaScript接口。因为每个平台暴露组件API接口的方式各不相同,本文对此不作具体限制。Providing a personalized component interface to the user can be achieved by exposing the API, for example, exposing three interfaces that are custom input and configured by the active feature page developer; in one specific example, three available feature pages The interfaces configured by the developer are: HTML interface, CSS interface, and JavaScript interface. Because each platform exposes component API interfaces in different ways, this article does not specifically limit this.
如果将开发人员输入的所有自定义代码直接渲染至页面上,是有风险的,如果出现任何报错,很有可能影响建站平台执行结果。基于此种风险,需要在对代码进行后续的反编译输出至页面上之前,对其进行异常捕获。因此,在一个优选方式中,通过个性化组件接口接收用户输入的组件内容代码过程中,可以对组件内容代码进行异常捕获,并将异常代码剔除掉,从而提高代码后续处理的准确度。If all the custom code input by the developer is directly rendered to the page, it is risky. If any error occurs, it is likely to affect the execution result of the website. Based on this risk, the code needs to be captured for exception before it is subsequently decompiled and output to the page. Therefore, in a preferred manner, during the process of receiving the component content code input by the user through the personalized component interface, the component content code may be abnormally captured, and the abnormal code may be culled, thereby improving the accuracy of the code subsequent processing.
例如,对于JavaScript代码,更有必有进行异常捕获。因为,浏览器在渲染页面时,是单线程的加载页面,在将用户的代码渲染至页面时,如果用户的代码输入有误,线程产生阻塞,导致页面无法正常加载,便会影响到自助式建站平台的其他功能运转,所以要对其进行异常捕获,即当开发者输入的代码, 有报错时。将其拦截,让其不至于影响到其他功能的运转,例如,在此可以使用各大浏览器厂商统一提供的try{}catch(e){}方法,将开发者输入的代码渲染至try{用户代码}模块中,如果try{}中的代码报错,那么浏览器就会将其拦截,并将报错信息输入到catch(e){报错信息}中。),具体的,可以采用下述代码来实现异常捕获。For example, for JavaScript code, there is a need for exception catching. Because, when the browser renders the page, it is a single-threaded loading page. When the user's code is rendered to the page, if the user's code input is wrong, the thread is blocked, and the page cannot be loaded normally, which will affect the self-service. The other functions of the platform are working, so you need to catch it abnormally, that is, when the developer enters the code, When there is an error. Intercept it so that it doesn't affect the operation of other functions. For example, you can use the try{}catch(e){} method provided by all major browser vendors to render the code input by the developer to try{ In the user code} module, if the code in try{} reports an error, the browser will intercept it and input the error message into catch(e){error message}. ), specifically, the following code can be used to achieve exception capture.
Figure PCTCN2017107053-appb-000001
Figure PCTCN2017107053-appb-000001
S102:对组件内容代码进行编码处理,并将处理过的数据内容存入到数据库。S102: Encode the component content code, and store the processed data content into a database.
在一种优选方式中,为了避免攻击脚本的潜在危险,可以将用户输入的组件内容代码打乱成无序的字符串,从而对组件内容代码进行混淆扰乱;对混淆扰乱后的数据采用编码算法进行编码操作。In a preferred manner, in order to avoid the potential danger of attacking the script, the component content code input by the user may be scrambled into an unordered string to confuse the component content code; and the encoding algorithm is used to confuse the scrambled data. Perform the encoding operation.
这是因为,用户输入的内容,包含了HTML代码、CSS代码和/或JavaScript代码,其数据结构较普通的配置参数更为复杂,除了包含数据模型和数据库难以识别的特殊字符(例如“:”、“’”、“/”、“|”、“\”、“空格”)外,可能包含额外攻击脚本。如果开发者输入的脚本是用来影响数据库的代码,可能在数据库里无法将开发者输入的相关代码进行有效保存,为了保险起见,需要将开发者输入的代码进行混淆处理。This is because the user input contains HTML code, CSS code, and/or JavaScript code, and its data structure is more complicated than normal configuration parameters, except for special characters that contain data models and databases that are difficult to recognize (such as ":" In addition to "'", "/", "|", "\", "space", additional attack scripts may be included. If the script entered by the developer is the code used to affect the database, the relevant code input by the developer may not be saved in the database. To be safe, the code input by the developer needs to be confused.
为了避免影响数据库的保存,需要将所有内容进行进行混淆扰乱。所谓混淆扰乱,即将开发者输入的所有代码,打乱成无序的字符串,数据库只会将开发者输入的代码当成无效的字符串来处理,字符串不会产生任何影响到数据库的行为。In order to avoid affecting the preservation of the database, all content needs to be confused and disturbed. The so-called confusion disruption, that is, all the code input by the developer, upset into an unordered string, the database will only treat the code entered by the developer as an invalid string, the string will not produce any behavior that affects the database.
例如,可以使用JavaScript自带的原生函数encodeURIComponent()进行混淆处理及编码。 For example, you can use the native function encodeURIComponent() that comes with JavaScript for obfuscation and encoding.
示例如下:An example is as follows:
SetState({SetState({
Html:encodeURIComponent(htmlStr)Html:encodeURIComponent(htmlStr)
});});
CSS和JavaScript保存原理同上。The principles of CSS and JavaScript are the same as above.
其中,SetState是JavaScript提供的一个保存至数据库的通用方法。htmlStr:在此表示用户输入的html代码。Among them, SetState is a general method provided by JavaScript to save to the database. htmlStr: Here is the html code entered by the user.
S103:从数据库中取出数据内容,并进行解码处理。S103: Extract the data content from the database and perform decoding processing.
在将HTML代码、CSS代码和/或JavaScript代码从数据库中取出并输出到页面时,因为在保存过程时已经将其编码,如果直接输入至页面,将不会有任何效果展示,反而会出现一堆乱码。所以在取出数据内容时,需要采用相对应的解码方法,来对数据进行解码(反编译)。例如,如果之前是使用的JavaScript提供的原生编码函数encodeURIComponent()进行的编译,这里就需要使用对应的解码函数decodeURIComponent()进行反编译。When the HTML code, CSS code, and/or JavaScript code is taken out of the database and output to the page, because it has been encoded during the save process, if you directly input to the page, there will be no effect display, but a Heap garbled. Therefore, when extracting the data content, it is necessary to use a corresponding decoding method to decode (decompile) the data. For example, if you used to compile with the native encoding function encodeURIComponent() provided by JavaScript, you need to decompile with the corresponding decoding function decodeURIComponent().
S104:将解码的数据内容渲染至页面,得到与用户输入的组件内容代码对应的个性化页面。S104: Render the decoded data content to the page to obtain a personalized page corresponding to the component content code input by the user.
将反编译的数据内容渲染至页面,即可呈现出开发人员所输入代码的自定义效果。Rendering the decompiled data content to the page presents a custom effect of the code entered by the developer.
参见图2,为图1方法一个示例所对应的示意图。图2中,首先通过暴露API的方式向用户提供个性化组件接口;然后,通过个性化组件接口接收用户输入的组件内容代码,即得到HTML代码、CSS代码和/或JavaScript代码;继而,对HTML代码、CSS代码和/或JavaScript代码进行编码后存入数据库;当要生成页面时,取出HTML代码、CSS代码和/或JavaScript代码准备预渲染,并对取出的代码进行解码处理;最后,将解码的数据渲染至页面,即可呈现出个性化页面。Referring to FIG. 2, it is a schematic diagram corresponding to an example of the method of FIG. 1. In Figure 2, the user is first provided with a personalized component interface by exposing the API; then, the component content code input by the user is received through the personalized component interface, ie, the HTML code, the CSS code, and/or the JavaScript code are obtained; and then, the HTML is The code, CSS code, and/or JavaScript code are encoded and stored in the database; when the page is to be generated, the HTML code, CSS code, and/or JavaScript code are taken out for pre-rendering, and the fetched code is decoded; finally, the code is decoded The rendered data is rendered to the page to present a personalized page.
本发明方案的一种典型应用场景为:页面开发者在使用自助式建站平台时,遇到简单专题页可以进行快速的搭建,但是当遇到与较复杂或者与后台需 要交互数据的一些活动专题页,一般的自助式建站平台就无法解决这种问题,一般需要页面开发者与平台开发者,进行协商。如何向平台开发者提供一种特殊组件来完成复杂专题页的搭建,则是一个技术需求。但是现有技术中,通常这种特殊组件无法进行抽象通用,即不能够复用到其他功能,而且,开发期间则会产生一些沟通成本及平台开发者的开发成本,不必要的运营成本等。如果平台开发者提供了诸如本发明文案提供的个性化组件,那么页面开发者在遇到自助式建站平台无法完成的页面搭建功能时,就可以自己使用个性化组件,快速的开发出自己想要实现的功能,从而有效的降低相关的研发成本。A typical application scenario of the solution of the present invention is: when a web developer uses a self-service website to build a platform, a simple topic page can be quickly constructed, but when it is encountered with more complicated or with the background In order to interact with some activity topic pages of data, the general self-service platform can't solve this problem. Generally, page developers and platform developers need to negotiate. How to provide platform developers with a special component to complete the construction of complex topic pages is a technical requirement. However, in the prior art, usually, such a special component cannot be abstracted and universally used, that is, it cannot be reused to other functions, and during the development, some communication costs, development costs of the platform developer, unnecessary operating costs, and the like are generated. If the platform developer provides a personalized component such as the one provided by the present invention, then when the page developer encounters a page building function that cannot be completed by the self-service website, the page developer can use the personalized component to quickly develop the desired one. Realize the functions, thus effectively reducing the related research and development costs.
可见,本发明实施例通过个性化页面生成方案,可以使得页面开发人员直接输入组件代码,随时随地的创建新个性化组件(即平台无法提供的通用抽象组件),不但能够有效的降低开发人员之间的沟通成本,并且可以提升自助式建站平台的构建效率。It can be seen that the personalized page generation solution can enable the page developer to directly input the component code, and create a new personalized component (that is, a general abstract component that the platform cannot provide) anytime and anywhere, which can effectively reduce the developer's The cost of communication between the two can increase the efficiency of building a self-service platform.
本发明实施例还提供一种个性化组件的实现方法。The embodiment of the invention further provides a method for implementing a personalized component.
参考图3,为根据本发明的一个实施例提供的个性化组件实现方法流程图,该方法包括步骤S301-S303。Referring to FIG. 3, a flowchart of a method for implementing a personalized component according to an embodiment of the present invention includes steps S301-S303.
S301:自定义个性化组件接口,并通过暴露API的方式,向用户提供个性化组件接口。S301: Customize the component interface and provide a personalized component interface to the user by exposing the API.
本领域技术人员了解,任何功能组件都是由HTML,CSS,JavaScript构成。其中,具体可以针对不同代码编写组件的不同内容:HTML(Hyper Text Markup Language,超文本标记语言):用于编写组件的结构;CSS(Cascading Style Sheets):用于编写组件的样式;Javascript:用于编写组件的行为。Those skilled in the art understand that any functional component is composed of HTML, CSS, and JavaScript. Specifically, you can write different components of the component for different code: HTML (Hyper Text Markup Language): used to write the structure of the component; CSS (Cascading Style Sheets): used to write the style of the component; Javascript: The behavior of writing components.
因此,在一种优选方式中,个性化组件接口包括HTML接口、CSS接口和Javascript接口中的一个或多个;组件内容代码包括HTML代码、CSS代码和Javascript代码中的一种或多种。可见,本发明方案中,提供的个性化组件可以使得用户(页面开发者)任意输入HTML、CSS、JavaScript。页面开发者使用本发明提供的个性化组件,可以完成任意功能开发,不受限于自助式建站平台的现有组件。Accordingly, in a preferred form, the personalization component interface includes one or more of an HTML interface, a CSS interface, and a Javascript interface; the component content code includes one or more of HTML code, CSS code, and Javascript code. It can be seen that, in the solution of the present invention, the personalized component provided can enable the user (page developer) to arbitrarily input HTML, CSS, and JavaScript. The page developer can use any of the personalized components provided by the present invention to perform any function development, and is not limited to the existing components of the self-service website platform.
基于此种方案下,本发明旨在自助式建站平台提供了其他功能组件的同 时,只需另外提供一种个性化组件(个性化组件),组件的内容(即输入组件的HTML代码、CSS代码、JavaScript代码)皆由活动专题页开发人员自行配置编写,即可临时的快速的完成一个自定义的个性化组件。因为个性化组件的不可复用性,无须组件开发人员进行重新开发个性化组件,只需要活动专题页开发人员使用自定义代码,即可完成个性化需求的定制。Based on this scheme, the present invention aims to provide the same functional components of the self-service platform. In addition, you only need to provide a personalized component (personalized component). The content of the component (that is, the HTML code of the input component, CSS code, JavaScript code) is written by the activity profile page developer, which can be temporarily fast. Complete a custom personalized component. Because of the non-reusability of personalized components, component developers are not required to re-develop personalized components, and only the active topic page developers use custom code to customize the individual requirements.
向用户提供个性化组件接口,可通过暴露API的方式实现,例如,暴露出三个接口,接口由活动专题页开发人员自定义输入并配置;在一个具体例子中,三个可供活动专题页开发人员配置的接口分别为:HTML接口,CSS接口,JavaScript接口。因为每个平台暴露组件API接口的方式各不相同,本文对此不作具体限制。Providing a personalized component interface to the user can be achieved by exposing the API, for example, exposing three interfaces that are custom input and configured by the active feature page developer; in one specific example, three available feature pages The interfaces configured by the developer are: HTML interface, CSS interface, and JavaScript interface. Because each platform exposes component API interfaces in different ways, this article does not specifically limit this.
S302:通过个性化组件接口接收用户输入的组件内容代码;S302: Receive a component content code input by a user through a personalized component interface;
如果将开发人员输入的所有自定义代码直接渲染至页面上,是有风险的,如果出现任何报错,很有可能影响建站平台执行结果。基于此种风险,需要在对代码进行后续的反编译输出至页面上之前,对其进行异常捕获。因此,在一个优选方式中,通过个性化组件接口接收用户输入的组件内容代码过程中,可以对组件内容代码进行异常捕获,并将异常代码剔除掉,从而提高代码后续处理的准确度。If all the custom code input by the developer is directly rendered to the page, it is risky. If any error occurs, it is likely to affect the execution result of the website. Based on this risk, the code needs to be captured for exception before it is subsequently decompiled and output to the page. Therefore, in a preferred manner, during the process of receiving the component content code input by the user through the personalized component interface, the component content code may be abnormally captured, and the abnormal code may be culled, thereby improving the accuracy of the code subsequent processing.
例如,对于JavaScript代码,更有必有进行异常捕获。因为,浏览器在渲染页面时,是单线程的加载页面,在将用户的代码渲染至页面时,如果用户的代码输入有误,线程产生阻塞,导致页面无法正常加载,便会影响到自助式建站平台的其他功能运转,所以要对其进行异常捕获,即当开发者输入的代码,有报错时。将其拦截,让其不至于影响到其他功能的运转,例如,在此可以使用各大浏览器厂商统一提供的try{}catch(e){}方法,将开发者输入的代码渲染至try{用户代码}模块中,如果try{}中的代码报错,那么浏览器就会将其拦截,并将报错信息输入到catch(e){报错信息}中。),具体的,可以采用下述代码来实现异常捕获。For example, for JavaScript code, there is a need for exception catching. Because, when the browser renders the page, it is a single-threaded loading page. When the user's code is rendered to the page, if the user's code input is wrong, the thread is blocked, and the page cannot be loaded normally, which will affect the self-service. The other functions of the platform are running, so you need to capture them abnormally, that is, when the code entered by the developer is reported. Intercept it so that it doesn't affect the operation of other functions. For example, you can use the try{}catch(e){} method provided by all major browser vendors to render the code input by the developer to try{ In the user code} module, if the code in try{} reports an error, the browser will intercept it and input the error message into catch(e){error message}. ), specifically, the following code can be used to achieve exception capture.
Figure PCTCN2017107053-appb-000002
Figure PCTCN2017107053-appb-000002
Figure PCTCN2017107053-appb-000003
Figure PCTCN2017107053-appb-000003
S303:对组件内容代码进行编译处理,得到与用户输入的组件内容代码对应的个性化组件。S303: Compile and process the component content code to obtain a personalized component corresponding to the component content code input by the user.
在一种优选方式中,为了避免攻击脚本的潜在危险,可以将用户输入的组件内容代码打乱成无序的字符串,从而对组件内容代码进行混淆扰乱;对混淆扰乱后的数据采用编码算法进行编码操作。In a preferred manner, in order to avoid the potential danger of attacking the script, the component content code input by the user may be scrambled into an unordered string to confuse the component content code; and the encoding algorithm is used to confuse the scrambled data. Perform the encoding operation.
这是因为,用户输入的内容,包含了HTML代码、CSS代码和/或JavaScript代码,其数据结构较普通的配置参数更为复杂,除了包含数据模型和数据库难以识别的特殊字符(例如“:”、“’”、“/”、“|”、“\”、“空格”)外,可能包含额外攻击脚本。如果开发者输入的脚本是用来影响数据库的代码,可能在数据库里无法将开发者输入的相关代码进行有效保存,为了保险起见,需要将开发者输入的代码进行混淆处理。This is because the user input contains HTML code, CSS code, and/or JavaScript code, and its data structure is more complicated than normal configuration parameters, except for special characters that contain data models and databases that are difficult to recognize (such as ":" In addition to "'", "/", "|", "\", "space", additional attack scripts may be included. If the script entered by the developer is the code used to affect the database, the relevant code input by the developer may not be saved in the database. To be safe, the code input by the developer needs to be confused.
为了避免影响数据库的保存,需要将所有内容进行进行混淆扰乱。所谓混淆扰乱,即将开发者输入的所有代码,打乱成无序的字符串,数据库只会将开发者输入的代码当成无效的字符串来处理,字符串不会产生任何影响到数据库的行为。In order to avoid affecting the preservation of the database, all content needs to be confused and disturbed. The so-called confusion disruption, that is, all the code input by the developer, upset into an unordered string, the database will only treat the code entered by the developer as an invalid string, the string will not produce any behavior that affects the database.
例如,可以使用JavaScript自带的原生函数encodeURIComponent()进行混淆处理及编码。For example, you can use the native function encodeURIComponent() that comes with JavaScript for obfuscation and encoding.
示例如下:An example is as follows:
SetState({SetState({
Html:encodeURIComponent(htmlStr)Html:encodeURIComponent(htmlStr)
});});
CSS和JavaScript保存原理同上。The principles of CSS and JavaScript are the same as above.
其中,SetState是JavaScript提供的一个保存至数据库的通用方法。htmlStr:在此表示用户输入的html代码。 Among them, SetState is a general method provided by JavaScript to save to the database. htmlStr: Here is the html code entered by the user.
在一个优选方式中,在对组件内容代码进行编译处理得到个性化组件之后,还包括:将编码的的数据存入到数据库中,以及,在生成页面时,从数据库中取出数据内容并进行解码处理。In a preferred manner, after the component content code is compiled and processed to obtain the personalized component, the method further comprises: storing the encoded data into the database, and, when generating the page, extracting and decoding the data content from the database. deal with.
这是因为,在将HTML代码、CSS代码和/或JavaScript代码从数据库中取出并输出到页面时,因为在保存过程时已经将其编码,如果直接输入至页面,将不会有任何效果展示,反而会出现一堆乱码。所以在取出数据内容时,需要采用相对应的解码方法,来对数据进行解码(反编译)。例如,如果之前是使用的JavaScript提供的原生编码函数encodeURIComponent()进行的编译,这里就需要使用对应的解码函数decodeURIComponent()进行反编译。This is because, when the HTML code, CSS code, and/or JavaScript code is taken out of the database and output to the page, since it has been encoded during the save process, if it is directly input to the page, there will be no effect display. Instead, there will be a bunch of garbled characters. Therefore, when extracting the data content, it is necessary to use a corresponding decoding method to decode (decompile) the data. For example, if you used to compile with the native encoding function encodeURIComponent() provided by JavaScript, you need to decompile with the corresponding decoding function decodeURIComponent().
最后,将解码的数据内容渲染至页面,得到与用户输入的组件内容代码对应的个性化页面。将反编译的数据内容渲染至页面,即可呈现出开发人员所输入代码的自定义效果。Finally, the decoded data content is rendered to the page, resulting in a personalized page corresponding to the component content code entered by the user. Rendering the decompiled data content to the page presents a custom effect of the code entered by the developer.
与图1方法相对应,本发明还提供一种个性化页面生成装置。参考图4,为一种个性化页面生成装置结构示意图。该装置包括:Corresponding to the method of FIG. 1, the present invention also provides a personalized page generating apparatus. Referring to FIG. 4, it is a schematic structural diagram of a personalized page generating apparatus. The device includes:
代码获取单元401,用于向用户提供个性化组件接口,并通过所述个性化组件接口接收用户输入的组件内容代码;The code obtaining unit 401 is configured to provide a personalized component interface to the user, and receive the component content code input by the user through the personalized component interface;
编码处理单元402,用于对所述组件内容代码进行编码处理,并将处理过的数据内容存入到数据库;The encoding processing unit 402 is configured to perform encoding processing on the component content code, and store the processed data content into a database;
解码处理单元403,用于从数据库中取出数据内容,并进行解码处理;a decoding processing unit 403, configured to take out data content from a database, and perform decoding processing;
渲染单元404,用于将解码的数据内容渲染至页面,得到与用户输入的组件内容代码对应的个性化页面。The rendering unit 404 is configured to render the decoded data content to the page to obtain a personalized page corresponding to the component content code input by the user.
优选的,所述个性化组件接口包括HTML接口、CSS接口和Javascript接口中的一个或多个;所述组件内容代码包括HTML代码、CSS代码和Javascript代码中的一种或多种。Preferably, the personalized component interface includes one or more of an HTML interface, a CSS interface, and a Javascript interface; the component content code includes one or more of HTML code, CSS code, and Javascript code.
优选的,该装置还包括:混淆扰乱处理单元405,将用户输入的组件内容代码打乱成无序的字符串,从而对组件内容代码进行混淆扰乱;其中,所述编码处理单元402,用于对混淆扰乱后的数据采用编码算法进行编码操作。 Preferably, the apparatus further includes: a confusion scrambling processing unit 405, scrambling the component content code input by the user into an unordered character string, thereby performing confusion confusion on the component content code; wherein the encoding processing unit 402 is configured to: The encoding algorithm is used to encode the data after the confusion is disturbed.
优选的,所述解码处理单元403具体用于,对于从数据库中取出的数据内容,采用与所述编码算法对应的解码算法进行解码操作。Preferably, the decoding processing unit 403 is specifically configured to perform a decoding operation on the data content extracted from the database by using a decoding algorithm corresponding to the encoding algorithm.
优选的,所述装置还包括:异常捕获单元406,用于对用户输入的组件内容代码进行异常捕获;以及,从组件内容代码中剔除有异常的代码。Preferably, the apparatus further includes: an exception capture unit 406 for performing an exception capture on the component content code input by the user; and removing the code having the exception from the component content code.
与图3方法相对应,本发明还提供一种个性化组件实现装置。参考图5,为一种个性化组件实现装置结构示意图。该装置包括:Corresponding to the method of FIG. 3, the present invention also provides a personalized component implementing apparatus. Referring to FIG. 5, a structural diagram of a device for implementing a personalized component is shown. The device includes:
个性化组件接口单元501,用于自定义个性化组件接口,并通过暴露API的方式,向用户提供个性化组件接口;The personalization component interface unit 501 is configured to customize the personalized component interface, and provide a personalized component interface to the user by exposing the API;
代码获取单元502,用于通过个性化组件接口接收用户输入的组件内容代码;The code obtaining unit 502 is configured to receive, by using the personalized component interface, a component content code input by the user;
编码处理单元503,用于对组件内容代码进行编译处理,得到与用户输入的组件内容代码对应的个性化组件。The encoding processing unit 503 is configured to perform a compiling process on the component content code to obtain a personalized component corresponding to the component content code input by the user.
优选的,所述个性化组件接口包括HTML接口、CSS接口和Javascript接口中的一个或多个;所述组件内容代码包括HTML代码、CSS代码和Javascript代码中的一种或多种。Preferably, the personalized component interface includes one or more of an HTML interface, a CSS interface, and a Javascript interface; the component content code includes one or more of HTML code, CSS code, and Javascript code.
优选的,该装置还包括:混淆扰乱处理单元504,将用户输入的组件内容代码打乱成无序的字符串,从而对组件内容代码进行混淆扰乱;其中,所述编码处理单元503,用于对混淆扰乱后的数据采用编码算法进行编码操作。Preferably, the apparatus further includes: a confusion scrambling processing unit 504, scrambling the component content code input by the user into an unordered character string, thereby performing confusion confusion on the component content code; wherein the encoding processing unit 503 is configured to: The encoding algorithm is used to encode the data after the confusion is disturbed.
优选的,还包括:所述解码处理单元505具体用于,在生成页面时,从预先存入编码数据的数据库中取出数据内容并进行解码处理。Preferably, the decoding processing unit 505 is specifically configured to: when generating the page, extract the data content from the database pre-stored with the encoded data and perform decoding processing.
优选的,所述装置还包括:异常捕获单元506,用于对用户输入的组件内容代码进行异常捕获;以及,从组件内容代码中剔除有异常的代码。Preferably, the device further comprises: an exception capture unit 506 for performing an exception capture on the component content code input by the user; and removing the code with the exception from the component content code.
在此提供的算法和显示不与任何特定计算机、虚拟系统或者其它设备固有相关。各种通用系统也可以与基于在此的示教一起使用。根据上面的描述,构造这类系统所要求的结构是显而易见的。此外,本发明也不针对任何特定编程语言。应当明白,可以利用各种编程语言实现在此描述的本发明的内容,并且上面对特定语言所做的描述是为了披露本发明的最佳实施方式。 The algorithms and displays provided herein are not inherently related to any particular computer, virtual system, or other device. Various general purpose systems can also be used with the teaching based on the teachings herein. The structure required to construct such a system is apparent from the above description. Moreover, the invention is not directed to any particular programming language. It is to be understood that the invention may be embodied in a variety of programming language, and the description of the specific language has been described above in order to disclose the preferred embodiments of the invention.
本发明的各个部件实施例可以以硬件实现,或者以在一个或者多个处理器上运行的软件模块实现,或者以它们的组合实现。本领域的技术人员应当理解,可以在实践中使用微处理器或者数字信号处理器(DSP)来实现根据本发明实施例的用户变身控制的系统中的一些或者全部部件的一些或者全部功能。本发明还可以实现为用于执行这里所描述的方法的一部分或者全部的设备或者装置程序(例如,计算机程序和计算机程序产品)。这样的实现本发明的程序可以存储在计算机可读介质上,或者可以具有一个或者多个信号的形式。这样的信号可以从因特网网站上下载得到,或者在载体信号上提供,或者以任何其他形式提供。The various component embodiments of the present invention may be implemented in hardware, or in a software module running on one or more processors, or in a combination thereof. Those skilled in the art will appreciate that a microprocessor or digital signal processor (DSP) may be used in practice to implement some or all of the functionality of some or all of the components of the user morphing control system in accordance with embodiments of the present invention. The invention can also be implemented as a device or device program (e.g., a computer program and a computer program product) for performing some or all of the methods described herein. Such a program implementing the invention may be stored on a computer readable medium or may be in the form of one or more signals. Such signals may be downloaded from an Internet website, provided on a carrier signal, or provided in any other form.
应该注意的是上述实施例对本发明进行说明而不是对本发明进行限制,并且本领域技术人员在不脱离所附权利要求的范围的情况下可设计出替换实施例。在权利要求中,不应将位于括号之间的任何参考符号构造成对权利要求的限制。单词“包含”不排除存在未列在权利要求中的元件或步骤。位于元件之前的单词“一”或“一个”不排除存在多个这样的元件。本发明可以借助于包括有若干不同元件的硬件以及借助于适当编程的计算机来实现。在列举了若干装置的单元权利要求中,这些装置中的若干个可以是通过同一个硬件项来具体体现。单词第一、第二、以及第三等的使用不表示任何顺序。可将这些单词解释为名称。 It is to be noted that the above-described embodiments are illustrative of the invention and are not intended to be limiting, and that the invention may be devised without departing from the scope of the appended claims. In the claims, any reference signs placed between parentheses shall not be construed as a limitation. The word "comprising" does not exclude the presence of the elements or steps that are not recited in the claims. The word "a" or "an" The invention can be implemented by means of hardware comprising several distinct elements and by means of a suitably programmed computer. In the unit claims enumerating several means, several of these means can be embodied by the same hardware item. The use of the words first, second, and third does not indicate any order. These words can be interpreted as names.

Claims (10)

  1. 一种个性化组件实现方法,其特征在于,包括:A personalized component implementation method, comprising:
    自定义个性化组件接口,并通过暴露API的方式,向用户提供个性化组件接口;Customize the component interface and provide the user with a personalized component interface by exposing the API;
    通过个性化组件接口接收用户输入的组件内容代码;Receiving a component content code input by a user through a personalized component interface;
    对组件内容代码进行编译处理,得到与用户输入的组件内容代码对应的个性化组件。The component content code is compiled and processed to obtain a personalized component corresponding to the component content code input by the user.
  2. 如权利要求1所述的方法,其特征在于,所述个性化组件接口包括HTML接口、CSS接口和Javascript接口中的一个或多个;所述组件内容代码包括HTML代码、CSS代码和Javascript代码中的一种或多种。The method of claim 1 wherein said personalization component interface comprises one or more of an HTML interface, a CSS interface, and a Javascript interface; said component content code comprising HTML code, CSS code, and Javascript code One or more.
  3. 如权利要求1所述的方法,其特征在于,还包括:The method of claim 1 further comprising:
    将用户输入的组件内容代码打乱成无序的字符串,从而对组件内容代码进行混淆扰乱;Disrupting the component content code by scrambling the component content code input by the user into an unordered string;
    对混淆扰乱后的数据采用编码算法进行编码操作。The encoding algorithm is used to encode the data after the confusion is disturbed.
  4. 如权利要求3所述的方法,其特征在于,还包括:The method of claim 3, further comprising:
    将编码的的数据存入到数据库中,以及,在生成页面时,从数据库中取出数据内容并进行解码处理。The encoded data is stored in the database, and when the page is generated, the data content is taken out from the database and decoded.
  5. 如权利要求1-4任一项所述的方法,其特征在于,所述方法还包括:The method of any of claims 1-4, wherein the method further comprises:
    对用户输入的组件内容代码进行异常捕获;Abnormal capture of the component content code entered by the user;
    从所述组件内容代码中剔除有异常的代码。An exception code is removed from the component content code.
  6. 一种个性化组件实现装置,其特征在于,包括:A personalized component implementation device, comprising:
    个性化组件接口单元,用于自定义个性化组件接口,并通过暴露API的方式,向用户提供个性化组件接口;A personalized component interface unit for customizing the component interface and providing a personalized component interface to the user by exposing the API;
    代码获取单元,用于通过个性化组件接口接收用户输入的组件内容代码;a code obtaining unit, configured to receive a component content code input by a user through a personalized component interface;
    编码处理单元,用于对组件内容代码进行编译处理,得到与用户输入的组件内容代码对应的个性化组件。 The encoding processing unit is configured to compile the component content code to obtain a personalized component corresponding to the component content code input by the user.
  7. 如权利要求6所述的装置,其特征在于,所述个性化组件接口包括HTML接口、CSS接口和Javascript接口中的一个或多个;所述组件内容代码包括HTML代码、CSS代码和Javascript代码中的一种或多种。The apparatus of claim 6, wherein the personalization component interface comprises one or more of an HTML interface, a CSS interface, and a Javascript interface; the component content code comprises HTML code, CSS code, and Javascript code. One or more.
  8. 如权利要求6所述的装置,其特征在于,所述装置还包括:混淆扰乱处理单元,将用户输入的组件内容代码打乱成无序的字符串,从而对组件内容代码进行混淆扰乱;其中,所述编码处理单元,用于对混淆扰乱后的数据采用编码算法进行编码操作。The device according to claim 6, wherein the device further comprises: a confusion scrambling processing unit that scrambles the component content code input by the user into an unordered character string, thereby performing confusion confusion on the component content code; The encoding processing unit is configured to perform an encoding operation by using an encoding algorithm on the data after the confusion is disturbed.
  9. 如权利要求8所述的装置,其特征在于,所述装置还包括:所述解码处理单元具体用于,在生成页面时,从预先存入编码数据的数据库中取出数据内容并进行解码处理。The device according to claim 8, wherein the device further comprises: the decoding processing unit is configured to: when generating the page, extract the data content from the database pre-stored with the encoded data and perform decoding processing.
  10. 如权利要求6-9任一项所述的装置,其特征在于,所述装置还包括:异常捕获单元,用于对用户输入的组件内容代码进行异常捕获;以及,从组件内容代码中剔除有异常的代码。 The apparatus according to any one of claims 6 to 9, wherein the apparatus further comprises: an exception capturing unit configured to perform an exception capture on a component content code input by the user; and, culling from the component content code Exceptional code.
PCT/CN2017/107053 2017-03-30 2017-10-20 Personalized component implementation method and device WO2018176814A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201710202608.6 2017-03-30
CN201710202608.6A CN107133029A (en) 2017-03-30 2017-03-30 Personalization component implementation method and device

Publications (1)

Publication Number Publication Date
WO2018176814A1 true WO2018176814A1 (en) 2018-10-04

Family

ID=59716791

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2017/107053 WO2018176814A1 (en) 2017-03-30 2017-10-20 Personalized component implementation method and device

Country Status (2)

Country Link
CN (1) CN107133029A (en)
WO (1) WO2018176814A1 (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107085515A (en) * 2017-03-30 2017-08-22 武汉斗鱼网络科技有限公司 Personal page generation method and device
CN107133029A (en) * 2017-03-30 2017-09-05 武汉斗鱼网络科技有限公司 Personalization component implementation method and device
CN109343856A (en) * 2018-10-24 2019-02-15 北京奇虎科技有限公司 The generation method and device of custom algorithm component
CN110597516B (en) * 2019-08-27 2023-10-20 贝壳技术有限公司 Confusion method and device for plug-in code, electronic equipment and storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090199163A1 (en) * 2008-01-31 2009-08-06 International Business Machines Corporation Debugger assistance for locating values at runtime
CN101526942A (en) * 2008-03-05 2009-09-09 徐邦勇 Component implementation technology for automatically generating dynamic web page on line in real time
CN104123133A (en) * 2014-07-01 2014-10-29 曾安里 Dragon VVR-VBF modularization development framework platform tool system
CN104699519A (en) * 2015-04-03 2015-06-10 四川效率源信息安全技术有限责任公司 Java script editor implemented based on GDI+ (graphics device interface plus) in combination with C# class library
CN107133029A (en) * 2017-03-30 2017-09-05 武汉斗鱼网络科技有限公司 Personalization component implementation method and device

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20090199163A1 (en) * 2008-01-31 2009-08-06 International Business Machines Corporation Debugger assistance for locating values at runtime
CN101526942A (en) * 2008-03-05 2009-09-09 徐邦勇 Component implementation technology for automatically generating dynamic web page on line in real time
CN104123133A (en) * 2014-07-01 2014-10-29 曾安里 Dragon VVR-VBF modularization development framework platform tool system
CN104699519A (en) * 2015-04-03 2015-06-10 四川效率源信息安全技术有限责任公司 Java script editor implemented based on GDI+ (graphics device interface plus) in combination with C# class library
CN107133029A (en) * 2017-03-30 2017-09-05 武汉斗鱼网络科技有限公司 Personalization component implementation method and device

Also Published As

Publication number Publication date
CN107133029A (en) 2017-09-05

Similar Documents

Publication Publication Date Title
US9582666B1 (en) Computer system for improved security of server computers interacting with client computers
Lawson Web scraping with Python
WO2018176814A1 (en) Personalized component implementation method and device
US10216488B1 (en) Intercepting and injecting calls into operations and objects
US10325097B2 (en) Static detection of context-sensitive cross-site scripting vulnerabilities
US8090959B2 (en) Method and apparatus for protecting .net programs
US10430514B2 (en) Method and terminal for extracting webpage content, and non-transitory storage medium
US9058489B2 (en) Marking documents with executable text for processing by computing systems
US9813440B1 (en) Polymorphic treatment of annotated content
Lin et al. Automated forensic analysis of mobile applications on Android devices
EP2575069A2 (en) Security vulnerability correction
CN105580384A (en) Actionable content displayed on a touch screen
CA2684822A1 (en) Data transformation based on a technical design document
US11301357B1 (en) Method to check application programming interface correctness in software
KR20110087193A (en) Apparatus and method for processing documents with executable text
WO2018176813A1 (en) Personalized page generation method and device
US20170300305A1 (en) Executable guidance experiences based on implicitly generated guidance models
CN102693238B (en) Widget application process, system and multimedia terminal
WO2021120538A1 (en) Applet code scanning method and apparatus
US8806457B2 (en) Deferred constant pool generation
CN111783019A (en) Browser sub-page creation method and device, computer equipment and storage medium
CN110457869B (en) Program compiling and encrypting method and device, storage medium and electronic equipment
CN103856476A (en) Method and device for identifying network robot
US11948007B2 (en) Methods for executing computer executable instructions
US9811323B2 (en) Methods, apparatus, systems and computer readable media for use in association with partitioning and/or rendering

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: 17903036

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: 17903036

Country of ref document: EP

Kind code of ref document: A1