Storage file checking method and device, storage medium and processor

By comprehensively checking the line terminators, data volume and data format of the warehousing files, the problem that warehousing tools in the existing technology cannot effectively check the content of data files is solved, and the warehousing success rate and data quality are improved.

CN118760716APending Publication Date: 2024-10-11CCB FINTECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202410715834.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-04
Publication Date
2024-10-11

AI Technical Summary

Technical Problem

Existing warehousing tools cannot effectively check the contents of data files, resulting in incorrect data or import failure when importing the database, affecting use.

Method used

By performing line terminator checks, data volume checks, and data format checks at preset locations on the files to be imported, comprehensive check results are generated to ensure that the data meets the requirements.

Benefits of technology

It improves the success rate and data quality of imported files, ensures that the data formats of line terminators, data items and preset positions meet the requirements, and avoids import errors.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118760716A_ABST
    Figure CN118760716A_ABST
Patent Text Reader

Abstract

The invention provides a warehousing file checking method and device, a storage medium and a processor, and relates to the technical field of computers. The method comprises the steps of obtaining a to-be-stored file; on the basis of a preset checking rule set, checking an end character of each row in the to-be-stored file to obtain a first checking result; based on a preset checking rule set, checking the data items in the to-be-stored file to obtain a second checking result; based on a preset checking rule set, checking a data format of a preset position in the to-be-stored file to obtain a third checking result; and based on the first check result, the second check result and the third check result, obtaining a storage file check result. According to the method and the device, the storage data content is comprehensively checked, the line terminator, the data item and the data format of the preset position in the to-be-stored file are ensured to meet the requirements, the storage success rate can be greatly improved, and the data quality is further improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a method for checking incoming documents, a device for checking incoming documents, a machine-readable storage medium, a computer program product, and a processor. Background Art

[0002] In computer use, importing data files into a database is a very frequent operation. However, if the data file is incorrect, the import will fail or the imported data will be incorrect, affecting the use. Therefore, it is necessary to check the incoming files when importing the database.

[0003] When the existing warehousing tools import data files, they are unable to check the contents of the data files, which may result in erroneous data in the imported files, resulting in import failures or incorrect imported data, affecting usage. Summary of the invention

[0004] The purpose of the embodiments of the present application is to provide a method for checking incoming files, a device for checking incoming files, a machine-readable storage medium, a computer program product, and a processor. The method for checking incoming files performs a comprehensive check on the content of incoming data by checking the line endings, the data volume, and the data format of a preset position of the incoming file.

[0005] In order to achieve the above-mentioned purpose, the first aspect of the present application provides a method for checking incoming documents, comprising:

[0006] Get the files to be stored;

[0007] Based on a preset check rule set, the terminator of each line in the to-be-stored file is checked to obtain a first check result;

[0008] Based on a preset check rule set, the data items in the to-be-stored file are checked to obtain a second check result;

[0009] Based on a preset check rule set, a data format of a preset position in the to-be-stored file is checked to obtain a third check result;

[0010] Based on the first inspection result, the second inspection result and the third inspection result, an incoming file inspection result is obtained.

[0011] In the embodiment of the present application, the end character of each line in the to-be-stored file is checked based on the preset check rule set to obtain a first check result, including:

[0012] Based on the preset check rule set, determine the line ending check rule corresponding to the file to be stored;

[0013] Read the content of the file to be stored line by line to obtain the end mark of each line;

[0014] Based on the line terminator checking rule corresponding to the file to be stored, determining whether the terminator of each line is correct;

[0015] When the end character of each line is correct, a first check result is obtained that the line end character is correct;

[0016] In the case where the end character of any line is incorrect, the first check result is that the line end character is incorrect.

[0017] In the embodiment of the present application, the data items in the to-be-stored file are checked based on a preset check rule set to obtain a second check result, including:

[0018] Based on the preset inspection rule set, determining the number of data items corresponding to the file to be stored;

[0019] Read the contents of the file to be stored line by line to obtain the number of data separators;

[0020] Compare the number of data separators with the number of data items to obtain a comparison result;

[0021] Based on the comparison result, a second inspection result is obtained.

[0022] In the embodiment of the present application, the data format of the preset position in the to-be-stored file is checked based on the preset check rule set to obtain the third check result, including:

[0023] Based on the preset inspection rule set, determining the special column data format rule corresponding to the to-be-stored file;

[0024] Based on the special column data format rule, read the content of the to-be-stored file line by line to obtain the data value of the preset position;

[0025] Based on the special column data format rule, it is determined whether the data format of the data value at the preset position is correct to obtain a third check result.

[0026] In the embodiment of the present application, it also includes:

[0027] Based on the preset inspection rule set, determine the file name rule corresponding to the file to be stored;

[0028] Divide the file name of the file to be stored into multiple parts to obtain multiple name fields;

