Movatterモバイル変換


[0]ホーム

URL:


CN110569036A - data verification system and method under front-end and back-end separation architecture - Google Patents

data verification system and method under front-end and back-end separation architecture
Download PDF

Info

Publication number
CN110569036A
CN110569036ACN201910769877.XACN201910769877ACN110569036ACN 110569036 ACN110569036 ACN 110569036ACN 201910769877 ACN201910769877 ACN 201910769877ACN 110569036 ACN110569036 ACN 110569036A
Authority
CN
China
Prior art keywords
rule
verification
data
data verification
request
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
CN201910769877.XA
Other languages
Chinese (zh)
Other versions
CN110569036B (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.)
Guangzhou Huazi Software Technology Co Ltd
Original Assignee
Guangzhou Huazi Software 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 Guangzhou Huazi Software Technology Co LtdfiledCriticalGuangzhou Huazi Software Technology Co Ltd
Priority to CN201910769877.XApriorityCriticalpatent/CN110569036B/en
Publication of CN110569036ApublicationCriticalpatent/CN110569036A/en
Application grantedgrantedCritical
Publication of CN110569036BpublicationCriticalpatent/CN110569036B/en
Activelegal-statusCriticalCurrent
Anticipated expirationlegal-statusCritical

Links

Classifications

Landscapes

Abstract

the invention provides a data verification system under a front-end and back-end separation architecture, which comprises a front end and a back end, wherein the back end comprises a verification rule analysis engine, a verification rule routing engine, a back-end rule verification engine and a rule transmission unit; the data verification of the form request at the front end and the back end is respectively carried out through the front end verification process and the back end verification process, and the front end and the back end share one set of data verification rules, so that the accuracy of the data verification is improved, and the complexity and the workload of development and maintenance of complex verification services are reduced.

Description

Data verification system and method under front-end and back-end separation architecture
Technical Field
The invention relates to the technical field of computer technology, in particular to a data verification system and a data verification method under a front-end and back-end separation architecture.
background
Generally, the verification of a form is divided into two steps, firstly, after a user enters a piece of data in a client, real-time verification is carried out, and verification result prompt of the data is carried out, so that the user can conveniently and quickly enter accurate data.
The related data verification rules of the front-end form and the back-end form in the traditional Web application program are written separately and independently, when a certain data verification rule is created or modified, the related data verification rules in the front end and the back end must be modified simultaneously, if the certain verification rule is not modified uniformly, errors can be caused in the application program, and the phenomenon is very common in the development field.
disclosure of Invention
The invention aims to overcome the defects of the prior art and provides a high-efficiency data verification system and method under a front-end and back-end separation framework for ensuring the consistency of front-end and back-end data verification rules
in order to achieve the above object, the present invention provides a data checking system under a front-end and back-end separated architecture, which includes a front end and a back end,
The back end includes:
The verification rule analysis engine is used for analyzing and caching the data verification rules in the uniform JSON format into a memory at the back end;
A check rule routing engine, configured to search a corresponding data check rule according to the service operation applied by the service request, and perform routing binding on the searched data check rule and the specific service operation, so that the data check rule after routing binding is used as a data check basis for the form request;
the back-end rule checking engine is used for performing data checking on each data field in the submitted form request according to the route-bound data checking rule at the back end;
-a rule transmission unit, configured to transmit the route-bound data check rule from the back-end to the front-end;
the front end comprises:
-a front-end rule checking engine for performing data checking at the front-end on data fields in the form request according to the data checking rules transmitted from the back-end;
before submitting a form request to the back end for data verification, the front end sends a service request to the back end to request to search a corresponding data verification rule and transmits the data verification rule to the front end from the back end, so that the service request is used as a basis for data verification by the front end rule verification engine before submitting the form request.
further, the attributes in any of the data verification rules include one or more attributes of field type, string length, whether null, maximum and minimum values, regular expression rules, identity card rules, phone number rules, e-mail rules, whether two passwords are consistent rules, multiple field combination association rules, and password strength rules.
a data verification method under a front-end and back-end separation architecture comprises a front-end verification process and a back-end verification process, wherein a verification rule analysis engine analyzes and caches a unified JSON format data verification rule in a back-end memory in advance so that the front-end verification process and the back-end verification process can acquire the corresponding data verification rule;
The front-end verification process specifically comprises the following steps:
A1. before submitting any form request, the front end firstly sends a corresponding service request to the back end;
A2. After receiving the service request, the back end searches a corresponding data check rule according to the service operation applied by the service request, wherein if the corresponding data check rule is searched, the back end performs routing binding on the data check rule and the specific service operation and transmits the data check rule and the specific service operation to the front end through the rule transmission unit; otherwise, if the corresponding data verification rule cannot be found, sending an instruction for not executing form request submission to the front end;
A3. the front end enters a data verification stage after receiving the data verification rule, wherein in the data verification stage, the front end rule verification engine traverses each data field in the form request to be submitted based on the received data verification rule, performs front end data verification, and finally returns a verification result, wherein if all the verification results conform to the data verification rule, the verification is judged to be successful; if any one of the verification results does not accord with the data verification rule, determining that the verification fails;
A4. the front end submits the form request which is judged to be successful by the front end data verification to the back end;
The back-end verification process specifically comprises the following steps:
B1. after receiving the form request from the front end, the back end enters a data verification stage;
B2. in the data verification stage, the back-end rule verification engine performs back-end data verification on each data field in the form request according to the bound data verification rule and returns a verification result, wherein if all the verification results conform to the data verification rule, the verification is judged to be successful; if any one of the verification results does not accord with the data verification rule, determining that the verification fails;
B3. and the back end continues to execute corresponding business operation backwards according to the form request which is judged to be successful by the back end data verification.
furthermore, the data check rule transmitted from the rule transmission unit to the front end does not need to be converted into a format.
The invention adopts the scheme, and has the beneficial effects that: the data verification of the form request at the front end and the back end is respectively carried out through the front end verification process and the back end verification process, and the front end and the back end share one set of data verification rules, so that the accuracy of the data verification is improved, and the complexity and the workload of development and maintenance of complex verification services are reduced.
drawings
FIG. 1 is a schematic diagram of a data verification system according to the present invention.
Fig. 2 is a schematic flow chart of a front-end verification process according to the present invention.
Fig. 3 is a schematic flow chart of a back-end verification process according to the present invention.
Detailed Description
to facilitate an understanding of the invention, the invention is described more fully below with reference to the accompanying drawings. Preferred embodiments of the present invention are shown in the drawings. This invention may, however, be embodied in many different forms and should not be construed as limited to the embodiments set forth herein. These embodiments are provided so that this disclosure will be thorough and complete.
Referring to fig. 1, in this embodiment, a data verification system under a front-end and back-end separation architecture includes a front end and a back end, where the front end is used as a client for a user, and the back end is used as a server of the system.
In this embodiment, the backend includes a check rule parsing engine, a check rule routing engine, a backend rule checking engine, and a rule transmission unit.
The verification rule parsing engine of this embodiment is configured to parse and cache the data verification rule in the unified JSON format into the memory at the back end, that is, a developer sets the data verification rule in advance, and stores the data verification rule in the unified JSON format into the back end, and then, in the process of starting and initializing the back end, reads the data verification rule by using the verification rule interpretation engine, parses a specific rule therein, converts the rule into a calculation object inside the back end system, and caches the calculation object into the memory, so that the front end or the back end can quickly obtain the data verification subsequently performed.
The check rule routing engine of this embodiment is configured to search a corresponding data check rule according to a service operation applied by a service request, and route and bind the searched data check rule and a specific service logic, and for convenience of understanding, the description is specifically made in combination with a specific implementation case: the data verification rule is obtained through conversion according to a URL address of a rear end endpoint needing data processing, if a form request is submitted to a service operation endpoint of/api/roles at the rear end, the data verification rule is named as api # roles.
the back-end rule check engine of this embodiment is configured to perform, at the back end, back-end data check on each data field in the submitted form request according to the route-bound data check rule, that is, the data check rules used by the back-end rule check engine are all previously bound by the check rule routing engine, and specifically, the back-end rule check engine performs back-end data check on each data field by traversing each data field of the form request according to the corresponding data check rule to return a check result, and then determines whether to continue to execute the corresponding business operation backward according to the check result.
the rule transmission unit in this embodiment is configured to transmit the route-bound data verification rule from the back end to the front end, and specifically, before the front end submits a form request, the front end first sends a corresponding service request to the back end, and according to the service request, the rule transmission unit needs to obtain the corresponding bound data verification rule and transmit the bound data verification rule from the back end to the front end, so that the rule transmission unit serves as a basis for the front end to perform data verification before submitting the form request. In addition, if the data verification rule corresponding to the expression request does not exist, the rule transmission unit does not acquire any data verification rule and sends an instruction for not executing form request submission to the front end.
In this embodiment, the front end includes a front-end rule checking engine, where the front-end rule checking engine of this embodiment is configured to perform data checking on each data field in a form request according to a data checking rule transmitted from the back end at the front end, that is, before submitting a form request, the front end first sends a corresponding service request to the back end, and then transmits a corresponding data checking rule to the front end by using a rule transmission unit, and the front-end rule checking engine performs front-end data checking on each data field in the form request to be submitted according to the data checking rule, specifically, the front-end rule checking engine performs front-end data checking on each data field by traversing each data field of the form request and according to the corresponding data checking rule to return a checking result, and then judging whether to continue to execute the corresponding business operation or not according to the checking result. In addition, if the front end returns the instruction of not executing the form request submission after sending a corresponding service request to the back end, the front end does not execute the front end data verification and submission operation of the form request.
in this embodiment, the attribute in any data verification rule includes one or more attributes of a field type, a string length, whether the data verification rule is empty, a maximum value and a minimum value, a regular expression rule, an identity card rule, a telephone number rule, an e-mail rule, whether two passwords are consistent, a plurality of field combination association rules, and a password strength rule, and a developer can correspondingly select the attribute in a proper data verification rule according to an actual data verification requirement, and can even expand other different verification data verification rules according to requirements, such as a special rule for querying a database to verify data validity; the present invention is not limited to the attributes listed in the above data checking rules, and those skilled in the art can make the derived selections according to the actual requirements.
for ease of understanding, the data verification system described above is further explained below in conjunction with a specific data verification method.
In this embodiment, a data verification method under a front-end and back-end separation architecture includes a front-end verification process and a back-end verification process, where a verification rule parsing engine parses and caches a uniform JSON-format data verification rule in advance in a back-end memory, so that the front-end verification process and the back-end verification process obtain corresponding data verification rules.
referring to fig. 2, the front-end verification process of this embodiment specifically includes the following steps:
A1. before submitting any form request, the front end firstly sends a corresponding service request to the back end;
A2. After receiving the service request, the back end searches a corresponding data check rule according to the service operation applied by the service request, wherein if the corresponding data check rule is searched, the back end performs routing binding on the data check rule and the specific service operation and transmits the data check rule and the specific service operation to the front end through the rule transmission unit; otherwise, if the corresponding data verification rule cannot be found, sending an instruction for not executing form request submission to the front end;
A3. the front end enters a data verification stage after receiving the data verification rule, wherein in the data verification stage, the front end rule verification engine traverses each data field in the form request to be submitted based on the received data verification rule, performs front end data verification, and finally returns a verification result, wherein if all the verification results conform to the data verification rule, the verification is judged to be successful; if any one of the verification results does not accord with the data verification rule, determining that the verification fails;
A4. the front end submits the form request which is judged to be successfully verified through the front end data verification to the back end.
In step a2, after the front end receives the instruction not to execute the form request submission, the data verification and submission operation of the form request is not executed.
In step a3, for the form request determined as failed in verification, the error prompt information in the data verification rule is transmitted to the front-end related display component for display, so that the user can view the verification result.
Referring to fig. 3, the back-end verification process of this embodiment specifically includes the following steps:
B1. After receiving the form request from the front end, the back end enters a data verification stage;
B2. in the data verification stage, the back-end rule verification engine performs back-end data verification on each data field in the form request according to the bound data verification rule and finally returns a verification result, wherein if all the verification results conform to the data verification rule, the verification is judged to be successful; if any one verification result does not accord with the data verification rule, the verification is judged to be successful;
B3. and the back end continues to execute corresponding business operation backwards according to the form request which is judged to be successfully verified through the back end data verification.
In step B2, for the form request determined as failed in verification, an error prompt message in the data verification rule is returned to the response result.
in both the front-end verification process and the back-end verification process, the data verification rules used are in an SON format, and the data verification rules transmitted to the front end by the rule transmission unit do not need to be converted into a JSON format.
the above-described embodiments are merely preferred embodiments of the present invention, which is not intended to limit the present invention in any way. Those skilled in the art can make many changes, modifications, and equivalents to the embodiments of the invention without departing from the scope of the invention as set forth in the claims below. Therefore, equivalent changes made according to the spirit of the present invention should be covered within the protection scope of the present invention without departing from the contents of the technical scheme of the present invention.

Claims (4)

CN201910769877.XA2019-08-202019-08-20Data verification system and method under front-end and back-end separation architectureActiveCN110569036B (en)

Priority Applications (1)

Application NumberPriority DateFiling DateTitle
CN201910769877.XACN110569036B (en)2019-08-202019-08-20Data verification system and method under front-end and back-end separation architecture

Applications Claiming Priority (1)

Application NumberPriority DateFiling DateTitle
CN201910769877.XACN110569036B (en)2019-08-202019-08-20Data verification system and method under front-end and back-end separation architecture

Publications (2)

Publication NumberPublication Date
CN110569036Atrue CN110569036A (en)2019-12-13
CN110569036B CN110569036B (en)2023-09-22

Family

ID=68775770

Family Applications (1)

Application NumberTitlePriority DateFiling Date
CN201910769877.XAActiveCN110569036B (en)2019-08-202019-08-20Data verification system and method under front-end and back-end separation architecture

Country Status (1)

CountryLink
CN (1)CN110569036B (en)

Cited By (11)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN111078570A (en)*2019-12-202020-04-28贵阳货车帮科技有限公司Parameter format detection method, device, equipment and medium based on interface framework
CN111736811A (en)*2020-06-102020-10-02苏宁云计算有限公司Form data verification method, system, server and user terminal
CN111897842A (en)*2020-01-022020-11-06北京京东尚科信息技术有限公司Data checking method, device, computer system and medium
CN112015728A (en)*2020-09-082020-12-01浙江惠瀜网络科技有限公司Method for automatically checking acquired data
CN112131100A (en)*2020-08-172020-12-25山东浪潮通软信息科技有限公司 Metadata-based front-end and back-end verification method and device
CN114115825A (en)*2021-10-082022-03-01北京能科瑞元数字技术有限公司Front-end and back-end data verification method compatible with software
CN114398577A (en)*2021-12-142022-04-26上海易校信息科技有限公司Method for reassigning fields after form data is submitted to system
CN115146322A (en)*2022-09-012022-10-04杭州安恒信息技术股份有限公司 A data verification method, device, equipment and storage medium
CN115965470A (en)*2022-12-282023-04-14中国建设银行股份有限公司Wind control verification method and device, electronic equipment and storage medium
CN119089512A (en)*2024-08-292024-12-06平安银行股份有限公司 Data verification method, electronic device and storage medium for financial business
CN120336302A (en)*2025-04-012025-07-18北京神舟航天软件技术股份有限公司 A data quality and security processing system and method based on automatic matching rules

Citations (7)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
US20110282969A1 (en)*2010-05-132011-11-17SEAL InnotechMethod and system for exchanging information between back-end and front-end systems
CN102932332A (en)*2012-09-282013-02-13用友软件股份有限公司Data verifying system and data verifying method
CN104270395A (en)*2014-10-242015-01-07中国建设银行股份有限公司Method, device and system for checking input data
CN108388430A (en)*2018-01-262018-08-10珠海金山网络游戏科技有限公司A kind of mobile terminal data check system and method
CN108920140A (en)*2018-07-192018-11-30河北中科恒运软件科技股份有限公司Method of calibration is unified in a kind of front and back end
CN109508436A (en)*2018-11-142019-03-22北京锐安科技有限公司Front end method for routing and device based on asynchronous loading page
CN109634956A (en)*2018-11-162019-04-16王亚萍A kind of building method and system of taxation informatization message rule verification engine

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
US20110282969A1 (en)*2010-05-132011-11-17SEAL InnotechMethod and system for exchanging information between back-end and front-end systems
CN102932332A (en)*2012-09-282013-02-13用友软件股份有限公司Data verifying system and data verifying method
CN104270395A (en)*2014-10-242015-01-07中国建设银行股份有限公司Method, device and system for checking input data
CN108388430A (en)*2018-01-262018-08-10珠海金山网络游戏科技有限公司A kind of mobile terminal data check system and method
CN108920140A (en)*2018-07-192018-11-30河北中科恒运软件科技股份有限公司Method of calibration is unified in a kind of front and back end
CN109508436A (en)*2018-11-142019-03-22北京锐安科技有限公司Front end method for routing and device based on asynchronous loading page
CN109634956A (en)*2018-11-162019-04-16王亚萍A kind of building method and system of taxation informatization message rule verification engine

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
赵思远: "HTTP协议头及错误码详解", 《计算机与网络》*

Cited By (15)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN111078570B (en)*2019-12-202023-04-07贵阳货车帮科技有限公司Parameter format detection method, device, equipment and medium based on interface framework
CN111078570A (en)*2019-12-202020-04-28贵阳货车帮科技有限公司Parameter format detection method, device, equipment and medium based on interface framework
CN111897842A (en)*2020-01-022020-11-06北京京东尚科信息技术有限公司Data checking method, device, computer system and medium
CN111736811A (en)*2020-06-102020-10-02苏宁云计算有限公司Form data verification method, system, server and user terminal
WO2021249356A1 (en)*2020-06-102021-12-16苏宁易购集团股份有限公司Form data verification method, system, server, and user terminal
CN112131100A (en)*2020-08-172020-12-25山东浪潮通软信息科技有限公司 Metadata-based front-end and back-end verification method and device
CN112015728A (en)*2020-09-082020-12-01浙江惠瀜网络科技有限公司Method for automatically checking acquired data
CN114115825A (en)*2021-10-082022-03-01北京能科瑞元数字技术有限公司Front-end and back-end data verification method compatible with software
CN114115825B (en)*2021-10-082022-09-02北京能科瑞元数字技术有限公司Front-end and back-end data verification method compatible with software
CN114398577A (en)*2021-12-142022-04-26上海易校信息科技有限公司Method for reassigning fields after form data is submitted to system
CN115146322A (en)*2022-09-012022-10-04杭州安恒信息技术股份有限公司 A data verification method, device, equipment and storage medium
CN115965470A (en)*2022-12-282023-04-14中国建设银行股份有限公司Wind control verification method and device, electronic equipment and storage medium
CN119089512A (en)*2024-08-292024-12-06平安银行股份有限公司 Data verification method, electronic device and storage medium for financial business
CN119089512B (en)*2024-08-292025-09-16平安银行股份有限公司 Data verification method, electronic device, and storage medium for financial business
CN120336302A (en)*2025-04-012025-07-18北京神舟航天软件技术股份有限公司 A data quality and security processing system and method based on automatic matching rules

Also Published As

Publication numberPublication date
CN110569036B (en)2023-09-22

Similar Documents

PublicationPublication DateTitle
CN110569036A (en)data verification system and method under front-end and back-end separation architecture
US9483386B2 (en)Information interaction test device and method based on automatic generation of associated test cases
CN112187558B (en)Data verification method and device and electronic equipment
US9621440B2 (en)System and method for validating documentation of representational state transfer (REST) services
RU2648966C2 (en)Apparatus and method for processing multiple open api
CN110858172B (en) A method and device for generating automatic test code
US11550646B2 (en)Method of verifying access of multi-core interconnect to level-2 cache
WO2021249356A1 (en)Form data verification method, system, server, and user terminal
WO2019154353A1 (en)System running parameter query method, matching method and apparatus, and node device
CN110389765B (en)Parameter verification method and parameter verification system
CN104063401A (en) Method and device for merging web page style addresses
WO2020006929A1 (en)Data check method and device, and computer storage medium
US11263542B2 (en)Technologies for auto discover and connect to a rest interface
CN113688025A (en)Interface test method, device, equipment and storage medium
CN112131100B (en) A front-end and back-end verification method and device based on metadata
CN117235163A (en)Service processing method, device, equipment and storage medium
CN114844814B (en)Pressure testing method and device
CN111767543B (en)Replay attack vulnerability determination method, device, equipment and readable storage medium
US11030304B2 (en)Buffer overflow detection based on a synthesis of assertions from templates and k-induction
CN116562255B (en)Form information generation method, form information generation device, electronic equipment and computer readable medium
CN113486383B (en)Method and device for controlling authority of front-end element, storage medium and equipment
CN113282499B (en)Method, system, equipment and medium for creating test data
CN116382640A (en)Method, device, equipment and storage medium for managing micro-service
CN115344850A (en)Web front-end form verification optimization method and system
CN103188117A (en)Device and method for information interaction server simulation testing

Legal Events

DateCodeTitleDescription
PB01Publication
PB01Publication
SE01Entry into force of request for substantive examination
SE01Entry into force of request for substantive examination
GR01Patent grant
GR01Patent grant

[8]ページ先頭

©2009-2025 Movatter.jp