CN110472207A - List generation method and device - Google Patents

List generation method and device Download PDF

Info

Publication number
CN110472207A
CN110472207A CN201810442671.1A CN201810442671A CN110472207A CN 110472207 A CN110472207 A CN 110472207A CN 201810442671 A CN201810442671 A CN 201810442671A CN 110472207 A CN110472207 A CN 110472207A
Authority
CN
China
Prior art keywords
template
data
client
form data
acquisition request
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.)
Pending
Application number
CN201810442671.1A
Other languages
Chinese (zh)
Inventor
陈其政
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Jingdong Century Trading Co Ltd
Beijing Jingdong Shangke Information Technology Co Ltd
Original Assignee
Beijing Jingdong Century Trading Co Ltd
Beijing Jingdong Shangke Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Jingdong Century Trading Co Ltd, Beijing Jingdong Shangke Information Technology Co Ltd filed Critical Beijing Jingdong Century Trading Co Ltd
Priority to CN201810442671.1A priority Critical patent/CN110472207A/en
Publication of CN110472207A publication Critical patent/CN110472207A/en
Pending legal-status Critical Current

Links

Landscapes

  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention discloses a kind of list generation method and devices, are related to field of computer technology.Wherein, the list generation method of one embodiment of the invention includes: the list acquisition request for receiving client and sending;Corresponding form templat and form data are obtained according to the list acquisition request;The form templat includes the attribute information of form item, and the form data includes the value information of form item;The corresponding form templat and form data are sent to the client, so that the client generates list according to the corresponding form templat and form data rendering.By above step, it can be improved list development efficiency, reduce the duplicated code in list exploitation, reduce the code maintenance cost in list exploitation.

Description

表单生成方法和装置Form generating method and device

技术领域technical field

本发明涉及计算机技术领域,尤其涉及一种表单生成方法和装置。The present invention relates to the field of computer technology, in particular to a form generation method and device.

背景技术Background technique

在移动互联网快速发展的今天,越来越多的表单填写移植到了移动端。在现有技术中,前后端需要使用各自的平台语言对各种表单进行单独开发。比如,当新增一个表单类型时,前端需要投入大量的人力进行新表单的界面开发、以及新表单中表单项之间的逻辑处理工作,后端需要对新表单的数据进行存储,并且需要针对新表单增加增删改查等各种操作的接口。With the rapid development of the mobile Internet today, more and more form filling is transplanted to the mobile terminal. In the prior art, the front and back ends need to use their respective platform languages to develop various forms separately. For example, when adding a new form type, the front-end needs to invest a lot of manpower in the interface development of the new form and the logical processing between the form items in the new form, and the back-end needs to store the data of the new form, and needs to target The new form adds interfaces for various operations such as adding, deleting, modifying, and checking.

在实现本发明过程中,发明人发现现有技术中至少存在如下问题现有的表单开发方法需要耗费大量的人力和时间成本,工作繁琐且开发效率低;修改某些业务逻辑需要前端重新发版,审核时间过长;代码维护成本较高,且代码无法复用。In the process of realizing the present invention, the inventor found that there are at least the following problems in the prior art. The existing form development method requires a lot of manpower and time costs, cumbersome work and low development efficiency; modifying some business logic requires the front-end to reissue the version , the review time is too long; the code maintenance cost is high, and the code cannot be reused.

发明内容Contents of the invention

有鉴于此,本发明提供一种表单生成方法和装置,能够提高表单开发效率、减少表单开发中的重复代码,降低表单开发中的代码维护成本。In view of this, the present invention provides a form generation method and device, which can improve form development efficiency, reduce repeated codes in form development, and reduce code maintenance costs in form development.

为实现上述目的,根据本发明的第一个方面,提供了一种表单生成方法。To achieve the above purpose, according to the first aspect of the present invention, a method for generating a form is provided.

本发明的表单生成方法包括:接收客户端发送的表单获取请求;根据所述表单获取请求获取对应的表单模板和表单数据;所述表单模板包括表单项的属性信息,所述表单数据包括表单项的取值信息;将所述对应的表单模板和表单数据发送至所述客户端,以使所述客户端根据所述对应的表单模板和表单数据渲染生成表单。The form generation method of the present invention includes: receiving a form acquisition request sent by a client; acquiring a corresponding form template and form data according to the form acquisition request; the form template includes attribute information of form items, and the form data includes form items value information; sending the corresponding form template and form data to the client, so that the client renders and generates a form according to the corresponding form template and form data.

可选地,所述表单获取请求包括:表单类型和表单标识;所述根据所述表单获取请求获取对应的表单模板和表单数据的步骤包括:根据所述表单类型查询表单模板仓库,以获取对应的表单模板;根据所述表单标识查询表单数据仓库,以获取对应的表单数据。Optionally, the form acquisition request includes: a form type and a form identifier; the step of acquiring the corresponding form template and form data according to the form acquisition request includes: querying the form template warehouse according to the form type to obtain the corresponding The form template; query the form data warehouse according to the form identifier to obtain the corresponding form data.

可选地,所述根据所述表单类型查询表单模板仓库,以获取对应的表单模板的步骤包括:根据所述表单类型生成第一SQL语句,然后根据第一SQL语句查询表单模板仓库,以得到对应的表单模板;所述根据所述表单标识查询表单数据仓库,以获取对应的表单数据的步骤包括:根据所述表单标识生成第二SQL语句,然后根据第二SQL语句查询表单数据仓库,以得到对应的表单数据。Optionally, the step of querying the form template warehouse according to the form type to obtain the corresponding form template includes: generating a first SQL statement according to the form type, and then querying the form template warehouse according to the first SQL statement to obtain Corresponding form template; the step of querying the form data warehouse according to the form identification to obtain the corresponding form data includes: generating a second SQL statement according to the form identification, and then querying the form data warehouse according to the second SQL statement to obtain Get the corresponding form data.

可选地,所述表单项的属性信息包括以下至少一项:表单项对应的组件类型、数据类型、是否必填、数据长度、表单项的显示顺序。Optionally, the attribute information of the form item includes at least one of the following: component type corresponding to the form item, data type, whether it is required, data length, and display order of the form item.

可选地,所述将所述对应的表单模板和表单数据发送至所述客户端的步骤包括:将所述对应的表单模板和表单数据进行封装,然后将封装得到的JSON字符串发送至所述客户端。Optionally, the step of sending the corresponding form template and form data to the client includes: encapsulating the corresponding form template and form data, and then sending the encapsulated JSON string to the client.

为实现上述目的,根据本发明的第二个方面,提供了一种表单生成方法。To achieve the above object, according to the second aspect of the present invention, a method for generating a form is provided.

本发明的表单生成方法包括:向服务端发送表单获取请求;接收所述服务端返回的与所述表单获取请求对应的表单模板和表单数据;所述表单模板包括表单项的属性信息,所述表单数据包括表单项的取值信息;根据所述对应的表单模板和表单数据渲染生成表单。The form generation method of the present invention includes: sending a form acquisition request to the server; receiving the form template and form data corresponding to the form acquisition request returned by the server; the form template includes the attribute information of the form item, the The form data includes the value information of the form item; the form is rendered and generated according to the corresponding form template and form data.

可选地,所述根据所述对应的表单模板和表单数据渲染生成表单的步骤包括:将所述服务端返回的所述对应的表单模板和表单数据解析成客户端支持的格式;然后根据解析后的表单模板进行组件渲染,并根据解析后的表单数据设置所述组件对应的取值信息,以生成表单。Optionally, the step of rendering and generating a form according to the corresponding form template and form data includes: parsing the corresponding form template and form data returned by the server into a format supported by the client; The final form template performs component rendering, and sets value information corresponding to the component according to the parsed form data to generate a form.

可选地,所述方法还包括:在监听到特定组件的取值改变时,自动修改与所述特定组件存在关联关系的组件的取值。Optionally, the method further includes: automatically modifying the value of a component associated with the specific component when monitoring a value change of the specific component.

为实现上述目的,根据本发明的第三个方面,提供了一种表单生成装置。To achieve the above object, according to the third aspect of the present invention, a form generation device is provided.

本发明的表单生成装置包括:接收模块,用于接收客户端发送的表单获取请求;获取模块,用于根据所述表单获取请求获取对应的表单模板和表单数据;所述表单模板包括表单项的属性信息,所述表单数据包括表单项的取值信息;发送模块,用于将所述对应的表单模板和表单数据发送至所述客户端,以使所述客户端根据所述对应的表单模板和表单数据渲染生成表单。The form generation device of the present invention includes: a receiving module, configured to receive a form acquisition request sent by a client; an acquisition module, configured to acquire a corresponding form template and form data according to the form acquisition request; the form template includes a form item Attribute information, the form data includes value information of form items; a sending module, configured to send the corresponding form template and form data to the client, so that the client can and form data rendering to generate the form.

可选地,所述表单获取请求包括:表单类型和表单标识;所述获取模块根据所述表单获取请求获取对应的表单模板和表单数据包括:所述获取模块根据所述表单类型查询表单模板仓库,以获取对应的表单模板;所述获取模块根据所述表单标识查询表单数据仓库,以获取对应的表单数据。Optionally, the form acquisition request includes: a form type and a form identifier; the acquisition module acquiring the corresponding form template and form data according to the form acquisition request includes: the acquisition module queries the form template warehouse according to the form type , to obtain the corresponding form template; the obtaining module queries the form data warehouse according to the form identifier, so as to obtain the corresponding form data.

可选地,所述获取模块根据所述表单类型查询表单模板仓库,以获取对应的表单模板包括:所述获取模块根据所述表单类型生成第一SQL语句,然后根据第一SQL语句查询表单模板仓库,以得到对应的表单模板;所述获取模块根据所述表单标识查询表单数据仓库,以获取对应的表单数据包括:所述获取模块根据所述表单标识生成第二SQL语句,然后根据第二SQL语句查询表单数据仓库,以得到对应的表单数据。Optionally, the obtaining module queries the form template warehouse according to the form type, so as to obtain the corresponding form template includes: the obtaining module generates a first SQL statement according to the form type, and then queries the form template according to the first SQL statement Warehouse to obtain a corresponding form template; the acquisition module queries the form data warehouse according to the form identifier, so as to obtain the corresponding form data includes: the acquisition module generates a second SQL statement according to the form identifier, and then according to the second The SQL statement queries the form data warehouse to obtain the corresponding form data.

可选地,所述发送模块将所述对应的表单模板和表单数据发送至所述客户端包括:所述发送模块将所述对应的表单模板和表单数据进行封装,然后将封装得到的JSON字符串发送至所述客户端。Optionally, sending the corresponding form template and form data to the client by the sending module includes: encapsulating the corresponding form template and form data by the sending module, and then encapsulating the obtained JSON character string sent to the client.

为实现上述目的,根据本发明的第四个方面,提供了一种表单生成装置。To achieve the above object, according to a fourth aspect of the present invention, a form generation device is provided.

本发明的表单生成装置包括:发送模块,用于向服务端发送表单获取请求;接收模块,用于接收所述服务端返回的与所述表单获取请求对应的表单模板和表单数据;所述表单模板包括表单项的属性信息,所述表单数据包括表单项的取值信息;渲染模块,用于根据所述对应的表单模板和表单数据渲染生成表单。The form generation device of the present invention includes: a sending module, used to send a form acquisition request to the server; a receiving module, used to receive the form template and form data corresponding to the form acquisition request returned by the server; the form The template includes attribute information of the form item, and the form data includes value information of the form item; the rendering module is configured to render and generate a form according to the corresponding form template and form data.

可选地,所述渲染模块根据所述对应的表单模板和表单数据渲染生成表单包括:所述渲染模块将所述服务端返回的所述对应的表单模板和表单数据解析成客户端支持的格式;然后根据解析后的表单模板进行组件渲染,并根据解析后的表单数据设置所述组件对应的取值信息,以生成表单。Optionally, the rendering module rendering and generating the form according to the corresponding form template and form data includes: the rendering module parsing the corresponding form template and form data returned by the server into a format supported by the client ; Then perform component rendering according to the parsed form template, and set value information corresponding to the component according to the parsed form data to generate a form.

可选地,所述装置还包括:公式执行器,用于在监听到特定组件的取值改变时,自动修改与所述特定组件存在关联关系的组件的取值。Optionally, the device further includes: a formula executor, configured to automatically modify the value of a component associated with the specific component when a value change of a specific component is detected.

为实现上述目的,根据本发明的第五个方面,提供了一种电子设备。To achieve the above purpose, according to a fifth aspect of the present invention, an electronic device is provided.

本发明的电子设备,包括:一个或多个处理器;以及,存储装置,用于存储一个或多个程序;当所述一个或多个程序被所述一个或多个处理器执行,使得所述一个或多个处理器实现本发明第一个方面或本发明第二个方面的表单生成方法。The electronic equipment of the present invention includes: one or more processors; and a storage device for storing one or more programs; when the one or more programs are executed by the one or more processors, the The one or more processors implement the form generation method of the first aspect of the present invention or the second aspect of the present invention.

为实现上述目的,根据本发明的第六个方面,提供了一种计算机可读介质。To achieve the above purpose, according to a sixth aspect of the present invention, a computer-readable medium is provided.

本发明的计算机可读介质,其上存储有计算机程序,所述程序被处理器执行时实现本发明第一个方面或第二个方面的表单生成方法。The computer-readable medium of the present invention stores a computer program thereon, and when the program is executed by a processor, the form generating method of the first aspect or the second aspect of the present invention is realized.

上述发明中的一个实施例具有如下优点或有益效果:通过接收客户端发送的表单获取请求,根据所述表单获取请求获取对应的表单模板和表单数据,将所述对应的表单模板和表单数据发送至所述客户端这些步骤,能够使所述客户端根据所述对应的表单模板和表单数据渲染生成表单,提高表单开发效率、减少表单开发中的重复代码,降低表单开发中的代码维护成本。An embodiment of the above invention has the following advantages or beneficial effects: by receiving the form acquisition request sent by the client, the corresponding form template and form data are acquired according to the form acquisition request, and the corresponding form template and form data are sent to These steps to the client can enable the client to render and generate a form according to the corresponding form template and form data, improve the efficiency of form development, reduce repeated codes in form development, and reduce code maintenance costs in form development.

上述的非惯用的可选方式所具有的进一步效果将在下文中结合具体实施方式加以说明。The further effects of the above-mentioned non-conventional alternatives will be described below in conjunction with specific embodiments.

附图说明Description of drawings

附图用于更好地理解本发明,不构成对本发明的不当限定。其中:The accompanying drawings are used to better understand the present invention, and do not constitute improper limitations to the present invention. in:

图1是根据本发明一个实施例的表单生成方法的主要流程示意图;Fig. 1 is a schematic flow diagram of the main flow of a form generation method according to an embodiment of the present invention;

图2是根据本发明另一实施例的表单生成方法的主要流程示意图;FIG. 2 is a schematic flow diagram of the main flow of a form generating method according to another embodiment of the present invention;

图3是根据本发明一个实施例的表单生成装置的主要模块示意图;Fig. 3 is a schematic diagram of main modules of a form generation device according to an embodiment of the present invention;

图4是根据本发明另一实施例的表单生成装置的主要模块示意图;4 is a schematic diagram of main modules of a form generation device according to another embodiment of the present invention;

图5是根据本发明一个实施例的表单生成系统的组成示意图;FIG. 5 is a schematic diagram of the composition of a form generation system according to an embodiment of the present invention;

图6是本发明实施例可以应用于其中的示例性系统架构图;FIG. 6 is an exemplary system architecture diagram to which the embodiment of the present invention can be applied;

图7是适于用来实现本发明实施例的电子设备的计算机系统的结构示意图。FIG. 7 is a schematic structural diagram of a computer system suitable for implementing the electronic device of the embodiment of the present invention.

具体实施方式Detailed ways

以下结合附图对本发明的示范性实施例做出说明,其中包括本发明实施例的各种细节以助于理解,应当将它们认为仅仅是示范性的。因此,本领域普通技术人员应当认识到,可以对这里描述的实施例做出各种改变和修改,而不会背离本发明的范围和精神。同样,为了清楚和简明,以下的描述中省略了对公知功能和结构的描述。Exemplary embodiments of the present invention are described below in conjunction with the accompanying drawings, which include various details of the embodiments of the present invention to facilitate understanding, and they should be regarded as exemplary only. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the invention. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.

需要指出的是,在不冲突的情况下,本发明中的实施例以及实施例中的特征可以相互组合。It should be noted that, in the case of no conflict, the embodiments of the present invention and the features in the embodiments can be combined with each other.

在详细介绍本发明实施例之前,首先对本发明实施例涉及的部分技术术语进行说明。Before introducing the embodiments of the present invention in detail, some technical terms involved in the embodiments of the present invention will be described first.

表单:是一种数据采集、数据展示的形式。Form: It is a form of data collection and data display.

MySQL:是一个关系型数据库管理系统。MySQL: is a relational database management system.

App:Application,指可执行的应用程序。App: Application, refers to the executable application.

Android:是一种基于Linux的自由及开放源代码的操作系统,主要用于移动设备。Android: is a free and open source operating system based on Linux, mainly used in mobile devices.

ios:是由苹果公司开发的移动操作系统。ios: is a mobile operating system developed by Apple Inc.

图1是根据本发明一个实施例的表单生成方法的主要流程示意图。本发明实施例的表单生成方法可由服务端执行。如图1所示,本发明实施例的表单生成方法包括:Fig. 1 is a schematic flow chart of a method for generating a form according to an embodiment of the present invention. The form generation method in the embodiment of the present invention can be executed by the server. As shown in Figure 1, the form generation method of the embodiment of the present invention includes:

步骤S101、接收客户端发送的表单获取请求。Step S101, receiving a form acquisition request sent by a client.

其中,所述表单获取请求可包括表单类型和表单标识(ID)。例如,表单类型为销售订单或报销单等等。Wherein, the form acquisition request may include form type and form identification (ID). For example, the form type is Sales Order or Expenses and so on.

步骤S102、根据所述表单获取请求获取对应的表单模板和表单数据。Step S102. Obtain the corresponding form template and form data according to the form acquisition request.

其中,所述表单模板包括表单项的属性信息。示例性的,所述表单项的属性信息包括以下至少一项:表单项对应的组件类型、数据类型、是否必填、数据长度、表单项的显示顺序。所述表单数据包括表单项的取值信息。例如,对于销售订单来说,表单数据可包括订单金额、订单明细、收货人和收货地址等表单项的取值信息。Wherein, the form template includes attribute information of form items. Exemplarily, the attribute information of the form item includes at least one of the following: component type corresponding to the form item, data type, whether it is required, data length, and display order of the form item. The form data includes value information of form items. For example, for a sales order, the form data may include value information of form items such as order amount, order details, consignee, and delivery address.

在一优选实施例中,所述表单模板、所述表单数据均可采用数据库表的存储形式,以便于对表单项的属性信息、取值信息进行增、删、改、查等数据操作。另外,所述表单模板也可采用XML文件或JSON文件的存储形式。In a preferred embodiment, both the form template and the form data can be stored in the form of a database table, so as to perform data operations such as adding, deleting, modifying, and checking the attribute information and value information of the form items. In addition, the form template may also be stored in the form of an XML file or a JSON file.

示例性的,当表单获取请求包括表单类型和表单标识时,步骤S102可包括:根据所述表单类型查询表单模板仓库,以获取对应的表单模板;根据所述表单标识查询表单数据仓库,以获取对应的表单数据。其中,所述表单模板仓库和所述表单数据仓库可以基于同一数据库(比如MySQL数据库)构建,也可以基于不同的数据库构建。Exemplarily, when the form acquisition request includes a form type and a form identifier, step S102 may include: querying the form template warehouse according to the form type to obtain the corresponding form template; querying the form data warehouse according to the form identifier to obtain The corresponding form data. Wherein, the form template warehouse and the form data warehouse may be constructed based on the same database (such as MySQL database), or may be constructed based on different databases.

具体实施时,当表单模板数据仓库和表单数据仓库均为采用SQL(结构化查询语言)进行数据操作的数据库时,所述根据所述表单类型查询表单模板仓库,以获取对应的表单模板的步骤进一步包括:根据所述表单类型生成第一SQL语句,然后根据第一SQL语句查询表单模板仓库,以得到对应的表单模板;所述根据所述表单标识查询表单数据仓库,以获取对应的表单数据的步骤进一步包括:根据所述表单标识生成第二SQL语句,然后根据第二SQL语句查询表单数据仓库,以得到对应的表单数据。During specific implementation, when both the form template data warehouse and the form data warehouse are databases using SQL (Structured Query Language) for data manipulation, the step of querying the form template warehouse according to the form type to obtain the corresponding form template It further includes: generating a first SQL statement according to the form type, and then querying the form template warehouse according to the first SQL statement to obtain the corresponding form template; said querying the form data warehouse according to the form identifier to obtain the corresponding form data The step further includes: generating a second SQL statement according to the form identifier, and then querying the form data warehouse according to the second SQL statement to obtain corresponding form data.

步骤S103、将所述对应的表单模板和表单数据发送至所述客户端,以使所述客户端根据所述对应的表单模板和表单数据渲染生成表单。Step S103 , sending the corresponding form template and form data to the client, so that the client renders and generates a form according to the corresponding form template and form data.

示例性的,步骤S103可包括:将所述对应的表单模板和表单数据进行封装,然后将封装得到的JSON字符串发送至所述客户端。另外,也可将所述对应的表单模板和表单数据封装成XML字符串,然后将封装得到的XML字符串发送至所述客户端。客户端在接收到所述对应的表单模板和表单数据之后,可通过通用的表单渲染引擎(或称为“渲染模块”)动态地生成表单。Exemplarily, step S103 may include: encapsulating the corresponding form template and form data, and then sending the encapsulated JSON string to the client. In addition, the corresponding form template and form data may also be encapsulated into an XML string, and then the encapsulated XML string may be sent to the client. After receiving the corresponding form template and form data, the client can dynamically generate the form through a common form rendering engine (or called "rendering module").

在本发明实施例中,通过将表单模板与表单数据存储在服务端,并在用户需要某一具体的表单时,根据客户端发送的表单获取请求获取对应的表单模板和表单数据,并将其返回至所述客户端,以使所述客户端能够根据所述对应的表单模板和表单数据动态地生成表单。通过以上步骤,能够提高表单开发效率,减少表单开发中的重复代码,降低表单开发中的代码维护成本。In the embodiment of the present invention, by storing the form template and form data in the server, and when the user needs a specific form, the corresponding form template and form data are obtained according to the form acquisition request sent by the client, and the return to the client, so that the client can dynamically generate a form according to the corresponding form template and form data. Through the above steps, the efficiency of form development can be improved, the repeated code in form development can be reduced, and the code maintenance cost in form development can be reduced.

图2是根据本发明另一实施例的表单生成方法的主要流程示意图。本发明实施例的表单生成方法可由客户端执行。如图2所示,本发明实施例的表单生成方法包括:Fig. 2 is a schematic flow chart of a method for generating a form according to another embodiment of the present invention. The form generation method in the embodiment of the present invention can be executed by the client. As shown in Figure 2, the form generation method of the embodiment of the present invention includes:

步骤S201、向服务端发送表单获取请求。Step S201, sending a form acquisition request to the server.

示例性的,所述表单获取请求可包括:表单类型和表单标识(ID)。其中,所述表单类型用于查找对应的表单模板,所述表单标识用于查找对应的表单数据。Exemplarily, the form acquisition request may include: form type and form identification (ID). Wherein, the form type is used to find the corresponding form template, and the form identifier is used to find the corresponding form data.

步骤S202、接收所述服务端返回的与所述表单获取请求对应的表单模板和表单数据。Step S202, receiving the form template and form data corresponding to the form acquisition request returned by the server.

其中,所述表单模板包括表单项的属性信息。示例性的,所述表单项的属性信息包括以下至少一项:表单项对应的组件类型、数据类型、是否必填、数据长度、表单项的显示顺序。所述表单数据包括表单项的取值信息。例如,对于销售订单来说,表单数据可包括订单金额、订单明细、收货人和收货地址等表单项的取值信息。比如,在某一销售订单的表单数据中,收货人这一表单项的取值信息为“张三”,收货地址这一表单项的取值信息为“北京市西城区金融大街19号”。Wherein, the form template includes attribute information of form items. Exemplarily, the attribute information of the form item includes at least one of the following: component type corresponding to the form item, data type, whether it is required, data length, and display order of the form item. The form data includes value information of form items. For example, for a sales order, the form data may include value information of form items such as order amount, order details, consignee, and delivery address. For example, in the form data of a sales order, the value information of the consignee form item is "Zhang San", and the value information of the delivery address form item is "No. 19 Financial Street, Xicheng District, Beijing ".

在一优选实施例中,所述表单模板、所述表单数据在服务端中均可采用数据库表的存储形式,以便于对表单项的属性信息、取值信息进行增、删、改、查等数据操作。另外,所述表单模板在服务端中也可采用XML文件或JSON文件的存储形式。In a preferred embodiment, both the form template and the form data can be stored in the form of a database table in the server, so as to add, delete, modify, check, etc. the attribute information and value information of the form item data manipulation. In addition, the form template may also be stored in an XML file or a JSON file in the server.

在该步骤中,客户端接收到的表单模板和表单数据可以是JSON字符串格式或XML字符串格式。In this step, the form template and form data received by the client may be in JSON string format or XML string format.

步骤S203、根据所述对应的表单模板和表单数据渲染生成表单。Step S203, rendering and generating a form according to the corresponding form template and form data.

具体来说,步骤S203可包括:Specifically, step S203 may include:

1)将所述服务端返回的所述对应的表单模板和表单数据解析成客户端支持的格式。例如,假设在某一表单模板记录的某一表单项对应的组件类型为“Text”,若客户端为Android的App,则客户端在进行解析时会将“Text”转换为“TextView”;若客户端为ios的App,则客户端在进行解析时会将“Text”转换为“UILable”。其中,“Text”、“TextView”以及“UILable”均表示文本框组件。1) Parsing the corresponding form template and form data returned by the server into a format supported by the client. For example, assuming that the component type corresponding to a form item recorded in a form template is "Text", if the client is an Android App, the client will convert "Text" to "TextView" when parsing; if If the client is an ios app, the client will convert "Text" to "UILable" when parsing. Among them, "Text", "TextView" and "UILable" all represent text box components.

2)然后根据解析后的表单模板进行组件渲染,并根据解析后的表单数据设置所述组件对应的取值信息,以生成表单。例如,假设某个表单模板包括5个表单项,这5个表单项的组件类型分别为输入框组件、日期选择组件、时间选择组件、单选组件、多选组件,则可根据解析后的表单模板对每个组件进行渲染,并根据解析后的表单数据设置每个组件对应的取值信息,以生成用户所需的表单。2) Then perform component rendering according to the parsed form template, and set value information corresponding to the component according to the parsed form data to generate a form. For example, suppose a form template includes 5 form items, and the component types of these 5 form items are input box component, date selection component, time selection component, radio component, and multi-selection component. The template renders each component, and sets the corresponding value information of each component according to the parsed form data to generate the form required by the user.

具体实施时,在接收到所述对应的表单模板和表单数据之后,客户端可通过通用的表单渲染引擎(或称为“渲染模块”)执行步骤S203,以动态地生成表单。示例性地,所述表单渲染引擎可包括以下至少一种组件:Tab组件、List组件(单据列表组件)、Table组件(表格组件)、输入框组件、日期选择组件、时间选择组件、单选组件、多选组件、参照选择组件等。其中,参照选择组件可理解为参照另一表单数据的选择器。比如,报销单的表单需要选择报销部门,则需要参照报销部门表单的数据。During specific implementation, after receiving the corresponding form template and form data, the client can execute step S203 through a common form rendering engine (or called "rendering module") to dynamically generate a form. Exemplarily, the form rendering engine may include at least one of the following components: Tab component, List component (document list component), Table component (table component), input box component, date selection component, time selection component, radio component , multi-select component, reference selection component, etc. Among them, the reference selection component can be understood as a selector that refers to another form data. For example, if the reimbursement form needs to select the reimbursement department, you need to refer to the data in the reimbursement department form.

在对表单模板和表单数据进行解析之后,表单渲染引擎可通过遍历解析后的表单模板和表单数据,获得组件的信息。例如,假设表单模板中某一表单项的组件类型为“输入框类型”,则可从解析后的表单模板获得输入框组件的如下信息:输入框组件的数据类型、是否必填、是否允许修改等等,从解析后的表单数据获得输入框组件对应的取值信息。假设解析后的表单模板中某一表单项的组件类型为“日期选择类型”,则可从解析后的表单模板获得日期选择组件的如下信息:日期选择组件的开始时间和结束时间、时间显示格式等等;从解析后的表单数据获得日期选择组件对应的取值信息。After parsing the form template and form data, the form rendering engine can obtain component information by traversing the parsed form template and form data. For example, assuming that the component type of a form item in the form template is "input box type", the following information of the input box component can be obtained from the parsed form template: the data type of the input box component, whether it is required, and whether it is allowed to be modified Wait, get the value information corresponding to the input box component from the parsed form data. Assuming that the component type of a form item in the parsed form template is "date selection type", the following information of the date selection component can be obtained from the parsed form template: the start time and end time of the date selection component, and the time display format etc.; obtain the value information corresponding to the date selection component from the parsed form data.

进一步,本发明实施例的方法还可包括:在监听到特定组件的取值改变时,自动修改与所述特定组件存在关联关系的组件的取值。比如,对于名称为“总价”的输入框组件,其与名称为“金额”的输入框组件、名称为“数量”的输入框组件存在关联关系“总价=金额*数量”。当监听到“金额”输入框组件或“数量”输入框组件的取值改变时,可通过公式执行器自动修改“总价”这一输入框组件的取值。Further, the method in this embodiment of the present invention may further include: automatically modifying the value of a component associated with the specific component when monitoring the value change of the specific component. For example, for an input box component named "total price", it has an association relationship with an input box component named "amount" and an input box component named "quantity" as "total price=amount*quantity". When the value change of the "amount" input box component or the "quantity" input box component is monitored, the value of the "total price" input box component can be automatically modified through the formula executor.

示例性的,公式执行器可支持聚合函数、数值函数、字符串函数、日期函数、逻辑函数等函数中的一个或多个。其中,聚合函数可包括以下一个或多个函数:求和、求平均、求最大值、求最小值、计数函数;数值函数可包括以下一个或多个函数:求绝对值、四舍五入、小数格式化函数;字符串函数可包括以下一个或多个函数:转小写、转大写、去掉空格、转字符、字符串替换、取字符串、字符串分割、字符串匹配函数等;日期函数可包括:获取当前日期函数;逻辑函数可包括:If条件函数。Exemplarily, the formula executor may support one or more of aggregate functions, numeric functions, string functions, date functions, logic functions and other functions. Among them, the aggregation function can include one or more of the following functions: sum, average, maximum value, minimum value, and count function; the numerical function can include one or more of the following functions: absolute value, rounding, decimal formatting Functions; string functions can include one or more of the following functions: convert lowercase, convert uppercase, remove spaces, convert characters, replace strings, fetch strings, split strings, string matching functions, etc.; date functions can include: get Current date function; logic function can include: If conditional function.

在本发明实施例中,通过在服务端存储表单模板和表单数据,并在用户需要某一具体的表单时,通过发送表单获取请求从服务端获取对应的表单模板和表单数据,再由通用的表单渲染引擎根据所述对应的表单模板和表单数据动态地生成表单,进而能够提高表单开发效率,减少表单开发中的重复代码,降低表单开发中的代码维护成本。In the embodiment of the present invention, the form template and form data are stored on the server side, and when the user needs a specific form, the corresponding form template and form data are obtained from the server side by sending a form acquisition request, and then the general The form rendering engine dynamically generates forms according to the corresponding form templates and form data, thereby improving form development efficiency, reducing repeated codes in form development, and reducing code maintenance costs in form development.

图3是根据本发明一个实施例的表单生成装置的主要模块示意图。本发明实施例的表单生成装置可设置在服务端。如图3所示,本发明实施例的表单生成装置300包括:接收模块301、获取模块302和发送模块303。Fig. 3 is a schematic diagram of main modules of a form generation device according to an embodiment of the present invention. The form generation device in the embodiment of the present invention can be set at the server end. As shown in FIG. 3 , the form generating apparatus 300 of the embodiment of the present invention includes: a receiving module 301 , an acquiring module 302 and a sending module 303 .

接收模块301,用于接收客户端发送的表单获取请求。The receiving module 301 is configured to receive a form acquisition request sent by a client.

其中,所述表单获取请求可包括表单类型和表单标识(ID)。例如,表单类型为销售订单或报销单等等。Wherein, the form acquisition request may include form type and form identification (ID). For example, the form type is Sales Order or Expenses and so on.

获取模块302,用于根据所述表单获取请求获取对应的表单模板和表单数据。The acquisition module 302 is configured to acquire the corresponding form template and form data according to the form acquisition request.

其中,所述表单模板包括表单项的属性信息。示例性的,所述表单项的属性信息包括以下至少一项:表单项对应的组件类型、数据类型、是否必填、数据长度、表单项的显示顺序。所述表单数据包括表单项的取值信息。例如,对于销售订单来说,表单数据可包括订单金额、订单明细、收货人和收货地址等表单项的取值信息。在一优选实施例中,所述表单模板、所述表单数据均可采用数据库表的存储形式,以便于对表单项的属性信息、取值信息进行增、删、改、查等数据操作。另外,所述表单模板也可采用XML文件或JSON文件的存储形式。Wherein, the form template includes attribute information of form items. Exemplarily, the attribute information of the form item includes at least one of the following: component type corresponding to the form item, data type, whether it is required, data length, and display order of the form item. The form data includes value information of form items. For example, for a sales order, the form data may include value information of form items such as order amount, order details, consignee, and delivery address. In a preferred embodiment, both the form template and the form data can be stored in the form of a database table, so as to perform data operations such as adding, deleting, modifying, and checking the attribute information and value information of the form items. In addition, the form template may also be stored in the form of an XML file or a JSON file.

示例性的,当表单获取请求包括表单类型和表单标识时,获取模块302获取对应的表单模板和表单数据可包括:获取模块302根据所述表单类型查询表单模板仓库,以获取对应的表单模板;获取模块302根据所述表单标识查询表单数据仓库,以获取对应的表单数据。其中,所述表单模板仓库和所述表单数据仓库可以基于同一数据库(比如MySQL数据库)构建,也可以基于不同的数据库构建。Exemplarily, when the form acquisition request includes a form type and a form identifier, acquiring the corresponding form template and form data by the acquiring module 302 may include: the acquiring module 302 queries the form template warehouse according to the form type to acquire the corresponding form template; The obtaining module 302 queries the form data warehouse according to the form identifier to obtain corresponding form data. Wherein, the form template warehouse and the form data warehouse may be constructed based on the same database (such as MySQL database), or may be constructed based on different databases.

具体实施时,当表单模板数据仓库和表单数据仓库均为采用SQL(结构化查询语言)进行数据操作的数据库时,获取模块302根据所述表单类型查询表单模板仓库,以获取对应的表单模板进一步包括:获取模块302根据所述表单类型生成第一SQL语句,然后根据第一SQL语句查询表单模板仓库,以得到对应的表单模板;获取模块302根据所述表单标识查询表单数据仓库,以获取对应的表单数据进一步包括:获取模块302根据所述表单标识生成第二SQL语句,然后根据第二SQL语句查询表单数据仓库,以得到对应的表单数据。During specific implementation, when both the form template data warehouse and the form data warehouse are databases using SQL (Structured Query Language) for data operations, the acquisition module 302 queries the form template warehouse according to the form type to obtain the corresponding form template further Including: the obtaining module 302 generates a first SQL statement according to the form type, and then queries the form template warehouse according to the first SQL statement to obtain the corresponding form template; the obtaining module 302 queries the form data warehouse according to the form identifier to obtain the corresponding form template. The form data further includes: the obtaining module 302 generates a second SQL statement according to the form identifier, and then queries the form data warehouse according to the second SQL statement to obtain corresponding form data.

发送模块303,用于将所述对应的表单模板和表单数据发送至所述客户端,以使所述客户端根据所述对应的表单模板和表单数据渲染生成表单。The sending module 303 is configured to send the corresponding form template and form data to the client, so that the client renders and generates a form according to the corresponding form template and form data.

具体来说,发送模块303可将所述对应的表单模板和表单数据进行封装,然后将封装得到的JSON字符串发送至所述客户端。另外,发送模块303也可将所述对应的表单模板和表单数据封装成XML字符串,然后将封装得到的XML字符串发送至所述客户端。客户端在接收到所述对应的表单模板和表单数据之后,可通过通用的表单渲染引擎(或称为“渲染模块”)动态地生成表单。Specifically, the sending module 303 can encapsulate the corresponding form template and form data, and then send the encapsulated JSON string to the client. In addition, the sending module 303 may also encapsulate the corresponding form template and form data into an XML string, and then send the encapsulated XML string to the client. After receiving the corresponding form template and form data, the client can dynamically generate the form through a common form rendering engine (or called "rendering module").

在本发明实施例中,通过将表单模板存储在表单模板仓库,将表单数据存储在表单数据仓库,并在用户需要某一具体的表单时,通过接收模块接收客户端的表单获取请求,通过获取模块获取对应的表单模板和表单数据,通过发送模块将对应的表单模板和表单数据发送至客户端,以使客户端能够根据所述对应的表单模板和表单数据动态地生成表单。本发明实施例的表单生成装置能够提高表单开发效率,减少表单开发中的重复代码,降低表单开发中的代码维护成本。In the embodiment of the present invention, the form template is stored in the form template warehouse, the form data is stored in the form data warehouse, and when the user needs a specific form, the form acquisition request of the client is received through the receiving module, and the form data is stored in the form data warehouse through the acquisition module Obtain the corresponding form template and form data, and send the corresponding form template and form data to the client through the sending module, so that the client can dynamically generate a form according to the corresponding form template and form data. The form generation device in the embodiment of the present invention can improve form development efficiency, reduce repeated codes in form development, and reduce code maintenance cost in form development.

图4是根据本发明另一实施例的表单生成装置的主要模块示意图。本发明实施例的表单生成装置可设置在客户端。如图4所示,本发明实施例的表单生成装置400包括:发送模块401、接收模块402和渲染模块403。Fig. 4 is a schematic diagram of main modules of a form generation device according to another embodiment of the present invention. The form generation device in the embodiment of the present invention can be set on the client side. As shown in FIG. 4 , the form generation apparatus 400 of the embodiment of the present invention includes: a sending module 401 , a receiving module 402 and a rendering module 403 .

发送模块401,用于向服务端发送表单获取请求。The sending module 401 is configured to send a form acquisition request to the server.

示例性的,所述表单获取请求可包括:表单类型和表单标识(ID)。其中,所述表单类型用于查找对应的表单模板,所述表单标识用于查找对应的表单数据。Exemplarily, the form acquisition request may include: form type and form identification (ID). Wherein, the form type is used to find the corresponding form template, and the form identifier is used to find the corresponding form data.

接收模块402,用于接收所述服务端返回的与所述表单获取请求对应的表单模板和表单数据。The receiving module 402 is configured to receive the form template and form data corresponding to the form acquisition request returned by the server.

其中,所述表单模板包括表单项的属性信息。示例性的,所述表单项的属性信息包括以下至少一项:表单项对应的组件类型、数据类型、是否必填、数据长度、表单项的显示顺序。所述表单数据包括表单项的取值信息。例如,对于销售订单来说,表单数据可包括订单金额、订单明细、收货人和收货地址等表单项的取值信息。在一优选实施例中,所述表单模板、所述表单数据在服务端中均可采用数据库表的存储形式,以便于对表单项的属性信息、取值信息进行增、删、改、查等数据操作。另外,所述表单模板在服务端中也可采用XML文件或JSON文件的存储形式。Wherein, the form template includes attribute information of form items. Exemplarily, the attribute information of the form item includes at least one of the following: component type corresponding to the form item, data type, whether it is required, data length, and display order of the form item. The form data includes value information of form items. For example, for a sales order, the form data may include value information of form items such as order amount, order details, consignee, and delivery address. In a preferred embodiment, both the form template and the form data can be stored in the form of a database table in the server, so as to add, delete, modify, check, etc. the attribute information and value information of the form item data manipulation. In addition, the form template may also be stored in an XML file or a JSON file in the server.

示例性的,接收模块402接收到的表单模板和表单数据可以是JSON字符串格式或XML字符串格式。Exemplarily, the form template and form data received by the receiving module 402 may be in JSON string format or XML string format.

渲染模块403,用于根据所述对应的表单模板和表单数据渲染生成表单。The rendering module 403 is configured to render and generate a form according to the corresponding form template and form data.

具体来说,渲染模块403将所述服务端返回的所述对应的表单模板和表单数据解析成客户端支持的格式;然后根据解析后的表单模板进行组件渲染,并根据解析后的表单数据设置所述组件对应的取值信息,以生成表单。例如,假设在某一表单模板记录的某一表单项对应的组件类型为“Text”,若客户端为Android的App,则渲染模块403在进行解析时会将“Text”转换为“TextView”;若客户端为ios的App,则渲染模块403在进行解析时会将“Text”转换为“UILable”。Specifically, the rendering module 403 parses the corresponding form template and form data returned by the server into a format supported by the client; then performs component rendering according to the parsed form template, and sets The value information corresponding to the component to generate the form. For example, assuming that the component type corresponding to a certain form item recorded in a certain form template is "Text", if the client is an Android App, the rendering module 403 will convert "Text" into "TextView" when parsing; If the client is an ios App, the rendering module 403 will convert "Text" into "UILable" when parsing.

示例性的,渲染模块403可包括以下至少一种组件:Tab组件、List组件(单据列表组件)、Table组件(表格组件)、输入框组件、日期选择组件、时间选择组件、单选组件、多选组件、参照选择组件等。其中,参照选择组件可理解为参照另一表单数据的选择器。比如,报销单的表单需要选择报销部门,则需要参照报销部门表单的数据。具体实施时,渲染模块403可通过遍历解析后的表单模板和表单数据,获得组件的信息。例如,假设解析后的表单模板中某一表单项的组件类型为“输入框类型”,则渲染模块403可从解析后的表单模板获得输入框组件的如下信息:输入框组件的数据类型、是否必填、是否允许修改等等。假设解析后的表单模板中某一表单项的组件类型为“日期选择类型”,则渲染模块403可从解析后的表单模板获得日期选择组件的如下信息:日期选择组件的开始时间和结束时间、时间显示格式等等。Exemplarily, the rendering module 403 may include at least one of the following components: Tab component, List component (receipt list component), Table component (table component), input box component, date selection component, time selection component, radio component, multiple Select components, select components by reference, etc. Among them, the reference selection component can be understood as a selector that refers to another form data. For example, if the reimbursement form needs to select the reimbursement department, you need to refer to the data in the reimbursement department form. During specific implementation, the rendering module 403 can obtain component information by traversing the parsed form template and form data. For example, assuming that the component type of a certain form item in the parsed form template is "input box type", the rendering module 403 can obtain the following information of the input box component from the parsed form template: the data type of the input box component, whether Required, whether modification is allowed, etc. Assuming that the component type of a form item in the parsed form template is "date selection type", the rendering module 403 can obtain the following information of the date selection component from the parsed form template: the start time and end time of the date selection component, Time display format and more.

进一步,本发明实施例的表单生成装置还可包括:公式执行器,用于在监听到特定组件的取值改变时,自动修改与所述特定组件存在关联关系的组件的取值。比如,对于名称为“总价”的输入框组件,其与名称为“金额”的输入框组件、名称为“数量”的输入框组件存在关联关系“总价=金额*数量”。当监听到“金额”输入框组件或“数量”输入框组件的取值改变时,公式执行器可自动修改“总价”这一输入框组件的取值。Further, the form generation device in the embodiment of the present invention may further include: a formula executor, configured to automatically modify the value of a component associated with the specific component when a value change of a specific component is detected. For example, for an input box component named "total price", it has an association relationship with an input box component named "amount" and an input box component named "quantity" as "total price=amount*quantity". When listening to the value change of the input box component of "amount" or the input box component of "quantity", the formula executor can automatically modify the value of the input box component of "total price".

示例性的,公式执行器可支持聚合函数、数值函数、字符串函数、日期函数、逻辑函数等函数中的一个或多个。其中,聚合函数可包括以下一个或多个函数:求和、求平均、求最大值、求最小值、计数函数;数值函数可包括以下一个或多个函数:求绝对值、四舍五入、小数格式化函数;字符串函数可包括以下一个或多个函数:转小写、转大写、去掉空格、转字符、字符串替换、取字符串、字符串分割、字符串匹配函数等;日期函数可包括:获取当前日期函数;逻辑函数可包括:If条件函数。Exemplarily, the formula executor may support one or more of aggregate functions, numeric functions, string functions, date functions, logic functions and other functions. Among them, the aggregation function can include one or more of the following functions: sum, average, maximum value, minimum value, and count function; the numerical function can include one or more of the following functions: absolute value, rounding, decimal formatting Functions; string functions can include one or more of the following functions: convert lowercase, convert uppercase, remove spaces, convert characters, replace strings, fetch strings, split strings, string matching functions, etc.; date functions can include: get Current date function; logic function can include: If conditional function.

在本发明实施例中,通过在服务端存储表单模板和表单数据,并在用户需要某一具体的表单时,通过发送模块发送表单获取请求,通过接收模块从服务端接收对应的表单模板和表单数据,通过通用的渲染模块根据所述对应的表单模板和表单数据动态地生成表单,能够提高表单开发效率,减少表单开发中的重复代码,降低表单开发中的代码维护成本。In the embodiment of the present invention, by storing the form template and form data on the server, and when the user needs a specific form, the sending module sends a form acquisition request, and the receiving module receives the corresponding form template and form from the server Data, the general rendering module dynamically generates forms according to the corresponding form templates and form data, which can improve the efficiency of form development, reduce repeated codes in form development, and reduce code maintenance costs in form development.

图5是根据本发明一个实施例的表单生成系统的组成示意图。如图5所示,本发明实施例的表单生成系统500包括:客户端501、服务端502。Fig. 5 is a schematic diagram of the composition of a form generating system according to an embodiment of the present invention. As shown in FIG. 5 , the form generating system 500 of the embodiment of the present invention includes: a client 501 and a server 502 .

客户端501,用于向服务端502发送表单获取请求。The client 501 is configured to send a form acquisition request to the server 502 .

其中,所述表单获取请求可包括:表单类型和表单标识(ID)。其中,所述表单类型用于查找对应的表单模板,所述表单标识用于查找对应的表单数据。Wherein, the form acquisition request may include: form type and form identification (ID). Wherein, the form type is used to find the corresponding form template, and the form identifier is used to find the corresponding form data.

服务端502,用于接收所述表单获取请求,并根据所述表单获取请求获取对应的表单模板和表单数据。The server 502 is configured to receive the form acquisition request, and acquire the corresponding form template and form data according to the form acquisition request.

其中,所述表单模板包括表单项的属性信息。示例性的,所述表单项的属性信息包括以下至少一项:表单项对应的组件类型、数据类型、是否必填、数据长度、表单项的显示顺序。所述表单数据包括表单项的取值信息。例如,对于销售订单来说,表单数据可包括订单金额、订单明细、收货人和收货地址等表单项的取值信息。在一优选实施例中,所述表单模板、所述表单数据均可采用数据库表的存储形式,以便于对表单项的属性信息、取值信息进行增、删、改、查等数据操作。另外,所述表单模板也可采用XML文件或JSON文件的存储形式。Wherein, the form template includes attribute information of form items. Exemplarily, the attribute information of the form item includes at least one of the following: component type corresponding to the form item, data type, whether it is required, data length, and display order of the form item. The form data includes value information of form items. For example, for a sales order, the form data may include value information of form items such as order amount, order details, consignee, and delivery address. In a preferred embodiment, both the form template and the form data can be stored in the form of a database table, so as to perform data operations such as adding, deleting, modifying, and checking the attribute information and value information of the form items. In addition, the form template may also be stored in the form of an XML file or a JSON file.

示例性的,当表单获取请求包括表单类型和表单标识时,服务端502获取对应的表单模板和表单数据可包括:服务端502根据所述表单类型查询表单模板仓库,以获取对应的表单模板;服务端502根据所述表单标识查询表单数据仓库,以获取对应的表单数据。Exemplarily, when the form obtaining request includes a form type and a form identifier, obtaining the corresponding form template and form data by the server 502 may include: the server 502 queries the form template warehouse according to the form type to obtain the corresponding form template; The server 502 queries the form data warehouse according to the form identifier to obtain corresponding form data.

服务端502,还用于将所述对应的表单模板和表单数据发送至客户端501。The server 502 is further configured to send the corresponding form template and form data to the client 501 .

具体来说,服务端502将所述对应的表单模板和表单数据发送至客户端501可包括:服务端502将所述对应的表单模板和表单数据进行封装,然后将封装后的JSON字符串发送至客户端。另外,也可将所述对应的表单模板和表单数据封装成XML字符串,然后将封装后的XML字符串发送至客户端。Specifically, the server 502 sending the corresponding form template and form data to the client 501 may include: the server 502 encapsulates the corresponding form template and form data, and then sends the encapsulated JSON string to the client. In addition, the corresponding form template and form data may also be encapsulated into an XML string, and then the encapsulated XML string may be sent to the client.

客户端501,还用于接收所述对应的表单模板和表单数据,然后根据所述对应的表单模板和表单数据渲染生成表单。The client 501 is further configured to receive the corresponding form template and form data, and then render and generate a form according to the corresponding form template and form data.

具体来说,客户端501根据所述对应的表单模板和表单数据渲染生成表单可包括:客户端501将所述服务端返回的所述对应的表单模板和表单数据解析成客户端支持的格式;然后根据解析后的表单模板进行组件渲染,并根据解析后的表单数据设置所述组件对应的取值信息,以生成表单。例如,假设在某一表单模板中记录的某一表单项对应的组件类型为“Text”,若客户端501为Android的App,则客户端501在进行解析时会将“Text”转换为“TextView”;若客户端501为ios的App,则客户端501在进行解析时会将“Text”转换为“UILable”。Specifically, the client 501 rendering and generating the form according to the corresponding form template and form data may include: the client 501 parsing the corresponding form template and form data returned by the server into a format supported by the client; Then perform component rendering according to the parsed form template, and set value information corresponding to the component according to the parsed form data to generate a form. For example, assuming that the component type corresponding to a certain form item recorded in a form template is "Text", if the client 501 is an Android app, then the client 501 will convert "Text" into "TextView" when parsing. "; if the client 501 is an ios App, the client 501 will convert "Text" to "UILable" when parsing.

具体实施时,在接收到所述对应的表单模板和表单数据之后,客户端501可通过通用的表单渲染引擎(或称为“渲染模块”)动态地生成表单。示例性的,所述表单渲染引擎可包括以下至少一种组件:Tab组件、List组件(单据列表组件)、Table组件(表格组件)、输入框组件、日期选择组件、时间选择组件、单选组件、多选组件、参照选择组件等。其中,参照选择组件可理解为参照另一表单数据的选择器。比如,报销单的表单需要选择报销部门,则需要参照报销部门表单的数据。During specific implementation, after receiving the corresponding form template and form data, the client 501 can dynamically generate a form through a common form rendering engine (or called a "rendering module"). Exemplarily, the form rendering engine may include at least one of the following components: Tab component, List component (document list component), Table component (table component), input box component, date selection component, time selection component, radio component , multi-select component, reference selection component, etc. Among them, the reference selection component can be understood as a selector that refers to another form data. For example, if the reimbursement form needs to select the reimbursement department, you need to refer to the data in the reimbursement department form.

进一步,客户端501还用于:在监听到特定组件的取值改变时,自动修改与所述特定组件存在关联关系的组件的取值。比如,对于名称为“总价”的输入框组件,其与名称为“金额”的输入框组件、名称为“数量”的输入框组件存在关联关系“总价=金额*数量”。当监听到“金额”输入框组件或“数量”输入框组件的取值改变时,客户端501可通过公式执行器自动修改“总价”这一输入框组件的取值。Further, the client 501 is further configured to: automatically modify the value of a component associated with the specific component when monitoring the value change of the specific component. For example, for an input box component named "total price", it has an association relationship with an input box component named "amount" and an input box component named "quantity" as "total price=amount*quantity". When listening to the value change of the input box component of "amount" or the input box component of "quantity", the client 501 can automatically modify the value of the input box component of "total price" through the formula executor.

示例性的,公式执行器可支持聚合函数、数值函数、字符串函数、日期函数、逻辑函数等函数中的一个或多个。其中,聚合函数可包括以下一个或多个函数:求和、求平均、求最大值、求最小值、计数函数;数值函数可包括以下一个或多个函数:求绝对值、四舍五入、小数格式化函数;字符串函数可包括以下一个或多个函数:转小写、转大写、去掉空格、转字符、字符串替换、取字符串、字符串分割、字符串匹配函数等;日期函数可包括:获取当前日期函数;逻辑函数可包括:If条件函数。Exemplarily, the formula executor may support one or more of aggregate functions, numeric functions, string functions, date functions, logic functions and other functions. Among them, the aggregation function can include one or more of the following functions: sum, average, maximum value, minimum value, and count function; the numerical function can include one or more of the following functions: absolute value, rounding, decimal formatting Functions; string functions can include one or more of the following functions: convert lowercase, convert uppercase, remove spaces, convert characters, replace strings, fetch strings, split strings, string matching functions, etc.; date functions can include: get Current date function; logic function can include: If conditional function.

在本发明实施例中,通过在服务端存储表单模板和表单数据,在客户端设置通用的表单渲染引擎,能够在用户需要某一具体的表单时动态地生成表单。本发明实施例的表单生成系统能够提高表单开发效率,减少表单开发中的重复代码,降低表单开发中的代码维护成本。In the embodiment of the present invention, by storing form templates and form data on the server side and setting a general form rendering engine on the client side, the form can be dynamically generated when the user needs a specific form. The form generating system in the embodiment of the present invention can improve form development efficiency, reduce repeated codes in form development, and reduce code maintenance cost in form development.

图6示出了可以应用本发明实施例的表单生成方法或表单生成装置的示例性系统架构600。Fig. 6 shows an exemplary system architecture 600 to which the form generation method or form generation device according to the embodiment of the present invention can be applied.

如图6所示,系统架构600可以包括终端设备601、602、603,网络604和服务器605。网络604用以在终端设备601、602、603和服务器605之间提供通信链路的介质。网络604可以包括各种连接类型,例如有线、无线通信链路或者光纤电缆等等。As shown in FIG. 6 , a system architecture 600 may include terminal devices 601 , 602 , and 603 , a network 604 and a server 605 . The network 604 is used as a medium for providing communication links between the terminal devices 601 , 602 , 603 and the server 605 . Network 604 may include various connection types, such as wires, wireless communication links, or fiber optic cables, among others.

用户可以使用终端设备601、602、603通过网络604与服务器605交互,以接收或发送消息等。终端设备601、602、603上可以安装有各种通讯客户端应用,例如购物类应用、网页浏览器应用、搜索类应用、即时通信工具、邮箱客户端、社交平台软件等。Users can use terminal devices 601 , 602 , 603 to interact with server 605 via network 604 to receive or send messages and the like. Various communication client applications can be installed on the terminal devices 601, 602, 603, such as shopping applications, web browser applications, search applications, instant messaging tools, email clients, social platform software, and the like.

终端设备601、602、603可以是具有显示屏并且支持网页浏览的各种电子设备,包括但不限于智能手机、平板电脑、膝上型便携计算机和台式计算机等等。The terminal devices 601, 602, 603 may be various electronic devices with display screens and supporting web browsing, including but not limited to smart phones, tablet computers, laptop computers, desktop computers and the like.

服务器605可以是提供各种服务的服务器,例如对用户利用终端设备601、602、603所浏览的购物类网站提供支持的后台管理服务器。后台管理服务器可以对接收到的表单获取请求等进行分析处理,并将处理结果(对应的表单模板和表单数据)反馈给终端设备。The server 605 may be a server that provides various services, such as a background management server that provides support for shopping websites browsed by users using the terminal devices 601 , 602 , and 603 . The background management server can analyze and process the received form acquisition request, etc., and feed back the processing result (corresponding form template and form data) to the terminal device.

需要说明的是,本发明实施例所提供的一种表单生成方法可由终端601、602、603执行,另一表单生成方法可由服务器605共同执行,相应地,本发明实施例提供的一种表单生成装置设置于终端中,另一表单生成装置设置于服务器605中。It should be noted that one form generation method provided by the embodiment of the present invention can be executed by the terminals 601, 602, and 603, and another form generation method can be jointly executed by the server 605. Correspondingly, a form generation method provided by the embodiment of the present invention The device is set in the terminal, and another form generating device is set in the server 605 .

应该理解,图6中的终端设备、网络和服务器的数目仅仅是示意性的。根据实现需要,可以具有任意数目的终端设备、网络和服务器。It should be understood that the numbers of terminal devices, networks and servers in FIG. 6 are only illustrative. According to the implementation needs, there can be any number of terminal devices, networks and servers.

图7示出了适于用来实现本发明实施例的电子设备的计算机系统700的结构示意图。图7示出的电子设备仅仅是一个示例,不应对本发明实施例的功能和使用范围带来任何限制。FIG. 7 shows a schematic structural diagram of a computer system 700 suitable for implementing an electronic device according to an embodiment of the present invention. The electronic device shown in FIG. 7 is only an example, and should not limit the functions and scope of use of this embodiment of the present invention.

如图7所示,计算机系统700包括中央处理单元(CPU)701,其可以根据存储在只读存储器(ROM)702中的程序或者从存储部分708加载到随机访问存储器(RAM)703中的程序而执行各种适当的动作和处理。在RAM 703中,还存储有系统700操作所需的各种程序和数据。CPU 701、ROM 702以及RAM 703通过总线704彼此相连。输入/输出(I/O)接口705也连接至总线704。As shown in FIG. 7 , a computer system 700 includes a central processing unit (CPU) 701 that can operate according to a program stored in a read-only memory (ROM) 702 or a program loaded from a storage section 708 into a random-access memory (RAM) 703 Instead, various appropriate actions and processes are performed. In the RAM 703, various programs and data necessary for the operation of the system 700 are also stored. The CPU 701 , ROM 702 , and RAM 703 are connected to each other via a bus 704 . An input/output (I/O) interface 705 is also connected to the bus 704 .

以下部件连接至I/O接口705:包括键盘、鼠标等的输入部分706;包括诸如阴极射线管(CRT)、液晶显示器(LCD)等以及扬声器等的输出部分707;包括硬盘等的存储部分708;以及包括诸如LAN卡、调制解调器等的网络接口卡的通信部分709。通信部分709经由诸如因特网的网络执行通信处理。驱动器710也根据需要连接至I/O接口705。可拆卸介质711,诸如磁盘、光盘、磁光盘、半导体存储器等等,根据需要安装在驱动器710上,以便于从其上读出的计算机程序根据需要被安装入存储部分708。The following components are connected to the I/O interface 705: an input section 706 including a keyboard, a mouse, etc.; an output section 707 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker; a storage section 708 including a hard disk, etc. and a communication section 709 including a network interface card such as a LAN card, a modem, or the like. The communication section 709 performs communication processing via a network such as the Internet. A drive 710 is also connected to the I/O interface 705 as needed. A removable medium 711 such as a magnetic disk, optical disk, magneto-optical disk, semiconductor memory, etc. is mounted on the drive 710 as necessary so that a computer program read therefrom is installed into the storage section 708 as necessary.

特别地,根据本发明公开的实施例,上文参考流程图描述的过程可以被实现为计算机软件程序。例如,本发明公开的实施例包括一种计算机程序产品,其包括承载在计算机可读介质上的计算机程序,该计算机程序包含用于执行流程图所示的方法的程序代码。在这样的实施例中,该计算机程序可以通过通信部分709从网络上被下载和安装,和/或从可拆卸介质711被安装。在该计算机程序被中央处理单元(CPU)701执行时,执行本发明的系统中限定的上述功能。In particular, according to the disclosed embodiments of the present invention, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, the disclosed embodiments of the present invention include a computer program product, which includes a computer program carried on a computer-readable medium, where the computer program includes program codes for executing the methods shown in the flowcharts. In such an embodiment, the computer program may be downloaded and installed from a network via communication portion 709 and/or installed from removable media 711 . When this computer program is executed by a central processing unit (CPU) 701, the above-described functions defined in the system of the present invention are performed.

需要说明的是,本发明所示的计算机可读介质可以是计算机可读信号介质或者计算机可读存储介质或者是上述两者的任意组合。计算机可读存储介质例如可以是——但不限于——电、磁、光、电磁、红外线、或半导体的系统、装置或器件,或者任意以上的组合。计算机可读存储介质的更具体的例子可以包括但不限于:具有一个或多个导线的电连接、便携式计算机磁盘、硬盘、随机访问存储器(RAM)、只读存储器(ROM)、可擦式可编程只读存储器(EPROM或闪存)、光纤、便携式紧凑磁盘只读存储器(CD-ROM)、光存储器件、磁存储器件、或者上述的任意合适的组合。在本发明中,计算机可读存储介质可以是任何包含或存储程序的有形介质,该程序可以被指令执行系统、装置或者器件使用或者与其结合使用。而在本发明中,计算机可读的信号介质可以包括在基带中或者作为载波一部分传播的数据信号,其中承载了计算机可读的程序代码。这种传播的数据信号可以采用多种形式,包括但不限于电磁信号、光信号或上述的任意合适的组合。计算机可读的信号介质还可以是计算机可读存储介质以外的任何计算机可读介质,该计算机可读介质可以发送、传播或者传输用于由指令执行系统、装置或者器件使用或者与其结合使用的程序。计算机可读介质上包含的程序代码可以用任何适当的介质传输,包括但不限于:无线、电线、光缆、RF等等,或者上述的任意合适的组合。It should be noted that the computer-readable medium shown in the present invention may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. A computer readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of computer-readable storage media may include, but are not limited to, electrical connections with one or more wires, portable computer diskettes, hard disks, random access memory (RAM), read-only memory (ROM), erasable Programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination of the above. In the present invention, a computer-readable storage medium may be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device. In the present invention, however, a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, in which computer-readable program codes are carried. Such propagated data signals may take many forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the foregoing. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium, which can send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device. . Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.

附图中的流程图和框图,图示了按照本发明各种实施例的系统、方法和计算机程序产品的可能实现的体系架构、功能和操作。在这点上,流程图或框图中的每个方框可以代表一个模块、程序段、或代码的一部分,上述模块、程序段、或代码的一部分包含一个或多个用于实现规定的逻辑功能的可执行指令。也应当注意,在有些作为替换的实现中,方框中所标注的功能也可以以不同于附图中所标注的顺序发生。例如,两个接连地表示的方框实际上可以基本并行地执行,它们有时也可以按相反的顺序执行,这依所涉及的功能而定。也要注意的是,框图或流程图中的每个方框、以及框图或流程图中的方框的组合,可以用执行规定的功能或操作的专用的基于硬件的系统来实现,或者可以用专用硬件与计算机指令的组合来实现。The flowchart and block diagrams in the Figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present invention. In this regard, each block in a flowchart or block diagram may represent a module, program segment, or portion of code that includes one or more logical functions for implementing specified executable instructions. It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or they may sometimes be executed in the reverse order, depending upon the functionality involved. It should also be noted that each block in the block diagrams or flowchart illustrations, and combinations of blocks in the block diagrams or flowchart illustrations, can be implemented by a dedicated hardware-based system that performs the specified function or operation, or can be implemented by a A combination of dedicated hardware and computer instructions.

描述于本发明实施例中所涉及到的模块可以通过软件的方式实现,也可以通过硬件的方式来实现。所描述的模块也可以设置在处理器中,例如,可以描述为:一种处理器包括接收模块、获取模块和发送模块。其中,这些模块的名称在某种情况下并不构成对该模块本身的限定,例如,接收模块还可以被描述为“接收客户端发送的表单获取请求的模块”。The modules involved in the embodiments described in the present invention may be realized by software or by hardware. The described modules may also be set in a processor, for example, it may be described as: a processor includes a receiving module, an acquiring module and a sending module. Wherein, the names of these modules do not constitute a limitation on the module itself under certain circumstances, for example, the receiving module may also be described as "a module that receives a form acquisition request sent by a client".

作为另一方面,本发明还提供了一种计算机可读介质,该计算机可读介质可以是上述实施例中描述的设备中所包含的;也可以是单独存在,而未装配入该设备中。上述计算机可读介质承载有一个或者多个程序,当上述一个或者多个程序被一个该设备执行时,使得该设备执行以下流程:接收客户端发送的表单获取请求;根据所述表单获取请求获取对应的表单模板和表单数据;所述表单模板包括表单项的属性信息,所述表单数据包括表单项的取值信息;将所述对应的表单模板和表单数据发送至所述客户端,以使所述客户端根据所述对应的表单模板和表单数据渲染生成表单。As another aspect, the present invention also provides a computer-readable medium. The computer-readable medium may be contained in the device described in the above embodiments, or it may exist independently without being assembled into the device. The above-mentioned computer-readable medium carries one or more programs, and when the above-mentioned one or more programs are executed by one of the devices, the device executes the following process: receiving a form acquisition request sent by the client; obtaining the form according to the form acquisition request Corresponding form template and form data; The form template includes the attribute information of the form item, and the form data includes the value information of the form item; The corresponding form template and form data are sent to the client, so that The client renders and generates a form according to the corresponding form template and form data.

上述具体实施方式,并不构成对本发明保护范围的限制。本领域技术人员应该明白的是,取决于设计要求和其他因素,可以发生各种各样的修改、组合、子组合和替代。任何在本发明的精神和原则之内所作的修改、等同替换和改进等,均应包含在本发明保护范围之内。The above specific implementation methods do not constitute a limitation to the protection scope of the present invention. It should be apparent to those skilled in the art that various modifications, combinations, sub-combinations and substitutions may occur depending on design requirements and other factors. Any modifications, equivalent replacements and improvements made within the spirit and principles of the present invention shall be included within the protection scope of the present invention.

Claims (17)

1.一种表单生成方法,其特征在于,所述方法包括:1. A method for generating a form, characterized in that the method comprises: 接收客户端发送的表单获取请求;Receive the form acquisition request sent by the client; 根据所述表单获取请求获取对应的表单模板和表单数据;所述表单模板包括表单项的属性信息,所述表单数据包括表单项的取值信息;Obtaining a corresponding form template and form data according to the form acquisition request; the form template includes attribute information of a form item, and the form data includes value information of the form item; 将所述对应的表单模板和表单数据发送至所述客户端,以使所述客户端根据所述对应的表单模板和表单数据渲染生成表单。Sending the corresponding form template and form data to the client, so that the client renders and generates a form according to the corresponding form template and form data. 2.根据权利要求1所述的方法,其特征在于,所述表单获取请求包括:表单类型和表单标识;所述根据所述表单获取请求获取对应的表单模板和表单数据的步骤包括:根据所述表单类型查询表单模板仓库,以获取对应的表单模板;根据所述表单标识查询表单数据仓库,以获取对应的表单数据。2. The method according to claim 1, wherein the form acquisition request comprises: a form type and a form identifier; the step of obtaining the corresponding form template and form data according to the form acquisition request comprises: according to the The form template warehouse is queried according to the form type to obtain the corresponding form template; the form data warehouse is queried according to the form identifier to obtain the corresponding form data. 3.根据权利要求2所述的方法,其特征在于,所述根据所述表单类型查询表单模板仓库,以获取对应的表单模板的步骤包括:根据所述表单类型生成第一SQL语句,然后根据第一SQL语句查询表单模板仓库,以得到对应的表单模板;所述根据所述表单标识查询表单数据仓库,以获取对应的表单数据的步骤包括:根据所述表单标识生成第二SQL语句,然后根据第二SQL语句查询表单数据仓库,以得到对应的表单数据。3. The method according to claim 2, wherein the step of querying the form template warehouse according to the form type to obtain the corresponding form template comprises: generating a first SQL statement according to the form type, and then according to the The first SQL statement queries the form template warehouse to obtain the corresponding form template; the step of querying the form data warehouse according to the form identifier to obtain the corresponding form data includes: generating a second SQL statement according to the form identifier, and then The form data warehouse is queried according to the second SQL statement to obtain corresponding form data. 4.根据权利要求1所述的方法,其特征在于,所述表单项的属性信息包括以下至少一项:表单项对应的组件类型、数据类型、是否必填、数据长度、表单项的显示顺序。4. The method according to claim 1, wherein the attribute information of the form item includes at least one of the following: component type corresponding to the form item, data type, whether it is required, data length, and display order of the form item . 5.根据权利要求1所述的方法,其特征在于,所述将所述对应的表单模板和表单数据发送至所述客户端的步骤包括:5. The method according to claim 1, wherein the step of sending the corresponding form template and form data to the client comprises: 将所述对应的表单模板和表单数据进行封装,然后将封装得到的JSON字符串发送至所述客户端。Encapsulate the corresponding form template and form data, and then send the encapsulated JSON string to the client. 6.一种表单生成方法,其特征在于,所述方法包括:6. A form generation method, characterized in that the method comprises: 向服务端发送表单获取请求;Send a form acquisition request to the server; 接收所述服务端返回的与所述表单获取请求对应的表单模板和表单数据;所述表单模板包括表单项的属性信息,所述表单数据包括表单项的取值信息;receiving the form template and form data corresponding to the form acquisition request returned by the server; the form template includes attribute information of the form item, and the form data includes value information of the form item; 根据所述对应的表单模板和表单数据渲染生成表单。A form is generated according to the corresponding form template and form data rendering. 7.根据权利要求6所述的方法,其特征在于,所述根据所述对应的表单模板和表单数据渲染生成表单的步骤包括:7. The method according to claim 6, wherein the step of rendering and generating a form according to the corresponding form template and form data comprises: 将所述服务端返回的所述对应的表单模板和表单数据解析成客户端支持的格式;然后根据解析后的表单模板进行组件渲染,并根据解析后的表单数据设置所述组件对应的取值信息,以生成表单。Parse the corresponding form template and form data returned by the server into a format supported by the client; then perform component rendering according to the parsed form template, and set the corresponding value of the component according to the parsed form data information to generate the form. 8.根据权利要求7所述的方法,其特征在于,所述方法还包括:8. The method according to claim 7, further comprising: 在监听到特定组件的取值改变时,自动修改与所述特定组件存在关联关系的组件的取值。When the value change of a specific component is detected, the value of the component associated with the specific component is automatically modified. 9.一种表单生成装置,其特征在于,所述装置包括:9. A form generation device, characterized in that the device comprises: 接收模块,用于接收客户端发送的表单获取请求;The receiving module is used to receive the form acquisition request sent by the client; 获取模块,用于根据所述表单获取请求获取对应的表单模板和表单数据;所述表单模板包括表单项的属性信息,所述表单数据包括表单项的取值信息;An acquisition module, configured to acquire a corresponding form template and form data according to the form acquisition request; the form template includes attribute information of form items, and the form data includes value information of form items; 发送模块,用于将所述对应的表单模板和表单数据发送至所述客户端,以使所述客户端根据所述对应的表单模板和表单数据渲染生成表单。A sending module, configured to send the corresponding form template and form data to the client, so that the client renders and generates a form according to the corresponding form template and form data. 10.根据权利要求9所述的装置,其特征在于,所述表单获取请求包括:表单类型和表单标识;所述获取模块根据所述表单获取请求获取对应的表单模板和表单数据包括:所述获取模块根据所述表单类型查询表单模板仓库,以获取对应的表单模板;所述获取模块根据所述表单标识查询表单数据仓库,以获取对应的表单数据。10. The device according to claim 9, wherein the form acquisition request includes: a form type and a form identifier; the acquisition module acquires a corresponding form template and form data according to the form acquisition request comprising: the The obtaining module queries the form template warehouse according to the form type to obtain the corresponding form template; the obtaining module queries the form data warehouse according to the form identifier to obtain the corresponding form data. 11.根据权利要求10所述的装置,其特征在于,所述获取模块根据所述表单类型查询表单模板仓库,以获取对应的表单模板包括:所述获取模块根据所述表单类型生成第一SQL语句,然后根据第一SQL语句查询表单模板仓库,以得到对应的表单模板;所述获取模块根据所述表单标识查询表单数据仓库,以获取对应的表单数据包括:所述获取模块根据所述表单标识生成第二SQL语句,然后根据第二SQL语句查询表单数据仓库,以得到对应的表单数据。11. The device according to claim 10, wherein the obtaining module queries the form template warehouse according to the form type, so as to obtain the corresponding form template comprises: the obtaining module generates a first SQL according to the form type statement, and then query the form template warehouse according to the first SQL statement to obtain the corresponding form template; the acquisition module queries the form data warehouse according to the form identifier to obtain the corresponding form data. The identification generates a second SQL statement, and then queries the form data warehouse according to the second SQL statement to obtain corresponding form data. 12.根据权利要求9所述的装置,其特征在于,所述发送模块将所述对应的表单模板和表单数据发送至所述客户端包括:12. The device according to claim 9, wherein sending the corresponding form template and form data to the client by the sending module comprises: 所述发送模块将所述对应的表单模板和表单数据进行封装,然后将封装得到的JSON字符串发送至所述客户端。The sending module encapsulates the corresponding form template and form data, and then sends the encapsulated JSON string to the client. 13.一种表单生成装置,其特征在于,所述装置包括:13. A form generation device, characterized in that the device comprises: 发送模块,用于向服务端发送表单获取请求;The sending module is used to send a form acquisition request to the server; 接收模块,用于接收所述服务端返回的与所述表单获取请求对应的表单模板和表单数据;所述表单模板包括表单项的属性信息,所述表单数据包括表单项的取值信息;A receiving module, configured to receive a form template and form data corresponding to the form acquisition request returned by the server; the form template includes attribute information of form items, and the form data includes value information of form items; 渲染模块,用于根据所述对应的表单模板和表单数据渲染生成表单。A rendering module, configured to render and generate a form according to the corresponding form template and form data. 14.根据权利要求13所述的装置,其特征在于,所述渲染模块根据所述对应的表单模板和表单数据渲染生成表单包括:14. The device according to claim 13, wherein said rendering module rendering and generating a form according to said corresponding form template and form data comprises: 所述渲染模块将所述服务端返回的所述对应的表单模板和表单数据解析成客户端支持的格式;然后根据解析后的表单模板进行组件渲染,并根据解析后的表单数据设置所述组件对应的取值信息,以生成表单。The rendering module parses the corresponding form template and form data returned by the server into a format supported by the client; then performs component rendering according to the parsed form template, and sets the components according to the parsed form data Corresponding value information to generate the form. 15.根据权利要求13所述的装置,其特征在于,所述装置还包括:15. The device according to claim 13, further comprising: 公式执行器,用于在监听到特定组件的取值改变时,自动修改与所述特定组件存在关联关系的组件的取值。The formula executor is configured to automatically modify the value of a component associated with the specific component when the value change of the specific component is monitored. 16.一种电子设备,其特征在于,包括:16. An electronic device, characterized in that it comprises: 一个或多个处理器;one or more processors; 存储装置,用于存储一个或多个程序,storage means for storing one or more programs, 当所述一个或多个程序被所述一个或多个处理器执行,使得所述一个或多个处理器实现如权利要求1至8中任一所述的方法。When the one or more programs are executed by the one or more processors, the one or more processors are made to implement the method according to any one of claims 1-8. 17.一种计算机可读介质,其上存储有计算机程序,其特征在于,所述程序被处理器执行时实现如权利要求1至8中任一所述的方法。17. A computer-readable medium, on which a computer program is stored, wherein, when the program is executed by a processor, the method according to any one of claims 1 to 8 is implemented.
CN201810442671.1A 2018-05-10 2018-05-10 List generation method and device Pending CN110472207A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810442671.1A CN110472207A (en) 2018-05-10 2018-05-10 List generation method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810442671.1A CN110472207A (en) 2018-05-10 2018-05-10 List generation method and device

Publications (1)

Publication Number Publication Date
CN110472207A true CN110472207A (en) 2019-11-19

Family

ID=68503913

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810442671.1A Pending CN110472207A (en) 2018-05-10 2018-05-10 List generation method and device

Country Status (1)

Country Link
CN (1) CN110472207A (en)

Cited By (18)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110941614A (en) * 2019-11-21 2020-03-31 望海康信(北京)科技股份公司 Form generation method and device, electronic equipment and computer readable storage medium
CN111857712A (en) * 2020-06-30 2020-10-30 深圳市中农易讯信息技术有限公司 Form processing method, device, terminal and medium
CN111858104A (en) * 2020-07-31 2020-10-30 中国工商银行股份有限公司 Multi-end adaptive form generation method, device, equipment and medium
CN112199373A (en) * 2020-09-24 2021-01-08 中国建设银行股份有限公司 Form development method and system
CN112257005A (en) * 2020-11-10 2021-01-22 北京乐我无限科技有限责任公司 Form component generation method and device
CN112783492A (en) * 2020-12-31 2021-05-11 杭州趣链科技有限公司 Method and device for rendering driving form applied to block chain management platform
CN112836479A (en) * 2020-12-30 2021-05-25 佛山欧神诺云商科技有限公司 Data report generation method, system and storage device
CN112989770A (en) * 2021-04-07 2021-06-18 北京京东振世信息技术有限公司 Form generation method, device and system, electronic equipment and storage medium
CN113049254A (en) * 2021-03-11 2021-06-29 一汽解放汽车有限公司 Engine test bed operation control method and device and computer equipment
CN113126986A (en) * 2021-04-12 2021-07-16 北京明略昭辉科技有限公司 Dynamic data-based form item rendering method, system, equipment and storage medium
CN113361241A (en) * 2021-06-21 2021-09-07 深圳平安智汇企业信息管理有限公司 Table configuration method and device, computer equipment and storage medium
CN113448660A (en) * 2020-03-25 2021-09-28 北京京东振世信息技术有限公司 Data processing method and device
CN113742628A (en) * 2021-09-08 2021-12-03 北京沃东天骏信息技术有限公司 Form processing method and device, computer readable storage medium and electronic equipment
CN113761864A (en) * 2021-09-09 2021-12-07 湖南快乐阳光互动娱乐传媒有限公司 Form amount calculation method and device, electronic equipment and computer storage medium
CN113760947A (en) * 2020-12-24 2021-12-07 北京京东尚科信息技术有限公司 Data center, data processing method, device, equipment and storage medium
CN114003220A (en) * 2021-12-30 2022-02-01 思创数码科技股份有限公司 Workflow model implementation method, system, readable storage medium and computer equipment
CN114492337A (en) * 2020-11-12 2022-05-13 永中软件股份有限公司 Method for generating form by clicking component in browser based on JavaScript
CN115098212A (en) * 2022-07-13 2022-09-23 南威软件股份有限公司 Method for realizing form generation, data authority filtering and flexible data file falling

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103077185A (en) * 2012-12-18 2013-05-01 厦门雅迅网络股份有限公司 Object-based user-defined information-expanding method
CN104899186A (en) * 2015-06-24 2015-09-09 郑州悉知信息技术有限公司 Form generating and obtaining method and device
CN105843945A (en) * 2016-04-08 2016-08-10 联动优势科技有限公司 Report generation method and system
US20170242835A1 (en) * 2016-02-23 2017-08-24 Wolfram Research, Inc. Methods and systems for generating electronic forms
CN107729003A (en) * 2017-11-20 2018-02-23 江苏神州信源系统工程有限公司 Automatic generation method, device and the electronic equipment of code

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103077185A (en) * 2012-12-18 2013-05-01 厦门雅迅网络股份有限公司 Object-based user-defined information-expanding method
CN104899186A (en) * 2015-06-24 2015-09-09 郑州悉知信息技术有限公司 Form generating and obtaining method and device
US20170242835A1 (en) * 2016-02-23 2017-08-24 Wolfram Research, Inc. Methods and systems for generating electronic forms
CN105843945A (en) * 2016-04-08 2016-08-10 联动优势科技有限公司 Report generation method and system
CN107729003A (en) * 2017-11-20 2018-02-23 江苏神州信源系统工程有限公司 Automatic generation method, device and the electronic equipment of code

Cited By (22)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110941614A (en) * 2019-11-21 2020-03-31 望海康信(北京)科技股份公司 Form generation method and device, electronic equipment and computer readable storage medium
CN113448660A (en) * 2020-03-25 2021-09-28 北京京东振世信息技术有限公司 Data processing method and device
CN111857712A (en) * 2020-06-30 2020-10-30 深圳市中农易讯信息技术有限公司 Form processing method, device, terminal and medium
CN111858104A (en) * 2020-07-31 2020-10-30 中国工商银行股份有限公司 Multi-end adaptive form generation method, device, equipment and medium
CN111858104B (en) * 2020-07-31 2023-09-12 中国工商银行股份有限公司 Multi-terminal adaptive form generation method, device, equipment and medium
CN112199373A (en) * 2020-09-24 2021-01-08 中国建设银行股份有限公司 Form development method and system
CN112257005A (en) * 2020-11-10 2021-01-22 北京乐我无限科技有限责任公司 Form component generation method and device
CN112257005B (en) * 2020-11-10 2024-04-19 北京乐我无限科技有限责任公司 Form component generation method and device
CN114492337A (en) * 2020-11-12 2022-05-13 永中软件股份有限公司 Method for generating form by clicking component in browser based on JavaScript
CN113760947A (en) * 2020-12-24 2021-12-07 北京京东尚科信息技术有限公司 Data center, data processing method, device, equipment and storage medium
CN112836479A (en) * 2020-12-30 2021-05-25 佛山欧神诺云商科技有限公司 Data report generation method, system and storage device
CN112783492B (en) * 2020-12-31 2025-01-17 杭州趣链科技有限公司 Driving form rendering method and device applied to block chain management platform
CN112783492A (en) * 2020-12-31 2021-05-11 杭州趣链科技有限公司 Method and device for rendering driving form applied to block chain management platform
CN113049254A (en) * 2021-03-11 2021-06-29 一汽解放汽车有限公司 Engine test bed operation control method and device and computer equipment
CN112989770B (en) * 2021-04-07 2024-05-17 北京京东振世信息技术有限公司 Form generation method, device and system, electronic equipment and storage medium
CN112989770A (en) * 2021-04-07 2021-06-18 北京京东振世信息技术有限公司 Form generation method, device and system, electronic equipment and storage medium
CN113126986A (en) * 2021-04-12 2021-07-16 北京明略昭辉科技有限公司 Dynamic data-based form item rendering method, system, equipment and storage medium
CN113361241A (en) * 2021-06-21 2021-09-07 深圳平安智汇企业信息管理有限公司 Table configuration method and device, computer equipment and storage medium
CN113742628A (en) * 2021-09-08 2021-12-03 北京沃东天骏信息技术有限公司 Form processing method and device, computer readable storage medium and electronic equipment
CN113761864A (en) * 2021-09-09 2021-12-07 湖南快乐阳光互动娱乐传媒有限公司 Form amount calculation method and device, electronic equipment and computer storage medium
CN114003220A (en) * 2021-12-30 2022-02-01 思创数码科技股份有限公司 Workflow model implementation method, system, readable storage medium and computer equipment
CN115098212A (en) * 2022-07-13 2022-09-23 南威软件股份有限公司 Method for realizing form generation, data authority filtering and flexible data file falling

Similar Documents

Publication Publication Date Title
CN110472207A (en) List generation method and device
CN110689268B (en) Method and device for extracting indexes
CN110795315A (en) Method and device for monitoring service
CN110764770A (en) Method and device for conversion and assignment between objects
CN108959294B (en) Method and device for accessing search engine
CN110134427A (en) A method and device for generating code files
CN113760240B (en) Method and device for generating data model
CN112818026A (en) Data integration method and device
WO2021169553A1 (en) Method and apparatus for processing order
CN110851343A (en) A test method and device based on decision tree
CN110688355A (en) Method and device for changing container state
CN113704222A (en) Method and device for processing service request
CN113704242A (en) Data processing method and device
CN112148705A (en) Data migration method and device
CN112948138A (en) Method and device for processing message
CN110705935A (en) Logistics document processing method and device
CN114817297A (en) Method and device for processing data
CN112131287A (en) Method and device for reading data
CN113760279A (en) Method and device for generating page
CN113448960A (en) Method and device for importing form file
CN113065920B (en) Data processing method and system
CN112486978A (en) Method and device for storing object characteristic attribute and inquiring object data
CN112988857A (en) Service data processing method and device
CN112948472A (en) Data processing method, device, equipment and computer readable medium
CN111258572A (en) Method and device for generating business code framework

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication

Application publication date: 20191119