[0029] Based on the file name rule, determine whether each name field is correct to obtain a fourth check result;

[0030] The step of obtaining the incoming file inspection result based on the first inspection result, the second inspection result and the third inspection result includes:

[0031] Based on the first inspection result, the second inspection result, the third inspection result and the fourth inspection result, an incoming file inspection result is obtained.

[0032] In the embodiments of the present application, any one or more of the following items are also included:

[0033] During the inspection process, inspection process information is generated and displayed;

[0034] After the inspection is completed, an inspection log is generated based on the inspection results of the incoming documents, and the inspection log is displayed.

[0035] A second aspect of the present application provides a device for checking incoming documents, the device comprising:

[0036] The acquisition module is used to obtain the files to be stored;

[0037] A first checking module, configured to check the end character of each line in the to-be-stored file based on a preset checking rule set, and obtain a first checking result;

[0038] A second checking module is used to check the data items in the to-be-stored file based on a preset checking rule set to obtain a second checking result;

[0039] A third inspection module, configured to inspect the data format of a preset position in the to-be-stored file based on a preset inspection rule set, and obtain a third inspection result;

[0040] A result module is used to obtain an incoming file inspection result based on the first inspection result, the second inspection result and the third inspection result.

[0041] A third aspect of the present application provides a processor configured to execute the above-mentioned incoming file inspection method.

[0042] A fourth aspect of the present application provides a machine-readable storage medium having instructions stored thereon, which, when executed by a processor, configures the processor to execute the above-mentioned method for checking incoming documents.

[0043] A fifth aspect of the present application provides a computer program product, including a computer program, which implements the above-mentioned method for checking incoming files when executed by a processor.

[0044] Through the above technical scheme, by obtaining the file to be stored; based on the preset check rule set, the terminator of each line in the file to be stored is checked to obtain the first check result; based on the preset check rule set, the data item in the file to be stored is checked to obtain the second check result; based on the preset check rule set, the data format of the preset position in the file to be stored is checked to obtain the third check result; based on the first check result, the second check result and the third check result, the storage file inspection result is obtained. By checking the line terminator, data volume and data format of the preset position in the file to be stored, a comprehensive inspection of the storage data content is achieved to ensure that the line terminator, data item and data format of the preset position in the file to be stored meet the requirements, which can greatly improve the success rate of storage and thus improve the data quality.

[0045] Other features and advantages of the embodiments of the present application will be described in detail in the subsequent specific implementation section. BRIEF DESCRIPTION OF THE DRAWINGS

[0046] The accompanying drawings are used to provide a further understanding of the embodiments of the present application and constitute a part of the specification. Together with the following specific implementations, they are used to explain the embodiments of the present application, but do not constitute a limitation on the embodiments of the present application. In the accompanying drawings:

[0047] Figure 1 A schematic diagram of an application environment of a method for checking incoming documents according to an embodiment of the present application is schematically shown;

[0048] Figure 2 The following is a schematic diagram showing a flow chart of a method for checking incoming documents according to an embodiment of the present application;

[0049] Figure 3 A structural block diagram schematically shows the main working principle of an embodiment of the present application;

[0050] Figure 4 A diagram schematically shows a process diagram of file checking according to an embodiment of the present application;

[0051] Figure 5 A schematic diagram of a structural block diagram of a storage document inspection device according to an embodiment of the present application is shown;

[0052] Figure 6 The internal structure diagram of a computer device according to an embodiment of the present application is schematically shown.

[0053] Description of Reference Numerals

[0054] 102-terminal; 104-server; 410-acquisition module; 420-first inspection module; 430-second inspection module; 440-third inspection module; 450-result module; A01-processor; A02-network interface; A03-internal memory; A04-display screen; A05-input device; A06-non-volatile storage medium; B01-operating system; B02-computer program. DETAILED DESCRIPTION

[0055] In order to make the purpose, technical scheme and advantages of the embodiments of the present application clearer, the technical scheme in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. It should be understood that the specific implementation methods described herein are only used to illustrate and explain the embodiments of the present application, and are not used to limit the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.

[0056] It should be noted that if the embodiments of the present application involve directional indications (such as up, down, left, right, front, back...), the directional indications are only used to explain the relative position relationship, movement status, etc. between the components under a certain specific posture (as shown in the accompanying drawings). If the specific posture changes, the directional indication will also change accordingly.

[0057] In addition, if there are descriptions involving "first", "second", etc. in the embodiments of the present application, the descriptions of "first", "second", etc. are only used for descriptive purposes and cannot be understood as indicating or suggesting their relative importance or implicitly indicating the number of technical features indicated. Therefore, the features defined as "first" and "second" may explicitly or implicitly include at least one of the features. In addition, the technical solutions between the various embodiments can be combined with each other, but they must be based on the ability of ordinary technicians in the field to implement them. When the combination of technical solutions is contradictory or cannot be implemented, it should be deemed that such combination of technical solutions does not exist and is not within the scope of protection required by this application.

