Structured file verification method and device, equipment, medium and program product
By generating a calibration content configuration table and applying predefined calibration rules, the problem of inefficient calibration of structured files is solved, efficient and automated data verification is achieved, and data accuracy and consistency are ensured.
Patent Information
- Application Number
- CN202411017611.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-26
- Publication Date
- 2024-11-22
AI Technical Summary
In the prior art, the verification efficiency of structured files is inefficient, relying on manual inspection, making errors prone, and it is difficult to ensure the consistency and accuracy of data.
By generating a verification content configuration table, it contains the configuration identification information of each field and the associated rule identification information, and automatically checks the structured file according to the predefined verification rule table, supporting regular expression verification and primary foreign keys Relationship verification and other rules types.
It realizes efficient and automated structured file verification, improves verification efficiency, avoids manual errors, ensures data accuracy and consistency, and supports flexible rule configuration and management.
Smart Images

Figure CN119005172A_ABST
Abstract
Description
Background Art
[0002] With the advent of the information age, data has become a vital resource in enterprises and organizations. In various fields, such as finance, medical care, education, government, etc., the effective management and utilization of data has become the key to improving efficiency, decision support and risk control. However, the quality of data directly affects the effect of data analysis and application. Inaccurate or incomplete data may lead to wrong decisions, business process interruptions and waste of resources. In this context, structured file verification methods have emerged. Structured files refer to those files with fixed formats and organizational structures, such as Excel files, XML files, etc. They contain multiple fields, each of which contains a specific type of data content. These files play an important role in data exchange, storage and processing. However, due to data entry errors, inconsistent formats, data loss and other reasons, the data in these structured files may have quality problems.
[0003] In order to ensure data quality, structured files need to be verified. Traditional verification methods rely on manual inspection, which is inefficient and prone to errors. Therefore, there is an urgent need for an automated, efficient and configurable structured file verification method to ensure data consistency and accuracy.
[0004] It should be noted that the information disclosed in the above background technology section is only used to enhance the understanding of the background of the present disclosure, and therefore may include information that does not constitute the prior art known to ordinary technicians in the field. Summary of the invention
[0005] The present disclosure provides a structured file verification method, apparatus, device, medium and program product, which at least to a certain extent overcome the problem of low efficiency in verifying structured files in related technologies.
[0006] Other features and advantages of the present disclosure will become apparent from the following detailed description, or may be learned in part by the practice of the present disclosure.
[0007] According to one aspect of the present disclosure, a structured file verification method is provided, comprising:
[0008] Obtain the file to be verified, which includes multiple fields;
[0009] Generate a verification content configuration table according to the file to be verified, the verification content configuration table includes configuration identification information of each field and rule identification information associated with each field, wherein the rule identification information is information identifying different verification rules in a predefined verification rule table, and the verification rule table includes multiple verification rules;
[0010] According to the verification rule corresponding to the rule identification information associated with each field in the verification content configuration table, the content corresponding to each field in the verification file is verified.
[0011] In some embodiments, before generating the verification content configuration table according to the file to be verified, the method further includes:
[0012] Define a validation rule table, which may include one or more of the following: rule name, rule code, rule type, and rule content.
[0013] In some embodiments, the above rule types include one or more of the following: regular expression verification, primary and foreign key relationship verification, and general verification.
[0014] In some embodiments, the above rule names include one or more of the following: cannot be empty, email, integer, identity information, floating point number, Chinese, mobile phone number, creation time, end time, product identifier, product attribute identifier, input class length, name class length.
[0015] In some embodiments, generating a verification content configuration table according to the file to be verified includes:
[0016] Obtain the field information of each field in the file to be verified, where the field information includes one or more of the following: the name of the file to be verified where each field is located, the name of the worksheet where each field is located, the field name, and the field code;
[0017] According to the field information of each field, the verification rules in the verification rule table are associated, wherein each verification rule corresponds to a rule identification information;
[0018] A verification content configuration table is generated according to the field information of each field and the rule identification information corresponding to each verification rule.
[0019] In some embodiments, the file to be verified includes an Excel file.
[0020] According to another aspect of the present disclosure, a structured file verification device is also provided, comprising:
[0021] A file acquisition module, used to acquire a file to be verified, wherein the file to be verified includes multiple fields;
[0022] A configuration table generating module, used to generate a verification content configuration table according to the file to be verified, wherein the verification content configuration table includes configuration identification information of each field and rule identification information associated with each field, wherein the rule identification information is information for identifying different verification rules in a predefined verification rule table, and the verification rule table includes multiple verification rules;
[0023] The verification module is used to verify the content corresponding to each field in the file to be verified according to the verification rule corresponding to the rule identification information associated with each field in the verification content configuration table.
[0024] According to another aspect of the present disclosure, an electronic device is also provided, comprising: a processor; and a memory for storing executable instructions of the processor; wherein the processor is configured to execute any one of the structured file verification methods described above by executing the executable instructions.
[0025] According to another aspect of the present disclosure, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the structured file verification method described in any one of the above is implemented.
[0026] According to another aspect of the present disclosure, a computer program product is provided, including a computer program, wherein when the computer program is executed by a processor, the computer program implements any one of the above structured file verification methods.
[0027] The structured file verification method, device, equipment, medium and program product provided in the embodiments of the present disclosure obtain the file to be verified, identify each field in the file, and generate a verification content configuration table according to these fields, which contains the configuration identification information and associated rule identification information corresponding to each field. The associated rule identification information points to the specific verification rule in the pre-defined verification rule table, and the corresponding verification rule is applied to the content of each field in the verification file according to the verification content configuration table to verify the accuracy and integrity of the data. The embodiments of the present disclosure provide an efficient, configurable and standardized data verification solution. Through the automated verification process, a large number of structured files can be quickly verified, which improves the verification efficiency of structured files and avoids the tediousness and potential errors of manual verification. At the same time, through the pre-defined verification rule table, the consistency and repeatability of the verification process are ensured, and the use of the verification rule table and the verification content configuration table provides flexible rule configuration and a verification process that is easy to intuitively manage, so that the system can adapt to different verification requirements and rule changes.
[0028] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0029] The accompanying drawings herein are incorporated into the specification and constitute a part of the specification, illustrate embodiments consistent with the present disclosure, and together with the specification are used to explain the principles of the present disclosure. Obviously, the accompanying drawings described below are only some embodiments of the present disclosure, and for ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without creative work.
[0030] Figure 1 A schematic diagram showing an exemplary application system architecture of an application structured file verification method in an embodiment of the present disclosure;
[0031] Figure 2 A flow chart of a structured file verification method in an embodiment of the present disclosure is shown;
[0032] Figure 3 A flow chart of another structured file verification method in an embodiment of the present disclosure is shown;
[0033] Figure 4 A detailed Excel file interface schematic diagram is shown in an embodiment of the present disclosure;
[0034] Figure 5 A schematic diagram of a predefined verification rule in an embodiment of the present disclosure is shown;
[0035] Figure 6 A schematic diagram of a verification content configuration representation in an embodiment of the present disclosure is shown;
[0036] Figure 7 A detailed Excel file verification flow chart in an embodiment of the present disclosure is shown;
[0037] Figure 8 A schematic diagram of a structured file verification device in an embodiment of the present disclosure is shown;
[0038] Fig. 9 A structural block diagram of an electronic device in an embodiment of the present disclosure is shown. DETAILED DESCRIPTION
[0039] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in a variety of forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that the disclosure will be more comprehensive and complete and to fully convey the concepts of the example embodiments to those skilled in the art. The described features, structures, or characteristics may be combined in any suitable manner in one or more embodiments.
[0040] In addition, the accompanying drawings are only schematic illustrations of the present disclosure and are not necessarily drawn to scale. The same reference numerals in the figures represent the same or similar parts, and their repeated description will be omitted. Some of the block diagrams shown in the accompanying drawings are functional entities and do not necessarily correspond to physically or logically independent entities. These functional entities can be implemented in software form, or implemented in one or more hardware modules or integrated circuits, or implemented in different networks and / or processor devices and / or microcontroller devices.
[0041] The specific implementation of the embodiment of the present disclosure is described in detail below with reference to the accompanying drawings.
[0042] Figure 1 FIG. 1 shows an exemplary application system architecture diagram to which the structured file verification method in the embodiment of the present disclosure can be applied. Figure 1 As shown, the system architecture may include a terminal device 101 , a network 102 and a server 103 .
[0043] The network 102 is a medium for providing a communication link between the terminal device 101 and the server 103, and can be a wired network or a wireless network.
[0044] Optionally, the wireless network or wired network described above uses standard communication technology and / or protocol. The network is usually the Internet, but it can also be any network, including but not limited to a local area network (LAN), a metropolitan area network (MAN), a wide area network (WAN), a mobile, wired or wireless network, a dedicated network or any combination of a virtual private network). In some embodiments, the data exchanged through the network is represented by technologies and / or formats including Hyper Text Mark-up Language (HTML), Extensible Markup Language (XML), etc. In addition, conventional encryption technologies such as Secure Socket Layer (SSL), Transport Layer Security (TLS), Virtual Private Network (VPN), Internet Protocol Security (IPSec) can also be used to encrypt all or some links. In other embodiments, customized and / or dedicated data communication technologies can also be used to replace or supplement the above data communication technologies.
[0045] The terminal device 101 can be various electronic devices, including but not limited to smart phones, tablet computers, laptop computers, desktop computers, smart speakers, smart watches, wearable devices, augmented reality devices, virtual reality devices, etc.
[0046] Optionally, the client of the application installed in different terminal devices 101 is the same, or the client of the same type of application based on different operating systems. Based on the different terminal platforms, the specific form of the client of the application can also be different, for example, the application client can be a mobile client, a PC client, etc.
[0047] The server 103 may be a server that provides various services, such as a background management server that provides support for the device operated by the user using the terminal device 101. The background management server may analyze and process the received request and other data, and feed back the processing results to the terminal device.
[0048] Optionally, the server can be an independent physical server, a server cluster or distributed system composed of multiple physical servers, or a cloud server that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communications, middleware services, domain name services, security services, CDN (Content Delivery Network), as well as big data and artificial intelligence platforms.
[0049] Those skilled in the art will know that Figure 1 The number of terminal devices, networks and servers in the embodiment is only for illustration, and any number of terminal devices, networks and servers may be provided according to actual needs, and the embodiments of the present disclosure do not limit this.
[0050] Under the above system architecture, a structured file verification method is provided in an embodiment of the present disclosure, and the method can be executed by any electronic device with computing and processing capabilities.
[0051] In some embodiments, the structured file verification method provided in the embodiments of the present disclosure can be executed by a terminal device of the above-mentioned system architecture; in other embodiments, the structured file verification method provided in the embodiments of the present disclosure can be executed by a server in the above-mentioned system architecture; in other embodiments, the structured file verification method provided in the embodiments of the present disclosure can be implemented by the terminal device and the server in the above-mentioned system architecture through interaction.
[0052] Figure 2 A flow chart of a structured file verification method in an embodiment of the present disclosure is shown as follows: Figure 1 As shown, the structured file verification method provided in the embodiment of the present disclosure includes the following steps:
[0053] S202, obtaining a file to be verified, where the file to be verified includes multiple fields.
[0054] It should be noted that the file to be verified can be any structured file that needs to be verified. A structured file is a file containing data in a specific format, such as CSV (Comma-Separated Values), XML (eXtensible Markup Language), JSON (JavaScript Object Notation), Excel (spreadsheet) files, etc. The structured file to be verified consists of multiple fields, and each field contains a specific type of data content.
[0055] S204, generating a verification content configuration table according to the file to be verified, the verification content configuration table including configuration identification information of each field and rule identification information associated with each field, wherein the rule identification information is information for identifying different verification rules in a predefined verification rule table, and the verification rule table includes multiple verification rules.
[0056] It should be noted that configuration identification information refers to a set of information used to uniquely identify and describe each field in a structured file. The configuration identification information is included in the verification content configuration table and is used as an identification number in the verification content configuration table. Through the configuration identification information, the verification system can accurately identify and verify each field to ensure the integrity and accuracy of the data.
[0057] Rule identification information is information used to uniquely identify a specific verification rule. During the structured file verification process, each field may need to satisfy at least one verification rule, and the rule identification information is used to indicate which verification rules apply to which field. In the disclosed embodiment, the rule identification information is contained in a predefined verification rule table, and the verification rule table includes multiple verification rules. By associating the configuration identification information of each field in the verification content configuration table with the rule identification information in the verification rule table, the verification process can be standardized and modularized, making the maintenance and update of the rules more flexible and convenient.
[0058] In the disclosed embodiment, the verification content configuration table is a table or data structure used to describe the verification rules that each field in the file to be verified should follow. The verification content configuration table contains configuration identification information for each field. The configuration identification information associates the field in the file to be verified with a specific verification rule to provide guidance for the verification process. The verification rule table is a list or database table containing a series of verification rules. Each verification rule defines how to verify the data of a specific field, and each verification rule corresponds to a rule identification information. The configuration identification information of the verification content configuration table is associated with the rule identification information in the verification rule table, which realizes the visualization of the verification rules for each field. The specific verification rules used for all fields can be seen more intuitively, and it also becomes simpler and more feasible when changing the verification rules.
[0059] S206: Verify the content corresponding to each field in the file to be verified according to the verification rule corresponding to the rule identification information associated with each field in the verification content configuration table.
[0060] The verification content configuration table contains the configuration flag information of each field in the file to be verified and the rule identification information associated with each field. The associated rule identification information indicates which verification rules are applied to each field. At the beginning of the verification, the system first reads the verification content configuration table to obtain each field and its associated rule identification information. For each field in the verification content configuration table, the system searches for the corresponding verification rule in the verification rule table according to its associated rule identification information. The system executes the corresponding verification logic for the content of each field in the file to be verified according to the definition in the verification rule table. Such verification ensures that the content corresponding to each field in the file to be verified complies with the predefined verification rules.
[0061] The disclosed embodiment associates the configuration identification information in the verification content configuration table with the rule identification information in the verification rule table, so that the specific verification rules applied to each field can be intuitively seen. When the verification rules need to be changed, only the corresponding rule definition needs to be updated in the verification rule table without modifying the verification logic code, which makes the maintenance and update of the verification rules simpler and more feasible.
[0062] The structured file verification method provided according to the embodiment of the present disclosure can quickly verify a large number of structured files, avoiding the tediousness and potential errors of manual verification. The consistency and repeatability of the verification process are ensured by the pre-defined verification rule table, which helps to maintain data quality and accuracy. The rule identification information allows the verification rules to be flexibly managed and updated, so that the system can adapt to different verification requirements and rule changes. The verification content configuration table can be configured according to different file types and verification requirements, improving the applicability and scalability of the system. The embodiment of the present disclosure can significantly improve the verification efficiency, especially for large files or files that need to be frequently verified, which can save a lot of time and human resources.
[0063] In some embodiments of the present disclosure, the above-mentioned file to be verified may be an Excel file.
[0064] In some embodiments of the present disclosure, before generating a verification content configuration table according to the file to be verified, it also includes: defining a verification rule table, and the verification rule table also includes one or more of the following: rule name, rule code, rule type, and rule content.
[0065] It should be noted that before processing the file to be verified, a verification rule table is created and defined in advance, that is, the verification rule table is preset and contains detailed information of various verification rules, which will be used to verify the data content in the file to be verified.
[0066] The following are the main components of the validation rule table:
[0067] Rule name: indicates the name of the validation rule, which is usually an easy-to-understand descriptive name, such as "non-empty validation", "email format validation", etc. In the disclosed embodiment, the rule name includes one or more of the following: cannot be empty, email, integer, identity information, floating point number, Chinese, mobile phone number, creation time, end time, product identifier, product attribute identifier, input class length, name class length. Among them, "cannot be empty" checks whether the content of the field is empty, that is, whether it contains any data. "Email" checks whether the field conforms to the standard format of the email address. "Integer" checks whether the field is an integer type. "Identity information" checks whether the field contains specific identity information, such as ID card number, passport number, etc. "Floating point number" checks whether the field is a floating point type, that is, whether it contains a decimal point. "Chinese" checks whether the field contains Chinese characters. "Mobile phone number" checks whether the field conforms to the standard format of mobile phone numbers. "Creation time" checks whether the field is a valid date and time, which is usually used to record the time when the data is created or modified. "End time" checks whether the field is a valid end date and time, which is usually used to record the end time of the activity. "Product Identification" verifies whether the field is a valid product identification, such as product code, product model, etc. "Product Attribute Identification" verifies whether the field is a valid product attribute identification, such as color, size, weight, etc. "Input Length" verifies whether the length of the field meets the predefined standards, usually used to limit the number of input characters. "Name Length" verifies whether the length of the field meets the predefined standards, usually used to limit the number of name characters.
[0068] Rule code: A code used to represent a validation rule, and is used to reference the rule in the validation content configuration table. The validation rule table assigns a unique code to each validation rule, such as "RULE-001", "VALIDATE_EMAIL", etc.
[0069] Rule type: indicates the type of validation rule, such as regular expression validation, primary and foreign key relationship validation, general validation, etc. The rule type determines how the rule validates data to meet different data validation requirements. Among them, regular expression is a powerful text pattern matching tool used to verify whether the field value conforms to a specific string format. For example, you can verify whether the email address conforms to the standard format, whether the phone number conforms to the specific format of the country or region, etc. Primary and foreign key relationship validation is applicable to data validation in the database to ensure that there is a correct relationship between the foreign key and the primary key in the data table. For example, in an Excel file, you can verify whether a field is a valid reference to another field, or whether it is in a predefined list. General validation is applicable to the validation of multiple data types, including but not limited to data type validation, length validation, range validation, etc. For example, you can verify whether the field value is an integer, a floating point number, a string, or whether it is within a predefined length range. Through these rule types, the system can flexibly verify the data in the file to be verified to ensure the accuracy and consistency of the data.
[0070] Rule content: represents the specific validation logic of the validation rule, including data type, format, range, etc. Rule content is the core of the validation rule, which defines how to validate the data of a specific field.
[0071] By defining the validation rule table, the system can pre-configure a series of validation rules, which can be selected and combined according to different requirements. When an Excel file needs to be validated, the system will select the corresponding validation rules based on the field information in the validation content configuration table, and apply these rules to validate the data in the Excel file. The validation content configuration table and validation rule table provide a flexible and configurable validation framework, which enables the system to quickly adapt to different validation requirements, and can easily update and expand validation rules. It also improves the automation of the validation process, reduces the need for manual intervention, and thus improves the efficiency and accuracy of validation.
[0072] In some embodiments of the present disclosure, Figure 3 As shown, generating a verification content configuration table according to the file to be verified also includes the following steps:
[0073] S302, obtaining field information of each field in the file to be verified, where the field information includes one or more of the following: the name of the file to be verified where each field is located, the name of the worksheet where each field is located, the field name, and the field code;
[0074] S304, associating the verification rule in the verification rule table according to the field information of each field, wherein each verification rule corresponds to a rule identification information;
[0075] S306: Generate a verification content configuration table according to the field information of each field and the rule identification information corresponding to each verification rule.
[0076] It should be noted that field information refers to the information representing each field in a structured file. Taking an Excel file as an example, the field information in an Excel file includes detailed information about each field, such as the name of the file to be verified where each field is located, that is, the Excel file name, the name of the worksheet where each field is located, that is, the Sheet name in the Excel file, the field name, and the field code.
[0077] According to the field information of each field, the corresponding verification rule is found in the verification rule table. Each verification rule has a unique rule identification information, which is used to reference in the verification content configuration table.
[0078] Generate a verification content configuration table based on the field information and associated verification rules of each field. The verification content configuration table lists the rule identification information corresponding to each field and its associated verification rules, providing guidance for the subsequent verification process.
[0079] The verification content configuration table generated by the embodiment of the present disclosure provides a clear verification blueprint, so that the verification process can be automatically executed according to predetermined rules. When an Excel file needs to be verified, the system can apply corresponding verification rules to each field in the file according to the information in the verification content configuration table to ensure the accuracy and consistency of the data. At the same time, this method also improves the automation of the verification process, reduces the need for manual intervention, and thus improves the efficiency and accuracy of the verification.
[0080] In the embodiment of the present disclosure, taking the verification Excel table as an example, Figure 4-Figure 7 Taking this as an example, it is explained in detail how to use the method provided by the embodiment of the present disclosure to verify a specific Excel file.
[0081] Figure 4 A detailed Excel file interface diagram in an embodiment of the present disclosure is shown. Figure 4 The Excel table named "Product Data" includes multiple worksheets, and each worksheet includes multiple fields.
[0082] Figure 5 A schematic diagram of a predefined verification rule representation in an embodiment of the present disclosure is shown, wherein id is configuration identification information, which can also be called a rule primary key identifier, rule_name is the rule name, rule_code is the rule code, rule_type is the rule type, and rule is the rule content.
[0083] Figure 6 The present disclosure shows an embodiment according to Figure 4 The validation content configuration table is generated by the Excel file, where id represents the primary key identifier of the validation content configuration table, excel_name is the Excel file name, sheet_name is the sheet page name, title_name is the header name, that is, the field name, title_code is the header code, that is, the field code, and rule_id is the primary key identifier of the associated validation rule, that is, the rule identification information.
[0084] in, Figure 6 Configuration identification information in , id "4", corresponding field name "product code", associated rule identification information, rule_id "1", corresponding to Figure 5 The rule identification information in the verification rule table, id "1", the corresponding rule name is "cannot be empty", and the corresponding rule type is "regular expression verification".
[0085] Figure 6 Configuration identification information in , id "6", corresponding field name "creation time", associated rule identification information, rule_id "8", corresponding to Figure 5 Verify the rule identification information in the rule table, id "8", the corresponding rule name is "creation time", and the corresponding rule type is "regular expression verification".
[0086] Figure 6 Configuration identification information in , id "10", corresponding field name "product attribute name", associated rule identification information, rule_id "13", corresponding to Figure 5 The rule identification information in the verification rule table, id "13", the corresponding rule name is "name class length", and the corresponding rule type is "general verification".
[0087] Figure 7 A detailed Excel file verification flow chart is shown, as Figure 7 As shown, including:
[0088] S702, pre-define the verification rules and generate a verification rule table;
[0089] S704, obtaining field information of each field in the Excel file;
[0090] S706, generating a verification content configuration table according to the field information of each field in the Excel file, wherein each field in the verification content configuration table is associated with a verification rule in the verification rule table;
[0091] S708, reading the information in the verification content configuration table, and verifying the imported Excel file.
[0092] In the disclosed embodiment, the verification rule table and the verification content configuration table are combined to complete the verification configuration of the Excel file import. Compared with the traditional annotation method, there is no need to process a large number of code files corresponding to the headers, and only two tables need to be operated in use; the verification rule table includes at least the primary key identifier, rule name, rule code, rule type, and rule content field. It is easier to record the required verification rules and add and change rules; the verification content configuration table includes at least the primary key identifier, excel file name, sheet page file name, header name, header code, and rule table primary key identifier. When changing the configuration, there is no need to modify the code or restart the system, which is more flexible and efficient.
[0093] Based on the same inventive concept, the present disclosure also provides a structured file verification device, as described in the following embodiments. Since the principle of solving the problem in the device embodiment is similar to that in the above method embodiment, the implementation of the device embodiment can refer to the implementation of the above method embodiment, and the repeated parts will not be repeated.
[0094] Figure 8 A schematic diagram of a structured file verification device in an embodiment of the present disclosure is shown. Figure 8 As shown, the device comprises:
[0095] The file acquisition module 801 is used to acquire the file to be verified, and the file to be verified includes multiple fields;
[0096] A configuration table generating module 802 is used to generate a verification content configuration table according to the file to be verified, wherein the verification content configuration table includes configuration identification information of each field and rule identification information associated with each field, wherein the rule identification information is information for identifying different verification rules in a predefined verification rule table, and the verification rule table includes multiple verification rules;
[0097] The verification module 803 is used to verify the content corresponding to each field in the file to be verified according to the verification rule corresponding to the rule identification information associated with each field in the verification content configuration table.
[0098] In some embodiments of the present disclosure, the configuration table generation module 802 is further used to define a verification rule table, which further includes one or more of the following: rule name, rule code, rule type, and rule content.
[0099] In some embodiments of the present disclosure, the above-mentioned configuration table generation module 802 is also used to obtain field information of each field in the file to be verified, and the field information includes one or more of the following: the name of the file to be verified where each field is located, the name of the worksheet where each field is located, the field name, and the field code; according to the field information of each field, the verification rules in the verification rule table are associated, wherein each verification rule corresponds to a rule identification information; and a verification content configuration table is generated according to the field information of each field and the rule identification information corresponding to each verification rule.
[0100] It should be noted that the examples and application scenarios implemented by the above modules and corresponding steps are the same, but are not limited to the contents disclosed in the above method embodiments. It should be noted that the above modules as part of the device can be executed in a computer system such as a set of computer executable instructions.
[0101] Those skilled in the art will appreciate that various aspects of the present disclosure may be implemented as systems, methods or program products. Therefore, various aspects of the present disclosure may be specifically implemented in the following forms, namely: complete hardware implementation, complete software implementation (including firmware, microcode, etc.), or a combination of hardware and software, which may be collectively referred to herein as "circuits", "modules" or "systems".
[0102] Refer to the following Fig. 9 The electronic device 900 according to this embodiment of the present disclosure is described. Fig. 9 The electronic device 900 shown is merely an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.
[0103] like Fig. 9 As shown, the electronic device 900 is in the form of a general computing device. The components of the electronic device 900 may include but are not limited to: at least one processing unit 910, at least one storage unit 920, and a bus 930 connecting different system components (including the storage unit 920 and the processing unit 910).
[0104] Among them, the storage unit stores a program code, and the program code can be executed by the processing unit 910, so that the processing unit 910 executes the steps described in the above "Exemplary Method" section of this specification according to various exemplary embodiments of the present disclosure. For example, the processing unit 910 can execute the following steps of the above method embodiment: obtain a file to be verified, and the file to be verified includes multiple fields; generate a verification content configuration table according to the file to be verified, and the verification content configuration table includes configuration identification information of each field and rule identification information associated with each field, wherein the rule identification information is information for identifying different verification rules in a predefined verification rule table, and the verification rule table includes multiple verification rules; according to the verification rule corresponding to the rule identification information associated with each field in the verification content configuration table, verify the content corresponding to each field in the file to be verified.
[0105] The storage unit 920 may include a readable medium in the form of a volatile storage unit, such as a random access storage unit (RAM) 9201 and / or a cache storage unit 9202 , and may further include a read-only storage unit (ROM) 9203 .
[0106] The storage unit 920 may also include a program / utility 9204 having a set (at least one) of program modules 9205, such program modules 9205 including but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment.
[0107] Bus 930 may represent one or more of several types of bus structures, including a memory unit bus or memory unit controller, a peripheral bus, an accelerated graphics port, a processing unit, or a local bus using any of a variety of bus architectures.
[0108] The electronic device 900 may also communicate with one or more external devices 940 (e.g., keyboards, pointing devices, Bluetooth devices, etc.), may also communicate with one or more devices that enable a user to interact with the electronic device 900, and / or may communicate with any device that enables the electronic device 900 to communicate with one or more other computing devices (e.g., routers, modems, etc.). Such communication may be performed via an input / output (I / O) interface 950. Furthermore, the electronic device 900 may also communicate with one or more networks (e.g., local area networks (LANs), wide area networks (WANs), and / or public networks, such as the Internet) via a network adapter 960. As shown, the network adapter 960 communicates with other modules of the electronic device 900 via a bus 930. It should be understood that, although not shown in the figure, other hardware and / or software modules may be used in conjunction with the electronic device 900, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, etc.
[0109] Through the description of the above implementation, it is easy for those skilled in the art to understand that the example implementation described here can be implemented by software, or by software combined with necessary hardware. Therefore, the technical solution according to the implementation of the present disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, including several instructions to enable a computing device (which can be a personal computer, a server, a terminal device, or a network device, etc.) to execute the method according to the implementation of the present disclosure.
[0110] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart may be implemented as a computer program product, which includes: a computer program, which implements the method in the above embodiment when executed by a processor.
[0111] In an exemplary embodiment of the present disclosure, a computer-readable storage medium is also provided, which may be a readable signal medium or a readable storage medium. A program product capable of implementing the above method of the present disclosure is stored thereon. In some possible implementations, various aspects of the present disclosure may also be implemented in the form of a program product, which includes a program code, and when the program product is run on a terminal device, the program code is used to cause the terminal device to execute the steps according to various exemplary implementations of the present disclosure described in the above “Exemplary Method” section of this specification.
[0112] More specific examples of computer-readable storage media in the present disclosure may include, but are not limited to, an electrical connection having one or more conductors, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0113] In the present disclosure, a computer readable storage medium may include a data signal propagated in baseband or as part of a carrier wave, wherein a readable program code is carried. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. A readable signal medium may also be any readable medium other than a readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.
[0114] Alternatively, the program code contained on the computer-readable storage medium may be transmitted using any appropriate medium, including but not limited to wireless, wired, optical cable, RF, etc., or any suitable combination of the foregoing.
[0115] In a specific implementation, the program code for performing the operations of the present disclosure may be written in any combination of one or more programming languages, including object-oriented programming languages such as Java, C++, etc., and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as a separate software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server. In the case of a remote computing device, the remote computing device may be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computing device (e.g., using an Internet service provider to connect through the Internet).
[0116] It should be noted that, although several modules or units of the device for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to the embodiments of the present disclosure, the features and functions of two or more modules or units described above can be embodied in one module or unit. On the contrary, the features and functions of one module or unit described above can be further divided into multiple modules or units to be embodied.
[0117] In addition, although the steps of the method in the present disclosure are described in a specific order in the drawings, this does not require or imply that the steps must be performed in this specific order, or that all the steps shown must be performed to achieve the desired results. Additionally or alternatively, some steps may be omitted, multiple steps may be combined into one step, and / or one step may be decomposed into multiple steps, etc.
[0118] Through the description of the above implementation, it is easy for those skilled in the art to understand that the example implementation described here can be implemented by software, or by software combined with necessary hardware. Therefore, the technical solution according to the implementation of the present disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, including several instructions to enable a computing device (which can be a personal computer, a server, a mobile terminal, or a network device, etc.) to execute the method according to the implementation of the present disclosure.
[0119] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. The present disclosure is intended to cover any variations, uses or adaptations of the present disclosure, which follow the general principles of the present disclosure and include common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The description and examples are intended to be exemplary only, and the true scope and spirit of the present disclosure are indicated by the appended claims.
Claims
1. A structured file verification method, characterized in that: include: Obtaining a file to be verified, wherein the file to be verified includes multiple fields; Generate a verification content configuration table according to the file to be verified, wherein the verification content configuration table includes configuration identification information of each field and rule identification information associated with each field, wherein the rule identification information is information identifying different verification rules in a predefined verification rule table, and the verification rule table includes multiple verification rules; The content corresponding to each field in the file to be verified is verified according to the verification rule corresponding to the rule identification information associated with each field in the verification content configuration table.
2. The structured file verification method according to claim 1, characterized in that: Before generating the verification content configuration table according to the file to be verified, the method further includes: The verification rule table is defined, and the verification rule table also includes one or more of the following: rule name, rule code, rule type, and rule content.
3. The structured file verification method according to claim 2, characterized in that: The rule types include one or more of the following: Regular expression verification, primary and foreign key relationship verification, and general verification.
4. The structured file verification method according to claim 2, characterized in that: The rule name includes one or more of the following: cannot be empty, email, integer, identity information, floating point number, Chinese, mobile phone number, creation time, end time, product identifier, product attribute identifier, input class length, and name class length.
5. The structured file verification method according to claim 1, characterized in that: Generate a verification content configuration table according to the file to be verified, including: Obtaining field information of each field in the file to be verified, wherein the field information includes one or more of the following: the name of the file to be verified where each field is located, the name of the worksheet where each field is located, the field name, and the field code; Associating the verification rules in the verification rule table according to the field information of each field, wherein each verification rule corresponds to a rule identification information; The verification content configuration table is generated according to the field information of each field and the rule identification information corresponding to each verification rule.
6. The structured file verification method according to claim 1, characterized in that: The file to be verified includes an Excel file.
7. A structured file verification device, characterized in that: include: A file acquisition module, used to acquire a file to be verified, wherein the file to be verified includes multiple fields; A configuration table generating module, used to generate a verification content configuration table according to the file to be verified, wherein the verification content configuration table includes configuration identification information of each field and rule identification information associated with each field, wherein the rule identification information is information for identifying different verification rules in a predefined verification rule table, and the verification rule table includes multiple verification rules; The verification module is used to verify the content corresponding to each field in the file to be verified according to the verification rule corresponding to the rule identification information associated with each field in the verification content configuration table.
8. An electronic device, characterized in that: include: processor; as well as A memory, configured to store executable instructions of the processor; The processor is configured to execute the structured file verification method according to any one of claims 1 to 6 by executing the executable instructions.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the structured file verification method according to any one of claims 1 to 6 is implemented.
10. A computer program product comprising: A computer program or instruction, characterized in that when the computer program or instruction is executed by a processor, it implements the structured file verification method described in any one of claims 1 to 6.
Citation Information
Cited By
Method for identifying and configuring different ECU calibration protocol files
CN119647461A
Data quality inspection method and system based on Excel file
CN121255786A
Project management system and method
CN121766940A
