Method and device for managing machine account data
By constructing template files and verification rules for ledger data, the problem of inefficient ledger data management in the existing technology is solved, batch data processing and storage are realized, and the efficiency and security of data upload are improved.
Patent Information
- Application Number
- CN202510373899.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-27
- Publication Date
- 2025-07-18
AI Technical Summary
In the management process of ledger data in the prior art, frequent interface jumps and manual entry lead to inefficiency, which cannot meet the timeliness requirements of large-scale data processing, and there is a risk of data errors and missed filling.
By obtaining the grouping and field information list of ledger data, building template files, filling in data and verifying, batch saving is achieved, and dynamic template files and verification rules are used to ensure the unified and secure data format.
It improves data upload efficiency, reduces frequent manual entry operations, reduces the risk of missed input, meets the timeliness requirements of batch business scenarios, and ensures the format accuracy and security of data.
Smart Images

Figure CN120337884A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of ledger data management, and particularly to a method and device for managing ledger data. Background Art
[0002] Currently, in the existing working mode, operators need to complete data maintenance operations item by item through the front-end interface of the system: for each ledger record, an editing interface needs to be independently retrieved, basic information needs to be manually input field by field, and then a separate save action needs to be performed. In the data upload link, the system also only supports the sequential transmission mode of single records and cannot implement the function of batch data processing. This discrete operation mechanism exposes multiple limitations when dealing with large-scale ledger maintenance tasks: First, frequent interface jumps and repetitive form filling significantly reduce work efficiency, and the daily data processing volume is severely restricted; second, the manual entry mode item by item leads to high labor costs and there are operation risks such as data input errors and missing fills; third, in batch business scenarios (such as periodic updates of equipment ledgers, centralized entry of project ledgers, etc.), the existing processes are difficult to meet the timeliness requirements, seriously affecting the progress efficiency of subsequent business links. Summary of the Invention
[0003] To solve the above technical problems, the present invention is proposed. Embodiments of the present invention provide a method and device for managing ledger data, which can solve the problem that operators manually enter ledger data, resulting in the inability to batch process and save ledger data.
[0004] According to one aspect of the present invention, there is provided a method for managing ledger data, including:
[0005] Obtaining a grouping information list and a field information list of the ledger data to be managed;
[0006] Determining header information according to the grouping information list and the field information list of the to-be-processed ledger data;
[0007] Determining a field code corresponding to each field name in the header information;
[0008] Based on a construction rule, constructing a template file of the ledger data to be managed according to the header information and the field code corresponding to each field name;
[0009] Filling the field information in the ledger data to be managed into the template file;
[0010] Based on a verification rule, verifying the filled file to obtain a verification result;
[0011] Based on the verification result, batch-saving the filled file.
[0012] In one embodiment, determining the header information based on the grouping information list and the field information list of the to-be-processed ledger data includes:
[0013] Sort the grouping names in the grouping information list to obtain the sorted grouping names;
[0014] Based on the sorted grouping names, sort the field names in the field information list to obtain the sorted field names; wherein, the level corresponding to the sorted grouping names is higher than the level corresponding to the sorted field names;
[0015] Determine the level corresponding to each of the sorted grouping names;
[0016] Based on the order of the levels, combine the sorted grouping names and the sorted field names to obtain multiple header information.
[0017] In one embodiment, constructing the template file of the to-be-managed ledger data based on the construction rule according to the header information and the field code corresponding to each field name includes:
[0018] Construct a blank file; wherein, the blank file includes a blank worksheet;
[0019] Fill the header information into the blank worksheet to obtain a table with header information;
[0020] Based on the table with header information, obtain the number of header rows and the number of header columns corresponding to the header information;
[0021] Based on the number of header rows and the number of header columns, determine the coordinates of the blank boxes in the table with header information, and establish the corresponding relationship between the blank boxes and their coordinates;
[0022] Based on the corresponding relationship and the table with header information, construct the template file of the to-be-managed ledger data.
[0023] In one embodiment, constructing the template file of the to-be-managed ledger data based on the construction rule according to the header information and the field code corresponding to each field name includes:
[0024] Determine multiple screening values corresponding to each field name; wherein, each screening value has a selected mark when triggered;
[0025] Construct a triggerable unit;
[0026] Fill the multiple screening values into the triggerable unit;
[0027] Update the filled triggerable units in the blank boxes of each column where the field names are located;
[0028] Based on the updated blank boxes, the header information, and the field codes corresponding to each field name, construct a template file for the data of the ledger to be managed.
[0029] In one embodiment, the verification of the filled file based on the verification rules to obtain the verification result includes:
[0030] Upload the filled file to the database and generate a file identification code corresponding to the filled file;
[0031] Based on the file identification code, obtain the filled file;
[0032] Parse the header information of the filled file to obtain the field codes;
[0033] Determine the field information corresponding to the field codes;
[0034] Based on the verification rules, determine whether the field information is encrypted;
[0035] If the field information is encrypted, encrypt the field;
[0036] Based on the verification rules, verify the encrypted field to obtain the verification result;
[0037] The batch saving of the filled file based on the verification result includes:
[0038] If the verification result indicates that the encrypted field verification is successful, batch save the encrypted field.
[0039] In one embodiment, the method for managing ledger data further includes:
[0040] If the field information is not encrypted, based on the verification rules, verify the field information to obtain the verification result;
[0041] If the verification result indicates that the field information verification fails, obtain the reason for the failure of the field information verification;
[0042] Construct a verification failure data file with the field information that fails the verification and its corresponding failure reason.
[0043] In one embodiment, after constructing a verification failure data file with the field information that fails the verification and its corresponding failure reason, the method for managing ledger data further includes:
[0044] Obtain the field information that fails verification in the verification failure data file;
[0045] Extract the keywords of the failure reasons corresponding to the field information that fails verification;
[0046] Based on the keywords, search for solutions;
[0047] Based on the solutions, perform pre-adjustment on the field information that fails verification;
[0048] Based on the verification rules, verify the pre-adjusted field information to obtain the verification result of the pre-adjusted field information;
[0049] Save the verification failure data file according to the verification result.
[0050] In one embodiment, the saving the verification failure data file according to the verification result includes:
[0051] If the verification result indicates that the pre-adjusted field information is verified successfully, obtain the field code corresponding to the pre-adjusted field information;
[0052] Based on the file identification code corresponding to the verification failure data file, obtain the verification success data file;
[0053] Based on the field code corresponding to the pre-adjusted field information, determine the filling position that conforms to the verification success data file;
[0054] Fill the pre-adjusted field information into the filling position.
[0055] In one embodiment, the determining whether the field information is encrypted based on the verification rules includes:
[0056] Obtain the field attribute corresponding to the field information;
[0057] Based on the field attribute, determine whether the field information is encrypted;
[0058] If the field attribute conforms to the preset attribute, encrypt the field.
[0059] On the other hand, the present invention provides a ledger data management device, including:
[0060] Obtain the grouping information list and field information list of the ledger data to be managed;
[0061] Determine the header information according to the grouping information list and field information list of the to-be-processed ledger data;
[0062] Determine the field codes corresponding to each field name in the header information;
[0063] Based on the construction rules, construct a template file for the ledger data to be managed according to the header information and the field codes corresponding to each field name;
[0064] Fill the field information in the ledger data to be managed into the template file;
[0065] Based on the verification rules, verify the filled file to obtain a verification result;
[0066] Based on the verification result, batch save the filled file.
[0067] A method and device for managing ledger data provided by the present invention include: obtaining a list of grouping information and a list of field information of the ledger data to be managed, determining the header information according to the list of grouping information and the list of field information of the ledger data to be processed, determining the field codes corresponding to each field name in the header information, based on the construction rules, constructing a template file for the ledger data to be managed according to the header information and the field codes corresponding to each field name, filling the field information in the ledger data to be managed into the template file, based on the verification rules, verifying the filled file to obtain a verification result, and based on the verification result, batch saving the filled file. The template file is dynamically constructed through the list of grouping information and the list of field information of the ledger data to be managed. The format of the ledger data to be managed is unified based on the template file. Then, the ledger data to be managed is filled into the template file, and the filled file is verified to ensure the accuracy of the format of the ledger data in the file. Finally, the verified file is batch saved to improve the efficiency of data upload. Brief Description of the Drawings
[0068] By describing the embodiments of the present invention in more detail in conjunction with the drawings, the above and other objects, features, and advantages of the present invention will become more obvious. The drawings are used to provide a further understanding of the embodiments of the present invention and constitute a part of the specification. Together with the embodiments of the present invention, they are used to explain the present invention and do not constitute a limitation to the present invention. In the drawings, the same reference numerals generally represent the same components or steps.
[0069] Figure 1 It is a flowchart of a method for managing ledger data provided by an exemplary embodiment of the present invention.
[0070] Figure 2 It is a flowchart of a method for constructing a template file provided by an exemplary embodiment of the present invention.
[0071] Figure 3It is a flowchart of a batch import function method provided by an exemplary embodiment of the present invention.
[0072] Figure 4 It is a flowchart of a ledger data management method provided by another exemplary embodiment of the present invention.
[0073] Figure 5 It is a schematic structural diagram of a ledger data management device provided by an exemplary embodiment of the present invention.
[0074] Figure 6 It is a structural diagram of an electronic device provided by an exemplary embodiment of the present invention. Detailed implementation manners
[0075] Next, exemplary embodiments of the present invention will be described in detail with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments of the present invention. It should be understood that the present invention is not limited by the exemplary embodiments described herein.
[0076] Figure 1 It is a schematic flowchart of a ledger data management method provided by an exemplary embodiment of the present invention. As Figure 1 shown, the ledger data management method includes:
[0077] Step 110: Obtain a list of grouping information and a list of field information of the ledger data to be managed.
[0078] In the embodiments of the present invention, when an operator creates a ledger, the operator needs to fill in the basic information of the ledger in a worksheet. For example, the ledger information includes the ledger name, ledger type, description, etc. Moreover, the operator also needs to customize the field information for creating the ledger. A ledger must contain multiple fields, and each field has field attributes such as field name, field code, field type, display type, sorting sequence number, whether it is unique, whether it is required, and whether it is encrypted. In addition, when creating a ledger, one or more groups can also be custom-created. Each group has group attributes such as group name and sorting sequence number. One or more fields are placed under a certain group, and one or more groups can also be custom-created again under a certain group. All the groups and fields can jointly form the header information of the ledger.
[0079] If no group is created, then the obtained ledger will only have a list of field information as a single-level header (one-line header); if a group is created, then the obtained ledger will have a multi-level header (multiple-line headers), and at this time the list of field information is the lowest-level header.
[0080] Thus, the operator can construct ledger data according to his own habits and generate a ledger data identification code, and then obtain the list of grouping information and the list of field information from the constructed ledger data through the ledger data identification code.
[0081] Step 120: Determine the header information according to the grouping information list and the field information list of the ledger data to be processed.
[0082] In the embodiment of the present invention, the level of the grouping information list is higher than that of the field information list. For example, the grouping information list includes Group A, Group B, and Group C, and the field information list includes field name a, field name b, and field name c. Group A may include field name a and / or field name b and / or field name c. The present invention sets the level of the field information list as the lowest level.
[0083] Step 130: Determine the field code corresponding to each field name in the header information.
[0084] In the embodiment of the present invention, since the field names corresponding to different groups may be the same, but their field codes are different, it is necessary to extract the field codes and correspond them to the field names, so that the attribute information of the field can be queried through the field code, improving the accuracy of the query.
[0085] Step 140: Based on the construction rules, construct a template file for the ledger data to be managed according to the header information and the field code corresponding to each field name.
[0086] In the embodiment of the present invention, when operators input ledger data, they write the headers according to their own filling habits, resulting in two versions of ledger data even if the data in the ledger data is the same. To unify the format of the ledger data for better management, the present invention constructs a dynamic template file for the ledger data to be managed. That is, even if the user fills in the header information according to their own habits, a template can be regenerated according to the user's header information and basic information, and the user fills in according to the template to achieve format unification.
[0087] Step 150: Fill the field information in the ledger data to be managed into the template file.
[0088] In an embodiment of the present invention, during the system initialization phase, the system generates an Excel template file with a standardized header structure, which clearly marks the data format requirements and entry specifications for each field. The user fills in the standardized ledger data to be managed according to the field specifications of the template file to ensure the unity and integrity of the data format. After completing the data entry, the user uploads the filled template file to the backend server through the front-end interface. After receiving the file, the backend system executes an automated processing flow: persistently stores the file in the FastDFS distributed file storage system to ensure the high availability and scalability of the file, and the system automatically generates structured metadata containing a unique file identification code (UUID) and the original file name. Then, the file metadata is returned to the front-end interface in JSON format to establish an index relationship for file retrieval.
[0089] Step 160: Verify the filled file based on the verification rules to obtain a verification result.
[0090] Step 170: Batch save the filled file based on the verification result.
[0091] A method for managing ledger data provided by the present invention includes: obtaining a list of grouping information and a list of field information of the ledger data to be managed, determining the header information according to the list of grouping information and the list of field information of the ledger data to be processed, determining the field code corresponding to each field name in the header information, constructing a template file of the ledger data to be managed based on the construction rules according to the header information and the field code corresponding to each field name, filling the field information in the ledger data to be managed into the template file, verifying the filled file based on the verification rules to obtain a verification result, and batch saving the filled file based on the verification result. Dynamically construct a template file through the list of grouping information and the list of field information of the ledger data to be managed. Standardize the format of the ledger data to be managed based on the template file. Then fill the ledger data to be managed into the template file and verify the filled file to ensure the accuracy of the format of the ledger data in the file. Finally, batch save the verified file to improve the efficiency of data upload.
[0092] In one embodiment, step 120 can be specifically implemented as: sorting the grouping names in the list of grouping information to obtain the sorted grouping names; sorting the field names in the list of field information based on the sorted grouping names to obtain the sorted field names; wherein the level corresponding to the sorted grouping names is higher than the level corresponding to the sorted field names; determining the level corresponding to each sorted grouping name; and combining the sorted grouping names and the sorted field names based on the order of the levels to obtain multiple header information.
[0093] In an embodiment of the present invention, the group names in the group information list can be sorted first. For example, if group A < group B, then the serial number of group A is 1 and the serial number of group B is 2. It should be understood that the sorting in this application is based on the level of the groups. For example, if the parallel group of group A is group C, then the serial number of group C is also 1.
[0094] Then, the field names below the sorted groups in the field information list are combined with the sorted groups and further sorted. For example, group A < group B < field a>, then the sorting of field a is 3. In the present invention, the sorting serial number of field a is set as the field code. Therefore, under different sorted groups, the sorting serial numbers of the field names are different.
[0095] In one embodiment, step 140 can be specifically implemented as follows: construct a blank file; wherein, the blank file includes a blank worksheet; fill the header information into the blank worksheet to obtain a table containing the header information; based on the table containing the header information, obtain the number of header rows and the number of header columns corresponding to the header information; based on the number of header rows and the number of header columns, determine the coordinates of the blank boxes in the table containing the header information, and establish a correspondence between the blank boxes and their coordinates; based on the correspondence and the table containing the header information, construct a template file for the data to be managed in the ledger.
[0096] In an embodiment of the present invention, in order to quickly locate the field information filled by the operator, when constructing the template file, a blank file is constructed first. The blank file contains a blank worksheet, and the constructed header information is automatically filled into the blank worksheet. Determine the number of header rows and the number of header columns in the table containing the header information, then the number of rows and columns to which the field information to be filled into the template file belongs can be determined. Construct the number of rows and columns into coordinates. Then, during the inspection, the position where the field information is located and the range of the field information can be determined through the coordinates. Hide the coordinates, and only the backend needs to determine them.
[0097] In one embodiment, step 140 can be specifically implemented as follows: determine multiple screening values corresponding to each field name; wherein, each screening value has a selected mark when triggered; construct a triggerable unit; fill the multiple screening values into the triggerable unit; update the filled triggerable unit in the blank box in each column where the field name is located; based on the updated blank box, the header information, and the field code corresponding to each field name, construct a template file for the data to be managed in the ledger.
[0098] In an embodiment of the present invention, in the design of the data entry interface, for fields with multiple selectable values, in order to improve the operation efficiency and selection accuracy, an interactive single - select control is used for visual design. The specific implementation scheme is as follows: implant a group of radio buttons in the cell corresponding to the field, and each candidate option has an independent trigger mechanism. When the user selects a specific option, the system should synchronously execute the following interactive feedback: generate a selection mark (such as a √ symbol or a filled dot) in front of the selected option. Automatically filter non - selected items, only retain the selected value in the cell display area, and update the corresponding field value in the data storage layer in real time. Application example: For the "status" field, set a group of radio buttons containing two options, "enabled" and "disabled", in its corresponding input area. When the operator selects "enabled", a blue tick mark is displayed on the left side of this option, and at the same time, the cell content is dynamically updated to a single value "enabled", and non - selected options are automatically hidden. This design pattern not only ensures the standardization of data entry but also reduces the probability of misoperation through intuitive visual feedback.
[0099] In one embodiment, step 160 can be specifically implemented as: uploading the filled file to the database and generating a file identification code corresponding to the filled file; based on the file identification code, obtaining the filled file; parsing the header information of the filled file to obtain the field code; determining the field information corresponding to the field code; based on the verification rule, determining whether the field information is encrypted; if the field information is encrypted, then encrypting the field; based on the verification rule, verifying the encrypted field to obtain a verification result; step 170 can be specifically implemented as: if the verification result indicates that the encrypted field is verified successfully, then batch - saving the encrypted field.
[0100] In an embodiment of the present invention, the system first traverses the ledger data and performs multi - dimensional verification on each piece of data: checking whether the required fields are empty, whether the unique fields are repeated, and whether the numerical and time formats conform to the specifications. The data that passes the verification will enter the processing link. If the field is marked as needing to be encrypted (such as sensitive information), then call an encryption algorithm (such as AES) for encryption, and then encapsulate the data and batch - store it in the database, while updating the successful quantity in the import record. Then, the system uploads the processed file to the database and generates a unique file identification code (such as UUID) for subsequent tracking; after re - obtaining the file through the identification code, parse the header to extract the field code, and judge which fields need to be encrypted according to the preset rules. If the encrypted field passes the format or consistency verification (such as ciphertext format verification, decrypt - then - encrypt comparison), then finally batch - persistently store the data, otherwise it may trigger a rollback or record an error. The entire process ensures data quality through hierarchical verification, and combines dynamic encryption and file identification mechanisms to achieve data security and traceability.
[0101] In one embodiment, the method for managing ledger data may be specifically implemented as follows: If the field information is not encrypted, it is verified based on the verification rules to obtain a verification result; if the verification result indicates that the field information verification fails, the reason for the failure of the field information verification is obtained; the field information with verification failure and its corresponding failure reason are constructed into a verification failure data file.
[0102] In an embodiment of the present invention, when the unencrypted field information passes the verification rule check, if a verification failure is found, the system will capture the specific failure reason and associate the error data with the reason. Subsequently, a verification failure file containing two worksheets is created - the "ledger main body" sheet uses the multi-level Chinese table headers of the original template and adds a "failure reason description" column to intuitively display the error details; the "header information" sheet hides and stores the original template structure metadata (such as the number of table header rows and columns, field codes), making the file have both the functions of error reporting and template reuse. After the file is generated, the system uploads it to the FastDFS distributed storage, records the file ID and name, and synchronously updates the failure times and the corresponding error file identification information in the historical import record to form a complete data verification closed-loop management process.
[0103] In one embodiment, the method for managing ledger data may be specifically implemented as follows: Obtain the field information with verification failure in the verification failure data file; extract the keywords of the failure reason corresponding to the field information with verification failure; based on the keywords, search for a solution; based on the solution, perform pre-adjustment on the field information with verification failure; based on the verification rules, verify the pre-adjusted field information to obtain the verification result of the pre-adjusted field information; save the verification failure data file according to the verification result.
[0104] In an embodiment of the present invention, the system first extracts the key features of the error fields and their failure reasons (such as "format does not match", "required item missing", etc.) from the failure file, matches the corresponding solutions (such as data format conversion, missing value filling, etc.) according to the preset rule library, and performs automatic pre-correction on the original error fields; then re-trigger the verification rules to verify the adjusted data. If the correction is successful, the status of the original failure record is updated. If it still fails to pass, the new error information is retained. Finally, the content of the verification failure file is dynamically maintained according to the secondary verification result to ensure that the current data problem status is always reflected in the file, forming a closed-loop processing link of "error identification - automatic repair - result feedback" to improve the data repair efficiency and accuracy.
[0105] In one embodiment, the method for managing ledger data can be specifically implemented as follows: If the verification result indicates that the field information after pre-adjustment is verified successfully, obtain the field code corresponding to the field information after pre-adjustment; based on the file identification code corresponding to the data file with verification failure, obtain the data file with verification success; based on the field code corresponding to the field information after pre-adjustment, determine the filling position corresponding to the data file with verification success; and fill the field information after pre-adjustment into the filling position.
[0106] In an embodiment of the present invention, when the pre-adjusted field passes the secondary verification, the system automatically extracts the coding identifier of the field, and quickly locates the associated data file template with verification success through the unique identifier of the original data file with verification failure; subsequently, based on the field code and the predefined metadata in the template (such as the table header structure, field mapping relationship), perform intelligent matching, accurately lock the cell position where the target data should be filled, and seamlessly inject the corrected compliance information into the corresponding area to ensure that the successful file is dynamically updated and maintains consistency with the original template structure. This process realizes the accurate positioning after error data repair through the coding association and automatic filling mechanism, forming a closed-loop circulation from error correction to data integrity maintenance.
[0107] In one embodiment, step 160 can be specifically implemented as follows: Obtain the field attribute corresponding to the field information; based on the field attribute, determine whether the field information is encrypted; if the field attribute meets the preset attribute, encrypt the field.
[0108] In an embodiment of the present invention, by traversing each field in the bottom-layer table header of the table, first automatically set the cell format rules for the corresponding column according to its field type: integers are limited to no decimal places, decimals are at least reserved one digit and at most six digits, date and time adopt the standardized format, and other types are set as free text; subsequently, check whether the field attribute contains a preset encryption identifier (such as a sensitive data marker), and if it meets the conditions, encrypt the field value, thereby implementing a dual control mechanism for format standardization and sensitive information protection during data entry.
[0109] For example, for each field, take its field type and set the cell format of its corresponding column according to the field type, which can help users to make a preliminary specification when filling in ledger data later. The format of an integer is "0", that is, only the digits before the decimal point are taken; the format of a decimal is "0.0##", that is, at least one digit is reserved after the decimal point, and at most six digits can be reserved; the format of date and time is "yyyy-MM-dd HH:mm:ss", that is, the time format like "2000-01-01 00:00:00"; the format of strings and others is "@", that is, custom text.
[0110] Finally, query the import history data according to the document identification code, display it in reverse order according to the update time, and the batch import situation of each time of this ledger can be viewed, such as the file name of the uploaded file, the number of successes, the number of failures, the file name of the data file with verification failures, etc.
[0111] In addition, the uploaded file can be downloaded to view the file used during batch import and the ledger data filled in at that time; the data file with verification failures can also be downloaded to view the verified failed data and the reason description. After modification in the data file with verification failures, it can be uploaded and batch imported again.
[0112] Figure 2 is a flowchart of a template file construction method provided by an exemplary embodiment of the present invention. As Figure 2 shown, the template file construction method includes:
[0113] The front-end passes the ledger id as the id of the ledger data to be managed, and queries and obtains the basic ledger information, the list of field information, and the list of grouping information through the id of the ledger data to be managed. Then create a ledger main sheet page, that is, a worksheet, and name the worksheet with the ledger name. Put the list of field information and the list of grouping information together and sort them according to the sorting serial number. Obtain the name of the multi-level table header and write it into the ledger main sheet page. Traverse the list of field information, set the cell format of the column where it is located according to the field type, traverse the list of field information, and obtain the display type. Determine whether the display type is a radio box or a checkbox. If it is a radio box, set the cell format of the column where it is located as a drop-down box and preset the option values. If it is a checkbox, create a sheet page and write the field name and the value range into the created sheet page. If the display type is other, then no other settings are made for the cell format.
[0114] Then create a header information sheet page, set it as a hidden sheet page, write the number of header rows and the number of header columns into the header information sheet page, traverse the list of field information, extract the field codes, and write them into the header information sheet page. Finally, the template file is obtained.
[0115] Figure 3 is a flowchart of a batch import function method provided by an exemplary embodiment of the present invention. As Figure 3 shown, the batch import function method includes:
[0116] Obtain the identification code of the ledger data to be managed, the file identification code corresponding to the filled file, and the file name from the front end. Generate an import history record data according to the identification code of the ledger data to be managed, the file identification code corresponding to the filled file, and the file name, and save it into the database. According to the identification code corresponding to the filled file, obtain the corresponding file from FastDFS. Parse and read the content of the header information sheet page to obtain the number of header rows, the number of header columns, and the field codes. According to the identification code corresponding to the filled file and the field codes, obtain the field attribute information of each field. According to the field attribute information, determine which field data needs to be verified and which field data needs to be encrypted. Parse and read the content of the ledger main body sheet page, and obtain the full amount of ledger data according to the number of header rows and the number of header columns. Record the number of successes and the number of failures. Both the number of successes and the number of failures start from 0. For the data with successful verification, encrypt the field data that needs to be encrypted, and increment the success count by 1. For the data with failed verification, add a description of the failure reason and increment the failure count by 1. When the success count > 0, encapsulate in batches and save the ledger data with successful verification, and update the import history record at the same time. When the failure count > 0, generate a file of data with failed verification, save it to FastDFS, and update the import history record. Then the final batch import ends.
[0117] Figure 4 It is a flowchart of the method for managing ledger data provided by another exemplary embodiment of the present invention. As Figure 4 shown, the method for managing ledger data includes: creating ledger data, determining and auditing the upper limit for use, downloading a template file, filling the ledger data into the template file, then uploading and batch importing, generating a history record, verifying the filled ledger data, saving the data with successful verification into the database, and generating a file for the data with failed verification. And import the history record. The operator can view the import history record and download the uploaded file and the file of data with failed verification.
[0118] Figure 5 It is a schematic structural diagram of the device for managing ledger data provided by an exemplary embodiment of the present invention. As Figure 5 shown, the device for managing ledger data includes: a construction module 201, configured to obtain a list of grouping information of the ledger data to be managed and a list of field information; determine the header information according to the list of grouping information of the ledger data to be processed and the list of field information; determine the field code corresponding to each field name in the header information; based on the construction rules, construct a template file of the ledger data to be managed according to the header information and the field code corresponding to each field name; fill the field information in the ledger data to be managed into the template file; a verification module 202, configured to verify the filled file based on the verification rules to obtain a verification result; an upload module 203, configured to batch save the filled file based on the verification result.
[0119] In one embodiment, the construction module 201 may be specifically configured to: sort the group names in the group information list to obtain the sorted group names; based on the sorted group names, sort the field names in the field information list to obtain the sorted field names; wherein, the level corresponding to the sorted group names is higher than the level corresponding to the sorted field names; determine the level corresponding to each of the sorted group names; based on the order of the levels, combine the sorted group names and the sorted field names to obtain a plurality of header information.
[0120] In one embodiment, the construction module 201 may be specifically configured to: construct a blank file; wherein, the blank file includes a blank worksheet; fill the header information into the blank worksheet to obtain a table containing the header information; based on the table containing the header information, obtain the number of header rows and the number of header columns corresponding to the header information; based on the number of header rows and the number of header columns, determine the coordinates of the blank boxes in the table containing the header information, and establish a correspondence between the blank boxes and their coordinates; based on the correspondence and the table containing the header information, construct a template file for the data of the ledger to be managed.
[0121] In one embodiment, the construction module 201 may be specifically configured to: determine a plurality of screening values corresponding to each field name; wherein, each screening value has a selected mark when triggered; construct a triggerable unit; fill the plurality of screening values into the triggerable unit; update the filled triggerable unit in the blank box in each column where the field name is located; based on the updated blank box, the header information, and the field code corresponding to each field name, construct a template file for the data of the ledger to be managed.
[0122] In one embodiment, the inspection module 202 may be specifically configured to: upload the filled file to a database and generate a file identification code corresponding to the filled file; based on the file identification code, obtain the filled file; parse the header information of the filled file to obtain a field code; determine the field information corresponding to the field code; based on a verification rule, determine whether the field information is encrypted; if the field information is encrypted, encrypt the field; based on a verification rule, verify the encrypted field to obtain a verification result; the upload module 203 may be specifically configured to: if the verification result indicates that the encrypted field is verified successfully, batch-save the encrypted field.
[0123] In one embodiment, the management device of the ledger data may be specifically configured as follows: If the field information is not encrypted, verify the field information based on the verification rule to obtain a verification result; if the verification result indicates that the verification of the field information fails, obtain the reason for the failure of the verification of the field information; construct the field information with the verification failure and its corresponding failure reason into a verification failure data file.
[0124] In one embodiment, the management device of the ledger data may be specifically configured as follows: Obtain the field information with verification failure in the verification failure data file; extract the keywords of the failure reason corresponding to the field information with verification failure; search for a solution based on the keywords; pre-adjust the field information with verification failure based on the solution; verify the pre-adjusted field information based on the verification rule to obtain the verification result of the pre-adjusted field information; save the verification failure data file according to the verification result.
[0125] In one embodiment, the management device of the ledger data may be specifically configured as follows: If the verification result indicates that the pre-adjusted field information is verified successfully, obtain the field code corresponding to the pre-adjusted field information; obtain the verification success data file based on the file identification code corresponding to the verification failure data file; determine the filling position that conforms to the verification success data file based on the field code corresponding to the pre-adjusted field information; fill the pre-adjusted field information into the filling position.
[0126] In one embodiment, the inspection module 202 may be specifically configured as follows: Obtain the field attribute corresponding to the field information; determine whether the field information is encrypted based on the field attribute; if the field attribute conforms to the preset attribute, encrypt the field.
[0127] Figure 6 The block diagram of the electronic device according to an embodiment of the present application is illustrated.
[0128] As Figure 6 shown, the electronic device 10 includes one or more processors 11 and a memory 12.
[0129] The processor 11 may be a central processing unit (CPU) or other form of processing unit with data processing capabilities and / or instruction execution capabilities, and may control other components in the electronic device 10 to perform desired functions.
[0130] The memory 12 may include one or more computer program products, and the computer program products may include various forms of computer-readable storage media, such as volatile memory and / or non-volatile memory. The volatile memory may include, for example, random access memory (RAM) and / or cache memory, etc. The non-volatile memory may include, for example, read-only memory (ROM), hard disk, flash memory, etc. One or more computer program instructions may be stored on the computer-readable storage media, and the processor 11 may run the program instructions to implement the management method of ledger data in various embodiments of the present application described above and / or other desired functions. Various contents such as input signals, signal components, noise components, etc. may also be stored in the computer-readable storage media.
[0131] In one example, the electronic device 10 may further include: an input device 13 and an output device 14, and these components are interconnected through a bus system and / or other forms of connection mechanisms (not shown).
[0132] When the electronic device 10 is a stand-alone device, the input device 13 may be a communication network connector for receiving the collected input signals from the first device and the second device.
[0133] In addition, the input device 13 may further include, for example, a keyboard, a mouse, and so on.
[0134] The output device 14 may output various information to the outside, including the determined distance information, direction information, etc. The output device 14 may include, for example, a display, a speaker, a printer, and a communication network and its connected remote output devices, etc.
[0135] Of course, for simplicity, Figure 6 only some of the components related to the present application in the electronic device 10 are shown, and components such as buses, input / output interfaces, etc. are omitted. In addition, according to specific application scenarios, the electronic device 10 may further include any other appropriate components.
[0136] The computer program products may be written in any combination of one or more programming languages for programming code to perform the operations of the embodiments of the present application. The programming languages include object-oriented programming languages such as Java, C++, etc., and also include conventional procedural programming languages such as the "C" language or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, executed as an independent software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server.
[0137] The computer-readable storage medium may adopt any combination of one or more readable media. The readable media may be a readable signal medium or a readable storage medium. The readable storage medium may, for example, include but is not limited to an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples (a non-exhaustive list) of the readable storage medium include: an electrical connection having one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an 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.
[0138] The foregoing is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principle of the present invention shall be included within the scope of protection of the present invention.
Claims
1. A management method for ledger data, characterized in that, Including: Obtaining a list of grouping information and a list of field information of the ledger data to be managed; Determining header information according to the list of grouping information and the list of field information of the to-be-processed ledger data; Determining the field code corresponding to each field name in the header information; Based on the construction rule, constructing a template file of the ledger data to be managed according to the header information and the field code corresponding to each field name; Filling the field information in the ledger data to be managed into the template file; Based on the verification rule, verifying the filled file to obtain a verification result; Based on the verification result, batch-saving the filled file.
2. The management method of ledger data according to claim 1, characterized in that The determining the header information according to the list of grouping information and the list of field information of the to-be-processed ledger data includes: Sorting the grouping names in the list of grouping information to obtain sorted grouping names; Based on the sorted grouping names, sorting the field names in the list of field information to obtain sorted field names; wherein, the level corresponding to the sorted grouping names is higher than the level corresponding to the sorted field names; Determining the level corresponding to each of the sorted grouping names; Based on the order of the levels, combining the sorted grouping names and the sorted field names to obtain multiple pieces of header information.
3. The management method of ledger data according to claim 2, wherein, The constructing the template file of the ledger data to be managed according to the header information and the field code corresponding to each field name based on the construction rule includes: Constructing a blank file; wherein, the blank file includes a blank worksheet; Filling the header information into the blank worksheet to obtain a table containing the header information; Based on the table containing the header information, obtaining the number of header rows and the number of header columns corresponding to the header information; Based on the number of header rows and the number of header columns, determining the coordinates of the blank boxes in the table containing the header information, and establishing a correspondence between the blank boxes and their coordinates; Based on the correspondence and the table containing the header information, constructing the template file of the ledger data to be managed.
4. The management method of ledger data according to claim 1, characterized in that, The constructing the template file of the ledger data to be managed according to the header information and the field code corresponding to each field name based on the construction rule includes: Determining multiple filtering values corresponding to each field name; wherein, each filtering value has a selected mark when triggered; Constructing a triggerable unit; Filling the multiple filtering values into the triggerable unit; Updating the filled triggerable unit in the blank boxes in each column where the field name is located; Based on the updated blank boxes, the header information, and the field code corresponding to each field name, constructing the template file of the ledger data to be managed.
5. The management method of ledger data according to claim 1, characterized in that The verifying the filled file based on the verification rule to obtain a verification result includes: Uploading the filled file to the database and generating a file identification code corresponding to the filled file; Based on the file identification code, obtaining the filled file; Parsing the header information of the filled file to obtain the field code; Determine the field information corresponding to the field code; Based on the verification rules, determine whether the field information is encrypted; If the field information is encrypted, encrypt the field; Based on the verification rules, verify the encrypted field to obtain a verification result; The batch saving of the filled file based on the verification result includes: If the verification result indicates that the encrypted field is verified successfully, batch save the encrypted field.
6. The management method of ledger data according to claim 5, wherein, It also includes: If the field information is not encrypted, based on the verification rules, verify the field information to obtain a verification result; If the verification result indicates that the field information verification fails, obtain the reason for the failure of the field information verification; Construct a verification failure data file from the field information with verification failure and its corresponding failure reason.
7. The management method of ledger data according to claim 6, characterized in that After constructing a verification failure data file from the field information with verification failure and its corresponding failure reason, it also includes: Obtain the field information with verification failure in the verification failure data file; Extract the keywords of the failure reason corresponding to the field information with verification failure; Based on the keywords, search for solutions; Based on the solutions, pre-adjust the field information with verification failure; Based on the verification rules, verify the pre-adjusted field information to obtain the verification result of the pre-adjusted field information; Save the verification failure data file according to the verification result.
8. The management method of ledger data according to claim 7, characterized in that, The saving of the verification failure data file according to the verification result includes: If the verification result indicates that the pre-adjusted field information is verified successfully, obtain the field code corresponding to the pre-adjusted field information; Based on the file identification code corresponding to the verification failure data file, obtain the verification success data file; Based on the field code corresponding to the pre-adjusted field information, determine the filling position that conforms to the verification success data file; Fill the pre-adjusted field information into the filling position.
9. The management method of ledger data according to claim 5, characterized in that The determining whether the field information is encrypted based on the verification rules includes: Obtain the field attribute corresponding to the field information; Based on the field attribute, determine whether the field information is encrypted; If the field attribute conforms to the preset attribute, encrypt the field.
10. A management device for ledger data, characterized in that, It includes: A construction module for obtaining a grouping information list and a field information list of the to-be-managed ledger data; Determine the header information according to the grouping information list and the field information list of the to-be-processed ledger data; Determine the field code corresponding to each field name in the header information; Based on the construction rules, construct a template file of the to-be-managed ledger data according to the header information and the field code corresponding to each field name; Fill the field information in the to-be-managed ledger data into the template file; An inspection module for verifying the filled file based on the verification rules to obtain a verification result; An upload module for batch saving the filled file based on the verification result.