[0058] The acquisition, transmission, storage, use, and processing of data in the technical solution of this application are in compliance with the relevant provisions of national laws and regulations. In addition, it should be noted that in the embodiments of this application, some existing solutions in the industry such as certain software, components, and models may be mentioned, which should be considered as exemplary, and their purpose is only to illustrate the feasibility of the implementation of the technical solution of this application, but it does not mean that the applicant has or will necessarily use the solution.

[0059] The document inspection method provided by this application can be applied to Figure 1In the application environment shown. The terminal 102 communicates with the server 104 through the network. By checking the line endings, the data volume and the data format of the preset position of the file to be stored, a comprehensive check of the stored data content is achieved. The terminal 102 can be, but is not limited to, various personal computers, laptops, smart phones, tablet computers and portable wearable devices, and the server 104 can be implemented by an independent server or a server cluster composed of multiple servers.

[0060] It should be noted that the set mentioned in this embodiment refers to multiple data of the same type put together as a whole, and this whole can be called a set. The line terminator refers to the special character set in the computer data storage to indicate the end of a line of data, and this special character is the line terminator.

[0061] Figure 2 The following is a schematic diagram showing a flow chart of a method for checking incoming documents according to an embodiment of the present application. Figure 2 As shown, in one embodiment of the present application, a method for checking incoming documents is provided. This embodiment mainly applies the method to the above Figure 1 Taking the terminal 102 (or server 104) in FIG. 1 as an example, the following steps are included:

[0062] Step 210: Obtain the files to be stored;

[0063] In this embodiment, the above-mentioned files to be stored refer to data files that need to be imported into the database. The above-mentioned files to be stored can be a single file or all files in a file directory. In specific implementation, the files to be stored can be obtained in the form of parameters through the access module. The parameters include two types: single file mode and file directory mode. Specifically, different parameters can be set according to needs to obtain the files to be stored. Among them, the single file mode indicates that the content to be checked is a single file input, and the file directory mode indicates that all files in the directory need to be checked.

[0064] Step 220: Based on a preset check rule set, check the end character of each line in the file to be stored to obtain a first check result;

[0065] In this embodiment, the above-mentioned preset inspection rule set includes a set of all rules to be checked, wherein the contents of the items to be checked include at least data item check, line terminator check, special column data check, etc., which can be pre-set according to actual needs. These inspection rules are used to represent the characteristic requirements for storing database files. The line terminator check rule in the inspection rules can be used to check the terminator of each line in the to-be-stored file. In order to facilitate the management of inspection rules, the inspection rules can be stored in the form of a table set, and a table set refers to a set of multiple tables, and specifically, the characteristic requirements of the database table can be stored in the json file format. For example: in the table set, the file name is the name of the database to which the table belongs, and each line in the file content is a characteristic requirement of a table.

[0066] In some embodiments, in order to accurately check, the line terminators may be checked line by line, and the checking of the line terminators of each line in the to-be-stored file based on a preset check rule set to obtain a first check result includes the following steps:

[0067] First, based on the preset check rule set, a line ending check rule corresponding to the file to be stored is determined;

[0068] In this embodiment, the above-mentioned check rules can be one database name corresponding to one line ending check rule, or one database operating system corresponding to one line ending check rule. The line ending check rule corresponding to the file to be imported can be determined by the database to be imported into. For example, the line ending check rule is: check whether the end of each line of data is "\n" or "\r\n", where "\n" is the line ending identifier in Linux and Unix operating systems, and "\r\n" is the line ending identifier in Windos operating system.

[0069] Then, read the content of the file to be stored line by line to obtain the end mark of each line;

[0070] Then, based on the line terminator checking rule corresponding to the file to be stored, it is determined whether the terminator of each line is correct;

[0071] Finally, when the end character of each line is correct, the first check result is that the line end character is correct; when the end character of any line is incorrect, the first check result is that the line end character is incorrect.

[0072] In this embodiment, after obtaining the end character of each line, a judgment can be made respectively. If the end character check result of the current line is correct, the end character check of the next line is performed. If the end character check result of the current line is wrong, the first check result is that the line end character is incorrect; if the end characters of each line are correct, the first check result is that the line end character is correct. For example, the corresponding line end character check rule is that the end character of each line is "\n". If it is "\n", the end character check of the next line is continued. If it is "\r\n", the first check result is that the line end character is incorrect.

[0073] By checking the end character of each line in the file to be stored, it can be ensured that the end characters of the lines in the imported file meet the requirements. For example, when the end character is "\r\n", the storage tool cannot recognize the content, and the end character of the line will enter the database in the form of data, resulting in data errors. By checking the end character of the line, it can be ensured that the end character of the line "\r\n" will not enter the database in the form of data, thereby ensuring the accuracy of the data. By checking the end characters of the line line by line, the correctness of the check is improved.

[0074] Step 230: Based on a preset check rule set, check the data items in the to-be-stored file to obtain a second check result;

[0075] In this embodiment, the above-mentioned checking of the data items refers to checking whether the number of data items in the file to be stored is correct.

[0076] In some embodiments, in order to accurately check, the check may be performed by using a data separator. Specifically, based on a preset check rule set, the data items in the to-be-stored file are checked to obtain a second check result, including:

[0077] First, based on the preset inspection rule set, the number of data items corresponding to the file to be stored is determined;

[0078] In this embodiment, the number of data items corresponding to the file to be stored can be pre-written in the checking rule, and the number of corresponding data items can be found through the name of the file to be stored.

[0079] Then, the content of the file to be stored is read line by line to obtain the number of data separators;

[0080] In this embodiment, there are data separators between the data in the file to be stored, and the number of data separators is obtained by counting.

[0081] Then, the number of the data separators is compared with the number of the data items to obtain a comparison result;

[0082] Finally, based on the comparison result, a second inspection result is obtained.

[0083] In this embodiment, the comparison refers to determining whether the number of data separated by delimiters in the to-be-stored file is the same as the number of data items. If they are the same, it means that the data item check is correct, and the second check result is that the data item check is correct; if they are not the same, it means that the data item check is incorrect, and the second check result is that the data item check is incorrect.

[0084] By comparing the number of read data delimiters with the number of data items in the check rule, it is possible to quickly check whether the number of data items is correct, which helps to quickly and correctly obtain the second check result.

[0085] Step 240: Based on a preset check rule set, check the data format of the preset position in the to-be-stored file to obtain a third check result;

[0086] In the present embodiment, the above-mentioned check rules include special column data check rules, which are used to check whether the format of the key column in the file data is correct. The above-mentioned preset position refers to the key column, which can be a predetermined special position, or can be a column or multiple columns. The above-mentioned check on the data format refers to whether the data format of the position satisfies the special column data check rules. For example, in the check rules, the special column data check rules are: the format of the time data in the 5th column is the "year-month-day" format, then according to the special column data check rules, the data in the 5th column of the file to be stored can be format checked to determine whether the data format satisfies the "year-month-day" format.

[0087] By checking the data format of the preset position in the file to be stored, the special column data can be checked in advance, which helps to discover data problems in advance and ensure that the data format of the special column position in the file to be stored meets the requirements, which can greatly improve the success rate of storage and thus improve data quality.

[0088] In some embodiments, in order to accurately perform the inspection, the data value at the preset position may be read first, and then a format check may be performed, that is, based on a preset inspection rule set, the data format at the preset position in the to-be-stored file may be checked to obtain a third inspection result, including:

[0089] First, based on the preset inspection rule set, determine the special column data format rule corresponding to the file to be stored;

[0090] In this embodiment, the special column data format rule corresponding to the file to be stored may be pre-written in the checking rule, and the corresponding special column data format rule may be found through the name of the file to be stored.

[0091] Then, based on the special column data format rule, the content of the to-be-stored file is read line by line to obtain the data value of the preset position;

[0092] In this embodiment, after obtaining the special column data format rule, the preset position can be determined, and then the content in the to-be-stored file can be read line by line to obtain the data value of the preset position. For example, in the above example, the preset position is the 5th column, and the data value of the 5th column in each row can be read line by line to obtain the data value of the preset position.

[0093] Finally, based on the special column data format rule, it is determined whether the data format of the data value at the preset position is correct to obtain a third inspection result.

[0094] In this embodiment, after obtaining the data value of the preset position, it can be determined whether the format of the data value meets the special column data format rule. If it does, it means that the special column data format check is correct, that is, the third check result is that the special column data format check is correct; otherwise, it means that the special column data format check is incorrect, that is, the third check result is that the special column data format check is incorrect. During the above check, as long as the format of one data value does not meet the special column data format rule, the special column data format check is incorrect.

[0095] By reading the data values ​​at the preset positions line by line and then performing a format check, missed detection or false detection can be avoided, thereby ensuring the correctness of the check.

[0096] It should be noted that the above steps 220-240 all involve reading the content of the file to be stored line by line. In specific implementation, the content of the file to be stored can be read line by line to obtain the end mark of each line, the number of data separators and the data value of the preset position. In this way, the three aspects of row separator, number of columns and special data can be checked at one time, which greatly improves the efficiency of the inspection.

[0097] Step 250: Based on the first inspection result, the second inspection result and the third inspection result, obtain the inspection result of the incoming file.

[0098] In this embodiment, the above-mentioned first check result, second check result and third check result are detection results obtained from three aspects: data item check, line terminator check and special column data check. Only when the three check results are correct, the obtained inspection result of the incoming file is a successful inspection, otherwise, the inspection fails.

