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
list
data
templat
client
item
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

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

List generation method and device
Technical field
The present invention relates to field of computer technology more particularly to a kind of list generation method and devices.
Background technique
In today of mobile Internet fast development, more and more lists, which are filled in, has been transplanted to mobile terminal.In existing skill In art, front and back end needs individually to develop various lists using respective platform language.For example, when increasing a list class newly When type, front end needs to put into the logic in the interface development and new table of a large amount of manpower progress new table between form item Handle work, rear end needs to store the data of new table, and need to increase for new table additions and deletions change look into etc. it is various The interface of operation.
In realizing process of the present invention, inventor's discovery at least there are the following problems in the prior art existing list exploitation Method it will take a lot of manpower and time cost, intricate operation and development efficiency is low;Before modifying certain service logics needs Version is sent out at end again, and audit time is too long;Code maintenance higher cost, and code can not be multiplexed.
Summary of the invention
In view of this, the present invention provides a kind of list generation method and device, list development efficiency, reduction table can be improved Duplicated code in single exploitation reduces the code maintenance cost in list exploitation.
To achieve the above object, according to the first aspect of the invention, a kind of list generation method is provided.
List generation method of the invention includes: the list acquisition request for receiving client and sending;It is obtained according to the list Take the corresponding form templat of request and form data;The form templat includes the attribute information of form item, the list Data include 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.
Optionally, the list acquisition request includes: form types and list mark;It is described to be asked according to list acquisition Ask the step of obtaining corresponding form templat and form data include: according to the form types inquiry form template warehouse, with Obtain corresponding form templat;According to the list identification look-up table forms data warehouse, to obtain corresponding form data.
Optionally, described according to the form types inquiry form template warehouse, to obtain the step of corresponding form templat It suddenly include: to generate the first SQL statement according to the form types, then according to the first SQL statement inquiry form template warehouse, with Obtain corresponding form templat;It is described according to the list identification look-up table forms data warehouse, to obtain corresponding form data The step of include: according to the list identify generate the second SQL statement, then according to the second SQL statement inquiry form data bins Library, to obtain corresponding form data.
Optionally, the attribute information of the form item includes at least one of the following: the corresponding component type of form item, data Whether type must fill out, the display order of data length, form item.
Optionally, the described the step of corresponding form templat and form data are sent to the client, includes: The corresponding form templat and form data are packaged, the JSON character string that encapsulation obtains then is sent to the visitor Family end.
To achieve the above object, according to the second aspect of the invention, a kind of list generation method is provided.
List generation method of the invention includes: to send list acquisition request to server-side;The server-side is received to return Form templat corresponding with the list acquisition request and form data;The form templat includes the attribute letter of form item Breath, the form data includes the value information of form item;It is generated according to the corresponding form templat and form data rendering List.
Optionally, it is described according to the corresponding form templat and form data rendering generate list the step of include: by The corresponding form templat and form data that the server-side returns are parsed into the format of client support;Then according to solution Form templat after analysis carries out component rendering, and the corresponding value information of the component is arranged according to the form data after parsing, To generate list.
Optionally, the method also includes: when the value for listening to specific components changes, automatic modification with it is described specific There are the values of the component of incidence relation for component.
To achieve the above object, according to the third aspect of the present invention, a kind of list generating means are provided.
List generating means of the invention include: receiving module, for receiving the list acquisition request of client transmission;It obtains Modulus block, for obtaining corresponding form templat and form data according to the list acquisition request;The form templat includes The attribute information of form item, the form data include the value information of form item;Sending module is used for the corresponding table Single mode plate and form data are sent to the client, so that the client is according to the corresponding form templat and list number List is generated according to rendering.
Optionally, the list acquisition request includes: form types and list mark;The acquisition module is according to the table Single acquisition request obtains corresponding form templat and form data includes: the acquisition module according to the form types inquiry table Single mode plate warehouse, to obtain corresponding form templat;The acquisition module according to the list identification look-up table forms data warehouse, To obtain corresponding form data.
Optionally, the acquisition module is according to the form types inquiry form template warehouse, to obtain corresponding list Template includes: the acquisition module according to the form types the first SQL statement of generation, is then inquired according to the first SQL statement Form templat warehouse, to obtain corresponding form templat;The acquisition module is according to the list identification look-up table forms data storehouse Library includes: the acquisition module according to list mark the second SQL statement of generation to obtain corresponding form data, then According to the second SQL statement inquiry form data warehouse, to obtain corresponding form data.
Optionally, the corresponding form templat and form data are sent to the client packet by the sending module Include: the corresponding form templat and form data are packaged by the sending module, the JSON word for then obtaining encapsulation Symbol string is sent to the client.
To achieve the above object, according to the fourth aspect of the present invention, a kind of list generating means are provided.
List generating means of the invention include: sending module, for sending list acquisition request to server-side;Receive mould Block, the form templat corresponding with the list acquisition request and form data returned for receiving the server-side;The table Single mode plate includes the attribute information of form item, and the form data includes the value information of form item;Rendering module is used for basis The corresponding form templat and form data rendering generate list.
Optionally, the rendering module includes: according to the corresponding form templat and form data rendering generation list The corresponding form templat that the server-side returns and form data are parsed into client support by the rendering module Format;Then component rendering is carried out according to the form templat after parsing, and the component is arranged according to the form data after parsing Corresponding value information, to generate list.
Optionally, described device further include: formula actuator, for listen to specific components value change when, from There are the values of the component of incidence relation with the specific components for dynamic modification.
To achieve the above object, according to the fifth aspect of the present invention, a kind of electronic equipment is provided.
Electronic equipment of the invention, comprising: one or more processors;And storage device, for storing one or more A program;When one or more of programs are executed by one or more of processors, so that one or more of processing Device realizes the list generation method of first aspect of the present invention or the second aspect of the present invention.
To achieve the above object, according to the sixth aspect of the invention, a kind of computer-readable medium is provided.
Computer-readable medium of the invention is stored thereon with computer program, real when described program is executed by processor The list generation method of existing first aspect or the second aspect of the present invention.
One embodiment in foregoing invention has the following advantages that or the utility model has the advantages that the list sent by receiving client Acquisition request obtains corresponding form templat and form data according to the list acquisition request, by the corresponding list mould Plate and form data are sent to these steps of the client, the client can be made according to the corresponding form templat and Form data rendering generates list, improves list development efficiency, reduces the duplicated code in list exploitation, reduces in list exploitation Code maintenance cost.
Further effect possessed by above-mentioned non-usual optional way adds hereinafter in conjunction with specific embodiment With explanation.
Detailed description of the invention
Attached drawing for a better understanding of the present invention, does not constitute an undue limitation on the present invention.Wherein:
Fig. 1 is the main flow schematic diagram of list generation method according to an embodiment of the invention;
Fig. 2 is the main flow schematic diagram of list generation method according to another embodiment of the present invention;
Fig. 3 is the main modular schematic diagram of list generating means according to an embodiment of the invention;
Fig. 4 is the main modular schematic diagram of list generating means according to another embodiment of the present invention;
Fig. 5 is the composition schematic diagram of form generation system according to an embodiment of the invention;
Fig. 6 is that the embodiment of the present invention can be applied to exemplary system architecture figure therein;
Fig. 7 is adapted for the structural schematic diagram for the computer system for realizing the electronic equipment of the embodiment of the present invention.
Specific embodiment
Below in conjunction with attached drawing, an exemplary embodiment of the present invention will be described, including the various of the embodiment of the present invention Details should think them only exemplary to help understanding.Therefore, those of ordinary skill in the art should recognize It arrives, it can be with various changes and modifications are made to the embodiments described herein, without departing from scope and spirit of the present invention.Together Sample, for clarity and conciseness, descriptions of well-known functions and structures are omitted from the following description.
It should be pointed out that in the absence of conflict, the feature in embodiment and embodiment in the present invention can be with It is combined with each other.
Before the embodiment of the present invention is discussed in detail, first to the present embodiments relate to portion of techniques term say It is bright.
List: being the form that a kind of acquisition of data, data are shown.
MySQL: being a Relational DBMS.
App:Application refers to executable application program.
Android: it is the operating system of a kind of freedom based on Linux and open source code, is mainly used for mobile device.
Ios: being the Mobile operating system developed by Apple Inc..
Fig. 1 is the main flow schematic diagram of list generation method according to an embodiment of the invention.The embodiment of the present invention List generation method can be executed by server-side.As shown in Figure 1, the list generation method of the embodiment of the present invention includes:
Step S101, the list acquisition request that client is sent is received.
Wherein, the list acquisition request may include form types and list mark (ID).For example, form types are sale Order or expense report etc..
Step S102, corresponding form templat and form data are obtained according to the list acquisition request.
Wherein, the form templat includes the attribute information of form item.Illustratively, the attribute information packet of the form item Include at least one of following: the corresponding component type of form item, data type, whether must fill out, the display of data length, form item it is suitable Sequence.The form data includes the value information of form item.For example, form data may include order for sales order The value information of the form items such as the amount of money, order detail, consignee and shipping address.
In a preferred embodiment, the storage form of database table can be used in the form templat, the form data, In order to which the attribute information to form item, value information such as are increased, delete, change, look at the data manipulations.In addition, the form templat The storage form of XML file or JSON file can also be used.
Illustratively, when list acquisition request includes form types and list identifies, step S102 can include: according to institute Form types inquiry form template warehouse is stated, to obtain corresponding form templat;According to the list identification look-up table forms data Warehouse, to obtain corresponding form data.Wherein, the form templat warehouse and the form data warehouse can be based on same Database (such as MySQL database) building, can also be based on different database sharings.
When it is implemented, when form templat data warehouse and form data warehouse are using SQL (structuralized query language Speech) carry out data manipulation database when, it is described according to the form types inquiry form template warehouse, to obtain corresponding table The step of single mode plate, further comprises: generating the first SQL statement according to the form types, is then looked into according to the first SQL statement Form templat warehouse is ask, to obtain corresponding form templat;It is described according to the list identification look-up table forms data warehouse, to obtain The step of taking corresponding form data further comprises: being identified according to the list and generates the second SQL statement, then according to second SQL statement inquiry form data warehouse, to obtain corresponding form data.
Step S103, the corresponding form templat and form data are sent to the client, so that the client End generates list according to the corresponding form templat and form data rendering.
Illustratively, step S103 can include: the corresponding form templat and form data are packaged, then will It encapsulates obtained JSON character string and is sent to the client.In addition, can also be by the corresponding form templat and form data It is packaged into XML character string, the XML character string that encapsulation obtains then is sent to the client.Client receive it is described It, can be by general list rendering engine (or being " rendering module ") dynamically after corresponding form templat and form data Generate list.
In embodiments of the present invention, by the way that form templat and form data are stored in server-side, and certain is needed in user When one specific list, corresponding form templat and form data are obtained according to the list acquisition request that client is sent, and will It is back to the client, so that the client can dynamically give birth to according to the corresponding form templat and form data At list.By above step, list development efficiency can be improved, reduce the duplicated code in list exploitation, reduce list and open Code maintenance cost in hair.
Fig. 2 is the main flow schematic diagram of list generation method according to another embodiment of the present invention.The embodiment of the present invention List generation method can be by client executing.As shown in Fig. 2, the list generation method of the embodiment of the present invention includes:
Step S201, list acquisition request is sent to server-side.
Illustratively, the list acquisition request can include: form types and list mark (ID).Wherein, the list Type is for searching corresponding form templat, and the list mark is for searching corresponding form data.
Step S202, form templat corresponding with the list acquisition request and list number that the server-side returns are received According to.
Wherein, the form templat includes the attribute information of form item.Illustratively, the attribute information packet of the form item Include at least one of following: the corresponding component type of form item, data type, whether must fill out, the display of data length, form item it is suitable Sequence.The form data includes the value information of form item.For example, form data may include order for sales order The value information of the form items such as the amount of money, order detail, consignee and shipping address.For example, in the list number of a certain sales order In, the value information of this form item of consignee is " Zhang San ", and the value information of this form item of shipping address is " Beijing Xicheng District finance street 19 ".
In a preferred embodiment, database table can be used in the form templat, the form data in server-side Storage form, in order to which the attribute information to form item, value information such as are increased, delete, change, look at the data manipulations.In addition, institute State form templat can also be used the storage form of XML file or JSON file in server-side.
In this step, the form templat and form data that client receives can be JSON string format or XML String format.
Step S203, list is generated according to the corresponding form templat and form data rendering.
Specifically, step S203 can include:
1) the corresponding form templat and form data that the server-side returns are parsed into the lattice of client support Formula.For example, it is assumed that the corresponding component type of a certain form item in a certain form templat record is " Text ", if client is The App of Android, then " Text " can be converted to " TextView " when being parsed by client;If client is ios's App, then " Text " can be converted to " UILable " when being parsed by client.Wherein, " Text ", " TextView " and " UILable " indicates text box component.
2) component rendering is then carried out according to the form templat after parsing, and according to the form data setting after parsing The corresponding value information of component, to generate list.For example, it is assumed that some form templat includes 5 form items, this 5 form items Component type be respectively input frame component, the date selection component, selection of time component, single choice component, multiselect component, then can root Each component is rendered according to the form templat after parsing, and corresponding according to each component of form data setting after parsing Value information, with list needed for generating user.
When it is implemented, client can be by general after receiving the corresponding form templat and form data List rendering engine (or be " rendering module ") execute step S203, to be dynamically generated list.Illustratively, the table Single rendering engine may include following at least one component: Tab component, List component (document list element), Table component (table Lattice component), input frame component, the date selection component, selection of time component, single choice component, multiselect component, referring to selection component Deng.Wherein, it can be regarded as the selector referring to another form data referring to selection component.For example, the list of expense report needs to select Reimbursement department is selected, then needs the data referring to reimbursement department's list.
After parsing to form templat and form data, list rendering engine can pass through the list after traversal parsing Template and form data obtain the information of component.For example, it is assumed that the component type of a certain form item is " input in form templat Box type ", then can analytically after form templat obtain input frame component following information: the data type of input frame component, Whether must fill out, whether allow to modify etc., analytically after form data obtain the corresponding value information of input frame component.Assuming that In form templat after parsing the component type of a certain form item be " date Selective type ", then can analytically after form templat Obtain the date selection component following information: the date select component at the beginning of and end time, time showing format etc.; Form data after analytically obtains the corresponding value information of date selection component.
Further, the method for the embodiment of the present invention may also include that when the value for listening to specific components changes, and repair automatically Change that there are the values of the component of incidence relation with the specific components.For example, for the input frame component of entitled " total price ", There are incidence relation " total prices=amount of money * number with the input frame component of the input frame component of entitled " amount of money ", entitled " quantity " Amount ".It, can be by formula actuator certainly when the value for listening to " amount of money " input frame component or " quantity " input frame component changes The value of dynamic modification " total price " this input frame component.
Illustratively, formula actuator can support aggregate function, numerical function, character string function, date function, logic letter One or more of functions such as number.Wherein, aggregate function may include following one or more functions: summing, is averaging, asks most It is worth greatly, minimizes, counting function;Numerical function may include following one or more functions: seeking absolute value, rounds up, is small Number format function;Character string function may include following one or more functions: turning small letter, turns capitalization, remove space, turn word Symbol, takes character string, string segmentation, string matching function etc. at character string replacement;Date function can include: the day before yesterday is worked as in acquisition Phase function;Logical function can include: If conditional function.
In embodiments of the present invention, by storing form templat and form data in server-side, and it is a certain in user's needs When specific list, corresponding form templat and form data are obtained from server-side by sending list acquisition request, then by leading to List rendering engine is dynamically generated list according to the corresponding form templat and form data, and then can be improved table Single development efficiency reduces the duplicated code in list exploitation, reduces the code maintenance cost in list exploitation.
Fig. 3 is the main modular schematic diagram of list generating means according to an embodiment of the invention.The embodiment of the present invention List generating means may be provided at server-side.As shown in figure 3, the list generating means 300 of the embodiment of the present invention include: to receive Module 301 obtains module 302 and sending module 303.
Receiving module 301, for receiving the list acquisition request of client transmission.
Wherein, the list acquisition request may include form types and list mark (ID).For example, form types are sale Order or expense report etc..
Module 302 is obtained, for obtaining corresponding form templat and form data according to the list acquisition request.
Wherein, the form templat includes the attribute information of form item.Illustratively, the attribute information packet of the form item Include at least one of following: the corresponding component type of form item, data type, whether must fill out, the display of data length, form item it is suitable Sequence.The form data includes the value information of form item.For example, form data may include order for sales order The value information of the form items such as the amount of money, order detail, consignee and shipping address.In a preferred embodiment, the list mould The storage form of database table can be used in plate, the form data, in order to form item attribute information, value information into Row such as increases, deletes, changing, looking at the data manipulations.In addition, the storage form of XML file or JSON file can also be used in the form templat.
Illustratively, when list acquisition request includes form types and list identifies, acquisition module 302 obtains corresponding Form templat and form data can include: obtain module 302 according to the form types inquiry form template warehouse, with acquisition pair The form templat answered;Module 302 is obtained according to the list identification look-up table forms data warehouse, to obtain corresponding list number According to.Wherein, the form templat warehouse and the form data warehouse can be based on same database (such as MySQL database) Building, can also be based on different database sharings.
When it is implemented, when form templat data warehouse and form data warehouse are using SQL (structuralized query language Speech) when carrying out the database of data manipulation, module 302 is obtained according to the form types inquiry form template warehouse, to obtain Corresponding form templat further comprises: obtaining module 302 according to the form types and generates the first SQL statement, then basis First SQL statement inquiry form template warehouse, to obtain corresponding form templat;Module 302 is obtained to be identified according to the list Inquiry form data warehouse further comprises to obtain corresponding form data: obtaining module 302 according to the list and identifies life At the second SQL statement, then according to the second SQL statement inquiry form data warehouse, to obtain corresponding form data.
Sending module 303, for the corresponding form templat and form data to be sent to the client, so that institute It states client and list is generated according to the corresponding form templat and form data rendering.
Specifically, the corresponding form templat and form data can be packaged by sending module 303, then will envelope It fills obtained JSON character string and is sent to the client.In addition, sending module 303 can also by the corresponding form templat and Form data is packaged into XML character string, and the XML character string that encapsulation obtains then is sent to the client.Client is connecing It can (or be " rendering mould by general list rendering engine after receiving the corresponding form templat and form data Block ") it is dynamically generated list.
In embodiments of the present invention, by the way that form templat is stored in form templat warehouse, form data is stored in table Forms data warehouse, and when user needs a certain specific list, the list acquisition request of client is received by receiving module, Corresponding form templat and form data are obtained by obtaining module, by sending module by corresponding form templat and list number According to client is sent to, to enable the client to be dynamically generated list according to the corresponding form templat and form data. The list generating means of the embodiment of the present invention can be improved list development efficiency, reduces the duplicated code in list exploitation, reduces Code maintenance cost in list exploitation.
Fig. 4 is the main modular schematic diagram of list generating means according to another embodiment of the present invention.The embodiment of the present invention List generating means may be provided at client.As shown in figure 4, the list generating means 400 of the embodiment of the present invention include: to send Module 401, receiving module 402 and rendering module 403.
Sending module 401, for sending list acquisition request to server-side.
Illustratively, the list acquisition request can include: form types and list mark (ID).Wherein, the list Type is for searching corresponding form templat, and the list mark is for searching corresponding form data.
Receiving module 402, the form templat corresponding with the list acquisition request returned for receiving the server-side And form data.
Wherein, the form templat includes the attribute information of form item.Illustratively, the attribute information packet of the form item Include at least one of following: the corresponding component type of form item, data type, whether must fill out, the display of data length, form item it is suitable Sequence.The form data includes the value information of form item.For example, form data may include order for sales order The value information of the form items such as the amount of money, order detail, consignee and shipping address.In a preferred embodiment, the list mould The storage form of database table can be used in plate, the form data in server-side, in order to form item attribute information, Value information such as is increased, is deleted, being changed, being looked at the data manipulations.In addition, XML file can also be used in the form templat in server-side Or the storage form of JSON file.
Illustratively, the form templat and form data that receiving module 402 receives can be JSON string format or XML string format.
Rendering module 403, for generating list according to the corresponding form templat and form data rendering.
Specifically, the corresponding form templat and form data solution that rendering module 403 returns to the server-side Analyse into the format of client support;Then component rendering is carried out according to the form templat after parsing, and according to the list after parsing The corresponding value information of the component is arranged in data, to generate list.For example, it is assumed that in a certain table of a certain form templat record The corresponding component type of individual event is " Text ", if client is the App of Android, the meeting when being parsed of rendering module 403 " Text " is converted into " TextView ";If client is the App of ios, rendering module 403 can be incited somebody to action when being parsed " Text " is converted to " UILable ".
Illustratively, rendering module 403 may include following at least one component: Tab component, (the document list of List component Component), Table component (form component), input frame component, the date select component, selection of time component, single choice component, multiselect Component, reference selection component etc..Wherein, it can be regarded as the selector referring to another form data referring to selection component.For example, report The single list of pin needs to select reimbursement department, then needs the data referring to reimbursement department's list.When it is implemented, rendering module 403 can obtain the information of component by the form templat and form data after traversal parsing.For example, it is assumed that the list after parsing The component type of a certain form item is " input box type " in template, then rendering module 403 can analytically after form templat obtain Input frame component following information: the data type of input frame component, whether must fill out, whether allow modify etc..Assuming that solution In form templat after analysis the component type of a certain form item be " date Selective type ", then rendering module 403 can analytically after Form templat obtain the following information of date selection component: at the beginning of the date selects component and end time, time are aobvious Show format etc..
Further, the list generating means of the embodiment of the present invention may also include that formula actuator, for listen to it is specific When the value of component changes, there are the values of the component of incidence relation with the specific components for automatic modification.For example, for title For the input frame component of " total price ", deposited with the input frame component of entitled " amount of money ", the input frame component of entitled " quantity " In incidence relation " total price=amount of money * quantity ".When the value for listening to " amount of money " input frame component or " quantity " input frame component When change, formula actuator can modify the value of " total price " this input frame component automatically.
Illustratively, formula actuator can support aggregate function, numerical function, character string function, date function, logic letter One or more of functions such as number.Wherein, aggregate function may include following one or more functions: summing, is averaging, asks most It is worth greatly, minimizes, counting function;Numerical function may include following one or more functions: seeking absolute value, rounds up, is small Number format function;Character string function may include following one or more functions: turning small letter, turns capitalization, remove space, turn word Symbol, takes character string, string segmentation, string matching function etc. at character string replacement;Date function can include: the day before yesterday is worked as in acquisition Phase function;Logical function can include: If conditional function.
In embodiments of the present invention, by storing form templat and form data in server-side, and it is a certain in user's needs When specific list, list acquisition request is sent by sending module, corresponding list is received from server-side by receiving module Template and form data are dynamically generated table according to the corresponding form templat and form data by general rendering module It is single, can be improved list development efficiency, reduce the duplicated code in list exploitation, reduce code maintenance in list exploitation at This.
Fig. 5 is the composition schematic diagram of form generation system according to an embodiment of the invention.As shown in figure 5, of the invention The form generation system 500 of embodiment includes: client 501, server-side 502.
Client 501, for sending list acquisition request to server-side 502.
Wherein, the list acquisition request can include: form types and list mark (ID).Wherein, the form types For searching corresponding form templat, the list mark is for searching corresponding form data.
Server-side 502 obtains corresponding table for receiving the list acquisition request, and according to the list acquisition request Single mode plate and form data.
Wherein, the form templat includes the attribute information of form item.Illustratively, the attribute information packet of the form item Include at least one of following: the corresponding component type of form item, data type, whether must fill out, the display of data length, form item it is suitable Sequence.The form data includes the value information of form item.For example, form data may include order for sales order The value information of the form items such as the amount of money, order detail, consignee and shipping address.In a preferred embodiment, the list mould The storage form of database table can be used in plate, the form data, in order to form item attribute information, value information into Row such as increases, deletes, changing, looking at the data manipulations.In addition, the storage form of XML file or JSON file can also be used in the form templat.
Illustratively, when list acquisition request includes form types and list identifies, server-side 502 obtains corresponding table Single mode plate and form data can include: server-side 502 is corresponding to obtain according to the form types inquiry form template warehouse Form templat;Server-side 502 is according to the list identification look-up table forms data warehouse, to obtain corresponding form data.
Server-side 502 is also used to the corresponding form templat and form data being sent to client 501.
Specifically, the corresponding form templat and form data are sent to client 501 and can wrapped by server-side 502 Include: the corresponding form templat and form data are packaged by server-side 502, then send out the JSON character string after encapsulation It send to client.In addition, the corresponding form templat and form data can also be packaged into XML character string, it then will encapsulation XML character string afterwards is sent to client.
Client 501 is also used to receive the corresponding form templat and form data, then according to the corresponding table Single mode plate and form data rendering generate list.
Specifically, client 501 generates list according to the corresponding form templat and form data rendering can include: The corresponding form templat that the server-side returns and form data are parsed into the lattice of client support by client 501 Formula;Then component rendering is carried out according to the form templat after parsing, and the component pair is arranged according to the form data after parsing The value information answered, to generate list.For example, it is assumed that the corresponding component class of a certain form item recorded in a certain form templat Type is " Text ", if client 501 is the App of Android, client 501 can be converted to " Text " when being parsed "TextView";If client 501 is the App of ios, client 501 can be converted to " Text " when being parsed “UILable”。
When it is implemented, client 501 can be by logical after receiving the corresponding form templat and form data List rendering engine (or being " rendering module ") is dynamically generated list.Illustratively, the list rendering engine can Comprise at least one of the following component: Tab component, List component (document list element), Table component (form component), input Frame component, date selection component, selection of time component, single choice component, multiselect component, reference selection component etc..Wherein, referring to choosing Selecting component can be regarded as the selector referring to another form data.For example, the list of expense report needs to select reimbursement department, then need With reference to the data of reimbursement department's list.
Further, client 501 is also used to: when the value for listening to specific components changes, automatic modification and the spy Determining component, there are the values of the component of incidence relation.It is and entitled for example, for the input frame component of entitled " total price " The input frame component of " amount of money ", entitled " quantity " input frame component there are incidence relation " total prices=amount of money * quantity ".Work as prison When hearing that the value of " amount of money " input frame component or " quantity " input frame component changes, client 501 can pass through formula actuator The value of automatic modification " total price " this input frame component.
Illustratively, formula actuator can support aggregate function, numerical function, character string function, date function, logic letter One or more of functions such as number.Wherein, aggregate function may include following one or more functions: summing, is averaging, asks most It is worth greatly, minimizes, counting function;Numerical function may include following one or more functions: seeking absolute value, rounds up, is small Number format function;Character string function may include following one or more functions: turning small letter, turns capitalization, remove space, turn word Symbol, takes character string, string segmentation, string matching function etc. at character string replacement;Date function can include: the day before yesterday is worked as in acquisition Phase function;Logical function can include: If conditional function.
In embodiments of the present invention, by storing form templat and form data in server-side, it is arranged in client general List rendering engine, can user need a certain specific list when be dynamically generated list.The table of the embodiment of the present invention Single generation system can be improved list development efficiency, reduce the duplicated code in list exploitation, reduce the code in list exploitation Maintenance cost.
Fig. 6 is shown can be using the list generation method of the embodiment of the present invention or the exemplary system of list generating means Framework 600.
As shown in fig. 6, system architecture 600 may include terminal device 601,602,603, network 604 and server 605. Network 604 between terminal device 601,602,603 and server 605 to provide the medium of communication link.Network 604 can be with Including various connection types, such as wired, wireless communication link or fiber optic cables etc..
User can be used terminal device 601,602,603 and be interacted by network 604 with server 605, to receive or send out Send message etc..Various telecommunication customer end applications, such as the application of shopping class, net can be installed on terminal device 601,602,603 The application of page browsing device, searching class application, instant messaging tools, mailbox client, social platform software etc..
Terminal device 601,602,603 can be the various electronic equipments with display screen and supported web page browsing, packet Include but be not limited to smart phone, tablet computer, pocket computer on knee and desktop computer etc..
Server 605 can be to provide the server of various services, such as utilize terminal device 601,602,603 to user The shopping class website browsed provides the back-stage management server supported.Back-stage management server can obtain the list received It takes request etc. to be analyzed and processed, and processing result (corresponding form templat and form data) is fed back into terminal device.
It should be noted that a kind of list generation method provided by the embodiment of the present invention can be by terminal 601,602,603 It executing, another list generation method can be executed jointly by server 605, correspondingly, a kind of list provided in an embodiment of the present invention Generating means are set in terminal, and another list generating means are set in server 605.
It should be understood that the number of terminal device, network and server in Fig. 6 is only schematical.According to realization need It wants, can have any number of terminal device, network and server.
Fig. 7 shows the structural representation for being suitable for the computer system 700 for the electronic equipment for being used to realize the embodiment of the present invention Figure.Electronic equipment shown in Fig. 7 is only an example, should not function to the embodiment of the present invention and use scope bring it is any Limitation.
As shown in fig. 7, computer system 700 includes central processing unit (CPU) 701, it can be read-only according to being stored in Program in memory (ROM) 702 or be loaded into the program in random access storage device (RAM) 703 from storage section 708 and Execute various movements appropriate and processing.In RAM 703, also it is stored with system 700 and operates required various programs and data. CPU 701, ROM 702 and RAM 703 are connected with each other by bus 704.Input/output (I/O) interface 705 is also connected to always Line 704.
I/O interface 705 is connected to lower component: the importation 706 including keyboard, mouse etc.;It is penetrated including such as cathode The output par, c 707 of spool (CRT), liquid crystal display (LCD) etc. and loudspeaker etc.;Storage section 708 including hard disk etc.; And the communications portion 709 of the network interface card including LAN card, modem etc..Communications portion 709 via such as because The network of spy's net executes communication process.Driver 710 is also connected to I/O interface 705 as needed.Detachable media 711, such as Disk, CD, magneto-optic disk, semiconductor memory etc. are mounted on as needed on driver 710, in order to read from thereon Computer program be mounted into storage section 708 as needed.
Particularly, disclosed embodiment, the process described above with reference to flow chart may be implemented as counting according to the present invention Calculation machine software program.For example, embodiment disclosed by the invention includes a kind of computer program product comprising be carried on computer Computer program on readable medium, the computer program include the program code for method shown in execution flow chart.In In such embodiment, which can be downloaded and installed from network by communications portion 709, and/or from can Medium 711 is dismantled to be mounted.When the computer program is executed by central processing unit (CPU) 701, system of the invention is executed The above-mentioned function of middle restriction.
It should be noted that computer-readable medium shown in the present invention can be computer-readable signal media or meter Calculation machine readable storage medium storing program for executing either the two any combination.Computer readable storage medium for example can be --- but not Be limited to --- electricity, magnetic, optical, electromagnetic, infrared ray or semiconductor system, device or device, or any above combination.Meter The more specific example of calculation machine readable storage medium storing program for executing can include but is not limited to: have the electrical connection, just of one or more conducting wires Taking formula computer disk, hard disk, random access storage device (RAM), read-only memory (ROM), erasable type may be programmed read-only storage Device (EPROM or flash memory), optical fiber, portable compact disc read-only memory (CD-ROM), light storage device, magnetic memory device, Or above-mentioned any appropriate combination.In the present invention, computer readable storage medium can be it is any include or storage journey The tangible medium of sequence, the program can be commanded execution system, device or device use or in connection.And at this In invention, computer-readable signal media may include in a base band or as carrier wave a part propagate data-signal, Wherein carry computer-readable program code.The data-signal of this propagation can take various forms, including but unlimited In electromagnetic signal, optical signal or above-mentioned any appropriate combination.Computer-readable signal media can also be that computer can Any computer-readable medium other than storage medium is read, which can send, propagates or transmit and be used for By the use of instruction execution system, device or device or program in connection.Include on computer-readable medium Program code can transmit with any suitable medium, including but not limited to: wireless, electric wire, optical cable, RF etc. are above-mentioned Any appropriate combination.
Flow chart and block diagram in attached drawing are illustrated according to the system of various embodiments of the invention, method and computer journey The architecture, function and operation in the cards of sequence product.In this regard, each box in flowchart or block diagram can generation A part of one module, program segment or code of table, a part of above-mentioned module, program segment or code include one or more Executable instruction for implementing the specified logical function.It should also be noted that in some implementations as replacements, institute in box The function of mark can also occur in a different order than that indicated in the drawings.For example, two boxes succeedingly indicated are practical On can be basically executed in parallel, they can also be executed in the opposite order sometimes, and this depends on the function involved.Also it wants It is noted that the combination of each box in block diagram or flow chart and the box in block diagram or flow chart, can use and execute rule The dedicated hardware based systems of fixed functions or operations is realized, or can use the group of specialized hardware and computer instruction It closes to realize.
Being described in module involved in the embodiment of the present invention can be realized by way of software, can also be by hard The mode of part is realized.Described module also can be set in the processor, for example, can be described as: a kind of processor packet It includes receiving module, obtain module and sending module.Wherein, the title of these modules is not constituted under certain conditions to the module The restriction of itself, for example, receiving module is also described as " receiving the module for the list acquisition request that client is sent ".
As on the other hand, the present invention also provides a kind of computer-readable medium, which be can be Included in equipment described in above-described embodiment;It is also possible to individualism, and without in the supplying equipment.Above-mentioned calculating Machine readable medium carries one or more program, when said one or multiple programs are executed by the equipment, makes It obtains the equipment and executes following below scheme: receiving the list acquisition request that client is sent;According to list acquisition request acquisition pair The form templat and form data answered;The form templat includes the attribute information of form item, and the form data includes list The value information of item;The corresponding form templat and form data are sent to the client, so that the client root List is generated according to the corresponding form templat and form data rendering.
Above-mentioned specific embodiment, does not constitute a limitation on the scope of protection of the present invention.Those skilled in the art should be bright It is white, design requirement and other factors are depended on, various modifications, combination, sub-portfolio and substitution can occur.It is any Made modifications, equivalent substitutions and improvements etc. within the spirit and principles in the present invention, should be included in the scope of the present invention Within.

Claims (17)

1. a kind of list generation method, which is characterized in that the described method includes:
Receive the list acquisition request that client is sent;
Corresponding form templat and form data are obtained according to the list acquisition request;The form templat includes form item Attribute information, the form data include the value information of form item;
The corresponding form templat and form data are sent to the client, so that the client is according to the correspondence Form templat and form data rendering generate list.
2. the method according to claim 1, wherein the list acquisition request includes: form types and list Mark;Described the step of obtaining corresponding form templat and form data according to the list acquisition request includes: according to Form types inquiry form template warehouse, to obtain corresponding form templat;According to the list identification look-up table forms data storehouse Library, to obtain corresponding form data.
3. according to the method described in claim 2, it is characterized in that, described according to the form types inquiry form template storehouse Library, to obtain corresponding form templat the step of include: to generate the first SQL statement according to the form types, then according to the One SQL statement inquiry form template warehouse, to obtain corresponding form templat;It is described singular according to the list identification look-up table According to warehouse, to obtain corresponding form data the step of includes: to be identified to generate the second SQL statement according to the list, then root According to the second SQL statement inquiry form data warehouse, to obtain corresponding form data.
4. the method according to claim 1, wherein the attribute information of the form item includes following at least one : whether form item corresponding component type data type, must fill out, the display order of data length, form item.
5. the method according to claim 1, wherein described send out the corresponding form templat and form data It send to the step of client and includes:
The corresponding form templat and form data are packaged, the JSON character string that encapsulation obtains then is sent to institute State client.
6. a kind of list generation method, which is characterized in that the described method includes:
List acquisition request is sent to server-side;
Receive form templat corresponding with the list acquisition request and form data that the server-side returns;The list mould Plate includes the attribute information of form item, and the form data includes the value information of form item;
List is generated according to the corresponding form templat and form data rendering.
7. according to the method described in claim 6, it is characterized in that, described according to the corresponding form templat and form data Rendering the step of generating list includes:
The corresponding form templat and form data that the server-side returns are parsed into the format of client support;Then Component rendering is carried out according to the form templat after parsing, and the corresponding value of the component is arranged according to the form data after parsing Information, to generate list.
8. the method according to the description of claim 7 is characterized in that the method also includes:
When the value for listening to specific components changes, automatic modification taking there are the component of incidence relation with the specific components Value.
9. a kind of list generating means, which is characterized in that described device includes:
Receiving module, for receiving the list acquisition request of client transmission;
Module is obtained, for obtaining corresponding form templat and form data according to the list acquisition request;The list mould Plate includes the attribute information of form item, and the form data includes the value information of form item;
Sending module, for the corresponding form templat and form data to be sent to the client, so that the client End generates list according to the corresponding form templat and form data rendering.
10. device according to claim 9, which is characterized in that the list acquisition request includes: form types and list Mark;The acquisition module obtains corresponding form templat according to the list acquisition request and form data includes: described obtains Modulus root tuber is according to the form types inquiry form template warehouse, to obtain corresponding form templat;The acquisition module according to The list identification look-up table forms data warehouse, to obtain corresponding form data.
11. device according to claim 10, which is characterized in that the acquisition module is according to the form types inquiry table Single mode plate warehouse includes: the acquisition module according to the form types the first SQL language of generation to obtain corresponding form templat Sentence, then according to the first SQL statement inquiry form template warehouse, to obtain corresponding form templat;The acquisition module according to The list identification look-up table forms data warehouse includes: the acquisition module according to the table to obtain corresponding form data Single mark generates the second SQL statement, then according to the second SQL statement inquiry form data warehouse, to obtain corresponding list number According to.
12. device according to claim 9, which is characterized in that the sending module by the corresponding form templat and Form data is sent to the client
The corresponding form templat and form data are packaged by the sending module, the JSON word for then obtaining encapsulation Symbol string is sent to the client.
13. a kind of list generating means, which is characterized in that described device includes:
Sending module, for sending list acquisition request to server-side;
Receiving module, the form templat corresponding with the list acquisition request and list number returned for receiving the server-side According to;The form templat includes the attribute information of form item, and the form data includes the value information of form item;
Rendering module, for generating list according to the corresponding form templat and form data rendering.
14. device according to claim 13, which is characterized in that the rendering module is according to the corresponding form templat Rendering generation list with form data includes:
The corresponding form templat that the server-side returns and form data are parsed into client branch by the rendering module The format held;Then component rendering is carried out according to the form templat after parsing, and according to the form data setting after parsing The corresponding value information of component, to generate list.
15. device according to claim 13, which is characterized in that described device further include:
Formula actuator, for when the value for listening to specific components changes, modification to exist with the specific components and closes automatically The value of the component of connection relationship.
16. a kind of electronic equipment characterized by comprising
One or more processors;
Storage device, for storing one or more programs,
When one or more of programs are executed by one or more of processors, so that one or more of processors are real The now method as described in any in claim 1 to 8.
17. a kind of computer-readable medium, is stored thereon with computer program, which is characterized in that described program is held by processor The method as described in any in claim 1 to 8 is realized when row.
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)

Similar Documents

Publication Publication Date Title
CN110798567A (en) Short message classification display method and device, storage medium and electronic equipment
CN107861933A (en) The method and apparatus for generating O&M form
CN109697641A (en) The method and apparatus for calculating commodity similarity
CN107609890A (en) A kind of method and apparatus of order tracking
CN110472207A (en) List generation method and device
CN110427304A (en) O&M method, apparatus, electronic equipment and medium for banking system
CN110351673A (en) Note transmission method, device, system and electronic equipment based on label model
CN109960212A (en) Task sending method and device
CN110209662A (en) A kind of method and apparatus of automation load data
CN110109983A (en) A kind of method and apparatus operating Redis database
CN109034988A (en) A kind of accounting entry generation method and device
CN110309142A (en) The method and apparatus of regulation management
CN108959294A (en) A kind of method and apparatus accessing search engine
CN110019258A (en) The method and apparatus for handling order data
CN107729394A (en) Data Mart management system and its application method based on Hadoop clusters
CN107908662A (en) The implementation method and realization device of search system
CN109656709A (en) A kind of method and apparatus of Codis cluster dilatation
CN109241033A (en) The method and apparatus for creating real-time data warehouse
CN107886350B (en) Method and device for analyzing data
CN109947788A (en) Data query method and apparatus
CN110110211A (en) Data query method and apparatus based on universal model
CN109992495A (en) The method and apparatus of interface testing
CN110209677A (en) The method and apparatus of more new data
CN110555070A (en) Method and apparatus for outputting information
CN110347654A (en) A kind of method and apparatus of online cluster features

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