CN116166972A - Data matching method and device - Google Patents

Data matching method and device Download PDF

Info

Publication number
CN116166972A
CN116166972A CN202310153192.9A CN202310153192A CN116166972A CN 116166972 A CN116166972 A CN 116166972A CN 202310153192 A CN202310153192 A CN 202310153192A CN 116166972 A CN116166972 A CN 116166972A
Authority
CN
China
Prior art keywords
data
matched
keyword
matching
fields
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
CN202310153192.9A
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.)
Bank of China Financial Technology Co Ltd
Original Assignee
Bank of China Financial Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Bank of China Financial Technology Co Ltd filed Critical Bank of China Financial Technology Co Ltd
Priority to CN202310153192.9A priority Critical patent/CN116166972A/en
Publication of CN116166972A publication Critical patent/CN116166972A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/22Indexing; Data structures therefor; Storage structures
    • G06F16/2282Tablespace storage structures; Management thereof

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Software Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The application discloses a data matching method, which can be applied to the technical field of data processing. The method comprises the following steps: the method comprises the steps that data to be matched can be obtained, keyword fields in the data to be matched are matched with keyword fields of configuration data in a preset configuration file or database code table according to preset matching rules, and if the fact that the data to be matched and the configuration data have matched keyword fields is determined, matching results are output, namely, the matching data can be configured into the configuration file or the database code table in advance according to matching scene configuration.

Description

Data matching method and device
Technical Field
The present disclosure relates to the field of data processing technologies, and in particular, to a data testing method.
Background
At present, in program development, as requirements of a plurality of business scenes on real-time data are more and more important, especially requirements of real-time data classification and the like on the data are more and more, real-time matching, transaction classification, client preference classification and the like of all the data are more and more, data matching is required for classifying the data each time, corresponding real-time matching codes are required to be written for each time of matching change of the real-time business scenes, along with the increase of matching scenes and the more and more matching classification requirements of business on the real-time data, the more and more data matching classification functions of a corresponding system are improved, and a large number of codes are required to be written correspondingly. Since a large number of codes need to be written, a long time is required for the labor, resulting in a large amount of labor.
Therefore, how to greatly reduce the manpower consumption in the data matching scene is a technical problem that needs to be solved by those skilled in the art.
Disclosure of Invention
Based on the above problems, the application provides a data matching method and device, so as to greatly reduce the manpower consumption in a data matching scene. The embodiment of the application discloses the following technical scheme.
In a first aspect, the present application provides a data matching method, including:
acquiring data to be matched;
matching the keyword field in the data to be matched with the keyword field of the configuration data in a preset configuration file or a database code table according to a preset matching rule;
and if the keyword fields of the data to be matched and the configuration data are determined to be matched, outputting a matching result.
Optionally, before the obtaining the data to be matched, the method further includes:
acquiring initial data in the configuration file or a database code table;
checking the initial data in the configuration file or the database code table according to a preset checking rule to obtain configuration data;
optionally, the matching, according to a preset matching rule, the keyword field in the data to be matched with the keyword field of the configuration data in a preset configuration file or a database code table includes:
and if the keyword field in the data to be matched is smaller than the keyword field in the configuration data, using the keyword field in the data to be matched to match the keyword field in the configuration data.
If the keyword field in the data to be matched is determined to be larger than the keyword field in the configuration data, the keyword field in the configuration data is used for matching the keyword field in the data to be matched.
Optionally, the matching in the keyword field in the data to be matched by using the keyword field in the configuration data includes:
and selecting a preset number of key word fields from the configuration data according to the priority from high to low each time according to the priority of the preset key word fields, and matching the key word fields in the data to be matched.
Optionally, if it is determined that the data to be matched and the configuration data have matching keyword fields, outputting a matching result includes:
if the data to be matched and the configuration data are determined to have a matched keyword field, outputting the matched keyword field;
if the data to be matched and the configuration data are determined to have a plurality of matched keyword fields, outputting the matched keyword field with the highest priority among the plurality of matched keyword fields according to the preset keyword field priority.
In a second aspect, the present application provides a data matching apparatus, including:
the first acquisition module is used for acquiring data to be matched;
the matching module is used for matching the keyword field in the data to be matched with the keyword field of the configuration data in a preset configuration file or database code table according to a preset matching rule;
and the output module is used for outputting a matching result if the keyword field for matching the data to be matched and the configuration data is determined.
Optionally, the apparatus further includes:
the second acquisition module is used for acquiring initial data in the configuration file or the database code table;
the obtaining module is used for verifying the initial data in the configuration file or the database code table according to a preset verification rule to obtain configuration data.
Optionally, the first matching module includes:
the first matching unit is used for matching the keyword fields in the configuration data by using the keyword fields in the data to be matched if the keyword fields in the data to be matched are determined to be smaller than the keyword fields in the configuration data;
and the second matching unit is used for matching the keyword fields in the data to be matched by using the keyword fields in the configuration data if the keyword fields in the data to be matched are determined to be larger than the keyword fields in the configuration data.
Optionally, the second matching unit is specifically configured to:
and selecting a preset number of key word fields from the configuration data according to the priority from high to low each time according to the priority of the preset key word fields, and matching the key word fields in the data to be matched.
Optionally, the output module is specifically configured to:
if the data to be matched and the configuration data are determined to have a matched keyword field, outputting the matched keyword field;
if the data to be matched and the configuration data are determined to have a plurality of matched keyword fields, outputting the matched keyword field with the highest priority among the plurality of matched keyword fields according to the preset keyword field priority.
In a third aspect, embodiments of the present application provide an apparatus comprising a memory for storing instructions or code and a processor for executing the instructions or code to cause the apparatus to perform the method of any one of the preceding aspects.
In a fourth aspect, embodiments of the present application provide a computer storage medium having code stored therein, which when executed, causes an apparatus running the code to implement the method of any one of the first aspects.
Compared with the prior art, the application has the following beneficial effects:
according to the method and the device, the data to be matched can be obtained, the keyword fields in the data to be matched are matched with the keyword fields of the configuration data in the preset configuration file or database code table according to the preset matching rule, and if the fact that the matched keyword fields exist in the data to be matched and the configuration data is determined, the matching result is output, namely, the matching data can be configured into the configuration file or the database code table in advance according to the configuration of the matching scene.
Drawings
In order to more clearly illustrate the present embodiments or the technical solutions in the prior art, the drawings that are required for the embodiments or the description of the prior art will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 is a flowchart of a data matching method provided in an embodiment of the present application;
fig. 2 is a schematic structural diagram of a data matching device according to an embodiment of the present application.
Detailed Description
The following description of the technical solutions in the embodiments of the present application will be made clearly and completely with reference to the drawings in the embodiments of the present application, and it is apparent that the described embodiments are only some embodiments of the present application, but not all embodiments. All other embodiments obtained by those skilled in the art based on the embodiments herein without making any inventive effort are intended to fall within the scope of the present application.
It should be noted that, the data matching method and apparatus provided in the present application are used in the field of data processing, and the foregoing is merely an example, and the application fields of the method and apparatus names provided in the present application are not limited.
At present, in program development, as requirements of a plurality of business scenes on real-time data are more and more important, especially requirements of real-time data classification and the like on the data are more and more, real-time matching, transaction classification, client preference classification and the like of all the data are more and more, data matching is required for classifying the data each time, corresponding real-time matching codes are required to be written for each time of matching change of the real-time business scenes, along with the increase of matching scenes and the more and more matching classification requirements of business on the real-time data, the more and more data matching classification functions of a corresponding system are improved, and a large number of codes are required to be written correspondingly.
According to the method and the device, the data to be matched can be obtained, the keyword fields in the data to be matched are matched with the keyword fields of the configuration data in the preset configuration file or database code table according to the preset matching rule, and if the fact that the matched keyword fields exist in the data to be matched and the configuration data is determined, the matching result is output, namely, the matching data can be configured into the configuration file or the database code table in advance according to the configuration of the matching scene.
The method provided by the embodiment of the application can be executed by the back-end server.
In order to provide a better understanding of the present application, those skilled in the art will now make further details of the present application with reference to the drawings and detailed description. The method provided in the embodiment of the present application is described below as an example performed by the first device.
Fig. 1 is a flowchart of a data matching method provided in an embodiment of the present application, as shown in fig. 1, where the method includes:
s101: and obtaining data to be matched.
The first device may pre-configure the initial data to the configuration file or the database code table before acquiring the data to be matched, and then the first device may read the database code table or the configuration file, where the initial data may be read by using a JAVA program, or may be read by using other manners, which is not limited herein. The initial data content configured into the configuration file or configuration code table may include: keyword field, keyword field sequence number, keyword field class name, keyword field priority, etc.
The first device reads the database code table or the configuration file, which may also be referred to as parsing the database code table or the configuration file to determine whether the configuration file format or the database code table structure is correct, and checks whether the data in the database code table is correct, for example: the key field sequence number cannot be repeated, the key field priority cannot be the same, and so on.
Specifically, for the configuration file, the configuration file may be parsed according to a preset checking rule, to verify the integrity and correctness of configuration parameters of the configuration file, for example, the preset checking rule may be to check the correctness of the configuration parameters, whether the sequence number of the keyword field and the priority of the keyword field in the parameters are null, whether the sequence number and the priority of the keyword field are integers, whether the sequence number and the priority of the keyword field are repeated, and the like.
For the database code table, the database code table can be analyzed according to a preset checking rule, the integrity of configuration parameters of the database code table is verified, and the correctness of the configuration parameters is verified, for example, the preset checking rule can be used for checking whether the sequence numbers of the keyword fields and the priorities of the keyword fields in the parameters are null, integers, repetitions and the like.
After checking the initial data in the configuration file or database code table, configuration data can be obtained and then loaded. The loaded configuration data can be loaded according to the priority of the keyword field, keywords in the configuration data are loaded, the length of each keyword is calculated, then duplication is removed, and the configuration data is stored, for example, three keywords exist in the configuration data, the lengths after duplication removal are respectively 2,4 and 6, and the three keywords and the length of each duplicated keyword can be stored.
The first device receives real-time data to be matched, namely the data to be matched are split according to the length of the key words, and the total number of split fields is counted.
S102: and matching the keyword field in the data to be matched with the keyword field of the configuration data in a preset configuration file or database code table according to a preset matching rule.
And the first equipment matches the keyword field in the data to be matched with the keyword field of the configuration data in a preset configuration file or database code table according to a preset matching rule.
Specifically, the first device may determine the total number of the keyword fields split by the data to be matched and the total number of the keywords in the configuration file, where the total number of the keyword fields split by the data to be matched may be named as a set data, the total number of the keywords in the configuration file may be named as B set data, if it is determined that the total number of the keyword fields in the a set data is greater than the keyword fields in the B set data, the B set data is used to match the a set data, and if it is determined that the total number of the keyword fields in the B set data is greater than the keyword fields in the a set data, the B set data is used to match the B set data, so that the total number of the dematched fields with fewer fields is used, and the purpose of high speed and high efficiency may be achieved. It should be noted that the matching process may be performed by multiple key fields in a multi-threaded and concurrent manner.
The matching process can be divided into two cases, wherein in the first case, the total number of the keyword fields is less than that of the data to be matched, and the keyword fields in the set A data can be used for multithreading to match the keyword fields in the set B data.
In the second case, the number of the keyword fields is less than that of the data in the configuration file or the configuration table, the keyword fields can be ranked from high to low according to the preset keyword field priority, a preset number of keyword fields are selected from the configuration data from high to low according to the priority each time to match the keyword fields in the data to be matched, for example, the preset number is set to 3, the keyword fields with the first three keyword fields from high to low in ranking can be selected from the keyword fields to match, and the keyword fields with the fourth to sixth keyword fields from high to low in ranking can be selected from the keyword fields to match if the second matching is needed. And so on.
S103: and if the keyword fields of the data to be matched and the configuration data are determined to be matched, outputting a matching result.
For the first case, if no matching result is obtained, returning that no matching is performed, if it is determined that one keyword field exists in the data to be matched and the configuration data, outputting the content and the length of the keyword field, and if it is determined that a plurality of matched keyword fields exist in the data to be matched and the configuration data, outputting the matching keyword field with the highest priority in the plurality of matched keyword fields according to the preset keyword field priority.
Aiming at the second situation, if the keyword field with the matching success exists in the first matching, whether all the keyword fields with higher priority than the keyword field are matched completely or not can be judged, and if yes, the keyword fields with lower priority than the keyword field on the matching are not matched, a result can be directly output, and the content and the length of the keyword field are output.
If there are a plurality of key fields for which matching is successful, for example, there is also a key matching that is higher in priority than the key field, only the key field of higher priority is output.
And selecting a preset number of keyword fields from the configuration data according to the priority from high to low to match the keyword fields in the data to be matched, carrying out next matching according to the principle if the keyword fields which are not matched successfully are not matched, until the data in the configuration data are completely matched, and outputting the fact that the matching is not carried out if the keyword fields which are not matched successfully are not matched.
According to the method and the device, the data to be matched can be obtained, the keyword fields in the data to be matched are matched with the keyword fields of the configuration data in the preset configuration file or database code table according to the preset matching rule, and if the fact that the matched keyword fields exist in the data to be matched and the configuration data is determined, the matching result is output, namely, the matching data can be configured into the configuration file or the database code table in advance according to the configuration of the matching scene.
The above provides some specific implementations of the method for providing data matching in the embodiments of the present application, and based on this, the present application further provides a corresponding apparatus. The device provided by the embodiment of the present application will be described in terms of functional modularization, and the device and the number matching method described above may be referred to correspondingly.
Fig. 2 is a schematic structural diagram of a data matching device according to an embodiment of the present application. As shown in fig. 2, the apparatus includes:
a first obtaining module 200, configured to obtain data to be matched;
the matching module 201 is configured to match the keyword field in the data to be matched with the keyword field of the configuration data in a preset configuration file or a database code table according to a preset matching rule;
and the output module 202 is configured to output a matching result if it is determined that the data to be matched and the configuration data have matching keyword fields.
Optionally, the apparatus further includes:
the second acquisition module is used for acquiring initial data in the configuration file or the database code table;
the obtaining module is used for verifying the initial data in the configuration file or the database code table according to a preset verification rule to obtain configuration data.
Optionally, the first matching module includes:
and the first matching unit is used for matching the keyword fields in the configuration data by using the keyword fields in the data to be matched if the keyword fields in the data to be matched are determined to be smaller than the keyword fields in the configuration data.
And the second matching unit is used for matching the keyword fields in the data to be matched by using the keyword fields in the configuration data if the keyword fields in the data to be matched are determined to be larger than the keyword fields in the configuration data.
Optionally, the second matching unit is specifically configured to:
and selecting a preset number of key word fields from the configuration data according to the priority from high to low each time according to the priority of the preset key word fields, and matching the key word fields in the data to be matched.
Optionally, the output module is specifically configured to:
if the data to be matched and the configuration data are determined to have a matched keyword field, outputting the matched keyword field;
if the data to be matched and the configuration data are determined to have a plurality of matched keyword fields, outputting the matched keyword field with the highest priority among the plurality of matched keyword fields according to the preset keyword field priority.
In the device, the first obtaining module 200 may obtain data to be matched, the matching module 201 matches a keyword field in the data to be matched with a keyword field of configuration data in a preset configuration file or database code table according to a preset matching rule, and the output module 202 outputs a matching result if determining that the data to be matched and the configuration data have matched keyword fields, that is, the device in the device may configure the matching data into the configuration file or database code table in advance according to the configuration of the matching scene.
The embodiment of the application also provides corresponding equipment and a computer storage medium, which are used for realizing the scheme provided by the embodiment of the application.
The device comprises a memory for storing instructions or code and a processor for executing the instructions or code to cause the device to perform the method according to any of the embodiments of the present application.
The computer storage medium has code stored therein that, when executed, causes an apparatus for executing the code to perform the method described in any of the embodiments of the present application.
The "first" and "second" in the names of "first", "second" (where present) and the like in the embodiments of the present application are used for name identification only, and do not represent the first and second in sequence.
From the above description of embodiments, it will be apparent to those skilled in the art that all or part of the steps of the above described example methods may be implemented in software plus general hardware platforms. Based on such understanding, the technical solutions of the present application may be embodied in the form of a software product, which may be stored in a storage medium, such as a read-only memory (ROM)/RAM, a magnetic disk, an optical disk, or the like, including several instructions for causing a computer device (which may be a personal computer, a server, or a network communication device such as a router) to perform the methods described in the embodiments or some parts of the embodiments of the present application.
In this specification, each embodiment is described in a progressive manner, and identical and similar parts of each embodiment are all referred to each other, and each embodiment mainly describes differences from other embodiments. In particular, for the device embodiments, since they are substantially similar to the method embodiments, the description is relatively simple, and reference is made to the description of the method embodiments for relevant points. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment. Those of ordinary skill in the art will understand and implement the present invention without undue burden.
The foregoing is merely exemplary embodiments of the present application and is not intended to limit the scope of the present application.