[0099] It should be noted that the above-mentioned line terminator check, data volume check and data format check at the preset position can be processed in parallel or executed sequentially. This embodiment is not limited to this. When executed sequentially, if the inspection result of one check item is correct, the next check item will be checked. Otherwise, the inspection result of the incoming file will be directly obtained as a check failure.

[0100] In the above implementation process, the file to be stored is obtained; based on the preset check rule set, the terminator of each line in the file to be stored is checked to obtain the first check result; based on the preset check rule set, the data item in the file to be stored is checked to obtain the second check result; based on the preset check rule set, the data format of the preset position in the file to be stored is checked to obtain the third check result; based on the first check result, the second check result and the third check result, the storage file inspection result is obtained. By checking the line terminator, data volume and data format of the preset position of the file to be stored, a comprehensive check of the storage data content is achieved to ensure that the line terminator, data item and data format of the preset position in the file to be stored meet the requirements, which can greatly improve the success rate of storage and thus improve the data quality.

[0101] In some embodiments, in order to further improve the success rate of storage, the following steps are also included:

[0102] First, based on the preset inspection rule set, the file name rule corresponding to the file to be stored is determined;

[0103] In this embodiment, the file name rule can be pre-set in the above-mentioned checking rule to check whether the file name meets the requirements. For example, the file name rule is composed of: "database table name_data business date". The above determination can be based on the name or type of the file to be stored to determine the corresponding file name rule.

[0104] Then, the file name of the file to be stored is divided into multiple parts to obtain multiple name fields;

[0105] In this embodiment, the above division can be performed according to the file name rule or according to actual needs to obtain multiple name fields. For example, in the above example, the file name can be divided into several components according to the separator "_".

[0106] Then, based on the file name rule, each name field is judged to be correct to obtain a fourth check result;

[0107] In this embodiment, after obtaining multiple name fields, it is determined whether the name fields meet the file name rules respectively. Only when all the name fields meet the file name rules, the fourth check result is obtained that the file name check is correct; otherwise, the fourth check result is obtained that the file name check is incorrect. For example, in the above example, the first part check: determine whether the first part of the component is in the table set. The second part check: determine whether the second part of the component matches the date format.

[0108] Correspondingly, obtaining the incoming document inspection result based on the first inspection result, the second inspection result and the third inspection result includes: obtaining the incoming document inspection result based on the first inspection result, the second inspection result, the third inspection result and the fourth inspection result.

[0109] In this embodiment, the above-mentioned first check result, second check result, third check result and fourth check result are respectively obtained from four aspects: data item check, line terminator check, special column data check and file name check. Only when the four check results are correct, the obtained inspection result of the incoming file is a successful inspection, otherwise, the inspection fails.

[0110] It should be noted that the above four aspects of the inspection can be processed in parallel or executed sequentially. For example, the order of the inspection is: 1. file name check, 2. line terminator check, 3. data item check, 4. special column check. This embodiment does not limit this. Among them, when executing sequentially, if the inspection result of one inspection item is correct, the next inspection item is entered, otherwise the inspection result of the incoming file is directly obtained as inspection failure.

[0111] In the above implementation process, by adding the check of file name on the basis of data item check, line terminator check and special column data check, the incoming data can be comprehensively checked from several important aspects such as file name, line separator, number of columns and special data requirements, which can greatly improve the success rate of warehousing and improve data quality.

[0112] In some embodiments, the detection status may also be displayed, which may specifically include any one or more of the following:

[0113] First, during the inspection process, inspection process information may be generated and displayed;

[0114] In this embodiment, the results can be displayed on the current display interface, and the above inspection process information includes: the file currently being inspected; the inspection items being inspected; the result of each inspection item - success / failure. During the inspection process, the inspection process information can be generated in real time according to the current detection status.

[0115] For example: In the above example, determine whether the first part of the component is in the table set. If there is a corresponding record in the table set, compare the second part. If there is no corresponding record, prompt that the table record does not exist; determine whether the second part of the component matches the date format. If it meets the date format, proceed to the next part of the check. If it does not meet the date format, prompt that the date format is incorrect. When checking the line terminator, if the line terminator is "\n", proceed to the next check. If it is "\r\n", prompt that the line terminator is incorrect. When judging whether the number of data items is correct, if it is correct, proceed to the next check. If it is not correct, prompt that the number of data columns is incorrect. Determine whether the data format of the special column meets the requirements. If it meets the requirements, the entire check is completed and the notification is completed. If it does not meet the requirements, prompt that the special column data is incorrect.

[0116] Then, after the inspection is completed, an inspection log is generated based on the inspection results of the incoming documents, and the inspection log is displayed.

