CN114417304A - Data verification method and device - Google Patents

Data verification method and device Download PDF

Info

Publication number
CN114417304A
CN114417304A CN202111590687.5A CN202111590687A CN114417304A CN 114417304 A CN114417304 A CN 114417304A CN 202111590687 A CN202111590687 A CN 202111590687A CN 114417304 A CN114417304 A CN 114417304A
Authority
CN
China
Prior art keywords
verification
scene
current
check
checking
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
Application number
CN202111590687.5A
Other languages
Chinese (zh)
Inventor
李小锋
谢彦彬
吴方正
黄文宝
刘波
徐浩
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
China Construction Bank Corp
Original Assignee
China Construction Bank Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by China Construction Bank Corp filed Critical China Construction Bank Corp
Priority to CN202111590687.5A priority Critical patent/CN114417304A/en
Publication of CN114417304A publication Critical patent/CN114417304A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F21/00Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
    • G06F21/30Authentication, i.e. establishing the identity or authorisation of security principals
    • G06F21/44Program or device authentication
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/30Creation or generation of source code
    • G06F8/38Creation or generation of source code for implementing user interfaces

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Hardware Design (AREA)
  • Human Computer Interaction (AREA)
  • Stored Programmes (AREA)

Abstract

The invention discloses a data verification method and device, and relates to the technical field of access control. One embodiment of the method comprises: establishing a check rule set corresponding to each check scene in a logic layer of a user interface; detecting a current check scene of the user interface, and checking a check object of the current check scene according to a check rule set corresponding to the current check scene in a logic layer of the user interface, wherein the check rule set comprises at least one check rule, and the check rule comprises the check object, a check condition and a check result. The embodiment has clear checking structure, is simple to realize and easy to maintain, overcomes the defects that the checking rules in the same scene are dispersed and are not beneficial to maintaining and modifying the checking rules, completely gets rid of the limitation of outsourcing third-party controls, meets the personalized requirements, has good expandability, reduces the integration difficulty, realizes the decoupling of the checking logic and the user interface, and reduces the influence of the change of the business requirements on the modification of the page content.

Description

