CN116383221A - Data importing method, device and system - Google Patents

Data importing method, device and system Download PDF

Info

Publication number
CN116383221A
CN116383221A CN202310272899.1A CN202310272899A CN116383221A CN 116383221 A CN116383221 A CN 116383221A CN 202310272899 A CN202310272899 A CN 202310272899A CN 116383221 A CN116383221 A CN 116383221A
Authority
CN
China
Prior art keywords
data
column header
import
target
header data
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202310272899.1A
Other languages
Chinese (zh)
Inventor
郑森洋
段海波
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Bairong Zhixin Beijing Technology Co ltd
Original Assignee
Bairong Zhixin Beijing Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Bairong Zhixin Beijing Technology Co ltd filed Critical Bairong Zhixin Beijing Technology Co ltd
Priority to CN202310272899.1A priority Critical patent/CN116383221A/en
Publication of CN116383221A publication Critical patent/CN116383221A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/23Updating
    • G06F16/2365Ensuring data consistency and integrity
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/20Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
    • G06F16/22Indexing; Data structures therefor; Storage structures
    • G06F16/2291User-Defined Types; Storage management thereof
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Security & Cryptography (AREA)
  • Software Systems (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention discloses a data importing method, a device and a system, which relate to the technical field of data processing and mainly aim at enabling data importing to be more flexible and improving data importing efficiency so as to quickly respond to user demands. The main technical scheme of the invention is as follows: generating a target import template based on target column header data in a template configuration page, wherein the target column header data is all or part of designated column header data selected in the template configuration page, and the designated column header data corresponds to the existing column header data in a database; configuring data corresponding to the target column header data in the target import template to obtain a corresponding target import file; uploading the target import file to a server, so that the server analyzes the target import file and dynamically generates entity classes by utilizing a reflection mechanism to import the data in the target import file into the database. The invention is used for importing data.

Description

Data importing method, device and system
Technical Field
The present invention relates to the field of data processing technologies, and in particular, to a data importing method, device, and system.
Background
With the rapid development of internet technology, various informationized systems are increasingly applied to daily work and life, and meanwhile, a large amount of related data is accumulated. To fully exploit the value of the data, the data is typically imported into an informatization system for storage for later application importing into the data for analysis.
At present, a data importing mode in the prior art generally adopts template importing, namely, data is imported into a template, and then is uploaded to a server based on the template with the data so as to import the data into a database, however, the template in the mode is fixed and cannot be expanded, and especially when newly added column header data exists, entity classes in the database need to be secondarily developed and online, so that the flexibility of data importing is poor, the importing efficiency of the data is affected, and the client requirements cannot be responded quickly.
Disclosure of Invention
In view of the above problems, the present invention provides a data importing method, device and system, which mainly aims to make data importing more flexible, and improve data importing efficiency so as to quickly respond to user demands.
In order to solve the technical problems, the invention provides the following scheme:
in a first aspect, the present invention provides a data importing method, applied to a client, where the method includes:
generating a target import template based on target column header data in a template configuration page, wherein the target column header data is all or part of designated column header data selected in the template configuration page, and the designated column header data corresponds to the existing column header data in a database;
configuring data corresponding to the target column header data in the target import template to obtain a corresponding target import file;
uploading the target import file to a server, so that the server analyzes the target import file and dynamically generates entity classes by utilizing a reflection mechanism to import the data in the target import file into the database.
In a second aspect, the present invention provides a data importing method, applied to a server, where the method includes:
receiving and analyzing a target import file uploaded by a client to obtain corresponding target column header data and data;
dynamically generating entity classes corresponding to the target column header data based on a reflection mechanism;
and constructing a mapping relation between the entity class and the data, and correspondingly importing the data into a database by utilizing the mapping relation.
In a third aspect, the present invention provides a data importing apparatus, applied to a client, the apparatus comprising:
a first generating unit, configured to generate a target import template based on target column header data in a template configuration page, where the target column header data is specified column header data for all or part selected in the template configuration page, and the specified column header data corresponds to existing column header data in a database;
the configuration unit is used for configuring the data corresponding to the target column header data in the target import template obtained by the first generation unit so as to obtain a corresponding target import file;
and the uploading unit is used for uploading the target import file obtained by the configuration unit to a server, so that the server analyzes the target import file and dynamically generates entity class by utilizing a reflection mechanism to import the data in the target import file into the database.
In a fourth aspect, the present invention provides a data importing apparatus, applied to a server, where the apparatus includes:
the first analysis unit is used for receiving and analyzing the target import file uploaded by the client to obtain corresponding target column header data and data;
the third generating unit is used for dynamically generating entity classes corresponding to the target column header data obtained by the first analyzing unit based on a reflection mechanism;
and the importing unit is used for constructing the mapping relation between the entity class and the data obtained by the third generating unit and importing the data into a database correspondingly by utilizing the mapping relation.
In a fifth aspect, the present invention provides a data import system, including a client and a server,
when the client performs data import, executing the data import method of the execution client according to any one of the above;
and when the server performs data import, executing the data import method of the execution server.
In order to achieve the above object, according to a sixth aspect of the present invention, there is provided a storage medium including a stored program, wherein the program, when run, controls a device in which the storage medium is located to execute the data import method of the first or second aspect.
In order to achieve the above object, according to a seventh aspect of the present invention, there is provided a processor for executing a program, wherein the program executes the data import generation method of the first or second aspect described above when running.
By means of the technical scheme, the data importing method, device and system provided by the invention are characterized in that when data are required to be imported, a target importing template is firstly generated based on target column header data in a template configuration page, wherein the target column header data is all or part of appointed column header data selected in the template configuration page, the appointed column header data corresponds to existing column header data in a database, then row data corresponding to the target column header data are configured in the target importing template to obtain a corresponding target importing file, and finally the target importing file is uploaded to a server side, so that the server side analyzes the target importing file and dynamically generates entity types by utilizing a reflection mechanism to import the row data in the target importing file into the database. According to the technical scheme provided by the invention, the template adopted by data import can be generated based on the target column head data selected from the appointed column head data in the template configuration page, and the appointed column head data are all the existing column head data in the database, so that after the configuration file is uploaded to the server, the server can generate the entity class corresponding to the target column head data by utilizing the reflection mechanism, thereby the data can be quickly and accurately imported into the database according to the importing corresponding relation between the entity class and the data table in the database, the importing template can be flexibly configured and expanded, the entity class is dynamically generated without secondary development and online for the entity class in the database when the newly added column head data exists, the flexibility and the efficiency of data import are effectively improved, and further the quick response to the client demand is realized.
The foregoing description is only an overview of the present invention, and is intended to be implemented in accordance with the teachings of the present invention in order that the same may be more clearly understood and to make the same and other objects, features and advantages of the present invention more readily apparent.
Drawings
Various other advantages and benefits will become apparent to those of ordinary skill in the art upon reading the following detailed description of the preferred embodiments. The drawings are only for purposes of illustrating the preferred embodiments and are not to be construed as limiting the invention. Also, like reference numerals are used to designate like parts throughout the figures. In the drawings:
fig. 1 shows a flowchart of a data importing method applied to a client according to an embodiment of the present invention;
fig. 2 shows a flowchart of a data importing method applied to a server according to an embodiment of the present invention;
fig. 3 is a block diagram of a data importing apparatus according to an embodiment of the present invention;
FIG. 4 is a block diagram illustrating another data importing apparatus applied to a client according to an embodiment of the present invention;
fig. 5 shows a block diagram of a data importing apparatus applied to a server according to an embodiment of the present invention;
FIG. 6 is a block diagram illustrating another data import method applied to a server according to an embodiment of the present invention;
fig. 7 shows a block diagram of a data import system according to an embodiment of the present invention.
Detailed Description
Exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be embodied in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.
At present, a data importing mode in the prior art generally adopts template importing, namely, data is imported into a template, and then is uploaded to a server based on the template with the data so as to import the data into a database, however, the template in the mode is fixed and cannot be expanded, and especially when newly added column header data exists, entity classes in the database need to be secondarily developed and online, so that the flexibility of data importing is poor, the importing efficiency of the data is affected, and the client requirements cannot be responded quickly. According to the invention, the corresponding import template is generated based on the target column head data selected from the appointed column head data in the template configuration page, and the appointed column head data are all the existing column head data in the database, so that after the configuration file is uploaded to the server, the server can generate the entity class corresponding to the target column head data by utilizing a reflection mechanism, thereby rapidly and accurately importing the data into the database according to the import corresponding relation between the entity class and the data table in the database, the import template can be flexibly configured and expanded, and when the newly added column head data exists, the entity class is dynamically generated without secondary development and online of the entity class in the database, so that the flexibility and efficiency of data import are effectively improved, and further, the rapid response to the client requirement is realized.
Therefore, the embodiment of the invention provides a data importing method, by which the data importing is more flexible, and the importing efficiency of the data is improved so as to quickly respond to the user demand, and the specific implementation steps are as shown in fig. 1, and the method is applied to a client and comprises the following steps:
101. a target import template is generated based on the target column header data in the template configuration page.
The target column header data is all or part of designated column header data selected in the template configuration page, and the designated column header data corresponds to the existing column header data in the database. It should be noted that, in this embodiment, the execution body is an intelligent device capable of responding to the client, for example, a mobile phone, a computer, etc., and the embodiment is not limited, but the template configuration page is a page that is generated in advance based on the existing column header data in the corresponding database and is capable of being operated by the user, that is, the existing column header data in the database and the specified column header data are in a one-to-one correspondence, and is used for configuring a template that the user needs to use for importing data, specifically, the existing column header data can be used as selectable specified column header data to generate a template configuration page, and the template configuration page is deployed at the client, however, because the data importing situation and the requirement are not fixed in the actual environment, the situation of storing new data will often occur, that is, the new column header data in the database is imported and stored in order to facilitate the user to newly add the new column header data in the database at the client, and also can set a configurable new column header data option in the template configuration page, so that the user can conveniently pre-add the new column header data according to the requirement, thereby facilitating the template configuration page to be imported by the user, the template configuration page is conveniently executed, and the template configuration page is conveniently to be imported to the target data.
Furthermore, in order to quickly configure an import template meeting the new data import requirement when the new data storage requirement exists, the data import efficiency and flexibility are improved, and specifically, the template configuration page further comprises a new column header data option; before generating the target import template based on the target column header data in the template configuration page, the method further comprises: generating a column header new request based on configuration operation of the new column header data option; and sending the column header newly-added request to the server so that the server analyzes the column header newly-added request, adds newly-added column header data in the column header newly-added request into the database, and updates the designated column header data in the template configuration page. The newly added column header data option may be a custom output frame, so as to write new column header data in the database, and may also preset a plurality of predicted standby column header data, so as to select new column header data in the database, which is not limited in this embodiment. In order to further meet the requirement of data import, the functions of deleting, modifying, inquiring and the like of the specified column header data can be set in the template configuration page at the same time.
102. And configuring the data corresponding to the data of the target column head in the target import template to obtain a corresponding target import file.
In this embodiment, after the target import template is generated, the user may directly download and write the line data, or write the line data in a region dedicated to displaying the target import template in the template configuration page, which is not limited in this embodiment, only needs to implement configuration of the line data corresponding to the target column header data, so as to complete the data of the target import template, so as to generate the target import file.
103. Uploading the target import file to the server so that the server analyzes the target import file and dynamically generates entity class by utilizing a reflection mechanism to import the line data in the target import file into the database.
It should be noted that, in this embodiment, the server is a server deployed with a corresponding database, after the configuration of the target import file is completed, the target import file needs to be uploaded to the server, and after the server obtains the target import file, the server may parse the target import file to obtain target column header data and corresponding row data therein.
Based on the implementation manner of fig. 1, it can be seen that, in the data import method provided by the present invention, when data needs to be imported, a target import template is first generated based on target column header data in a template configuration page, where the target column header data is all or part of specified column header data selected in the template configuration page, the specified column header data corresponds to existing column header data in a database, then, row data corresponding to the target column header data is configured in the target import template to obtain a corresponding target import file, and finally, the target import file is uploaded to a server, so that the server analyzes the target import file and dynamically generates entity types by using a reflection mechanism to import the row data in the target import file into the database. According to the technical scheme provided by the invention, the template adopted by data import can be generated based on the target column head data selected from the appointed column head data in the template configuration page, and the appointed column head data are all the existing column head data in the database, so that after the configuration file is uploaded to the server, the server can generate the entity class corresponding to the target column head data by utilizing the reflection mechanism, thereby the data can be quickly and accurately imported into the database according to the importing corresponding relation between the entity class and the data table in the database, the importing template can be flexibly configured and expanded, the entity class is dynamically generated without secondary development and online for the entity class in the database when the newly added column head data exists, the flexibility and the efficiency of data import are effectively improved, and further the quick response to the client demand is realized.
Further, the embodiment of the invention also provides another data importing method, by which the data importing is more flexible, and the importing efficiency of the data is improved, so as to quickly respond to the user demand, and the specific implementation steps are as shown in fig. 2, and the method is applied to the server and comprises the following steps:
201. and receiving and analyzing the target import file uploaded by the client to obtain corresponding target column header data and row data.
In this embodiment, the execution body of the present embodiment is a server, and since the target import file is row data configured based on an import template generated from target column header data selected from specified column header data in the client template configuration page, after the client uploads the target import file, the server may parse the target import file to obtain the target column header data and the row data therein, so as to execute the subsequent step 201. It should be further noted that, since the specified column header data in the template configuration page is generated based on the existing column header data in the database and there is a need for newly adding column header data from time to time, in order to meet the requirement of the user for fast importing data, specifically, before receiving and parsing the target import file generated by the target import template configuration, the method further includes: acquiring the existing column header data in a database; and generating a template configuration page by taking the existing column header data as selectable appointed column header data and configurable newly added column header data options, and deploying the template configuration page at the client. The page for configuring the import template is deployed in advance at the client, so that the efficiency and the flexibility of configuring the import template by a user are improved, and the efficiency of data import is further improved.
Further, since the aforementioned data import may not have a need for newly adding column header data, in order to further improve the flexibility and efficiency of configuration of the import template and the efficiency of the server to the data import database, specifically, after the template configuration page is deployed on the client, the method further includes: receiving and analyzing a new column header adding request sent by a client to obtain corresponding new column header adding data; and adding the newly added column header data into a database, and updating the appointed column header data in the template configuration page. The user may perform custom configuration based on the newly added column header data option in the template configuration page, for example, directly write in a new column header field, or pre-configure a predicted alternative column header field, and determine a new column header field based on the selection, which is not limited in this embodiment, but after the newly added column header data option is configured, a column header newly added request sent to the server may be automatically generated, where the newly added column header data of the database to be added is provided, and based on the request, the server may add the parsed newly added column header data to the data table in the database, since only newly added column header data is now available, the row data corresponding to the column header data is not imported together, and in order to quickly respond to the client requirement, the designated column header data in the template configuration page may be automatically updated, that is, the newly added column header data is selected as the designated column header data for the user, so as to configure the import template corresponding to the user requirement.
202. And dynamically generating entity classes corresponding to the target column header data based on the reflection mechanism.
It should be noted that, in this embodiment, in order to be able to more conveniently obtain the existing column header data in the database and import the corresponding row data, an entity class corresponding to the data table in the database needs to be established in the program, so that the extracted or imported data is stored in a list manner, that is, the entity class is a medium for importing the data into the database or from the database, and because the reflection mechanism characteristics, and the target column header data is selected from the existing column header data in the database, the entity class corresponding to the target column header data is dynamically generated based on the reflection mechanism, that is, the row data corresponding to the target column header data can be imported into the database.
Further, since the target import file may directly configure row data in the template configuration page, or may first download the target import template and reconfigure row data, where the later has a certain risk of modifying column header data, once the target column header data in the target import template is modified, the modified target column header data does not correspond to the designated column header data, and further does not correspond to the existing column header data in the database, which may result in a failure or incomplete data import, and in order to avoid the situation that affects the integrity and efficiency of data import, specifically, before dynamically generating the entity class corresponding to the target column header data based on the reflection mechanism, the method includes: judging whether invalid column header data exists in the target column header data based on the existing column header data in the database; if not, dynamically generating entity class corresponding to the target column header data based on a reflection mechanism; if yes, triggering an import prompt instruction, and executing corresponding operation based on the import prompt instruction. The invalid data is target column header data in the imported file and target column header data which does not correspond to existing column header data in the database, namely modified target column header data, the import prompting instruction can be an import missing instruction, namely data corresponding to unmodified target column header data can be imported into the database, so that data import efficiency is improved, or an import failure instruction can be used for directly judging import failure of the target imported file, so that reconfiguration of the target imported file is prompted, integrity of the imported data is guaranteed each time, and the method is not limited.
Further, for the above mentioned triggering of the instruction for guiding and guiding, the specific execution process of executing the corresponding operation based on the instruction for guiding and guiding is as follows: the instruction of the import hint at least comprises one of an import missing instruction and an import failure instruction; specifically, when the import missing instruction is triggered, missing prompt information generated according to the invalid column header data is fed back to the client, and entity classes corresponding to the valid column header data in the target column header data are dynamically generated based on a reflection mechanism, so that row data corresponding to the valid column header data are imported into the database; when the instruction of leading-in failure is triggered, failure prompt information generated according to the invalid column header data is fed back to the client, and the data leading-in operation is stopped. The valid column header data is the target column header data corresponding to the existing column header data in the database in the target import file, namely unmodified target column header data, the import missing instruction can also feed back the modified target column header data to the client, namely, feed back which data are imported, and which data are not imported, so that a user can know the incompleteness of the imported data in time while the import efficiency is ensured, and the import failure instruction can stop executing the data import operation, and feed back the invalid column header data in the whole target import file to the client, namely, ensure the integrity of data import, and ensure the row number corresponding to the invalid column header data in the import failure instruction.
203. And constructing a mapping relation between the entity class and the data, and importing the data into a database by using the mapping relation.
It should be noted that, in this embodiment, since the target column header data has a corresponding relationship with the data, after the entity class is generated, the mapping relationship between the entity class and the data may be directly constructed, so that the data is correspondingly imported into the database by using the mapping relationship, that is, the data may be accurately and quickly imported into the data table of the database.
Based on the implementation of fig. 2, it can be seen that, in the data importing method provided by the present invention, when data is needed to be imported, a target import file uploaded by a client is received and parsed first to obtain corresponding target column header data and row data, then entity classes corresponding to the target column header data are dynamically generated based on a reflection mechanism, finally, a mapping relation between the entity classes and the row data is constructed, and the data is imported into a database corresponding to the row data by using the mapping relation. According to the technical scheme provided by the invention, the target column head data in the target import file can be ensured to correspond to the existing column head data in the database, and the entity class corresponding to the target column head data is generated by utilizing the reflection mechanism, so that the line data is quickly and accurately imported into the database according to the import corresponding relation between the entity class and the data table in the database and the mapping relation between the entity class and the line data, when the newly added column head data exists, the entity class is dynamically generated, the entity class in the database is not required to be developed for the second time, the flexibility and the efficiency of data import are effectively improved, and the quick response to the client requirement is further realized.
Further, as an implementation of the method embodiments shown in fig. 1-2, an embodiment of the present invention provides a data importing apparatus, which is used to make data importing more flexible, and improve data importing efficiency, so as to quickly respond to a user demand. The embodiment of the device corresponds to the foregoing method embodiment, and for convenience of reading, details of the foregoing method embodiment are not described one by one in this embodiment, but it should be clear that the device in this embodiment can correspondingly implement all the details of the foregoing method embodiment. As shown in fig. 3, the device is applied to a client, and includes:
a first generating unit 31, configured to generate a target import template based on target column header data in a template configuration page, where the target column header data is specified column header data for all or part selected in the template configuration page, and the specified column header data corresponds to existing column header data in a database;
a configuration unit 32, configured to configure, in the target import template obtained by the first generation unit 31, a line data corresponding to the target column header data, so as to obtain a corresponding target import file;
and an uploading unit 33, configured to upload the target import file obtained by the configuration unit 32 to a server, so that the server parses the target import file and dynamically generates an entity class by using a reflection mechanism to import the data in the target import file into the database.
Further, as shown in fig. 4, the template configuration page further includes a new column header data option; the apparatus further comprises:
a second generation unit 34 for generating a column header new request based on a configuration operation for the newly added column header data before the first generation unit 31;
a sending unit 35, configured to send the column header new request obtained by the second generating unit 34 to the server, so that the server parses the column header new request, adds new column header data in the column header new request to the database, and updates the specified column header data in the template configuration page.
Further, as an implementation of the method embodiments shown in fig. 1-2, an embodiment of the present invention provides a data importing apparatus, which is used to make data importing more flexible, and improve data importing efficiency, so as to quickly respond to a user demand. The embodiment of the device corresponds to the foregoing method embodiment, and for convenience of reading, details of the foregoing method embodiment are not described one by one in this embodiment, but it should be clear that the device in this embodiment can correspondingly implement all the details of the foregoing method embodiment. As shown in fig. 5, the device is applied to a server, and includes:
a first parsing unit 41, configured to receive and parse the target import file uploaded by the client, so as to obtain corresponding target column header data and data;
a third generating unit 42, configured to dynamically generate, based on a reflection mechanism, an entity class corresponding to the target column header data obtained by the first parsing unit 41;
an importing unit 43, configured to construct a mapping relationship between the entity class and the line data obtained by the third generating unit 42, and import the line data into a database according to the mapping relationship.
Further, as shown in fig. 6, the apparatus further includes:
an obtaining unit 44, configured to obtain the existing column header data in the database before the first parsing unit 41;
a fourth generating unit 45, configured to use the existing column header data obtained by the obtaining unit 44 as selectable specified column header data, and the template configuration page of the configurable newly added column header data option, and deploy the template configuration page to the client.
Further, as shown in fig. 6, the apparatus further includes:
a second parsing unit 46, configured to receive and parse the column header adding request sent by the client after the fourth generating unit 45, so as to obtain corresponding added column header data;
a processing unit 47, configured to add the new column header data obtained by the second parsing unit 46 to the database, and update the specified column header data in the template configuration page.
Further, as shown in fig. 6, the apparatus further includes:
a judging unit 48 for judging whether invalid column header data exists in the target column header data based on existing column header data in the database before the third generating unit 42;
the third generation unit 42, having a processing unit for,
if the judging unit 48 judges that the invalid column header data does not exist in the target column header data, dynamically generating an entity class corresponding to the target column header data based on the reflection mechanism;
and a triggering unit 49, configured to trigger an import hint instruction if the judging unit 48 judges that invalid column header data exists in the target column header data, and execute a corresponding operation based on the import hint instruction.
Further, as shown in fig. 6, the instruction for import hint at least includes one of an instruction for import missing and an instruction for import failure; the triggering unit 49 is provided, in particular,
when the import missing instruction is triggered, missing prompt information generated according to the invalid column header data is fed back to a client, and entity classes corresponding to valid column header data except the invalid column header data in the target column header data are dynamically generated based on the reflection mechanism, so that the data corresponding to the valid column header data are imported into the database;
when the import failure instruction is triggered, failure prompt information generated according to the invalid column header data is fed back to the client, and the data import operation is stopped.
Further, the embodiment of the present invention also provides a data importing system, as shown in fig. 7, which includes a server 51 and a client 52, wherein,
the client 51 may be configured to execute the data import method applied to the client as described in any of the above.
The server 52 may be configured to execute any of the data import methods described above applied to the server when data import is performed. Further, an embodiment of the present invention further provides a storage medium, where the storage medium is configured to store a computer program, where the computer program controls, when running, a device where the storage medium is located to execute the data import method described in fig. 1-2.
Further, an embodiment of the present invention further provides a processor, where the processor is configured to execute a program, where the program executes the data import method described in fig. 1-2.
In the foregoing embodiments, the descriptions of the embodiments are emphasized, and for parts of one embodiment that are not described in detail, reference may be made to related descriptions of other embodiments.
It will be appreciated that the relevant features of the methods, apparatus and systems described above may be referenced to one another. In addition, the "first", "second", and the like in the above embodiments are for distinguishing the embodiments, and do not represent the merits and merits of the embodiments.
It will be clear to those skilled in the art that, for convenience and brevity of description, specific working procedures of the above-described systems, apparatuses and units may refer to corresponding procedures in the foregoing method embodiments, which are not repeated herein.
The algorithms and displays presented herein are not inherently related to any particular computer, virtual system, or other apparatus. Various general-purpose systems may also be used with the teachings herein. The required structure for a construction of such a system is apparent from the description above. In addition, the present invention is not directed to any particular programming language. It will be appreciated that the teachings of the present invention described herein may be implemented in a variety of programming languages, and the above description of specific languages is provided for disclosure of enablement and best mode of the present invention.
Furthermore, the memory may include volatile memory, random Access Memory (RAM) and/or nonvolatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM), in a computer readable medium, the memory including at least one memory chip.
It will be appreciated by those skilled in the art that embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
In one typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include volatile memory in a computer-readable medium, random Access Memory (RAM) and/or nonvolatile memory, etc., such as Read Only Memory (ROM) or flash RAM. Memory is an example of a computer-readable medium.
Computer readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of storage media for a computer include, but are not limited to, phase change memory (PRAM), static Random Access Memory (SRAM), dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), read Only Memory (ROM), electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium, which can be used to store information that can be accessed by a computing device. Computer-readable media, as defined herein, does not include transitory computer-readable media (transmission media), such as modulated data signals and carrier waves.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article or apparatus that comprises an element.
It will be appreciated by those skilled in the art that embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The foregoing is merely exemplary of the present application and is not intended to limit the present application. Various modifications and changes may be made to the present application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc. which are within the spirit and principles of the present application are intended to be included within the scope of the claims of the present application.

Claims (12)

1. A data importing method, applied to a client, the method comprising:
generating a target import template based on target column header data in a template configuration page, wherein the target column header data is all or part of designated column header data selected in the template configuration page, and the designated column header data corresponds to the existing column header data in a database;
configuring data corresponding to the target column header data in the target import template to obtain a corresponding target import file;
uploading the target import file to a server, so that the server analyzes the target import file and dynamically generates entity classes by utilizing a reflection mechanism to import the data in the target import file into the database.
2. The method of claim 1, wherein the template configuration page further comprises a new column header data option; before generating the target import template based on the target column header data in the template configuration page, the method further comprises:
generating a column header new request based on configuration operation of the new column header data option;
and sending the column header adding request to the server so that the server analyzes the column header adding request, adds new column header data in the column header adding request into the database, and updates the appointed column header data in the template configuration page.
3. A data importing method, which is applied to a server, the method comprising:
receiving and analyzing a target import file uploaded by a client to obtain corresponding target column header data and data;
dynamically generating entity classes corresponding to the target column header data based on a reflection mechanism;
and constructing a mapping relation between the entity class and the data, and correspondingly importing the data into a database by utilizing the mapping relation.
4. The method of claim 3, wherein prior to receiving and parsing the target import file generated by the target import template configuration, the method further comprises:
acquiring the existing column header data in the database;
and generating the template configuration page by taking the existing column header data as selectable appointed column header data and configurable newly added column header data options, and deploying the template configuration page at the client.
5. The method of claim 4, wherein after deploying the template configuration page at the client, the method further comprises:
receiving and analyzing a new column header adding request sent by the client to obtain corresponding new column header adding data;
and adding the newly added column header data into the database, and updating the appointed column header data in the template configuration page.
6. A method according to claim 3, comprising, prior to dynamically generating the entity class corresponding to the target column header data based on a reflection mechanism:
judging whether invalid column head data exists in the target column head data or not based on the existing column head data in the database;
if not, dynamically generating entity classes corresponding to the target column header data based on the reflection mechanism;
if yes, triggering an import prompt instruction, and executing corresponding operation based on the import prompt instruction.
7. The method of claim 6, wherein the import hint instruction includes at least one of an import miss instruction and an import fail instruction; triggering an import hint instruction and executing corresponding operations based on the import hint instruction, including:
when the import missing instruction is triggered, missing prompt information generated according to the invalid column header data is fed back to a client, and entity classes corresponding to the valid column header data in the target column header data are dynamically generated based on a reflection mechanism so as to import the data corresponding to the valid column header data into the database;
when the import failure instruction is triggered, failure prompt information generated according to the invalid column header data is fed back to the client, and the data import operation is stopped.
8. A data importing apparatus, applied to a client, the apparatus comprising:
a first generating unit, configured to generate a target import template based on target column header data in a template configuration page, where the target column header data is specified column header data for all or part selected in the template configuration page, and the specified column header data corresponds to existing column header data in a database;
the configuration unit is used for configuring the data corresponding to the target column header data in the target import template obtained by the first generation unit so as to obtain a corresponding target import file;
and the uploading unit is used for uploading the target import file obtained by the configuration unit to a server, so that the server analyzes the target import file and dynamically generates entity class by utilizing a reflection mechanism to import the data in the target import file into the database.
9. A data importing apparatus, applied to a server, the apparatus comprising:
the first analysis unit is used for receiving and analyzing the target import file uploaded by the client to obtain corresponding target column header data and data;
the third generating unit is used for dynamically generating entity classes corresponding to the target column header data obtained by the first analyzing unit based on a reflection mechanism;
and the importing unit is used for constructing the mapping relation between the entity class and the data obtained by the third generating unit and importing the data into a database correspondingly by utilizing the mapping relation.
10. A data importing system is characterized by comprising a client and a server,
the client performs the data import method according to any one of claims 1 to 2 when performing data import;
the server performs the data import method according to any one of claims 3 to 6 when performing data import.
11. A storage medium comprising a stored program, wherein the program, when run, controls a device in which the storage medium is located to perform the data import method according to any one of claims 1 to 2 or claims 3 to 7.
12. A processor, wherein the processor is configured to run a program, wherein the program when run performs the data import method according to any one of claims 1 to 2 or claims 3 to 7.
CN202310272899.1A 2023-03-20 2023-03-20 Data importing method, device and system Pending CN116383221A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310272899.1A CN116383221A (en) 2023-03-20 2023-03-20 Data importing method, device and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310272899.1A CN116383221A (en) 2023-03-20 2023-03-20 Data importing method, device and system

