Movatterモバイル変換


[0]ホーム

URL:


CN102117293B - Dynamic file positioning and query method - Google Patents

Dynamic file positioning and query method
Download PDF

Info

Publication number
CN102117293B
CN102117293BCN200910247756.5ACN200910247756ACN102117293BCN 102117293 BCN102117293 BCN 102117293BCN 200910247756 ACN200910247756 ACN 200910247756ACN 102117293 BCN102117293 BCN 102117293B
Authority
CN
China
Prior art keywords
field
information
file
transaction
condition
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
CN200910247756.5A
Other languages
Chinese (zh)
Other versions
CN102117293A (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.)
China Unionpay Co Ltd
Original Assignee
China Unionpay 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 China Unionpay Co LtdfiledCriticalChina Unionpay Co Ltd
Priority to CN200910247756.5ApriorityCriticalpatent/CN102117293B/en
Publication of CN102117293ApublicationCriticalpatent/CN102117293A/en
Application grantedgrantedCritical
Publication of CN102117293BpublicationCriticalpatent/CN102117293B/en
Activelegal-statusCriticalCurrent
Anticipated expirationlegal-statusCritical

Links

Images

Landscapes

Abstract

The invention discloses a dynamic file positioning and query method, which comprises the following steps of: inputting user query information; positioning a selected condition field, a selected transaction type field, a transaction counting format field and a result display result according to the user query information; obtaining information in row records according to the positioned condition field, matching the information in the row records with the input information, and simultaneously performing transaction type matching; positioning the information in the row records according to a matched transaction type, and netting the information with a field of the same transaction type and the same amount of money; and performing row recording on a query result.

Description

Translated fromChinese
文件动态定位及查询方法File dynamic location and query method

技术领域technical field

本发明涉及文件动态定位及查询方法,更具体地,涉及银行卡文件动态定位及查询方法。The invention relates to a file dynamic location and query method, more specifically, to a bank card file dynamic location and query method.

背景技术Background technique

目前,随着银行业务的日益增长和银行卡业务种类的日益丰富,对银行卡文件进行简单而快速的动态定位以及查询变得越来越重要。在现有的银行卡文件处理方法中,主要有如下两种处理方式:(1)使用拆分软件:读取文件中的每行记录并全部拆分后,对获得的字段逐个与指定的条件字段进行匹配,然后再与条件值进行核对,从而识别交易、验证每笔交易记录中所有字段信息的正确性;然而,如果每个字段验证失败,则无法进行后续处理;(2)使用文件编辑工具(例如ultraEdit):先将文件打开,再对照文件格式规范进行比对;然而,该方式无法有效识别交易,难于处理较大的文件,并且手工定位比对查询的方式正确率低、速度慢,更无法直接获取交易类型并对金额字段进行直接统计。At present, with the increasing banking business and the increasingly rich types of bank card business, it is becoming more and more important to perform simple and fast dynamic positioning and query on bank card files. In the existing bank card file processing method, there are mainly the following two processing methods: (1) use splitting software: after reading each line record in the file and splitting them all, the obtained fields are matched with the specified conditions one by one Fields are matched, and then checked with the condition value, so as to identify the transaction and verify the correctness of all field information in each transaction record; however, if each field verification fails, subsequent processing cannot be performed; (2) use file editing Tools (such as ultraEdit): Open the file first, and then compare it against the file format specification; however, this method cannot effectively identify transactions, and it is difficult to process larger files, and the manual positioning and comparison query method has low accuracy and slow speed , and it is impossible to directly obtain the transaction type and perform direct statistics on the amount field.

发明内容Contents of the invention

为了解决上述现有技术方案所存在的缺陷,本发明提出了一种可以动态定位银行卡文件,并可对指定的银行卡流水文件进行交易查询和统计的方法。In order to solve the defects in the above-mentioned existing technical solutions, the present invention proposes a method that can dynamically locate bank card files, and perform transaction query and statistics on specified bank card journal files.

本发明的目的之一是通过以下技术方案实现的:One of purpose of the present invention is achieved through the following technical solutions:

一种文件动态定位及查询方法,所述文件动态定位及查询方法包括如下步骤:A file dynamic location and query method, the file dynamic location and query method comprises the following steps:

(A1)录入用户查询信息;(A1) Input user query information;

(A2)根据所述用户查询信息,定位被选择的条件字段、被选择的交易类型字段、交易统计格式字段以及结果显示字段;(A2) Locate the selected condition field, the selected transaction type field, the transaction statistics format field and the result display field according to the user query information;

(A3)根据已定位的所述条件字段获得行记录中的信息,并将所述行记录中的信息与录入的信息进行匹配,同时进行交易类型匹配;(A3) Obtain the information in the row record according to the located condition field, and match the information in the row record with the entered information, and simultaneously perform transaction type matching;

(A4)根据已匹配的交易类型,定位所述行记录中的信息,并与之前同交易类型同金额字段轧差;(A4) According to the matched transaction type, locate the information in the row record, and net the difference with the same transaction type and the same amount field before;

(A5)对查询结果进行行记录;(A5) record the query result;

其中,在步骤(A2)中,获取被选择条件字段在整个格式字段中的序列,根据所述序列前所有格式字段长度与各字段间分割符长度,计算所述条件字段的起始位置以及记录所述条件字段本身的长度。Wherein, in step (A2), the sequence of the selected condition field in the entire format field is obtained, and the initial position and record of the condition field are calculated according to the length of all format fields before the sequence and the length of the separator between each field The length of the condition field itself.

在上面公开的方案中,优选地,步骤(A2)进一步包括:根据文件类型属性,判断文件格式字段中是否包含交易类型字段,如果包含交易类型字段,则按照步骤(A2)的方式获得所述交易类型字段的起始位置和所述交易类型字段本身的长度,如果不包含交易类型,则在内存中将交易类型转换为文件格式字段,并根据所述字段在整个格式字段中的序列,获得对应的起始位置和所述字段本身的长度。In the solution disclosed above, preferably, step (A2) further includes: according to the file type attribute, judging whether the file format field contains a transaction type field, and if it contains a transaction type field, then obtain the described The starting position of the transaction type field and the length of the transaction type field itself. If the transaction type is not included, the transaction type is converted into a file format field in memory, and according to the sequence of the fields in the entire format field, obtain Corresponds to the starting position and the length of the field itself.

在上面公开的方案中,优选地,所述银行卡文件动态定位及查询方法在windows平台下被执行。In the solution disclosed above, preferably, the bank card file dynamic location and query method is executed under the windows platform.

在上面公开的方案中,优选地,所述步骤(A2)进一步包括:In the scheme disclosed above, preferably, the step (A2) further includes:

(B1)装载配置文件;(B1) loading configuration files;

(B2)装载录入的条件信息;(B2) load the entered condition information;

(B3)查询条件字段的定位信息;(B3) positioning information of the query condition field;

(B4)根据定位信息直接对流水进行取值;(B4) directly value the running water according to the positioning information;

(B5)定位信息取值处理。(B5) Positioning information value acquisition processing.

在上面公开的方案中,优选地,步骤(B1)进一步包括:In the scheme disclosed above, preferably, step (B1) further includes:

根据选择要处理的文件名,装载相关文件名称参数;According to the selected file name to be processed, load the relevant file name parameters;

装载渠道翻译信息、交易翻译信息及金额统计信息;Load channel translation information, transaction translation information and amount statistics;

将参数装载入内存中,并分别以结构体、容器为对象。Load the parameters into the memory, and take the structure and container as objects respectively.

在上面公开的方案中,优选地,步骤(B3)进一步包括:In the scheme disclosed above, preferably, step (B3) further includes:

根据条件字段名称,在文件格式字段内存中进行查找,对于所述字段之前的所有字段长度值,以及字段分隔符所占长度进行统计,获得条件字段在一行流水中的起始位置,并将所述条件字段自身长度作为偏移长度。记录入条件内存结构体中。According to the name of the conditional field, search in the memory of the file format field, count all the field length values before the field, and the length occupied by the field separator, obtain the starting position of the conditional field in a line of water, and store all The length of the condition field itself is used as the offset length. Recorded in the conditional memory structure.

在上面公开的方案中,优选地,步骤(B4)进一步包括:In the scheme disclosed above, preferably, step (B4) further includes:

在进行查询或统计时,将得到的一行流水,根据每个条件字段起始位置、偏移长度,使用substring直接获取指定位置内容。When querying or counting, the obtained line will use substring to directly obtain the content at the specified location according to the starting position and offset length of each condition field.

在上面公开的方案中,优选地,步骤(B5)进一步包括In the scheme disclosed above, preferably, step (B5) further includes

根据步骤B4中取得的定位值,将所述定位值所定位的信息与条件结构体容器中录入的条件值进行精确/模糊匹配,如果匹配成功,则按照条件容器中所有装载的条件结构体内容,循环执行步骤(B4);如果遇到匹配失败,则直接丢弃所述流水,取下一行流水重新执行步骤(B4)。According to the positioning value obtained in step B4, perform an exact/fuzzy match between the information positioned by the positioning value and the condition value entered in the condition structure container. , step (B4) is executed cyclically; if a matching failure is encountered, the running water is directly discarded, and the next line of running water is taken to re-execute step (B4).

本发明所公开的文件动态定位及查询方法具有如下优点:通过使用动态定位技术,在对文件进行处理的过程中,避免了对整个流水文件每行记录都拆分验证的过程,可以快速实现对流水文件的查询、分类统计等处理动作;对于处理交易量较大的流水文件,所述文件动态定位及查询方法具有运行稳定,查询与匹配精确,处理高效的特点,并且该方法在windows平台下被执行,从而可以满足用户对文件处理的性能需求。The file dynamic positioning and query method disclosed in the present invention has the following advantages: by using the dynamic positioning technology, in the process of processing the file, the process of splitting and verifying each row of the entire flow file is avoided, and the process of checking and verifying each row of the entire file can be quickly realized. Processing actions such as query, classification and statistics of flow files; for processing flow files with a large transaction volume, the dynamic positioning and query method of the file has the characteristics of stable operation, accurate query and matching, and efficient processing, and the method can be used under the windows platform It is executed to meet the user's performance requirements for file processing.

附图说明Description of drawings

结合附图,本发明的技术特征以及优点将会被本领域技术人员更好地理解,其中:With reference to the accompanying drawings, the technical features and advantages of the present invention will be better understood by those skilled in the art, wherein:

图1为根据本发明的实施例的文件动态定位及查询方法流程图;Fig. 1 is a flow chart of a file dynamic location and query method according to an embodiment of the present invention;

图2为根据本发明的实施例的文件动态定位处理的流程图;Fig. 2 is the flowchart of the file dynamic location processing according to the embodiment of the present invention;

具体实施方式Detailed ways

图1是根据本发明的实施例的文件动态定位及查询方法流程图。如图1所示,本发明所公开的文件动态定位及查询方法包括如下步骤:(A1)录入用户查询信息;(A2)根据所述用户查询信息,定位被选择的条件字段、被选择的交易类型字段、交易统计格式字段以及结果显示字段;(A3)根据已定位的所述条件字段获得行记录中的信息,并将所述行记录中的信息与录入的信息进行匹配,同时进行交易类型匹配;(A4)根据已匹配的交易类型,定位所述行记录中的信息,并与之前同交易类型同金额字段轧差;(A5)对查询结果进行行记录。其中,在所述步骤A2中,获取被选择条件字段在整个格式字段中的序列,根据序列前所有格式字段长度与各字段间分割符长度,计算该条件字段的起始位置以及记录字段本身的长度;根据文件类型属性,判断文件格式字段中是否包含交易类型字段,如果包含交易类型字段,则按照前述方式获得起始位置和其本身的长度,如果不包含交易类型,则在内存中将交易类型转换为文件格式字段,并包含如下字段:消息类型、报文类型和服务点条件码,并根据这些字段在整个格式字段中的序列,获得对应的起始位置和其本身的长度。所述步骤2还包括:装载文件类型对应的需统计格式字段(例如本金、手续费等各类金额字段),并按照前面所述的方式获得起始位置及其本身长度;获取内存中所有显示格式字段,并按照前面所述的方式获得起始位置及其本身长度。在步骤A3中,读入行记录后,根据条件字段起始位置和字段长度,采用读取子字符串方式定位获得行记录中的信息,与录入的信息进行模糊匹配(如果是精确匹配,则进行精确匹配),如果行记录中的信息包含或与录入信息一致,则视为该条件字段匹配。否则丢弃该行记录,取下一行记录处理;同时,读入行记录后,根据条件字段起始位置和字段长度,定位获得行记录中的信息,与录入的信息进行模糊匹配(如果是精确匹配,则进行精确匹配),当行记录中的信息包含或与录入信息一致时,如果文件格式中有交易类型字段,则视为匹配。如果文件格式中没有交易类型字段,则转换后的包含字段信息均一致,视为交易类型匹配。否则丢弃该行记录,取下一行记录处理。在步骤A4中,根据交易类型分类后,定位获得该行记录中的信息,与之前同交易类型同金额字段(如均为本金字段)轧差。在步骤A5中,对查询结果进行记录,根据显示字段起始位置和字段长度,定位获得行记录中的信息,进入显示结果处理过程,并且二次文件生成时,根据指定需要的信息定位后组合,写入文件中。FIG. 1 is a flowchart of a method for dynamically locating and querying files according to an embodiment of the present invention. As shown in Figure 1, the document dynamic location and query method disclosed in the present invention includes the following steps: (A1) input user query information; (A2) locate the selected condition field and selected transaction according to the user query information; Type field, transaction statistics format field, and result display field; (A3) Obtain the information in the row record according to the positioned condition field, and match the information in the row record with the entered information, and simultaneously perform transaction type Matching; (A4) Locating the information in the row record according to the matched transaction type, and offsetting the difference with the same transaction type and the same amount field before; (A5) Performing a row record for the query result. Wherein, in the step A2, the sequence of the selected condition field in the entire format field is obtained, and the initial position of the condition field and the record field itself are calculated according to the length of all format fields before the sequence and the length of the separator between each field. Length; according to the file type attribute, judge whether the file format field contains the transaction type field, if it contains the transaction type field, then obtain the starting position and its own length according to the above method, if it does not contain the transaction type, then store the transaction in memory The type is converted into a file format field, and includes the following fields: message type, message type, and service point condition code, and according to the sequence of these fields in the entire format field, the corresponding starting position and its own length are obtained. Said step 2 also includes: loading the required statistics format field corresponding to the file type (such as various amount fields such as principal and handling fee), and obtaining the starting position and its own length in the manner described above; The format field is displayed and the starting position and its own length are obtained as previously described. In step A3, after the row record is read, according to the starting position and field length of the conditional field, the information in the row record is obtained by reading the substring method, and fuzzy matching is performed with the entered information (if it is an exact match, then Exact match), if the information in the row record contains or is consistent with the entered information, it is considered that the condition field matches. Otherwise, discard the row record and take the next row record for processing; at the same time, after reading the row record, locate and obtain the information in the row record according to the starting position and field length of the condition field, and perform fuzzy matching with the entered information (if it is an exact match , perform an exact match), when the information in the line record contains or is consistent with the entered information, if there is a transaction type field in the file format, it is considered a match. If there is no transaction type field in the file format, the information contained in the converted fields is consistent, and the transaction type is considered to match. Otherwise, discard this line of records and take the next line of records for processing. In step A4, after classification according to the transaction type, locate and obtain the information in the row record, and net the difference with the previous same transaction type and same amount field (for example, both are principal fields). In step A5, record the query result, locate and obtain the information in the line record according to the initial position and field length of the display field, enter the display result processing process, and when the secondary file is generated, locate and combine according to the specified required information , written to the file.

图2所示为根据本发明的实施例的文件动态定位处理的流程图。如图2所示,本发明所公开的银行卡文件动态定位及查询方法中的步骤A2进一步包括:(B1)装载配置文件;(B2)装载录入的条件信息;(B3)查询条件字段的定位信息;(B4)根据定位信息直接对流水进行取值;(B5)定位信息取值处理。在步骤B1中,根据选择要处理的文件名,装载相关文件名称参数,包括:文件格式字段名称、长度,是否条件字段,是否金额字段,是否渠道信息等;装载渠道翻译信息,装载交易翻译信息,装载金额统计信息;参数装载进入内存中,分别以结构体、容器为对象,供后续使用。在步骤B2中,对录入的条件信息,包括选择的查询字段,输入的条件值,对每个条件以结构体的方式记录,分别包括:字段名称,字段长度(从参数装载获得),输入条件存储容器(可能包含多个输入值);依次对每个选择条件分别以结构体方式装载入内存容器中,供后续使用。在步骤B3中,根据条件字段名称,在文件格式字段内存中进行查找,由于文件格式字段是按照顺序排列的,对于该字段之前的所有字段长度值,以及字段分隔符所占长度进行统计,获得条件字段在一行流水中的起始位置,并将该条件字段自身长度作为偏移长度。记录入条件内存结构体中。在步骤B4中,在进行查询或统计时,将得到的一行流水,根据每个条件字段起始位置、偏移长度,使用substring直接获取指定位置内容。在步骤B5中,根据步骤B4中取得的定位值,将该定位值所定位的信息与条件结构体容器中录入的条件值进行精确/模糊匹配,如果匹配成功,则按照条件容器中所有装载的条件结构体内容,循环步骤B4。如果遇到匹配失败,则直接丢弃该行流水,取下一行流水重新执行步骤B4;如果符合所有条件内容,则进入交易类型翻译、金额轧差处理;按照步骤B3、B4,将取到的字段值在内存中组合匹配,获得交易类型;将金额字段按照借、贷方向统计轧差。FIG. 2 is a flow chart of file dynamic location processing according to an embodiment of the present invention. As shown in Figure 2, step A2 in the bank card file dynamic location and query method disclosed by the present invention further includes: (B1) loading configuration file; (B2) loading condition information of entry; (B3) positioning of query condition field information; (B4) directly value the running water according to the location information; (B5) process the value of the location information. In step B1, according to the file name to be processed, load relevant file name parameters, including: file format field name, length, whether condition field, whether amount field, whether channel information, etc.; load channel translation information, load transaction translation information , to load the statistical information of the amount; the parameters are loaded into the memory, and the structure and the container are used as objects for subsequent use. In step B2, the input condition information, including the selected query field and the input condition value, is recorded in the form of a structure for each condition, including: field name, field length (obtained from parameter loading), input condition Storage container (may contain multiple input values); load each selection condition into the memory container in the form of a structure for subsequent use. In step B3, according to the conditional field name, the file format field memory is searched. Since the file format fields are arranged in order, all field length values before this field and the length occupied by the field separator are counted to obtain The starting position of the condition field in a line of pipeline water, and the length of the condition field itself is used as the offset length. Recorded in the conditional memory structure. In step B4, when performing query or statistics, the obtained row of pipeline is used to directly obtain the content at the specified location according to the starting position and offset length of each condition field. In step B5, according to the positioning value obtained in step B4, perform an exact/fuzzy match between the information positioned by the positioning value and the condition value entered in the condition structure container. Conditional structure content, loop step B4. If the matching fails, discard the line directly, take the next line and re-execute step B4; if all conditions are met, enter transaction type translation and amount netting processing; follow steps B3 and B4 to retrieve the fields Values are combined and matched in memory to obtain the transaction type; the amount field is calculated according to the direction of debit and credit.

尽管本发明是通过上述的优选实施方式进行描述的,但是其实现形式并不局限于上述的实施方式。应该认识到:在不脱离本发明主旨和范围的情况下,本领域技术人员可以对本发明做出不同的变化和修改。Although the present invention has been described through the above-mentioned preferred embodiments, its implementation forms are not limited to the above-mentioned embodiments. It should be appreciated that those skilled in the art can make various changes and modifications to the present invention without departing from the spirit and scope of the present invention.

Claims (9)

CN200910247756.5A2009-12-302009-12-30Dynamic file positioning and query methodActiveCN102117293B (en)

Priority Applications (1)

Application NumberPriority DateFiling DateTitle
CN200910247756.5ACN102117293B (en)2009-12-302009-12-30Dynamic file positioning and query method

Applications Claiming Priority (1)

Application NumberPriority DateFiling DateTitle
CN200910247756.5ACN102117293B (en)2009-12-302009-12-30Dynamic file positioning and query method

Publications (2)

Publication NumberPublication Date
CN102117293A CN102117293A (en)2011-07-06
CN102117293Btrue CN102117293B (en)2014-03-19

Family

ID=44216067

Family Applications (1)

Application NumberTitlePriority DateFiling Date
CN200910247756.5AActiveCN102117293B (en)2009-12-302009-12-30Dynamic file positioning and query method

Country Status (1)

CountryLink
CN (1)CN102117293B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN105930325B (en)*2015-11-192019-05-24中国银联股份有限公司A kind of file report compares the conversed analysis method and device of difference
CN108418703B (en)*2018-01-102021-06-25北京思特奇信息技术股份有限公司Early warning method and system based on real-time event detection
CN109697216B (en)*2018-12-182021-04-20中国银行股份有限公司Clearing transaction information processing method, device and system

Citations (3)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
US5617567A (en)*1990-05-211997-04-01Financial System Technology Pty. Ltd.Data processing system and method for retrieving and entity specified in a search path record from a relational database
CN101158977A (en)*2007-11-212008-04-09金蝶软件(中国)有限公司Method and system for processing multiple services bills data
CN101751423A (en)*2008-12-082010-06-23北大方正集团有限公司Article duplicate checking method and system

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
US5617567A (en)*1990-05-211997-04-01Financial System Technology Pty. Ltd.Data processing system and method for retrieving and entity specified in a search path record from a relational database
CN101158977A (en)*2007-11-212008-04-09金蝶软件(中国)有限公司Method and system for processing multiple services bills data
CN101751423A (en)*2008-12-082010-06-23北大方正集团有限公司Article duplicate checking method and system

Also Published As

Publication numberPublication date
CN102117293A (en)2011-07-06

Similar Documents

PublicationPublication DateTitle
CN113362157B (en) Abnormal node identification method, model training method, device and storage medium
CN111553137B (en)Report generation method and device, storage medium and computer equipment
CN102117292B (en) File secondary generation and query method
CN104750795A (en)Intelligent semantic searching system and method
CN115049471A (en)Bill processing method, device, equipment and storage medium
CN116029734B (en) Method, system and electronic device for detecting bank transaction fraud
CN102117293B (en)Dynamic file positioning and query method
CN107908720A (en)A kind of patent data cleaning method and system based on AdaBoost algorithms
US7971135B2 (en)Method and system for automatic data aggregation
US11308130B1 (en)Constructing ground truth when classifying data
CN112749167A (en)Method and device for determining broken link data and nonvolatile storage medium
CN118606276B (en)Electronic archive data information optimal storage method
US7849037B2 (en)Method for using the fundamental homotopy group in assessing the similarity of sets of data
US20100205175A1 (en)Cap-sensitive text search for documents
CN118733717A (en) File duplication checking method, device, equipment, storage medium and program product
CN115221062B (en) Test case generation method, computer device and computer readable storage medium
CN110728566A (en)Data processing method and device in reimbursement file, computer equipment and storage medium
CN110018844A (en)Management method, device and the electronic equipment of decision trigger method
CN108376365B (en)Bank number determining method and device
JP6250307B2 (en) Image information processing apparatus and image information processing method
CN117764574B (en)Automatic fee calculation method, device, system and storage medium
CN119917657B (en)Information presentation method, apparatus, computer device, readable storage medium, and program product
CN115577070B (en)Financial data inquiry management system
CN114443720B (en) Method, device, electronic device and storage medium for obtaining liquidation rules
US8315924B1 (en)Method and apparatus for automating accounting with check vouchers

Legal Events

DateCodeTitleDescription
C06Publication
PB01Publication
C10Entry into substantive examination
SE01Entry into force of request for substantive examination
GR01Patent grant
GR01Patent grant

[8]ページ先頭

©2009-2025 Movatter.jp