WO2020006929A1 - 数据校验方法、装置及计算机存储介质 - Google Patents
数据校验方法、装置及计算机存储介质 Download PDFInfo
- Publication number
- WO2020006929A1 WO2020006929A1 PCT/CN2018/111111 CN2018111111W WO2020006929A1 WO 2020006929 A1 WO2020006929 A1 WO 2020006929A1 CN 2018111111 W CN2018111111 W CN 2018111111W WO 2020006929 A1 WO2020006929 A1 WO 2020006929A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- data
- type
- verification module
- specification file
- preset specification
- 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.)
- Ceased
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/40—Transformation of program code
- G06F8/41—Compilation
- G06F8/42—Syntactic analysis
- G06F8/427—Parsing
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/40—Transformation of program code
- G06F8/41—Compilation
- G06F8/43—Checking; Contextual analysis
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F8/00—Arrangements for software engineering
- G06F8/40—Transformation of program code
- G06F8/41—Compilation
- G06F8/44—Encoding
- G06F8/443—Optimisation
Definitions
- the present application relates to the field of information technology, and in particular, to a data verification method, device, and computer storage medium.
- the front-end and back-end of the application system are usually developed in a separate way.
- false service systems have emerged.
- the fake service system can generate fake data and feed it back to the front end according to the fake development interface of the pre-appointed interface document, so that the front end can use the fake data to process the page display first, without waiting for the background interface development to complete the feedback and accurate data for page display, and then perform integration testing .
- the interface data service of the false service system after receiving the input data sent by the user through the front end, the input data usually needs to be checked for legality to reduce the waste of system resources caused by invalid data and provide users with clear input prompt .
- the false service system when it performs data verification, it needs to make a series of condition judgments for each input data sent by the front end, and write corresponding verification codes.
- verifying the data in the above manner will result in a large number of data verification codes, resulting in code expansion, poor reusability, and low readability.
- the present application provides a data verification method, device, and computer storage medium, which are mainly capable of effectively reducing the redundancy of the verification code and improving the reusability and readability of the verification code.
- a data verification method is provided, which is applied to a false service system and includes:
- a data type analysis module is called to parse the data type of the input data according to a preset specification file
- the preset specification file defines different data types, and data verification modules corresponding to the different data types respectively;
- the called data verification module is used to verify the input data.
- a data verification device including:
- a parsing unit configured to, when receiving input data sent by the front end, call a data type parsing module to parse a data type of the input data according to a preset specification file;
- a calling unit for calling a data verification module corresponding to the data type according to the preset specification file the preset specification file defines different data types, and data verification modules corresponding to the different data types respectively ;
- the verification unit is configured to verify the input data by using a called data verification module.
- a computer non-volatile readable storage medium on which computer-readable instructions are stored, and when the computer-readable instructions are executed by a processor, the following steps are implemented:
- a data type analysis module is called to parse the data type of the input data according to a preset specification file
- the preset specification file defines different data types, and data verification modules corresponding to the different data types respectively;
- the called data verification module is used to verify the input data.
- a computer device including a memory, a processor, and computer-readable instructions stored on the memory and executable on the processor.
- the processor executes the computer-readable instructions, Implement the following steps:
- a data type analysis module is called to parse the data type of the input data according to a preset specification file
- the preset specification file defines different data types, and data verification modules corresponding to the different data types respectively;
- the called data verification module is used to verify the input data.
- a data verification method, device, and computer storage medium provided by this application. Compared with the current requirements for each input data sent by the front end, a series of condition judgments are required. Compared with writing a corresponding verification code, this application receives When inputting data sent by the front end, the data type analysis module can be called to parse the data type of the input data according to a preset specification file.
- a data verification module corresponding to the data type can be called according to the preset specification file, the preset specification file defines different data types, and data verification modules corresponding to the different data types respectively ; And can use the called data verification module to verify the input data, so that the false service system can uniformly process the input data of the same data type through the data verification module of the same data type, without the need for each input
- the data is processed separately, which can effectively reduce the redundancy of the check code and improve the reusability and readability of the check code.
- FIG. 1 shows a flowchart of a data verification method according to an embodiment of the present application
- FIG. 2 is a flowchart of another data verification method according to an embodiment of the present application.
- FIG. 3 is a schematic structural diagram of a data verification apparatus according to an embodiment of the present application.
- FIG. 4 is a schematic structural diagram of another data verification apparatus according to an embodiment of the present application.
- FIG. 5 is a schematic structural diagram of a computer device according to an embodiment of the present application.
- an embodiment of the present application provides a data verification method, which is applied to a false service system. As shown in FIG. 1, the method includes:
- a data type parsing module is called to parse a data type of the input data according to a preset specification file.
- the preset specification file may be a JSON Schema specification file.
- JSON Schema is a specification that defines a JSON data structure based on the JSON format. It is an easy-to-understand human- and machine-readable document. You can know the data object structure returned by the background interface, and then develop your own page display.
- the preset specification file may define a data type parsing module. Specifically, the data type parsing module may be developed for technicians to predefine in the preset specification file, the data type parsing module supports Data types can be enumerable and can hold data of different data types.
- the data type may be a null character type, a Boolean type, a number type, a string type, an array type, an object type, or other custom data types.
- the data type analysis module may search for data that matches the input data format, and determine the data type of the matched data as the data type of the input data.
- the input data can be carried in a data verification request.
- the fake service system can receive the data verification. Request to receive the input data.
- the preset specification file defines different data types and data verification modules corresponding to the different data types.
- the preset specification file may define a null character type and its corresponding data verification module, a Boolean type and its corresponding data verification module, a numeric type and its corresponding data verification module, a string type, and Its corresponding data verification module, array type and its corresponding data verification module, object type and its corresponding data verification module, or other custom data types and its corresponding data verification module.
- a null character type data verification module may be called according to a preset specification file to verify whether the input data is a null character. If the data type of the input data is parsed, a Boolean data verification module may be called according to a preset specification file to verify whether the input data is "true”, “false", “true”, or " false ". If the data type of the input data is parsed as a digital type, a string-type data verification module may be called according to a preset specification file to verify whether the input data is digital.
- a string type data verification module may be called according to a preset specification file to verify whether the input data is a string. If the data type of the input data is parsed as an array type, the data verification module of the array type may be called according to a preset specification file to check whether the input data is an array. If the data type of the input data is parsed as an object type , A data verification module of an object type may be called according to a preset specification file to verify whether the input data is an object.
- the data verification method provided in the embodiment of the present application requires a series of condition judgments for each input data currently sent by the front end. Compared with writing a corresponding verification code, the embodiment of the present application receives When inputting data, the data type analysis module can be called to analyze the data type of the input data according to a preset specification file.
- a data verification module corresponding to the data type can be called according to the preset specification file, the preset specification file defines different data types, and data verification modules corresponding to the different data types respectively ; And can use the called data verification module to verify the input data, so that the false service system can uniformly process the input data of the same data type through the data verification module of the same data type, without the need for each input
- the data is processed separately, which can effectively reduce the redundancy of the check code and improve the reusability and readability of the check code.
- an embodiment of the present application provides another data verification method, as shown in FIG. 2, the method includes :
- a data type analysis module is called to analyze the data type of the input data according to a preset specification file.
- the step of calling the data type analysis module to parse the data type of the input data according to a preset specification file may specifically include: calling the data type analysis module to find the input data format according to the preset specification file. For the matched data, the data type of the matched data is determined as the data type of the input data.
- the data type of the input data can be parsed; if the input data is " abd ", the data that matches the input data format is” mmn ", and the data type of" mmn "is a string type, then the data type of the input data can be parsed as a string type.
- the preset specification file defines different data types and data verification module identifiers corresponding to the different data types.
- the different data types and data verification module identifiers corresponding to the different data types may be Is defined in advance into the specification file.
- the data verification modules corresponding to the different data types may be developed in advance by a technician, specifically, may be developed by writing a verification code corresponding to a series of verification operations on the data.
- the identification of the data verification module may be the name of the data verification module.
- the identification of the data verification module of the Boolean type may be: Boolean-Checking module, the Boolean type defined by the preset specification file and the corresponding forged data verification.
- the module can be:
- the method may further include: obtaining front-end front-end address information and calling a fake service interface corresponding to the front-end address information; Use the fake service interface to call a data verification module corresponding to the data type according to a preset specification file, and the fake service interface is defined according to an interface document agreed in advance by the front end and the background.
- the fake service interface may be used to search for a data verification module identifier corresponding to the data type from the preset specification file to invoke a data verification module corresponding to the data type.
- the interface document may include pre-agreed request field information, return field information, data type field information, and the like.
- the fake service interface 1 can be called and the fake service interface 1 can be used from the preset specification file. And searching for a data verification module identifier of a character string type to call the data verification module of the character string to verify whether the input data is a character string.
- step 204 Use the called data verification module to verify the input data. If the verification is successful, step 205 is performed, and if the verification fails, step 206 is performed.
- the step 204 may specifically include:
- null character type data verification module uses a null character type data verification module to verify whether the input data is a null character.
- a data verification module of the array type uses a data verification module of the array type to check whether the input data is an array.
- a digital type data verification module may be used to verify whether each input value in the input data is digital or not to verify whether the input data is an array.
- the data type is an object type
- the data specification object defined in the corresponding data specification object attribute may be called for input data verification.
- the data specification object attribute may be
- the data specification object can be "status” and "complete”. If the input data is ⁇ "status”: “randomstring”, “complete”: true ⁇ , you can verify whether "randomstring” is a string type and verify Checks whether true is a boolean type and whether the input data is an object type.
- the prompt information may be text prompt information, picture prompt information, and the like.
- the feedback of the verification success information to the front end enables the front end to request forged data from the virtual service system for testing, so as to complete the development of the application system as soon as possible, avoid the deployment of a real test environment, and wait for the background interface to complete the integration test, saving labor costs. And time cost.
- the null character type data verification module verifies that the input data is not a null character type, it may feed back to the front end an input data verification failure prompt message, and store the input data and the null character type to the storage module.
- the Boolean-type data verification module verifies that the input data is not a Boolean type, feedback the input data verification failure prompt message to the front end, and store the input data and a null character type in the storage module;
- the data verification module verifies that the input data is not a digital type, and then feeds back to the front end an input data verification failure prompt message, and stores the input data and the digital type in the storage module.
- the data verification module of the character string type may feed back to the front end a prompt message of input data verification failure, and store the input data and the character string type to the storage module;
- the data verification module of the array verifies that the input data is not an array type, and then feeds back to the front end an input data verification failure prompt message, and stores the input data and array type to the storage module;
- the object type data verification module Verify that the input data is not an object type, and feed back the input data verification failure prompt information to the front end, and store the input data and object type in the storage module.
- the verification data failure information storage module by storing the input data and the corresponding data type in the verification data failure information storage module, all data verification failure information can be obtained at one time, which is convenient for one-time debugging and resolution, and saves Time costs.
- the embodiments of the present application may also support the functions of pre-defined preset specification files and extended forged data types.
- the method further includes: defining the different data types and data verification modules corresponding to the different data types to all the data verification modules.
- the preset specification file is described; when a data check extension instruction is received, the new data type included in the data check extension instruction is obtained; the new data type and its corresponding data check module are obtained Defined in the preset specification file.
- the front end can send data verification of the newly added data types to the fake service system.
- Extended instructions for example, the new data type can be: phone number data type.
- the false service system can define the phone number data type and its corresponding data verification module module into a preset specification file. For example, after expanding the phone number data type, the following can be added to the preset specification file:
- the data type analysis module may also add a phone number data type, so that when the input data is received, it is possible to parse out whether the data type of the input data is a phone number data type. If the data type of the input data is parsed as the phone number data type, the data verification module module of the phone number data type can be used to verify the input data. For example, if the input data is "13888888888", the verification result can be the input data. telephone number. Similarly, other custom data types are extended to the fake service system in the same way.
- Another data verification method provided by the embodiment of the present application compared with the current need to perform a series of condition judgments for each input data sent by the front end, compared with writing a corresponding verification code, the embodiment of the present application receives the front end When sending the input data, the data type analysis module can be called to parse the data type of the input data according to a preset specification file.
- a data verification module corresponding to the data type can be called according to the preset specification file, the preset specification file defines different data types, and data verification modules corresponding to the different data types respectively ; And can use the called data verification module to verify the input data, so that the false service system can uniformly process the input data of the same data type through the data verification module of the same data type, without the need for each input
- the data is processed separately, which can effectively reduce the redundancy of the check code and improve the reusability and readability of the check code.
- an embodiment of the present application provides a data verification device.
- the device may include: a parsing unit 31, a calling unit 32, and a verification unit 33.
- the device may specifically be part of a false service system.
- the parsing unit 31 may be configured to call a data type parsing module to parse the data type of the input data when receiving the input data sent by the front end according to a preset specification file.
- the parsing unit 31 is a main functional module in the device that, when receiving input data sent by the front end, calls a data type parsing module according to a preset specification file to parse the data type of the input data.
- the calling unit 32 may be configured to call a data verification module corresponding to the data type according to the preset specification file.
- the preset specification file defines different data types, and the different data types correspond to Data verification module.
- the calling unit 32 is a main function module and a core module of this device calling a data verification module corresponding to the data type according to the preset specification file.
- the verification unit 33 may be configured to verify the input data by using a called data verification module.
- the verification unit 33 is a main function module for verifying the input data by using a called data verification module in the device.
- the calling module 32 may be specifically used to find a data verification module corresponding to the data type from the preset specification file. Identification, the preset specification file defines different data types, and data verification module identifiers corresponding to the different data types; and invokes a data verification module corresponding to the data type according to the data verification module identification.
- the calling module 32 may be specifically configured to obtain the front-end front-end address information and call a fake service interface corresponding to the front-end address information; and use the fake service interface to call the
- the data verification module corresponding to the data type, and the false service interface is defined according to an interface document agreed in advance by the front end and the background.
- the parsing module 31 may be specifically configured to call a data type parsing module according to a preset specification file to find data that matches the input data format, and match the data.
- the data type of is determined as the data type of the input data.
- the verification module 33 may be specifically configured to use a null character type data verification module to verify whether the input data is a null character if the data type is a null character type; or if If the data type is Boolean, use a Boolean data verification module to verify whether the input data is true or false; or if the data type is a numeric type, use a numeric data verification module to verify Whether the input data is a number; or if the data type is a string type, verifying whether the input data is a string by using a string type data verification module; or if the data type is an array type, Then, an array type data verification module is used to verify whether the input data is an array; or if the data type is an object type, an object type data verification module is used to verify whether the input data is an object.
- the device in order to make the front end know that the input data verification is successful, the device further includes a feedback unit 34, as shown in FIG. 4.
- the feedback unit 34 may be configured to, if the input data verification succeeds, use the called data verification module to feedback the verification success prompt information to the front end.
- the feedback unit 34 is a main functional module of the present device that uses the called data verification module to feed back to the front end a verification success message when the input data verification is successful.
- the device further includes a storage unit 35.
- the storage unit 35 may be configured to store the input data and a corresponding data type to the verification data failure information storage module if the input data fails to be verified.
- the storage unit 35 is a main functional module of the present device that stores the input data and its corresponding data type into the verification data failure information storage module when the verification of the input data fails.
- the embodiments of the present application can also support the functions of pre-defined preset specification files and extended forged data types.
- the device further includes a definition unit 36 and an acquisition unit 37, as shown in FIG. 4.
- the defining unit 36 may be configured to define the different data types and data verification modules corresponding to the different data types into the preset specification file.
- the definition unit 36 is a main function module in the device that defines the different data types and data verification modules corresponding to the different data types to the preset specification file.
- the acquiring unit 37 may be configured to acquire a new data type included in the data check extended instruction when the data check extended instruction is received.
- the acquiring unit 37 is a main function module for acquiring a new data type included in the data check extended instruction when the data check extended instruction is received in the device.
- the definition unit 36 may be further configured to define the newly added data type and a corresponding data verification module into the preset specification file.
- the definition unit 36 is a main function module in the device that defines the newly added data type and its corresponding data verification module to the preset specification file.
- an embodiment of the present application further provides a computer non-volatile readable storage medium having computer-readable instructions stored thereon.
- the computer-readable instructions When the computer-readable instructions are executed by a processor, Implement the following steps: when receiving input data sent by the front end, call a data type analysis module to parse the data type of the input data according to a preset specification file; call a data calibration corresponding to the data type according to the preset specification file Verification module, the preset specification file defines different data types, and data verification modules corresponding to the different data types respectively; and the called data verification module is used to verify the input data.
- an embodiment of the present application further provides a physical structure diagram of a computer device.
- the receiving terminal device includes: The processor 41, the memory 42, and computer-readable instructions stored on the memory 42 and executable on the processor, wherein the memory 42 and the processor 41 are all disposed on the bus 43, and the processor 41 executes the computer-readable
- the following steps are implemented: when receiving the input data sent by the front end, the data type analysis module is called to analyze the data type of the input data according to a preset specification file; A data verification module.
- the preset specification file defines different data types and data verification modules corresponding to the different data types respectively; and the called data verification module is used to verify the input data.
- the computer device further includes a bus 43 configured to be coupled to the processor 41 and the memory 42.
- the data type analysis module when receiving input data sent by the front end, can be called to parse the data type of the input data according to a preset specification file.
- a data verification module corresponding to the data type can be called according to the preset specification file, the preset specification file defines different data types, and data verification modules corresponding to the different data types respectively ; And can use the called data verification module to verify the input data, so that the false service system can uniformly process the input data of the same data type through the data verification module of the same data type, without the need for each input
- the data is processed separately, which can effectively reduce the redundancy of the check code and improve the reusability and readability of the check code.
- modules or steps of the present application may be implemented by a general-purpose computing device, and they may be concentrated on a single computing device or distributed on a network composed of multiple computing devices. Above, optionally, they may be implemented with computer-readable instruction code executable by a computing device, so that they may be stored in a storage device and executed by the computing device, and in some cases, may be different from this.
- the steps shown or described are performed in sequence, either by making them into individual integrated circuit modules, or by making multiple modules or steps into a single integrated circuit module. As such, this application is not limited to any particular combination of hardware and software.
Landscapes
- Engineering & Computer Science (AREA)
- General Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Software Systems (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Debugging And Monitoring (AREA)
Abstract
一种数据校验方法、装置及计算机存储介质,涉及信息技术领域,主要在于能够有效减少校验代码冗余、提升校验代码的复用性以及可读性。所述方法包括:当接收到前端发送的输入数据时,根据预设规范文件调用数据类型解析模块解析所述输入数据的数据类型(101);根据所述预设规范文件调用与所述数据类型对应的数据校验模块(102),所述预设规范文件定义有不同数据类型,以及所述不同数据类型分别对应的数据校验模块;利用调用的数据校验模块对所述输入数据进行校验(103)。该方法适用于数据校验。
Description
本申请要求于2018年7月5日提交中国专利局、申请号为2018107306073、申请名称为“数据校验方法、装置及计算机存储介质”的中国专利申请的优先权,其全部内容通过引用结合在申请中。
本申请涉及信息技术领域,尤其是涉及一种数据校验方法、装置及计算机存储介质。
随着信息技术的不断发展,应用系统的前端和后台通常采用分离方式开发,为了避免前端等待后台完成真实的接口开发再进行集成测试,降低前端和后台的耦合性,虚假服务系统随之出现,虚假服务系统可以根据预先约定的接口文档的虚假开发接口,生成伪造数据反馈给前端,使得前端可以先利用伪造数据处理页面展示,无需等待后台接口开发完成反馈准确数据进行页面展示,再进行集成测试。虚假服务系统在进行接口数据服务中,在接收到用户通过前端发送的输入数据后,通常需要对输入数据进行合法性校验,以减少无效数据对系统的资源浪费,并且提供用户明确的输入提示。
目前,虚假服务系统在进行数据校验时,针对前端发送的每个输入数据都需要进行一系列的条件判断,编写对应的校验代码。然而,通过上述方式校验数据,会造成数据的校验代码较多,导致代码膨胀,复用性差,可读性低。
发明内容
本申请提供了一种数据校验方法、装置及计算机存储介质,主要在于能够有效减少校验代码冗余、提升校验代码的复用性以及可读性。
根据本申请的第一个方面,提供一种数据校验方法,应用于虚假服务系统,包括:
当接收到前端发送的输入数据时,根据预设规范文件调用数据类型解析模块解析所述输入数据的数据类型;
根据所述预设规范文件调用与所述数据类型对应的数据校验模块,所述预设规范文件定义有不同数据类型,以及所述不同数据类型分别对应的数据校验模块;
利用调用的数据校验模块对所述输入数据进行校验。
根据本申请的第二个方面,提供一种数据校验装置,包括:
解析单元,用于当接收到前端发送的输入数据时,根据预设规范文件调用数据类型解析模块解析所述输入数据的数据类型;
调用单元,用于根据所述预设规范文件调用与所述数据类型对应的数据校验模块,所述预设规范文件定义有不同数据类型,以及所述不同数据类型分别对应的数据校验模块;
校验单元,用于利用调用的数据校验模块对所述输入数据进行校验。
根据本申请的第三个方面,提供一种计算机非易失性可读存储介质,其上存储有计算机可读指令,该计算机可读指令被处理器执行时实现以下步骤:
当接收到前端发送的输入数据时,根据预设规范文件调用数据类型解析模块解析所述输入数据的数据类型;
根据所述预设规范文件调用与所述数据类型对应的数据校验模块,所述预设规范文件定义有不同数据类型,以及所述不同数据类型分别对应的数据校验模块;
利用调用的数据校验模块对所述输入数据进行校验。
根据本申请的第四个方面,提供一种计算机设备,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机可读指令,所述处理器执行所述计算机可读指令时实现以下步骤:
当接收到前端发送的输入数据时,根据预设规范文件调用数据类型解析模块解析所述输入数据的数据类型;
根据所述预设规范文件调用与所述数据类型对应的数据校验模块,所述预设规范文件定义有不同数据类型,以及所述不同数据类型分别对应的数据校验模块;
利用调用的数据校验模块对所述输入数据进行校验。
本申请提供的一种数据校验方法、装置及计算机存储介质,与目前针对前端发送的每个输入数据都需要进行一系列的条件判断,编写对应的校验代码相比,本申请在接收到前端发送的输入数据时,能够根据预设规范文件调用数据类型解析模块解析所述输入数据的数据类型。与此同时,能够根据所述预设规范文件调用与所述数据类型对应的数据校验模块,所述预设规范文件定义有不同数据类型,以及所述不同数据类型分别对应的数据校验模块;并能够利用调用的数据校验模块对所述输入数据进行校验,从而能够实现虚假服务系统通过同一数据类型的数据校验模块对同一数据类型的输入数据进行统一处理,无需针对每个输入数据进行单独处理,进而能够有效减少校验代码冗余、提升校验代码的复用性以及可读性。
此处所说明的附图用来提供对本申请的进一步理解,构成本申请的一部分,本申请的示意性实施例及其说明用于解释本申请,并不构成对本申请的不当限定。在附图中:
图1示出了本申请实施例提供的一种数据校验方法流程图;
图2示出了本申请实施例提供的另一种数据校验方法流程图;
图3示出了本申请实施例提供的一种数据校验装置的结构示意图;
图4示出了本申请实施例提供的另一种数据校验装置的结构示意图;
图5示出了本申请实施例提供的一种计算机设备的实体结构示意图。
下文中将参考附图并结合实施例来详细说明本申请。需要说明的是,在不冲突的情况下,本申请中的实施例及实施例中的特征可以相互组合。
如背景技术,目前,虚假服务系统在进行数据校验时,针对前端发送的每个输入数据都需要进行一系列的条件判断,编写对应的校验代码。然而,通过上述方式校验数据,会造成数据的校验代码较多,导致代码膨胀,复用性差,可读性低。
为了解决上述问题,本申请实施例提供了一种数据校验方法,应用于虚假服务系统,如图1所示,所述方法包括:
101、当接收到前端发送的输入数据时,根据预设规范文件调用数据类型解析模块解析所述输入数据的数据类型。
其中,所述预设规范文件可以为JSON Schema规范文件,JSON Schema是基于JSON格式定义JSON数据结构的规范,它是一个易于理解的人类和机器都可读的文档,使用JSON schema前端开发人员即可知晓后台接口返回的数据对象结构,进而开发自己的页面展示。所述预设规范文件可以定义有数据类型解析模块,具体地,所述数据类型解析模块可以为技术人员开发完预定义在所述预设规范文件中的,所述数据类型解析模块所支持的数据类型可以是可枚举的,可以保存不同数据类型的数据。所述数据类型可以为空字符类型、布尔类型、数字类型、字符串类型、数组类型、对象类型,或者其他自定义的数据类型。所述数据类型解析模块可以查找与所述输入数据格式匹配的数据,将匹配数据的数据类型确定为所述输入数据的数据类型。
需要说明的是,所述输入数据可以携带在数据校验请求中,当用户在前端的计算机可读指令展示页面输入数据并触发的校验按钮或者按键时,虚假服务系统能够接收到数据校验请求,从而接收所述输入数据。
102、根据所述预设规范文件调用与所述数据类型对应的数据校验模块。
其中,所述预设规范文件定义有不同数据类型,以及所述不同数据类型分别对应的数据校验模块。具体地,所述预设规范文件可以定义有空字符类型及其对应的数据校验模块,布尔类型及其对应的数据校验模块,数字类型及其对应的数据校验模块,字符串类型及其对应的数据校验模块,数组类型及其对应的数据校验模块,对象类型及其对应的数据校验模块,或者其他自定义的数据类型及其对应的数据校验模块。
例如,若解析出输入数据的数据类型为空字符类型,则可以根据预设规范文件调用空字符类型的数据校验模块,以校验所述输入数据是否为空字符。若解析出输入数据的数据类型为布尔类型,则可以根据预设规范文件调用布尔类型的数据校验模块,以校验所述输入数据是否为“真”、“假”、“true”或者“false”。若解析出输入数据的数据类型为数字类型,则可以根据预设规范文件调用字符串类型的数据校验模块,以校验所述输入数据是否为数字。若解析出输入数据的数据类型为字符串类型,则可以根据预设规范文件调用字符串类型的数据校验模块,以校验所述输入数据是否为字符串。若解析出输入数据的数据类型为数组类型,则可以根据预设规范文件调用数组类型的数据校验模块,以校验所述输入数据是否为数组,若解析出输入数据的数据类型为对象类型,则可以根据预设规范文件调用对象类型的数据校验模块,以校验所述输入数据是否为对象。
103、利用调用的数据校验模块对所述输入数据进行校验。
本申请实施例提供的一种数据校验方法,与目前针对前端发送的每个输入数据都需要进行一系列的条件判断,编写对应的校验代码相比,本申请实施例在接收到前端发送的输入数据时,能够根据预设规范文件调用数据类型解析模块解析所述输入数据的数据类型。与此同时,能够根据所述预设规范文件调用与所述数据类型对应的数据校验模块,所述预设规范文件定义有不同数据类型,以及所述不同数据类型分别对应的数据校验模块;并能够利用调用的数据校验模块对所述输入数据进行校验,从而能够实现虚假服务系统通过同一数据类型的数据校验模块对同一数据类型的输入数据进行统一处理,无需针对每个输入数据进行单独处理,进而能够有效减少校验代码冗余、提升校验代码的复用性以及可读性。
进一步的,为了更好的说明上述数据校验的过程,作为对上述实施例的细化和扩展,本申请实施例提供了另一种数据校验方法,如图2所示,所述方法包括:
201、当接收到前端发送的输入数据时,根据预设规范文件调用数据类型解析模块解析所述输入数据的数据类型。
对于本申请实施例,所述根据预设规范文件调用数据类型解析模块解析所述输入数据 的数据类型的步骤,具体可以包括:根据预设规范文件调用数据类型解析模块查找与所述输入数据格式匹配的数据,将匹配数据的数据类型确定为所述输入数据的数据类型。例如,若输入数据为“1”,与输入数据格式匹配的数据为“2”,“2”的数据类型为数字类型,则可以解析出输入数据的数据类型为数字类型;若输入数据为“abd”,与输入数据格式匹配的数据为“mmn”,“mmn”的数据类型为字符串类型,则可以解析出输入数据的数据类型为字符串类型。
202、从所述预设规范文件中查找与所述数据类型对应的数据校验模块标识。
其中,所述预设规范文件定义有不同数据类型,以及所述不同数据类型分别对应的数据校验模块标识;所述不同数据类型,以及所述不同数据类型分别对应的数据校验模块标识可以为预先定义到所述规范文件中的。所述不同数据类型分别对应的数据校验模块可以为技术人员预先开发的,具体地,可以为通过编写数据一系列校验操作对应的校验代码开发的。所述数据校验模块标识可以为数据校验模块的名称,如布尔类型的数据校验模块标识可以为:Boolean-Checking module,所述预设规范文件定义的布尔类型以及对应的伪造数据校验模块的方式可以为:
“Type”:Boolean;“Checking module”:Boolean-Checking module。
203、根据所述数据校验模块标识调用与所述数据类型对应的数据校验模块。
对于本申请实施例,为了调用与所述数据类型对应的数据校验模块,所述方法还可以包括:获取所述前端的前端地址信息,并调用与所述前端地址信息对应的虚假服务接口;利用所述虚假服务接口根据预设规范文件调用与所述数据类型对应的数据校验模块,所述虚假服务接口为根据前端和后台预先约定的接口文档定义的。具体地,可以利用所述虚假服务接口从所述预设规范文件中查找与所述数据类型对应的数据校验模块标识,以调用与所述数据类型对应的数据校验模块。所述接口文档可以包括预先约定的请求字段信息、返回字段信息、数据类型字段信息等。例如,所述前端地址信息为http://abc.123.486:789/A,解析的数据类型为字符串类型,则可以调用虚假服务接口1,并利用虚假服务接口1从所述预设规范文件中查找与字符串类型的数据校验模块标识,以调用字符串的数据校验模块,校验所述输入数据是否为字符串。
204、利用调用的数据校验模块对所述输入数据进行校验。若校验成功,则执行步骤205,若校验失败,则执行步骤206。
对于本申请实施例,所述步骤204具体可以包括:
1、若所述数据类型为空字符类型,则利用空字符类型的数据校验模块校验所述输入 数据是否为空字符。
2、若所述数据类型为布尔类型,则利用布尔类型的数据校验模块校验所述输入数据是否为真或者假。
3、若所述数据类型为数字类型,则利用数字类型的数据校验模块校验所述输入数据是否为数字。
4、若所述数据类型为字符串类型,则利用字符串类型的数据校验模块校验所述输入数据是否为字符串。
5、若所述数据类型为数组类型,则利用数组类型的数据校验模块校验所述输入数据是否为数组。具体地,可以利用数字类型的数据校验模块校验输入数据中的每个输入值是否数字来校验所述输入数据是否为数组。
数据规范对象可以为“status”和“complete”,若输入数据为{“status”:“randomstring”,“complete”:true},则可以通过分别校验“randomstring”是否为字符串类型,以及校验true是否为布尔类型,校验输入数据是否为对象类型。
205、利用所述调用的数据校验模块向所述前端反馈校验成功提示信息。
其中,所述提示信息可以为文字提示信息,图片提示信息等。通过向前端反馈校验成功提示信息,能够使得前端向虚拟服务系统请求伪造数据进行测试,以尽快完成应用系统的开发,避免部署真实测试环境,以及等待后台接口完成后进行集成测试,节约人力成本和时间成本。
206、将所述输入数据及其对应的数据类型存储到校验数据失败信息存储模块。
例如,若空字符类型的数据校验模块校验输入数据为并非空字符类型,则可以向所述前端反馈输入数据校验失败提示信息,并将输入数据和空字符类型存储到所述存储模块; 若布尔类型的数据校验模块校验输入数据并非布尔类型,则向所述前端反馈输入数据校验失败提示信息,并将输入数据和空字符类型存储到所述存储模块;若数字类型的数据校验模块校验输入数据并非数字类型,则向所述前端反馈输入数据校验失败提示信息,并将输入数据和数字类型存储到所述存储模块。若字符串类型的数据校验模块校验输入数据为并非字符串类型,则可以向所述前端反馈输入数据校验失败提示信息,并将输入数据和字符串类型存储到所述存储模块;若数组的数据校验模块校验输入数据并非数组类型,则向所述前端反馈输入数据校验失败提示信息,并将输入数据和数组类型存储到所述存储模块;若对象类型的数据校验模块校验输入数据并非对象类型,则向所述前端反馈输入数据校验失败提示信息,并将输入数据和对象类型存储到所述存储模块。
对于本申请实施例,通过将所述输入数据及其对应的数据类型存储到校验数据失败信息存储模块,能够实现一次性获取出所有的数据校验失败信息,便于一次性调试及解决,节约时间成本。
本申请实施例还可以支持预定义预设规范文件和扩展伪造数据类型的功能,所述方法还包括:将所述不同数据类型,以及所述不同数据类型分别对应的数据校验模块定义到所述预设规范文件中;当接收到数据校验扩展指令时,获取所述数据校验扩展指令包含的新增的数据类型;将所述新增的数据类型及其对应的的数据校验模块定义到所述预设规范文件中。
在实际使用过程中,若存在一些自定义的数据类型,且技术人员开发完自定义的数据类型的数据校验模块后,前端可以向虚假服务系统发送包含的新增的数据类型的数据校验扩展指令,例如新增的数据类型可以为:电话号码数据类型。虚假服务系统可以将电话号码数据类型及其对应的数据校验模块模块定义到预设规范文件中。例如,在扩展电话号码数据类型后,预设规范文件中可以增加如下内容:
此外,所述数据类型解析模块也可以新增电话号码数据类型,从而在接收到输入数据时,能够解析出输入数据的数据类型是否为电话号码数据类型。若解析出输入数据的数据类型为电话号码数据类型,则可以利用电话号码数据类型的数据校验模块模块对输入数据进行校验,如输入数据为“13888888888”,校验结果可以为输入数据是电话号码。同理 地,其他自定义的数据类型以相同方式扩展到虚假服务系统中。
本申请实施例提供的另一种数据校验方法,与目前针对前端发送的每个输入数据都需要进行一系列的条件判断,编写对应的校验代码相比,本申请实施例在接收到前端发送的输入数据时,能够根据预设规范文件调用数据类型解析模块解析所述输入数据的数据类型。与此同时,能够根据所述预设规范文件调用与所述数据类型对应的数据校验模块,所述预设规范文件定义有不同数据类型,以及所述不同数据类型分别对应的数据校验模块;并能够利用调用的数据校验模块对所述输入数据进行校验,从而能够实现虚假服务系统通过同一数据类型的数据校验模块对同一数据类型的输入数据进行统一处理,无需针对每个输入数据进行单独处理,进而能够有效减少校验代码冗余、提升校验代码的复用性以及可读性。
进一步地,作为图1的具体实现,本申请实施例提供了一种数据校验装置,如图3所示,所述装置可以包括:解析单元31、调用单元32和校验单元33,所述装置具体可以为虚假服务系统的一部分。
所述解析单元31,可以用于当接收到前端发送的输入数据时,根据预设规范文件调用数据类型解析模块解析所述输入数据的数据类型。所述解析单元31是本装置中在接收到前端发送的输入数据时,根据预设规范文件调用数据类型解析模块解析所述输入数据的数据类型的主要功能模块。
所述调用单元32,可以用于根据所述预设规范文件调用与所述数据类型对应的数据校验模块,所述预设规范文件定义有不同数据类型,以及所述不同数据类型分别对应的数据校验模块。所述调用单元32是本装置中根据所述预设规范文件调用与所述数据类型对应的数据校验模块的主要功能模块,也是核心模块。
所述校验单元33,可以用于利用调用的数据校验模块对所述输入数据进行校验。所述校验单元33是本装置中利用调用的数据校验模块对所述输入数据进行校验的主要功能模块。
对于本申请实施例,为了调用与所述数据类型对应的数据校验模块,所述调用模块32,具体可以用于从所述预设规范文件中查找与所述数据类型对应的数据校验模块标识,所述预设规范文件定义有不同数据类型,以及所述不同数据类型分别对应的数据校验模块标识;根据所述数据校验模块标识调用与所述数据类型对应的数据校验模块。
此外,所述调用模块32,具体还可以用于获取所述前端的前端地址信息,并调用与所述前端地址信息对应的虚假服务接口;利用所述虚假服务接口根据预设规范文件调用与所 述数据类型对应的数据校验模块,所述虚假服务接口为根据前端和后台预先约定的接口文档定义的。
对于本申请实施例,为了解析所述输入数据的数据类型,所述解析模块31,具体可以用于根据预设规范文件调用数据类型解析模块查找与所述输入数据格式匹配的数据,将匹配数据的数据类型确定为所述输入数据的数据类型。
在具体应用场景中,所述校验模块33,具体可以用于若所述数据类型为空字符类型,则利用空字符类型的数据校验模块校验所述输入数据是否为空字符;或者若所述数据类型为布尔类型,则利用布尔类型的数据校验模块校验所述输入数据是否为真或者假;或者若所述数据类型为数字类型,则利用数字类型的数据校验模块校验所述输入数据是否为数字;或者若所述数据类型为字符串类型,则利用字符串类型的数据校验模块校验所述输入数据是否为字符串;或者若所述数据类型为数组类型,则利用数组类型的数据校验模块校验所述输入数据是否为数组;或者若所述数据类型为对象类型,则利用对象类型的数据校验模块,校验所述输入数据是否为对象。
对于本申请实施例,为了使得前端获知输入数据校验成功的情况,所述装置还包括:反馈单元34,如图4所示。
所述反馈单元34,可以用于若所述输入数据校验成功,则利用所述调用的数据校验模块向所述前端反馈校验成功提示信息。所述反馈单元34是本装置中在所述输入数据校验成功时,利用所述调用的数据校验模块向所述前端反馈校验成功提示信息的主要功能模块。
进一步地,为了实现一次性获取出所有的数据校验失败信息,便于一次性调试及解决,节约时间成本,所述装置还包括:存储单元35。
所述存储单元35,可以用于若所述输入数据校验失败,则将所述输入数据及其对应的数据类型存储到校验数据失败信息存储模块。所述存储单元35是本装置中在所述输入数据校验失败时,将所述输入数据及其对应的数据类型存储到校验数据失败信息存储模块的主要功能模块。
本申请实施例还可以支持预定义预设规范文件和扩展伪造数据类型的功能,所述装置还包括:定义单元36和获取单元37,如图4所示。
所述定义单元36,可以用于将所述不同数据类型,以及所述不同数据类型分别对应的数据校验模块定义到所述预设规范文件中。所述定义单元36是本装置中将所述不同数据类型,以及所述不同数据类型分别对应的数据校验模块定义到所述预设规范文件中的主要 功能模块。
所述获取单元37,可以用于当接收到数据校验扩展指令时,获取所述数据校验扩展指令包含的新增的数据类型。所述获取单元37是本装置中当接收到数据校验扩展指令时,获取所述数据校验扩展指令包含的新增的数据类型的主要功能模块。
所述定义单元36,还可以用于将所述新增的数据类型及其对应的的数据校验模块定义到所述预设规范文件中。所述定义单元36是本装置中将所述新增的数据类型及其对应的的数据校验模块定义到所述预设规范文件中的主要功能模块。
需要说明的是,本申请实施例提供的一种数据校验装置所涉及各功能模块的其他相应描述,可以参考图1所示方法的对应描述,在此不再赘述。
基于上述如图1所示方法,相应的,本申请实施例还提供了一种计算机非易失性可读存储介质,其上存储有计算机可读指令,该计算机可读指令被处理器执行时实现以下步骤:当接收到前端发送的输入数据时,根据预设规范文件调用数据类型解析模块解析所述输入数据的数据类型;根据所述预设规范文件调用与所述数据类型对应的数据校验模块,所述预设规范文件定义有不同数据类型,以及所述不同数据类型分别对应的数据校验模块;利用调用的数据校验模块对所述输入数据进行校验。
基于上述如图1所示方法和如图3所示数据校验装置的实施例,本申请实施例还提供了一种计算机设备的实体结构图,如图5所示,该接收终端设备包括:处理器41、存储器42、及存储在存储器42上并可在处理器上运行的计算机可读指令,其中存储器42和处理器41均设置在总线43上所述处理器41执行所述计算机可读指令时实现以下步骤:当接收到前端发送的输入数据时,根据预设规范文件调用数据类型解析模块解析所述输入数据的数据类型;根据所述预设规范文件调用与所述数据类型对应的数据校验模块,所述预设规范文件定义有不同数据类型,以及所述不同数据类型分别对应的数据校验模块;利用调用的数据校验模块对所述输入数据进行校验。该计算机设备还包括:总线43,被配置为耦接处理器41及存储器42。
通过本申请的技术方案,在接收到前端发送的输入数据时,能够根据预设规范文件调用数据类型解析模块解析所述输入数据的数据类型。与此同时,能够根据所述预设规范文件调用与所述数据类型对应的数据校验模块,所述预设规范文件定义有不同数据类型,以及所述不同数据类型分别对应的数据校验模块;并能够利用调用的数据校验模块对所述输入数据进行校验,从而能够实现虚假服务系统通过同一数据类型的数据校验模块对同一数据类型的输入数据进行统一处理,无需针对每个输入数据进行单独处理,进而能够有效减 少校验代码冗余、提升校验代码的复用性以及可读性。
显然,本领域的技术人员应该明白,上述的本申请的各模块或各步骤可以用通用的计算装置来实现,它们可以集中在单个的计算装置上,或者分布在多个计算装置所组成的网络上,可选地,它们可以用计算装置可执行的计算机可读指令代码来实现,从而,可以将它们存储在存储装置中由计算装置来执行,并且在某些情况下,可以以不同于此处的顺序执行所示出或描述的步骤,或者将它们分别制作成各个集成电路模块,或者将它们中的多个模块或步骤制作成单个集成电路模块来实现。这样,本申请不限制于任何特定的硬件和软件结合。
以上所述仅为本申请的优选实施例而已,并不用于限制本申请,对于本领域的技术人员来说,本申请可以有各种更改和变化。凡在本申请的精神和原则之内,所作的任何修改、等同替换、改进等,均应包括在本申请的保护范围之内。
Claims (20)
- 一种数据校验方法,其特征在于,应用于虚假服务系统,包括:当接收到前端发送的输入数据时,根据预设规范文件调用数据类型解析模块解析所述输入数据的数据类型;根据所述预设规范文件调用与所述数据类型对应的数据校验模块,所述预设规范文件定义有不同数据类型,以及所述不同数据类型分别对应的数据校验模块;利用调用的数据校验模块对所述输入数据进行校验。
- 根据权利要求1所述的方法,其特征在于,所述根据所述预设规范文件调用与所述数据类型对应的数据校验模块,包括:从所述预设规范文件中查找与所述数据类型对应的数据校验模块标识,所述预设规范文件定义有不同数据类型,以及所述不同数据类型分别对应的数据校验模块标识;根据所述数据校验模块标识调用与所述数据类型对应的数据校验模块。
- 根据权利要求1所述的方法,其特征在于,所述根据所述预设规范文件调用与所述数据类型对应的数据校验模块,包括:获取所述前端的前端地址信息,并调用与所述前端地址信息对应的虚假服务接口;利用所述虚假服务接口根据预设规范文件调用与所述数据类型对应的数据校验模块,所述虚假服务接口为根据前端和后台预先约定的接口文档定义的。
- 根据权利要求1所述的方法,其特征在于,所述根据预设规范文件调用数据类型解析模块解析所述输入数据的数据类型,包括:根据预设规范文件调用数据类型解析模块查找与所述输入数据格式匹配的数据,将匹配数据的数据类型确定为所述输入数据的数据类型。
- 根据权利要求1所述的方法,其特征在于,所述利用调用的数据校验模块对所述输入数据进行校验,包括:若所述数据类型为空字符类型,则利用空字符类型的数据校验模块校验所述输入数据是否为空字符;或者若所述数据类型为布尔类型,则利用布尔类型的数据校验模块校验所述输入数据是否为真或者假;或者若所述数据类型为数字类型,则利用数字类型的数据校验模块校验所述输入数据是否为数字;或者若所述数据类型为字符串类型,则利用字符串类型的数据校验模块校验所述输入数据 是否为字符串;或者若所述数据类型为数组类型,则利用数组类型的数据校验模块校验所述输入数据是否为数组;或者若所述数据类型为对象类型,则利用对象类型的数据校验模块,校验所述输入数据是否为对象。
- 根据权利要求1所述的方法,其特征在于,所述利用调用的数据校验模块对所述输入数据进行校验之后,所述方法还包括:若所述输入数据校验成功,则利用所述调用的数据校验模块向所述前端反馈校验成功提示信息;若所述输入数据校验失败,则将所述输入数据及其对应的数据类型存储到校验数据失败信息存储模块。
- 根据权利要求1所述的方法,其特征在于,所述方法还包括:将所述不同数据类型,以及所述不同数据类型分别对应的数据校验模块定义到所述预设规范文件中;当接收到数据校验扩展指令时,获取所述数据校验扩展指令包含的新增的数据类型;将所述新增的数据类型及其对应的数据校验模块定义到所述预设规范文件中。
- 一种数据校验装置,其特征在于,包括:解析单元,用于当接收到前端发送的输入数据时,根据预设规范文件调用数据类型解析模块解析所述输入数据的数据类型;调用单元,用于根据所述预设规范文件调用与所述数据类型对应的数据校验模块,所述预设规范文件定义有不同数据类型,以及所述不同数据类型分别对应的数据校验模块;校验单元,用于利用调用的数据校验模块对所述输入数据进行校验。
- 根据权利要求8所述的装置,其特征在于,所述调用模块,具体用于从所述预设规范文件中查找与所述数据类型对应的数据校验模块标识,所述预设规范文件定义有不同数据类型,以及所述不同数据类型分别对应的数据校验模块标识;根据所述数据校验模块标识调用与所述数据类型对应的数据校验模块。
- 根据权利要求8所述的装置,其特征在于,所述调用模块,具体还用于获取所述前端的前端地址信息,并调用与所述前端地址信息对应的虚假服务接口;利用所述虚假服务接口根据预设规范文件调用与所述数据类型对应的数据校验模块,所述虚假服务接口为根据前端和后台预先约定的接口文档定义的。
- 根据权利要求8所述的装置,其特征在于,所述解析模块31,具体用于根据预设规范文件调用数据类型解析模块查找与所述输入数据格式匹配的数据,将匹配数据的数据类型确定为所述输入数据的数据类型。
- 根据权利要求8所述的装置,其特征在于,所述校验模块33,具体用于若所述数据类型为空字符类型,则利用空字符类型的数据校验模块校验所述输入数据是否为空字符;或者若所述数据类型为布尔类型,则利用布尔类型的数据校验模块校验所述输入数据是否为真或者假;或者若所述数据类型为数字类型,则利用数字类型的数据校验模块校验所述输入数据是否为数字;或者若所述数据类型为字符串类型,则利用字符串类型的数据校验模块校验所述输入数据是否为字符串;或者若所述数据类型为数组类型,则利用数组类型的数据校验模块校验所述输入数据是否为数组;或者若所述数据类型为对象类型,则利用对象类型的数据校验模块,校验所述输入数据是否为对象。
- 根据权利要求8所述的装置,其特征在于,所述装置还包括:反馈单元,用于若所述输入数据校验成功,则利用所述调用的数据校验模块向所述前端反馈校验成功提示信息;存储单元,用于若所述输入数据校验失败,则将所述输入数据及其对应的数据类型存储到校验数据失败信息存储模块。
- 根据权利要求8所述的装置,其特征在于,所述装置还包括:定义单元,用于将所述不同数据类型,以及所述不同数据类型分别对应的数据校验模块定义到所述预设规范文件中;获取单元,用于当接收到数据校验扩展指令时,获取所述数据校验扩展指令包含的新增的数据类型;所述定义单元,还用于将所述新增的数据类型及其对应的数据校验模块定义到所述预设规范文件中。
- 一种计算机非易失性可读存储介质,其上存储有计算机可读指令,其特征在于,所述计算机可读指令被处理器执行时实现数据校验方法,包括:当接收到前端发送的输入数据时,根据预设规范文件调用数据类型解析模块解析所述输入数据的数据类型;根据所述预设规范文件调用与所述数据类型对应的数据校验模块,所述预设规范文件定义有不同数据类型,以及所述不同数据类型分别对应的数据校验模块;利用调用的数据校验模块对所述输入数据进行校验。
- 根据权利要求15所述的计算机非易失性可读存储介质,其特征在于,所述计算 机可读指令被处理器执行时实现所述根据所述预设规范文件调用与所述数据类型对应的数据校验模块,包括:从所述预设规范文件中查找与所述数据类型对应的数据校验模块标识,所述预设规范文件定义有不同数据类型,以及所述不同数据类型分别对应的数据校验模块标识;根据所述数据校验模块标识调用与所述数据类型对应的数据校验模块。
- 根据权利要求15所述的计算机非易失性可读存储介质,其特征在于,所述计算机可读指令被处理器执行时实现所述根据所述预设规范文件调用与所述数据类型对应的数据校验模块,包括:获取所述前端的前端地址信息,并调用与所述前端地址信息对应的虚假服务接口;利用所述虚假服务接口根据预设规范文件调用与所述数据类型对应的数据校验模块,所述虚假服务接口为根据前端和后台预先约定的接口文档定义的。
- 一种计算机设备,包括存储器、处理器及存储在存储器上并可在处理器上运行的计算机可读指令,其特征在于,所述计算机可读指令被处理器执行时实现数据校验方法,包括:当接收到前端发送的输入数据时,根据预设规范文件调用数据类型解析模块解析所述输入数据的数据类型;根据所述预设规范文件调用与所述数据类型对应的数据校验模块,所述预设规范文件定义有不同数据类型,以及所述不同数据类型分别对应的数据校验模块;利用调用的数据校验模块对所述输入数据进行校验。
- 根据权利要求18所述的计算机设备,其特征在于,所述处理器执行所述计算机可读指令时实现所述根据所述预设规范文件调用与所述数据类型对应的数据校验模块,包括:从所述预设规范文件中查找与所述数据类型对应的数据校验模块标识,所述预设规范文件定义有不同数据类型,以及所述不同数据类型分别对应的数据校验模块标识;根据所述数据校验模块标识调用与所述数据类型对应的数据校验模块。
- 根据权利要求18所述的计算机设备,其特征在于,所述处理器执行所述计算机可读指令时实现所述根据所述预设规范文件调用与所述数据类型对应的数据校验模块,包括:获取所述前端的前端地址信息,并调用与所述前端地址信息对应的虚假服务接口;利用所述虚假服务接口根据预设规范文件调用与所述数据类型对应的数据校验模块,所述虚假服务接口为根据前端和后台预先约定的接口文档定义的。
Applications Claiming Priority (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201810730607.3A CN109165017A (zh) | 2018-07-05 | 2018-07-05 | 数据校验方法、装置及计算机存储介质 |
| CN201810730607.3 | 2018-07-05 |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| WO2020006929A1 true WO2020006929A1 (zh) | 2020-01-09 |
Family
ID=64897305
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| PCT/CN2018/111111 Ceased WO2020006929A1 (zh) | 2018-07-05 | 2018-10-20 | 数据校验方法、装置及计算机存储介质 |
Country Status (2)
| Country | Link |
|---|---|
| CN (1) | CN109165017A (zh) |
| WO (1) | WO2020006929A1 (zh) |
Cited By (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN116070716A (zh) * | 2023-02-07 | 2023-05-05 | 中国建设银行股份有限公司 | 模型校验的实现方法、装置及服务器 |
Families Citing this family (7)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN110109818A (zh) * | 2019-03-15 | 2019-08-09 | 平安城市建设科技(深圳)有限公司 | 后端接口数据的监测方法、装置、终端及可读存储介质 |
| CN110489326B (zh) * | 2019-07-09 | 2023-08-25 | 北京字节跳动网络技术有限公司 | 基于ids的httpapi调试方法装置、介质和设备 |
| CN112395266B (zh) * | 2019-08-19 | 2022-12-13 | 中移(苏州)软件技术有限公司 | 一种数据文件处理方法、第一服务器及计算机存储介质 |
| CN113126955B (zh) * | 2019-12-30 | 2025-04-11 | 深圳市华胜软件技术有限公司 | 一种随机数据生成方法、装置、智能终端及存储介质 |
| CN111427566B (zh) * | 2020-03-18 | 2024-05-07 | 北京达佳互联信息技术有限公司 | 适于模拟接口平台的数据处理方法和装置、服务器 |
| CN112182562B (zh) * | 2020-10-19 | 2026-02-13 | 平安银行股份有限公司 | 沙箱环境下的数据审核方法、系统、电子设备及介质 |
| CN116483377B (zh) * | 2023-06-15 | 2024-03-01 | 太平金融科技服务(上海)有限公司深圳分公司 | 一种代码检测方法、装置、电子设备及存储介质 |
Citations (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN103605512A (zh) * | 2013-11-05 | 2014-02-26 | 广东电网公司电力科学研究院 | 一种基于GTechnology平台的数据校验系统及方法 |
| CN105930409A (zh) * | 2016-04-18 | 2016-09-07 | 深圳市永兴元科技有限公司 | 基于动态生成规则的数据校验方法及装置 |
| CN107329849A (zh) * | 2017-07-06 | 2017-11-07 | 北京理工大学 | 一种基于Java系统的数据校验方法及系统 |
| CN107347048A (zh) * | 2016-05-04 | 2017-11-14 | 北京京东尚科信息技术有限公司 | 数据校验的方法、装置及系统 |
| CN108108256A (zh) * | 2017-12-15 | 2018-06-01 | 农信银资金清算中心有限责任公司 | 一种数据正确性校验方法及装置 |
Family Cites Families (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US9336184B2 (en) * | 2010-12-17 | 2016-05-10 | Microsoft Technology Licensing, Llc | Representation of an interactive document as a graph of entities |
| CN103049431B (zh) * | 2013-01-14 | 2015-04-01 | 山东电力集团公司 | 基于模型对象化语义的icd检验方法 |
-
2018
- 2018-07-05 CN CN201810730607.3A patent/CN109165017A/zh active Pending
- 2018-10-20 WO PCT/CN2018/111111 patent/WO2020006929A1/zh not_active Ceased
Patent Citations (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN103605512A (zh) * | 2013-11-05 | 2014-02-26 | 广东电网公司电力科学研究院 | 一种基于GTechnology平台的数据校验系统及方法 |
| CN105930409A (zh) * | 2016-04-18 | 2016-09-07 | 深圳市永兴元科技有限公司 | 基于动态生成规则的数据校验方法及装置 |
| CN107347048A (zh) * | 2016-05-04 | 2017-11-14 | 北京京东尚科信息技术有限公司 | 数据校验的方法、装置及系统 |
| CN107329849A (zh) * | 2017-07-06 | 2017-11-07 | 北京理工大学 | 一种基于Java系统的数据校验方法及系统 |
| CN108108256A (zh) * | 2017-12-15 | 2018-06-01 | 农信银资金清算中心有限责任公司 | 一种数据正确性校验方法及装置 |
Cited By (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN116070716A (zh) * | 2023-02-07 | 2023-05-05 | 中国建设银行股份有限公司 | 模型校验的实现方法、装置及服务器 |
Also Published As
| Publication number | Publication date |
|---|---|
| CN109165017A (zh) | 2019-01-08 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| WO2020006929A1 (zh) | 数据校验方法、装置及计算机存储介质 | |
| CN107861713B (zh) | 数据调用方法、装置及计算机可读存储介质 | |
| WO2021249356A1 (zh) | 表单数据校验方法、系统、服务器和用户终端 | |
| CN109726108B (zh) | 基于模拟数据的前端代码测试方法、装置、系统和介质 | |
| CN110716783A (zh) | 一种前端页面生成、部署方法及装置、存储介质和设备 | |
| CN110471842A (zh) | 一种测试方法、装置及计算机可读存储介质 | |
| CN110351325B (zh) | 一种数据处理方法及相关设备 | |
| WO2019154353A1 (zh) | 系统运行参数查询方法、匹配方法、装置及节点设备 | |
| JP2010501914A (ja) | 携帯デバイスのための電子メールフォームエンジン | |
| CN110532107A (zh) | 接口调用方法、装置、计算机设备及存储介质 | |
| CN112395138B (zh) | 一种校验参数的方法和装置 | |
| CN110084567B (zh) | 电子印章使用方法、装置、设备及计算机可读存储介质 | |
| CN114528044B (zh) | 一种接口调用方法、装置、设备及介质 | |
| CN114500630A (zh) | 消息推送的方法、装置、系统、存储介质和电子设备 | |
| WO2019161620A1 (zh) | 应用依赖关系更新方法、终端、设备及存储介质 | |
| CN108073429A (zh) | 一种支付方式配置方法、装置、设备及存储介质 | |
| US12602255B2 (en) | Transaction method and apparatus with fixed execution order | |
| CN114371866A (zh) | 业务系统的版本重构测试方法、装置和设备 | |
| CN114610598A (zh) | 测试方法、装置、电子设备及计算机可读存储介质 | |
| WO2020006930A1 (zh) | 数据伪造方法、装置及计算机存储介质 | |
| EP3828739B1 (en) | Parallelization of authentication strategies | |
| CN112395194B (zh) | 一种接入测试平台的方法和装置 | |
| US10529327B1 (en) | System and method for enabling voice recognition for operating system | |
| CN107203714B (zh) | 数据校验文件的配置方法和装置 | |
| CN114021535A (zh) | 数据处理方法及数据处理装置 |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| 121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 18925141 Country of ref document: EP Kind code of ref document: A1 |
|
| NENP | Non-entry into the national phase |
Ref country code: DE |
|
| 122 | Ep: pct application non-entry in european phase |
Ref document number: 18925141 Country of ref document: EP Kind code of ref document: A1 |

