Disclosure of Invention
The invention provides an electronic archive integrated processing method and system, which discover the change of data in an service in time based on service table metadata so as to keep consistency between an archive system and the service system, and establish archive service relationship between electronic archive files to carry out archive file association management, thereby realizing a cross-archive retrieval function and improving the usability of the electronic archive system.
In order to achieve the above purpose, the invention is realized by adopting the following technical scheme.
In one aspect, the present invention provides a method for integrated processing of an electronic file, including:
reading and analyzing a form template in a service system to obtain template basic information and component information;
acquiring service table metadata according to the template basic information, and carrying out data synchronization processing on service data corresponding to the electronic file system and the integrated system according to the service table metadata;
under the condition of corresponding service data synchronization between the electronic archive system and the service system, acquiring form service data according to the component information, generating an electronic archive file and generating electronic archive associated data according to the component information;
and storing the electronic archive file in an electronic archive system and storing the electronic archive associated data in an electronic archive database.
Optionally, the reading and analyzing the form template in the service system to obtain template basic information and component information includes:
reading template form data in a service system through a template adapter in an electronic file system to obtain template basic information of the service system;
and analyzing the module object based on the module basic information to obtain module information.
The template basic information and the component information are obtained by reading the form template in the service system, so that the problems of large workload, easy error and the like caused by the need of manually inputting or importing data in the traditional archive data acquisition process are solved.
Optionally, the obtaining service table metadata according to the template basic information and performing data synchronization processing on the service data corresponding to the electronic file system and the integrated system according to the service table metadata includes:
acquiring service table metadata from the template basic information;
inquiring and comparing in an electronic archive database according to the service table metadata to obtain changed service table metadata;
and changing the related business data in the electronic archive database based on the changed business table metadata, so that the corresponding business data between the electronic archive system and the business system are consistent.
By acquiring the service table metadata from the template basic information and taking the service table metadata as a reference standard for service data change of the service system, corresponding service data in the electronic file system can be correspondingly changed in time, so that consistency of the corresponding service data between the electronic file system and the service system is ensured, update lag of the electronic file system data is avoided, and timely standard alignment synchronization between the electronic file system data and the service system data is realized.
Optionally, under the condition that the corresponding service data between the electronic archive system and the service system are synchronous, acquiring form service data according to the component information and generating an electronic archive file, including:
rendering each template component into an HTML element object according to a template to obtain a plurality of HTML files;
traversing each component service data according to the component information, and filling the traversed service data into a corresponding HTML file;
and converting the filled HTML file into a PDF file to obtain the electronic archive file.
And generating query sentences according to the component information, traversing the service data of each component according to different component types, and obtaining the service data required by the electronic file system in each component, so that data omission is avoided, and the integrity and reliability of the generated electronic file are ensured.
Optionally, in the case of synchronization of the corresponding service data between the electronic archive system and the service system, generating the electronic archive associated data according to the component information includes:
acquiring associated table metadata corresponding to the electronic archive file from the component information;
forming an association relation between form service data based on the association table metadata;
and generating electronic archive association data based on the association relation between the form service data.
Optionally, the storing the electronic archive file in an electronic archive system and storing the electronic archive associated data in an electronic archive database includes:
storing the electronic archive file in the electronic archive system in a classified manner;
and storing the electronic archive associated data in an electronic archive database, and establishing hyperlinks among the electronic archive files.
By rearranging and relating the business relation of the components in the business form to the file system, the file relation model and the business system relation model are kept consistent, so that hyperlinks are established among different electronic file files, cross-file retrieval can be realized, the consistency between the electronic file system and the business system is further improved, and the integrated processing performance and usability of the electronic file system are further improved.
In another aspect, the present invention provides an electronic archive integrated processing system, including:
and a template analysis module: the system is used for integrating the electronic file system with the service system and reading and analyzing the form template in the service system to obtain template basic information and component information;
and a data acquisition module: the module information is used for acquiring the service table metadata according to the template basic information and acquiring the form service data according to the module information;
and the data relation processing module is used for: the system comprises an electronic archive database, an integrated system, a service table metadata, a data synchronization processing unit and a data synchronization processing unit, wherein the service table metadata is used for carrying out data synchronization processing on service data corresponding to the electronic archive system and the integrated system according to the service table metadata, generating electronic archive related data according to the component information and storing the electronic archive related data in the electronic archive database;
the file processing module: for generating an electronic archive file and for saving said electronic archive file in an electronic archive system.
Optionally, the template parsing module includes a template adapting module and a component parsing module;
the template adaptation module is used for reading template form data in the service system to obtain template basic information;
and the component analysis module is used for analyzing the template component based on the template basic information to obtain component information.
Compared with the prior art, the invention has the beneficial effects that: according to the invention, the electronic file system is integrated with the service system, form data in the service system is read and analyzed through the template adapter to realize generation of the electronic file, data change of the service system can be found in time through metadata comparison, corresponding data change is carried out on the electronic file system based on the data change, consistency of the electronic file system and the service system is improved, meanwhile, the relationship between the service data and other data is obtained through analysis of the service data, the relationship in the service system is completely organized into the electronic file system, and association and link are established between the electronic file, so that the electronic file system can realize a cross-file retrieval function, usability of the electronic file system is improved, and better acquisition, archiving and association treatment effects on the electronic file are realized.
Detailed Description
The invention is further described below with reference to the accompanying drawings. The following examples are only for more clearly illustrating the technical aspects of the present invention, and are not intended to limit the scope of the present invention.
Example 1
Referring to fig. 1, the present embodiment provides an electronic archive integration processing method, including:
reading and analyzing a form template in a service system to obtain template basic information and component information;
acquiring service table metadata according to the template basic information and carrying out data synchronization processing on service data corresponding to the electronic file system and the integrated system according to the service table metadata;
under the condition of corresponding service data synchronization between the electronic archive system and the service system, acquiring form service data according to the component information, generating an electronic archive file and generating electronic archive associated data according to the component information;
and storing the electronic archive file in an electronic archive system and storing the electronic archive associated data in an electronic archive database.
According to the method and the device, the generation of the electronic archive file is completed by reading the form data in the service system, and the change of the data in the service system can be found in time by comparing the metadata, so that timely processing is performed, the consistency of the corresponding service data between the electronic archive system and the service system is maintained, meanwhile, the service relations among different form data in the service system are organized into the electronic archive system, the association is established among different electronic archive files, the cross-archive retrieval function can be realized, and the usability of the electronic archive system is improved.
Example 2
On the basis of embodiment 1, this embodiment also makes the following design.
The electronic file integrated processing method in the embodiment is realized through the following steps.
S01: reading a form template in a service system to obtain a data source, a service table and a service main key on the template; and further analyzing in detail to obtain component information: component layout, component type, business table field, association table field set, etc.
The template in this embodiment is defined as JSON format, the template comprising: template ID, template name, template data source information, service primary key, component list, template expression as follows:
{
the template ID is used to identify the template,
the name of the template is given,
the source information of the template data is provided,
the primary key of the service is provided,
component list
}
The basic attributes of the template component object include: (1) service table names; (2) a service table field name; (3) component type; (4) layout mode; (5) whether the mark is necessary to be filled; (6) associating a service table; (7) associating a set of fields; (8) a list of subcomponents, the template component being expressed as follows:
{
the name of the service table is given,
the name of the field of the service table,
the type of component is a type of component,
in the way of the layout, the layout is carried out,
whether or not it is necessary to fill in the identification,
the service list is associated with a service list,
a set of associated fields is provided,
list of sub-components
}
In this embodiment, the layout among the table unit elements is described in the template in a grid manner, the accurate position of the table unit element in the final determined component can be determined through the combination of rows and columns, the analysis method of the template component is that the component is analyzed as 'first row and then later row', the component is sequentially analyzed into various objects on the HTML page, and the HTML template file is generated.
S02: and acquiring service table metadata information from the data source information, wherein the service table metadata information mainly comprises service table names, column names, types, primary keys and descriptions. And inquiring in the file system according to the table name, if records exist, comparing metadata, if the records change, indicating that the business related to the file in the business system changes, and sending a message to a file manager to prompt the manager to pay attention to and intervene in the processing. If no service table metadata exists in the file system, the metadata is written into the electronic file database.
S03: and acquiring form service data according to the component information based on the condition that the corresponding service data between the electronic archive system and the service system are consistent, and filling an HTML template by a user based on the form service data. In this embodiment, the component traversing manner is used, and different processing is performed step by step according to different component types.
1. And processing the uploading data type in an accessory mode, and downloading the file to the local.
2. And constructing a joint query statement of the query service table and the association service table for the association form type, and generating an SQL query statement by using a main key of the service table, a main key of the left association reference service table and a field of the reference service table in the query condition.
3. For other types of queries, the component field names are traversed as query options, constructing SQL statements.
And filling the acquired required business data into an HTML file, converting the HTML file into a PDF electronic archive file, and then combining the electronic archive file with an accessory to generate a final electronic archive file.
S04: and processing the data relationship to realize the file link relationship, and rearranging and relating the business relationship of the component in the business form to the file system to keep the file relationship model and the business system relationship model consistent.
The correlation between the business form and other forms can be obtained through the correlation component: relationship 1: service table, form primary key ID, associated service table, associated foreign key ID, association (1 to 1,1 to N or N to 1).
The relation between the service form and the electronic archive file can be obtained through electronic archive generation: relationship 2: the service form main key ID, the electronic archive file ID, and the form main key and the archive main key are in a 1-to-1 relationship.
And taking the ID of the external key associated with the current form as a main key, recording and inquiring the existing relation 2 in the file system, and obtaining the direct reference relation between the current electronic archive file and other electronic archive files. And inquiring the same record in the existing relation 1 record in the file system by taking the current form association external key ID as a main key, and inquiring in the existing relation 2 record in the file system by taking the form main key of the inquired record as an inquiry condition, so that the co-reference relation of the current electronic archive file and other electronic archive files can be obtained. In other embodiments, the technician may define and implement more archive link relationships by associating business table metadata with business table fields in other ways.
S05: classifying and storing the generated electronic archive files according to classification modes such as archive types, storage lives and the like; and storing the electronic archive relation into an electronic archive database.
Example 3
Referring to fig. 2, the present embodiment provides an electronic archive integrated processing system, which is composed of a template adaptation module, a component analysis module, a data acquisition module, a data relationship processing module and an archive processing module.
M01: the template adaptation module is used for reading a form template in the service system and analyzing template basic information, wherein the basic information mainly comprises a template ID, a template name, a service table, a service primary key and a data source.
M02: and the module analysis module is used for further analyzing the module. The method is called by the template ID in the basic information, and in this embodiment, the component analysis module completes the analysis of the component layout.
When the component layout type is 'column layout', processing the component according to a column mode rendering mode, setting the height as a standard height, and setting all sub-components in the subsequent component in the column; the component layout type is "row layout," then the component is rendered in row mode, with the width of the column being the standard height, and all sub-components in subsequent components in the row.
After the component layout analysis is completed, rendering information processing is carried out, and the method comprises the following two steps:
1. rendering the components into HTML element objects according to templates, and providing the HTML element objects for processing by a archive processing module.
2. Determining the binding relation between a service table corresponding to a component in a template and a service table field, wherein the binding relation comprises a reference table and a reference field in an associated table, and rendering is mainly carried out according to the type of the component:
in the first case, the component type is an association table type, and represents that data information refers to other data tables, then continuing to read the association business table attribute of the component, obtaining the name of the referenced data table, reading the association field set attribute of the component, obtaining the association field set in the reference table, and presenting the association field set in a sub-table mode in page rendering information;
in the second case, the component type is a date, which is presented in a standardized format in the page rendering information;
in the third case, the component type is date and time, and the date and time is presented in a standardized format in the page rendering information;
in the fourth case, the component type is text input, and the component type is presented as a text box in the page rendering information;
in a fifth case, the component type is a title, which is presented in the page rendering information;
in the sixth case, the component type is upload data, presented as hidden fields in the page rendering information, and the data is not presented in the page.
M03: and the data acquisition module acquires service table metadata information from the template basic information and acquires service data necessary for filling the form from a component analysis result. Based on the result of the component analysis module, traversing the service data of each component in a recursive mode, and filling the service data into the rendered HTML page, wherein the method specifically comprises the following steps: and constructing an initial SQL sentence, wherein the query condition is a form primary key ID, and then adding a field name in the page rendering information into a query field in a traversing manner.
When the traversed component is the associated form, reconstructing the SQL statement of the query service table through the main key of the current table, and generating the SQL query statement of the associated service data by left associated reference service table main key and reference service table field; when the service main key is uploading data, reading the attachment in the hidden domain, downloading the attachment to the local, and filling the acquired data into the rendered HTML page after the data acquisition module executes data acquisition.
M04: and the data relation processing module establishes a relation among the business forms, the components, the association forms and the electronic archive files and is used for archive data management and realizing cross-archive query and link processing.
And (1) processing and reading service table metadata and associated table metadata corresponding to the archive file according to the data relationship, and storing the metadata into a database if no record exists in the database. If the record exists in the database, the record is compared with the metadata of the corresponding service table stored in the file system, and if the change of the data is found, a prompt is sent to a manager of the file system.
And 2, the data relation processing module stores the relation between the form main key and the associated form external key into the electronic archive database to form records (form service list, form main key ID, associated service list name, associated external key ID and associated relation).
And 3, the data relation processing module stores the relation between the service form ID and the current electronic archive file ID into a database to form a record (form main key ID, electronic archive file ID).
According to the relation 2, inquiring whether the association table in the record 2 corresponds to other electronic archive files, if so, defining as directly referencing the electronic archive relation, and establishing a link between the current electronic archive file and the referencing electronic archive file to form a directly referencing relation record (current archive ID, directly referencing archive ID). Further, whether the main key of the current association table is associated with other archive files is queried, if so, the current association table is defined as a common association electronic archive relationship, and a link is established between the current electronic archive file and the common association electronic archive file to form a common reference relationship record (current archive ID, common direct archive ID). When a user browses the archive system, the direct reference relation link and the common reference relation link are displayed on the current page, and after clicking, the user can directly jump to the corresponding archive file to check the related archive information.
M05. the file processing module generates an electronic file and stores the electronic file in the electronic file system. And converting the service data result set into a file description structure with service data by using rendering information, component information and form service data through a program, and exporting the file description structure into a PDF file. And finally, combining the PDF file and the accessory acquired by the data acquisition module to form an electronic archive file, and storing the electronic archive file in an electronic archive system.
Example 4
The present embodiment provides a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, implements the electronic archive integration processing method as described in any one of embodiment 2.
The embodiments of the present invention have been described above with reference to the accompanying drawings, but the present invention is not limited to the above-described embodiments, which are merely illustrative and not restrictive, and many forms may be made by those having ordinary skill in the art without departing from the spirit of the present invention and the scope of the claims, which are all within the protection of the present invention.