Claims (10)

1. A method of data matching, comprising:
acquiring data to be matched;
matching the keyword field in the data to be matched with the keyword field of the configuration data in a preset configuration file or a database code table according to a preset matching rule;
and if the keyword fields of the data to be matched and the configuration data are determined to be matched, outputting a matching result.
2. The method of claim 1, wherein prior to the acquiring the data to be matched, the method further comprises:
acquiring initial data in the configuration file or a database code table;
and checking the initial data in the configuration file or the database code table according to a preset checking rule to obtain configuration data.
3. The method according to any one of claims 1-2, wherein matching the key field in the data to be matched with the key field of the configuration data in the preset configuration file or database code table according to the preset matching rule includes:
if the keyword field in the data to be matched is smaller than the keyword field in the configuration data, matching the keyword field in the configuration data by using the keyword field in the data to be matched;
and if the keyword field in the data to be matched is determined to be larger than the keyword field in the configuration data, using the keyword field in the configuration data to match the keyword field in the data to be matched.
4. A method according to claim 3, wherein said using the key field in the configuration data to match the key field in the data to be matched comprises:
and selecting a preset number of key word fields from the configuration data according to the priority from high to low each time according to the priority of the preset key word fields, and matching the key word fields in the data to be matched.
5. The method according to any one of claims 1-4, wherein outputting a matching result if it is determined that the data to be matched and the configuration data have matching key fields, includes:
if the data to be matched and the configuration data are determined to have a matched keyword field, outputting the matched keyword field;
if the data to be matched and the configuration data are determined to have a plurality of matched keyword fields, outputting the matched keyword field with the highest priority among the plurality of matched keyword fields according to the preset keyword field priority.
6. A data matching apparatus, comprising:
the first acquisition module is used for acquiring data to be matched;
the matching module is used for matching the keyword field in the data to be matched with the keyword field of the configuration data in a preset configuration file or database code table according to a preset matching rule;
and the output module is used for outputting a matching result if the keyword field for matching the data to be matched and the configuration data is determined.
7. The apparatus of claim 6, wherein the apparatus further comprises:
the second acquisition module is used for acquiring initial data in the configuration file or the database code table;
the obtaining module is used for verifying the initial data in the configuration file or the database code table according to a preset verification rule to obtain configuration data.
8. The apparatus of any of claims 6-7, wherein the first matching module comprises:
the first matching unit is used for matching the keyword fields in the configuration data by using the keyword fields in the data to be matched if the keyword fields in the data to be matched are determined to be smaller than the keyword fields in the configuration data;
and the second matching unit is used for matching the keyword fields in the data to be matched by using the keyword fields in the configuration data if the keyword fields in the data to be matched are determined to be larger than the keyword fields in the configuration data.
9. The apparatus according to claim 8, wherein the second matching unit is specifically configured to:
and selecting a preset number of key word fields from the configuration data according to the priority from high to low each time according to the priority of the preset key word fields, and matching the key word fields in the data to be matched.
10. The apparatus according to any one of claims 6-9, wherein the output module is specifically configured to:
if the data to be matched and the configuration data are determined to have a matched keyword field, outputting the matched keyword field;
if the data to be matched and the configuration data are determined to have a plurality of matched keyword fields, outputting the matched keyword field with the highest priority among the plurality of matched keyword fields according to the preset keyword field priority.
CN202310153192.9A 2023-02-22 2023-02-22 Data matching method and device Pending CN116166972A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310153192.9A CN116166972A (en) 2023-02-22 2023-02-22 Data matching method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310153192.9A CN116166972A (en) 2023-02-22 2023-02-22 Data matching method and device