Data verification method and device
Technical Field
The present invention relates to the field of access control technologies, and in particular, to a data verification method and apparatus.
Background
For some service platforms, such as financial market interconnection trading platforms, desktop client programs developed in a Windows environment WPF (Windows Presentation Foundation, a Windows-based user interface framework launched by microsoft), there are many scenarios in which the same user interface is shared, and the same control value check rule for the same interface is different or only part of the control values are checked when a user submits the same user interface. The existing financial market client checks the value of the user interface control by implementing a verification interface provided by the third party commercial control.
In the process of implementing the invention, the inventor finds that at least the following problems exist in the prior art:
because the same control value is different according to different scene verification rules and needs to be realized under the same control according to scene conditions, the same scene verification rule is relatively dispersed and is not beneficial to maintenance and modification of the verification rule; the scheme for verifying the interface control value by adopting the third-party control has no source code, is difficult to realize aiming at personalized requirements, and has poor expansibility, difficult integration and high maintenance difficulty. The rule of the user manual check needs to be realized by registering the user control check event, and the coupling ratio is higher depending on the user interface.
Disclosure of Invention
In view of this, embodiments of the present invention provide a data verification method and apparatus, which can create a verification rule set corresponding to a verification scene in a logic layer, so as to be separated from a user interface, and the verification structure is clear, and is simple to implement and easy to maintain.
To achieve the above object, according to an aspect of an embodiment of the present invention, a data verification method is provided.
A method of data verification, comprising: establishing a check rule set corresponding to each check scene in a logic layer of a user interface; detecting a current verification scene of the user interface, and verifying a verification object of the current verification scene according to a verification rule set corresponding to the current verification scene in a logic layer of the user interface, wherein the verification rule set comprises at least one verification rule, and the verification rule comprises the verification object, a verification condition and a verification result.
Optionally, the creating, in the logic layer of the user interface, a verification rule set corresponding to each verification scenario respectively includes: in a view model of the user interface, determining a check object set of each check scene, wherein the check object set comprises one or more check objects; and according to the verification scene, filling the verification objects, the verification conditions and the verification results in the verification object set into a rule template to generate verification rules, and obtaining a verification rule set of the corresponding verification scene according to the generated verification rules.
Optionally, the creating, in the logic layer of the user interface, a verification rule set corresponding to each verification scenario respectively includes: in a view model of the user interface, determining a check object set of each check scene, wherein the check object set comprises one or more check objects; acquiring a corresponding verification result generation template according to one or more of a verification scene, a verification object and a verification condition, wherein the verification result generation template is used for dynamically generating a verification result; and according to the verification scene, filling the verification objects, the verification conditions and the verification result generation template in the verification object set into a rule template to generate verification rules, and obtaining a verification rule set of the corresponding verification scene according to each generated verification rule.
Optionally, the verifying the verification object of the current verification scene includes: and under the condition that the same verification object in the same verification rule set corresponds to a plurality of verification rules, if any one of the plurality of verification rules fails to verify the verification object, terminating the verification process of the verification object by using other verification rules in the plurality of verification rules.
Optionally, the detecting a current verification scenario of the user interface includes: and detecting the current verification scene of the user interface according to user indication information or interface control events, wherein the user indication information is in one or more forms of instructions, messages and notifications triggered by user actions.
Optionally, after detecting the current verification scenario of the user interface, the method further includes: reading the identification value of the current verification scene, and determining the type of the current verification scene according to the identification value, wherein the type of the current verification scene is divided into an automatic verification scene of an interface control and a manual verification scene of a user.
Optionally, when the type of the current verification scene is a user manual verification scene, after the verification of the verification object of the current verification scene, the method includes: and storing the verification result of the verification object of the current verification scene in a dictionary set, wherein the key of the dictionary in the dictionary set is the name of the verification object, and the value is the corresponding verification result.
Optionally, after storing the verification result of the verification object of the current verification scene in a dictionary set, the method includes: and informing an interface control bound with the checking object of the current checking scene to acquire a corresponding checking result in the dictionary set.
Optionally, an interface control bound to the verification object of the current verification scene is notified to obtain a corresponding verification result in the dictionary set by calling a RaisePropertyChanged method of the WPF programming language.
Optionally, the identification value is a preset default value or a modification value of the default value by a user, and the type of the current verification scene is an automatic verification scene of the interface control under the condition that the identification value is the default value; under the condition that the identification value is the modified value, the type of the current verification scene is a user manual verification scene; in a case that the type of the current verification scenario is a user manual verification scenario, the method further includes: and after the verification object of the current verification scene passes verification, restoring the identification value to the default value.
Optionally, when the type of the current verification scene is an automatic verification scene of the interface control, returning a verification result of the verification object of the current verification scene to the interface control bound with the verification object of the current verification scene in real time.
Optionally, after the verification of the verification object of the current verification scene, the method further includes:
prompting the checking result of the checking object of the current checking scene through a specific marking style or a bullet frame, and/or recording the checking result of the checking object of the current checking scene in a user log.
Optionally, the verification object of the current verification scene is a source property bound to the interface control of the user interface.
Optionally, the number of the check rule sets corresponding to the current check scenario is multiple, and a check result set in each check rule set is a check result set of the corresponding check rule set; after the verification of the verification object of the current verification scene according to the verification rule set corresponding to the current verification scene, the method includes: and executing preset operation logic on the verification result sets of the multiple verification rule sets corresponding to the current verification scene, wherein the preset operation logic comprises logic for executing AND operation or OR operation on two or more different verification result sets.
According to another aspect of the embodiments of the present invention, a data verification apparatus is provided.
A data verification apparatus, comprising: the verification rule set creating module is used for creating a verification rule set corresponding to each verification scene in a logic layer of the user interface; the verification scene detection module is used for detecting the current verification scene of the user interface; and the checking module is used for checking a checking object of the current checking scene according to a checking rule set corresponding to the current checking scene in a logic layer of the user interface, wherein the checking rule set comprises at least one checking rule, and the checking rule comprises a checking object, a checking condition and a checking result.
Optionally, the verification rule set creating module is configured to: in a view model of the user interface, determining a check object set of each check scene, wherein the check object set comprises one or more check objects; and according to the verification scene, filling the verification objects, the verification conditions and the verification results in the verification object set into a rule template to generate verification rules, and obtaining a verification rule set of the corresponding verification scene according to the generated verification rules.
Optionally, the verification rule set creating module is configured to: in a view model of the user interface, determining a check object set of each check scene, wherein the check object set comprises one or more check objects; acquiring a corresponding verification result generation template according to one or more of a verification scene, a verification object and a verification condition, wherein the verification result generation template is used for dynamically generating a verification result; and according to the verification scene, filling the verification objects, the verification conditions and the verification result generation template in the verification object set into a rule template to generate verification rules, and obtaining a verification rule set of the corresponding verification scene according to each generated verification rule.
Optionally, the verification module is further configured to: and under the condition that the same verification object in the same verification rule set corresponds to a plurality of verification rules, if any one of the plurality of verification rules fails to verify the verification object, terminating the verification process of the verification object by using other verification rules in the plurality of verification rules.
Optionally, the check scene detection module is further configured to: and detecting the current verification scene of the user interface according to user indication information or interface control events, wherein the user indication information is in one or more forms of instructions, messages and notifications triggered by user actions.
Optionally, the system further includes a verification scene type determining module, configured to: reading the identification value of the current verification scene, and determining the type of the current verification scene according to the identification value, wherein the type of the current verification scene is divided into an automatic verification scene of an interface control and a manual verification scene of a user.
Optionally, the system further comprises a verification result storage module, configured to: and storing the verification result of the verification object of the current verification scene in a dictionary set, wherein the key of the dictionary in the dictionary set is the name of the verification object, and the value is the corresponding verification result.
Optionally, the system further includes a verification result notification module, configured to: and informing an interface control bound with the checking object of the current checking scene to acquire a corresponding checking result in the dictionary set.
Optionally, the verification result notification module notifies the interface control bound to the verification object of the current verification scene to obtain the corresponding verification result in the dictionary set by calling a RaisePropertyChanged method of the WPF programming language.
Optionally, the identification value is a preset default value or a modification value of the default value by a user, and the verification scene type determining module is further configured to: under the condition that the identification value is the default value, determining the type of the current verification scene as an automatic verification scene of the interface control; determining the type of the current verification scene as a user manual verification scene under the condition that the identification value is the modified value; the device further comprises an identification value setting module, which is used for recovering the identification value to the default value after the verification object of the current verification scene passes the verification under the condition that the type of the current verification scene is the manual verification scene of the user.
Optionally, the system further comprises a check result returning module, configured to: and under the condition that the type of the current verification scene is the automatic verification scene of the interface control, returning the verification result of the verification object of the current verification scene to the interface control bound with the verification object of the current verification scene in real time.
Optionally, the system further comprises a verification result prompting module and/or a logging module, wherein: the verification result prompting module is used for prompting the verification result of the verification object of the current verification scene through a specific marking style or a bullet frame; the log recording module is used for recording the verification result of the verification object of the current verification scene in the user log.
Optionally, the verification object of the current verification scene is a source property bound to the interface control of the user interface.
Optionally, the number of the check rule sets corresponding to the current check scenario is multiple, and a check result set in each check rule set is a check result set of the corresponding check rule set; the system also comprises a verification result processing module used for: and executing preset operation logic on the verification result sets of the multiple verification rule sets corresponding to the current verification scene, wherein the preset operation logic comprises logic for executing AND operation or OR operation on two or more different verification result sets.
According to yet another aspect of an embodiment of the present invention, an electronic device is provided.
An electronic device, comprising: one or more processors; a memory for storing one or more programs which, when executed by the one or more processors, cause the one or more processors to implement the data verification methods provided by embodiments of the present invention.
According to yet another aspect of an embodiment of the present invention, a computer-readable medium is provided.
A computer-readable medium, on which a computer program is stored, the computer program, when being executed by a processor, implements the data verification method provided by the embodiments of the present invention.
According to yet another aspect of an embodiment of the present invention, a computer program product is provided.
A computer program product comprising a computer program which, when executed by a processor, implements the data verification method provided by embodiments of the invention.
One embodiment of the above invention has the following advantages or benefits: establishing a check rule set corresponding to each check scene in a logic layer of a user interface; detecting a current check scene of a user interface, and checking a check object of the current check scene according to a check rule set corresponding to the current check scene in a logic layer of the user interface, wherein the check rule set comprises at least one check rule, and the check rule comprises the check object, a check condition and a check result. The method can realize that a check rule set corresponding to a check scene is established in a logic layer, so that the method is separated from a user interface, the check structure is clear, the method is simple to realize and easy to maintain, only check objects, check conditions and check results need to be filled in the rules, the defect that the check rules of the same scene are dispersed and are not beneficial to maintenance and modification of the check rules is overcome, the limitation of outsourcing third-party controls is completely eliminated, the personalized requirements are met, the expandability is good, the integration difficulty is reduced, the decoupling of the check logic and the user interface can be realized, and the influence of the change of business requirements on the modification of page contents is reduced.
Further effects of the above-mentioned non-conventional alternatives will be described below in connection with the embodiments.
Drawings
The drawings are included to provide a better understanding of the invention and are not to be construed as unduly limiting the invention. Wherein:
FIG. 1 is a schematic diagram of the main steps of a data verification method according to one embodiment of the present invention;
fig. 2 is a schematic diagram of a correspondence relationship between a verification rule set and a verification scenario according to an embodiment of the present invention;
FIG. 3 is a schematic diagram of a data verification process according to an embodiment of the invention;
FIG. 4 is a schematic diagram of the main modules of a data verification device according to one embodiment of the present invention;
FIG. 5 is an exemplary system architecture diagram in which embodiments of the present invention may be employed;
fig. 6 is a schematic block diagram of a computer system suitable for use in implementing a terminal device or server of an embodiment of the invention.
Detailed Description
Exemplary embodiments of the present invention are described below with reference to the accompanying drawings, in which various details of embodiments of the invention are included to assist understanding, and which are to be considered as merely exemplary. Accordingly, those of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope and spirit of the invention. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
According to the technical scheme, the data acquisition, storage, use, processing and the like meet relevant regulations of national laws and regulations.
Fig. 1 is a schematic diagram of main steps of a data verification method according to an embodiment of the present invention, and as shown in fig. 1, the data verification method according to an embodiment of the present invention mainly includes the following steps S101 to S102.
Step S101: and creating a check rule set corresponding to each check scene in a logic layer of the user interface.
Step S102: detecting a current check scene of the user interface, and checking a check object of the current check scene according to a check rule set corresponding to the current check scene in a logic layer of the user interface, wherein the check rule set comprises at least one check rule.
The verification rule can be represented by a ValidationRule, and is a verification rule used for verifying whether the value of the user interface control meets the necessary condition for submission, and the verification rule of the embodiment of the invention mainly comprises the following parts: checking object, checking condition and checking result.
The verification object is an interface control value to be verified, specifically, the verification object may be a source property bound to an interface control of the user interface, the source property may also be referred to as a control source property, which is a property of a data source of the interface control, and the interface control value to be verified is obtained by obtaining a value of the corresponding source property. The verification object name is the same as the source attribute name.
The check rule set can be represented by ValidationRuleSet, and is a set of check rules. The check rule sets are freely combined according to needs, and each check rule set consists of a rule set name and a List (List) set of the rule set.
The verification scene can be represented by ValidationScene, which refers to various occasions needing to be verified by using a verification rule set.
In one embodiment, the verification rule set may be created and maintained in advance, and loaded for use in verification when the interface is opened. The corresponding relationship between the verification rule set and the verification scenario in an embodiment of the present invention is shown in fig. 2, where the verification scenario includes ValidationScene1 to ValidationScene n, the verification rule set includes ValidationRuleSet1 to ValidationRuleSetN, and the verification rule includes ValidationRule1 to ValidationRuleN. One checking scenario may correspond to one or more checking rule sets, and one checking rule set may include one or more checking rules.
In an embodiment, a logic layer, such as a view model (ViewModel), creates a check rule set corresponding to each check scenario in the logic layer of a user interface, and the specific steps include: in a view model (ViewModel) of a user interface, determining a check object set of each check scene, wherein the check object set comprises one or more check objects, and the ViewModel is a logic layer of the user interface and is separated from the user interface; and filling the verification objects, the verification conditions and the verification results in the verification object set into the rule template according to the verification scene to generate verification rules, and obtaining the verification rule set of the corresponding verification scene according to the generated verification rules.
The embodiment of the invention only needs to fill the check object, the check condition and the check result in the rule, and has clear check structure, simple realization and easy maintenance.
In another embodiment, a verification rule set corresponding to each verification scenario is created in a logic layer of a user interface, and the specific steps include: in a view model of a user interface, determining a check object set of each check scene, wherein the check object set comprises one or more check objects; acquiring a corresponding verification result generation template according to one or more of a verification scene, a verification object and a verification condition, wherein the verification result generation template is used for dynamically generating a verification result; and according to the verification scene, filling the verification objects, the verification condition and the verification result generation template in the verification object set into the rule template to generate verification rules, and obtaining a verification rule set of the corresponding verification scene according to each generated verification rule. The embodiment of the invention fills the verification object, the verification condition and the verification result generating template in the verification object set into the rule template, the verification result generating template can comprise a function for generating a verification result, the verification scene, the verification object or the verification condition are different, the corresponding verification result generating templates can be different, the verification result generating template is filled into the rule template instead of the fixed verification result being filled into the template, and the verification result can be dynamically generated in real time instead of the fixed verification result being obtained according to the actual requirement during verification, so that the verification result is not a fixed value configured in the rule, and can be dynamically generated in real time, and the verification result can be dynamically generated when the verification is carried out based on the generated verification rule set. For example, when a certain verification condition is reached, a certain verification object is verified, and the verification result is a value of a certain function, then the verification condition, the verification object, and the function are filled in the rule template, and when the verification object needs to be verified, an input value of the function can be obtained or set as needed, so as to obtain an output value of the function as the verification result, where the output value of the function is not a fixed value, but is dynamically generated by using the function.
The type of the current verification scene in the embodiment of the invention can be an automatic verification scene of an interface control or a manual verification scene of a user. The interface control automatic checking scene is a checking scene for automatically checking whether the corresponding control value meets the user requirement or not when the control value on the user interface changes, the control loses focus and other events. The user manually verifies a scene, for example, a verification scene in which the user needs to selectively verify whether the interface control value meets the submission condition when performing actions such as adding, modifying, and saving a draft.
In the embodiment of the invention, in a view model (Viewmodel) of a user interface, a check object set of each check scene is determined, a corresponding check rule set is generated, automatic check of an interface control value and manual check of a user are realized in the application logic Viewmodel (view model), and the view model is separated from the user interface, so that the decoupling purpose can be achieved.
In an embodiment, verifying the verification object of the current verification scene may specifically include: under the condition that the same verification object in the same verification rule set corresponds to a plurality of verification rules, if any one of the plurality of verification rules fails to verify the verification object, the verification process of the verification object by using other verification rules in the plurality of verification rules is terminated, and the other verification objects in the same verification rule set still can be verified.
In an embodiment, detecting a current verification scenario of the user interface may specifically include: and detecting the current checking scene of the user interface according to user indication information or interface control events, wherein the user indication information is in one or more forms of instructions, messages and notifications triggered by user actions. The current check scene of the user interface is a specific check scene under an automatic check scene of the interface control or a manual check scene of the user, for example, when the control value on the user interface changes, the check of the corresponding control value is a check scene, and when the user modifies, the check of the interface control value is also a check scene.
In an embodiment, after detecting the current verification scene of the user interface, the identification value of the current verification scene may also be read, and the type of the current verification scene is determined according to the identification value, and the types of the verification scene may be divided into an interface control automatic verification scene and a user manual verification scene. The identification value may be user set.
The check result corresponding to the check condition in the check rule can be obtained by checking the check object of the current check scene according to the check rule set corresponding to the current check scene, for example, the check result is returned when the check condition is true, and the null result is returned if the check condition is false.
In one embodiment, the type of the current verification scenario is a user manual verification scenario. After the check object of the current check scene is checked, the check result of the check object of the current check scene may be stored in the dictionary set, a key of the dictionary in the dictionary set is a check object name, and a value is a corresponding check result.
After the verification result of the verification object of the current verification scene is stored in the dictionary set, the interface control bound with the verification object of the current verification scene can be informed to acquire the corresponding verification result in the dictionary set. Specifically, an interface control bound with a verification object of a current verification scene may be notified by calling a RaisePropertyChanged method of the WPF programming language, and the notification content may specifically be that a verification result needs to be displayed on the interface, so that the notified interface control acquires a corresponding verification result in the dictionary set.
In one embodiment, the identification value of the current verification scene is a preset default value or a modification value of the default value by a user, and the type of the current verification scene is an automatic verification scene of the interface control under the condition that the identification value is the default value; and under the condition that the identification value is the modified value, the type of the current verification scene is the manual verification scene of the user. For example, the default of the identification value is FALSE, which indicates automatic verification, that is, the type of the verification scene is the interface control automatic verification scene, if the user performs manual verification, the user may modify the identification value to TRUE, that is, the type of the verification scene is the user manual verification scene.
In an embodiment, the type of the current verification scene is a user manual verification scene, and after the verification object of the current verification scene passes verification, the identification value of the current verification scene can be restored to a preset default value. That is, after the manual verification is completed, the identification value may be restored to the default value FALSE in response to the instruction that the manual verification is completed.
In one embodiment, the type of the current verification scene is an interface control automatic verification scene, and a verification result of a verification object of the current verification scene can be returned to the interface control bound with the verification object of the current verification scene in real time.
In an embodiment, after the verification object of the current verification scene is verified, the verification result of the verification object of the current verification scene may be prompted through a specific indication style (for example, a style such as a red box) or a pop box, and/or the verification result of the verification object of the current verification scene may be recorded in the user log. For example, if the check result is null (indicating that the check is passed, i.e., there is no exception), the corresponding interface control may not perform exception prompting, and if the check result is not null (indicating that the check is not passed, i.e., there is an exception), the corresponding interface control may perform exception prompting by marking red on a frame to prompt that the corresponding control value check result is abnormal, and may also prompt specific content of the check result, such as specific exception information, when the mouse is suspended on the interface control. Besides the check result of the interface control value is displayed in the user interface in a red frame, various display modes such as user-defined pop-up frame display or log document record can be adopted.
In each embodiment of the present invention, the verification object of the current verification scene may specifically be a source attribute bound to an interface control of the user interface. The verification object name is the same as the source attribute name. In one embodiment, the number of the check rule sets corresponding to the current check scenario is multiple, and the set of the check results in each check rule set is the check result set of the corresponding check rule set. According to the check rule set corresponding to the current check scene, after the check object of the current check scene is checked, preset operation logics can be executed on check result sets of a plurality of check rule sets corresponding to the current check scene, wherein the preset operation logics comprise logics for executing AND operation or OR operation on two or more different check result sets.
The verification rule set of the embodiment of the invention can freely combine and flexibly configure the verification rules, meets the requirement of customized development, can quickly position and modify the verification rules aiming at the change of business requirements, realizes the simplification of complex verification logic, and can obtain the verification result and display the verification result on an interface by a specific developer only by utilizing the maintained verification rule set, thereby improving the user experience. The verification scene of the embodiment of the invention supports the operation logics of AND, OR and the like on the verification results of a plurality of verification rule sets, and meets the service requirement of further operating the verification results in individual scenes. The limitation of the outsourcing third-party control is completely eliminated, and the operation safety of the service platform system where the user interface is located is improved.
Fig. 3 is a schematic diagram of a data verification process according to an embodiment of the present invention, and as shown in fig. 3, the process may include: creating a check rule (S301); combining the verification rules into a verification rule set according to needs (S302); loading a checking rule set corresponding to the current checking scene (S303); performing data verification by using the loaded verification rule set (S304), specifically including verifying the source property bound with the interface control of the user interface; judging whether the type of the current checking scene is automatic checking of the interface control (S305); if yes, returning the checking result to the corresponding interface control in real time (S306); otherwise, storing the verification result into a dictionary set, storing the object name of the verification rule in the Key of the dictionary, and storing the verification result corresponding to the verification rule in the Value (S307); traversing Key in the verification result dictionary, and notifying an interface control bound with the verification object by using a RaisePropertyChanged method to acquire a corresponding verification result in the dictionary set (S308); presenting the check result in a separate bullet box (S309); the check result is recorded in the user log (S310), wherein the execution sequence of the above steps S308, S309, S310 is not limited by the step number itself.
FIG. 4 is a schematic diagram of the main modules of a data verification device according to an embodiment of the present invention. As shown in fig. 4, the data verification apparatus 400 according to an embodiment of the present invention mainly includes: a verification rule set creation module 401, a verification scene detection module 402, and a verification module 403.
A checking rule set creating module 401, configured to create, in a logic layer of the user interface, a checking rule set corresponding to each checking scenario.
A check scene detection module 402, configured to detect a current check scene of the user interface.
The verification module 403 is configured to, in a logic layer of the user interface, verify a verification object of a current verification scene according to a verification rule set corresponding to the current verification scene, where the verification rule set includes at least one verification rule, and the verification rule includes the verification object, a verification condition, and a verification result.
In an embodiment, the verification rule set creating module 401 may be specifically configured to: in a view model of a user interface, determining a check object set of each check scene, wherein the check object set comprises one or more check objects; and filling the verification objects, the verification conditions and the verification results in the verification object set into the rule template according to the verification scene to generate verification rules, and obtaining the verification rule set of the corresponding verification scene according to the generated verification rules.
In another embodiment, the verification rule set creating module 401 may be specifically configured to: in a view model of a user interface, determining a check object set of each check scene, wherein the check object set comprises one or more check objects; acquiring a corresponding verification result generation template according to one or more of a verification scene, a verification object and a verification condition, wherein the verification result generation template is used for dynamically generating a verification result; and according to the verification scene, filling the verification objects, the verification condition and the verification result generation template in the verification object set into the rule template to generate verification rules, and obtaining a verification rule set of the corresponding verification scene according to each generated verification rule.
The verification module 403 may specifically be configured to: and under the condition that the same verification object in the same verification rule set corresponds to a plurality of verification rules, if any one of the plurality of verification rules fails to verify the verification object, terminating the verification process of the verification object by using other verification rules in the plurality of verification rules.
The verification scene detection module 402 may be specifically configured to: and detecting the current checking scene of the user interface according to user indication information or interface control events, wherein the user indication information is in one or more forms of instructions, messages and notifications triggered by user actions.
The data verification apparatus 400 may further include a verification scene type determination module configured to: reading the identification value of the current verification scene, and determining the type of the current verification scene according to the identification value, wherein the type of the current verification scene is divided into an automatic interface control verification scene and a manual user verification scene.
The data verification apparatus 400 may further include a verification result storage module configured to: and storing the verification result of the verification object of the current verification scene in a dictionary set, wherein the key of the dictionary in the dictionary set is the name of the verification object, and the value is the corresponding verification result.
The data verification apparatus 400 may further include a verification result notification module configured to: and informing the interface control bound with the checking object of the current checking scene to acquire a corresponding checking result in the dictionary set.
The verification result notification module may specifically notify the interface control bound to the verification object of the current verification scene to acquire the corresponding verification result in the dictionary set by calling a RaisePropertyChanged method of the WPF programming language.
The identification value of the current verification scene may be a preset default value or a modification value of the default value by a user.
The check scene type determining module may be specifically configured to: under the condition that the identification value is a default value, determining the type of the current verification scene as an automatic verification scene of the interface control; and under the condition that the identification value is the modified value, determining the type of the current verification scene as a user manual verification scene.
The data verification apparatus 400 may further include an identifier setting module, configured to restore the identifier to a default value after the verification object of the current verification scene passes verification when the type of the current verification scene is the user manual verification scene.
The data verification apparatus 400 may further include a verification result returning module configured to: and under the condition that the type of the current verification scene is the automatic verification scene of the interface control, returning the verification result of the verification object of the current verification scene to the interface control bound with the verification object of the current verification scene in real time.
The data verification apparatus 400 may further include a verification result prompting module, and/or a logging module, wherein: the verification result prompting module is used for prompting the verification result of the verification object of the current verification scene through a specific marking style or a bullet frame; the log recording module is used for recording the verification result of the verification object of the current verification scene in the user log.
The verification object of the current verification scene is specifically a source property bound with an interface control of the user interface.
The number of the check rule sets corresponding to the current check scene may be multiple, and the check result set in each check rule set is the check result set of the corresponding check rule set.
The data verification apparatus 400 may further include a verification result processing module configured to: and executing preset operation logic on the verification result sets of the multiple verification rule sets corresponding to the current verification scene, wherein the preset operation logic comprises logic for executing AND operation or OR operation on two or more different verification result sets.
In addition, the specific implementation contents of the data verification device in the embodiment of the present invention have been described in detail in the above data verification method, so repeated contents are not described again here.
Fig. 5 illustrates an exemplary system architecture 500 to which the data verification method or data verification apparatus of an embodiment of the present invention may be applied.
As shown in fig. 5, the system architecture 500 may include terminal devices 501, 502, 503, a network 504, and a server 505. The network 504 serves to provide a medium for communication links between the terminal devices 501, 502, 503 and the server 505. Network 504 may include various connection types, such as wired, wireless communication links, or fiber optic cables, to name a few.
The user may use the terminal devices 501, 502, 503 to interact with a server 505 over a network 504 to receive or send messages or the like. The terminal devices 501, 502, 503 may have installed thereon various communication client applications, such as shopping-like applications, web browser applications, search-like applications, instant messaging tools, mailbox clients, social platform software, etc. (by way of example only).
The terminal devices 501, 502, 503 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop portable computers, desktop computers, and the like.
The server 505 may be a server providing various services, such as a background management server (for example only) providing support for shopping websites browsed by users using the terminal devices 501, 502, 503. The backend management server may analyze and otherwise process the received data such as the financial information query request, and feed back a processing result (e.g., target push information — just an example) to the terminal device.
It should be noted that the data verification method provided by the embodiment of the present invention is generally executed by the server 505, and accordingly, the data verification apparatus is generally disposed in the server 505.
It should be understood that the number of terminal devices, networks, and servers in fig. 5 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
Referring now to FIG. 6, shown is a block diagram of a computer system 600 suitable for use in implementing a terminal device or server of an embodiment of the present application. The terminal device or the server shown in fig. 6 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present application.
As shown in fig. 6, the computer system 600 includes a Central Processing Unit (CPU)601 that can perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM)602 or a program loaded from a storage section 608 into a Random Access Memory (RAM) 603. In the RAM 603, various programs and data necessary for the operation of the system 600 are also stored. The CPU 601, ROM 602, and RAM 603 are connected to each other via a bus 604. An input/output (I/O) interface 605 is also connected to bus 604.
The following components are connected to the I/O interface 605: an input portion 606 including a keyboard, a mouse, and the like; an output portion 607 including a display such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, and a speaker; a storage section 608 including a hard disk and the like; and a communication section 609 including a network interface card such as a LAN card, a modem, or the like. The communication section 609 performs communication processing via a network such as the internet. The driver 610 is also connected to the I/O interface 605 as needed. A removable medium 611 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 610 as necessary, so that a computer program read out therefrom is mounted in the storage section 608 as necessary.
In particular, according to the embodiments of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method illustrated in the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network through the communication section 609, and/or installed from the removable medium 611. The above-described functions defined in the system of the present application are executed when the computer program is executed by the Central Processing Unit (CPU) 601.
It should be noted that the computer readable medium shown in the present invention can be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present application, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In this application, however, a computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present application. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The modules described in the embodiments of the present invention may be implemented by software or hardware. The described modules may also be provided in a processor, which may be described as: a processor comprises a checking rule set creating module, a checking scene detection module and a checking module. The names of these modules do not in some cases constitute a limitation on the module itself, for example, the verification scenario detection module may also be described as a "module for detecting the current verification scenario of the user interface".
As another aspect, the present invention also provides a computer-readable medium that may be contained in the apparatus described in the above embodiments; or may be separate and not incorporated into the device. The computer readable medium carries one or more programs which, when executed by a device, cause the device to comprise: establishing a check rule set corresponding to each check scene in a logic layer of a user interface; detecting a current verification scene of the user interface, and verifying a verification object of the current verification scene according to a verification rule set corresponding to the current verification scene in a logic layer of the user interface, wherein the verification rule set comprises at least one verification rule, and the verification rule comprises the verification object, a verification condition and a verification result.
As a further aspect, the present invention also provides a computer program product comprising a computer program which, when executed by a processor, implements the data verification method of an embodiment of the present invention.
According to the technical scheme of the embodiment of the invention, a verification rule set corresponding to each verification scene is established in a logic layer of a user interface; detecting a current check scene of a user interface, and checking a check object of the current check scene according to a check rule set corresponding to the current check scene in a logic layer of the user interface, wherein the check rule set comprises at least one check rule, and the check rule comprises the check object, a check condition and a check result. The method can realize that a check rule set corresponding to a check scene is established in a logic layer, has clear check structure, is simple to realize and easy to maintain, only needs to fill check objects, check conditions and check results in the rules, overcomes the defects that the check rules of the same scene are dispersed and are not beneficial to maintenance and modification of the check rules, completely breaks away from the limitation of outsourcing third-party controls, meets the personalized requirements, has good expandability, reduces the integration difficulty, can also realize the decoupling of the check logic and a user interface, and reduces the influence of the change of business requirements on the modification of page contents.
The above-described embodiments should not be construed as limiting the scope of the invention. Those skilled in the art will appreciate that various modifications, combinations, sub-combinations, and substitutions can occur, depending on design requirements and other factors. Any modification, equivalent replacement, and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (31)

1. A method for data verification, comprising:
establishing a check rule set corresponding to each check scene in a logic layer of a user interface;
detecting a current verification scene of the user interface, and verifying a verification object of the current verification scene according to a verification rule set corresponding to the current verification scene in a logic layer of the user interface, wherein the verification rule set comprises at least one verification rule, and the verification rule comprises the verification object, a verification condition and a verification result.
2. The method according to claim 1, wherein creating a checking rule set corresponding to each checking scenario in a logical layer of a user interface comprises:
in a view model of the user interface, determining a check object set of each check scene, wherein the check object set comprises one or more check objects;
and according to the verification scene, filling the verification objects, the verification conditions and the verification results in the verification object set into a rule template to generate verification rules, and obtaining a verification rule set of the corresponding verification scene according to the generated verification rules.
3. The method according to claim 1, wherein creating a checking rule set corresponding to each checking scenario in a logical layer of a user interface comprises:
in a view model of the user interface, determining a check object set of each check scene, wherein the check object set comprises one or more check objects;
acquiring a corresponding verification result generation template according to one or more of a verification scene, a verification object and a verification condition, wherein the verification result generation template is used for dynamically generating a verification result;
and according to the verification scene, filling the verification objects, the verification conditions and the verification result generation template in the verification object set into a rule template to generate verification rules, and obtaining a verification rule set of the corresponding verification scene according to each generated verification rule.
4. The method according to claim 2 or 3, wherein the verifying the verification object of the current verification scene comprises:
and under the condition that the same verification object in the same verification rule set corresponds to a plurality of verification rules, if any one of the plurality of verification rules fails to verify the verification object, terminating the verification process of the verification object by using other verification rules in the plurality of verification rules.
5. The method of claim 1, wherein the detecting a current verification scenario of the user interface comprises:
and detecting the current verification scene of the user interface according to user indication information or interface control events, wherein the user indication information is in one or more forms of instructions, messages and notifications triggered by user actions.
6. The method of claim 1 or 5, wherein after detecting the current verification scenario of the user interface, further comprising:
reading the identification value of the current verification scene, and determining the type of the current verification scene according to the identification value, wherein the type of the current verification scene is divided into an automatic verification scene of an interface control and a manual verification scene of a user.
7. The method according to claim 6, wherein in a case that the type of the current verification scene is a user manual verification scene, after verifying the verification object of the current verification scene, the method comprises:
and storing the verification result of the verification object of the current verification scene in a dictionary set, wherein the key of the dictionary in the dictionary set is the name of the verification object, and the value is the corresponding verification result.
8. The method according to claim 7, wherein after storing the verification result of the verification object of the current verification scene in a dictionary set, the method comprises:
and informing an interface control bound with the checking object of the current checking scene to acquire a corresponding checking result in the dictionary set.
9. The method as claimed in claim 8, wherein the interface control bound to the verification object of the current verification scene is notified to obtain the corresponding verification result in the dictionary set by calling a RaisePropertyChanged method of WPF programming language.
10. The method according to claim 6, wherein the identification value is a preset default value or a modification value of the default value by a user, and in the case that the identification value is the default value, the type of the current verification scene is an interface control automatic verification scene; under the condition that the identification value is the modified value, the type of the current verification scene is a user manual verification scene;
in a case that the type of the current verification scenario is a user manual verification scenario, the method further includes:
and after the verification object of the current verification scene passes verification, restoring the identification value to the default value.
11. The method according to claim 6, wherein in a case that the type of the current verification scene is an interface control automatic verification scene, a verification result of a verification object of the current verification scene is returned to the interface control bound with the verification object of the current verification scene in real time.
12. The method of claim 1, wherein after verifying the verification object of the current verification scene, the method further comprises:
prompting the checking result of the checking object of the current checking scene through a specific marking style or a bullet frame, and/or recording the checking result of the checking object of the current checking scene in a user log.
13. The method of claim 1, wherein the verification object of the current verification scenario is a source property bound to an interface control of the user interface.
14. The method according to claim 1, wherein the number of the check rule sets corresponding to the current check scenario is multiple, and a set of check results in each check rule set is a check result set of the corresponding check rule set;
after the verification of the verification object of the current verification scene according to the verification rule set corresponding to the current verification scene, the method includes:
and executing preset operation logic on the verification result sets of the multiple verification rule sets corresponding to the current verification scene, wherein the preset operation logic comprises logic for executing AND operation or OR operation on two or more different verification result sets.
15. A data verification apparatus, comprising:
the verification rule set creating module is used for creating a verification rule set corresponding to each verification scene in a logic layer of the user interface;
the verification scene detection module is used for detecting the current verification scene of the user interface;
and the checking module is used for checking a checking object of the current checking scene according to a checking rule set corresponding to the current checking scene in a logic layer of the user interface, wherein the checking rule set comprises at least one checking rule, and the checking rule comprises a checking object, a checking condition and a checking result.
16. The apparatus of claim 15, wherein the verification rule set creation module is configured to:
in a view model of the user interface, determining a check object set of each check scene, wherein the check object set comprises one or more check objects;
and according to the verification scene, filling the verification objects, the verification conditions and the verification results in the verification object set into a rule template to generate verification rules, and obtaining a verification rule set of the corresponding verification scene according to the generated verification rules.
17. The apparatus of claim 15, wherein the verification rule set creation module is configured to:
in a view model of the user interface, determining a check object set of each check scene, wherein the check object set comprises one or more check objects;
acquiring a corresponding verification result generation template according to one or more of a verification scene, a verification object and a verification condition, wherein the verification result generation template is used for dynamically generating a verification result;
and according to the verification scene, filling the verification objects, the verification conditions and the verification result generation template in the verification object set into a rule template to generate verification rules, and obtaining a verification rule set of the corresponding verification scene according to each generated verification rule.
18. The apparatus of claim 16 or 17, wherein the verification module is further configured to:
and under the condition that the same verification object in the same verification rule set corresponds to a plurality of verification rules, if any one of the plurality of verification rules fails to verify the verification object, terminating the verification process of the verification object by using other verification rules in the plurality of verification rules.
19. The apparatus of claim 15, wherein the verification scenario detection module is further configured to:
and detecting the current verification scene of the user interface according to user indication information or interface control events, wherein the user indication information is in one or more forms of instructions, messages and notifications triggered by user actions.
20. The apparatus of claim 15 or 19, further comprising a verification scene type determination module configured to:
reading the identification value of the current verification scene, and determining the type of the current verification scene according to the identification value, wherein the type of the current verification scene is divided into an automatic verification scene of an interface control and a manual verification scene of a user.
21. The apparatus of claim 20, further comprising a verification result storage module configured to:
and storing the verification result of the verification object of the current verification scene in a dictionary set, wherein the key of the dictionary in the dictionary set is the name of the verification object, and the value is the corresponding verification result.
22. The apparatus of claim 21, further comprising a verification result notification module configured to:
and informing an interface control bound with the checking object of the current checking scene to acquire a corresponding checking result in the dictionary set.
23. The apparatus of claim 22, wherein the verification result notification module notifies an interface control bound to the verification object of the current verification scene to obtain the corresponding verification result in the dictionary set by calling a RaisePropertyChanged method of WPF programming language.
24. The apparatus of claim 20, wherein the identification value is a preset default value or a modification value of the default value by a user, and the checking scenario type determining module is further configured to: under the condition that the identification value is the default value, determining the type of the current verification scene as an automatic verification scene of the interface control; determining the type of the current verification scene as a user manual verification scene under the condition that the identification value is the modified value;
the device further comprises an identification value setting module, which is used for recovering the identification value to the default value after the verification object of the current verification scene passes the verification under the condition that the type of the current verification scene is the manual verification scene of the user.
25. The apparatus of claim 20, further comprising a verification result returning module configured to: and under the condition that the type of the current verification scene is the automatic verification scene of the interface control, returning the verification result of the verification object of the current verification scene to the interface control bound with the verification object of the current verification scene in real time.
26. The apparatus of claim 15, further comprising a verification result prompting module, and/or a logging module, wherein:
the verification result prompting module is used for prompting the verification result of the verification object of the current verification scene through a specific marking style or a bullet frame;
the log recording module is used for recording the verification result of the verification object of the current verification scene in the user log.
27. The apparatus of claim 15, wherein the verification object of the current verification scenario is a source property bound to an interface control of the user interface.
28. The apparatus according to claim 15, wherein the number of the check rule sets corresponding to the current check scenario is multiple, and a set of check results in each check rule set is a check result set of the corresponding check rule set;
the system also comprises a verification result processing module used for:
and executing preset operation logic on the verification result sets of the multiple verification rule sets corresponding to the current verification scene, wherein the preset operation logic comprises logic for executing AND operation or OR operation on two or more different verification result sets.
29. An electronic device, comprising:
one or more processors;
a memory for storing one or more programs,
the one or more programs, when executed by the one or more processors, cause the one or more processors to implement the method recited in any of claims 1-14.
30. A computer-readable medium, on which a computer program is stored which, when being executed by a processor, carries out the method according to any one of claims 1-14.
31. A computer program product comprising a computer program, characterized in that the computer program realizes the method according to any of claims 1-14 when executed by a processor.
CN202111590687.5A 2021-12-23 2021-12-23 Data verification method and device Pending CN114417304A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111590687.5A CN114417304A (en) 2021-12-23 2021-12-23 Data verification method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111590687.5A CN114417304A (en) 2021-12-23 2021-12-23 Data verification method and device

Publications (1)

Publication Number Publication Date
CN114417304A true CN114417304A (en) 2022-04-29

Family

ID=81267228

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111590687.5A Pending CN114417304A (en) 2021-12-23 2021-12-23 Data verification method and device

Country Status (1)

Country Link
CN (1) CN114417304A (en)

Similar Documents

Publication Publication Date Title
CN112036824A (en) Business approval method, system, storage medium and electronic equipment
CN109359194B (en) Method and apparatus for predicting information categories
CN109656799B (en) Test method and device
CN113344523A (en) Data processing method and device, electronic equipment and computer readable storage medium
CN109582317B (en) Method and apparatus for debugging hosted applications
CN113362173A (en) Anti-duplication mechanism verification method, anti-duplication mechanism verification system, electronic equipment and storage medium
US11074395B2 (en) Dynamic contribution mapping of digital works
CN110659897A (en) Method, system, computing device and medium for transaction verification
CN110874446A (en) Page display method and system, computer system and computer readable medium
CN114417304A (en) Data verification method and device
CN113986258A (en) Service publishing method, device, equipment and storage medium
CN114489667A (en) Script generation method and device, electronic equipment and storage medium
CN113312900A (en) Data verification method and device
CN112860344A (en) Component processing method and device, electronic equipment and storage medium
CN111367898A (en) Data processing method, device, system, electronic equipment and storage medium
CN112084114A (en) Method and apparatus for testing an interface
US9942185B2 (en) Hyperlink validation
US20200279038A1 (en) Network interaction method, electronic device, client and server
CN115208762B (en) Configuration updating method, device, configuration server and computer readable storage medium
KR102537296B1 (en) Method, apparatus, and recording medium of operating scholarship service
CN113760706B (en) Webpage debugging method and device
CN110874253B (en) Display method and display system
CN117176576A (en) Network resource changing method, device, equipment and storage medium
CN114218254A (en) Report generation method, device, equipment and storage medium
CN117093702A (en) Method and device for generating data service package, storage medium and electronic equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination