Data import method and device, computer equipment and storage medium

文档序号:1952707 发布日期:2021-12-10 浏览:24次 中文

阅读说明:本技术 一种数据导入的方法、装置、计算机设备和存储介质 (Data import method and device, computer equipment and storage medium ) 是由 张焘 侯力夫 金向平 于 2021-09-15 设计创作,主要内容包括:本申请涉及一种数据导入的方法、装置、计算机设备和存储介质。所述方法包括建立元模型,通过元模型中设置的字段生成第一默认模板,通过元模型中设置的字段属性生成第一默认规则;通过改变元模型中的字段将第一默认模板调整为目标模板,通过改变元模型中的字段属性将第一默认规则调整为目标规则;将所述目标模板发送至目标终端,获取所述目标终端上传的已导入数据的目标模板和对应的脚本信息;通过所述脚本信息从所述元模型中获取到对应的目标字段,按照所述目标字段加载所述目标规则;通过所述目标规则动态校验所述目标模板中的数据,根据校验结果分类存储所述数据这一方法,能够自定义规则和模板以实现灵活地支持不同业务数据的导入。(The application relates to a data import method, a data import device, computer equipment and a storage medium. The method comprises the steps of establishing a meta-model, generating a first default template through a field set in the meta-model, and generating a first default rule through a field attribute set in the meta-model; adjusting the first default template to be a target template by changing the field in the meta-model, and adjusting the first default rule to be a target rule by changing the field attribute in the meta-model; sending the target template to a target terminal, and acquiring the target template of the imported data uploaded by the target terminal and corresponding script information; acquiring a corresponding target field from the meta-model through the script information, and loading the target rule according to the target field; the data in the target template is dynamically verified through the target rule, and the data are classified and stored according to the verification result, so that the rule and the template can be customized to flexibly support the import of different service data.)

1. A method of data import, the method comprising:

establishing a meta-model, generating a first default template through a field set in the meta-model, and generating a first default rule through a field attribute set in the meta-model;

adjusting the first default template to be a target template by changing the field in the meta-model, and adjusting the first default rule to be a target rule by changing the field attribute in the meta-model;

sending the target template to a target terminal, and acquiring the target template of the imported data uploaded by the target terminal and corresponding script information;

acquiring a corresponding target field from the meta-model through the script information, and loading the target rule according to the target field;

and dynamically verifying the data in the target template through the target rule, and storing the data in a classified manner according to a verification result.

2. The method of claim 1, wherein the building a meta-model comprises:

indirectly controlling a terminal interface and a terminal control by packaging a view model and a control programming model, and designing metadata on the terminal interface, wherein the metadata comprises a main entity model, a field and a field attribute;

constructing a data dictionary through the main entity model, wherein the data dictionary stores bill bodies and field values;

and adjusting the file format of the metadata, and storing the file of the metadata in a database.

3. The method of claim 1, wherein after adjusting the default template to the target template by changing fields in the meta-model and adjusting the default rule to the target rule by changing field attributes in the meta-model, further comprising:

recording the target rule and the target template through business organization records;

and setting the target rule and the target template as a second default rule and a second default template when data is imported next time.

4. The method of claim 3, wherein after setting the target rule and the target template as a second default rule and a second default template for a next data import, further comprising:

verifying whether the second default rule exists;

if the second default rule exists, finding the corresponding field attribute and the corresponding field in the original model through the second default rule, generating a third default template through setting the corresponding field, and sending the third default template to the target terminal; and if the second default rule does not exist, generating a first default template through a field set in the meta-model, generating a first default rule through a field attribute set in the meta-model, and sending the first default template to the target terminal.

5. The method according to claim 1, wherein the obtaining of the corresponding target field from the meta-model through the script information and the loading of the target rule according to the target field comprise:

obtaining the hash value of the target field and the hash value of the target template;

and comparing the hash value of the target field with the hash value of the target template, if the hash values are the same, determining that the target template is a correct template, and applying the target rule to the target template.

6. The method of claim 1, wherein the dynamically verifying the data in the target template by the target rule, and storing the data according to the classification of the verification result comprises:

dynamically acquiring the essential record of the field through the field set in the meta-model, and checking the essential record;

dynamically acquiring a field type through a field attribute set in the meta-model, and dynamically checking data of a corresponding field; if the field type is a basic data type field, dynamically acquiring a table structure of the basic data type field through a meta-model, and checking data of a corresponding field;

and storing the data in a classified manner according to the verification result.

7. The method of claim 6, wherein the storing the data by classification according to the verification result comprises:

if the data is the data of the father-son entry, classifying the data by adopting a recursive algorithm, assembling the child entry data corresponding to the data of the father entry according to a father-son structure, and updating the assembled data to the entry;

storing the data to a database.

8. An apparatus for data import, the apparatus comprising:

the generating module is used for establishing a meta-model, generating a first default template through a field set in the meta-model, and generating a first default rule through a field attribute set in the meta-model;

the adjusting module is used for adjusting the first default template into a target template by changing the field in the meta-model and adjusting the first default rule into a target rule by changing the field attribute in the meta-model;

the import module is used for sending the target template to a target terminal and acquiring the target template of the imported data uploaded by the target terminal and corresponding script information;

the acquisition module is used for acquiring a corresponding target field from the meta-model through the script information and loading the target rule according to the target field;

and the checking module is used for dynamically checking the data in the target template through the target rule and storing the data in a classified manner according to a checking result.

9. A computer device comprising a memory and a processor, the memory storing a computer program, characterized in that the processor, when executing the computer program, implements the steps of the method of any of claims 1 to 7.

10. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the method of any one of claims 1 to 7.

Technical Field

The present application relates to the field of data processing technologies, and in particular, to a data import/export method and apparatus, a computer device, and a storage medium.

Background

With the development of data processing technology, the requirements for realizing import and export of data are increasing. In the prior art, because businesses such as enterprises and units have the characteristics of complexity, variability, wide sources and complex processing, when the data import and export technology is applied to the enterprises and units, the processing process becomes abnormally complex. In the conventional technology, configuration information in a configuration table is set by configuring a generation interface of the configuration table to generate the configuration table, and then a verification cabinet interface parallel to the configuration table generation interface is set at the front end of the configuration table generation interface for generating a verification rule or importing a pre-prepared verification rule. Therefore, data import of each function needs to maintain a set of templates separately on a configuration interface, the maintenance interface is various, the maintenance cost is high, and the verification rule of each function needs to be predefined. In addition, in the existing data import and export technology, only data itself is concerned in the data processing process, and the processing logic of the data does not relate to business aspects, so that the data sources supported by the technology are single, and the system is rushed when the data volume is large. Due to the fact that the scenes of enterprise application are complex and changeable, and the data sources are multiple, the existing technology is difficult to support.

Disclosure of Invention

Based on this, it is necessary to provide a data import method, apparatus, computer device and storage medium to implement a custom rule and a template to achieve the purpose of flexibly supporting import of different service data.

A method of data import, the method comprising:

and establishing a meta-model, generating a first default template through a field set in the meta-model, and generating a first default rule through a field attribute set in the meta-model.

The first default template is adjusted to the target template by changing fields in the meta-model, and the first default rule is adjusted to the target rule by changing field attributes in the meta-model.

And sending the target template to a target terminal, and acquiring the target template of the imported data uploaded by the target terminal and corresponding script information.

And acquiring a corresponding target field from the meta-model through the script information, and loading the target rule according to the target field.

And dynamically verifying the data in the target template through the target rule, and storing the data in a classified manner according to a verification result.

In one embodiment, the building meta-model includes:

and indirectly controlling a terminal interface and a terminal control by packaging a view model and a control programming model, and designing metadata on the terminal interface, wherein the metadata comprises a main entity model, a field and a field attribute.

And constructing a data dictionary through the main entity model, wherein the data dictionary stores bill bodies and field values.

And adjusting the file format of the metadata, and storing the file of the metadata in a database.

In one embodiment, after the adjusting the default template to the target template by changing the field in the meta-model and the adjusting the default rule to the target rule by changing the field attribute in the meta-model, the method further includes:

and recording the target rule and the target template through business organization records.

And setting the target rule and the target template as a second default rule and a second default template when data is imported next time.

In one embodiment, after setting the target rule and the target template as a second default rule and a second default template when data is imported next time, the method further includes:

verifying whether the second default rule exists.

If the second default rule exists, finding the corresponding field attribute and the corresponding field in the original model through the second default rule, generating a third default template through setting the corresponding field, and sending the third default template to the target terminal; and if the second default rule does not exist, generating a first default template through a field set in the meta-model, generating a first default rule through a field attribute set in the meta-model, and sending the first default template to the target terminal.

In one embodiment, the acquiring, by the script information, the corresponding target field from the meta-model and loading the target rule according to the target field includes:

and acquiring the hash value of the target field and the hash value of the target template.

And comparing the hash value of the target field with the hash value of the target template, if the hash values are the same, determining that the target template is a correct template, and applying the target rule to the target template.

In one embodiment, the dynamically verifying the data in the target template through the target rule, and storing the data according to a classification according to a verification result includes:

and dynamically acquiring the essential record of the field through the field set in the meta-model, and carrying out essential record verification.

Dynamically acquiring a field type through a field attribute set in the meta-model, and dynamically checking data of a corresponding field; and if the field type is a basic data type field, dynamically acquiring the table structure of the basic data type field through a meta-model, and checking the data of the corresponding field.

And storing the data in a classified manner according to the verification result.

In one embodiment, the storing the data by classifying the data according to the verification result includes:

and if the data is the data of the father-son entry, classifying the data by adopting a recursive algorithm, assembling the child entry data corresponding to the data of the father entry according to a father-son structure, and updating the assembled data to the entry.

Storing the data to a database.

An apparatus for data import, the apparatus comprising:

the generating module is used for establishing a meta-model, generating a first default template through a field set in the meta-model, and generating a first default rule through a field attribute set in the meta-model.

And the adjusting module is used for adjusting the first default template into the target template by changing the field in the meta-model and adjusting the first default rule into the target rule by changing the field attribute in the meta-model.

And the import module is used for sending the target template to a target terminal and acquiring the target template of the imported data uploaded by the target terminal and corresponding script information.

And the acquisition module is used for acquiring the corresponding target field from the meta-model through the script information and loading the target rule according to the target field.

And the checking module is used for dynamically checking the data in the target template through the target rule and storing the data in a classified manner according to a checking result.

A computer device comprising a memory and a processor, the memory storing a computer program, the processor implementing the following steps when executing the computer program:

and establishing a meta-model, generating a first default template through a field set in the meta-model, and generating a first default rule through a field attribute set in the meta-model.

The first default template is adjusted to the target template by changing fields in the meta-model, and the first default rule is adjusted to the target rule by changing field attributes in the meta-model.

And sending the target template to a target terminal, and acquiring the target template of the imported data uploaded by the target terminal and corresponding script information.

And acquiring a corresponding target field from the meta-model through the script information, and loading the target rule according to the target field.

And dynamically verifying the data in the target template through the target rule, and storing the data in a classified manner according to a verification result.

A computer-readable storage medium, on which a computer program is stored which, when executed by a processor, carries out the steps of:

and establishing a meta-model, generating a first default template through a field set in the meta-model, and generating a first default rule through a field attribute set in the meta-model.

The first default template is adjusted to the target template by changing fields in the meta-model, and the first default rule is adjusted to the target rule by changing field attributes in the meta-model.

And sending the target template to a target terminal, and acquiring the target template of the imported data uploaded by the target terminal and corresponding script information.

And acquiring a corresponding target field from the meta-model through the script information, and loading the target rule according to the target field.

And dynamically verifying the data in the target template through the target rule, and storing the data in a classified manner according to a verification result.

The method, the device, the computer equipment and the storage medium for importing the data are characterized in that a meta-model is established firstly, a first default template is generated through fields set in the meta-model, and a first default rule is generated through field attributes set in the meta-model; adjusting the first default template to be a target template by changing the field in the meta-model, and adjusting the first default rule to be a target rule by changing the field attribute in the meta-model; sending the target template to a target terminal, and acquiring the target template of the imported data uploaded by the target terminal and corresponding script information; acquiring a corresponding target field from the meta-model through the script information, and loading the target rule according to the target field; the data in the target template is dynamically verified through the target rule, and the data are classified and stored according to the verification result, so that the rule and the template can be customized to flexibly support the import of different service data.

Drawings

FIG. 1 is a diagram of an application environment for a method of data import in one embodiment;

FIG. 2 is a flowchart illustrating a method of data import according to an embodiment;

FIG. 3 is a flowchart illustrating the steps of building a meta-model in one embodiment;

FIG. 4 is a flowchart illustrating steps involved in one embodiment after adjusting a default template to a target template by changing fields in a meta-model and adjusting a default rule to a target rule by changing field attributes in the meta-model;

FIG. 5 is a flowchart illustrating steps that may be included after the target rule and the target template are set as the second default rule and the second default template for the next data import in one embodiment;

FIG. 6 is a flowchart illustrating steps involved in acquiring a corresponding target field from the meta-model via the script information and loading the target rule according to the target field in one embodiment;

FIG. 7 is a flowchart illustrating the steps involved in dynamically verifying data in the target template according to the target rules and storing the data in a sorted manner according to the verification results in one embodiment;

FIG. 8 is a flowchart illustrating the steps involved in storing data by classification based on the verification result in one embodiment;

FIG. 9 is a block diagram of an apparatus for data import, according to an embodiment;

FIG. 10 is a diagram showing an internal structure of a computer device according to an embodiment.

Detailed Description

In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.

The data importing method provided by the application can be applied to the application environment shown in fig. 1. Wherein the terminal 102 communicates with the server 104 via a network. First, a meta model is built on the server 104, a first default template is generated by a field set in the meta model, and a first default rule is generated by a field attribute set in the meta model. The first default template is then adjusted to the target template by changing fields in the meta-model, and the first default rule is adjusted to the target rule by changing field attributes in the meta-model. Then, the target template is sent to the (target) terminal 102 through the server 104, and the target template of the imported data uploaded by the (target) terminal 102 and the corresponding script information are obtained. Then, acquiring a corresponding target field from the meta-model through the script information, and loading the target rule according to the target field. And finally, dynamically verifying the data in the target template through the target rule, and storing the data in a classified manner according to a verification result. The terminal 102 may be, but not limited to, various personal computers, notebook computers, smart phones, tablet computers, and portable wearable devices, and the server 104 may be implemented by an independent server or a server cluster formed by a plurality of servers.

In an embodiment, as shown in fig. 2, a data importing method is provided, which is described by taking an example that the method is applied to the system including the terminal and the server in fig. 1 and implemented by interaction between the terminal and the server, and includes the following steps:

step 202, establishing a meta-model, generating a first default template through a field set in the meta-model, and generating a first default rule through a field attribute set in the meta-model.

Wherein the meta-model is defined by a script, which can be divided into table element data and entity metadata, wherein the entity metadata contains database table field identification. A field refers to an abstract representation of a content attribute that is a real-world business, of different types, such as time, text, quantity, unit price, amount, business object, etc. The template refers to an input interface of data, and the first default template refers to a universal unified template generated according to universal fields in the meta-model. The field attributes may define the characteristics and behavior of the field, such as field size, field format, validity rules, and so forth. Rules may control the entry of fields, where each service dynamically generates a rule corresponding to it. The first default rule refers to a generic unified rule generated from generic field attributes in the meta-model.

Specifically, a meta-model is established on the server, a first default template is generated through fields set in the meta-model, and a first default rule is generated through field attributes set in the meta-model. The fields set in the meta-model and the field attributes set in the meta-model have general universality, and the first default template and the first default rule have a corresponding relation.

Alternatively, the first default template may be MS Excel.

Step 204, adjusting the first default template to be the target template by changing the field in the meta-model, and adjusting the first default rule to be the target rule by changing the field attribute in the meta-model.

The target template is a template selected by a user in a self-defining mode, and the field is adjusted in the self-defining mode. The target rule refers to a rule selected by a user in a self-defining mode, and the field attribute is adjusted in the self-defining mode. The target rule and the target template have a corresponding relation.

Specifically, on the server, the first default template is adjusted to the target template by changing the fields in the meta-model, wherein the adjustment may be to add, delete or add the fields. And adjusting the first default rule to be a target rule by changing the field attribute in the meta-model, wherein the adjustment mode can be adding, deleting or adding the field attribute.

Alternatively, the target template may be MS Excel.

And step 206, sending the target template to a target terminal, and acquiring the target template of the imported data uploaded by the target terminal and corresponding script information.

The target terminal refers to a browser, a mobile terminal and other visual interfaces; the script information refers to a script tab.

Specifically, the server sends the target template to a target terminal, and then obtains the target template of the imported data and the corresponding script information uploaded by the target terminal.

And 208, acquiring a corresponding target field from the meta-model through the script information, and loading the target rule according to the target field.

Wherein, loading the target rule according to the target field means applying the target rule to the target field.

Specifically, on the server, the corresponding target field is obtained from the meta-model through the script information, and the target rule is applied to the corresponding target field.

And step 210, dynamically checking the data in the target template through the target rule, and storing the data in a classified manner according to a checking result.

Specifically, on the server, each service dynamically generates a rule. And dynamically verifying the data in the target template through the target rule, and storing the data in a classified manner according to a verification result.

The method, the device, the computer equipment and the storage medium for importing the data are characterized in that a meta-model is established firstly, a first default template is generated through fields set in the meta-model, and a first default rule is generated through field attributes set in the meta-model; adjusting the first default template to be a target template by changing the field in the meta-model, and adjusting the first default rule to be a target rule by changing the field attribute in the meta-model; sending the target template to a target terminal, and acquiring the target template of the imported data uploaded by the target terminal and corresponding script information; acquiring a corresponding target field from the meta-model through the script information, and loading the target rule according to the target field; the data in the target template is dynamically verified through the target rule, and the data are classified and stored according to the verification result, so that the rule and the template can be customized to flexibly support the import of different service data.

In one embodiment, as shown in fig. 3, the building meta-model includes:

step 302, indirectly controlling a terminal interface and a terminal control through a packaging view model and a control programming model, designing metadata on the terminal interface, wherein the metadata comprises a main entity model, a field and a field attribute,

the view model is used for controlling the presentation data on the server and can be mainly applied to a terminal interface. The control programming model refers to a method, attributes, events and relations between controls for various discrete functions in the controls on the server, and can act on the terminal controls. The terminal interface refers to an interface available for interaction on the terminal, for example, a human-computer interaction interface. Terminal controls may be used for terminal control.

Specifically, the server indirectly controls the terminal interface and the terminal control through a packaging view model and a control programming model.

And 304, constructing a data dictionary through the main entity model, wherein the data dictionary stores bill bodies and field values.

The metadata refers to information describing data attributes, and may include: master entity model, sub-entities, fields, field attributes, table structures, interface packets, and the like. The data dictionary refers to an information set describing data, and is a set of definitions of all data elements used in the system, and the data dictionary can store bill bodies and field values.

Specifically, metadata design is carried out on a terminal interface, and a data dictionary is constructed through a main entity model.

Step 306, adjusting the file format of the metadata, and storing the file of the metadata in a database.

The file format of the metadata refers to the format of the metadata carrier file, and the format adjustment is to deposit the data.

In the embodiment, a terminal interface and a terminal control are indirectly controlled on the server through a packaging view model and a control programming model; on the terminal, carrying out metadata design on a terminal interface, wherein the metadata comprises: the system comprises a main entity model, a sub-entity, fields, field attributes, a table structure and an interface data packet, wherein a data dictionary is constructed through the main entity model, and the data dictionary stores a bill body and field values; and on the server, adjusting the file format of the metadata, and storing the file of the metadata into a database, thereby realizing the establishment of the meta model.

Optionally, the format is adjusted to xml format to precipitate the data.

In one embodiment, as shown in fig. 4, after the adjusting the default template to the target template by changing the field in the meta-model and the adjusting the default rule to the target rule by changing the field attribute in the meta-model, the method further includes:

step 402, recording the target rule and the target template through business organization record.

The business organization record is tracing data for recording and organizing information such as when and how a business process occurs, business activity input and output, resource use and the like, and mainly refers to recording related information of a target rule and a target template.

Specifically, the target rule and the target template are recorded on the server through business organization records.

And step 404, setting the target rule and the target template as a second default rule and a second default template when data is imported next time.

The next data import refers to one data import after the first default rule and the first default template are adjusted to be the target rule and the target template for data import.

Specifically, the target rule and the target template are set on the server as a second default rule and a second default template when data is imported next time.

Alternatively, the second default template may be MS Excel.

In this embodiment, the server records the target rule and the target template through a service organization record; then, the target rule and the target template are set as a second default rule and a second default template when data is imported next time, and the target rule and the target template can be set as new rules and templates (a second target rule and a second default template) according to the records so as to realize the self-defined template and rule.

In an embodiment, as shown in fig. 5, after setting the target rule and the target template as a second default rule and a second default template at the next data import, the method further includes:

step 502, verifying whether the second default rule exists.

The second default rule is a target rule customized by a user and is set to be the second default rule through the server.

Specifically, on the server, it is verified whether the second default rule exists.

Step 504, if the second default rule exists, finding the corresponding field attribute and the corresponding field in the original model through the second default rule, generating a third default template through setting the corresponding field, and sending the third default template to the target terminal; and if the second default rule does not exist, generating a first default template through a field set in the meta-model, generating a first default rule through a field attribute set in the meta-model, and sending the first default template to the target terminal.

The third default template is generated by finding the corresponding field attribute and the corresponding field in the original model through a second default rule and setting the corresponding field.

Specifically, on the server, after judgment, if the second default rule exists, finding a corresponding field attribute and a corresponding field in the original model through the second default rule, generating a third default template through setting the corresponding field, and sending the third default template to the target terminal; and if the second default rule does not exist, generating a first default template through a field set in the meta-model, generating a first default rule through a field attribute set in the meta-model, and sending the first default template to the target terminal.

In this embodiment, different templates are determined and generated by verifying that the second default rule exists, and the purpose of customizing the template through the rule through the setting of the meta-model can be achieved.

In an embodiment, as shown in fig. 6, the obtaining, through the script information, a corresponding target field from the meta-model, and loading the target rule according to the target field includes:

step 602, obtaining the hash value of the target field and the hash value of the target template.

Where a hash value refers to a piece of data given as the answer to a hash function, called a value.

Specifically, the server obtains the hash value of the target field and the hash value of the target template

Step 604, comparing the hash value of the target field with the hash value of the target template, if the hash values are the same, the target template is a correct template, and applying the target rule to the target template.

Wherein, the target field and the target template have corresponding relation, so that the hash values have identity.

Specifically, the server compares the hash value of the target field with the hash value of the target template, and if the hash values are the same, the target template is a correct template, and the target rule is applied to the target template.

In this embodiment, the accuracy of the target template can be verified by comparing the hash value of the target field with the hash value of the target template.

In one embodiment, as shown in fig. 7, the dynamically verifying the data in the target template by the target rule, and the classifying and storing the data according to the verification result includes:

step 702, dynamically obtaining the bibliography of the field through the field set in the meta-model, and checking the bibliography.

Wherein, the obligation is to ensure the validity and legality of the data.

Specifically, on the server, the bibliography of the field is dynamically acquired through the field set in the meta-model, and the bibliography is checked.

Step 704, dynamically obtaining the field type through the field attribute set in the meta-model, and dynamically checking the data of the corresponding field; and if the field type is a basic data type field, dynamically acquiring the table structure of the basic data type field through a meta-model, and checking the data of the corresponding field.

The field types are divided into different types according to a certain classification rule, and the classification rule can be customized and can also be defined according to the service requirement. Here classified according to the service requirements, and in particular, the basic material type field is separately processed.

Specifically, on the server, the field type is dynamically acquired through the field attribute set in the meta-model, and the data of the corresponding field is dynamically verified; and if the field type is a basic data type field, dynamically acquiring the table structure of the basic data type field through a meta-model, and checking the data of the corresponding field.

And step 706, storing the data in a classified manner according to the verification result.

Specifically, on the server, data is classified and stored according to the verification result.

In this embodiment, the bibliographic check of the field and the dynamic check of the data are performed, and the data are stored in a classified manner according to the check result, so that the accuracy of the stored data can be realized.

In one embodiment, as shown in fig. 8, the storing the data according to the classification of the data according to the verification result includes:

and step 802, if the data is data of the father-son entry, classifying the data by adopting a recursive algorithm, assembling the child entry data corresponding to the data of the father entry according to a father-son structure, and updating the assembled data to the entry.

The data of the parent-child entry refers to data with a parent-child structure. A recursive algorithm is an algorithm for processing data, such as a recursive tree.

Specifically, on the server, after the verification, the obtained data structure is a parent-child entry structure, and then the server classifies the data by using a recursive tree method, assembles child entry data corresponding to the data of the parent entry according to the parent-child structure, and updates the assembled data to the entry.

Step 804, storing the data in a database.

Specifically, the data is stored to a database.

In this embodiment, the parent-child entry structure is processed separately through the check result, so that stable storage of parent-child entry data can be realized. In this case, it is generally difficult to store data in a parent-child entry structure in a stable manner.

It should be understood that although the various steps in the flow charts of fig. 2-8 are shown in order as indicated by the arrows, the steps are not necessarily performed in order as indicated by the arrows. The steps are not performed in the exact order shown and described, and may be performed in other orders, unless explicitly stated otherwise. Moreover, at least some of the steps in fig. 2-8 may include multiple steps or multiple stages, which are not necessarily performed at the same time, but may be performed at different times, which are not necessarily performed in sequence, but may be performed in turn or alternately with other steps or at least some of the other steps.

In one embodiment, as shown in fig. 9, there is provided an apparatus for data import, including: the device comprises a generation module, an adjustment module, an import module, an acquisition module and a detection module, wherein:

the generating module is used for establishing a meta-model, generating a first default template through a field set in the meta-model, and generating a first default rule through a field attribute set in the meta-model.

And the adjusting module is used for adjusting the first default template into the target template by changing the field in the meta-model and adjusting the first default rule into the target rule by changing the field attribute in the meta-model.

And the import module is used for sending the target template to a target terminal and acquiring the target template of the imported data uploaded by the target terminal and corresponding script information.

And the acquisition module is used for acquiring the corresponding target field from the meta-model through the script information and loading the target rule according to the target field.

And the checking module is used for dynamically checking the data in the target template through the target rule and storing the data in a classified manner according to a checking result.

In one embodiment, as shown in fig. 9, there is provided an apparatus for data import, including: control module, design module and storage module, wherein:

and the control module is used for indirectly controlling the terminal interface and the terminal control through the packaging view model and the control programming model, and designing metadata on the terminal interface, wherein the metadata comprises a main entity model, a field and field attributes.

And the construction module is used for constructing a data dictionary through the main entity model, and the data dictionary stores the bill body and the field value.

And the storage module is used for adjusting the file format of the metadata and storing the file of the metadata into the database.

In one embodiment, as shown in fig. 9, there is provided an apparatus for data import, including: record module and setting module, wherein:

and the recording module is used for recording the target rule and the target template through business organization records.

And the setting module is used for setting the target rule and the target template as a second default rule and a second default template when data is imported next time.

In one embodiment, as shown in fig. 9, there is provided an apparatus for data import, including: the device comprises a verification module and a first judgment module, wherein:

a verification module for verifying whether the second default rule exists;

the first judgment module is used for judging whether the second default rule exists, finding the corresponding field attribute and the corresponding field in the original model through the second default rule, generating a third default template through setting the corresponding field, and sending the third default template to the target terminal; and if the second default rule does not exist, generating a first default template through a field set in the meta-model, generating a first default rule through a field attribute set in the meta-model, and sending the first default template to the target terminal.

In one embodiment, as shown in fig. 9, there is provided an apparatus for data import, including: another acquisition module and a comparison module, wherein:

another obtaining module, configured to obtain the hash value of the target field and the hash value of the target template.

And the comparison module is used for comparing the hash value of the target field with the hash value of the target template, if the hash values are the same, the target template is a correct template, and the target rule is applied to the target template.

In one embodiment, as shown in fig. 9, there is provided an apparatus for data import, including: first check-up module, second check-up module and classification module, wherein:

the first checking module is used for dynamically acquiring the mandatory record of the field through the field set in the meta-model and checking the mandatory record;

the second check module is used for dynamically acquiring the field type through the field attribute set in the meta-model and dynamically checking the data of the corresponding field; if the field type is a basic data type field, dynamically acquiring a table structure of the basic data type field through a meta-model, and checking data of a corresponding field;

and the classification module is used for classifying and storing the data according to the verification result.

In one embodiment, as shown in fig. 9, there is provided an apparatus for data import, including: a second determination module and another storage module, wherein:

the second judgment module is used for classifying the data by adopting a recursive algorithm if the data is the data of the father-son entry, assembling the child entry data corresponding to the data of the father entry according to a father-son structure, and updating the assembled data to the entry;

and the other storage module is used for storing the data to a database.

In addition to embodiments in which the apparatus is dependent, embodiments in which all method items are written from one apparatus item to one apparatus item are also to be written.

For specific limitations of a device for importing data, reference may be made to the above limitations of a method for importing data, and details thereof are not described herein. The modules in the above-mentioned data importing apparatus may be implemented wholly or partially by software, hardware, and a combination thereof. The modules can be embedded in a hardware form or independent from a processor in the computer device, and can also be stored in a memory in the computer device in a software form, so that the processor can call and execute operations corresponding to the modules.

In one embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as shown in fig. 10. The computer device includes a processor, a memory, and a network interface connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device comprises a nonvolatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of an operating system and computer programs in the non-volatile storage medium. The database of the computer device is used to store the imported data. The network interface of the computer device is used for communicating with an external terminal through a network connection. The computer program is executed by a processor to implement a method of data import.

Those skilled in the art will appreciate that the architecture shown in fig. 10 is merely a block diagram of some of the structures associated with the disclosed aspects and is not intended to limit the computing devices to which the disclosed aspects apply, as particular computing devices may include more or less components than those shown, or may combine certain components, or have a different arrangement of components.

In one embodiment, a computer device is provided, comprising a memory and a processor, the memory having a computer program stored therein, the processor implementing the following steps when executing the computer program:

and establishing a meta-model, generating a first default template through a field set in the meta-model, and generating a first default rule through a field attribute set in the meta-model.

The first default template is adjusted to the target template by changing fields in the meta-model, and the first default rule is adjusted to the target rule by changing field attributes in the meta-model.

And sending the target template to a target terminal, and acquiring the target template of the imported data uploaded by the target terminal and corresponding script information.

And acquiring a corresponding target field from the meta-model through the script information, and loading the target rule according to the target field.

And dynamically verifying the data in the target template through the target rule, and storing the data in a classified manner according to a verification result.

In one embodiment, the processor, when executing the computer program, further performs the steps of:

and indirectly controlling a terminal interface and a terminal control by packaging a view model and a control programming model, and designing metadata on the terminal interface, wherein the metadata comprises a main entity model, a field and a field attribute.

And constructing a data dictionary through the main entity model, wherein the data dictionary stores bill bodies and field values.

And adjusting the file format of the metadata, and storing the file of the metadata in a database.

In one embodiment, the processor, when executing the computer program, further performs the steps of:

and recording the target rule and the target template through business organization records.

And setting the target rule and the target template as a second default rule and a second default template when data is imported next time.

In one embodiment, the processor, when executing the computer program, further performs the steps of:

verifying whether the second default rule exists.

If the second default rule exists, finding the corresponding field attribute and the corresponding field in the original model through the second default rule, generating a third default template through setting the corresponding field, and sending the third default template to the target terminal; and if the second default rule does not exist, generating a first default template through a field set in the meta-model, generating a first default rule through a field attribute set in the meta-model, and sending the first default template to the target terminal.

In one embodiment, the processor, when executing the computer program, further performs the steps of:

and acquiring the hash value of the target field and the hash value of the target template.

And comparing the hash value of the target field with the hash value of the target template, if the hash values are the same, determining that the target template is a correct template, and applying the target rule to the target template.

In one embodiment, the processor, when executing the computer program, further performs the steps of:

and dynamically acquiring the essential record of the field through the field set in the meta-model, and carrying out essential record verification.

Dynamically acquiring a field type through a field attribute set in the meta-model, and dynamically checking data of a corresponding field; and if the field type is a basic data type field, dynamically acquiring the table structure of the basic data type field through a meta-model, and checking the data of the corresponding field.

And storing the data in a classified manner according to the verification result.

In one embodiment, the processor, when executing the computer program, further performs the steps of:

and if the data is the data of the father-son entry, classifying the data by adopting a recursive algorithm, assembling the child entry data corresponding to the data of the father entry according to a father-son structure, and updating the assembled data to the entry.

Storing the data to a database.

In one embodiment, a computer-readable storage medium is provided, having a computer program stored thereon, which when executed by a processor, performs the steps of:

and establishing a meta-model, generating a first default template through a field set in the meta-model, and generating a first default rule through a field attribute set in the meta-model.

The first default template is adjusted to the target template by changing fields in the meta-model, and the first default rule is adjusted to the target rule by changing field attributes in the meta-model.

And sending the target template to a target terminal, and acquiring the target template of the imported data uploaded by the target terminal and corresponding script information.

And acquiring a corresponding target field from the meta-model through the script information, and loading the target rule according to the target field.

And dynamically verifying the data in the target template through the target rule, and storing the data in a classified manner according to a verification result.

In one embodiment, the computer program when executed by the processor further performs the steps of:

and indirectly controlling a terminal interface and a terminal control by packaging a view model and a control programming model, and designing metadata on the terminal interface, wherein the metadata comprises a main entity model, a field and a field attribute.

And constructing a data dictionary through the main entity model, wherein the data dictionary stores bill bodies and field values.

And adjusting the file format of the metadata, and storing the file of the metadata in a database.

In one embodiment, the computer program when executed by the processor further performs the steps of:

and recording the target rule and the target template through business organization records.

And setting the target rule and the target template as a second default rule and a second default template when data is imported next time.

In one embodiment, the computer program when executed by the processor further performs the steps of:

verifying whether the second default rule exists.

If the second default rule exists, finding the corresponding field attribute and the corresponding field in the original model through the second default rule, generating a third default template through setting the corresponding field, and sending the third default template to the target terminal; and if the second default rule does not exist, generating a first default template through a field set in the meta-model, generating a first default rule through a field attribute set in the meta-model, and sending the first default template to the target terminal.

In one embodiment, the computer program when executed by the processor further performs the steps of:

and acquiring the hash value of the target field and the hash value of the target template.

And comparing the hash value of the target field with the hash value of the target template, if the hash values are the same, determining that the target template is a correct template, and applying the target rule to the target template.

In one embodiment, the computer program when executed by the processor further performs the steps of:

and dynamically acquiring the essential record of the field through the field set in the meta-model, and carrying out essential record verification.

Dynamically acquiring a field type through a field attribute set in the meta-model, and dynamically checking data of a corresponding field; and if the field type is a basic data type field, dynamically acquiring the table structure of the basic data type field through a meta-model, and checking the data of the corresponding field.

And storing the data in a classified manner according to the verification result.

In one embodiment, the computer program when executed by the processor further performs the steps of:

and if the data is the data of the father-son entry, classifying the data by adopting a recursive algorithm, assembling the child entry data corresponding to the data of the father entry according to a father-son structure, and updating the assembled data to the entry.

Storing the data to a database.

It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by hardware instructions of a computer program, which can be stored in a non-volatile computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. Any reference to memory, storage, database or other medium used in the embodiments provided herein can include at least one of non-volatile and volatile memory. Non-volatile Memory may include Read-Only Memory (ROM), magnetic tape, floppy disk, flash Memory, optical storage, or the like. Volatile Memory can include Random Access Memory (RAM) or external cache Memory. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM), among others.

The technical features of the above embodiments can be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the above embodiments are not described, but should be considered as the scope of the present specification as long as there is no contradiction between the combinations of the technical features.

The above-mentioned embodiments only express several embodiments of the present application, and the description thereof is more specific and detailed, but not construed as limiting the scope of the invention. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the concept of the present application, which falls within the scope of protection of the present application. Therefore, the protection scope of the present patent shall be subject to the appended claims.

21页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:数据处理方法、装置、电子设备、存储介质及程序产品

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!