CN115248939A - Data verification method, device, equipment and storage medium - Google Patents
Data verification method, device, equipment and storage medium Download PDFInfo
- Publication number
- CN115248939A CN115248939A CN202110454365.1A CN202110454365A CN115248939A CN 115248939 A CN115248939 A CN 115248939A CN 202110454365 A CN202110454365 A CN 202110454365A CN 115248939 A CN115248939 A CN 115248939A
- Authority
- CN
- China
- Prior art keywords
- verification
- data
- data verification
- request
- service entity
- 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
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F21/00—Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
- G06F21/60—Protecting data
- G06F21/64—Protecting data integrity, e.g. using checksums, certificates or signatures
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/28—Databases characterised by their database models, e.g. relational or object models
- G06F16/284—Relational databases
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Databases & Information Systems (AREA)
- Physics & Mathematics (AREA)
- Computer Security & Cryptography (AREA)
- General Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- Bioethics (AREA)
- Software Systems (AREA)
- Computer Hardware Design (AREA)
- General Health & Medical Sciences (AREA)
- Health & Medical Sciences (AREA)
- Data Mining & Analysis (AREA)
- Storage Device Security (AREA)
Abstract
The application discloses a data verification method, a data verification device, data verification equipment and a storage medium, and relates to the technical field of data processing. The method comprises the following steps: receiving input configuration data; sending a first data verification request to a verification service entity, wherein the first data verification request is used for requesting data verification on the configuration data, and the verification service entity is a service entity shared by the terminal and the server and used for providing verification service; and writing the configuration data into a database in response to receiving a verification success result sent by the verification service entity. The method can reduce the cost of developing the data verification function by the front end and the back end.
Description
Technical Field
The present application relates to the field of data processing technologies, and in particular, to a data verification method, apparatus, device, and storage medium.
Background
In the process of program development and operation, a developer or an operator writes configuration data in a program, in order to ensure the correctness of the configuration data, a terminal checks the correctness of the configuration data after receiving the configuration data, writes the configuration data into a server after the check is successful, and the server checks the correctness of the data again after receiving the configuration data, thereby determining whether to apply the configuration data.
In the related art, for a front-end program running on a terminal and a back-end program running on a server, developers at the front end and the back end respectively develop respective check codes for the front end and the back end according to check logics of data, so as to respectively complete data check on the terminal and the server.
In the method in the related art, a developer needs to respectively develop the check codes of the front end and the back end based on the same check logic, and the development cost is high.
Disclosure of Invention
The embodiment of the application provides a data verification method, a data verification device, data verification equipment and a storage medium, and development cost of a front-end development data verification function and a back-end development data verification function can be reduced. The technical scheme is as follows.
According to an aspect of the present application, there is provided a data verification method applied to a terminal, the method including:
receiving input configuration data;
sending a first data verification request to a verification service entity, wherein the first data verification request is used for requesting data verification on the configuration data, and the verification service entity is a service entity shared by the terminal and the server and used for providing verification service;
and writing the configuration data into a database in response to receiving a verification success result sent by the verification service entity.
According to another aspect of the present application, there is provided a data verification method applied to a server, the method including:
reading configuration data from a database;
sending a second data verification request to a verification service entity, wherein the second data verification request is used for requesting data verification on the configuration data, and the verification service entity is a service entity shared by the terminal and the server and used for providing verification service;
and applying the configuration data in response to receiving a verification success result sent by the verification service entity.
According to another aspect of the present application, there is provided a data verification method applied to a verification service entity, where the verification service entity is a service entity shared by a terminal and a server and used for providing a verification service, the method including:
receiving a data verification request, wherein the data verification request comprises configuration data, and the data verification request is used for requesting data verification on the configuration data, and the data verification request is a first data verification request sent by a terminal, or the data verification request is a second data verification request sent by a server;
calling a data verification program to perform data verification on the configuration data to obtain a verification result;
and returning the verification result to a requester of the data verification request, wherein the requester is the terminal or the server.
According to another aspect of the present application, there is provided a data verification apparatus applied to a terminal, the apparatus including:
the input module is used for receiving input configuration data;
a first sending module, configured to send a first data verification request to a verification service entity, where the first data verification request is used to request data verification on the configuration data, and the verification service entity is a service entity shared by the terminal and the server and configured to provide a verification service;
a first receiving module, configured to receive a successful verification result sent by the verification service entity;
and the writing module is used for writing the configuration data into a database in response to receiving a verification success result sent by the verification service entity.
In an optional embodiment, the verification service entity stores at least two data verification programs, where the at least two data verification programs are used to perform data verification on different configuration data by using different verification rules;
the first sending module is configured to send the first data verification request to the verification service entity through a first data verification interface, where the first data verification interface is configured to request to invoke a first data verification program corresponding to the configuration data in the at least two data verification programs to perform data verification.
In an optional embodiment, the apparatus further comprises:
the configuration module is used for configuring interface attributes corresponding to the configuration data, wherein the interface attributes comprise at least one of a service name, an interface identifier and an interface enabling state of the first data verification interface;
the writing module is configured to write the interface attribute corresponding to the configuration data into the database;
the first sending module is configured to send the first data verification request to the verification service entity through the first data verification interface according to the interface attribute corresponding to the configuration data, where the first data verification interface is configured to request to invoke a first data verification program corresponding to the configuration data in the at least two data verification programs for data verification.
In an optional embodiment, the data verification includes: at least one of data length check, data normalization check, multi-field linkage check and service rule check.
In an alternative embodiment, the data check includes the multi-field linkage check;
and the successful verification result is sent to the terminal by the verification service entity in response to that the first field in the configuration data meets the first requirement and the second field in the configuration data meets the second requirement.
According to another aspect of the present application, there is provided a data verification apparatus applied to a server, the apparatus including:
the reading module is used for reading the configuration data from the database;
a second sending module, configured to send a second data verification request to a verification service entity, where the second data verification request is used to request data verification on the configuration data, and the verification service entity is a service entity shared by the terminal and the server and used to provide a verification service;
the second receiving module is used for receiving a verification success result sent by the verification service entity;
and the service module is used for responding to the received verification success result sent by the verification service entity and applying the configuration data.
In an optional embodiment, the verification service entity stores at least two data verification programs, where the at least two data verification programs are used to perform data verification on different configuration data by using different verification rules;
the second sending module is configured to send the second data verification request to the verification service entity through a first data verification interface, where the second data verification request includes the configuration data, and the first data verification interface is configured to request to invoke a first data verification program corresponding to the configuration data in the at least two data verification programs to perform data verification.
In an optional embodiment, the reading module is configured to read an interface attribute corresponding to the configuration data from the database, where the interface attribute includes at least one of a service name, an interface identifier, and an interface enabling state of the first data verification interface, and the interface attribute corresponding to the configuration data is configured by the terminal and written into the database;
the second sending module is configured to send the second data verification request to the verification service entity through the first data verification interface according to the interface attribute, where the second data verification request includes the configuration data, and the first data verification interface is configured to request to invoke a first data verification program corresponding to the configuration data in the at least two data verification programs to perform data verification.
In an optional embodiment, the data verification includes: at least one of data length check, data normalization check, multi-field linkage check and business rule check.
In an alternative embodiment, the data check includes the multi-field linkage check;
and the verification success result is sent to the server by the verification service entity in response to that the first field in the configuration data meets the first requirement and the second field in the configuration data meets the second requirement.
According to another aspect of the present application, there is provided a data verification apparatus, applied to a verification service entity, where the verification service entity is a service entity shared by a terminal and a server and used for providing a verification service, the apparatus including:
a third receiving module, configured to receive a data verification request, where the data verification request includes configuration data, and the data verification request is used to request data verification on the configuration data, where the data verification request is a first data verification request sent by a terminal, or the data verification request is a second data verification request sent by a server;
the verification module is used for calling a data verification program to carry out data verification on the configuration data to obtain a verification result;
and the third sending module is used for returning the verification result to a requester of the data verification request, wherein the requester is the terminal or the server.
In an optional embodiment, the verification service entity stores at least two data verification programs, where the at least two data verification programs are used to perform data verification on different configuration data by using different verification rules;
the third receiving module is configured to receive the data verification request through a first data verification interface, where the data verification request includes the configuration data, and the first data verification interface is configured to request to invoke a first data verification program corresponding to the configuration data in the at least two data verification programs to perform data verification;
the verification module is used for calling the first data verification program corresponding to the first data verification interface to perform data verification on the configuration data to obtain the verification result.
In an optional embodiment, the data verification includes: at least one of data length check, data normalization check, multi-field linkage check and business rule check.
In an optional embodiment, the verification module is configured to obtain the verification result in response to that a first field in the configuration data meets a first requirement and a second field in the configuration data meets a second requirement, where the verification result is a verification success result.
According to another aspect of the present application, there is provided a computer device comprising: a processor and a memory having stored therein at least one instruction, at least one program, set of codes, or set of instructions, which is loaded and executed by the processor to implement a data verification method as described above.
According to another aspect of the present application, there is provided a computer readable storage medium having stored therein at least one instruction, at least one program, code set or instruction set, which is loaded and executed by a processor to implement a data verification method as described above.
According to another aspect of an embodiment of the present disclosure, there is provided a computer program product or a computer program comprising computer instructions stored in a computer readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and executes the computer instructions, so that the computer device executes the data verification method provided in the above-mentioned alternative implementation mode.
The beneficial effects brought by the technical scheme provided by the embodiment of the application at least comprise:
the verification service entity is configured to provide verification service for the terminal and the server, and the terminal and the server can share the verification service entity to complete verification of the configuration data. When data verification is needed, the terminal or the server sends a data verification request to the verification service entity, the configuration data needing verification is sent to the verification service entity, the verification service entity calls a verification program to complete data verification, and a verification result is returned to the terminal or the server. Therefore, a developer only needs to develop a data verification program on the verification service entity, the data verification program does not need to be separately developed for the terminal and the server, the development cost of realizing the data verification function of the terminal and the server is reduced, and when the verification logic is changed, the developer only needs to modify the data verification program on the verification service entity, a front-end program on the terminal and a back-end program on the server do not need to be modified respectively, and the maintenance cost of the data verification program is reduced.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
FIG. 1 is a block diagram of a computer system provided in an exemplary embodiment of the present application;
FIG. 2 is a block diagram of a computer system provided in another exemplary embodiment of the present application;
FIG. 3 is a schematic diagram of a data verification method provided by another exemplary embodiment of the present application;
FIG. 4 is a flowchart of a method of data verification as provided by another exemplary embodiment of the present application;
FIG. 5 is a flowchart of a method of data verification as provided by another exemplary embodiment of the present application;
FIG. 6 is a front end page schematic diagram of a data verification method provided by another exemplary embodiment of the present application;
FIG. 7 is a front end page schematic diagram of a data verification method provided by another exemplary embodiment of the present application;
FIG. 8 is a schematic front-end page view of a data verification method provided in another example embodiment of the present application;
FIG. 9 is a flowchart of a method of a data verification method provided by another exemplary embodiment of the present application;
FIG. 10 is a block diagram of a data verification device provided in another exemplary embodiment of the present application;
FIG. 11 is a block diagram of a data verification device as provided by another exemplary embodiment of the present application;
FIG. 12 is a block diagram of a data verification device provided in another exemplary embodiment of the present application;
FIG. 13 is a block diagram of a server provided in another exemplary embodiment of the present application;
fig. 14 is a block diagram of a terminal provided in another exemplary embodiment of the present application.
Detailed Description
To make the objects, technical solutions and advantages of the present application more clear, embodiments of the present application will be described in further detail below with reference to the accompanying drawings.
FIG. 1 is a schematic diagram illustrating a computer system 101 provided in an exemplary embodiment of the present application, the computer system 101 including: a terminal 102, a server 103 and a verification service entity 104.
The terminal 102 may include at least one of a smartphone, a laptop, a desktop, a tablet, a smart speaker, and a smart robot. In an alternative implementation manner, the terminal 102 runs a front-end program of an application program, which can execute the data verification method provided by the present application, and the application program may be any type of application program, such as a life service application program, a social contact application program, a shopping application program, a forum application program, an information application program, an office application program, a game application program, a payment application program, an audio/video application program, and the like. In the development, operation or application process of the application program, the configuration data received by the front-end program in any scene may be subjected to data verification by using the data verification method provided by the present application. For example, in the development process of an application program, when a developer configures related data for a front-end program, the data verification method provided by the application can be adopted to perform data verification on the configured data; in the operation process of the application program, when an operator sets related data for the front-end program, the data verification method provided by the application can be adopted to carry out data verification on the set data; in the application process of the application program, when a user inputs data on the front-end program, the data verification method provided by the application can be adopted to carry out data verification on the input data.
Illustratively, the terminal 102 stores a first program code, and when the client needs to perform data verification, the client may call the first program code to send a data verification request to the verification service entity 104, so as to complete data verification through the verification service provided by the verification service entity 104.
The terminal 102 and the server 103 are connected to each other through a wired or wireless network.
The terminal 102 includes a first memory and a first processor. The first memory stores a first program code; the first program code is called and executed by the first processor to implement the data verification method provided by the application. The first memory may include, but is not limited to, the following: random Access Memory (RAM), read Only Memory (ROM), programmable Read-Only Memory (PROM), erasable Read-Only Memory (EPROM), and electrically Erasable Read-Only Memory (EEPROM).
The first processor may be comprised of one or more integrated circuit chips. Alternatively, the first Processor may be a general purpose Processor, such as a Central Processing Unit (CPU) or a Network Processor (NP). Alternatively, the first processor may implement the data verification method provided by the present application through a running program or code.
The server 103 includes at least one of a server 103, a plurality of servers 103, a cloud computing platform, and a virtualization center. The server 103 is used to run the backend program of the application. Optionally, the server 103 undertakes primary computational work and the terminal 102 undertakes secondary computational work; or, the server 103 undertakes the secondary computing work, and the terminal 102 undertakes the primary computing work; or, the server 103 and the terminal 102 adopt a distributed computing architecture to perform collaborative computing.
The server 103 includes a second memory and a second processor. The second memory stores a second program code; the second program code is called by the second processor to implement the data checking method provided by the application. Optionally, the second memory may include, but is not limited to, the following: RAM, ROM, PROM, EPROM, EEPROM. Alternatively, the second processor may be a general purpose processor, such as a CPU or NP.
The verification service entity 104 stores at least one data verification program thereon, and the verification server entity 104 is configured to run the data verification program and provide a verification service. Each data verification program corresponds to one data verification interface, and the terminal 102 or the server 103 calls the corresponding data verification program to complete data verification on the configuration data by calling the data verification interface. For example, the data verification program may also be referred to as a data verification plug-in, that is, at least one data verification plug-in is provided on the verification service entity, and the terminal or the server invokes, through invoking the data invocation interface, the corresponding data verification plug-in on the verification service entity to complete data verification on the configuration data.
Illustratively, the verification service entity 104 may be the server 103 (business server) described above, and may be implemented separately as a verification server.
In an alternative implementation, as shown in FIG. 2, computer system 101 includes: a terminal 102, a service server 105, a verification server 106 and a database 107.
The terminal 102 receives the input configuration data, and sends a first data verification request of the configuration data to the verification server 106 through the first data verification interface. The verification server 106 receives the first data verification request, calls a first data verification program (first data verification plug-in) corresponding to the first data verification interface to perform data verification on the configuration data, obtains a verification result, and sends the verification result to the terminal 102. The terminal 102 writes the configuration data into the database 107 in response to the verification result being a verification success result.
The service server 105 reads the configuration data from the database 107, and sends a second data verification request of the configuration data to the verification server 106 through the first data verification interface. The verification server 106 receives the second data verification request, calls a first data verification program (first data verification plug-in) corresponding to the first data verification interface to perform data verification on the configuration data, obtains a verification result, and sends the verification result to the service server 105. The service server 105, in response to the verification result being a successful verification result, applies the configuration data to run the back-end service program.
The database 107 may be configured in the service server 105, or may be independent from the service server 105. That is, in an alternative implementation manner, the server (i.e., the server 103 in fig. 1) in the embodiment of the present application includes: a business server 105, a database 107 and a verification server 106 (verification service entity). In another alternative implementation manner, the server in the embodiment of the present application includes the following components in fig. 2: a business server 105 and a database 107. In another alternative implementation manner, the server in the embodiment of the present application includes the following components in fig. 2: a traffic server 105 and a verification server 106 (verification service entity). In another alternative implementation manner, the server in the embodiment of the present application includes the following components in fig. 2: the service server 105.
Based on the computer system shown in fig. 2, as shown in fig. 3, a front-end program 1101 runs on the terminal, a back-end program 1102 runs on the service server, the database is a KV library 1103, a plurality of data verification interfaces are provided on the verification server 106, and each data verification interface is used for correspondingly calling one data verification plug-in.
The front-end program 1101 receives input configuration data, sends a first data verification request to the verification server 106 through the first data verification interface 1105 indicated by the interface attribute corresponding to the configuration data, and the verification server 106 calls the first data verification plug-in 1105 corresponding to the first data verification interface 1105 to verify the configuration data carried in the first data verification request, so as to obtain a verification result, and returns the verification result to the front-end program 1101. The front-end program 1101 writes the configuration data into the KV bank 1103 in response to the verification result being a verification success result.
The backend program 1102 reads the configuration data and the interface attribute corresponding to the configuration data from the KV library 1103, sends a second data verification request to the verification server 106 through the first data verification interface 1105 indicated by the interface attribute corresponding to the configuration data, and the verification server 106 calls the first data verification plug-in 1105 corresponding to the first data verification interface 1105 to verify the configuration data carried in the second data verification request, to obtain a verification result, and returns the verification result to the backend program 1102. The back-end program 1102 applies the configuration data in response to the verification result being a verification success result.
Fig. 4 is a flowchart illustrating a data verification method according to an exemplary embodiment of the present application. The method may be performed by a computer device, for example, a computer system as shown in fig. 1 or fig. 2. The method comprises the following steps.
In step 210, the terminal receives the input configuration data.
The configuration data is data input in a front-end program run by the terminal. For example, data entered in a page of the front-end program. Illustratively, the configuration data may be data of one field, or may include data of a plurality of fields.
For example, the configuration data may be a username (a field), and the method provided by this embodiment is used to check whether the entered username complies with the username rules. For another example, the configuration data may be a user name and an account id (two fields), and the method of this embodiment is used to check whether the user name and the account id conform to the corresponding data rules.
For example, the steps performed by the terminal in this embodiment are performed by a front-end program running on the terminal.
Step 220, the terminal sends a first data verification request to a verification service entity, where the first data verification request is used to request data verification for the configuration data, and the verification service entity is a service entity shared by the terminal and the server and used to provide verification service.
Illustratively, the verification service entity may be a verification server, or may be a module providing the verification service on the service server. The verification service entity is used for providing verification service for the terminal and/or the server, receiving a data verification request sent by the terminal and/or the server, calling a corresponding data verification program (data verification plug-in) according to the data verification interface to verify configuration data carried in the data verification request to obtain a verification result, and returning the verification result to the terminal and/or the server.
The first data verification request includes configuration data. The first data verification request is sent by the terminal to the verification server through the data verification interface.
Step 230, the verification service entity receives a data verification request, where the data verification request includes configuration data, the data verification request is used to request data verification on the configuration data, and the data verification request is a first data verification request sent by the terminal; and calling a data verification program to perform data verification on the configuration data to obtain a verification result.
Illustratively, the verification result includes one of a verification success result and a verification failure result. The verification success result shows that the configuration data successfully passes the data verification and accords with the corresponding data rule. And the verification failure result indicates that the configuration data does not pass the data verification and does not conform to the corresponding data rule.
And 240, checking the checking result sent by the service entity to the terminal.
And the verification service entity returns a verification result to a requester of the data verification request, wherein the requester is a terminal.
In step 250, the terminal writes the configuration data into the database in response to receiving the successful verification result sent by the verification service entity.
And when the verification result received by the terminal is a successful verification result, the terminal writes the configuration data into the database.
And when the verification result received by the terminal is a verification failure result, the terminal fails to write the configuration data. Illustratively, the terminal displays prompt information of data verification failure in response to receiving a verification failure result sent by the verification service entity.
The database is a database arranged in the server, or the database is a database independent from the server. The database is used for storing configuration data.
In an alternative implementation, the terminal also has a local database therein. And the terminal writes the configuration data into the local database in response to receiving a verification success result sent by the verification service entity. And responding to that the configuration data in the local database passes the manual verification, and writing the configuration data into the database.
The server reads the configuration data from the database, step 260.
Illustratively, the server needs to check the configuration data again when reading the configuration data.
Step 270, the server sends a second data verification request to the verification service entity, where the second data verification request is used to request data verification for the configuration data, and the verification service entity is a service entity shared by the terminal and the server and used to provide a verification service.
The second data check request includes configuration data. The second data verification request is sent by the server to the verification server through the data verification interface.
Illustratively, the terminal and the server send a data verification request to the verification server through the same data verification interface, and request to call the same data verification program (data verification plug-in) to perform data verification on the configuration data.
Step 280, the verification service entity receives a data verification request, the data verification request includes configuration data, the data verification request is used for requesting data verification on the configuration data, and the data verification request is a second data verification request sent by the server; and calling a data verification program to perform data verification on the configuration data to obtain a verification result.
Step 290, the service entity checks the checking result sent to the server.
And the verification service entity returns a verification result to a requester of the data verification request, wherein the requester is a server.
Step 300, the verification service entity applies the configuration data in response to receiving the verification success result sent by the verification service entity.
In summary, in the method provided in this embodiment, the verification service entity is configured, and the verification service entity provides the verification service for the terminal and the server, so that the terminal and the server can share the verification service entity to complete verification of the configuration data. When data verification is needed, the terminal or the server sends a data verification request to the verification service entity, the configuration data needing verification is sent to the verification service entity, the verification service entity calls a verification program to complete data verification, and a verification result is returned to the terminal or the server. Therefore, a developer only needs to develop a data verification program on the verification service entity, and does not need to separately develop the data verification program for the terminal and the server, so that the development cost of realizing the data verification function of the terminal and the server is reduced, and when the verification logic is changed, the developer only needs to modify the data verification program on the verification service entity, does not need to respectively modify a front-end program on the terminal and a back-end program on the server, and reduces the maintenance cost of the data verification program.
Exemplarily, the verification service entity stores at least two data verification programs, and the at least two data verification programs are used for performing data verification on different configuration data by adopting different verification rules; the terminal can also correspondingly configure different data verification programs for different configuration data.
Fig. 5 is a flowchart illustrating a data verification method according to an exemplary embodiment of the present application. The method may be performed by a computer device, for example, a computer system as shown in fig. 1 or fig. 2. Based on the exemplary embodiment shown in fig. 4, step 210 further includes step 201 to step 202, step 220 further includes step 221, step 230 further includes step 231, step 260 further includes step 261, step 270 further includes step 271, and step 280 further includes step 281.
Step 201, the terminal configures an interface attribute corresponding to the configuration data, where the interface attribute includes at least one of a service name, an interface identifier, and an interface enabling state of the first data verification interface.
For example, a user may configure a corresponding data verification interface for each configuration data through a front-end page, that is, edit an interface attribute of the data verification interface on a configuration page of the configuration data, to establish a corresponding relationship between the configuration data and the data verification interface.
Illustratively, the interface attributes of the data verification interface include: the chinese name, english name and related data of the data verification program (data verification plug-in), for example, the interface attributes of the data verification interface include: the service name, interface name, cmd, magicid of the data verification program called by the data verification interface and whether the data verification program (data verification plug-in) is enabled.
For example, as shown in fig. 6, a development page 1001 of configuration data is opened through a configuration service on a front-end page, a plug-in list (data check program list) 1002 can be seen, and a chinese name, an english name and related data of the plug-in (data check program) are defined, so that the plug-ins can be conveniently closed and enabled.
As shown in fig. 7, when configuring a plug-in for configuration data, an interface attribute 1004 (for example, a service name, a cmd, and a magic) of a data verification interface is edited in a configuration page 1003, so that a corresponding relationship between the configuration data and the data verification interface may be established, and a front end may request a verification service provided by a verification service entity through an RPC (Remote Procedure Call) interface.
Optionally, according to the service requirement, the data verification program can be arbitrarily increased or decreased on the verification server entity, and the user can also arbitrarily change the data verification program corresponding to each configuration data through the front-end program, so as to meet various verification requirements for the configuration data at different time periods.
Optionally, the terminal may further configure interface attributes of at least two data verification programs (data verification interfaces) for one configuration data, so that the terminal sends a data verification request for the configuration data to the at least two data verification interfaces, thereby completing data verification for the one configuration data by using at least two data verification logics. Therefore, for configuration data which needs to be verified by using complex data verification logic, data verification can be completed by calling a plurality of data verification interfaces.
For example, when configuration data needs to complete data verification through multiple data verification interfaces, a terminal may simultaneously send multiple data verification requests for the configuration data to the multiple data verification interfaces, where one data verification interface corresponds to one data verification request, then receive multiple verification results, and when all the multiple verification results are verification success results, the terminal determines that the configuration data is verified successfully.
For example, the terminal may also send a first data verification request for the configuration data to the first data verification interface first, send a second data verification request for the configuration data to the second data verification interface in response to receiving a first verification success result returned for the first data verification request, and determine that the configuration data is verified successfully in response to receiving a second verification success result returned for the second data verification request, or continue to send a third data verification request for the configuration data to the third data verification interface.
Step 202, the terminal writes the interface attribute corresponding to the configuration data into a database.
After the user edits the interface attribute corresponding to the configuration data on the front-end program, the terminal writes the interface attribute corresponding to the configuration data into the database for storage, so that the server reads the interface attribute from the database, and initiates a data verification request of the configuration data through a data verification interface indicated by the interface attribute.
Illustratively, the terminal also writes the interface attribute corresponding to the configuration data into the local database.
In step 210, the terminal receives input configuration data.
For example, as shown in fig. 8, on an edit page 1005 of the configuration data, the user can edit the configuration data 1006, and after the editing is completed, the terminal calls a verification service through the data verification interface to verify the correctness of the configuration data input by the user.
Step 221, the terminal sends a first data verification request to the verification service entity through the first data verification interface, where the first data verification request includes the configuration data, and the first data verification interface is used to request to invoke a first data verification program corresponding to the configuration data in at least two data verification programs for data verification.
Illustratively, the terminal sends a first data verification request to the verification service entity through a first data verification interface according to an interface attribute corresponding to the configuration data, the first data verification request includes the configuration data, and the first data verification interface is configured to request to invoke a first data verification program corresponding to the configuration data among at least two data verification programs for data verification.
Illustratively, the terminal reads an interface attribute corresponding to the configuration data from a local, and sends a first data verification request of the configuration data to the verification service entity through the first data verification interface according to the first data verification interface indicated by the interface attribute.
Illustratively, the verification service entity has stored thereon a plurality of data verification programs (data verification plug-ins). Each data verification program corresponds to one data verification interface, and the terminal or the server sends a data verification request to the verification service entity through the data verification interface so as to request to call the data verification program corresponding to the data verification interface to perform data verification on the configuration data.
For example, the data verification logic of different data verification programs is different, different configuration data may be configured to perform data verification using different data verification programs, and different configuration data may also be configured to perform data verification using the same data verification program.
It should be understood that, for the same configuration data, the terminal and the server are verified by using the same data verification program, that is, for the same configuration data, the terminal and the server invoke the same data verification interface to send a data verification request. After a user configures a data verification interface adopted by configuration data through a front end, an interface attribute of the data verification interface corresponding to the configuration data is stored in a database, a server reads the configuration data and the interface attribute corresponding to the configuration data at the same time, and sends a data verification request to a verification service entity through the data verification interface corresponding to the interface attribute, so that the terminal and the server complete data verification on the same configuration data by adopting the same data verification program.
Illustratively, the terminal packages the configuration data into json format and sends the json format to the verification service entity through the first data verification interface. The verification service entity converts the json format configuration data into proto protocol data, and calls a data verification program (data verification plug-in) corresponding to the first data verification interface to perform data verification.
231, the verification service entity receives a data verification request through a first data verification interface, where the data verification request includes configuration data, and the first data verification interface is used to request to invoke a first data verification program corresponding to the configuration data in at least two data verification programs for data verification; and calling a first data verification program corresponding to the first data verification interface to perform data verification on the configuration data to obtain a verification result.
Illustratively, the data verification includes: at least one of data length check, data normalization check, multi-field linkage check and business rule check.
The data length check refers to checking the data length of each field in the configuration data, for example, the data length of a certain field is required to be not more than 1bit.
The data normalization check is to check whether the basic format of the configuration data meets the requirement. For example, the data normative check includes checking whether the data type, the character type and the data format meet the requirements.
The multi-field linkage check means that check rules among a plurality of fields in the configuration data have relevance, for example, when a first field meets a first requirement, a second field needs to meet a second requirement, when the first field meets a third requirement, the second field needs to meet a fourth requirement, and the like.
The service rule verification means that the configuration data needs to meet a verification rule set according to the service rule. For example, the business rule check may check whether the configuration data is within a specified value range, whether the configuration data is one of three preset texts, and the like.
For example, when the data verification includes multi-field linkage verification, the verification service entity obtains a verification result in response to that a first field in the configuration data meets a first requirement and a second field in the configuration data meets a second requirement, and the verification result is a verification success result.
That is, the successful verification result is sent to the terminal and/or the server by the verification service entity in response to that the first field in the configuration data meets the first requirement and the second field in the configuration data meets the second requirement.
For example, a first field in the configuration data may be gender and a second field may be age. The first requirement may be "woman" and the second requirement may be "27-30". Alternatively, the first requirement may be "male" and the second requirement may be "31-50". That is, when the sex input by the user is female, the input age must be in the range of 27-30, and when the sex input is "male", the input age must be in the range of "31-50".
And 240, checking the checking result sent by the service entity to the terminal.
Illustratively, if the check is successful, the check service entity returns 0, and if the check is failed, returns non-0.
In step 250, the terminal writes the configuration data into the database in response to receiving the successful verification result sent by the verification service entity.
In step 261, the server reads the configuration data and the interface attribute corresponding to the configuration data from the database, where the interface attribute includes at least one of a service name, an interface identifier, and an interface activation state of the first data verification interface, and the interface attribute corresponding to the configuration data is configured by the terminal and written into the database.
Illustratively, the server reads the interface attribute corresponding to the configuration data from the database. And determining a first data verification interface corresponding to the configuration data according to the interface attribute.
Step 271, the server sends a second data verification request to the verification service entity through the first data verification interface, where the second data verification request includes the configuration data, and the first data verification interface is used to request to invoke a first data verification program corresponding to the configuration data in the at least two data verification programs to perform data verification.
Illustratively, the server sends a second data verification request to the verification service entity through the first data verification interface according to the interface attribute, the second data verification request includes configuration data, and the first data verification interface is configured to request to invoke a first data verification program corresponding to the configuration data in the at least two data verification programs to perform data verification.
Step 281, the verification service entity receives a data verification request through a first data verification interface, where the data verification request includes configuration data, and the first data verification interface is used to request to call a first data verification program corresponding to the configuration data in at least two data verification programs for data verification; and calling a first data verification program corresponding to the first data verification interface to perform data verification on the configuration data to obtain a verification result.
Step 290, the service entity checks the checking result sent to the server.
Step 300, the verification service entity applies the configuration data in response to receiving the verification success result sent by the verification service entity.
In summary, in the method provided in this embodiment, a plurality of data verification programs are stored in the verification service entity, and the interface attributes of the data verification interfaces corresponding to different configuration data are configured at the front end, so that different data verification programs are used for performing data verification on different configuration data, and multiple different verification logics are used for verifying multiple different configuration data. When the verification rule of the configuration data needs to be changed, the data verification of the configuration data can be realized by adopting a new data verification program only by changing the interface attribute corresponding to the configuration data at the front end, so that the development and maintenance cost of the data verification is reduced, and the data verification efficiency is improved.
Exemplarily, as shown in fig. 9, an exemplary embodiment of performing data verification by applying the data verification method provided in the present application in a computer system composed of a terminal, a service server, and a verification server, as shown in fig. 2, is provided.
In step 301, the configuration data of the front-end program on the terminal is in the form of jsonschema (schema), and a user can write the configuration data corresponding to each field in the front-end program.
For example, as shown in fig. 3, the front-end program 1101 receives configuration data input by a user, performs step 302 in response to receiving an operation of saving the configuration data, reads an interface attribute corresponding to the configuration data, determines a first data check interface 1105 corresponding to the configuration data, and sends a first data check request to the check server 106 through the first data check interface 1105, where the first data check request includes the configuration data.
And the front-end program determines a first data verification interface corresponding to the configuration data from the data verification interface list according to the interface attribute corresponding to the configuration data.
For example, as shown in FIG. 3, verification server 106 is provided with a plurality of data verification interfaces, each for invoking a data verification plug-in. The verification server 106 receives the first data verification request sent by the front-end program 1101 through the first data verification interface 1105, and invokes the first data verification plug-in 1106 corresponding to the first data verification interface 1105 to perform data verification on the configuration data, so as to obtain a verification result.
For example, as shown in fig. 3, in response to the verification result being a verification success result, the front-end program 1101 saves the configuration data into the mysql library table. In response to the manual verification of the configuration data in the mysql library table being successful, the front end program 1101 writes the configuration data into the KV library 1103.
And 305, after the configuration data is stored in the mysql library table, manually checking the configuration data, and after the check is successful, writing the configuration data into a KV library (database) by a front-end program.
For example, as shown in fig. 3, the backend program 1102 simultaneously reads an interface attribute corresponding to the configuration data from the KV library 1103, where the interface attribute is used to indicate a first data verification interface 1105 used for performing data verification on the configuration data.
In step 402, the back-end program also calls a verification service provided by the verification server to perform data verification.
For example, as shown in fig. 3, the back-end program 1102 sends a second data verification request to the verification server 106 through the first data verification interface 1105, where the second data verification request includes the configuration data. The verification server 106 receives the second data verification request through the first data verification interface 1105, and invokes the first data verification plug-in 1106 corresponding to the first data verification interface 1105 to perform data verification on the configuration data, so as to obtain a verification result.
Therefore, the verification service independence can be realized, a front-end program on the terminal and a back-end program on the service server conveniently share one verification logic, and the verification complexity and the maintenance difficulty of the verification code are simplified.
In response to a successful verification, the backend program applies the configuration data, step 403.
Illustratively, the developer defines the configuration structure of jsonschema at the front end, and needs to be consistent with the protobuffer structure at the back end.
The developer realizes corresponding verification services according to the definition of the proto file of the verification services, verifies data length, rules and the like by configuring corresponding data verification plug-ins through data verification of each field of a proto message, and simultaneously performs linkage verification or individualized verification of a single field on the acquired configuration data through a data verification interface.
The developer may associate the configuration data with the data verification interface by:
a) The first front-end program acquires interface attributes of a corresponding data verification interface on a verification server, such as a service name, an interface name, a cmd, a magicid and the like;
b) The front-end program configures the interface attribute of the data verification interface corresponding to the configuration data on the front-end page of the configuration data;
c) The front-end program sets the effective switch of the data verification plug-in unit to be in an open state, and the data verification plug-in unit is guaranteed to operate normally.
After the interface attribute of the configuration data configured by the front-end program is successful, the front-end program can modify the configuration data, and once the front-end program detects that the configuration data is modified and stored, a data verification plug-in corresponding to the interface attribute is started to perform data verification on the configuration data, wherein the process comprises the following steps:
a) The front-end program receives the configuration data editing operation on the front-end page and stores the configuration data;
b) The front-end program packs the configuration data into json format data and sends the json format data to the verification server;
c) The verification server converts the json format configuration data into proto protocol configuration data and calls a corresponding data verification plug-in to verify the data;
d) The data verification plug-in performs data length verification, data normalization verification, multi-field linkage verification, business rule verification and the like on the configuration data;
e) If the verification is successful, the verification server returns 0 to the front-end program, if the verification is failed, the verification server returns non-0, and meanwhile, when the front-end program receives the result, the configuration data can be correspondingly written into the KV library or the writing fails according to the verification result.
After the configuration data is successfully verified, the front-end program writes the configuration data into the KV repository for storage, the back-end program (service server) can obtain the configuration data from the KV repository, and certainly the back-end program does not completely trust the configuration data sent by the front-end program, so the back-end program also needs to perform data verification on the configuration data:
a) The front-end program writes the successfully verified configuration data into a KV library in the production environment;
b) The back-end program acquires configuration data in the KV library through an SDK (Software Development Kit);
c) The back-end program checks the acquired configuration data through a data check interface provided by the check server, so that the front-end program and the back-end program can share one set of check service.
In summary, the method provided in this embodiment can ensure the correctness of the configuration data through the above process. And the check codes of the front-end program and the back-end program are not required to be developed, so that the reusability is strong. Aiming at different services, a set of check logic can be shared without repeated development, and the complexity of check service is simplified.
The method provided by the embodiment can be used for verifying the correctness of the configuration data, the complexity of development of the verification code is simplified, only the micro service for verifying the verification of the verification data needs to be developed, and then the data verification interface of the verification service is configured in the front-end program, so that a set of verification logic can be shared in the front-end program and the back-end program, the same verification logic does not need to be repeatedly realized in different programming languages in the front-end program and the back-end program, and the workload of development is reduced. Meanwhile, the simplicity of development codes is ensured, so that the check codes are easy to maintain, the reusability is strong, the method can be expanded to different services to share one set of check logic, and the expandability is strong. The method provided by the embodiment can deliver the configuration of the verification code of the configuration data to product personnel and operation personnel for configuration, thereby reducing the burden of development personnel.
The following are embodiments of the apparatus of the present application, and for details that are not described in detail in the embodiments of the apparatus, reference may be made to corresponding descriptions in the above method embodiments, and details are not described herein again.
Fig. 10 shows a schematic structural diagram of a data verification apparatus according to an exemplary embodiment of the present application. The apparatus can be implemented as all or a part of a terminal by software, hardware or a combination of both, and includes:
an input module 501, configured to receive input configuration data;
a first sending module 502, configured to send a first data verification request to a verification service entity, where the first data verification request is used to request data verification on the configuration data, and the verification service entity is a service entity shared by the terminal and the server and configured to provide a verification service;
a first receiving module 503, configured to receive a successful verification result sent by the verification service entity;
a writing module 504, configured to write the configuration data into a database in response to receiving a verification success result sent by the verification service entity.
In an optional embodiment, the verification service entity stores at least two data verification programs, where the at least two data verification programs are used to perform data verification on different configuration data by using different verification rules;
the first sending module 502 is configured to send the first data verification request to the verification service entity through a first data verification interface, where the first data verification interface is configured to request to invoke a first data verification program corresponding to the configuration data in the at least two data verification programs to perform data verification.
In an optional embodiment, the apparatus further comprises:
a configuration module 505, configured to configure an interface attribute corresponding to the configuration data, where the interface attribute includes at least one of a service name, an interface identifier, and an interface enabling state of the first data verification interface;
the writing module 504 is configured to write the interface attribute corresponding to the configuration data into the database;
the first sending module 502 is configured to send the first data verification request to the verification service entity through the first data verification interface according to the interface attribute corresponding to the configuration data, where the first data verification interface is configured to request to invoke a first data verification program corresponding to the configuration data in the at least two data verification programs for data verification.
In an optional embodiment, the data verification includes: at least one of data length check, data normalization check, multi-field linkage check and service rule check.
In an alternative embodiment, the data check includes the multi-field linkage check;
and the successful verification result is sent to the terminal by the verification service entity in response to that the first field in the configuration data meets the first requirement and the second field in the configuration data meets the second requirement.
Fig. 11 shows a schematic structural diagram of a data verification apparatus according to an exemplary embodiment of the present application. The apparatus may be implemented as all or a part of a server by software, hardware or a combination of both, and includes:
a reading module 601, configured to read configuration data from a database;
a second sending module 602, configured to send a second data verification request to a verification service entity, where the second data verification request is used to request data verification on the configuration data, and the verification service entity is a service entity shared by the terminal and the server and configured to provide a verification service;
a second receiving module 603, configured to receive a successful verification result sent by the verification service entity;
the service module 604 is configured to apply the configuration data in response to receiving a verification success result sent by the verification service entity.
In an optional embodiment, the verification service entity stores at least two data verification programs, where the at least two data verification programs are used to perform data verification on different configuration data by using different verification rules;
the second sending module 602 is configured to send the second data verification request to the verification service entity through a first data verification interface, where the second data verification request includes the configuration data, and the first data verification interface is configured to request to invoke a first data verification program corresponding to the configuration data in the at least two data verification programs to perform data verification.
In an optional embodiment, the reading module 601 is configured to read, from the database, an interface attribute corresponding to the configuration data, where the interface attribute includes at least one of a service name, an interface identifier, and an interface enabling state of the first data verification interface, and the interface attribute corresponding to the configuration data is configured by the terminal and written into the database;
the second sending module 602 is configured to send the second data verification request to the verification service entity through the first data verification interface according to the interface attribute, where the second data verification request includes the configuration data, and the first data verification interface is configured to request to invoke a first data verification program corresponding to the configuration data in the at least two data verification programs to perform data verification.
In an optional embodiment, the data verification includes: at least one of data length check, data normalization check, multi-field linkage check and business rule check.
In an alternative embodiment, the data check includes the multi-field linkage check;
and the verification success result is sent to the server by the verification service entity in response to that the first field in the configuration data meets the first requirement and the second field in the configuration data meets the second requirement.
Fig. 12 shows a schematic structural diagram of a data verification apparatus according to an exemplary embodiment of the present application. The apparatus may be implemented by software, hardware or a combination of both as all or a part of a verification service entity, where the verification service entity is a service entity shared by a terminal and the server and used for providing a verification service, and the apparatus includes:
a third receiving module 701, configured to receive a data verification request, where the data verification request includes configuration data, and the data verification request is used to request data verification on the configuration data, where the data verification request is a first data verification request sent by a terminal, or the data verification request is a second data verification request sent by a server;
a verification module 702, configured to invoke a data verification program to perform data verification on the configuration data, so as to obtain a verification result;
a third sending module 703 is configured to return the verification result to a requester of the data verification request, where the requester is the terminal or the server.
In an optional embodiment, the verification service entity stores at least two data verification programs, where the at least two data verification programs are used to perform data verification on different configuration data by using different verification rules;
the third receiving module 701 is configured to receive the data verification request through a first data verification interface, where the data verification request includes the configuration data, and the first data verification interface is configured to request to invoke a first data verification program corresponding to the configuration data in the at least two data verification programs for data verification;
the verification module 702 is configured to invoke the first data verification program corresponding to the first data verification interface to perform data verification on the configuration data, so as to obtain the verification result.
In an optional embodiment, the data verification includes: at least one of data length check, data normalization check, multi-field linkage check and business rule check.
In an optional embodiment, the checking module 702 is configured to obtain the checking result in response to that a first field in the configuration data meets a first requirement and a second field in the configuration data meets a second requirement, where the checking result is a checking success result.
Fig. 13 is a schematic structural diagram of a server according to an embodiment of the present application. Specifically, the method comprises the following steps: the server 800 includes a Central Processing Unit (CPU) 801, a system Memory 804 including a Random Access Memory (RAM) 802 and a Read-Only Memory (ROM) 803, and a system bus 805 connecting the system Memory 804 and the CPU 801. The server 800 also includes a basic input/output system (I/O system) 806 for facilitating information transfer between various devices within the computer, and a mass storage device 807 for storing an operating system 813, application programs 814, and other program modules 815.
The basic input/output system 806 includes a display 808 for displaying information and an input device 809 such as a mouse, keyboard, etc. for inputting information for a user's account. Wherein a display 808 and an input device 809 are connected to the central processing unit 801 through an input/output controller 810 connected to the system bus 805. The basic input/output system 806 may also include an input/output controller 810 for receiving and processing input from a number of other devices, such as a keyboard, mouse, or electronic stylus. Similarly, an input/output controller 810 also provides output to a display screen, a printer, or other type of output device.
The mass storage device 807 is connected to the central processing unit 801 through a mass storage controller (not shown) connected to the system bus 805. The mass storage device 807 and its associated computer-readable media provide non-volatile storage for the server 800. That is, the mass storage device 807 may include a computer-readable medium (not shown) such as a hard disk or Compact Disc-Only Memory (CD-ROM) drive.
Without loss of generality, computer readable media may comprise computer storage media and communication media. Computer storage media includes volatile and nonvolatile, removable and non-removable media implemented in any method or technology for storage of information such as computer readable instructions, data structures, program modules or other data. Computer storage media include RAM, ROM, erasable Programmable Read-Only Memory (EPROM), electrically Erasable Programmable Read-Only Memory (EEPROM), flash Memory or other solid state Memory technology, CD-ROM, digital Versatile Disks (DVD), or other optical storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices. Of course, those skilled in the art will appreciate that computer storage media is not limited to the foregoing. The system memory 804 and mass storage 807 described above may be collectively referred to as memory.
According to various embodiments of the present application, server 800 may also operate as a remote computer connected to a network through a network, such as the Internet. That is, the server 800 may be connected to the network 812 through the network interface unit 811 coupled to the system bus 805, or may be connected to other types of networks or remote computer systems (not shown) using the network interface unit 811.
The application further provides a terminal, which includes a processor and a memory, where at least one instruction is stored in the memory, and the at least one instruction is loaded and executed by the processor to implement the data verification method provided by the foregoing method embodiments. It should be noted that the terminal may be a terminal as provided in fig. 14 below.
Fig. 14 shows a block diagram of a terminal 900 according to an exemplary embodiment of the present application. The terminal 900 may be: a smart phone, a tablet computer, an MP3 player (Moving Picture Experts Group Audio Layer III, motion video Experts compression standard Audio Layer 3), an MP4 player (Moving Picture Experts Group Audio Layer IV, motion video Experts compression standard Audio Layer 4), a notebook computer, or a desktop computer. Terminal 900 may also be referred to as a user account device, portable terminal, laptop terminal, desktop terminal, or other name.
In general, terminal 900 includes: a processor 901 and a memory 902.
In some embodiments, terminal 900 can also optionally include: a peripheral interface 903 and at least one peripheral. The processor 901, memory 902, and peripheral interface 903 may be connected by buses or signal lines. Each peripheral may be connected to the peripheral interface 903 by a bus, signal line, or circuit board. Specifically, the peripheral device includes: at least one of a radio frequency circuit 904, a display screen 905, a camera assembly 906, an audio circuit 907, a positioning assembly 908, and a power supply 909.
The peripheral interface 903 may be used to connect at least one peripheral related to I/O (Input/Output) to the processor 901 and the memory 902. In some embodiments, the processor 901, memory 902, and peripheral interface 903 are integrated on the same chip or circuit board; in some other embodiments, any one or two of the processor 901, the memory 902, and the peripheral device interface 903 may be implemented on a separate chip or circuit board, which is not limited by the embodiment.
The Radio Frequency circuit 904 is used to receive and transmit RF (Radio Frequency) signals, also known as electromagnetic signals. The radio frequency circuitry 904 communicates with communication networks and other communication devices via electromagnetic signals. The radio frequency circuit 904 converts an electrical signal into an electromagnetic signal to transmit, or converts a received electromagnetic signal into an electrical signal. Illustratively, the radio frequency circuit 904 includes: an antenna system, an RF transceiver, one or more amplifiers, a tuner, an oscillator, a digital signal processor, a codec chipset, a subscriber account identity module card, and so forth. The radio frequency circuitry 904 may communicate with other terminals via at least one wireless communication protocol. The wireless communication protocols include, but are not limited to: the world wide web, metropolitan area networks, intranets, generations of mobile communication networks (2G, 3G, 4G, and 5G), wireless local area networks, and/or WiFi (Wireless Fidelity) networks. In some embodiments, the radio frequency circuit 904 may also include NFC (Near Field Communication) related circuits, which are not limited in this application.
The display screen 905 is used to display a UI (User Interface). The UI may include graphics, text, icons, video, and any combination thereof. When the display screen 905 is a touch display screen, the display screen 905 also has the ability to capture touch signals on or over the surface of the display screen 905. The touch signal may be input to the processor 901 as a control signal for processing. At this point, the display 905 may also be used to provide virtual buttons and/or a virtual keyboard, also referred to as soft buttons and/or a soft keyboard. In some embodiments, the display 905 may be one, providing the front panel of the terminal 900; in other embodiments, the display 905 may be at least two, respectively disposed on different surfaces of the terminal 900 or in a foldable design; in still other embodiments, the display 905 may be a flexible display disposed on a curved surface or on a folded surface of the terminal 900. Even more, the display screen 905 may be arranged in a non-rectangular irregular figure, i.e. a shaped screen. The Display panel 905 may be made of LCD (Liquid Crystal Display), OLED (Organic Light-Emitting Diode), or other materials.
The camera assembly 906 is used to capture images or video. Illustratively, camera assembly 906 includes a front camera and a rear camera. Generally, a front camera is disposed at a front panel of the terminal, and a rear camera is disposed at a rear surface of the terminal. In some embodiments, the number of the rear cameras is at least two, and each rear camera is any one of a main camera, a depth-of-field camera, a wide-angle camera and a telephoto camera, so that the main camera and the depth-of-field camera are fused to realize a background blurring function, the main camera and the wide-angle camera are fused to realize panoramic shooting and a VR (Virtual Reality) shooting function or other fusion shooting functions. In some embodiments, camera assembly 906 may also include a flash. The flash lamp can be a monochrome temperature flash lamp or a bicolor temperature flash lamp. The double-color-temperature flash lamp is a combination of a warm-light flash lamp and a cold-light flash lamp, and can be used for light compensation at different color temperatures.
The positioning component 908 is used to locate a current geographic Location of the terminal 900 for navigation or LBS (Location Based Service). The Positioning component 908 can be a Positioning component based on the Global Positioning System (GPS) in the united states, the beidou System in china, or the galileo System in russia.
In some embodiments, terminal 900 can also include one or more sensors 910. The one or more sensors 910 include, but are not limited to: acceleration sensor 911, gyro sensor 912, pressure sensor 913, fingerprint sensor 914, optical sensor 915, and proximity sensor 916.
The acceleration sensor 911 can detect the magnitude of acceleration in three coordinate axes of the coordinate system established with the terminal 900. For example, the acceleration sensor 911 may be used to detect the components of the gravitational acceleration in three coordinate axes. The processor 901 can control the display screen 905 to display the user account interface in a horizontal view or a vertical view according to the gravitational acceleration signal collected by the acceleration sensor 911. The acceleration sensor 911 may also be used for acquisition of motion data of a game or a user account.
The gyroscope sensor 912 can detect the body direction and the rotation angle of the terminal 900, and the gyroscope sensor 912 and the acceleration sensor 911 cooperate to acquire the 3D motion of the user account on the terminal 900. The processor 901 can implement the following functions according to the data collected by the gyro sensor 912: motion sensing (such as changing the UI according to a tilting operation of a user account), image stabilization while photographing, game control, and inertial navigation.
The pressure sensor 913 may be disposed on a side frame of the terminal 900 and/or underneath the display 905. When the pressure sensor 913 is disposed on the side frame of the terminal 900, the holding signal of the user account to the terminal 900 may be detected, and the processor 901 performs left-right hand recognition or shortcut operation according to the holding signal collected by the pressure sensor 913. When the pressure sensor 913 is disposed on the lower layer of the display screen 905, the processor 901 controls the operable control on the UI interface by performing a pressure operation on the display screen 905 according to the user account. The operability control comprises at least one of a button control, a scroll bar control, an icon control and a menu control.
The fingerprint sensor 914 is used for collecting fingerprints of the user account, and the processor 901 identifies the identity of the user account according to the fingerprints collected by the fingerprint sensor 914, or the fingerprint sensor 914 identifies the identity of the user account according to the collected fingerprints. When the identity of the user account is identified as a trusted identity, the processor 901 authorizes the user account to perform relevant sensitive operations, including unlocking a screen, viewing encrypted information, downloading software, paying, changing settings, and the like. The fingerprint sensor 914 may be disposed on the front, back, or side of the terminal 900. When a physical key or vendor Logo is provided on the terminal 900, the fingerprint sensor 914 may be integrated with the physical key or vendor Logo.
The optical sensor 915 is used to collect ambient light intensity. In one embodiment, the processor 901 may control the display brightness of the display screen 905 based on the ambient light intensity collected by the optical sensor 915. Specifically, when the ambient light intensity is high, the display brightness of the display screen 905 is increased; when the ambient light intensity is low, the display brightness of the display screen 905 is reduced. In another embodiment, the processor 901 can also dynamically adjust the shooting parameters of the camera assembly 906 according to the ambient light intensity collected by the optical sensor 915.
A proximity sensor 916, also known as a distance sensor, is typically provided on the front panel of the terminal 900. The proximity sensor 916 is used to capture the distance between the user account and the front of the terminal 900. In one embodiment, when the proximity sensor 916 detects that the distance between the user account and the front face of the terminal 900 gradually decreases, the processor 901 controls the display 905 to switch from the bright screen state to the dark screen state; when the proximity sensor 916 detects that the distance between the user account and the front surface of the terminal 900 gradually becomes larger, the processor 901 controls the display 905 to switch from the breath screen state to the bright screen state.
Those skilled in the art will appreciate that the configuration shown in fig. 14 is not intended to be limiting of terminal 900 and may include more or fewer components than those shown, or some components may be combined, or a different arrangement of components may be used.
The memory further comprises one or more programs, the one or more programs are stored in the memory, and the one or more programs comprise data verification methods for performing the data verification methods provided by the embodiments of the present application.
The present application further provides a computer device, comprising: a processor and a memory, the storage medium having at least one instruction, at least one program, a set of codes, or a set of instructions stored therein, the at least one instruction, at least one program, set of codes, or set of instructions being loaded and executed by the processor to implement the data verification method provided by the above-described method embodiments.
The present application further provides a computer-readable storage medium, in which at least one instruction, at least one program, a code set, or a set of instructions is stored, and the at least one instruction, the at least one program, the code set, or the set of instructions is loaded and executed by a processor to implement the data verification method provided by the above-mentioned method embodiments.
The present application also provides a computer program product or computer program comprising computer instructions stored in a computer readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and executes the computer instructions, so that the computer device executes the data verification method provided in the above-mentioned alternative implementation mode.
It should be understood that reference to "a plurality" herein means two or more. "and/or" describes the association relationship of the associated objects, meaning that there may be three relationships, e.g., a and/or B, which may mean: a exists alone, A and B exist simultaneously, and B exists alone. The character "/" generally indicates that the former and latter associated objects are in an "or" relationship.
It will be understood by those skilled in the art that all or part of the steps for implementing the above embodiments may be implemented by hardware, or may be implemented by a program instructing relevant hardware, where the program may be stored in a computer-readable storage medium, and the storage medium may be a read-only memory, a magnetic disk or an optical disk.
The present application is intended to cover various modifications, alternatives, and equivalents, which may be included within the spirit and scope of the present application.
Claims (15)
1. A data verification method is applied to a terminal, and the method comprises the following steps:
receiving input configuration data;
sending a first data verification request to a verification service entity, wherein the first data verification request is used for requesting data verification on the configuration data, and the verification service entity is a service entity shared by the terminal and the server and used for providing verification service;
and writing the configuration data into a database in response to receiving a verification success result sent by the verification service entity.
2. The method according to claim 1, wherein the verification service entity stores at least two data verification procedures, and the at least two data verification procedures are used for performing data verification on different configuration data by using different verification rules;
the sending the first data verification request to the verification service entity includes:
and sending the first data verification request to the verification service entity through a first data verification interface, wherein the first data verification request comprises the configuration data, and the first data verification interface is used for requesting to call a first data verification program corresponding to the configuration data in the at least two data verification programs for data verification.
3. The method of claim 2, further comprising:
configuring interface attributes corresponding to the configuration data, wherein the interface attributes comprise at least one of a service name, an interface identifier and an interface enabling state of the first data verification interface;
writing the interface attribute corresponding to the configuration data into the database;
the sending the first data verification request to the verification service entity through the first data verification interface includes:
and sending the first data verification request to the verification service entity through the first data verification interface according to the interface attribute corresponding to the configuration data, wherein the first data verification request comprises the configuration data, and the first data verification interface is used for requesting to call a first data verification program corresponding to the configuration data in the at least two data verification programs for data verification.
4. The method of any of claims 1 to 3, wherein the data verification comprises: at least one of data length check, data normalization check, multi-field linkage check and business rule check.
5. The method of claim 4, wherein the data check comprises the multi-field linkage check;
and the successful verification result is sent to the terminal by the verification service entity in response to that the first field in the configuration data meets the first requirement and the second field in the configuration data meets the second requirement.
6. A data verification method is applied to a server, and comprises the following steps:
reading configuration data from a database;
sending a second data verification request to a verification service entity, wherein the second data verification request is used for requesting data verification on the configuration data, and the verification service entity is a service entity shared by the terminal and the server and used for providing verification service;
and applying the configuration data in response to receiving a verification success result sent by the verification service entity.
7. The method according to claim 6, wherein the verification service entity stores at least two data verification programs, and the at least two data verification programs are used for performing data verification on different configuration data by using different verification rules;
the sending of the second data verification request to the verification service entity includes:
and sending the second data verification request to the verification service entity through a first data verification interface, wherein the second data verification request comprises the configuration data, and the first data verification interface is used for requesting to call a first data verification program corresponding to the configuration data in the at least two data verification programs for data verification.
8. The method of claim 7, further comprising:
reading an interface attribute corresponding to the configuration data from the database, wherein the interface attribute comprises at least one of a service name, an interface identifier and an interface enabling state of the first data verification interface, and the interface attribute corresponding to the configuration data is configured by the terminal and written into the database;
the sending the second data verification request to the verification service entity through the first data verification interface includes:
and sending the second data verification request to the verification service entity through the first data verification interface according to the interface attribute, wherein the second data verification request comprises the configuration data, and the first data verification interface is used for requesting to call a first data verification program corresponding to the configuration data in the at least two data verification programs for data verification.
9. A data verification method is applied to a verification service entity, wherein the verification service entity is a service entity shared by a terminal and a server and used for providing verification service, and the method comprises the following steps:
receiving a data verification request, wherein the data verification request comprises configuration data, the data verification request is used for requesting data verification on the configuration data, and the data verification request is a first data verification request sent by a terminal or a second data verification request sent by a server;
calling a data verification program to perform data verification on the configuration data to obtain a verification result;
and returning the verification result to a requester of the data verification request, wherein the requester is the terminal or the server.
10. The method according to claim 9, wherein the verification service entity stores at least two data verification programs, and the at least two data verification programs are used for performing data verification on different configuration data by using different verification rules;
the receiving a data verification request includes:
receiving the data verification request through a first data verification interface, wherein the data verification request comprises the configuration data, and the first data verification interface is used for requesting to call a first data verification program corresponding to the configuration data in the at least two data verification programs for data verification;
the calling data checking program carries out data checking on the configuration data to obtain a checking result, and the method comprises the following steps:
and calling the first data verification program corresponding to the first data verification interface to perform data verification on the configuration data to obtain the verification result.
11. A data checking device is applied to a terminal, and the device comprises:
the input module is used for receiving input configuration data;
a first sending module, configured to send a first data verification request to a verification service entity, where the first data verification request is used to request data verification on the configuration data, and the verification service entity is a service entity shared by the terminal and the server and used to provide a verification service;
the first receiving module is used for receiving a verification success result sent by the verification service entity;
and the writing module is used for writing the configuration data into a database in response to receiving a verification success result sent by the verification service entity.
12. A data verification device is applied to a server, and the device comprises:
the reading module is used for reading the configuration data from the database;
a second sending module, configured to send a second data verification request to a verification service entity, where the second data verification request is used to request data verification on the configuration data, and the verification service entity is a service entity that is shared by the terminal and the server and is used to provide a verification service;
the second receiving module is used for receiving a verification success result sent by the verification service entity;
and the service module is used for responding to the received verification success result sent by the verification service entity and applying the configuration data.
13. A data verification apparatus, applied to a verification service entity, where the verification service entity is a service entity shared by a terminal and a server and used for providing a verification service, the apparatus comprising:
a third receiving module, configured to receive a data verification request, where the data verification request includes configuration data, and the data verification request is used to request data verification on the configuration data, where the data verification request is a first data verification request sent by a terminal, or the data verification request is a second data verification request sent by a server;
the verification module is used for calling a data verification program to perform data verification on the configuration data to obtain a verification result;
and the third sending module is used for returning the verification result to a requester of the data verification request, wherein the requester is the terminal or the server.
14. A computer device, characterized in that the computer device comprises: a processor and a memory, the memory having stored therein at least one instruction, at least one program, a set of codes, or a set of instructions, which is loaded and executed by the processor to implement the data verification method as claimed in any one of claims 1 to 10.
15. A computer readable storage medium having stored therein at least one instruction, at least one program, a set of codes, or a set of instructions, which is loaded and executed by a processor to implement a data verification method as claimed in any one of claims 1 to 10.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110454365.1A CN115248939A (en) | 2021-04-26 | 2021-04-26 | Data verification method, device, equipment and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110454365.1A CN115248939A (en) | 2021-04-26 | 2021-04-26 | Data verification method, device, equipment and storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN115248939A true CN115248939A (en) | 2022-10-28 |
Family
ID=83696485
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202110454365.1A Pending CN115248939A (en) | 2021-04-26 | 2021-04-26 | Data verification method, device, equipment and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN115248939A (en) |
-
2021
- 2021-04-26 CN CN202110454365.1A patent/CN115248939A/en active Pending
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN110674022B (en) | Behavior data acquisition method and device and storage medium | |
CN113204298A (en) | Method and device for displaying release progress, electronic equipment and storage medium | |
US11934814B2 (en) | Application porting method and apparatus, device, and medium | |
CN111949680A (en) | Data processing method and device, computer equipment and storage medium | |
CN111159604A (en) | Picture resource loading method and device | |
CN111241499A (en) | Application program login method, device, terminal and storage medium | |
CN112052354A (en) | Video recommendation method, video display method and device and computer equipment | |
CN112749362A (en) | Control creating method, device, equipment and storage medium | |
CN114594923A (en) | Control method, device and equipment of vehicle-mounted terminal and storage medium | |
CN113051015A (en) | Page rendering method and device, electronic equipment and storage medium | |
CN112257006A (en) | Page information configuration method, device, equipment and computer readable storage medium | |
CN110290191B (en) | Resource transfer result processing method, device, server, terminal and storage medium | |
CN113190362B (en) | Service calling method and device, computer equipment and storage medium | |
CN109783176B (en) | Page switching method and device | |
CN113837709A (en) | Online processing method and device of business process, terminal and readable storage medium | |
CN112764600A (en) | Resource processing method, device, storage medium and computer equipment | |
CN110825465A (en) | Log data processing method and device, electronic equipment and storage medium | |
CN113268234A (en) | Page generation method, device, terminal and storage medium | |
CN111294320B (en) | Data conversion method and device | |
CN109597951B (en) | Information sharing method and device, terminal and storage medium | |
CN113076452A (en) | Application classification method, device, equipment and computer readable storage medium | |
CN112231619A (en) | Conversion method, conversion device, electronic equipment and storage medium | |
CN115248939A (en) | Data verification method, device, equipment and storage medium | |
CN112765571A (en) | Authority management method, system, device, server and storage medium | |
CN114385939A (en) | Application display method, application display system, application display device and application display equipment |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination |