CN110287383B - Method and device for checking field information - Google Patents

Method and device for checking field information Download PDF

Info

Publication number
CN110287383B
CN110287383B CN201910580581.3A CN201910580581A CN110287383B CN 110287383 B CN110287383 B CN 110287383B CN 201910580581 A CN201910580581 A CN 201910580581A CN 110287383 B CN110287383 B CN 110287383B
Authority
CN
China
Prior art keywords
field
preset
rule
service
combination
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.)
Active
Application number
CN201910580581.3A
Other languages
Chinese (zh)
Other versions
CN110287383A (en
Inventor
曲鸣
江旻
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
WeBank Co Ltd
Original Assignee
WeBank Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by WeBank Co Ltd filed Critical WeBank Co Ltd
Priority to CN201910580581.3A priority Critical patent/CN110287383B/en
Publication of CN110287383A publication Critical patent/CN110287383A/en
Priority to PCT/CN2020/091658 priority patent/WO2020259147A1/en
Application granted granted Critical
Publication of CN110287383B publication Critical patent/CN110287383B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/903Querying
    • G06F16/90335Query processing
    • G06F16/90344Query processing by using string matching techniques
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q40/00Finance; Insurance; Tax strategies; Processing of corporate or income taxes
    • G06Q40/04Trading; Exchange, e.g. stocks, commodities, derivatives or currency exchange

Abstract

The invention discloses a field information checking method and a device, wherein the method comprises the following steps: acquiring field information; the field information comprises configuration field information and service field information, and the configuration field information comprises at least one configuration field; taking the at least one configuration field as a current configuration field combination, and acquiring a preset field inspection rule corresponding to the current configuration field combination according to a preset operation; and checking the business field information according to the preset field checking rule. When the method is applied to finance technology (Fintech), the field inspection rule matched with the preset inspection rule table is most suitable for the inspection of field information, the configuration field combination with one configuration field removed is not used as the current configuration field combination again after the matching, and the matching is carried out with the preset inspection rule table, so that the preset field inspection rule which is suitable for the field information as much as possible is found, and the adaptability of the field information inspection is improved.

Description

Method and device for checking field information
Technical Field
The invention relates to the field of financial science and technology (Fintech) and the field of information inspection, in particular to a field information inspection method and device.
Background
With the development of computer technology, more and more technologies (big data, distributed, blockchain, artificial intelligence, etc.) are applied in the financial field, and the traditional financial industry is gradually changing to financial technology (Fintech). Currently, in the field of financial science and technology, some financial systems need to implement a financial transaction function by transmitting fields into an external service interface, and because the financial transaction has a high requirement on operation stability, the field information transmitted into the financial systems needs to be checked.
Because the services of the access parties are different, the same external service interface may have more or less difference in field information. If the platform 1 uses a certain interface, the platform 1 is required to transmit A, B, C three service fields to the interface, and if the platform 2 uses the interface as well, the platform 2 is required to transmit A, C, D three service fields to the interface. In the prior art, all service fields of an access party are checked according to the same general field check rule. However, for the same service field of different access parties, the requirements of the access parties are different, for example, the value range of A of the service field of the platform 1 is required to be 0-100; a of the service field of the platform 2 has a value range of 50-200; this requires that when checking the service field a, it is first determined whether it is from the platform 1 or the platform 2, and then checked according to the checking requirement of the corresponding platform, and when each service field is checked later, this determination is then checked, and it is obvious that a general field checking rule has poor adaptability to field information checking of different access parties.
Disclosure of Invention
The embodiment of the application provides a field information checking method and device, which solve the problem of poor adaptability to field information checking of different access parties in the prior art.
In a first aspect, an embodiment of the present application provides a field information checking method, including: acquiring field information; the field information comprises configuration field information and service field information, and the configuration field information comprises at least one configuration field; taking the at least one configuration field as a current configuration field combination, and acquiring a preset field inspection rule corresponding to the current configuration field combination according to a preset operation; the preset operation is as follows: matching the current configuration field combination with a preset check rule table; the preset check rule table comprises at least one field check rule; if the field checking rule can be matched, outputting the field checking rule as the preset field checking rule; if the field checking rule cannot be matched and the current configuration field combination comprises at least two configuration fields, removing one configuration field from the current configuration field combination, taking the configuration field combination with the one configuration field removed as the current configuration field combination again, and returning to the step of matching the configuration field combination with a preset checking rule table; and checking the business field information according to the preset field checking rule.
According to the method, the preset field inspection rule is acquired according to the preset operation in the configuration field information of the field information, the configuration field information is firstly matched with the preset inspection rule table, and as the current configuration field combination comprises the most configuration fields when the current configuration field combination is the configuration field information, the configuration field combination which is matched with the preset inspection rule table is most suitable for the inspection of the field information, and the configuration field combination with one configuration field removed is not matched again as the current configuration field combination and is matched with the preset inspection rule table, so that the preset field inspection rule which is suitable for the field information as much as possible is found, and the adaptability of the field information inspection is improved.
In an alternative embodiment, the matching the current configuration field combination with a preset check rule table includes: according to a preset mapping rule, the current interface field combination is mapped into a character string; determining a sub-inspection rule table corresponding to the type of the character string from the preset inspection rule table; and determining whether the character string has a corresponding field check rule in the sub check rule table.
According to the method, the current interface field combination is mapped into the character string according to the preset mapping rule, and whether the corresponding field checking rule exists or not is determined in the sub-checking rule table corresponding to the type of the character string, so that the corresponding sub-checking rule table can be flexibly set according to the type of the character string, and the field checking rule can be classified.
In an optional implementation manner, each field inspection rule in the preset inspection rule table marks a failure period attribute and/or an effective period attribute, wherein the failure period attribute indicates that the field inspection rule is unmatched at a current time, the effective period attribute indicates that the field inspection rule is matchable at the current time, and the matching of the current configuration field combination with the preset inspection rule table further includes: matching the current configuration field combination with a first time efficiency test rule table; the first time-efficiency test rule table is a combination of field test rules after the field test rules of the mark failure time period attribute are removed from the preset test rule table; and/or matching the current configuration field combination with a second aging test rule table; the second aging test rule table is a combination of field test rules marking the effective period attribute in the preset test rule table.
In the method, the failure time period attribute and/or the effective time period attribute are marked by each field inspection rule in the preset inspection rule table, and the current configuration field combination can be selectively matched with the first effective inspection rule table and/or the second effective inspection rule table, so that consideration of effective or failure dimension is increased, and the diversity and flexibility of the matched field inspection rules are further increased.
In an alternative embodiment, the checking the service field information according to the preset field checking rule includes: if a first service field is marked in the preset field checking rule as a necessary field in the service information, and the service information does not comprise the first service field, or the value of the first service field is empty, determining that the service information is illegal; for a second service field, the second service field is any service field existing in the service field information and the preset field checking rule, and if any one of at least one check of the second service field is illegal, determining that the service information is illegal; the at least one test includes: whether the value format of the second service field accords with the preset format of the second service field or not, if not, the value format of the second service field is illegal; whether the length of the value of the second service field accords with the preset length of the second service field or not, if not, the value of the second service field is illegal; if the second service field is marked as a selected filling field in the preset field checking rule, determining whether the value of the second service field is within the preset value range of the selected filling field, and if not, making the value illegal.
Under the above mode, a method for judging that the service information is illegal according to the first service field, a method for judging that the service information is illegal according to the second service field and a method for judging that the service information is illegal when the second service field is a filling field are provided.
In an alternative embodiment, if there is one configuration field in the current configuration field combination and only one configuration field exists, a default general field checking rule in the preset checking rule table is used as the preset field checking rule.
In the above manner, the field checking rule is provided when only one configuration field exists in the current configuration field combination, namely the default general field checking rule, so that the field information is ensured to be necessarily matched with the preset field checking rule.
In a second aspect, the present application provides a field information checking apparatus, including: the acquisition module is used for acquiring field information; the field information comprises configuration field information and service field information, and the configuration field information comprises at least one configuration field; the processing module is used for taking the at least one configuration field as a current configuration field combination and acquiring a preset field inspection rule corresponding to the current configuration field combination according to a preset operation; the preset operation is as follows: matching the current configuration field combination with a preset check rule table; the preset check rule table comprises at least one field check rule; if the field checking rule can be matched, outputting the field checking rule as the preset field checking rule; if the field checking rule cannot be matched and the current configuration field combination comprises at least two configuration fields, removing one configuration field from the current configuration field combination, taking the configuration field combination with the one configuration field removed as the current configuration field combination again, and returning to the step of matching the configuration field combination with a preset checking rule table; and checking the business field information according to the preset field checking rule.
In an alternative embodiment, the processing module is specifically configured to: according to a preset mapping rule, the current interface field combination is mapped into a character string; determining a sub-inspection rule table corresponding to the type of the character string from the preset inspection rule table; and determining whether the character string has a corresponding field check rule in the sub check rule table.
In an alternative embodiment, each field inspection rule in the preset inspection rule table marks a failure period attribute and/or an effective period attribute, wherein the failure period attribute indicates that the field inspection rule is unmatched at the current time, and the effective period attribute indicates that the field inspection rule is matchable at the current time, and the processing module is further configured to: matching the current configuration field combination with a first time efficiency test rule table; the first time-efficiency test rule table is a combination of field test rules after the field test rules of the mark failure time period attribute are removed from the preset test rule table; and/or matching the current configuration field combination with a second aging test rule table; the second aging test rule table is a combination of field test rules marking the effective period attribute in the preset test rule table.
In an alternative embodiment, the processing module is specifically configured to: if a first service field is marked in the preset field checking rule as a necessary field in the service information, and the service information does not comprise the first service field, or the value of the first service field is empty, determining that the service information is illegal; for a second service field, the second service field is any service field existing in the service field information and the preset field checking rule, and if any one of at least one check of the second service field is illegal, determining that the service information is illegal; the at least one test includes: whether the value format of the second service field accords with the preset format of the second service field or not, if not, the value format of the second service field is illegal; whether the length of the value of the second service field accords with the preset length of the second service field or not, if not, the value of the second service field is illegal; if the second service field is marked as a selected filling field in the preset field checking rule, determining whether the value of the second service field is within the preset value range of the selected filling field, and if not, making the value illegal.
In an alternative embodiment, the processing module is further configured to: and if the current configuration field combination has one configuration field and only one configuration field, taking a default general field check rule in the preset check rule table as the preset field check rule.
The advantages of the second aspect and the embodiments of the second aspect may be referred to the advantages of the first aspect and the embodiments of the first aspect, and will not be described here again.
In a third aspect, embodiments of the present application provide a computer device, including a program or instructions, which when executed, is configured to perform the method of the first aspect and the embodiments of the first aspect.
In a fourth aspect, embodiments of the present application provide a storage medium including a program or instructions, which when executed, are configured to perform the method of the first aspect and the respective embodiments of the first aspect.
Drawings
Fig. 1 is a schematic flow chart of steps of a field information checking method according to an embodiment of the present application;
fig. 2 is a schematic diagram of a data structure of field information according to an embodiment of the present application;
FIG. 3 is a schematic diagram of a correspondence between a character string and a sub-inspection rule table according to an embodiment of the present application;
Fig. 4 is a schematic flow chart of specific steps of a field information checking method according to an embodiment of the present application;
fig. 5 is a schematic structural diagram of a field information checking device according to an embodiment of the present application.
Detailed Description
In order to better understand the above technical solutions, the following detailed description will be made with reference to the accompanying drawings and specific embodiments, and it should be understood that specific features in the embodiments and examples of the present application are detailed descriptions of the technical solutions of the present application, and not limit the technical solutions of the present application, and the technical features in the embodiments and examples of the present application may be combined with each other without conflict.
For ease of description, keywords and abbreviations presented in this application are first introduced.
Configuration field information: a preset field check rule for determining a match of field information, the configuration field information including at least one configuration field.
For example, the configuration field information may include: MERCHANT_ID: the partner platform accesses the ID number of the line; ps_code: a product type; txn_id: a transaction code; txn_type: transaction type.
Service field information: the combination of the fields to be checked in the field information, the field check rule for the service field in the service field information, depends on the configuration field information.
For example, the service field information may include: app_no: application number; NAME: a name; id_type: certificate submission types.
In the operation process of a financial institution (a banking institution, an insurance institution or a securities institution), some financial systems need to realize a financial transaction function by transmitting fields to an external service interface, and because the financial transaction has high requirements on operation stability, the field information transmitted to the financial systems needs to be checked. Because the services of the access parties are different, the same external service interface may have more or less difference in field information. In the prior art, all service fields of an access party are checked according to the same general field check rule. But the requirements for each access party are different for the same service field for different access parties. Obviously, one common field verification rule has poor adaptability to field information verification of different access parties. This situation does not meet the requirements of financial institutions such as banks, and cannot guarantee efficient operation of various businesses of the financial institutions.
Therefore, the embodiment of the present application provides a field information checking method, as shown in fig. 1, which is a schematic flow chart of steps of the field information checking method provided in the embodiment of the present application. It should be noted that, the field information applicable to the method shown in fig. 1 may be an interface field when an application system interface is input, and the scenario is not limited herein. The method shown in fig. 1 can be used for differentiated configuration and management of a system interface, and for the same system interface, the requirements of field information sent by different access parties can be differentiated through rapid configuration.
Step 101: and acquiring field information.
Step 102: and taking the at least one configuration field as a current configuration field combination, and acquiring a preset field inspection rule corresponding to the current configuration field combination according to a preset operation.
Step 103: and checking the business field information according to the preset field checking rule.
In step 101, the field information includes configuration field information and service field information, and a specific data structure of the field information including at least one configuration field may be described in detail with reference to fig. 2, as shown in fig. 2, which is a schematic data structure of the field information provided in an embodiment of the present application. In the data structure shown in fig. 2, the column field names of the 1 st to 4 th rows are one configuration field, and the column field names of the 1 st to 4 th rows constitute configuration field information. And the column item names of each of the 5 th to 13 th rows are a service field, and the column item names of the 5 th to 13 th rows form service field information. Wherein R represents a mandatory term and O represents an optional term.
As can be seen from fig. 2, there are two types of functions for an interface with a transaction service code txn_id of 90032, which means that an approval function is performed when the transaction type is 0, and only information synchronization is performed when the transaction type is 1. The field information represented on the field information, i.e., the txn_id 90032, can be classified into two TYPEs according to the transaction TYPE txn_type. For the same interface, different transaction types may have differences in field requirements, and each transaction type may also have differences in fields for different partners, and may also have differences in fields for different product categories for the same partner. Thus, the field information may be classified according to the configuration field, and the service field may be checked according to the corresponding field check rule.
In step 102, the preset operation is: matching the current configuration field combination with a preset check rule table; the preset check rule table comprises at least one field check rule; if the field checking rule can be matched, outputting the field checking rule as the preset field checking rule; if the field checking rule cannot be matched and the current configuration field combination comprises at least two configuration fields, removing one configuration field from the current configuration field combination, taking the configuration field combination with the one configuration field removed as the current configuration field combination again, and returning to the step of matching the configuration field combination with a preset checking rule table. The order of removing one configuration field from the current configuration field combination can be removed according to a preset priority.
It should be noted that, the preset operation may further include: and if the current configuration field combination has one configuration field and only one configuration field, taking a default general field check rule in the preset check rule table as the preset field check rule.
For example, for 4 configuration fields in a configuration field combination: A. b, C and D. The current configuration field combination is ABCD. Firstly, matching ABCD with a preset checking rule table, if the ABCD is not matched and the preset priority indication is removed D, combining the current configuration field into ABC, matching ABC with the preset checking rule table, if the ABCD is still not matched and the preset priority indication is removed C, then matching AB with the preset checking rule table, and if the AB is still not matched and the preset priority indication is removed B, determining the preset field checking rule according to the following optional implementation modes. The alternative embodiment is specifically as follows: and if the current configuration field combination has one configuration field and only one configuration field, taking a default general field check rule in the preset check rule table as the preset field check rule. I.e. when the current configuration field combination is a, the preset field check rule is a default generic field check rule.
An alternative embodiment of step 102 is described below with reference to fig. 2 by way of specific example, and an alternative embodiment of matching the current configuration field combinations to a preset verification rule table is as follows:
according to a preset mapping rule, the current interface field combination is mapped into a character string; determining a sub-inspection rule table corresponding to the type of the character string from the preset inspection rule table; and determining whether the character string has a corresponding field check rule in the sub check rule table.
In the above optional implementation manner of the embodiment of the present application, 4 fields, i.e., txn_id, txn_ TYPE, MERCHANT _id, and ps_code, are used as configuration field information, and according to different uploading contents, a corresponding preset field checking rule may be obtained. The following describes in detail with reference to fig. 3, and as shown in fig. 3, a schematic diagram of a correspondence relationship between a character string and a sub-inspection rule table is provided in an embodiment of the present application. Wherein the first column of intermediate_key represents a character string, the first column of intermediate_value represents a sub-check rule table when the character string is a character string mapped by txn_id, txn_ TYPE, MERCHANT _id, ps_code, and in addition, AVAILABLE represents whether a field check rule exists in each row of the sub-check rule table, and Y represents the existence.
Based on the KEY and the interface configuration design of the VALUE, the KEY VALUE can be flexibly combined in the KEY fields of TXN_ID, TXN_ TYPE, MERCHANT _ID and PS_CODE, for example, under the same TXN_ID and TXN_TYPE, only different MERCHANT_IDs are needed to be subjected to interface field difference distinction, and different PS_CODE has no difference, so the KEY VALUE only needs to contain TXN_ID and TXN_ TYPE, MERCHANT _ID; similarly, if there is no difference between different MERCHANT_IDs under the same TXN_ID and TXN_TYPE, the KEY value only needs to contain TXN_ID and TXN_TYPE, and the like, if the KEY value is an interface field common to all partners and products, only the TXN_ID is configured.
In the above alternative embodiment, it is preferable to take the most refined KEY value to perform matching whether there is a corresponding configuration of the interface checking rule, that is, the txn_id, txn_ TYPE, MERCHANT _id, ps_code are mapped to different character strings, if the KEY value is not matched to the rule, the matching is continued according to the txn_id, txn_ TYPE, MERCHANT _id, and if the KEY value is not matched, the txn_id, txn_type, or txn_id is continuously used for matching, and when the field checking rule is matched only by using the txn_id, it is actually equivalent to that the caller does not need to perform customized management of the interface rule, and a default universal interface checking rule is used.
The field information checking method can be continuously optimized subsequently, the effective period attribute and the ineffective period attribute can be added on the preset field checking rule configuration, so that the configuration can be carried out in advance for some expected changes, the effective period of the new configuration item is set to be a required period, and the ineffective period attribute can be similarly configured, so that after the set effective period or ineffective period is reached, the old field checking rule configuration automatically fails, the service automatically uses the new effective field checking rule, the limitation that the current field checking change can only be carried out at the appointed time (such as when a user cooperates with the change at the same time) is solved, and the field checking method is more flexible in actual use.
Based on the validation period and the invalidation period, another alternative embodiment of matching the current configuration field combination with the preset check rule table is as follows:
each field test rule in the preset test rule table marks a failure time period attribute and/or an effective time period attribute, the failure time period attribute indicates that the field test rule is unmatched at the current time, the effective time period attribute indicates that the field test rule is matchable at the current time, and the matching of the current configuration field combination and the preset test rule table further comprises: matching the current configuration field combination with a first time efficiency test rule table; the first time-efficiency test rule table is a combination of field test rules after the field test rules of the mark failure time period attribute are removed from the preset test rule table; and/or matching the current configuration field combination with a second aging test rule table; the second aging test rule table is a combination of field test rules marking the effective period attribute in the preset test rule table.
After step 102, the validity of the service information of the transaction requester may be checked by combining with a preset field check rule, where the preset field check rule may be stored in a format of an extensible markup language (Extensible Markup Language, xml), or may be stored in other data storage files, such as excel. For example, dimension control of service fields corresponding to each type of transaction is designed in an excel table, the excel file is put under the engineering of application service, a set of modules for analyzing the file format and the content of the excel table is written, when an application process is started, the configuration contents are loaded into a memory by loading the modules and organized according to a certain mode, and when a requester calls an interface, the interface is matched with field information sent by the requester, so that the same effect can be achieved.
The preset field checking rules include a checking rule for each service field in the service fields, for example, each service field may have several attributes, such as a fieldName indicates a name of the service field, a fieldType indicates a service field type (such as String, bigDecimal, array, etc.), fmtdegualr indicates a service field format length, fieldLevel indicates a hierarchy (normally 1 layer, if an array is provided, a service field in the array is 2 layers, and so on), forceExist indicates whether the service field is a mandatory field (true indicates that the field must appear in an interface request message and has a value), dic indicates that the service field is an unnecessary field, if the service field needs to limit an upload value, configuration is performed, for example, the upper example indicates that the value of the field can only be uploaded Normally (NORMAL) or a computer instruction (SUND), and if other values are illegal; the above is a detailed description of the checking rules for one of the business fields, a preset field checking rule being a set of a plurality of such field checking rules.
An alternative embodiment of step 103 is as follows:
if a first service field is marked in the preset field checking rule as a necessary field in the service information, and the service information does not comprise the first service field, or the value of the first service field is empty, determining that the service information is illegal; for a second service field, the second service field is any service field existing in the service field information and the preset field checking rule, and if any one of at least one check of the second service field is illegal, determining that the service information is illegal; the at least one test includes: whether the value format of the second service field accords with the preset format of the second service field or not, if not, the value format of the second service field is illegal; whether the length of the value of the second service field accords with the preset length of the second service field or not, if not, the value of the second service field is illegal; if the second service field is marked as a selected filling field in the preset field checking rule, determining whether the value of the second service field is within the preset value range of the selected filling field, and if not, making the value illegal.
In connection with the schematic diagram of the data structure of field information shown in fig. 2, the specific procedure of the above embodiment may include:
(1) If in the preset field checking rule, if there must exist (forceexists) the service field configured as true (true), if there is no service field or if there is this service field but the value is empty in the field information sent on the calling party, a prompt of "check failed, field cannot be empty" is returned.
(2) If the service field in the field information does not exist in the interface checking rule, the service field is filtered out and does not enter into the checking of the preset field checking rule.
(3) If the service field in the field information exists in the interface check rule, checking whether the format of the field value is correct according to the field format (fieldType), and if so, checking whether the length of the field value is consistent; if the check is not passed, a prompt of 'incorrect field format' is returned.
(4) If the service field has a dic configuration item, the value of the service field has clear content range check, the value sent by the service field must be in the range of the dic configuration, if the value is not in the range, the check is not passed, and a prompt of 'incorrect field value' is returned.
According to the method, the preset field inspection rule is acquired according to the preset operation in the configuration field information of the field information, the configuration field information is firstly matched with the preset inspection rule table, and as the current configuration field combination comprises the most configuration fields when the current configuration field combination is the configuration field information, the configuration field combination which is matched with the preset inspection rule table is most suitable for the inspection of the field information, and the configuration field combination with one configuration field removed is not matched again as the current configuration field combination and is matched with the preset inspection rule table, so that the preset field inspection rule which is suitable for the field information as much as possible is found, and the adaptability of the field information inspection is improved. In addition, the same field inspection rule can be flexibly changed according to factors such as a user, a business scene and the like, and the interface inspection rule can be directly and quickly used for adapting management without adjustment at an application layer.
For example, a flowchart of steps of a combined embodiment may be shown in fig. 4, and fig. 4 is a schematic diagram of steps of a field information checking method provided in this embodiment of the present application.
Fig. 5 is a schematic structural diagram of a field information checking device according to an embodiment of the present application.
The application provides a field information verifying apparatus, including: an obtaining module 501, configured to obtain field information; the field information comprises configuration field information and service field information, and the configuration field information comprises at least one configuration field; a processing module 502, configured to use the at least one configuration field as a current configuration field combination, and obtain a preset field inspection rule corresponding to the current configuration field combination according to a preset operation; the preset operation is as follows: matching the current configuration field combination with a preset check rule table; the preset check rule table comprises at least one field check rule; if the field checking rule can be matched, outputting the field checking rule as the preset field checking rule; if the field checking rule cannot be matched and the current configuration field combination comprises at least two configuration fields, removing one configuration field from the current configuration field combination, taking the configuration field combination with the one configuration field removed as the current configuration field combination again, and returning to the step of matching the configuration field combination with a preset checking rule table; and checking the business field information according to the preset field checking rule.
In an alternative embodiment, the processing module 502 is specifically configured to: according to a preset mapping rule, the current interface field combination is mapped into a character string; determining a sub-inspection rule table corresponding to the type of the character string from the preset inspection rule table; and determining whether the character string has a corresponding field check rule in the sub check rule table.
In an alternative embodiment, each field inspection rule in the preset inspection rule table marks a failure period attribute and/or an effective period attribute, where the failure period attribute indicates that the field inspection rule is unmatched at the current time, and the effective period attribute indicates that the field inspection rule is matchable at the current time, and the processing module 502 is further configured to: matching the current configuration field combination with a first time efficiency test rule table; the first time-efficiency test rule table is a combination of field test rules after the field test rules of the mark failure time period attribute are removed from the preset test rule table; and/or matching the current configuration field combination with a second aging test rule table; the second aging test rule table is a combination of field test rules marking the effective period attribute in the preset test rule table.
In an alternative embodiment, the processing module 502 is specifically configured to: if a first service field is marked in the preset field checking rule as a necessary field in the service information, and the service information does not comprise the first service field, or the value of the first service field is empty, determining that the service information is illegal; for a second service field, the second service field is any service field existing in the service field information and the preset field checking rule, and if any one of at least one check of the second service field is illegal, determining that the service information is illegal; the at least one test includes: whether the value format of the second service field accords with the preset format of the second service field or not, if not, the value format of the second service field is illegal; whether the length of the value of the second service field accords with the preset length of the second service field or not, if not, the value of the second service field is illegal; if the second service field is marked as a selected filling field in the preset field checking rule, determining whether the value of the second service field is within the preset value range of the selected filling field, and if not, making the value illegal.
In an alternative embodiment, the processing module 502 is further configured to: and if the current configuration field combination has one configuration field and only one configuration field, taking a default general field check rule in the preset check rule table as the preset field check rule.
The embodiment of the application provides a computer device, which comprises a program or an instruction, and when the program or the instruction are executed, the program or the instruction are used for executing a field information checking method and any optional method provided by the embodiment of the application.
The embodiment of the application provides a storage medium including a program or an instruction, which when executed, is configured to perform a field information checking method and any optional method provided in the embodiment of the application.
Finally, it should be noted that: it will be appreciated by those skilled in the art that embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, optical storage, and the like) having computer-usable program code embodied therein.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to the application. It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
It will be apparent to those skilled in the art that various modifications and variations can be made in the present application without departing from the scope of the application. Thus, if such modifications and variations of the present application fall within the scope of the claims and the equivalents thereof, the present application is intended to cover such modifications and variations.

Claims (12)

1. A field information checking method, comprising:
acquiring field information; the field information comprises configuration field information and service field information, and the configuration field information comprises at least one configuration field;
taking the at least one configuration field as a current configuration field combination, and acquiring a preset field inspection rule corresponding to the current configuration field combination according to a preset operation; the preset operation is as follows: matching the current configuration field combination with a preset check rule table; the preset check rule table comprises at least one field check rule; if the field checking rule can be matched, outputting the field checking rule as the preset field checking rule; if the field checking rule cannot be matched and the current configuration field combination comprises at least two configuration fields, removing one configuration field from the current configuration field combination, taking the configuration field combination with the one configuration field removed as the current configuration field combination again, and returning to the step of matching the configuration field combination with a preset checking rule table;
And checking the business field information according to the preset field checking rule.
2. The method of claim 1, wherein said matching the current configuration field combination to a pre-set check rule table comprises:
according to a preset mapping rule, the current configuration field combination is mapped into a character string;
determining a sub-inspection rule table corresponding to the type of the character string from the preset inspection rule table;
and determining whether the character string has a corresponding field check rule in the sub check rule table.
3. The method of claim 1, wherein each field inspection rule in the preset inspection rule table marks a failure period attribute and/or an effective period attribute, the failure period attribute indicating that the field inspection rule is unmatched at a current time, the effective period attribute indicating that the field inspection rule is matchable at a current time, the matching the current configuration field combination to the preset inspection rule table further comprising:
matching the current configuration field combination with a first time efficiency test rule table; the first time-efficiency test rule table is a combination of field test rules after the field test rules of the mark failure time period attribute are removed from the preset test rule table;
And/or matching the current configuration field combination with a second aging test rule table; the second aging test rule table is a combination of field test rules marking the effective period attribute in the preset test rule table.
4. A method according to any one of claims 1-3, wherein said checking said traffic field information according to said preset field checking rules comprises:
if a first service field is marked in the preset field checking rule as a necessary field in the service field information, and the service field information does not comprise the first service field, or the value of the first service field is empty, determining that the service field information is illegal;
for a second service field, the second service field is any service field existing in the service field information and the preset field inspection rule, and if any one of at least one inspection of the second service field is illegal, determining that the service field information is illegal; the at least one test includes: whether the value format of the second service field accords with the preset format of the second service field or not, if not, the value format of the second service field is illegal; whether the length of the value of the second service field accords with the preset length of the second service field or not, if not, the value of the second service field is illegal;
If the second service field is marked as a selected filling field in the preset field checking rule, determining whether the value of the second service field is within the preset value range of the selected filling field, and if not, making the value illegal.
5. A method according to any one of claims 1-3, wherein the pre-setting operation further comprises:
and if the current configuration field combination has one configuration field and only one configuration field, taking a default general field check rule in the preset check rule table as the preset field check rule.
6. A field information checking apparatus, comprising:
the acquisition module is used for acquiring field information; the field information comprises configuration field information and service field information, and the configuration field information comprises at least one configuration field;
the processing module is used for taking the at least one configuration field as a current configuration field combination and acquiring a preset field inspection rule corresponding to the current configuration field combination according to a preset operation; the preset operation is as follows: matching the current configuration field combination with a preset check rule table; the preset check rule table comprises at least one field check rule; if the field checking rule can be matched, outputting the field checking rule as the preset field checking rule; if the field checking rule cannot be matched and the current configuration field combination comprises at least two configuration fields, removing one configuration field from the current configuration field combination, taking the configuration field combination with the one configuration field removed as the current configuration field combination again, and returning to the step of matching the configuration field combination with a preset checking rule table; and checking the business field information according to the preset field checking rule.
7. The apparatus of claim 6, wherein the processing module is specifically configured to:
according to a preset mapping rule, the current configuration field combination is mapped into a character string;
determining a sub-inspection rule table corresponding to the type of the character string from the preset inspection rule table;
and determining whether the character string has a corresponding field check rule in the sub check rule table.
8. The apparatus of claim 6, wherein each field inspection rule in the preset inspection rule table marks a failure period attribute indicating that the field inspection rule is unmatched at a current time and/or a validation period attribute indicating that the field inspection rule is matchable at the current time, the processing module further to:
matching the current configuration field combination with a first time efficiency test rule table; the first time-efficiency test rule table is a combination of field test rules after the field test rules of the mark failure time period attribute are removed from the preset test rule table;
and/or matching the current configuration field combination with a second aging test rule table; the second aging test rule table is a combination of field test rules marking the effective period attribute in the preset test rule table.
9. The apparatus according to any of the claims 6-8, wherein the processing module is specifically configured to:
if a first service field is marked in the preset field checking rule as a necessary field in the service field information, and the service field information does not comprise the first service field, or the value of the first service field is empty, determining that the service field information is illegal;
for a second service field, the second service field is any service field existing in the service field information and the preset field inspection rule, and if any one of at least one inspection of the second service field is illegal, determining that the service field information is illegal; the at least one test includes: whether the value format of the second service field accords with the preset format of the second service field or not, if not, the value format of the second service field is illegal; whether the length of the value of the second service field accords with the preset length of the second service field or not, if not, the value of the second service field is illegal;
if the second service field is marked as a selected filling field in the preset field checking rule, determining whether the value of the second service field is within the preset value range of the selected filling field, and if not, making the value illegal.
10. The apparatus of any of claims 6-8, wherein the processing module is further to:
and if the current configuration field combination has one configuration field and only one configuration field, taking a default general field check rule in the preset check rule table as the preset field check rule.
11. A computer device comprising a program or instructions which, when executed, performs the method of any of claims 1 to 5.
12. A storage medium comprising a program or instructions which, when executed, perform the method of any one of claims 1 to 5.
CN201910580581.3A 2019-06-28 2019-06-28 Method and device for checking field information Active CN110287383B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201910580581.3A CN110287383B (en) 2019-06-28 2019-06-28 Method and device for checking field information
PCT/CN2020/091658 WO2020259147A1 (en) 2019-06-28 2020-05-21 Field information checking method and apparatus

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910580581.3A CN110287383B (en) 2019-06-28 2019-06-28 Method and device for checking field information

Publications (2)

Publication Number Publication Date
CN110287383A CN110287383A (en) 2019-09-27
CN110287383B true CN110287383B (en) 2023-06-09

Family

ID=68019818

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910580581.3A Active CN110287383B (en) 2019-06-28 2019-06-28 Method and device for checking field information

Country Status (2)

Country Link
CN (1) CN110287383B (en)
WO (1) WO2020259147A1 (en)

Families Citing this family (16)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110287383B (en) * 2019-06-28 2023-06-09 深圳前海微众银行股份有限公司 Method and device for checking field information
CN110704686B (en) * 2019-10-08 2022-03-18 北京锐安科技有限公司 Quality detection method and device for semi-structured data, storage medium and equipment
CN111159482A (en) * 2019-12-19 2020-05-15 贝壳技术有限公司 Data verification method and system
CN111209538A (en) * 2020-01-03 2020-05-29 北京明略软件系统有限公司 Table data quality probing method and device
CN111459970A (en) * 2020-03-31 2020-07-28 交通银行股份有限公司 Method for checking uniqueness of object information
CN111754232B (en) * 2020-06-29 2023-11-28 上海通联金融服务有限公司 Control method for verifying key fields before non-financial transaction
CN112015728A (en) * 2020-09-08 2020-12-01 浙江惠瀜网络科技有限公司 Method for automatically checking acquired data
CN112256737A (en) * 2020-10-30 2021-01-22 深圳前海微众银行股份有限公司 HIVE rule matching data method, device and storage medium
CN113065920A (en) * 2021-04-12 2021-07-02 北京京东振世信息技术有限公司 Data processing method and system
CN113535776A (en) * 2021-05-28 2021-10-22 国网辽宁省电力有限公司 Parameter validity checking method and system applied to monitoring device
CN113268290A (en) * 2021-06-16 2021-08-17 中移(杭州)信息技术有限公司 Software container optimization method, device, equipment and computer program product
CN113609014A (en) * 2021-08-04 2021-11-05 深圳鼎盛电脑科技有限公司 Interface field checking method and device, storage medium and electronic equipment
CN113836126B (en) * 2021-09-22 2024-01-30 上海妙一生物科技有限公司 Data cleaning method, device, equipment and storage medium
CN116415199B (en) * 2023-04-13 2023-10-20 广东铭太信息科技有限公司 Business data outlier analysis method based on audit intermediate table
CN116719875B (en) * 2023-08-09 2023-12-26 恩核(北京)信息技术有限公司 Data standardization maintenance method, system, equipment and medium
CN117151864A (en) * 2023-09-13 2023-12-01 中邮消费金融有限公司 Automatic bad loan responsibility identification method and system

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108132880A (en) * 2017-12-21 2018-06-08 武汉斑马快跑科技有限公司 A kind of parameter verification method and device
CN109726370A (en) * 2018-12-29 2019-05-07 北京中电普华信息技术有限公司 A kind of configurable verification rule packaging method and device

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20170063696A1 (en) * 2015-08-27 2017-03-02 Hewlett Packard Enterprise Development Lp Data packet flow rule field range of an application specific integrated circuit
CN110287383B (en) * 2019-06-28 2023-06-09 深圳前海微众银行股份有限公司 Method and device for checking field information

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108132880A (en) * 2017-12-21 2018-06-08 武汉斑马快跑科技有限公司 A kind of parameter verification method and device
CN109726370A (en) * 2018-12-29 2019-05-07 北京中电普华信息技术有限公司 A kind of configurable verification rule packaging method and device

Also Published As

Publication number Publication date
CN110287383A (en) 2019-09-27
WO2020259147A1 (en) 2020-12-30

Similar Documents

Publication Publication Date Title
CN110287383B (en) Method and device for checking field information
CN107395353B (en) block chain consensus method and device
JP6940662B2 (en) Methods and systems for the protection and verification of identities and certificates via the blockchain
US8516037B2 (en) Methods for dynamic partitioning of applications in client-server environments
US9483386B2 (en) Information interaction test device and method based on automatic generation of associated test cases
WO2022046313A1 (en) Cryptographic-asset collateral management
CN109614262B (en) Service checking method, device and computer readable storage medium
CN107025108B (en) Exporting hierarchical data from a Source Code Management (SCM) system to a Product Lifecycle Management (PLM) system
CN110309099A (en) Interface managerial method, device, equipment and computer readable storage medium
US11914574B2 (en) Generation of inconsistent testing data
CN109146444B (en) Virtual account creating method and device and account information updating method and device
CN112632947A (en) Online document processing method, online document processing device and electronic equipment
CN110544092B (en) Dynamic newly-added multi-type database data operation chaining method for block chain
CN110336872B (en) Method, device and system for acquiring third-party data
CN106506661A (en) Method, server and system for dynamically returning data
CN115829307A (en) Automatic production method and device of smart card and readable storage medium
CN107277108B (en) Method, device and system for processing messages at nodes of block chain
CN113704123B (en) Interface testing method, device, equipment and storage medium
CN111260375B (en) Service processing method and device
CN102663614B (en) Customer relation management is to the collocation method of service release and system
CN111090638A (en) Method and device for comparing transaction functions in database migration
US20230401181A1 (en) Data Management Ecosystem for Databases
CN116774983A (en) Workflow method based on flow
US20240020288A1 (en) Data validation device, data validation method, and non-transitory computer-readable medium
US20120089989A1 (en) Systems and methods for executing and implementing computer processes in process environments

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
GR01 Patent grant
GR01 Patent grant