CN106446024B - Method and device for automatically generating data model - Google Patents

Method and device for automatically generating data model Download PDF

Info

Publication number
CN106446024B
CN106446024B CN201610765288.0A CN201610765288A CN106446024B CN 106446024 B CN106446024 B CN 106446024B CN 201610765288 A CN201610765288 A CN 201610765288A CN 106446024 B CN106446024 B CN 106446024B
Authority
CN
China
Prior art keywords
web page
data model
forms
page
generating
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201610765288.0A
Other languages
Chinese (zh)
Other versions
CN106446024A (en
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.)
Neusoft Corp
Original Assignee
Neusoft Corp
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 Neusoft Corp filed Critical Neusoft Corp
Priority to CN201610765288.0A priority Critical patent/CN106446024B/en
Publication of CN106446024A publication Critical patent/CN106446024A/en
Application granted granted Critical
Publication of CN106446024B publication Critical patent/CN106446024B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/25Integrating or interfacing systems involving database management systems
    • G06F16/252Integrating or interfacing systems involving database management systems between a Database Management System and a front-end application
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F40/00Handling natural language data
    • G06F40/10Text processing
    • G06F40/166Editing, e.g. inserting or deleting
    • G06F40/177Editing, e.g. inserting or deleting of tables; using ruled lines
    • G06F40/18Editing, e.g. inserting or deleting of tables; using ruled lines of spreadsheets

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • Health & Medical Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • Computational Linguistics (AREA)
  • General Health & Medical Sciences (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The invention discloses a method and a device for automatically generating a data model, relates to the field of computers, can quickly and automatically generate the data model, has strong universality, and does not need to redraw a form when a user already has page design resources. The method for automatically generating the data model comprises the following steps: acquiring a WEB page; extracting forms in the WEB page, wherein each form contains form information; packaging all the forms extracted from the WEB page into a service object according to the form information; and generating a data model according to the business object.

Description

Method and device for automatically generating data model
Technical Field
The disclosed embodiments relate to the field of computers, and in particular, to a method and an apparatus for automatically generating a data model.
Background
At present, there are two common methods for generating data models.
The first is to use a rapid development tool. Since it is very difficult to accurately understand the business process of the user in the early stage of the project, the following processes need to be repeatedly performed by adopting the method: designing a data model-generating a page-communicating with a user-modifying the data model-generating a page-communicating with the user again. Therefore, the first method is not only time-consuming, but also inefficient and has a high risk in the later period.
The second method is to use a form designer to draw the form and automatically generate a background database and a running program from the form. Because the user can design the form by hands by using the form designer, the method can improve the communication efficiency and reduce the later risk. However, although the client form designer has a strong function, a computer program needs to be installed, the form is poor in universality, and the form designer is strongly coupled with an automatic generation program, so that although a user already has page design resources, the user still needs to draw the form designer again.
Disclosure of Invention
The purpose of the disclosed embodiments is to provide a method and an apparatus for automatically generating a data model, which can automatically generate a data model quickly, have strong versatility, and do not need to redraw a form when a user already has page design resources.
In order to achieve the above object, an embodiment of the present disclosure provides a method for automatically generating a data model, where the method includes:
acquiring a WEB page;
extracting forms in the WEB page, wherein each form contains form information;
packaging all the forms extracted from the WEB page into a business object according to the forms; and
and generating a data model according to the business object.
Optionally, the acquiring the WEB page includes: and acquiring the WEB page by acquiring a uniform resource locator or a visual page output by a visual page design tool.
Optionally, the extracting the form in the WEB page includes: and extracting each form by using the tag name in the hypertext markup language source code of the WEB page.
Optionally, the method further comprises: and generating an executable application program according to the data model.
The embodiment of the present disclosure further provides an apparatus for automatically generating a data model, where the apparatus includes:
the WEB page acquisition module is used for acquiring a WEB page;
the extraction module is used for extracting forms in the WEB page, and each form contains form information;
the packaging module is used for packaging all the forms extracted from the WEB page into a service object according to the form information; and
and the data model generation module is used for generating a data model according to the business object.
Optionally, the WEB page obtaining module obtains the WEB page by obtaining a uniform resource locator or a visual page output by a visual page design tool.
Optionally, the extracting module extracts each of the forms using a tag name in hypertext markup language source code of the WEB page.
Optionally, the apparatus further comprises an application generation module for generating an executable application according to the data model.
According to the technical scheme of the embodiment of the disclosure, the WEB page is obtained firstly, then the forms in the WEB page are extracted, then all the forms extracted from the WEB page are packaged into one service object, and then the data model is generated according to the service object, so that the universality is strong, and the forms do not need to be drawn manually in the process of generating the data model, which is very favorable when a user already has page design resources, so that the generation efficiency of the data model can be greatly improved, and the data model can be generated quickly and automatically.
Additional features and advantages of embodiments of the present disclosure will be described in detail in the detailed description which follows.
Drawings
The accompanying drawings, which are included to provide a further understanding of the disclosed embodiments and are incorporated in and constitute a part of this specification, illustrate embodiments of the disclosure and together with the detailed description serve to explain the embodiments, but do not limit the embodiments. In the drawings:
FIG. 1 is a flow diagram of a method of automatically generating a data model according to one embodiment of the present disclosure;
FIG. 2 is yet another flow diagram of a method of automatically generating a data model according to one embodiment of the present disclosure;
FIG. 3 is a schematic block diagram of an apparatus for automatically generating a data model according to one embodiment of the present disclosure; and
FIG. 4 is a schematic block diagram of an apparatus for automatically generating a data model according to yet another embodiment of the present disclosure.
Detailed Description
Specific embodiments of the disclosed embodiments are described in detail below with reference to the accompanying drawings. It is to be understood that the description herein of specific embodiments is only for purposes of illustrating and explaining the embodiments of the present disclosure, and is not intended to limit the embodiments of the present disclosure.
According to a first aspect of the embodiments of the present disclosure, there is provided a method for automatically generating a data model, as shown in fig. 1, the method may include the following steps S101 to S104:
in step S101, a WEB page is acquired;
in step S102, extracting forms in the WEB page, where each form includes form information;
in step S103, encapsulating all the forms extracted from the WEB page into a service object according to the form information; and
in step S104, a data model is generated according to the business object.
By adopting the steps S101 to S104, since the technical solution of this embodiment is to obtain the WEB page first, then extract the forms in the WEB page, then encapsulate all the forms extracted from the WEB page into a business object, and then generate the data model according to the business object, it is not only strong in versatility, but also does not need to manually draw the forms in the process of generating the data model, which is very advantageous when the user already has page design resources, so that the generation efficiency of the data model can be greatly improved, and the data model can be automatically generated quickly. Furthermore, after the data model is generated, the generated data model may be provided to the user so that the user can modify the generated data model according to the user's needs, for example, assuming that the generated data model relates to a date item of birth year and month, the user may set a data input type of the date item of birth year and month, for example, year-month-day or month-day-year.
The WEB page referred to in the method of automatically generating a data model according to an embodiment of the present disclosure refers to a file on the world wide WEB organized in a Hypertext Markup Language (HTML) format, which appears as an information page when information query is performed through the world wide WEB. A WEB page may include information such as graphics, text, sound, video images, text boxes, drop-down menus, and the like.
According to another aspect of the method for automatically generating a data model of the embodiment of the present disclosure, in step S101, the acquiring a WEB page may include: the WEB page is obtained by obtaining a Uniform Resource Locator (URL) or a visual page output by a visual page design tool. Therefore, the WEB page is very widely obtained, and is not limited by specific WEB page design tools and page styles, so that the method for automatically generating the data model according to the embodiment of the disclosure has very strong universality.
For example, if the URL address of the WEB page is already known, the WEB page can be acquired by inputting the URL address.
For another example, if there is a WEB page output by the existing system, the WEB page may also be directly obtained by the URL address of the WEB page. The existing system may be, for example, an existing information system in an enterprise, such as a financial system, an attendance system, and the like, and the information system may include a page of a form; the existing system may also be an internet site, such as a kyoto shopping site, which also contains pages of forms.
For another example, if a WEB page that is output by the visual page design tool already exists, the WEB page may be directly acquired. The visualization page design tools may be, for example, Microsoft Forms and Google Forms, among others. The visual page design tool mentioned in the embodiments of the present disclosure is a tool for designing a form, which is well known to those skilled in the art, and is not described herein, for example, a form designer may directly generate a form by using a drag control in the visual page design tool.
According to another aspect of the method for automatically generating a data model of the embodiment of the present disclosure, in step S102, the extracting the form in the WEB page may include: and extracting each form by using the tag name in the HTML source code of the WEB page. Generally, a WEB page may contain one form or multiple forms, and therefore, in the HTML source code, each form is identified by a tag name. The tag name typically includes information such as the identity (i.e., ID), name, and path of the form. Therefore, by extracting the tag names of the forms and then decomposing the tag names, each form included in the WEB page and the form information included in each form can be easily extracted.
The form information may include the type of data contained in the form (e.g., text box, date, number, drop down menu, etc.), the content of the data contained in the form, and the operations to which the data contained in the form relates (e.g., data update, data query, data delete, etc.). In addition, the form information may also include the layout manner of the extracted form. For example, the layout manner of the form may generally include a page layout manner, a table layout manner, a streaming layout manner, an adaptive layout manner, and the like.
After all forms are extracted from the WEB page, in step S103, all the forms extracted from the WEB page may be encapsulated into a service object according to the form information. For example, assuming that a form is extracted from a WEB page in step S102, the form may be packaged into a business object in step S103. For another example, assuming that a plurality of forms are extracted from a WEB page in step S102, the forms may be packaged into a service object in step S103.
According to another aspect of the method for automatically generating a data model of the embodiment of the present disclosure, in step S104, the generating a data model according to the business object may be performed by using an existing rapid software development tool. For example, the rapid software development tool may be a Power Builder or a conditional Rose tool, among other tools. In generating the data model, the business objects may be first entered into the rapid software development tools, which are then able to generate the data model from the entered business objects.
According to still another aspect of the method for automatically generating a data model of the embodiment of the present disclosure, as shown in fig. 2, after step S104, the method may further include step S105 of generating an executable application program according to the data model. For example, Visual studio, Google Forms, or online form design tools, etc. may be employed to generate an executable application from the data model. In addition, if the user modifies the data model generated in step S104, the data model to be relied upon here may be a data model that is repeatedly modified by the user. After the executable application is generated, it may be saved.
The executable application program may include an application program code, a form object, and a database, where the database is used to store data related to the form object, the form object relates to a layout manner of the form, a type of the data related to the form, and data content, and the application program code is a bridge between the form object and the database, and is used to describe how to perform an insertion operation, a query operation, an update operation, a delete operation, and the like of the data related to the form object.
According to a second aspect of the embodiments of the present disclosure, there is provided an apparatus for automatically generating a data model, as shown in fig. 3, the apparatus may include a WEB page obtaining module 201, an extracting module 202, a packaging module 203, and a data model generating module 204, where: a WEB page acquiring module 201, configured to acquire a WEB page; an extracting module 202, configured to extract forms in the WEB page, where each form includes form information; the packaging module 203 is configured to package all the forms extracted from the WEB page into a service object according to the form information; and a data model generation module 204, configured to generate a data model according to the business object.
According to the technical scheme of the embodiment, the WEB page is acquired by the WEB page acquisition module 201, the forms in the WEB page are extracted by the extraction module 202, all the forms extracted from the WEB page are packaged into a business object by the packaging module 203, and the data model is generated by the data model generation module 204 according to the business object. Furthermore, after the data model is generated, the generated data model may be provided to the user so that the user can modify the generated data model according to the user's needs, for example, assuming that the generated data model relates to a date item of birth year and month, the user may set a data input type of the date item of birth year and month, for example, year-month-day or month-day-year.
The WEB page mentioned in the apparatus for automatically generating a data model according to an embodiment of the present disclosure refers to a file on the world wide WEB organized in HTML format, which appears in the form of an information page when an information query is made through the world wide WEB. A WEB page may include information such as graphics, text, sound, video images, text boxes, drop-down menus, and the like.
According to another aspect of the apparatus for automatically generating a data model according to the embodiment of the present disclosure, the WEB page obtaining module 201 obtains the WEB page by obtaining a uniform resource locator or a visual page output by a visual page design tool. Therefore, the WEB page can be obtained from a wide range of sources, and is not limited by specific WEB page design tools and page styles, so that the device for automatically generating the data model according to the embodiment of the disclosure has strong universality.
For example, if the URL address of the WEB page is already known, the WEB page acquisition module 201 may acquire the WEB page by the URL address.
For another example, if there is a WEB page output by the existing system, the WEB page obtaining module 201 may directly obtain the WEB page through the URL address of the WEB page. The existing system may be, for example, an existing information system in an enterprise, such as a financial system, an attendance system, and the like, and the information system may include a page of a form; the existing system may also be an internet site, such as a kyoto shopping site, which also contains pages of forms.
For another example, if there is already a WEB page output by the visual page design tool, the WEB page acquiring module 201 may directly acquire the WEB page. The visualization page design tools may be, for example, Microsoft Forms and Googleforms, among others. The visual page design tool mentioned in the embodiments of the present disclosure is a tool for designing a form, which is well known to those skilled in the art, and is not described herein, for example, a form designer may directly generate a form by using a drag control in the visual page design tool.
According to a further aspect of the apparatus for automatically generating a data model of the embodiment of the disclosure, the extracting module 202 may extract each of the forms by using a tag name in HTML source code of the WEB page. Usually, a WEB page may contain a plurality of forms, and therefore, in the HTML source code, each form is identified by a tag name. The tag name typically includes information such as the identity (i.e., ID), name, and path of the form. Therefore, the extraction module 202 extracts the tag names of the forms and decomposes the tag names, so that each form included in the WEB page and the form information included in each form can be easily extracted.
The form information may include the type of data contained in the form (e.g., text box, date, number, drop down menu, etc.), the content of the data contained in the form, and the operations to which the data contained in the form relates (e.g., data update, data query, data delete, etc.). In addition, the form information may also include the layout manner of the extracted form. For example, the layout manner of the form may generally include a page layout manner, a table layout manner, a streaming layout manner, an adaptive layout manner, and the like.
After the extraction module 202 extracts all forms from the WEB page, the encapsulation module 203 encapsulates all the forms extracted from the WEB page by the extraction module 202 into a service object according to the form information. For example, assuming that the extraction module 202 extracts a form from a WEB page, the encapsulation module 203 may encapsulate the form into a business object. For another example, assuming that the extracting module 202 extracts a plurality of forms from a WEB page, the encapsulating module 203 may encapsulate the plurality of forms into a service object.
According to yet another aspect of the apparatus for automatically generating a data model of an embodiment of the present disclosure, the data model generation module 204 may employ existing rapid software development tools to generate the data model. For example, the rapid software development tool may be a Power Builder or a conditional Rose tool, among other tools. In generating the data model, the business objects may be first entered into the rapid software development tools, which are then able to generate the data model from the entered business objects.
According to still another aspect of the apparatus for automatically generating a data model of the embodiment of the present disclosure, as shown in fig. 4, the apparatus may further include an application generation module 205 for generating an executable application according to the data model. For example, the application generation module 205 may employ Visual studio, Google Forms, or online form design tools, etc. to generate an executable application from the data model. In addition, if the user has modified the data model generated by the data model generation module 204, the data model upon which the application generation module 205 is based is a data model that has been repeatedly modified by the user. In this way, an executable application can be saved after it has been generated.
The executable application program may include an application program code, a form object, and a database, where the database is used to store data related to the form object, the form object relates to a layout manner of the form, a type of the data related to the form, and data content, and the application program code is a bridge between the form object and the database, and is used to describe how to perform an insertion operation, a query operation, an update operation, a delete operation, and the like of the data related to the form object.
Preferred embodiments of the present disclosure are described in detail with reference to the accompanying drawings, however, the embodiments of the present disclosure are not limited to the specific details of the embodiments, and various simple modifications may be made to the technical solutions of the embodiments of the present disclosure within the technical concept scope of the embodiments of the present disclosure, and the simple modifications all belong to the protective scope of the embodiments of the present disclosure.
It should be noted that the various features described in the above embodiments may be combined in any suitable manner without departing from the scope of the invention. In order to avoid unnecessary repetition, the embodiments of the present disclosure do not separately describe various possible combinations.
In addition, any combination of various different implementation manners of the embodiments of the present disclosure can be performed, and the embodiments of the present disclosure should be considered as disclosed in the embodiments of the present disclosure as long as the combinations do not depart from the spirit of the embodiments of the present disclosure.

Claims (8)

1. A method for automatically generating a data model, the method comprising:
acquiring a WEB page;
extracting forms in the WEB page, wherein each form contains form information;
packaging all the forms extracted from the WEB page into a service object according to the form information; and
and generating a data model according to the business object.
2. The method according to claim 1, wherein the retrieving the WEB page comprises:
and acquiring the WEB page by acquiring a uniform resource locator or a visual page output by a visual page design tool.
3. The method according to claim 1, wherein the extracting the form in the WEB page comprises:
and extracting each form by using the tag name in the hypertext markup language source code of the WEB page.
4. A method according to any one of claims 1 to 3, characterized in that the method further comprises: and generating an executable application program according to the data model.
5. An apparatus for automatically generating a data model, the apparatus comprising:
the WEB page acquisition module is used for acquiring a WEB page;
the extraction module is used for extracting forms in the WEB page, and each form contains form information;
the packaging module is used for packaging all the forms extracted from the WEB page into a service object according to the form information; and
and the data model generation module is used for generating a data model according to the business object.
6. The apparatus of claim 5, wherein the WEB page retrieving module retrieves the WEB page by retrieving a uniform resource locator or a visual page output by a visual page design tool.
7. The apparatus of claim 5 wherein the extraction module extracts each of the forms using a tag name in hypertext markup language source code of the WEB page.
8. The apparatus of any one of claims 5 to 7, further comprising an application generation module for generating an executable application in accordance with the data model.
CN201610765288.0A 2016-08-30 2016-08-30 Method and device for automatically generating data model Active CN106446024B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610765288.0A CN106446024B (en) 2016-08-30 2016-08-30 Method and device for automatically generating data model

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610765288.0A CN106446024B (en) 2016-08-30 2016-08-30 Method and device for automatically generating data model

Publications (2)

Publication Number Publication Date
CN106446024A CN106446024A (en) 2017-02-22
CN106446024B true CN106446024B (en) 2020-06-23

Family

ID=58090322

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610765288.0A Active CN106446024B (en) 2016-08-30 2016-08-30 Method and device for automatically generating data model

Country Status (1)

Country Link
CN (1) CN106446024B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109634585B (en) * 2018-11-27 2021-12-21 浙江万朋教育科技股份有限公司 Method for adaptively displaying and updating server data based on form

Citations (2)

* 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
CN104361140A (en) * 2014-12-10 2015-02-18 用友软件股份有限公司 Dynamically generated data model configuration device and method

Patent Citations (2)

* 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
CN104361140A (en) * 2014-12-10 2015-02-18 用友软件股份有限公司 Dynamically generated data model configuration device and method

Also Published As

Publication number Publication date
CN106446024A (en) 2017-02-22

Similar Documents

Publication Publication Date Title
CN103389895B (en) A kind of generation method and system of front end page
CN108228166B (en) Template-based back-end code generation method and system
KR102185864B1 (en) Server-side rendering method and system of native content for presentation
US20190171696A1 (en) Web-intrinsic interactive documents
WO2018000998A1 (en) Interface generation method, apparatus and system
CN108717437B (en) Search result display method and device and storage medium
US20150302110A1 (en) Decoupling front end and back end pages using tags
GB2576654A (en) Method and apparatus for facilitating creation of simulation model
CN102163233A (en) Method and system for converting webpage markup language format
KR20140038459A (en) Live browser tooling in an integrated development environment
CN113419728B (en) Marketing page building method, device, equipment and storage medium
CN104598570B (en) The grasping means of resource and device
CN110780868A (en) Website development method, device, equipment and storage medium based on componentized template
CN105224544A (en) A kind of data editing method of database and device
CN111831384A (en) Language switching method and device, equipment and storage medium
CN103324567B (en) A kind of adjustment method of application engine and debug system
CN114398138B (en) Interface generation method, device, computer equipment and storage medium
CN104156421B (en) The page shows method, apparatus and system
CN115599386A (en) Code generation method, device, equipment and storage medium
Decker et al. A tool for efficiently reverse engineering accurate UML class diagrams
CN109582580B (en) System, method and apparatus for debugging pages
CN106446024B (en) Method and device for automatically generating data model
CN107391175B (en) Control data configuration method and computer readable storage medium
CN113076094A (en) Front end component construction method and device and electronic equipment
CN107679168B (en) Target website content acquisition method based on java platform

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant