CN113177059A - Method and device for generating matching platform SQL script - Google Patents

Method and device for generating matching platform SQL script Download PDF

Info

Publication number
CN113177059A
CN113177059A CN202110559092.7A CN202110559092A CN113177059A CN 113177059 A CN113177059 A CN 113177059A CN 202110559092 A CN202110559092 A CN 202110559092A CN 113177059 A CN113177059 A CN 113177059A
Authority
CN
China
Prior art keywords
template
matching
requirement
sql script
attribute
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
CN202110559092.7A
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.)
China Construction Bank Corp
Original Assignee
China Construction Bank 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 China Construction Bank Corp filed Critical China Construction Bank Corp
Priority to CN202110559092.7A priority Critical patent/CN113177059A/en
Publication of CN113177059A publication Critical patent/CN113177059A/en
Pending legal-status Critical Current

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/24Querying
    • G06F16/242Query formulation
    • G06F16/2433Query languages
    • 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/22Indexing; Data structures therefor; Storage structures
    • G06F16/2282Tablespace storage structures; Management thereof
    • 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/186Templates

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Databases & Information Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Computational Linguistics (AREA)
  • Software Systems (AREA)
  • Health & Medical Sciences (AREA)
  • Artificial Intelligence (AREA)
  • Audiology, Speech & Language Pathology (AREA)
  • General Health & Medical Sciences (AREA)
  • Mathematical Physics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention discloses a method and a device for generating a matching platform SQL script, which relate to the technical field of automatic program design, wherein the method comprises the following steps: determining a service matching scene according to a service target; determining a plurality of service type templates and a plurality of sub-templates corresponding to each service type template of the service matching scene according to the service matching scene; configuring a plurality of sub-templates corresponding to each business type template according to the business requirement document and a pre-configured SQL generation strategy corresponding to each table; and generating the SQL script according to a generation strategy of a preconfigured SQL script table and a plurality of sub-templates corresponding to each business type template. The invention can realize template configuration and automatic generation of the SQL script and improve the efficiency and accuracy of the generation of the SQL script of the matching platform.

Description

Method and device for generating matching platform SQL script
Technical Field
The invention relates to the technical field of automatic program design, in particular to a method and a device for generating a matching platform SQL script.
Background
This section is intended to provide a background or context to the embodiments of the invention that are recited in the claims. The description herein is not admitted to be prior art by inclusion in this section.
The existing matching platform has various service scenes, the matching roles and the phase combinations of each scene are different, the displayed information items are different, the number of SQL sentences is large, the workload is large, templates are newly added and adjusted on lines of versions almost every time, a large amount of time is consumed by developers, and meanwhile, the problem of low accuracy rate in SQL script generation also exists.
Disclosure of Invention
The embodiment of the invention provides a method for generating a matching platform SQL script, which is used for efficiently and accurately generating the matching platform SQL script and comprises the following steps:
determining a service matching scene according to a service target; determining a plurality of service type templates and a plurality of sub-templates corresponding to each service type template of the service matching scene according to the service matching scene;
configuring a plurality of sub-templates corresponding to each business type template according to the business requirement document and a generation strategy of each table corresponding to a pre-configured Structured Query Language (SQL);
and generating the SQL script according to a generation strategy of a preconfigured SQL script table and a plurality of sub-templates corresponding to each business type template.
In an embodiment, the method for generating the SQL script matching the platform may further include pre-configuring a generation policy of each table corresponding to SQL according to the following steps:
configuring a requirement template definition table;
configuring a relation table of the template and the page module; the template name in the relation table of the template and page module is the configured template name in the requirement template definition table;
configuring a requirement attribute table; the domain numbers configured in the requirement attribute table exist in a matching code table;
configuring a matching code table; the attribute codes in the matching code table are formed by splicing domain numbers and code Chinese names;
configuring a requirement and attribute relation table; the template number in the requirement and attribute relation table is consistent with the template number in the configuration requirement template definition table;
configuring a matching relation table; the service requirement number and the user experience requirement number in the matching relation table are configured to be template numbers of the matching parties;
configuring a role resource table; and displaying, hiding or coding all information in the role resource table according to the logged role configuration.
In one embodiment, the serial number of the page module group in the requirement and attribute relation table is consistent with the serial number of the column page module in the relation table of the template and page module.
In one embodiment, the attribute validation rules in the requirement and attribute relationship table are consistent with the attribute validation rules in the requirement attribute table.
In one embodiment, the product attribute value type codes in the requirements attribute table include a text type, a date type, a column type, a custom column type, a maintainable column type, a numeric range type, a multi-line text type, and a time range type.
In one embodiment, a requirements template definition table is configured, comprising: and configuring the template name, the template number and the page template number of the requirement template definition table.
In an embodiment, the method for generating the SQL script matching platform may further include configuring a generation policy of the SQL script table in advance according to the following method:
configuring and generating an SQL script table; the table names are a requirement template definition table, a template and page module relation table, a requirement attribute table, a matching code table, a requirement and attribute relation table, a matching relation table and a role resource table which need to generate an SQL script;
the SQL script is configured to execute the macro.
In one embodiment, the version list in the SQL script table corresponds to the version number in the requirement template definition table, the template and page module relation table, the requirement attribute table, the matching code table, the requirement and attribute relation table, the matching relation table, and the role resource table.
In an embodiment, the method for generating the matching platform SQL script may further include: when the information of the service change is detected, the content and the version number in the plurality of sub-templates corresponding to each service type template are reconfigured;
generating an SQL script according to a generation strategy of a preconfigured SQL script table and a plurality of sub-templates corresponding to each business type template, wherein the generation strategy comprises the following steps: and regenerating the SQL script according to a generation strategy of a preconfigured SQL script table and a plurality of reconfigured sub-templates corresponding to each business type template.
The embodiment of the invention also provides a generating device of the matching platform SQL script, which is used for efficiently and accurately generating the matching platform SQL script and comprises the following components:
the determining unit is used for determining a service matching scene according to the service target; determining a plurality of service type templates and a plurality of sub-templates corresponding to each service type template of the service matching scene according to the service matching scene;
the configuration unit is used for configuring a plurality of sub-templates corresponding to each business type template according to the business requirement document and the generation strategy of each table corresponding to the preset SQL;
and the generating unit is used for generating the SQL script according to a generating strategy of a preconfigured SQL script table and a plurality of sub-templates corresponding to each business type template.
The embodiment of the invention also provides computer equipment which comprises a memory, a processor and a computer program which is stored on the memory and can run on the processor, wherein the processor realizes the generation method of the matching platform SQL script when executing the computer program.
The embodiment of the invention also provides a computer readable storage medium, which stores a computer program for executing the method for generating the matching platform SQL script.
In the embodiment of the invention, the generation scheme of the SQL script of the matching platform is realized by the following steps: determining a service matching scene according to a service target; determining a plurality of service type templates and a plurality of sub-templates corresponding to each service type template of the service matching scene according to the service matching scene; configuring a plurality of sub-templates corresponding to each business type template according to the business requirement document and a generation strategy of each table corresponding to a pre-configured Structured Query Language (SQL); the SQL script is generated according to the generation strategy of the pre-configured SQL script table and the plurality of sub-templates corresponding to each business type template, so that the SQL can be automatically generated by template configuration, and the efficiency and the accuracy of the generation of the SQL script of the matching platform are improved.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts. In the drawings:
FIG. 1 is a schematic flow chart of a method for generating a matching platform SQL script in the embodiment of the present invention;
FIG. 2 is a schematic flow chart illustrating a generation policy for each table according to SQL pre-configured in the embodiment of the present invention;
FIG. 3 is a schematic flow chart illustrating a generation policy for pre-configuring an SQL script table according to an embodiment of the present invention;
FIG. 4 is a diagram illustrating a configuration of an SQL script execution macro according to an embodiment of the present invention;
FIG. 5 is a schematic structural diagram of a matching platform SQL script generation device in the embodiment of the present invention;
fig. 6 is a schematic structural diagram of a computer device in an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention more apparent, the embodiments of the present invention are further described in detail below with reference to the accompanying drawings. The exemplary embodiments and descriptions of the present invention are provided to explain the present invention, but not to limit the present invention.
Before describing embodiments of the present invention, terms related to the embodiments of the present invention will be described.
Abbreviation of VB Visual Basic;
SQL Query Language, an abbreviation for Structured Query Language;
an Oracle Oracle Database;
function, process with return value;
set define off override variable function;
sheet worksheets;
code _ type code type;
PPP mode Public Private Partnership government and social capital cooperative mode;
a STORE show window;
prodprodprodroduct abbreviation, product;
s _ MODEL _ Attribute MODEL number;
the quantity of Amount;
the Email text represents the configuration mailbox verification;
the True/False configuration item corresponds to yes/no;
a Positive Integer;
tel Telphone, abbreviation;
range documents indicate Range checking;
the representation in Ranngelength text represents the check of the length of the text;
the Ischinese text indicates the verification of Chinese required to be input;
the nReadonly text shows the newly-established read-only check, and n is the abbreviation of new;
eReadonly text shows the check of editing read-only, e is the shorthand of the edit;
a number;
a positive non-negative number;
the maxSelNum text represents the maximum selectable number;
an area region;
the limitnumOnly text indicates that only numbers can be input, and Num is an abbreviation of Number;
show defaults to show;
default.
The technology related to the embodiment of the invention is applied to the automatic generation of SQL scripts of a matching platform, matching scenes are various, matching roles and stage combinations of each scene are different, displayed information items are different, different matching fields have different models, the number of the existing templates reaches four hundred, each template has 2-4 modules on average, attributes of each template are 30-40 on average, each template needs to be configured with a requirement template definition table (as shown in the following table 1), a new requirement attribute table (as shown in the following table 3), a requirement and attribute relation table (as shown in the following table 5), a template and page module relation table (as shown in the following table 2), a role resource table (as shown in the following table 7), a corresponding matching code table (as shown in the following table 4), a matching relation table (as shown in the following table 6) and other related information, the SQL statements are more, the workload is large, and the template is newly added and adjusted almost every version, the method consumes a lot of time for developers, and particularly, the traditional SQL data generation mainly has the following problems:
(1) the manual sentence knocking cost is very high, and the mistake is easy to make.
(2) Different sub-templates exist in the same template, although the difference of the sub-templates is small, the time is more consumed for manually modifying the SQL.
(3) There may be multiple phases for the same type of demand; the corresponding attributes of each stage are different.
(4) Matching requirements corresponding to different templates are different, so that developers need to check by eyes and convert the matching requirements into corresponding scripts to be stored in a warehouse, and omission and errors often occur.
(5) The content in the template is often changed by the service, and the checking and the modifying are not only easy to make mistakes, but also consume a lot of time.
In consideration of the usability and extensibility of future products, the inventor considers the technical problems, and therefore a generation scheme matching with a platform SQL script is provided, the scheme is a VB-based SQL generator, the scheme realizes template configuration and automatically generates SQL, and is more flexible and convenient. Specifically, the implementation method of the embodiment of the present invention mainly includes the following steps. As the basis of program operation, the generation rules of several tables corresponding to SQL are configured in advance, and the generation rules are set for each table. Which comprises the following steps: the SQL file name generated, the operator, the creation date, whether to enable, whether to retain SQL, generate a version list, initialize SQL, and generate an SQL formula configuration. After the rule configuration is completed, the sheet page items of the corresponding table needing to generate the SQL are configured at the same time, the content corresponding to the template is completely supplemented, the program can be operated, and the SQL sentences of each sheet page item are generated to be under the specified directory. The following describes the generation scheme of the matching platform SQL script in detail.
Fig. 1 is a schematic flow chart of a method for generating a matching platform SQL script in an embodiment of the present invention, and as shown in fig. 1, the method includes the following steps:
step 101: determining a service matching scene according to a service target; determining a plurality of service type templates and a plurality of sub-templates corresponding to each service type template of the service matching scene according to the service matching scene;
step 102: configuring a plurality of sub-templates corresponding to each business type template according to the business requirement document and a generation strategy of each table corresponding to a pre-configured Structured Query Language (SQL);
step 103: and generating the SQL script according to a generation strategy of a preconfigured SQL script table and a plurality of sub-templates corresponding to each business type template.
In the embodiment of the invention, the generation method of the matching platform SQL script comprises the following steps: determining a service matching scene according to a service target; determining a plurality of service type templates and a plurality of sub-templates corresponding to each service type template of the service matching scene according to the service matching scene; configuring a plurality of sub-templates corresponding to each business type template according to the business requirement document and a generation strategy of each table corresponding to a pre-configured Structured Query Language (SQL); the SQL script is generated according to the generation strategy of the pre-configured SQL script table and the plurality of sub-templates corresponding to each business type template, so that the SQL can be automatically generated by template configuration, and the efficiency and the accuracy of the generation of the SQL script of the matching platform are improved.
In an embodiment, as shown in fig. 2, the method for generating the SQL script of the matching platform may further include configuring a generation policy of each table corresponding to SQL in advance according to the following steps:
step 201: configuring a template name, a template number and a page template number of a requirement template definition table;
step 202: configuring a relation table of the template and the page module; the template name in the relation table of the template and page module is the configured template name in the requirement template definition table;
step 203: configuring a requirement attribute table; the domain numbers configured in the requirement attribute table exist in a matching code table;
step 204: configuring a matching code table; the attribute codes in the matching code table are formed by splicing domain numbers and code Chinese names;
step 205: configuring a requirement and attribute relation table; the template number in the requirement and attribute relation table is consistent with the template number in the configuration requirement template definition table;
step 206: configuring a matching relation table; the service requirement number and the user experience requirement number in the matching relation table are configured to be template numbers of the matching parties;
step 207: configuring a role resource table; and displaying, hiding or coding all information in the role resource table according to the logged role configuration.
The step of generating the policy corresponding to each table in the preconfigured SQL is described in detail below, that is, the step of describing the table configuration flow.
In the requirement template definition table of table 1, template names (three types of templates, a general template type, an information creation maintenance type and a requirement detail display type) are respectively configured, template numbers, page template numbers and corresponding version information, the first three fields must be unique and cannot be repeated with the existing template information, and the version number is configured when SQL is generated (the version number rules of all tables below are consistent and are not repeated).
Figure BDA0003078239950000071
Table 1 requirements template definition table configuration rules (policies)
Table 2 shows the relationship configuration rules of the template and the page module, and the following table fields are respectively configured, where the template name must be the configured template information in table 1, if there is no SQL report generation exception, the sequence of the page module determines the sequence of the module on the page display, the sequence of the page module group consists of 10 digits, each module corresponds to a module group sequence, the chinese and english names of the page module group are named according to the module title in the prototype page, allowing emptying, the parameter query identifier is 0 or 1, 1 identifies the entry of the module as the requirement for the other, otherwise, 0.
Figure BDA0003078239950000072
Figure BDA0003078239950000081
TABLE 2 template and Page Module relationship configuration rules
Table 3 requires attribute configuration rules, configures newly added attribute information, repeats SQL statement exception, starts with S _ mode _ with a unique attribute number, has a fixed length of 16 bits, configures a data type corresponding to the attribute with an attribute type code, currently supports a text type, a date type, a list type, a custom list type, a maintainable list type, a numerical range type, a multi-line text type, and a time range type, if the attribute type code is configured to the list type, the custom list type, the maintainable list type, three items of a domain number need to be configured, and the configured domain number needs to exist in table 4 below. If the attribute type is numerical type and needs to be displayed as proportion type, filling the measuring unit code with 'percent' or 'thousandth' and the like; the attribute verification rule is a common service verification function, if the attribute is an amount class, the attribute can be configured as an amount: true, whether an input numerical value is in an amount format is verified, mailbox verification is configured as an email: true, a positive Integer type verification positive Integer: true, a percentage verification range [0,100], a text box number verification range [0,500], a mobile phone format verification tel: true, Chinese ischinese: true is required to be input, new read-only read is required, read-only read is edited, number: true, non-negative number: true, true is limited, multiple selection number MaxSelNum:200 is limited, a region area is judged, true is limited to only having a number input limitmOnly read (multiple verification rules are separated by # numbers), and the like.
Figure BDA0003078239950000082
Figure BDA0003078239950000091
TABLE 3 requirement Attribute Table configuration rules
Table 4 matches the code table configuration rule, the configuration needs to correspond to the standard code table, wherein the attribute code does not need to be filled, and is formed by automatically splicing the domain number and the code chinese name, the attribute name configures the domain name, the domain number corresponds to the column domain number in table 3, and corresponds to the code _ type of the code table, the code value column configures the code value corresponding to the code, and the parent domain code value mainly aims at the code with the cascade attribute and needs to configure the upper domain thereof.
Figure BDA0003078239950000092
Table 4 matching code table configuration rules
Table 5 requires a rule for configuring the relationship between the attribute and the template, the template number needs to be identical to the template number in table 1, the attribute name is displayed according to the information in the prototype page, the display sequence is ordered from left to right and from top to bottom according to the position where the attribute is displayed in the prototype page, and the serial number of the page module group is identical to the serial number of the column page module in table 2; the attribute value non-null identifier is used for configuring whether the attribute value is a necessary input item; if the data type is list type, custom list type or maintainable list type, the radio list is configured as single selection or multiple selection, and the rest is defaulted as single selection; the attribute shapes are used for distinguishing matching conditions, part of templates do not have the attribute required by the opposite side, content copying is required, copying is not required when the template is empty, 01 indicates that the attribute is a necessary match, and 02 indicates an optional match; if the cascade attribute exists, the father attribute needs to be configured; the attribute validation rules are consistent with the attribute validation rules of table 3. The attribute default value only aims at a newly-built maintenance template or a detail display template, and the display default value is as follows: show, conventional default: default, if the country defaults to china, default to default 156, default to show for face, etc.
Figure BDA0003078239950000101
TABLE 5 requirement and Attribute relationship configuration rules
That is, in one embodiment, the serial number of the page module in the requirement and attribute relationship table may be identical to the serial number of the column page module in the template and page module relationship table.
That is, in one embodiment, the attribute validation rules in the requirements and attribute relationship table may be consistent with the attribute validation rules in the requirements attribute table.
Table 6 configures the lowest matching conditions of the two parties requiring the matching, the service requirement number and the user experience requirement number are configured as template numbers of the two parties matching, and if the two parties matching the shop window or the commodity, the number is configured as STORE or PROD; transaction pattern code 01: one-way, i.e. both sides succeed as long as one side meets the other, 02: and in two directions, the matching is successful only if the requirements of the two parties meet each other. The processing method code 01 indicates that the condition is satisfied, and 02 indicates that the condition is not necessarily satisfied; and limiting the quantity value of the condition, and calculating the matching success only when the minimum condition number is met, wherein the total number of the matching conditions which the service hopes to meet is total. The standard number is used for configuring the total number of one-time matching in the matching process, the grouping number is recorded as the current self-increment serial number, and a new matching self-increment 1 is added.
Figure BDA0003078239950000102
Figure BDA0003078239950000111
TABLE 6 matchmaking rules configuration
Table 7 role resource configuration rules, all information needs to be displayed, hidden or coded according to the logged-in role configuration, for example, 50 elements are entered in an inline PPP template, 40 elements are entered in an inline template, then three sets of display pages need to be subdivided when viewing the template pages entered in the inline, and if the template pages are inline users, all the display pages are displayed; if the user is an out-of-line user, 40 elements visible to the out-of-line user are displayed; and if the visitor checks the code, the code is printed and displayed on the basis of the second point. The role number corresponds to the role in the system, 10029-inline user; 10030-enterprise customers; 10031-tourist. And when one resource configuration is added, the resource sequence number is increased by 1, so that the role number + the sequence number can not violate the unique index constraint. The attribute viewing type is 01-not shown, 02-coding is carried out, and the resource number is configured to be the serial number of a page module to which the attribute value to be coded or hidden belongs plus "_" + attribute value number.
Figure BDA0003078239950000112
TABLE 7 role resource configuration rules
The following describes the steps of configuring the generation policy of the SQL script table in advance, i.e. the table parsing flow.
In an embodiment, as shown in fig. 3, the method for generating the SQL script matching the platform may further include configuring a generation policy of the SQL script table in advance according to the following method:
step 301: configuring and generating an SQL script table; the table names are a requirement template definition table, a template and page module relation table, a requirement attribute table, a matching code table, a requirement and attribute relation table, a matching relation table and a role resource table which need to generate an SQL script;
step 302: the SQL script is configured to execute the macro.
In specific implementation, when the SQL script table is configured (step 301): table 8 generates an SQL script configuration, the table names are table 1 to table 7 of this configuration, which need to generate an SQL script, the output file name allows customization, the enabled configuration "yes" and "no" indicates whether a new SQL is generated this time, the generated version list corresponds to the version numbers in table 1 to table 7, if the SQL version number generated by the configuration is 1.1, the configuration information configured as a version other than 1.1 is not executed. The initialization SQL statement is typically a conventional SQL statement, such as a close variable replacement function of Oracle. H \\ \ dbinit is a uniform generation path of all SQL, a folder needs to be built in a corresponding directory in advance before an SQL command is executed, and log information executed by a script is reflected under the field.
Figure BDA0003078239950000121
Table 8 generates SQL script configuration
That is, in one embodiment, the version list in the SQL script table corresponds to the version number in the requirement template definition table, the template-to-page module relationship table, the requirement attribute table, the matching code table, the requirement-to-attribute relationship table, the matching relationship table, and the role resource table.
In specific implementation, when the SQL script executes the macro (step 302), the macro configured in table 8 mainly has the following modules, common modules, and generated files, as shown in fig. 4.
The corresponding simplified pseudo-code may be as follows:
Figure BDA0003078239950000122
Figure BDA0003078239950000131
and after SQL is executed, checking whether a generated file exists in the configured directory or not, and if so, judging whether the generated file exists or not. And error information can be fed back well, so that developers can read and position the configuration error position quickly and correspond to which field of which table.
In an embodiment, the method for generating the matching platform SQL script may further include: when the information of the service change is detected, the content and the version number in the plurality of sub-templates corresponding to each service type template are reconfigured;
generating an SQL script according to a generation strategy of a preconfigured SQL script table and a plurality of sub-templates corresponding to each business type template, wherein the generation strategy comprises the following steps: and regenerating the SQL script according to a generation strategy of a preconfigured SQL script table and a plurality of reconfigured sub-templates corresponding to each business type template.
In specific implementation, if the template information is changed by the service, only the corresponding change content and version number need to be modified, and the corresponding SQL script can be generated in full or incremental mode again. That is, if the service changes the information in the original template, only the corresponding information needs to be found in Excel, and the SQL script is regenerated.
To facilitate an understanding of how the invention may be implemented, an example of a matching scenario is presented below.
Firstly, configuring a scene description.
The business scene case: in order to meet the requirements of the cultural industry type enterprises, a cultural industry release module needs to be newly added on a platform, and the module is divided into a plurality of types: cultural service, cultural cooperation, cultural investment and the like, and the corresponding modules and information are different under different types.
If according to the traditional method, developers need to sequentially input the information into the database, the time and labor are wasted in manually generating the SQL, the simultaneous configuration of a plurality of sets of templates is difficult to support, and once the workload of change is huge, the SQL generator introduced by the text is adopted to support rapid development and iteration.
And secondly, configuring and SQL generating processes.
1. And combing the presentation forms of different templates under different scenes according to the business target, wherein the business scene can be divided into 3 sets of main templates, a cultural service template, a cultural cooperation template and a cultural investment template.
2. Each set of template (a plurality of sub-templates corresponding to each service type template) can subdivide different sub-templates according to actual service scenes, such as a culture service newly-built editing template (with the number of MDCCB _ WHFW _ NE) and a culture service preview detail display template (with the number of omitted), or subdividing the sub-templates according to different roles and different visual angles, such as a culture service in-line user template, a culture service out-of-line user template, a culture service tourist template and other sub-templates.
3. Configuring each set of subdivided templates according to detailed requirement documents provided by product analysts, inputting corresponding information such as fields, attributes, update version numbers and the like into Excel tables 1-7 according to the content of the 2.2.1 configuration flow, and storing the configuration after the correctness is confirmed.
4. And (4) selecting to execute SQL in a single or batch mode, and generating an SQL script to a specified directory.
5. If the business changes the template information, only the corresponding change content and version number need to be modified, and the corresponding SQL script can be generated in full or incremental mode again.
To sum up, the beneficial technical effects of the method for generating the matching platform SQL script provided by the embodiment of the present invention may include:
1. the developer can generate the SQL script only by inputting the fields provided by the service in the Excel.
2. If the service changes the information in the original template, only the corresponding information needs to be found in Excel, and the SQL script is regenerated.
3. Saving a large amount of time of developers and greatly improving the working efficiency of the developers.
4. The template error rate and the number of defects are greatly reduced.
5. Different matching requirements are required for different templates.
The embodiment of the invention also provides a device for generating the SQL script of the matching platform, which is described in the following embodiment. Because the principle of the device for solving the problems is similar to the method for generating the matching platform SQL script, the implementation of the device can refer to the implementation of the method for generating the matching platform SQL script, and repeated parts are not repeated.
Fig. 5 is a schematic structural diagram of a device for generating a matching platform SQL script in an embodiment of the present invention, and as shown in fig. 5, the device includes:
the determining unit 01 is used for determining a service matching scene according to the service target; determining a plurality of service type templates and a plurality of sub-templates corresponding to each service type template of the service matching scene according to the service matching scene;
the configuration unit 02 is used for configuring a plurality of sub-templates corresponding to each service type template according to the service requirement document and a generation strategy of each table corresponding to the pre-configured SQL;
the generating unit 03 is configured to generate an SQL script according to a generation policy of a preconfigured SQL script table and a plurality of sub-templates corresponding to each service type template.
In an embodiment, the apparatus for generating a matching platform SQL script may further include a first pre-configuration unit, configured to:
configuring a template name, a template number and a page template number of a requirement template definition table;
configuring a relation table of the template and the page module; the template name in the relation table of the template and page module is the configured template name in the requirement template definition table;
configuring a requirement attribute table; the domain numbers configured in the requirement attribute table exist in a matching code table;
configuring a matching code table; the attribute codes in the matching code table are formed by splicing domain numbers and code Chinese names;
configuring a requirement and attribute relation table; the template number in the requirement and attribute relation table is consistent with the template number in the configuration requirement template definition table;
configuring a matching relation table; the service requirement number and the user experience requirement number in the matching relation table are configured to be template numbers of the matching parties;
configuring a role resource table; and displaying, hiding or coding all information in the role resource table according to the logged role configuration.
In an embodiment, the apparatus for generating a matching platform SQL script may further include a second pre-configuration unit, configured to:
configuring and generating an SQL script table; the table names are a requirement template definition table, a template and page module relation table, a requirement attribute table, a matching code table, a requirement and attribute relation table, a matching relation table and a role resource table which need to generate an SQL script;
the SQL script is configured to execute the macro.
In an embodiment, the apparatus for generating a matching platform SQL script further includes: the reconfiguration unit is used for reconfiguring the content and the version number in the plurality of sub-templates corresponding to each service type template when the information of service change is detected;
the generating unit may specifically be configured to: and regenerating the SQL script according to a generation strategy of a preconfigured SQL script table and a plurality of reconfigured sub-templates corresponding to each business type template.
An embodiment of the present invention further provides a computer device, as shown in fig. 6, which includes a memory 302, a processor 304, and a computer program stored on the memory and executable on the processor, where the processor implements the above-mentioned arbitrary matching platform SQL script generation method when executing the computer program.
In particular, the computer device may be a computer terminal, a server or a similar computing device.
An embodiment of the present invention further provides a computer-readable storage medium, where a computer program for executing any method for generating a matching platform SQL script is stored in the computer-readable storage medium.
In particular, computer-readable storage media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer-readable storage media include, but are not limited to, phase change memory (PRAM), Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), Read Only Memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), Digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device. As defined herein, a computer readable storage medium does not include a transitory computer readable medium such as a modulated data signal and a carrier wave.
In the embodiment of the invention, the generation scheme of the SQL script of the matching platform is realized by the following steps: determining a service matching scene according to a service target; determining a plurality of service type templates and a plurality of sub-templates corresponding to each service type template of the service matching scene according to the service matching scene; configuring a plurality of sub-templates corresponding to each business type template according to the business requirement document and a generation strategy of each table corresponding to a pre-configured Structured Query Language (SQL); the SQL script is generated according to the generation strategy of the pre-configured SQL script table and the plurality of sub-templates corresponding to each business type template, so that the SQL can be automatically generated by template configuration, and the efficiency and the accuracy of the generation of the SQL script of the matching platform are improved.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
The above-mentioned embodiments are intended to illustrate the objects, technical solutions and advantages of the present invention in further detail, and it should be understood that the above-mentioned embodiments are only exemplary embodiments of the present invention, and are not intended to limit the scope of the present invention, and any modifications, equivalent substitutions, improvements and the like made within the spirit and principle of the present invention should be included in the scope of the present invention.

Claims (15)

1. A method for generating a matching platform SQL script is characterized by comprising the following steps:
determining a service matching scene according to a service target; determining a plurality of service type templates and a plurality of sub-templates corresponding to each service type template of the service matching scene according to the service matching scene;
configuring a plurality of sub-templates corresponding to each business type template according to the business requirement document and a generation strategy of each table corresponding to a pre-configured Structured Query Language (SQL);
and generating the SQL script according to a generation strategy of a preconfigured SQL script table and a plurality of sub-templates corresponding to each business type template.
2. The method for generating a platform-matched SQL script according to claim 1, further comprising the following steps of pre-configuring the strategy for generating each table corresponding to SQL:
configuring a requirement template definition table;
configuring a relation table of the template and the page module; the template name in the relation table of the template and page module is the configured template name in the requirement template definition table;
configuring a requirement attribute table; the domain numbers configured in the requirement attribute table exist in a matching code table;
configuring a matching code table; the attribute codes in the matching code table are formed by splicing domain numbers and code Chinese names;
configuring a requirement and attribute relation table; the template number in the requirement and attribute relation table is consistent with the template number in the configuration requirement template definition table;
configuring a matching relation table; the service requirement number and the user experience requirement number in the matching relation table are configured to be template numbers of the matching parties;
configuring a role resource table; and displaying, hiding or coding all information in the role resource table according to the logged role configuration.
3. The method of generating a matching platform SQL script of claim 2, wherein the order of a page module in the requirements and attributes relationship table is consistent with the order of a column page module in the template and page module relationship table.
4. The method of generating a matching platform SQL script of claim 2, wherein the attribute validation rules in the requirements and attribute relationship table are consistent with the attribute validation rules in the requirements attribute table.
5. The method of generating a matching platform SQL script of claim 2, wherein the product attribute value type codes in the requirements attribute table comprise a text type, a date type, a column type, a custom column type, a maintainable column type, a numeric range type, a multi-line text type, and a time range type.
6. The method of generating a matching platform SQL script of claim 2, wherein configuring a requirements template definition table comprises: and configuring the template name, the template number and the page template number of the requirement template definition table.
7. The method of generating a matching platform SQL script of claim 1, further comprising: the method comprises the following steps of pre-configuring a generation strategy of the SQL script table according to the following method:
configuring and generating an SQL script table; the table names are a requirement template definition table, a template and page module relation table, a requirement attribute table, a matching code table, a requirement and attribute relation table, a matching relation table and a role resource table which need to generate an SQL script;
the SQL script is configured to execute the macro.
8. The method for generating a matching platform SQL script of claim 7, wherein a version list in the SQL script table corresponds to a version number in a requirement template definition table, a template-to-page module relation table, a requirement attribute table, a matching code table, a requirement-to-attribute relation table, a matching relation table, and a role resource table.
9. The method of generating a matching platform SQL script of claim 1, further comprising: when the information of the service change is detected, the content and the version number in the plurality of sub-templates corresponding to each service type template are reconfigured;
generating an SQL script according to a generation strategy of a preconfigured SQL script table and a plurality of sub-templates corresponding to each business type template, wherein the generation strategy comprises the following steps: and regenerating the SQL script according to a generation strategy of a preconfigured SQL script table and a plurality of reconfigured sub-templates corresponding to each business type template.
10. A generating device for matching platform SQL script is characterized by comprising:
the determining unit is used for determining a service matching scene according to the service target; determining a plurality of service type templates and a plurality of sub-templates corresponding to each service type template of the service matching scene according to the service matching scene;
the configuration unit is used for configuring a plurality of sub-templates corresponding to each business type template according to the business requirement document and the generation strategy of each table corresponding to the preset SQL;
and the generating unit is used for generating the SQL script according to a generating strategy of a preconfigured SQL script table and a plurality of sub-templates corresponding to each business type template.
11. The matching platform SQL script generation apparatus of claim 10, further comprising a first pre-configuration unit configured to:
configuring a requirement template definition table;
configuring a relation table of the template and the page module; the template name in the relation table of the template and page module is the configured template name in the requirement template definition table;
configuring a requirement attribute table; the domain numbers configured in the requirement attribute table exist in a matching code table;
configuring a matching code table; the attribute codes in the matching code table are formed by splicing domain numbers and code Chinese names;
configuring a requirement and attribute relation table; the template number in the requirement and attribute relation table is consistent with the template number in the configuration requirement template definition table;
configuring a matching relation table; the service requirement number and the user experience requirement number in the matching relation table are configured to be template numbers of the matching parties;
configuring a role resource table; and displaying, hiding or coding all information in the role resource table according to the logged role configuration.
12. The matching platform SQL script generation apparatus of claim 10, further comprising a second pre-configuration unit configured to:
configuring and generating an SQL script table; the table names are a requirement template definition table, a template and page module relation table, a requirement attribute table, a matching code table, a requirement and attribute relation table, a matching relation table and a role resource table which need to generate an SQL script;
the SQL script is configured to execute the macro.
13. The apparatus for generating matching platform SQL script of claim 10, further comprising: the reconfiguration unit is used for reconfiguring the content and the version number in the plurality of sub-templates corresponding to each service type template when the information of service change is detected;
the generating unit is specifically configured to: and regenerating the SQL script according to a generation strategy of a preconfigured SQL script table and a plurality of reconfigured sub-templates corresponding to each business type template.
14. A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor implements the method of any of claims 1 to 9 when executing the computer program.
15. A computer-readable storage medium, characterized in that the computer-readable storage medium stores a computer program for executing the method of any one of claims 1 to 9.
CN202110559092.7A 2021-05-21 2021-05-21 Method and device for generating matching platform SQL script Pending CN113177059A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110559092.7A CN113177059A (en) 2021-05-21 2021-05-21 Method and device for generating matching platform SQL script

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110559092.7A CN113177059A (en) 2021-05-21 2021-05-21 Method and device for generating matching platform SQL script