Publications (1)

Publication Number Publication Date
CN116383221A true CN116383221A (en) 2023-07-04

Family

ID=86968593

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310272899.1A Pending CN116383221A (en) 2023-03-20 2023-03-20 Data importing method, device and system

Country Status (1)

Country Link
CN (1) CN116383221A (en)

Similar Documents

Publication Publication Date Title
CN109582563B (en) Test method, device, computer equipment and storage medium for test cases
US20090287643A1 (en) Context based script generation
CN110020353B (en) Method and device for constructing webpage form
CN108459792B (en) Flow switching method and device and computer equipment
CN110704749B (en) Recommendation engine customization system, recommendation method, recommendation system and electronic equipment
CN104423961A (en) Method and system for generating testing script
CN110750415B (en) Interface service configuration method, device, medium and computer equipment
CN110674105A (en) Data backup method, system and server
EP3413149B1 (en) Field device commissioning system and field device commissioning method
CN113296823A (en) Method, device, equipment and storage medium for generating resource configuration file
US20220292056A1 (en) Method and apparatus for modifying file name, and storage medium
CN112306471A (en) Task scheduling method and device
CN112256247B (en) Method, device, computer equipment and storage medium for processing dependence of module assembly
CN104252413A (en) Automatic script generation method, device and system
CN116383221A (en) Data importing method, device and system
CN115174398A (en) Network equipment configuration method, equipment and medium based on python interactive shell
CN114489999A (en) Method and device for processing pipeline task, processor and electronic equipment
CN113486637A (en) Intelligent dynamic custom contract generation method and device
CN110019296B (en) Database query script generation method and device, storage medium and processor
CN111652377A (en) Robot learning method, device and medium based on block chain
CN107948227B (en) Performance optimization method and device of distributed system platform
CN111125565A (en) Method and equipment for inputting information in application
CN117270956B (en) Configuration method of hardware equipment, client, hardware equipment network management system and medium
CN109783756B (en) Website creation method, server and computer readable storage medium
CN114924674B (en) Multi-region column navigation interaction method, device and medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination