CN106919374A - A kind of scenario generation method and device - Google Patents

A kind of scenario generation method and device Download PDF

Info

Publication number
CN106919374A
CN106919374A CN201511000556.1A CN201511000556A CN106919374A CN 106919374 A CN106919374 A CN 106919374A CN 201511000556 A CN201511000556 A CN 201511000556A CN 106919374 A CN106919374 A CN 106919374A
Authority
CN
China
Prior art keywords
script
user
logic
subservice
generated
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.)
Granted
Application number
CN201511000556.1A
Other languages
Chinese (zh)
Other versions
CN106919374B (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.)
Beijing Jingdong Century Trading Co Ltd
Beijing Jingdong Shangke Information Technology Co Ltd
Original Assignee
Beijing Jingdong Century Trading Co Ltd
Beijing Jingdong Shangke Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Jingdong Century Trading Co Ltd, Beijing Jingdong Shangke Information Technology Co Ltd filed Critical Beijing Jingdong Century Trading Co Ltd
Priority to CN201511000556.1A priority Critical patent/CN106919374B/en
Publication of CN106919374A publication Critical patent/CN106919374A/en
Application granted granted Critical
Publication of CN106919374B publication Critical patent/CN106919374B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/31Programming languages or programming paradigms

Abstract

This application discloses a kind of scenario generation method and device, wherein method includes:After the python programmings for receiving validated user are instructed, the set-up procedure of triggering script generation;Using metadatabase, currently the field name of the corresponding each subservice logic of script to be generated, table name and condition and the connection for being coupled each subservice logic are accorded with to trigger user's selection, and generate corresponding service logic script;Joint debugging test is carried out to the service logic script, if test passes through, corresponding script file is generated according to the service logic script.Using the present invention, the formation efficiency of python scripts, specification script form can be improved and be easily achieved.

Description

A kind of scenario generation method and device
Technical field
The present invention relates to Computer Applied Technology, the generation method and system of more particularly to a kind of script.
Background technology
At present in distributed big data (hadoop), extract-conversion-loading (ETL, Extract-Transform-Load) process of data is mainly completed using python scripts.At present, python The generation of script using manual type by programming personnel, it is necessary to be write.
Requirement of the method for above-mentioned traditional manually generated python scripts to writer can be very high, such as, it is necessary to ripe White silk grasps various rules, annotation, functional based method, parameter reference in python language etc., and in compiling procedure Programmer is needed often to the method and occupation mode in python language, so that the complexity that script is generated can be caused, And then reduce the efficiency of script generation, increased the difficulty of generation.Further, since in practical application, everyone Script edit style is inconsistent, causes the generation form of script and cannot unify.
As can be seen here, the generation method of existing python scripts, has that efficiency is low, difficulty is high, script format is not advised The problems such as model.
The content of the invention
In view of this, it is a primary object of the present invention to provide the generation method and device of a kind of script, can improve The formation efficiency of python scripts, specification script form and is easily achieved.
In order to achieve the above object, technical scheme proposed by the present invention is:
A kind of scenario generation method, including:
A, when receive validated user python programmings instruct after, triggering script generation set-up procedure;
B, using metadatabase, trigger the field of the corresponding each subservice logic of the current script to be generated of user's selection Name, table name and condition and the connection for being coupled each subservice logic are accorded with, and generate corresponding service logic script;
C, joint debugging test is carried out to the service logic script, if test passes through, according to the service logic script Generate corresponding script file.
A kind of script generation device, including:
Preparatory unit, for after the python programmings for receiving validated user are instructed, triggering the standard of script generation Standby process;
Script generation unit, for utilizing metadatabase, triggers the current script to be generated of user's selection corresponding each The field name of subservice logic, table name and condition and the connection for being coupled each subservice logic are accorded with, and are generated corresponding Service logic script;
Test cell, for carrying out joint debugging test to the service logic script, if test passes through, according to described Service logic script generates corresponding script file.
In sum, the generation method and device of script proposed by the present invention, is receiving the python journeys of validated user After sequence writes instruction, the set-up procedure of automatic triggering script generation;And after set-up procedure terminates, using metadatabase, Triggering user use the mode of selection be input into field name, table name and the condition of each subservice logic for generating script with And the connection for being coupled each subservice logic is accorded with, and the input results based on user automatically generate corresponding service logic Script.In this way, one side user need not only need to be input into by the way of selection by the way of manual compiling For the relevant information of script generation, thus do not need user skillfully grasp the various rules in python language, annotation, Functional based method, parameter reference etc., such that it is able to reduce the threshold of script generation, reduce the generation difficulty of python scripts, On the other hand, the formation efficiency of python scripts can also be improved so that script format has certain normalization.
Brief description of the drawings
Fig. 1 is the method flow schematic diagram of the embodiment of the present invention;
Fig. 2 is the apparatus structure schematic diagram of the embodiment of the present invention.
Specific embodiment
To make the object, technical solutions and advantages of the present invention clearer, below in conjunction with accompanying drawing and specific implementation The present invention is described in further detail for example.
Core concept of the invention is:Using metadatabase, the various numbers required for providing the user script edit According to resource, the information of manual compiling is needed when script is generated to reduce, meanwhile, based on metadatabase, automatically The relevant information for generating script selected according to user generates corresponding script, and automatic before script generation Detected, such that it is able to improving the formation efficiency of python scripts, specification script form and being easily achieved.
Fig. 1 is the method flow schematic diagram of the embodiment of the present invention one, as shown in figure 1, the embodiment mainly includes:
Step 101, when receive validated user python programmings instruct after, triggering script generation preparation Journey.
This step is used to complete the preparation of script generation.
In actual applications, the legitimate verification of user identity, can be by Enterprise Resources Plan (ERP) certification reality Existing, specific method is grasped by those skilled in the art, be will not be repeated here.
It is preferred that the set-up procedure of above-mentioned script generation can comprise the steps:
The version information that step 1011, the acquisition user determine for script to be generated.
Specifically, the version information can be automatically generated by system and determined by user.
The letter that the script current to be generated that step 1012, the acquisition user select from default data dictionary is used Number.
This step is used to determine the system function that current script is used that here, user need not to manually enter, directly Called from default data dictionary, such that it is able to reducing the complexity of set-up procedure, shortening time.Should Data dictionary, be it is pre-configured in system database, will include python java standard libraries in system module (i.e. Bag or collection of functions), SET command parameters, direct quote command etc..The concrete configuration method of data dictionary is this area skill Art personnel grasped, and be will not be repeated here.
Step 1013, the acquisition user are that the customized function of script to be generated and corresponding function are annotated.
This step, needs customized function and corresponding annotation, to ensure the rule that script is generated for obtaining user Plasticity.
The reference that the script described to be generated that step 1014, the acquisition user select from the data dictionary is used Order.
This step, the quote command that user uses the need for only needing to be selected from data dictionary, therefore, can So that the workload of user is greatly reduced, the execution efficiency of set-up procedure is improved.
Step 1015, the acquisition user select from default database collection, the set of table type and table name set The script that the target database for preserving script operation result, table type and the table name and script for going out need when running Parameter.
From above-mentioned set-up procedure, it can be seen that in this process, script runs required system function, draws user It is to carry out being acquired by way of selection in related resource set user with information such as orders, such that it is able to big The workload of user in set-up procedure is greatly reduced, the execution efficiency of set-up procedure is improved.
Step 102, using metadatabase, trigger the corresponding each subservice of the current script to be generated of user's selection and patrol Volume field name, table name and condition and the connection for being coupled each subservice logic accord with, and generate corresponding business and patrol Collect script.
This step, for generating service logic script.Here, it is necessary to get through metadatabase, can to provide the user With the table, the field information that select, such that it is able to be based on selected these bases for generating service logic script of user The corresponding service logic script of this Automatic generation of information, this mode for automatically generating service logic script can be effective Avoid using the efficiency existing for manual entry mode editing affairs logic script it is low, be difficult to the problems such as realizing.
It is preferred that this step can be realized using following methods:
Step 1021, obtain the user from the set of fields in the metadatabase, each the described son selected Field name, table name and logic matching condition that service logic is included, and the field name, table name and logic are matched into bar Part combination obtains corresponding subservice logic script.
, it is necessary to field name, table name and the corresponding sub- industry of logic matching condition generation selected according to user in this step Business logic script.User only needs to select field name, table name and the logic for generating each subservice logic script With condition, without being input into complete script, therefore, it can that the difficulty of script generation is greatly lowered, carry Script formation efficiency high.
Step 1021, the connection symbol for obtaining each subservice logic that the user selects from default connection symbol set, And the subservice locial join is obtained into the service logic script using the symbol that is coupled.
This step, the connection symbol of the subservice logic for being selected according to user, each son that will be obtained in step 1021 Service logic script is combined, such that it is able to obtain the service logic script of present procedure.
Step 103, joint debugging test is carried out to the service logic script, if test passes through, according to the business Logic script generates corresponding script file.
This step, the procedure subject i.e. service logic script for being obtained to step 102 carries out joint debugging test, if surveyed Pinged, then generated corresponding script file.
Here, the those skilled in the art that are generated as of specific joint debugging test and script file are grasped, herein no longer Repeat.
Fig. 2 is a kind of script generation device structural representation corresponding with the above method, as shown in Fig. 2 the device Including:
Preparatory unit, for after the python programmings for receiving validated user are instructed, triggering the standard of script generation Standby process;
Script generation unit, for utilizing metadatabase, triggers the current script to be generated of user's selection corresponding each The field name of subservice logic, table name and condition and the connection for being coupled each subservice logic are accorded with, and are generated corresponding Service logic script;
Test cell, for carrying out joint debugging test to the service logic script, if test passes through, according to described Service logic script generates corresponding script file.
It is preferred that the preparatory unit, is further used for obtaining the version information that the user determines for script to be generated; Obtain the function that the script current to be generated that the user selects from default data dictionary is used;Obtain the use Family is that the customized function of script to be generated and corresponding function are annotated;Obtain the user from the data word The quote command that the script described to be generated selected in allusion quotation is used;Obtain the user from default database collection, In the set of table type and table name set, the target database for preserving script operation result selected, table type and The script argument that table name and script need when running.
It is preferred that the script generation unit, it is further used for obtaining the user from the metadatabase In set of fields, field name, table name and logic matching condition that each the described subservice logic selected is included, And the combination of the field name, table name and logic matching condition is obtained into corresponding subservice logic script;Obtain institute User from the connection symbol of the default each subservice logic for being coupled and being selected in symbol set is stated, and utilizes the connection The subservice locial join is obtained the service logic script by symbol.
In sum, presently preferred embodiments of the present invention is these are only, protection of the invention is not intended to limit Scope.All any modification, equivalent substitution and improvements within the spirit and principles in the present invention, made etc., Should be included within protection scope of the present invention.

Claims (6)

1. a kind of scenario generation method, it is characterised in that including:
A, when receive validated user python programmings instruct after, triggering script generation set-up procedure;
B, using metadatabase, trigger the field of the corresponding each subservice logic of the current script to be generated of user's selection Name, table name and condition and the connection for being coupled each subservice logic are accorded with, and generate corresponding service logic script;
C, joint debugging test is carried out to the service logic script, if test passes through, according to the service logic script Generate corresponding script file.
2. method according to claim 1, it is characterised in that the set-up procedure of the script generation includes:
Obtain the version information that the user determines for script to be generated;
Obtain the function that the script current to be generated that the user selects from default data dictionary is used;
It is that the customized function of script to be generated and corresponding function are annotated to obtain the user;
Obtain the quote command that the script described to be generated that the user selects from the data dictionary is used;
The user is obtained from default database collection, the set of table type and table name set, select for protecting The script argument that target database, table type and the table name and script for depositing script operation result need when running.
3. method according to claim 1, it is characterised in that the step b includes:
The user is obtained from the set of fields in the metadatabase, each selected subservice logic bag Field name, table name and the logic matching condition for containing, and the combination of the field name, table name and logic matching condition is obtained Corresponding subservice logic script;
The user from the connection symbol of the default each subservice logic for being coupled and being selected in symbol set is obtained, and utilizes institute Connection symbol is stated by the subservice locial join, the service logic script is obtained.
4. a kind of script generation device, it is characterised in that including:
Preparatory unit, for after the python programmings for receiving validated user are instructed, triggering the standard of script generation Standby process;
Script generation unit, for utilizing metadatabase, triggers the current script to be generated of user's selection corresponding each The field name of subservice logic, table name and condition and the connection for being coupled each subservice logic are accorded with, and are generated corresponding Service logic script;
Test cell, for carrying out joint debugging test to the service logic script, if test passes through, according to described Service logic script generates corresponding script file.
5. device according to claim 4, it is characterised in that the preparatory unit, is further used for obtaining institute State the version information that user determines for script to be generated;Obtain that the user selects from default data dictionary works as The function that preceding script to be generated is used;The user is obtained for the customized function of script to be generated and corresponding Function is annotated;Obtain the quote command that the script described to be generated that the user selects from the data dictionary is used; The user is obtained from default database collection, the set of table type and table name set, select for preserving pin The script argument that the target database of this operation result, table type and table name and script need when running.
6. device according to claim 4, it is characterised in that the script generation unit, is further used for obtaining The user is taken from the set of fields in the metadatabase, the word that each selected subservice logic is included Section name, table name and logic matching condition, and the combination of the field name, table name and logic matching condition is obtained corresponding Subservice logic script;Obtain the user from the connection of the default each subservice logic for being coupled and being selected in symbol set Symbol, and the subservice locial join is obtained into the service logic script using the symbol that is coupled.
CN201511000556.1A 2015-12-28 2015-12-28 Script generation method and device Active CN106919374B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201511000556.1A CN106919374B (en) 2015-12-28 2015-12-28 Script generation method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201511000556.1A CN106919374B (en) 2015-12-28 2015-12-28 Script generation method and device

Publications (2)

Publication Number Publication Date
CN106919374A true CN106919374A (en) 2017-07-04
CN106919374B CN106919374B (en) 2021-06-29

Family

ID=59455747

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201511000556.1A Active CN106919374B (en) 2015-12-28 2015-12-28 Script generation method and device

Country Status (1)

Country Link
CN (1) CN106919374B (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108255709A (en) * 2017-12-26 2018-07-06 平安壹钱包电子商务有限公司 Script tests method, apparatus, terminal device and the storage medium of written in code
CN108446110A (en) * 2018-03-14 2018-08-24 武汉斗鱼网络科技有限公司 Lua scenario generation methods, device, terminal and computer-readable medium
CN109814864A (en) * 2019-01-02 2019-05-28 北京永洪商智科技有限公司 A kind of data visualization method, visualization system, Web browsing system and equipment
CN110825764A (en) * 2018-07-23 2020-02-21 北京国双科技有限公司 SQL script generation method, system, storage medium and processor

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070203933A1 (en) * 2006-02-24 2007-08-30 Iversen Heine K Method for generating data warehouses and OLAP cubes
CN101526917A (en) * 2009-04-22 2009-09-09 南京大学 Method for reproducing test scripts based on data drive
CN101727488A (en) * 2009-12-17 2010-06-09 中国电力科学研究院 Method and device for generating base table division code
CN101853152A (en) * 2009-03-31 2010-10-06 华为技术有限公司 Method and system for generating graphical user interface
CN101944084A (en) * 2009-07-09 2011-01-12 镇江华扬信息科技有限公司 Database automatic operation system based on SQL script and FTP transmission technique
CN102122247A (en) * 2011-03-17 2011-07-13 深圳市同洲软件有限公司 Automatic code generating system and method
US8165990B2 (en) * 2009-06-15 2012-04-24 Microsoft Corporation Conversion of an application database to minimize time in single-user access mode
CN102968306A (en) * 2012-11-29 2013-03-13 广东全通教育股份有限公司 Method and system for automatically generating code based on data model drive
CN103455316A (en) * 2012-07-27 2013-12-18 安徽工业大学 Class-based code generator
CN104615667A (en) * 2015-01-13 2015-05-13 联动优势电子商务有限公司 Basic data generation method and device and test data generation method and device

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070203933A1 (en) * 2006-02-24 2007-08-30 Iversen Heine K Method for generating data warehouses and OLAP cubes
CN101853152A (en) * 2009-03-31 2010-10-06 华为技术有限公司 Method and system for generating graphical user interface
CN101526917A (en) * 2009-04-22 2009-09-09 南京大学 Method for reproducing test scripts based on data drive
US8165990B2 (en) * 2009-06-15 2012-04-24 Microsoft Corporation Conversion of an application database to minimize time in single-user access mode
CN101944084A (en) * 2009-07-09 2011-01-12 镇江华扬信息科技有限公司 Database automatic operation system based on SQL script and FTP transmission technique
CN101727488A (en) * 2009-12-17 2010-06-09 中国电力科学研究院 Method and device for generating base table division code
CN102122247A (en) * 2011-03-17 2011-07-13 深圳市同洲软件有限公司 Automatic code generating system and method
CN103455316A (en) * 2012-07-27 2013-12-18 安徽工业大学 Class-based code generator
CN102968306A (en) * 2012-11-29 2013-03-13 广东全通教育股份有限公司 Method and system for automatically generating code based on data model drive
CN104615667A (en) * 2015-01-13 2015-05-13 联动优势电子商务有限公司 Basic data generation method and device and test data generation method and device

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
侯莹 等: ""基于模型的Fuzzing测试脚本自动化生成"", 《计算机科学》 *

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108255709A (en) * 2017-12-26 2018-07-06 平安壹钱包电子商务有限公司 Script tests method, apparatus, terminal device and the storage medium of written in code
CN108446110A (en) * 2018-03-14 2018-08-24 武汉斗鱼网络科技有限公司 Lua scenario generation methods, device, terminal and computer-readable medium
CN108446110B (en) * 2018-03-14 2022-01-04 武汉斗鱼网络科技有限公司 Lua script generation method, Lua script generation device, Lua script generation terminal and computer readable medium
CN110825764A (en) * 2018-07-23 2020-02-21 北京国双科技有限公司 SQL script generation method, system, storage medium and processor
CN110825764B (en) * 2018-07-23 2022-07-26 北京国双科技有限公司 SQL script generation method, system, storage medium and processor
CN109814864A (en) * 2019-01-02 2019-05-28 北京永洪商智科技有限公司 A kind of data visualization method, visualization system, Web browsing system and equipment

Also Published As

Publication number Publication date
CN106919374B (en) 2021-06-29

Similar Documents

Publication Publication Date Title
CN104391934B (en) Data verification method and device
CN103930898B (en) Program analysis/the service for checking credentials provides system and control method, program analysis/checking device, program analysis/verification tool managing device
US20180173386A1 (en) Updating data records by adding editing functions to non-editable display elements
US8930833B2 (en) Method and apparatus to present an integrated process modeler
CN104021080B (en) Automatic testing system based on custom scripts
CN108762803A (en) A kind of configuring management method, device, terminal device and storage medium
CN107423061A (en) A kind of list generation method based on ISON data
WO2016060547A1 (en) Emulating manual system of filing using electronic document and electronic file
CN102411540B (en) Automatic management system of workflow-based common software testing process
CN107203473A (en) The automatization test system and method for automatic expansion interface test case
CN106919374A (en) A kind of scenario generation method and device
CN108197114A (en) Detection method, device, storage medium and the electronic device of list data
CN109240688A (en) Interface development method, electronic device and readable storage medium storing program for executing
CN110888720A (en) Task processing method and device, computer equipment and storage medium
CN108255702A (en) A kind of test case creation method, apparatus, equipment and storage medium
CN107315586A (en) Using the methods, devices and systems of packing
CN107506190A (en) XML file amending method and device based on Spring frameworks
CN111208995A (en) Method, system, device and storage medium for automatically generating IBM host job
CN110297637A (en) The applicable resource file thermogravimetric of full platform client software carries tool and method of development
CN107423223A (en) Test and management system
CN109522005A (en) Cross-platform GRAPHICAL PROGRAMMING method
CN109189849B (en) Standardized and streamlined data entry method and system
CN113919158A (en) Simulation method and device for flight control panel and storage medium
CN103377076A (en) Method and system for adjusting task execution plans during operation
CN110457023A (en) Task creation method, apparatus, storage medium and electronic equipment

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
GR01 Patent grant
GR01 Patent grant