CN104360937A - Intelligent parameter checking device - Google Patents
Intelligent parameter checking device Download PDFInfo
- Publication number
- CN104360937A CN104360937A CN201410563040.7A CN201410563040A CN104360937A CN 104360937 A CN104360937 A CN 104360937A CN 201410563040 A CN201410563040 A CN 201410563040A CN 104360937 A CN104360937 A CN 104360937A
- Authority
- CN
- China
- Prior art keywords
- module
- verification
- checker
- parameter
- processing unit
- 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
Links
Abstract
The invention provides an intelligent parameter checking device which comprises a page processing unit and/or a server processing unit, wherein the page processing unit comprises a rule reading module, a parameter acquisition module, a checker expansion module, a parameter checking module and an exception handling module, and the server processing unit comprises a rule reading module, a parameter acquisition module, a checker expansion module, a parameter checking module, an exception handling module and a rule conversion module. The device has the following advantages: 1, high code reuse rate, 2, wide application scope, 3, flexible checking rule representation form, 4, easiness in use and expansion, 5, improvement of user experience and perception, 6, improvement of development efficiency, and 7, lowered maintenance cost.
Description
[technical field]
The present invention relates to a kind of intelligent parameter calibration equipment.
[background technology]
In project development process, Validation of Data is for software product research staff being part very pain in the neck but be again necessary certainly.
For Web project, the checking of client validation+service end is indispensable, and the script validates of client is for improving Consumer's Experience and perception, and the checking of service end is mainly in order to the security of data, the checking of legitimacy.But in the hard coded epoch, all codes are all write in a program, following problem can be found that there is when enforcement these two kinds checking:
1, client check code is write relatively loaded down with trivial details, and easily makes mistakes, mainly misspelling;
2, when business reorganization or verification mode do not meet the demands, the new reading code of developer's duplicate removal is needed to revise;
3, checking and the client validation of service end will keep consistency, and the same very loaded down with trivial details (client validation input can not more than 10 characters, that server end also will control accordingly at 10 characters, and during amendment, need client and service end synchronous vacations, information front and back end all will input once again, more loaded down with trivial details), expend the research and development time.
4, realize list verification all again write or copy a pile code, code seems succinct not at every turn; For interface exploitation, there is the awkward situation that parameter verification method is again write or copied a pile code equally;
In addition, existing parameter calibrator ubiquity poor universality (front-back ground checkout code is difficult to multiplexing and is coupled with framework), extendability are poor; Shortcomings such as not handy (configuring and implement loaded down with trivial details).
[summary of the invention]
The technical problem to be solved in the present invention, is to provide a kind of intelligent parameter calibration equipment, which solves the pain spot of the research and development of software personnel duplication of labour, greatly reduces the time and efforts that software check expends.
A kind of intelligent parameter calibration equipment, comprise page end processing unit and or service end processing unit;
Described page end processing unit comprises regular read module, parameter acquisition module, checker expansion module, parameter verification module and abnormality processing module; Described regular read module is responsible for reading business verification rule, described parameter acquisition module is responsible for the input value obtaining list, built-in checker is provided with in described parameter verification module, by built-in checker, the input value of described list is verified according to described business verification rule, out-of-dately forward abnormality processing module to when verification is obstructed; Described abnormality processing module in charge is when verifying unsuccessfully, abnormal prompt information pushing is provided prompting to user, described checker expansion module is responsible for when built-in checker cannot satisfy the demands, the checker needed for user is formulated by this verification expansion module;
Described service end processing unit comprises described regular read module, described parameter acquisition module, described checker expansion module, described parameter verification module, described abnormality processing module and a regular modular converter, and described regular modular converter is responsible for regular for the business the read verification character string converting described parameter verification module to and can identify.
Further, described business verification rule comprises the file of the character string of json form, the character string of xml form, the file of json form or xml form.
Further, described regular modular converter is responsible for the regular character string converting java or javascript to and can identify of business verification by json form or xml form.
Tool of the present invention has the following advantages:
1, code reuse is high, and research and development of software personnel there is no need each AM/BAM and write verification rule;
2, applied widely, can use at web, wap, Mobile solution project, interface;
3, verifying Rule Expression flexible form: support json form, xml form, can be that character string also can read by automatic search file;
4, be easy to use and expand: when built-in checker cannot meet actual needs, can customize realization;
5, improve Consumer's Experience and perception: point out when unification bomp or the parameter when transmission do not meet the demands, improve Consumer's Experience and perception;
6, improve development efficiency: in Webservic interface exploitation process, remind interface interchange side timely when the parameter transmitted is illegal, effectively can improve development efficiency;
7, reduce maintenance cost: when business reorganization or verification mode do not meet the demands, normally business variation is not when being too large, and developer only need revise business rule file can meet service needed, some only operation maintenance personnel can complete amendment.
[accompanying drawing explanation]
The present invention is further illustrated in conjunction with the embodiments with reference to the accompanying drawings.
Fig. 1 is the structural representation of a kind of intelligent parameter calibration equipment of the present invention.
Fig. 2 is the process flow diagram of a kind of intelligent parameter calibration equipment of the present invention under interface exploitation.
Fig. 3 is the use flow process of a kind of intelligent parameter calibration equipment of the present invention under Web exploitation.
[embodiment]
Refer to Fig. 1, a kind of intelligent parameter calibration equipment, comprise page end processing unit and or service end processing unit; Namely described intelligent parameter calibration equipment can need to select only comprise page end processing unit or only comprise service end processing unit or comprise page end processing unit and service end processing unit simultaneously according to practical application scene;
Described page end processing unit comprises regular read module, parameter acquisition module, checker expansion module, parameter verification module and abnormality processing module; Described regular read module is responsible for reading business verification rule, described parameter acquisition module is responsible for the input value obtaining list, built-in checker is provided with in described parameter verification module, by built-in checker, the input value of described list is verified according to described business verification rule, out-of-dately forward abnormality processing module to when verification is obstructed; Described abnormality processing module in charge is when verifying unsuccessfully, abnormal prompt information pushing is provided prompting to user, described checker expansion module is responsible for when built-in checker cannot satisfy the demands, the checker needed for user is formulated by this verification expansion module; Described regular modular converter is responsible for the regular character string converting java or javascript to and can identify of business verification by json form or xml form;
Described business verification rule comprises the file of the character string of json form, the character string of xml form, the file of json form or xml form, when business verification rule is deposited with document form, the path that described regular read module is deposited according to business verification rule is read.When parameter verification module will verify certain parameter, need to specify the title (namely searching required checker by title from built-in checker) that checker is corresponding in advance; A plurality of conventional checker is encapsulated, such as network address checker (url), cell-phone number checker (mobile), identification card number checker (idCard), digit check device (number), postcode checker (zip) etc. in described built-in checker.
Described service end processing unit comprises described regular read module, described parameter acquisition module, described checker expansion module, described parameter verification module, described abnormality processing module and a regular modular converter, and described regular modular converter is responsible for regular for the business the read verification character string converting described parameter verification module to and can identify.
It should be noted that: this device is particularly useful for list and interface parameters verification, the hard coded epoch, all codes are all write in a program, when business reorganization or verification mode do not meet the demands, developer is needed to go reading code to revise, after employing this device, business and code dehind and business rule is deposited in file, follow-up O&M, just can be able to be completed by amendment business rule file, and this work can not be develop to perform completely, O&M also can do (when normally business variation is not too large, if business reorganization scope is wide, cause the checker of originally specifying cannot just can finishing service target by amendment business rule, developer is just needed to get involved amendment).
Refer to Fig. 2, Fig. 2 is the use flow process under interface exploitation.Interface interchange direction interface service provider request service, in the unit of interface service provider loading service end process and business verification rule file or character string, described regular read module reads business verification rule, if the character string that regular non-java or javascript of described verification can identify, then changed by described regular modular converter; Described parameter acquisition module obtains the parameter needing verification, described parameter verification module carries out parameter verification according to business verification rule, when verification succeeds, the information that returns results is to interface interchange side, when verifying unsuccessfully, abnormal information is passed to interface interchange side by described abnormality processing module, improves Consumer's Experience and perception and effectively improves development efficiency.
Refer to Fig. 3, Fig. 3 is the use flow process under Web exploitation.First page end processing unit and business verify regular load table single-page, then submission form, the regular read module of page end processing unit reads business verification rule, described parameter acquisition module obtains the parameter needing verification, described parameter verification module carries out parameter verification according to business verification rule, when verification succeeds, and announcement server, when verifying unsuccessfully, abnormal information is passed to forms pages by described abnormality processing module.Described server loads described service end processing unit and described business verification rule, server receives the form request that browser is submitted to, the regular read module of described service end processing unit reads business verification rule, if the character string that regular non-java or javascript of described verification can identify, then changed by described regular modular converter; Described parameter acquisition module obtains the parameter needing verification, described parameter verification module carries out parameter verification according to business verification rule, when verification succeeds, by showing result, when verifying unsuccessfully, abnormal information is passed to forms pages by described abnormality processing module.
In use flow process under Web exploitation, page end processing unit and service end processing unit share identical business verification rule, and peopleware does not need to write twice business verification rule, greatly alleviates the workload that peopleware writes business rule.
Illustrate embodiment below:
1, the page using intelligent parameter calibration equipment is being needed to introduce date control, date control My97DatePicker http://www.my97.net/
Particularly: <script type=" text/javascript " src=" <%=basePath%>/js/validator/va lidator.js " ></script>
2, the jar loading the dependence of intelligent parameter calibration equipment wraps, and (the jar bag of described dependence is organized (such as APACHE foundation) to be provided freely to technician by third party and is used, utilize the basic function that it provides, save the time of developer's development device, such as, the jar of its analyzing XML character string is directly utilized to wrap, just can save the time that research staff writes codes implement XML character string parsing in person), the core of dependence is surrounded by: dom4j-1.6.1.jar, json-lib-2.4.jar, log4j-1.2.14.jar, commons-logging-1.1.1.jar
It is below the configuration in the pom.xml of maven engineering
3, in projects, intelligent parameter calibration equipment is introduced
Described intelligent parameter calibration equipment is a jar bag normally, such as, by verify-utils-1.0.0-RELEASE.jar, under joining the lib catalogue of web engineering
It is below the configuration in the pom.xml of maven engineering
4, in the web.xml of projects, configuration is added
In order to load page end processing unit automatic when application system starts, intelligent parameter calibration equipment can be used in the page, therefore, in web.xml, does following configuration:
5, the place of intelligent parameter calibration equipment to used to introduce script file or class
Page end processing unit, as long as introduce validator.js script file, intelligent parameter calibration equipment <script type=" text/javascript " src=" <%=basePath%>/js/validator/va lidator.js " ></script> just can be used on the page
Service end processing unit, import such as VerifyUtil (service class that intelligent parameter calibration equipment externally provides), AssignMethod (expansion checker interface), ValidatorTool (intelligent parameter calibration equipment tool-class), WebTool (web developing instrument class) class just can use intelligent parameter calibration equipment in rear end
6, write business verification rule file and introduce in the place that will use
On the page: <script type=" text/javascript " src=" <%=basePath%>/js/validator/de moForm-verify.js " ></script>
Server (obtains business rule file path, then transfers to intelligent parameter calibration equipment to read, resolves, transforms, the final business verification rule forming server end)
String path=WebTool.getWebPath(request,"js/validator/demoForm-verify.js");
7, calling program is write
Invoking page end processing unit on the page
Such as:
If need built-in checker, by following two kinds of modes
A, by self-defined regular expression, such as:
" id ": " zip ", " datatype ": " type ": x.assign, " regexp ": " ^ [1-9] [0-9] { 5} $ ", " msg ": " please correctly fill in postcode! "
Wherein regexp parameter is self-defined regular expression
B, by self-defined method of calibration, such as:
Server calls service end processing unit:
Such as:
Tool of the present invention has the following advantages: use intelligent parameter calibration equipment of the present invention, and research and development of software personnel there is no need each AM/BAM and write business verification rule, and code reuse is high; This device can be applicable to web, wap, Mobile solution project, interface exploitation etc., applied range; This device supports character string or the file of json form, xml form, verification Rule Expression flexible form; 4, when built-in method of calibration cannot meet actual needs, expand by parameter verification module; 5, provide bomp by abnormality processing module and improve Consumer's Experience and perception; 6, in Webservic interface exploitation process, when the illegal timely prompting interface interchange side of parameter transmitted, effectively development efficiency is improved; 7, maintenance cost is reduced.
Although the foregoing describe the specific embodiment of the present invention; but be familiar with those skilled in the art to be to be understood that; specific embodiment described by us is illustrative; instead of for the restriction to scope of the present invention; those of ordinary skill in the art, in the modification of the equivalence done according to spirit of the present invention and change, should be encompassed in scope that claim of the present invention protects.
Claims (3)
1. an intelligent parameter calibration equipment, is characterized in that: comprise page end processing unit and or service end processing unit;
Described page end processing unit comprises regular read module, parameter acquisition module, checker expansion module, parameter verification module and abnormality processing module; Described regular read module is responsible for reading business verification rule, described parameter acquisition module is responsible for the input value obtaining list, built-in checker is provided with in described parameter verification module, by built-in checker, the input value of described list is verified according to described business verification rule, out-of-dately forward abnormality processing module to when verification is obstructed; Described abnormality processing module in charge is when verifying unsuccessfully, abnormal prompt information pushing is provided prompting to user, described checker expansion module is responsible for when built-in checker cannot satisfy the demands, the checker needed for user is formulated by this verification expansion module;
Described service end processing unit comprises described regular read module, described parameter acquisition module, described checker expansion module, described parameter verification module, described abnormality processing module and a regular modular converter, and described regular modular converter is responsible for regular for the business the read verification character string converting described parameter verification module to and can identify.
2. a kind of intelligent parameter calibration equipment according to claim 1, is characterized in that: described business verification rule comprises the file of the character string of json form, the character string of xml form, the file of json form or xml form.
3. a kind of intelligent parameter calibration equipment according to claim 1, is characterized in that: described regular modular converter is responsible for the regular character string converting java or javascript to and can identify of business verification by json form or xml form.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201410563040.7A CN104360937A (en) | 2014-10-21 | 2014-10-21 | Intelligent parameter checking device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201410563040.7A CN104360937A (en) | 2014-10-21 | 2014-10-21 | Intelligent parameter checking device |
Publications (1)
Publication Number | Publication Date |
---|---|
CN104360937A true CN104360937A (en) | 2015-02-18 |
Family
ID=52528201
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201410563040.7A Pending CN104360937A (en) | 2014-10-21 | 2014-10-21 | Intelligent parameter checking device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN104360937A (en) |
Cited By (12)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105404620A (en) * | 2015-11-20 | 2016-03-16 | 华为技术有限公司 | Form verification method and apparatus |
CN105678163A (en) * | 2016-01-01 | 2016-06-15 | 广州亦云信息技术有限公司 | Method and system for verifying data |
CN108809896A (en) * | 2017-04-28 | 2018-11-13 | 阿里巴巴集团控股有限公司 | A kind of information calibration method, device and electronic equipment |
CN108804399A (en) * | 2017-05-04 | 2018-11-13 | 腾讯科技(北京)有限公司 | The method of calibration and device of list |
CN109101812A (en) * | 2018-08-28 | 2018-12-28 | 北京神州绿盟信息安全科技股份有限公司 | A kind of parameter verification method, apparatus, computing device and storage medium |
CN109284198A (en) * | 2017-07-21 | 2019-01-29 | 北京京东尚科信息技术有限公司 | A kind of method and apparatus verifying data |
CN109636317A (en) * | 2018-11-23 | 2019-04-16 | 山东中创软件工程股份有限公司 | Service control method, device, system and storage medium |
CN109670328A (en) * | 2018-12-25 | 2019-04-23 | 北京城市网邻信息技术有限公司 | A kind of data processing method and device |
CN109858257A (en) * | 2018-12-27 | 2019-06-07 | 北京互金新融科技有限公司 | Access control method and device |
CN110188038A (en) * | 2019-05-13 | 2019-08-30 | 青岛海尔科技有限公司 | A kind of parameter verification method and device, verification framework |
CN111539198A (en) * | 2020-04-15 | 2020-08-14 | 北京宝兰德软件股份有限公司 | Form verification method and device based on Java |
CN116909930A (en) * | 2023-09-11 | 2023-10-20 | 智业软件股份有限公司 | Method and device for detecting exception of variables in front-end webpage operation |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20110282813A1 (en) * | 2009-11-12 | 2011-11-17 | Vincent Sgro | System and method for using pattern recognition to monitor and maintain status quo |
CN102426549A (en) * | 2011-09-08 | 2012-04-25 | 新一站保险代理有限公司 | Efficient Web form validation method and framework thereof |
CN102819766A (en) * | 2011-06-09 | 2012-12-12 | 金蝶软件(中国)有限公司 | Method, device and enterprise system for checking forms |
-
2014
- 2014-10-21 CN CN201410563040.7A patent/CN104360937A/en active Pending
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20110282813A1 (en) * | 2009-11-12 | 2011-11-17 | Vincent Sgro | System and method for using pattern recognition to monitor and maintain status quo |
CN102819766A (en) * | 2011-06-09 | 2012-12-12 | 金蝶软件(中国)有限公司 | Method, device and enterprise system for checking forms |
CN102426549A (en) * | 2011-09-08 | 2012-04-25 | 新一站保险代理有限公司 | Efficient Web form validation method and framework thereof |
Cited By (17)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105404620A (en) * | 2015-11-20 | 2016-03-16 | 华为技术有限公司 | Form verification method and apparatus |
WO2017084345A1 (en) * | 2015-11-20 | 2017-05-26 | 华为技术有限公司 | Method and device for form verification |
CN105678163A (en) * | 2016-01-01 | 2016-06-15 | 广州亦云信息技术有限公司 | Method and system for verifying data |
CN105678163B (en) * | 2016-01-01 | 2018-10-09 | 广州亦云信息技术有限公司 | A kind of data verification method and system |
CN108809896A (en) * | 2017-04-28 | 2018-11-13 | 阿里巴巴集团控股有限公司 | A kind of information calibration method, device and electronic equipment |
CN108804399A (en) * | 2017-05-04 | 2018-11-13 | 腾讯科技(北京)有限公司 | The method of calibration and device of list |
CN109284198A (en) * | 2017-07-21 | 2019-01-29 | 北京京东尚科信息技术有限公司 | A kind of method and apparatus verifying data |
CN109101812A (en) * | 2018-08-28 | 2018-12-28 | 北京神州绿盟信息安全科技股份有限公司 | A kind of parameter verification method, apparatus, computing device and storage medium |
CN109636317A (en) * | 2018-11-23 | 2019-04-16 | 山东中创软件工程股份有限公司 | Service control method, device, system and storage medium |
CN109670328A (en) * | 2018-12-25 | 2019-04-23 | 北京城市网邻信息技术有限公司 | A kind of data processing method and device |
CN109670328B (en) * | 2018-12-25 | 2022-04-26 | 北京城市网邻信息技术有限公司 | Data processing method and device |
CN109858257A (en) * | 2018-12-27 | 2019-06-07 | 北京互金新融科技有限公司 | Access control method and device |
CN109858257B (en) * | 2018-12-27 | 2021-06-18 | 北京互金新融科技有限公司 | Access control method and device |
CN110188038A (en) * | 2019-05-13 | 2019-08-30 | 青岛海尔科技有限公司 | A kind of parameter verification method and device, verification framework |
CN111539198A (en) * | 2020-04-15 | 2020-08-14 | 北京宝兰德软件股份有限公司 | Form verification method and device based on Java |
CN116909930A (en) * | 2023-09-11 | 2023-10-20 | 智业软件股份有限公司 | Method and device for detecting exception of variables in front-end webpage operation |
CN116909930B (en) * | 2023-09-11 | 2023-11-24 | 智业软件股份有限公司 | Method and device for detecting exception of variables in front-end webpage operation |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN104360937A (en) | Intelligent parameter checking device | |
CN102289378B (en) | Method for automatically generating APP (Application) | |
CN103365847B (en) | A kind of generation method and apparatus of self-defined web page files | |
CN104731589A (en) | Automatic generation method and device of user interface (UI) | |
CN104484216A (en) | Method and device for generating service interface document and on-line test tool | |
US20140207826A1 (en) | Generating xml schema from json data | |
CN103049320A (en) | Method and device for starting external application program in browser | |
CN105512881A (en) | Method and terminal for completing payment on the basis of two-dimensional code | |
CN105512190A (en) | Interface jumping method and device | |
US11003835B2 (en) | System and method to convert a webpage built on a legacy framework to a webpage compatible with a target framework | |
CN102395950A (en) | Communicating with data storage systems | |
CN102187314A (en) | Interactive design environments to visually model, debug and execute resource oriented programs | |
CN111061464B (en) | Analysis code generation method, device, equipment and storage medium | |
CN104461538A (en) | Report generation method and report generation system | |
CN102750152A (en) | Method and device of application for generating a plurality of programming languages based on descriptive language | |
CN101957756A (en) | System and method for rapidly generating intelligent mobile terminal program | |
CN104049972A (en) | Data verification method and system | |
CN104572092A (en) | Method and device for webpage making | |
US8756258B2 (en) | Generating references to reusable code in a schema | |
CN109799988A (en) | IOS page layout method, terminal device and computer readable storage medium | |
CN109145236A (en) | Page file processing method, apparatus and system | |
CN101876998B (en) | Method and system for editing data | |
CN103942168A (en) | Method and system for performing information transmission through browser | |
CN104143110A (en) | Two-dimensional code generating method with web site information | |
WO2019043462A1 (en) | Systems and methods for creating automated interface transmission between heterogeneous systems in an enterprise ecosystem |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20150218 |
|
RJ01 | Rejection of invention patent application after publication |