Publications (1)

Publication Number Publication Date
CN113177059A true CN113177059A (en) 2021-07-27

Family

ID=76929626

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110559092.7A Pending CN113177059A (en) 2021-05-21 2021-05-21 Method and device for generating matching platform SQL script

Country Status (1)

Country Link
CN (1) CN113177059A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113962206A (en) * 2021-10-22 2022-01-21 中电金信软件有限公司 Report generation method and device

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113962206A (en) * 2021-10-22 2022-01-21 中电金信软件有限公司 Report generation method and device

Similar Documents

Publication Publication Date Title
CN104133772B (en) Automatic test data generation method
CN110543303B (en) Visual service platform
CN105511873B (en) User interface control display method and device
US20140317563A1 (en) Generate field mapping
CN110705237B (en) Automatic document generation method, data processing device and storage medium
CN102360290A (en) Form building device and form building method
CN111784108B (en) Modeling method and device of main data management platform
CN107329765B (en) Program file processing method and device
CN111125064B (en) Method and device for generating database schema definition statement
US20210124752A1 (en) System for Data Collection, Aggregation, Storage, Verification and Analytics with User Interface
CN114327458A (en) Method and system for quickly building enterprise informatization system
CN113177059A (en) Method and device for generating matching platform SQL script
CN114564194A (en) Form self-defining development method and system based on VUE framework
CN114037493A (en) Method and system for generating bidding document
CN117539981A (en) Method, equipment and medium for constructing theme data set
CN115659920A (en) Method and device for converting Excel process into cxp process
CN115221840A (en) PDM system-oriented business document structured dynamic form configuration method
CN111090978B (en) Document processing method and device and storage medium
CN114330256A (en) Method and equipment for generating user-defined form control based on antd
CN113553047A (en) Method and device for converting DSL into visual page
CN113254455A (en) Dynamic configuration method and device of database, computer equipment and storage medium
CN110597507A (en) Business form modeling system and modeling method
CN115455035B (en) Data query model construction method and computer-readable storage medium
CN113468460B (en) Method, device and equipment for rendering Web page based on YAML (Yaml language)
CN111144084B (en) Method and system for configuring article template and method and system for generating article

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