[0117] In this embodiment, the content displayed in the inspection log is relatively specific, including the following: 1. The inspected file; 2. The inspection item; 3. The result of the inspection item, the reason for the failure of the inspection item, the failed line number, and the specific content of the failed line.

[0118] In the above implementation process, the inspection process information displayed includes the current inspection status by displaying the results on the current display interface; or after the inspection is completed, the inspection log is displayed. Compared with the existing warehousing tool, when the warehousing fails, the reason for the failure will be informed in the form of an error code, but the error code is generally an internal error identifier defined by the tool, and the user cannot quickly understand the root cause of the error failure. This solution can clearly locate where the error occurs and inform the type of error, which can help users quickly correct the error.

[0119] The following is a specific example to illustrate the solution:

[0120] Please see Figure 3 , Figure 3 The schematic diagram shows the main working principle of the embodiment of the present application. In the specific implementation, it is realized by four parts: access module, inspection rule, checker and display module. The access module obtains the content to be inspected in the form of parameters. The inspection rule is a collection of all items to be inspected. The checker checks the documents to be inspected item by item according to the inspection rule. If a certain inspection fails, an error message is displayed through the display module, and no further inspection is performed. Please refer to Figure 4 , Figure 4The process diagram of file checking according to the embodiment of the present application is schematically shown. In the specific checking, the file name is checked by obtaining the table name from the table set, the column number is checked from the table set for data item checking, and the special column requirements are checked from the table set for special column data detection.

[0121] Figure 2 FIG. 1 is a flow chart of a method for checking incoming documents in one embodiment. It should be understood that although Figure 2 The steps in the flowchart are shown in sequence as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified in this document, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. Moreover, Figure 2 At least part of the steps may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least part of the sub-steps or stages of other steps.

[0122] Please see Figure 5 , Figure 5 The structural block diagram of the incoming document inspection device according to the embodiment of the present application is schematically shown. This embodiment provides an incoming document inspection device, which includes an acquisition module 410, a first inspection module 420, a second inspection module 430, a third inspection module 440 and a result module 450, wherein:

[0123] The acquisition module 410 is used to acquire the files to be stored;

[0124] A first checking module 420 is used to check the end character of each line in the to-be-stored file based on a preset checking rule set to obtain a first checking result;

[0125] A second checking module 430 is used to check the data items in the to-be-stored file based on a preset checking rule set to obtain a second checking result;

[0126] A third checking module 440 is used to check the data format of a preset position in the to-be-stored file based on a preset checking rule set to obtain a third checking result;

[0127] The result module 450 is used to obtain the inspection result of the incoming file based on the first inspection result, the second inspection result and the third inspection result.

[0128] Wherein, the first inspection module 420 includes:

[0129] A first rule determination unit, configured to determine a line ending character check rule corresponding to the file to be stored based on the preset check rule set;

[0130] The first reading unit is used to read the content of the file to be stored line by line to obtain the end mark of each line;

[0131] An end character judging unit, used for judging whether the end character of each line is correct based on the line end character checking rule corresponding to the file to be stored;

[0132] A first line terminator determination unit, configured to obtain a first check result that the line terminator is correct when the terminator of each line is correct;

[0133] The second line terminator determining unit is used for obtaining a first checking result that the line terminator is incorrect when the line terminator of any line is incorrect.

[0134] Wherein, the second inspection module 430 includes:

[0135] A data item quantity determination unit, configured to determine the number of data items corresponding to the to-be-stored file based on the preset inspection rule set;

[0136] The second reading unit is used to read the content of the file to be stored line by line to obtain the number of data separators;

[0137] A comparison unit, used for comparing the number of the data separators with the number of the data items to obtain a comparison result;

[0138] The detection result unit is used to obtain a second inspection result based on the comparison result.

[0139] Wherein, the third inspection module 440 includes:

[0140] A second rule determination unit, configured to determine a special column data format rule corresponding to the to-be-stored file based on the preset inspection rule set;

[0141] A third reading unit is used to read the content of the to-be-stored file line by line based on the special column data format rule to obtain a data value at a preset position;

[0142] The judging unit is used to judge whether the data format of the data value at the preset position is correct based on the special column data format rule, and obtain a third checking result.

[0143] Among them, it also includes:

[0144] A third rule determination module, used to determine the file name rule corresponding to the to-be-stored file based on the preset inspection rule set;

[0145] A division module divides the file name of the to-be-stored file into multiple parts to obtain multiple name fields;

[0146] A judgment module, used for judging whether each name field is correct based on the file name rule, to obtain a fourth checking result;

[0147] The result module 450 includes:

[0148] The result determination unit is used to obtain the inspection result of the incoming file based on the first inspection result, the second inspection result, the third inspection result and the fourth inspection result.

[0149] This also includes any one or more of the following:

[0150] A first display module is used to generate inspection process information during the inspection process and display the inspection process information;

[0151] The second display module is used to generate an inspection log based on the inspection result of the incoming file after the inspection is completed, and display the inspection log.

[0152] The incoming file inspection device includes a processor and a memory. The above-mentioned acquisition module 410, first inspection module 420, second inspection module 430, third inspection module 440 and result module 450 are all stored in the memory as program units, and the processor executes the above-mentioned program modules stored in the memory to implement corresponding functions.

[0153] The processor includes a kernel, which retrieves the corresponding program unit from the memory. One or more kernels can be set, and the method of checking the incoming files can be implemented by adjusting the kernel parameters.

[0154] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM, and the memory includes at least one memory chip.

[0155] An embodiment of the present application provides a machine-readable storage medium on which a program is stored. When the program is executed by a processor, the above-mentioned method for checking incoming files is implemented.

[0156] An embodiment of the present application provides a processor, which is used to run a program, wherein the program executes the above-mentioned storage file inspection method when running.

[0157] In one embodiment, a computer device is provided. The computer device may be a terminal, and its internal structure diagram may be as follows: Figure 6As shown. The computer device includes a processor A01, a network interface A02, a display screen A04, an input device A05 and a memory (not shown in the figure) connected through a system bus. Among them, the processor A01 of the computer device is used to provide computing and control capabilities. The memory of the computer device includes an internal memory A03 and a non-volatile storage medium A06. The non-volatile storage medium A06 stores an operating system B01 and a computer program B02. The internal memory A03 provides an environment for the operation of the operating system B01 and the computer program B02 in the non-volatile storage medium A06. The network interface A02 of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor A01, a method for checking incoming documents is implemented. The display screen A04 of the computer device can be a liquid crystal display or an electronic ink display, and the input device A05 of the computer device can be a touch layer covered on the display screen, or a button, trackball or touchpad set on the computer device housing, or an external keyboard, touchpad or mouse, etc.

[0158] Those skilled in the art will understand that Figure 6 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0159] In one embodiment, the inbound document inspection device provided by the present application can be implemented in the form of a computer program. The computer program can be Figure 6 The computer device shown in the figure is run. The memory of the computer device can store various program modules constituting the incoming document inspection device, for example, Figure 5 The obtained module 410, the first checking module 420, the second checking module 430, the third checking module 440 and the result module 450 are shown. The computer program composed of each program module enables the processor to execute the steps of the storage file checking method of each embodiment of the present application described in this specification.

[0160] Figure 6 The computer device shown can be Figure 5 The acquisition module 410 in the storage document inspection device shown executes step 210. The computer device may execute step 220 through the first inspection module 420, execute step 230 through the second inspection module 430, execute step 240 through the third inspection module 440, and execute step 250 through the result module 450.

[0161] The present application also provides a computer program product, which, when executed on a data processing device, is suitable for executing a program for initializing the following method steps:

[0162] Get the files to be stored;

[0163] Based on a preset check rule set, the terminator of each line in the to-be-stored file is checked to obtain a first check result;

[0164] Based on a preset check rule set, the data items in the to-be-stored file are checked to obtain a second check result;

[0165] Based on a preset check rule set, a data format of a preset position in the to-be-stored file is checked to obtain a third check result;

[0166] Based on the first inspection result, the second inspection result and the third inspection result, an incoming file inspection result is obtained.

[0167] In one embodiment, the end character of each line in the to-be-stored file is checked based on a preset check rule set to obtain a first check result, including:

[0168] Based on the preset check rule set, determine the line ending check rule corresponding to the file to be stored;

[0169] Read the content of the file to be stored line by line to obtain the end mark of each line;

[0170] Based on the line terminator checking rule corresponding to the file to be stored, determining whether the terminator of each line is correct;

[0171] When the end character of each line is correct, a first check result is obtained that the line end character is correct;

[0172] In the case where the end character of any line is incorrect, the first check result is that the line end character is incorrect.

[0173] In one embodiment, the data items in the to-be-stored file are checked based on a preset check rule set to obtain a second check result, including:

[0174] Based on the preset inspection rule set, determining the number of data items corresponding to the file to be stored;

[0175] Read the contents of the file to be stored line by line to obtain the number of data separators;

[0176] Compare the number of data separators with the number of data items to obtain a comparison result;

[0177] Based on the comparison result, a second inspection result is obtained.

[0178] In one embodiment, the data format of a preset position in the to-be-stored file is checked based on a preset check rule set to obtain a third check result, including:

[0179] Based on the preset inspection rule set, determining the special column data format rule corresponding to the to-be-stored file;

[0180] Based on the special column data format rule, read the content of the to-be-stored file line by line to obtain the data value of the preset position;

[0181] Based on the special column data format rule, it is determined whether the data format of the data value at the preset position is correct to obtain a third check result.

[0182] In one embodiment, it further includes:

[0183] Based on the preset inspection rule set, determine the file name rule corresponding to the file to be stored;

[0184] Divide the file name of the file to be stored into multiple parts to obtain multiple name fields;

[0185] Based on the file name rule, determine whether each name field is correct to obtain a fourth check result;

[0186] The step of obtaining the incoming file inspection result based on the first inspection result, the second inspection result and the third inspection result includes:

[0187] Based on the first inspection result, the second inspection result, the third inspection result and the fourth inspection result, an incoming file inspection result is obtained.

[0188] In one embodiment, any one or more of the following are also included:

[0189] During the inspection process, inspection process information is generated and displayed;

[0190] After the inspection is completed, an inspection log is generated based on the inspection results of the incoming documents, and the inspection log is displayed.

[0191] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.

[0192] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0193] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0194] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0195] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.

[0196] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.

[0197] Computer readable media include permanent and non-permanent, removable and non-removable media, and can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.

[0198] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.

[0199] The above are only embodiments of the present application and are not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included within the scope of the claims of the present application.

Claims

1. A method for checking incoming documents, characterized in that: The method for checking incoming documents includes: Get the files to be stored; Based on a preset check rule set, the terminator of each line in the to-be-stored file is checked to obtain a first check result; Based on a preset check rule set, the data items in the to-be-stored file are checked to obtain a second check result; Based on a preset check rule set, a data format of a preset position in the to-be-stored file is checked to obtain a third check result; Based on the first inspection result, the second inspection result and the third inspection result, an incoming file inspection result is obtained.

2. The method according to claim 1, characterized in that The step of checking the terminator of each line in the file to be stored based on the preset check rule set to obtain a first check result includes: Based on the preset check rule set, determine the line ending check rule corresponding to the file to be stored; Read the content of the file to be stored line by line to obtain the end mark of each line; Based on the line terminator checking rule corresponding to the file to be stored, determining whether the terminator of each line is correct; When the end character of each line is correct, a first check result is obtained that the line end character is correct; In the case where the end character of any line is incorrect, the first check result is that the line end character is incorrect.

3. The method according to claim 1, characterized in that The step of checking the data items in the to-be-stored file based on the preset check rule set to obtain a second check result includes: Based on the preset inspection rule set, determining the number of data items corresponding to the file to be stored; Read the contents of the file to be stored line by line to obtain the number of data separators; Compare the number of data separators with the number of data items to obtain a comparison result; Based on the comparison result, a second inspection result is obtained.

4. The method according to claim 1, characterized in that The method of checking the data format of the preset position in the file to be stored based on the preset check rule set to obtain a third check result includes: Based on the preset inspection rule set, determining the special column data format rule corresponding to the to-be-stored file; Based on the special column data format rule, read the content of the to-be-stored file line by line to obtain the data value of the preset position; Based on the special column data format rule, it is determined whether the data format of the data value at the preset position is correct to obtain a third check result.

5. The method according to claim 1, characterized in that Also includes: Based on the preset inspection rule set, determine the file name rule corresponding to the file to be stored; Divide the file name of the file to be stored into multiple parts to obtain multiple name fields; Based on the file name rule, determine whether each name field is correct to obtain a fourth check result; The step of obtaining the incoming file inspection result based on the first inspection result, the second inspection result and the third inspection result includes: Based on the first inspection result, the second inspection result, the third inspection result and the fourth inspection result, an incoming file inspection result is obtained.

6. The method according to claim 1, characterized in that Also includes any one or more of the following: During the inspection process, inspection process information is generated and displayed; After the inspection is completed, an inspection log is generated based on the inspection results of the incoming documents, and the inspection log is displayed.

7. A device for checking incoming documents, characterized in that: The incoming document inspection device comprises: The acquisition module is used to obtain the files to be stored; A first checking module, configured to check the end character of each line in the to-be-stored file based on a preset checking rule set, and obtain a first checking result; A second checking module is used to check the data items in the to-be-stored file based on a preset checking rule set to obtain a second checking result; A third inspection module, configured to inspect the data format of a preset position in the to-be-stored file based on a preset inspection rule set, and obtain a third inspection result; A result module is used to obtain an incoming file inspection result based on the first inspection result, the second inspection result and the third inspection result.

8. A processor, characterized in that: The method is configured to execute the incoming document inspection method according to any one of claims 1 to 6.

9. A machine-readable storage medium having instructions stored thereon, characterized in that: When the instruction is executed by a processor, the processor is configured to execute the incoming document inspection method according to any one of claims 1 to 6.

10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the computer program implements the method for checking incoming documents according to any one of claims 1 to 6.

Citation Information

Patent Citations

  • Data quality inspection method and device

    CN112463780A

  • File batch storage method and device, equipment and storage medium

    CN116644035A

  • Warehouse number group check apparatus, warehouse number group check method, and warehouse number group check program

    JP2024072676A