Publications (1)

Publication Number Publication Date
CN116166972A true CN116166972A (en) 2023-05-26

Family

ID=86421644

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310153192.9A Pending CN116166972A (en) 2023-02-22 2023-02-22 Data matching method and device

Country Status (1)

Country Link
CN (1) CN116166972A (en)

Similar Documents

Publication Publication Date Title
CN109543942A (en) Data verification method, device, computer equipment and storage medium
CN108984177A (en) A kind of data processing method and system
CN110634471B (en) Voice quality inspection method and device, electronic equipment and storage medium
CN108985344A (en) A kind of the training set optimization method and system of neural network model
CN110427375B (en) Method and device for identifying field type
CN112307374A (en) Jumping method, device and equipment based on backlog and storage medium
CN111553652A (en) Service processing method and device
CN111752846A (en) Interface testing method and device
CN115988001A (en) Consensus voting processing method, device, equipment and medium for block chain system
CN116166972A (en) Data matching method and device
WO2009155292A1 (en) Systems and methods for document searching
CN114465875B (en) Fault processing method and device
Getir et al. State Elimination as Model Transformation Problem.
CN113342647A (en) Test data generation method and device
CN111339378A (en) Character command auditing method and system in operation and maintenance management
CN111427571A (en) Data verification method and device
CN111062800A (en) Data processing method and device, electronic equipment and computer readable medium
CN115994743B (en) Document abstract specification management method and system
CN113626593B (en) Excel file verification method, device and equipment
CN115687599B (en) Service data processing method and device, electronic equipment and storage medium
US11228441B2 (en) System for automated data verification
CN109992293A (en) The assemble method and device of android system complement version information
CN115203057B (en) Low code test automation method, device, equipment and storage medium
CN110349025B (en) Method and device for preventing loss of contract assets based on non-cost transaction output
CN117874008A (en) Data table migration method and device

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